Merge remote-tracking branch 'origin/master' into m_tag_ovl

This commit is contained in:
Cuyler36
2024-09-14 09:33:35 -04:00
1284 changed files with 284925 additions and 27376 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ extern void flash_rom_and_player_info_clear() {
bzero(save, sizeof(Save));
mFRm_ClearSaveCheckData(Save_GetPointer(save_check));
priv_p = Save_GetPointer(private[0]);
priv_p = Save_GetPointer(private_data[0]);
for (i = 0; i < PLAYER_NUM; i++) {
mPr_ClearPrivateInfo(priv_p);
priv_p++;
@@ -96,7 +96,7 @@ extern void title_action_data_init_start_select(GAME_PLAY* play) {
mCD_LoadLand();
mCPk_InitPak(0);
Common_Set(now_private, Save_GetPointer(private[0]));
Common_Set(now_private, Save_GetPointer(private_data[0]));
Common_Set(player_no, 0);
mTD_rtc_reserve();
+27 -27
View File
@@ -15,17 +15,17 @@ static void aBTD_actor_dt(ACTOR* actorx, GAME* game);
static void aBTD_actor_move(ACTOR* actorx, GAME* game);
ACTOR_PROFILE Boat_Demo_Profile = {
mAc_PROFILE_BOAT_DEMO,
ACTOR_PART_CONTROL,
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(BOAT_DEMO_ACTOR),
&aBTD_actor_ct,
&aBTD_actor_dt,
&aBTD_actor_move,
mActor_NONE_PROC1,
NULL
mAc_PROFILE_BOAT_DEMO,
ACTOR_PART_CONTROL,
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(BOAT_DEMO_ACTOR),
&aBTD_actor_ct,
&aBTD_actor_dt,
&aBTD_actor_move,
mActor_NONE_PROC1,
NULL,
};
static mDemo_Clip_c aBTD_clip;
@@ -46,28 +46,28 @@ extern u8 aBTD_island_ldr[];
static void aBTD_setupAction(BOAT_DEMO_ACTOR* boat_demo, GAME_PLAY* play, int action);
static void aBTD_actor_ct(ACTOR* actorx, GAME* game) {
BOAT_DEMO_ACTOR* boat_demo = (BOAT_DEMO_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
BOAT_DEMO_ACTOR* boat_demo = (BOAT_DEMO_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
Common_Get(clip).demo_clip2 = &aBTD_clip;
bzero(&aBTD_clip, sizeof(aBTD_clip));
Common_Get(clip).demo_clip2->class = boat_demo;
Common_Get(clip).demo_clip2->type = mDemo_CLIP_TYPE_BOAT_DEMO;
boat_demo->island_gba_loader_p = aBTD_island_ldr;
boat_demo->island_gba_program_p = aBTD_island_prg;
Common_Get(clip).demo_clip2 = &aBTD_clip;
bzero(&aBTD_clip, sizeof(aBTD_clip));
Common_Get(clip).demo_clip2->demo_class = boat_demo;
Common_Get(clip).demo_clip2->type = mDemo_CLIP_TYPE_BOAT_DEMO;
boat_demo->island_gba_loader_p = aBTD_island_ldr;
boat_demo->island_gba_program_p = aBTD_island_prg;
if (mFI_CheckBlockKind(play->block_table.block_x, play->block_table.block_z, mRF_BLOCKKIND_ISLAND) == TRUE) {
boat_demo->at_island = TRUE;
boat_demo->island_npc_info_registered = TRUE;
}
if (mFI_CheckBlockKind(play->block_table.block_x, play->block_table.block_z, mRF_BLOCKKIND_ISLAND) == TRUE) {
boat_demo->at_island = TRUE;
boat_demo->island_npc_info_registered = TRUE;
}
aBTD_setupAction(boat_demo, play, aBTD_ACTION_SENDO_BIRTH_WAIT);
aBTD_setupAction(boat_demo, play, aBTD_ACTION_SENDO_BIRTH_WAIT);
}
static void aBTD_actor_dt(ACTOR* actorx, GAME* game) {
if (Common_Get(clip).demo_clip2 != NULL) {
Common_Get(clip).demo_clip2 = NULL;
}
if (Common_Get(clip).demo_clip2 != NULL) {
Common_Get(clip).demo_clip2 = NULL;
}
}
#include "../src/ac_boat_demo_move.c_inc"
+6 -5
View File
@@ -16,7 +16,8 @@ static void change_FGUnit(ACTOR* actor, int type) {
if (mSN_ClearSnowman(name) == 0) {
int dug = FALSE;
if ((((*name >= BURIED_PITFALL_START) && (*name <= BURIED_PITFALL_END)) || (*name == SHINE_SPOT))) {
if ((((*name >= BURIED_PITFALL_HOLE_START) && (*name <= BURIED_PITFALL_HOLE_END)) ||
(*name == SHINE_SPOT))) {
dug = TRUE;
}
@@ -37,9 +38,9 @@ static void change_FGUnit(ACTOR* actor, int type) {
static void aBRS_set_bgOffset(STRUCTURE_ACTOR* windmill, int idx) {
static mCoBG_OffsetTable_c height_table_ct[9] = {
{0x64, 9, 9, 9, 9, 9, 0}, {0x64, 9, 9, 9, 9, 9, 0}, {0x64, 9, 9, 9, 9, 9, 0},
{0x64, 9, 9, 9, 9, 9, 0}, {0x64, 9, 9, 9, 9, 9, 0}, {0x64, 9, 9, 9, 9, 9, 0},
{0x64, 9, 9, 9, 9, 9, 0}, {0x64, 9, 9, 9, 9, 9, 0}, {0x64, 9, 9, 9, 9, 9, 0},
{ 0x64, 9, 9, 9, 9, 9, 0 }, { 0x64, 9, 9, 9, 9, 9, 0 }, { 0x64, 9, 9, 9, 9, 9, 0 },
{ 0x64, 9, 9, 9, 9, 9, 0 }, { 0x64, 9, 9, 9, 9, 9, 0 }, { 0x64, 9, 9, 9, 9, 9, 0 },
{ 0x64, 9, 9, 9, 9, 9, 0 }, { 0x64, 9, 9, 9, 9, 9, 0 }, { 0x64, 9, 9, 9, 9, 9, 0 },
};
static mCoBG_OffsetTable_c* height_table[2] = {
@@ -182,7 +183,7 @@ static void aBRS_open_wait(STRUCTURE_ACTOR* actor, GAME_PLAY* play) {
if (actor == GET_PLAYER_ACTOR_NOW()->get_door_label_proc(gamePT)) {
aBRS_rewrite_out_data(&actor->actor_class, play);
goto_other_scene(play, &aBRS_br_shop_door_data, 1);
} else if (mPlib_check_player_actor_main_index_OutDoorMove(play) == 0) {
} else if (mPlib_check_player_actor_main_index_OutDoorMove(&play->game) == 0) {
if (aBRS_check_player(&actor->actor_class, play) == 0) {
if (aBRS_open_check(&actor->actor_class) != 2) {
aBRS_setup_action(actor, 2);
+197
View File
@@ -0,0 +1,197 @@
#include "ac_bridge_a.h"
#include "m_common_data.h"
#include "m_name_table.h"
#include "m_field_info.h"
#include "m_player_lib.h"
#include "m_rcp.h"
#include "m_debug.h"
static void aBridgeA_actor_ct(ACTOR* actorx, GAME* game);
static void aBridgeA_actor_dt(ACTOR* actorx, GAME* game);
static void aBridgeA_actor_init(ACTOR* actorx, GAME* game);
static void aBridgeA_actor_move(ACTOR* actorx, GAME* game);
static void aBridgeA_actor_draw(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Bridge_A_Profile = {
mAc_PROFILE_BRIDGE_A,
ACTOR_PART_ITEM,
ACTOR_STATE_TA_SET,
BRIDGE_A0,
ACTOR_OBJ_BANK_KEEP,
sizeof(STRUCTURE_ACTOR),
&aBridgeA_actor_ct,
&aBridgeA_actor_dt,
&aBridgeA_actor_init,
&aBridgeA_actor_draw,
NULL,
};
// clang-format on
static void aBridgeA_set_BgOffset(ACTOR* actorx) {
// clang-format off
static const mCoBG_OffsetTable_c rewrite_data[] = {
{ mCoBG_ATTRIBUTE_31, 4, 4, 4, 4, 4, 0 },
{ mCoBG_ATTRIBUTE_27, 4, 0, 4, 4, 4, 1 },
{ mCoBG_ATTRIBUTE_28, 4, 4, 0, 4, 4, 1 },
{ mCoBG_ATTRIBUTE_29, 4, 4, 4, 0, 4, 1 },
{ mCoBG_ATTRIBUTE_30, 4, 4, 4, 4, 0, 1 },
{ mCoBG_ATTRIBUTE_31, 0, 0, 0, 0, 0, 0 },
};
// clang-format on
static s_xyz unit_offset_a0[] = {
{ 0, 0, 0 }, { 0, 1, -1 }, { -1, 1, 0 }, { 1, 3, 0 }, { 0, 3, 1 }, { 1, 5, -1 }, { -1, 5, 1 },
};
static s_xyz unit_offset_a1[] = {
{ 0, 0, 0 }, { 0, 4, -1 }, { 1, 4, 0 }, { -1, 2, 0 }, { 0, 2, 1 }, { -1, 5, -1 }, { 1, 5, 1 },
};
f32 dist_to_ground = mCoBG_GetBgY_OnlyCenter_FromWpos2(actorx->world.position, 0.0f);
s_xyz* unit_offset = actorx->npc_id == BRIDGE_A0 ? unit_offset_a0 : unit_offset_a1;
int i;
for (i = 0; i < 7; i++) {
xyz_t pos = actorx->world.position;
f32 ut_dist_to_ground;
pos.x += unit_offset[i].x * mFI_UNIT_BASE_SIZE_F;
pos.z += unit_offset[i].z * mFI_UNIT_BASE_SIZE_F;
ut_dist_to_ground = mCoBG_GetBgY_OnlyCenter_FromWpos2(pos, 0.0f);
/* s_xyz->y is repurposed to be the index into 'rewrite_data' array (could be new struct too) */
if (unit_offset[i].y == 5 && ut_dist_to_ground == dist_to_ground) {
mCoBG_SetPluss5PointOffset_file(pos, rewrite_data[0], __FILE__, 217);
} else {
mCoBG_SetPluss5PointOffset_file(pos, rewrite_data[unit_offset[i].y], __FILE__, 220);
}
/* Update all bridge units other than the main item unit */
if (i != 0) {
mFI_SetFG_common(RSV_NO, pos, FALSE);
}
}
}
extern cKF_Skeleton_R_c cKF_bs_r_obj_s_bridgeA;
extern cKF_Skeleton_R_c cKF_bs_r_obj_w_bridgeA;
extern cKF_Animation_R_c cKF_ba_r_obj_s_bridgeA;
extern cKF_Animation_R_c cKF_ba_r_obj_w_bridgeA;
static void aBridgeA_actor_ct(ACTOR* actorx, GAME* game) {
static cKF_Skeleton_R_c* skl[] = { &cKF_bs_r_obj_s_bridgeA, &cKF_bs_r_obj_w_bridgeA };
static cKF_Animation_R_c* anm[] = { &cKF_ba_r_obj_s_bridgeA, &cKF_ba_r_obj_w_bridgeA };
STRUCTURE_ACTOR* bridge = (STRUCTURE_ACTOR*)actorx;
int idx;
if (Common_Get(time).season == mTM_SEASON_WINTER) {
idx = 1;
} else {
idx = 0;
}
bridge->actor_class.world.position.y += 1.5f;
cKF_SkeletonInfo_R_ct(&bridge->keyframe, skl[idx], anm[idx], bridge->work_area, bridge->morph_area);
cKF_SkeletonInfo_R_init_standard_repeat(&bridge->keyframe, anm[idx], NULL);
cKF_SkeletonInfo_R_play(&bridge->keyframe);
if (actorx->npc_id == BRIDGE_A0) {
actorx->shape_info.rotation.y = DEG2SHORT_ANGLE2(0.0f);
} else {
actorx->shape_info.rotation.y = DEG2SHORT_ANGLE2(-90.0f);
}
aBridgeA_set_BgOffset(actorx);
bridge->arg1_f = 0.0f;
bridge->arg0_f = 0.0f;
sAdo_RegistPlussBridge(&actorx->world.position);
}
static void aBridgeA_actor_dt(ACTOR* actorx, GAME* game) {
sAdo_DeletePlussBridge();
}
static f32 aBridge_player_check(STRUCTURE_ACTOR* bridge, GAME_PLAY* play) {
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
xyz_t player_pos = player->actor_class.world.position;
xyz_t bridge_pos = bridge->actor_class.world.position;
xyz_t player_dist_from_bridge;
f32 bridge_run_speed = player->actor_class.speed * (0.75f + (f32)GETREG(TAKREG, 23) * 0.01f);
f32 dist0;
f32 dist1;
xyz_t_sub(&player_pos, &bridge_pos, &player_dist_from_bridge);
if (bridge->actor_class.npc_id == BRIDGE_A1) {
dist0 = player_dist_from_bridge.x - player_dist_from_bridge.z;
dist1 = player_dist_from_bridge.x + player_dist_from_bridge.z;
} else {
dist0 = player_dist_from_bridge.x + player_dist_from_bridge.z;
dist1 = player_dist_from_bridge.x - player_dist_from_bridge.z;
}
if ((dist0 > -mFI_UNIT_BASE_SIZE_F && dist0 < mFI_UNIT_BASE_SIZE_F) &&
(dist1 > -mFI_UNIT_BASE_SIZE_F * 2 && dist1 < mFI_UNIT_BASE_SIZE_F * 2)) {
if (bridge_run_speed > bridge->arg0_f) {
bridge->arg1_f = 1.0f + (f32)GETREG(TAKREG, 20) * 0.01f;
bridge->arg0_f = bridge_run_speed;
} else if (bridge_run_speed > 0.1f) {
add_calc(&bridge->arg0_f, bridge_run_speed, 0.1f + (f32)GETREG(TAKREG, 22) * 0.01f, 0.1f, 0.01f);
add_calc(&bridge->arg1_f, 1.0f, 0.1f + (f32)GETREG(TAKREG, 24) * 0.01f, 0.1f, 0.01f);
return;
}
}
add_calc(&bridge->arg1_f, 0.0f, (0.08f + (f32)GETREG(TAKREG, 21) * 0.01f) * (0.4f + bridge->arg0_f * 0.1f), 0.1f,
0.01f);
}
static void aBridgeA_actor_move(ACTOR* actorx, GAME* game) {
STRUCTURE_ACTOR* bridge = (STRUCTURE_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
aBridge_player_check(bridge, play);
bridge->keyframe.frame_control.speed = bridge->arg0_f * 0.5f;
cKF_SkeletonInfo_R_play(&bridge->keyframe);
if (bridge->arg1_f == 0.0f) {
bridge->arg1_f = 0.0f;
bridge->arg0_f = 0.0f;
bridge->keyframe.frame_control.current_frame = 0.0f;
}
}
static void aBridgeA_actor_init(ACTOR* actorx, GAME* game) {
mFI_SetFG_common(DUMMY_BRIDGE, actorx->home.position, FALSE);
aBridgeA_actor_move(actorx, game);
actorx->mv_proc = &aBridgeA_actor_move;
}
static int aBridgeA_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx, Gfx** joint_shape,
u8* joint_flags, void* arg, s_xyz* joint_rot, xyz_t* joint_pos) {
static s16 base_r_table[] = {
DEG2SHORT_ANGLE2(0.0f), DEG2SHORT_ANGLE2(0.0f), DEG2SHORT_ANGLE2(314.703369f),
DEG2SHORT_ANGLE2(90.296631f), DEG2SHORT_ANGLE2(270.302124f), DEG2SHORT_ANGLE2(44.697876f),
};
STRUCTURE_ACTOR* bridge = (STRUCTURE_ACTOR*)arg;
f32 rot = bridge->arg1_f;
if (joint_idx > 1) {
f32 inv = 1.0f - rot;
joint_rot->z = rot * (f32)joint_rot->z + inv * (f32)base_r_table[joint_idx];
}
return TRUE;
}
static void aBridgeA_actor_draw(ACTOR* actorx, GAME* game) {
STRUCTURE_ACTOR* bridge = (STRUCTURE_ACTOR*)actorx;
Mtx* mtx_p = (Mtx*)GRAPH_ALLOC_TYPE(game->graph, Mtx, bridge->keyframe.skeleton->num_shown_joints);
_texture_z_light_fog_prim(game->graph);
cKF_Si3_draw_R_SV(game, &bridge->keyframe, mtx_p, &aBridgeA_before_disp, NULL, actorx);
}
+7 -10
View File
@@ -34,7 +34,8 @@ static void change_FGUnit(STRUCTURE_ACTOR* buggy, int type) {
if (mSN_ClearSnowman(unit_fg) == FALSE) {
dug = FALSE;
if ((((*unit_fg >= BURIED_PITFALL_START) && (*unit_fg <= BURIED_PITFALL_END)) || (*unit_fg == SHINE_SPOT))) {
if ((((*unit_fg >= BURIED_PITFALL_HOLE_START) && (*unit_fg <= BURIED_PITFALL_HOLE_END)) ||
(*unit_fg == SHINE_SPOT))) {
dug = TRUE;
}
@@ -132,7 +133,8 @@ static int aBGY_check_player2(GAME_PLAY* play) {
y = player->actor_class.world.angle.y;
res = 0;
if ((y > DEG2SHORT_ANGLE2(135.0f)) && (y < DEG2SHORT_ANGLE2(225.0f)) && (player->actor_class.speed > 0.0f)) { // 0x6000 && 0xA000
if ((y > DEG2SHORT_ANGLE2(135.0f)) && (y < DEG2SHORT_ANGLE2(225.0f)) &&
(player->actor_class.speed > 0.0f)) { // 0x6000 && 0xA000
res = 1;
}
@@ -230,7 +232,7 @@ static void aBGY_open_wait(STRUCTURE_ACTOR* buggy, GAME_PLAY* play) {
return;
}
if (mPlib_check_player_actor_main_index_OutDoorMove(play) != FALSE) {
if (mPlib_check_player_actor_main_index_OutDoorMove(&play->game) != FALSE) {
return;
}
@@ -264,12 +266,7 @@ static void aBGY_open_door(STRUCTURE_ACTOR* buggy, GAME_PLAY* play) {
}
static void aBGY_setup_action(STRUCTURE_ACTOR* buggy, int action) {
static aSTR_MOVE_PROC process[] = {
&aBGY_close_wait,
&aBGY_open_wait,
&aBGY_close_door,
&aBGY_open_door
};
static aSTR_MOVE_PROC process[] = { &aBGY_close_wait, &aBGY_open_wait, &aBGY_close_door, &aBGY_open_door };
static cKF_Animation_R_c* animation[] = { &cKF_ba_r_obj_s_uranai, &cKF_ba_r_obj_w_uranai };
static f32 start_idx[] = { 1.0f, 17.0f, 17.0f, 1.0f };
@@ -314,7 +311,7 @@ static void aBGY_actor_move(ACTOR* actor, GAME* game) {
(mDemo_Check(mDemo_TYPE_SCROLL3, &player->actor_class) == FALSE) && ((bx1 != bx2) || (bz1 != bz2))) {
Actor_delete(actor);
} else {
buggy->keyframe_state = cKF_SkeletonInfo_R_play(&buggy->keyframe);
buggy->action_proc(buggy, play);
+2 -2
View File
@@ -15,7 +15,7 @@
static int aDOU_set_check(int house_no) {
int player_no = mHS_get_pl_no(house_no);
Private_c* priv = Save_GetPointer(private[player_no]);
Private_c* priv = Save_GetPointer(private_data[player_no]);
mHm_hs_c* house = Save_GetPointer(homes[house_no]);
if (mEv_CheckTitleDemo() != 0 && mEv_CheckTitleDemo() != -1 && mEv_CheckTitleDemo() != -9) {
@@ -35,7 +35,7 @@ static int aDOU_get_color(int house_no) {
static int aDOU_get_douzou_type(int house_no) {
int player_no = mHS_get_pl_no(house_no);
Private_c* priv = Save_GetPointer(private[player_no]);
Private_c* priv = Save_GetPointer(private_data[player_no]);
s8 sex = mPr_SEX_MALE;
s8 face = mPr_FACE_TYPE0;
+106
View File
@@ -0,0 +1,106 @@
#include "ac_ev_broker.h"
#include "m_common_data.h"
#include "m_player_lib.h"
#include "m_msg.h"
enum {
aEBRK_ACTION_TALK_WAIT,
aEBRK_ACTION_TURN,
aEBRK_ACTION_ENTER,
aEBRK_ACTION_HIDE,
aEBRK_ACTION_NUM
};
static void aEBRK_actor_ct(ACTOR* actorx, GAME* game);
static void aEBRK_actor_dt(ACTOR* actorx, GAME* game);
static void aEBRK_actor_init(ACTOR* actorx, GAME* game);
static void aEBRK_actor_move(ACTOR* actorx, GAME* game);
static void aEBRK_actor_draw(ACTOR* actorx, GAME* game);
static void aEBRK_actor_save(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Ev_Broker_Profile = {
mAc_PROFILE_EV_BROKER,
ACTOR_PART_NPC,
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
SP_NPC_BROKER,
ACTOR_OBJ_BANK_KEEP,
sizeof(EV_BROKER_ACTOR),
&aEBRK_actor_ct,
&aEBRK_actor_dt,
&aEBRK_actor_init,
mActor_NONE_PROC1,
&aEBRK_actor_save,
};
// clang-format on
static void aEBRK_talk_request(ACTOR* actorx, GAME* game);
static int aEBRK_talk_init(ACTOR* actorx, GAME* game);
static int aEBRK_talk_end_chk(ACTOR* actorx, GAME* game);
static void aEBRK_schedule_proc(NPC_ACTOR* npc_actorx, GAME_PLAY* play, int sched_type);
static int aEBRK_get_sell_item_sum(void);
static int aEBRK_check_start_around(ACTOR* actorx, GAME* game);
static void aEBRK_actor_ct(ACTOR* actorx, GAME* game) {
static aNPC_ct_data_c ct_data = {
&aEBRK_actor_move, &aEBRK_actor_draw, 5, &aEBRK_talk_request, &aEBRK_talk_init, &aEBRK_talk_end_chk,
};
EV_BROKER_ACTOR* broker = (EV_BROKER_ACTOR*)actorx;
if (Common_Get(clip).npc_clip->birth_check_proc(actorx, game) == TRUE) {
broker->npc_class.schedule.schedule_proc = &aEBRK_schedule_proc;
Common_Get(clip).npc_clip->ct_proc(actorx, game, &ct_data);
broker->npc_class.actor_class.status_data.weight = 254;
if (aEBRK_get_sell_item_sum() == 0 || aEBRK_check_start_around(actorx, game) == FALSE) {
broker->npc_class.talk_info.talk_request_proc = (aNPC_TALK_REQUEST_PROC)&none_proc1;
broker->next_action = aEBRK_ACTION_HIDE;
} else {
int hide_npc = Common_Get(special_event_common).broker.hide_npc;
broker->npc_class.condition_info.hide_request = hide_npc;
if (hide_npc == TRUE) {
broker->npc_class.talk_info.talk_request_proc = (aNPC_TALK_REQUEST_PROC)&none_proc1;
broker->next_action = aEBRK_ACTION_HIDE;
} else {
broker->next_action = aEBRK_ACTION_TALK_WAIT;
}
}
}
}
static void aEBRK_actor_save(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->save_proc(actorx, game);
}
static void aEBRK_actor_dt(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->dt_proc(actorx, game);
Common_Get(special_event_common).broker.hide_npc = FALSE;
mEv_actor_dying_message(mEv_EVENT_BROKER_SALE, actorx);
}
static void aEBRK_actor_init(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->init_proc(actorx, game);
}
static void aEBRK_set_animation(EV_BROKER_ACTOR* broker, int action) {
static int animeSeqNo[] = {
aNPC_ANIM_WAIT1,
aNPC_ANIM_WALK1,
aNPC_ANIM_WALK1,
aNPC_ANIM_WAIT1,
};
Common_Get(clip).npc_clip->animation_init_proc(&broker->npc_class.actor_class, animeSeqNo[action], FALSE);
}
static void aEBRK_actor_draw(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->draw_proc(actorx, game);
}
#include "../src/ac_ev_broker_move.c_inc"
+303
View File
@@ -0,0 +1,303 @@
static void aEBRK_set_request_act(EV_BROKER_ACTOR* broker) {
broker->npc_class.request.act_priority = 4;
broker->npc_class.request.act_idx = aNPC_ACT_SPECIAL;
broker->npc_class.request.act_type = aNPC_ACT_TYPE_SEARCH;
}
static void aEBRK_set_pl_talk_lock(EV_BROKER_ACTOR* broker, u8 flag) {
if (broker->pl_talk_lock != flag) {
if (flag == TRUE) {
mPlib_Set_able_force_speak_label(&broker->npc_class.actor_class);
} else {
mPlib_Reset_able_force_speak_label();
}
broker->pl_talk_lock = flag;
}
}
static int aEBRK_check_start_around_sub(ACTOR* check_actor, ACTOR* actorx, f32 pos_x, f32 pos_z) {
int res = TRUE;
while (check_actor != NULL) {
if (check_actor != actorx) {
f32 dist_x = check_actor->world.position.x - pos_x;
f32 dist_z = check_actor->world.position.z - pos_z;
if (SQ(dist_x) + SQ(dist_z) < SQ(mFI_UNIT_BASE_SIZE_F)) {
res = FALSE;
break;
}
}
check_actor = check_actor->next_actor;
}
return res;
}
static int aEBRK_check_start_around(ACTOR* actorx, GAME* game) {
static int part[] = { ACTOR_PART_NPC, ACTOR_PART_BG };
f32 pos_x = actorx->world.position.x;
f32 pos_z = actorx->world.position.z;
int i;
int res = TRUE;
for (i = 0; i < ARRAY_COUNT(part); i++) {
if (!aEBRK_check_start_around_sub(((GAME_PLAY*)game)->actor_info.list[part[i]].actor, actorx, pos_x, pos_z)) {
res = FALSE;
break;
}
}
return res;
}
static void aEBRK_check_tent(ACTOR* actorx, GAME* game) {
EV_BROKER_ACTOR* broker = (EV_BROKER_ACTOR*)actorx;
ACTOR* tent_actor = broker->tent_actor;
if (broker->tent_actor == NULL) {
broker->tent_actor =
Actor_info_name_search(&((GAME_PLAY*)game)->actor_info, mAc_PROFILE_BRSHOP, ACTOR_PART_ITEM);
} else if (tent_actor->id != mAc_PROFILE_BRSHOP || (tent_actor->mv_proc == NULL && tent_actor->dw_proc == NULL)) {
Actor_delete(actorx);
}
}
static int aEBRK_get_sell_item_sum(void) {
mActor_name_t* sell_item_p = Save_Get(event_save_data).special.event.broker.items;
int sum = 0;
int i;
for (i = 0; i < ARRAY_COUNT(Save_Get(event_save_data).special.event.broker.items); i++) {
if (*sell_item_p != EMPTY_NO) {
sum++;
}
sell_item_p++;
}
return sum;
}
static int aEBRK_check_pl_list(PersonalID_c* pid, int n) {
int res = -1;
int i;
for (i = 0; i < n; i++) {
if (mPr_CheckCmpPersonalID(pid, &Now_Private->player_ID) == TRUE) {
res = i;
}
pid++;
}
return res;
}
static void aEBRK_talk_wait(EV_BROKER_ACTOR* broker) {
int animeSeqNo = aNPC_ANIM_WAIT1;
if (chase_angle(&broker->npc_class.actor_class.shape_info.rotation.y, DEG2SHORT_ANGLE2(0.0f),
DEG2SHORT_ANGLE2(5.625f)) == FALSE) {
animeSeqNo = aNPC_ANIM_WALK1;
}
broker->npc_class.actor_class.world.angle.y = broker->npc_class.actor_class.shape_info.rotation.y;
if (broker->npc_class.draw.animation_id != animeSeqNo) {
Common_Get(clip).npc_clip->animation_init_proc(&broker->npc_class.actor_class, animeSeqNo, FALSE);
}
}
static void aEBRK_turn(EV_BROKER_ACTOR* broker) {
if (broker->npc_class.actor_class.shape_info.rotation.y == broker->npc_class.movement.mv_angl) {
broker->action_step = aNPC_ACTION_END_STEP;
}
}
static void aEBRK_enter(EV_BROKER_ACTOR* broker) {
ACTOR* actorx = &broker->npc_class.actor_class;
f32 walk_dist = actorx->home.position.z - actorx->world.position.z;
if (walk_dist > 60.0f) {
broker->action_step = aNPC_ACTION_END_STEP;
}
}
static void aEBRK_set_spd_info(EV_BROKER_ACTOR* broker, int action) {
if (action == aEBRK_ACTION_ENTER) {
broker->npc_class.movement.max_speed = 1.0f;
broker->npc_class.movement.acceleration = 0.1f;
broker->npc_class.movement.deceleration = 0.1f;
} else {
broker->npc_class.actor_class.speed = 0.0f;
broker->npc_class.movement.max_speed = 0.0f;
broker->npc_class.movement.acceleration = 0.0f;
broker->npc_class.movement.deceleration = 0.0f;
}
}
static void aEBRK_setupAction(EV_BROKER_ACTOR* broker, int action) {
static aEBRK_ACT_PROC process[] = {
&aEBRK_talk_wait,
&aEBRK_turn,
&aEBRK_enter,
(aEBRK_ACT_PROC)&none_proc1,
};
broker->action_step = 0;
broker->action = action;
broker->action_proc = process[action];
aEBRK_set_animation(broker, action);
aEBRK_set_spd_info(broker, action);
}
static void aEBRK_act_chg_data_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
nactorx->action.act_obj = aNPC_ACT_OBJ_PLAYER;
}
static void aEBRK_act_init_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
EV_BROKER_ACTOR* broker = (EV_BROKER_ACTOR*)nactorx;
nactorx->action.step = 0;
aEBRK_setupAction(broker, broker->next_action);
}
static void aEBRK_act_main_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
EV_BROKER_ACTOR* broker = (EV_BROKER_ACTOR*)nactorx;
(*broker->action_proc)(broker);
}
static void aEBRK_act_proc(NPC_ACTOR* nactorx, GAME_PLAY* play, int proc) {
static aNPC_SUB_PROC act_proc[] = {
&aEBRK_act_init_proc,
&aEBRK_act_chg_data_proc,
&aEBRK_act_main_proc,
};
(*act_proc[proc])(nactorx, play);
}
static void aEBRK_think_main_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
EV_BROKER_ACTOR* broker = (EV_BROKER_ACTOR*)nactorx;
if (nactorx->action.step == aNPC_ACTION_END_STEP) {
aEBRK_set_request_act(broker);
if (nactorx->action.idx == aNPC_ACT_TALK) {
nactorx->movement.mv_angl = DEG2SHORT_ANGLE2(180.0f);
nactorx->movement.mv_add_angl = DEG2SHORT_ANGLE2(11.25f);
broker->next_action = aEBRK_ACTION_TURN;
mPlib_request_main_demo_wait_type1(&play->game, 0, NULL);
}
} else if (broker->action_step == aNPC_ACTION_END_STEP) {
switch (broker->action) {
case aEBRK_ACTION_TURN:
nactorx->condition_info.demo_flg =
aNPC_COND_DEMO_SKIP_ENTRANCE_CHECK | aNPC_COND_DEMO_SKIP_HEAD_LOOKAT |
aNPC_COND_DEMO_SKIP_TALK_CHECK | aNPC_COND_DEMO_SKIP_ITEM | aNPC_COND_DEMO_SKIP_FORWARD_CHECK |
aNPC_COND_DEMO_SKIP_BGCHECK | aNPC_COND_DEMO_SKIP_OBJ_COL_CHECK | aNPC_COND_DEMO_SKIP_MOVE_Y |
aNPC_COND_DEMO_SKIP_MOVE_CIRCLE_REV | aNPC_COND_DEMO_SKIP_MOVE_RANGE_CHECK;
aEBRK_setupAction(broker, aEBRK_ACTION_ENTER);
break;
case aEBRK_ACTION_ENTER:
nactorx->condition_info.hide_request = TRUE;
mPlib_request_main_wait_type3(&play->game);
aEBRK_set_pl_talk_lock(broker, FALSE);
aEBRK_setupAction(broker, aEBRK_ACTION_HIDE);
break;
}
}
}
static void aEBRK_think_init_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
EV_BROKER_ACTOR* broker = (EV_BROKER_ACTOR*)nactorx;
nactorx->think.interrupt_flags = 0;
nactorx->action.act_proc = &aEBRK_act_proc;
aEBRK_set_request_act(broker);
}
static void aEBRK_think_proc(NPC_ACTOR* nactorx, GAME_PLAY* play, int proc) {
static aNPC_SUB_PROC think_proc[] = {
&aEBRK_think_init_proc,
&aEBRK_think_main_proc,
};
(*think_proc[proc])(nactorx, play);
}
static void aEBRK_schedule_init_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
nactorx->think.think_proc = &aEBRK_think_proc;
Common_Get(clip).npc_clip->think_proc(nactorx, play, aNPC_THINK_SPECIAL, 0);
}
static void aEBRK_schedule_main_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
if (!Common_Get(clip).npc_clip->think_proc(nactorx, play, -1, 1)) {
Common_Get(clip).npc_clip->think_proc(nactorx, play, -1, 2);
}
}
static void aEBRK_schedule_proc(NPC_ACTOR* nactorx, GAME_PLAY* play, int proc) {
static aNPC_SUB_PROC sche_proc[] = {
&aEBRK_schedule_init_proc,
&aEBRK_schedule_main_proc,
};
(*sche_proc[proc])(nactorx, play);
}
static void aEBRK_set_talk_info_talk_request(ACTOR* actorx) {
int msg_no;
u8 item_name[mIN_ITEM_NAME_LEN];
mActor_name_t item;
int idx;
idx = aEBRK_check_pl_list(Save_Get(event_save_data).special.event.broker.pid,
ARRAY_COUNT(Save_Get(event_save_data).special.event.broker.pid));
if (idx != -1) {
item = Save_Get(event_save_data).special.event.broker.sold_items[idx];
mIN_copy_name_str(item_name, item);
mMsg_SET_ITEM_STR_ART(mMsg_ITEM_STR2, item_name, mIN_ITEM_NAME_LEN, item);
msg_no = 0x078A;
} else {
idx = aEBRK_check_pl_list(&Common_Get(special_event_common).broker.entered_pid, 1);
if (idx != -1) {
msg_no = 0x0789;
} else {
msg_no = 0x788;
}
}
mDemo_Set_msg_num(msg_no);
aEBRK_set_pl_talk_lock((EV_BROKER_ACTOR*)actorx, TRUE);
}
static void aEBRK_talk_request(ACTOR* actorx, GAME* game) {
mDemo_Request(mDemo_TYPE_TALK, actorx, &aEBRK_set_talk_info_talk_request);
}
static int aEBRK_talk_init(ACTOR* actorx, GAME* game) {
EV_BROKER_ACTOR* broker = (EV_BROKER_ACTOR*)actorx;
broker->npc_class.talk_info.talk_request_proc = (aNPC_TALK_REQUEST_PROC)&none_proc1;
mDemo_Set_ListenAble();
return TRUE;
}
static int aEBRK_talk_end_chk(ACTOR* actorx, GAME* game) {
int res = FALSE;
if (mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE) {
res = TRUE;
}
return res;
}
static void aEBRK_actor_move(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->move_proc(actorx, game);
aEBRK_check_tent(actorx, game);
}
+46 -57
View File
@@ -10,91 +10,80 @@ static void aECST_actor_draw(ACTOR* actorx, GAME* game);
static void aECST_actor_save(ACTOR* actorx, GAME* game);
ACTOR_PROFILE Ev_Castaway_Profile = {
mAc_PROFILE_EV_CASTAWAY,
ACTOR_PART_NPC,
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(EV_CASTAWAY_ACTOR),
&aECST_actor_ct,
&aECST_actor_dt,
&aECST_actor_init,
mActor_NONE_PROC1,
&aECST_actor_save
mAc_PROFILE_EV_CASTAWAY,
ACTOR_PART_NPC,
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(EV_CASTAWAY_ACTOR),
&aECST_actor_ct,
&aECST_actor_dt,
&aECST_actor_init,
mActor_NONE_PROC1,
&aECST_actor_save,
};
static void aECST_schedule_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int type);
static void aECST_actor_ct(ACTOR* actorx, GAME* game) {
static aNPC_ct_data_c ct_data = {
&aECST_actor_move,
&aECST_actor_draw,
5,
NULL,
NULL,
NULL,
0
};
static aNPC_ct_data_c ct_data = { &aECST_actor_move, &aECST_actor_draw, 5, NULL, NULL, NULL, 0 };
static xyz_t def_pos = { 3580.0f, 0.0f, 4670.0f }; // 'G-5' @ 9-4
EV_CASTAWAY_ACTOR* castaway = (EV_CASTAWAY_ACTOR*)actorx;
static xyz_t def_pos = { 3580.0f, 0.0f, 4670.0f }; // 'G-5' @ 9-4
if ((*Common_Get(clip).npc_clip->birth_check_proc)(actorx, game) == TRUE) {
castaway->npc_class.schedule.schedule_proc = &aECST_schedule_proc;
(*Common_Get(clip).npc_clip->ct_proc)(actorx, game, &ct_data);
castaway->npc_class.condition_info.demo_flg = ~aNPC_COND_DEMO_SKIP_MOVE_Y; // is this a mistake?
castaway->npc_class.condition_info.hide_request = FALSE;
castaway->npc_class.palActorIgnoreTimer = -1;
aNPC_SPNPC_BIT_SET(Common_Get(spnpc_first_talk_flags), aNPC_SPNPC_BIT_DOZAEMON);
actorx->status_data.weight = 254;
actorx->gravity = 0.0f;
actorx->max_velocity_y = 0.0f;
actorx->shape_info.rotation.y = DEG2SHORT_ANGLE(68.027344f); // 0x3060
actorx->world.angle.y = DEG2SHORT_ANGLE(68.027344f); // 0x3060
castaway->npc_class.movement.mv_angl = DEG2SHORT_ANGLE(68.027344f); // 0x3060
actorx->world.position = def_pos;
actorx->home.position = def_pos;
}
EV_CASTAWAY_ACTOR* castaway = (EV_CASTAWAY_ACTOR*)actorx;
if ((*Common_Get(clip).npc_clip->birth_check_proc)(actorx, game) == TRUE) {
castaway->npc_class.schedule.schedule_proc = &aECST_schedule_proc;
(*Common_Get(clip).npc_clip->ct_proc)(actorx, game, &ct_data);
castaway->npc_class.condition_info.demo_flg = ~aNPC_COND_DEMO_SKIP_MOVE_Y; // is this a mistake?
castaway->npc_class.condition_info.hide_request = FALSE;
castaway->npc_class.palActorIgnoreTimer = -1;
aNPC_SPNPC_BIT_SET(Common_Get(spnpc_first_talk_flags), aNPC_SPNPC_BIT_DOZAEMON);
actorx->status_data.weight = 254;
actorx->gravity = 0.0f;
actorx->max_velocity_y = 0.0f;
actorx->shape_info.rotation.y = DEG2SHORT_ANGLE(68.027344f); // 0x3060
actorx->world.angle.y = DEG2SHORT_ANGLE(68.027344f); // 0x3060
castaway->npc_class.movement.mv_angl = DEG2SHORT_ANGLE(68.027344f); // 0x3060
actorx->world.position = def_pos;
actorx->home.position = def_pos;
}
}
static void aECST_actor_save(ACTOR* actorx, GAME* game) {
(*Common_Get(clip).npc_clip->save_proc)(actorx, game);
(*Common_Get(clip).npc_clip->save_proc)(actorx, game);
}
static void aECST_actor_dt(ACTOR* actorx, GAME* game) {
(*Common_Get(clip).npc_clip->dt_proc)(actorx, game);
(*Common_Get(clip).npc_clip->dt_proc)(actorx, game);
}
static void aECST_actor_init(ACTOR* actorx, GAME* game) {
(*Common_Get(clip).npc_clip->init_proc)(actorx, game);
(*Common_Get(clip).npc_clip->init_proc)(actorx, game);
}
static void aECST_schedule_main_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
if (actorx->draw.animation_id != 116) {
(*Common_Get(clip).npc_clip->animation_init_proc)((ACTOR*)actorx, 116, 0);
}
if (actorx->draw.animation_id != 116) {
(*Common_Get(clip).npc_clip->animation_init_proc)((ACTOR*)actorx, aNPC_ANIM_GETUP_WAIT_SEG1, 0);
}
}
static void aECST_schedule_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int type) {
static aNPC_SUB_PROC sched_proc[2] = {
(aNPC_SUB_PROC)&none_proc1,
aECST_schedule_main_proc
};
static aNPC_SUB_PROC sched_proc[2] = { (aNPC_SUB_PROC)&none_proc1, aECST_schedule_main_proc };
(*sched_proc[type])(actorx, play);
(*sched_proc[type])(actorx, play);
}
static void aECST_actor_move(ACTOR* actorx, GAME* game) {
EV_CASTAWAY_ACTOR* castaway = (EV_CASTAWAY_ACTOR*)actorx;
s16 cycle = castaway->bobbing_cycle;
EV_CASTAWAY_ACTOR* castaway = (EV_CASTAWAY_ACTOR*)actorx;
s16 cycle = castaway->bobbing_cycle;
cycle += 512;
actorx->position_speed.y = (actorx->home.position.y + 4.0f + sin_s(cycle) * 4.0f) - actorx->world.position.y;
castaway->bobbing_cycle = cycle;
(*Common_Get(clip).npc_clip->move_proc)(actorx, game);
cycle += 512;
actorx->position_speed.y = (actorx->home.position.y + 4.0f + sin_s(cycle) * 4.0f) - actorx->world.position.y;
castaway->bobbing_cycle = cycle;
(*Common_Get(clip).npc_clip->move_proc)(actorx, game);
}
static void aECST_actor_draw(ACTOR* actorx, GAME* game) {
(*Common_Get(clip).npc_clip->draw_proc)(actorx, game);
(*Common_Get(clip).npc_clip->draw_proc)(actorx, game);
}
+200 -271
View File
@@ -1,376 +1,305 @@
static void aEGH_look_player(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
if (ghost->npc_class.action.step == aNPC_ACTION_END_STEP) {
u8 action = 4;
s16 player_y = ghost->npc_class.actor_class.player_angle_y;
s16 rot_y = ghost->npc_class.actor_class.shape_info.rotation.y;
s16 diff = player_y - rot_y;
if (ABS(diff) < DEG2SHORT_ANGLE(67.5f)) {
action = 0;
}
if (ghost->npc_class.action.step == aNPC_ACTION_END_STEP) {
u8 action = 4;
s16 player_y = ghost->npc_class.actor_class.player_angle_y;
s16 rot_y = ghost->npc_class.actor_class.shape_info.rotation.y;
s16 diff = player_y - rot_y;
aEGH_set_request_act(ghost, 4, action, 2, 1, 0, 0);
}
if (ABS(diff) < DEG2SHORT_ANGLE(67.5f)) {
action = 0;
}
aEGH_set_request_act(ghost, 4, action, 2, 1, 0, 0);
}
}
static int aEGH_bitset_func(u16 bit) {
u32 player_no = Common_Get(player_no);
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
u32 player_no = Common_Get(player_no);
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
if (player_no == mPr_FOREIGNER) {
if (ghost_common != NULL) {
ghost_common->flags |= bit;
return TRUE;
if (player_no == mPr_FOREIGNER) {
if (ghost_common != NULL) {
ghost_common->flags |= bit;
return TRUE;
}
} else if (ghost_save != NULL) {
ghost_save->flags |= (u16)(bit << player_no);
return TRUE;
}
}
else if (ghost_save != NULL) {
ghost_save->flags |= (u16)(bit << player_no);
return TRUE;
}
return FALSE;
return FALSE;
}
static int aEGH_bitclr_func(u16 bit) {
u32 player_no = Common_Get(player_no);
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
u32 player_no = Common_Get(player_no);
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
if (player_no == mPr_FOREIGNER) {
if (ghost_common != NULL) {
ghost_common->flags &= ~bit;
return TRUE;
if (player_no == mPr_FOREIGNER) {
if (ghost_common != NULL) {
ghost_common->flags &= ~bit;
return TRUE;
}
} else if (ghost_save != NULL) {
ghost_save->flags &= ~(u16)(bit << player_no);
return TRUE;
}
}
else if (ghost_save != NULL) {
ghost_save->flags &= ~(u16)(bit << player_no);
return TRUE;
}
return FALSE;
return FALSE;
}
static u16 aEGH_bitcheck_func(u16 bit) {
u32 player_no = Common_Get(player_no);
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
u32 player_no = Common_Get(player_no);
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
if (player_no == mPr_FOREIGNER) {
if (ghost_common != NULL) {
return ghost_common->flags & bit;
if (player_no == mPr_FOREIGNER) {
if (ghost_common != NULL) {
return ghost_common->flags & bit;
}
} else if (ghost_save != NULL) {
return (u16)(bit << player_no) & ghost_save->flags;
}
}
else if (ghost_save != NULL) {
return (u16)(bit << player_no) & ghost_save->flags;
}
return FALSE;
return FALSE;
}
static int aEGH_equal_block(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
int bx;
int bz;
int bx;
int bz;
mFI_Wpos2BlockNum(&bx, &bz, GET_PLAYER_ACTOR(play)->actor_class.world.position);
return bx == ghost->npc_class.actor_class.block_x && bz == ghost->npc_class.actor_class.block_z;
mFI_Wpos2BlockNum(&bx, &bz, GET_PLAYER_ACTOR(play)->actor_class.world.position);
return bx == ghost->npc_class.actor_class.block_x && bz == ghost->npc_class.actor_class.block_z;
}
static int aEGH_time_over() {
return Common_Get(time.now_sec) > (4 * mTM_SECONDS_IN_HOUR);
return Common_Get(time.now_sec) > (4 * mTM_SECONDS_IN_HOUR);
}
static void aEGH_byebye_check(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
ACTOR* actorx = (ACTOR*)ghost;
ACTOR* actorx = (ACTOR*)ghost;
if (
mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE &&
mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE &&
aEGH_time_over() != FALSE
) {
if (aEGH_equal_block(ghost, play)) {
switch (ghost->think_act) {
case aEGH_THINK_SPEAK:
{
aEGH_setup_think_proc(ghost, play, aEGH_THINK_BYEBYE);
ghost->msg_no = 0x2EDD;
ghost->npc_class.actor_class.talk_distance = 1000.0f;
ghost->_9AA = 1;
break;
}
if (mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE && mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE &&
aEGH_time_over() != FALSE) {
if (aEGH_equal_block(ghost, play)) {
switch (ghost->think_act) {
case aEGH_THINK_SPEAK: {
aEGH_setup_think_proc(ghost, play, aEGH_THINK_BYEBYE);
ghost->msg_no = 0x2EDD;
ghost->npc_class.actor_class.talk_distance = 1000.0f;
ghost->_9AA = 1;
break;
}
case aEGH_THINK_NORMAL_WAIT:
case aEGH_THINK_IRAI_AF:
case aEGH_THINK_BYE:
case aEGH_THINK_WELCOM:
{
Actor_delete((ACTOR*)ghost);
break;
case aEGH_THINK_NORMAL_WAIT:
case aEGH_THINK_IRAI_AF:
case aEGH_THINK_BYE:
case aEGH_THINK_WELCOM: {
Actor_delete((ACTOR*)ghost);
break;
}
}
} else {
aEGH_setup_think_proc(ghost, play, aEGH_THINK_IRAI);
}
}
}
else {
aEGH_setup_think_proc(ghost, play, aEGH_THINK_IRAI);
}
}
}
static void aEGH_irai(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
if (ghost->npc_class.actor_class.player_distance_xz > 220.0f) {
aEGH_setup_think_proc(ghost, play, aEGH_THINK_BYE);
}
if (ghost->npc_class.actor_class.player_distance_xz > 220.0f) {
aEGH_setup_think_proc(ghost, play, aEGH_THINK_BYE);
}
}
static void aEGH_bye(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
if (ghost->npc_class.actor_class.player_distance_xz < 200.0f) {
aEGH_setup_think_proc(ghost, play, aEGH_THINK_WELCOM);
}
if (ghost->npc_class.actor_class.player_distance_xz < 200.0f) {
aEGH_setup_think_proc(ghost, play, aEGH_THINK_WELCOM);
}
}
static void aEGH_byebye(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
if (ghost->alpha == 0) {
Actor_delete((ACTOR*)ghost);
}
else {
if (ghost->bye_bye_timer != 0) {
ghost->bye_bye_timer--;
if (ghost->alpha == 0) {
Actor_delete((ACTOR*)ghost);
} else {
if (ghost->bye_bye_timer != 0) {
ghost->bye_bye_timer--;
if (ghost->bye_bye_timer == 0) {
sAdo_SysTrgStart(0x16C);
}
}
else {
if (ghost->bye_bye_angle < 30000) {
ghost->bye_bye_angle += 60;
}
if (ghost->bye_bye_timer == 0) {
sAdo_SysTrgStart(0x16C);
}
} else {
if (ghost->bye_bye_angle < 30000) {
ghost->bye_bye_angle += 60;
}
ghost->npc_class.actor_class.shape_info.rotation.y += ghost->bye_bye_angle;
ghost->npc_class.actor_class.world.angle.y = ghost->npc_class.actor_class.shape_info.rotation.y;
ghost->npc_class.movement.mv_angl = ghost->npc_class.actor_class.world.angle.y;
ghost->npc_class.movement.mv_add_angl = 0;
}
ghost->npc_class.actor_class.shape_info.rotation.y += ghost->bye_bye_angle;
ghost->npc_class.actor_class.world.angle.y = ghost->npc_class.actor_class.shape_info.rotation.y;
ghost->npc_class.movement.mv_angl = ghost->npc_class.actor_class.world.angle.y;
ghost->npc_class.movement.mv_add_angl = 0;
}
if (ghost->bye_bye_scale_timer != 0) {
ghost->bye_bye_scale_timer--;
if (ghost->bye_bye_scale_timer != 0) {
ghost->bye_bye_scale_timer--;
} else {
ghost->npc_class.actor_class.scale.x += -0.00004f;
ghost->npc_class.actor_class.scale.z = ghost->npc_class.actor_class.scale.x;
}
}
else {
ghost->npc_class.actor_class.scale.x += -0.00004f;
ghost->npc_class.actor_class.scale.z = ghost->npc_class.actor_class.scale.x;
}
}
}
static void aEGH_speak_byebye(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
ACTOR* actorx = (ACTOR*)ghost;
ACTOR* actorx = (ACTOR*)ghost;
if (
mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE &&
mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE &&
aEGH_equal_block(ghost, play) == FALSE
) {
aEGH_setup_think_proc(ghost, play, aEGH_THINK_IRAI);
}
if (mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE && mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE &&
aEGH_equal_block(ghost, play) == FALSE) {
aEGH_setup_think_proc(ghost, play, aEGH_THINK_IRAI);
}
}
static void aEGH_think_main_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
EV_GHOST_ACTOR* ghost = (EV_GHOST_ACTOR*)actorx;
EV_GHOST_ACTOR* ghost = (EV_GHOST_ACTOR*)actorx;
(*ghost->think_proc)(ghost, play);
aEGH_look_player(ghost, play);
(*ghost->think_proc)(ghost, play);
aEGH_look_player(ghost, play);
}
static void aEGH_think_init_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
EV_GHOST_ACTOR* ghost = (EV_GHOST_ACTOR*)actorx;
u8 think_act;
EV_GHOST_ACTOR* ghost = (EV_GHOST_ACTOR*)actorx;
u8 think_act;
if (ghost->_9AC) {
ghost->_9AC = FALSE;
}
else {
if (aEGH_bitcheck_func(aEGH_BIT_FOUND_GHOST)) {
ghost->alpha = 140;
think_act = aEGH_THINK_SPEAK;
}
else {
ghost->alpha = 0;
think_act = aEGH_THINK_IRAI_AF;
}
if (ghost->_9AC) {
ghost->_9AC = FALSE;
} else {
if (aEGH_bitcheck_func(aEGH_BIT_FOUND_GHOST)) {
ghost->alpha = 140;
think_act = aEGH_THINK_SPEAK;
} else {
ghost->alpha = 0;
think_act = aEGH_THINK_IRAI_AF;
}
actorx->actor_class.status_data.weight = 255;
actorx->condition_info.hide_request = FALSE;
aEGH_setup_think_proc(ghost, play, think_act);
actorx->condition_info.demo_flg = aNPC_COND_DEMO_SKIP_FOOTSTEPS_VFX |
aNPC_COND_DEMO_SKIP_FEEL_CHECK |
aNPC_COND_DEMO_SKIP_FOOTSTEPS |
aNPC_COND_DEMO_SKIP_ENTRANCE_CHECK |
aNPC_COND_DEMO_SKIP_HEAD_LOOKAT;
}
actorx->actor_class.status_data.weight = 255;
actorx->condition_info.hide_request = FALSE;
aEGH_setup_think_proc(ghost, play, think_act);
actorx->condition_info.demo_flg = aNPC_COND_DEMO_SKIP_FOOTSTEPS_VFX | aNPC_COND_DEMO_SKIP_FEEL_CHECK |
aNPC_COND_DEMO_SKIP_FOOTSTEPS | aNPC_COND_DEMO_SKIP_ENTRANCE_CHECK |
aNPC_COND_DEMO_SKIP_HEAD_LOOKAT;
}
}
static void aEGH_normal_wait_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
(*Common_Get(clip).npc_clip->animation_init_proc)((ACTOR*)ghost, 126, FALSE);
ghost->npc_class.draw.main_animation.keyframe.frame_control.mode = cKF_FRAMECONTROL_REPEAT;
ghost->npc_class.action.idx = 0;
aEGH_set_request_act(ghost, 4, 0, 0, 0, 0, 0);
(*Common_Get(clip).npc_clip->animation_init_proc)((ACTOR*)ghost, aNPC_ANIM_GSTWAIT1, FALSE);
ghost->npc_class.draw.main_animation.keyframe.frame_control.mode = cKF_FRAMECONTROL_REPEAT;
ghost->npc_class.action.idx = 0;
aEGH_set_request_act(ghost, 4, 0, 0, 0, 0, 0);
}
static void aEGH_irai_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
ghost->npc_class.actor_class.talk_distance = 80.0f;
aEGH_normal_wait_init(ghost, play);
ghost->msg_no = 0x2EE2;
ghost->npc_class.actor_class.talk_distance = 80.0f;
aEGH_normal_wait_init(ghost, play);
ghost->msg_no = 0x2EE2;
}
static void aEGH_irai_af_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
ghost->npc_class.actor_class.talk_distance = 55.0f;
ghost->msg_no = 0x2EE7;
(*Common_Get(clip).npc_clip->chg_schedule_proc)((NPC_ACTOR*)ghost, play, 5);
ghost->npc_class.actor_class.status_data.weight = 80;
ghost->npc_class.actor_class.talk_distance = 55.0f;
ghost->msg_no = 0x2EE7;
(*Common_Get(clip).npc_clip->chg_schedule_proc)((NPC_ACTOR*)ghost, play, 5);
ghost->npc_class.actor_class.status_data.weight = 80;
}
static void aEGH_bye_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
ghost->npc_class.actor_class.talk_distance = 280.0f;
aEGH_normal_wait_init(ghost, play);
ghost->msg_no = 0x2ED8;
ghost->npc_class.actor_class.talk_distance = 280.0f;
aEGH_normal_wait_init(ghost, play);
ghost->msg_no = 0x2ED8;
}
static void aEGH_welcom_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
ghost->npc_class.actor_class.talk_distance = 200.0f;
aEGH_normal_wait_init(ghost, play);
ghost->msg_no = 0x2ED3;
ghost->npc_class.actor_class.talk_distance = 200.0f;
aEGH_normal_wait_init(ghost, play);
ghost->msg_no = 0x2ED3;
}
static void aEGH_byebye_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
aEGH_bitclr_func(aEGH_BIT_FOUND_GHOST);
ghost->bye_bye_angle = -1000;
ghost->bye_bye_timer = 25;
ghost->bye_bye_scale_timer = 48;
ghost->bye_bye_transparency_delay_timer = 43;
aEGH_normal_wait_init(ghost, play);
ghost->npc_class.head.lock_flag = TRUE;
aEGH_bitclr_func(aEGH_BIT_FOUND_GHOST);
ghost->bye_bye_angle = -1000;
ghost->bye_bye_timer = 25;
ghost->bye_bye_scale_timer = 48;
ghost->bye_bye_transparency_delay_timer = 43;
aEGH_normal_wait_init(ghost, play);
ghost->npc_class.head.lock_flag = TRUE;
}
static aEGH_setup_c dt_tbl[aEGH_THINK_NUM] = {
{
aEGH_THINK_PROC_BYE,
aEGH_THINK_INIT_NORMAL_WAIT,
aEGH_TALK_REQUEST_NONE,
aEGH_TALK_END_WAIT,
aEGH_THINK_NORMAL_WAIT
},
{
aEGH_THINK_PROC_BYEBYE,
aEGH_THINK_INIT_BYEBYE,
aEGH_TALK_REQUEST_NONE,
aEGH_TALK_END_WAIT,
aEGH_THINK_IRAI
},
{ aEGH_THINK_PROC_BYE, aEGH_THINK_INIT_NORMAL_WAIT, aEGH_TALK_REQUEST_NONE, aEGH_TALK_END_WAIT,
aEGH_THINK_NORMAL_WAIT },
{ aEGH_THINK_PROC_BYEBYE, aEGH_THINK_INIT_BYEBYE, aEGH_TALK_REQUEST_NONE, aEGH_TALK_END_WAIT, aEGH_THINK_IRAI },
{
aEGH_THINK_PROC_NONE,
aEGH_THINK_INIT_WELCOM,
aEGH_TALK_REQUEST_FORCE,
aEGH_TALK_END_WAIT,
aEGH_THINK_WELCOM
},
{ aEGH_THINK_PROC_NONE, aEGH_THINK_INIT_WELCOM, aEGH_TALK_REQUEST_FORCE, aEGH_TALK_END_WAIT, aEGH_THINK_WELCOM },
{
aEGH_THINK_PROC_BYE,
aEGH_THINK_INIT_BYE,
aEGH_TALK_REQUEST_FORCE,
aEGH_TALK_GIVE_ME_WAIT,
aEGH_THINK_NORMAL_WAIT
},
{ aEGH_THINK_PROC_BYE, aEGH_THINK_INIT_BYE, aEGH_TALK_REQUEST_FORCE, aEGH_TALK_GIVE_ME_WAIT,
aEGH_THINK_NORMAL_WAIT },
{
aEGH_THINK_PROC_IRAI,
aEGH_THINK_INIT_IRAI,
aEGH_TALK_REQUEST_FORCE,
aEGH_TALK_SELECT_WAIT,
aEGH_THINK_SPEAK
},
{ aEGH_THINK_PROC_IRAI, aEGH_THINK_INIT_IRAI, aEGH_TALK_REQUEST_FORCE, aEGH_TALK_SELECT_WAIT, aEGH_THINK_SPEAK },
{
aEGH_THINK_PROC_SPEAK_BYEBYE,
aEGH_THINK_INIT_NORMAL_WAIT,
aEGH_TALK_REQUEST_FORCE,
aEGH_TALK_SELECT_ROOF,
aEGH_THINK_IRAI
},
{ aEGH_THINK_PROC_SPEAK_BYEBYE, aEGH_THINK_INIT_NORMAL_WAIT, aEGH_TALK_REQUEST_FORCE, aEGH_TALK_SELECT_ROOF,
aEGH_THINK_IRAI },
{
aEGH_THINK_PROC_NONE,
aEGH_THINK_INIT_IRAI_AF,
aEGH_TALK_REQUEST_NORM,
aEGH_TALK_END_WAIT,
aEGH_THINK_SPEAK
}
{ aEGH_THINK_PROC_NONE, aEGH_THINK_INIT_IRAI_AF, aEGH_TALK_REQUEST_NORM, aEGH_TALK_END_WAIT, aEGH_THINK_SPEAK }
};
static aEGH_PROC proc_table[aEGH_THINK_PROC_NUM] = {
(aEGH_PROC)&none_proc1,
&aEGH_irai,
&aEGH_bye,
&aEGH_byebye,
&aEGH_speak_byebye
};
static aEGH_PROC proc_table[aEGH_THINK_PROC_NUM] = { (aEGH_PROC)&none_proc1, &aEGH_irai, &aEGH_bye, &aEGH_byebye,
&aEGH_speak_byebye };
static aEGH_PROC init_table[aEGH_THINK_INIT_NUM] = {
(aEGH_PROC)&none_proc1,
&aEGH_normal_wait_init,
&aEGH_irai_init,
&aEGH_irai_af_init,
&aEGH_bye_init,
&aEGH_welcom_init,
&aEGH_byebye_init
};
static aEGH_PROC init_table[aEGH_THINK_INIT_NUM] = { (aEGH_PROC)&none_proc1, &aEGH_normal_wait_init, &aEGH_irai_init,
&aEGH_irai_af_init, &aEGH_bye_init, &aEGH_welcom_init,
&aEGH_byebye_init };
static void aEGH_setup_think_proc(EV_GHOST_ACTOR* ghost, GAME_PLAY* play, u8 think_act) {
static aNPC_TALK_REQUEST_PROC talk_request_table[aEGH_TALK_REQUEST_NUM] = {
(aNPC_TALK_REQUEST_PROC)&none_proc1,
&aEGH_norm_talk_request,
&aEGH_force_talk_request
};
aEGH_setup_c* data = &dt_tbl[think_act];
static aNPC_TALK_REQUEST_PROC talk_request_table[aEGH_TALK_REQUEST_NUM] = { (aNPC_TALK_REQUEST_PROC)&none_proc1,
&aEGH_norm_talk_request,
&aEGH_force_talk_request };
ghost->think_act = think_act;
ghost->think_proc = proc_table[data->think_proc];
ghost->npc_class.talk_info.talk_request_proc = talk_request_table[data->talk_request_proc];
ghost->talk_act = data->talk_act;
ghost->after_talk_think_act = data->talk_after_act;
(*init_table[data->think_init_proc])(ghost, play);
ghost->_9A7 = TRUE;
aEGH_setup_c* data = &dt_tbl[think_act];
ghost->think_act = think_act;
ghost->think_proc = proc_table[data->think_proc];
ghost->npc_class.talk_info.talk_request_proc = talk_request_table[data->talk_request_proc];
ghost->talk_act = data->talk_act;
ghost->after_talk_think_act = data->talk_after_act;
(*init_table[data->think_init_proc])(ghost, play);
ghost->_9A7 = TRUE;
}
static void aEGH_think_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int think_type) {
switch (think_type) {
case 0:
aEGH_think_init_proc(actorx, play);
break;
case 1:
aEGH_think_main_proc(actorx, play);
break;
}
switch (think_type) {
case 0:
aEGH_think_init_proc(actorx, play);
break;
case 1:
aEGH_think_main_proc(actorx, play);
break;
}
}
static void aEGH_schedule_init_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
actorx->think.think_proc = &aEGH_think_proc;
(*Common_Get(clip).npc_clip->think_proc)(actorx, play, aNPC_THINK_SPECIAL, 0);
actorx->think.think_proc = &aEGH_think_proc;
(*Common_Get(clip).npc_clip->think_proc)(actorx, play, aNPC_THINK_SPECIAL, 0);
}
static void aEGH_schedule_main_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
if ((*Common_Get(clip).npc_clip->think_proc)(actorx, play, -1, 1) == FALSE) {
(*Common_Get(clip).npc_clip->think_proc)(actorx, play, -1, 2);
}
if ((*Common_Get(clip).npc_clip->think_proc)(actorx, play, -1, 1) == FALSE) {
(*Common_Get(clip).npc_clip->think_proc)(actorx, play, -1, 2);
}
}
static void aEGH_schedule_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int sched_type) {
switch (sched_type) {
case 0:
aEGH_schedule_init_proc(actorx, play);
break;
case 1:
aEGH_schedule_main_proc(actorx, play);
break;
}
switch (sched_type) {
case 0:
aEGH_schedule_init_proc(actorx, play);
break;
case 1:
aEGH_schedule_main_proc(actorx, play);
break;
}
}
+24 -38
View File
@@ -9,17 +9,10 @@ extern void aEMJ_actor_init(ACTOR*, GAME*);
extern void aEMJ_actor_save(ACTOR*, GAME*);
ACTOR_PROFILE Ev_Majin_Profile = {
mAc_PROFILE_EV_MAJIN,
ACTOR_PART_NPC,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
SP_NPC_EV_MAJIN,
ACTOR_OBJ_BANK_KEEP,
sizeof(EV_NPCMAJIN_ACTOR),
aEMJ_actor_ct,
aEMJ_actor_dt,
aEMJ_actor_init,
NONE_ACTOR_PROC,
aEMJ_actor_save,
mAc_PROFILE_EV_MAJIN, ACTOR_PART_NPC, ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
SP_NPC_EV_MAJIN, ACTOR_OBJ_BANK_KEEP, sizeof(EV_NPCMAJIN_ACTOR),
aEMJ_actor_ct, aEMJ_actor_dt, aEMJ_actor_init,
NONE_ACTOR_PROC, aEMJ_actor_save,
};
extern void aEMJ_actor_move(ACTOR*, GAME*);
@@ -31,57 +24,50 @@ static void aEMJ_schedule_proc(NPC_ACTOR*, GAME_PLAY*, int);
void aEMJ_actor_ct(ACTOR* actor, GAME* game) {
static aNPC_ct_data_c ct_data = {
&aEMJ_actor_move,
&aEMJ_actor_draw,
5,
mActor_NONE_PROC1,
&aEMJ_talk_init,
&aEMJ_talk_end_chk,
0,
&aEMJ_actor_move, &aEMJ_actor_draw, 5, mActor_NONE_PROC1, &aEMJ_talk_init, &aEMJ_talk_end_chk, 0,
};
EV_NPCMAJIN_ACTOR* majin = (EV_NPCMAJIN_ACTOR*)actor;
if(Common_Get(clip.npc_clip)->birth_check_proc(actor,game) == TRUE){
if (Common_Get(clip.npc_clip)->birth_check_proc(actor, game) == TRUE) {
majin->npc_class.schedule.schedule_proc = aEMJ_schedule_proc;
Common_Get(clip.npc_clip)->ct_proc(actor,game,&ct_data);
Common_Get(clip.npc_clip)->ct_proc(actor, game, &ct_data);
majin->npc_class.head.lock_flag = 1;
majin->npc_class.talk_info.default_turn_animation = 0x4E;
majin->npc_class.talk_info.default_animation = 0x4E;
majin->npc_class.talk_info.default_turn_animation = aNPC_ANIM_WAIT_R1;
majin->npc_class.talk_info.default_animation = aNPC_ANIM_WAIT_R1;
majin->npc_class.talk_info.turn = 2;
}
}
void aEMJ_actor_save(ACTOR* actor, GAME* game) {
Common_Get(clip.npc_clip)->save_proc(actor,game);
Common_Get(clip.npc_clip)->save_proc(actor, game);
}
void aEMJ_actor_dt(ACTOR* actor, GAME* game) {
if(Common_Get(clip.groundhog_control_clip) != NULL){
if (Common_Get(clip.groundhog_control_clip) != NULL) {
Common_Get(clip.groundhog_control_clip)->groundhog_npc_actor = NULL;
}
Common_Get(clip.npc_clip)->dt_proc(actor,game);
Common_Get(clip.effect_clip)->effect_kill_proc(0x5D, 0xFFFF);
Common_Get(clip.npc_clip)->dt_proc(actor, game);
Common_Get(clip.effect_clip)->effect_kill_proc(eEC_EFFECT_RESET_HOLE, RSV_NO);
}
void aEMJ_actor_init(ACTOR* actor, GAME* game) {
Common_Get(clip.npc_clip)->init_proc(actor,game);
Common_Get(clip.npc_clip)->init_proc(actor, game);
}
void aEMJ_set_animation(ACTOR* actor, int idx){
static s16 animeSeqNo[] = {79,78,80};
Common_Get(clip.npc_clip)->animation_init_proc(actor,animeSeqNo[idx],0);
void aEMJ_set_animation(ACTOR* actor, int idx) {
static s16 animeSeqNo[] = { aNPC_ANIM_APPEAR1, aNPC_ANIM_WAIT_R1, aNPC_ANIM_GO_UG1 };
Common_Get(clip.npc_clip)->animation_init_proc(actor, animeSeqNo[idx], 0);
}
void aEMJ_actor_move(ACTOR* actor, GAME* game){
Common_Get(clip.npc_clip)->move_proc(actor,game);
void aEMJ_actor_move(ACTOR* actor, GAME* game) {
Common_Get(clip.npc_clip)->move_proc(actor, game);
actor->shape_info.draw_shadow = 0;
}
void aEMJ_actor_draw(ACTOR* actor, GAME* game) {
Common_Get(clip.npc_clip)->draw_proc(actor,game);
Common_Get(clip.npc_clip)->draw_proc(actor, game);
}
#include "../src/ac_ev_majin_move.c_inc"
#include "../src/ac_ev_majin_move.c_inc"
+10 -10
View File
@@ -18,8 +18,8 @@ void aEMJ_act_init_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
}
void aEMJ_act_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
static aNPC_SUB_PROC act_proc[] = {aEMJ_act_init_proc, (aNPC_SUB_PROC)mActor_NONE_PROC1,
(aNPC_SUB_PROC)mActor_NONE_PROC1};
static aNPC_SUB_PROC act_proc[] = { aEMJ_act_init_proc, (aNPC_SUB_PROC)mActor_NONE_PROC1,
(aNPC_SUB_PROC)mActor_NONE_PROC1 };
act_proc[idx](actor, play);
}
@@ -27,13 +27,13 @@ void aEMJ_act_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
void aEMJ_appear(NPC_ACTOR* actor, GAME_PLAY* play) {
EV_NPCMAJIN_ACTOR* majin = (EV_NPCMAJIN_ACTOR*)actor;
if (majin->npc_class.draw._04 == 1) {
if (majin->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
aEMJ_setup_think_proc(actor, 1);
}
}
void aEMJ_retire(NPC_ACTOR* actor, GAME_PLAY* play) {
if (actor->draw._04 == 1) {
if (actor->draw.main_animation_state == cKF_STATE_STOPPED) {
((NPC_ACTOR*)(actor->actor_class.parent_actor))->npc_info.animal = (Animal_c*)1;
Actor_delete(&actor->actor_class);
}
@@ -64,9 +64,9 @@ void aEMJ_think_init_proc(ACTOR* actor, GAME* game) {
void aEMJ_setup_think_proc(NPC_ACTOR* actor, int idx) {
static NPC_DT_PROCS dt_tbl[] = {
{aEMJ_appear, (aNPC_SUB_PROC)none_proc1},
{(aNPC_SUB_PROC)none_proc1, aEMJ_force_talk_request},
{aEMJ_retire, (aNPC_SUB_PROC)none_proc1},
{ aEMJ_appear, (aNPC_SUB_PROC)none_proc1 },
{ (aNPC_SUB_PROC)none_proc1, aEMJ_force_talk_request },
{ aEMJ_retire, (aNPC_SUB_PROC)none_proc1 },
};
EV_NPCMAJIN_ACTOR* majin = (EV_NPCMAJIN_ACTOR*)actor;
@@ -106,7 +106,7 @@ void aEMJ_schedule_main_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
}
void aEMJ_schedule_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
static aNPC_SUB_PROC sche_proc[] = {aEMJ_schedule_init_proc, aEMJ_schedule_main_proc};
static aNPC_SUB_PROC sche_proc[] = { aEMJ_schedule_init_proc, aEMJ_schedule_main_proc };
sche_proc[idx](actor, play);
}
@@ -132,8 +132,8 @@ void aEMJ_set_force_talk_info() {
mDemo_Set_msg_num(msg_num);
}
void aEMJ_force_talk_request(NPC_ACTOR* actor, GAME_PLAY* play) {
mDemo_Request(10, &actor->actor_class, aEMJ_set_force_talk_info);
void aEMJ_force_talk_request(NPC_ACTOR* actor, GAME_PLAY* play) {
mDemo_Request(10, &actor->actor_class, aEMJ_set_force_talk_info);
}
int aEMJ_talk_init(ACTOR* actor, GAME* play) {
+55
View File
@@ -0,0 +1,55 @@
typedef struct gyoei_type_s {
short size;
short search_area;
int bite_time;
} aGYO_type_c;
// clang-format off
static aGYO_type_c gyoei_type[] = {
{ 1, 3, 4 }, // aSOG_FISH_TYPE_CRUCIAN_CARP
{ 2, 3, 2 }, // aSOG_FISH_TYPE_BROOK_TROUT
{ 4, 2, 3 }, // aSOG_FISH_TYPE_CARP
{ 4, 2, 3 }, // aSOG_FISH_TYPE_KOI
{ 4, 3, 4 }, // aSOG_FISH_TYPE_CATFISH
{ 1, 3, 3 }, // aSOG_FISH_TYPE_SMALL_BASS
{ 3, 2, 2 }, // aSOG_FISH_TYPE_BASS
{ 4, 1, 1 }, // aSOG_FISH_TYPE_LARGE_BASS
{ 1, 4, 4 }, // aSOG_FISH_TYPE_BLUEGILL
{ 5, 2, 4 }, // aSOG_FISH_TYPE_GIANT_CATFISH
{ 5, 2, 1 }, // aSOG_FISH_TYPE_GIANT_SNAKEHEAD
{ 4, 2, 3 }, // aSOG_FISH_TYPE_BARBEL_STEED
{ 3, 3, 3 }, // aSOG_FISH_TYPE_DACE
{ 1, 3, 3 }, // aSOG_FISH_TYPE_PALE_CHUB
{ 0, 2, 1 }, // aSOG_FISH_TYPE_BITTERLING
{ 0, 3, 3 }, // aSOG_FISH_TYPE_LOACH
{ 0, 3, 3 }, // aSOG_FISH_TYPE_POND_SMELT
{ 1, 2, 1 }, // aSOG_FISH_TYPE_SWEETFISH
{ 1, 1, 1 }, // aSOG_FISH_TYPE_CHERRY_SALMON
{ 4, 1, 1 }, // aSOG_FISH_TYPE_LARGE_CHAR
{ 3, 2, 2 }, // aSOG_FISH_TYPE_RAINBOW_TROUT
{ 5, 1, 1 }, // aSOG_FISH_TYPE_STRINGFISH
{ 4, 2, 1 }, // aSOG_FISH_TYPE_SALMON
{ 0, 2, 3 }, // aSOG_FISH_TYPE_GOLDFISH
{ 1, 4, 3 }, // aSOG_FISH_TYPE_PIRANHA
{ 3, 3, 2 }, // aSOG_FISH_TYPE_AROWANA
{ 2, 1, 1 }, // aSOG_FISH_TYPE_EEL
{ 1, 2, 4 }, // aSOG_FISH_TYPE_FRESHWATER_GOBY
{ 1, 2, 2 }, // aSOG_FISH_TYPE_ANGELFISH
{ 0, 2, 3 }, // aSOG_FISH_TYPE_GUPPY
{ 0, 2, 3 }, // aSOG_FISH_TYPE_POPEYED_GOLDFISH
{ 5, 2, 0 }, // aSOG_FISH_TYPE_COELACANTH
{ 1, 4, 4 }, // aSOG_FISH_TYPE_CRAWFISH
{ 0, 4, 3 }, // aSOG_FISH_TYPE_FROG
{ 0, 2, 2 }, // aSOG_FISH_TYPE_KILLIFISH
{ 3, 2, 4 }, // aSOG_FISH_TYPE_JELLYFISH
{ 4, 3, 2 }, // aSOG_FISH_TYPE_SEA_BASS
{ 4, 2, 1 }, // aSOG_FISH_TYPE_RED_SNAPPER
{ 4, 2, 0 }, // aSOG_FISH_TYPE_BARRED_KNIFEJAW
{ 6, 1, 1 }, // aSOG_FISH_TYPE_ARAPAIMA
{ 7, 1, 1 }, // aSOG_FISH_TYPE_WHALE
{ 0, 1, 3 }, // aSOG_FISH_TYPE_EMPTY_CAN
{ 3, 2, 4 }, // aSOG_FISH_TYPE_BOOT
{ 4, 2, 4 }, // aSOG_FISH_TYPE_OLD_TIRE
{ 4, 2, 1 }, // aSOG_FISH_TYPE_SALMON2
};
// clang-format on
+58 -76
View File
@@ -32,107 +32,89 @@ static void aHNW_actor_init(ACTOR* actor, GAME* game);
static void aHNW_actor_draw(ACTOR* actor, GAME* game);
ACTOR_PROFILE Haniwa_Profile = {
mAc_PROFILE_HANIWA,
ACTOR_PART_BG,
ACTOR_STATE_NONE,
ACTOR_PROP_HANIWA0,
ACTOR_OBJ_BANK_12,
sizeof(HANIWA_ACTOR),
mAc_PROFILE_HANIWA, ACTOR_PART_BG, ACTOR_STATE_NONE, ACTOR_PROP_HANIWA0, ACTOR_OBJ_BANK_12,
sizeof(HANIWA_ACTOR),
&aHNW_actor_ct,
&aHNW_actor_dt,
&aHNW_actor_init,
(mActor_proc)&none_proc1,
NULL
&aHNW_actor_ct, &aHNW_actor_dt, &aHNW_actor_init, (mActor_proc)&none_proc1, NULL
};
static ClObjPipeData_c AcHaniwaCoInfoData = {
{ 57, 32, ClObj_TYPE_PIPE },
{ 1 },
{ 20, 30, 0, { 0, 0, 0 } }
};
static ClObjPipeData_c AcHaniwaCoInfoData = { { 57, 32, ClObj_TYPE_PIPE }, { 1 }, { 20, 30, 0, { 0, 0, 0 } } };
static StatusData_c AcHaniwaStatusData = {
0,
20, 30, 0,
254
};
static StatusData_c AcHaniwaStatusData = { 0, 20, 30, 0, 254 };
/* TODO: ct, dt, & draw are in their own TU */
static void aHNW_actor_ct(ACTOR* actor, GAME* game) {
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
ClObjPipe_c* pipe;
cKF_SkeletonInfo_R_c* keyframe = &haniwa->keyframe;
GAME_PLAY* play = (GAME_PLAY*)game;
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
ClObjPipe_c* pipe;
cKF_SkeletonInfo_R_c* keyframe = &haniwa->common_actor_class.anime.keyframe;
GAME_PLAY* play = (GAME_PLAY*)game;
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_hnw, NULL, haniwa->keyframe_work_area, haniwa->keyframe_morph_area);
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_hnw, NULL, haniwa->keyframe_work_area, haniwa->keyframe_morph_area);
pipe = &haniwa->col_pipe;
ClObjPipe_ct(game, pipe);
ClObjPipe_set5(game, pipe, actor, &AcHaniwaCoInfoData);
CollisionCheck_Status_set3(&haniwa->actor_class.status_data, &AcHaniwaStatusData);
pipe = &haniwa->common_actor_class.col_pipe;
ClObjPipe_ct(game, pipe);
ClObjPipe_set5(game, pipe, actor, &AcHaniwaCoInfoData);
CollisionCheck_Status_set3(&haniwa->common_actor_class.actor_class.status_data, &AcHaniwaStatusData);
{
Object_Bank_c* bank = &play->object_exchange.banks[actor->data_bank_id];
haniwa->bank_ram_start = bank->ram_start;
}
{
Object_Bank_c* bank = &play->object_exchange.banks[actor->data_bank_id];
haniwa->bank_ram_start = bank->ram_start;
}
haniwa->animation_state = 2;
haniwa->house_idx = actor->npc_id - ACTOR_PROP_HANIWA0;
actor->talk_distance = 43.0f;
haniwa->common_actor_class.anime.anime_no = 2;
haniwa->house_idx = actor->npc_id - ACTOR_PROP_HANIWA0;
actor->talk_distance = 43.0f;
}
static void aHNW_actor_dt(ACTOR* actor, GAME* game) {
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
if (haniwa->playing_save_bgm) {
mBGMPsComp_delete_ps_demo(0x41, 0x168);
}
if (haniwa->playing_save_bgm) {
mBGMPsComp_delete_ps_demo(0x41, 0x168);
}
cKF_SkeletonInfo_R_dt(&haniwa->keyframe);
ClObjPipe_dt(game, &haniwa->col_pipe);
cKF_SkeletonInfo_R_dt(&haniwa->common_actor_class.anime.keyframe);
ClObjPipe_dt(game, &haniwa->common_actor_class.col_pipe);
}
#include "../src/ac_haniwa_move.c_inc"
static void aHNW_actor_draw(ACTOR* actor, GAME* game) {
static Gfx hnw_tex_model[] = {
gsDPLoadTLUT_Dolphin(15, 16, 1, hnw_face),
gsSPEndDisplayList(),
};
static Gfx hnw_tex_model[] = {
gsDPLoadTLUT_Dolphin(15, 16, 1, hnw_face),
gsSPEndDisplayList(),
};
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
cKF_SkeletonInfo_R_c* keyframe = &haniwa->keyframe;
GRAPH* g = game->graph;
Mtx* m;
m = GRAPH_ALLOC_TYPE(g, Mtx, keyframe->skeleton->num_shown_joints);
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
cKF_SkeletonInfo_R_c* keyframe = &haniwa->common_actor_class.anime.keyframe;
GRAPH* g = game->graph;
Mtx* m;
if (m != NULL) {
Gfx* gfx;
int house_idx = haniwa->house_idx;
_texture_z_light_fog_prim(g);
m = GRAPH_ALLOC_TYPE(g, Mtx, keyframe->skeleton->num_shown_joints);
OPEN_DISP(g);
gfx = NOW_POLY_OPA_DISP;
if (m != NULL) {
Gfx* gfx;
int house_idx = haniwa->house_idx;
_texture_z_light_fog_prim(g);
gSPSegment(gfx++, G_MWO_SEGMENT_B, hnw_tmem_txt);
OPEN_DISP(g);
gfx = NOW_POLY_OPA_DISP;
if (mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID) != TRUE &&
Common_Get(player_no) == mHS_get_pl_no(house_idx)
) {
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
gSPSegment(gfx++, G_MWO_SEGMENT_B, hnw_tmem_txt);
if (mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID) != TRUE &&
Common_Get(player_no) == mHS_get_pl_no(house_idx)) {
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
} else {
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
}
gSPDisplayList(gfx++, hnw_tex_model);
SET_POLY_OPA_DISP(gfx);
CLOSE_DISP(g);
cKF_Si3_draw_R_SV(game, keyframe, m, NULL, NULL, actor);
}
else {
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
}
gSPDisplayList(gfx++, hnw_tex_model);
SET_POLY_OPA_DISP(gfx);
CLOSE_DISP(g);
cKF_Si3_draw_R_SV(game, keyframe, m, NULL, NULL, actor);
}
}
+21 -19
View File
@@ -9,7 +9,7 @@ static int aHNW_set_save_permission() {
if (player_no < PLAYER_NUM) {
int arrange_idx = mHS_get_arrange_idx(player_no);
house = Save_GetPointer(homes[arrange_idx]);
pid = &Save_Get(private[player_no]).player_ID;
pid = &Save_Get(private_data[player_no]).player_ID;
if (mPr_NullCheckPersonalID(pid) != TRUE && mPr_CheckCmpPersonalID(pid, &house->ownerID) == TRUE) {
res = TRUE;
@@ -108,7 +108,7 @@ static int aHNW_check_house_door(ACTOR* actor, GAME* game) {
mDemo_Clip_c* demo_clip = Common_Get(clip).demo_clip;
if (demo_clip != NULL) {
INTRO_DEMO_ACTOR* demo_class = (INTRO_DEMO_ACTOR*)demo_clip->class;
INTRO_DEMO_ACTOR* demo_class = (INTRO_DEMO_ACTOR*)demo_clip->demo_class;
if (demo_class != NULL && demo_clip->type == mDemo_CLIP_TYPE_INTRO_DEMO && mEv_CheckFirstIntro() &&
demo_class->player_intro_demo_state != 0) {
res = TRUE;
@@ -646,11 +646,11 @@ static void aHNW_setupAction(ACTOR* actor, GAME* game, int action) {
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
int house_idx = haniwa->house_idx;
int animation_state = haniwa->animation_state;
int animation_state = haniwa->common_actor_class.anime.anime_no;
int no_owner = mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID);
int owner_is_player = mHS_get_pl_no(house_idx) == Common_Get(player_no);
haniwa->action = action;
haniwa->common_actor_class.act = action;
haniwa->action_proc = process[action];
if (action >= aHNW_ACTION_CHECK_PROCEEDS) {
@@ -674,37 +674,39 @@ static void aHNW_setupAction(ACTOR* actor, GAME* game, int action) {
}
if (animation_state == 2) {
cKF_SkeletonInfo_R_init(&haniwa->keyframe, haniwa->keyframe.skeleton, &cKF_ba_r_hnw_move, 1.0f, 9.0f, 1.0f,
haniwa->anim_frame_speed, 0.0f, cKF_FRAMECONTROL_REPEAT, NULL);
haniwa->saved_current_frame = haniwa->keyframe.frame_control.current_frame;
cKF_SkeletonInfo_R_init(&haniwa->common_actor_class.anime.keyframe,
haniwa->common_actor_class.anime.keyframe.skeleton, &cKF_ba_r_hnw_move, 1.0f, 9.0f,
1.0f, haniwa->anim_frame_speed, 0.0f, cKF_FRAMECONTROL_REPEAT, NULL);
haniwa->common_actor_class.anime.cur_keyframe =
haniwa->common_actor_class.anime.keyframe.frame_control.current_frame;
}
haniwa->animation_state = 0;
haniwa->common_actor_class.anime.anime_no = 0;
aHNW_init_proc(actor, game, action);
if (no_owner && action < aHNW_ACTION_CHECK_PROCEEDS) {
haniwa->keyframe.frame_control.mode = cKF_FRAMECONTROL_STOP;
haniwa->common_actor_class.anime.keyframe.frame_control.mode = cKF_FRAMECONTROL_STOP;
} else {
haniwa->keyframe.frame_control.mode = cKF_FRAMECONTROL_REPEAT;
haniwa->common_actor_class.anime.keyframe.frame_control.mode = cKF_FRAMECONTROL_REPEAT;
}
}
static void aHNW_common_process(ACTOR* actor, GAME* game) {
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
cKF_SkeletonInfo_R_c* keyframe = &haniwa->keyframe;
cKF_SkeletonInfo_R_c* keyframe = &haniwa->common_actor_class.anime.keyframe;
int house_idx = haniwa->house_idx;
int no_owner = mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID);
f32 target;
if (no_owner == FALSE && keyframe->frame_control.mode == cKF_FRAMECONTROL_STOP) {
aHNW_setupAction((ACTOR*)haniwa, game, haniwa->action);
aHNW_setupAction((ACTOR*)haniwa, game, haniwa->common_actor_class.act);
keyframe->frame_control.mode = cKF_FRAMECONTROL_REPEAT;
} else if (no_owner && haniwa->action < 2 && keyframe->frame_control.speed <= 0.1f) {
} else if (no_owner && haniwa->common_actor_class.act < 2 && keyframe->frame_control.speed <= 0.1f) {
keyframe->frame_control.mode = cKF_FRAMECONTROL_STOP;
} else {
keyframe->frame_control.mode = cKF_FRAMECONTROL_REPEAT;
}
if (no_owner == FALSE || haniwa->action >= aHNW_ACTION_CHECK_PROCEEDS) {
if (no_owner == FALSE || haniwa->common_actor_class.act >= aHNW_ACTION_CHECK_PROCEEDS) {
aHNW_search_player((ACTOR*)haniwa);
} else {
aHNW_search_front((ACTOR*)haniwa, house_idx);
@@ -724,13 +726,13 @@ static void aHNW_common_process(ACTOR* actor, GAME* game) {
static void aHNW_actor_move(ACTOR* actor, GAME* game) {
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
cKF_SkeletonInfo_R_c* keyframe = &haniwa->keyframe;
cKF_SkeletonInfo_R_c* keyframe = &haniwa->common_actor_class.anime.keyframe;
haniwa->keyframe_state = cKF_SkeletonInfo_R_play(keyframe);
haniwa->common_actor_class.anime.state = cKF_SkeletonInfo_R_play(keyframe);
(*haniwa->action_proc)((ACTOR*)haniwa, game);
aHNW_common_process(actor, game);
CollisionCheck_Uty_ActorWorldPosSetPipeC(actor, &haniwa->col_pipe);
CollisionCheck_setOC(game, &play->collision_check, &haniwa->col_pipe.collision_obj);
CollisionCheck_Uty_ActorWorldPosSetPipeC(actor, &haniwa->common_actor_class.col_pipe);
CollisionCheck_setOC(game, &play->collision_check, &haniwa->common_actor_class.col_pipe.collision_obj);
Actor_world_to_eye(actor, 50.0f);
}
@@ -743,6 +745,6 @@ static void aHNW_actor_init(ACTOR* actor, GAME* game) {
actor->dw_proc = &aHNW_actor_draw;
aHNW_setupAction((ACTOR*)haniwa, game,
aHNW_ACTION_WAIT); // weird that we have to re-cast to ACTOR so fequently for matches
haniwa->keyframe.morph_counter = 0.0f;
haniwa->common_actor_class.anime.keyframe.morph_counter = 0.0f;
aHNW_actor_move(actor, game);
}
+1 -1
View File
@@ -268,7 +268,7 @@ static void aIGK_move_on_flower(ACTOR* actorx, GAME* game) {
aIGK_MOVE_TIMER(insect)--;
if (aIGK_MOVE_TIMER(insect) <= 0) {
sAdo_OngenPos((u32)actorx, NA_SE_A8, &actorx->world.position);
sAdo_OngenPos((u32)actorx, NA_SE_GOKI_MOVE, &actorx->world.position);
insect->timer = (int)(2 * (90.0f + RANDOM_F(90.0f)));
aIGK_setupAction(insect, aIGK_ACTION_WAIT_ON_FLOWER, game);
} else {
+1 -1
View File
@@ -283,7 +283,7 @@ static void aIKA_actor_move(ACTOR* actorx, GAME* game) {
aIKA_setupAction(insect, aIKA_ACTION_LET_ESCAPE, game);
} else {
if (insect->action != aIKA_ACTION_ATTACK) {
sAdo_OngenPos((u32)actorx, NA_SE_CF, &actorx->world.position);
sAdo_OngenPos((u32)actorx, NA_SE_KA_BUZZ, &actorx->world.position);
}
if (insect->insect_flags.bit_3 == TRUE && insect->insect_flags.bit_2 == FALSE &&
+96
View File
@@ -0,0 +1,96 @@
#include "ac_intro_demo.h"
#include "m_name_table.h"
#include "m_common_data.h"
#include "libultra/libultra.h"
#include "m_event.h"
#include "m_play.h"
#include "m_bgm.h"
#include "m_player_lib.h"
#include "m_house.h"
enum {
aID_ACT_FIRST_SET,
aID_ACT_TRAIN_BIRTH_WAIT,
aID_ACT_RIDE_TRAIN,
aID_ACT_RIDE_OFF_PLAYER,
aID_ACT_WALK_ONE_UNIT,
aID_ACT_GO_OUT_OF_STATION,
aID_ACT_BIRTH_RCN_GUIDE,
aID_ACT_FIRST_TALK_END_WAIT,
aID_ACT_WALK_AFTER_RCN_GUIDE,
aID_ACT_IN_HOUSE,
aID_ACT_DECIDE_HOUSE,
aID_ACT_RETIRE_RCN_GUIDE_WAIT,
aID_ACT_FIRST_JOB,
aID_ACT_NUM
};
static void aID_actor_ct(ACTOR* actorx, GAME* game);
static void aID_actor_dt(ACTOR* actorx, GAME* game);
static void aID_actor_move(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Intro_Demo_Profile = {
mAc_PROFILE_INTRO_DEMO,
ACTOR_PART_CONTROL,
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(INTRO_DEMO_ACTOR),
&aID_actor_ct,
&aID_actor_dt,
&aID_actor_move,
mActor_NONE_PROC1,
NULL,
};
// clang-format on
static mDemo_Clip_c aID_clip;
static void aID_setupAction(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play, int action);
static void aID_actor_ct(ACTOR* actorx, GAME* game) {
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
Common_Get(clip).demo_clip = &aID_clip;
bzero(&aID_clip, sizeof(aID_clip));
Common_Get(clip).demo_clip->demo_class = actorx;
Common_Get(clip).demo_clip->type = mDemo_CLIP_TYPE_INTRO_DEMO;
if (mEv_CheckFirstIntro() == TRUE) {
if (Common_Get(field_type) == mFI_FIELDTYPE_FG) {
switch (mFI_GET_TYPE(Common_Get(last_field_id))) {
case mFI_FIELD_PLAYER0_ROOM:
intro_demo->_1A4 = TRUE;
intro_demo->next_action = aID_ACT_DECIDE_HOUSE;
aID_setupAction(intro_demo, play, aID_ACT_BIRTH_RCN_GUIDE);
mBGMPsComp_make_ps_demo(BGM_INTRO_RCN_GUIDE, 0x168);
break;
default:
aID_setupAction(intro_demo, play, 0);
break;
}
} else {
aID_setupAction(intro_demo, play, aID_ACT_IN_HOUSE);
}
} else {
aID_setupAction(intro_demo, play, aID_ACT_FIRST_JOB);
}
}
static void aID_actor_dt(ACTOR* actorx, GAME* game) {
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)actorx;
if (Common_Get(clip).demo_clip != NULL) {
Common_Get(clip).demo_clip = NULL;
}
if (intro_demo->first_field_bgm_state == 2) {
mBGMPsComp_delete_ps_fieldSuddenEv(BGM_INTRO_FIND_SHOP, 0x168);
}
}
#include "../src/ac_intro_demo_move.c_inc"
+331
View File
@@ -0,0 +1,331 @@
static void aID_change_player_demo_standing_train(GAME* game) {
if (mPlib_get_player_actor_main_index(game) != mPlayer_INDEX_DEMO_STANDING_TRAIN) {
mPlib_request_main_demo_standing_train_type1(game);
}
}
static void aID_set_first_field_bgm(INTRO_DEMO_ACTOR* intro_demo) {
mBGMPsComp_make_ps_fieldSuddenEv(BGM_INTRO_FIND_SHOP, 0x168, 1);
mBGMPsComp_scene_mode(1);
intro_demo->first_field_bgm_state = 2;
}
static void aID_check_set_first_field_bgm(INTRO_DEMO_ACTOR* intro_demo) {
if (intro_demo->first_field_bgm_state == 1 && sAdo_BgmFadeoutCheck() == TRUE) {
aID_set_first_field_bgm(intro_demo);
}
}
static void aID_first_set(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
Common_Set(train_coming_flag, 3);
aID_change_player_demo_standing_train(&play->game);
aID_setupAction(intro_demo, play, aID_ACT_TRAIN_BIRTH_WAIT);
}
static void aID_train_birth_wait(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
TRAIN1_ACTOR* train = (TRAIN1_ACTOR*)Actor_info_fgName_search(&play->actor_info, TRAIN1, ACTOR_PART_ITEM);
aID_change_player_demo_standing_train(&play->game);
if (train != NULL) {
intro_demo->train1_actor_p = train;
train->player_pass_exists = TRUE;
aID_setupAction(intro_demo, play, aID_ACT_RIDE_TRAIN);
}
}
static void aID_ride_train(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
TRAIN1_ACTOR* train = intro_demo->train1_actor_p;
aID_change_player_demo_standing_train(&play->game);
if (train->tr_action == 5) {
aID_setupAction(intro_demo, play, aID_ACT_RIDE_OFF_PLAYER);
}
}
static void aID_ride_off_player(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
ACTOR* station_master = intro_demo->station_master_actor_p;
if (intro_demo->_1A0 == 0) {
/* Wait for the station master to speak to the player */
if (mDemo_Check(mDemo_TYPE_SPEAK, station_master) == TRUE) {
intro_demo->_1A0 = 1;
}
} else {
/* Wait for the station master to be done speaking to the player */
if (mDemo_Check(mDemo_TYPE_SPEAK, station_master) == FALSE) {
aID_setupAction(intro_demo, play, aID_ACT_WALK_ONE_UNIT);
}
}
}
static void aID_walk_one_unit(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
if (player != NULL) {
if (player->actor_class.world.position.z >= aID_OFF_UT_Z_POS) {
/* Reached target position */
aID_setupAction(intro_demo, play, aID_ACT_GO_OUT_OF_STATION);
} else {
/* Walk to A-3 @ 5Z, 7.5X */
mPlib_Set_goal_player_demo_walk(aID_OFF_UT_X_POS, aID_OFF_UT_Z_POS, 2.5f);
}
}
}
static void aID_go_out_of_station(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
if (player != NULL) {
if (player->actor_class.world.position.z >= aID_OUT_OF_STATION_Z_POS) {
mPlib_request_main_demo_wait_type1(&play->game, 0, NULL);
intro_demo->next_action = aID_ACT_FIRST_TALK_END_WAIT;
aID_setupAction(intro_demo, play, aID_ACT_BIRTH_RCN_GUIDE);
}
}
}
static void aID_birth_rcn_guide(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
static mActor_name_t rcn_name[] = { SP_NPC_RCN_GUIDE, SP_NPC_RCN_GUIDE_1, SP_NPC_RCN_GUIDE_2, SP_NPC_RCN_GUIDE_3 };
static int restart_ux[] = { 6, 9, 6, 9 };
static int restart_uz[] = { 5, 5, 12, 12 };
static f32 restartOffsetX[] = { 10.0f, -10.0f, 10.0f, -10.0f };
mActor_name_t name = rcn_name[mSP_GetShopLevel()];
int type;
int data;
int ux;
int uz;
f32 ofsX;
f32 ofsZ;
s16 param;
int house_idx;
ACTOR* rcn_actor;
if (intro_demo->_1A4 == TRUE) {
house_idx = Common_Get(last_field_id) - mFI_FIELD_PLAYER0_ROOM;
intro_demo->house_idx = house_idx;
ux = restart_ux[house_idx];
uz = restart_uz[house_idx];
ofsX = restartOffsetX[house_idx];
ofsZ = 8.0f;
if (mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID) == TRUE) {
param = aID_STATE_TAKEN_HOUSE;
} else {
param = aID_STATE_FREE_HOUSE;
}
data = 3;
type = 2;
} else {
data = 3;
type = 1;
ux = 8;
uz = 15;
ofsX = 0.0f;
ofsZ = 0.0f;
param = aID_STATE_INITIAL;
}
if (Common_Get(clip).npc_clip->setupActor_proc(play, name, -1, -1, param, data, type, ux, uz) == TRUE) {
rcn_actor = Actor_info_fgName_search(&play->actor_info, name, ACTOR_PART_NPC);
intro_demo->rcn_guide_actor_p = rcn_actor;
rcn_actor->world.position.x += ofsX;
rcn_actor->world.position.z += ofsZ;
aID_setupAction(intro_demo, play, intro_demo->next_action);
}
}
static void aID_first_talk_end_wait(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
if (intro_demo->talk_flag == TRUE) {
intro_demo->talk_flag = FALSE;
aID_setupAction(intro_demo, play, aID_ACT_WALK_AFTER_RCN_GUIDE);
}
}
static void aID_walk_after_rcn_guide(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
static f32 rate_table[] = { 1.0f, 0.6f };
NPC_ACTOR* rcn_guide = (NPC_ACTOR*)intro_demo->rcn_guide_actor_p;
f32 rate = rate_table[rcn_guide->actor_class.player_distance_xz < 80.0f] * rcn_guide->actor_class.speed;
/* Walk the player to the raccoon guide NPC's position */
mPlib_Set_goal_player_demo_walk(rcn_guide->actor_class.world.position.x, rcn_guide->actor_class.world.position.z,
rate);
/* If we've finished our action then stop walking and move on */
if (((NPC_ACTOR*)intro_demo->rcn_guide_actor_p)->action.idx == 0) {
mPlib_request_main_wait_type3(&play->game);
aID_setupAction(intro_demo, play, aID_ACT_DECIDE_HOUSE);
}
}
static void aID_decide_house(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
if (intro_demo->talk_flag == TRUE) {
aID_setupAction(intro_demo, play, aID_ACT_RETIRE_RCN_GUIDE_WAIT);
}
}
static void aID_retire_rcn_guide_wait(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
mQst_errand_c* errand;
if (intro_demo->rcn_guide_actor_p == NULL) {
mPlib_request_main_wait_type3(&play->game);
mHS_set_use(Common_Get(player_no), intro_demo->house_idx);
mPr_SetItemCollectBit(Now_Private->cloth.item);
mPr_SetItemCollectBit(FTR_TAPEDECK);
mPr_SetItemCollectBit(ITM_CARPET_START +
Save_Get(homes[intro_demo->house_idx]).floors[0].wall_floor.flooring_idx);
mPr_SetItemCollectBit(ITM_WALL_START +
Save_Get(homes[intro_demo->house_idx]).floors[0].wall_floor.wallpaper_idx);
mHm_SetNowHome();
mPlib_Set_unable_wade(FALSE);
mCoBG_ChangeBlockBgCheckMode(0);
mEv_UnSetFirstIntro();
Now_Private->inventory.loan = mPlayer_DEBT0;
errand = mQst_GetFirstJobData();
mQst_SetFirstJobStart(errand);
aID_setupAction(intro_demo, play, aID_ACT_FIRST_JOB);
}
aID_check_set_first_field_bgm(intro_demo);
}
static void aID_first_job(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
if (intro_demo->_1A8 == TRUE) {
mQst_errand_c* errand = mQst_GetFirstJobData();
mQst_ClearErrand(errand, 1);
mEv_UnSetFirstJob();
mTM_off_renew_time(1);
Actor_delete(&intro_demo->actor_class);
Common_Set(complete_payment_type, mPlayer_COMPLETE_PAYMENT_TYPE_ARBEIT);
play->event.day = 0;
} else {
aID_check_set_first_field_bgm(intro_demo);
}
}
static void aID_first_set_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
Actor_data* player_data = play->player_data;
mBGMPsComp_make_ps_demo(BGM_INTRO_ARRIVE, 0x168);
mBGMPsComp_scene_mode(9);
player_data->position.x = aID_PLR_START_X_POS;
player_data->position.z = aID_PLR_START_Z_POS;
}
static void aID_train_birth_wait_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
xyz_t center_pos;
center_pos.x = 2180.0f;
center_pos.z = 820.0f;
center_pos.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(center_pos, -35.0f);
Camera2_request_main_demo_fromNowPos2(play, &center_pos, 0.0f, 0.0f, 0.0f, 9);
}
static void aID_ride_off_player_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
static xyz_t enter_pos = { 2180.0f, 0.0f, 820.0f };
TRAIN1_ACTOR* train = intro_demo->train1_actor_p;
ACTOR* station_master = Actor_info_fgName_search(&play->actor_info, SP_NPC_STATION_MASTER, ACTOR_PART_NPC);
intro_demo->station_master_actor_p = station_master;
train->player_pass_exists = FALSE;
mPlib_request_main_demo_getoff_train_type1(&play->game);
intro_demo->_1A0 = 0;
mCoBG_SetAttribute(enter_pos, mCoBG_ATTRIBUTE_STONE);
}
static void aID_walk_one_unit_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
mPlib_request_main_demo_walk_type1(&play->game, 2220.0f, 840.0f, 2.5f, 0);
}
static void aID_go_out_of_station_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
mPlib_request_main_wait_type3(&play->game);
Camera2_request_main_normal(play, 0, 9);
}
static void aID_walk_after_rcn_guide_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
ACTOR* rcn_guide = intro_demo->rcn_guide_actor_p;
/* Walk the player to the raccoon guide NPC's position */
mPlib_request_main_demo_walk_type1(&play->game, rcn_guide->world.position.x, rcn_guide->world.position.z,
rcn_guide->speed * 0.6f, 0);
}
static void aID_decide_house_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
mPlib_Set_unable_wade(TRUE); /* We can't switch acres */
mCoBG_ChangeBlockBgCheckMode(1); /* Acre BG check mode altered */
}
static void aID_retire_rcn_guide_wait_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
mPlib_request_main_demo_wait_type1(&play->game, 0, NULL);
mBGMPsComp_delete_ps_demo(BGM_INTRO_SELECT_HOUSE2, 0x168);
mBGMPsComp_make_ps_fc_quiet(0x2D0);
intro_demo->first_field_bgm_state = 1;
}
static void aID_first_job_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
mQst_errand_c* errand = mQst_GetFirstJobData();
if (errand->base.quest_kind == mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH ||
errand->base.quest_kind == mQst_ERRAND_FIRSTJOB_START ||
(errand->base.quest_kind == mQst_ERRAND_FIRSTJOB_PLANT_FLOWER && errand->base.progress == 1)) {
if (Common_Get(field_type) == mFI_FIELD_FG && intro_demo->first_field_bgm_state == 0) {
aID_set_first_field_bgm(intro_demo);
}
}
}
typedef void (*aID_INIT_PROC)(INTRO_DEMO_ACTOR*, GAME_PLAY*);
static void aID_init_proc(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play, int act) {
// clang-format off
static aID_INIT_PROC init_proc[] = {
&aID_first_set_init,
&aID_train_birth_wait_init,
(aID_INIT_PROC)&none_proc1,
&aID_ride_off_player_init,
&aID_walk_one_unit_init,
&aID_go_out_of_station_init,
(aID_INIT_PROC)&none_proc1,
(aID_INIT_PROC)&none_proc1,
&aID_walk_after_rcn_guide_init,
(aID_INIT_PROC)&none_proc1,
&aID_decide_house_init,
&aID_retire_rcn_guide_wait_init,
&aID_first_job_init,
};
// clang-format on
(*init_proc[act])(intro_demo, play);
}
static void aID_setupAction(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play, int act) {
// clang-format off
static aID_ACT_PROC process[] = {
&aID_first_set,
&aID_train_birth_wait,
&aID_ride_train,
&aID_ride_off_player,
&aID_walk_one_unit,
&aID_go_out_of_station,
&aID_birth_rcn_guide,
&aID_first_talk_end_wait,
&aID_walk_after_rcn_guide,
(aID_ACT_PROC)&none_proc1,
&aID_decide_house,
&aID_retire_rcn_guide_wait,
&aID_first_job,
};
// clang-format on
intro_demo->action_proc = process[act];
intro_demo->action = act;
aID_init_proc(intro_demo, play, act);
}
static void aID_actor_move(ACTOR* actorx, GAME* game) {
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
(*intro_demo->action_proc)(intro_demo, play);
}
+3 -9
View File
@@ -31,7 +31,8 @@ static void change_FGUnit(STRUCTURE_ACTOR* kamakura, int type) {
if (mSN_ClearSnowman(unit_fg) == FALSE) {
dug = FALSE;
if ((((*unit_fg >= BURIED_PITFALL_START) && (*unit_fg <= BURIED_PITFALL_END)) || (*unit_fg == SHINE_SPOT))) {
if ((((*unit_fg >= BURIED_PITFALL_HOLE_START) && (*unit_fg <= BURIED_PITFALL_HOLE_END)) ||
(*unit_fg == SHINE_SPOT))) {
dug = TRUE;
}
@@ -171,14 +172,7 @@ static void aKKR_wait(STRUCTURE_ACTOR* kamakura, GAME_PLAY* play) {
static void aKKR_setup_action(STRUCTURE_ACTOR* kamakura, int action) {
static aSTR_MOVE_PROC process[] = {
&aKKR_wait,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
&aKKR_wait, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
};
kamakura->action_proc = process[action];
+4 -3
View File
@@ -119,9 +119,10 @@ static void Museum_Fossil_Actor_move(ACTOR* actorx, GAME* game) {
/* If the donator still lives in town we need to copy their name */
if (mMmd_DONATOR_EXISTS(donator)) {
mMsg_Set_free_str(mMsg_Get_base_window_p(), mMsg_FREE_STR0,
Save_Get(private[mMmd_DONATOR_PLR_IDX(donator)]).player_ID.player_name,
PLAYER_NAME_LEN);
mMsg_Set_free_str(
mMsg_Get_base_window_p(), mMsg_FREE_STR0,
Save_Get(private_data[mMmd_DONATOR_PLR_IDX(donator)]).player_ID.player_name,
PLAYER_NAME_LEN);
}
}
+1 -1
View File
@@ -194,7 +194,7 @@ static void Museum_Picture_Actor_move(ACTOR* actorx, GAME* game) {
/* If the donator still lives in town we need to copy their name */
if (mMmd_DONATOR_EXISTS(donator)) {
mMsg_Set_free_str(mMsg_Get_base_window_p(), mMsg_FREE_STR0,
Save_Get(private[mMmd_DONATOR_PLR_IDX(donator)]).player_ID.player_name,
Save_Get(private_data[mMmd_DONATOR_PLR_IDX(donator)]).player_ID.player_name,
PLAYER_NAME_LEN);
}
}
+2 -2
View File
@@ -239,8 +239,8 @@ static void aMHS_actor_draw(ACTOR* actorx, GAME* game) {
gSPSegment(gfx++, G_MWO_SEGMENT_A, obj_myhome_mark_pal);
} else {
int org_idx = door_original & 7;
u16* pal = mNW_PaletteIdx2Palette(Save_Get(private[pl_no]).my_org[org_idx].palette);
u8* tex = Save_Get(private[pl_no]).my_org[org_idx].design.data;
u16* pal = mNW_PaletteIdx2Palette(Save_Get(private_data[pl_no]).my_org[org_idx].palette);
u8* tex = Save_Get(private_data[pl_no]).my_org[org_idx].design.data;
gSPSegment(gfx++, G_MWO_SEGMENT_9, tex);
gSPSegment(gfx++, G_MWO_SEGMENT_A, pal);
+5 -5
View File
@@ -200,12 +200,12 @@ static int aMHS_check_player_in_intro_demo(STRUCTURE_ACTOR* my_house, GAME_PLAY*
return 0;
}
intro_demo = (INTRO_DEMO_ACTOR*)clip->class;
intro_demo = (INTRO_DEMO_ACTOR*)clip->demo_class;
if (intro_demo == NULL || clip->type != mDemo_CLIP_TYPE_INTRO_DEMO || mEv_CheckFirstIntro() == FALSE) {
return 0;
}
if (my_house->arg3_f == TRUE && intro_demo->player_in_intro_demo == TRUE) {
if (my_house->arg3_f == TRUE && intro_demo->player_in_house == TRUE) {
return 1;
}
@@ -214,7 +214,7 @@ static int aMHS_check_player_in_intro_demo(STRUCTURE_ACTOR* my_house, GAME_PLAY*
my_house->arg3_f = TRUE;
action = my_house->action;
intro_demo->selected_house = action;
intro_demo->house_idx = action;
intro_demo->player_intro_demo_state =
mPr_NullCheckPersonalID(&Save_Get(homes[action]).ownerID) ? aID_STATE_TAKEN_HOUSE : aID_STATE_FREE_HOUSE;
return 2;
@@ -400,12 +400,12 @@ static void aMHS_open_door(STRUCTURE_ACTOR* my_house, GAME_PLAY* play) {
aMHS_goto_next_pl_scene(play, my_house);
if (Common_Get(clip).demo_clip != NULL && Common_Get(clip).demo_clip->type == mDemo_CLIP_TYPE_INTRO_DEMO) {
demo_class = Common_Get(clip).demo_clip->class;
demo_class = Common_Get(clip).demo_clip->demo_class;
if (demo_class != NULL) {
intro_demo = (INTRO_DEMO_ACTOR*)demo_class;
intro_demo->player_in_intro_demo = FALSE;
intro_demo->player_in_house = FALSE;
}
}
+7 -7
View File
@@ -1101,7 +1101,7 @@ static void aMR_MiniDiskCommonDt(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
my_room->bgm_info.last_md_no = -1;
/* Don't delete for aerobics radio music */
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
if (my_room->bgm_info.md_no != BGM_SPORTSFAIR_AEROBICS) {
mBGMPsComp_MDPlayerPos_delete();
}
}
@@ -1134,7 +1134,7 @@ static void aMR_ChangeMDBgm(ACTOR* actorx, FTR_ACTOR* ftr_actor) {
if (my_room->bgm_info.md_no != -1) {
mBGMPsComp_make_ps_room(my_room->bgm_info.md_no, 0);
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
if (my_room->bgm_info.md_no != BGM_SPORTSFAIR_AEROBICS) {
mBGMPsComp_MDPlayerPos_make();
}
@@ -1150,12 +1150,12 @@ static void aMR_ChangeMDBgm(ACTOR* actorx, FTR_ACTOR* ftr_actor) {
my_room->bgm_info.last_md_no = my_room->bgm_info.md_no;
} else {
mBGMPsComp_delete_ps_room(my_room->bgm_info.last_md_no, 0);
if (my_room->bgm_info.last_md_no != BGM_AEROBICS) {
if (my_room->bgm_info.last_md_no != BGM_SPORTSFAIR_AEROBICS) {
mBGMPsComp_MDPlayerPos_delete();
}
mBGMPsComp_make_ps_room(my_room->bgm_info.md_no, 0);
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
if (my_room->bgm_info.md_no != BGM_SPORTSFAIR_AEROBICS) {
mBGMPsComp_MDPlayerPos_make();
}
@@ -2209,7 +2209,7 @@ extern mActor_name_t aMR_FurnitureFg_to_FurnitureFgWithDirect(mActor_name_t item
extern void aMR_RadioCommonMove(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
if (ftr_actor->haniwa_state == 1) {
aMR_ReserveBgm(actorx, BGM_AEROBICS, ftr_actor, 0);
aMR_ReserveBgm(actorx, BGM_SPORTSFAIR_AEROBICS, ftr_actor, 0);
ftr_actor->haniwa_state = 0;
} else if (ftr_actor->switch_changed_flag) {
if (ftr_actor->switch_bit == FALSE) {
@@ -2219,7 +2219,7 @@ extern void aMR_RadioCommonMove(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
ftr_actor->switch_bit = FALSE;
} else {
aMR_OneMDSwitchOn_TheOtherSwitchOff(ftr_actor);
aMR_ReserveBgm(actorx, BGM_AEROBICS, ftr_actor, 0);
aMR_ReserveBgm(actorx, BGM_SPORTSFAIR_AEROBICS, ftr_actor, 0);
aMR_ChangeMDBgm(actorx, ftr_actor);
ftr_actor->switch_bit = TRUE;
}
@@ -2227,7 +2227,7 @@ extern void aMR_RadioCommonMove(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
}
extern int aMR_RadioBgmNow(void) {
if (mBGMPsComp_execute_bgm_num_get() == BGM_AEROBICS) {
if (mBGMPsComp_execute_bgm_num_get() == BGM_SPORTSFAIR_AEROBICS) {
return TRUE;
}
+4 -4
View File
@@ -741,7 +741,7 @@ static void aMR_SetPullMoveAnime(FTR_ACTOR* ftr_actor, GAME* game, MY_ROOM_ACTOR
cKF_SkeletonInfo_R_init_standard_stop(keyframe, &cKF_ba_r_furniture_stop, NULL);
cKF_SkeletonInfo_R_play(keyframe);
cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(keyframe, 0.0f, 0.0f, 0.0f, 0, 0, 0);
cKF_SkeletonInfo_R_AnimationMove_ct_base(0.0f, pos, pos, 0, 0, keyframe, TRUE);
cKF_SkeletonInfo_R_AnimationMove_ct_base(pos, pos, 0, 0, 0.0f, keyframe, TRUE);
cKF_SkeletonInfo_R_init_standard_stop_morph(keyframe, &cKF_ba_r_furniture_pull, NULL, -3.0f);
cKF_SkeletonInfo_R_play(keyframe);
}
@@ -763,7 +763,7 @@ static void aMR_SetPushMoveAnime(FTR_ACTOR* ftr_actor, GAME* game, MY_ROOM_ACTOR
cKF_SkeletonInfo_R_init_standard_stop(keyframe, &cKF_ba_r_furniture_stop, NULL);
cKF_SkeletonInfo_R_play(keyframe);
cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(keyframe, 0.0f, 0.0f, 0.0f, 0, 0, 0);
cKF_SkeletonInfo_R_AnimationMove_ct_base(0.0f, pos, pos, 0, 0, keyframe, TRUE);
cKF_SkeletonInfo_R_AnimationMove_ct_base(pos, pos, 0, 0, 0.0f, keyframe, TRUE);
cKF_SkeletonInfo_R_init_standard_stop(keyframe, &cKF_ba_r_furniture_push, NULL);
cKF_SkeletonInfo_R_play(keyframe);
}
@@ -2354,7 +2354,7 @@ static void aMR_BirthWait(FTR_ACTOR* ftr_actor, GAME* game, MY_ROOM_ACTOR* my_ro
if (ftr_actor->id == my_room->rsv_ftr[i].free_no) {
if (my_room->rsv_ftr[i].frames <= 0) {
ftr_actor->state = aFTR_STATE_BIRTH;
sAdo_OngenTrgStart(NA_SE_BIRTH_FTR, &ftr_actor->position);
sAdo_OngenTrgStart(NA_SE_ITEM_HORIDASHI, &ftr_actor->position);
}
break;
@@ -2885,7 +2885,7 @@ static void My_Room_Actor_move(ACTOR* actorx, GAME* game) {
if (md_ftr_actor != NULL) {
u16 md_angle = md_ftr_actor->s_angle_y;
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
if (my_room->bgm_info.md_no != BGM_SPORTSFAIR_AEROBICS) {
mBGMPsComp_MDPlayerPos_param_set(&md_ftr_actor->position, md_angle,
aMR_Fname2ConpoIndex(md_ftr_actor->name), (u32)md_ftr_actor);
}
File diff suppressed because it is too large Load Diff
+152
View File
@@ -0,0 +1,152 @@
#include "ac_npc_guide.h"
#include "m_play.h"
#include "m_common_data.h"
#include "ac_train_door.h"
#include "m_player_lib.h"
#include "m_font.h"
#include "m_msg.h"
#include "m_timeIn_ovl.h"
#include "m_ledit_ovl.h"
#include "libultra/libultra.h"
#include "m_bgm.h"
#include "m_soncho.h"
enum {
aNGD_ACTION_ENTER,
aNGD_ACTION_APPROACH,
aNGD_ACTION_TALK_START_WAIT,
aNGD_ACTION_TIME_CHECK,
aNGD_ACTION_SDON_AND_PB_WAIT,
aNGD_ACTION_TIME_MENU_OPEN_WAIT,
aNGD_ACTION_TIME_MENU_CLOSE_WAIT,
aNGD_ACTION_MSG_WIN_OPEN_WAIT,
aNGD_ACTION_CONFIRM_INPUT_DATA,
aNGD_ACTION_WAIT_PERMISSION,
aNGD_ACTION_SITDOWN,
aNGD_ACTION_PNAME_MENU_OPEN_WAIT,
aNGD_ACTION_PNAME_MENU_CLOSE_WAIT,
aNGD_ACTION_SEX_SELECT_WAIT,
aNGD_ACTION_SEX_SELECT_WAIT2,
aNGD_ACTION_SEX_SELECT_AFTER,
aNGD_ACTION_CNAME_MENU_OPEN_WAIT,
aNGD_ACTION_CNAME_MENU_CLOSE_WAIT,
aNGD_ACTION_STANDUP_START_WAIT,
aNGD_ACTION_STANDUP,
aNGD_ACTION_MOVE_READY,
aNGD_ACTION_MOVE_TO_AISLE,
aNGD_ACTION_MOVE_TO_DOOR,
aNGD_ACTION_MOVE_TO_DECK,
aNGD_ACTION_KEITAI_ON,
aNGD_ACTION_KEITAI_TALK,
aNGD_ACTION_KEITAI_OFF,
aNGD_ACTION_OPEN_DOOR,
aNGD_ACTION_RETURN_APPROACH,
aNGD_ACTION_LAST_TALK_START_WAIT,
aNGD_ACTION_SITDOWN2_START_WAIT,
aNGD_ACTION_SITDOWN2,
aNGD_ACTION_LAST_TALK_END_WAIT,
aNGD_ACTION_SCENE_CHANGE_WAIT,
aNGD_ACTION_NUM
};
enum {
aNGD_OBJ_LOOK_TYPE_NORMAL,
aNGD_OBJ_LOOK_TYPE_TALK,
aNGD_OBJ_LOOK_TYPE_NUM
};
static void aNGD_actor_ct(ACTOR* actorx, GAME* game);
static void aNGD_actor_dt(ACTOR* actorx, GAME* game);
static void aNGD_actor_init(ACTOR* actorx, GAME* game);
static void aNGD_actor_save(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Npc_Guide_Profile = {
mAc_PROFILE_NPC_GUIDE,
ACTOR_PART_NPC,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
SP_NPC_GUIDE,
ACTOR_OBJ_BANK_KEEP,
sizeof(NPC_GUIDE_ACTOR),
&aNGD_actor_ct,
&aNGD_actor_dt,
&aNGD_actor_init,
mActor_NONE_PROC1,
&aNGD_actor_save,
};
// clang-format on
static void aNGD_actor_move(ACTOR* actorx, GAME* game);
static void aNGD_actor_draw(ACTOR* actorx, GAME* game);
static void aNGD_setupAction(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play, int action);
static void aNGD_actor_ct(ACTOR* actorx, GAME* game) {
static aNPC_ct_data_c ct_data = { &aNGD_actor_move, &aNGD_actor_draw, 0, NULL, NULL, NULL, 0 };
NPC_GUIDE_ACTOR* guide = (NPC_GUIDE_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
PLAYER_ACTOR* player;
Common_Get(clip).npc_clip->ct_proc(actorx, game, &ct_data);
guide->npc_class.condition_info.hide_flg = FALSE; // show guide actor
guide->npc_class.condition_info.demo_flg =
aNPC_COND_DEMO_SKIP_ENTRANCE_CHECK | aNPC_COND_DEMO_SKIP_HEAD_LOOKAT | aNPC_COND_DEMO_SKIP_TALK_CHECK |
aNPC_COND_DEMO_SKIP_ITEM | aNPC_COND_DEMO_SKIP_FORWARD_CHECK | aNPC_COND_DEMO_SKIP_BGCHECK |
aNPC_COND_DEMO_SKIP_OBJ_COL_CHECK | aNPC_COND_DEMO_SKIP_MOVE_Y | aNPC_COND_DEMO_SKIP_MOVE_CIRCLE_REV |
aNPC_COND_DEMO_SKIP_MOVE_RANGE_CHECK;
guide->camera_morph_counter = 40;
guide->obj_look_type = aNGD_OBJ_LOOK_TYPE_NORMAL;
guide->npc_class.eye_y = 30.0f;
guide->camera_move_set_counter = 1;
guide->npc_class.palActorIgnoreTimer = -1;
guide->train_door_actor = Actor_info_fgName_search(&play->actor_info, TRAIN_DOOR, ACTOR_PART_BG);
guide->npc_class.actor_class.shape_info.draw_shadow = TRUE;
guide->npc_class.actor_class.world.position.z = 130.0f;
/* Put the player into demo wait state */
mPlib_request_main_demo_wait_type1(game, 0, NULL);
player = GET_PLAYER_ACTOR(play);
if (player != NULL) {
/* Make the player invisible during the intro train ride */
player->actor_class.state_bitfield |= ACTOR_STATE_INVISIBLE;
}
aNGD_setupAction(guide, play, aNGD_ACTION_ENTER);
/* Play train noises sfx repeatedly */
sAdo_SysLevStart(NA_SE_TRAIN_RIDE);
/* Disable sunlight */
Common_Set(sunlight_flag, FALSE);
/* Turn on echo for sound effects */
sAdo_TrgSeEcho(TRUE);
sAdo_LevSeEcho(TRUE);
}
static void aNGD_actor_save(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->save_proc(actorx, game);
}
static void aNGD_actor_dt(ACTOR* actorx, GAME* game) {
/* Update all animals in town to have this town's info */
mNpc_SetAnimalThisLand(Save_Get(animals), ANIMAL_NUM_MAX);
Common_Get(clip).npc_clip->dt_proc(actorx, game);
/* Stop train noise sfx */
sAdo_SysLevStop(NA_SE_TRAIN_RIDE);
}
static void aNGD_actor_init(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->init_proc(actorx, game);
}
static void aNGD_actor_draw(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->draw_proc(actorx, game);
}
#include "../src/ac_npc_guide_animation.c_inc"
#include "../src/ac_npc_guide_move.c_inc"
+138
View File
@@ -0,0 +1,138 @@
#include "ac_npc_guide2.h"
#include "m_play.h"
#include "m_common_data.h"
#include "ac_train_door.h"
#include "m_player_lib.h"
#include "m_font.h"
#include "m_msg.h"
#include "m_timeIn_ovl.h"
#include "m_ledit_ovl.h"
#include "libultra/libultra.h"
#include "m_bgm.h"
#include "m_soncho.h"
enum {
aNG2_ACTION_ENTER,
aNG2_ACTION_APPROACH,
aNG2_ACTION_TALK_START_WAIT,
aNG2_ACTION_WAIT_PERMISSION,
aNG2_ACTION_SITDOWN,
aNG2_ACTION_SDON_AND_PB_WAIT,
aNG2_ACTION_PNAME_MENU_OPEN_WAIT,
aNG2_ACTION_PNAME_MENU_CLOSE_WAIT,
aNG2_ACTION_MSG_WIN_OPEN_WAIT,
aNG2_ACTION_PNAME_NG,
aNG2_ACTION_SEX_SELECT_WAIT,
aNG2_ACTION_SEX_SELECT_WAIT2,
aNG2_ACTION_SEX_SELECT_AFTER,
aNG2_ACTION_STANDUP_START_WAIT,
aNG2_ACTION_STANDUP,
aNG2_ACTION_MOVE_READY,
aNG2_ACTION_MOVE_TO_AISLE,
aNG2_ACTION_MOVE_TO_DOOR,
aNG2_ACTION_MOVE_TO_DECK,
aNG2_ACTION_KEITAI_ON,
aNG2_ACTION_KEITAI_TALK,
aNG2_ACTION_KEITAI_OFF,
aNG2_ACTION_OPEN_DOOR,
aNG2_ACTION_RETURN_APPROACH,
aNG2_ACTION_LAST_TALK_START_WAIT,
aNG2_ACTION_SITDOWN2_START_WAIT,
aNG2_ACTION_SITDOWN2,
aNG2_ACTION_LAST_TALK_END_WAIT,
aNG2_ACTION_SCENE_CHANGE_WAIT,
aNG2_ACTION_NUM
};
enum {
aNG2_OBJ_LOOK_TYPE_NORMAL,
aNG2_OBJ_LOOK_TYPE_TALK,
aNG2_OBJ_LOOK_TYPE_NUM
};
static void aNG2_actor_ct(ACTOR* actorx, GAME* game);
static void aNG2_actor_dt(ACTOR* actorx, GAME* game);
static void aNG2_actor_init(ACTOR* actorx, GAME* game);
static void aNG2_actor_save(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Npc_Guide2_Profile = {
mAc_PROFILE_NPC_GUIDE2,
ACTOR_PART_NPC,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
SP_NPC_GUIDE2,
ACTOR_OBJ_BANK_KEEP,
sizeof(NPC_GUIDE2_ACTOR),
&aNG2_actor_ct,
&aNG2_actor_dt,
&aNG2_actor_init,
mActor_NONE_PROC1,
&aNG2_actor_save,
};
// clang-format on
static void aNG2_actor_move(ACTOR* actorx, GAME* game);
static void aNG2_actor_draw(ACTOR* actorx, GAME* game);
static void aNG2_setupAction(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play, int action);
static void aNG2_actor_ct(ACTOR* actorx, GAME* game) {
static aNPC_ct_data_c ct_data = { &aNG2_actor_move, &aNG2_actor_draw, 0, NULL, NULL, NULL, 0 };
NPC_GUIDE2_ACTOR* guide2 = (NPC_GUIDE2_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
PLAYER_ACTOR* player;
Common_Get(clip).npc_clip->ct_proc(actorx, game, &ct_data);
guide2->npc_class.condition_info.hide_flg = FALSE; // show guide2 actor
guide2->npc_class.condition_info.demo_flg =
aNPC_COND_DEMO_SKIP_ENTRANCE_CHECK | aNPC_COND_DEMO_SKIP_HEAD_LOOKAT | aNPC_COND_DEMO_SKIP_TALK_CHECK |
aNPC_COND_DEMO_SKIP_ITEM | aNPC_COND_DEMO_SKIP_FORWARD_CHECK | aNPC_COND_DEMO_SKIP_BGCHECK |
aNPC_COND_DEMO_SKIP_OBJ_COL_CHECK | aNPC_COND_DEMO_SKIP_MOVE_Y | aNPC_COND_DEMO_SKIP_MOVE_CIRCLE_REV |
aNPC_COND_DEMO_SKIP_MOVE_RANGE_CHECK;
guide2->camera_morph_counter = 40;
guide2->obj_look_type = aNG2_OBJ_LOOK_TYPE_NORMAL;
guide2->npc_class.eye_y = 30.0f;
guide2->camera_move_set_counter = 1;
guide2->npc_class.palActorIgnoreTimer = -1;
guide2->train_door_actor = Actor_info_fgName_search(&play->actor_info, TRAIN_DOOR, ACTOR_PART_BG);
guide2->npc_class.actor_class.shape_info.draw_shadow = TRUE;
guide2->npc_class.actor_class.world.position.z = 130.0f;
/* Put the player into demo wait state */
mPlib_request_main_demo_wait_type1(game, 0, NULL);
player = GET_PLAYER_ACTOR(play);
if (player != NULL) {
/* Make the player invisible during the intro train ride */
player->actor_class.state_bitfield |= ACTOR_STATE_INVISIBLE;
}
aNG2_setupAction(guide2, play, aNG2_ACTION_ENTER);
/* Play train noises sfx repeatedly */
sAdo_SysLevStart(NA_SE_TRAIN_RIDE);
}
static void aNG2_actor_save(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->save_proc(actorx, game);
}
static void aNG2_actor_dt(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->dt_proc(actorx, game);
/* Stop train noise sfx */
sAdo_SysLevStop(NA_SE_TRAIN_RIDE);
}
static void aNG2_actor_init(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->init_proc(actorx, game);
}
static void aNG2_actor_draw(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->draw_proc(actorx, game);
}
#include "../src/ac_npc_guide2_animation.c_inc"
#include "../src/ac_npc_guide2_move.c_inc"
+45
View File
@@ -0,0 +1,45 @@
typedef struct npc_guide_animation_s {
int anim_id;
int talk_flag;
} aNG2_anime_c;
static void aNG2_set_animation(NPC_GUIDE2_ACTOR* guide2, int action) {
// clang-format off
static aNG2_anime_c anime[] = {
{ aNPC_ANIM_OPEN_D1, FALSE },
{ aNPC_ANIM_WALK1, FALSE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_SITDOWN_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_STANDUP_D1, FALSE },
{ aNPC_ANIM_WAIT1, FALSE },
{ aNPC_ANIM_WALK1, FALSE },
{ aNPC_ANIM_WALK1, FALSE },
{ aNPC_ANIM_TO_DECK_D1, FALSE },
{ aNPC_ANIM_KEITAI_ON1, FALSE },
{ aNPC_ANIM_KEITAI_TALK1, TRUE },
{ aNPC_ANIM_KEITAI_OFF1, FALSE },
{ aNPC_ANIM_OPEN_D2, FALSE },
{ aNPC_ANIM_WALK1, FALSE },
{ aNPC_ANIM_WAIT1, FALSE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_SITDOWN_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, FALSE },
};
// clang-format on
aNG2_anime_c* anime_info = &anime[action];
Common_Get(clip).npc_clip->animation_init_proc(&guide2->npc_class.actor_class, anime_info->anim_id,
anime_info->talk_flag);
}
+823
View File
@@ -0,0 +1,823 @@
static void aNG2_set_camera(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
static s8 mov_def_cnt[] = { 3, 0 };
static f32 obj_look_y_max[] = { 30.0f, 20.0f };
static f32 obj_look_y_spd[] = { 0.5f, 2.5f };
xyz_t eye;
xyz_t pos;
xyz_t ground;
s16 move;
f32 moveX;
f32 moveY;
int obj_look_type = guide2->obj_look_type;
s16 cur_angle;
f32 inter;
f32 sin;
f32 ground_y;
s16 angle;
move = guide2->camera_move;
guide2->camera_move += 0xE20;
angle = move;
angle += 0xE20;
moveX = cos_s(angle) * 0.1f;
angle = move;
angle += 0xE20;
moveY = sin_s(angle) * guide2->camera_move_range;
if (guide2->camera_move_y <= 0.0f && moveY >= 0.0f) {
s8 cnt = guide2->camera_move_cnt;
cnt--;
if (cnt < 0) {
s8 set_cnt = guide2->camera_move_set_counter;
set_cnt--;
if (set_cnt < 0) {
set_cnt = ARRAY_COUNT(mov_def_cnt) - 1;
}
guide2->camera_move_set_counter = set_cnt;
cnt = mov_def_cnt[set_cnt];
guide2->camera_move_range = 0.3f;
} else {
guide2->camera_move_range *= 0.35f;
}
guide2->camera_move_cnt = cnt;
}
guide2->camera_move_y = moveY;
cur_angle = guide2->camera_tilt_cur_angle;
chase_angle(&cur_angle, guide2->camera_tilt_goal_angle, guide2->camera_tilt_add);
guide2->camera_tilt_cur_angle = cur_angle;
sin = sin_s(cur_angle);
/* Set camera eye pos */
eye.x = moveX + sin * 20.0f + 100.0f;
eye.y = moveY + sin * -5.0f + 80.0f;
eye.z = 400.0f;
/* Move NPC head to current target */
chase_f(&guide2->npc_class.eye_y, obj_look_y_max[obj_look_type], obj_look_y_spd[obj_look_type] * 0.5f);
/* Set ground pos */
ground.x = guide2->npc_class.draw.shadow_pos.x;
ground.z = guide2->npc_class.draw.shadow_pos.z;
if (obj_look_type == aNG2_OBJ_LOOK_TYPE_TALK) {
/* Use the guide2's NPC shadow position for Y */
ground_y = guide2->npc_class.draw.shadow_pos.y;
} else {
/* Get the ground position for Y */
ground_y = mCoBG_GetBgY_OnlyCenter_FromWpos2(ground, 0.0f);
}
chase_f(&guide2->obj_dist_ground, ground_y, 0.5f);
ground.y = guide2->obj_dist_ground;
/* Set camera center pos */
if (guide2->lock_camera_flag == TRUE) {
pos.x = ground.x;
pos.y = ground.y + guide2->npc_class.eye_y;
pos.z = ground.z;
} else if (mDemo_Check(mDemo_TYPE_SPEAK, &guide2->npc_class.actor_class) == TRUE) {
int morph_counter = guide2->camera_morph_counter;
f32 r;
guide2->camera_morph_counter = morph_counter - 1;
if ((morph_counter - 1) == 0) {
guide2->lock_camera_flag = TRUE;
}
r = (40.0f - (f32)(morph_counter - 1)) / 40.0f;
inter = cKF_HermitCalc(r, 1.0f, 0.0f, 1.0f, 3.2f, 0.0f);
pos.x = (ground.x - 90.0f) * inter + 90.0f;
pos.y = ((ground.y + guide2->npc_class.eye_y) - 80.0f) * inter + 80.0f;
pos.z = (ground.z - 280.0f) * inter + 280.0f;
} else {
/* Default position */
pos.x = 90.0f;
pos.y = 80.0f;
pos.z = 280.0f;
}
pos.x += moveX;
pos.y += moveY;
Camera2_change_priority(play, 0);
Camera2_request_main_lock(play, &pos, &eye, 40.0f, 0, 60.0f, 800.0f, 5);
}
static void aNG2_set_camera_eyes(NPC_GUIDE2_ACTOR* guide2) {
if (guide2->camera_eyes_flag == TRUE) {
guide2->npc_class.request.head_pos.x = 100.0f;
guide2->npc_class.request.head_pos.y = guide2->npc_class.actor_class.eye.position.y;
guide2->npc_class.request.head_pos.z = 400.0f;
guide2->npc_class.request.head_priority = 3;
guide2->npc_class.request.head_type = 2;
}
}
static void aNG2_set_walk_spd(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->npc_class.movement.max_speed = 1.0f;
guide2->npc_class.movement.acceleration = 0.1f;
guide2->npc_class.movement.deceleration = 0.2f;
}
static void aNG2_set_walk_spd2(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->npc_class.movement.max_speed = 1.5f;
guide2->npc_class.movement.acceleration = 0.15f;
guide2->npc_class.movement.deceleration = 0.3f;
}
static void aNG2_set_stop_spd(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->npc_class.actor_class.speed = 0.0f;
guide2->npc_class.movement.max_speed = 0.0f;
guide2->npc_class.movement.acceleration = 0.0f;
guide2->npc_class.movement.deceleration = 0.0f;
}
static int aNG2_make_keitai(NPC_GUIDE2_ACTOR* guide2, GAME* game) {
int res = FALSE;
if (guide2->npc_class.right_hand.item_actor_p == NULL) {
if (Common_Get(clip).tools_clip != NULL) {
ACTOR* keitai = Common_Get(clip).tools_clip->aTOL_birth_proc(
TOOL_KEITAI, aTOL_ACTION_TAKEOUT, &guide2->npc_class.actor_class, game, -1, NULL);
if (keitai != NULL) {
guide2->npc_class.right_hand.item_actor_p = keitai;
res = TRUE;
}
}
} else {
res = TRUE;
}
return res;
}
static int aNG2_chg_cond_keitai(NPC_GUIDE2_ACTOR* guide2, int cond) {
int res = FALSE;
if (Common_Get(clip).tools_clip != NULL) {
if (Common_Get(clip).tools_clip->aTOL_chg_request_mode_proc(
&guide2->npc_class.actor_class, guide2->npc_class.right_hand.item_actor_p, cond) == TRUE) {
res = TRUE;
}
}
return res;
}
static void aNG2_talk_demo_proc(ACTOR* actorx) {
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == TRUE) {
Common_Get(clip).npc_clip->talk_demo_proc(actorx);
}
}
static u8* aNG2_getP_other_pl_name(void) {
Private_c* priv;
u32 player_no;
int i;
player_no = Common_Get(player_no);
priv = Save_Get(private_data) + player_no;
/* Search for players before this one's player no */
for (i = player_no; i != 0; i--) {
priv--;
if (mPr_NullCheckPersonalID(&priv->player_ID) != TRUE) {
return priv->player_ID.player_name;
}
}
priv = Save_Get(private_data) + player_no;
/* Search for players after this one's player no */
for (i = (PLAYER_NUM - 1) - player_no; i != 0; i--) {
priv++;
if (mPr_NullCheckPersonalID(&priv->player_ID) != TRUE) {
return priv->player_ID.player_name;
}
}
/* No other players to reference */
return NULL;
}
static int aNG2_check_pname(void) {
int ok = TRUE;
int i;
for (i = 0; i < PLAYER_NUM; i++) {
Private_c* priv = Save_GetPointer(private_data[i]);
if (i != Common_Get(player_no)) {
if (mem_cmp(Now_Private->player_ID.player_name, priv->player_ID.player_name, PLAYER_NAME_LEN) == TRUE) {
/* Another player has the same name in this town */
ok = FALSE;
break;
}
}
}
return ok;
}
static void aNG2_check_talk_msg_no(NPC_GUIDE2_ACTOR* guide2) {
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide2->npc_class.actor_class) == TRUE) {
int msg_no = mMsg_GET_MSG_NUM();
int flags;
switch (msg_no) {
case 0x2AC9:
flags = (1 << 3);
break;
case 0x2ADB:
flags = (1 << 2);
break;
case 0x2ADD:
flags = (1 << 1);
break;
case 0x2AD3:
flags = (1 << 0);
break;
default:
flags = 0;
break;
}
guide2->answer_flags |= flags;
}
}
static void aNG2_set_pl_face_type(NPC_GUIDE2_ACTOR* guide2) {
static int face_type_table[mPr_SEX_NUM][mPr_FACE_TYPE_NUM] = {
/* Male faces */
{
mPr_FACE_TYPE5,
mPr_FACE_TYPE6,
mPr_FACE_TYPE1,
mPr_FACE_TYPE4,
mPr_FACE_TYPE0,
mPr_FACE_TYPE2,
mPr_FACE_TYPE7,
mPr_FACE_TYPE3,
},
/* Female faces */
{
mPr_FACE_TYPE0,
mPr_FACE_TYPE5,
mPr_FACE_TYPE2,
mPr_FACE_TYPE6,
mPr_FACE_TYPE4,
mPr_FACE_TYPE7,
mPr_FACE_TYPE3,
mPr_FACE_TYPE1,
},
};
int answer_flags = guide2->answer_flags;
int face_type;
if ((answer_flags & 1) == 0) {
/* Select a random face for the player */
face_type = RANDOM(mPr_FACE_TYPE_NUM);
} else {
/* Select a face based on choices */
face_type = face_type_table[Now_Private->gender][answer_flags >> 1];
}
Now_Private->face = face_type;
}
static void aNG2_calc_body_angl(NPC_GUIDE2_ACTOR* guide2, f32 pos_x, f32 pos_z) {
f32 dX = pos_x - guide2->npc_class.actor_class.world.position.x;
f32 dZ = pos_z - guide2->npc_class.actor_class.world.position.z;
s16 angl = atans_table(dZ, dX);
chase_angle(&guide2->npc_class.actor_class.shape_info.rotation.y, angl, DEG2SHORT_ANGLE2(11.25f));
guide2->npc_class.actor_class.world.angle.y = guide2->npc_class.actor_class.shape_info.rotation.y;
}
static void aNG2_set_default_talk_info(void) {
mDemo_Set_camera(CAMERA2_PROCESS_NUM);
mDemo_Set_talk_change_player(FALSE);
mDemo_Set_use_zoom_sound(TRUE);
}
static void aNG2_enter(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
if (guide2->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
guide2->camera_eyes_flag = TRUE;
aNG2_setupAction(guide2, play, aNG2_ACTION_APPROACH);
} else if (cKF_FrameControl_passCheck_now(&guide2->npc_class.draw.main_animation.keyframe.frame_control, 20.0f) ==
TRUE) {
TRAINDOOR_ACTOR* train_door = (TRAINDOOR_ACTOR*)guide2->train_door_actor;
train_door->open_flag = TRUE;
}
}
static void aNG2_approach(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
if (guide2->npc_class.actor_class.world.position.z >= 290.0f) {
guide2->npc_class.actor_class.world.position.z = 290.0f;
aNG2_setupAction(guide2, play, aNG2_ACTION_TALK_START_WAIT);
}
}
static void aNG2_set_talk_info_talk_start_wait(ACTOR* actorx) {
mMsg_SET_FREE_STR(mMsg_FREE_STR0, aNG2_getP_other_pl_name(), PLAYER_NAME_LEN);
mDemo_Set_msg_num(0x2AD5);
aNG2_set_default_talk_info();
((NPC_GUIDE2_ACTOR*)actorx)->obj_look_type = aNG2_OBJ_LOOK_TYPE_TALK;
}
static void aNG2_talk_start_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
ACTOR* actorx = (ACTOR*)guide2;
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == TRUE) {
if (mDemo_Check_ListenAble() == FALSE &&
chase_angle(&actorx->shape_info.rotation.y, actorx->player_angle_y, 0x400) == TRUE) {
guide2->camera_eyes_flag = FALSE;
aNG2_setupAction(guide2, play, aNG2_ACTION_WAIT_PERMISSION);
mDemo_Set_ListenAble();
}
} else {
mDemo_Request(mDemo_TYPE_SPEAK, actorx, &aNG2_set_talk_info_talk_start_wait);
}
}
static void aNG2_wait_permission(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
aNG2_setupAction(guide2, play, aNG2_ACTION_SITDOWN);
}
}
static void aNG2_sitdown(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->npc_class.actor_class.world.position.x = 100.0f;
guide2->npc_class.actor_class.world.position.z = 280.0f;
guide2->npc_class.actor_class.shape_info.rotation.y = 0;
/* Wait for the sit animation to finish before continuing */
if (guide2->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
mMsg_UNSET_LOCKCONTINUE();
guide2->next_action = aNG2_ACTION_PNAME_MENU_OPEN_WAIT;
aNG2_setupAction(guide2, play, aNG2_ACTION_SDON_AND_PB_WAIT);
}
}
static void aNG2_sdon_and_pb_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
if (order != 0 && mMsg_CHECK_MAINNORMALCONTINUE()) {
aNG2_setupAction(guide2, play, guide2->next_action);
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
}
static void aNG2_pname_menu_open_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
if (mMsg_CHECK_MAIN_WAIT() == TRUE) {
aNG2_setupAction(guide2, play, 7);
}
}
static void aNG2_pname_menu_close_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
if (play->submenu.open_flag == FALSE) {
aNG2_setupAction(guide2, play, 8);
}
}
static void aNG2_msg_win_open_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
static int msg_no[] = { 0x2ACA, 0x2AE2 };
static int next_act_idx[] = { 10, 9 };
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
if (mMsg_Check_not_series_main_wait(msg_p) == TRUE) {
int idx = 0;
mMsg_Unset_LockContinue(msg_p);
/* Check if the player's name already exists in town */
if (aNG2_check_pname() == FALSE) {
idx = 1;
}
mMsg_Set_continue_msg_num(msg_p, msg_no[idx]);
mMsg_Set_ForceNext(msg_p);
aNG2_setupAction(guide2, play, next_act_idx[idx]);
}
}
static void aNG2_sex_select_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0: // male
case mChoice_CHOICE1: // female
aNG2_setupAction(guide2, play, aNG2_ACTION_SEX_SELECT_WAIT2);
break;
case mChoice_CHOICE2: // 'That's not right'
guide2->next_action = aNG2_ACTION_PNAME_MENU_OPEN_WAIT;
aNG2_setupAction(guide2, play, aNG2_ACTION_SDON_AND_PB_WAIT);
break;
}
}
}
static void aNG2_sex_select_wait2(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
static int next_act_idx[] = { aNG2_ACTION_STANDUP_START_WAIT, aNG2_ACTION_SEX_SELECT_AFTER };
int order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
if (order != 0) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
if (mMsg_Check_MainNormalContinue(msg_p) == TRUE) {
int idx = -1;
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0: // male
switch (order) {
case 1: // That's right
Now_Private->gender = mPr_SEX_MALE;
break;
case 2: // I'm not a boy
Now_Private->gender = mPr_SEX_FEMALE;
break;
}
idx = 0;
mMsg_Set_continue_msg_num(msg_p, 0x2AD9);
mMsg_Set_ForceNext(msg_p);
break;
case mChoice_CHOICE1: // female
switch (order) {
case 1: // That's right
Now_Private->gender = mPr_SEX_FEMALE;
break;
case 2: // I'm not a girl
Now_Private->gender = mPr_SEX_MALE;
break;
}
idx = 1;
break;
}
if (idx != -1) {
aNG2_setupAction(guide2, play, next_act_idx[idx]);
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
}
}
}
static void aNG2_sex_select_after(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
if (order != 0 && mMsg_Check_MainNormalContinue(msg_p)) {
aNG2_setupAction(guide2, play, aNG2_ACTION_STANDUP_START_WAIT);
mMsg_Set_continue_msg_num(msg_p, 0x2AD9);
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
}
static void aNG2_standup_start_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
/* Wait for guide2 to stop speaking to us */
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide2->npc_class.actor_class) == FALSE) {
guide2->obj_look_type = aNG2_OBJ_LOOK_TYPE_NORMAL;
aNG2_setupAction(guide2, play, aNG2_ACTION_STANDUP);
}
}
static void aNG2_standup(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
/* Wait for animation to finish */
if (guide2->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
aNG2_setupAction(guide2, play, guide2->next_action);
}
}
static void aNG2_move_ready(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->npc_class.actor_class.world.position.x = 100.0f;
guide2->npc_class.actor_class.world.position.z = 300.0f;
aNG2_setupAction(guide2, play, aNG2_ACTION_MOVE_TO_AISLE);
}
static void aNG2_move_to_aisle(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
aNG2_calc_body_angl(guide2, 140.0f, 290.0f);
if (guide2->npc_class.actor_class.world.position.x > 140.0f) {
aNG2_setupAction(guide2, play, aNG2_ACTION_MOVE_TO_DOOR);
}
}
static void aNG2_move_to_door(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
aNG2_calc_body_angl(guide2, 140.0f, 130.0f);
/* Check if we reached the door */
if (guide2->npc_class.actor_class.world.position.z < 130.0f) {
aNG2_setupAction(guide2, play, aNG2_ACTION_MOVE_TO_DECK);
}
/* Check if we should start rotating */
if (guide2->npc_class.draw.shadow_pos.z < 140.0f) {
guide2->camera_tilt_goal_angle = DEG2SHORT_ANGLE2(90.0f);
guide2->camera_tilt_add = DEG2SHORT_ANGLE2(2.8125f);
}
}
static void aNG2_move_to_deck(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
if (cKF_FrameControl_passCheck_now(&guide2->npc_class.draw.main_animation.keyframe.frame_control, 9.0f) == TRUE) {
TRAINDOOR_ACTOR* train_door = (TRAINDOOR_ACTOR*)guide2->train_door_actor;
train_door->open_flag = TRUE;
}
/* Reuse standup state to wait for animation to finish */
aNG2_standup(guide2, play);
}
static void aNG2_set_talk_info_keitai_on(ACTOR* actorx) {
mDemo_Set_msg_num(0x2ADE);
aNG2_set_default_talk_info();
}
static void aNG2_keitai_on(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
static f32 anmSpd[] = { 0.0f, 0.5f };
int idx = aNG2_make_keitai(guide2, &play->game);
guide2->npc_class.draw.main_animation.keyframe.frame_control.speed = anmSpd[idx];
if (idx != 0) {
if (mDemo_Check(mDemo_TYPE_SPEAK, (ACTOR*)guide2) == TRUE) {
if (mDemo_Check_ListenAble() == FALSE) {
mDemo_Set_ListenAble();
}
} else {
/* Request to start speaking */
mDemo_Request(mDemo_TYPE_SPEAK, (ACTOR*)guide2, &aNG2_set_talk_info_keitai_on);
}
}
/* Wait for animation to finish */
if (guide2->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
aNG2_setupAction(guide2, play, aNG2_ACTION_KEITAI_TALK);
}
}
static void aNG2_keitai_talk(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide2->npc_class.actor_class) == FALSE) {
aNG2_setupAction(guide2, play, aNG2_ACTION_KEITAI_OFF);
} else if (guide2->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
Common_Get(clip).npc_clip->animation_init_proc(&guide2->npc_class.actor_class, aNPC_ANIM_KEITAI_TALK2, TRUE);
}
}
static void aNG2_open_door(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
chase_angle(&guide2->npc_class.actor_class.shape_info.rotation.y, DEG2SHORT_ANGLE2(-180.0f),
DEG2SHORT_ANGLE2(0.703125f));
if (cKF_FrameControl_passCheck_now(&guide2->npc_class.draw.main_animation.keyframe.frame_control, 22.0f) == TRUE) {
TRAINDOOR_ACTOR* train_door = (TRAINDOOR_ACTOR*)guide2->train_door_actor;
train_door->open_flag = TRUE;
if (guide2->npc_class.draw.shadow_pos.z < 140.0f) {
guide2->camera_tilt_goal_angle = 0;
guide2->camera_tilt_add = 0x600;
}
}
/* Reuse standup state to wait for animation to finish */
aNG2_standup(guide2, play);
}
static void aNG2_return_approach(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->npc_class.actor_class.world.position.x = 140.0f;
guide2->npc_class.actor_class.world.angle.y = 0;
guide2->npc_class.actor_class.shape_info.rotation.y = 0;
if (guide2->npc_class.actor_class.world.position.z > 290.0f) {
aNG2_setupAction(guide2, play, aNG2_ACTION_LAST_TALK_START_WAIT);
}
}
static void aNG2_set_talk_info_last_talk_start_wait(ACTOR* actorx) {
mDemo_Set_msg_num(0x2AD1);
aNG2_set_default_talk_info();
((NPC_GUIDE2_ACTOR*)actorx)->obj_look_type = aNG2_OBJ_LOOK_TYPE_TALK;
}
static void aNG2_last_talk_start_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
ACTOR* actorx = (ACTOR*)guide2;
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == TRUE) {
if (mDemo_Check_ListenAble() == FALSE &&
chase_angle(&actorx->shape_info.rotation.y, actorx->player_angle_y, 0x400) == TRUE) {
guide2->camera_eyes_flag = FALSE;
aNG2_setupAction(guide2, play, aNG2_ACTION_SITDOWN2_START_WAIT);
mDemo_Set_ListenAble();
}
} else {
mDemo_Request(mDemo_TYPE_SPEAK, actorx, &aNG2_set_talk_info_last_talk_start_wait);
}
}
static void aNG2_sitdown2_start_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
if (order != 0) {
aNG2_setupAction(guide2, play, aNG2_ACTION_SITDOWN2);
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
}
static void aNG2_sitdown2(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->npc_class.actor_class.world.position.x = 100.0f;
guide2->npc_class.actor_class.world.position.z = 280.0f;
guide2->npc_class.actor_class.shape_info.rotation.y = 0;
/* Wait for animation to finish */
aNG2_standup(guide2, play);
}
static void aNG2_last_talk_end_wait(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide2->npc_class.actor_class) == FALSE) {
aNG2_setupAction(guide2, play, aNG2_ACTION_SCENE_CHANGE_WAIT);
}
}
/* Init procs */
static void aNG2_sitdown_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
mMsg_SET_LOCKCONTINUE();
}
static void aNG2_pname_menu_open_wait_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
mMsg_Set_LockContinue(msg_p);
mMsg_request_main_disappear_wait_type1(msg_p);
}
static void aNG2_pname_menu_close_wait_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
Submenu* submenu = &play->submenu;
mSM_open_submenu(submenu, mSM_OVL_LEDIT, mLE_TYPE_PLAYER_NAME, 0);
}
static void aNG2_msg_win_open_wait_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
mMsg_REQUEST_MAIN_APPEAR_WAIT_TYPE1();
}
static void aNG2_pname_ng_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->next_action = 6;
}
static void aNG2_standup_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->next_action = aNG2_ACTION_MOVE_READY;
}
static void aNG2_move_ready_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
}
static void aNG2_move_to_aisle_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
aNG2_set_walk_spd2(guide2, play);
}
static void aNG2_move_to_deck_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
aNG2_set_stop_spd(guide2, play);
guide2->npc_class.actor_class.world.position.x = 140.0f;
guide2->npc_class.actor_class.world.position.z = 130.0f;
guide2->next_action = aNG2_ACTION_KEITAI_ON;
}
static void aNG2_keitai_off_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
aNG2_chg_cond_keitai(guide2, aTOL_ACTION_PUTAWAY);
guide2->next_action = aNG2_ACTION_OPEN_DOOR;
}
static void aNG2_open_door_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->next_action = aNG2_ACTION_RETURN_APPROACH;
}
static void aNG2_return_approach_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->camera_eyes_flag = TRUE;
aNG2_set_walk_spd2(guide2, play);
guide2->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
}
static void aNG2_sitdown2_start_wait_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
static void aNG2_sitdown2_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
guide2->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
guide2->next_action = aNG2_ACTION_LAST_TALK_END_WAIT;
}
static void aNG2_last_talk_end_wait_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
aNG2_chg_cond_keitai(guide2, aTOL_ACTION_DESTRUCT);
guide2->npc_class.right_hand.item_actor_p = NULL;
}
static void aNG2_scene_change_wait_init(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play) {
/* Init next scene transition */
goto_next_scene(play, 0, 1);
play->fb_wipe_type = 3;
Common_Get(transition).wipe_type = 4;
mEv_SetFirstJob();
mEv_SetFirstIntro();
mEnv_DecideWeather_NormalGameStart();
aNG2_set_pl_face_type(guide2);
mPr_SetNowPrivateCloth();
Common_Set(submenu_disabled, TRUE);
mBGMPsComp_make_ps_wipe(0x41C2);
mBGMPsComp_scene_mode(18);
}
typedef void (*aNG2_INIT_PROC)(NPC_GUIDE2_ACTOR*, GAME_PLAY*);
static void aNG2_init_proc(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play, int action) {
static aNG2_INIT_PROC init_proc[] = {
(aNG2_INIT_PROC)&none_proc1,
&aNG2_set_walk_spd,
&aNG2_set_stop_spd,
(aNG2_INIT_PROC)&none_proc1,
&aNG2_sitdown_init,
(aNG2_INIT_PROC)&none_proc1,
&aNG2_pname_menu_open_wait_init,
&aNG2_pname_menu_close_wait_init,
&aNG2_msg_win_open_wait_init,
&aNG2_pname_ng_init,
(aNG2_INIT_PROC)&none_proc1,
(aNG2_INIT_PROC)&none_proc1,
(aNG2_INIT_PROC)&none_proc1,
(aNG2_INIT_PROC)&none_proc1,
&aNG2_standup_init,
&aNG2_move_ready_init,
&aNG2_move_to_aisle_init,
(aNG2_INIT_PROC)&none_proc1,
&aNG2_move_to_deck_init,
(aNG2_INIT_PROC)&none_proc1,
(aNG2_INIT_PROC)&none_proc1,
&aNG2_keitai_off_init,
&aNG2_open_door_init,
&aNG2_return_approach_init,
&aNG2_set_stop_spd,
&aNG2_sitdown2_start_wait_init,
&aNG2_sitdown2_init,
&aNG2_last_talk_end_wait_init,
&aNG2_scene_change_wait_init,
};
(*init_proc[action])(guide2, play);
}
static void aNG2_setupAction(NPC_GUIDE2_ACTOR* guide2, GAME_PLAY* play, int action) {
static aNG2_PROC process[] = {
&aNG2_enter,
&aNG2_approach,
&aNG2_talk_start_wait,
&aNG2_wait_permission,
&aNG2_sitdown,
&aNG2_sdon_and_pb_wait,
&aNG2_pname_menu_open_wait,
&aNG2_pname_menu_close_wait,
&aNG2_msg_win_open_wait,
&aNG2_sdon_and_pb_wait,
&aNG2_sex_select_wait,
&aNG2_sex_select_wait2,
&aNG2_sex_select_after,
&aNG2_standup_start_wait,
&aNG2_standup,
&aNG2_move_ready,
&aNG2_move_to_aisle,
&aNG2_move_to_door,
&aNG2_move_to_deck,
&aNG2_keitai_on,
&aNG2_keitai_talk,
&aNG2_standup,
&aNG2_open_door,
&aNG2_return_approach,
&aNG2_last_talk_start_wait,
&aNG2_sitdown2_start_wait,
&aNG2_sitdown2,
&aNG2_last_talk_end_wait,
(aNG2_PROC)&none_proc1,
};
guide2->action = action;
guide2->proc = process[action];
aNG2_set_animation(guide2, action);
aNG2_init_proc(guide2, play, action);
}
static void aNG2_actor_move(ACTOR* actorx, GAME* game) {
NPC_GUIDE2_ACTOR* guide2 = (NPC_GUIDE2_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
Common_Get(clip).npc_clip->move_before_proc(actorx, game);
aNG2_talk_demo_proc(actorx);
aNG2_check_talk_msg_no(guide2);
(*guide2->proc)(guide2, play);
Common_Get(clip).npc_clip->move_after_proc(actorx, game);
aNG2_set_camera(guide2, play);
aNG2_set_camera_eyes(guide2);
mSC_change_player_freeze(play);
}
+59
View File
@@ -0,0 +1,59 @@
typedef struct npc_guide_animation_s {
int anim_id;
int talk_flag;
} aNGD_anime_c;
static void aNGD_set_animation(NPC_GUIDE_ACTOR* guide, int action) {
// clang-format off
static aNGD_anime_c anime[] = {
{ aNPC_ANIM_OPEN_D1, FALSE },
{ aNPC_ANIM_WALK1, FALSE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_SITDOWN_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_STANDUP_D1, FALSE },
{ aNPC_ANIM_WAIT1, FALSE },
{ aNPC_ANIM_WALK1, FALSE },
{ aNPC_ANIM_WALK1, FALSE },
{ aNPC_ANIM_TO_DECK_D1, FALSE },
{ aNPC_ANIM_KEITAI_ON1, FALSE },
{ aNPC_ANIM_KEITAI_TALK1, TRUE },
{ aNPC_ANIM_KEITAI_OFF1, FALSE },
{ aNPC_ANIM_OPEN_D2, FALSE },
{ aNPC_ANIM_WALK1, FALSE },
{ aNPC_ANIM_WAIT1, FALSE },
{ aNPC_ANIM_WAIT1, TRUE },
{ aNPC_ANIM_SITDOWN_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
{ aNPC_ANIM_SITDOWN_WAIT_D1, FALSE },
};
// clang-format on
aNGD_anime_c* anime_info = &anime[action];
int anim_id = anime_info->anim_id;
int talk_flag = anime_info->talk_flag;
if ((action == aNGD_ACTION_SDON_AND_PB_WAIT || action == aNGD_ACTION_MSG_WIN_OPEN_WAIT ||
action == aNGD_ACTION_CONFIRM_INPUT_DATA) &&
guide->next_action != aNGD_ACTION_TIME_MENU_OPEN_WAIT &&
guide->next_action != aNGD_ACTION_TIME_MENU_CLOSE_WAIT) {
anim_id = aNPC_ANIM_SITDOWN_WAIT_D1;
talk_flag = TRUE;
}
Common_Get(clip).npc_clip->animation_init_proc(&guide->npc_class.actor_class, anim_id, talk_flag);
}
+908
View File
@@ -0,0 +1,908 @@
static void aNGD_set_camera(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
static s8 mov_def_cnt[] = { 3, 0 };
static f32 obj_look_y_max[] = { 30.0f, 20.0f };
static f32 obj_look_y_spd[] = { 0.5f, 2.5f };
xyz_t eye;
xyz_t pos;
xyz_t ground;
s16 move;
f32 moveX;
f32 moveY;
int obj_look_type = guide->obj_look_type;
s16 cur_angle;
f32 inter;
f32 sin;
f32 ground_y;
s16 angle;
move = guide->camera_move;
guide->camera_move += 0xE20;
angle = move;
angle += 0xE20;
moveX = cos_s(angle) * 0.1f;
angle = move;
angle += 0xE20;
moveY = sin_s(angle) * guide->camera_move_range;
if (guide->camera_move_y <= 0.0f && moveY >= 0.0f) {
s8 cnt = guide->camera_move_cnt;
cnt--;
if (cnt < 0) {
s8 set_cnt = guide->camera_move_set_counter;
set_cnt--;
if (set_cnt < 0) {
set_cnt = ARRAY_COUNT(mov_def_cnt) - 1;
}
guide->camera_move_set_counter = set_cnt;
cnt = mov_def_cnt[set_cnt];
guide->camera_move_range = 0.3f;
} else {
guide->camera_move_range *= 0.35f;
}
guide->camera_move_cnt = cnt;
}
guide->camera_move_y = moveY;
cur_angle = guide->camera_tilt_cur_angle;
chase_angle(&cur_angle, guide->camera_tilt_goal_angle, guide->camera_tilt_add);
guide->camera_tilt_cur_angle = cur_angle;
sin = sin_s(cur_angle);
/* Set camera eye pos */
eye.x = moveX + sin * 20.0f + 100.0f;
eye.y = moveY + sin * -5.0f + 80.0f;
eye.z = 400.0f;
/* Move NPC head to current target */
chase_f(&guide->npc_class.eye_y, obj_look_y_max[obj_look_type], obj_look_y_spd[obj_look_type] * 0.5f);
/* Set ground pos */
ground.x = guide->npc_class.draw.shadow_pos.x;
ground.z = guide->npc_class.draw.shadow_pos.z;
if (obj_look_type == aNGD_OBJ_LOOK_TYPE_TALK) {
/* Use the guide's NPC shadow position for Y */
ground_y = guide->npc_class.draw.shadow_pos.y;
} else {
/* Get the ground position for Y */
ground_y = mCoBG_GetBgY_OnlyCenter_FromWpos2(ground, 0.0f);
}
chase_f(&guide->obj_dist_ground, ground_y, 0.5f);
ground.y = guide->obj_dist_ground;
/* Set camera center pos */
if (guide->lock_camera_flag == TRUE) {
pos.x = ground.x;
pos.y = ground.y + guide->npc_class.eye_y;
pos.z = ground.z;
} else if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == TRUE) {
int morph_counter = guide->camera_morph_counter;
f32 r;
guide->camera_morph_counter = morph_counter - 1;
if ((morph_counter - 1) == 0) {
guide->lock_camera_flag = TRUE;
}
r = (40.0f - (f32)(morph_counter - 1)) / 40.0f;
inter = cKF_HermitCalc(r, 1.0f, 0.0f, 1.0f, 3.2f, 0.0f);
pos.x = (ground.x - 90.0f) * inter + 90.0f;
pos.y = ((ground.y + guide->npc_class.eye_y) - 80.0f) * inter + 80.0f;
pos.z = (ground.z - 280.0f) * inter + 280.0f;
} else {
/* Default position */
pos.x = 90.0f;
pos.y = 80.0f;
pos.z = 280.0f;
}
pos.x += moveX;
pos.y += moveY;
Camera2_change_priority(play, 0);
Camera2_request_main_lock(play, &pos, &eye, 40.0f, 0, 60.0f, 800.0f, 5);
}
static void aNGD_set_camera_eyes(NPC_GUIDE_ACTOR* guide) {
if (guide->camera_eyes_flag == TRUE) {
guide->npc_class.request.head_pos.x = 100.0f;
guide->npc_class.request.head_pos.y = guide->npc_class.actor_class.eye.position.y;
guide->npc_class.request.head_pos.z = 400.0f;
guide->npc_class.request.head_priority = 3;
guide->npc_class.request.head_type = 2;
}
}
static void aNGD_set_walk_spd(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->npc_class.movement.max_speed = 1.0f;
guide->npc_class.movement.acceleration = 0.1f;
guide->npc_class.movement.deceleration = 0.2f;
}
static void aNGD_set_walk_spd2(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->npc_class.movement.max_speed = 1.5f;
guide->npc_class.movement.acceleration = 0.15f;
guide->npc_class.movement.deceleration = 0.3f;
}
static void aNGD_set_stop_spd(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->npc_class.actor_class.speed = 0.0f;
guide->npc_class.movement.max_speed = 0.0f;
guide->npc_class.movement.acceleration = 0.0f;
guide->npc_class.movement.deceleration = 0.0f;
}
static int aNGD_make_keitai(NPC_GUIDE_ACTOR* guide, GAME* game) {
int res = FALSE;
if (guide->npc_class.right_hand.item_actor_p == NULL) {
if (Common_Get(clip).tools_clip != NULL) {
ACTOR* keitai = Common_Get(clip).tools_clip->aTOL_birth_proc(TOOL_KEITAI, aTOL_ACTION_TAKEOUT,
&guide->npc_class.actor_class, game, -1, NULL);
if (keitai != NULL) {
guide->npc_class.right_hand.item_actor_p = keitai;
res = TRUE;
}
}
} else {
res = TRUE;
}
return res;
}
static int aNGD_chg_cond_keitai(NPC_GUIDE_ACTOR* guide, int cond) {
int res = FALSE;
if (Common_Get(clip).tools_clip != NULL) {
if (Common_Get(clip).tools_clip->aTOL_chg_request_mode_proc(
&guide->npc_class.actor_class, guide->npc_class.right_hand.item_actor_p, cond) == TRUE) {
res = TRUE;
}
}
return res;
}
static void aNGD_talk_demo_proc(ACTOR* actorx) {
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == TRUE) {
Common_Get(clip).npc_clip->talk_demo_proc(actorx);
}
}
static void aNGD_check_talk_msg_no(NPC_GUIDE_ACTOR* guide) {
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == TRUE) {
int msg_no = mMsg_GET_MSG_NUM();
int flags;
switch (msg_no) {
case 0x2AC9:
flags = (1 << 3);
break;
case 0x2ACD:
flags = (1 << 2);
break;
case 0x2ACF:
flags = (1 << 1);
break;
case 0x2AD3:
flags = (1 << 0);
break;
default:
flags = 0;
break;
}
guide->answer_flags |= flags;
}
}
static void aNGD_set_pl_face_type(NPC_GUIDE_ACTOR* guide) {
static int face_type_table[mPr_SEX_NUM][mPr_FACE_TYPE_NUM] = {
/* Male faces */
{
mPr_FACE_TYPE5,
mPr_FACE_TYPE6,
mPr_FACE_TYPE1,
mPr_FACE_TYPE4,
mPr_FACE_TYPE0,
mPr_FACE_TYPE2,
mPr_FACE_TYPE7,
mPr_FACE_TYPE3,
},
/* Female faces */
{
mPr_FACE_TYPE0,
mPr_FACE_TYPE5,
mPr_FACE_TYPE2,
mPr_FACE_TYPE6,
mPr_FACE_TYPE4,
mPr_FACE_TYPE7,
mPr_FACE_TYPE3,
mPr_FACE_TYPE1,
},
};
int answer_flags = guide->answer_flags;
int face_type;
if ((answer_flags & 1) == 0) {
/* Select a random face for the player */
face_type = RANDOM(mPr_FACE_TYPE_NUM);
} else {
/* Select a face based on choices */
face_type = face_type_table[Now_Private->gender][answer_flags >> 1];
}
Now_Private->face = face_type;
}
static void aNGD_calc_body_angl(NPC_GUIDE_ACTOR* guide, f32 pos_x, f32 pos_z) {
f32 dX = pos_x - guide->npc_class.actor_class.world.position.x;
f32 dZ = pos_z - guide->npc_class.actor_class.world.position.z;
s16 angl = atans_table(dZ, dX);
chase_angle(&guide->npc_class.actor_class.shape_info.rotation.y, angl, DEG2SHORT_ANGLE2(11.25f));
guide->npc_class.actor_class.world.angle.y = guide->npc_class.actor_class.shape_info.rotation.y;
}
static void aNGD_set_default_talk_info(void) {
mDemo_Set_camera(CAMERA2_PROCESS_NUM);
mDemo_Set_talk_change_player(FALSE);
mDemo_Set_use_zoom_sound(TRUE);
}
static void aNGD_enter(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
guide->camera_eyes_flag = TRUE;
aNGD_setupAction(guide, play, aNGD_ACTION_APPROACH);
} else if (cKF_FrameControl_passCheck_now(&guide->npc_class.draw.main_animation.keyframe.frame_control, 20.0f) ==
TRUE) {
TRAINDOOR_ACTOR* train_door = (TRAINDOOR_ACTOR*)guide->train_door_actor;
train_door->open_flag = TRUE;
}
}
static void aNGD_approach(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (guide->npc_class.actor_class.world.position.z >= 290.0f) {
guide->npc_class.actor_class.world.position.z = 290.0f;
aNGD_setupAction(guide, play, aNGD_ACTION_TALK_START_WAIT);
}
}
static void aNGD_set_talk_info_talk_start_wait(ACTOR* actorx) {
mDemo_Set_msg_num(0x2AC6);
aNGD_set_default_talk_info();
((NPC_GUIDE_ACTOR*)actorx)->obj_look_type = aNGD_OBJ_LOOK_TYPE_TALK;
}
static void aNGD_talk_start_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
ACTOR* actorx = (ACTOR*)guide;
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == TRUE) {
if (mDemo_Check_ListenAble() == FALSE &&
chase_angle(&actorx->shape_info.rotation.y, actorx->player_angle_y, 0x400) == TRUE) {
guide->camera_eyes_flag = FALSE;
aNGD_setupAction(guide, play, aNGD_ACTION_TIME_CHECK);
mDemo_Set_ListenAble();
}
} else {
mDemo_Request(mDemo_TYPE_SPEAK, actorx, &aNGD_set_talk_info_talk_start_wait);
}
}
static void aNGD_time_check(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0:
aNGD_setupAction(guide, play, aNGD_ACTION_WAIT_PERMISSION);
break;
case mChoice_CHOICE1:
guide->next_action = aNGD_ACTION_TIME_MENU_OPEN_WAIT;
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
break;
}
}
}
static void aNGD_sdon_and_pb_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
if (order != 0 && mMsg_CHECK_MAINNORMALCONTINUE()) {
aNGD_setupAction(guide, play, guide->next_action);
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
}
static void aNGD_time_menu_open_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (mMsg_CHECK_MAIN_WAIT() == TRUE) {
aNGD_setupAction(guide, play, guide->action + 1);
}
}
static void aNGD_time_menu_close_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (play->submenu.open_flag == FALSE) {
aNGD_setupAction(guide, play, aNGD_ACTION_MSG_WIN_OPEN_WAIT);
}
}
static void aNGD_msg_win_open_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
static int msg_no[] = { 0x2AE5, 0x2ACA, 0x2AE4 };
static int next_act_idx[] = {
aNGD_ACTION_CONFIRM_INPUT_DATA,
aNGD_ACTION_SEX_SELECT_WAIT,
aNGD_ACTION_CONFIRM_INPUT_DATA,
};
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
if (mMsg_Check_not_series_main_wait(msg_p) == TRUE) {
int idx = -1;
switch (guide->next_action) {
case aNGD_ACTION_TIME_MENU_CLOSE_WAIT:
idx = 0;
break;
case aNGD_ACTION_PNAME_MENU_CLOSE_WAIT:
idx = 1;
break;
case aNGD_ACTION_CNAME_MENU_CLOSE_WAIT:
idx = 2;
break;
}
if (idx >= 0) {
mMsg_Unset_LockContinue(msg_p);
mMsg_Set_continue_msg_num(msg_p, msg_no[idx]);
mMsg_Set_ForceNext(msg_p);
aNGD_setupAction(guide, play, next_act_idx[idx]);
}
}
}
static void aNGD_confirm_input_data(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0:
switch (guide->next_action) {
case aNGD_ACTION_TIME_MENU_CLOSE_WAIT:
aNGD_setupAction(guide, play, aNGD_ACTION_WAIT_PERMISSION);
break;
case aNGD_ACTION_CNAME_MENU_CLOSE_WAIT:
aNGD_setupAction(guide, play, aNGD_ACTION_STANDUP_START_WAIT);
break;
}
break;
case mChoice_CHOICE1:
switch (guide->next_action) {
case aNGD_ACTION_TIME_MENU_CLOSE_WAIT:
guide->next_action = aNGD_ACTION_TIME_MENU_OPEN_WAIT;
break;
case aNGD_ACTION_CNAME_MENU_CLOSE_WAIT:
guide->next_action = aNGD_ACTION_CNAME_MENU_OPEN_WAIT;
break;
}
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
break;
}
}
}
static void aNGD_wait_permission(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
aNGD_setupAction(guide, play, aNGD_ACTION_SITDOWN);
}
}
static void aNGD_sitdown(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->npc_class.actor_class.world.position.x = 100.0f;
guide->npc_class.actor_class.world.position.z = 280.0f;
guide->npc_class.actor_class.shape_info.rotation.y = 0;
/* Wait for the sit animation to finish before continuing */
if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
mMsg_UNSET_LOCKCONTINUE();
guide->next_action = aNGD_ACTION_PNAME_MENU_OPEN_WAIT;
Common_Set(sunlight_flag, TRUE); // turn on the sunlight as we exit tunnel
/* Turn off echoes since we exited the tunnel */
sAdo_TrgSeEcho(FALSE);
sAdo_LevSeEcho(FALSE);
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
}
}
static void aNGD_sex_select_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0: // male
case mChoice_CHOICE1: // female
aNGD_setupAction(guide, play, aNGD_ACTION_SEX_SELECT_WAIT2);
break;
case mChoice_CHOICE2: // 'That's not right'
guide->next_action = aNGD_ACTION_PNAME_MENU_OPEN_WAIT;
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
break;
}
}
}
static void aNGD_sex_select_wait2(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
int order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
if (order != 0 && mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0: // male
switch (order) {
case 1: // That's right
Now_Private->gender = mPr_SEX_MALE;
break;
case 2: // I'm not a boy
Now_Private->gender = mPr_SEX_FEMALE;
break;
}
guide->next_action = aNGD_ACTION_CNAME_MENU_OPEN_WAIT;
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
break;
case mChoice_CHOICE1: // female
switch (order) {
case 1: // That's right
Now_Private->gender = mPr_SEX_FEMALE;
break;
case 2: // I'm not a girl
Now_Private->gender = mPr_SEX_MALE;
break;
}
aNGD_setupAction(guide, play, aNGD_ACTION_SEX_SELECT_AFTER);
break;
}
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
}
static void aNGD_sex_select_after(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
if (order != 0 && mMsg_Check_MainNormalContinue(msg_p)) {
mMsg_Set_continue_msg_num(msg_p, 0x2AD8);
mMsg_Set_ForceNext(msg_p);
guide->next_action = aNGD_ACTION_CNAME_MENU_OPEN_WAIT;
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
}
static void aNGD_standup_start_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
/* Wait for guide to stop speaking to us */
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == FALSE) {
guide->obj_look_type = aNGD_OBJ_LOOK_TYPE_NORMAL;
aNGD_setupAction(guide, play, aNGD_ACTION_STANDUP);
}
}
static void aNGD_standup(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
/* Wait for animation to finish */
if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
aNGD_setupAction(guide, play, guide->next_action);
}
}
static void aNGD_move_ready(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->npc_class.actor_class.world.position.x = 100.0f;
guide->npc_class.actor_class.world.position.z = 300.0f;
aNGD_setupAction(guide, play, aNGD_ACTION_MOVE_TO_AISLE);
}
static void aNGD_move_to_aisle(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
aNGD_calc_body_angl(guide, 140.0f, 290.0f);
if (guide->npc_class.actor_class.world.position.x > 140.0f) {
aNGD_setupAction(guide, play, aNGD_ACTION_MOVE_TO_DOOR);
}
}
static void aNGD_move_to_door(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
aNGD_calc_body_angl(guide, 140.0f, 130.0f);
/* Check if we reached the door */
if (guide->npc_class.actor_class.world.position.z < 130.0f) {
aNGD_setupAction(guide, play, aNGD_ACTION_MOVE_TO_DECK);
}
/* Check if we should start rotating */
if (guide->npc_class.draw.shadow_pos.z < 140.0f) {
guide->camera_tilt_goal_angle = DEG2SHORT_ANGLE2(90.0f);
guide->camera_tilt_add = DEG2SHORT_ANGLE2(2.8125f);
}
}
static void aNGD_move_to_deck(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (cKF_FrameControl_passCheck_now(&guide->npc_class.draw.main_animation.keyframe.frame_control, 9.0f) == TRUE) {
TRAINDOOR_ACTOR* train_door = (TRAINDOOR_ACTOR*)guide->train_door_actor;
train_door->open_flag = TRUE;
}
/* Reuse standup state to wait for animation to finish */
aNGD_standup(guide, play);
}
static void aNGD_set_talk_info_keitai_on(ACTOR* actorx) {
mDemo_Set_msg_num(0x2AD0);
aNGD_set_default_talk_info();
}
static void aNGD_keitai_on(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
static f32 anmSpd[] = { 0.0f, 0.5f };
int idx = aNGD_make_keitai(guide, &play->game);
guide->npc_class.draw.main_animation.keyframe.frame_control.speed = anmSpd[idx];
if (idx != 0) {
if (mDemo_Check(mDemo_TYPE_SPEAK, (ACTOR*)guide) == TRUE) {
if (mDemo_Check_ListenAble() == FALSE) {
mDemo_Set_ListenAble();
}
} else {
/* Request to start speaking */
mDemo_Request(mDemo_TYPE_SPEAK, (ACTOR*)guide, &aNGD_set_talk_info_keitai_on);
}
}
/* Wait for animation to finish */
if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
aNGD_setupAction(guide, play, aNGD_ACTION_KEITAI_TALK);
}
}
static void aNGD_keitai_talk(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == FALSE) {
aNGD_setupAction(guide, play, aNGD_ACTION_KEITAI_OFF);
} else if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
Common_Get(clip).npc_clip->animation_init_proc(&guide->npc_class.actor_class, aNPC_ANIM_KEITAI_TALK2, TRUE);
}
}
static void aNGD_open_door(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
chase_angle(&guide->npc_class.actor_class.shape_info.rotation.y, DEG2SHORT_ANGLE2(-180.0f),
DEG2SHORT_ANGLE2(0.703125f));
if (cKF_FrameControl_passCheck_now(&guide->npc_class.draw.main_animation.keyframe.frame_control, 22.0f) == TRUE) {
TRAINDOOR_ACTOR* train_door = (TRAINDOOR_ACTOR*)guide->train_door_actor;
train_door->open_flag = TRUE;
if (guide->npc_class.draw.shadow_pos.z < 140.0f) {
guide->camera_tilt_goal_angle = 0;
guide->camera_tilt_add = 0x600;
}
}
/* Reuse standup state to wait for animation to finish */
aNGD_standup(guide, play);
}
static void aNGD_return_approach(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->npc_class.actor_class.world.position.x = 140.0f;
guide->npc_class.actor_class.world.angle.y = 0;
guide->npc_class.actor_class.shape_info.rotation.y = 0;
if (guide->npc_class.actor_class.world.position.z > 290.0f) {
aNGD_setupAction(guide, play, aNGD_ACTION_LAST_TALK_START_WAIT);
}
}
static void aNGD_set_talk_info_last_talk_start_wait(ACTOR* actorx) {
mDemo_Set_msg_num(0x2AD1);
aNGD_set_default_talk_info();
((NPC_GUIDE_ACTOR*)actorx)->obj_look_type = aNGD_OBJ_LOOK_TYPE_TALK;
}
static void aNGD_last_talk_start_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
ACTOR* actorx = (ACTOR*)guide;
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == TRUE) {
if (mDemo_Check_ListenAble() == FALSE &&
chase_angle(&actorx->shape_info.rotation.y, actorx->player_angle_y, 0x400) == TRUE) {
guide->camera_eyes_flag = FALSE;
aNGD_setupAction(guide, play, aNGD_ACTION_SITDOWN2_START_WAIT);
mDemo_Set_ListenAble();
}
} else {
mDemo_Request(mDemo_TYPE_SPEAK, actorx, &aNGD_set_talk_info_last_talk_start_wait);
}
}
static void aNGD_sitdown2_start_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
if (order != 0) {
aNGD_setupAction(guide, play, aNGD_ACTION_SITDOWN2);
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
}
static void aNGD_sitdown2(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->npc_class.actor_class.world.position.x = 100.0f;
guide->npc_class.actor_class.world.position.z = 280.0f;
guide->npc_class.actor_class.shape_info.rotation.y = 0;
/* Wait for animation to finish */
aNGD_standup(guide, play);
}
static void aNGD_last_talk_end_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == FALSE) {
aNGD_setupAction(guide, play, aNGD_ACTION_SCENE_CHANGE_WAIT);
}
}
/* Init procs */
static void aNGD_time_menu_open_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
mMsg_Set_LockContinue(msg_p);
mMsg_request_main_disappear_wait_type1(msg_p);
guide->next_action = aNGD_ACTION_TIME_MENU_CLOSE_WAIT;
}
static void aNGD_time_menu_close_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
Submenu* submenu = &play->submenu;
switch (guide->next_action) {
case aNGD_ACTION_TIME_MENU_CLOSE_WAIT:
mSM_open_submenu(submenu, mSM_OVL_TIMEIN, mTI_OVL_OPEN_INITIAL, 0);
break;
case aNGD_ACTION_PNAME_MENU_CLOSE_WAIT:
mSM_open_submenu(submenu, mSM_OVL_LEDIT, mLE_TYPE_PLAYER_NAME, 0);
break;
case aNGD_ACTION_CNAME_MENU_CLOSE_WAIT:
mSM_open_submenu(submenu, mSM_OVL_LEDIT, mLE_TYPE_COUNTRY_NAME, 0);
break;
}
}
static void aNGD_msg_win_open_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
mMsg_REQUEST_MAIN_APPEAR_WAIT_TYPE1();
}
static void aNGD_sitdown_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
mMsg_SET_LOCKCONTINUE();
}
static void aNGD_pname_menu_open_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
mMsg_Set_LockContinue(msg_p);
mMsg_request_main_disappear_wait_type1(msg_p);
guide->next_action = aNGD_ACTION_PNAME_MENU_CLOSE_WAIT;
}
static void aNGD_cname_menu_open_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
mMsg_Set_LockContinue(msg_p);
mMsg_request_main_disappear_wait_type1(msg_p);
guide->next_action = aNGD_ACTION_CNAME_MENU_CLOSE_WAIT;
}
static void aNGD_standup_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->next_action = aNGD_ACTION_MOVE_READY;
}
static void aNGD_move_ready_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
}
static void aNGD_move_to_aisle_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
aNGD_set_walk_spd2(guide, play);
}
static void aNGD_move_to_deck_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
aNGD_set_stop_spd(guide, play);
guide->npc_class.actor_class.world.position.x = 140.0f;
guide->npc_class.actor_class.world.position.z = 130.0f;
guide->next_action = aNGD_ACTION_KEITAI_ON;
}
static void aNGD_keitai_off_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
aNGD_chg_cond_keitai(guide, aTOL_ACTION_PUTAWAY);
guide->next_action = aNGD_ACTION_OPEN_DOOR;
}
static void aNGD_open_door_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->next_action = aNGD_ACTION_RETURN_APPROACH;
}
static void aNGD_return_approach_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->camera_eyes_flag = TRUE;
aNGD_set_walk_spd2(guide, play);
guide->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
}
static void aNGD_sitdown2_start_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
static void aNGD_sitdown2_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
guide->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
guide->next_action = aNGD_ACTION_LAST_TALK_END_WAIT;
}
static void aNGD_last_talk_end_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
aNGD_chg_cond_keitai(guide, aTOL_ACTION_DESTRUCT);
guide->npc_class.right_hand.item_actor_p = NULL;
}
static void aNGD_scene_change_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
u8 term;
int town_day;
/* Init next scene transition */
goto_next_scene(play, 0, 1);
play->fb_wipe_type = 3;
Common_Get(transition).wipe_type = 4;
/* Clear plant growth renew time */
Save_Set(all_grow_renew_time, mTM_rtcTime_clear_code);
/* Update player ID town info */
if (Now_Private != NULL) {
mLd_CopyLandName(Now_Private->player_ID.land_name, Save_Get(land_info).name);
}
/* Init island */
bcopy(Save_GetPointer(land_info), &Save_Get(island).landinfo, sizeof(mLd_land_info_c)); // Copy the town's land info
mNpc_DecideIslandNpc(&Save_Get(island).animal); // Pick islander
/* Update some renew time values to current rtc time */
lbRTC_TimeCopy(Save_GetPointer(last_grow_time), Common_GetPointer(time.rtc_time));
mTM_set_renew_time(Save_GetPointer(renew_time), Common_GetPointer(time.rtc_time));
mTM_set_season(); // initialize the season
/* Initialize first Stalk Market info */
Kabu_decide_price_schedule();
/* Init Post Office */
mPO_post_office_init();
/* Set insect term info */
Save_Set(insect_term, Common_Get(time.rtc_time.month));
Save_Set(insect_term_transition_offset, RANDOM(6));
/* Set fish term info */
term = Common_Get(time.rtc_time.month) * 2;
if (Common_Get(time.rtc_time.day) > 15) {
term++;
}
Save_Set(gyoei_term, term);
Save_Set(gyoei_term_transition_offset, RANDOM(6));
/* Decide Town Day date */
town_day = 1 + RANDOM(30);
if (town_day >= 4) {
town_day++; // add one to prevent conflict with Fireworks Festival (4th of July)
}
Save_Set(town_day, town_day);
mSP_ShopGameStartCt(NULL);
mNtc_SetInitData();
mPr_SetNowPrivateCloth();
mEv_SetFirstJob();
mEv_SetFirstIntro();
mEnv_DecideWeather_FirstGameStart();
mCD_calendar_clear(-1);
mCD_calendar_wellcome_on();
mNpc_SetParentNameAllAnimal();
aNGD_set_pl_face_type(guide);
Common_Set(submenu_disabled, TRUE);
mRmTp_SetDefaultLightSwitchData(1);
mBGMPsComp_make_ps_wipe(0x41C2);
mBGMPsComp_scene_mode(18);
}
typedef void (*aNGD_INIT_PROC)(NPC_GUIDE_ACTOR*, GAME_PLAY*);
static void aNGD_init_proc(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play, int action) {
static aNGD_INIT_PROC init_proc[] = {
(aNGD_INIT_PROC)&none_proc1,
&aNGD_set_walk_spd,
&aNGD_set_stop_spd,
(aNGD_INIT_PROC)&none_proc1,
(aNGD_INIT_PROC)&none_proc1,
&aNGD_time_menu_open_wait_init,
&aNGD_time_menu_close_wait_init,
&aNGD_msg_win_open_wait_init,
(aNGD_INIT_PROC)&none_proc1,
(aNGD_INIT_PROC)&none_proc1,
&aNGD_sitdown_init,
&aNGD_pname_menu_open_wait_init,
&aNGD_time_menu_close_wait_init,
(aNGD_INIT_PROC)&none_proc1,
(aNGD_INIT_PROC)&none_proc1,
(aNGD_INIT_PROC)&none_proc1,
&aNGD_cname_menu_open_wait_init,
&aNGD_time_menu_close_wait_init,
(aNGD_INIT_PROC)&none_proc1,
&aNGD_standup_init,
&aNGD_move_ready_init,
&aNGD_move_to_aisle_init,
(aNGD_INIT_PROC)&none_proc1,
&aNGD_move_to_deck_init,
(aNGD_INIT_PROC)&none_proc1,
(aNGD_INIT_PROC)&none_proc1,
&aNGD_keitai_off_init,
&aNGD_open_door_init,
&aNGD_return_approach_init,
&aNGD_set_stop_spd,
&aNGD_sitdown2_start_wait_init,
&aNGD_sitdown2_init,
&aNGD_last_talk_end_wait_init,
&aNGD_scene_change_wait_init,
};
(*init_proc[action])(guide, play);
}
static void aNGD_setupAction(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play, int action) {
static aNGD_PROC process[] = {
&aNGD_enter,
&aNGD_approach,
&aNGD_talk_start_wait,
&aNGD_time_check,
&aNGD_sdon_and_pb_wait,
&aNGD_time_menu_open_wait,
&aNGD_time_menu_close_wait,
&aNGD_msg_win_open_wait,
&aNGD_confirm_input_data,
&aNGD_wait_permission,
&aNGD_sitdown,
&aNGD_time_menu_open_wait,
&aNGD_time_menu_close_wait,
&aNGD_sex_select_wait,
&aNGD_sex_select_wait2,
&aNGD_sex_select_after,
&aNGD_time_menu_open_wait,
&aNGD_time_menu_close_wait,
&aNGD_standup_start_wait,
&aNGD_standup,
&aNGD_move_ready,
&aNGD_move_to_aisle,
&aNGD_move_to_door,
&aNGD_move_to_deck,
&aNGD_keitai_on,
&aNGD_keitai_talk,
&aNGD_standup,
&aNGD_open_door,
&aNGD_return_approach,
&aNGD_last_talk_start_wait,
&aNGD_sitdown2_start_wait,
&aNGD_sitdown2,
&aNGD_last_talk_end_wait,
(aNGD_PROC)&none_proc1,
};
guide->action = action;
guide->proc = process[action];
aNGD_set_animation(guide, action);
aNGD_init_proc(guide, play, action);
}
static void aNGD_actor_move(ACTOR* actorx, GAME* game) {
NPC_GUIDE_ACTOR* guide = (NPC_GUIDE_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
Common_Get(clip).npc_clip->move_before_proc(actorx, game);
aNGD_talk_demo_proc(actorx);
aNGD_check_talk_msg_no(guide);
(*guide->proc)(guide, play);
Common_Get(clip).npc_clip->move_after_proc(actorx, game);
aNGD_set_camera(guide, play);
aNGD_set_camera_eyes(guide);
mSC_change_player_freeze(play);
}
+162
View File
@@ -0,0 +1,162 @@
#include "ac_npc_rcn_guide.h"
#include "m_play.h"
#include "m_name_table.h"
#include "libultra/libultra.h"
#include "m_common_data.h"
#include "m_player_lib.h"
#include "m_bgm.h"
#include "m_msg.h"
#include "m_font.h"
#include "m_house.h"
#include "ac_intro_demo.h"
/* sizeof(aNRG_talk_data_c) == 0x0C */
typedef struct rcn_guide_talk_data_s {
/* 0x00 */ int msg_no;
/* 0x04 */ u8 turn_flag;
/* 0x05 */ u8 camera_type;
/* 0x06 */ u8 melody_flag;
/* 0x08 */ aNRG_TALK_PROC talk_proc;
} aNRG_talk_data_c;
enum {
aNRC_THINK_CALL,
aNRC_THINK_APPROACH,
aNRG_THINK_INTRODUCE,
aNRC_THINK_TURN,
aNRC_THINK_TAKE_WITH,
aNRC_THINK_EXPLAIN,
aNRC_THINK_DECIDE_HOUSE_WAIT,
aNRC_THINK_STOP_WADE,
aNRC_THINK_BEFORE_OPEN_DOOR_TALK,
aNRC_THINK_BEFORE_OPEN_DOOR_TALK2,
aNRC_THINK_ENTER_WAIT,
aNRC_THINK_RESTART_WAIT,
aNRC_THINK_RESTART_TALK,
aNRC_THINK_DECIDE_HOUSE,
aNRC_THINK_EXIT_TURN,
aNRC_THINK_EXIT,
aNRC_THINK_WAIT,
aNRC_THINK_NUM
};
enum {
aNRG_FORCE_TALK_CALL,
aNRG_FORCE_TALK_INTRODUCE,
aNRG_FORCE_TALK_EXPLAIN,
aNRG_FORCE_TALK_STOP_WADE,
aNRG_FORCE_TALK_BEFORE_OPEN_DOOR_TALK,
aNRG_FORCE_TALK_BEFORE_OPEN_DOOR2_TALK,
aNRG_FORCE_TALK_HOUSE_TAKEN,
aNRG_FORCE_TALK_HOUSE_VACANT,
aNRG_FORCE_TALK_NUM
};
enum {
aNRG_NORM_TALK_DECIDE_HOUSE,
aNRG_NORM_TALK_NUM
};
static void aNRG_actor_ct(ACTOR* actorx, GAME* game);
static void aNRG_actor_save(ACTOR* actorx, GAME* game);
static void aNRG_actor_dt(ACTOR* actorx, GAME* game);
static void aNRG_actor_init(ACTOR* actorx, GAME* game);
static void aNRG_actor_draw(ACTOR* actorx, GAME* game);
static void aNRG_actor_move(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Npc_Rcn_Guide_Profile = {
mAc_PROFILE_NPC_RCN_GUIDE,
ACTOR_PART_NPC,
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
SP_NPC_RCN_GUIDE,
ACTOR_OBJ_BANK_KEEP,
sizeof(NPC_RCN_GUIDE_ACTOR),
&aNRG_actor_ct,
&aNRG_actor_dt,
&aNRG_actor_init,
mActor_NONE_PROC1,
&aNRG_actor_save,
};
// clang-format on
static void aNRG_force_talk_request(ACTOR* actorx, GAME* game);
static int aNRG_talk_init(ACTOR* actorx, GAME* game);
static int aNRG_talk_end_chk(ACTOR* actorx, GAME* game);
static void aNRG_schedule_proc(NPC_ACTOR* nactorx, GAME_PLAY* game, int sched_idx);
static void aNRG_setup_think_proc(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play, int think_idx);
static void aNRG_actor_ct(ACTOR* actorx, GAME* game) {
// clang-format off
static aNPC_ct_data_c ct_data = {
&aNRG_actor_move,
&aNRG_actor_draw,
5,
&aNRG_force_talk_request,
&aNRG_talk_init,
&aNRG_talk_end_chk,
0,
};
// clang-format on
NPC_RCN_GUIDE_ACTOR* rcn_guide = (NPC_RCN_GUIDE_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
PLAYER_ACTOR* player;
s16 angle_y;
if (Common_Get(clip).npc_clip->birth_check_proc(actorx, &play->game) == TRUE) {
rcn_guide->npc_class.schedule.schedule_proc = &aNRG_schedule_proc;
Common_Get(clip).npc_clip->ct_proc(actorx, &play->game, &ct_data);
rcn_guide->npc_class.collision.priority = 2;
rcn_guide->melody_copy = rcn_guide->npc_class.talk_info.melody_inst;
/* Set shop acre */
mFI_BlockKind2BkNum(&rcn_guide->shop_bx, &rcn_guide->shop_bz, mRF_BLOCKKIND_SHOP);
rcn_guide->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
rcn_guide->npc_class.actor_class.status_data.weight = 255;
player = GET_PLAYER_ACTOR(play);
if (player != NULL) {
angle_y = search_position_angleY(&rcn_guide->npc_class.actor_class.world.position,
&player->actor_class.world.position);
} else {
angle_y = 0;
}
rcn_guide->npc_class.actor_class.shape_info.rotation.y = angle_y;
rcn_guide->npc_class.actor_class.world.angle.y = angle_y;
}
}
static void aNRG_actor_save(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->save_proc(actorx, game);
}
static void aNRG_actor_dt(ACTOR* actorx, GAME* game) {
NPC_RCN_GUIDE_ACTOR* rcn_guide = (NPC_RCN_GUIDE_ACTOR*)actorx;
/* Stop playing the initial intro music when destruct due to entering a house */
if (rcn_guide->think_idx == aNRC_THINK_WAIT) {
mBGMPsComp_delete_ps_demo(BGM_INTRO_RCN_GUIDE, 0x168);
}
Common_Get(clip).npc_clip->dt_proc(actorx, game);
}
static void aNRG_actor_init(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->init_proc(actorx, game);
}
static void aNRG_actor_draw(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->draw_proc(actorx, game);
}
#include "../src/ac_npc_rcn_guide_move.c_inc"
#include "../src/ac_npc_rcn_guide_talk.c_inc"
#include "../src/ac_npc_rcn_guide_schedule.c_inc"
+229
View File
@@ -0,0 +1,229 @@
#include "ac_npc_rcn_guide2.h"
#include "m_common_data.h"
#include "m_bgm.h"
#include "m_player_lib.h"
#include "m_font.h"
#include "m_msg.h"
#include "m_soncho.h"
#include "ac_intro_demo.h"
enum {
aNRG2_JOB1,
aNRG2_JOB2,
aNRG2_JOB3,
aNRG2_JOB4,
aNRG2_JOB5,
aNRG2_JOB6,
aNRG2_JOB7,
aNRG2_JOB8,
aNRG2_JOB9,
aNRG2_JOB10,
aNRG2_JOB11,
aNRG2_JOB_NUM
};
enum {
aNRG2_NORM_TALK_JOB1_START,
aNRG2_NORM_TALK_JOB2_START,
aNRG2_NORM_TALK_JOB3_START,
aNRG2_NORM_TALK_JOB4_START,
aNRG2_NORM_TALK_JOB5_START,
aNRG2_NORM_TALK_JOB5_2_START,
aNRG2_NORM_TALK_JOB6_START,
aNRG2_NORM_TALK_JOB7_START,
aNRG2_NORM_TALK_JOB10_START,
aNRG2_NORM_TALK_JOB11_START,
aNRG2_NORM_TALK_JOB1_REFUSE,
aNRG2_NORM_TALK_JOB2_REFUSE,
aNRG2_NORM_TALK_JOB3_REFUSE,
aNRG2_NORM_TALK_JOB4_REFUSE,
aNRG2_NORM_TALK_JOB5_REFUSE,
aNRG2_NORM_TALK_JOB5_2_REFUSE,
aNRG2_NORM_TALK_JOB6_REFUSE,
aNRG2_NORM_TALK_JOB7_REFUSE,
aNRG2_NORM_TALK_J1_CONT1,
aNRG2_NORM_TALK_J1_CONT2,
aNRG2_NORM_TALK_J1_CONT3,
aNRG2_NORM_TALK_J2_CONT1,
aNRG2_NORM_TALK_J3_CONT1,
aNRG2_NORM_TALK_J3_CONT2,
aNRG2_NORM_TALK_J4_CONT1,
aNRG2_NORM_TALK_J4_CONT2,
aNRG2_NORM_TALK_J5_CONT3,
aNRG2_NORM_TALK_J5_CONT1,
aNRG2_NORM_TALK_J5_CONT2,
aNRG2_NORM_TALK_J6_CONT1,
aNRG2_NORM_TALK_J6_CONT2,
aNRG2_NORM_TALK_J7_CONT1,
aNRG2_NORM_TALK_J10_CONT1,
aNRG2_NORM_TALK_J11_CONT1,
aNRG2_NORM_TALK_J1_END,
aNRG2_NORM_TALK_J2_END,
aNRG2_NORM_TALK_J3_END,
aNRG2_NORM_TALK_J4_END,
aNRG2_NORM_TALK_J5_END,
aNRG2_NORM_TALK_J6_END,
aNRG2_NORM_TALK_J7_END,
aNRG2_NORM_TALK_J10_END,
aNRG2_NORM_TALK_J11_END,
aNRG2_NORM_TALK_AGAIN,
aNRG2_NORM_TALK_NUM
};
enum {
aNRG2_FORCE_TALK_SAY_HELLO,
aNRG2_FORCE_TALK_SAY_HELLO2,
aNRG2_FORCE_TALK_SAY_HELLO_SP,
aNRG2_FORCE_TALK_CLOTH_CHK,
aNRG2_FORCE_TALK_UPSTAIR_CHK,
aNRG2_FORCE_TALK_NUM
};
enum {
aNRG2_THINK_SAY_HELLO,
aNRG2_THINK_SAY_HELLO2,
aNRG2_THINK_SAY_HELLO3,
aNRG2_THINK_SEND_AWAY,
aNRG2_THINK_TALK_START_WAIT,
aNRG2_THINK_JOB_START_WAIT,
aNRG2_THINK_ALL_JOB_END,
aNRG2_THINK_NUM
};
enum {
aNRG2_TALK_SAY_HELLO,
aNRG2_TALK_SAY_HELLO_SP,
aNRG2_TALK_SAY_HELLO_SP2,
aNRG2_TALK_CLOTH_CHK,
aNRG2_TALK_TALK_END_WAIT,
aNRG2_TALK_DEMO_START_WAIT,
aNRG2_TALK_DEMO_END_WAIT,
aNRG2_TALK_DEMO_END_WAIT2,
aNRG2_TALK_JOB_START,
aNRG2_TALK_JOB_END,
aNRG2_TALK_3RD_JOB_END,
aNRG2_TALK_DEMO2_START_WAIT,
aNRG2_TALK_DEMO2_START_WAIT2,
aNRG2_TALK_DEMO2_END,
aNRG2_TALK_GIVE_NEW_PAPER,
aNRG2_TALK_CHECK_MORE_PAPER,
aNRG2_TALK_DECIDE_NEW_TARGET,
aNRG2_TALK_DEMO3_START_WAIT,
aNRG2_TALK_DEMO3_START_WAIT2,
aNRG2_TALK_DEMO3_END_WAIT,
aNRG2_TALK_ALL_JOB_END,
aNRG2_TALK_NUM
};
typedef struct rcn_guide2_talk_info_s {
int msg_no;
aNRG2_TALK_PROC talk_proc;
} aNRG2_talk_info_c;
static void aNRG2_actor_ct(ACTOR* actorx, GAME* game);
static void aNRG2_actor_save(ACTOR* actorx, GAME* game);
static void aNRG2_actor_dt(ACTOR* actorx, GAME* game);
static void aNRG2_actor_init(ACTOR* actorx, GAME* game);
static void aNRG2_actor_draw(ACTOR* actorx, GAME* game);
static void aNRG2_actor_move(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Npc_Rcn_Guide2_Profile = {
mAc_PROFILE_NPC_RCN_GUIDE2,
ACTOR_PART_NPC,
ACTOR_STATE_NONE,
SP_NPC_RCN_GUIDE2,
ACTOR_OBJ_BANK_KEEP,
sizeof(NPC_RCN_GUIDE2_ACTOR),
&aNRG2_actor_ct,
&aNRG2_actor_dt,
&aNRG2_actor_init,
mActor_NONE_PROC1,
&aNRG2_actor_save,
};
// clang-format on
static void aNRG2_change_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, int talk_proc_idx);
static void aNRG2_force_talk_request(ACTOR* actorx, GAME* game);
static int aNRG2_talk_init(ACTOR* actorx, GAME* game);
static int aNRG2_talk_end_chk(ACTOR* actorx, GAME* game);
static void aNRG2_schedule_proc(NPC_ACTOR* nactorx, GAME_PLAY* game, int sched_idx);
static void aNRG2_setup_think_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, GAME_PLAY* play, int think_idx);
static void aNRG2_actor_ct(ACTOR* actorx, GAME* game) {
// clang-format off
static aNPC_ct_data_c ct_data = {
&aNRG2_actor_move,
&aNRG2_actor_draw,
5,
&aNRG2_force_talk_request,
&aNRG2_talk_init,
&aNRG2_talk_end_chk,
1,
};
// clang-format on
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
if (Common_Get(clip).npc_clip->birth_check_proc(actorx, game) == TRUE) {
int shop_type = 0;
switch (actorx->npc_id) {
case SP_NPC_RCN_GUIDE2:
shop_type = 0;
break;
case SP_NPC_RCN_GUIDE2_1:
shop_type = 1;
break;
case SP_NPC_RCN_GUIDE2_2:
shop_type = 2;
break;
case SP_NPC_RCN_GUIDE2_3:
shop_type = 3;
break;
}
rcn_guide2->npc_class.draw.draw_type = shop_type;
rcn_guide2->npc_class.schedule.schedule_proc = &aNRG2_schedule_proc;
Common_Get(clip).npc_clip->ct_proc(actorx, game, &ct_data);
}
}
static void aNRG2_actor_save(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->save_proc(actorx, game);
}
static void aNRG2_actor_dt(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->dt_proc(actorx, game);
}
static void aNRG2_actor_init(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->init_proc(actorx, game);
}
static void aNRG2_actor_draw(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->draw_proc(actorx, game);
}
#include "../src/ac_npc_rcn_guide2_move.c_inc"
#include "../src/ac_npc_rcn_guide2_talk.c_inc"
#include "../src/ac_npc_rcn_guide2_schedule.c_inc"
+30
View File
@@ -0,0 +1,30 @@
static void aNRG2_set_exit_info(ACTOR* actorx) {
GAME_PLAY* play = (GAME_PLAY*)gamePT;
if (goto_other_scene(play, Common_GetPointer(structure_exit_door_data), TRUE) != 1) {
mDemo_End(actorx);
} else {
mBGMPsComp_scene_mode(14);
mBGMPsComp_make_ps_wipe(0x195);
}
}
static void aNRG2_exit_check(ACTOR* actorx, GAME_PLAY* play) {
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
if (player != NULL && player->item_in_front == EXIT_DOOR1 && play->fb_wipe_mode == 0) {
mDemo_Request(mDemo_TYPE_EXITSCENE, actorx, &aNRG2_set_exit_info);
}
}
static void aNRG2_actor_move(ACTOR* actorx, GAME* game) {
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
if (rcn_guide2->npc_class.action.idx == aNPC_ACT_WAIT) {
rcn_guide2->npc_class.action.step = aNPC_ACTION_END_STEP;
}
Common_Get(clip).npc_clip->move_proc(actorx, game);
aNRG2_exit_check(actorx, play);
}
+374
View File
@@ -0,0 +1,374 @@
static int aNRG2_setup_j1_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
int talk_idx = aNRG2_NORM_TALK_J1_CONT1;
if (mPr_GetPossessionItemIdxWithCond(Now_Private, ITM_CLOTH016, mPr_ITEM_COND_NORMAL) == -1) {
if (mPr_GetPossessionItemIdx(Now_Private, EMPTY_NO) == -1) {
talk_idx = aNRG2_NORM_TALK_J1_CONT3;
} else {
talk_idx = aNRG2_NORM_TALK_J1_CONT2;
}
}
return talk_idx;
}
static int aNRG2_setup_j2_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
int talk_idx = aNRG2_NORM_TALK_J2_CONT1;
if (rcn_guide2->can_ask_again_flag == TRUE) {
talk_idx = aNRG2_NORM_TALK_AGAIN;
}
return talk_idx;
}
static int aNRG2_setup_j3_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int talk_idx = aNRG2_NORM_TALK_J3_CONT1;
if (mQst_CheckRemoveTarget(errand_p) == TRUE) {
talk_idx = aNRG2_NORM_TALK_J3_CONT2;
} else if (rcn_guide2->can_ask_again_flag == TRUE) {
talk_idx = aNRG2_NORM_TALK_AGAIN;
}
return talk_idx;
}
static int aNRG2_setup_j4_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int talk_idx = aNRG2_NORM_TALK_J4_CONT1;
if (rcn_guide2->can_ask_again_flag == TRUE) {
talk_idx = aNRG2_NORM_TALK_AGAIN;
} else if (mQst_CheckRemoveTarget(errand_p) == TRUE) {
talk_idx = aNRG2_NORM_TALK_J4_CONT2;
} else if (errand_p->base.progress == 3) {
talk_idx = aNRG2_NORM_TALK_J5_CONT3;
}
return talk_idx;
}
static int aNRG2_setup_j5_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int talk_idx = aNRG2_NORM_TALK_J5_CONT1;
if (mQst_CheckRemoveTarget(errand_p) == TRUE) {
talk_idx = aNRG2_NORM_TALK_J5_CONT2;
}
return talk_idx;
}
static int aNRG2_setup_j6_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int talk_idx = aNRG2_NORM_TALK_J6_CONT1;
if (mQst_CheckRemoveTarget(errand_p) == TRUE) {
talk_idx = aNRG2_NORM_TALK_J6_CONT2;
} else if (rcn_guide2->can_ask_again_flag == TRUE) {
talk_idx = aNRG2_NORM_TALK_AGAIN;
}
return talk_idx;
}
static int aNRG2_setup_j7_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
int talk_idx = aNRG2_NORM_TALK_J7_CONT1;
if (rcn_guide2->can_ask_again_flag == TRUE) {
talk_idx = aNRG2_NORM_TALK_AGAIN;
}
return talk_idx;
}
static int aNRG2_setup_j10_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
return aNRG2_NORM_TALK_J10_CONT1;
}
static int aNRG2_setup_j11_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
return aNRG2_NORM_TALK_J11_CONT1;
}
typedef int (*aNRG2_SETUP_JOB_CONT_PROC)(NPC_RCN_GUIDE2_ACTOR*);
static void aNRG2_setup_job_cont(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
// clang-format off
static aNRG2_SETUP_JOB_CONT_PROC setup_job_cont_proc[] = {
&aNRG2_setup_j1_cont,
&aNRG2_setup_j2_cont,
&aNRG2_setup_j3_cont,
&aNRG2_setup_j4_cont,
&aNRG2_setup_j5_cont,
&aNRG2_setup_j6_cont,
&aNRG2_setup_j7_cont,
&aNRG2_setup_j4_cont,
&aNRG2_setup_j6_cont,
&aNRG2_setup_j10_cont,
&aNRG2_setup_j11_cont,
};
// clang-format on
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int idx = errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH;
rcn_guide2->talk_idx = (*setup_job_cont_proc[idx])(rcn_guide2);
}
static void aNRG2_talk_start_wait(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, GAME_PLAY* play) {
// clang-format off
static int job_end_talk_idx[] = {
aNRG2_NORM_TALK_J1_END,
aNRG2_NORM_TALK_J2_END,
aNRG2_NORM_TALK_J3_END,
aNRG2_NORM_TALK_J4_END,
aNRG2_NORM_TALK_J5_END,
aNRG2_NORM_TALK_J6_END,
aNRG2_NORM_TALK_J7_END,
aNRG2_NORM_TALK_J4_END,
aNRG2_NORM_TALK_J6_END,
aNRG2_NORM_TALK_J10_END,
aNRG2_NORM_TALK_J11_END,
};
// clang-format on
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int idx = errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH;
if (mQst_CheckFirstJobFin(errand_p) == TRUE) {
rcn_guide2->talk_idx = job_end_talk_idx[idx];
rcn_guide2->can_ask_again_flag = FALSE;
} else {
aNRG2_setup_job_cont(rcn_guide2);
}
}
static void aNRG2_job_start_wait(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, GAME_PLAY* play) {
// clang-format off
static int job_start_talk_idx[] = {
aNRG2_NORM_TALK_JOB1_START,
aNRG2_NORM_TALK_JOB2_START,
aNRG2_NORM_TALK_JOB3_START,
aNRG2_NORM_TALK_JOB4_START,
aNRG2_NORM_TALK_JOB5_START,
aNRG2_NORM_TALK_JOB6_START,
aNRG2_NORM_TALK_JOB7_START,
aNRG2_NORM_TALK_JOB4_START,
aNRG2_NORM_TALK_JOB6_START,
aNRG2_NORM_TALK_JOB10_START,
aNRG2_NORM_TALK_JOB11_START,
};
// clang-format on
// clang-format off
static int job_start_refuse_talk_idx[] = {
aNRG2_NORM_TALK_JOB1_REFUSE,
aNRG2_NORM_TALK_JOB2_REFUSE,
aNRG2_NORM_TALK_JOB3_REFUSE,
aNRG2_NORM_TALK_JOB4_REFUSE,
aNRG2_NORM_TALK_JOB5_REFUSE,
aNRG2_NORM_TALK_JOB6_REFUSE,
aNRG2_NORM_TALK_JOB7_REFUSE,
aNRG2_NORM_TALK_JOB4_REFUSE,
aNRG2_NORM_TALK_JOB6_REFUSE,
-1,
-1,
};
// clang-format on
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int idx = errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH;
if (aNRG2_check_job_start() == TRUE) {
rcn_guide2->talk_idx = job_start_talk_idx[idx];
} else {
rcn_guide2->talk_idx = job_start_refuse_talk_idx[idx];
}
}
static void aNRG2_all_job_end(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, GAME_PLAY* play) {
if (play->fb_wipe_mode == 0) {
rcn_guide2->counter++;
if (rcn_guide2->counter > 60) {
aNRG2_setup_think_proc(rcn_guide2, play, aNRG2_THINK_SEND_AWAY);
}
}
}
static void aNRG2_think_main_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)nactorx;
if (nactorx->action.step == aNPC_ACTION_END_STEP) {
(*rcn_guide2->think_proc)(rcn_guide2, play);
}
}
static void aNRG2_think_init_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)nactorx;
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int think_idx;
rcn_guide2->npc_class.condition_info.hide_request = FALSE;
rcn_guide2->npc_class.actor_class.status_data.weight = 255;
rcn_guide2->npc_class.actor_class.shape_info.rotation.y = rcn_guide2->npc_class.actor_class.player_angle_y;
rcn_guide2->npc_class.actor_class.world.angle.y = rcn_guide2->npc_class.actor_class.player_angle_y;
if (Common_Get(quest).work == 0) {
Common_Get(quest).work = 1;
rcn_guide2->daily_speak_flag = TRUE;
if (errand_p->base.quest_kind == mQst_ERRAND_FIRSTJOB_START) {
if (Now_Private->cloth.item == ITM_CLOTH016) {
aNRG2_setup_job(aNRG2_JOB2);
think_idx = aNRG2_THINK_SAY_HELLO3;
} else {
aNRG2_setup_job(aNRG2_JOB1);
think_idx = aNRG2_THINK_SAY_HELLO;
}
} else {
think_idx = aNRG2_THINK_SAY_HELLO2;
}
} else if (errand_p->base.progress == 1) {
think_idx = aNRG2_THINK_JOB_START_WAIT;
} else {
think_idx = aNRG2_THINK_TALK_START_WAIT;
}
if (Save_Get(scene_no) == SCENE_DEPART) {
/* Replace the upstairs warps with reserve items */
mFI_UtNumtoFGSet_common(RSV_POLICE_ITEM_0, 7, 1, FALSE);
mFI_UtNumtoFGSet_common(RSV_POLICE_ITEM_0, 8, 1, FALSE);
}
aNRG2_setup_think_proc(rcn_guide2, play, think_idx);
}
static void aNRG2_send_away_init(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, GAME_PLAY* play) {
goto_other_scene(play, Common_GetPointer(structure_exit_door_data), 1);
mBGMPsComp_scene_mode(14);
}
static void aNRG2_talk_start_wait_init(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, GAME_PLAY* play) {
aNRG2_talk_start_wait(rcn_guide2, play);
}
static void aNRG2_job_start_wait_init(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, GAME_PLAY* play) {
aNRG2_job_start_wait(rcn_guide2, play);
}
static void aNRG2_all_job_end_init(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, GAME_PLAY* play) {
INTRO_DEMO_ACTOR* intro_demo;
mPlib_request_main_demo_wait_type1(&play->game, 0, NULL);
intro_demo =
(INTRO_DEMO_ACTOR*)Actor_info_name_search(&play->actor_info, mAc_PROFILE_INTRO_DEMO, ACTOR_PART_CONTROL);
intro_demo->_1A8 = TRUE;
}
typedef void (*aNRG2_THINK_INIT_PROC)(NPC_RCN_GUIDE2_ACTOR*, GAME_PLAY*);
typedef struct rcn_guide2_think_data_s {
aNRG2_THINK_PROC think_proc;
aNRG2_THINK_INIT_PROC think_init_proc;
aNPC_TALK_REQUEST_PROC talk_request_proc;
u8 talk_idx;
u8 next_think_idx;
} aNRG2_think_data_c;
static void aNRG2_setup_think_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, GAME_PLAY* play, int think_idx) {
// clang-format off
static aNRG2_think_data_c dt_tbl[] = {
{
(aNRG2_THINK_PROC)&none_proc1,
(aNRG2_THINK_INIT_PROC)&none_proc1,
&aNRG2_force_talk_request,
aNRG2_FORCE_TALK_SAY_HELLO,
aNRG2_THINK_SEND_AWAY,
},
{
(aNRG2_THINK_PROC)&none_proc1,
(aNRG2_THINK_INIT_PROC)&none_proc1,
&aNRG2_force_talk_request,
aNRG2_FORCE_TALK_SAY_HELLO2,
aNRG2_THINK_SEND_AWAY,
},
{
(aNRG2_THINK_PROC)&none_proc1,
(aNRG2_THINK_INIT_PROC)&none_proc1,
&aNRG2_force_talk_request,
aNRG2_FORCE_TALK_SAY_HELLO_SP,
aNRG2_THINK_SEND_AWAY,
},
{
(aNRG2_THINK_PROC)&none_proc1,
&aNRG2_send_away_init,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
0,
aNRG2_THINK_SEND_AWAY,
},
{
&aNRG2_talk_start_wait,
&aNRG2_talk_start_wait_init,
&aNRG2_norm_talk_request,
aNRG2_NORM_TALK_JOB1_START,
aNRG2_THINK_TALK_START_WAIT,
},
{
&aNRG2_job_start_wait,
&aNRG2_job_start_wait_init,
&aNRG2_norm_talk_request,
aNRG2_NORM_TALK_JOB1_START,
aNRG2_THINK_JOB_START_WAIT,
},
{
&aNRG2_all_job_end,
&aNRG2_all_job_end_init,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
0,
aNRG2_THINK_ALL_JOB_END,
},
};
// clang-format on
aNRG2_think_data_c* data = &dt_tbl[think_idx];
static u16 arg_data[6] = { 0, 0, 0, 0, 0, 0 };
rcn_guide2->think_idx = think_idx;
rcn_guide2->think_proc = data->think_proc;
rcn_guide2->npc_class.talk_info.talk_request_proc = data->talk_request_proc;
rcn_guide2->talk_idx = data->talk_idx;
rcn_guide2->next_think_idx = data->next_think_idx;
rcn_guide2->npc_class.request.act_priority = 1;
rcn_guide2->npc_class.request.act_idx = aNPC_ACT_WAIT;
rcn_guide2->npc_class.request.act_type = aNPC_ACT_TYPE_DEFAULT;
mem_copy((u8*)rcn_guide2->npc_class.request.act_args, (u8*)arg_data, sizeof(arg_data));
(*data->think_init_proc)(rcn_guide2, play);
}
static void aNRG2_think_proc(NPC_ACTOR* nactorx, GAME_PLAY* play, int proc_type) {
static aNPC_SUB_PROC think_proc[] = { &aNRG2_think_init_proc, &aNRG2_think_main_proc };
(*think_proc[proc_type])(nactorx, play);
}
static void aNRG2_schedule_init_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
nactorx->think.think_proc = &aNRG2_think_proc;
Common_Get(clip).npc_clip->think_proc(nactorx, play, aNPC_THINK_IN_BLOCK, 0);
}
static void aNRG2_schedule_main_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
int res = Common_Get(clip).npc_clip->think_proc(nactorx, play, -1, 1);
if (res == 0) {
Common_Get(clip).npc_clip->think_proc(nactorx, play, -1, 2);
}
}
static void aNRG2_schedule_proc(NPC_ACTOR* nactorx, GAME_PLAY* play, int proc_type) {
static aNPC_SUB_PROC sche_proc[] = { &aNRG2_schedule_init_proc, &aNRG2_schedule_main_proc };
(*sche_proc[proc_type])(nactorx, play);
}
+912
View File
@@ -0,0 +1,912 @@
static void aNRG2_set_str_j3(void) {
static u8 choume_str[] = { 'Q', 'A', 'B', 'C', 'D', 'E', 'F' };
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
mQst_errand_c* errand_p = mQst_GetFirstJobData();
AnmPersonalID_c* to_id_p = &errand_p->recipient;
int idx = mNpc_SearchAnimalinfo(Save_Get(animals), to_id_p->npc_id, ANIMAL_NUM_MAX);
u8 str[ANIMAL_NAME_LEN];
if (idx != -1) {
/* Set msg string 3 & 4 to acre Z & X respectively */
Anmhome_c* home_p = &Save_Get(animals[idx]).home_info;
mMsg_Set_free_str(msg_p, mMsg_FREE_STR3, &choume_str[home_p->block_z], 1);
mFont_UnintToString(str, sizeof(str), home_p->block_x, sizeof(str), TRUE, FALSE, TRUE);
mMsg_Set_free_str(msg_p, mMsg_FREE_STR4, str, sizeof(str));
}
mNpc_GetNpcWorldNameAnm(str, to_id_p);
mMsg_Set_free_str_cl(msg_p, mMsg_FREE_STR5, str, sizeof(str), 1);
}
static void aNRG2_set_str_j4(void) {
int bx;
int bz;
u8 str[1];
/* Set recipient home acre */
aNRG2_set_str_j3();
/* Set post office acre string */
mFI_BlockKind2BkNum(&bx, &bz, mRF_BLOCKKIND_POSTOFFICE);
mFont_UnintToString(str, sizeof(str), bx, sizeof(str), TRUE, FALSE, TRUE);
/* We only care about the X acre since the post office is always in the A row */
mMsg_SET_FREE_STR(mMsg_FREE_STR6, str, sizeof(str));
}
typedef void (*aNRG2_SET_STR_PROC)(void);
static void aNRG2_set_str_proc(void) {
static aNRG2_SET_STR_PROC process[] = {
(aNRG2_SET_STR_PROC)&none_proc1,
(aNRG2_SET_STR_PROC)&none_proc1,
&aNRG2_set_str_j3,
&aNRG2_set_str_j4,
&aNRG2_set_str_j3,
&aNRG2_set_str_j3,
(aNRG2_SET_STR_PROC)&none_proc1,
&aNRG2_set_str_j4,
&aNRG2_set_str_j3,
(aNRG2_SET_STR_PROC)&none_proc1,
(aNRG2_SET_STR_PROC)&none_proc1,
};
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int idx = errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH;
/* Set the current job strings, index is job quest idx relative to first job */
(*process[idx])();
}
static void aNRG2_set_possession(void) {
// clang-format off
static mActor_name_t set_item[] = {
ITM_CLOTH016,
ITM_WHITE_PANSY_BAG,
EMPTY_NO,
ITM_PAPER55,
EMPTY_NO,
ITM_AXE,
EMPTY_NO,
ITM_PAPER55,
ITM_AXE,
EMPTY_NO,
EMPTY_NO,
};
// clang-format on
mQst_errand_c* errand_p = mQst_GetFirstJobData();
u32 job_kind = errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH;
if (job_kind == aNRG2_JOB2) {
int i;
/* Give player 7 random flower bags */
for (i = 0; i < 7; i++) {
mActor_name_t item = ITM_WHITE_PANSY_BAG + RANDOM(9);
mPr_SetFreePossessionItem(Now_Private, item, mPr_ITEM_COND_NORMAL);
}
/* Give player 3 saplings */
for (i = 0; i < 3; i++) {
mPr_SetFreePossessionItem(Now_Private, ITM_SAPLING, mPr_ITEM_COND_NORMAL);
}
} else {
switch (job_kind) {
case aNRG2_JOB3:
case aNRG2_JOB5:
/* Set the random errand item with quest condition */
mPr_SetFreePossessionItem(Now_Private, errand_p->item, mPr_ITEM_COND_QUEST);
break;
case aNRG2_JOB1:
case aNRG2_JOB4:
case aNRG2_JOB7:
case aNRG2_JOB8:
/* Set the static job item with normal condition */
mPr_SetFreePossessionItem(Now_Private, set_item[job_kind], mPr_ITEM_COND_NORMAL);
break;
case aNRG2_JOB2:
case aNRG2_JOB6:
case aNRG2_JOB9:
default:
/* Set the static job item with quest condition */
mPr_SetFreePossessionItem(Now_Private, set_item[job_kind], mPr_ITEM_COND_QUEST);
break;
case aNRG2_JOB10:
case aNRG2_JOB11:
break;
}
}
}
static int aNRG2_check_job_start(void) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int res = FALSE;
u32 free_slots = mPr_GetPossessionItemSum(Now_Private, EMPTY_NO);
switch (errand_p->base.quest_kind) {
case mQst_ERRAND_FIRSTJOB_PLANT_FLOWER:
/* Need at least 10 inventory slots free for the planting chore */
if (free_slots >= 10) {
res = TRUE;
}
break;
case mQst_ERRAND_FIRSTJOB_POST_NOTICE:
case mQst_ERRAND_FIRSTJOB_INTRODUCTIONS:
case mQst_ERRAND_FIRSTJOB_OPEN:
/* These chores have no items and thus can always be started */
res = TRUE;
break;
default:
/* Default requires at least one free inventory slot */
if (free_slots > 0) {
res = TRUE;
}
break;
}
return res;
}
/* Is this a typo of setup? */
static void aNRG2_stepup_j1(u32 kind, NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
/* Job 1: change into 'work clothes' */
mQst_SetFirstJobChangeCloth(errand_p, ITM_CLOTH016);
}
static void aNRG2_stepup_j2(u32 kind, NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
/* Job 2: plant flower seeds & tree saplings */
mQst_SetFirstJobSeed(errand_p);
}
static void aNRG2_stepup_j3(u32 kind, NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
/* List of 'no good' furniture, seemingly only ones you can walk on? */
static mActor_name_t ng_list[] = { FTR_MANHOLE_COVER, FTR_BATH_MAT };
mQst_errand_c* errand_p;
AnmPersonalID_c* anm_pid_p;
mActor_name_t ftr;
u32 free_idx;
/* Get first job quest data */
errand_p = mQst_GetFirstJobData();
/* Get first free inventory slot index */
free_idx = mPr_GetPossessionItemIdx(Now_Private, EMPTY_NO);
/* Get an unused target villager for delivery target */
anm_pid_p = mNpc_GetOtherAnimalPersonalID(errand_p->info.first_job.used_ids, errand_p->info.first_job.used_num);
/* Roll random ABC list furniture to be delivered */
mSP_SelectRandomItem_New(NULL, &ftr, 1, ng_list, ARRAY_COUNT(ng_list), mSP_KIND_FURNITURE, mSP_LISTTYPE_ABC, FALSE);
/* Job 3: deliver furniture */
mQst_SetFirstJobFurniture(errand_p, anm_pid_p, ftr, free_idx);
}
static void aNRG2_stepup_j4(u32 kind, NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p;
AnmPersonalID_c* anm_pid_p;
// Get first job quest data
errand_p = mQst_GetFirstJobData();
// Get an unused target villager for letter recipient
anm_pid_p = mNpc_GetOtherAnimalPersonalID(errand_p->info.first_job.used_ids, errand_p->info.first_job.used_num);
// Force a memory with the animal in the event the player hasn't spoken to them yet
// This could happen if an animal moves in before the chore is started,
// but after the introductions sequence is finished.
// This prevents the case where the recipient would not be listed
// in the recipient menu despite being assigned by Nook.
mNpc_SetAnimalPersonalID2Memory(anm_pid_p);
// Job 4: send letter
if (kind == aNRG2_JOB4) {
mQst_SetFirstJobLetter(errand_p, anm_pid_p);
} else {
mQst_SetFirstJobLetter2(errand_p, anm_pid_p);
}
// Allow Nook to remind the player about this chore
rcn_guide2->can_ask_again_flag = TRUE;
}
static void aNRG2_stepup_j5(u32 kind, NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p;
AnmPersonalID_c* anm_pid_p;
mActor_name_t ftr;
u32 free_idx;
/* Get first job quest data */
errand_p = mQst_GetFirstJobData();
/* Get first free inventory slot index */
free_idx = mPr_GetPossessionItemIdx(Now_Private, EMPTY_NO);
/* Get an unused target villager for delivery target */
anm_pid_p = mNpc_GetOtherAnimalPersonalID(errand_p->info.first_job.used_ids, errand_p->info.first_job.used_num);
/* Roll random ABC list carpet to be delivered */
mSP_SelectRandomItem_New(NULL, &ftr, 1, NULL, 0, mSP_KIND_CARPET, mSP_LISTTYPE_ABC, FALSE);
/* Job 5: deliver carpet */
mQst_SetFirstJobCarpet(errand_p, anm_pid_p, ftr, free_idx);
}
static void aNRG2_stepup_j6(u32 kind, NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p;
u32 free_idx;
// Get first job quest data
errand_p = mQst_GetFirstJobData();
// Get the first free inventory slot
free_idx = mPr_GetPossessionItemIdx(Now_Private, EMPTY_NO);
// Job 5: deliver axe
if (kind == aNRG2_JOB6) {
mQst_SetFirstJobAxe(errand_p, &errand_p->info.first_job.used_ids[1], ITM_AXE, free_idx);
} else {
mQst_SetFirstJobAxe2(errand_p, &errand_p->info.first_job.used_ids[1], ITM_AXE, free_idx);
}
}
static void aNRG2_stepup_j7(u32 kind, NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
/* Job 7: post on notice board */
mQst_SetFirstJobNotice(errand_p);
}
static void aNRG2_stepup_j10(u32 kind, NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
/* Job 10: introductions */
mQst_SetFirstJobHello(errand_p);
}
static void aNRG2_stepup_j11(u32 kind, NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
/* Job 11: open quest */
mQst_SetFirstJobOpenQuest(errand_p);
}
typedef void (*aNRG2_STEPUP_PROC)(u32, NPC_RCN_GUIDE2_ACTOR*);
static void aNRG2_stepup_job(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, u32 job_kind) {
// clang-format off
static aNRG2_STEPUP_PROC stepup_job_proc[] = {
&aNRG2_stepup_j1,
&aNRG2_stepup_j2,
&aNRG2_stepup_j3,
&aNRG2_stepup_j4,
&aNRG2_stepup_j5,
&aNRG2_stepup_j6,
&aNRG2_stepup_j7,
&aNRG2_stepup_j4,
&aNRG2_stepup_j6,
&aNRG2_stepup_j10,
&aNRG2_stepup_j11,
};
// clang-format on
mQst_errand_c* errand_p = mQst_GetFirstJobData();
if (errand_p->base.progress == 1) {
(*stepup_job_proc[job_kind])(job_kind, rcn_guide2);
aNRG2_set_str_proc();
}
}
static void aNRG2_setup_job(int job_kind) {
// clang-format off
static u32 kind[] = {
mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH,
mQst_ERRAND_FIRSTJOB_PLANT_FLOWER,
mQst_ERRAND_FIRSTJOB_DELIVER_FTR,
mQst_ERRAND_FIRSTJOB_SEND_LETTER,
mQst_ERRAND_FIRSTJOB_DELIVER_CARPET,
mQst_ERRAND_FIRSTJOB_DELIVER_AXE,
mQst_ERRAND_FIRSTJOB_POST_NOTICE,
mQst_ERRAND_FIRSTJOB_SEND_LETTER2,
mQst_ERRAND_FIRSTJOB_DELIVER_AXE2,
mQst_ERRAND_FIRSTJOB_INTRODUCTIONS,
mQst_ERRAND_FIRSTJOB_OPEN,
};
// clang-format on
mQst_errand_c* errand_p = mQst_GetFirstJobData();
errand_p->base.quest_kind = kind[job_kind];
errand_p->base.progress = 1;
}
static void aNRG2_say_hello_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
// clang-format off
static int job_start_msg_no[] = {
0x07F1,
0x07F6,
0x07FB,
0x0802,
0x080C,
0x0813,
0x0818,
0x0802,
0x0813,
0x0821,
0x0827,
};
// clang-format on
// clang-format off
static int job_start_refuse_msg_no[] = {
0x07F0,
0x07F5,
0x07FA,
0x07FA,
0x07FA,
0x07FA,
0x0818,
0x07FA,
0x07FA,
-1,
-1,
};
// clang-format on
static int next_talk_idx[] = { aNRG2_TALK_DEMO_START_WAIT, aNRG2_TALK_TALK_END_WAIT };
mMsg_Window_c* msg_p;
mQst_errand_c* errand_p;
int msg_no;
int talk_idx;
int job_kind;
msg_p = mMsg_Get_base_window_p();
errand_p = mQst_GetFirstJobData();
if (errand_p->base.progress == 1) {
job_kind = errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH;
if (aNRG2_check_job_start() == TRUE) {
/* The next job can be started */
// Initial setup
aNRG2_stepup_job(rcn_guide2, job_kind);
// Set quest items if necessary
aNRG2_set_possession();
// Setup params
msg_no = job_start_msg_no[job_kind];
rcn_guide2->next_think_idx = aNRG2_THINK_TALK_START_WAIT;
talk_idx = 0;
} else {
/* The next job can't be started */
msg_no = job_start_refuse_msg_no[job_kind];
rcn_guide2->next_think_idx = aNRG2_THINK_JOB_START_WAIT;
talk_idx = 1;
}
mMsg_Set_continue_msg_num(msg_p, msg_no);
aNRG2_change_talk_proc(rcn_guide2, next_talk_idx[talk_idx]);
} else {
/* We're still in the middle of a job? */
rcn_guide2->next_think_idx = aNRG2_THINK_TALK_START_WAIT;
mMsg_Set_CancelNormalContinue(msg_p);
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_TALK_END_WAIT);
}
}
static void aNRG2_say_hello_sp_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
/* Special message on first meeting at shop if player is already wearing uniform */
mMsg_SET_CONTINUE_MSG_NUM(0x0837);
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_SAY_HELLO_SP2);
}
static void aNRG2_say_hello_sp2_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
if (mMsg_GET_MSG_NUM() == 0x0837) {
aNRG2_say_hello_talk_proc(rcn_guide2);
}
}
static void aNRG2_cloth_chk_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
if (errand_p->base.progress == 1) {
rcn_guide2->next_think_idx = aNRG2_THINK_JOB_START_WAIT;
} else {
rcn_guide2->next_think_idx = aNRG2_THINK_TALK_START_WAIT;
}
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_TALK_END_WAIT);
}
static void aNRG2_demo_start_wait_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
/* List of display items for each job */
static mActor_name_t itemNo[] = {
ITM_CLOTH016, /* work uniform */
ITM_WHITE_PANSY_BAG, /* flower bag */
FTR_FAN, /* furniture */
ITM_PAPER55, /* simple paper */
ITM_CARPET00, /* carpet */
ITM_AXE, /* axe */
EMPTY_NO, /* no item */
ITM_PAPER55, /* simple paper */
ITM_AXE, /* axe */
EMPTY_NO, /* no item */
EMPTY_NO, /* no item */
};
int order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 1);
if (order == 4) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
u32 kind = errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH;
/* Set params for hand over item */
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 0, itemNo[kind]);
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 1, 7);
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 2, 0);
/* Don't let the player continue dialog */
mMsg_SET_LOCKCONTINUE();
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_DEMO_END_WAIT);
}
}
static void aNRG2_demo_end_wait_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
/* Wait for the hand over process item to start */
if (rcn_guide2->npc_class.action.idx == 10 && Common_Get(clip).handOverItem_clip->master_actor != NULL) {
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_DEMO_END_WAIT2);
}
}
static void aNRG2_demo_end_wait2_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
/* Wait for the hand over item process to finish */
if (Common_Get(clip).handOverItem_clip->master_actor == NULL) {
/* Allow player to continue dialog */
mMsg_UNSET_LOCKCONTINUE();
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_TALK_END_WAIT);
}
}
static void aNRG2_job_start_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int talk_proc_idx;
/* Setup job quest info */
aNRG2_stepup_job(rcn_guide2, errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH);
/* Give the player the necessary item(s) for the job */
aNRG2_set_possession();
if (errand_p->base.quest_kind == mQst_ERRAND_FIRSTJOB_INTRODUCTIONS ||
errand_p->base.quest_kind == mQst_ERRAND_FIRSTJOB_OPEN) {
talk_proc_idx = aNRG2_TALK_TALK_END_WAIT;
} else {
talk_proc_idx = aNRG2_TALK_DEMO_START_WAIT;
}
aNRG2_change_talk_proc(rcn_guide2, talk_proc_idx);
rcn_guide2->next_think_idx = aNRG2_THINK_TALK_START_WAIT;
}
static void aNRG2_job_end_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
static int next_job_no[] = {
aNRG2_JOB2, aNRG2_JOB3, aNRG2_JOB4, aNRG2_JOB11, aNRG2_JOB6, aNRG2_JOB7,
aNRG2_JOB7, aNRG2_JOB9, aNRG2_JOB7, aNRG2_JOB3, aNRG2_JOB5,
};
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int next_job;
/* If the finished quest was the planting flowers & saplings job & the player hasn't spoken to all villagers &
* Tortimer, then set the job to introductions.
*/
if (errand_p->base.quest_kind == mQst_ERRAND_FIRSTJOB_PLANT_FLOWER &&
(mNpc_CheckFriendAllAnimal(&Now_Private->player_ID) == FALSE || mSC_check_ArbeitPlayer() == FALSE)) {
next_job = aNRG2_JOB10;
} else {
next_job = next_job_no[errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH];
}
aNRG2_setup_job(next_job);
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_SAY_HELLO);
}
static void aNRG2_3rd_job_end_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
/* Hand over the map */
if (order != 0) {
aNRG2_job_end_talk_proc(rcn_guide2);
/* Set params for hand over item */
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 1, 2);
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 0, ITM_TOWN_MAP);
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 1, 7);
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 2, 0);
/* Enable map flag */
Common_Set(map_flag, TRUE);
/* Clear demo order */
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
}
}
static void aNRG2_demo2_start_wait_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
/* Take quest item back from player */
if (order != 0) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int idx = mPr_GetPossessionItemIdxWithCond(Now_Private, errand_p->item, mPr_ITEM_COND_QUEST);
// This is bad, if you somehow don't have the quest item, the first item in your inventory will be deleted
if (idx == -1) {
idx = 0;
}
/* Clear item */
mPr_SetPossessionItem(Now_Private, idx, 0, mPr_ITEM_COND_NORMAL);
/* Clear demo order */
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
/* Prevent player from continuing dialogue */
mMsg_SET_LOCKCONTINUE();
/* Tell the player to play hand over animation */
mPlib_request_main_give_type1(gamePT, errand_p->item, 7, FALSE, FALSE);
aNRG2_setup_job(errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH);
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_DEMO2_START_WAIT2);
}
}
static void aNRG2_demo2_start_wait2_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
/* Wait for hand over item request mode */
if (Common_Get(clip).handOverItem_clip->request_mode == aHOI_REQUEST_TRANS_WAIT) {
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 1, 3);
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_DEMO2_END);
}
}
static void aNRG2_demo2_end_wait_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
/* Wait for hand over item to finish */
if (Common_Get(clip).handOverItem_clip->master_actor == NULL) {
/* Allow player to continue the dialogue now */
mMsg_UNSET_LOCKCONTINUE();
aNRG2_job_start_talk_proc(rcn_guide2);
}
}
static void aNRG2_give_new_paper_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
if (aNRG2_check_job_start() == TRUE) {
/* Give another piece of stationery to the player */
mMsg_Set_continue_msg_num(msg_p, 0x0805); // 'Here! Here's another piece of paper.'
aNRG2_job_start_talk_proc(rcn_guide2);
rcn_guide2->can_ask_again_flag = TRUE;
} else {
/* Player has full pockets so tell them */
mMsg_Set_continue_msg_num(msg_p, 0x07FA); // '...What have we here?'
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_TALK_END_WAIT);
rcn_guide2->can_ask_again_flag = FALSE;
}
}
static void aNRG2_check_more_paper_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
mQst_errand_c* errand_p;
if (order != 0) {
/* Clear the demo order */
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0:
/* Player asked for more paper, so give them some if they have inv space */
errand_p = mQst_GetFirstJobData();
aNRG2_give_new_paper_talk_proc(rcn_guide2);
errand_p->base.progress = 2;
break;
case mChoice_CHOICE1:
/* Player said they don't need more paper */
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_TALK_END_WAIT);
rcn_guide2->can_ask_again_flag = FALSE;
break;
}
}
}
static void aNRG2_decide_new_target_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
mQst_errand_c* errand_p;
if (order != 0) {
errand_p = mQst_GetFirstJobData();
/* Clear the demo order */
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
aNRG2_setup_job(errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH);
aNRG2_stepup_job(rcn_guide2, errand_p->base.quest_kind - mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH);
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_CHECK_MORE_PAPER);
}
}
static void aNRG2_demo3_start_wait_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
mQst_errand_c* errand_p;
int idx;
if (order != 0) {
errand_p = mQst_GetFirstJobData();
idx = mPr_GetPossessionItemIdxWithCond(Now_Private, errand_p->item, mPr_ITEM_COND_QUEST);
if (idx == -1) {
/* If the job's tool item can't be found then try the player's equipped item */
if (Now_Private->equipment == errand_p->item) {
Now_Private->equipment = EMPTY_NO;
}
} else {
mPr_SetPossessionItem(Now_Private, idx, EMPTY_NO, mPr_ITEM_COND_NORMAL);
}
/* Clear the demo order */
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
mMsg_SET_LOCKCONTINUE();
mPlib_request_main_give_type1(gamePT, errand_p->item, 7, FALSE, FALSE);
aNRG2_setup_job(aNRG2_JOB8);
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_DEMO3_START_WAIT2);
}
}
static void aNRG2_all_job_end_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2) {
rcn_guide2->next_think_idx = aNRG2_THINK_ALL_JOB_END;
aNRG2_change_talk_proc(rcn_guide2, aNRG2_TALK_TALK_END_WAIT);
}
static void aNRG2_change_talk_proc(NPC_RCN_GUIDE2_ACTOR* rcn_guide2, int talk_proc_idx) {
// clang-format off
static aNRG2_TALK_PROC proc[] = {
&aNRG2_say_hello_talk_proc,
&aNRG2_say_hello_sp_talk_proc,
&aNRG2_say_hello_sp2_talk_proc,
&aNRG2_cloth_chk_talk_proc,
(aNRG2_TALK_PROC)&none_proc1,
&aNRG2_demo_start_wait_talk_proc,
&aNRG2_demo_end_wait_talk_proc,
&aNRG2_demo_end_wait2_talk_proc,
&aNRG2_job_start_talk_proc,
&aNRG2_job_end_talk_proc,
&aNRG2_3rd_job_end_talk_proc,
&aNRG2_demo2_start_wait_talk_proc,
&aNRG2_demo2_start_wait2_talk_proc,
&aNRG2_demo2_end_wait_talk_proc,
&aNRG2_give_new_paper_talk_proc,
&aNRG2_check_more_paper_talk_proc,
&aNRG2_decide_new_target_talk_proc,
&aNRG2_demo3_start_wait_talk_proc,
&aNRG2_demo2_start_wait2_talk_proc,
&aNRG2_demo2_end_wait_talk_proc,
&aNRG2_all_job_end_talk_proc,
};
// clang-format on
rcn_guide2->talk_proc = proc[talk_proc_idx];
}
static void aNRG2_set_goods_talk_info(ACTOR* actorx) {
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
int msg_no = 0x081C;
/* Check if it's a raffle day */
if (Common_Get(tanuki_shop_status) == mSP_TANUKI_SHOP_STATUS_FUKUBIKI) {
msg_no = 0x0833;
}
mDemo_Set_msg_num(msg_no);
mDemo_Set_talk_turn(TRUE);
rcn_guide2->talk_proc = (aNRG2_TALK_PROC)&none_proc1;
}
static int aNRG2_goods_talk_request(ACTOR* actorx, GAME* game) {
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
int res = FALSE;
if (player != NULL) {
int ux;
int uz;
mActor_name_t item;
mFI_Wpos2UtNum(&ux, &uz, player->forward_ut_pos);
item = Common_Get(clip).shop_design_clip->unitNum2ItemNo_proc(ux, uz);
if (player->a_btn_pressed == TRUE && item != EXIT_DOOR1 && item != EMPTY_NO && item != RSV_WALL_NO &&
item != RSV_NO && item != DOOR0) {
/* Player interacted with shop goods, tell them they're inaccessible currently */
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
mDemo_Request(mDemo_TYPE_SPEAK, actorx, &aNRG2_set_goods_talk_info);
rcn_guide2->talk_proc_idx = 0;
res = TRUE;
}
}
return res;
}
static int aNRG2_cloth_check(void) {
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int res = FALSE;
if (errand_p->base.quest_kind > mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH &&
errand_p->info.first_job.wrong_cloth == FALSE && Now_Private->cloth.item != ITM_CLOTH016) {
/* Player changed out of work uniform on the job, now they get a stern talking to! */
res = TRUE;
}
return res;
}
static int aNRG2_check_upstair(void) {
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_NOW();
u16 angle_y = player->actor_class.shape_info.rotation.y;
int res = FALSE;
if (angle_y > DEG2SHORT_ANGLE2(135.0f) && angle_y < DEG2SHORT_ANGLE2(225.0f) &&
player->item_in_front == RSV_POLICE_ITEM_0) {
res = TRUE;
}
return res;
}
static void aNRG2_set_force_talk_info(ACTOR* actorx) {
static aNRG2_talk_info_c dt_tbl[] = {
{ 0x07EE, &aNRG2_say_hello_talk_proc }, /* 'Well, finally you arrive!' */
{ 0x07EF, &aNRG2_say_hello_talk_proc }, /* 'So you're back again today?' */
{ 0x07EE, &aNRG2_say_hello_sp_talk_proc }, /* 'Well, finally you arrive!' (already wearing work uniform) */
{ 0x0832, &aNRG2_cloth_chk_talk_proc }, /* 'Why did you change out of your uniform, hm?' */
{ 0x0834, (aNRG2_TALK_PROC)&none_proc1 }, /* 'Stop right there!' (Going up to 2nd floor) */
};
aNRG2_talk_info_c* data;
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
mQst_errand_c* errand_p = mQst_GetFirstJobData();
int talk_idx;
/* Figure out our talk state */
if (aNRG2_cloth_check() == TRUE) {
talk_idx = aNRG2_FORCE_TALK_CLOTH_CHK; // Player changed out of their work uniform
errand_p->info.first_job.wrong_cloth = TRUE;
} else if (aNRG2_check_upstair() == TRUE) {
talk_idx = aNRG2_FORCE_TALK_UPSTAIR_CHK; // Player tried going upstairs in Nookington's
} else {
talk_idx = rcn_guide2->talk_idx;
}
data = &dt_tbl[talk_idx];
/* If assigning a new job then set the necessary text strings */
if (mQst_CheckFirstJobFin(errand_p) == FALSE) {
aNRG2_set_str_proc();
}
/* Apply the relevant data */
mDemo_Set_msg_num(data->msg_no);
mDemo_Set_talk_turn(TRUE);
rcn_guide2->talk_proc = data->talk_proc;
}
static void aNRG2_force_talk_request(ACTOR* actorx, GAME* game) {
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
mDemo_Request(mDemo_TYPE_SPEAK, actorx, &aNRG2_set_force_talk_info);
rcn_guide2->talk_proc_idx = 0;
}
static void aNRG2_set_norm_talk_info(ACTOR* actorx) {
// clang-format off
static aNRG2_talk_info_c dt_tbl[] = {
{ 0x07F1, &aNRG2_job_start_talk_proc },
{ 0x07F6, &aNRG2_job_start_talk_proc },
{ 0x07FB, &aNRG2_job_start_talk_proc },
{ 0x0802, &aNRG2_job_start_talk_proc },
{ 0x080C, &aNRG2_job_start_talk_proc },
{ 0x0830, &aNRG2_job_start_talk_proc },
{ 0x0813, &aNRG2_job_start_talk_proc },
{ 0x0818, &aNRG2_job_start_talk_proc },
{ 0x0821, &aNRG2_job_start_talk_proc },
{ 0x0827, &aNRG2_job_start_talk_proc },
{ 0x07F0, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07F5, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07FA, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07FA, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07FA, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x0826, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07FA, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x0818, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07F3, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x081F, &aNRG2_job_start_talk_proc },
{ 0x0835, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07F8, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07FE, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07FF, &aNRG2_demo2_start_wait_talk_proc },
{ 0x0807, &aNRG2_check_more_paper_talk_proc },
{ 0x0808, &aNRG2_decide_new_target_talk_proc },
{ 0x0804, &aNRG2_give_new_paper_talk_proc },
{ 0x080F, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x0810, &aNRG2_demo2_start_wait_talk_proc },
{ 0x0815, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x0816, &aNRG2_demo3_start_wait_talk_proc },
{ 0x0819, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x0822, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x0829, (aNRG2_TALK_PROC)&none_proc1 },
{ 0x07F4, &aNRG2_job_end_talk_proc },
{ 0x07F9, &aNRG2_job_end_talk_proc },
{ 0x0801, &aNRG2_3rd_job_end_talk_proc },
{ 0x080B, &aNRG2_job_end_talk_proc },
{ 0x0812, &aNRG2_job_end_talk_proc },
{ 0x0818, &aNRG2_job_end_talk_proc },
{ 0x081A, &aNRG2_all_job_end_talk_proc },
{ 0x0828, &aNRG2_job_end_talk_proc },
{ 0x0830, &aNRG2_job_end_talk_proc },
{ 0x0836, (aNRG2_TALK_PROC)&none_proc1 },
};
// clang-format on
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
int talk_idx = rcn_guide2->talk_idx;
aNRG2_talk_info_c* data = &dt_tbl[talk_idx];
mQst_errand_c* errand_p = mQst_GetFirstJobData();
if (talk_idx >= aNRG2_NORM_TALK_J1_CONT1 && talk_idx <= aNRG2_NORM_TALK_J11_CONT1) {
rcn_guide2->can_ask_again_flag = TRUE;
}
if (mQst_CheckFirstJobFin(errand_p) == FALSE) {
aNRG2_set_str_proc();
}
mDemo_Set_msg_num(data->msg_no);
rcn_guide2->talk_proc = data->talk_proc;
}
static void aNRG2_norm_talk_request(ACTOR* actorx, GAME* game) {
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
if (aNRG2_goods_talk_request(actorx, game) == FALSE) {
if (aNRG2_cloth_check() == TRUE) {
aNRG2_force_talk_request(actorx, game);
} else if (aNRG2_check_upstair() == TRUE) {
aNRG2_force_talk_request(actorx, game);
} else {
mDemo_Request(mDemo_TYPE_TALK, actorx, &aNRG2_set_norm_talk_info);
rcn_guide2->talk_proc_idx = 0;
}
}
}
static int aNRG2_talk_init(ACTOR* actorx, GAME* game) {
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
rcn_guide2->npc_class.talk_info.talk_request_proc = (aNPC_TALK_REQUEST_PROC)&none_proc1;
mDemo_Set_ListenAble();
return TRUE;
}
static int aNRG2_talk_end_chk(ACTOR* actorx, GAME* game) {
NPC_RCN_GUIDE2_ACTOR* rcn_guide2 = (NPC_RCN_GUIDE2_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
int res = FALSE;
(*rcn_guide2->talk_proc)(rcn_guide2);
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE && mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE) {
aNRG2_setup_think_proc(rcn_guide2, play, rcn_guide2->next_think_idx);
res = TRUE;
}
return res;
}
+39
View File
@@ -0,0 +1,39 @@
static int aNRG_set_request_act(NPC_RCN_GUIDE_ACTOR* rcn_guide, u8 act_prio, u8 act_idx, u8 act_type, u16 obj, int x,
int z) {
u16 args[6];
int res = FALSE;
if (act_prio >= rcn_guide->npc_class.request.act_priority) {
bzero(args, sizeof(args));
args[0] = obj;
args[2] = x;
args[3] = z;
rcn_guide->npc_class.request.act_priority = act_prio;
rcn_guide->npc_class.request.act_idx = act_idx;
rcn_guide->npc_class.request.act_type = act_type;
mem_copy((u8*)rcn_guide->npc_class.request.act_args, (u8*)args, sizeof(args));
res = TRUE;
}
return res;
}
static void aNRG_set_house_master_name(int house_idx) {
mMsg_SET_FREE_STR(mMsg_FREE_STR0, Save_Get(private_data[mHS_get_pl_no(house_idx)]).player_ID.player_name,
PLAYER_NAME_LEN);
}
static void aNRG_set_shop_address(NPC_RCN_GUIDE_ACTOR* rcn_guide) {
static u8 choume_str[] = { 'Q', 'A', 'B', 'C', 'D', 'E', 'F' };
u8 str[1];
/* Set the row (Z) string */
mMsg_SET_FREE_STR(mMsg_FREE_STR1, &choume_str[rcn_guide->shop_bz], 1);
/* Set the column (X) string */
mFont_UnintToString(str, sizeof(str), rcn_guide->shop_bx, sizeof(str), TRUE, FALSE, TRUE);
mMsg_SET_FREE_STR(mMsg_FREE_STR2, str, sizeof(str));
}
static void aNRG_actor_move(ACTOR* actorx, GAME* game) {
Common_Get(clip).npc_clip->move_proc(actorx, game);
}
+407
View File
@@ -0,0 +1,407 @@
typedef void (*aNRG_THINK_INIT_PROC)(NPC_RCN_GUIDE_ACTOR*, GAME_PLAY*);
typedef struct npc_rcn_guide_setup_think_s {
aNRG_THINK_PROC think_proc;
aNRG_THINK_INIT_PROC think_init_proc;
aNPC_TALK_REQUEST_PROC talk_request_proc;
u8 talk_idx;
u8 next_think_idx;
} aNRG_setup_think_c;
static void aNRG_approach(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
if (rcn_guide->npc_class.action.step == aNPC_ACTION_END_STEP && rcn_guide->npc_class.action.idx == 2) {
aNRG_setup_think_proc(rcn_guide, play, aNRG_THINK_INTRODUCE);
}
}
static void aNRG_turn(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
if (rcn_guide->npc_class.action.step == aNPC_ACTION_END_STEP && rcn_guide->npc_class.action.idx == 3) {
aNRG_setup_think_proc(rcn_guide, play, rcn_guide->next_think_idx);
}
}
static void aNRG_take_with(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
if (rcn_guide->npc_class.action.step == aNPC_ACTION_END_STEP && rcn_guide->npc_class.action.idx == 2) {
int path = rcn_guide->path;
if (path >= 1) {
aNRG_setup_think_proc(rcn_guide, play, aNRC_THINK_EXPLAIN);
} else {
aNRG_set_request_act(rcn_guide, 4, aNPC_ACT_WALK2, aNPC_ACT_TYPE_TO_POINT, aNPC_ACT_OBJ_DEFAULT, 2240,
1500);
path++;
}
rcn_guide->path = path;
}
}
static void aNRG_decide_house_wait(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
int next_think_idx = -1;
if (GET_PLAYER_ACTOR_NOW()->excute_cancel_wade) {
/* Player is trying to leave the acre, so let them know they can't */
next_think_idx = aNRC_THINK_STOP_WADE;
} else if (Common_Get(clip).demo_clip != NULL && Common_Get(clip).demo_clip->type == mDemo_CLIP_TYPE_INTRO_DEMO) {
ACTOR* demo_actor = (ACTOR*)Common_Get(clip).demo_clip->demo_class;
if (demo_actor != NULL) {
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)demo_actor;
switch (intro_demo->player_intro_demo_state) {
case 1:
next_think_idx = aNRC_THINK_BEFORE_OPEN_DOOR_TALK;
break;
case 2:
next_think_idx = aNRC_THINK_BEFORE_OPEN_DOOR_TALK2;
break;
}
}
}
if (next_think_idx >= 0) {
aNRG_setup_think_proc(rcn_guide, play, next_think_idx);
}
}
static void aNRG_enter_wait(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
if (Common_Get(clip).demo_clip != NULL && Common_Get(clip).demo_clip->type == mDemo_CLIP_TYPE_INTRO_DEMO) {
ACTOR* demo_actor = (ACTOR*)Common_Get(clip).demo_clip->demo_class;
if (demo_actor != NULL) {
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)demo_actor;
intro_demo->player_in_house = TRUE;
aNRG_setup_think_proc(rcn_guide, play, aNRC_THINK_WAIT);
}
}
}
static void aNRG_exit(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
static s16 moveX[] = { 2240, 2240, 2240, 2240 };
static s16 moveZ[] = { 1900, 1980, 1300, 1220 };
if (rcn_guide->npc_class.action.step == aNPC_ACTION_END_STEP) {
f32 posZ = rcn_guide->npc_class.actor_class.world.position.z;
int idx;
if (posZ < 1540.0f) {
if (posZ <= 1220.0f) {
idx = -1;
} else if (posZ <= 1300.0f) {
idx = 3;
} else {
idx = 2;
}
} else {
if (posZ >= 1980.0f) {
idx = -1;
} else if (posZ >= 1900.0f) {
idx = 1;
} else {
idx = 0;
}
}
if (idx == -1) {
if (Common_Get(clip).demo_clip != NULL && Common_Get(clip).demo_clip->type == mDemo_CLIP_TYPE_INTRO_DEMO) {
ACTOR* demo_actor = (ACTOR*)Common_Get(clip).demo_clip->demo_class;
if (demo_actor != NULL) {
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)demo_actor;
intro_demo->rcn_guide_actor_p = NULL;
Actor_delete(&rcn_guide->npc_class.actor_class);
play->submenu.start_refuse = FALSE;
}
}
} else {
aNRG_set_request_act(rcn_guide, 4, aNPC_ACT_WALK2, aNPC_ACT_TYPE_TO_POINT, aNPC_ACT_OBJ_DEFAULT, moveX[idx],
moveZ[idx]);
}
}
}
static void aNRG_restart_wait(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
int think_idx;
if (mPlib_check_player_actor_main_index_OutDoorMove2(&play->game) == FALSE) {
switch (rcn_guide->npc_class.actor_class.actor_specific) {
case 1:
think_idx = aNRC_THINK_DECIDE_HOUSE;
break;
default:
think_idx = aNRC_THINK_RESTART_TALK;
break;
}
aNRG_setup_think_proc(rcn_guide, play, think_idx);
}
}
static void aNRG_think_main_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
NPC_RCN_GUIDE_ACTOR* rcn_guide = (NPC_RCN_GUIDE_ACTOR*)nactorx;
(*rcn_guide->think_proc)(rcn_guide, play);
}
static void aNRG_think_init_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
NPC_RCN_GUIDE_ACTOR* rcn_guide = (NPC_RCN_GUIDE_ACTOR*)nactorx;
int think_idx;
switch (rcn_guide->npc_class.actor_class.actor_specific) {
case 1:
case 2:
think_idx = aNRC_THINK_RESTART_WAIT;
break;
default:
think_idx = aNRC_THINK_CALL;
break;
}
aNRG_setup_think_proc(rcn_guide, play, think_idx);
rcn_guide->npc_class.condition_info.hide_request = FALSE;
}
static void aNRG_call_init(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
s16 angle_y = atans_table(980.0f - rcn_guide->npc_class.actor_class.world.position.z,
2320.0f - rcn_guide->npc_class.actor_class.world.position.x);
rcn_guide->npc_class.actor_class.shape_info.rotation.y = angle_y;
rcn_guide->npc_class.actor_class.world.angle.y = angle_y;
}
static void aNRG_approach_init(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
f32 x;
f32 z;
/* Player cannot open the start menu */
play->submenu.start_refuse = TRUE;
/* Make the player stand around waiting */
mPlib_request_main_demo_wait_type1(&play->game, 0, NULL);
if (player != NULL) {
/* Move to a bit below where the player is */
x = player->actor_class.world.position.x;
z = player->actor_class.world.position.z + 70.0f;
} else {
/* Move to a predefined position -- how would the player even be NULL? */
x = 2320.0f;
z = 1050.0f;
}
/* Request action to move to desired location */
aNRG_set_request_act(rcn_guide, 4, aNPC_ACT_WALK2, aNPC_ACT_TYPE_TO_POINT, aNPC_ACT_OBJ_DEFAULT, x, z);
}
static void aNRG_introduce_init(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
aNRG_set_request_act(rcn_guide, 4, aNPC_ACT_WAIT, aNPC_ACT_TYPE_DEFAULT, aNPC_ACT_OBJ_DEFAULT, 0, 0);
}
static void aNRG_turn_init(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
mPlib_request_main_demo_wait_type1(&play->game, 0, NULL);
aNRG_set_request_act(rcn_guide, 4, aNPC_ACT_TURN, aNPC_ACT_TYPE_TO_POINT, aNPC_ACT_OBJ_DEFAULT, 2240, 1300);
}
static void aNRG_take_with_init(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
if (Common_Get(clip).demo_clip != NULL && Common_Get(clip).demo_clip->type == mDemo_CLIP_TYPE_INTRO_DEMO) {
ACTOR* demo_actor = (ACTOR*)Common_Get(clip).demo_clip->demo_class;
if (demo_actor != NULL) {
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)demo_actor;
intro_demo->talk_flag = TRUE;
}
}
aNRG_set_request_act(rcn_guide, 4, aNPC_ACT_WALK2, aNPC_ACT_TYPE_TO_POINT, aNPC_ACT_OBJ_DEFAULT, 2240, 1300);
}
static void aNRG_before_open_door_talk2_init(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)Common_Get(clip).demo_clip->demo_class;
aNRG_set_house_master_name(intro_demo->house_idx);
}
static void aNRG_exit_turn_init(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
static s16 moveX[] = { 2240, 2240 };
static s16 moveZ[] = { 1900, 1300 };
int idx = 0;
if (rcn_guide->npc_class.actor_class.world.position.z < 1540.0f) {
idx = 1;
}
aNRG_set_request_act(rcn_guide, 4, aNPC_ACT_TURN, aNPC_ACT_TYPE_TO_POINT, aNPC_ACT_OBJ_DEFAULT, moveX[idx],
moveZ[idx]);
if (Common_Get(clip).demo_clip != NULL && Common_Get(clip).demo_clip->type == mDemo_CLIP_TYPE_INTRO_DEMO) {
ACTOR* demo_actor = (ACTOR*)Common_Get(clip).demo_clip->demo_class;
if (demo_actor != NULL) {
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)demo_actor;
intro_demo->talk_flag = TRUE;
}
}
rcn_guide->next_think_idx = aNRC_THINK_EXIT;
}
static void aNRG_setup_think_proc(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play, int think_idx) {
// clang-format off
static aNRG_setup_think_c dt_tbl[] = {
{
(aNRG_THINK_PROC)&none_proc1,
&aNRG_call_init,
&aNRG_force_talk_request,
aNRG_FORCE_TALK_CALL,
aNRC_THINK_APPROACH,
},
{
&aNRG_approach,
&aNRG_approach_init,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
aNRG_FORCE_TALK_CALL,
aNRC_THINK_APPROACH,
},
{
(aNRG_THINK_PROC)&none_proc1,
&aNRG_introduce_init,
&aNRG_force_talk_request,
aNRG_FORCE_TALK_INTRODUCE,
aNRC_THINK_TURN,
},
{
&aNRG_turn,
&aNRG_turn_init,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
aNRG_FORCE_TALK_CALL,
aNRC_THINK_TAKE_WITH,
},
{
&aNRG_take_with,
&aNRG_take_with_init,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
aNRG_FORCE_TALK_CALL,
aNRC_THINK_TAKE_WITH,
},
{
(aNRG_THINK_PROC)&none_proc1,
(aNRG_THINK_INIT_PROC)&none_proc1,
&aNRG_force_talk_request,
aNRG_FORCE_TALK_EXPLAIN,
aNRC_THINK_DECIDE_HOUSE_WAIT,
},
{
&aNRG_decide_house_wait,
&aNRG_introduce_init,
&aNRG_norm_talk_request,
aNRG_NORM_TALK_DECIDE_HOUSE,
aNRC_THINK_DECIDE_HOUSE_WAIT,
},
{
(aNRG_THINK_PROC)&none_proc1,
(aNRG_THINK_INIT_PROC)&none_proc1,
&aNRG_force_talk_request,
aNRG_FORCE_TALK_STOP_WADE,
aNRC_THINK_DECIDE_HOUSE_WAIT,
},
{
(aNRG_THINK_PROC)&none_proc1,
(aNRG_THINK_INIT_PROC)&none_proc1,
&aNRG_force_talk_request,
aNRG_FORCE_TALK_BEFORE_OPEN_DOOR_TALK,
aNRC_THINK_ENTER_WAIT,
},
{
(aNRG_THINK_PROC)&none_proc1,
&aNRG_before_open_door_talk2_init,
&aNRG_force_talk_request,
aNRG_FORCE_TALK_BEFORE_OPEN_DOOR2_TALK,
aNRC_THINK_ENTER_WAIT,
},
{
&aNRG_enter_wait,
(aNRG_THINK_INIT_PROC)&none_proc1,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
aNRG_FORCE_TALK_CALL,
aNRC_THINK_ENTER_WAIT,
},
{
&aNRG_restart_wait,
(aNRG_THINK_INIT_PROC)&none_proc1,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
aNRG_FORCE_TALK_CALL,
aNRC_THINK_RESTART_WAIT,
},
{
(aNRG_THINK_PROC)&none_proc1,
(aNRG_THINK_INIT_PROC)&none_proc1,
&aNRG_force_talk_request,
aNRG_FORCE_TALK_HOUSE_TAKEN,
aNRC_THINK_DECIDE_HOUSE_WAIT,
},
{
(aNRG_THINK_PROC)&none_proc1,
(aNRG_THINK_INIT_PROC)&none_proc1,
&aNRG_force_talk_request,
aNRG_FORCE_TALK_HOUSE_VACANT,
aNRC_THINK_DECIDE_HOUSE_WAIT,
},
{
&aNRG_turn,
&aNRG_exit_turn_init,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
aNRG_FORCE_TALK_CALL,
aNRC_THINK_EXIT_TURN,
},
{
&aNRG_exit,
(aNRG_THINK_INIT_PROC)&none_proc1,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
aNRG_FORCE_TALK_CALL,
aNRC_THINK_EXIT,
},
{
(aNRG_THINK_PROC)&none_proc1,
(aNRG_THINK_INIT_PROC)&none_proc1,
(aNPC_TALK_REQUEST_PROC)&none_proc1,
aNRG_FORCE_TALK_CALL,
aNRC_THINK_WAIT,
},
};
// clang-format on
aNRG_setup_think_c* think_data = &dt_tbl[think_idx];
rcn_guide->think_idx = think_idx;
rcn_guide->think_proc = think_data->think_proc;
rcn_guide->npc_class.talk_info.talk_request_proc = think_data->talk_request_proc;
rcn_guide->talk_idx = think_data->talk_idx;
rcn_guide->next_think_idx = think_data->next_think_idx;
(*think_data->think_init_proc)(rcn_guide, play);
}
static void aNRG_think_proc(NPC_ACTOR* nactorx, GAME_PLAY* play, int type) {
static aNPC_SUB_PROC think_proc[] = { &aNRG_think_init_proc, &aNRG_think_main_proc };
(*think_proc[type])(nactorx, play);
}
static void aNRG_schedule_init_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
nactorx->think.think_proc = &aNRG_think_proc;
Common_Get(clip).npc_clip->think_proc(nactorx, play, aNPC_THINK_SPECIAL, 0);
}
static void aNRG_schedule_main_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
int res = Common_Get(clip).npc_clip->think_proc(nactorx, play, -1, 1);
if (res == 0) {
Common_Get(clip).npc_clip->think_proc(nactorx, play, -1, 2);
}
}
static void aNRG_schedule_proc(NPC_ACTOR* nactorx, GAME_PLAY* play, int type) {
static aNPC_SUB_PROC sche_proc[] = { &aNRG_schedule_init_proc, &aNRG_schedule_main_proc };
(*sche_proc[type])(nactorx, play);
}
+170
View File
@@ -0,0 +1,170 @@
enum {
aNRG_TALK_DEMAND_PAYMENT,
aNRG_TALK_MENU_OPEN_WAIT,
aNRG_TALK_MENU_CLOSE_WAIT,
aNRG_TALK_DEMO_START_WAIT,
aNRG_TALK_DEMO_END_WAIT,
aNRG_TALK_FINISHED,
aNRG_TALK_NUM
};
static void aNRG_demand_payment_change_talk_proc(NPC_RCN_GUIDE_ACTOR* rcn_guide, int talk_proc_idx);
static void aNRG_demand_payment_talk_proc(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
if (order != 0) {
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
mMsg_REQUEST_MAIN_DISAPPEAR_WAIT_TYPE1();
aNRG_demand_payment_change_talk_proc(rcn_guide, aNRG_TALK_MENU_OPEN_WAIT);
}
}
static void aNRG_menu_open_wait_talk_proc(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
if (mMsg_CHECK_MAIN_WAIT() == TRUE) {
Submenu* submenu = &play->submenu;
int idx = mPr_GetPossessionItemIdxWithCond(Now_Private, ITM_MONEY_1000, mPr_ITEM_COND_QUEST);
mSM_open_submenu(submenu, mSM_OVL_INVENTORY, mSM_IV_OPEN_QUEST, idx);
mMsg_SET_LOCKCONTINUE();
aNRG_demand_payment_change_talk_proc(rcn_guide, aNRG_TALK_MENU_CLOSE_WAIT);
}
}
static void aNRG_menu_close_wait_talk_proc(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
Submenu* submenu = &play->submenu;
if (submenu->open_flag == FALSE) {
if (submenu->item_p->item == EMPTY_NO) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
mMsg_request_main_appear_wait_type1(msg_p);
mMsg_ChangeMsgData(msg_p, 0x07EB); /* 'You better pay it all back, or I will have to...' */
mMsg_Set_ForceNext(msg_p);
mMsg_Unset_LockContinue(msg_p);
aNRG_demand_payment_change_talk_proc(rcn_guide, aNRG_TALK_DEMAND_PAYMENT); /* Go back to first state */
} else {
aNRG_demand_payment_change_talk_proc(rcn_guide, aNRG_TALK_DEMO_START_WAIT); /* Handed over the Bells */
}
}
}
static void aNRG_demo_start_wait_talk_proc(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
if (Common_Get(clip).handOverItem_clip->request_mode == aHOI_REQUEST_TRANS_WAIT) {
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 1, 3);
aNRG_demand_payment_change_talk_proc(rcn_guide, aNRG_TALK_DEMO_END_WAIT);
}
}
static void aNRG_demo_end_wait_talk_proc(NPC_RCN_GUIDE_ACTOR* rcn_guide, GAME_PLAY* play) {
if (Common_Get(clip).handOverItem_clip->master_actor == NULL) {
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
aNRG_set_shop_address(rcn_guide);
rcn_guide->next_think_idx = aNRC_THINK_EXIT_TURN;
mMsg_request_main_appear_wait_type1(msg_p);
mMsg_Set_ForceNext(msg_p);
aNRG_demand_payment_change_talk_proc(rcn_guide, aNRG_TALK_FINISHED);
}
}
static void aNRG_demand_payment_change_talk_proc(NPC_RCN_GUIDE_ACTOR* rcn_guide, int talk_proc_idx) {
// clang-format off
static aNRG_TALK_PROC talk_proc[] = {
&aNRG_demand_payment_talk_proc,
&aNRG_menu_open_wait_talk_proc,
&aNRG_menu_close_wait_talk_proc,
&aNRG_demo_start_wait_talk_proc,
&aNRG_demo_end_wait_talk_proc,
(aNRG_TALK_PROC)&none_proc1,
};
// clang-format on
rcn_guide->talk_proc = talk_proc[talk_proc_idx];
}
static void aNRG_set_force_talk_info(ACTOR* actorx) {
// clang-format off
static aNRG_talk_data_c dt_tbl[] = {
{ 0x07DE, TRUE, CAMERA2_PROCESS_NORMAL, TRUE, (aNRG_TALK_PROC)&none_proc1 }, /* Step down from train station */
{ 0x07DF, TRUE, CAMERA2_PROCESS_TALK, FALSE, (aNRG_TALK_PROC)&none_proc1 }, /* Ask about call from Rover */
{ 0x07E1, TRUE, CAMERA2_PROCESS_TALK, FALSE, (aNRG_TALK_PROC)&none_proc1 }, /* Show houses */
{ 0x07E2, TRUE, CAMERA2_PROCESS_NORMAL, FALSE, (aNRG_TALK_PROC)&none_proc1 }, /* Player tries leaving acre */
{ 0x07E4, FALSE, CAMERA2_PROCESS_NORMAL, FALSE, (aNRG_TALK_PROC)&none_proc1 }, /* Player enters empty house */
{ 0x07E3, FALSE, CAMERA2_PROCESS_NORMAL, FALSE, (aNRG_TALK_PROC)&none_proc1 }, /* Player enters taken house */
{ 0x07E5, TRUE, CAMERA2_PROCESS_TALK, TRUE, (aNRG_TALK_PROC)&none_proc1 }, /* Player exits taken house */
{ 0x07E6, TRUE, CAMERA2_PROCESS_TALK, TRUE, &aNRG_demand_payment_talk_proc }, /* Player exits empty house */
};
// clang-format on
NPC_RCN_GUIDE_ACTOR* rcn_guide = (NPC_RCN_GUIDE_ACTOR*)actorx;
int talk_idx = rcn_guide->talk_idx;
aNRG_talk_data_c* data = &dt_tbl[talk_idx];
mDemo_Set_msg_num(data->msg_no);
mDemo_Set_talk_turn(data->turn_flag);
mDemo_Set_camera(data->camera_type);
rcn_guide->talk_proc_idx = aNRG_TALK_DEMAND_PAYMENT;
rcn_guide->talk_proc = data->talk_proc;
if (data->melody_flag == TRUE) {
rcn_guide->npc_class.talk_info.melody_inst = rcn_guide->melody_copy;
} else {
rcn_guide->npc_class.talk_info.melody_inst = 0;
}
if (talk_idx == 0) {
mBGMPsComp_make_ps_quiet(0);
}
}
static void aNRG_force_talk_request(ACTOR* actorx, GAME* game) {
mDemo_Request(mDemo_TYPE_SPEAK, actorx, &aNRG_set_force_talk_info);
}
static void aNRG_set_norm_talk_info(ACTOR* actorx) {
static aNRG_talk_data_c dt_tbl[] = {
{ 0x0820, TRUE, CAMERA2_PROCESS_TALK, FALSE, (aNRG_TALK_PROC)&none_proc1 }, /* Normal talk about houses */
};
NPC_RCN_GUIDE_ACTOR* rcn_guide = (NPC_RCN_GUIDE_ACTOR*)actorx;
aNRG_talk_data_c* data = &dt_tbl[rcn_guide->talk_idx];
mDemo_Set_msg_num(data->msg_no);
mDemo_Set_talk_turn(data->turn_flag);
mDemo_Set_camera(data->camera_type);
rcn_guide->talk_proc_idx = aNRG_TALK_DEMAND_PAYMENT;
rcn_guide->talk_proc = data->talk_proc;
if (data->melody_flag == TRUE) {
rcn_guide->npc_class.talk_info.melody_inst = rcn_guide->melody_copy;
} else {
rcn_guide->npc_class.talk_info.melody_inst = 0;
}
}
static void aNRG_norm_talk_request(ACTOR* actorx, GAME* game) {
mDemo_Request(mDemo_TYPE_TALK, actorx, &aNRG_set_norm_talk_info);
}
static int aNRG_talk_init(ACTOR* actorx, GAME* game) {
NPC_RCN_GUIDE_ACTOR* rcn_guide = (NPC_RCN_GUIDE_ACTOR*)actorx;
rcn_guide->npc_class.talk_info.talk_request_proc = (aNPC_TALK_REQUEST_PROC)&none_proc1;
mDemo_Set_ListenAble();
return TRUE;
}
static int aNRG_talk_end_chk(ACTOR* actorx, GAME* game) {
NPC_RCN_GUIDE_ACTOR* rcn_guide = (NPC_RCN_GUIDE_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
int res = FALSE;
(*rcn_guide->talk_proc)(rcn_guide, play);
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE && mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE) {
/* We're done talking so move onto the next schedule step */
aNRG_setup_think_proc(rcn_guide, play, rcn_guide->next_think_idx);
res = TRUE;
}
return res;
}
+82 -34
View File
@@ -1,4 +1,5 @@
#include "ac_npc_rtc.h"
#include "m_name_table.h"
#include "m_common_data.h"
#include "m_player_lib.h"
@@ -10,49 +11,96 @@
#include "boot.h"
#include "m_string.h"
#include "libultra/libultra.h"
#include "m_timeIn_ovl.h"
extern void aNRTC_actor_ct(ACTOR*, GAME*);
extern void aNRTC_actor_dt(ACTOR*, GAME*);
extern void aNRTC_actor_init(ACTOR*, GAME*);
extern void aNRTC_actor_save(ACTOR*, GAME*);
enum {
aNRTC_THINK_START,
aNRTC_THINK_TITLE,
aNRTC_THINK_DOOR,
aNRTC_THINK_CHECK,
aNRTC_THINK_IPMENU,
aNRTC_THINK_WAIT,
ACTOR_PROFILE Npc_Rtc_Profile = {
mAc_PROFILE_NPC_RTC, ACTOR_PART_NPC, ACTOR_STATE_NONE, SP_NPC_RTC, ACTOR_OBJ_BANK_KEEP, sizeof(NPCRTC_ACTOR),
aNRTC_actor_ct, aNRTC_actor_dt, aNRTC_actor_init, mActor_NONE_PROC1, aNRTC_actor_save,
aNRTC_THINK_NUM
};
extern void aNRTC_actor_move(ACTOR*, GAME*);
extern void aNRTC_actor_draw(ACTOR*, GAME*);
enum {
aNRTC_TALK_BREAK_DATA,
aNRTC_TALK_BREAK_DATA2,
aNRTC_TALK_RTC_ERR,
aNRTC_TALK_TIMER_OPEN_MSG_WAIT,
aNRTC_TALK_TIMER_OPEN_WAIT,
aNRTC_TALK_TIMER_CLOSE_WAIT,
aNRTC_TALK_DELETE_BF,
aNRTC_TALK_DELETE,
aNRTC_TALK_FORMAT_CHK,
aNRTC_TALK_FORMAT,
aNRTC_TALK_END,
extern int aNRTC_talk_init(ACTOR*, GAME*);
extern int aNRTC_talk_end_chk(ACTOR*, GAME*);
aNRTC_TALK_NUM
};
extern void aNRTC_schedule_proc(NPC_ACTOR*, GAME_PLAY*, int);
static void aNRTC_actor_ct(ACTOR*, GAME*);
static void aNRTC_actor_dt(ACTOR*, GAME*);
static void aNRTC_actor_init(ACTOR*, GAME*);
static void aNRTC_actor_save(ACTOR*, GAME*);
extern void aNRTC_talk_request(ACTOR* actor, GAME*);
// clang-format off
ACTOR_PROFILE Npc_Rtc_Profile = {
mAc_PROFILE_NPC_RTC,
ACTOR_PART_NPC,
ACTOR_STATE_NONE,
SP_NPC_RTC,
ACTOR_OBJ_BANK_KEEP,
sizeof(NPC_RTC_ACTOR),
&aNRTC_actor_ct,
&aNRTC_actor_dt,
&aNRTC_actor_init,
mActor_NONE_PROC1,
&aNRTC_actor_save,
};
extern void aNRTC_change_talk_proc(NPCRTC_ACTOR* rtc, int idx);
static void aNRTC_actor_move(ACTOR*, GAME*);
static void aNRTC_actor_draw(ACTOR*, GAME*);
u8 aNRTC_sound_mode[] = { 0x00, 0x01, 0x02, 0x00 };
u8 aNRTC_voice_mode[] = { 0x00, 0x01, 0x02, 0x00 };
static int aNRTC_talk_init(ACTOR*, GAME*);
static int aNRTC_talk_end_chk(ACTOR*, GAME*);
void aNRTC_actor_ct(ACTOR* actor, GAME* game) {
static aNPC_ct_data_c ct_data = { &aNRTC_actor_move, &aNRTC_actor_draw, 5, mActor_NONE_PROC1,
&aNRTC_talk_init, &aNRTC_talk_end_chk, 0 };
static void aNRTC_schedule_proc(NPC_ACTOR*, GAME_PLAY*, int);
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
static void aNRTC_talk_request(ACTOR* actor, GAME*);
static void aNRTC_change_talk_proc(NPC_RTC_ACTOR* rtc, int idx);
static u8 aNRTC_sound_mode[] = { Config_SOUND_MODE_0, Config_SOUND_MODE_1, Config_SOUND_MODE_2 };
static u8 aNRTC_voice_mode[] = { Config_VOICE_MODE_ANIMALESE, Config_VOICE_MODE_CLICK, Config_VOICE_MODE_SILENT };
static void aNRTC_actor_ct(ACTOR* actor, GAME* game) {
// clang-format off
static aNPC_ct_data_c ct_data = {
&aNRTC_actor_move,
&aNRTC_actor_draw,
5,
mActor_NONE_PROC1,
&aNRTC_talk_init,
&aNRTC_talk_end_chk,
0,
};
// clang-format on
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
PLAYER_ACTOR* player;
xyz_t center;
xyz_t eye;
if (Common_Get(clip.npc_clip)->birth_check_proc(actor, game) == TRUE) {
rtc->npc_class.schedule.schedule_proc = aNRTC_schedule_proc;
rtc->npc_class.schedule.schedule_proc = &aNRTC_schedule_proc;
Common_Get(clip.npc_clip)->ct_proc(actor, game, &ct_data);
actor->status_data.weight = MASSTYPE_IMMOVABLE;
mPlib_request_main_demo_wait_type1(game, 0, NULL);
player = GET_PLAYER_ACTOR(play);
if (player != NULL) {
player->actor_class.state_bitfield |= 0x80;
player->actor_class.state_bitfield |= ACTOR_STATE_INVISIBLE;
}
center.x = 100.0f;
@@ -70,35 +118,36 @@ void aNRTC_actor_ct(ACTOR* actor, GAME* game) {
rtc->npc_class.condition_info.hide_request = 0;
rtc->npc_class.talk_info.default_act = 9;
rtc->npc_class.talk_info.melody_inst = 0;
rtc->unk9A0 = 0;
rtc->talk_flag = FALSE;
}
}
void aNRTC_actor_save(ACTOR* actor, GAME* game) {
static void aNRTC_actor_save(ACTOR* actor, GAME* game) {
Common_Get(clip.npc_clip)->save_proc(actor, game);
}
void aNRTC_actor_dt(ACTOR* actor, GAME* game) {
static void aNRTC_actor_dt(ACTOR* actor, GAME* game) {
Common_Get(clip.npc_clip)->dt_proc(actor, game);
}
void aNRTC_actor_init(ACTOR* actor, GAME* game) {
static void aNRTC_actor_init(ACTOR* actor, GAME* game) {
Common_Get(clip.npc_clip)->init_proc(actor, game);
}
void aNRTC_actor_move(ACTOR* actor, GAME* game) {
StaffRoll info;
static void aNRTC_actor_move(ACTOR* actor, GAME* game) {
StaffRollInfo_c info;
f32 val = 0.5f;
u8 arm_flag = TRUE;
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
if (rtc->npc_class.draw.animation_id == 0x76) {
if (rtc->npc_class.draw.animation_id == aNPC_ANIM_4HAKU_E1) {
sAdos_GetStaffRollInfo(&info);
if (info.unk0 != 4) {
if (info.staffroll_part != STAFFROLL_PART_FINISH) {
val = 0.0f;
arm_flag = FALSE;
rtc->npc_class.draw.main_animation.keyframe.frame_control.current_frame = 1.0f + (64.0f * (f32)info.unk8);
rtc->npc_class.draw.main_animation.keyframe.frame_control.current_frame =
1.0f + (64.0f * (f32)info.percent);
}
}
@@ -108,10 +157,9 @@ void aNRTC_actor_move(ACTOR* actor, GAME* game) {
mSC_change_player_freeze(play);
}
void aNRTC_actor_draw(ACTOR* actor, GAME* game) {
static void aNRTC_actor_draw(ACTOR* actor, GAME* game) {
Common_Get(clip.npc_clip)->draw_proc(actor, game);
}
#include "../src/ac_npc_rtc_think.c.inc"
#include "../src/ac_npc_rtc_talk.c.inc"
+166 -175
View File
@@ -1,69 +1,67 @@
static void aNRTC_set_slot_name(int slot_id, int str_no) {
u8 name[mIN_ITEM_NAME_LEN];
mString_Load_StringFromRom(name, sizeof(name), 0x6CD + slot_id);
mMsg_Set_free_str(mMsg_Get_base_window_p(), str_no, name, sizeof(name));
mString_Load_StringFromRom(name, sizeof(name), 0x06CD + slot_id);
mMsg_SET_FREE_STR(str_no, name, sizeof(name));
}
static void aNRTC_rtc_err(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
int num;
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
switch (num) {
case 0:
aNRTC_change_talk_proc(rtc, 3);
static void aNRTC_rtc_err(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0:
aNRTC_change_talk_proc(rtc, aNRTC_TALK_TIMER_OPEN_MSG_WAIT);
break;
case 1:
rtc->unk9A8 = 1;
aNRTC_change_talk_proc(rtc, 10);
case mChoice_CHOICE1:
rtc->think_idx = aNRTC_THINK_TITLE;
aNRTC_change_talk_proc(rtc, aNRTC_TALK_END);
break;
}
}
}
static void aNRTC_timer_open_msg_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
int order = mDemo_Get_OrderValue(4, 9);
static void aNRTC_timer_open_msg_wait(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
int order = mDemo_Get_OrderValue(mDemo_TYPE_4, 9);
if (order == 1) {
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
mDemo_Set_OrderValue(4, 9, 0);
aNRTC_change_talk_proc(rtc, 4);
mMsg_request_main_disappear_wait_type1(mMsg_Get_base_window_p());
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
mDemo_Set_OrderValue(mDemo_TYPE_4, 9, 0);
aNRTC_change_talk_proc(rtc, aNRTC_TALK_TIMER_OPEN_WAIT);
mMsg_REQUEST_MAIN_DISAPPEAR_WAIT_TYPE1();
}
}
}
static void aNRTC_timer_open_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
static void aNRTC_timer_open_wait(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
Submenu* submenu = &play->submenu;
if (mMsg_Check_main_wait(mMsg_Get_base_window_p()) == 1) {
aNRTC_change_talk_proc(rtc, 5);
mSM_open_submenu(submenu, 3, 1, 0);
mMsg_request_main_appear_wait_type1(mMsg_Get_base_window_p());
if (mMsg_CHECK_MAIN_WAIT() == TRUE) {
aNRTC_change_talk_proc(rtc, aNRTC_THINK_WAIT);
mSM_open_submenu(submenu, mSM_OVL_TIMEIN, mTI_OVL_OPEN_INITIAL, 0);
mMsg_REQUEST_MAIN_APPEAR_WAIT_TYPE1();
}
}
static void aNRTC_timer_close_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
static void aNRTC_timer_close_wait(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
if (play->submenu.open_flag == FALSE) {
if (mMsg_Check_not_series_main_wait(mMsg_Get_base_window_p()) == 1) {
mMsg_Set_ForceNext(mMsg_Get_base_window_p());
rtc->unk9A8 = 2;
aNRTC_change_talk_proc(rtc, 0xA);
if (mMsg_CHECK_NOT_SERIES_MAIN_WAIT() == TRUE) {
mMsg_SET_FORCENEXT();
rtc->think_idx = aNRTC_THINK_DOOR;
aNRTC_change_talk_proc(rtc, aNRTC_TALK_END);
}
}
}
static void aNRTC_delete_bf(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
int order = mDemo_Get_OrderValue(4, 9);
static void aNRTC_delete_bf(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
int order = mDemo_Get_OrderValue(mDemo_TYPE_4, 9);
if ((mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) && (order != 0)) {
if ((mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) && (order != 0)) {
mMsg_Set_LockContinue(mMsg_Get_base_window_p());
aNRTC_change_talk_proc(rtc, 7);
mMsg_SET_LOCKCONTINUE();
aNRTC_change_talk_proc(rtc, aNRTC_TALK_DELETE);
}
}
static void aNRTC_delete(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
static void aNRTC_delete(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
mMsg_Window_c* window;
int card;
int card_ret;
@@ -73,258 +71,251 @@ static void aNRTC_delete(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
switch (card_ret) {
case 0:
rtc->unk9A8 = 3;
mMsg_Set_continue_msg_num(window, 0x9DE);
rtc->think_idx = aNRTC_THINK_CHECK;
mMsg_Set_continue_msg_num(window, 0x09DE);
break;
case 22:
case 2:
rtc->unk9A8 = 1;
mMsg_Set_continue_msg_num(window, 0x9DF);
rtc->think_idx = aNRTC_THINK_TITLE;
mMsg_Set_continue_msg_num(window, 0x09DF);
break;
case 25:
return;
case 15:
rtc->unk9A8 = 3;
mMsg_Set_continue_msg_num(window, 0x9E1);
rtc->think_idx = aNRTC_THINK_CHECK;
mMsg_Set_continue_msg_num(window, 0x09E1);
break;
default:
rtc->unk9A8 = 1;
mMsg_Set_continue_msg_num(window, 0x9DF);
rtc->think_idx = aNRTC_THINK_TITLE;
mMsg_Set_continue_msg_num(window, 0x09DF);
break;
}
if (card_ret != 0x19) {
if (card_ret != 25) {
mMsg_Unset_LockContinue(window);
aNRTC_change_talk_proc(rtc, 10);
aNRTC_change_talk_proc(rtc, aNRTC_TALK_END);
}
}
static void aNRTC_format_chk(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
int num;
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
aNRTC_change_talk_proc(rtc, 0xA);
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
switch (num) {
case 0:
rtc->unk9A8 = 3;
static void aNRTC_format_chk(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
aNRTC_change_talk_proc(rtc, aNRTC_TALK_END);
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0:
rtc->think_idx = aNRTC_THINK_CHECK;
break;
case 1:
rtc->unk9A8 = 2;
case mChoice_CHOICE1:
rtc->think_idx = aNRTC_THINK_DOOR;
break;
case 2:
rtc->unk9A8 = 1;
case mChoice_CHOICE2:
rtc->think_idx = aNRTC_THINK_TITLE;
break;
case 3:
rtc->unk9A8 = 3;
aNRTC_change_talk_proc(rtc, 9);
case mChoice_CHOICE3:
rtc->think_idx = aNRTC_THINK_CHECK;
aNRTC_change_talk_proc(rtc, aNRTC_TALK_FORMAT);
break;
}
}
}
static void aNRTC_format(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
static void aNRTC_format(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
int order;
mMsg_Window_c* window;
int card_ret;
window = mMsg_Get_base_window_p();
order = mDemo_Get_OrderValue(4, 9);
order = mDemo_Get_OrderValue(mDemo_TYPE_4, 9);
switch (order) {
case 1:
mDemo_Set_OrderValue(4, 9, 2);
mDemo_Set_OrderValue(mDemo_TYPE_4, 9, 2);
mMsg_Set_LockContinue(window);
break;
case 2:
card_ret = mCD_card_format_bg(Common_Get(memcard_slot));
switch (card_ret) {
case 1:
mMsg_Set_continue_msg_num(window, 0x9E9);
switch (mCD_card_format_bg(Common_Get(memcard_slot))) {
case mCD_RESULT_SUCCESS:
mMsg_Set_continue_msg_num(window, 0x09E9);
mMsg_Unset_LockContinue(window);
aNRTC_change_talk_proc(rtc, 0xA);
rtc->unk9A8 = 3;
mDemo_Set_OrderValue(4, 9, 0);
aNRTC_change_talk_proc(rtc, aNRTC_TALK_END);
rtc->think_idx = aNRTC_THINK_CHECK;
mDemo_Set_OrderValue(mDemo_TYPE_4, 9, 0);
break;
case -1:
case mCD_RESULT_ERROR:
mMsg_Unset_LockContinue(window);
aNRTC_change_talk_proc(rtc, 0xA);
rtc->unk9A8 = 1;
mMsg_Set_continue_msg_num(window, 0x9E7);
mDemo_Set_OrderValue(4, 9, 0);
case 0:
aNRTC_change_talk_proc(rtc, aNRTC_TALK_END);
rtc->think_idx = aNRTC_THINK_TITLE;
mMsg_Set_continue_msg_num(window, 0x09E7);
mDemo_Set_OrderValue(mDemo_TYPE_4, 9, 0);
case mCD_RESULT_BUSY:
break;
}
break;
}
}
static void aNRTC_break_data(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
int num;
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
aNRTC_change_talk_proc(rtc, 0xA);
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
switch (num) {
case 0:
rtc->unk9A8 = 3;
static void aNRTC_break_data(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
aNRTC_change_talk_proc(rtc, aNRTC_TALK_END);
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0:
rtc->think_idx = aNRTC_THINK_CHECK;
break;
case 1:
aNRTC_change_talk_proc(rtc, 6);
case mChoice_CHOICE1:
aNRTC_change_talk_proc(rtc, aNRTC_TALK_DELETE_BF);
break;
}
}
}
static void aNRTC_break_data_2(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
int num;
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
aNRTC_change_talk_proc(rtc, 0xA);
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
switch (num) {
case 0:
rtc->unk9A8 = 3;
static void aNRTC_break_data_2(NPC_RTC_ACTOR* rtc, GAME_PLAY* play) {
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
aNRTC_change_talk_proc(rtc, aNRTC_TALK_END);
switch (mChoice_GET_CHOSENUM()) {
case mChoice_CHOICE0:
rtc->think_idx = aNRTC_THINK_CHECK;
break;
case 1:
rtc->unk9A8 = 2;
case mChoice_CHOICE1:
rtc->think_idx = aNRTC_THINK_DOOR;
break;
case 2:
rtc->unk9A8 = 1;
case mChoice_CHOICE2:
rtc->think_idx = aNRTC_THINK_TITLE;
break;
case 3:
rtc->unk9A8 = 4;
case mChoice_CHOICE3:
rtc->think_idx = aNRTC_THINK_IPMENU;
break;
}
}
}
static void aNRTC_change_talk_proc(NPCRTC_ACTOR* rtc, int idx) {
static aNPCRTC_SUB_PROC process[] = {
aNRTC_break_data,
aNRTC_break_data_2,
aNRTC_rtc_err,
aNRTC_timer_open_msg_wait,
aNRTC_timer_open_wait,
aNRTC_timer_close_wait,
aNRTC_delete_bf,
aNRTC_delete,
aNRTC_format_chk,
aNRTC_format,
(aNPCRTC_SUB_PROC)none_proc1,
static void aNRTC_change_talk_proc(NPC_RTC_ACTOR* rtc, int idx) {
// clang-format off
static aNRTC_PROC process[] = {
&aNRTC_break_data,
&aNRTC_break_data_2,
&aNRTC_rtc_err,
&aNRTC_timer_open_msg_wait,
&aNRTC_timer_open_wait,
&aNRTC_timer_close_wait,
&aNRTC_delete_bf,
&aNRTC_delete,
&aNRTC_format_chk,
&aNRTC_format,
(aNRTC_PROC)&none_proc1,
};
rtc->unk994 = idx;
rtc->unk99C = process[idx];
// clang-format on
rtc->talk_idx = idx;
rtc->talk_proc = process[idx];
}
static void aNRTC_set_talk_info_talk_request() {
int msg;
switch (Common_Get(save_error_type)) {
case 0:
msg = 0x9CC;
case mFRm_ERROR_BAD_RTC:
msg = 0x09CC;
break;
case 2:
msg = 0x9D1;
case mFRm_ERROR_DATA_CORRUPTED:
msg = 0x09D1;
break;
case 6:
msg = 0x9DA;
case mFRm_ERROR_MEMCARD_INVALID:
msg = 0x09DA;
break;
case 7:
msg = 0x9D8;
case mFRm_ERROR_MEMCARD_NO_SPACE:
msg = 0x09D8;
break;
case 9:
msg = 0x9D4;
case mFRm_ERROR_NO_MEMCARD:
msg = 0x09D4;
break;
case 1:
msg = 0x9E2;
case mFRm_ERROR_MEMCARD_TRAVELDATA_CONFLICT:
msg = 0x09E2;
break;
case 4:
msg = 0x9E4;
case mFRm_ERROR_MEMCARD_DAMAGED:
msg = 0x09E4;
break;
case 3:
msg = 0x9E3;
case mFRm_ERROR_MEMCARD_NO_FILES:
msg = 0x09E3;
break;
case 5:
msg = 0x9E5;
case mFRm_ERROR_MEMCARD_FORMAT:
msg = 0x09E5;
break;
case 8:
msg = 0x9E6;
case mFRm_ERROR_NOT_MEMCARD:
msg = 0x09E6;
break;
default:
msg = 0x9D4;
msg = 0x09D4;
break;
}
mDemo_Set_msg_num(msg);
mDemo_Set_camera(1);
mDemo_Set_camera(CAMERA2_PROCESS_NORMAL);
}
static void aNRTC_talk_request(ACTOR* actor, GAME* game) {
mDemo_Request(8, actor, aNRTC_set_talk_info_talk_request);
mDemo_Request(mDemo_TYPE_SPEAK, actor, &aNRTC_set_talk_info_talk_request);
}
static int aNRTC_talk_init(ACTOR* actor, GAME* game) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
mDemo_Set_ListenAble();
aNRTC_set_slot_name(Common_Get(memcard_slot), mMsg_FREE_STR4);
switch (Common_Get(save_error_type)) {
case 0:
aNRTC_change_talk_proc(rtc, 2);
case mFRm_ERROR_BAD_RTC:
aNRTC_change_talk_proc(rtc, aNRTC_TALK_RTC_ERR);
break;
case 2:
aNRTC_change_talk_proc(rtc, 0);
case mFRm_ERROR_DATA_CORRUPTED:
aNRTC_change_talk_proc(rtc, aNRTC_TALK_BREAK_DATA);
break;
case 5:
aNRTC_change_talk_proc(rtc, 8);
case mFRm_ERROR_MEMCARD_FORMAT:
aNRTC_change_talk_proc(rtc, aNRTC_TALK_FORMAT_CHK);
break;
default:
aNRTC_change_talk_proc(rtc, 1);
aNRTC_change_talk_proc(rtc, aNRTC_TALK_BREAK_DATA2);
break;
}
rtc->npc_class.talk_info.talk_request_proc = mActor_NONE_PROC1;
mMsg_Set_idling_req(mMsg_Get_base_window_p());
return 1;
mMsg_SET_IDLING_REQ();
return TRUE;
}
static int aNRTC_talk_end_chk(ACTOR* actor, GAME* game) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
int res = 0;
int res = FALSE;
mMsg_Window_c* window;
window = mMsg_Get_base_window_p();
rtc->unk99C(rtc, play);
(*rtc->talk_proc)(rtc, play);
if (mMsg_Check_idling_now(window) == 1) {
if (mMsg_Check_idling_now(window) == TRUE) {
mMsg_request_main_disappear_wait_type1(window);
aNRTC_think_init_proc(&rtc->npc_class, play);
rtc->unk9A0 = 0;
res = 1;
rtc->unk9B4 = 0x32;
rtc->unk9B0 = 0x4B;
rtc->talk_flag = FALSE;
res = TRUE;
rtc->bgm_timer = 50;
rtc->fade_timer = 75;
bzero(&play->fade_color_value, sizeof(rgba8888_t));
} else {
int unk9AC;
unk9AC = rtc->unk9AC;
if ((mMsg_Check_MainNormal(mMsg_Get_base_window_p()) == 1) ||
(((mChoice_check_main_normal(mChoice_Get_base_window_p()) == 1) != 0))) {
unk9AC++;
if (unk9AC > 0x258) {
unk9AC = 0x258;
int counter = rtc->counter;
if ((mMsg_CHECK_MAINNORMAL() == TRUE) || (mChoice_CHECK_MAIN_NORMAL() == TRUE)) {
counter++;
if (counter > 600) {
counter = 600;
}
} else {
unk9AC = 0;
counter = 0;
}
if (mDemo_Get_OrderValue(4, 0) == 0) {
if (unk9AC >= 0x258) {
if (rtc->npc_class.draw.animation_id != 0x76) {
mDemo_Set_OrderValue(4, 0, 0xFF);
if (mDemo_Get_OrderValue(mDemo_TYPE_4, 0) == 0) {
if (counter >= 600) {
if (rtc->npc_class.draw.animation_id != aNPC_ANIM_4HAKU_E1) {
mDemo_Set_OrderValue(mDemo_TYPE_4, 0, 0xFF);
}
} else if (rtc->npc_class.draw.animation_id == 0x76) {
mDemo_Set_OrderValue(4, 0, 0xFD);
} else if (rtc->npc_class.draw.animation_id == aNPC_ANIM_4HAKU_E1) {
mDemo_Set_OrderValue(mDemo_TYPE_4, 0, 0xFD);
}
}
rtc->unk9AC = unk9AC;
rtc->counter = counter;
}
return res;
}
+63 -43
View File
@@ -2,30 +2,40 @@
static void aNRTC_talk_request(ACTOR* actor, GAME*);
static void aNRTC_think_start(NPC_ACTOR* actor, GAME_PLAY* play) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
if (rtc->unk9B8 > 0) {
rtc->unk9B8--;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
if (rtc->first_talk_timer > 0) {
rtc->first_talk_timer--;
} else {
rtc->unk9A0 = 1;
rtc->npc_class.talk_info.talk_request_proc = aNRTC_talk_request;
rtc->npc_class.condition_info.demo_flg = 0x100;
rtc->talk_flag = TRUE;
rtc->npc_class.talk_info.talk_request_proc = &aNRTC_talk_request;
rtc->npc_class.condition_info.demo_flg = aNPC_COND_DEMO_SKIP_HEAD_LOOKAT;
}
}
static void aNRTC_think_title(NPC_ACTOR* actor, GAME_PLAY* play) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
play->fb_wipe_type = 3;
play->fb_fade_type = 4;
mPlib_request_main_invade_type1(play);
mPlib_request_main_invade_type1((GAME*)play);
Actor_info_save_actor(play);
rtc->unk9A8 = 5;
rtc->think_idx = aNRTC_THINK_WAIT;
}
Door_data_c door_data = { SCENE_PLAYERSELECT, 4, FALSE, 0, { 100, 0, 120 }, EMPTY_NO, 3, { 0, 0, 0 } };
// clang-format off
static Door_data_c door_data = {
SCENE_PLAYERSELECT,
mSc_DIRECT_NORTH,
FALSE,
0,
{ 100, 0, 120 },
EMPTY_NO,
3,
{ 0, 0, 0 },
};
// clang-format on
static void aNRTC_think_door(NPC_ACTOR* actor, GAME_PLAY* play) {
if (sAdo_BgmFadeoutCheck() != 0) {
goto_other_scene(play, &door_data, 1);
Common_Set(transition.wipe_type, 3);
@@ -33,54 +43,61 @@ static void aNRTC_think_door(NPC_ACTOR* actor, GAME_PLAY* play) {
}
static void aNRTC_think_check(NPC_ACTOR* actor, GAME_PLAY* play) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
if (sAdo_BgmFadeoutCheck() != 0) {
goto_other_scene(play, &door_data, 1);
mCD_ReCheckLoadLand(play);
Common_Set(transition.wipe_type, 3);
rtc->unk9A8 = 5;
rtc->think_idx = aNRTC_THINK_WAIT;
}
}
static void aNRTC_think_ipmenu(NPC_ACTOR* actor, GAME_PLAY* play) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
if (sAdo_BgmFadeoutCheck() != 0) {
HotResetIplMenu();
rtc->unk9A8 = 5;
rtc->think_idx = aNRTC_THINK_WAIT;
}
}
aNPC_SUB_PROC aNRTC_proc_table[] = {
aNRTC_think_start, aNRTC_think_title, aNRTC_think_door,
aNRTC_think_check, aNRTC_think_ipmenu, (aNPC_SUB_PROC)mActor_NONE_PROC1,
// clang-format off
static aNPC_SUB_PROC aNRTC_proc_table[] = {
&aNRTC_think_start,
&aNRTC_think_title,
&aNRTC_think_door,
&aNRTC_think_check,
&aNRTC_think_ipmenu,
(aNPC_SUB_PROC)mActor_NONE_PROC1,
};
// clang-format on
static void aNRTC_think_main_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
if (rtc->unk9B0 > 0) {
rtc->unk9B0--;
if (rtc->unk9B0 == 0) {
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
if (rtc->fade_timer > 0) {
rtc->fade_timer--;
if (rtc->fade_timer == 0) {
play->fade_color_value.c.a = -1;
} else if (rtc->unk9B0 < 25) {
play->fade_color_value.c.a = 255.0f * (1.0f - (0.04f * rtc->unk9B0));
} else if (rtc->fade_timer < 25) {
play->fade_color_value.c.a = 255.0f * (1.0f - (0.04f * rtc->fade_timer));
}
} else if (rtc->unk9A0 == 0) {
aNRTC_proc_table[rtc->unk9A8](actor, play);
} else if (rtc->talk_flag == 0) {
aNRTC_proc_table[rtc->think_idx](actor, play);
}
if (rtc->unk9B4 == 0) {
if (rtc->unk9A8 == 1) {
if (rtc->bgm_timer == 0) {
if (rtc->think_idx == 1) {
mBGMPsComp_make_ps_wipe(0x21C2);
} else {
mBGMPsComp_make_ps_wipe(0x621C);
}
rtc->unk9B4 = -2;
} else if (rtc->unk9B4 > 0) {
rtc->unk9B4--;
rtc->bgm_timer = -2;
} else if (rtc->bgm_timer > 0) {
rtc->bgm_timer--;
}
}
static void aNRTC_think_init_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
rtc->npc_class.request.act_priority = 4;
rtc->npc_class.request.act_idx = 8;
rtc->npc_class.request.act_type = 0;
@@ -88,34 +105,37 @@ static void aNRTC_think_init_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
static void aNRTC_think_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
static aNPC_SUB_PROC think_proc[] = {
aNRTC_think_init_proc,
aNRTC_think_main_proc,
&aNRTC_think_init_proc,
&aNRTC_think_main_proc,
};
think_proc[idx](actor, play);
}
static void aNRTC_schedule_init_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
rtc->npc_class.draw._5BE = 1;
rtc->npc_class.talk_info.default_animation = 0x76;
rtc->unk9B4 = -1;
rtc->unk9B0 = 0;
rtc->unk9B8 = 0x5A;
rtc->npc_class.talk_info.default_animation = aNPC_ANIM_4HAKU_E1;
rtc->bgm_timer = -1;
rtc->fade_timer = 0;
rtc->first_talk_timer = 90;
rtc->npc_class.think.think_proc = aNRTC_think_proc;
rtc->unk9A8 = 0;
Common_Get(clip.npc_clip)->think_proc(actor, play, 6, 0);
rtc->think_idx = 0;
Common_Get(clip.npc_clip)->think_proc(actor, play, aNPC_THINK_IN_BLOCK, 0);
}
static void aNRTC_schedule_main_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
NPC_RTC_ACTOR* rtc = (NPC_RTC_ACTOR*)actor;
if (Common_Get(clip.npc_clip)->think_proc(actor, play, -1, 1) == 0) {
Common_Get(clip.npc_clip)->think_proc(actor, play, -1, 2);
}
}
static void aNRTC_schedule_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
static aNPC_SUB_PROC sche_proc[] = { aNRTC_schedule_init_proc, aNRTC_schedule_main_proc };
static aNPC_SUB_PROC sche_proc[] = {
&aNRTC_schedule_init_proc,
&aNRTC_schedule_main_proc,
};
sche_proc[idx](actor, play);
}
+952 -1125
View File
File diff suppressed because it is too large Load Diff
+451
View File
@@ -0,0 +1,451 @@
#include "ac_shop_design.h"
#include "m_common_data.h"
#include "m_name_table.h"
static void Shop_Design_Actor_ct(ACTOR* actorx, GAME* game);
static void Shop_Design_Actor_dt(ACTOR* actorx, GAME* game);
static void Shop_Design_Actor_move(ACTOR* actorx, GAME* game);
static void Shop_Design_Actor_draw(ACTOR* actorx, GAME* game);
ACTOR_PROFILE Shop_Design_Profile = {
mAc_PROFILE_SHOP_DESIGN,
ACTOR_PART_CONTROL,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(SHOP_DESIGN_ACTOR),
&Shop_Design_Actor_ct,
&Shop_Design_Actor_dt,
&Shop_Design_Actor_move,
&Shop_Design_Actor_draw,
NULL,
};
static mActor_name_t aSD_ItemName2ReservePointName(mActor_name_t item) {
int tanuki_shop_status = Common_Get(tanuki_shop_status);
if (tanuki_shop_status == mSP_TANUKI_SHOP_STATUS_EVENT) {
return RSV_SHOP_EVENT;
}
if (item == ITM_SIGNBOARD) {
return RSV_SHOP_SIGNBOARD;
}
if (ITEM_IS_FTR(item)) {
return RSV_SHOP_FTR;
}
if (item == RSV_SHOP_SOLD_FTR) {
return RSV_SHOP_FTR;
}
if ((item >= ITM_PAPER_START && item <= ITM_PAPER_END) || (item >= ITM_DIARY00 && item <= ITM_DIARY15)) {
return RSV_SHOP_PAPER;
}
if (item == RSV_SHOP_SOLD_PAPER) {
return RSV_SHOP_PAPER;
}
if (item >= ITM_CARPET_START && item <= (ITM_CARPET_END - 4)) {
return RSV_SHOP_CARPET;
}
if (item == RSV_SHOP_SOLD_CARPET) {
return RSV_SHOP_CARPET;
}
if (item >= ITM_WALL_START && item <= (ITM_WALL_END - 4)) {
return RSV_SHOP_WALL;
}
if (item == RSV_SHOP_SOLD_WALL) {
return RSV_SHOP_WALL;
}
if (item >= ITM_CLOTH_START && item <= ITM_CLOTH_END) {
return RSV_SHOP_CLOTH;
}
if (item == RSV_SHOP_SOLD_CLOTH) {
return RSV_SHOP_CLOTH;
}
if (item >= ITM_TOOL_START && item <= ITM_TOOL_END) {
if (item >= ITM_UMBRELLA_START && item <= (ITM_UMBRELLA_END - 1)) {
return RSV_SHOP_UMBRELLA;
}
if (item >= ITM_RED_PAINT && item <= ITM_BROWN_PAINT) {
return RSV_SHOP_PAINT;
}
/* @BUG - this is impossible to reach, maybe signboard used to be in the TOOL category before? */
if (item == ITM_SIGNBOARD) {
return RSV_SHOP_SIGNBOARD;
}
return RSV_SHOP_TOOL;
}
if (item == RSV_SHOP_SOLD_TOOL) {
return RSV_SHOP_TOOL;
}
if (item == RSV_SHOP_SOLD_UMBRELLA) {
return RSV_SHOP_UMBRELLA;
}
if (item == RSV_SHOP_SOLD_PAINT) {
return RSV_SHOP_PAINT;
}
if (item == RSV_SHOP_SOLD_SIGNBOARD) {
return RSV_SHOP_SIGNBOARD;
}
if ((item >= ITM_SAPLING && item <= ITM_CEDAR_SAPLING) ||
((item >= ITM_WHITE_PANSY_BAG && item <= ITM_YELLOW_TULIP_BAG &&
tanuki_shop_status == mSP_TANUKI_SHOP_STATUS_HALLOWEEN))) {
return RSV_SHOP_HALLOWEEN;
}
if ((item >= ITM_WHITE_PANSY_BAG && item <= ITM_YELLOW_TULIP_BAG) || item == ITM_FOOD_CANDY) {
return RSV_SHOP_PLANT;
}
return EMPTY_NO;
}
static void aSD_MakeHukubukuroFg(void) {
static mActor_name_t reserve_table[] = {
RSV_SHOP_TOOL, RSV_SHOP_SIGNBOARD, RSV_SHOP_PAINT, RSV_SHOP_PAPER, RSV_SHOP_HALLOWEEN, RSV_SHOP_PLANT,
};
int n = Save_Get(shop).flowers_candy_grab_bag_count;
int i;
/* Search all reserve items */
for (i = 0; i < ARRAY_COUNT(reserve_table); i++) {
/* Replace all reserve items of this type to grab bags */
while (n > 0 && mSP_SetGoods2ReservedPoint(ITM_HUKUBUKURO_BAG, reserve_table[i]) != FALSE) {
n--;
}
}
/* Search all reserve items */
for (i = 0; i < ARRAY_COUNT(reserve_table); i++) {
/* Replace any left with reserve RSV_SHOP_SOLD_PLANT */
while (mSP_SetGoods2ReservedPoint(RSV_SHOP_SOLD_PLANT, reserve_table[i]) != FALSE) {}
}
}
static void aSD_MakePlantFg_normal(void) {
while (mSP_SetGoods2ReservedPoint(RSV_SHOP_SOLD_PLANT, RSV_SHOP_HALLOWEEN) != FALSE) {}
while (mSP_SetGoods2ReservedPoint(RSV_SHOP_SOLD_PLANT, RSV_SHOP_PLANT) != FALSE) {}
}
static void aSD_MakePlantFg_hal(void) {
int n = Save_Get(shop).flowers_candy_grab_bag_count;
/* Fill plant spots with candy */
while (n > 0 && mSP_SetGoods2ReservedPoint(ITM_FOOD_CANDY, RSV_SHOP_PLANT) != FALSE) {
n--;
}
/* Clear the remaining plant reserve spots */
while (mSP_SetGoods2ReservedPoint(RSV_SHOP_SOLD_PLANT, RSV_SHOP_PLANT) != FALSE) {}
}
static void aSD_MakePlantFg(void) {
if (Common_Get(tanuki_shop_status) == mSP_TANUKI_SHOP_STATUS_HALLOWEEN) {
aSD_MakePlantFg_hal();
} else {
aSD_MakePlantFg_normal();
}
}
static void aSD_MakeGoodsFg(mActor_name_t* goods_p, int count) {
int i;
for (i = 0; i < count; i++) {
if (goods_p[i] != EMPTY_NO) {
mActor_name_t reserve_name = aSD_ItemName2ReservePointName(goods_p[i]);
if (reserve_name != EMPTY_NO) {
mSP_SetGoods2ReservedPoint(goods_p[i], reserve_name);
}
}
}
}
/* Mispelling of 'rare' */
static void aSD_MakeReaGoodsFg(mActor_name_t item) {
if (item != EMPTY_NO) {
mSP_SetGoods2ReservedPoint(item, RSV_SHOP_RARE);
}
}
static void aSD_MakeLotteryGoodsFg(mActor_name_t* lottery_items) {
mSP_SetGoods2ReservedPoint(lottery_items[2], RSV_SHOP_FTR);
mSP_SetGoods2ReservedPoint(lottery_items[0], RSV_SHOP_FTR);
mSP_SetGoods2ReservedPoint(lottery_items[1], RSV_SHOP_FTR);
}
static mActor_name_t aSD_UnitNum2ItemNo(int ux, int uz);
static int aSD_ReportGoodsSales(int ux, int uz);
static void aSD_SetClipProc(ACTOR* actorx, int clear) {
SHOP_DESIGN_ACTOR* shop_design = (SHOP_DESIGN_ACTOR*)actorx;
if (clear) {
Common_Get(clip).shop_design_clip = NULL;
} else {
Common_Get(clip).shop_design_clip = &shop_design->clip;
shop_design->clip.design_actor = shop_design;
shop_design->clip.unitNum2ItemNo_proc = &aSD_UnitNum2ItemNo;
shop_design->clip.reportGoodsSale_proc = &aSD_ReportGoodsSales;
}
}
static void aSD_GetGoodsInfo(SHOP_DESIGN_ACTOR* shop_design) {
if (Common_Get(tanuki_shop_status) == mSP_TANUKI_SHOP_STATUS_EVENT) {
int count = 0;
int i;
shop_design->goods_list = Save_Get(event_save_data).special.event.bargin.items;
shop_design->goods_list_max = mEv_BARGIN_ITEM_NUM;
for (i = 0; i < mEv_BARGIN_ITEM_NUM; i++) {
if (shop_design->goods_list[i] != EMPTY_NO) {
count++;
}
}
shop_design->goods_list_count = count;
} else {
shop_design->goods_list = Save_Get(shop).items;
shop_design->goods_list_count = mSP_CountElementInGoodsList();
shop_design->goods_list_max = mSP_GOODS_COUNT;
}
/* Check if player is from a different town and, if so, set the flag for Nookington's */
mSP_SetNewVisitor();
}
static void aSD_SetReservedPointFill000(void) {
mActor_name_t* fg_p = mFI_BkNumtoUtFGTop(0, 0);
int i;
for (i = 0; i < UT_TOTAL_NUM; i++) {
if (fg_p[i] >= RSV_SHOP_PAPER && fg_p[i] <= RSV_SHOP_SIGNBOARD) {
fg_p[i] = RSV_NO; // TODO: I suppose RSV_NO is actually called 'FILL000'
}
}
}
static void Shop_Design_Actor_ct(ACTOR* actorx, GAME* game) {
SHOP_DESIGN_ACTOR* shop_design = (SHOP_DESIGN_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
int scene_no = Save_Get(scene_no);
actorx->actor_specific = -1; // no valid shop type
if (scene_no == SCENE_SHOP0) {
actorx->actor_specific = 0;
} else if (scene_no == SCENE_CONVENI) {
actorx->actor_specific = 1;
} else if (scene_no == SCENE_SUPER) {
actorx->actor_specific = 2;
} else if (scene_no == SCENE_DEPART) {
actorx->actor_specific = 3;
}
/* Check if the shop is currently having the monthly lottery raffle */
if (Common_Get(tanuki_shop_status) == mSP_TANUKI_SHOP_STATUS_FUKUBIKI && actorx->actor_specific != -1) {
/* garagara likely referes to ガラガラ抽選 or 'raffle drum/rattle lottery' */
static xyz_t garagara_set_table[] = {
{ 160.0f, 60.0f, 190.0f }, /* Nook's Cranny */
{ 240.0f, 60.0f, 190.0f }, /* Nook 'n' Go */
{ 240.0f, 60.0f, 350.0f }, /* Nookway */
{ 240.0f, 60.0f, 350.0f }, /* Nookington's */
{ 160.0f, 60.0f, 180.0f }, /* Nookington's 2nd floor? */
};
/* Make the raffle drum actor */
Actor_info_make_actor(&play->actor_info, game, mAc_PROFILE_GARAGARA,
garagara_set_table[actorx->actor_specific].x,
garagara_set_table[actorx->actor_specific].y,
garagara_set_table[actorx->actor_specific].z, 0, 0, 0, -1, -1, -1, EMPTY_NO, 0, -1, -1);
}
if (scene_no == SCENE_SHOP0 || scene_no == SCENE_CONVENI || scene_no == SCENE_SUPER || scene_no == SCENE_DEPART ||
scene_no == SCENE_DEPART_2) {
aSD_GetGoodsInfo(shop_design);
if (Common_Get(tanuki_shop_status) == mSP_TANUKI_SHOP_STATUS_FUKUBIKI) {
aSD_MakeLotteryGoodsFg(Save_Get(shop).lottery_items);
} else {
aSD_MakeGoodsFg(shop_design->goods_list, shop_design->goods_list_count);
if (Common_Get(tanuki_shop_status) != mSP_TANUKI_SHOP_STATUS_EVENT) {
aSD_MakeReaGoodsFg(Save_Get(shop).rare_item);
if (Common_Get(tanuki_shop_status) == mSP_TANUKI_SHOP_STATUS_HUKUBUKURO_SALE) {
aSD_MakeHukubukuroFg();
} else {
aSD_MakePlantFg();
}
}
}
aSD_SetReservedPointFill000();
aSD_SetClipProc(actorx, FALSE);
}
}
static void Shop_Design_Actor_dt(ACTOR* actorx, GAME* game) {
aSD_SetClipProc(actorx, TRUE);
}
static void Shop_Design_Actor_draw(ACTOR* actorx, GAME* game) {
// nothing
}
static void Shop_Design_Actor_move(ACTOR* actorx, GAME* game) {
// nothing
}
static mActor_name_t aSD_UnitNum2ItemNo(int ux, int uz) {
int bx = ux / UT_X_NUM;
int bz = uz / UT_Z_NUM;
mActor_name_t* fg_p = mFI_BkNumtoUtFGTop(bx, bz);
int local_ux = ux - bx * UT_X_NUM;
int local_uz = uz - bz * UT_Z_NUM;
mActor_name_t item = fg_p[local_ux + local_uz * UT_X_NUM];
if ((item >= RSV_SHOP_FE0D && item <= RSV_SHOP_SOLD_SIGNBOARD)) {
return RSV_NO;
}
if (
// clang-format off
ITEM_IS_FTR(item) ||
(item >= ITM_PAPER_START && item <= ITM_PAPER_END) ||
(item >= ITM_CARPET_START && item <= ITM_CARPET_END - 4) ||
(item >= ITM_WALL_START && item <= ITM_WALL_END - 4) ||
(item >= ITM_CLOTH_START && item <= ITM_CLOTH_END) ||
(item >= ITM_TOOL_START && item <= ITM_TOOL_END) ||
(item >= ITM_SAPLING && item <= ITM_CEDAR_SAPLING) ||
(item >= ITM_WHITE_PANSY_BAG && item <= ITM_YELLOW_TULIP_BAG) ||
(item >= ITM_DIARY00 && item <= ITM_DIARY15) ||
(item == ITM_FOOD_CANDY) ||
(item == RSV_FE1F) ||
(item == ITM_HUKUBUKURO_BAG) ||
(item == ITM_SIGNBOARD)
// clang-format on
) {
if (item == RSV_FE1F) {
if (Common_Get(clip).my_room_clip != NULL) {
mActor_name_t ftr_item;
Common_Get(clip).my_room_clip->unitNum2ftrItemNoftrId_proc(&ftr_item, NULL, ux, uz, mCoBG_LAYER0);
return ftr_item;
} else {
return RSV_NO;
}
} else {
return item;
}
} else {
return RSV_NO;
}
}
static int aSD_ReportGoodsSales(int ux, int uz) {
mActor_name_t item = aSD_UnitNum2ItemNo(ux, uz);
u32 price = mSP_ItemNo2ItemPrice(item);
mActor_name_t rsv_item = EMPTY_NO;
if (Common_Get(clip).shop_design_clip != NULL) {
SHOP_DESIGN_ACTOR* shop_design = Common_Get(clip).shop_design_clip->design_actor;
mSP_PlusSales(price);
if (item == ITM_HUKUBUKURO_BAG) {
mSP_ShopSaleReport(item, shop_design->goods_list, shop_design->goods_list_max, RSV_SHOP_SOLD_PLANT);
mFI_UtNumtoFGSet_common(RSV_SHOP_SOLD_PLANT, ux, uz, FALSE);
return FALSE;
} else if ((item >= ITM_SAPLING && item <= ITM_CEDAR_SAPLING) ||
(item >= ITM_WHITE_PANSY_BAG && item <= ITM_YELLOW_TULIP_BAG) || item == ITM_FOOD_CANDY) {
if (mSP_ShopSaleReport(item, shop_design->goods_list, shop_design->goods_list_max, RSV_SHOP_SOLD_PLANT)) {
return TRUE;
} else {
mFI_UtNumtoFGSet_common(RSV_SHOP_SOLD_PLANT, ux, uz, FALSE);
return FALSE;
}
} else if (item >= ITM_CLOTH_START && item <= ITM_CLOTH_END) {
mSP_ShopSaleReport(item, shop_design->goods_list, shop_design->goods_list_max, RSV_SHOP_SOLD_CLOTH);
Common_Get(clip).shop_manekin_clip->change2naked_manekin_proc(ux, uz);
mFI_UtNumtoFGSet_common(RSV_NO, ux, uz, FALSE);
return FALSE;
} else if (ITEM_IS_FTR(item) && Common_Get(clip).my_room_clip != NULL) {
mActor_name_t ftr_item;
int ftrID;
Common_Get(clip).my_room_clip->unitNum2ftrItemNoftrId_proc(&ftr_item, &ftrID, ux, uz, mCoBG_LAYER0);
Common_Get(clip).my_room_clip->ftrId2extinguishFtr_proc(ftrID);
if (item == Save_Get(shop).rare_item) {
rsv_item = RSV_SHOP_SOLD_RARE;
} else {
rsv_item = RSV_SHOP_SOLD_FTR;
}
}
if (item >= ITM_CARPET_START && item <= (ITM_CARPET_END - 4)) {
rsv_item = RSV_SHOP_SOLD_CARPET;
}
if (item >= ITM_WALL_START && item <= (ITM_WALL_END - 4)) {
rsv_item = RSV_SHOP_SOLD_WALL;
}
if (item == ITM_SIGNBOARD) {
rsv_item = RSV_SHOP_SOLD_SIGNBOARD;
}
if (item >= ITM_TOOL_START && item <= ITM_TOOL_END) {
if (item >= ITM_UMBRELLA_START && item <= (ITM_UMBRELLA_END - 1)) {
if (Common_Get(clip).shop_umbrella_clip != NULL) {
Common_Get(clip).shop_umbrella_clip->delete_umbrella_proc(ux, uz);
}
rsv_item = RSV_SHOP_SOLD_UMBRELLA;
} else if (item >= ITM_RED_PAINT && item <= ITM_BROWN_PAINT) {
rsv_item = RSV_SHOP_SOLD_PAINT;
} else if (item == ITM_SIGNBOARD) {
rsv_item = RSV_SHOP_SOLD_SIGNBOARD;
} else {
rsv_item = RSV_SHOP_SOLD_TOOL;
}
}
if (item >= ITM_PAPER_START && item <= ITM_PAPER_END) {
return TRUE;
}
if (item >= ITM_DIARY00 && item <= ITM_DIARY15) {
rsv_item = RSV_SHOP_SOLD_PAPER;
}
if (Common_Get(tanuki_shop_status) == mSP_TANUKI_SHOP_STATUS_EVENT && mEv_CheckEvent(mEv_SPNPC_SHOP) == FALSE) {
return FALSE;
}
if (rsv_item != EMPTY_NO) {
if (mSP_ShopSaleReport(item, shop_design->goods_list, shop_design->goods_list_max, rsv_item)) {
return TRUE;
}
mFI_UtNumtoFGSet_common(rsv_item, ux, uz, FALSE);
}
return FALSE;
} else {
return FALSE;
}
}
+528
View File
@@ -0,0 +1,528 @@
#include "ac_shop_goods.h"
#include "m_common_data.h"
#include "m_player_lib.h"
#include "m_rcp.h"
#include "sys_matrix.h"
#include "ac_my_room.h"
#include "m_malloc.h"
static void Shop_Goods_Actor_ct(ACTOR* actorx, GAME* game);
static void Shop_Goods_Actor_dt(ACTOR* actorx, GAME* game);
static void Shop_Goods_Actor_move(ACTOR* actorx, GAME* game);
static void Shop_Goods_Actor_draw(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Shop_Goods_Profile = {
mAc_PROFILE_SHOP_GOODS,
ACTOR_PART_CONTROL,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_SHOP_GOODS,
sizeof(SHOP_GOODS_ACTOR),
&Shop_Goods_Actor_ct,
&Shop_Goods_Actor_dt,
&Shop_Goods_Actor_move,
&Shop_Goods_Actor_draw,
NULL,
};
// clang-format on
#define aSG_DATA_ROTATE_Y_FLAG (1 << 0)
#include "../src/ac_shop_goods_data.c_inc"
#define aSG_SCALE_FLAG (1 << 0)
static s16 SG_angle_y[UT_Z_NUM][UT_X_NUM];
static SHOP_GOODS_ACTOR* Glb_shop_goods_actor;
static int picture_count;
static s16 mode;
static s16 Shop_Goods_Actor_single_get_angle_y(int ut_z, int ut_x, int layer) {
if (layer == mCoBG_LAYER1) {
return SG_angle_y[ut_z][ut_x];
}
return 0;
}
static void Shop_Goods_Actor_single_set_angle_y(int ut_z, int ut_x, int layer, s16 angle_y) {
if (layer == mCoBG_LAYER1) {
SG_angle_y[ut_z][ut_x] = angle_y;
}
}
static void Shop_Goods_draw_ta_set(GAME* game) {
OPEN_DISP(game->graph);
gDPSetTextureAdjustMode(NEXT_POLY_OPA_DISP, G_TA_DOLPHIN);
gDPSetTextureAdjustMode(NEXT_POLY_XLU_DISP, G_TA_DOLPHIN);
CLOSE_DISP(game->graph);
}
static void Shop_Goods_draw_ta_clr(GAME* game) {
OPEN_DISP(game->graph);
gDPSetTextureAdjustMode(NEXT_POLY_OPA_DISP, G_TA_N64);
gDPSetTextureAdjustMode(NEXT_POLY_XLU_DISP, G_TA_N64);
CLOSE_DISP(game->graph);
}
static int Shop_Goods_Actor_drop_entry(SHOP_GOODS_ACTOR* shop_goods, mActor_name_t item, xyz_t* now_pos,
xyz_t* target_pos, s16 layer, int timer, u16 flags);
static int Shop_Goods_Actor_player_drop_entry(GAME* game, mActor_name_t item, int ut_x, int ut_z, int layer,
int delay_timer) {
ACTOR* player_actor = GET_PLAYER_ACTOR_GAME_ACTOR(game);
int res = 0;
xyz_t now_pos;
xyz_t target_pos;
mActor_name_t* fg_p;
target_pos.x = 0.0f;
target_pos.y = 0.0f;
target_pos.z = 0.0f;
mFI_UtNum2CenterWpos(&target_pos, ut_x, ut_z);
if (layer == mCoBG_LAYER0) {
target_pos.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(target_pos, -1.0f);
} else {
target_pos.y = mCoBG_GetBgY_AngleS_FromWpos(NULL, target_pos, -1.0f);
}
if (layer == mCoBG_LAYER0) {
fg_p = mFI_GetUnitFG(target_pos);
} else {
fg_p = mFI_GetUnitFG2(target_pos);
}
if (*fg_p == EMPTY_NO) {
xyz_t_move(&now_pos, &player_actor->world.position);
now_pos.y += 50.0f;
if (Shop_Goods_Actor_drop_entry(Glb_shop_goods_actor, item, &now_pos, &target_pos, layer, delay_timer, 1)) {
if (layer == mCoBG_LAYER0) {
mFI_SetFG_common(RSV_NO, target_pos, FALSE);
} else {
mFI_SetFG2(RSV_NO, target_pos);
}
if (layer == mCoBG_LAYER1) {
SG_angle_y[ut_z][ut_x] = 0;
}
res = 1;
aMR_ThrowItem_FurnitureLock();
}
} else {
res = -1;
}
return res;
}
static int Shop_Goods_Actor_drop_entry(SHOP_GOODS_ACTOR* shop_goods, mActor_name_t item, xyz_t* now_pos,
xyz_t* target_pos, s16 layer, int delay_timer, u16 flags) {
aSG_single_draw_c* single_draw_p = shop_goods->single_draw;
int i;
f32 dist_xz;
f32 dist_y;
int res = FALSE;
for (i = 0; i < aSG_SINGLE_DRAW_NUM; i++) {
if (single_draw_p->counter == 0) {
xyz_t_move(&single_draw_p->start_pos, now_pos);
xyz_t_move(&single_draw_p->current_pos, now_pos);
xyz_t_move(&single_draw_p->target_pos, target_pos);
single_draw_p->item = item;
single_draw_p->layer = layer;
single_draw_p->angle.y = search_position_angleY(&single_draw_p->current_pos, &single_draw_p->target_pos);
single_draw_p->flags = flags;
single_draw_p->acceleration_y = -1.2f;
single_draw_p->counter = 1;
single_draw_p->_40 = 0;
single_draw_p->delay_timer = delay_timer;
if ((flags & 1)) {
single_draw_p->scale = 0.0f;
} else {
single_draw_p->scale = 1.0f;
}
dist_xz = search_position_distanceXZ(&single_draw_p->target_pos, &single_draw_p->current_pos);
dist_y = single_draw_p->target_pos.y - single_draw_p->current_pos.y;
if (dist_xz != 0.0f) {
f32 tmp =
((single_draw_p->acceleration_y * 0.5f) + (single_draw_p->acceleration_y * 0.5f) * 28.0f) * 14.0f;
single_draw_p->velocity_y = (dist_y - tmp) / 28.0f;
} else {
single_draw_p->velocity_y = 0.0f;
}
res = TRUE;
break;
}
single_draw_p++;
}
return res;
}
static void Shop_Goods_Actor_drop_destruct(SHOP_GOODS_ACTOR* shop_goods) {
int i;
aSG_single_draw_c* single_draw_p = shop_goods->single_draw;
for (i = 0; i < aSG_SINGLE_DRAW_NUM; i++) {
if (single_draw_p->counter != 0) {
if (single_draw_p->layer == mCoBG_LAYER0) {
mFI_SetFG_common(single_draw_p->item, single_draw_p->target_pos, FALSE);
} else {
mFI_SetFG2(single_draw_p->item, single_draw_p->target_pos);
}
}
single_draw_p++;
}
}
static void Shop_Goods_Actor_drop_move(SHOP_GOODS_ACTOR* shop_goods) {
int i;
aSG_single_draw_c* single_draw_p = shop_goods->single_draw;
for (i = 0; i < aSG_SINGLE_DRAW_NUM; i++, single_draw_p++) {
if (single_draw_p->delay_timer > 0) {
single_draw_p->delay_timer--;
continue;
}
if (single_draw_p->counter != 0) {
f32 percent_xz = (f32)single_draw_p->counter * (1.0f / 30.0f);
if (percent_xz > 1.0f) {
percent_xz = 1.0f;
} else {
percent_xz = percent_xz;
}
single_draw_p->velocity_y += single_draw_p->acceleration_y * 0.5f;
single_draw_p->current_pos.y += single_draw_p->velocity_y * 0.5f;
single_draw_p->current_pos.x =
single_draw_p->start_pos.x + percent_xz * (single_draw_p->target_pos.x - single_draw_p->start_pos.x);
single_draw_p->current_pos.z =
single_draw_p->start_pos.z + percent_xz * (single_draw_p->target_pos.z - single_draw_p->start_pos.z);
if ((single_draw_p->flags & aSG_SCALE_FLAG)) {
single_draw_p->scale = 0.1f + (1.0f - SQ(1.0f - (f32)single_draw_p->counter / 28.0f)) * 0.9f;
}
if (single_draw_p->counter == 27) {
if (single_draw_p->item == ITM_FOOD_APPLE || single_draw_p->item == ITM_FOOD_CHERRY ||
single_draw_p->item == ITM_FOOD_PEAR || single_draw_p->item == ITM_FOOD_PEACH ||
single_draw_p->item == ITM_FOOD_ORANGE) {
sAdo_OngenTrgStart(0x127, &single_draw_p->current_pos);
} else if (single_draw_p->item == ITM_MONEY_1000 || single_draw_p->item == ITM_MONEY_10000 ||
single_draw_p->item == ITM_MONEY_30000 || single_draw_p->item == ITM_MONEY_100) {
sAdo_OngenTrgStart(0x444, &single_draw_p->current_pos);
} else {
sAdo_OngenTrgStart(0x128, &single_draw_p->current_pos);
}
}
if (single_draw_p->current_pos.y <= single_draw_p->target_pos.y) {
if (single_draw_p->_40 == 0) {
single_draw_p->flags &= ~aSG_SCALE_FLAG;
single_draw_p->scale = 1.0f;
xyz_t_move(&single_draw_p->current_pos, &single_draw_p->target_pos);
single_draw_p->velocity_y = -single_draw_p->velocity_y * 0.25f;
single_draw_p->_40++;
if (single_draw_p->velocity_y > 3.0f) {
single_draw_p->velocity_y = 3.0f;
}
} else {
if (single_draw_p->layer == mCoBG_LAYER0) {
mFI_SetFG_common(single_draw_p->item, single_draw_p->target_pos, FALSE);
} else {
mFI_SetFG2(single_draw_p->item, single_draw_p->target_pos);
}
single_draw_p->counter = 0;
aMR_ThrowItem_FurnitureUnlock();
}
} else {
single_draw_p->counter++;
}
}
}
}
static void Shop_Goods_Actor_single_drawR(GAME* game, mActor_name_t item, xyz_t* pos, xyz_t* scale, s16 angle_y,
int layer) {
GAME_PLAY* play = (GAME_PLAY*)game;
const aSG_data_c* src_data_p = l_shop_goods_dsp_table;
int i;
for (i = 0; i < picture_count; i++) {
const aSG_data_c* data_p = &src_data_p[i];
// Global_light* glight = &((GAME_PLAY*)game)->global_light;
LightsN* lightsN;
if (item >= data_p->item_start && item <= data_p->item_end) {
int xlu_flag = data_p->xlu_gfx0[mode] != NULL;
GRAPH* graph;
if (xlu_flag) {
_texture_z_light_fog_prim_xlu(game->graph);
}
_texture_z_light_fog_prim(game->graph);
graph = play->game.graph;
OPEN_DISP(graph);
lightsN = Global_light_read(&play->global_light, graph);
LightsN_list_check(lightsN, play->global_light.list, pos);
LightsN_disp(lightsN, play->game.graph);
Matrix_translate(pos->x, pos->y, pos->z, 0);
if ((data_p->flags & aSG_DATA_ROTATE_Y_FLAG) && layer == mCoBG_LAYER1) {
Matrix_RotateY(angle_y, 1);
}
Matrix_scale(scale->x, scale->y, scale->z, 1);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_OPA_DISP, data_p->gfx0[mode]);
if (data_p->gfx1[mode] != NULL) {
gSPDisplayList(NEXT_POLY_OPA_DISP, data_p->gfx1[mode]);
}
if (xlu_flag != FALSE) {
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, data_p->xlu_gfx0[mode]);
if (data_p->xlu_gfx1[mode] != NULL) {
gSPDisplayList(NEXT_POLY_XLU_DISP, data_p->xlu_gfx1[mode]);
}
}
CLOSE_DISP(graph);
return;
}
}
}
static void Shop_Goods_Actor_single_draw(GAME* game, mActor_name_t item, xyz_t* pos, f32 scale, s16 angle_y,
int layer) {
xyz_t xyz_scale;
Shop_Goods_draw_ta_set(game);
xyz_scale.x = scale;
xyz_scale.y = scale;
xyz_scale.z = scale;
Shop_Goods_Actor_single_drawR(game, item, pos, &xyz_scale, angle_y, layer);
Shop_Goods_draw_ta_clr(game);
}
static void Shop_Goods_Actor_drop_draw(ACTOR* actorx, GAME* game) {
SHOP_GOODS_ACTOR* shop_goods = (SHOP_GOODS_ACTOR*)actorx;
int i;
aSG_single_draw_c* single_draw_p = shop_goods->single_draw;
for (i = 0; i < aSG_SINGLE_DRAW_NUM; i++) {
if (single_draw_p->counter != 0) {
int ut_x;
int ut_z;
s16 angle_y;
if (mFI_Wpos2UtNum(&ut_x, &ut_z, single_draw_p->target_pos)) {
angle_y = SG_angle_y[ut_z][ut_x];
} else {
angle_y = 0;
}
Shop_Goods_Actor_single_draw(game, single_draw_p->item, &single_draw_p->current_pos,
single_draw_p->scale * 0.01f, angle_y, single_draw_p->layer);
}
single_draw_p++;
}
}
static int aSG_CountPictureKind(void) {
const aSG_data_c* data_p = l_shop_goods_dsp_table;
int count = 0;
for (data_p; data_p->item_start != EMPTY_NO || data_p->item_end != EMPTY_NO; data_p++) {
count++;
}
return count;
}
static void Shop_Goods_Actor_ct(ACTOR* actorx, GAME* game) {
SHOP_GOODS_ACTOR* shop_goods = (SHOP_GOODS_ACTOR*)actorx;
int i;
shop_goods->picture_count = aSG_CountPictureKind();
picture_count = shop_goods->picture_count;
mFI_Wpos2BlockNum(&shop_goods->bx, &shop_goods->bz, actorx->world.position);
shop_goods->bx_pos = (f32)shop_goods->bx * mFI_BK_WORLDSIZE_X_F;
shop_goods->bz_pos = (f32)shop_goods->bz * mFI_BK_WORLDSIZE_Z_F;
shop_goods->mode = actorx->actor_specific;
mode = shop_goods->mode;
for (i = 0; i < aSG_SINGLE_DRAW_NUM; i++) {
shop_goods->single_draw[i].counter = 0;
}
Glb_shop_goods_actor = shop_goods;
if (Common_Get(clip).shop_goods_clip == NULL) {
Common_Get(clip).shop_goods_clip = (aSG_Clip_c*)zelda_malloc(sizeof(aSG_Clip_c));
Common_Get(clip).shop_goods_clip->single_draw_proc = &Shop_Goods_Actor_single_draw;
Common_Get(clip).shop_goods_clip->player_drop_entry_proc = &Shop_Goods_Actor_player_drop_entry;
Common_Get(clip).shop_goods_clip->single_get_angle_y_proc = &Shop_Goods_Actor_single_get_angle_y;
Common_Get(clip).shop_goods_clip->single_set_angle_y_proc = &Shop_Goods_Actor_single_set_angle_y;
}
}
static void Shop_Goods_Actor_dt(ACTOR* actorx, GAME* game) {
SHOP_GOODS_ACTOR* shop_goods = (SHOP_GOODS_ACTOR*)actorx;
Shop_Goods_Actor_drop_destruct(shop_goods);
if (Common_Get(clip).shop_goods_clip != NULL) {
zelda_free(Common_Get(clip).shop_goods_clip);
/* @BUG - shouldn't shop_goods_clip get set to NULL? */
#ifdef BUGFIXES
Common_Get(clip).shop_goods_clip = NULL;
#endif
}
}
static void Shop_Goods_Actor_move(ACTOR* actorx, GAME* game) {
SHOP_GOODS_ACTOR* shop_goods = (SHOP_GOODS_ACTOR*)actorx;
Shop_Goods_Actor_drop_move(shop_goods);
}
static void aSG_DrawGoods(GRAPH* graph, Global_light* glight, SHOP_GOODS_ACTOR* shop_goods, int bx, int bz, int ux,
int uz, const aSG_data_c* data_p, int layer) {
xyz_t pos;
int mode = shop_goods->mode;
Gfx* gfx0 = data_p->gfx0[mode];
Gfx* gfx1 = data_p->gfx1[mode];
Gfx* xlu_gfx0 = data_p->xlu_gfx0[mode];
Gfx* xlu_gfx1 = data_p->xlu_gfx1[mode];
LightsN* lightsN;
mFI_BkandUtNum2CenterWpos(&pos, bx, bz, ux, uz);
if (layer == mCoBG_LAYER0) {
pos.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(pos, 0.0f);
} else {
pos.y = mCoBG_GetBgY_AngleS_FromWpos(NULL, pos, 0.0f);
}
OPEN_DISP(graph);
lightsN = Global_light_read(glight, graph);
LightsN_list_check(lightsN, glight->list, &pos);
LightsN_disp(lightsN, graph);
if (gfx0 != NULL || xlu_gfx0 != NULL) {
Matrix_translate(pos.x, pos.y, pos.z, 0);
if ((data_p->flags & aSG_DATA_ROTATE_Y_FLAG) && layer == mCoBG_LAYER1) {
Matrix_RotateY(SG_angle_y[uz][ux], 1);
}
Matrix_scale(0.01f, 0.01f, 0.01f, 1);
if (gfx0 != NULL) {
_texture_z_light_fog_prim(graph);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_OPA_DISP, gfx0);
if (gfx1 != NULL) {
gSPDisplayList(NEXT_POLY_OPA_DISP, gfx1);
}
}
if (xlu_gfx0 != NULL) {
_texture_z_light_fog_prim_xlu(graph);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, xlu_gfx0);
if (xlu_gfx1 != NULL) {
gSPDisplayList(NEXT_POLY_XLU_DISP, xlu_gfx1);
}
}
}
CLOSE_DISP(graph);
}
static void aSG_DrawGoodsPicture(ACTOR* actorx, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
Global_light* glight = &play->global_light;
SHOP_GOODS_ACTOR* shop_goods = (SHOP_GOODS_ACTOR*)actorx;
const aSG_data_c* data_p = l_shop_goods_dsp_table;
int picture_count = shop_goods->picture_count;
int bx = shop_goods->bx;
int bz = shop_goods->bz;
mActor_name_t* fg_p = mFI_BkNumtoUtFGTop(bx, bz);
mActor_name_t* fg2_p = mFI_BkNum2UtFGTop_layer(bx, bz, mCoBG_LAYER1);
s16 mode = shop_goods->mode;
int ux;
int uz;
int i;
if (fg_p != NULL) {
for (uz = 0; uz < UT_Z_NUM; uz++) {
for (ux = 0; ux < UT_X_NUM; ux++) {
if (*fg_p != RSV_NO) {
for (i = 0; i < picture_count; i++) {
if (*fg_p >= data_p[i].item_start && *fg_p <= data_p[i].item_end) {
aSG_DrawGoods(game->graph, glight, shop_goods, bx, bz, ux, uz, &data_p[i], mCoBG_LAYER0);
break;
}
}
}
fg_p++;
}
}
}
if (mode == 1 && fg2_p != NULL) {
for (uz = 0; uz < UT_Z_NUM; uz++) {
for (ux = 0; ux < UT_X_NUM; ux++) {
if (*fg2_p != RSV_NO) {
for (i = 0; i < picture_count; i++) {
if (*fg2_p >= data_p[i].item_start && *fg2_p <= data_p[i].item_end) {
aSG_DrawGoods(game->graph, glight, shop_goods, bx, bz, ux, uz, &data_p[i], mCoBG_LAYER1);
break;
}
}
}
fg2_p++;
}
}
}
}
static void Shop_Goods_Actor_draw(ACTOR* actorx, GAME* game) {
_texture_z_light_fog_prim(game->graph);
Shop_Goods_draw_ta_set(game);
aSG_DrawGoodsPicture(actorx, game);
Shop_Goods_draw_ta_clr(game);
Shop_Goods_Actor_drop_draw(actorx, game);
}
+971
View File
@@ -0,0 +1,971 @@
extern Gfx obj_apple2_modelT[];
extern Gfx obj_axeT_mat_model[];
extern Gfx obj_axeT_gfx_model[];
extern Gfx obj_paper_mat_model[];
extern Gfx obj_paper_gfx_model[];
extern Gfx obj_carpetT_mat_model[];
extern Gfx obj_carpetT_gfx_model[];
extern Gfx item_fish_modelT[];
extern Gfx obj_shop_fossil_mat_model[];
extern Gfx obj_shop_fossil_gfx_model[];
extern Gfx obj_fukuT_mat_model[];
extern Gfx obj_fukuT_gfx_model[];
extern Gfx item_kabu_modelT[];
extern Gfx obj_shop_kanbanT_mat_model[];
extern Gfx obj_shop_kanbanT_gfx_model[];
extern Gfx obj_shop_kaza1_model[];
extern Gfx obj_shop_kaza2_model[];
extern Gfx obj_shop_kaza3_model[];
extern Gfx obj_shop_kaza4_model[];
extern Gfx obj_shop_kaza5_model[];
extern Gfx obj_shop_kaza6_model[];
extern Gfx obj_shop_kaza7_model[];
extern Gfx obj_shop_kaza8_model[];
extern Gfx item_matutake_modelT[];
extern Gfx obj_mdT_mat_model[];
extern Gfx obj_mdT_gfx_model[];
extern Gfx obj_shop_cnaegiT_mat_model[];
extern Gfx obj_shop_cnaegiT_gfx_model[];
extern Gfx obj_naegiT_mat_model[];
extern Gfx obj_naegiT_gfx_model[];
extern Gfx obj_netT_mat_model[];
extern Gfx obj_netT_gfx_model[];
extern Gfx item_orange_modelT[];
extern Gfx obj_paintT_a_mat_model[];
extern Gfx obj_paintT_b_mat_model[];
extern Gfx obj_paintT_c_mat_model[];
extern Gfx obj_paintT_d_mat_model[];
extern Gfx obj_paintT_e_mat_model[];
extern Gfx obj_paintT_f_mat_model[];
extern Gfx obj_paintT_g_mat_model[];
extern Gfx obj_paintT_h_mat_model[];
extern Gfx obj_paintT_i_mat_model[];
extern Gfx obj_paintT_j_mat_model[];
extern Gfx obj_paintT_k_mat_model[];
extern Gfx obj_paintT_l_mat_model[];
extern Gfx obj_paintT_gfx_model[];
extern Gfx obj_rodT_mat_model[];
extern Gfx obj_rodT_gfx_model[];
extern Gfx obj_rod_lineT_mat_model[];
extern Gfx obj_rod_lineT_gfx_model[];
extern Gfx obj_sangoT_mat_model[];
extern Gfx obj_sangoT_gfx_model[];
extern Gfx obj_seed_mat_model[];
extern Gfx obj_seed_gfx_model[];
extern Gfx obj_honegaiT_mat_model[];
extern Gfx obj_honegaiT_gfx_model[];
extern Gfx obj_horagaiT_mat_model[];
extern Gfx obj_horagaiT_gfx_model[];
extern Gfx obj_komagaiT_mat_model[];
extern Gfx obj_komagaiT_gfx_model[];
extern Gfx obj_takaragaiT_mat_model[];
extern Gfx obj_takaragaiT_gfx_model[];
extern Gfx obj_ougigaiT_mat_model[];
extern Gfx obj_ougigaiT_gfx_model[];
extern Gfx obj_sakuragaiT_mat_model[];
extern Gfx obj_sakuragaiT_gfx_model[];
extern Gfx obj_shakogaiT_mat_model[];
extern Gfx obj_shakogaiT_gfx_model[];
extern Gfx obj_shovelT_mat_model[];
extern Gfx obj_shovelT_gfx_model[];
extern Gfx obj_soldoutT_mat_model[];
extern Gfx obj_soldoutT_gfx_model[];
extern Gfx obj_ticketT_mat_model[];
extern Gfx obj_ticketT_gfx_model[];
extern Gfx obj_axe2T_mat_model[];
extern Gfx obj_axe2T_gfx_model[];
extern Gfx obj_net2T_mat_model[];
extern Gfx obj_net2T_gfx_model[];
extern Gfx obj_rod2T_mat_model[];
extern Gfx obj_rod2T_gfx_model[];
extern Gfx obj_rod2_lineT_mat_model[];
extern Gfx obj_rod2_lineT_gfx_model[];
extern Gfx obj_shovel2T_mat_model[];
extern Gfx obj_shovel2T_gfx_model[];
extern Gfx obj_g2T_mat_model[];
extern Gfx obj_g2T_gfx_model[];
extern Gfx obj_nagagutuT_mat_model[];
extern Gfx obj_nagagutuT_gfx_model[];
extern Gfx obj_g1T_mat_model[];
extern Gfx obj_g1T_gfx_model[];
extern Gfx obj_shop_utiwa1_mat_model[];
extern Gfx obj_shop_utiwa1_gfx_model[];
extern Gfx obj_shop_utiwa2_mat_model[];
extern Gfx obj_shop_utiwa2_gfx_model[];
extern Gfx obj_shop_utiwa3_mat_model[];
extern Gfx obj_shop_utiwa3_gfx_model[];
extern Gfx obj_shop_utiwa4_mat_model[];
extern Gfx obj_shop_utiwa4_gfx_model[];
extern Gfx obj_shop_utiwa5_mat_model[];
extern Gfx obj_shop_utiwa5_gfx_model[];
extern Gfx obj_shop_utiwa6_mat_model[];
extern Gfx obj_shop_utiwa6_gfx_model[];
extern Gfx obj_shop_utiwa7_mat_model[];
extern Gfx obj_shop_utiwa7_gfx_model[];
extern Gfx obj_shop_utiwa8_mat_model[];
extern Gfx obj_shop_utiwa8_gfx_model[];
extern Gfx obj_wallT_mat_model[];
extern Gfx obj_wallT_gfx_model[];
extern Gfx int_iid_diary_model[];
extern Gfx int_iid_funediary_model[];
extern Gfx int_iid_mdiary_model[];
extern Gfx int_iid_newediary_model[];
extern Gfx int_ike_nikki_fan1_on_model[];
extern Gfx int_ike_nikki_fan2_on_model[];
extern Gfx int_ike_nikki_fan3_on_model[];
extern Gfx int_ike_nikki_fan4_on_model[];
extern Gfx int_ike_nikki_fan5_on_model[];
extern Gfx int_ike_nikki_wafu1_on_model[];
extern Gfx bag_DL_mode[];
extern Gfx bag_DL_vtx[];
extern Gfx obj_shop_candy_modelT[];
extern Gfx obj_item_cocoT_mat_model[];
extern Gfx obj_item_cocoT_gfx_model[];
extern Gfx nuts_DL_mode[];
extern Gfx nuts_DL_vtx[];
extern Gfx obj_otosiT_mat_model[];
extern Gfx obj_otosiT_gfx_model[];
extern Gfx peach_DL_mode[];
extern Gfx peach_DL_vtx[];
extern Gfx pear_DL_mode[];
extern Gfx pear_DL_vtx[];
extern Gfx int_nog_collegenote_model[];
extern Gfx int_nog_harddiaryT_model[];
extern Gfx int_nog_schoolnote_model[];
extern Gfx int_nog_systemnote_model[];
extern Gfx int_nog_tudurinoteT_model[];
extern Gfx int_tak_nikki01_on_model[];
typedef struct ac_shop_goods_data_s {
mActor_name_t item_start;
mActor_name_t item_end;
Gfx* gfx0[2];
Gfx* gfx1[2];
Gfx* xlu_gfx0[2];
Gfx* xlu_gfx1[2];
int flags;
} aSG_data_c;
// clang-format off
static const aSG_data_c l_shop_goods_dsp_table[] = {
{
ITM_PAPER00,
ITM_PAPER_END - 1,
{ obj_paper_mat_model, obj_paper_mat_model },
{ obj_paper_gfx_model, obj_paper_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
0xFE0E,
0xFE0E,
{ obj_soldoutT_mat_model, obj_soldoutT_mat_model },
{ obj_soldoutT_gfx_model, obj_soldoutT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
0xFE10,
0xFE18,
{ obj_soldoutT_mat_model, obj_soldoutT_mat_model },
{ obj_soldoutT_gfx_model, obj_soldoutT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_CARPET00,
ITM_CARPET66,
{ obj_carpetT_mat_model, obj_carpetT_mat_model },
{ obj_carpetT_gfx_model, obj_carpetT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_WALL00,
ITM_WALL66,
{ obj_wallT_mat_model, obj_wallT_mat_model },
{ obj_wallT_gfx_model, obj_wallT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_CLOTH000,
ITM_CLOTH254,
{ NULL, obj_wallT_mat_model },
{ NULL, obj_wallT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_AXE,
ITM_AXE,
{ obj_axeT_mat_model, obj_axeT_mat_model },
{ obj_axeT_gfx_model, obj_axeT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_AXE_USE_1,
ITM_AXE_USE_7,
{ obj_axeT_mat_model, obj_axeT_mat_model },
{ obj_axeT_gfx_model, obj_axeT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SHOVEL,
ITM_SHOVEL,
{ obj_shovelT_mat_model, obj_shovelT_mat_model },
{ obj_shovelT_gfx_model, obj_shovelT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_NET,
ITM_NET,
{ obj_netT_mat_model, obj_netT_mat_model },
{ obj_netT_gfx_model, obj_netT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_ROD,
ITM_ROD,
{ obj_rodT_mat_model, obj_rodT_mat_model },
{ obj_rodT_gfx_model, obj_rodT_gfx_model },
{ obj_rod_lineT_mat_model, obj_rod_lineT_mat_model },
{ obj_rod_lineT_gfx_model, obj_rod_lineT_gfx_model },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SAPLING,
ITM_SAPLING,
{ obj_naegiT_mat_model, obj_naegiT_mat_model },
{ obj_naegiT_gfx_model, obj_naegiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_WHITE_PANSY_BAG,
ITM_YELLOW_TULIP_BAG,
{ obj_seed_mat_model, obj_seed_mat_model },
{ obj_seed_gfx_model, obj_seed_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_CEDAR_SAPLING,
ITM_CEDAR_SAPLING,
{ obj_shop_cnaegiT_mat_model, obj_shop_cnaegiT_mat_model },
{ obj_shop_cnaegiT_gfx_model, obj_shop_cnaegiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_YELLOW_PINWHEEL,
ITM_YELLOW_PINWHEEL,
{ obj_shop_kaza1_model, obj_shop_kaza1_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_RED_PINWHEEL,
ITM_RED_PINWHEEL,
{ obj_shop_kaza2_model, obj_shop_kaza2_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_TIGER_PINWHEEL,
ITM_TIGER_PINWHEEL,
{ obj_shop_kaza3_model, obj_shop_kaza3_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_GREEN_PINWHEEL,
ITM_GREEN_PINWHEEL,
{ obj_shop_kaza4_model, obj_shop_kaza4_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_PINK_PINWHEEL,
ITM_PINK_PINWHEEL,
{ obj_shop_kaza5_model, obj_shop_kaza5_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_STRIPED_PINWHEEL,
ITM_STRIPED_PINWHEEL,
{ obj_shop_kaza6_model, obj_shop_kaza6_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_FLOWER_PINWHEEL,
ITM_FLOWER_PINWHEEL,
{ obj_shop_kaza7_model, obj_shop_kaza7_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_FANCY_PINWHEEL,
ITM_FANCY_PINWHEEL,
{ obj_shop_kaza8_model, obj_shop_kaza8_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_BLUEBELL_FAN,
ITM_BLUEBELL_FAN,
{ obj_shop_utiwa1_mat_model, obj_shop_utiwa1_mat_model },
{ obj_shop_utiwa1_gfx_model, obj_shop_utiwa1_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_PLUM_FAN,
ITM_PLUM_FAN,
{ obj_shop_utiwa2_mat_model, obj_shop_utiwa2_mat_model },
{ obj_shop_utiwa2_gfx_model, obj_shop_utiwa2_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_BAMBOO_FAN,
ITM_BAMBOO_FAN,
{ obj_shop_utiwa3_mat_model, obj_shop_utiwa3_mat_model },
{ obj_shop_utiwa3_gfx_model, obj_shop_utiwa3_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_CLOUD_FAN,
ITM_CLOUD_FAN,
{ obj_shop_utiwa4_mat_model, obj_shop_utiwa4_mat_model },
{ obj_shop_utiwa4_gfx_model, obj_shop_utiwa4_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_MAPLE_FAN,
ITM_MAPLE_FAN,
{ obj_shop_utiwa5_mat_model, obj_shop_utiwa5_mat_model },
{ obj_shop_utiwa5_gfx_model, obj_shop_utiwa5_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_FAN_FAN,
ITM_FAN_FAN,
{ obj_shop_utiwa6_mat_model, obj_shop_utiwa6_mat_model },
{ obj_shop_utiwa6_gfx_model, obj_shop_utiwa6_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_FLOWER_FAN,
ITM_FLOWER_FAN,
{ obj_shop_utiwa7_mat_model, obj_shop_utiwa7_mat_model },
{ obj_shop_utiwa7_gfx_model, obj_shop_utiwa7_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_LEAF_FAN,
ITM_LEAF_FAN,
{ obj_shop_utiwa8_mat_model, obj_shop_utiwa8_mat_model },
{ obj_shop_utiwa8_gfx_model, obj_shop_utiwa8_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_FOOD_APPLE,
ITM_FOOD_APPLE,
{ obj_apple2_modelT, obj_apple2_modelT },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_FOOD_PEACH,
ITM_FOOD_PEACH,
{ peach_DL_mode, peach_DL_mode },
{ peach_DL_vtx, peach_DL_vtx },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_FOOD_ORANGE,
ITM_FOOD_ORANGE,
{ item_orange_modelT, item_orange_modelT },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_FISH00,
ITM_FISH39,
{ item_fish_modelT, item_fish_modelT },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_FOOD_MUSHROOM,
ITM_FOOD_MUSHROOM,
{ item_matutake_modelT, item_matutake_modelT },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_KABU_10,
ITM_KABU_SPOILED,
{ item_kabu_modelT, item_kabu_modelT },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_FOOD_CANDY,
ITM_FOOD_CANDY,
{ obj_shop_candy_modelT, obj_shop_candy_modelT },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_FOOD_CHERRY,
ITM_FOOD_CHERRY,
{ nuts_DL_mode, nuts_DL_mode },
{ nuts_DL_vtx, nuts_DL_vtx },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_FOOD_PEAR,
ITM_FOOD_PEAR,
{ pear_DL_mode, pear_DL_mode },
{ pear_DL_vtx, pear_DL_vtx },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_FOOD_COCONUT,
ITM_FOOD_COCONUT,
{ obj_item_cocoT_mat_model, obj_item_cocoT_mat_model },
{ obj_item_cocoT_gfx_model, obj_item_cocoT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_MONEY_1000,
ITM_MONEY_100,
{ bag_DL_mode, bag_DL_mode },
{ bag_DL_vtx, bag_DL_vtx },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_MINIDISK00,
ITM_MINIDISK54,
{ obj_mdT_mat_model, obj_mdT_mat_model },
{ obj_mdT_gfx_model, obj_mdT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_TICKET_START,
ITM_TICKET_END,
{ obj_ticketT_mat_model, obj_ticketT_mat_model },
{ obj_ticketT_gfx_model, obj_ticketT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_HUKUBUKURO_BAG,
ITM_HUKUBUKURO_PRESENT,
{ obj_fukuT_mat_model, obj_fukuT_mat_model },
{ obj_fukuT_gfx_model, obj_fukuT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DUST0_EMPTY_CAN,
ITM_DUST0_EMPTY_CAN,
{ obj_g2T_mat_model, obj_g2T_mat_model },
{ obj_g2T_gfx_model, obj_g2T_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DUST1_BOOT,
ITM_DUST1_BOOT,
{ obj_nagagutuT_mat_model, obj_nagagutuT_mat_model },
{ obj_nagagutuT_gfx_model, obj_nagagutuT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DUST2_OLD_TIRE,
ITM_DUST2_OLD_TIRE,
{ obj_g1T_mat_model, obj_g1T_mat_model },
{ obj_g1T_gfx_model, obj_g1T_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_FOSSIL,
ITM_FOSSIL,
{ obj_shop_fossil_mat_model, obj_shop_fossil_mat_model },
{ obj_shop_fossil_gfx_model, obj_shop_fossil_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_PITFALL,
ITM_PITFALL,
{ obj_otosiT_mat_model, obj_otosiT_mat_model },
{ obj_otosiT_gfx_model, obj_otosiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_SHELL1,
ITM_SHELL1,
{ obj_komagaiT_mat_model, obj_komagaiT_mat_model },
{ obj_komagaiT_gfx_model, obj_komagaiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SHELL3,
ITM_SHELL3,
{ obj_takaragaiT_mat_model, obj_takaragaiT_mat_model },
{ obj_takaragaiT_gfx_model, obj_takaragaiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SHELL2,
ITM_SHELL2,
{ obj_honegaiT_mat_model, obj_honegaiT_mat_model },
{ obj_honegaiT_gfx_model, obj_honegaiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SHELL6,
ITM_SHELL6,
{ obj_horagaiT_mat_model, obj_horagaiT_mat_model },
{ obj_horagaiT_gfx_model, obj_horagaiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SHELL4,
ITM_SHELL4,
{ obj_sakuragaiT_mat_model, obj_sakuragaiT_mat_model },
{ obj_sakuragaiT_gfx_model, obj_sakuragaiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SHELL0,
ITM_SHELL0,
{ obj_ougigaiT_mat_model, obj_ougigaiT_mat_model },
{ obj_ougigaiT_gfx_model, obj_ougigaiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SHELL5,
ITM_SHELL5,
{ obj_shakogaiT_mat_model, obj_shakogaiT_mat_model },
{ obj_shakogaiT_gfx_model, obj_shakogaiT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SHELL7,
ITM_SHELL7,
{ obj_sangoT_mat_model, obj_sangoT_mat_model },
{ obj_sangoT_gfx_model, obj_sangoT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_RED_PAINT,
ITM_RED_PAINT,
{ obj_paintT_a_mat_model, obj_paintT_a_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_ORANGE_PAINT,
ITM_ORANGE_PAINT,
{ obj_paintT_b_mat_model, obj_paintT_b_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_YELLOW_PAINT,
ITM_YELLOW_PAINT,
{ obj_paintT_c_mat_model, obj_paintT_c_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_PALE_GREEN_PAINT,
ITM_PALE_GREEN_PAINT,
{ obj_paintT_d_mat_model, obj_paintT_d_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_GREEN_PAINT,
ITM_GREEN_PAINT,
{ obj_paintT_e_mat_model, obj_paintT_e_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_SKY_BLUE_PAINT,
ITM_SKY_BLUE_PAINT,
{ obj_paintT_f_mat_model, obj_paintT_f_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_BLUE_PAINT,
ITM_BLUE_PAINT,
{ obj_paintT_g_mat_model, obj_paintT_g_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_PURPLE_PAINT,
ITM_PURPLE_PAINT,
{ obj_paintT_h_mat_model, obj_paintT_h_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_PINK_PAINT,
ITM_PINK_PAINT,
{ obj_paintT_i_mat_model, obj_paintT_i_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_BLACK_PAINT,
ITM_BLACK_PAINT,
{ obj_paintT_j_mat_model, obj_paintT_j_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_WHITE_PAINT,
ITM_WHITE_PAINT,
{ obj_paintT_k_mat_model, obj_paintT_k_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_BROWN_PAINT,
ITM_BROWN_PAINT,
{ obj_paintT_l_mat_model, obj_paintT_l_mat_model },
{ obj_paintT_gfx_model, obj_paintT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
0
},
{
ITM_GOLDEN_NET,
ITM_GOLDEN_NET,
{ obj_net2T_mat_model, obj_net2T_mat_model },
{ obj_net2T_gfx_model, obj_net2T_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_GOLDEN_AXE,
ITM_GOLDEN_AXE,
{ obj_axe2T_mat_model, obj_axe2T_mat_model },
{ obj_axe2T_gfx_model, obj_axe2T_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_GOLDEN_SHOVEL,
ITM_GOLDEN_SHOVEL,
{ obj_shovel2T_mat_model, obj_shovel2T_mat_model },
{ obj_shovel2T_gfx_model, obj_shovel2T_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_GOLDEN_ROD,
ITM_GOLDEN_ROD,
{ obj_rod2T_mat_model, obj_rod2T_mat_model },
{ obj_rod2T_gfx_model, obj_rod2T_gfx_model },
{ obj_rod2_lineT_mat_model, obj_rod2_lineT_mat_model },
{ obj_rod2_lineT_gfx_model, obj_rod2_lineT_gfx_model },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_SIGNBOARD,
ITM_SIGNBOARD,
{ obj_shop_kanbanT_mat_model, obj_shop_kanbanT_mat_model },
{ obj_shop_kanbanT_gfx_model, obj_shop_kanbanT_gfx_model },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY00,
ITM_DIARY00,
{ int_nog_collegenote_model, int_nog_collegenote_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY01,
ITM_DIARY01,
{ int_nog_schoolnote_model, int_nog_schoolnote_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY02,
ITM_DIARY02,
{ int_nog_systemnote_model, int_nog_systemnote_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY03,
ITM_DIARY03,
{ int_nog_harddiaryT_model, int_nog_harddiaryT_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY04,
ITM_DIARY04,
{ int_nog_tudurinoteT_model, int_nog_tudurinoteT_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY05,
ITM_DIARY05,
{ int_iid_diary_model, int_iid_diary_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY06,
ITM_DIARY06,
{ int_iid_funediary_model, int_iid_funediary_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY07,
ITM_DIARY07,
{ int_iid_mdiary_model, int_iid_mdiary_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY08,
ITM_DIARY08,
{ int_iid_newediary_model, int_iid_newediary_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY09,
ITM_DIARY09,
{ int_tak_nikki01_on_model, int_tak_nikki01_on_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY10,
ITM_DIARY10,
{ int_ike_nikki_fan1_on_model, int_ike_nikki_fan1_on_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY11,
ITM_DIARY11,
{ int_ike_nikki_fan2_on_model, int_ike_nikki_fan2_on_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY12,
ITM_DIARY12,
{ int_ike_nikki_fan3_on_model, int_ike_nikki_fan3_on_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY13,
ITM_DIARY13,
{ int_ike_nikki_fan4_on_model, int_ike_nikki_fan4_on_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY14,
ITM_DIARY14,
{ int_ike_nikki_fan5_on_model, int_ike_nikki_fan5_on_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
ITM_DIARY15,
ITM_DIARY15,
{ int_ike_nikki_wafu1_on_model, int_ike_nikki_wafu1_on_model },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
aSG_DATA_ROTATE_Y_FLAG
},
{
EMPTY_NO,
EMPTY_NO,
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
{ NULL, NULL },
0
},
};
// clang-format on
+527
View File
@@ -0,0 +1,527 @@
#include "ac_shop_indoor.h"
#include "m_common_data.h"
#include "m_malloc.h"
#include "m_rcp.h"
#include "sys_matrix.h"
enum {
aSI_SHOP_TYPE_ZAKKA,
aSI_SHOP_TYPE_CONVENI,
aSI_SHOP_TYPE_SUPER,
aSI_SHOP_TYPE_DEPART_1F,
aSI_SHOP_TYPE_DEPART_2F,
aSI_SHOP_TYPE_NUM
};
enum {
aSI_SE_MODE_NORMAL,
aSI_SE_MODE_SILENT,
aSI_SE_MODE_NUM
};
static int aSI_se_mode = aSI_SE_MODE_NORMAL;
typedef struct shop_indoor_disp_s {
Gfx* wall_gfx;
Gfx* wall_xlu_gfx;
Gfx* floor_gfx;
Gfx* floor_xlu_gfx;
Gfx* fukubiki_gfx;
Gfx* fukubiki_xlu_gfx;
} aSI_disp_data_c;
extern Gfx rom_shop1w_model[];
extern Gfx rom_shop1w_modelT[];
extern Gfx rom_shop1f_model[];
extern Gfx rom_shop1f_modelT[];
extern Gfx rom_shop1_fuku_model[];
extern Gfx rom_shop1_fuku_modelT[];
extern Gfx rom_shop2w_model[];
extern Gfx rom_shop2w_modelT[];
extern Gfx rom_shop2f_model[];
extern Gfx rom_shop2f_modelT[];
extern Gfx rom_shop2_fuku_model[];
extern Gfx rom_shop2_fuku_modelT[];
extern Gfx rom_shop3w_model[];
extern Gfx rom_shop3w_modelT[];
extern Gfx rom_shop3f_model[];
extern Gfx rom_shop3f_modelT[];
extern Gfx rom_shop3_fuku_model[];
extern Gfx rom_shop3_fuku_modelT[];
extern Gfx rom_shop4_fuku_model[];
extern Gfx rom_shop4_fuku_modelT[];
extern Gfx rom_shop4_2w_model[];
extern Gfx rom_shop4_2w_modelT[];
extern Gfx rom_shop4_2f_model[];
extern Gfx rom_shop4_2f_modelT[];
static aSI_disp_data_c aSI_disp_data_table[] = {
{
rom_shop1w_model,
rom_shop1w_modelT,
rom_shop1f_model,
rom_shop1f_modelT,
rom_shop1_fuku_model,
rom_shop1_fuku_modelT,
},
{
rom_shop2w_model,
rom_shop2w_modelT,
rom_shop2f_model,
rom_shop2f_modelT,
rom_shop2_fuku_model,
rom_shop2_fuku_modelT,
},
{
rom_shop3w_model,
rom_shop3w_modelT,
rom_shop3f_model,
rom_shop3f_modelT,
rom_shop3_fuku_model,
rom_shop3_fuku_modelT,
},
{
rom_shop1w_model,
rom_shop1w_modelT,
rom_shop1f_model,
rom_shop1f_modelT,
rom_shop4_fuku_model,
rom_shop4_fuku_modelT,
},
{
rom_shop4_2w_model,
rom_shop4_2w_modelT,
rom_shop4_2f_model,
rom_shop4_2f_modelT,
rom_shop1_fuku_model,
rom_shop1_fuku_modelT,
},
};
static s16 aSI_wall_default_table[] = {
(u8)ITM_WALL67, (u8)ITM_WALL68, (u8)ITM_WALL69, (u8)ITM_WALL68, (u8)ITM_WALL70,
};
static s16 aSI_floor_default_table[] = {
(u8)ITM_CARPET67, (u8)ITM_CARPET68, (u8)ITM_CARPET69, (u8)ITM_CARPET70, (u8)ITM_CARPET70,
};
static void Shop_Indoor_Actor_ct(ACTOR* actorx, GAME* game);
static void Shop_Indoor_Actor_dt(ACTOR* actorx, GAME* game);
static void Shop_Indoor_Actor_move(ACTOR* actorx, GAME* game);
static void Shop_Indoor_Actor_draw(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Shop_Indoor_Profile = {
mAc_PROFILE_SHOP_INDOOR,
ACTOR_PART_FG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(SHOP_INDOOR_ACTOR),
&Shop_Indoor_Actor_ct,
&Shop_Indoor_Actor_dt,
&Shop_Indoor_Actor_move,
&Shop_Indoor_Actor_draw,
NULL,
};
// clang-format on
static int aSI_GetShopIndoorBank(ACTOR* actorx, GAME* game) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
u8** floor_data_pp = shop_indoor->floor_data_p;
u8** wall_data_pp = shop_indoor->wall_data_p;
int i;
for (i = 0; i < 2; i++) {
wall_data_pp[i] = zelda_malloc_align(aMI_WALL_BANK_SIZE, 32);
}
for (i = 0; i < 2; i++) {
floor_data_pp[i] = zelda_malloc_align(aMI_FLOOR_BANK_SIZE, 32);
}
}
static void aSI_CopyFloorTexture(ACTOR* actorx, s16 floor_idx, s16 bank_idx) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
u8** floor_data_pp = shop_indoor->floor_data_p;
if (bank_idx == 2) {
int i;
for (i = 0; i < 2; i++) {
u8* floor_data_p = floor_data_pp[i];
if (floor_data_p != NULL) {
mRmTp_CopyFloorData(floor_data_p, floor_idx);
}
}
} else {
u8* floor_data_p = floor_data_pp[bank_idx];
if (floor_data_p != NULL) {
mRmTp_CopyFloorData(floor_data_p, floor_idx);
}
}
}
static void aSI_CopyWallTexture(ACTOR* actorx, s16 wall_idx, s16 bank_idx) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
u8** wall_data_pp = shop_indoor->wall_data_p;
if (bank_idx == 2) {
int i;
for (i = 0; i < 2; i++) {
u8* wall_data_p = wall_data_pp[i];
if (wall_data_p != NULL) {
mRmTp_CopyWallData(wall_data_p, wall_idx);
}
}
} else {
u8* wall_data_p = wall_data_pp[bank_idx];
if (wall_data_p != NULL) {
mRmTp_CopyWallData(wall_data_p, wall_idx);
}
}
}
static void aSI_ShopIndoorCopy(ACTOR* actorx, GAME* game) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
aSI_CopyWallTexture(actorx, (s16)aSI_wall_default_table[shop_indoor->shop_idx], 2);
aSI_CopyFloorTexture(actorx, (s16)aSI_floor_default_table[shop_indoor->shop_idx], 2);
}
static int aSI_ChangeWall(mActor_name_t item);
static int aSI_ChangeCarpet(mActor_name_t item);
static void aSI_IndoorDmaAgain(void);
static void aSI_Change2Default(void);
static void aSI_SetClipProc(ACTOR* actorx, int clear) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
if (clear == TRUE) {
Common_Get(clip).shop_indoor_clip = NULL;
} else {
aSI_Clip_c* clip_p = &shop_indoor->clip;
Common_Get(clip).shop_indoor_clip = clip_p;
clip_p->shop_indoor_actor = actorx;
clip_p->change_wall_proc = &aSI_ChangeWall;
clip_p->change_carpet_proc = &aSI_ChangeCarpet;
clip_p->indoor_dma_again_proc = &aSI_IndoorDmaAgain;
clip_p->change2default_proc = &aSI_Change2Default;
}
}
static void Shop_Indoor_Actor_ct(ACTOR* actorx, GAME* game) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
int i;
int scene_no = Save_Get(scene_no);
static int scene_no_table[] = { SCENE_SHOP0, SCENE_CONVENI, SCENE_SUPER, SCENE_DEPART, SCENE_DEPART_2 };
for (i = 0; i < aSI_SHOP_TYPE_NUM; i++) {
if (scene_no == scene_no_table[i]) {
actorx->actor_specific = i;
shop_indoor->shop_idx = i;
}
}
if (Common_Get(tanuki_shop_status) == mSP_TANUKI_SHOP_STATUS_FUKUBIKI &&
actorx->actor_specific != aSI_SHOP_TYPE_DEPART_2F) {
shop_indoor->fukubiki_active = TRUE;
}
shop_indoor->floor_idx = aSI_floor_default_table[shop_indoor->shop_idx];
shop_indoor->wall_idx = aSI_wall_default_table[shop_indoor->shop_idx];
shop_indoor->floor_data_idx = 0;
/* @BUG - floor_data_idx is set again instead of wall_data_idx */
#ifndef BUGFIXES
shop_indoor->floor_data_idx = 0;
#else
shop_indoor->wall_data_idx = 0;
#endif
shop_indoor->_17C = 0;
shop_indoor->floor_data_p[0] = NULL;
shop_indoor->floor_data_p[1] = NULL;
shop_indoor->wall_data_p[0] = NULL;
shop_indoor->wall_data_p[1] = NULL;
aSI_GetShopIndoorBank(actorx, game);
aSI_ShopIndoorCopy(actorx, game);
aSI_SetClipProc(actorx, FALSE);
}
static void Shop_Indoor_Actor_dt(ACTOR* actorx, GAME* game) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
int i;
aSI_SetClipProc(actorx, TRUE);
for (i = 0; i < 2; i++) {
if (shop_indoor->floor_data_p[i] != NULL) {
zelda_free(shop_indoor->floor_data_p[i]);
}
if (shop_indoor->wall_data_p[i] != NULL) {
zelda_free(shop_indoor->wall_data_p[i]);
}
}
}
static void aSI_DrawShopFloor(ACTOR* actorx, GAME* game) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
int data_idx = shop_indoor->floor_data_idx;
int shop_level = actorx->actor_specific;
u16* pal;
u8* tex0;
u8* tex1;
u8* tex2;
u8* tex3;
GAME_PLAY* play = (GAME_PLAY*)game;
pal = (u16*)shop_indoor->floor_data_p[data_idx];
tex0 = (u8*)(shop_indoor->floor_data_p[data_idx] + aMI_PAL_SIZE);
tex1 = (u8*)(shop_indoor->floor_data_p[data_idx] + aMI_PAL_SIZE + aMI_TEX_SIZE);
tex2 = (u8*)(shop_indoor->floor_data_p[data_idx] + aMI_PAL_SIZE + aMI_TEX_SIZE * 2);
tex3 = (u8*)(shop_indoor->floor_data_p[data_idx] + aMI_PAL_SIZE + aMI_TEX_SIZE * 3);
_texture_z_light_fog_prim_xlu(game->graph);
_texture_z_light_fog_prim(game->graph);
Global_kankyo_set_room_prim(play);
if (shop_indoor->floor_data_p[data_idx] != NULL) {
if (aSI_disp_data_table[shop_level].floor_gfx != NULL) {
OPEN_DISP(game->graph);
/* Load floor palette & textures */
gSPSegment(NEXT_POLY_OPA_DISP, ANIME_1_TXT_SEG, tex0);
gSPSegment(NEXT_POLY_OPA_DISP, ANIME_2_TXT_SEG, tex1);
gSPSegment(NEXT_POLY_OPA_DISP, ANIME_3_TXT_SEG, tex2);
gSPSegment(NEXT_POLY_OPA_DISP, ANIME_4_TXT_SEG, tex3);
gSPSegment(NEXT_POLY_OPA_DISP, ANIME_5_TXT_SEG, pal);
Matrix_translate(0.0f, 0.0f, 0.0f, 0);
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 1);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_OPA_DISP, aSI_disp_data_table[shop_level].floor_gfx);
CLOSE_DISP(game->graph);
}
if (aSI_disp_data_table[shop_level].floor_xlu_gfx != NULL) {
OPEN_DISP(game->graph);
/* Load floor palette & textures */
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_1_TXT_SEG, tex0);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_2_TXT_SEG, tex1);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_3_TXT_SEG, tex2);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_4_TXT_SEG, tex3);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_5_TXT_SEG, pal);
Matrix_translate(0.0f, 0.0f, 0.0f, 0);
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 1);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, aSI_disp_data_table[shop_level].floor_xlu_gfx);
CLOSE_DISP(game->graph);
}
}
}
static void aSI_DrawShopFukubiki(ACTOR* actorx, GAME* game) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
int shop_level = shop_indoor->shop_idx;
GAME_PLAY* play = (GAME_PLAY*)game;
if (aSI_disp_data_table[shop_level].fukubiki_gfx != NULL) {
_texture_z_light_fog_prim(game->graph);
if (shop_level == aSI_SHOP_TYPE_CONVENI) {
xyz_t mirror_pos = { 10.0f, 10.0f, 10.0f };
Setpos_HiliteReflect_init(&mirror_pos, play);
}
OPEN_DISP(game->graph);
Matrix_translate(0.0f, 0.0f, 0.0f, 0);
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 1);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Global_kankyo_set_room_prim(play);
gSPDisplayList(NEXT_POLY_OPA_DISP, aSI_disp_data_table[shop_level].fukubiki_gfx);
CLOSE_DISP(game->graph);
}
if (aSI_disp_data_table[shop_level].fukubiki_xlu_gfx != NULL) {
_texture_z_light_fog_prim_xlu(game->graph);
OPEN_DISP(game->graph);
Matrix_translate(0.0f, 0.0f, 0.0f, 0);
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 1);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, aSI_disp_data_table[shop_level].fukubiki_xlu_gfx);
CLOSE_DISP(game->graph);
}
}
static void aSI_DrawShopWall(ACTOR* actorx, GAME* game) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
int data_idx = shop_indoor->wall_data_idx;
u16* pal = (u16*)shop_indoor->wall_data_p[data_idx];
u8* tex0 = (u8*)(shop_indoor->wall_data_p[data_idx] + aMI_PAL_SIZE);
u8* tex1 = (u8*)(shop_indoor->wall_data_p[data_idx] + aMI_PAL_SIZE + aMI_TEX_SIZE);
int shop_level = actorx->actor_specific;
if (aSI_disp_data_table[shop_level].wall_gfx != NULL) {
GAME_PLAY* play = (GAME_PLAY*)game;
OPEN_DISP(game->graph);
_texture_z_light_fog_prim(game->graph);
if (shop_level == aSI_SHOP_TYPE_CONVENI) {
xyz_t mirror_pos = { 10.0f, 10.0f, 10.0f };
Setpos_HiliteReflect_init(&mirror_pos, play);
}
/* Load floor palette & textures */
gSPSegment(NEXT_POLY_OPA_DISP, ANIME_1_TXT_SEG, tex0);
gSPSegment(NEXT_POLY_OPA_DISP, ANIME_2_TXT_SEG, tex1);
gSPSegment(NEXT_POLY_OPA_DISP, ANIME_3_TXT_SEG, pal);
Matrix_translate(0.0f, 0.0f, 0.0f, 0);
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 1);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Global_kankyo_set_room_prim(play);
gSPDisplayList(NEXT_POLY_OPA_DISP, aSI_disp_data_table[shop_level].wall_gfx);
CLOSE_DISP(game->graph);
}
if (aSI_disp_data_table[shop_level].wall_xlu_gfx != NULL) {
GAME_PLAY* play = (GAME_PLAY*)game;
OPEN_DISP(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
/* Load floor palette & textures */
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_1_TXT_SEG, tex0);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_2_TXT_SEG, tex1);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_3_TXT_SEG, pal);
Matrix_translate(0.0f, 0.0f, 0.0f, 0);
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 1);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Global_kankyo_set_room_prim(play);
gSPDisplayList(NEXT_POLY_XLU_DISP, aSI_disp_data_table[shop_level].wall_xlu_gfx);
CLOSE_DISP(game->graph);
}
}
static void aSI_DrawShopIndoor(ACTOR* actorx, GAME* game) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
if (shop_indoor->fukubiki_active == TRUE) {
aSI_DrawShopFukubiki(actorx, game);
} else {
aSI_DrawShopWall(actorx, game);
aSI_DrawShopFloor(actorx, game);
}
}
static void Shop_Indoor_Actor_draw(ACTOR* actorx, GAME* game) {
aSI_DrawShopIndoor(actorx, game);
}
static void Shop_Indoor_Actor_move(ACTOR* actorx, GAME* game) {
// nothing
}
static int aSI_ChangeCarpet(mActor_name_t item) {
if (Common_Get(clip).shop_indoor_clip != NULL) {
ACTOR* actorx = Common_Get(clip).shop_indoor_clip->shop_indoor_actor;
if (actorx != NULL && ITEM_IS_CARPET(item)) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
int floor_data_idx = shop_indoor->floor_data_idx;
shop_indoor->floor_idx = (mActor_name_t)item - ITM_CARPET_START;
shop_indoor->floor_data_idx = (floor_data_idx ^ 1) & 1;
aSI_CopyFloorTexture(actorx, shop_indoor->floor_idx, shop_indoor->floor_data_idx);
if (aSI_se_mode == aSI_SE_MODE_NORMAL) {
sAdo_SysTrgStart(NA_SE_11B);
}
return TRUE;
}
}
return FALSE;
}
static int aSI_ChangeWall(mActor_name_t item) {
if (Common_Get(clip).shop_indoor_clip != NULL) {
ACTOR* actorx = Common_Get(clip).shop_indoor_clip->shop_indoor_actor;
if (actorx != NULL && ITEM_IS_WALL(item)) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
int wall_data_idx = shop_indoor->wall_data_idx;
shop_indoor->wall_idx = (mActor_name_t)item - ITM_WALL_START;
shop_indoor->wall_data_idx = (wall_data_idx ^ 1) & 1;
aSI_CopyWallTexture(actorx, shop_indoor->wall_idx, shop_indoor->wall_data_idx);
sAdo_SysTrgStart(NA_SE_11B);
return TRUE;
}
}
return FALSE;
}
static void aSI_Change2Default(void) {
ACTOR* actorx = Common_Get(clip).shop_indoor_clip->shop_indoor_actor;
if (actorx != NULL) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
s16 shop_level = shop_indoor->shop_idx;
aSI_se_mode = aSI_SE_MODE_SILENT;
aSI_ChangeWall(ITM_WALL_START + (mActor_name_t)aSI_wall_default_table[shop_level]);
aSI_ChangeCarpet(ITM_CARPET_START + (mActor_name_t)aSI_floor_default_table[shop_level]);
aSI_se_mode = aSI_SE_MODE_NORMAL;
}
}
static void aSI_IndoorDmaAgain(void) {
if (Common_Get(clip).shop_indoor_clip != NULL) {
ACTOR* actorx = Common_Get(clip).shop_indoor_clip->shop_indoor_actor;
if (actorx != NULL) {
SHOP_INDOOR_ACTOR* shop_indoor = (SHOP_INDOOR_ACTOR*)actorx;
aSI_CopyWallTexture(actorx, shop_indoor->wall_idx, 2);
aSI_CopyFloorTexture(actorx, shop_indoor->floor_idx, 2);
}
}
}
+397
View File
@@ -0,0 +1,397 @@
#include "ac_shop_level.h"
#include "m_common_data.h"
#include "m_player_lib.h"
#include "m_house.h"
#include "m_handbill.h"
#include "m_string.h"
static void Shop_Level_Actor_ct(ACTOR* actorx, GAME* game);
static void Shop_Level_Actor_dt(ACTOR* actorx, GAME* game);
static void Shop_Level_Actor_move(ACTOR* actorx, GAME* game);
static void Shop_Level_Actor_draw(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Shop_Level_Profile = {
mAc_PROFILE_SHOP_LEVEL,
ACTOR_PART_CONTROL,
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(SHOP_LEVEL_ACTOR),
&Shop_Level_Actor_ct,
&Shop_Level_Actor_dt,
&Shop_Level_Actor_move,
&Shop_Level_Actor_draw,
NULL,
};
// clang-format on
static void aSL_SetShopRenewalChirashi_Notice(int shop_level, lbRTC_time_c* time_p) {
static int renewal_chirashi_bunmen[] = { 0x0018, 0x0019, 0x001A, 0x001A };
int header_back_start;
Mail_c mail;
Mail_ct_c* content = &mail.content;
u8 year_str[6];
u8 month_str[9];
u8 day_str[4];
lbRTC_time_c renew_start_date = *time_p;
int i;
lbRTC_Sub_DD(&renew_start_date, 1);
for (i = 0; i < PLAYER_NUM; i++) {
int player_no = mHS_get_pl_no_detail(i);
int free_idx = mMl_chk_mail_free_space(Save_Get(homes[i]).mailbox, HOME_MAILBOX_SIZE);
if (free_idx >= 0 && player_no != -1 && mEv_ArbeitPlayer(player_no) == FALSE) {
int year_str_len;
mString_Load_StringFromRom(month_str, sizeof(month_str),
mString_MONTH_START + (renew_start_date.month - 1));
mHandbill_Set_free_str(mHandbill_FREE_STR0, month_str, sizeof(month_str));
mString_Load_StringFromRom(day_str, sizeof(day_str), mString_DAY_START + (renew_start_date.day - 1));
mHandbill_Set_free_str(mHandbill_FREE_STR1, day_str, sizeof(day_str));
year_str_len = mString_Load_YearStringFromRom(year_str, renew_start_date.year);
mHandbill_Set_free_str(mHandbill_FREE_STR2, year_str, year_str_len);
mMl_clear_mail(&mail);
mHandbill_Load_HandbillFromRom(content->header, &header_back_start, content->footer, content->body,
renewal_chirashi_bunmen[shop_level & 3]);
content->header_back_start = header_back_start;
content->font = mMl_FONT_0;
content->paper_type = (u8)ITM_PAPER55;
content->mail_type = mMl_TYPE_SHOP_SALE_LEAFLET;
mPr_CopyPersonalID(&mail.header.recipient.personalID, &Save_Get(private_data[player_no]).player_ID);
mail.header.recipient.type = mMl_NAME_TYPE_PLAYER;
mMl_copy_mail(&Save_Get(homes[i]).mailbox[free_idx], &mail);
}
}
}
static void aSL_SetRenewalChiraswhi_Notice(void) {
if (Save_Get(shop).shop_info.send_upgrade_notice == TRUE) {
if (mSP_GetShopLevel() < mSP_GetRealShopLevel()) {
lbRTC_time_c* rtc_time_p = Common_GetPointer(time.rtc_time);
lbRTC_time_c renew_time = Save_Get(shop).renewal_time;
lbRTC_Sub_DD(&renew_time, 1);
if (lbRTC_IsOverTime(&renew_time, rtc_time_p) == lbRTC_OVER ||
lbRTC_IsEqualTime(rtc_time_p, &renew_time, lbRTC_CHECK_YEARS | lbRTC_CHECK_MONTHS | lbRTC_CHECK_DAYS)) {
aSL_SetShopRenewalChirashi_Notice(mSP_GetShopLevel(), &Save_Get(shop).renewal_time);
Save_Get(shop).shop_info.send_upgrade_notice = FALSE;
}
} else {
aSL_SetShopRenewalChirashi_Notice((mSP_GetShopLevel() - 1) & 3, &Save_Get(shop).renewal_time);
Save_Get(shop).shop_info.send_upgrade_notice = FALSE;
}
}
}
typedef struct shop_level_rewrite_offset_s {
int ofs_ux;
int ofs_uz;
} aSL_rewrite_ofs_c;
// clang-format off
static aSL_rewrite_ofs_c aSL_zakka_rw[] = {
{ -1, -1 },
{ 0, -1 },
{ -2, 0 },
{ -1, 0 },
{ 1, 0 },
{ -2, 1 },
{ -1, 1 },
{ 0, 1 },
{ 1, 1 },
{ -1, 2 },
{ 0, 2 },
};
// clang-format on
// clang-format off
static aSL_rewrite_ofs_c aSL_conveni_rw[] = {
{ -2, -2 },
{ -1, -2 },
{ -3, -1 },
{ -2, -1 },
{ -1, -1 },
{ 0, -1 },
{ -3, 0 },
{ -2, 0 },
{ -1, 0 },
{ 1, 0 },
{ -2, 1 },
{ -1, 1 },
{ 0, 1 },
{ 1, 1 },
{ -1, 2 },
{ 0, 2 },
};
// clang-format on
// clang-format off
static aSL_rewrite_ofs_c aSL_super_rw[] = {
{ -1, -3 },
{ 0, -3 },
{ -2, -2 },
{ -1, -2 },
{ 0, -2 },
{ 1, -2 },
{ -3, -1 },
{ -2, -1 },
{ -1, -1 },
{ 0, -1 },
{ 1, -1 },
{ 2, -1 },
{ -3, 0 },
{ -2, 0 },
{ -1, 0 },
{ 1, 0 },
{ 2, 0 },
{ -2, 1 },
{ -1, 1 },
{ 0, 1 },
{ 1, 1 },
{ -1, 2 },
{ 0, 2 },
};
// clang-format on
static void aSL_GroundClean(s16 level, s16 next_level, mActor_name_t* fg_p, int bx, int bz, int ux, int uz) {
static aSL_rewrite_ofs_c* table[] = {
aSL_zakka_rw,
aSL_conveni_rw,
aSL_super_rw,
aSL_super_rw,
};
static int rw_cnt[] = {
ARRAY_COUNT(aSL_zakka_rw),
ARRAY_COUNT(aSL_conveni_rw),
ARRAY_COUNT(aSL_super_rw),
ARRAY_COUNT(aSL_super_rw),
};
int i;
aSL_rewrite_ofs_c* rewrite_ofs_p;
u16* deposit_p;
deposit_p = mFI_GetDepositP(bx, bz);
rewrite_ofs_p = table[next_level & 3];
for (i = 0; i < rw_cnt[next_level & 3]; i++) {
int rewrite_ux = (ux + rewrite_ofs_p[i].ofs_ux) & 0xF;
int rewrite_uz = (uz + rewrite_ofs_p[i].ofs_uz) & 0xF;
int rewrite_unit = rewrite_uz * UT_X_NUM + rewrite_ux;
mPB_keep_item(fg_p[rewrite_unit]);
mFI_BlockDepositOFF(deposit_p, rewrite_ux, rewrite_uz);
fg_p[rewrite_unit] = RSV_NO;
}
}
static int aSL_RewriteShopFg(ACTOR* actorx, GAME* game, s16 level, s16 next_level) {
SHOP_LEVEL_ACTOR* shop_level = (SHOP_LEVEL_ACTOR*)actorx;
int i;
int ux;
int uz;
mActor_name_t* fg_top_p;
mActor_name_t* fg_p;
fg_top_p = mFI_BkNumtoUtFGTop(shop_level->bx, shop_level->bz);
fg_p = fg_top_p;
if (fg_top_p != NULL) {
for (i = 0; i < UT_TOTAL_NUM; i++) {
/* @BUG - shouldn't this just be <= SHOP3? This goes one over which would include the Post Office */
if (*fg_top_p >= SHOP0 && *fg_top_p <= (SHOP3 + 1)) {
ux = i & 0xF;
uz = (i >> 4) & 0xF;
*fg_top_p = SHOP0 + next_level;
aSL_GroundClean((s16)level, (s16)next_level, fg_p, shop_level->bx, shop_level->bz, ux, uz);
return TRUE;
}
fg_top_p++;
}
}
return FALSE;
}
static void aSL_RenewShop(ACTOR* actorx, GAME* game) {
int last_scene = Common_Get(last_scene_no);
if (last_scene == SCENE_SHOP0 || last_scene == SCENE_CONVENI || last_scene == SCENE_SUPER ||
last_scene == SCENE_DEPART || last_scene == SCENE_DEPART_2) {
return;
}
if (mFI_GET_TYPE(mFI_GetFieldId()) == mFI_FIELD_FG && Save_Get(scene_no) == SCENE_FG &&
mEv_CheckEvent(mEv_SAVED_RENEWSHOP) == TRUE) {
lbRTC_time_c renew_time = Save_Get(shop).renewal_time;
lbRTC_time_c now_time = Common_Get(time.rtc_time);
aSL_SetRenewalChiraswhi_Notice();
if (lbRTC_IsOverTime(&renew_time, &now_time) == lbRTC_OVER ||
lbRTC_IsEqualTime(&now_time, &renew_time, lbRTC_CHECK_YEARS | lbRTC_CHECK_MONTHS | lbRTC_CHECK_DAYS)) {
if (aSL_RewriteShopFg(actorx, game, mSP_GetShopLevel(), mSP_GetRealShopLevel()) && mSP_RenewShopLevel()) {
mEv_EventOFF(mEv_SAVED_RENEWSHOP);
mSP_NewExchangeDay();
mSP_ExchangeLineUp_ZeldaMalloc();
}
}
}
}
static void Shop_Level_Actor_ct(ACTOR* actorx, GAME* game) {
SHOP_LEVEL_ACTOR* shop_level = (SHOP_LEVEL_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
ACTOR* player_actor = GET_PLAYER_ACTOR_ACTOR(play);
xyz_t* pos_p;
int shop_block_flag;
shop_level->bx = 0;
shop_level->bz = 0;
if (player_actor != NULL) {
pos_p = &player_actor->world.position;
} else {
pos_p = &actorx->world.position;
}
/* Try to move shop level actor to where the player currently is */
actorx->world.position = *pos_p;
shop_block_flag = mFI_BlockKind2BkNum(&shop_level->bx, &shop_level->bz, mRF_BLOCKKIND_SHOP);
if (Save_Get(scene_no) == SCENE_FG) {
mSP_SetShopRareFurnitureChirashi(Common_Get(player_no), Save_Get(shop).items, mSP_GOODS_COUNT, NULL);
Save_Get(shop).shop_info.not_loaded_before = FALSE;
}
if (shop_block_flag) {
aSL_RenewShop(actorx, game);
}
}
static void Shop_Level_Actor_dt(ACTOR* actorx, GAME* game) {
// nothing
}
static void Shop_Level_Actor_draw(ACTOR* actorx, GAME* game) {
// nothing
}
static void aSL_JudgeRenewShop(ACTOR* actorx, GAME* game) {
if (Save_Get(scene_no) == SCENE_FG && mEv_CheckEvent(mEv_SAVED_RENEWSHOP) == FALSE) {
if (mSP_GetShopLevel() < mSP_GetRealShopLevel()) {
lbRTC_time_c now_time = Common_Get(time.rtc_time);
lbRTC_time_c renewal_two_days = now_time;
lbRTC_time_c renewal_one_day;
u16 bargain_date;
renewal_two_days.hour = mSP_GetShopOpenTime();
renewal_two_days.min = 0;
renewal_two_days.sec = 0;
lbRTC_Add_DD(&renewal_two_days, 2);
renewal_one_day = now_time;
lbRTC_Add_DD(&renewal_one_day, 1);
bargain_date = mEv_get_bargain_day();
if (bargain_date != 0) {
lbRTC_month_t bargain_month = (bargain_date >> 8) & 0xFF;
lbRTC_day_t bargain_day = bargain_date & 0xFF;
/* No upgrading shop if a Nook sale event happens within 2 days */
if ((now_time.month == bargain_month && now_time.day == bargain_day) ||
(renewal_two_days.month == bargain_month && renewal_two_days.day == bargain_day) ||
(renewal_one_day.month == bargain_month && renewal_one_day.day == bargain_day)) {
return;
}
}
{
lbRTC_year_t now_year = now_time.year;
lbRTC_month_t now_month = now_time.month;
lbRTC_day_t max_day = lbRTC_GetDaysByMonth(now_year, now_time.month);
lbRTC_day_t now_day = now_time.day;
/* No upgrading shop if lottery day is within 2 days */
if (now_day == max_day ||
(renewal_two_days.day == lbRTC_GetDaysByMonth(renewal_two_days.year, renewal_two_days.month)) ||
(renewal_one_day.day == lbRTC_GetDaysByMonth(renewal_one_day.year, renewal_one_day.month))) {
return;
}
/* Don't upgrade shop on sale day */
if ((now_month == lbRTC_NOVEMBER &&
now_day == (lbRTC_Weekly_day(now_year, lbRTC_NOVEMBER, 4, lbRTC_THURSDAY) + 1)) ||
(renewal_two_days.month == lbRTC_NOVEMBER &&
renewal_two_days.day ==
(lbRTC_Weekly_day(renewal_two_days.year, lbRTC_NOVEMBER, 4, lbRTC_THURSDAY) + 1)) ||
(renewal_one_day.month == lbRTC_NOVEMBER &&
renewal_one_day.day ==
(lbRTC_Weekly_day(renewal_one_day.year, lbRTC_NOVEMBER, 4, lbRTC_THURSDAY) + 1))) {
return;
}
}
mEv_EventON(mEv_SAVED_RENEWSHOP);
Save_Get(shop).renewal_time = renewal_two_days;
Save_Get(shop).shop_info.send_upgrade_notice = TRUE;
Save_Get(shop).shop_info.upgrading_today = TRUE;
}
}
if (Save_Get(scene_no) == SCENE_FG && mEv_CheckEvent(mEv_SAVED_RENEWSHOP) == TRUE) {
lbRTC_time_c now_time = Common_Get(time.rtc_time);
lbRTC_time_c renewal_time = Save_Get(shop).renewal_time;
lbRTC_Sub_DD(&renewal_time, 2);
if (lbRTC_IsOverTime(&now_time, &renewal_time) == lbRTC_OVER) {
mEv_EventOFF(mEv_SAVED_RENEWSHOP);
Save_Get(shop).shop_info.upgrading_today = FALSE;
Save_Get(shop).shop_info.send_upgrade_notice = FALSE;
return;
}
}
aSL_SetRenewalChiraswhi_Notice();
mSP_SetRenewalChiraswhi_AppoDay();
}
static void aSL_ExchangeShopGoodsInGame(ACTOR* actorx, GAME* game, lbRTC_hour_t hour) {
lbRTC_time_c now_time = Common_Get(time.rtc_time);
lbRTC_hour_t now_hour = now_time.hour;
if (mEv_CheckEvent(mEv_SAVED_RENEWSHOP) == FALSE && Save_Get(scene_no) == SCENE_FG && now_hour >= hour &&
mSP_CheckExchangeDay2()) {
if (mSP_CheckExchangeMonth()) {
mSP_LotteryLineUp_ZeldaMalloc();
}
mSP_NewExchangeDay();
mSP_ExchangeLineUp_ZeldaMalloc();
}
}
static void aSL_ReportShopOpen2Event(void) {
int status = mSP_ShopOpen(); // @unused
if (mSP_ShopOpen() == mSP_SHOP_STATUS_OPEN || mSP_ShopOpen() == mSP_SHOP_STATUS_OPENEVENT) {
mEv_EventON(mEv_DAILY_OPEN_SHOP);
} else {
mEv_EventOFF(mEv_DAILY_OPEN_SHOP);
}
}
static void Shop_Level_Actor_move(ACTOR* actorx, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
ACTOR* player_actor = GET_PLAYER_ACTOR_ACTOR(play);
xyz_t* pos_p;
if (player_actor != NULL) {
pos_p = &player_actor->world.position;
} else {
pos_p = &actorx->world.position;
}
actorx->world.position = *pos_p;
aSL_JudgeRenewShop(actorx, game);
aSL_ExchangeShopGoodsInGame(actorx, game, 6);
aSL_ReportShopOpen2Event();
}
+1 -1
View File
@@ -234,7 +234,7 @@ static void aSHOP_open_wait(STRUCTURE_ACTOR* shop, GAME_PLAY* play) {
actor = &shop->actor_class;
game = &play->game;
if (mPlib_check_player_actor_main_index_OutDoorMove(play) != FALSE) {
if (mPlib_check_player_actor_main_index_OutDoorMove(&play->game) != FALSE) {
return;
}
+1022
View File
File diff suppressed because it is too large Load Diff
+109 -122
View File
@@ -6,26 +6,14 @@
#include "m_rcp.h"
#include "m_common_data.h"
enum {
aTKT_ACTION_WAIT,
aTKT_ACTION_TAKEOUT,
aTKT_ACTION_PUTAWAY,
aTKT_ACTION_DESTRUCT,
aTKT_ACTION_TAKEOUT2,
aTKT_ACTION_DELETED // Placeholder. Unknown use.
};
extern cKF_Animation_R_c cKF_ba_r_tol_keitai_1_keitai_on1;
extern cKF_Animation_R_c cKF_ba_r_tol_keitai_1_keitai_off1;
extern cKF_Skeleton_R_c cKF_bs_r_tol_keitai_1;
KEITAI_ACTION_ANIM aTKT_anm_dt[6] = {
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 1.0f },
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 68.0f },
{ &cKF_ba_r_tol_keitai_1_keitai_off1, 1.0f, 61.0f},
{ &cKF_ba_r_tol_keitai_1_keitai_off1, 1.0f, 61.0f},
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 68.0f},
{ NULL, 0.0f, 0.0f}
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 1.0f }, { &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 68.0f },
{ &cKF_ba_r_tol_keitai_1_keitai_off1, 1.0f, 61.0f }, { &cKF_ba_r_tol_keitai_1_keitai_off1, 1.0f, 61.0f },
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 68.0f }, { NULL, 0.0f, 0.0f },
};
static void aTKT_actor_ct(ACTOR* actor, GAME* game);
@@ -33,149 +21,148 @@ static void aTKT_actor_move(ACTOR* actor, GAME* game);
static void aTKT_actor_draw(ACTOR* actor, GAME* game);
ACTOR_PROFILE T_Keitai_Profile = {
mAc_PROFILE_T_KEITAI,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEITAI,
sizeof(KEITAI_ACTOR),
&aTKT_actor_ct,
NONE_ACTOR_PROC,
&aTKT_actor_move,
&aTKT_actor_draw,
NULL
mAc_PROFILE_T_KEITAI,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEITAI,
sizeof(KEITAI_ACTOR),
&aTKT_actor_ct,
NONE_ACTOR_PROC,
&aTKT_actor_move,
&aTKT_actor_draw,
NULL,
};
static void aTKT_setupAction(KEITAI_ACTOR* actor, int action);
static void aTKT_actor_ct(ACTOR* actor, GAME* game) {
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
cKF_SkeletonInfo_R_ct(&keitai->keyframe, &cKF_bs_r_tol_keitai_1, NULL, keitai->work, keitai->morph);
keitai->bank_ram_start = ((GAME_PLAY*)game)->object_exchange.banks[actor->data_bank_id].ram_start;
aTKT_setupAction(keitai, aTKT_ACTION_TAKEOUT);
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
cKF_SkeletonInfo_R_ct(&keitai->keyframe, &cKF_bs_r_tol_keitai_1, NULL, keitai->work, keitai->morph);
keitai->bank_ram_start = ((GAME_PLAY*)game)->object_exchange.banks[actor->data_bank_id].ram_start;
aTKT_setupAction(keitai, aTOL_ACTION_TAKEOUT);
}
static void aTKT_calc_scale(ACTOR* actor, int idx) {
static f32 start_scale[2] = { 0.0f, 1.0f };
static f32 end_scale[2] = { 1.0f, 0.0f };
static f32 start_chno[2] = { 10.0f, 33.0f };
static f32 end_chno[2] = { 20.0f, 41.0f };
static f32 start_scale[2] = { 0.0f, 1.0f };
static f32 end_scale[2] = { 1.0f, 0.0f };
static f32 start_chno[2] = { 10.0f, 33.0f };
static f32 end_chno[2] = { 20.0f, 41.0f };
f32 current_frame;
f32 starting_chno;
f32 ending_chno;
f32 starting_scale;
f32 ending_scale;
f32 scale;
KEITAI_ACTOR* keitai;
f32 current_frame;
f32 starting_chno;
f32 ending_chno;
f32 starting_scale;
f32 ending_scale;
f32 scale;
KEITAI_ACTOR* keitai;
keitai = (KEITAI_ACTOR*)actor;
current_frame = keitai->keyframe.frame_control.current_frame;
starting_chno = start_chno[idx];
ending_chno = end_chno[idx];
starting_scale = start_scale[idx];
ending_scale = end_scale[idx];
if (current_frame < starting_chno) {
scale = starting_scale;
} else if (current_frame > ending_chno) {
scale = ending_scale;
} else {
scale = starting_scale + ((ending_scale - starting_scale) * ((current_frame - starting_chno) / (ending_chno - starting_chno)));
}
actor->scale.x = scale;
actor->scale.y = scale;
actor->scale.z = scale;
keitai = (KEITAI_ACTOR*)actor;
current_frame = keitai->keyframe.frame_control.current_frame;
starting_chno = start_chno[idx];
ending_chno = end_chno[idx];
starting_scale = start_scale[idx];
ending_scale = end_scale[idx];
if (current_frame < starting_chno) {
scale = starting_scale;
} else if (current_frame > ending_chno) {
scale = ending_scale;
} else {
scale = starting_scale +
((ending_scale - starting_scale) * ((current_frame - starting_chno) / (ending_chno - starting_chno)));
}
actor->scale.x = scale;
actor->scale.y = scale;
actor->scale.z = scale;
}
static void aTKT_takeout(ACTOR* actor) {
aTKT_calc_scale(actor, 0);
aTKT_calc_scale(actor, 0);
}
static void aTKT_putaway(ACTOR* actor) {
aTKT_calc_scale(actor, 1);
aTKT_calc_scale(actor, 1);
}
static void aTKT_destruct(ACTOR* actor) {
Actor_delete(actor);
Actor_delete(actor);
}
static void aTKT_s_takeout(ACTOR* actor) {
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
actor->scale.x = 1.0f;
actor->scale.y = 1.0f;
actor->scale.z = 1.0f;
actor->scale.x = 1.0f;
actor->scale.y = 1.0f;
actor->scale.z = 1.0f;
keitai->keyframe.frame_control.current_frame = keitai->keyframe.frame_control.end_frame;
keitai->keyframe.frame_control.current_frame = keitai->keyframe.frame_control.end_frame;
}
static void aTKT_setupAction(KEITAI_ACTOR* keitai, int action) {
static KEITAI_PROC action_process[] = {(KEITAI_PROC)none_proc1, aTKT_takeout, aTKT_putaway, aTKT_destruct, aTKT_s_takeout, NULL};
KEITAI_ACTION_ANIM *action_anim;
f32 starting_frame;
f32 ending_frame;
static KEITAI_PROC process[] = {
(KEITAI_PROC)none_proc1, aTKT_takeout, aTKT_putaway, aTKT_destruct, aTKT_s_takeout, NULL,
};
keitai->action_proc = action_process[action];
keitai->action = action;
keitai->tools_class.work0 = action;
action_anim = &aTKT_anm_dt[action];
starting_frame = action_anim->start_frame;
cKF_SkeletonInfo_R_init(
&keitai->keyframe, keitai->keyframe.skeleton,
action_anim->animation, starting_frame, action_anim->end_frame, starting_frame,
0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL
);
KEITAI_ACTION_ANIM* action_anim;
f32 starting_frame;
f32 ending_frame;
keitai->action_proc = process[action];
keitai->action = action;
keitai->tools_class.work0 = action;
action_anim = &aTKT_anm_dt[action];
starting_frame = action_anim->start_frame;
cKF_SkeletonInfo_R_init(&keitai->keyframe, keitai->keyframe.skeleton, action_anim->animation, starting_frame,
action_anim->end_frame, starting_frame, 0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL);
}
static void aTKT_actor_move(ACTOR* actor, GAME* game) {
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
int action = keitai->tools_class.work0;
if (action != keitai->action) {
aTKT_setupAction(keitai, action);
}
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
int action = keitai->tools_class.work0;
if (action != keitai->action) {
aTKT_setupAction(keitai, action);
}
cKF_SkeletonInfo_R_play(&keitai->keyframe);
keitai->action_proc(actor);
cKF_SkeletonInfo_R_play(&keitai->keyframe);
keitai->action_proc(actor);
}
static void aTKT_actor_draw(ACTOR* actor, GAME* game) {
cKF_SkeletonInfo_R_c* keyf;
GRAPH* graph;
Mtx* mtx;
Gfx* gfx;
KEITAI_ACTOR* keitai;
cKF_SkeletonInfo_R_c* keyf;
GRAPH* graph;
Mtx* mtx;
Gfx* gfx;
KEITAI_ACTOR* keitai;
keitai = (KEITAI_ACTOR*)actor;
keyf = &keitai->keyframe;
graph = game->graph;
mtx = GRAPH_ALLOC_TYPE(graph, Mtx, keyf->skeleton->num_shown_joints);
keitai = (KEITAI_ACTOR*)actor;
keyf = &keitai->keyframe;
graph = game->graph;
mtx = GRAPH_ALLOC_TYPE(graph, Mtx, keyf->skeleton->num_shown_joints);
if (mtx != NULL) {
if (keitai->tools_class.init_matrix == TRUE) {
Matrix_put(&keitai->tools_class.matrix_work);
Matrix_Position_Zero(&actor->world.position);
keitai->tools_class.init_matrix = FALSE;
if (mtx != NULL) {
if (keitai->tools_class.init_matrix == TRUE) {
Matrix_put(&keitai->tools_class.matrix_work);
Matrix_Position_Zero(&actor->world.position);
keitai->tools_class.init_matrix = FALSE;
} else {
Matrix_translate(actor->world.position.x, actor->world.position.y, actor->world.position.z, FALSE);
Matrix_scale(0.01f, 0.01f, 0.01f, TRUE);
}
_texture_z_light_fog_prim_npc(graph);
OPEN_DISP(graph);
gfx = NOW_POLY_OPA_DISP;
Matrix_scale(actor->scale.x, actor->scale.y, actor->scale.z, TRUE);
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
SET_POLY_OPA_DISP(gfx);
cKF_Si3_draw_R_SV(game, keyf, mtx, NULL, NULL, NULL);
CLOSE_DISP(graph);
}
else {
Matrix_translate(actor->world.position.x, actor->world.position.y, actor->world.position.z, FALSE);
Matrix_scale(0.01f, 0.01f, 0.01f, TRUE);
}
_texture_z_light_fog_prim_npc(graph);
OPEN_DISP(graph);
gfx = NOW_POLY_OPA_DISP;
Matrix_scale(actor->scale.x, actor->scale.y, actor->scale.z, TRUE);
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
SET_POLY_OPA_DISP(gfx);
cKF_Si3_draw_R_SV(game, keyf, mtx, NULL, NULL, NULL);
CLOSE_DISP(graph);
}
}
+196 -236
View File
@@ -7,12 +7,12 @@
#include "m_common_data.h"
enum {
aTUMB_ACTION_TAKEOUT_BEFORE,
aTUMB_ACTION_OPENING, // Placeholder. Unknown use.
aTUMB_ACTION_DELETED2, // Placeholder. Unknown use.
aTUMB_ACTION_DESTRUCT,
aTUMB_ACTION_DELETED3, // Placeholder. Unknown use.
aTUMB_ACTION_DELETED4 // Placeholder. Unknown use.
aTUMB_ACTION_TAKEOUT_BEFORE,
aTUMB_ACTION_OPENING, // Placeholder. Unknown use.
aTUMB_ACTION_DELETED2, // Placeholder. Unknown use.
aTUMB_ACTION_DESTRUCT,
aTUMB_ACTION_DELETED3, // Placeholder. Unknown use.
aTUMB_ACTION_DELETED4 // Placeholder. Unknown use.
};
static void aTUMB_actor_ct(ACTOR* actor, GAME* game);
@@ -20,17 +20,17 @@ static void aTUMB_actor_move(ACTOR* actor, GAME* game);
static void aTUMB_actor_draw(ACTOR* actor, GAME* game);
ACTOR_PROFILE T_Umbrella_Profile = {
mAc_PROFILE_T_UMBRELLA,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_UMBRELLA,
sizeof(UMBRELLA_ACTOR),
&aTUMB_actor_ct,
NONE_ACTOR_PROC,
&aTUMB_actor_move,
&aTUMB_actor_draw,
NULL
mAc_PROFILE_T_UMBRELLA,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_UMBRELLA,
sizeof(UMBRELLA_ACTOR),
&aTUMB_actor_ct,
NONE_ACTOR_PROC,
&aTUMB_actor_move,
&aTUMB_actor_draw,
NULL,
};
extern Gfx e_umb01_model[];
@@ -103,284 +103,244 @@ extern Gfx kasa_umb_w_model[];
static void aTUMB_setupAction(UMBRELLA_ACTOR* umbrella, int action);
static void aTUMB_actor_ct(ACTOR* actor, GAME* game) {
UMBRELLA_ACTOR* umbrella = (UMBRELLA_ACTOR*)actor;
aTUMB_setupAction(umbrella, umbrella->tools_class.work0);
UMBRELLA_ACTOR* umbrella = (UMBRELLA_ACTOR*)actor;
aTUMB_setupAction(umbrella, umbrella->tools_class.work0);
}
static void aTUMB_OngenTrgStart_sub(ACTOR* actor, u16 id) {
sAdo_OngenTrgStart(id, &actor->world.position);
sAdo_OngenTrgStart(id, &actor->world.position);
}
static void aTUMB_OngenTrgStart(ACTOR* actor, int idx) {
switch(idx) {
case 1:
aTUMB_OngenTrgStart_sub(actor, 0x139);
break;
case 2:
aTUMB_OngenTrgStart_sub(actor, 0x10E);
break;
}
switch (idx) {
case 1:
aTUMB_OngenTrgStart_sub(actor, 0x139);
break;
case 2:
aTUMB_OngenTrgStart_sub(actor, 0x10E);
break;
}
}
static void aTUMB_calc_model_scale_sub(xyz_t* scale, UMBRELLA_ACTOR* umbrella, int idx) {
static f32 e_open_sect_table[6] = { 0.0f, 7.0f, 11.0f, 18.0f, 22.0f, 26.0f };
static f32 e_open_scale_table[12] = {
0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 1.0f,0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f
};
static f32 e_open_sect_table[6] = { 0.0f, 7.0f, 11.0f, 18.0f, 22.0f, 26.0f };
static f32 e_open_scale_table[12] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 1.0f, 0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f };
static f32 kasa_open_sect_table[4] = { 0.0f, 15.0f, 22.0f, 26.0f };
static f32 kasa_open_scale_table[8] = {
3.0f, 0.15f, 3.0f, 0.15f, 1.0f, 1.0f, 0.9, 1.0f
};
static f32 kasa_open_sect_table[4] = { 0.0f, 15.0f, 22.0f, 26.0f };
static f32 kasa_open_scale_table[8] = { 3.0f, 0.15f, 3.0f, 0.15f, 1.0f, 1.0f, 0.9, 1.0f };
static UMBRELLA_DATA_TABLE open_data_table[2] = {
{ 6, e_open_sect_table, e_open_scale_table },
{ 4, kasa_open_sect_table, kasa_open_scale_table }
};
static UMBRELLA_DATA_TABLE open_data_table[2] = { { 6, e_open_sect_table, e_open_scale_table },
{ 4, kasa_open_sect_table, kasa_open_scale_table } };
static f32 e_close_sect_table[6] = { 0.0f, 4.0f, 12.0f, 15.0f, 22.0f, 30.0f };
static f32 e_close_scale_table[12] = {
1.0f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f
};
static f32 e_close_sect_table[6] = { 0.0f, 4.0f, 12.0f, 15.0f, 22.0f, 30.0f };
static f32 e_close_scale_table[12] = { 1.0f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f };
static f32 kasa_close_sect_table[4] = { 0.0f, 4.0f, 12.0f, 30.0f };
static f32 kasa_close_scale_table[8] = {
1.0f, 1.0f, 1.2f, 1.0f, 3.0f, 0.15f, 3.0f, 0.15f
};
static f32 kasa_close_sect_table[4] = { 0.0f, 4.0f, 12.0f, 30.0f };
static f32 kasa_close_scale_table[8] = { 1.0f, 1.0f, 1.2f, 1.0f, 3.0f, 0.15f, 3.0f, 0.15f };
static UMBRELLA_DATA_TABLE close_data_table[2] = {
{ 6, e_close_sect_table, e_close_scale_table },
{ 4, kasa_close_sect_table, kasa_close_scale_table }
};
static UMBRELLA_DATA_TABLE close_data_table[2] = { { 6, e_close_sect_table, e_close_scale_table },
{ 4, kasa_close_sect_table, kasa_close_scale_table } };
static UMBRELLA_DATA_TABLE* data_table[6] = {
open_data_table, open_data_table, close_data_table, close_data_table, open_data_table, NULL
};
static UMBRELLA_DATA_TABLE* data_table[6] = { open_data_table, open_data_table, close_data_table,
close_data_table, open_data_table, NULL };
f32 modifier_percentage;
f32 base_scale_x;
f32 base_scale_y;
f32 max_scale_y;
f32 max_scale_x;
f32 modifier_percentage;
f32 base_scale_x;
f32 base_scale_y;
f32 max_scale_y;
f32 max_scale_x;
int scale_idx_offset;
f32* scale_table;
int sector_idx;
int frame;
int corresponding_sector;
UMBRELLA_DATA_TABLE *table;
f32* sect_table;
int scale_idx_offset;
f32* scale_table;
int sector_idx;
int frame;
int corresponding_sector;
UMBRELLA_DATA_TABLE* table;
f32* sect_table;
corresponding_sector = 0;
table = data_table[umbrella->action] + idx;
sector_idx = table->table_length - 1;
frame = (int)umbrella->frame;
sect_table = table->sect_table + 1;
corresponding_sector = 0;
table = data_table[umbrella->action] + idx;
sector_idx = table->table_length - 1;
frame = (int)umbrella->frame;
sect_table = table->sect_table + 1;
for(sector_idx; sector_idx > 0; sector_idx--) {
if (frame <= (int)sect_table[0]) {
frame -= (int)sect_table[-1];
break;
}
for (sector_idx; sector_idx > 0; sector_idx--) {
if (frame <= (int)sect_table[0]) {
frame -= (int)sect_table[-1];
break;
}
sect_table++;
corresponding_sector++;
}
sect_table++;
corresponding_sector++;
}
scale_idx_offset = corresponding_sector * 2;
scale_table = table->scale_table;
base_scale_x = scale_table[scale_idx_offset];
modifier_percentage = (f32) frame / (sect_table[0] - sect_table[-1]);
base_scale_y = scale_table[scale_idx_offset + 1];
max_scale_y = scale_table[scale_idx_offset + 3];
max_scale_x = scale_table[scale_idx_offset + 2];
scale_idx_offset = corresponding_sector * 2;
scale_table = table->scale_table;
base_scale_x = scale_table[scale_idx_offset];
modifier_percentage = (f32)frame / (sect_table[0] - sect_table[-1]);
base_scale_y = scale_table[scale_idx_offset + 1];
max_scale_y = scale_table[scale_idx_offset + 3];
max_scale_x = scale_table[scale_idx_offset + 2];
scale->x = base_scale_x + modifier_percentage * (max_scale_x - base_scale_x);
scale->y = base_scale_y + modifier_percentage * (max_scale_y - base_scale_y);
scale->z = scale->y;
scale->x = base_scale_x + modifier_percentage * (max_scale_x - base_scale_x);
scale->y = base_scale_y + modifier_percentage * (max_scale_y - base_scale_y);
scale->z = scale->y;
}
static void aTUMB_calc_model_scale(UMBRELLA_ACTOR* umbrella) {
aTUMB_calc_model_scale_sub(&umbrella->scale_e, umbrella, 0);
aTUMB_calc_model_scale_sub(&umbrella->scale_kasa, umbrella, 1);
aTUMB_calc_model_scale_sub(&umbrella->scale_e, umbrella, 0);
aTUMB_calc_model_scale_sub(&umbrella->scale_kasa, umbrella, 1);
}
static void aTUMB_anime_proc(UMBRELLA_ACTOR* umbrella) {
static f32 max_anm[6] = { 0.0f, 26.0f, 30.0f, 30.0f, 26.0f, 0.0f };
static f32 max_anm[6] = { 0.0f, 26.0f, 30.0f, 30.0f, 26.0f, 0.0f };
f32 max_anm_for_action;
f32 next_frame;
int action;
f32 max_anm_for_action;
f32 next_frame;
int action;
action = umbrella->action;
max_anm_for_action = max_anm[action];
next_frame = umbrella->frame;
next_frame += 0.5f;
action = umbrella->action;
max_anm_for_action = max_anm[action];
next_frame = umbrella->frame;
next_frame += 0.5f;
if (next_frame >= max_anm_for_action) {
next_frame = max_anm_for_action;
}
if (next_frame >= max_anm_for_action) {
next_frame = max_anm_for_action;
}
if (action == aTUMB_ACTION_OPENING) {
umbrella->opened_fully = next_frame == max_anm_for_action;
}
if (action == aTUMB_ACTION_OPENING) {
umbrella->opened_fully = next_frame == max_anm_for_action;
}
umbrella->frame = next_frame;
aTUMB_calc_model_scale(umbrella);
umbrella->frame = next_frame;
aTUMB_calc_model_scale(umbrella);
}
static void aTUMB_takeout_before(ACTOR* actor) {
UMBRELLA_ACTOR* umbrella = (UMBRELLA_ACTOR*)actor;
if (umbrella->tools_class.unk1BC == TRUE) {
aTUMB_setupAction(umbrella, aTUMB_ACTION_OPENING);
}
UMBRELLA_ACTOR* umbrella = (UMBRELLA_ACTOR*)actor;
if (umbrella->tools_class.unk1BC == TRUE) {
aTUMB_setupAction(umbrella, aTUMB_ACTION_OPENING);
}
}
static void aTUMB_destruct(ACTOR* actor) {
Actor_delete(actor);
Actor_delete(actor);
}
void aTUMB_setupAction(UMBRELLA_ACTOR* umbrella, int action) {
static UMBRELLA_PROC process[] = {
aTUMB_takeout_before, (UMBRELLA_PROC)none_proc1, (UMBRELLA_PROC)none_proc1, aTUMB_destruct, (UMBRELLA_PROC)none_proc1, NULL
};
static UMBRELLA_PROC process[] = { aTUMB_takeout_before, (UMBRELLA_PROC)none_proc1, (UMBRELLA_PROC)none_proc1,
aTUMB_destruct, (UMBRELLA_PROC)none_proc1, NULL };
f32 frame;
f32 frame;
umbrella->action_proc = process[action];
umbrella->action = action;
umbrella->tools_class.work0 = action;
aTUMB_OngenTrgStart(&umbrella->tools_class.actor_class, action);
umbrella->action_proc = process[action];
umbrella->action = action;
umbrella->tools_class.work0 = action;
if (action == aTUMB_ACTION_DELETED3) {
umbrella->opened_fully = TRUE;
frame = 26.0f;
} else {
frame = 0.0f;
}
aTUMB_OngenTrgStart(&umbrella->tools_class.actor_class, action);
umbrella->frame = frame;
if (action == aTUMB_ACTION_DELETED3) {
umbrella->opened_fully = TRUE;
frame = 26.0f;
} else {
frame = 0.0f;
}
umbrella->frame = frame;
}
static void aTUMB_actor_move(ACTOR* actor, GAME* game) {
UMBRELLA_ACTOR* umbrella;
int action;
UMBRELLA_ACTOR* umbrella;
int action;
umbrella = (UMBRELLA_ACTOR*)actor;
action = umbrella->tools_class.work0;
umbrella = (UMBRELLA_ACTOR*)actor;
action = umbrella->tools_class.work0;
if (action != umbrella->action) {
aTUMB_setupAction(umbrella, action);
}
if (action != umbrella->action) {
aTUMB_setupAction(umbrella, action);
}
if (umbrella->action != aTUMB_ACTION_DESTRUCT) {
aTUMB_anime_proc(umbrella);
}
if (umbrella->action != aTUMB_ACTION_DESTRUCT) {
aTUMB_anime_proc(umbrella);
}
umbrella->action_proc(actor);
umbrella->action_proc(actor);
}
static void aTUMB_actor_draw(ACTOR* actor, GAME* game) {
static UMBRELLA_MODEL draw_dt[40] = {
{ e_umb01_model, kasa_umb01_model },
{ e_umb02_model, kasa_umb02_model },
{ e_umb03_model, kasa_umb03_model },
{ e_umb04_model, kasa_umb04_model },
{ e_umb05_model, kasa_umb05_model },
{ e_umb06_model, kasa_umb06_model },
{ e_umb07_model, kasa_umb07_model },
{ e_umb08_model, kasa_umb08_model },
{ e_umb09_model, kasa_umb09_model },
{ e_umb10_model, kasa_umb10_model },
{ e_umb11_model, kasa_umb11_model },
{ e_umb12_model, kasa_umb12_model },
{ e_umb13_model, kasa_umb13_model },
{ e_umb14_model, kasa_umb14_model },
{ e_umb15_model, kasa_umb15_model },
{ e_umb16_model, kasa_umb16_model },
{ e_umb17_model, kasa_umb17_model },
{ e_umb18_model, kasa_umb18_model },
{ e_umb19_model, kasa_umb19_model },
{ e_umb20_model, kasa_umb20_model },
{ e_umb21_model, kasa_umb21_model },
{ e_umb22_model, kasa_umb22_model },
{ e_umb23_model, kasa_umb23_model },
{ e_umb24_model, kasa_umb24_model },
{ e_umb25_model, kasa_umb25_model },
{ e_umb26_model, kasa_umb26_model },
{ e_umb27_model, kasa_umb27_model },
{ e_umb28_model, kasa_umb28_model },
{ e_umb29_model, kasa_umb29_model },
{ e_umb30_model, kasa_umb30_model },
{ e_umb31_model, kasa_umb31_model },
{ e_umb32_model, kasa_umb32_model },
{ e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model }
};
static UMBRELLA_MODEL draw_dt[40] = {
{ e_umb01_model, kasa_umb01_model }, { e_umb02_model, kasa_umb02_model }, { e_umb03_model, kasa_umb03_model },
{ e_umb04_model, kasa_umb04_model }, { e_umb05_model, kasa_umb05_model }, { e_umb06_model, kasa_umb06_model },
{ e_umb07_model, kasa_umb07_model }, { e_umb08_model, kasa_umb08_model }, { e_umb09_model, kasa_umb09_model },
{ e_umb10_model, kasa_umb10_model }, { e_umb11_model, kasa_umb11_model }, { e_umb12_model, kasa_umb12_model },
{ e_umb13_model, kasa_umb13_model }, { e_umb14_model, kasa_umb14_model }, { e_umb15_model, kasa_umb15_model },
{ e_umb16_model, kasa_umb16_model }, { e_umb17_model, kasa_umb17_model }, { e_umb18_model, kasa_umb18_model },
{ e_umb19_model, kasa_umb19_model }, { e_umb20_model, kasa_umb20_model }, { e_umb21_model, kasa_umb21_model },
{ e_umb22_model, kasa_umb22_model }, { e_umb23_model, kasa_umb23_model }, { e_umb24_model, kasa_umb24_model },
{ e_umb25_model, kasa_umb25_model }, { e_umb26_model, kasa_umb26_model }, { e_umb27_model, kasa_umb27_model },
{ e_umb28_model, kasa_umb28_model }, { e_umb29_model, kasa_umb29_model }, { e_umb30_model, kasa_umb30_model },
{ e_umb31_model, kasa_umb31_model }, { e_umb32_model, kasa_umb32_model }, { e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model }, { e_umb_w_model, kasa_umb_w_model }, { e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model }, { e_umb_w_model, kasa_umb_w_model }, { e_umb_w_model, kasa_umb_w_model },
{ e_umb_w_model, kasa_umb_w_model },
};
UMBRELLA_ACTOR* umbrella;
GRAPH* graph;
int umbrella_design_index;
int umbrella_name;
int tool_name;
UMBRELLA_MODEL* umbrella_model;
ACTOR* parent;
Gfx* gfx;
UMBRELLA_ACTOR* umbrella;
GRAPH* graph;
int umbrella_design_index;
int umbrella_name;
int tool_name;
UMBRELLA_MODEL* umbrella_model;
ACTOR* parent;
Gfx* gfx;
umbrella = (UMBRELLA_ACTOR*)actor;
parent = actor->parent_actor;
tool_name = umbrella->tools_class.tool_name;
graph = game->graph;
umbrella_model = &draw_dt[tool_name];
umbrella = (UMBRELLA_ACTOR*)actor;
parent = actor->parent_actor;
tool_name = umbrella->tools_class.tool_name;
graph = game->graph;
umbrella_model = &draw_dt[tool_name];
if (parent->drawn == FALSE || umbrella->tools_class.init_matrix == FALSE) {
return;
}
Matrix_put(&umbrella->tools_class.matrix_work);
Matrix_Position_Zero(&umbrella->tools_class.actor_class.world.position);
umbrella->tools_class.init_matrix = FALSE;
umbrella->tools_class.unk1BC = TRUE;
_texture_z_light_fog_prim_npc(graph);
OPEN_DISP(graph);
gfx = NOW_POLY_OPA_DISP;
Matrix_rotateXYZ(0, -0x4000, 0, TRUE);
Matrix_scale(umbrella->scale_e.x, umbrella->scale_e.y, umbrella->scale_e.z, TRUE);
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, umbrella_model->model_e);
Matrix_translate(4500.0f, 0.0f, 0.0f, TRUE);
Matrix_scale(umbrella->scale_kasa.x, umbrella->scale_kasa.y, umbrella->scale_kasa.z, TRUE);
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (tool_name >= TOOL_UMBRELLA32) {
umbrella_name = tool_name - TOOL_UMBRELLA32;
if (parent->part == ACTOR_PART_PLAYER) {
umbrella_name = (umbrella_name & 7);
gSPSegment(gfx++, G_MWO_SEGMENT_8, mNW_PaletteIdx2Palette(Player_Palette_Get(umbrella_name)));
gSPSegment(gfx++, G_MWO_SEGMENT_9, Player_Design_Get(umbrella_name));
if (parent->drawn == FALSE || umbrella->tools_class.init_matrix == FALSE) {
return;
}
else {
umbrella_name = umbrella_name & 3;
gSPSegment(gfx++, G_MWO_SEGMENT_8, mNW_PaletteIdx2Palette(Able_Sisters_Umbrella_Palette_Get(umbrella_name)));
gSPSegment(gfx++, G_MWO_SEGMENT_9, Able_Sisters_Umbrella_Design_Get(umbrella_name));
}
}
gSPDisplayList(gfx++, umbrella_model->model_kasa);
SET_POLY_OPA_DISP(gfx);
CLOSE_DISP(graph);
Matrix_put(&umbrella->tools_class.matrix_work);
Matrix_Position_Zero(&umbrella->tools_class.actor_class.world.position);
umbrella->tools_class.init_matrix = FALSE;
umbrella->tools_class.unk1BC = TRUE;
_texture_z_light_fog_prim_npc(graph);
OPEN_DISP(graph);
gfx = NOW_POLY_OPA_DISP;
Matrix_rotateXYZ(0, -0x4000, 0, TRUE);
Matrix_scale(umbrella->scale_e.x, umbrella->scale_e.y, umbrella->scale_e.z, TRUE);
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, umbrella_model->model_e);
Matrix_translate(4500.0f, 0.0f, 0.0f, TRUE);
Matrix_scale(umbrella->scale_kasa.x, umbrella->scale_kasa.y, umbrella->scale_kasa.z, TRUE);
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (tool_name >= TOOL_ORG_UMBRELLA0) {
umbrella_name = tool_name - TOOL_ORG_UMBRELLA0;
if (parent->part == ACTOR_PART_PLAYER) {
umbrella_name = (umbrella_name & 7);
gSPSegment(gfx++, G_MWO_SEGMENT_8, mNW_PaletteIdx2Palette(Player_Palette_Get(umbrella_name)));
gSPSegment(gfx++, G_MWO_SEGMENT_9, Player_Design_Get(umbrella_name));
} else {
umbrella_name = umbrella_name & 3;
gSPSegment(gfx++, G_MWO_SEGMENT_8,
mNW_PaletteIdx2Palette(Able_Sisters_Umbrella_Palette_Get(umbrella_name)));
gSPSegment(gfx++, G_MWO_SEGMENT_9, Able_Sisters_Umbrella_Design_Get(umbrella_name));
}
}
gSPDisplayList(gfx++, umbrella_model->model_kasa);
SET_POLY_OPA_DISP(gfx);
CLOSE_DISP(graph);
}
+2 -1
View File
@@ -76,7 +76,8 @@ static void aTnt_ChangeFg(ACTOR* actor, int type) {
if (mSN_ClearSnowman(name) == 0) {
int dug = FALSE;
if ((((*name >= BURIED_PITFALL_START) && (*name <= BURIED_PITFALL_END)) || (*name == SHINE_SPOT))) {
if ((((*name >= BURIED_PITFALL_HOLE_START) && (*name <= BURIED_PITFALL_HOLE_END)) ||
(*name == SHINE_SPOT))) {
dug = TRUE;
}
+51 -61
View File
@@ -10,7 +10,6 @@ static void aTOL_actor_dt(ACTOR*, GAME*);
static void aTOL_init_clip_area(GAME* play);
static void aTOL_free_clip_area();
ACTOR_PROFILE Tools_Profile = {
mAc_PROFILE_TOOLS,
ACTOR_PART_CONTROL,
@@ -25,124 +24,115 @@ ACTOR_PROFILE Tools_Profile = {
NULL,
};
aTOL_Clip_c aTOL_clip;
static void aTOL_actor_ct(ACTOR* actor, GAME* game){
aTOL_Clip_c aTOL_clip;
static void aTOL_actor_ct(ACTOR* actor, GAME* game) {
aTOL_init_clip_area(game);
}
static void aTOL_actor_dt(ACTOR*, GAME*){
static void aTOL_actor_dt(ACTOR*, GAME*) {
aTOL_free_clip_area();
}
static void aTOL_check_data_bank(int id, ACTOR* actor){
static void aTOL_check_data_bank(int id, ACTOR* actor) {
ACTOR* kill;
aTOL_Clip_c* clip;
if((actor->part == ACTOR_PART_PLAYER) && (id <= 0x1F)){
if ((actor->part == ACTOR_PART_PLAYER) && (id <= 0x1F)) {
clip = Common_Get(clip.tools_clip);
if(clip->bank_id != -1){
if (clip->bank_id != -1) {
kill = actor->child_actor;
if((kill != NULL) && (kill->data_bank_id == clip->bank_id)){
if ((kill != NULL) && (kill->data_bank_id == clip->bank_id)) {
Actor_delete(kill);
}
}
}
}
static TOOLS_ACTOR* aTOL_birth_proc(int name, int id, TOOLS_ACTOR* tool,
GAME_PLAY* play, s16 arg, int* arg5){
static ACTOR* aTOL_birth_proc(int name, int id, ACTOR* tool, GAME* game, s16 arg, int* arg5) {
static s16 profile_table[] = {
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_KEITAI, mAc_PROFILE_T_UTIWA, mAc_PROFILE_T_HANABI, mAc_PROFILE_T_CRACKER, mAc_PROFILE_T_PISTOL,
mAc_PROFILE_T_FLAG, mAc_PROFILE_T_TUMBLER, mAc_PROFILE_T_NPCSAO, mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA,
mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA, mAc_PROFILE_T_ANRIUM1, mAc_PROFILE_T_BAG1, mAc_PROFILE_T_BAG2,
mAc_PROFILE_T_BISCUS1, mAc_PROFILE_T_BISCUS2, mAc_PROFILE_T_BISCUS3, mAc_PROFILE_T_BISCUS4, mAc_PROFILE_T_HASU1,
mAc_PROFILE_T_HAT1, mAc_PROFILE_T_HAT2, mAc_PROFILE_T_HAT3, mAc_PROFILE_T_REI1, mAc_PROFILE_T_REI2,
mAc_PROFILE_T_ZINNIA1, mAc_PROFILE_T_ZINNIA2, mAc_PROFILE_T_COBRA1,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
mAc_PROFILE_T_KEITAI, mAc_PROFILE_T_UTIWA, mAc_PROFILE_T_HANABI, mAc_PROFILE_T_CRACKER,
mAc_PROFILE_T_PISTOL, mAc_PROFILE_T_FLAG, mAc_PROFILE_T_TUMBLER, mAc_PROFILE_T_NPCSAO,
mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA,
mAc_PROFILE_T_ANRIUM1, mAc_PROFILE_T_BAG1, mAc_PROFILE_T_BAG2, mAc_PROFILE_T_BISCUS1,
mAc_PROFILE_T_BISCUS2, mAc_PROFILE_T_BISCUS3, mAc_PROFILE_T_BISCUS4, mAc_PROFILE_T_HASU1,
mAc_PROFILE_T_HAT1, mAc_PROFILE_T_HAT2, mAc_PROFILE_T_HAT3, mAc_PROFILE_T_REI1,
mAc_PROFILE_T_REI2, mAc_PROFILE_T_ZINNIA1, mAc_PROFILE_T_ZINNIA2, mAc_PROFILE_T_COBRA1,
};
TOOLS_ACTOR* child;
GAME_PLAY* play = (GAME_PLAY*)game;
aTOL_check_data_bank(name, &tool->actor_class);
aTOL_check_data_bank(name, tool);
child = (TOOLS_ACTOR*)Actor_info_make_child_actor(&play->actor_info, &tool->actor_class, &play->game,
profile_table[name], 0.0f, 0.0f, 0.0f, 0, 0, 0, -1, 0, arg, -1);
child = (TOOLS_ACTOR*)Actor_info_make_child_actor(&play->actor_info, tool, game, profile_table[name], 0.0f, 0.0f,
0.0f, 0, 0, 0, -1, 0, arg, -1);
if(child != NULL){
if (child != NULL) {
child->work0 = id;
child->tool_name = name;
}
if(arg5 != NULL){
if (arg5 != NULL) {
*arg5 = -1;
}
return &child->actor_class;
}
static int aTOL_chg_request_mode_proc(ACTOR* actor ,TOOLS_ACTOR* tool, int id){
static int aTOL_chg_request_mode_proc(ACTOR* actor, ACTOR* tool, int id) {
TOOLS_ACTOR* t_actor = (TOOLS_ACTOR*)tool;
if(actor != tool->actor_class.parent_actor){
return 0;
if (actor != tool->parent_actor) {
return FALSE;
}
tool->work0 = id;
return 1;
t_actor->work0 = id;
return TRUE;
}
static void aTOL_secure_pl_umbrella_bank_area(GAME* game){
static void aTOL_secure_pl_umbrella_bank_area(GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
Object_Exchange_c* exchange;
int id;
exchange = &play->object_exchange;
id = exchange->bank_idx;
if(mSc_secure_exchange_keep_bank(exchange, 0, 0xC00) != NULL){
if (mSc_secure_exchange_keep_bank(exchange, 0, 0xC00) != NULL) {
Common_Set(clip.tools_clip->bank_id, id);
}
else{
} else {
Common_Set(clip.tools_clip->bank_id, -1);
}
}
static void aTOL_init_clip_area(GAME* game){
if(Common_Get(clip.tools_clip) == NULL){
static void aTOL_init_clip_area(GAME* game) {
if (Common_Get(clip.tools_clip) == NULL) {
Common_Set(clip.tools_clip, &aTOL_clip);
bzero(&aTOL_clip, sizeof(aTOL_Clip_c));
Common_Set(clip.tools_clip->aTOL_birth_proc,aTOL_birth_proc);
Common_Set(clip.tools_clip->aTOL_chg_request_mode_proc,aTOL_chg_request_mode_proc);
Common_Set(clip.tools_clip->aTOL_birth_proc, aTOL_birth_proc);
Common_Set(clip.tools_clip->aTOL_chg_request_mode_proc, aTOL_chg_request_mode_proc);
aTOL_secure_pl_umbrella_bank_area(game);
}
}
static void aTOL_free_clip_area(){
if(Common_Get(clip.tools_clip) != NULL){
static void aTOL_free_clip_area() {
if (Common_Get(clip.tools_clip) != NULL) {
Common_Set(clip.tools_clip, NULL);
}
}
}
+33 -33
View File
@@ -20,72 +20,72 @@ ACTOR_PROFILE TrainDoor_Profile = {
&aTRD_actor_dt,
&aTRD_actor_move,
&aTRD_actor_draw,
NULL
NULL,
};
extern cKF_Skeleton_R_c cKF_bs_r_obj_romtrain_door;
extern cKF_Animation_R_c cKF_ba_r_obj_romtrain_door;
static void aTRD_actor_ct(ACTOR* actor, GAME* game){
static void aTRD_actor_ct(ACTOR* actor, GAME* game) {
TRAINDOOR_ACTOR* traindoor = (TRAINDOOR_ACTOR*)actor;
cKF_SkeletonInfo_R_ct(&traindoor->keyframe, &cKF_bs_r_obj_romtrain_door, NULL, &traindoor->work, &traindoor->target);
cKF_SkeletonInfo_R_init(&traindoor->keyframe,traindoor->keyframe.skeleton, &cKF_ba_r_obj_romtrain_door,1.0f,51.0f,1.0f,
0.0f,0.0f,0,NULL);
traindoor->keyframe.morph_counter = 0.0f;
cKF_SkeletonInfo_R_play(&traindoor->keyframe);
cKF_SkeletonInfo_R_ct(&traindoor->common_actor_class.anime.keyframe, &cKF_bs_r_obj_romtrain_door, NULL,
traindoor->work, traindoor->target);
cKF_SkeletonInfo_R_init(&traindoor->common_actor_class.anime.keyframe,
traindoor->common_actor_class.anime.keyframe.skeleton, &cKF_ba_r_obj_romtrain_door, 1.0f,
51.0f, 1.0f, 0.0f, 0.0f, 0, NULL);
traindoor->common_actor_class.anime.keyframe.morph_counter = 0.0f;
cKF_SkeletonInfo_R_play(&traindoor->common_actor_class.anime.keyframe);
}
static void aTRD_actor_dt(ACTOR* actor, GAME* game){
static void aTRD_actor_dt(ACTOR* actor, GAME* game) {
TRAINDOOR_ACTOR* traindoor = (TRAINDOOR_ACTOR*)actor;
cKF_SkeletonInfo_R_dt(&traindoor->keyframe);
cKF_SkeletonInfo_R_dt(&traindoor->common_actor_class.anime.keyframe);
}
static void aTRD_set_door_SE(ACTOR* actor){
static void aTRD_set_door_SE(ACTOR* actor) {
TRAINDOOR_ACTOR* traindoor = (TRAINDOOR_ACTOR*)actor;
static f32 chk_pat[] = {2.0f, 27.0f};
static u16 se_no[] = {1042, 1043,0, 0,0,0, 0,0,0};
static f32 chk_pat[] = { 2.0f, 27.0f };
static u16 se_no[] = { NA_SE_TRAINDOOR0, NA_SE_TRAINDOOR1 };
int i;
for(i = 0; i < 2; i++){
if(cKF_FrameControl_passCheck_now(&traindoor->keyframe.frame_control,chk_pat[i]) != 0){
sAdo_OngenTrgStart(se_no[i], &traindoor->actor_class.world.position);
return;
for (i = 0; i < 2; i++) {
if (cKF_FrameControl_passCheck_now(&traindoor->common_actor_class.anime.keyframe.frame_control, chk_pat[i])) {
sAdo_OngenTrgStart(se_no[i], &traindoor->common_actor_class.actor_class.world.position);
break;
}
}
}
static void aTRD_actor_move(ACTOR* actor, GAME* game){
static void aTRD_actor_move(ACTOR* actor, GAME* game) {
TRAINDOOR_ACTOR* traindoor = (TRAINDOOR_ACTOR*)actor;
if(traindoor->idle == 1){
traindoor->idle = 0;
traindoor->keyframe.frame_control.speed = 0.5f;
if (traindoor->open_flag == TRUE) {
traindoor->open_flag = FALSE;
traindoor->common_actor_class.anime.keyframe.frame_control.speed = 0.5f;
}
if(cKF_SkeletonInfo_R_play(&traindoor->keyframe) == 1){
traindoor->keyframe.frame_control.current_frame = traindoor->keyframe.frame_control.start_frame;
traindoor->keyframe.frame_control.speed = 0.0f;
if (cKF_SkeletonInfo_R_play(&traindoor->common_actor_class.anime.keyframe) == cKF_FRAMECONTROL_REPEAT) {
traindoor->common_actor_class.anime.keyframe.frame_control.current_frame =
traindoor->common_actor_class.anime.keyframe.frame_control.start_frame;
traindoor->common_actor_class.anime.keyframe.frame_control.speed = 0.0f;
}
aTRD_set_door_SE(actor);
}
static void aTRD_actor_draw(ACTOR* actor, GAME* game){
static void aTRD_actor_draw(ACTOR* actor, GAME* game) {
TRAINDOOR_ACTOR* traindoor = (TRAINDOOR_ACTOR*)actor;
cKF_SkeletonInfo_R_c* keyf = &traindoor->keyframe;
Gfx* mtx;
cKF_SkeletonInfo_R_c* keyf = &traindoor->common_actor_class.anime.keyframe;
Mtx* mtxp;
mtx = GRAPH_ALLOC(game->graph, (u32) keyf->skeleton->num_shown_joints * 64);
mtxp = (Mtx*)mtx;
if(mtxp != NULL){
mtxp = GRAPH_ALLOC_TYPE(game->graph, Mtx, (u32)keyf->skeleton->num_shown_joints);
if (mtxp != NULL) {
_texture_z_light_fog_prim(game->graph);
texture_z_light_prim_xlu_disp(game->graph);
cKF_Si3_draw_R_SV(game,keyf, mtxp, NULL,NULL,NULL);
cKF_Si3_draw_R_SV(game, keyf, mtxp, NULL, NULL, NULL);
}
}
}
+286 -352
View File
@@ -7,175 +7,170 @@
#include "m_play.h"
#include "sys_matrix.h"
u16 aTrainWindow_tree_pal_table[15][16]= {
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0545,
0x9885,0xA0C5,
0xAD05,0xBD66,
0xCDE8,0xD2FA,
0xE77C,0xF3BE
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0655,
0x98C5,0xA105,
0xB165,0xC1E6,
0xD268,0xD2FA,
0xE77C,0xF3BE
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0464,
0x90C3,0x9504,
0xA184,0xAA05,
0xB287,0xD2FA,
0xE77C,0xF3BE
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0164,
0x80E5,0x8145,
0x89A4,0x9A60,
0xB300,0xD380,
0xEFE8,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0C37,
0xB086,0xC8A7,
0xE0C7,0xF109,
0xF98C,0xFE10,
0xFF18,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0066,
0x80C9,0x8127,
0x8186,0x8202,
0x82C1,0x9380,
0xCBE8,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0058,
0x80C9,0x80E8,
0x8148,0x81C8,
0x8268,0x9326,
0xC3EB,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0353,
0x8CC2,0x9102,
0x9963,0xA5C4,
0xB242,0xC6E4,
0xDB88,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0564,
0x90C5,0x9924,
0xA984,0xBA03,
0xD2A3,0xE304,
0xEF6A,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0842,
0xA463,0xB4A2,
0xC502,0xD961,
0xE9E1,0xF682,
0xFF26,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0814,
0xB024,0xC044,
0xCC85,0xE0C6,
0xF128,0xFE0B,
0xFEEB,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0734,
0xA484,0xAC83,
0xBCC4,0xD503,
0xE985,0xF629,
0xFF0E,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0635,
0xA085,0xA8C5,
0xB505,0xC566,
0xD5E8,0xEE8A,
0xFF2C,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0545,
0x9885,0xA0C5,
0xAD05,0xBD66,
0xCDE8,0xD2FA,
0xE77C,0xF3BE
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0545,
0x9885,0xA0C5,
0xAD05,0xBD66,
0xCDE8,0xD2FA,
0xE77C,0xF3BE
}
// clang-format off
static u16 aTrainWindow_tree_pal_table[15][16] ATTRIBUTE_ALIGN(32) = {
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0545,
0x9885,0xA0C5,
0xAD05,0xBD66,
0xCDE8,0xD2FA,
0xE77C,0xF3BE
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0655,
0x98C5,0xA105,
0xB165,0xC1E6,
0xD268,0xD2FA,
0xE77C,0xF3BE
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0464,
0x90C3,0x9504,
0xA184,0xAA05,
0xB287,0xD2FA,
0xE77C,0xF3BE
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0164,
0x80E5,0x8145,
0x89A4,0x9A60,
0xB300,0xD380,
0xEFE8,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0C37,
0xB086,0xC8A7,
0xE0C7,0xF109,
0xF98C,0xFE10,
0xFF18,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0066,
0x80C9,0x8127,
0x8186,0x8202,
0x82C1,0x9380,
0xCBE8,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0058,
0x80C9,0x80E8,
0x8148,0x81C8,
0x8268,0x9326,
0xC3EB,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0353,
0x8CC2,0x9102,
0x9963,0xA5C4,
0xB242,0xC6E4,
0xDB88,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0564,
0x90C5,0x9924,
0xA984,0xBA03,
0xD2A3,0xE304,
0xEF6A,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0842,
0xA463,0xB4A2,
0xC502,0xD961,
0xE9E1,0xF682,
0xFF26,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0814,
0xB024,0xC044,
0xCC85,0xE0C6,
0xF128,0xFE0B,
0xFEEB,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0734,
0xA484,0xAC83,
0xBCC4,0xD503,
0xE985,0xF629,
0xFF0E,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0635,
0xA085,0xA8C5,
0xB505,0xC566,
0xD5E8,0xEE8A,
0xFF2C,0x8000
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0545,
0x9885,0xA0C5,
0xAD05,0xBD66,
0xCDE8,0xD2FA,
0xE77C,0xF3BE
},
{
0x0724,0xA443,
0xBCA4,0xDD25,
0xF5E7,0xF209,
0xFECD,0x0545,
0x9885,0xA0C5,
0xAD05,0xBD66,
0xCDE8,0xD2FA,
0xE77C,0xF3BE
},
};
// clang-format on
EVW_ANIME_SCROLL aTrainWindow_out_cloud = {
0, -2,
64, 64
};
static EVW_ANIME_SCROLL aTrainWindow_out_cloud = { 0, -2, 64, 64 };
EVW_ANIME_DATA aTrainWindow_evw_anime_data = {
-2, EVW_ANIME_TYPE_SCROLL1, &aTrainWindow_out_cloud
};
static EVW_ANIME_DATA aTrainWindow_evw_anime_data = { -2, EVW_ANIME_TYPE_SCROLL1, &aTrainWindow_out_cloud };
static void Train_Window_Actor_ct(ACTOR*, GAME*);
static void Train_Window_Actor_dt(ACTOR*, GAME*);
static void Train_Window_Actor_move(ACTOR*, GAME*);
static void Train_Window_Actor_draw(ACTOR*, GAME*);
ACTOR_PROFILE Train_Window_Profile = {
mAc_PROFILE_TRAIN_WINDOW,
ACTOR_PART_ITEM,
@@ -187,10 +182,9 @@ ACTOR_PROFILE Train_Window_Profile = {
&Train_Window_Actor_dt,
&Train_Window_Actor_move,
&Train_Window_Actor_draw,
NULL
NULL,
};
static int aTrainWindow_NoDraw(ACTOR*, GAME*);
static int aTrainWindow_DrawGoneOutTunnel(ACTOR*, GAME*);
static int aTrainWindow_DrawInTunnel(ACTOR*, GAME*);
@@ -201,83 +195,37 @@ extern Gfx rom_train_out_bgcloud_modelT[];
extern Gfx rom_train_out_bgtree_modelT[];
extern Gfx rom_train_out_shineglass_modelT[];
static int aTrainWindow_GetTreePalletIdx(){
static int aTrainWindow_GetTreePalletIdx() {
static u8 till_data[15][2] = {
{
0x02,0x03
},
{
0x02,0x11
},
{
0x02,0x18
},
{
0x04,0x03
},
{
0x04,0x08
},
{
0x07,0x16
},
{
0x09,0x0F
},
{
0x0A,0x05
},
{
0x0A,0x17
},
{
0x0B,0x07
},
{
0x0B,0x0E
},
{
0x0B,0x1C
},
{
0x0C,0x0A
},
{
0x0C,0x11
},
{
0x0C,0x1F
}
{ 0x02, 0x03 }, { 0x02, 0x11 }, { 0x02, 0x18 }, { 0x04, 0x03 }, { 0x04, 0x08 },
{ 0x07, 0x16 }, { 0x09, 0x0F }, { 0x0A, 0x05 }, { 0x0A, 0x17 }, { 0x0B, 0x07 },
{ 0x0B, 0x0E }, { 0x0B, 0x1C }, { 0x0C, 0x0A }, { 0x0C, 0x11 }, { 0x0C, 0x1F },
};
int i;
lbRTC_month_t month = Common_Get(time.rtc_time.month);
lbRTC_day_t day = Common_Get(time.rtc_time.day);
for(i = 0; i < 15; i++){
for (i = 0; i < 15; i++) {
if (month < till_data[i][0]) {
return i;
}
if (month == till_data[i][0] && day <= till_data[i][1]) {
return i;
}
}
return 0;
}
static void Train_Window_Actor_ct(ACTOR* actor, GAME* game) {
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR*)actor;
static void Train_Window_Actor_ct(ACTOR* actor, GAME* game){
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR* )actor;
switch(Save_Get(scene_no)){
case 49:
case 15:
window->draw_type = aTrainWindow_NoDraw;
switch (Save_Get(scene_no)) {
case SCENE_START_DEMO:
case SCENE_START_DEMO3:
window->draw_type = &aTrainWindow_NoDraw;
window->Single_Scrollx = 0;
window->Single_Scrolly = 0;
window->Two_Scrollx1 = 0;
@@ -285,10 +233,10 @@ static void Train_Window_Actor_ct(ACTOR* actor, GAME* game){
window->Two_Scrollx2 = 0;
window->Two_Scrolly2 = 0;
window->scroll_speed = 0.07f;
break;
break;
case 16:
window->draw_type = aTrainWindow_DrawGoneOutTunnel;
case SCENE_START_DEMO2:
window->draw_type = &aTrainWindow_DrawGoneOutTunnel;
window->Single_Scrollx = 1000;
window->Single_Scrolly = 0;
window->Two_Scrollx1 = 1000;
@@ -296,7 +244,7 @@ static void Train_Window_Actor_ct(ACTOR* actor, GAME* game){
window->Two_Scrollx2 = 0;
window->Two_Scrolly2 = 0;
window->scroll_speed = 1.0f;
break;
break;
}
window->pallete_id = aTrainWindow_GetTreePalletIdx();
window->current_pallete = aTrainWindow_tree_pal_table[window->pallete_id];
@@ -304,72 +252,66 @@ static void Train_Window_Actor_ct(ACTOR* actor, GAME* game){
window->TreeScrolly = 0;
window->pos.x = 0;
window->pos.y = 0;
window->pos.z = 0;
window->pos.z = 0;
window->xlu_alpha = 254.0f;
}
static void Train_Window_Actor_dt(ACTOR* actor, GAME* game){
static void Train_Window_Actor_dt(ACTOR* actor, GAME* game) {
}
static u8 aTW_GetNowAlpha(){
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)){
if(Common_Get(time.now_sec) < 43200){
static u8 aTW_GetNowAlpha() {
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
if (Common_Get(time.now_sec) < 43200) {
return 255.0f * ((f32)(Common_Get(time.now_sec) - 14400) / 28800.0f);
}
return 255.0f * (1.0f - ((f32)(Common_Get(time.now_sec) - 43200) / 28800.0f));
}
else if(Common_Get(time.now_sec) < 14400) {
} else if (Common_Get(time.now_sec) < 14400) {
return 200.0f * (1.0f - (0.5f + ((f32)Common_Get(time.now_sec) / 28800.0f)));
}
else{
return 200.0f * ((f32)Common_Get(time.now_sec - 72000) / 28800.0f);
} else {
return 200.0f * ((f32)Common_Get(time.now_sec - 72000) / 28800.0f);
}
}
static void Train_Window_Actor_move(ACTOR* actor, GAME* game){
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR* )actor;
static void Train_Window_Actor_move(ACTOR* actor, GAME* game) {
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR*)actor;
f32 alpha;
window->TreeScrollx += 5;
add_calc(&window->xlu_alpha, aTW_GetNowAlpha(), window->scroll_speed, 50.0f, 1.0f);
if((Common_Get(time.now_sec) < 14400) || (Common_Get(time.now_sec) >= 72000)){
if ((Common_Get(time.now_sec) < 14400) || (Common_Get(time.now_sec) >= 72000)) {
alpha = 0.0f;
}
else if(Common_Get(time.now_sec) >= 43200){
} else if (Common_Get(time.now_sec) >= 43200) {
alpha = 160.0f + (-160.0f * ((f32)(Common_Get(time.now_sec) - 43200) / 28800.0f));
}
else{
alpha = 160.0f * ((f32)(Common_Get(time.now_sec) -14400) / 28800.0f);
} else {
alpha = 160.0f * ((f32)(Common_Get(time.now_sec) - 14400) / 28800.0f);
}
add_calc(&window->lod_factor, alpha, 0.3f, 50.0f, 1.0f);
}
static int aTrainWindow_OperateScrollLimit(int a, int b, int c){
b >>= 1;
if(b != 0){
if(b > 0){
if(a+b > c){
static int aTrainWindow_OperateScrollLimit(int a, int b, int c) {
b >>= 1;
if (b != 0) {
if (b > 0) {
if (a + b > c) {
return c;
}
return a+b;
return a + b;
}
if(b >= 0){
return a;
if (b >= 0) {
return a;
}
if(a+b < c){
if (a + b < c) {
return c;
}
return a+b;
return a + b;
}
return a;
}
static Gfx* aTrainWindow_TileScroll(u32* x, u32* y, int xamt,int yamt, int xend, int yend,
int width, int height, GRAPH** graph){
static Gfx* aTrainWindow_TileScroll(u32* x, u32* y, int xamt, int yamt, int xend, int yend, int width, int height,
GRAPH** graph) {
*x = aTrainWindow_OperateScrollLimit(*x, xamt, xend);
*y = aTrainWindow_OperateScrollLimit(*y, yamt, yend);
@@ -377,9 +319,9 @@ int width, int height, GRAPH** graph){
return tex_scroll2(*graph, *x, *y, width, height);
}
static Gfx* aTrainWindow_TileScroll2(u32* x1, u32* y1, int x1amt, int y1amt, int x1end, int y1end, int width1, int height1,
u32* x2, u32* y2, int x2amt, int y2amt, int x2end, int y2end, int width2, int height2, GRAPH** graph){
static Gfx* aTrainWindow_TileScroll2(u32* x1, u32* y1, int x1amt, int y1amt, int x1end, int y1end, int width1,
int height1, u32* x2, u32* y2, int x2amt, int y2amt, int x2end, int y2end,
int width2, int height2, GRAPH** graph) {
*x1 = aTrainWindow_OperateScrollLimit(*x1, x1amt, x1end);
*y1 = aTrainWindow_OperateScrollLimit(*y1, y1amt, y1end);
@@ -389,22 +331,20 @@ u32* x2, u32* y2, int x2amt, int y2amt, int x2end, int y2end, int width2, int he
return two_tex_scroll(*graph, 0, *x1, *y1, width1, height1, 1, *x2, *y2, width2, height2);
}
static int aTrainWindow_DrawGoneOutTunnel(ACTOR* actor, GAME* game){
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR* )actor;
static int aTrainWindow_DrawGoneOutTunnel(ACTOR* actor, GAME* game) {
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR*)actor;
GRAPH** graph = &game->graph;
Gfx* ssc;
Gfx* tsc;
ssc = aTrainWindow_TileScroll(&window->Single_Scrollx,&window->Single_Scrolly,
0,0,1000,0, 64, 32, graph);
tsc = aTrainWindow_TileScroll2(&window->Two_Scrollx1, &window->Two_Scrolly1, 0,0,1000, 0, 64, 8,
&window->Two_Scrollx2, &window->Two_Scrolly2, 0,0,0,0,16,16,graph);
if((ssc == NULL) || (tsc == NULL)){
ssc = aTrainWindow_TileScroll(&window->Single_Scrollx, &window->Single_Scrolly, 0, 0, 1000, 0, 64, 32, graph);
tsc = aTrainWindow_TileScroll2(&window->Two_Scrollx1, &window->Two_Scrolly1, 0, 0, 1000, 0, 64, 8,
&window->Two_Scrollx2, &window->Two_Scrolly2, 0, 0, 0, 0, 16, 16, graph);
if ((ssc == NULL) || (tsc == NULL)) {
return 0;
}
else{
} else {
OPEN_DISP(*graph);
gSPSegment(NOW_POLY_OPA_DISP++, 11, ssc);
@@ -412,7 +352,7 @@ static int aTrainWindow_DrawGoneOutTunnel(ACTOR* actor, GAME* game){
gSPSegment(NOW_POLY_OPA_DISP++, 12, tsc);
gSPSegment(NOW_POLY_XLU_DISP++, 12, tsc);
CLOSE_DISP(*graph);
return 1;
@@ -420,21 +360,19 @@ static int aTrainWindow_DrawGoneOutTunnel(ACTOR* actor, GAME* game){
}
static int aTrainWindow_DrawGoingOutTunnel(ACTOR* actor, GAME* game) {
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR* )actor;
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR*)actor;
Gfx* tsc;
Gfx* ssc;
GRAPH** graph = &game->graph;
ssc = aTrainWindow_TileScroll(&window->Single_Scrollx,&window->Single_Scrolly,
30,0,1000,0, 64, 32, graph);
tsc = aTrainWindow_TileScroll2(&window->Two_Scrollx1, &window->Two_Scrolly1, 30,0,1000, 0, 64, 8,
&window->Two_Scrollx2, &window->Two_Scrolly2, 0,0,0,0,16,16,graph);
if((ssc == NULL) || (tsc == NULL)){
ssc = aTrainWindow_TileScroll(&window->Single_Scrollx, &window->Single_Scrolly, 30, 0, 1000, 0, 64, 32, graph);
tsc = aTrainWindow_TileScroll2(&window->Two_Scrollx1, &window->Two_Scrolly1, 30, 0, 1000, 0, 64, 8,
&window->Two_Scrollx2, &window->Two_Scrolly2, 0, 0, 0, 0, 16, 16, graph);
if ((ssc == NULL) || (tsc == NULL)) {
return 0;
}
else{
} else {
OPEN_DISP(*graph);
gSPSegment(NOW_POLY_OPA_DISP++, 11, ssc);
@@ -442,10 +380,10 @@ static int aTrainWindow_DrawGoingOutTunnel(ACTOR* actor, GAME* game) {
gSPSegment(NOW_POLY_OPA_DISP++, 12, tsc);
gSPSegment(NOW_POLY_XLU_DISP++, 12, tsc);
CLOSE_DISP(*graph);
if(((int)window->Single_Scrollx == 1000) && ((int)window->Two_Scrollx1 == 1000)){
if (((int)window->Single_Scrollx == 1000) && ((int)window->Two_Scrollx1 == 1000)) {
window->draw_type = aTrainWindow_DrawGoneOutTunnel;
window->pallete_id = aTrainWindow_GetTreePalletIdx();
window->current_pallete = aTrainWindow_tree_pal_table[window->pallete_id];
@@ -455,28 +393,26 @@ static int aTrainWindow_DrawGoingOutTunnel(ACTOR* actor, GAME* game) {
}
}
static int aTrainWindow_NoDraw(ACTOR* actor, GAME* game){
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR* )actor;
static int aTrainWindow_NoDraw(ACTOR* actor, GAME* game) {
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR*)actor;
window->draw_type = aTrainWindow_DrawInTunnel;
return 0;
}
static int aTrainWindow_DrawInTunnel(ACTOR* actor, GAME* game){
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR* )actor;
static int aTrainWindow_DrawInTunnel(ACTOR* actor, GAME* game) {
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR*)actor;
Gfx* tsc;
Gfx* ssc;
GRAPH** graph = &game->graph;
ssc = aTrainWindow_TileScroll(&window->Single_Scrollx,&window->Single_Scrolly,
0,0,1000,0, 64, 32, graph);
tsc = aTrainWindow_TileScroll2(&window->Two_Scrollx1, &window->Two_Scrolly1, 0,0,1000, 0, 64, 8,
&window->Two_Scrollx2, &window->Two_Scrolly2, 0,0,0,0,16,16,graph);
if((ssc == NULL) || (tsc == NULL)){
ssc = aTrainWindow_TileScroll(&window->Single_Scrollx, &window->Single_Scrolly, 0, 0, 1000, 0, 64, 32, graph);
tsc = aTrainWindow_TileScroll2(&window->Two_Scrollx1, &window->Two_Scrolly1, 0, 0, 1000, 0, 64, 8,
&window->Two_Scrollx2, &window->Two_Scrolly2, 0, 0, 0, 0, 16, 16, graph);
if ((ssc == NULL) || (tsc == NULL)) {
return 0;
}
else{
} else {
OPEN_DISP(*graph);
gSPSegment(NOW_POLY_OPA_DISP++, 11, ssc);
@@ -484,96 +420,94 @@ static int aTrainWindow_DrawInTunnel(ACTOR* actor, GAME* game){
gSPSegment(NOW_POLY_OPA_DISP++, 12, tsc);
gSPSegment(NOW_POLY_XLU_DISP++, 12, tsc);
CLOSE_DISP(*graph);
if(Common_Get(sunlight_flag) != 0){
if (Common_Get(sunlight_flag) != 0) {
window->pallete_id = aTrainWindow_GetTreePalletIdx();
window->current_pallete = aTrainWindow_tree_pal_table[window->pallete_id];
window->draw_type = aTrainWindow_DrawGoingOutTunnel;
}
return 1;
}
}
static void aTrainWindow_SetLightPrimColorDetail(GAME* game, u32 r, u32 g, u32 b, int l, int poly_a, int xlu_a){
static void aTrainWindow_SetLightPrimColorDetail(GAME* game, u32 r, u32 g, u32 b, int l, int poly_a, int xlu_a) {
GAME_PLAY* play = (GAME_PLAY*)game;
int i;
int current_color;
u8 color[3];
GRAPH* graph;
for(i = 0; i < 3; i++){
for (i = 0; i < 3; i++) {
current_color = play->global_light.ambientColor[i] + play->kankyo.base_light.sun_color[i];
switch(i){
switch (i) {
case 0:
current_color += r;
break;
break;
case 1:
current_color += g;
break;
break;
case 2:
current_color += b;
break;
break;
}
if(current_color < 0){
if (current_color < 0) {
current_color = 0;
}else if(current_color >= 256){
} else if (current_color >= 256) {
current_color = 255;
}
color[i] = current_color;
}
if(l < 0){
if (l < 0) {
l = 0;
}else if(l > 255){
} else if (l > 255) {
l = 255;
}
if(poly_a < 0){
if (poly_a < 0) {
poly_a = 0;
}else if(poly_a > 255){
} else if (poly_a > 255) {
poly_a = 255;
}
if(xlu_a < 0){
if (xlu_a < 0) {
xlu_a = 0;
}else if(xlu_a > 255){
} else if (xlu_a > 255) {
xlu_a = 255;
}
graph = play->game.graph;
OPEN_DISP(graph);
OPEN_DISP(graph);
gDPSetPrimColor(NOW_POLY_OPA_DISP++, 0, l, color[0], color[1], color[2], poly_a);
gDPSetPrimColor(NOW_POLY_XLU_DISP++, 0, l, color[0], color[1], color[2], xlu_a);
gDPSetPrimColor(NOW_POLY_XLU_DISP++, 0, l, color[0], color[1], color[2], xlu_a);
CLOSE_DISP(graph);
}
static void aTrainWindow_SetTreeTextureScroll(ACTOR* actor, GAME* game){
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR* )actor;
static void aTrainWindow_SetTreeTextureScroll(ACTOR* actor, GAME* game) {
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR*)actor;
Gfx* tree;
GRAPH** graph = &game->graph;
tree = tex_scroll2(*graph, window->TreeScrollx, window->TreeScrolly, 128, 32);
OPEN_DISP(*graph);
OPEN_DISP(*graph);
gSPSegment(NOW_POLY_OPA_DISP++, 8, tree);
gSPSegment(NOW_POLY_XLU_DISP++, 8, tree);
gSPSegment(NOW_POLY_OPA_DISP++,8, tree);
gSPSegment(NOW_POLY_XLU_DISP++,8, tree);
CLOSE_DISP(*graph);
}
static void Train_Window_Actor_draw(ACTOR* actor, GAME* game){
static void Train_Window_Actor_draw(ACTOR* actor, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR* )actor;
TRAIN_WINDOW_ACTOR* window = (TRAIN_WINDOW_ACTOR*)actor;
GRAPH* graph = game->graph;
Matrix_translate(0.0f,0.0f,0.0f,FALSE);
Matrix_translate(0.0f, 0.0f, 0.0f, FALSE);
Matrix_scale(0.05f, 0.05f, 0.05f, TRUE);
OPEN_DISP(graph);
gSPMatrix(NOW_POLY_OPA_DISP++, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -582,23 +516,23 @@ static void Train_Window_Actor_draw(ACTOR* actor, GAME* game){
_texture_z_light_fog_prim(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
if(window->draw_type(actor,game) != 0){
aTrainWindow_SetLightPrimColorDetail(game, 0,0,0,127,255,(u8)window->xlu_alpha);
gSPSegment(NOW_POLY_XLU_DISP++,10, window->current_pallete);
Evw_Anime_Set(play, &aTrainWindow_evw_anime_data);
aTrainWindow_SetLightPrimColorDetail(game,0,0,0,43,255,window->xlu_alpha);
gSPDisplayList(NOW_POLY_OPA_DISP++,rom_train_out_tunnel_model);
aTrainWindow_SetLightPrimColorDetail(game,0,0,0,127,255,window->xlu_alpha);
gSPDisplayList(NOW_POLY_OPA_DISP++,rom_train_out_bgsky_model);
aTrainWindow_SetLightPrimColorDetail(game,0,0,0,127,255,window->xlu_alpha);
gSPDisplayList(NOW_POLY_XLU_DISP++,rom_train_out_bgcloud_modelT);
if (window->draw_type(actor, game) != 0) {
aTrainWindow_SetLightPrimColorDetail(game, 0, 0, 0, 127, 255, (u8)window->xlu_alpha);
gSPSegment(NOW_POLY_XLU_DISP++, 10, window->current_pallete);
Evw_Anime_Set(play, &aTrainWindow_evw_anime_data);
aTrainWindow_SetLightPrimColorDetail(game, 0, 0, 0, 43, 255, window->xlu_alpha);
gSPDisplayList(NOW_POLY_OPA_DISP++, rom_train_out_tunnel_model);
aTrainWindow_SetLightPrimColorDetail(game, 0, 0, 0, 127, 255, window->xlu_alpha);
gSPDisplayList(NOW_POLY_OPA_DISP++, rom_train_out_bgsky_model);
aTrainWindow_SetLightPrimColorDetail(game, 0, 0, 0, 127, 255, window->xlu_alpha);
gSPDisplayList(NOW_POLY_XLU_DISP++, rom_train_out_bgcloud_modelT);
aTrainWindow_SetTreeTextureScroll(actor, game);
aTrainWindow_SetLightPrimColorDetail(game, GETREG(CRV, CRV_DEBUG_RED_VALUE) -80 ,GETREG(CRV, CRV_DEBUG_GREEN_VALUE) -70 ,GETREG(CRV, CRV_DEBUG_BLUE_VALUE) -160, GETREG(CRV,CRV_DEBUG_LOD_VALUE) + 27,255, window->xlu_alpha);
gSPDisplayList(NOW_POLY_XLU_DISP++,rom_train_out_bgtree_modelT);
aTrainWindow_SetLightPrimColorDetail(game,0,0,0,window->lod_factor,255,window->xlu_alpha);
gSPDisplayList(NOW_POLY_XLU_DISP++,rom_train_out_shineglass_modelT);
aTrainWindow_SetLightPrimColorDetail(
game, GETREG(CRV, CRV_DEBUG_RED_VALUE) - 80, GETREG(CRV, CRV_DEBUG_GREEN_VALUE) - 70,
GETREG(CRV, CRV_DEBUG_BLUE_VALUE) - 160, GETREG(CRV, CRV_DEBUG_LOD_VALUE) + 27, 255, window->xlu_alpha);
gSPDisplayList(NOW_POLY_XLU_DISP++, rom_train_out_bgtree_modelT);
aTrainWindow_SetLightPrimColorDetail(game, 0, 0, 0, window->lod_factor, 255, window->xlu_alpha);
gSPDisplayList(NOW_POLY_XLU_DISP++, rom_train_out_shineglass_modelT);
}
CLOSE_DISP(graph);
}
}
+117
View File
@@ -0,0 +1,117 @@
#include "ac_uki.h"
#include "m_play.h"
#include "m_name_table.h"
#include "ac_set_ovl_gyoei.h"
#include "m_vibctl.h"
#include "m_common_data.h"
#include "ef_effect_control.h"
#include "m_player_lib.h"
#include "sys_matrix.h"
#include "m_actor_shadow.h"
enum {
aUKI_PROC_CARRY,
aUKI_PROC_READY,
aUKI_PROC_AIR,
aUKI_PROC_CAST,
aUKI_PROC_WAIT,
aUKI_PROC_HIT,
aUKI_PROC_TOUCH,
aUKI_PROC_BITE,
aUKI_PROC_CATCH,
aUKI_PROC_GET,
aUKI_PROC_FORCE,
aUKI_PROC_NUM
};
static void aUKI_actor_ct(ACTOR* actorx, GAME* game);
static void aUKI_actor_dt(ACTOR* actorx, GAME* game);
static void aUKI_actor_move(ACTOR* actorx, GAME* game);
static void aUKI_actor_draw(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Uki_Profile = {
mAc_PROFILE_UKI,
ACTOR_PART_BG,
ACTOR_STATE_NO_MOVE_WHILE_CULLED,
ETC_UKI,
ACTOR_OBJ_BANK_UKI,
sizeof(UKI_ACTOR),
&aUKI_actor_ct,
&aUKI_actor_dt,
&aUKI_actor_move,
NULL,
NULL,
};
// clang-format on
// clang-format off
static ClObjPipeData_c aUKI_CoInfoData = {
0x3D, 0x20, ClObj_TYPE_PIPE,
0x01,
8, 8, 0, 0, 0, 0,
};
// clang-format on
static StatusData_c aUKI_StatusData = { 0, 8, 8, 0, 50 };
#include "../src/ac_gyoei_type.c_inc"
typedef struct uki_vib_s {
int n_frames;
int attack_frames;
int sustain_frames;
int release_frames;
} aUKI_vib_c;
static void aUKI_set_value(ACTOR* actorx, xyz_t pos, xyz_t pos_speed, int angle_speed_y, int command);
static mActor_name_t aUKI_get_fish_type(ACTOR* actorx);
static void aUKI_set_proc(ACTOR* actorx, GAME* game, int proc, int arg);
static void aUKI_actor_ct(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
Shape_Info_init(actorx, 0.0, &mAc_ActorShadowEllipse, 4.5, 8.5);
actorx->shape_info.draw_shadow = FALSE;
ClObjPipe_ct(game, &uki->col_pipe);
ClObjPipe_set5(game, &uki->col_pipe, actorx, &aUKI_CoInfoData);
CollisionCheck_Status_set3(&actorx->status_data, &aUKI_StatusData);
actorx->max_velocity_y = -20.0;
actorx->gravity = 1.2;
actorx->speed = 0.0;
uki->_194 = 0.0;
Matrix_copy_MtxF(&uki->mtxf, &MtxF_clear);
actorx->scale.x = 0.01;
actorx->scale.y = 0.01;
actorx->scale.z = 0.01;
actorx->world.position = uki->right_hand_pos;
uki->set_value_proc = &aUKI_set_value;
uki->get_fish_type_proc = &aUKI_get_fish_type;
uki->child_actor = NULL;
uki->frame_timer = 2;
uki->cast_timer = 0;
uki->touch_timer = 0;
uki->touched_flag = FALSE;
uki->hit_water_flag = FALSE;
uki->gyo_type = -1;
uki->color[0] = 255;
uki->color[1] = 255;
uki->color[2] = 255;
uki->gyo_command = 0;
uki->gyo_status = 0;
uki->status = aUKI_STATUS_CARRY;
uki->proc = aUKI_PROC_CARRY;
uki->coast_flag = FALSE;
uki->_2B5 = 0;
}
static void aUKI_actor_dt(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
ClObjPipe_dt(game, &uki->col_pipe);
}
#include "../src/ac_uki_move.c_inc"
#include "../src/ac_uki_draw.c_inc"
+90
View File
@@ -0,0 +1,90 @@
static void aUKI_rotate_calc(UKI_ACTOR* uki) {
f32 angle_x = (uki->position_speed.x * 30.0f) / 6.0f;
f32 angle_z = (uki->position_speed.z * 30.0f) / 6.0f;
f32 sin = sin_s(uki->uki_rot_speed);
uki->uki_angle.x = DEG2SHORT_ANGLE2(180.0f + (angle_x * sin));
uki->uki_angle.z = DEG2SHORT_ANGLE2(180.0f + (angle_z * sin));
uki->uki_rot_speed += DEG2SHORT_ANGLE2(5.625f);
}
extern Gfx tol_uki1_model[];
extern Gfx tol_uki2_model[];
static void aUKI_actor_draw(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
ACTOR* player_actor = GET_PLAYER_ACTOR_GAME_ACTOR(game);
GRAPH* graph = game->graph;
mActor_name_t item;
OPEN_POLY_OPA_DISP(graph);
Matrix_mult(&uki->mtxf, 1);
gDPPipeSync(POLY_OPA_DISP++);
switch (uki->proc) {
case aUKI_PROC_CARRY:
aUKI_rotate_calc(uki);
Matrix_RotateY(player_actor->shape_info.rotation.y, 1);
break;
case aUKI_PROC_READY:
case aUKI_PROC_AIR:
uki->uki_angle.x = search_position_angleX(&actorx->world.position, &uki->rod_top_position);
uki->uki_angle.y = search_position_angleY(&actorx->world.position, &uki->rod_top_position);
uki->uki_angle.x += DEG2SHORT_ANGLE2(180.0f);
Matrix_RotateY(uki->uki_angle.y, 1);
Matrix_RotateX(uki->uki_angle.x, 1);
break;
case aUKI_PROC_CAST:
add_calc_short_angle2(&uki->uki_angle.x, DEG2SHORT_ANGLE2(90.0f), 1.0f - sqrtf(0.95f), 1024, 0);
uki->uki_angle.y = search_position_angleY(&actorx->world.position, &uki->rod_top_position);
Matrix_RotateY(uki->uki_angle.y, 1);
Matrix_RotateX(uki->uki_angle.x, 1);
break;
case aUKI_PROC_HIT:
uki->uki_angle.y = search_position_angleY(&actorx->world.position, &uki->rod_top_position);
if (uki->frame_timer < 10) {
add_calc_short_angle2(&uki->uki_angle.x, DEG2SHORT_ANGLE2(0.0f), 1.0f - sqrtf(0.9f), 2048, 0);
} else {
uki->uki_angle.x = search_position_angleX(&actorx->world.position, &uki->rod_top_position);
uki->uki_angle.x += DEG2SHORT_ANGLE2(-90.0f);
}
Matrix_RotateY(uki->uki_angle.y, 1);
Matrix_RotateX(uki->uki_angle.x, 1);
break;
case aUKI_PROC_WAIT:
if (uki->cast_timer == 0) {
add_calc_short_angle2(&uki->uki_angle.x, DEG2SHORT_ANGLE2(0.0f), 1.0f - sqrtf(0.8f),
DEG2SHORT_ANGLE2(45.0f), 0);
} else {
add_calc_short_angle2(&uki->uki_angle.x, DEG2SHORT_ANGLE2(90.0f), 1.0f - sqrtf(0.95f), 1024, 0);
}
uki->uki_angle.y = search_position_angleY(&actorx->world.position, &uki->rod_top_position);
Matrix_RotateY(uki->uki_angle.y, 1);
Matrix_RotateX(uki->uki_angle.x, 1);
break;
case aUKI_PROC_BITE:
if (uki->gyo_status == 4) {
add_calc_short_angle2(&uki->uki_angle.x, DEG2SHORT_ANGLE2(-90.0f), 1.0f - sqrtf(0.95f), 1024, 0);
Matrix_RotateY(uki->uki_angle.y, 1);
}
break;
}
gSPMatrix(POLY_OPA_DISP++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 128, uki->color[0], uki->color[1], uki->color[2], 255);
if (mEv_CheckTitleDemo() > 0) {
item = mPlib_Get_controller_data_for_title_demo_p()->equipped_item;
} else {
item = Now_Private->equipment;
}
if (item == ITM_ROD) {
gSPDisplayList(POLY_OPA_DISP++, tol_uki1_model);
} else {
gSPDisplayList(POLY_OPA_DISP++, tol_uki2_model);
}
CLOSE_POLY_OPA_DISP(graph);
}
+991
View File
@@ -0,0 +1,991 @@
static void set_collision(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
CollisionCheck_Uty_ActorWorldPosSetPipeC(actorx, &uki->col_pipe);
CollisionCheck_setOC(game, &play->collision_check, &uki->col_pipe.collision_obj);
}
static void aUKI_set_value(ACTOR* actorx, xyz_t pos, xyz_t pos_speed, int angle_speed_y, int command) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
uki->right_hand_pos = pos;
uki->position_speed = pos_speed;
uki->angle_speed_y = angle_speed_y;
uki->command = command;
}
static mActor_name_t aUKI_get_fish_type(ACTOR* actorx) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
// clang-format off
static mActor_name_t fish_data[] = {
ITM_FISH00,
ITM_FISH01,
ITM_FISH02,
ITM_FISH03,
ITM_FISH04,
ITM_FISH05,
ITM_FISH06,
ITM_FISH07,
ITM_FISH08,
ITM_FISH09,
ITM_FISH10,
ITM_FISH11,
ITM_FISH12,
ITM_FISH13,
ITM_FISH14,
ITM_FISH15,
ITM_FISH16,
ITM_FISH17,
ITM_FISH18,
ITM_FISH19,
ITM_FISH20,
ITM_FISH21,
ITM_FISH22,
ITM_FISH23,
ITM_FISH24,
ITM_FISH25,
ITM_FISH26,
ITM_FISH27,
ITM_FISH28,
ITM_FISH29,
ITM_FISH30,
ITM_FISH31,
ITM_FISH32,
ITM_FISH33,
ITM_FISH34,
ITM_FISH35,
ITM_FISH36,
ITM_FISH37,
ITM_FISH38,
ITM_FISH39,
ITM_FISH39,
ITM_DUST0_EMPTY_CAN,
ITM_DUST1_BOOT,
ITM_DUST2_OLD_TIRE,
ITM_FISH22,
};
// clang-format on
mActor_name_t item = EMPTY_NO;
if (uki->gyo_type >= 0 && uki->gyo_type < aSOG_FISH_TYPE_EXTENDED_NUM) {
item = fish_data[uki->gyo_type];
}
return item;
}
static void aUKI_chase_color(int* col_p, u32 target, int step) {
u32 now = *col_p;
if (now != target) {
int n_step = (f32)step * 0.5f;
if (n_step > 0) {
int d = now - target;
if (d > n_step) {
*col_p = now + n_step;
} else {
*col_p = target;
}
} else {
int d = now - target;
if (d < n_step) {
*col_p = now - -n_step;
} else {
*col_p = target;
}
}
}
}
static void aUKI_BGcheck(ACTOR* actorx) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
f32 ground_y;
f32 water_y;
f32 y;
switch (mCoBG_Wpos2Attribute(actorx->world.position, NULL)) {
case mCoBG_ATTRIBUTE_SEA:
case mCoBG_ATTRIBUTE_WAVE:
case mCoBG_ATTRIBUTE_SAND: {
ground_y = mCoBG_GetBgY_AngleS_FromWpos(NULL, actorx->world.position, 0.0f);
water_y = mCoBG_GetWaterHeight_File(actorx->world.position, __FILE__, 237);
uki->range = 5.0f;
if ((water_y - ground_y) < 10.0f) {
y = 0.0f;
} else {
y = -12.0f;
}
if (uki->proc == 6 && (water_y - ground_y) < 20.0f) {
actorx->world.angle.y += DEG2SHORT_ANGLE2(180.0f);
}
break;
}
case mCoBG_ATTRIBUTE_WATERFALL: {
uki->range = 11.0f;
y = -12.0f;
break;
}
default: {
if (uki->proc == 4) {
if (uki->cast_timer != 0) {
uki->range = 12.0f;
y = 0.0f;
} else {
chase_f(&uki->range, 40.0f, 0.05f);
y = -12.0f;
}
} else {
uki->range = 12.0f;
y = -12.0f;
}
break;
}
}
switch (uki->proc) {
case 0:
case 3:
case 5:
mCoBG_BgCheckControll(NULL, actorx, uki->range, y, TRUE, TRUE, 1);
break;
default:
mCoBG_BgCheckControll(NULL, actorx, uki->range, y, TRUE, FALSE, 1);
break;
}
}
static void aUKI_touch_vib_proc(UKI_ACTOR* uki) {
static aUKI_vib_c vib_data_table[] = {
// clang-format off
{ 60, 0, 1, 10 },
{ 70, 0, 1, 10 },
{ 80, 0, 1, 10 },
{ 90, 0, 1, 10 },
{ 100, 0, 1, 10 },
{ 100, 1, 2, 9 },
{ 100, 2, 2, 7 },
{ 100, 2, 2, 7 },
// clang-format on
};
if (uki->gyo_type >= 0) {
s16 idx = gyoei_type[uki->gyo_type].size;
aUKI_vib_c* vib_p = &vib_data_table[idx];
mVibctl_simple_entry(vib_p->n_frames, mVibctl_VIB_PROG_FFF, vib_p->attack_frames, vib_p->sustain_frames,
vib_p->release_frames, 0.0f);
}
}
static void aUKI_bite_vib_proc(ACTOR* actorx) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
static aUKI_vib_c vib_data_table[] = {
// clang-format off
{ 40, 5, 60, 3 },
{ 50, 5, 60, 3 },
{ 60, 5, 60, 3 },
{ 70, 5, 60, 3 },
{ 80, 5, 60, 3 },
{ 90, 5, 60, 3 },
{ 100, 5, 60, 3 },
{ 100, 5, 60, 3 },
// clang-format on
};
if (uki->gyo_type >= 0) {
s16 idx = gyoei_type[uki->gyo_type].size;
aUKI_vib_c* vib_p = &vib_data_table[idx];
mVibctl_simple_entry(vib_p->n_frames, mVibctl_VIB_PROG_IMPACT, vib_p->attack_frames, vib_p->sustain_frames,
vib_p->release_frames, 0.0f);
}
}
static void aUKI_clear_spd(ACTOR* actorx) {
actorx->speed = 0.0f;
actorx->position_speed.x = 0.0f;
actorx->position_speed.z = 0.0f;
}
static void aUKI_parabola_init(UKI_ACTOR* uki, const xyz_t* p0, const xyz_t* p1, s16 timer, u8 type) {
f32 y_param;
f32 f = (f32)(int)timer;
f32 step = f * 0.5f;
f32 dx = p1->x - p0->x;
f32 dy = p1->y - p0->y;
f32 dz = p1->z - p0->z;
if (dy > 100.0f) {
y_param = 12.0f;
} else {
y_param = 4.5f;
}
switch (type) {
case 0: {
uki->parabola_vec[0].x = dx / f;
uki->parabola_vec[0].y = dy / f;
uki->parabola_vec[0].z = dz / f;
break;
}
case 1: {
uki->parabola_vec[1].y = (2.0f * (y_param * f - dy)) / SQ(f);
uki->parabola_vec[0].x = dx / step;
uki->parabola_vec[0].y = y_param - uki->parabola_vec[1].y;
uki->parabola_vec[0].z = dz / step;
uki->parabola_vec[1].x = uki->parabola_vec[0].x / f;
uki->parabola_vec[1].z = uki->parabola_vec[0].z / f;
break;
}
case 2: {
uki->parabola_acc[1].y = (2.0f * (y_param * f - dy)) / SQ(f);
uki->parabola_acc[0].x = dx / step;
uki->parabola_acc[0].y = y_param - uki->parabola_acc[1].y;
uki->parabola_acc[0].z = dz / step;
uki->parabola_acc[1].x = uki->parabola_acc[0].x / f;
uki->parabola_acc[1].z = uki->parabola_acc[0].z / f;
break;
}
}
}
static void aUKI_parabola_move(ACTOR* actorx, u8 type) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
switch (type) {
case 0:
xyz_t_add(&actorx->world.position, &uki->parabola_vec[0], &actorx->world.position);
break;
case 1:
xyz_t_add(&actorx->world.position, &uki->parabola_vec[0], &actorx->world.position);
xyz_t_sub(&uki->parabola_vec[0], &uki->parabola_vec[1], &uki->parabola_vec[0]);
break;
case 2:
xyz_t_add(&uki->uki_pos, &uki->parabola_acc[0], &uki->uki_pos);
xyz_t_sub(&uki->parabola_acc[0], &uki->parabola_acc[1], &uki->parabola_acc[0]);
break;
}
}
static s16 aUKI_Get_flow_angle(ACTOR* actorx) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
xyz_t flow;
mCoBG_GetWaterFlow(&flow, actorx->bg_collision_check.result.unit_attribute);
return atans_table(flow.z, flow.x);
}
static void aUKI_effect_sibuki(ACTOR* actorx, GAME* game, s16 arg) {
xyz_t pos = actorx->world.position;
s16 flow_angle;
pos.y = mCoBG_GetWaterHeight_File(actorx->world.position, __FILE__, 575);
flow_angle = aUKI_Get_flow_angle(actorx);
eEC_CLIP->effect_make_proc(eEC_EFFECT_TURI_MIZU, pos, 1, flow_angle, game, EMPTY_NO, arg, 0);
}
static void aUKI_effect_hamon(ACTOR* actorx, GAME* game, s16 arg) {
xyz_t pos = actorx->world.position;
s16 flow_angle;
pos.y = mCoBG_GetWaterHeight_File(actorx->world.position, __FILE__, 603);
flow_angle = aUKI_Get_flow_angle(actorx);
eEC_CLIP->effect_make_proc(eEC_EFFECT_TURI_HAMON, pos, 1, flow_angle, game, EMPTY_NO, arg, 0);
}
static void aUKI_movement(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
s16 flow_angle;
flow_angle = aUKI_Get_flow_angle(actorx);
if (actorx->player_distance_xz < 130.0f ||
actorx->bg_collision_check.result.unit_attribute == mCoBG_ATTRIBUTE_WATERFALL) {
if (uki->gyo_command != 1) {
if (uki->touch_timer != 5) {
uki->touch_timer = 0;
}
chase_f(&actorx->speed, 0.45f, 0.1f);
} else {
chase_f(&actorx->speed, 0.225f, 0.1f);
}
actorx->position_speed.x = actorx->speed * sin_s(flow_angle);
actorx->position_speed.z = actorx->speed * cos_s(flow_angle);
} else {
if (uki->gyo_command != 1) {
if (uki->touch_timer != 5) {
uki->touch_timer = 0;
}
}
actorx->speed = 0.8f;
actorx->position_speed.x = actorx->speed * sin_s(actorx->player_angle_y);
actorx->position_speed.z = actorx->speed * cos_s(actorx->player_angle_y);
}
if (actorx->player_distance_xz > 127.0f && (play->game_frame % 10) == 0) {
aUKI_effect_hamon(actorx, game, 4);
}
}
static void aUKI_coast_wave(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
switch (mCoBG_Wpos2Attribute(actorx->world.position, NULL)) {
case mCoBG_ATTRIBUTE_WAVE:
case mCoBG_ATTRIBUTE_SAND:
aUKI_clear_spd(actorx);
if (uki->coast_flag == FALSE) {
uki->coast_flag = TRUE;
}
break;
default:
aUKI_movement(actorx, game);
Actor_position_move(actorx);
break;
}
}
static void aUKI_vib_calc(ACTOR* actorx, f32 height, f32 max_speed_y, f32 gravity) {
if (actorx->world.position.y < height) {
actorx->max_velocity_y = max_speed_y;
} else {
actorx->max_velocity_y = -max_speed_y;
}
actorx->gravity = gravity;
}
static void aUKI_set_spd_relations_in_water(ACTOR* actorx, GAME* game) {
static s16 angl_add_table[] = { DEG2SHORT_ANGLE2(1.40625f), DEG2SHORT_ANGLE2(5.625f) };
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
s16 flow_angle;
int idx;
f32 water_height = mCoBG_GetWaterHeight_File(actorx->world.position, __FILE__, 772);
if (uki->gyo_command == 2) {
if (uki->gyo_status == 4) {
f32 height = water_height + 7.5f;
if (uki->touch_timer != 6) {
aUKI_vib_calc(actorx, height, 2.0f, 1.0f);
if (actorx->world.position.y >= height) {
uki->touch_timer = 6;
}
} else {
aUKI_vib_calc(actorx, height, 0.3f, 0.1f);
}
} else {
f32 height = water_height - 7.5f;
if (uki->touch_timer != 5) {
aUKI_vib_calc(actorx, height, 1.5f, 0.5f);
if (actorx->world.position.y < (water_height - 7.5f)) {
uki->touch_timer = 5;
}
} else {
aUKI_vib_calc(actorx, height, 0.3f, 0.1f);
}
}
} else if (uki->gyo_command == 1) {
if (uki->touched_flag) {
uki->touched_flag = FALSE;
uki->touch_timer = 2;
aUKI_effect_hamon(actorx, game, 2);
aUKI_touch_vib_proc(uki);
}
switch (uki->touch_timer) {
case 4:
aUKI_vib_calc(actorx, water_height, 0.3f, -0.050000005f);
break;
case 0:
case 2:
water_height -= 1.7f;
aUKI_vib_calc(actorx, water_height, 0.9f, 1.0f);
if (actorx->world.position.y < water_height) {
uki->touch_timer = 3;
}
break;
case 3:
aUKI_vib_calc(actorx, water_height, 0.9f, 1.0f);
if (actorx->world.position.y >= water_height) {
uki->touch_timer = 4;
}
break;
default:
break;
}
} else {
if (uki->proc == 4) {
flow_angle = aUKI_Get_flow_angle(actorx);
idx = ABS((s16)(actorx->world.angle.y - flow_angle)) > DEG2SHORT_ANGLE2(90.0f);
chase_angle(&actorx->world.angle.y, flow_angle, angl_add_table[idx]);
actorx->shape_info.rotation.y = actorx->world.angle.y;
}
if (actorx->bg_collision_check.result.unit_attribute == mCoBG_ATTRIBUTE_WATERFALL) {
if (actorx->world.position.y < water_height) {
if (uki->touch_timer == 5) {
aUKI_vib_calc(actorx, water_height, 0.9f, 1.0f);
} else {
aUKI_vib_calc(actorx, water_height, 0.3f, -0.050000005f);
}
} else {
actorx->max_velocity_y = -3.0f;
actorx->gravity = 3.0f;
}
switch (uki->proc) {
case 4:
case 6:
case 7:
uki->gyo_status = 1;
actorx->position_speed.y = 0.0f;
uki->gyo_command = 0;
break;
}
} else {
if (uki->touch_timer == 5) {
aUKI_vib_calc(actorx, water_height, 0.9f, 1.0f);
if (actorx->world.position.y >= water_height) {
aUKI_effect_hamon(actorx, game, 1);
uki->touch_timer = 0;
}
} else {
aUKI_vib_calc(actorx, water_height, 0.3f, -0.050000005f);
}
}
}
}
static void aUKI_color(ACTOR* actorx) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
f32 water_height = mCoBG_GetWaterHeight_File(actorx->world.position, __FILE__, 911);
if (actorx->world.position.y < (water_height - 3.0f)) {
aUKI_chase_color(&uki->color[0], 100, -52);
aUKI_chase_color(&uki->color[1], 100, -52);
aUKI_chase_color(&uki->color[2], 128, -43);
} else {
aUKI_chase_color(&uki->color[0], 255, 52);
aUKI_chase_color(&uki->color[1], 255, 52);
aUKI_chase_color(&uki->color[2], 255, 43);
}
}
static u8 aUKI_force_command(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
u8 res = FALSE;
switch (uki->command) {
case 8:
res = TRUE;
aUKI_set_proc(actorx, game, aUKI_PROC_FORCE, 0);
break;
case 7:
res = TRUE;
aUKI_clear_spd(actorx);
uki->frame_timer = 52;
aUKI_parabola_init(uki, &actorx->world.position, &uki->right_hand_pos, uki->frame_timer, 1);
uki->status = aUKI_STATUS_COMEBACK;
aUKI_effect_sibuki(actorx, game, 1);
sAdo_OngenTrgStart(NA_SE_10C, &actorx->world.position);
aUKI_set_proc(actorx, game, aUKI_PROC_FORCE, 0);
break;
}
return res;
}
static void aUKI_carry(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
actorx->world.position = uki->right_hand_pos;
uki->uki_pos = uki->right_hand_pos;
if (uki->command == 2) {
int timer;
if (uki->frame_timer == 0) {
timer = 0;
} else {
timer = --uki->frame_timer;
}
if (timer == 0) {
aUKI_set_proc(actorx, game, aUKI_PROC_READY, 0);
}
}
}
static void aUKI_ready(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
int timer;
if (uki->frame_timer == 0) {
timer = 0;
} else {
timer = --uki->frame_timer;
}
if (timer == 0) {
switch (uki->command) {
case 3:
aUKI_set_proc(actorx, game, aUKI_PROC_CAST, 0);
break;
case 4:
aUKI_set_proc(actorx, game, aUKI_PROC_AIR, 0);
break;
}
} else {
aUKI_parabola_move(actorx, 0);
}
}
static void aUKI_air(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
int timer;
aUKI_parabola_move(actorx, 0);
if (uki->frame_timer == 0) {
timer = 0;
} else {
timer = --uki->frame_timer;
}
if (timer == 0) {
aUKI_clear_spd(actorx);
aUKI_set_proc(actorx, game, aUKI_PROC_CARRY, 0);
}
}
static void aUKI_cast(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
int timer;
aUKI_parabola_move(actorx, 1);
if (actorx->bg_collision_check.result.is_in_water) {
uki->hit_water_flag = TRUE;
aUKI_effect_sibuki(actorx, game, 3);
mVibctl_simple_entry(50, mVibctl_VIB_PROG_FFF, 0, 1, 15, 0.0f);
uki->status = aUKI_STATUS_FLOAT;
sAdo_OngenTrgStart(NA_SE_10B, &actorx->world.position);
aUKI_set_proc(actorx, game, aUKI_PROC_WAIT, 0);
}
}
static void aUKI_wait(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
uki->hit_water_flag = FALSE;
uki->uki_pos = actorx->world.position;
chase_f(&actorx->position_speed.y, actorx->max_velocity_y, actorx->gravity);
if (aUKI_force_command(actorx, game) == FALSE) {
int timer;
if (uki->cast_timer == 0) {
timer = 0;
} else {
timer = --uki->cast_timer;
}
if (timer == 0 && uki->gyo_command == 1) {
aUKI_set_proc(actorx, game, aUKI_PROC_TOUCH, 0);
} else if (uki->command == 6) {
int timer;
aUKI_clear_spd(actorx);
if (uki->frame_timer == 0) {
timer = 0;
} else {
timer = --uki->frame_timer;
}
if (timer == 0) {
aUKI_set_proc(actorx, game, aUKI_PROC_HIT, 1);
}
} else {
aUKI_coast_wave(actorx, game);
}
}
}
static void aUKI_hit(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
int timer;
if (uki->frame_timer == 0) {
timer = 0;
} else {
timer = --uki->frame_timer;
}
if (timer == 0) {
if (uki->gyo_status == 5) {
aUKI_set_proc(actorx, game, aUKI_PROC_CATCH, 0);
} else {
uki->gyo_command = 0;
uki->gyo_status = 0;
aUKI_set_proc(actorx, game, aUKI_PROC_CARRY, 0);
}
} else {
aUKI_parabola_move(actorx, 1);
aUKI_parabola_move(actorx, 2);
}
}
static void aUKI_touch(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
chase_f(&actorx->position_speed.y, actorx->max_velocity_y, actorx->gravity);
if (aUKI_force_command(actorx, game) == FALSE) {
if (uki->gyo_command == 2) {
aUKI_touch_vib_proc(uki);
aUKI_set_proc(actorx, game, aUKI_PROC_BITE, 0);
} else if (uki->command == 6) {
int timer;
aUKI_clear_spd(actorx);
if (uki->frame_timer == 0) {
timer = 0;
} else {
timer = --uki->frame_timer;
}
if (timer == 0) {
aUKI_set_proc(actorx, game, aUKI_PROC_HIT, 1);
}
} else {
aUKI_movement(actorx, game);
}
Actor_position_move(actorx);
}
}
static void aUKI_bite(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
// clang-format off
static s16 angl[] = {
DEG2SHORT_ANGLE2(10.1513671875f),
DEG2SHORT_ANGLE2(9.4647216796875f),
DEG2SHORT_ANGLE2(8.778076171875f),
DEG2SHORT_ANGLE2(8.778076171875f),
DEG2SHORT_ANGLE2(8.0914306640625f),
DEG2SHORT_ANGLE2(7.40478515625f),
DEG2SHORT_ANGLE2(7.03125f),
DEG2SHORT_ANGLE2(7.03125),
};
// clang-format on
// clang-format off
static f32 spd[] = {
0.1f,
0.2f,
0.3f,
0.3f,
0.4f,
0.6f,
0.8f,
0.8f,
};
// clang-format on
chase_f(&actorx->position_speed.y, actorx->max_velocity_y, actorx->gravity);
if (aUKI_force_command(actorx, game) == FALSE) {
if (uki->gyo_command == 2) {
if (uki->command == 6) {
int timer;
if (uki->frame_timer == 0) {
timer = 0;
} else {
timer = --uki->frame_timer;
}
if (timer == 0) {
aUKI_clear_spd(actorx);
aUKI_set_proc(actorx, game, aUKI_PROC_HIT, 3);
aUKI_parabola_init(uki, &uki->uki_pos, &uki->left_hand_pos, uki->frame_timer, 2);
uki->gyo_status = 5;
} else {
s16 idx = gyoei_type[uki->gyo_type].size;
f32 angle = angl[idx];
actorx->world.angle.y += (int)(angle * 0.5f);
actorx->shape_info.rotation.y = actorx->world.angle.y;
actorx->speed = spd[idx];
actorx->position_speed.x = actorx->speed * sin_s(actorx->world.angle.y);
actorx->position_speed.z = actorx->speed * cos_s(actorx->world.angle.y);
Actor_position_move(actorx);
uki->uki_pos = uki->gyo_pos;
uki->gyo_status = 4;
if (uki->status != aUKI_STATUS_VIB) {
aUKI_bite_vib_proc(actorx);
}
uki->status = aUKI_STATUS_VIB;
}
} else {
if ((game->frame_counter % 10) == 0) {
aUKI_touch_vib_proc(uki);
}
Actor_position_move(actorx);
}
} else {
aUKI_set_proc(actorx, game, aUKI_PROC_WAIT, 0);
}
}
}
static void aUKI_catch(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
actorx->world.position = uki->right_hand_pos;
uki->uki_pos = uki->left_hand_pos;
switch (uki->command) {
case 1:
uki->gyo_command = 0;
uki->gyo_status = 8;
aUKI_set_proc(actorx, game, aUKI_PROC_CARRY, 0);
break;
case 5:
aUKI_set_proc(actorx, game, aUKI_PROC_GET, 0);
break;
}
}
static void aUKI_get(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
actorx->world.position = uki->right_hand_pos;
uki->uki_pos = uki->left_hand_pos;
if (uki->command == 1) {
uki->gyo_command = 0;
uki->gyo_status = 0;
aUKI_set_proc(actorx, game, aUKI_PROC_CARRY, 0);
}
}
static void aUKI_force(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
if (uki->status == aUKI_STATUS_COMEBACK) {
int timer;
if (uki->frame_timer == 0) {
timer = 0;
} else {
timer = --uki->frame_timer;
}
if (timer == 0) {
aUKI_set_proc(actorx, game, aUKI_PROC_CARRY, 0);
} else {
aUKI_parabola_move(actorx, 1);
}
} else {
aUKI_force_command(actorx, game);
}
}
static void aUKI_set_proc_carry(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
actorx->position_speed.y = 0.0f;
uki->frame_timer = 4;
uki->status = aUKI_STATUS_CARRY;
}
static void aUKI_set_proc_ready(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
ACTOR* player_actor = GET_PLAYER_ACTOR_GAME_ACTOR(game);
xyz_t target_pos;
uki->frame_timer = 32;
target_pos = actorx->world.position;
target_pos.x -= 30.0f * sin_s(player_actor->shape_info.rotation.y);
target_pos.z -= 30.0f * cos_s(player_actor->shape_info.rotation.y);
aUKI_parabola_init(uki, &actorx->world.position, &target_pos, 20, 0);
uki->status = aUKI_STATUS_READY;
}
static void aUKI_set_proc_air(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
uki->frame_timer = 14;
aUKI_parabola_init(uki, &actorx->world.position, &uki->uki_pos, uki->frame_timer, 0);
uki->status = aUKI_STATUS_CARRY;
}
static void aUKI_set_proc_cast(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
uki->frame_timer = 50;
uki->cast_timer = 40;
aUKI_parabola_init(uki, &actorx->world.position, &uki->cast_goal_point, uki->frame_timer, 1);
uki->status = aUKI_STATUS_CAST;
}
static void aUKI_set_proc_wait(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
uki->frame_timer = 12;
uki->gyo_status = 1;
uki->gyo_type = -1;
uki->child_actor = NULL;
}
static void aUKI_set_proc_hit(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
Submenu* submenu_p = &play->submenu;
xyz_t_move(&submenu_p->water_pos, &actorx->world.position);
uki->frame_timer = 52;
aUKI_parabola_init(uki, &actorx->world.position, &uki->right_hand_pos, uki->frame_timer, 1);
uki->status = aUKI_STATUS_COMEBACK;
if (uki->coast_flag) {
uki->coast_flag = FALSE;
} else {
aUKI_effect_sibuki(actorx, game, arg);
}
sAdo_OngenTrgStart(NA_SE_10C, &actorx->world.position);
}
static void aUKI_set_proc_touch(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
aUKI_clear_spd(actorx);
aUKI_movement(actorx, game);
Actor_position_move(actorx);
uki->frame_timer = 12;
uki->gyo_status = 2;
}
static void aUKI_set_proc_bite(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
static s16 timer[] = { 26, 39, 39, 39, 52, 65, 78, 78 };
aUKI_clear_spd(actorx);
aUKI_effect_sibuki(actorx, game, 0);
switch (uki->gyo_type) {
case aSOG_FISH_TYPE_EMPTY_CAN:
case aSOG_FISH_TYPE_BOOT:
case aSOG_FISH_TYPE_OLD_TIRE:
uki->frame_timer = 26;
break;
default:
uki->frame_timer = (int)((f32)(int)timer[gyoei_type[uki->gyo_type].size] * 2.0f);
break;
}
uki->gyo_status = 3;
}
static void aUKI_set_proc_catch(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
uki->frame_timer = 20;
uki->gyo_status = 6;
uki->status = aUKI_STATUS_CATCH;
}
static void aUKI_set_proc_get(ACTOR* actorx, GAME* game, int arg) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
uki->gyo_status = 7;
}
typedef void (*aUKI_INIT_PROC)(ACTOR*, GAME*, int);
static void aUKI_set_proc(ACTOR* actorx, GAME* game, int proc, int arg) {
// clang-format off
static aUKI_INIT_PROC init_proc[] = {
&aUKI_set_proc_carry,
&aUKI_set_proc_ready,
&aUKI_set_proc_air,
&aUKI_set_proc_cast,
&aUKI_set_proc_wait,
&aUKI_set_proc_hit,
&aUKI_set_proc_touch,
&aUKI_set_proc_bite,
&aUKI_set_proc_catch,
&aUKI_set_proc_get,
(aUKI_INIT_PROC)&none_proc1,
};
// clang-format on
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
(*init_proc[proc])(actorx, game, arg);
uki->proc = proc;
}
typedef void (*aUKI_MOVE_PROC)(ACTOR*, GAME*);
static void aUKI_actor_move(ACTOR* actorx, GAME* game) {
UKI_ACTOR* uki = (UKI_ACTOR*)actorx;
if (uki->command != 0) {
// clang-format off
static aUKI_MOVE_PROC Uki_move_proc[] = {
&aUKI_carry,
&aUKI_ready,
&aUKI_air,
&aUKI_cast,
&aUKI_wait,
&aUKI_hit,
&aUKI_touch,
&aUKI_bite,
&aUKI_catch,
&aUKI_get,
&aUKI_force,
};
// clang-format on
ACTOR* player_actor;
f32 sin;
f32 cos;
actorx->dw_proc = &aUKI_actor_draw;
player_actor = GET_PLAYER_ACTOR_GAME_ACTOR(game);
sin = sin_s(player_actor->shape_info.rotation.y);
cos = cos_s(player_actor->shape_info.rotation.y);
uki->right_hand_pos.x += 3.0f * sin + -7.0f * cos;
uki->right_hand_pos.y += 6.0f;
uki->right_hand_pos.z += 3.0f * cos - -7.0f * sin;
(*Uki_move_proc[uki->proc])(actorx, game);
aUKI_BGcheck(actorx);
aUKI_set_spd_relations_in_water(actorx, game);
aUKI_color(actorx);
set_collision(actorx, game);
} else {
actorx->dw_proc = NULL;
}
}
+73 -61
View File
@@ -19,8 +19,8 @@ static void Weather_Actor_dt(ACTOR* actor, GAME* game);
static void Weather_Actor_move(ACTOR* actor, GAME* game);
static void Weather_Actor_draw(ACTOR* actor, GAME* game);
static void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id);
static int aWeather_CountWeatherPrivate(WEATHER_ACTOR* weather);
static void aWeather_SetNowProfile(ACTOR* actorx, s16 id);
static int aWeather_CountWeatherPrivate(ACTOR* actorx);
static aWeather_Profile_c* profile_tbl[] = {
&iam_weather_fine, &iam_weather_rain, &iam_weather_snow, &iam_weather_sakura, &iam_weather_leaf,
@@ -58,12 +58,14 @@ static void aWeather_SysLevCall_MoveEnd(WEATHER_ACTOR* weather) {
}
static void aWeather_SysLevStart(u8 flag) {
Common_Get(clip.weather_clip)->actor->start_sound_effect = flag;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
weather->start_sound_effect = flag;
}
static void aWeather_SysLevStop(u8 flag) {
int stopFlag = flag;
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if (weather->start_sound_effect == stopFlag) {
weather->start_sound_effect = 0;
@@ -97,13 +99,12 @@ static void aWeather_RequestChangeWeather(ACTOR* actor, s16 status, s16 level) {
}
extern void aWeather_RequestChangeWeatherToIsland() {
aWeather_RequestChangeWeather(&Common_Get(clip.weather_clip)->actor->actor_class, Common_Get(island_weather),
aWeather_RequestChangeWeather(Common_Get(clip.weather_clip)->actor, Common_Get(island_weather),
Common_Get(island_weather_intensity));
}
extern void aWeather_RequestChangeWeatherFromIsland() {
aWeather_RequestChangeWeather(&Common_Get(clip.weather_clip)->actor->actor_class,
mEnv_SAVE_GET_WEATHER_TYPE(Save_Get(weather)),
aWeather_RequestChangeWeather(Common_Get(clip.weather_clip)->actor, mEnv_SAVE_GET_WEATHER_TYPE(Save_Get(weather)),
mEnv_SAVE_GET_WEATHER_INTENSITY(Save_Get(weather)));
}
@@ -158,8 +159,7 @@ static aWeather_Priv* aWeather_GetWeatherPrv(u8 status, s16 timer, xyz_t* pos, x
}
static int aWeather_StopSysLevSE() {
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
u8 current = weather->current_sound_effect;
if (weather->sound_flag == 0) {
@@ -174,8 +174,7 @@ static int aWeather_StopSysLevSE() {
}
static int aWeather_StartSysLevSE() {
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
u8 current = weather->current_sound_effect;
if (weather->sound_flag == 1) {
@@ -202,7 +201,8 @@ static int aWeather_StartSysLevSE() {
return 0;
}
static void aWeather_ChangeWeatherInstance(WEATHER_ACTOR* weather, s16 status, s16 level) {
static void aWeather_ChangeWeatherInstance(ACTOR* actorx, s16 status, s16 level) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
weather->next_status = status;
weather->next_level = level;
@@ -210,9 +210,9 @@ static void aWeather_ChangeWeatherInstance(WEATHER_ACTOR* weather, s16 status, s
weather->current_level = 0;
weather->request_change = TRUE;
if (!aWeather_CountWeatherPrivate(weather)) {
if (!aWeather_CountWeatherPrivate(actorx)) {
weather->current_status = weather->next_status;
aWeather_SetNowProfile(weather, weather->current_status);
aWeather_SetNowProfile(actorx, weather->current_status);
aWeather_weatherinfo_CommonSet(weather->current_status, weather->next_level);
weather->current_level = level;
weather->current_aim_level = weather->next_level;
@@ -229,7 +229,8 @@ static int aWeather_IsLand_Event_Check() {
return 0;
}
static int aWeather_Basement_Event_Check(WEATHER_ACTOR* weather) {
static int aWeather_Basement_Event_Check(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
if ((weather->basement_event == 1) || (weather->basement_event == 2)) {
return 1;
@@ -237,7 +238,8 @@ static int aWeather_Basement_Event_Check(WEATHER_ACTOR* weather) {
return 0;
}
static void aWeather_ChangeEnvSE(WEATHER_ACTOR* weather, GAME_PLAY* play, s16 status, s16 level) {
static void aWeather_ChangeEnvSE(ACTOR* actorx, GAME* game, s16 status, s16 level) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
u8 current = weather->current_sound_effect;
if (weather->sound_flag == 1 || weather->sound_flag == 2)
@@ -256,7 +258,7 @@ static void aWeather_ChangeEnvSE(WEATHER_ACTOR* weather, GAME_PLAY* play, s16 st
if ((status == 1) && (weather->current_sound_effect == -1000)) {
switch (level) {
case 1:
if (mPlib_check_player_open_umbrella(play) != 0) {
if (mPlib_check_player_open_umbrella(game) != 0) {
aWeather_SysLevStart(0x12);
weather->current_sound_effect = 0x12;
return;
@@ -265,7 +267,7 @@ static void aWeather_ChangeEnvSE(WEATHER_ACTOR* weather, GAME_PLAY* play, s16 st
weather->current_sound_effect = 7;
break;
case 2:
if (mPlib_check_player_open_umbrella(play) != 0) {
if (mPlib_check_player_open_umbrella(game) != 0) {
aWeather_SysLevStart(0x13);
weather->current_sound_effect = 0x13;
return;
@@ -274,7 +276,7 @@ static void aWeather_ChangeEnvSE(WEATHER_ACTOR* weather, GAME_PLAY* play, s16 st
weather->current_sound_effect = 8;
break;
case 3:
if (mPlib_check_player_open_umbrella(play) != 0) {
if (mPlib_check_player_open_umbrella(game) != 0) {
aWeather_SysLevStart(0x14);
weather->current_sound_effect = 0x14;
return;
@@ -293,7 +295,7 @@ static void aWeather_EndEnvSE(ACTOR* actor) {
if ((sAdo_GameframeEnd_Check() == 1) ||
((sAdo_GameframeEnd_Check() == 2) &&
((aWeather_IsLand_Event_Check() != 0) || (aWeather_Basement_Event_Check(weather) != 0)))) {
((aWeather_IsLand_Event_Check() != 0) || (aWeather_Basement_Event_Check(actor) != 0)))) {
if (((u8)(current - 7) <= 2) || ((u8)(current - 0x12) <= 1) || (u8)(current == 0x14)) {
aWeather_SysLevStop(current);
weather->current_sound_effect = -1000;
@@ -305,7 +307,8 @@ static void aWeather_EndEnvSE(ACTOR* actor) {
aWeather_SysLevCall_MoveEnd(weather);
}
static void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id) {
static void aWeather_SetNowProfile(ACTOR* actorx, s16 id) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
if (!mFI_GET_TYPE(mFI_GetFieldId())) {
weather->current_profile = profile_tbl[id];
@@ -314,11 +317,11 @@ static void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id) {
}
}
static void aWeather_SecureWeatherPrivateWork(WEATHER_ACTOR* weather) {
static void aWeather_SecureWeatherPrivateWork(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
int i;
weather->priv = zelda_malloc(sizeof(aWeather_Priv) * 100);
if (weather->priv != NULL) {
for (i = 0; i < 100; i++) {
bzero(&weather->priv[i], sizeof(aWeather_Priv));
@@ -326,14 +329,16 @@ static void aWeather_SecureWeatherPrivateWork(WEATHER_ACTOR* weather) {
}
}
static void aWeather_SetClip(WEATHER_ACTOR* weather, int flag) {
static void aWeather_SetClip(ACTOR* actorx, int flag) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
aWeather_Clip_c* clip;
if (flag != 0) {
Common_Set(clip.weather_clip, NULL);
} else {
clip = &weather->clip;
clip->actor = weather;
clip->actor = actorx;
clip->change_weather = aWeather_RequestChangeWeather;
clip->get_priv_num = aWeather_GetWeatherPrvNum;
clip->remove_priv = aWeather_AbolishPrivate;
@@ -346,7 +351,8 @@ static void aWeather_SetClip(WEATHER_ACTOR* weather, int flag) {
}
}
static void aWeather_RenewWindInfo(WEATHER_ACTOR* weather) {
static void aWeather_RenewWindInfo(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
s_xyz pos = Common_Get(wind); // multiply by 1 means inline ?
f32 speed = Common_Get(wind_speed) * 0.01f;
f32 factor = 1.0f;
@@ -356,12 +362,12 @@ static void aWeather_RenewWindInfo(WEATHER_ACTOR* weather) {
weather->wind_info.z = pos.z * speed * factor;
}
static void aWeather_SnowInAdvance(WEATHER_ACTOR* weather, GAME_PLAY* play, int moves) {
static void aWeather_SnowInAdvance(ACTOR* actorx, GAME* game, int moves) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
int i;
for (i = 0; i < moves; i++) {
Weather_Actor_move(&weather->actor_class, &play->game);
Weather_Actor_move(actorx, game);
}
}
@@ -375,7 +381,7 @@ static void Weather_Actor_ct(ACTOR* actor, GAME* game) {
int cur;
xyz_t* pos = Camera2_getCenterPos_p();
aWeather_SetClip(weather, 0);
aWeather_SetClip(actor, 0);
if (mEv_CheckTitleDemo() > 0) {
cur = mEv_CheckTitleDemo() - 1;
@@ -408,17 +414,17 @@ static void Weather_Actor_ct(ACTOR* actor, GAME* game) {
weather->lightning_timer2 = 30;
weather->sound_flag = 0;
aWeather_RenewWindInfo(weather);
aWeather_RenewWindInfo(actor);
if (!mFI_GET_TYPE(mFI_GetFieldId())) {
aWeather_SecureWeatherPrivateWork(weather);
aWeather_SecureWeatherPrivateWork(actor);
}
aWeather_SetNowProfile(weather, weather->current_status);
aWeather_SetNowProfile(actor, weather->current_status);
if ((weather->current_status == 2) || (weather->current_status == 3)) {
weather->pos.y -= 50.0f;
aWeather_SnowInAdvance(weather, play, 0x28);
aWeather_SnowInAdvance(actor, game, 0x28);
weather->pos.y += 50.0f;
}
@@ -437,11 +443,11 @@ static void Weather_Actor_ct(ACTOR* actor, GAME* game) {
weather->basement_event = 0;
}
if ((play->fb_wipe_type == 6) && (aWeather_IsLand_Event_Check() == 0) &&
(aWeather_Basement_Event_Check(weather) == 0)) {
(aWeather_Basement_Event_Check(actor) == 0)) {
weather->current_sound_effect = Common_Get(current_sound_effect);
} else {
weather->current_sound_effect = -1000;
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actor, game, weather->current_status, weather->current_level);
aWeather_SysLevCall_MoveEnd(weather);
}
}
@@ -453,7 +459,7 @@ static void Weather_Actor_dt(ACTOR* actor, GAME* game) {
zelda_free(weather->priv);
}
aWeather_SetClip(weather, 1);
aWeather_SetClip(actor, 1);
}
static void aWeather_DrawWeatherPrv(ACTOR* actor, GAME* game) {
@@ -495,7 +501,8 @@ static void aWeather_MakeWeatherPrv(ACTOR* actor, GAME* game) {
}
}
static void aWeather_MoveWeatherPrv(WEATHER_ACTOR* weather, GAME* game) {
static void aWeather_MoveWeatherPrv(ACTOR* actorx, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
aWeather_Priv* priv;
int i;
@@ -509,7 +516,7 @@ static void aWeather_MoveWeatherPrv(WEATHER_ACTOR* weather, GAME* game) {
if (priv->timer != -100) {
priv->timer--;
if (priv->timer <= 0) {
aWeather_AbolishPrivate(&weather->actor_class, i);
aWeather_AbolishPrivate(actorx, i);
}
}
}
@@ -517,7 +524,8 @@ static void aWeather_MoveWeatherPrv(WEATHER_ACTOR* weather, GAME* game) {
}
}
static int aWeather_CountWeatherPrivate(WEATHER_ACTOR* weather) {
static int aWeather_CountWeatherPrivate(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
int i;
int count;
aWeather_Priv* priv = weather->priv;
@@ -534,7 +542,8 @@ static int aWeather_CountWeatherPrivate(WEATHER_ACTOR* weather) {
return count;
}
static void aWeather_ChangeWeather(WEATHER_ACTOR* weather, GAME_PLAY* play) {
static void aWeather_ChangeWeather(ACTOR* actorx, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
if ((weather->request_change == TRUE) && (weather->current_level == 0)) {
if (mFI_GET_TYPE(mFI_GetFieldId())) {
@@ -542,27 +551,28 @@ static void aWeather_ChangeWeather(WEATHER_ACTOR* weather, GAME_PLAY* play) {
aWeather_weatherinfo_CommonSet(weather->current_status, weather->next_level);
weather->current_level = 1;
weather->current_aim_level = weather->next_level;
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actorx, game, weather->current_status, weather->current_level);
weather->request_change = FALSE;
} else if (aWeather_CountWeatherPrivate(weather) == 0) {
} else if (aWeather_CountWeatherPrivate(actorx) == 0) {
weather->current_status = weather->next_status;
aWeather_SetNowProfile(weather, weather->current_status);
aWeather_SetNowProfile(actorx, weather->current_status);
aWeather_weatherinfo_CommonSet(weather->current_status, weather->next_level);
weather->current_level = 1;
weather->current_aim_level = weather->next_level;
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actorx, game, weather->current_status, weather->current_level);
weather->request_change = FALSE;
}
}
}
static void aWeather_CheckWeatherTimer() {
static void aWeather_CheckWeatherTimer(ACTOR* actorx) {
s_xyz dir;
mEnv_DecideWindDirect(&dir, 0x3000, 0x3000);
}
static void aWeather_RenewWeatherLevel(WEATHER_ACTOR* weather, GAME_PLAY* play) {
static void aWeather_RenewWeatherLevel(ACTOR* actorx, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
s16 level;
if (weather->current_level != weather->current_aim_level) {
@@ -574,12 +584,13 @@ static void aWeather_RenewWeatherLevel(WEATHER_ACTOR* weather, GAME_PLAY* play)
weather->current_level--;
else
weather->current_level++;
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actorx, game, weather->current_status, weather->current_level);
}
}
}
static void aWeather_ChangeWeatherTime0(WEATHER_ACTOR* weather) {
static void aWeather_ChangeWeatherTime0(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
s16 rndWeather, rndIntensity;
s16 evWeather, evIntensity;
s16 save_weather;
@@ -611,14 +622,15 @@ static void aWeather_ChangeWeatherTime0(WEATHER_ACTOR* weather) {
Save_Set(weather, rndIntensity | (rndWeather * 16));
if (((mEv_CheckTitleDemo() != -9) || (weather->sound_flag != 1)) && (mFI_CheckInIsland() == 0)) {
aWeather_RequestChangeWeather(&weather->actor_class, rndWeather, rndIntensity);
aWeather_RequestChangeWeather(actorx, rndWeather, rndIntensity);
}
Common_Set(weather_time, Common_Get(time.rtc_time));
}
}
}
static void aWeather_MakeKaminari(WEATHER_ACTOR* weather) {
static void aWeather_MakeKaminari(ACTOR* actorx) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actorx;
lbRTC_time_c time = Common_Get(time.rtc_time);
u8 month = time.month;
s16 timer;
@@ -660,21 +672,21 @@ static void Weather_Actor_move(ACTOR* actor, GAME* game) {
camera = &play->camera;
angle = search_position_angleY(&camera->lookat.center, &camera->lookat.eye);
aWeather_MakeKaminari(weather);
aWeather_CheckWeatherTimer(weather);
aWeather_MakeKaminari(actor);
aWeather_CheckWeatherTimer(actor);
aWeather_MakeWeatherPrv(actor, game);
aWeather_RenewWeatherLevel(weather, play);
aWeather_MoveWeatherPrv(weather, game);
aWeather_ChangeWeather(weather, play);
aWeather_RenewWeatherLevel(actor, game);
aWeather_MoveWeatherPrv(actor, game);
aWeather_ChangeWeather(actor, game);
weather->pos = *pos;
aWeather_ChangeWeatherTime0(weather);
aWeather_ChangeWeatherTime0(actor);
if (Common_Get(weather) == 1) {
umbrella = mPlib_check_player_open_umbrella(play);
umbrella = mPlib_check_player_open_umbrella(game);
if (umbrella != weather->umbrella_flag) {
aWeather_ChangeEnvSE(weather, play, weather->current_status, weather->current_level);
aWeather_ChangeEnvSE(actor, game, weather->current_status, weather->current_level);
}
weather->umbrella_flag = umbrella;
@@ -689,10 +701,10 @@ static void Weather_Actor_move(ACTOR* actor, GAME* game) {
}
extern int aWeather_ChangingWeather() {
if (Common_Get(clip.weather_clip) != NULL) {
if (Common_Get(clip.weather_clip->actor) != NULL) {
return Common_Get(clip.weather_clip->actor)->request_change == TRUE;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip).weather_clip->actor;
return weather->request_change == TRUE;
}
}
+60 -67
View File
@@ -27,50 +27,46 @@ Gfx* ef_otiba_model_tbl[] = {
};
aWeather_Profile_c iam_weather_leaf = {
aWeatherLeaf_make,
aWeatherLeaf_ct,
aWeatherLeaf_move,
aWeatherLeaf_set,
aWeatherLeaf_draw,
aWeatherLeaf_make, aWeatherLeaf_ct, aWeatherLeaf_move, aWeatherLeaf_set, aWeatherLeaf_draw,
};
static int aWeatherLeaf_DecideMakeLeafCount(ACTOR* actor, GAME* game){
static int aWeatherLeaf_DecideMakeLeafCount(ACTOR* actor, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
if(weather->current_level == 1){
if (weather->current_level == 1) {
return (game->frame_counter & 15) == 0;
}
return (game->frame_counter & 7) == 0;
return (game->frame_counter & 7) == 0;
}
static void aWeatherLeaf_make(ACTOR* actor, GAME* game){
static void aWeatherLeaf_make(ACTOR* actor, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
aWeather_Priv* priv;
f32 x,z;
aWeather_Priv* priv;
f32 x, z;
xyz_t pos = weather->pos;
f32 y = 230.0f + pos.y;
int count = Common_Get(clip.weather_clip)->get_priv_num(actor);
xyz_t base = {0.0f, 0.0f, 0.0f};
int count = Common_Get(clip.weather_clip)->get_priv_num(actor);
xyz_t base = { 0.0f, 0.0f, 0.0f };
xyz_t mod_pos;
if(aWeatherLeaf_DecideMakeLeafCount(actor, game) != 0){
if (aWeatherLeaf_DecideMakeLeafCount(actor, game) != 0) {
base.y = -0.8f + (RANDOM_F(-0.0999999642372f));
if(count != -1){
if (count != -1) {
x = -100.0f + (RANDOM_F(200.0f));
z = -200.0f + (RANDOM_F(380.0f));
mod_pos = pos;
mod_pos.x += x;
mod_pos.z += z;
mod_pos.y = y;
priv = Common_Get(clip.weather_clip)->get_priv(4, 280, &mod_pos, &base, actor, count);
if(priv != NULL){
if (priv != NULL) {
aWeatherLeaf_ct(priv, game);
priv->work[3]= 0;
priv->work[3] = 0;
priv->work[4] = 156.5f + (RANDOM_F(260.5));
priv->currentY = y;
}
@@ -78,36 +74,34 @@ static void aWeatherLeaf_make(ACTOR* actor, GAME* game){
}
}
static void aWeatherLeaf_ct(aWeather_Priv* priv, GAME*){
static void aWeatherLeaf_ct(aWeather_Priv* priv, GAME*) {
priv->work[0] = RANDOM_F(3.0f);
priv->work[1] = RANDOM_F(65535.0f);
priv->work[2] = RANDOM_F(65535.0f);
}
static int aWeatherLeaf_CheckLeafBorder(aWeather_Priv* priv){
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
static int aWeatherLeaf_CheckLeafBorder(aWeather_Priv* priv) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
int ret = 0;
f32 leafTemp;
xyz_t pos;
if(weather != NULL){
pos = weather->pos;
leafTemp =priv->pos.x;
if(leafTemp < (-100.0f + pos.x)){
if (weather != NULL) {
pos = weather->pos;
leafTemp = priv->pos.x;
if (leafTemp < (-100.0f + pos.x)) {
ret |= 2;
}
if(leafTemp > (100.0f + pos.x)){
if (leafTemp > (100.0f + pos.x)) {
ret |= 8;
}
leafTemp =priv->pos.z;
leafTemp = priv->pos.z;
if(leafTemp > (180.0f + pos.z)){
if (leafTemp > (180.0f + pos.z)) {
ret |= 4;
}
if(leafTemp < (-200.0f + pos.z)){
if (leafTemp < (-200.0f + pos.z)) {
ret |= 1;
}
}
@@ -115,58 +109,58 @@ static int aWeatherLeaf_CheckLeafBorder(aWeather_Priv* priv){
return ret;
}
static void aWeatherLeaf_CheckLeafScroll(aWeather_Priv* priv){
static void aWeatherLeaf_CheckLeafScroll(aWeather_Priv* priv) {
int border = aWeatherLeaf_CheckLeafBorder(priv);
if(border != 0){
if((border >> 1) & 1){
if (border != 0) {
if ((border >> 1) & 1) {
priv->pos.x += 200.0f;
}
if((border >> 3) & 1){
if ((border >> 3) & 1) {
priv->pos.x -= 200.0f;
}
if((border >> 2) & 1){
if ((border >> 2) & 1) {
priv->pos.z -= 380.0f;
}
if(border & 1){
if (border & 1) {
priv->pos.z += 380.0f;
}
}
if(Common_Get(clip.weather_clip) != NULL){
if (Common_Get(clip.weather_clip) != NULL) {
f32 y;
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if(weather != NULL){
if (weather != NULL) {
y = 230.0f + weather->pos.y;
if(priv->pos.y < + weather->pos.y){
if (priv->pos.y < +weather->pos.y) {
priv->pos.y = (y + (priv->pos.y - priv->currentY));
priv->currentY = y;
priv->currentY = y;
}
}
}
}
static void aWeatherLeaf_SetWind2Leaf(aWeather_Priv* priv){
static void aWeatherLeaf_SetWind2Leaf(aWeather_Priv* priv) {
priv->pos.x += 0.45f;
}
static void aWeatherLeaf_move(aWeather_Priv* priv, GAME* game){
GAME_PLAY* play = (GAME_PLAY*) game;
static void aWeatherLeaf_move(aWeather_Priv* priv, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
priv->pos.x += priv->speed.x;
priv->pos.y += priv->speed.y;
priv->pos.z += priv->speed.z;
priv->work[3] += priv->work[4];
aWeatherLeaf_SetWind2Leaf(priv);
aWeatherLeaf_CheckLeafScroll(priv);
priv->work[1] += 0x8DC;
priv->work[2] += 0x474;
priv->work[2] += 0x474;
}
static void aWeatherLeaf_set(GAME* game){
static void aWeatherLeaf_set(GAME* game) {
_texture_z_light_fog_prim_xlu(game->graph);
@@ -174,39 +168,38 @@ static void aWeatherLeaf_set(GAME* game){
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_otiba01_setmode);
CLOSE_DISP(game->graph);
}
void aWeatherLeaf_draw(aWeather_Priv* priv, GAME* game){
GAME_PLAY* play = (GAME_PLAY*) game;
void aWeatherLeaf_draw(aWeather_Priv* priv, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
Mtx* work;
f32 scale;
f32 min;
xyz_t pos;
xyz_t screen_pos;
xyz_t screen_pos;
pos.x = priv->pos.x + (6.0f * sin_s(priv->work[3]));
pos.z = priv->pos.z + (6.0f * cos_s(priv->work[3]));
pos.y = priv->pos.y;
pos.y = priv->pos.y;
Game_play_Projection_Trans(play, &pos, &screen_pos);
if(( screen_pos.x >= 0.0f) && (screen_pos.x < SCREEN_WIDTH_F) && ( screen_pos.y >= 0.0f) && (screen_pos.y < SCREEN_HEIGHT_F)){
if ((screen_pos.x >= 0.0f) && (screen_pos.x < SCREEN_WIDTH_F) && (screen_pos.y >= 0.0f) &&
(screen_pos.y < SCREEN_HEIGHT_F)) {
work = GRAPH_ALLOC_TYPE(game->graph, Mtx, 1);
OPEN_DISP(game->graph);
suMtxMakeSRT(work, 0.00499999988824f, 0.00499999988824f, 0.00499999988824f, priv->work[2], priv->work[1], priv->work[2], pos.x, pos.y, pos.z);
OPEN_DISP(game->graph);
suMtxMakeSRT(work, 0.00499999988824f, 0.00499999988824f, 0.00499999988824f, priv->work[2], priv->work[1],
priv->work[2], pos.x, pos.y, pos.z);
gSPMatrix(NEXT_POLY_XLU_DISP, work, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_otiba_model_tbl[priv->work[0]]);
CLOSE_DISP( game->graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_otiba_model_tbl[priv->work[0]]);
CLOSE_DISP(game->graph);
}
}
+63 -69
View File
@@ -29,24 +29,20 @@ static void aWeatherRain_set(GAME*);
static void aWeatherRain_draw(aWeather_Priv*, GAME*);
aWeather_Profile_c iam_weather_rain = {
aWeatherRain_make,
aWeatherRain_ct,
aWeatherRain_move,
aWeatherRain_set,
aWeatherRain_draw,
aWeatherRain_make, aWeatherRain_ct, aWeatherRain_move, aWeatherRain_set, aWeatherRain_draw,
};
static int aWeatherRain_DecideMakeRainCount(ACTOR* actor){
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
static int aWeatherRain_DecideMakeRainCount(ACTOR* actor) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
if(weather->current_level == 1){
if (weather->current_level == 1) {
return 1;
}
return( weather->current_level -2 ? 0 : -1) + 3;
return (weather->current_level - 2 ? 0 : -1) + 3;
}
static void aWeatherRain_make(ACTOR* actor, GAME* game){
static void aWeatherRain_make(ACTOR* actor, GAME* game) {
aWeather_Priv* priv;
xyz_t pos;
xyz_t pos_mod;
@@ -57,84 +53,79 @@ static void aWeatherRain_make(ACTOR* actor, GAME* game){
GAME_PLAY* play = (GAME_PLAY*)game;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
f32 x,y,z;
f32 x, y, z;
count = aWeatherRain_DecideMakeRainCount(actor);
pos = weather->pos;
for(i = 0; i < count; i++){
for (i = 0; i < count; i++) {
priv_num = Common_Get(clip.weather_clip)->get_priv_num(&weather->actor_class);
if (priv_num != -1){
if (priv_num != -1) {
x = -130.0f + (RANDOM_F(260.0f));
z = -200.0f + (RANDOM_F(360.0f));
pos_mod = pos;
speed = ZeroVec;
speed.y = -9.5f + (RANDOM_F(-2.5f));
speed.y = -9.5f + (RANDOM_F(-2.5f));
speed.y += -2.0f;
pos_mod.x += x;
pos_mod.z += z;
if(mEv_CheckTitleDemo() == -9){
if (mEv_CheckTitleDemo() == -9) {
PLAYER_ACTOR* player = get_player_actor_withoutCheck(play);
pos_mod.y = 70.0f + (120.0f + player->actor_class.world.position.y);
}
else{
} else {
pos_mod.y = 70.0f + (120.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(pos_mod, 0.0f));
}
priv = Common_Get(clip.weather_clip)->get_priv(1, 1000, &pos_mod, &speed, actor, priv_num);
if(priv != NULL){
aWeatherRain_ct(priv,game);
if (priv != NULL) {
aWeatherRain_ct(priv, game);
priv->work[0] = 0;
}
}
}
}
static void aWeatherRain_ct(aWeather_Priv*, GAME*){
static void aWeatherRain_ct(aWeather_Priv*, GAME*) {
}
static void aWeatherRain_MoveRain(aWeather_Priv* priv) {
static void aWeatherRain_MoveRain(aWeather_Priv* priv){
priv->pos.x += priv->speed.x;
priv->pos.y += priv->speed.y;
priv->pos.z += priv->speed.z;
priv->pos.x += priv->speed.x;
priv->pos.y += priv->speed.y;
priv->pos.z += priv->speed.z;
}
static void aWeatherRain_MakePicha(ACTOR* actor, GAME* game, xyz_t pos){
static void aWeatherRain_MakePicha(ACTOR* actor, GAME* game, xyz_t pos) {
int priv_num = Common_Get(clip.weather_clip)->get_priv_num(actor);
GAME_PLAY* play = (GAME_PLAY*)game;
aWeather_Priv* priv;
f32 y;
if(priv_num != -1){
if(mEv_CheckTitleDemo() == -9){
if (priv_num != -1) {
if (mEv_CheckTitleDemo() == -9) {
PLAYER_ACTOR* player = get_player_actor_withoutCheck(play);
y = player->actor_class.world.position.y;
pos.y = y;
}
else{
} else {
y = mCoBG_GetBgY_OnlyCenter_FromWpos(pos, 0.0f);
pos.y = y;
}
priv = Common_Get(clip.weather_clip)->get_priv(1, 8, &pos, NULL, actor, priv_num);
if(priv != NULL){
aWeatherRain_ct(priv,game);
if (priv != NULL) {
aWeatherRain_ct(priv, game);
priv->work[0] = 1;
}
}
}
static void aWeatherRain_set(GAME* game){
static void aWeatherRain_set(GAME* game) {
_texture_z_light_fog_prim_xlu(game->graph);
@@ -142,75 +133,78 @@ static void aWeatherRain_set(GAME* game){
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_ame02_setmode);
CLOSE_DISP(game->graph);
}
static void aWeatherRain_move(aWeather_Priv* priv, GAME* game){
static void aWeatherRain_move(aWeather_Priv* priv, GAME* game) {
WEATHER_ACTOR* weather;
s16 timer = (1000 - priv->timer);
if(priv->work[0] == 0){
if (priv->work[0] == 0) {
aWeatherRain_MoveRain(priv);
if((timer >= 10) && (Common_Get(clip.weather_clip) != NULL)){
weather = Common_Get(clip.weather_clip)->actor;
if(weather != NULL){
(Common_Get(clip.weather_clip)->remove_priv(&weather->actor_class, priv->id));
if ((timer >= 10) && (Common_Get(clip.weather_clip) != NULL)) {
weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if (weather != NULL) {
(Common_Get(clip.weather_clip)->remove_priv(&weather->actor_class, priv->id));
aWeatherRain_MakePicha(&weather->actor_class, game, priv->pos);
}
}
}
}
void aWeatherRain_draw(aWeather_Priv* priv, GAME* game){
void aWeatherRain_draw(aWeather_Priv* priv, GAME* game) {
static f32 rain_scale[] = {
0.000299999985145f, 0.035f, 0.01f,
0.000299999985145f,
0.035f,
0.01f,
};
static f32 picha_scale[] = {
0.0033f,0.0033f,0.0033f,
0.0033f,
0.0033f,
0.0033f,
};
GAME_PLAY* play = (GAME_PLAY*)game;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
s16 disp;
s16 disp;
xyz_t pos;
s16 angle;
GRAPH* graph;
Mtx* work;
angle = Common_Get(clip.weather_clip)->actor->current_yAngle;
disp = 8 - priv->timer;
angle = weather->current_yAngle;
disp = 8 - priv->timer;
pos = priv->pos;
if(priv->work[0] == 1){
if (priv->work[0] == 1) {
graph = play->game.graph;
disp = disp >> 1;
Matrix_translate(pos.x,pos.y,pos.z, FALSE);
Matrix_translate(pos.x, pos.y, pos.z, FALSE);
Matrix_mult(&play->billboard_matrix, 1);
Matrix_scale(picha_scale[0], picha_scale[1], picha_scale[2], TRUE);
OPEN_DISP(graph);
OPEN_DISP(graph);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, aWeather_rain_picha_disp[(disp)]);
CLOSE_DISP(graph);
}
else if(priv->work[0] == 0){
} else if (priv->work[0] == 0) {
work = GRAPH_ALLOC_TYPE(game->graph, Mtx, 1);
OPEN_DISP( play->game.graph);
suMtxMakeSRT(work, rain_scale[0], rain_scale[1], rain_scale[2], 0, angle, 0, pos.x, pos.y, pos.z);
OPEN_DISP(play->game.graph);
suMtxMakeSRT(work, rain_scale[0], rain_scale[1], rain_scale[2], 0, angle, 0, pos.x, pos.y, pos.z);
gSPMatrix(NEXT_POLY_XLU_DISP, work, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_ame02_04_modelT);
CLOSE_DISP( play->game.graph);
CLOSE_DISP(play->game.graph);
}
}
+59 -67
View File
@@ -20,50 +20,46 @@ static void aWeatherSakura_set(GAME*);
static void aWeatherSakura_draw(aWeather_Priv*, GAME*);
aWeather_Profile_c iam_weather_sakura = {
aWeatherSakura_make,
aWeatherSakura_ct,
aWeatherSakura_move,
aWeatherSakura_set,
aWeatherSakura_draw,
aWeatherSakura_make, aWeatherSakura_ct, aWeatherSakura_move, aWeatherSakura_set, aWeatherSakura_draw,
};
static int aWeatherSakura_DecideMakeSakuraCount(ACTOR* actor, GAME* game){
static int aWeatherSakura_DecideMakeSakuraCount(ACTOR* actor, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
if(weather->current_level == 1){
if (weather->current_level == 1) {
return (game->frame_counter & 7) == 0;
}
return (game->frame_counter & 3) == 0;
return (game->frame_counter & 3) == 0;
}
static void aWeatherSakura_make(ACTOR* actor, GAME* game){
static void aWeatherSakura_make(ACTOR* actor, GAME* game) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
aWeather_Priv* priv;
f32 x,z;
aWeather_Priv* priv;
f32 x, z;
xyz_t pos = weather->pos;
f32 y = 230.0f + pos.y;
int count = Common_Get(clip.weather_clip)->get_priv_num(actor);
xyz_t base = {0.0f, 0.0f, 0.0f};
int count = Common_Get(clip.weather_clip)->get_priv_num(actor);
xyz_t base = { 0.0f, 0.0f, 0.0f };
xyz_t mod_pos;
if(aWeatherSakura_DecideMakeSakuraCount(actor, game) != 0){
if (aWeatherSakura_DecideMakeSakuraCount(actor, game) != 0) {
base.y = -0.8f + (RANDOM_F(-0.0999999642372f));
if(count != -1){
if (count != -1) {
x = -100.0f + (RANDOM_F(200.0f));
z = -200.0f + (RANDOM_F(380.0f));
mod_pos = pos;
mod_pos.x += x;
mod_pos.z += z;
mod_pos.y = y;
priv = Common_Get(clip.weather_clip)->get_priv(3, 280, &mod_pos, &base, actor, count);
if(priv != NULL){
if (priv != NULL) {
aWeatherSakura_ct(priv, game);
priv->work[3]= 0;
priv->work[3] = 0;
priv->work[4] = 156.5f + (RANDOM_F(260.5));
priv->currentY = y;
}
@@ -71,36 +67,34 @@ static void aWeatherSakura_make(ACTOR* actor, GAME* game){
}
}
static void aWeatherSakura_ct(aWeather_Priv* priv, GAME*){
static void aWeatherSakura_ct(aWeather_Priv* priv, GAME*) {
priv->work[0] = RANDOM_F(65535.0f);
priv->work[1] = RANDOM_F(65535.0f);
priv->work[2] = RANDOM_F(65535.0f);
}
static int aWeatherSakura_CheckSakuraBorder(aWeather_Priv* priv){
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
static int aWeatherSakura_CheckSakuraBorder(aWeather_Priv* priv) {
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
int ret = 0;
f32 sakuraTemp;
xyz_t pos;
if(weather != NULL){
pos = weather->pos;
sakuraTemp =priv->pos.x;
if(sakuraTemp < (-100.0f + pos.x)){
if (weather != NULL) {
pos = weather->pos;
sakuraTemp = priv->pos.x;
if (sakuraTemp < (-100.0f + pos.x)) {
ret |= 2;
}
if(sakuraTemp > (100.0f + pos.x)){
if (sakuraTemp > (100.0f + pos.x)) {
ret |= 8;
}
sakuraTemp =priv->pos.z;
sakuraTemp = priv->pos.z;
if(sakuraTemp > (180.0f + pos.z)){
if (sakuraTemp > (180.0f + pos.z)) {
ret |= 4;
}
if(sakuraTemp < (-200.0f + pos.z)){
if (sakuraTemp < (-200.0f + pos.z)) {
ret |= 1;
}
}
@@ -108,59 +102,59 @@ static int aWeatherSakura_CheckSakuraBorder(aWeather_Priv* priv){
return ret;
}
static void aWeatherSakura_CheckSakuraScroll(aWeather_Priv* priv){
static void aWeatherSakura_CheckSakuraScroll(aWeather_Priv* priv) {
int border = aWeatherSakura_CheckSakuraBorder(priv);
if(border != 0){
if((border >> 1) & 1){
if (border != 0) {
if ((border >> 1) & 1) {
priv->pos.x += 200.0f;
}
if((border >> 3) & 1){
if ((border >> 3) & 1) {
priv->pos.x -= 200.0f;
}
if((border >> 2) & 1){
if ((border >> 2) & 1) {
priv->pos.z -= 380.0f;
}
if(border & 1){
if (border & 1) {
priv->pos.z += 380.0f;
}
}
if(Common_Get(clip.weather_clip) != NULL){
if (Common_Get(clip.weather_clip) != NULL) {
f32 y;
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if(weather != NULL){
if (weather != NULL) {
y = 230.0f + weather->pos.y;
if(priv->pos.y < + weather->pos.y){
if (priv->pos.y < +weather->pos.y) {
priv->pos.y = (y + (priv->pos.y - priv->currentY));
priv->currentY = y;
priv->currentY = y;
}
}
}
}
static void aWeatherSakura_SetWind2Sakura(aWeather_Priv* priv){
static void aWeatherSakura_SetWind2Sakura(aWeather_Priv* priv) {
priv->pos.x += 0.45f;
}
static void aWeatherSakura_move(aWeather_Priv* priv, GAME* game){
GAME_PLAY* play = (GAME_PLAY*) game;
static void aWeatherSakura_move(aWeather_Priv* priv, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
priv->pos.x += priv->speed.x;
priv->pos.y += priv->speed.y;
priv->pos.z += priv->speed.z;
priv->work[3] += priv->work[4];
aWeatherSakura_SetWind2Sakura(priv);
aWeatherSakura_CheckSakuraScroll(priv);
priv->work[0] += 0x200;
priv->work[1] += 0x8DC;
priv->work[2] += 0x474;
priv->work[2] += 0x474;
}
static void aWeatherSakura_set(GAME* game){
static void aWeatherSakura_set(GAME* game) {
_texture_z_light_fog_prim_xlu(game->graph);
@@ -168,41 +162,39 @@ static void aWeatherSakura_set(GAME* game){
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_hanabira01_00_setmode);
CLOSE_DISP(game->graph);
}
void aWeatherSakura_draw(aWeather_Priv* priv, GAME* game){
GAME_PLAY* play = (GAME_PLAY*) game;
void aWeatherSakura_draw(aWeather_Priv* priv, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
xyz_t base = { 0.05f, 0.05f, 0.05f };
xyz_t base = {0.05f, 0.05f, 0.05f};
Mtx* work;
f32 scale;
f32 min;
xyz_t pos;
xyz_t screen_pos;
xyz_t screen_pos;
pos.x = priv->pos.x + (6.0f * sin_s(priv->work[3]));
pos.z = priv->pos.z + (6.0f * cos_s(priv->work[3]));
pos.y = priv->pos.y;
pos.y = priv->pos.y;
Game_play_Projection_Trans(play, &pos, &screen_pos);
if(( screen_pos.x >= 0.0f) && (screen_pos.x < SCREEN_WIDTH_F) && ( screen_pos.y >= 0.0f) && (screen_pos.y < SCREEN_HEIGHT_F)){
if ((screen_pos.x >= 0.0f) && (screen_pos.x < SCREEN_WIDTH_F) && (screen_pos.y >= 0.0f) &&
(screen_pos.y < SCREEN_HEIGHT_F)) {
work = GRAPH_ALLOC_TYPE(game->graph, Mtx, 1);
OPEN_DISP(game->graph);
OPEN_DISP(game->graph);
suMtxMakeSRT(work, base.x, base.y, base.z, priv->work[2], priv->work[1], priv->work[2], pos.x, pos.y, pos.z);
gSPMatrix(NEXT_POLY_XLU_DISP, work, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_hanabira01_00_modelT);
CLOSE_DISP( game->graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_hanabira01_00_modelT);
CLOSE_DISP(game->graph);
}
}
+3 -3
View File
@@ -72,7 +72,7 @@ static void aWeatherSnow_ct(aWeather_Priv*, GAME*) {
}
static int aWeatherSnow_CheckSnowBorder(aWeather_Priv* priv, GAME_PLAY* play) {
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
int ret = 0;
f32 wtemp, ptemp;
if (weather != NULL) {
@@ -120,7 +120,7 @@ static void aWeatherSnow_CheckSnowScroll(aWeather_Priv* priv, GAME_PLAY* play) {
if (Common_Get(clip.weather_clip) != NULL) {
f32 y;
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if (weather != NULL) {
y = 230.0f + weather->pos.y;
@@ -135,7 +135,7 @@ static void aWeatherSnow_CheckSnowScroll(aWeather_Priv* priv, GAME_PLAY* play) {
static void aWeatherSnow_SetWind2Snow(aWeather_Priv* priv) {
if (Common_Get(clip.weather_clip) != NULL) {
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)Common_Get(clip.weather_clip)->actor;
if (weather != NULL) {
priv->pos.x += weather->wind_info.x;
priv->pos.y += weather->wind_info.y;
+10 -11
View File
@@ -60,7 +60,7 @@ extern void sAdo_SysTrgStart(u16 id) {
Na_SysTrgStart(id);
}
extern void sAdo_PlyWalkSe(int walk, const xyz_t* pos) {
extern void sAdo_PlyWalkSe(u16 walk, const xyz_t* pos) {
f32 fcalc;
u16 scalc;
@@ -69,7 +69,7 @@ extern void sAdo_PlyWalkSe(int walk, const xyz_t* pos) {
Na_PlyWalkSe(walk, scalc, fcalc);
}
extern void sAdo_PlyWalkSeRoom(int walk, const xyz_t* pos) {
extern void sAdo_PlyWalkSeRoom(u8 walk, const xyz_t* pos) {
f32 fcalc;
u16 scalc;
@@ -228,7 +228,7 @@ extern void sAdo_SetRhythmInfo(TempoBeat_c* rhythm) {
Na_SetRhythmInfo(rhythm);
}
extern int sAdo_InstCountGet() {
extern s8 sAdo_InstCountGet() {
return Na_InstCountGet();
}
@@ -297,8 +297,8 @@ extern void sAdos_KishaStatusLevel(f32 speed, u32 ongenNum1, u16 angle1, f32 dis
Na_KishaStatusLevel(speed, ongenNum1, angle1, distance1, ongenNum2, angle2, distance2);
}
extern void sAdos_GetRadioCounter(void* p) {
Na_GetRadioCounter(p);
extern int sAdos_GetRadioCounter(Radio_c* radio) {
return Na_GetRadioCounter(radio);
}
extern void sAdos_GetKappaCounter(void* p) {
@@ -306,9 +306,8 @@ extern void sAdos_GetKappaCounter(void* p) {
Na_GetKappaCounter(p);
}
extern void sAdos_GetStaffRollInfo(void* p) {
Na_GetStaffRollInfo(p);
extern void sAdos_GetStaffRollInfo(StaffRollInfo_c* info) {
Na_GetStaffRollInfo(info);
}
extern void sAdos_TTKK_ARM(u8 mode) {
@@ -401,10 +400,10 @@ u16 sAdo_Get_WalkLabel(int type) {
return ret;
}
int sAdo_Get_KokeruLabel(int type) {
u16 sAdo_Get_KokeruLabel(int type) {
u16 label = sAdo_Get_WalkLabel(type);
int ret;
u16 ret;
switch (label) {
case 0x4201:
@@ -471,7 +470,7 @@ extern int sAdo_GameframeEnd_Check() {
return S_ongenpos_refuse_fg;
}
extern int sAdo_GetSoundFrameCounter() {
extern u32 sAdo_GetSoundFrameCounter() {
return Na_GetSoundFrameCounter();
}
+1 -1
View File
@@ -62,7 +62,7 @@ static void bit_cmn_single_draw(GAME* game, mActor_name_t fg_no, xyz_t* pos, f32
bIT_DRAW_AF_PROC draw_af, rgba_t* col);
static int bIT_actor_player_drop_entry(GAME* game, mActor_name_t fg_item, int ut_x, int ut_z, s16 layer);
static int BIT_actor_tree_cutcount_check(GAME* game, int ut_x, int ut_z);
static void bIT_actor_dig_hole_effect_entry(mActor_name_t fg_item, xyz_t* pos, u16 frames, u16 wait_frames);
static int bIT_actor_dig_hole_effect_entry(mActor_name_t fg_item, xyz_t* pos, u16 frames, u16 wait_frames);
static void bIT_actor_bury_hole_effect_entry(mActor_name_t fg_item, xyz_t* pos, u16 frames);
static void bIT_actor_fly_entry(mActor_name_t fg_item, xyz_t* pos, s16 angle_y);
static int bIT_drop_entry_v1(mActor_name_t fg_item, xyz_t* pos, xyz_t* target_pos);
+4 -4
View File
@@ -624,7 +624,7 @@ static int bIT_common_bury_after(mActor_name_t fg_bury_item, mActor_name_t fg_ho
int hole_no = mCoBG_GetHoleNumber(*bury_pos);
if (hole_no != -1) {
*buried_item_p = BURIED_PITFALL_START + hole_no;
*buried_item_p = BURIED_PITFALL_HOLE_START + hole_no;
} else {
*buried_item_p = EMPTY_NO;
}
@@ -1115,7 +1115,7 @@ static void bg_item_tree_fruit_drop(mActor_name_t fg_item, int ut_x, int ut_z, x
}
}
static void bIT_actor_dig_hole_effect_entry(mActor_name_t fg_item, xyz_t* pos, u16 frames, u16 wait_frames) {
static int bIT_actor_dig_hole_effect_entry(mActor_name_t fg_item, xyz_t* pos, u16 frames, u16 wait_frames) {
int ut_x;
int ut_z;
@@ -1124,7 +1124,7 @@ static void bIT_actor_dig_hole_effect_entry(mActor_name_t fg_item, xyz_t* pos, u
mFI_UtNum2DepositOFF(ut_x, ut_z);
}
bIT_actor_hole_effect_entry(bIT_CLIP->bg_item_common_p->hole, fg_item, pos, frames, wait_frames, 1, 0);
return bIT_actor_hole_effect_entry(bIT_CLIP->bg_item_common_p->hole, fg_item, pos, frames, wait_frames, 1, 0);
}
static void bIT_actor_bury_hole_effect_entry(mActor_name_t fg_item, xyz_t* pos, u16 frames) {
@@ -2907,7 +2907,7 @@ static int bIT_actor_pit_fall(mActor_name_t pit_fg_item, int ut_x, int ut_z, mAc
mFI_UtNum2CenterWpos(&pos, ut_x, ut_z);
pos.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(pos, -1.0f);
pitfall_fg_no = pit_fg_item - BURIED_PITFALL_START;
pitfall_fg_no = pit_fg_item - BURIED_PITFALL_HOLE_START;
mFI_SetFG_common(pitfall_fg_no + 0x43, pos, FALSE);
hole_fg_no = pitfall_fg_no + HOLE_START;
bIT_actor_pit_entry(common->pit, 1, hole_fg_no, &pos, fg_item_in_pit);
+111 -120
View File
@@ -74,7 +74,7 @@ static int cKF_FrameControl_passCheck(cKF_FrameControl_c* fc, f32 current, f32*
*out = 0.0f;
cur = fc->current_frame;
if (cur == current) {
return 0;
return FALSE;
}
speed = (fc->start_frame < fc->end_frame) ? fc->speed : -fc->speed;
@@ -83,24 +83,24 @@ static int cKF_FrameControl_passCheck(cKF_FrameControl_c* fc, f32 current, f32*
if ((speed >= 0.0f && cur < current && cur + speed >= current) ||
(speed < 0.0f && cur > current && cur + speed <= current)) {
*out = cur + speed - current; // Calculate overshoot
return 1;
return TRUE;
}
return 0;
return FALSE;
}
extern int cKF_FrameControl_passCheck_now(cKF_FrameControl_c* fc, f32 current) {
f32 cur = fc->current_frame;
f32 speed;
int ret = 0;
int ret = FALSE;
if (cur != current) {
speed = (fc->start_frame < fc->end_frame) ? fc->speed : -fc->speed;
if ((speed >= 0.0f && cur >= current && cur - speed < current) ||
(speed < 0.0f && cur <= current && cur - speed > current)) {
ret = 1;
ret = TRUE;
}
} else {
ret = 1;
ret = TRUE;
}
return ret;
}
@@ -617,7 +617,7 @@ extern void cKF_Si3_draw_SV_R_child(GAME* game, cKF_SkeletonInfo_R_c* keyframe,
joint1 = cur_joint[1];
if ((joint_num[0] == 0) && (keyframe->animation_enabled & cKF_ANIMATION_ROT_X)) {
if ((joint_num[0] == 0) && (keyframe->animation_enabled & cKF_ANIMATION_ROT_Y)) {
joint1.x = keyframe->base_model_rotation.x;
joint1.y = keyframe->updated_base_model_rotation.y;
joint1.z = keyframe->updated_base_model_rotation.z;
@@ -743,13 +743,13 @@ extern void cKF_SkeletonInfo_R_combine_work_set(cKF_SkeletonInfo_R_combine_work_
}
extern void cKF_SkeletonInfo_R_combine_translation(s16** joint, int* flag, cKF_SkeletonInfo_R_combine_work_c* combine,
s8* cwork_num) {
int i = 0;
s8* part_table) {
int i;
for (i; i < 3; i++) {
switch (*cwork_num) {
for (i = 0; i < 3; i++) {
/* Determine which animation we should pull from for the joint */
switch (*part_table) {
case 0:
if (*combine[0].anm_check_bit_tbl & *flag) {
(**joint) =
cKF_KeyCalc(combine[0].anm_data_src_idx, combine[0].anm_key_num[combine[0].anm_key_num_idx],
@@ -760,7 +760,6 @@ extern void cKF_SkeletonInfo_R_combine_translation(s16** joint, int* flag, cKF_S
break;
case 1:
if (*combine[1].anm_check_bit_tbl & *flag) {
(**joint) =
cKF_KeyCalc(combine[1].anm_data_src_idx, combine[1].anm_key_num[combine[1].anm_key_num_idx],
@@ -771,7 +770,6 @@ extern void cKF_SkeletonInfo_R_combine_translation(s16** joint, int* flag, cKF_S
break;
case 2:
if (*combine[2].anm_check_bit_tbl & *flag) {
(**joint) =
cKF_KeyCalc(combine[2].anm_data_src_idx, combine[2].anm_key_num[combine[2].anm_key_num_idx],
@@ -789,12 +787,14 @@ extern void cKF_SkeletonInfo_R_combine_translation(s16** joint, int* flag, cKF_S
} else {
combine[0].anm_const_val_tbl_idx++;
}
if (*combine[1].anm_check_bit_tbl & *flag) {
combine[1].anm_data_src_idx += combine[1].anm_key_num[combine[1].anm_key_num_idx];
combine[1].anm_key_num_idx++;
} else {
combine[1].anm_const_val_tbl_idx++;
}
if (*combine[2].anm_check_bit_tbl & *flag) {
combine[2].anm_data_src_idx += combine[2].anm_key_num[combine[2].anm_key_num_idx];
combine[2].anm_key_num_idx++;
@@ -808,17 +808,17 @@ extern void cKF_SkeletonInfo_R_combine_translation(s16** joint, int* flag, cKF_S
}
extern void cKF_SkeletonInfo_R_combine_rotation(s16** joint, int* flag, cKF_SkeletonInfo_R_combine_work_c* combine,
s8* cwork_num) {
int i = 0;
s8* part_table) {
int i;
int j;
s16* temp;
f32 calc_joint;
for (i; i < combine->keyframe->skeleton->num_joints; i++) {
for (i = 0; i < combine->keyframe->skeleton->num_joints; i++) {
*flag = 4;
for (j = 0; j < 3; j++) {
switch (cwork_num[i + 1]) {
/* Determine which animation we should pull from for the joint */
switch (part_table[i + 1]) {
case 0:
if (*flag & combine[0].anm_check_bit_tbl[i]) {
(**joint) =
@@ -868,54 +868,54 @@ extern void cKF_SkeletonInfo_R_combine_rotation(s16** joint, int* flag, cKF_Skel
combine[2].anm_const_val_tbl_idx++;
}
temp = *joint;
calc_joint = 0.1f * (*temp);
**joint = (s16)(int)((calc_joint - ((f32)(int)(calc_joint * 0.0027777778f) * 360.0f)) * 182.04445f);
/*
* At this point, rotation values in joint are encoded in [degree.x] format.
* This gives one decimal of rotational precision. We then convert from degrees to
* s16 binangle.
*/
/* s16 degree -> float degree with 1 decimal place precision */
calc_joint = 0.1f * (**joint);
/* degree (unbound) -> [0.0f, 360.0f) -> binangle [-32768, 32767] */
**joint = (s16)DEG2SHORT_ANGLE2(MOD_F(calc_joint, 360.0f));
*flag = (u32)*flag >> 1;
*joint += 1;
}
}
}
extern int cKF_SkeletonInfo_R_combine_play(cKF_SkeletonInfo_R_c* info1, cKF_SkeletonInfo_R_c* info2, s8* flag) {
extern int cKF_SkeletonInfo_R_combine_play(cKF_SkeletonInfo_R_c* info1, cKF_SkeletonInfo_R_c* info2, s8* part_table) {
int combinet;
s16* joint;
cKF_SkeletonInfo_R_combine_work_c combine1;
cKF_SkeletonInfo_R_combine_work_c combine2;
cKF_SkeletonInfo_R_combine_work_c combine3;
cKF_SkeletonInfo_R_combine_work_c combine[3];
int i;
int j;
s_xyz* joint2;
s_xyz* applyjoint;
if ((info1 == NULL) || (info2 == NULL) || (flag == NULL)) {
return 0;
if ((info1 == NULL) || (info2 == NULL) || (part_table == NULL)) {
return cKF_STATE_NONE;
}
joint = (F32_IS_ZERO(info1->morph_counter)) ? &info1->current_joint->x : &info1->target_joint->x;
if (info1 != NULL) {
cKF_SkeletonInfo_R_combine_work_set(&combine3, info1);
cKF_SkeletonInfo_R_combine_work_set(&combine[0], info1);
}
if (info2 != NULL) {
cKF_SkeletonInfo_R_combine_work_set(&combine2, info2);
cKF_SkeletonInfo_R_combine_work_set(&combine1, info2);
cKF_SkeletonInfo_R_combine_work_set(&combine[1], info2);
cKF_SkeletonInfo_R_combine_work_set(&combine[2], info2);
}
combinet = 0x20;
cKF_SkeletonInfo_R_combine_translation(&joint, &combinet, &combine3, flag);
cKF_SkeletonInfo_R_combine_rotation(&joint, &combinet, &combine3, flag);
cKF_SkeletonInfo_R_combine_translation(&joint, &combinet, &combine[0], part_table);
cKF_SkeletonInfo_R_combine_rotation(&joint, &combinet, &combine[0], part_table);
if (info1->rotation_diff_table != NULL) {
applyjoint = (F32_IS_ZERO(info1->morph_counter)) ? info1->current_joint : info1->target_joint;
applyjoint += 1;
for (i = 0, j = 0; i < info1->skeleton->num_joints; i++, j++) {
applyjoint->x += info1->rotation_diff_table[j].x;
applyjoint->y += info1->rotation_diff_table[j].y;
applyjoint->z += info1->rotation_diff_table[j].z;
for (i = 0; i < info1->skeleton->num_joints; i++) {
applyjoint->x += info1->rotation_diff_table[i].x;
applyjoint->y += info1->rotation_diff_table[i].y;
applyjoint->z += info1->rotation_diff_table[i].z;
applyjoint++;
}
@@ -923,95 +923,89 @@ extern int cKF_SkeletonInfo_R_combine_play(cKF_SkeletonInfo_R_c* info1, cKF_Skel
if (F32_IS_ZERO(info1->morph_counter)) {
cKF_FrameControl_play(&info2->frame_control);
return cKF_FrameControl_play(&info1->frame_control);
}
if (info1->morph_counter > 0.0f) {
} else if (info1->morph_counter > 0.0f) {
cKF_SkeletonInfo_R_morphJoint(info1);
info1->morph_counter -= 0.5f;
if (info1->morph_counter <= 0.0f) {
info1->morph_counter = 0.0f;
}
return 0;
return cKF_STATE_NONE;
} else {
cKF_SkeletonInfo_R_morphJoint(info1);
info1->morph_counter += 0.5f;
if (info1->morph_counter >= 0.0f) {
info1->morph_counter = 0.0f;
}
cKF_FrameControl_play(&info2->frame_control);
return cKF_FrameControl_play(&info1->frame_control);
}
cKF_SkeletonInfo_R_morphJoint(info1);
info1->morph_counter += 0.5f;
if (info1->morph_counter >= 0.0f) {
info1->morph_counter = 0.0f;
}
cKF_FrameControl_play(&info2->frame_control);
return cKF_FrameControl_play(&info1->frame_control);
}
extern void cKF_SkeletonInfo_R_T_combine_play(int* arg1, int* arg2, int* arg3, cKF_SkeletonInfo_R_c* info1,
cKF_SkeletonInfo_R_c* info2, cKF_SkeletonInfo_R_c* info3, s8* flag) {
extern void cKF_SkeletonInfo_R_T_combine_play(int* state1, int* state2, int* state3, cKF_SkeletonInfo_R_c* info1,
cKF_SkeletonInfo_R_c* info2, cKF_SkeletonInfo_R_c* info3,
s8* part_table) {
int combinet;
s16* joint;
cKF_SkeletonInfo_R_combine_work_c combine1;
cKF_SkeletonInfo_R_combine_work_c combine2;
cKF_SkeletonInfo_R_combine_work_c combine3;
cKF_SkeletonInfo_R_combine_work_c combine[3];
int i;
int j;
s_xyz* joint2;
s_xyz* applyjoint;
if ((info1 == NULL) || (info2 == NULL) || (info3 == NULL) || (flag == NULL)) {
if ((info1 == NULL) || (info2 == NULL) || (info3 == NULL) || (part_table == NULL)) {
return;
}
joint = (F32_IS_ZERO(info1->morph_counter)) ? &info1->current_joint->x : &info1->target_joint->x;
if (info1 != NULL) {
cKF_SkeletonInfo_R_combine_work_set(&combine3, info1);
cKF_SkeletonInfo_R_combine_work_set(&combine[0], info1);
}
if (info2 != NULL) {
cKF_SkeletonInfo_R_combine_work_set(&combine2, info2);
cKF_SkeletonInfo_R_combine_work_set(&combine[1], info2);
}
if (info3 != NULL) {
cKF_SkeletonInfo_R_combine_work_set(&combine1, info3);
cKF_SkeletonInfo_R_combine_work_set(&combine[2], info3);
}
combinet = 0x20;
cKF_SkeletonInfo_R_combine_translation(&joint, &combinet, &combine3, flag);
cKF_SkeletonInfo_R_combine_rotation(&joint, &combinet, &combine3, flag);
cKF_SkeletonInfo_R_combine_translation(&joint, &combinet, &combine[0], part_table);
cKF_SkeletonInfo_R_combine_rotation(&joint, &combinet, &combine[0], part_table);
if (info1->rotation_diff_table != NULL) {
applyjoint = (F32_IS_ZERO(info1->morph_counter)) ? info1->current_joint : info1->target_joint;
applyjoint += 1;
for (i = 0, j = 0; i < info1->skeleton->num_joints; i++, j++) {
applyjoint->x += info1->rotation_diff_table[j].x;
applyjoint->y += info1->rotation_diff_table[j].y;
applyjoint->z += info1->rotation_diff_table[j].z;
for (i = 0; i < info1->skeleton->num_joints; i++) {
applyjoint->x += info1->rotation_diff_table[i].x;
applyjoint->y += info1->rotation_diff_table[i].y;
applyjoint->z += info1->rotation_diff_table[i].z;
applyjoint++;
}
}
if (F32_IS_ZERO(info1->morph_counter)) {
*arg1 = cKF_FrameControl_play(&info1->frame_control);
*arg2 = cKF_FrameControl_play(&info2->frame_control);
*arg3 = cKF_FrameControl_play(&info3->frame_control);
return;
}
if (info1->morph_counter > 0.0f) {
*state1 = cKF_FrameControl_play(&info1->frame_control);
*state2 = cKF_FrameControl_play(&info2->frame_control);
*state3 = cKF_FrameControl_play(&info3->frame_control);
} else if (info1->morph_counter > 0.0f) {
cKF_SkeletonInfo_R_morphJoint(info1);
info1->morph_counter -= 0.5f;
if (info1->morph_counter <= 0.0f) {
info1->morph_counter = 0.0f;
}
*arg1 = 0;
*arg2 = 0;
*arg3 = 0;
return;
*state1 = cKF_STATE_NONE;
*state2 = cKF_STATE_NONE;
*state3 = cKF_STATE_NONE;
} else {
cKF_SkeletonInfo_R_morphJoint(info1);
info1->morph_counter += 0.5f;
if (info1->morph_counter >= 0.0f) {
info1->morph_counter = 0.0f;
}
*state1 = cKF_FrameControl_play(&info1->frame_control);
*state2 = cKF_FrameControl_play(&info2->frame_control);
*state3 = cKF_FrameControl_play(&info3->frame_control);
}
cKF_SkeletonInfo_R_morphJoint(info1);
info1->morph_counter += 0.5f;
if (info1->morph_counter >= 0.0f) {
info1->morph_counter = 0.0f;
}
*arg1 = cKF_FrameControl_play(&info1->frame_control);
*arg2 = cKF_FrameControl_play(&info2->frame_control);
*arg3 = cKF_FrameControl_play(&info3->frame_control);
}
extern void cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(cKF_SkeletonInfo_R_c* keyframe, f32 transx, f32 transy,
@@ -1030,14 +1024,10 @@ extern void cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(cKF_SkeletonInfo_R_c
keyframe->updated_base_model_rotation.z = anglez;
}
extern void cKF_SkeletonInfo_R_AnimationMove_ct_base(f32 counter, xyz_t* basepos, xyz_t* correctpos, s16 ybase,
s16 yidle, cKF_SkeletonInfo_R_c* keyframe, int an_flag) {
int sub;
extern void cKF_SkeletonInfo_R_AnimationMove_ct_base(xyz_t* basepos, xyz_t* correctpos, s16 ybase, s16 yidle,
f32 counter, cKF_SkeletonInfo_R_c* keyframe, int an_flag) {
keyframe->animation_enabled = an_flag;
keyframe->fixed_counter = (counter >= 0.0f) ? counter : -counter;
keyframe->base_world_position = ZeroVec;
keyframe->model_world_position_correction = ZeroVec;
@@ -1059,12 +1049,13 @@ extern void cKF_SkeletonInfo_R_AnimationMove_ct_base(f32 counter, xyz_t* basepos
keyframe->base_angle_y = yidle;
keyframe->model_angle_correction = 0;
if (an_flag & cKF_ANIMATION_ROT_X) {
sub = ybase - yidle;
if (sub > 0x8000) {
sub = -(0x10000 - sub);
} else if (sub < -0x8000) {
sub += 0x10000;
if (an_flag & cKF_ANIMATION_ROT_Y) {
int sub = ybase - yidle;
if (sub > DEG2SHORT_ANGLE2(180.0f)) {
sub = -(DEG2SHORT_ANGLE2(360.0f) - sub);
} else if (sub < DEG2SHORT_ANGLE2(-180.0f)) {
sub += DEG2SHORT_ANGLE2(360.0f);
}
keyframe->base_angle_y = yidle;
keyframe->model_angle_correction = sub;
@@ -1082,7 +1073,7 @@ extern void cKF_SkeletonInfo_R_AnimationMove_dt(cKF_SkeletonInfo_R_c* keyframe)
if (an_flag & cKF_ANIMATION_TRANS_Y) {
cur_joint->y = keyframe->base_model_translation.y;
}
if (an_flag & cKF_ANIMATION_ROT_X) {
if (an_flag & cKF_ANIMATION_ROT_Y) {
cur_joint = keyframe->current_joint;
cur_joint[1].x = keyframe->base_model_rotation.x;
cur_joint[1].y = keyframe->base_model_rotation.y;
@@ -1091,7 +1082,7 @@ extern void cKF_SkeletonInfo_R_AnimationMove_dt(cKF_SkeletonInfo_R_c* keyframe)
keyframe->animation_enabled = 0;
}
extern void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* base, s_xyz* sbase, xyz_t* move, s16 yidle,
extern void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* base, s16* sbase, xyz_t* scale, s16 yidle,
cKF_SkeletonInfo_R_c* keyframe) {
f32 fc = keyframe->fixed_counter;
f32 count = 1.0f + fc;
@@ -1117,7 +1108,7 @@ extern void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* base, s_xyz* sbase, xyz
correct_y = 0.0f;
}
if (an_flag & cKF_ANIMATION_ROT_X) {
if (an_flag & cKF_ANIMATION_ROT_Y) {
mangle_y = keyframe->model_angle_correction;
if (count > 0.5f) {
keyframe->model_angle_correction -= (s16)(int)(mangle_y * correct_y);
@@ -1153,7 +1144,7 @@ extern void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* base, s_xyz* sbase, xyz
keyframe->model_world_position_correction.z = 0.0f;
}
if ((sbase != NULL) && (an_flag & cKF_ANIMATION_ROT_X)) {
if ((sbase != NULL) && (an_flag & cKF_ANIMATION_ROT_Y)) {
angley = keyframe->base_angle_y;
angle_c = keyframe->model_angle_correction;
base_x = keyframe->base_model_rotation.x;
@@ -1162,14 +1153,14 @@ extern void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* base, s_xyz* sbase, xyz
Matrix_rotateXYZ(keyframe->current_joint[1].x, keyframe->current_joint[1].y, keyframe->current_joint[1].z, 0);
Matrix_to_rotate2_new(get_Matrix_now(), update_base, 0);
Matrix_pull();
sbase->x = angley + angle_c + (update_base->x - base_x);
*sbase = angley + angle_c + (update_base->x - base_x);
}
if (base != NULL) {
cur_joint = keyframe->current_joint;
sub = 0;
if (sbase != NULL) {
sub = sbase->x - yidle;
sub = *sbase - yidle;
}
if (an_flag & cKF_ANIMATION_TRANS_XZ) {
f32 move_x, move_z;
@@ -1184,9 +1175,9 @@ extern void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* base, s_xyz* sbase, xyz
cos = cos_s(sub);
temp1 = (trans_x * cos) + (trans_z * sin);
move_x = move->x * (cur_joint->x - temp1);
move_x = scale->x * (cur_joint->x - temp1);
temp1 = (-trans_x * sin) + (trans_z * cos);
move_z = move->z * (cur_joint->z - temp1);
move_z = scale->z * (cur_joint->z - temp1);
sin = sin_s(yidle);
cos = cos_s(yidle);
@@ -1199,7 +1190,7 @@ extern void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* base, s_xyz* sbase, xyz
base->z = temp2 + (keyframe->base_world_position.z + base_z);
}
if (an_flag & cKF_ANIMATION_TRANS_Y) {
base->y = move->y * (cur_joint->y - keyframe->base_model_translation.y) +
base->y = scale->y * (cur_joint->y - keyframe->base_model_translation.y) +
(keyframe->base_world_position.y + keyframe->model_world_position_correction.y);
}
}
@@ -1210,25 +1201,25 @@ extern void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* base, s_xyz* sbase, xyz
keyframe->fixed_counter = count;
}
extern void cKF_SkeletonInfo_R_AnimationMove_CulcTransToWorld(f32 calcx, f32 calcy, f32 calcz, xyz_t* base,
xyz_t* calcp, s16 val, xyz_t* trans,
cKF_SkeletonInfo_R_c* keyframe, int animation_flag) {
extern void cKF_SkeletonInfo_R_AnimationMove_CulcTransToWorld(xyz_t* calc_pos, const xyz_t* base_pos, f32 trans_x,
f32 trans_y, f32 trans_z, s16 angle_y, const xyz_t* scale,
cKF_SkeletonInfo_R_c* keyframe, int trans_flag) {
f32 sin, cos;
f32 j_x, j_z;
s_xyz* cur_joint = keyframe->current_joint;
if (animation_flag & cKF_ANIMATION_TRANS_XZ) {
j_x = cur_joint->x - calcx;
j_z = cur_joint->z - calcz;
if (trans_flag & cKF_ANIMATION_TRANS_XZ) {
j_x = cur_joint->x - trans_x;
j_z = cur_joint->z - trans_z;
sin = sin_s(val);
cos = cos_s(val);
sin = sin_s(angle_y);
cos = cos_s(angle_y);
base->x = calcp->x + trans->x * ((j_x * cos) + (j_z * sin));
base->z = calcp->z + trans->z * ((-j_x * sin) + (j_z * cos));
calc_pos->x = base_pos->x + scale->x * ((j_x * cos) + (j_z * sin));
calc_pos->z = base_pos->z + scale->z * ((-j_x * sin) + (j_z * cos));
}
if (animation_flag & cKF_ANIMATION_TRANS_Y) {
base->y = calcp->y + trans->y * (cur_joint->y - calcy);
if (trans_flag & cKF_ANIMATION_TRANS_Y) {
calc_pos->y = base_pos->y + scale->y * (cur_joint->y - trans_y);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,77 @@
#include "libforest/gbi_extensions.h"
static u16 rom_open_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/rom_open_pal.inc"
};
static u8 rom_open_floor_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/rom_open_floor_tex.inc"
};
static u8 rom_open_shade_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/rom_open_shade_tex.inc"
};
static u8 rom_open_spot2_tex_rgb_i4[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/rom_open_spot2_tex_rgb_i4.inc"
};
static u8 rom_open_spot_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/rom_open_spot_tex.inc"
};
static Vtx grd_player_select_v[] = {
#include "assets/field/bg/grd_player_select_v.inc"
};
extern Gfx grd_player_select_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, TEXEL1, TEXEL1, 0, 0, 0, COMBINED,
COMBINED, 0, PRIM_LOD_FRAC, 0),
gsDPSetPrimColor(0, 150, 255, 255, 255, 255),
gsDPSetEnvColor(0xFF, 0xFF, 0x82, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(rom_open_spot2_tex_rgb_i4, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 15, 15),
gsDPSetTextureImage_Dolphin(G_IM_FMT_I, G_IM_SIZ_8b, 32, 64, rom_open_spot_tex),
gsDPSetTile_Dolphin(G_DOLPHIN_TLUT_DEFAULT_MODE, 1, 0, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_FOG | G_SHADING_SMOOTH),
gsSPVertex(&grd_player_select_v[12], 4, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 0, 0 // tri2
),
gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
gsDPSetPrimColor(0, 255, 0, 0, 0, 255),
gsDPLoadTextureBlock_4b_Dolphin(rom_open_shade_tex, G_IM_FMT_I, 32, 64, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPVertex(&grd_player_select_v[16], 4, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 0, 0 // tri2
),
gsSPEndDisplayList(),
};
extern Gfx grd_player_select_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, PRIMITIVE, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
gsDPSetPrimColor(0, 255, 255, 255, 255, 255),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, rom_open_pal),
gsDPLoadTextureBlock_4b_Dolphin(rom_open_floor_tex, G_IM_FMT_CI, 64, 64, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_SHADING_SMOOTH),
gsSPVertex(&grd_player_select_v[0], 12, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 6, 7, // tri0
8, 9, 10, // tri1
8, 10, 11, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,9 @@
#include "evw_anime.h"
/* @HACK - this is probably aligned to 32 bytes because it and the other data were compiled into a single object file
the other TU has things aligned to 32 bytes */
static EVW_ANIME_SCROLL grd_player_select_evw_anime_1[] ATTRIBUTE_ALIGN(32) = { { 1, 1, 32, 32 }, { 0, 0, 32, 64 } };
extern EVW_ANIME_DATA grd_player_select_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_player_select_evw_anime_1 },
};
@@ -0,0 +1,670 @@
#include "libforest/gbi_extensions.h"
static u16 yubin_k_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_k_pal.inc"
};
static u16 yubin_k2_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_k2_pal.inc"
};
static u16 yubin_floor_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_floor_pal.inc"
};
static u16 yubin_hakari_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_hakari_pal.inc"
};
static u16 yubin_wall_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_wall_pal.inc"
};
static u16 yubin_letter_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_letter_pal.inc"
};
static u16 yubin_us_bag_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_us_bag_pal.inc"
};
static u16 zzzyubin_tree_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/zzzyubin_tree_pal.inc"
};
static u16 yubin_t_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_t_pal.inc"
};
static u16 yubin_us_card_pal[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_us_card_pal.inc"
};
static u8 yuibn_kaunta01_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yuibn_kaunta01_tex.inc"
};
static u8 yuibn_kaunta02_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yuibn_kaunta02_tex.inc"
};
static u8 yuibn_desk01_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yuibn_desk01_tex.inc"
};
static u8 yubin_ark01_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_ark01_tex.inc"
};
static u8 yuibn_kaunta03_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yuibn_kaunta03_tex.inc"
};
static u8 yuibn_kaunta04_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yuibn_kaunta04_tex.inc"
};
static u8 yubin_floor01_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_floor01_tex.inc"
};
static u8 yubin_floor02_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_floor02_tex.inc"
};
static u8 yubin_floor03_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_floor03_tex.inc"
};
static u8 yubin_hakari01_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_hakari01_tex.inc"
};
static u8 yubin_hakari02_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_hakari02_tex.inc"
};
static u8 yubin_hakari03_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_hakari03_tex.inc"
};
static u8 yubin_wall04_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_wall04_tex.inc"
};
static u8 yubin_letter01_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_letter01_tex.inc"
};
static u8 yubin_window_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_window_tex.inc"
};
static u8 yubin_us_bag_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_us_bag_tex.inc"
};
static u8 yubin_tree2_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_tree2_tex.inc"
};
static u8 yubin_tree_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_tree_tex.inc"
};
static u8 yubin_tree3_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_tree3_tex.inc"
};
static u8 yubin_tree4_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_tree4_tex.inc"
};
static u8 yubin_step_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_step_tex.inc"
};
static u8 rom_yubinkyoku_akril_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/rom_yubinkyoku_akril_tex.inc"
};
static u8 rom_yubinkyoku_shede_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/rom_yubinkyoku_shede_tex.inc"
};
static u8 yubin_us_card_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_us_card_tex.inc"
};
static u8 yubin_us_mat_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_us_mat_tex.inc"
};
static u8 rom_yubinkyoku_shadow_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/rom_yubinkyoku_shadow_tex.inc"
};
static u8 yubin_us_card2_tex[] ATTRIBUTE_ALIGN(32) = {
#include "assets/field/bg/yubin_us_card2_tex.inc"
};
static Vtx grd_post_office_v[] = {
#include "assets/field/bg/grd_post_office_v.inc"
};
extern Gfx grd_post_office_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0,
COMBINED),
gsDPSetPrimColor(0, 255, 255, 255, 255, 120),
gsDPSetEnvColor(0x00, 0x64, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(rom_yubinkyoku_akril_tex, G_IM_FMT_I, 16, 16, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[197], 4, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 0, 0 // tri2
),
gsSPEndDisplayList(),
};
extern Gfx grd_post_office_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_wall_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_window_tex, G_IM_FMT_CI, 16, 16, 15, GX_MIRROR, GX_MIRROR, 0, 0),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_SHADING_SMOOTH),
gsSPVertex(&grd_post_office_v[217], 8, 0),
gsSPNTrianglesInit_5b(4, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 6, 7, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_k_pal),
gsDPLoadTextureBlock_4b_Dolphin(yuibn_kaunta04_tex, G_IM_FMT_CI, 32, 32, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[225], 4, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, zzzyubin_tree_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_tree_tex, G_IM_FMT_CI, 16, 32, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[229], 20, 0),
gsSPNTrianglesInit_5b(8, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 6, 7, // tri0
8, 9, 10, // tri1
8, 10, 11, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(12, 14, 15, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(yubin_tree2_tex, G_IM_FMT_CI, 32, 48, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPNTrianglesInit_5b(2, // tri count
16, 17, 18, // tri0
16, 18, 19, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_k2_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_ark01_tex, G_IM_FMT_CI, 32, 64, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[249], 32, 0),
gsSPNTrianglesInit_5b(25, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
1, 4, 5 // tri2
),
gsSPNTriangles_5b(1, 5, 2, // tri0
4, 6, 7, // tri1
4, 7, 5, // tri2
6, 8, 9 // tri3
),
gsSPNTriangles_5b(6, 9, 7, // tri0
8, 10, 11, // tri1
8, 11, 9, // tri2
10, 12, 13 // tri3
),
gsSPNTriangles_5b(10, 13, 11, // tri0
12, 14, 15, // tri1
12, 15, 13, // tri2
16, 17, 18 // tri3
),
gsSPNTriangles_5b(16, 18, 19, // tri0
20, 0, 3, // tri1
20, 3, 21, // tri2
22, 23, 20 // tri3
),
gsSPNTriangles_5b(22, 20, 21, // tri0
24, 25, 3, // tri1
24, 3, 26, // tri2
27, 28, 29 // tri3
),
gsSPNTriangles_5b(27, 29, 30, // tri0
27, 30, 31, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_post_office_v[281], 32, 0),
gsSPNTrianglesInit_5b(21, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 3, 4 // tri2
),
gsSPNTriangles_5b(0, 4, 5, // tri0
0, 5, 6, // tri1
0, 6, 7, // tri2
0, 7, 8 // tri3
),
gsSPNTriangles_5b(9, 10, 11, // tri0
9, 11, 12, // tri1
11, 13, 14, // tri2
11, 14, 15 // tri3
),
gsSPNTriangles_5b(16, 17, 18, // tri0
16, 18, 19, // tri1
17, 20, 1, // tri2
17, 1, 21 // tri3
),
gsSPNTriangles_5b(22, 23, 24, // tri0
22, 24, 25, // tri1
26, 27, 28, // tri2
26, 28, 29 // tri3
),
gsSPNTriangles_5b(27, 30, 3, // tri0
27, 3, 31, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_post_office_v[313], 4, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_us_bag_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_us_bag_tex, G_IM_FMT_CI, 48, 48, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[317], 10, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
0, 4, 1 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
7, 8, 9, // tri1
5, 7, 9, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_floor_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_floor03_tex, G_IM_FMT_CI, 32, 16, 15, GX_MIRROR, GX_MIRROR, 0, 0),
gsSPVertex(&grd_post_office_v[327], 4, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_hakari_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_hakari03_tex, G_IM_FMT_CI, 32, 16, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[331], 8, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 0, 0 // tri2
),
gsDPLoadTextureBlock_4b_Dolphin(yubin_hakari02_tex, G_IM_FMT_CI, 16, 16, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPNTrianglesInit_5b(2, // tri count
4, 5, 6, // tri0
4, 6, 7, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_letter_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_letter01_tex, G_IM_FMT_CI, 16, 32, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[339], 7, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
2, 4, 5 // tri2
),
gsSPNTriangles_5b(2, 5, 3, // tri0
2, 1, 6, // tri1
2, 6, 4, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_floor_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_us_mat_tex, G_IM_FMT_CI, 48, 32, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[346], 22, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_us_card_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_us_card_tex, G_IM_FMT_CI, 32, 64, 15, GX_MIRROR, GX_MIRROR, 0, 0),
gsSPNTrianglesInit_5b(10, // tri count
4, 5, 6, // tri0
5, 7, 6, // tri1
8, 9, 10 // tri2
),
gsSPNTriangles_5b(8, 10, 11, // tri0
12, 13, 14, // tri1
15, 16, 13, // tri2
17, 15, 13 // tri3
),
gsSPNTriangles_5b(12, 17, 13, // tri0
18, 19, 20, // tri1
18, 21, 19, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_t_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_step_tex, G_IM_FMT_CI, 32, 16, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[0], 6, 0),
gsSPNTrianglesInit_5b(4, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
2, 4, 0 // tri2
),
gsSPNTriangles_5b(0, 5, 3, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_wall_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_wall04_tex, G_IM_FMT_CI, 32, 48, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[6], 32, 0),
gsSPNTrianglesInit_5b(26, // tri count
0, 1, 2, // tri0
3, 2, 1, // tri1
1, 0, 4 // tri2
),
gsSPNTriangles_5b(3, 5, 2, // tri0
3, 6, 5, // tri1
7, 4, 8, // tri2
4, 0, 8 // tri3
),
gsSPNTriangles_5b(9, 10, 11, // tri0
10, 12, 11, // tri1
13, 14, 15, // tri2
14, 16, 15 // tri3
),
gsSPNTriangles_5b(15, 17, 11, // tri0
9, 11, 17, // tri1
15, 16, 17, // tri2
18, 4, 7 // tri3
),
gsSPNTriangles_5b(19, 18, 7, // tri0
14, 13, 6, // tri1
3, 14, 6, // tri2
20, 21, 22 // tri3
),
gsSPNTriangles_5b(21, 23, 22, // tri0
20, 22, 24, // tri1
20, 24, 25, // tri2
20, 25, 26 // tri3
),
gsSPNTriangles_5b(27, 26, 25, // tri0
28, 29, 30, // tri1
29, 31, 30, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_post_office_v[38], 32, 0),
gsSPNTrianglesInit_5b(34, // tri count
0, 1, 2, // tri0
3, 0, 2, // tri1
4, 1, 0 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
8, 9, 10, // tri1
8, 5, 9, // tri2
5, 7, 9 // tri3
),
gsSPNTriangles_5b(7, 10, 9, // tri0
5, 11, 6, // tri1
11, 12, 6, // tri2
5, 13, 11 // tri3
),
gsSPNTriangles_5b(13, 12, 11, // tri0
14, 15, 16, // tri1
17, 14, 16, // tri2
16, 15, 18 // tri3
),
gsSPNTriangles_5b(17, 16, 18, // tri0
19, 12, 20, // tri1
17, 19, 20, // tri2
13, 17, 20 // tri3
),
gsSPNTriangles_5b(13, 20, 12, // tri0
17, 21, 19, // tri1
17, 22, 21, // tri2
17, 18, 22 // tri3
),
gsSPNTriangles_5b(23, 3, 2, // tri0
23, 2, 24, // tri1
23, 24, 25, // tri2
26, 27, 28 // tri3
),
gsSPNTriangles_5b(26, 23, 27, // tri0
23, 25, 27, // tri1
25, 28, 27, // tri2
23, 29, 3 // tri3
),
gsSPNTriangles_5b(29, 30, 3, // tri0
23, 31, 29, // tri1
31, 30, 29, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_floor_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_floor01_tex, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_MIRROR, 0, 0),
gsSPVertex(&grd_post_office_v[70], 32, 0),
gsSPNTrianglesInit_5b(25, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 2, 6, // tri0
5, 7, 2, // tri1
4, 6, 8, // tri2
9, 4, 10 // tri3
),
gsSPNTriangles_5b(4, 8, 10, // tri0
11, 12, 13, // tri1
3, 14, 15, // tri2
16, 3, 0 // tri3
),
gsSPNTriangles_5b(17, 18, 19, // tri0
17, 20, 18, // tri1
20, 21, 18, // tri2
21, 22, 18 // tri3
),
gsSPNTriangles_5b(23, 20, 17, // tri0
21, 20, 24, // tri1
25, 17, 19, // tri2
26, 25, 27 // tri3
),
gsSPNTriangles_5b(26, 17, 25, // tri0
26, 23, 17, // tri1
21, 28, 22, // tri2
29, 30, 31 // tri3
),
gsSPNTriangles_5b(21, 24, 31, // tri0
30, 21, 31, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(yubin_floor02_tex, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_MIRROR, 0, 0),
gsSPVertex(&grd_post_office_v[102], 32, 0),
gsSPNTrianglesInit_5b(24, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 3, 5 // tri2
),
gsSPNTriangles_5b(4, 7, 5, // tri0
4, 8, 7, // tri1
9, 0, 2, // tri2
9, 8, 0 // tri3
),
gsSPNTriangles_5b(9, 10, 8, // tri0
9, 11, 10, // tri1
12, 8, 10, // tri2
13, 12, 10 // tri3
),
gsSPNTriangles_5b(13, 10, 14, // tri0
11, 15, 10, // tri1
13, 14, 16, // tri2
17, 18, 19 // tri3
),
gsSPNTriangles_5b(17, 20, 18, // tri0
21, 22, 23, // tri1
22, 19, 23, // tri2
19, 18, 23 // tri3
),
gsSPNTriangles_5b(21, 24, 22, // tri0
21, 25, 24, // tri1
21, 26, 25, // tri2
27, 28, 25 // tri3
),
gsSPNTriangles_5b(29, 30, 20, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_post_office_v[133], 3, 0),
gsSPNTrianglesInit_5b(1, // tri count
0, 1, 2, // tri0
0, 0, 0, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_k_pal),
gsDPLoadTextureBlock_4b_Dolphin(yuibn_kaunta03_tex, G_IM_FMT_CI, 32, 16, 15, GX_MIRROR, GX_MIRROR, 0, 0),
gsSPVertex(&grd_post_office_v[136], 28, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 0, 0 // tri2
),
gsDPLoadTextureBlock_4b_Dolphin(yuibn_desk01_tex, G_IM_FMT_CI, 32, 32, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPNTrianglesInit_5b(2, // tri count
4, 5, 6, // tri0
4, 6, 7, // tri1
0, 0, 0 // tri2
),
gsDPLoadTextureBlock_4b_Dolphin(yuibn_kaunta02_tex, G_IM_FMT_CI, 32, 32, 15, GX_MIRROR, GX_MIRROR, 0, 0),
gsSPNTrianglesInit_5b(4, // tri count
8, 9, 10, // tri0
8, 10, 11, // tri1
12, 13, 14 // tri2
),
gsSPNTriangles_5b(12, 14, 15, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(yuibn_kaunta01_tex, G_IM_FMT_CI, 32, 32, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPNTrianglesInit_5b(6, // tri count
16, 17, 18, // tri0
16, 18, 19, // tri1
20, 21, 22 // tri2
),
gsSPNTriangles_5b(20, 22, 23, // tri0
24, 25, 26, // tri1
24, 26, 27, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, zzzyubin_tree_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_tree4_tex, G_IM_FMT_CI, 16, 16, 15, GX_MIRROR, GX_MIRROR, 0, 0),
gsSPVertex(&grd_post_office_v[164], 14, 0),
gsSPNTrianglesInit_5b(4, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
0, 3, 4 // tri2
),
gsSPNTriangles_5b(0, 4, 5, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(yubin_tree3_tex, G_IM_FMT_CI, 16, 16, 15, GX_MIRROR, GX_MIRROR, 0, 0),
gsSPNTrianglesInit_5b(6, // tri count
6, 7, 8, // tri0
6, 8, 9, // tri1
7, 10, 11 // tri2
),
gsSPNTriangles_5b(7, 11, 8, // tri0
10, 12, 13, // tri1
10, 13, 11, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_hakari_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_hakari01_tex, G_IM_FMT_CI, 16, 32, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[178], 7, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
4, 2, 1 // tri2
),
gsSPNTriangles_5b(4, 1, 5, // tri0
6, 3, 2, // tri1
6, 2, 4, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, yubin_us_card_pal),
gsDPLoadTextureBlock_4b_Dolphin(yubin_us_card2_tex, G_IM_FMT_CI, 32, 16, 15, GX_CLAMP, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[185], 4, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
0, 0, 0 // tri2
),
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PASS2),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsSPVertex(&grd_post_office_v[189], 8, 0),
gsSPNTrianglesInit_5b(4, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIM_LOD_FRAC, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
gsDPSetPrimColor(0, 120, 10, 0, 30, 255),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_DECAL2),
gsDPLoadTextureBlock_4b_Dolphin(rom_yubinkyoku_shadow_tex, G_IM_FMT_I, 16, 32, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[201], 8, 0),
gsSPNTrianglesInit_5b(4, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 6, 7, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(rom_yubinkyoku_shede_tex, G_IM_FMT_I, 16, 32, 15, GX_MIRROR, GX_CLAMP, 0, 0),
gsSPVertex(&grd_post_office_v[209], 8, 0),
gsSPNTrianglesInit_5b(4, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 6, 7, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,297 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_1_v[] = {
#include "assets/field/bg/grd_s_c1_1_v.inc"
};
extern Gfx grd_s_c1_1_modelT[] = {
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_1_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_1_v[201], 29, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
7, 4, 8, // tri0
9, 7, 10, // tri1
11, 9, 12, // tri2
13, 11, 14 // tri3
),
gsSPNTriangles_5b(
0, 15, 16, // tri0
17, 18, 19, // tri1
18, 3, 20, // tri2
3, 1, 20 // tri3
),
gsSPNTriangles_5b(
21, 22, 23, // tri0
24, 21, 23, // tri1
15, 24, 25, // tri2
21, 26, 22 // tri3
),
gsSPNTriangles_5b(
26, 27, 28, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_1_v[0], 32, 0),
gsSPNTrianglesInit_5b(
18, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
3, 6, 4 // tri2
),
gsSPNTriangles_5b(
7, 5, 8, // tri0
7, 9, 5, // tri1
5, 4, 8, // tri2
10, 11, 12 // tri3
),
gsSPNTriangles_5b(
11, 13, 12, // tri0
14, 7, 15, // tri1
7, 16, 15, // tri2
16, 17, 15 // tri3
),
gsSPNTriangles_5b(
18, 19, 20, // tri0
19, 21, 20, // tri1
22, 23, 24, // tri2
23, 25, 24 // tri3
),
gsSPNTriangles_5b(
26, 10, 12, // tri0
27, 28, 29, // tri1
28, 30, 29, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_1_v[31], 32, 0),
gsSPNTrianglesInit_5b(
18, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
7, 2, 3, // tri0
8, 9, 10, // tri1
9, 1, 10, // tri2
1, 0, 10 // tri3
),
gsSPNTriangles_5b(
11, 12, 13, // tri0
12, 14, 13, // tri1
15, 16, 4, // tri2
16, 5, 4 // tri3
),
gsSPNTriangles_5b(
17, 18, 19, // tri0
20, 21, 22, // tri1
21, 23, 22, // tri2
24, 17, 25 // tri3
),
gsSPNTriangles_5b(
26, 27, 28, // tri0
27, 29, 28, // tri1
30, 31, 29, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_1_v[63], 26, 0),
gsSPNTrianglesInit_5b(
13, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(
5, 6, 7, // tri0
8, 9, 10, // tri1
8, 11, 9, // tri2
12, 13, 4 // tri3
),
gsSPNTriangles_5b(
14, 15, 16, // tri0
17, 18, 19, // tri1
20, 21, 8, // tri2
22, 23, 24 // tri3
),
gsSPNTriangles_5b(
23, 20, 24, // tri0
25, 23, 22, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_1_v[89], 31, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
3, 4, 1, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(
8, 9, 10, // tri0
11, 10, 6, // tri1
12, 9, 8, // tri2
13, 2, 14 // tri3
),
gsSPNTriangles_5b(
15, 14, 16, // tri0
17, 16, 18, // tri1
3, 1, 0, // tri2
19, 7, 4 // tri3
),
gsSPNTriangles_5b(
20, 21, 22, // tri0
23, 20, 24, // tri1
21, 25, 26, // tri2
25, 27, 28 // tri3
),
gsSPNTriangles_5b(
29, 23, 30, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_1_v[120], 32, 0),
gsSPNTrianglesInit_5b(
33, // tri count
0, 1, 2, // tri0
3, 4, 1, // tri1
3, 5, 4 // tri2
),
gsSPNTriangles_5b(
5, 6, 4, // tri0
1, 4, 2, // tri1
4, 6, 2, // tri2
6, 7, 2 // tri3
),
gsSPNTriangles_5b(
8, 9, 10, // tri0
8, 11, 9, // tri1
9, 12, 10, // tri2
13, 12, 14 // tri3
),
gsSPNTriangles_5b(
12, 9, 14, // tri0
9, 11, 14, // tri1
11, 15, 14, // tri2
12, 13, 16 // tri3
),
gsSPNTriangles_5b(
17, 18, 19, // tri0
17, 20, 18, // tri1
20, 21, 18, // tri2
22, 0, 23 // tri3
),
gsSPNTriangles_5b(
22, 1, 0, // tri0
24, 12, 25, // tri1
24, 10, 12, // tri2
8, 26, 11 // tri3
),
gsSPNTriangles_5b(
26, 27, 11, // tri0
26, 22, 27, // tri1
26, 28, 22, // tri2
28, 1, 22 // tri3
),
gsSPNTriangles_5b(
28, 3, 1, // tri0
5, 29, 6, // tri1
5, 30, 29, // tri2
30, 17, 29 // tri3
),
gsSPNTriangles_5b(
30, 20, 17, // tri0
30, 31, 20, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_1_v[152], 20, 0),
gsSPNTrianglesInit_5b(
12, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
7, 8, 9, // tri0
7, 10, 8, // tri1
10, 11, 8, // tri2
11, 12, 8 // tri3
),
gsSPNTriangles_5b(
13, 14, 15, // tri0
14, 16, 15, // tri1
14, 17, 16, // tri2
2, 3, 18 // tri3
),
gsSPNTriangles_5b(
3, 19, 18, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_1_v[172], 29, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
7, 8, 9, // tri0
8, 10, 11, // tri1
5, 12, 13, // tri2
12, 7, 14 // tri3
),
gsSPNTriangles_5b(
15, 16, 17, // tri0
18, 19, 20, // tri1
21, 18, 22, // tri2
16, 3, 23 // tri3
),
gsSPNTriangles_5b(
3, 1, 23, // tri0
21, 22, 24, // tri1
25, 21, 24, // tri2
26, 25, 27 // tri3
),
gsSPNTriangles_5b(
0, 26, 28, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,330 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_2_v[] = {
#include "assets/field/bg/grd_s_c1_2_v.inc"
};
extern Gfx grd_s_c1_2_modelT[] = {
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_2_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_2_v[222], 15, 0),
gsSPNTrianglesInit_5b(
8, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 3, 6 // tri2
),
gsSPNTriangles_5b(
1, 7, 8, // tri0
7, 9, 8, // tri1
9, 10, 11, // tri2
10, 12, 13 // tri3
),
gsSPNTriangles_5b(
12, 14, 13, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_2_v[0], 32, 0),
gsSPNTrianglesInit_5b(
19, // tri count
0, 1, 2, // tri0
2, 3, 4, // tri1
3, 5, 6 // tri2
),
gsSPNTriangles_5b(
5, 7, 6, // tri0
8, 7, 5, // tri1
5, 3, 2, // tri2
9, 10, 11 // tri3
),
gsSPNTriangles_5b(
9, 12, 10, // tri0
10, 12, 13, // tri1
12, 14, 13, // tri2
14, 15, 13 // tri3
),
gsSPNTriangles_5b(
14, 16, 15, // tri0
17, 18, 19, // tri1
20, 21, 22, // tri2
17, 19, 23 // tri3
),
gsSPNTriangles_5b(
19, 24, 23, // tri0
25, 26, 27, // tri1
26, 28, 27, // tri2
26, 29, 28 // tri3
),
gsSPVertex(&grd_s_c1_2_v[30], 32, 0),
gsSPNTrianglesInit_5b(
23, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
1, 4, 2 // tri2
),
gsSPNTriangles_5b(
4, 5, 2, // tri0
6, 7, 8, // tri1
9, 10, 11, // tri2
9, 12, 10 // tri3
),
gsSPNTriangles_5b(
9, 13, 12, // tri0
14, 15, 16, // tri1
17, 18, 19, // tri2
18, 20, 19 // tri3
),
gsSPNTriangles_5b(
20, 9, 19, // tri0
20, 21, 9, // tri1
21, 22, 9, // tri2
22, 13, 9 // tri3
),
gsSPNTriangles_5b(
19, 23, 17, // tri0
24, 11, 25, // tri1
26, 27, 28, // tri2
27, 29, 28 // tri3
),
gsSPNTriangles_5b(
28, 29, 30, // tri0
30, 29, 8, // tri1
31, 30, 8, // tri2
5, 31, 8 // tri3
),
gsSPVertex(&grd_s_c1_2_v[62], 15, 0),
gsSPNTrianglesInit_5b(
12, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(
5, 6, 0, // tri0
7, 8, 9, // tri1
7, 10, 8, // tri2
11, 10, 7 // tri3
),
gsSPNTriangles_5b(
11, 6, 12, // tri0
10, 11, 12, // tri1
6, 5, 12, // tri2
13, 12, 5 // tri3
),
gsSPNTriangles_5b(
12, 13, 14, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_2_v[77], 32, 0),
gsSPNTrianglesInit_5b(
30, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(
5, 6, 7, // tri0
3, 8, 9, // tri1
3, 4, 8, // tri2
9, 10, 11 // tri3
),
gsSPNTriangles_5b(
9, 8, 10, // tri0
12, 13, 14, // tri1
12, 15, 13, // tri2
11, 10, 12 // tri3
),
gsSPNTriangles_5b(
10, 15, 12, // tri0
14, 13, 16, // tri1
13, 17, 16, // tri2
16, 18, 19 // tri3
),
gsSPNTriangles_5b(
16, 17, 18, // tri0
19, 18, 20, // tri1
18, 21, 20, // tri2
20, 21, 22 // tri3
),
gsSPNTriangles_5b(
21, 7, 22, // tri0
22, 7, 6, // tri1
23, 24, 25, // tri2
23, 5, 24 // tri3
),
gsSPNTriangles_5b(
6, 5, 23, // tri0
25, 24, 26, // tri1
24, 27, 26, // tri2
26, 27, 28 // tri3
),
gsSPNTriangles_5b(
27, 29, 28, // tri0
28, 30, 31, // tri1
28, 29, 30, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_2_v[109], 28, 0),
gsSPNTrianglesInit_5b(
26, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
2, 1, 4 // tri2
),
gsSPNTriangles_5b(
1, 5, 4, // tri0
6, 7, 8, // tri1
7, 9, 8, // tri2
10, 11, 12 // tri3
),
gsSPNTriangles_5b(
11, 13, 12, // tri0
5, 14, 4, // tri1
7, 6, 14, // tri2
14, 6, 4 // tri3
),
gsSPNTriangles_5b(
15, 16, 17, // tri0
17, 16, 9, // tri1
15, 18, 16, // tri2
16, 8, 9 // tri3
),
gsSPNTriangles_5b(
18, 19, 16, // tri0
20, 21, 22, // tri1
22, 21, 19, // tri2
19, 18, 22 // tri3
),
gsSPNTriangles_5b(
20, 23, 21, // tri0
20, 24, 23, // tri1
24, 25, 23, // tri2
24, 26, 25 // tri3
),
gsSPNTriangles_5b(
26, 10, 25, // tri0
26, 27, 10, // tri1
11, 10, 27, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_2_v[137], 32, 0),
gsSPNTrianglesInit_5b(
18, // tri count
0, 1, 2, // tri0
2, 3, 0, // tri1
3, 4, 0 // tri2
),
gsSPNTriangles_5b(
4, 5, 6, // tri0
1, 7, 8, // tri1
9, 6, 10, // tri2
11, 12, 13 // tri3
),
gsSPNTriangles_5b(
14, 11, 15, // tri0
16, 14, 15, // tri1
15, 9, 16, // tri2
17, 18, 19 // tri3
),
gsSPNTriangles_5b(
20, 21, 18, // tri0
22, 23, 21, // tri1
22, 24, 23, // tri2
24, 25, 26 // tri3
),
gsSPNTriangles_5b(
27, 28, 26, // tri0
27, 29, 28, // tri1
29, 30, 31, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_2_v[169], 32, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 3, 7 // tri2
),
gsSPNTriangles_5b(
8, 9, 10, // tri0
9, 6, 11, // tri1
12, 13, 14, // tri2
15, 12, 16 // tri3
),
gsSPNTriangles_5b(
13, 17, 18, // tri0
17, 8, 19, // tri1
20, 21, 22, // tri2
21, 15, 23 // tri3
),
gsSPNTriangles_5b(
9, 11, 10, // tri0
15, 16, 23, // tri1
24, 25, 26, // tri2
27, 24, 28 // tri3
),
gsSPNTriangles_5b(
29, 30, 31, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_2_v[201], 6, 0),
gsSPNTrianglesInit_5b(
2, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_2_v[207], 15, 0),
gsSPNTrianglesInit_5b(
8, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 0, 5 // tri2
),
gsSPNTriangles_5b(
6, 7, 8, // tri0
7, 4, 8, // tri1
9, 10, 11, // tri2
10, 12, 13 // tri3
),
gsSPNTriangles_5b(
12, 6, 14, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,312 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_3_v[] = {
#include "assets/field/bg/grd_s_c1_3_v.inc"
};
extern Gfx grd_s_c1_3_modelT[] = {
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_3_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_3_v[203], 23, 0),
gsSPNTrianglesInit_5b(
11, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 0, 5 // tri2
),
gsSPNTriangles_5b(
6, 3, 7, // tri0
8, 6, 9, // tri1
10, 8, 11, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(
15, 12, 16, // tri0
17, 15, 18, // tri1
19, 17, 20, // tri2
21, 19, 22 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_3_v[0], 32, 0),
gsSPNTrianglesInit_5b(
29, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(
5, 6, 0, // tri0
0, 2, 5, // tri1
5, 7, 6, // tri2
8, 9, 10 // tri3
),
gsSPNTriangles_5b(
9, 11, 10, // tri0
9, 12, 11, // tri1
8, 13, 9, // tri2
14, 15, 16 // tri3
),
gsSPNTriangles_5b(
15, 4, 16, // tri0
0, 17, 1, // tri1
1, 16, 4, // tri2
18, 19, 20 // tri3
),
gsSPNTriangles_5b(
18, 21, 19, // tri0
21, 22, 19, // tri1
21, 23, 22, // tri2
21, 24, 23 // tri3
),
gsSPNTriangles_5b(
19, 14, 20, // tri0
16, 20, 14, // tri1
21, 18, 17, // tri2
10, 25, 26 // tri3
),
gsSPNTriangles_5b(
10, 11, 25, // tri0
11, 27, 25, // tri1
27, 28, 25, // tri2
28, 29, 25 // tri3
),
gsSPNTriangles_5b(
29, 30, 25, // tri0
30, 26, 25, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_3_v[31], 32, 0),
gsSPNTrianglesInit_5b(
20, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(
5, 1, 6, // tri0
1, 4, 6, // tri1
7, 8, 9, // tri2
8, 10, 9 // tri3
),
gsSPNTriangles_5b(
10, 11, 9, // tri0
12, 13, 11, // tri1
12, 14, 13, // tri2
13, 9, 11 // tri3
),
gsSPNTriangles_5b(
15, 16, 17, // tri0
16, 15, 18, // tri1
19, 20, 21, // tri2
22, 23, 21 // tri3
),
gsSPNTriangles_5b(
24, 10, 8, // tri0
25, 26, 27, // tri1
26, 28, 27, // tri2
18, 29, 16 // tri3
),
gsSPNTriangles_5b(
29, 30, 16, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_3_v[62], 12, 0),
gsSPNTrianglesInit_5b(
6, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
3, 6, 4 // tri2
),
gsSPNTriangles_5b(
3, 7, 6, // tri0
6, 8, 4, // tri1
9, 10, 11, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_3_v[74], 32, 0),
gsSPNTrianglesInit_5b(
39, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
3, 4, 2 // tri2
),
gsSPNTriangles_5b(
4, 5, 2, // tri0
1, 6, 3, // tri1
6, 7, 3, // tri2
7, 8, 3 // tri3
),
gsSPNTriangles_5b(
8, 4, 3, // tri0
6, 9, 7, // tri1
6, 10, 9, // tri2
9, 8, 7 // tri3
),
gsSPNTriangles_5b(
9, 11, 8, // tri0
10, 12, 9, // tri1
12, 13, 9, // tri2
13, 14, 9 // tri3
),
gsSPNTriangles_5b(
14, 11, 9, // tri0
12, 15, 13, // tri1
12, 16, 15, // tri2
15, 14, 13 // tri3
),
gsSPNTriangles_5b(
15, 17, 14, // tri0
16, 18, 15, // tri1
18, 19, 15, // tri2
19, 20, 15 // tri3
),
gsSPNTriangles_5b(
20, 17, 15, // tri0
18, 21, 19, // tri1
18, 22, 21, // tri2
21, 20, 19 // tri3
),
gsSPNTriangles_5b(
21, 23, 20, // tri0
22, 24, 21, // tri1
24, 25, 21, // tri2
25, 26, 21 // tri3
),
gsSPNTriangles_5b(
26, 23, 21, // tri0
24, 27, 25, // tri1
24, 28, 27, // tri2
28, 29, 27 // tri3
),
gsSPNTriangles_5b(
29, 30, 27, // tri0
30, 26, 27, // tri1
26, 25, 27, // tri2
28, 31, 29 // tri3
),
gsSPVertex(&grd_s_c1_3_v[106], 5, 0),
gsSPNTrianglesInit_5b(
3, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
3, 4, 2 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_3_v[111], 32, 0),
gsSPNTrianglesInit_5b(
18, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 3, 7 // tri2
),
gsSPNTriangles_5b(
8, 9, 10, // tri0
11, 12, 13, // tri1
14, 15, 16, // tri2
17, 0, 18 // tri3
),
gsSPNTriangles_5b(
17, 18, 15, // tri0
19, 6, 20, // tri1
4, 14, 16, // tri2
11, 21, 12 // tri3
),
gsSPNTriangles_5b(
19, 20, 22, // tri0
21, 19, 22, // tri1
9, 11, 13, // tri2
23, 24, 25 // tri3
),
gsSPNTriangles_5b(
26, 27, 28, // tri0
28, 29, 23, // tri1
30, 31, 26, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_3_v[143], 32, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
3, 4, 0, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(
5, 8, 9, // tri0
8, 10, 11, // tri1
8, 11, 9, // tri2
10, 12, 13 // tri3
),
gsSPNTriangles_5b(
12, 14, 15, // tri0
14, 16, 17, // tri1
16, 18, 19, // tri2
16, 19, 17 // tri3
),
gsSPNTriangles_5b(
18, 20, 21, // tri0
22, 23, 24, // tri1
25, 26, 23, // tri2
27, 28, 26 // tri3
),
gsSPNTriangles_5b(
28, 29, 30, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_3_v[174], 6, 0),
gsSPNTrianglesInit_5b(
2, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_3_v[180], 23, 0),
gsSPNTrianglesInit_5b(
11, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 6, 7 // tri2
),
gsSPNTriangles_5b(
1, 8, 9, // tri0
8, 3, 10, // tri1
11, 12, 13, // tri2
14, 15, 16 // tri3
),
gsSPNTriangles_5b(
15, 17, 16, // tri0
17, 18, 19, // tri1
12, 20, 21, // tri2
20, 14, 22 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,342 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_4_v[] = {
#include "assets/field/bg/grd_s_c1_4_v.inc"
};
extern Gfx grd_s_c1_4_modelT[] = {
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_4_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_4_v[246], 14, 0),
gsSPNTrianglesInit_5b(
7, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(
6, 3, 7, // tri0
8, 5, 9, // tri1
10, 8, 11, // tri2
12, 10, 13 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_4_v[0], 32, 0),
gsSPNTrianglesInit_5b(
22, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
5, 7, 6, // tri0
7, 8, 9, // tri1
7, 10, 8, // tri2
8, 11, 9 // tri3
),
gsSPNTriangles_5b(
10, 12, 8, // tri0
13, 14, 15, // tri1
14, 16, 15, // tri2
13, 17, 14 // tri3
),
gsSPNTriangles_5b(
6, 18, 4, // tri0
6, 19, 18, // tri1
5, 10, 7, // tri2
2, 20, 0 // tri3
),
gsSPNTriangles_5b(
2, 21, 20, // tri0
22, 23, 24, // tri1
23, 25, 24, // tri2
25, 26, 24 // tri3
),
gsSPNTriangles_5b(
27, 28, 29, // tri0
28, 30, 29, // tri1
19, 31, 18, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_4_v[32], 32, 0),
gsSPNTrianglesInit_5b(
21, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(
1, 5, 4, // tri0
5, 6, 4, // tri1
7, 8, 9, // tri2
8, 10, 9 // tri3
),
gsSPNTriangles_5b(
11, 12, 10, // tri0
11, 13, 12, // tri1
12, 14, 10, // tri2
0, 15, 1 // tri3
),
gsSPNTriangles_5b(
16, 15, 0, // tri0
17, 18, 19, // tri1
20, 21, 22, // tri2
23, 20, 22 // tri3
),
gsSPNTriangles_5b(
23, 24, 20, // tri0
25, 26, 27, // tri1
26, 28, 27, // tri2
29, 30, 28 // tri3
),
gsSPNTriangles_5b(
30, 27, 28, // tri0
30, 31, 27, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_4_v[64], 32, 0),
gsSPNTrianglesInit_5b(
13, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
7, 8, 9, // tri0
8, 10, 9, // tri1
11, 12, 4, // tri2
13, 14, 15 // tri3
),
gsSPNTriangles_5b(
16, 17, 18, // tri0
19, 18, 20, // tri1
21, 22, 23, // tri2
24, 25, 26 // tri3
),
gsSPNTriangles_5b(
27, 28, 29, // tri0
30, 29, 31, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_4_v[96], 3, 0),
gsSPNTrianglesInit_5b(
1, // tri count
0, 1, 2, // tri0
0, 0, 0, // tri1
0, 0, 0 // tri2
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_4_v[99], 32, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 6, 5 // tri2
),
gsSPNTriangles_5b(
6, 7, 5, // tri0
8, 9, 10, // tri1
9, 11, 10, // tri2
10, 12, 13 // tri3
),
gsSPNTriangles_5b(
14, 15, 8, // tri0
7, 16, 14, // tri1
3, 17, 18, // tri2
19, 20, 21 // tri3
),
gsSPNTriangles_5b(
22, 21, 23, // tri0
24, 2, 25, // tri1
26, 25, 27, // tri2
28, 27, 20 // tri3
),
gsSPNTriangles_5b(
29, 30, 31, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_4_v[131], 21, 0),
gsSPNTrianglesInit_5b(
13, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 6, 7 // tri2
),
gsSPNTriangles_5b(
3, 5, 8, // tri0
1, 8, 2, // tri1
9, 0, 10, // tri2
6, 11, 12 // tri3
),
gsSPNTriangles_5b(
13, 14, 15, // tri0
16, 17, 14, // tri1
18, 19, 20, // tri2
16, 18, 17 // tri3
),
gsSPNTriangles_5b(
11, 13, 15, // tri0
13, 16, 14, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_4_v[152], 32, 0),
gsSPNTrianglesInit_5b(
29, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 1 // tri2
),
gsSPNTriangles_5b(
5, 3, 1, // tri0
2, 6, 0, // tri1
7, 8, 9, // tri2
8, 10, 9 // tri3
),
gsSPNTriangles_5b(
8, 11, 10, // tri0
12, 9, 13, // tri1
9, 14, 13, // tri2
9, 10, 14 // tri3
),
gsSPNTriangles_5b(
12, 7, 9, // tri0
12, 15, 7, // tri1
16, 17, 18, // tri2
16, 19, 17 // tri3
),
gsSPNTriangles_5b(
19, 20, 17, // tri0
21, 20, 19, // tri1
21, 22, 20, // tri2
21, 23, 22 // tri3
),
gsSPNTriangles_5b(
24, 25, 18, // tri0
24, 26, 25, // tri1
16, 18, 25, // tri2
26, 24, 12 // tri3
),
gsSPNTriangles_5b(
24, 15, 12, // tri0
27, 0, 6, // tri1
8, 28, 11, // tri2
29, 30, 28 // tri3
),
gsSPNTriangles_5b(
29, 31, 30, // tri0
30, 11, 28, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_4_v[184], 32, 0),
gsSPNTrianglesInit_5b(
26, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
3, 4, 2 // tri2
),
gsSPNTriangles_5b(
3, 5, 4, // tri0
3, 6, 5, // tri1
7, 8, 9, // tri2
8, 10, 9 // tri3
),
gsSPNTriangles_5b(
8, 11, 10, // tri0
12, 13, 14, // tri1
12, 15, 13, // tri2
13, 16, 14 // tri3
),
gsSPNTriangles_5b(
17, 18, 16, // tri0
17, 19, 18, // tri1
13, 17, 16, // tri2
20, 21, 22 // tri3
),
gsSPNTriangles_5b(
20, 23, 21, // tri0
23, 24, 21, // tri1
24, 25, 21, // tri2
24, 26, 25 // tri3
),
gsSPNTriangles_5b(
24, 27, 26, // tri0
27, 28, 26, // tri1
28, 29, 26, // tri2
28, 0, 29 // tri3
),
gsSPNTriangles_5b(
28, 30, 0, // tri0
30, 31, 0, // tri1
31, 1, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_4_v[216], 16, 0),
gsSPNTrianglesInit_5b(
14, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(
1, 5, 4, // tri0
5, 6, 4, // tri1
6, 7, 4, // tri2
6, 8, 7 // tri3
),
gsSPNTriangles_5b(
6, 9, 8, // tri0
9, 10, 8, // tri1
10, 11, 8, // tri2
10, 12, 11 // tri3
),
gsSPNTriangles_5b(
10, 13, 12, // tri0
13, 14, 12, // tri1
14, 15, 12, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_4_v[232], 14, 0),
gsSPNTrianglesInit_5b(
7, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 0, 5 // tri2
),
gsSPNTriangles_5b(
6, 7, 8, // tri0
1, 6, 9, // tri1
10, 11, 12, // tri2
11, 3, 13 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,283 @@
#include "libforest/gbi_extensions.h"
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 grass_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_5_v[] = {
#include "assets/field/bg/grd_s_c1_5_v.inc"
};
extern Gfx grd_s_c1_5_modelT[] = {
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_5_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_5_v[0], 32, 0),
gsSPNTrianglesInit_5b(
21, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 6, 5 // tri2
),
gsSPNTriangles_5b(
7, 8, 9, // tri0
8, 10, 9, // tri1
11, 6, 12, // tri2
11, 13, 6 // tri3
),
gsSPNTriangles_5b(
13, 14, 6, // tri0
14, 5, 6, // tri1
5, 15, 3, // tri2
16, 17, 9 // tri3
),
gsSPNTriangles_5b(
17, 7, 9, // tri0
17, 18, 7, // tri1
18, 19, 7, // tri2
20, 21, 22 // tri3
),
gsSPNTriangles_5b(
20, 23, 21, // tri0
20, 24, 23, // tri1
25, 22, 26, // tri2
24, 27, 28 // tri3
),
gsSPNTriangles_5b(
24, 29, 27, // tri0
29, 30, 27, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_5_v[31], 27, 0),
gsSPNTrianglesInit_5b(
25, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
6, 7, 4, // tri0
7, 8, 4, // tri1
9, 10, 11, // tri2
10, 12, 11 // tri3
),
gsSPNTriangles_5b(
12, 13, 11, // tri0
12, 14, 13, // tri1
12, 15, 14, // tri2
13, 14, 16 // tri3
),
gsSPNTriangles_5b(
17, 13, 16, // tri0
18, 19, 20, // tri1
20, 21, 18, // tri2
20, 2, 21 // tri3
),
gsSPNTriangles_5b(
2, 3, 21, // tri0
21, 3, 22, // tri1
22, 23, 24, // tri2
22, 3, 23 // tri3
),
gsSPNTriangles_5b(
23, 25, 24, // tri0
24, 25, 26, // tri1
25, 16, 26, // tri2
16, 14, 26 // tri3
),
gsSPNTriangles_5b(
26, 19, 18, // tri0
14, 19, 26, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_5_v[58], 32, 0),
gsSPNTrianglesInit_5b(
30, // tri count
0, 1, 2, // tri0
2, 3, 4, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
6, 7, 8, // tri0
8, 9, 10, // tri1
10, 11, 12, // tri2
11, 13, 12 // tri3
),
gsSPNTriangles_5b(
14, 15, 13, // tri0
14, 16, 15, // tri1
16, 17, 18, // tri2
18, 19, 20 // tri3
),
gsSPNTriangles_5b(
20, 21, 22, // tri0
22, 23, 24, // tri1
24, 25, 26, // tri2
25, 27, 26 // tri3
),
gsSPNTriangles_5b(
25, 28, 27, // tri0
24, 23, 25, // tri1
22, 21, 23, // tri2
20, 29, 21 // tri3
),
gsSPNTriangles_5b(
20, 19, 29, // tri0
17, 19, 18, // tri1
16, 14, 17, // tri2
13, 11, 14 // tri3
),
gsSPNTriangles_5b(
10, 9, 11, // tri0
8, 7, 9, // tri1
6, 5, 7, // tri2
4, 3, 5 // tri3
),
gsSPNTriangles_5b(
2, 1, 3, // tri0
4, 30, 2, // tri1
8, 31, 6, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_5_v[90], 27, 0),
gsSPNTrianglesInit_5b(
23, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 3 // tri2
),
gsSPNTriangles_5b(
6, 7, 4, // tri0
8, 9, 6, // tri1
8, 10, 9, // tri2
11, 12, 10 // tri3
),
gsSPNTriangles_5b(
13, 14, 11, // tri0
15, 16, 17, // tri1
17, 18, 19, // tri2
17, 16, 18 // tri3
),
gsSPNTriangles_5b(
18, 14, 19, // tri0
14, 13, 19, // tri1
11, 14, 12, // tri2
10, 12, 9 // tri3
),
gsSPNTriangles_5b(
6, 9, 7, // tri0
4, 7, 5, // tri1
3, 5, 1, // tri2
2, 1, 20 // tri3
),
gsSPNTriangles_5b(
21, 20, 22, // tri0
22, 20, 23, // tri1
24, 25, 26, // tri2
24, 23, 25 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_5_v[117], 32, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 3, 6 // tri2
),
gsSPNTriangles_5b(
7, 8, 9, // tri0
8, 10, 9, // tri1
11, 12, 13, // tri2
11, 14, 12 // tri3
),
gsSPNTriangles_5b(
15, 16, 17, // tri0
18, 15, 19, // tri1
18, 19, 20, // tri2
20, 21, 18 // tri3
),
gsSPNTriangles_5b(
20, 22, 21, // tri0
22, 23, 24, // tri1
24, 25, 26, // tri2
26, 27, 9 // tri3
),
gsSPNTriangles_5b(
10, 28, 29, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_5_v[147], 32, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
3, 1, 4, // tri1
5, 3, 6 // tri2
),
gsSPNTriangles_5b(
7, 5, 8, // tri0
9, 7, 10, // tri1
10, 11, 9, // tri2
12, 13, 11 // tri3
),
gsSPNTriangles_5b(
14, 15, 13, // tri0
16, 17, 18, // tri1
19, 16, 20, // tri2
21, 19, 22 // tri3
),
gsSPNTriangles_5b(
21, 22, 23, // tri0
24, 25, 23, // tri1
26, 25, 24, // tri2
27, 26, 28 // tri3
),
gsSPNTriangles_5b(
29, 30, 31, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_5_v[179], 26, 0),
gsSPNTrianglesInit_5b(
13, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(
4, 5, 3, // tri0
6, 5, 7, // tri1
8, 9, 10, // tri2
9, 11, 12 // tri3
),
gsSPNTriangles_5b(
11, 13, 14, // tri0
15, 16, 17, // tri1
18, 15, 19, // tri2
20, 18, 21 // tri3
),
gsSPNTriangles_5b(
22, 23, 24, // tri0
16, 22, 25, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,375 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 water_2_tex_dummy[];
extern u8 water_1_tex_dummy[];
extern u8 river_tex_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_r1_1_v[] = {
#include "assets/field/bg/grd_s_c1_r1_1_v.inc"
};
extern Gfx grd_s_c1_r1_1_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 1, 0, TEXEL0, TEXEL1, COMBINED, 0, SHADE, TEXEL0,
COMBINED, 0, PRIM_LOD_FRAC, PRIMITIVE),
gsDPSetPrimColor(0, 50, 255, 255, 255, 50),
gsDPSetEnvColor(0x00, 0x64, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(water_1_tex_dummy, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPLoadMultiBlock_4b_Dolphin(water_2_tex_dummy, 1, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r1_1_v[256], 24, 0),
gsSPNTrianglesInit_5b(20, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(3, 5, 4, // tri0
6, 7, 8, // tri1
7, 9, 8, // tri2
10, 6, 11 // tri3
),
gsSPNTriangles_5b(6, 8, 11, // tri0
12, 11, 13, // tri1
12, 10, 11, // tri2
13, 14, 12 // tri3
),
gsSPNTriangles_5b(13, 15, 14, // tri0
15, 16, 14, // tri1
16, 17, 14, // tri2
16, 18, 17 // tri3
),
gsSPNTriangles_5b(16, 19, 18, // tri0
5, 20, 21, // tri1
5, 21, 4, // tri2
20, 22, 23 // tri3
),
gsSPNTriangles_5b(20, 23, 21, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_r1_1_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r1_1_v[280], 11, 0),
gsSPNTrianglesInit_5b(5, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
1, 3, 6 // tri2
),
gsSPNTriangles_5b(4, 7, 8, // tri0
7, 9, 10, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r1_1_v[0], 32, 0),
gsSPNTrianglesInit_5b(25, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
8, 9, 10, // tri1
9, 11, 10, // tri2
0, 12, 1 // tri3
),
gsSPNTriangles_5b(13, 14, 15, // tri0
14, 16, 15, // tri1
16, 17, 15, // tri2
17, 3, 15 // tri3
),
gsSPNTriangles_5b(3, 1, 15, // tri0
18, 19, 12, // tri1
19, 1, 12, // tri2
18, 20, 19 // tri3
),
gsSPNTriangles_5b(18, 21, 20, // tri0
21, 13, 20, // tri1
18, 22, 21, // tri2
23, 24, 11 // tri3
),
gsSPNTriangles_5b(24, 25, 11, // tri0
25, 10, 11, // tri1
26, 27, 28, // tri2
26, 29, 27 // tri3
),
gsSPNTriangles_5b(26, 30, 29, // tri0
30, 31, 29, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_1_v[32], 32, 0),
gsSPNTrianglesInit_5b(26, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 6, 5 // tri2
),
gsSPNTriangles_5b(6, 1, 5, // tri0
6, 7, 1, // tri1
7, 2, 1, // tri2
3, 8, 4 // tri3
),
gsSPNTriangles_5b(9, 10, 11, // tri0
10, 12, 11, // tri1
9, 13, 10, // tri2
14, 15, 16 // tri3
),
gsSPNTriangles_5b(14, 17, 15, // tri0
17, 18, 15, // tri1
19, 20, 21, // tri2
20, 22, 21 // tri3
),
gsSPNTriangles_5b(20, 23, 22, // tri0
23, 24, 22, // tri1
23, 25, 24, // tri2
25, 26, 24 // tri3
),
gsSPNTriangles_5b(22, 27, 21, // tri0
27, 28, 21, // tri1
28, 29, 30, // tri2
29, 31, 30 // tri3
),
gsSPNTriangles_5b(29, 16, 31, // tri0
30, 21, 28, // tri1
16, 15, 31, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_1_v[64], 9, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
8, 7, 5, // tri1
5, 3, 8, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r1_1_v[73], 32, 0),
gsSPNTrianglesInit_5b(24, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
0, 4, 1 // tri2
),
gsSPNTriangles_5b(5, 6, 2, // tri0
7, 8, 9, // tri1
8, 10, 9, // tri2
11, 12, 13 // tri3
),
gsSPNTriangles_5b(12, 14, 13, // tri0
15, 14, 12, // tri1
15, 16, 14, // tri2
17, 16, 15 // tri3
),
gsSPNTriangles_5b(17, 18, 16, // tri0
18, 19, 16, // tri1
20, 19, 18, // tri2
20, 21, 19 // tri3
),
gsSPNTriangles_5b(22, 21, 20, // tri0
22, 23, 21, // tri1
22, 24, 23, // tri2
25, 26, 27 // tri3
),
gsSPNTriangles_5b(25, 27, 28, // tri0
27, 26, 29, // tri1
7, 9, 29, // tri2
29, 26, 7 // tri3
),
gsSPNTriangles_5b(8, 30, 10, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_1_v[104], 32, 0),
gsSPNTrianglesInit_5b(27, // tri count
0, 1, 2, // tri0
2, 3, 0, // tri1
0, 4, 1 // tri2
),
gsSPNTriangles_5b(4, 0, 5, // tri0
6, 5, 7, // tri1
6, 7, 8, // tri2
7, 9, 8 // tri3
),
gsSPNTriangles_5b(10, 11, 9, // tri0
9, 7, 10, // tri1
10, 12, 11, // tri2
10, 13, 12 // tri3
),
gsSPNTriangles_5b(13, 14, 12, // tri0
15, 16, 14, // tri1
17, 18, 16, // tri2
19, 20, 18 // tri3
),
gsSPNTriangles_5b(21, 22, 20, // tri0
23, 24, 22, // tri1
25, 26, 24, // tri2
26, 27, 28 // tri3
),
gsSPNTriangles_5b(26, 25, 27, // tri0
24, 23, 25, // tri1
22, 21, 23, // tri2
20, 19, 21 // tri3
),
gsSPNTriangles_5b(18, 17, 19, // tri0
16, 15, 17, // tri1
14, 13, 15, // tri2
29, 30, 31 // tri3
),
gsSPVertex(&grd_s_c1_r1_1_v[136], 21, 0),
gsSPNTrianglesInit_5b(17, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 3 // tri2
),
gsSPNTriangles_5b(3, 6, 2, // tri0
3, 5, 6, // tri1
7, 8, 9, // tri2
9, 8, 4 // tri3
),
gsSPNTriangles_5b(5, 4, 8, // tri0
7, 10, 8, // tri1
10, 11, 8, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(15, 16, 13, // tri0
13, 16, 14, // tri1
17, 18, 15, // tri2
19, 20, 17 // tri3
),
gsSPNTriangles_5b(17, 20, 18, // tri0
15, 18, 16, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(river_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r1_1_v[157], 32, 0),
gsSPNTrianglesInit_5b(24, // tri count
0, 1, 2, // tri0
2, 3, 0, // tri1
2, 4, 3 // tri2
),
gsSPNTriangles_5b(5, 6, 4, // tri0
5, 7, 6, // tri1
7, 8, 9, // tri2
7, 5, 8 // tri3
),
gsSPNTriangles_5b(4, 2, 5, // tri0
10, 11, 9, // tri1
9, 8, 10, // tri2
12, 13, 11 // tri3
),
gsSPNTriangles_5b(13, 14, 15, // tri0
15, 14, 16, // tri1
14, 17, 16, // tri2
17, 18, 16 // tri3
),
gsSPNTriangles_5b(19, 20, 18, // tri0
21, 22, 20, // tri1
21, 23, 22, // tri2
20, 19, 21 // tri3
),
gsSPNTriangles_5b(24, 25, 23, // tri0
24, 26, 25, // tri1
24, 27, 26, // tri2
23, 21, 24 // tri3
),
gsSPNTriangles_5b(28, 29, 30, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_1_v[188], 14, 0),
gsSPNTrianglesInit_5b(10, // tri count
0, 1, 2, // tri0
0, 3, 4, // tri1
3, 5, 4 // tri2
),
gsSPNTriangles_5b(4, 1, 0, // tri0
1, 6, 2, // tri1
7, 8, 9, // tri2
8, 10, 11 // tri3
),
gsSPNTriangles_5b(12, 13, 11, // tri0
11, 10, 12, // tri1
7, 10, 8, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r1_1_v[202], 32, 0),
gsSPNTrianglesInit_5b(16, // tri count
0, 1, 2, // tri0
3, 4, 1, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(8, 7, 4, // tri0
9, 10, 6, // tri1
11, 12, 10, // tri2
13, 14, 15 // tri3
),
gsSPNTriangles_5b(16, 17, 14, // tri0
18, 19, 20, // tri1
21, 20, 17, // tri2
22, 23, 24 // tri3
),
gsSPNTriangles_5b(25, 26, 23, // tri0
27, 24, 28, // tri1
29, 28, 19, // tri2
17, 16, 21 // tri3
),
gsSPNTriangles_5b(24, 27, 22, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_1_v[232], 13, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
3, 2, 4, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(8, 4, 6, // tri0
9, 7, 10, // tri1
11, 10, 12, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r1_1_v[245], 11, 0),
gsSPNTrianglesInit_5b(5, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(6, 3, 8, // tri0
9, 5, 10, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,7 @@
#include "evw_anime.h"
static EVW_ANIME_SCROLL grd_s_c1_r1_1_evw_anime_1[] = { { 1, -1, 32, 32 }, { -1, -2, 32, 32 } };
extern EVW_ANIME_DATA grd_s_c1_r1_1_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_s_c1_r1_1_evw_anime_1 },
};
@@ -0,0 +1,344 @@
#include "libforest/gbi_extensions.h"
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 water_2_tex_dummy[];
extern u8 water_1_tex_dummy[];
extern u8 river_tex_dummy[];
extern u8 grass_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_r1_2_v[] = {
#include "assets/field/bg/grd_s_c1_r1_2_v.inc"
};
extern Gfx grd_s_c1_r1_2_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 1, 0, TEXEL0, TEXEL1, COMBINED, 0, SHADE, TEXEL0,
COMBINED, 0, PRIM_LOD_FRAC, PRIMITIVE),
gsDPSetPrimColor(0, 50, 255, 255, 255, 50),
gsDPSetEnvColor(0x00, 0x3C, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(water_1_tex_dummy, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPLoadMultiBlock_4b_Dolphin(water_2_tex_dummy, 1, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r1_2_v[254], 20, 0),
gsSPNTrianglesInit_5b(16, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(4, 5, 1, // tri0
6, 7, 8, // tri1
6, 9, 7, // tri2
7, 10, 8 // tri3
),
gsSPNTriangles_5b(7, 11, 10, // tri0
11, 2, 10, // tri1
11, 0, 2, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(13, 15, 14, // tri0
13, 16, 15, // tri1
16, 17, 15, // tri2
16, 18, 17 // tri3
),
gsSPNTriangles_5b(16, 19, 18, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_r1_2_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r1_2_v[0], 32, 0),
gsSPNTrianglesInit_5b(24, // tri count
0, 1, 2, // tri0
2, 3, 4, // tri1
0, 2, 4 // tri2
),
gsSPNTriangles_5b(4, 5, 0, // tri0
5, 6, 0, // tri1
6, 7, 0, // tri2
7, 8, 0 // tri3
),
gsSPNTriangles_5b(9, 10, 11, // tri0
10, 12, 11, // tri1
13, 14, 15, // tri2
15, 14, 8 // tri3
),
gsSPNTriangles_5b(16, 17, 9, // tri0
17, 18, 9, // tri1
9, 11, 16, // tri2
19, 20, 21 // tri3
),
gsSPNTriangles_5b(22, 19, 23, // tri0
19, 21, 23, // tri1
21, 24, 23, // tri2
21, 25, 24 // tri3
),
gsSPNTriangles_5b(26, 27, 28, // tri0
26, 28, 25, // tri1
29, 27, 26, // tri2
29, 30, 27 // tri3
),
gsSPNTriangles_5b(30, 29, 31, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_2_v[32], 32, 0),
gsSPNTrianglesInit_5b(18, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 5, 4 // tri2
),
gsSPNTriangles_5b(4, 7, 6, // tri0
8, 6, 7, // tri1
8, 7, 9, // tri2
10, 11, 9 // tri3
),
gsSPNTriangles_5b(11, 12, 9, // tri0
13, 14, 15, // tri1
13, 16, 14, // tri2
17, 18, 19 // tri3
),
gsSPNTriangles_5b(20, 13, 21, // tri0
15, 22, 13, // tri1
23, 2, 24, // tri2
1, 25, 2 // tri3
),
gsSPNTriangles_5b(1, 26, 25, // tri0
4, 3, 26, // tri1
27, 28, 29, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_2_v[62], 17, 0),
gsSPNTrianglesInit_5b(12, // tri count
0, 1, 2, // tri0
1, 3, 4, // tri1
3, 5, 4 // tri2
),
gsSPNTriangles_5b(3, 6, 5, // tri0
5, 7, 4, // tri1
1, 4, 2, // tri2
4, 8, 2 // tri3
),
gsSPNTriangles_5b(9, 10, 11, // tri0
9, 8, 10, // tri1
12, 13, 14, // tri2
13, 15, 14 // tri3
),
gsSPNTriangles_5b(15, 13, 16, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r1_2_v[79], 32, 0),
gsSPNTrianglesInit_5b(17, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 8, // tri0
7, 9, 10, // tri1
9, 11, 12, // tri2
11, 13, 12 // tri3
),
gsSPNTriangles_5b(13, 14, 15, // tri0
14, 16, 15, // tri1
17, 18, 19, // tri2
20, 21, 18 // tri3
),
gsSPNTriangles_5b(22, 23, 21, // tri0
24, 25, 23, // tri1
24, 26, 25, // tri2
26, 27, 28 // tri3
),
gsSPNTriangles_5b(27, 2, 28, // tri0
3, 29, 30, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_2_v[110], 12, 0),
gsSPNTrianglesInit_5b(7, // tri count
0, 1, 2, // tri0
1, 3, 4, // tri1
3, 5, 4 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
6, 8, 7, // tri1
8, 9, 10, // tri2
9, 11, 10 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(river_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r1_2_v[122], 32, 0),
gsSPNTrianglesInit_5b(26, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(1, 5, 4, // tri0
5, 6, 4, // tri1
5, 7, 6, // tri2
7, 8, 6 // tri3
),
gsSPNTriangles_5b(7, 9, 8, // tri0
9, 10, 8, // tri1
9, 11, 10, // tri2
9, 12, 11 // tri3
),
gsSPNTriangles_5b(12, 13, 11, // tri0
12, 14, 13, // tri1
14, 15, 13, // tri2
16, 17, 15 // tri3
),
gsSPNTriangles_5b(16, 18, 17, // tri0
19, 20, 18, // tri1
21, 22, 20, // tri2
21, 23, 22 // tri3
),
gsSPNTriangles_5b(21, 24, 23, // tri0
25, 26, 24, // tri1
27, 28, 26, // tri2
26, 25, 27 // tri3
),
gsSPNTriangles_5b(27, 29, 28, // tri0
30, 31, 29, // tri1
27, 30, 29, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_2_v[154], 22, 0),
gsSPNTrianglesInit_5b(16, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(4, 5, 3, // tri0
4, 6, 5, // tri1
6, 7, 5, // tri2
6, 8, 7 // tri3
),
gsSPNTriangles_5b(6, 9, 8, // tri0
10, 11, 12, // tri1
12, 13, 10, // tri2
13, 14, 10 // tri3
),
gsSPNTriangles_5b(13, 15, 14, // tri0
16, 17, 18, // tri1
19, 20, 16, // tri2
16, 20, 17 // tri3
),
gsSPNTriangles_5b(19, 21, 20, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r1_2_v[176], 32, 0),
gsSPNTrianglesInit_5b(25, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 6, 7, // tri0
6, 8, 9, // tri1
6, 9, 7, // tri2
8, 10, 11 // tri3
),
gsSPNTriangles_5b(8, 11, 9, // tri0
4, 12, 5, // tri1
4, 13, 14, // tri2
4, 14, 12 // tri3
),
gsSPNTriangles_5b(13, 15, 14, // tri0
13, 16, 17, // tri1
13, 17, 15, // tri2
18, 19, 20 // tri3
),
gsSPNTriangles_5b(19, 21, 20, // tri0
20, 22, 18, // tri1
22, 23, 18, // tri2
0, 24, 1 // tri3
),
gsSPNTriangles_5b(0, 25, 24, // tri0
25, 26, 24, // tri1
27, 28, 29, // tri2
28, 30, 29 // tri3
),
gsSPNTriangles_5b(25, 21, 19, // tri0
25, 19, 26, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_2_v[207], 32, 0),
gsSPNTrianglesInit_5b(25, // tri count
0, 1, 2, // tri0
0, 2, 3, // tri1
2, 4, 5 // tri2
),
gsSPNTriangles_5b(2, 5, 3, // tri0
6, 7, 8, // tri1
9, 10, 11, // tri2
9, 12, 10 // tri3
),
gsSPNTriangles_5b(6, 13, 7, // tri0
14, 15, 16, // tri1
14, 17, 15, // tri2
16, 18, 19 // tri3
),
gsSPNTriangles_5b(16, 15, 18, // tri0
19, 18, 20, // tri1
18, 21, 20, // tri2
20, 22, 23 // tri3
),
gsSPNTriangles_5b(20, 21, 22, // tri0
23, 22, 6, // tri1
22, 24, 6, // tri2
6, 25, 26 // tri3
),
gsSPNTriangles_5b(6, 24, 25, // tri0
25, 27, 28, // tri1
25, 29, 27, // tri2
29, 12, 27 // tri3
),
gsSPNTriangles_5b(12, 29, 10, // tri0
29, 30, 10, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_2_v[238], 16, 0),
gsSPNTrianglesInit_5b(12, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 2, 5, // tri0
2, 7, 5, // tri1
2, 1, 7, // tri2
5, 7, 8 // tri3
),
gsSPNTriangles_5b(7, 9, 8, // tri0
8, 9, 10, // tri1
9, 11, 10, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(12, 15, 13, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,7 @@
#include "evw_anime.h"
static EVW_ANIME_SCROLL grd_s_c1_r1_2_evw_anime_1[] = { { 1, -1, 32, 32 }, { -1, -2, 32, 32 } };
extern EVW_ANIME_DATA grd_s_c1_r1_2_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_s_c1_r1_2_evw_anime_1 },
};
@@ -0,0 +1,323 @@
#include "libforest/gbi_extensions.h"
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 water_2_tex_dummy[];
extern u8 water_1_tex_dummy[];
extern u8 river_tex_dummy[];
extern u8 grass_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_r1_3_v[] = {
#include "assets/field/bg/grd_s_c1_r1_3_v.inc"
};
extern Gfx grd_s_c1_r1_3_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 1, 0, TEXEL0, TEXEL1, COMBINED, 0, SHADE, TEXEL0,
COMBINED, 0, PRIM_LOD_FRAC, PRIMITIVE),
gsDPSetPrimColor(0, 50, 255, 255, 255, 50),
gsDPSetEnvColor(0x00, 0x64, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(water_1_tex_dummy, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPLoadMultiBlock_4b_Dolphin(water_2_tex_dummy, 1, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r1_3_v[247], 27, 0),
gsSPNTrianglesInit_5b(23, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
0, 4, 1 // tri2
),
gsSPNTriangles_5b(4, 5, 1, // tri0
6, 7, 8, // tri1
9, 6, 8, // tri2
4, 9, 8 // tri3
),
gsSPNTriangles_5b(4, 8, 5, // tri0
10, 2, 11, // tri1
10, 11, 12, // tri2
13, 14, 10 // tri3
),
gsSPNTriangles_5b(13, 10, 12, // tri0
3, 11, 2, // tri1
15, 16, 17, // tri2
15, 18, 16 // tri3
),
gsSPNTriangles_5b(16, 19, 17, // tri0
16, 20, 19, // tri1
20, 21, 19, // tri2
21, 22, 19 // tri3
),
gsSPNTriangles_5b(21, 23, 22, // tri0
23, 24, 22, // tri1
23, 25, 24, // tri2
23, 26, 25 // tri3
),
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_r1_3_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r1_3_v[0], 32, 0),
gsSPNTrianglesInit_5b(21, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
5, 8, 7, // tri1
6, 9, 4, // tri2
9, 10, 4 // tri3
),
gsSPNTriangles_5b(11, 12, 13, // tri0
11, 14, 12, // tri1
15, 16, 17, // tri2
16, 18, 17 // tri3
),
gsSPNTriangles_5b(15, 19, 16, // tri0
15, 20, 19, // tri1
18, 21, 22, // tri2
21, 23, 22 // tri3
),
gsSPNTriangles_5b(21, 24, 23, // tri0
18, 16, 21, // tri1
25, 26, 27, // tri2
26, 28, 27 // tri3
),
gsSPNTriangles_5b(28, 29, 27, // tri0
30, 31, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_3_v[32], 32, 0),
gsSPNTrianglesInit_5b(19, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
7, 8, 6, // tri1
7, 9, 8, // tri2
9, 10, 8 // tri3
),
gsSPNTriangles_5b(11, 12, 13, // tri0
14, 15, 16, // tri1
17, 18, 19, // tri2
17, 20, 18 // tri3
),
gsSPNTriangles_5b(17, 21, 20, // tri0
21, 22, 20, // tri1
21, 23, 22, // tri2
24, 25, 26 // tri3
),
gsSPNTriangles_5b(11, 13, 27, // tri0
27, 28, 24, // tri1
27, 13, 28, // tri2
29, 30, 31 // tri3
),
gsSPVertex(&grd_s_c1_r1_3_v[64], 19, 0),
gsSPNTrianglesInit_5b(13, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 0 // tri2
),
gsSPNTriangles_5b(6, 7, 8, // tri0
7, 9, 8, // tri1
7, 10, 9, // tri2
11, 12, 7 // tri3
),
gsSPNTriangles_5b(13, 14, 12, // tri0
15, 13, 12, // tri1
11, 15, 12, // tri2
16, 17, 11 // tri3
),
gsSPNTriangles_5b(17, 15, 11, // tri0
18, 0, 5, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r1_3_v[83], 32, 0),
gsSPNTrianglesInit_5b(17, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
0, 4, 1 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
8, 3, 9, // tri1
8, 10, 3, // tri2
11, 12, 13 // tri3
),
gsSPNTriangles_5b(14, 15, 16, // tri0
9, 14, 17, // tri1
18, 4, 19, // tri2
20, 21, 22 // tri3
),
gsSPNTriangles_5b(23, 11, 24, // tri0
23, 24, 21, // tri1
15, 20, 22, // tri2
25, 26, 27 // tri3
),
gsSPNTriangles_5b(28, 25, 29, // tri0
26, 30, 31, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_3_v[115], 24, 0),
gsSPNTrianglesInit_5b(13, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(7, 8, 9, // tri0
7, 10, 11, // tri1
12, 11, 10, // tri2
13, 12, 10 // tri3
),
gsSPNTriangles_5b(14, 15, 13, // tri0
16, 17, 14, // tri1
18, 19, 16, // tri2
18, 20, 19 // tri3
),
gsSPNTriangles_5b(18, 21, 20, // tri0
21, 22, 23, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r1_3_v[139], 32, 0),
gsSPNTrianglesInit_5b(28, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
4, 0, 5, // tri1
5, 8, 7, // tri2
9, 10, 5 // tri3
),
gsSPNTriangles_5b(10, 8, 5, // tri0
9, 5, 11, // tri1
5, 0, 11, // tri2
0, 2, 11 // tri3
),
gsSPNTriangles_5b(12, 13, 14, // tri0
12, 15, 13, // tri1
15, 16, 13, // tri2
17, 18, 19 // tri3
),
gsSPNTriangles_5b(18, 20, 19, // tri0
21, 22, 23, // tri1
21, 24, 22, // tri2
24, 25, 22 // tri3
),
gsSPNTriangles_5b(24, 17, 25, // tri0
17, 19, 25, // tri1
26, 15, 27, // tri2
18, 28, 20 // tri3
),
gsSPNTriangles_5b(18, 29, 28, // tri0
15, 8, 16, // tri1
8, 10, 16, // tri2
1, 30, 3 // tri3
),
gsSPNTriangles_5b(30, 31, 3, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_3_v[171], 23, 0),
gsSPNTrianglesInit_5b(18, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(1, 5, 4, // tri0
5, 6, 4, // tri1
6, 7, 4, // tri2
6, 8, 7 // tri3
),
gsSPNTriangles_5b(9, 10, 8, // tri0
9, 11, 10, // tri1
6, 9, 8, // tri2
11, 12, 10 // tri3
),
gsSPNTriangles_5b(11, 13, 12, // tri0
13, 14, 15, // tri1
13, 16, 14, // tri2
17, 18, 19 // tri3
),
gsSPNTriangles_5b(17, 20, 18, // tri0
20, 21, 18, // tri1
21, 22, 18, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(river_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r1_3_v[194], 32, 0),
gsSPNTrianglesInit_5b(26, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 3, 6, // tri0
5, 2, 3, // tri1
4, 6, 7, // tri2
6, 8, 7 // tri3
),
gsSPNTriangles_5b(8, 9, 7, // tri0
10, 11, 12, // tri1
11, 13, 12, // tri2
11, 14, 13 // tri3
),
gsSPNTriangles_5b(14, 15, 13, // tri0
14, 16, 15, // tri1
14, 17, 16, // tri2
17, 18, 16 // tri3
),
gsSPNTriangles_5b(17, 19, 18, // tri0
19, 20, 18, // tri1
19, 21, 20, // tri2
21, 22, 20 // tri3
),
gsSPNTriangles_5b(0, 23, 1, // tri0
23, 24, 1, // tri1
23, 25, 24, // tri2
26, 27, 28 // tri3
),
gsSPNTriangles_5b(27, 29, 28, // tri0
29, 30, 28, // tri1
29, 31, 30, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r1_3_v[226], 21, 0),
gsSPNTrianglesInit_5b(13, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 3 // tri2
),
gsSPNTriangles_5b(6, 7, 5, // tri0
8, 9, 7, // tri1
8, 10, 9, // tri2
11, 12, 10 // tri3
),
gsSPNTriangles_5b(13, 14, 12, // tri0
13, 15, 14, // tri1
15, 16, 14, // tri2
17, 18, 16 // tri3
),
gsSPNTriangles_5b(17, 19, 18, // tri0
19, 20, 18, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,7 @@
#include "evw_anime.h"
static EVW_ANIME_SCROLL grd_s_c1_r1_3_evw_anime_1[] = { { 1, -1, 32, 32 }, { -1, -2, 32, 32 } };
extern EVW_ANIME_DATA grd_s_c1_r1_3_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_s_c1_r1_3_evw_anime_1 },
};
@@ -0,0 +1,323 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 water_2_tex_dummy[];
extern u8 water_1_tex_dummy[];
extern u8 river_tex_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_r2_1_v[] = {
#include "assets/field/bg/grd_s_c1_r2_1_v.inc"
};
extern Gfx grd_s_c1_r2_1_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 1, 0, TEXEL0, TEXEL1, COMBINED, 0, SHADE, TEXEL0,
COMBINED, 0, PRIM_LOD_FRAC, PRIMITIVE),
gsDPSetPrimColor(0, 50, 255, 255, 255, 50),
gsDPSetEnvColor(0x00, 0x64, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(water_1_tex_dummy, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPLoadMultiBlock_4b_Dolphin(water_2_tex_dummy, 1, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r2_1_v[260], 12, 0),
gsSPNTrianglesInit_5b(10, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(4, 5, 3, // tri0
4, 6, 5, // tri1
6, 7, 5, // tri2
6, 8, 7 // tri3
),
gsSPNTriangles_5b(8, 9, 7, // tri0
8, 10, 9, // tri1
8, 11, 10, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_r2_1_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r2_1_v[247], 13, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 3, 6 // tri2
),
gsSPNTriangles_5b(7, 5, 8, // tri0
9, 7, 10, // tri1
11, 9, 12, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r2_1_v[0], 32, 0),
gsSPNTrianglesInit_5b(23, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 7, 5, // tri0
8, 9, 10, // tri1
8, 11, 9, // tri2
10, 9, 12 // tri3
),
gsSPNTriangles_5b(9, 7, 12, // tri0
13, 14, 15, // tri1
14, 16, 15, // tri2
17, 18, 19 // tri3
),
gsSPNTriangles_5b(18, 20, 19, // tri0
20, 21, 19, // tri1
20, 22, 21, // tri2
20, 23, 22 // tri3
),
gsSPNTriangles_5b(23, 24, 22, // tri0
1, 25, 3, // tri1
2, 3, 26, // tri2
27, 28, 23 // tri3
),
gsSPNTriangles_5b(29, 30, 28, // tri0
30, 24, 28, // tri1
24, 23, 28, // tri2
17, 31, 18 // tri3
),
gsSPVertex(&grd_s_c1_r2_1_v[32], 32, 0),
gsSPNTrianglesInit_5b(19, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
8, 9, 10, // tri1
8, 11, 9, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(15, 16, 17, // tri0
18, 19, 20, // tri1
12, 21, 18, // tri2
22, 23, 21 // tri3
),
gsSPNTriangles_5b(22, 24, 23, // tri0
21, 12, 22, // tri1
24, 25, 23, // tri2
26, 25, 24 // tri3
),
gsSPNTriangles_5b(26, 27, 28, // tri0
26, 24, 27, // tri1
29, 30, 31, // tri2
30, 8, 31 // tri3
),
gsSPVertex(&grd_s_c1_r2_1_v[64], 32, 0),
gsSPNTrianglesInit_5b(23, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
3, 4, 2 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
5, 8, 6, // tri1
8, 9, 6, // tri2
3, 7, 10 // tri3
),
gsSPNTriangles_5b(11, 12, 4, // tri0
13, 14, 12, // tri1
13, 12, 15, // tri2
15, 12, 11 // tri3
),
gsSPNTriangles_5b(15, 11, 16, // tri0
11, 17, 16, // tri1
18, 16, 17, // tri2
19, 9, 8 // tri3
),
gsSPNTriangles_5b(20, 21, 22, // tri0
21, 14, 22, // tri1
5, 7, 1, // tri2
7, 3, 1 // tri3
),
gsSPNTriangles_5b(23, 24, 25, // tri0
26, 27, 19, // tri1
28, 29, 30, // tri2
28, 31, 29 // tri3
),
gsSPVertex(&grd_s_c1_r2_1_v[96], 10, 0),
gsSPNTrianglesInit_5b(4, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 7, 8 // tri2
),
gsSPNTriangles_5b(6, 9, 7, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r2_1_v[106], 32, 0),
gsSPNTrianglesInit_5b(16, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(7, 8, 9, // tri0
8, 7, 10, // tri1
9, 6, 7, // tri2
11, 10, 12 // tri3
),
gsSPNTriangles_5b(2, 13, 12, // tri0
14, 15, 0, // tri1
16, 17, 18, // tri2
18, 19, 20 // tri3
),
gsSPNTriangles_5b(20, 21, 22, // tri0
22, 23, 24, // tri1
24, 25, 26, // tri2
27, 28, 29 // tri3
),
gsSPNTriangles_5b(29, 30, 31, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_1_v[138], 20, 0),
gsSPNTrianglesInit_5b(9, // tri count
0, 1, 2, // tri0
2, 3, 4, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(7, 8, 9, // tri0
10, 11, 12, // tri1
13, 14, 10, // tri2
15, 16, 13 // tri3
),
gsSPNTriangles_5b(17, 18, 15, // tri0
9, 19, 17, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r2_1_v[158], 32, 0),
gsSPNTrianglesInit_5b(38, // tri count
0, 1, 2, // tri0
3, 0, 2, // tri1
4, 5, 2 // tri2
),
gsSPNTriangles_5b(5, 6, 2, // tri0
6, 7, 2, // tri1
7, 8, 2, // tri2
6, 9, 7 // tri3
),
gsSPNTriangles_5b(6, 10, 9, // tri0
11, 12, 0, // tri1
13, 11, 0, // tri2
14, 13, 0 // tri3
),
gsSPNTriangles_5b(1, 4, 2, // tri0
1, 0, 12, // tri1
8, 3, 2, // tri2
0, 3, 14 // tri3
),
gsSPNTriangles_5b(15, 16, 17, // tri0
18, 17, 16, // tri1
19, 11, 20, // tri2
11, 21, 20 // tri3
),
gsSPNTriangles_5b(21, 11, 22, // tri0
11, 23, 22, // tri1
11, 19, 12, // tri2
11, 13, 23 // tri3
),
gsSPNTriangles_5b(10, 6, 24, // tri0
24, 6, 5, // tri1
18, 25, 17, // tri2
25, 26, 17 // tri3
),
gsSPNTriangles_5b(27, 28, 25, // tri0
27, 25, 18, // tri1
29, 27, 16, // tri2
27, 18, 16 // tri3
),
gsSPNTriangles_5b(30, 29, 31, // tri0
29, 16, 31, // tri1
31, 16, 15, // tri2
10, 24, 31 // tri3
),
gsSPNTriangles_5b(24, 30, 31, // tri0
10, 31, 15, // tri1
10, 15, 9, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(river_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r2_1_v[190], 32, 0),
gsSPNTrianglesInit_5b(23, // tri count
0, 1, 2, // tri0
1, 3, 4, // tri1
4, 2, 1 // tri2
),
gsSPNTriangles_5b(3, 5, 4, // tri0
6, 7, 5, // tri1
7, 4, 5, // tri2
8, 7, 6 // tri3
),
gsSPNTriangles_5b(9, 10, 8, // tri0
10, 7, 8, // tri1
11, 12, 9, // tri2
9, 12, 10 // tri3
),
gsSPNTriangles_5b(11, 13, 12, // tri0
13, 14, 15, // tri1
14, 16, 15, // tri2
16, 17, 15 // tri3
),
gsSPNTriangles_5b(13, 15, 12, // tri0
18, 19, 20, // tri1
21, 22, 18, // tri2
23, 24, 22 // tri3
),
gsSPNTriangles_5b(25, 26, 24, // tri0
25, 27, 26, // tri1
28, 29, 27, // tri2
28, 30, 29 // tri3
),
gsSPVertex(&grd_s_c1_r2_1_v[221], 13, 0),
gsSPNTrianglesInit_5b(7, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
2, 4, 0 // tri2
),
gsSPNTriangles_5b(5, 6, 4, // tri0
7, 8, 6, // tri1
9, 8, 10, // tri2
11, 12, 9 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r2_1_v[234], 13, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(1, 5, 8, // tri0
9, 10, 11, // tri1
10, 3, 12, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,7 @@
#include "evw_anime.h"
static EVW_ANIME_SCROLL grd_s_c1_r2_1_evw_anime_1[] = { { 1, -1, 32, 32 }, { -1, -2, 32, 32 } };
extern EVW_ANIME_DATA grd_s_c1_r2_1_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_s_c1_r2_1_evw_anime_1 },
};
@@ -0,0 +1,310 @@
#include "libforest/gbi_extensions.h"
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 water_2_tex_dummy[];
extern u8 water_1_tex_dummy[];
extern u8 river_tex_dummy[];
extern u8 grass_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_r2_2_v[] = {
#include "assets/field/bg/grd_s_c1_r2_2_v.inc"
};
extern Gfx grd_s_c1_r2_2_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 1, 0, TEXEL0, TEXEL1, COMBINED, 0, SHADE, TEXEL0,
COMBINED, 0, PRIM_LOD_FRAC, PRIMITIVE),
gsDPSetPrimColor(0, 50, 255, 255, 255, 50),
gsDPSetEnvColor(0x00, 0x3C, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(water_1_tex_dummy, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPLoadMultiBlock_4b_Dolphin(water_2_tex_dummy, 1, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r2_2_v[267], 13, 0),
gsSPNTrianglesInit_5b(11, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 8, // tri0
9, 1, 3, // tri1
7, 0, 10, // tri2
5, 8, 6 // tri3
),
gsSPNTriangles_5b(7, 10, 11, // tri0
0, 2, 10, // tri1
12, 9, 3, // tri2
7, 11, 8 // tri3
),
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_r2_2_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r2_2_v[0], 32, 0),
gsSPNTrianglesInit_5b(26, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
1, 6, 7 // tri2
),
gsSPNTriangles_5b(8, 9, 10, // tri0
8, 10, 11, // tri1
9, 12, 10, // tri2
13, 14, 15 // tri3
),
gsSPNTriangles_5b(6, 16, 7, // tri0
12, 17, 18, // tri1
12, 9, 17, // tri2
1, 7, 19 // tri3
),
gsSPNTriangles_5b(14, 8, 11, // tri0
20, 13, 15, // tri1
21, 22, 23, // tri2
1, 19, 2 // tri3
),
gsSPNTriangles_5b(4, 24, 5, // tri0
6, 25, 26, // tri1
16, 6, 26, // tri2
26, 3, 5 // tri3
),
gsSPNTriangles_5b(26, 25, 3, // tri0
27, 28, 3, // tri1
3, 28, 29, // tri2
24, 4, 30 // tri3
),
gsSPNTriangles_5b(24, 30, 31, // tri0
3, 29, 4, // tri1
25, 27, 3, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_2_v[32], 30, 0),
gsSPNTrianglesInit_5b(25, // tri count
0, 1, 2, // tri0
3, 0, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(7, 8, 9, // tri0
7, 10, 8, // tri1
3, 2, 11, // tri2
12, 13, 5 // tri3
),
gsSPNTriangles_5b(13, 14, 5, // tri0
5, 15, 16, // tri1
5, 14, 15, // tri2
16, 15, 17 // tri3
),
gsSPNTriangles_5b(15, 18, 17, // tri0
17, 19, 3, // tri1
17, 18, 19, // tri2
3, 19, 0 // tri3
),
gsSPNTriangles_5b(19, 20, 0, // tri0
20, 21, 0, // tri1
21, 20, 22, // tri2
20, 23, 22 // tri3
),
gsSPNTriangles_5b(22, 24, 25, // tri0
22, 23, 24, // tri1
26, 27, 7, // tri2
27, 28, 7 // tri3
),
gsSPNTriangles_5b(7, 29, 10, // tri0
7, 28, 29, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r2_2_v[62], 32, 0),
gsSPNTrianglesInit_5b(17, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 7, 8 // tri2
),
gsSPNTriangles_5b(7, 9, 8, // tri0
10, 11, 12, // tri1
13, 14, 15, // tri2
14, 0, 15 // tri3
),
gsSPNTriangles_5b(16, 5, 17, // tri0
17, 5, 4, // tri1
18, 19, 20, // tri2
21, 22, 23 // tri3
),
gsSPNTriangles_5b(24, 23, 22, // tri0
24, 22, 19, // tri1
22, 21, 25, // tri2
24, 19, 18 // tri3
),
gsSPNTriangles_5b(26, 27, 16, // tri0
28, 29, 25, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_2_v[92], 32, 0),
gsSPNTrianglesInit_5b(16, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 5, 4 // tri2
),
gsSPNTriangles_5b(7, 8, 9, // tri0
10, 11, 12, // tri1
13, 14, 15, // tri2
13, 15, 16 // tri3
),
gsSPNTriangles_5b(2, 17, 18, // tri0
19, 20, 21, // tri1
19, 21, 22, // tri2
20, 13, 16 // tri3
),
gsSPNTriangles_5b(20, 16, 21, // tri0
23, 24, 25, // tri1
26, 11, 10, // tri2
26, 10, 27 // tri3
),
gsSPNTriangles_5b(23, 28, 29, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_2_v[122], 32, 0),
gsSPNTrianglesInit_5b(17, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
0, 2, 6 // tri2
),
gsSPNTriangles_5b(7, 6, 8, // tri0
9, 0, 6, // tri1
10, 9, 6, // tri2
11, 12, 13 // tri3
),
gsSPNTriangles_5b(14, 15, 16, // tri0
17, 18, 12, // tri1
19, 20, 21, // tri2
11, 22, 12 // tri3
),
gsSPNTriangles_5b(22, 17, 12, // tri0
18, 23, 12, // tri1
24, 14, 16, // tri2
25, 11, 13 // tri3
),
gsSPNTriangles_5b(26, 27, 28, // tri0
29, 30, 27, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_2_v[153], 27, 0),
gsSPNTrianglesInit_5b(11, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 7, 8 // tri2
),
gsSPNTriangles_5b(9, 10, 11, // tri0
12, 9, 13, // tri1
14, 15, 16, // tri2
17, 18, 19 // tri3
),
gsSPNTriangles_5b(20, 17, 21, // tri0
18, 22, 19, // tri1
11, 20, 23, // tri2
24, 25, 26 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r2_2_v[180], 32, 0),
gsSPNTrianglesInit_5b(17, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 2, 6, // tri0
7, 8, 9, // tri1
0, 10, 11, // tri2
10, 12, 11 // tri3
),
gsSPNTriangles_5b(8, 13, 14, // tri0
8, 14, 9, // tri1
13, 4, 15, // tri2
16, 7, 17 // tri3
),
gsSPNTriangles_5b(18, 19, 20, // tri0
19, 21, 22, // tri1
21, 23, 24, // tri2
23, 25, 26 // tri3
),
gsSPNTriangles_5b(25, 27, 28, // tri0
27, 29, 30, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_2_v[211], 13, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
1, 3, 4, // tri1
3, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 8, // tri0
7, 9, 10, // tri1
9, 11, 12, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(river_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r2_2_v[224], 32, 0),
gsSPNTrianglesInit_5b(26, // tri count
0, 1, 2, // tri0
2, 3, 0, // tri1
3, 4, 0 // tri2
),
gsSPNTriangles_5b(4, 3, 5, // tri0
5, 6, 4, // tri1
5, 7, 6, // tri2
7, 8, 6 // tri3
),
gsSPNTriangles_5b(7, 9, 8, // tri0
7, 10, 9, // tri1
10, 11, 9, // tri2
10, 12, 11 // tri3
),
gsSPNTriangles_5b(10, 13, 12, // tri0
13, 14, 12, // tri1
14, 15, 12, // tri2
14, 16, 15 // tri3
),
gsSPNTriangles_5b(14, 17, 16, // tri0
18, 19, 20, // tri1
18, 21, 19, // tri2
19, 22, 20 // tri3
),
gsSPNTriangles_5b(22, 23, 20, // tri0
24, 25, 26, // tri1
24, 27, 28, // tri2
24, 28, 25 // tri3
),
gsSPNTriangles_5b(25, 29, 26, // tri0
23, 30, 20, // tri1
23, 31, 30, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_2_v[256], 11, 0),
gsSPNTrianglesInit_5b(7, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(4, 5, 1, // tri0
4, 6, 5, // tri1
7, 8, 9, // tri2
6, 10, 5 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,7 @@
#include "evw_anime.h"
static EVW_ANIME_SCROLL grd_s_c1_r2_2_evw_anime_1[] = { { 1, -1, 32, 32 }, { -1, -2, 32, 32 } };
extern EVW_ANIME_DATA grd_s_c1_r2_2_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_s_c1_r2_2_evw_anime_1 },
};
@@ -0,0 +1,365 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 water_2_tex_dummy[];
extern u8 water_1_tex_dummy[];
extern u8 river_tex_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_r2_3_v[] = {
#include "assets/field/bg/grd_s_c1_r2_3_v.inc"
};
extern Gfx grd_s_c1_r2_3_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 1, 0, TEXEL0, TEXEL1, COMBINED, 0, SHADE, TEXEL0,
COMBINED, 0, PRIM_LOD_FRAC, PRIMITIVE),
gsDPSetPrimColor(0, 50, 255, 255, 255, 50),
gsDPSetEnvColor(0x00, 0x64, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(water_1_tex_dummy, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPLoadMultiBlock_4b_Dolphin(water_2_tex_dummy, 1, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r2_3_v[288], 16, 0),
gsSPNTrianglesInit_5b(14, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(1, 5, 4, // tri0
5, 6, 4, // tri1
6, 7, 4, // tri2
6, 8, 7 // tri3
),
gsSPNTriangles_5b(6, 9, 8, // tri0
9, 10, 8, // tri1
9, 11, 10, // tri2
11, 12, 10 // tri3
),
gsSPNTriangles_5b(12, 13, 10, // tri0
12, 14, 13, // tri1
12, 15, 14, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_r2_3_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r2_3_v[271], 17, 0),
gsSPNTrianglesInit_5b(10, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
3, 4, 2 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
5, 8, 6, // tri1
6, 9, 7, // tri2
0, 10, 11 // tri3
),
gsSPNTriangles_5b(12, 4, 13, // tri0
10, 8, 14, // tri1
9, 15, 16, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r2_3_v[0], 32, 0),
gsSPNTrianglesInit_5b(22, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
6, 8, 7, // tri1
5, 9, 6, // tri2
10, 11, 12 // tri3
),
gsSPNTriangles_5b(13, 14, 15, // tri0
14, 16, 15, // tri1
16, 17, 15, // tri2
0, 18, 19 // tri3
),
gsSPNTriangles_5b(18, 20, 19, // tri0
20, 21, 19, // tri1
22, 23, 24, // tri2
23, 17, 24 // tri3
),
gsSPNTriangles_5b(11, 4, 1, // tri0
11, 10, 4, // tri1
11, 25, 12, // tri2
25, 26, 12 // tri3
),
gsSPNTriangles_5b(26, 27, 12, // tri0
28, 5, 7, // tri1
28, 29, 5, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_3_v[30], 32, 0),
gsSPNTrianglesInit_5b(22, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
4, 8, 5, // tri1
9, 10, 11, // tri2
10, 12, 11 // tri3
),
gsSPNTriangles_5b(10, 8, 12, // tri0
13, 14, 15, // tri1
14, 16, 15, // tri2
14, 17, 16 // tri3
),
gsSPNTriangles_5b(17, 18, 16, // tri0
17, 19, 18, // tri1
19, 20, 18, // tri2
21, 22, 23 // tri3
),
gsSPNTriangles_5b(22, 24, 23, // tri0
9, 25, 7, // tri1
12, 26, 11, // tri2
27, 28, 29 // tri3
),
gsSPNTriangles_5b(27, 30, 28, // tri0
28, 31, 29, // tri1
30, 0, 2, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_3_v[62], 30, 0),
gsSPNTrianglesInit_5b(17, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(1, 5, 4, // tri0
1, 6, 5, // tri1
5, 7, 4, // tri2
5, 8, 7 // tri3
),
gsSPNTriangles_5b(9, 10, 11, // tri0
10, 12, 11, // tri1
10, 13, 12, // tri2
14, 15, 16 // tri3
),
gsSPNTriangles_5b(14, 17, 15, // tri0
18, 19, 20, // tri1
21, 22, 23, // tri2
24, 23, 25 // tri3
),
gsSPNTriangles_5b(26, 27, 28, // tri0
26, 29, 27, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r2_3_v[92], 17, 0),
gsSPNTrianglesInit_5b(10, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
3, 4, 2 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
5, 8, 6, // tri1
6, 9, 7, // tri2
10, 4, 11 // tri3
),
gsSPNTriangles_5b(0, 12, 13, // tri0
9, 14, 15, // tri1
12, 8, 16, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r2_3_v[109], 32, 0),
gsSPNTrianglesInit_5b(18, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
6, 8, 7, // tri1
9, 10, 11, // tri2
10, 12, 11 // tri3
),
gsSPNTriangles_5b(9, 13, 10, // tri0
9, 14, 13, // tri1
15, 16, 17, // tri2
15, 18, 16 // tri3
),
gsSPNTriangles_5b(19, 20, 21, // tri0
19, 22, 23, // tri1
24, 23, 22, // tri2
25, 24, 22 // tri3
),
gsSPNTriangles_5b(26, 27, 25, // tri0
17, 28, 26, // tri1
15, 29, 30, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_3_v[140], 32, 0),
gsSPNTrianglesInit_5b(14, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
2, 6, 7 // tri2
),
gsSPNTriangles_5b(8, 9, 10, // tri0
11, 12, 13, // tri1
14, 15, 16, // tri2
17, 14, 18 // tri3
),
gsSPNTriangles_5b(12, 19, 20, // tri0
19, 17, 21, // tri1
22, 23, 24, // tri2
22, 25, 26 // tri3
),
gsSPNTriangles_5b(27, 26, 25, // tri0
28, 27, 25, // tri1
29, 30, 28, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_3_v[171], 6, 0),
gsSPNTrianglesInit_5b(2, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
0, 0, 0 // tri2
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r2_3_v[177], 32, 0),
gsSPNTrianglesInit_5b(29, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
5, 2, 6, // tri1
6, 4, 7, // tri2
4, 8, 7 // tri3
),
gsSPNTriangles_5b(9, 10, 11, // tri0
9, 2, 10, // tri1
2, 5, 10, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(12, 15, 13, // tri0
15, 16, 13, // tri1
17, 18, 19, // tri2
17, 20, 18 // tri3
),
gsSPNTriangles_5b(21, 22, 23, // tri0
22, 12, 23, // tri1
22, 24, 12, // tri2
21, 23, 25 // tri3
),
gsSPNTriangles_5b(23, 12, 25, // tri0
26, 21, 25, // tri1
21, 27, 22, // tri2
21, 28, 27 // tri3
),
gsSPNTriangles_5b(28, 26, 29, // tri0
28, 21, 26, // tri1
18, 9, 11, // tri2
18, 20, 9 // tri3
),
gsSPNTriangles_5b(30, 19, 31, // tri0
30, 17, 19, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_3_v[209], 24, 0),
gsSPNTrianglesInit_5b(18, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
8, 9, 10, // tri1
8, 11, 9, // tri2
8, 12, 11 // tri3
),
gsSPNTriangles_5b(8, 13, 12, // tri0
14, 0, 2, // tri1
14, 15, 0, // tri2
3, 16, 4 // tri3
),
gsSPNTriangles_5b(16, 17, 4, // tri0
18, 8, 10, // tri1
18, 19, 8, // tri2
19, 20, 8 // tri3
),
gsSPNTriangles_5b(20, 13, 8, // tri0
21, 22, 5, // tri1
21, 23, 22, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(river_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r2_3_v[233], 32, 0),
gsSPNTrianglesInit_5b(28, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
3, 4, 2 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
5, 8, 6, // tri1
5, 9, 8, // tri2
10, 7, 6 // tri3
),
gsSPNTriangles_5b(11, 12, 13, // tri0
12, 14, 13, // tri1
15, 12, 16, // tri2
12, 11, 16 // tri3
),
gsSPNTriangles_5b(14, 17, 13, // tri0
14, 18, 17, // tri1
18, 19, 17, // tri2
18, 20, 19 // tri3
),
gsSPNTriangles_5b(18, 21, 20, // tri0
21, 22, 20, // tri1
21, 23, 22, // tri2
21, 24, 23 // tri3
),
gsSPNTriangles_5b(24, 25, 23, // tri0
24, 26, 25, // tri1
24, 27, 26, // tri2
28, 29, 3 // tri3
),
gsSPNTriangles_5b(29, 4, 3, // tri0
0, 30, 1, // tri1
30, 5, 1, // tri2
30, 9, 5 // tri3
),
gsSPNTriangles_5b(10, 31, 7, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r2_3_v[265], 6, 0),
gsSPNTrianglesInit_5b(4, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(4, 5, 1, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,7 @@
#include "evw_anime.h"
static EVW_ANIME_SCROLL grd_s_c1_r2_3_evw_anime_1[] = { { 1, -1, 32, 32 }, { -1, -2, 32, 32 } };
extern EVW_ANIME_DATA grd_s_c1_r2_3_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_s_c1_r2_3_evw_anime_1 },
};
@@ -0,0 +1,291 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 water_2_tex_dummy[];
extern u8 water_1_tex_dummy[];
extern u8 river_tex_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_r3_1_v[] = {
#include "assets/field/bg/grd_s_c1_r3_1_v.inc"
};
extern Gfx grd_s_c1_r3_1_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 1, 0, TEXEL0, TEXEL1, COMBINED, 0, SHADE, TEXEL0,
COMBINED, 0, PRIM_LOD_FRAC, PRIMITIVE),
gsDPSetPrimColor(0, 50, 255, 255, 255, 50),
gsDPSetEnvColor(0x00, 0x64, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(water_1_tex_dummy, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPLoadMultiBlock_4b_Dolphin(water_2_tex_dummy, 1, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r3_1_v[208], 14, 0),
gsSPNTrianglesInit_5b(12, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
1, 4, 2 // tri2
),
gsSPNTriangles_5b(1, 5, 4, // tri0
5, 6, 4, // tri1
5, 7, 6, // tri2
7, 8, 6 // tri3
),
gsSPNTriangles_5b(8, 9, 6, // tri0
8, 10, 9, // tri1
10, 11, 9, // tri2
10, 12, 11 // tri3
),
gsSPNTriangles_5b(10, 13, 12, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_r3_1_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r3_1_v[197], 11, 0),
gsSPNTrianglesInit_5b(5, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 3, 6 // tri2
),
gsSPNTriangles_5b(7, 5, 8, // tri0
9, 7, 10, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r3_1_v[0], 32, 0),
gsSPNTrianglesInit_5b(22, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
7, 8, 6, // tri1
4, 9, 5, // tri2
10, 11, 12 // tri3
),
gsSPNTriangles_5b(10, 13, 11, // tri0
13, 14, 11, // tri1
15, 16, 12, // tri2
16, 10, 12 // tri3
),
gsSPNTriangles_5b(15, 8, 16, // tri0
8, 7, 16, // tri1
17, 18, 19, // tri2
18, 20, 19 // tri3
),
gsSPNTriangles_5b(20, 21, 19, // tri0
22, 23, 24, // tri1
25, 26, 27, // tri2
26, 28, 27 // tri3
),
gsSPNTriangles_5b(28, 29, 27, // tri0
28, 30, 29, // tri1
28, 31, 30, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_1_v[32], 32, 0),
gsSPNTrianglesInit_5b(21, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
0, 4, 1 // tri2
),
gsSPNTriangles_5b(4, 5, 1, // tri0
4, 6, 5, // tri1
2, 3, 7, // tri2
3, 8, 7 // tri3
),
gsSPNTriangles_5b(9, 10, 11, // tri0
9, 12, 10, // tri1
13, 14, 15, // tri2
14, 16, 15 // tri3
),
gsSPNTriangles_5b(14, 0, 16, // tri0
0, 2, 16, // tri1
17, 18, 19, // tri2
18, 20, 19 // tri3
),
gsSPNTriangles_5b(21, 22, 23, // tri0
22, 24, 23, // tri1
22, 25, 24, // tri2
22, 26, 25 // tri3
),
gsSPNTriangles_5b(27, 28, 29, // tri0
27, 30, 28, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_1_v[63], 21, 0),
gsSPNTrianglesInit_5b(16, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 5 // tri2
),
gsSPNTriangles_5b(6, 7, 8, // tri0
7, 9, 8, // tri1
9, 10, 8, // tri2
9, 11, 10 // tri3
),
gsSPNTriangles_5b(11, 12, 10, // tri0
4, 13, 5, // tri1
4, 14, 13, // tri2
14, 15, 13 // tri3
),
gsSPNTriangles_5b(14, 16, 15, // tri0
16, 6, 15, // tri1
4, 17, 14, // tri2
14, 18, 16 // tri3
),
gsSPNTriangles_5b(19, 20, 0, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r3_1_v[84], 28, 0),
gsSPNTrianglesInit_5b(15, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 3, 7 // tri2
),
gsSPNTriangles_5b(1, 8, 9, // tri0
8, 6, 10, // tri1
11, 12, 13, // tri2
11, 14, 15 // tri3
),
gsSPNTriangles_5b(16, 15, 14, // tri0
17, 16, 14, // tri1
18, 19, 17, // tri2
20, 21, 18 // tri3
),
gsSPNTriangles_5b(22, 23, 20, // tri0
22, 24, 23, // tri1
22, 25, 24, // tri2
25, 26, 27 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(river_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r3_1_v[112], 30, 0),
gsSPNTrianglesInit_5b(26, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
1, 4, 2 // tri2
),
gsSPNTriangles_5b(1, 5, 4, // tri0
5, 6, 4, // tri1
5, 7, 6, // tri2
5, 8, 7 // tri3
),
gsSPNTriangles_5b(8, 9, 7, // tri0
8, 10, 9, // tri1
8, 11, 10, // tri2
11, 12, 10 // tri3
),
gsSPNTriangles_5b(11, 13, 12, // tri0
11, 14, 13, // tri1
14, 15, 13, // tri2
16, 17, 18 // tri3
),
gsSPNTriangles_5b(17, 19, 18, // tri0
19, 20, 18, // tri1
20, 21, 18, // tri2
20, 22, 21 // tri3
),
gsSPNTriangles_5b(22, 23, 21, // tri0
22, 24, 23, // tri1
24, 25, 23, // tri2
24, 26, 25 // tri3
),
gsSPNTriangles_5b(26, 27, 25, // tri0
27, 28, 25, // tri1
27, 29, 28, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r3_1_v[142], 32, 0),
gsSPNTrianglesInit_5b(27, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
8, 9, 10, // tri1
11, 12, 13, // tri2
11, 14, 12 // tri3
),
gsSPNTriangles_5b(14, 15, 12, // tri0
5, 16, 7, // tri1
16, 17, 7, // tri2
17, 18, 7 // tri3
),
gsSPNTriangles_5b(5, 4, 19, // tri0
4, 20, 19, // tri1
9, 19, 10, // tri2
19, 20, 10 // tri3
),
gsSPNTriangles_5b(3, 21, 2, // tri0
3, 22, 21, // tri1
22, 23, 21, // tri2
9, 8, 24 // tri3
),
gsSPNTriangles_5b(8, 25, 24, // tri0
8, 26, 25, // tri1
27, 28, 29, // tri2
27, 30, 28 // tri3
),
gsSPNTriangles_5b(17, 27, 18, // tri0
27, 29, 18, // tri1
0, 26, 31, // tri2
0, 25, 26 // tri3
),
gsSPVertex(&grd_s_c1_r3_1_v[174], 12, 0),
gsSPNTrianglesInit_5b(8, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 0, 5 // tri2
),
gsSPNTriangles_5b(0, 2, 5, // tri0
6, 7, 8, // tri1
7, 9, 8, // tri2
10, 8, 11 // tri3
),
gsSPNTriangles_5b(10, 6, 8, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r3_1_v[186], 11, 0),
gsSPNTrianglesInit_5b(5, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 6, 7 // tri2
),
gsSPNTriangles_5b(1, 8, 9, // tri0
8, 3, 10, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,7 @@
#include "evw_anime.h"
static EVW_ANIME_SCROLL grd_s_c1_r3_1_evw_anime_1[] = { { 1, -1, 32, 32 }, { -1, -2, 32, 32 } };
extern EVW_ANIME_DATA grd_s_c1_r3_1_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_s_c1_r3_1_evw_anime_1 },
};
@@ -0,0 +1,313 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 water_2_tex_dummy[];
extern u8 water_1_tex_dummy[];
extern u8 river_tex_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_r3_2_v[] = {
#include "assets/field/bg/grd_s_c1_r3_2_v.inc"
};
extern Gfx grd_s_c1_r3_2_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 1, 0, TEXEL0, TEXEL1, COMBINED, 0, SHADE, TEXEL0,
COMBINED, 0, PRIM_LOD_FRAC, PRIMITIVE),
gsDPSetPrimColor(0, 50, 255, 255, 255, 50),
gsDPSetEnvColor(0x00, 0x64, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(water_1_tex_dummy, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPLoadMultiBlock_4b_Dolphin(water_2_tex_dummy, 1, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r3_2_v[240], 15, 0),
gsSPNTrianglesInit_5b(13, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
1, 4, 2 // tri2
),
gsSPNTriangles_5b(1, 5, 4, // tri0
5, 6, 4, // tri1
5, 7, 6, // tri2
7, 8, 6 // tri3
),
gsSPNTriangles_5b(7, 9, 8, // tri0
9, 10, 8, // tri1
9, 11, 10, // tri2
11, 12, 10 // tri3
),
gsSPNTriangles_5b(11, 13, 12, // tri0
11, 14, 13, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_r3_2_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r3_2_v[229], 11, 0),
gsSPNTrianglesInit_5b(5, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 3, 6 // tri2
),
gsSPNTriangles_5b(7, 5, 8, // tri0
9, 7, 10, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r3_2_v[0], 32, 0),
gsSPNTrianglesInit_5b(18, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 2, 5 // tri2
),
gsSPNTriangles_5b(4, 0, 2, // tri0
3, 6, 1, // tri1
7, 4, 5, // tri2
8, 9, 10 // tri3
),
gsSPNTriangles_5b(11, 12, 13, // tri0
14, 15, 16, // tri1
14, 17, 15, // tri2
17, 18, 15 // tri3
),
gsSPNTriangles_5b(19, 20, 21, // tri0
20, 22, 21, // tri1
23, 24, 25, // tri2
24, 26, 25 // tri3
),
gsSPNTriangles_5b(27, 25, 26, // tri0
28, 29, 30, // tri1
29, 31, 30, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_2_v[32], 32, 0),
gsSPNTrianglesInit_5b(15, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
5, 8, 7, // tri1
9, 10, 11, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(15, 16, 17, // tri0
16, 18, 17, // tri1
18, 19, 20, // tri2
21, 22, 3 // tri3
),
gsSPNTriangles_5b(23, 24, 8, // tri0
10, 25, 11, // tri1
26, 27, 28, // tri2
26, 29, 27 // tri3
),
gsSPVertex(&grd_s_c1_r3_2_v[62], 32, 0),
gsSPNTrianglesInit_5b(21, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(1, 5, 4, // tri0
5, 6, 4, // tri1
5, 7, 6, // tri2
7, 8, 6 // tri3
),
gsSPNTriangles_5b(7, 9, 8, // tri0
9, 10, 8, // tri1
9, 11, 10, // tri2
9, 12, 11 // tri3
),
gsSPNTriangles_5b(12, 13, 11, // tri0
12, 14, 13, // tri1
15, 16, 17, // tri2
18, 16, 15 // tri3
),
gsSPNTriangles_5b(19, 20, 21, // tri0
22, 23, 24, // tri1
22, 25, 23, // tri2
26, 27, 28 // tri3
),
gsSPNTriangles_5b(27, 29, 28, // tri0
29, 30, 28, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_2_v[93], 9, 0),
gsSPNTrianglesInit_5b(3, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 7, 8 // tri2
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r3_2_v[102], 32, 0),
gsSPNTrianglesInit_5b(15, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
0, 4, 3 // tri2
),
gsSPNTriangles_5b(5, 6, 7, // tri0
8, 9, 10, // tri1
11, 8, 12, // tri2
13, 14, 15 // tri3
),
gsSPNTriangles_5b(16, 13, 17, // tri0
9, 18, 19, // tri1
18, 16, 20, // tri2
21, 22, 23 // tri3
),
gsSPNTriangles_5b(24, 21, 25, // tri0
22, 26, 27, // tri1
26, 28, 29, // tri2
5, 24, 30 // tri3
),
gsSPVertex(&grd_s_c1_r3_2_v[133], 14, 0),
gsSPNTrianglesInit_5b(7, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 7, 3 // tri2
),
gsSPNTriangles_5b(8, 9, 6, // tri0
8, 10, 9, // tri1
8, 11, 10, // tri2
11, 12, 13 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(river_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r3_2_v[147], 32, 0),
gsSPNTrianglesInit_5b(28, // tri count
0, 1, 2, // tri0
3, 4, 2, // tri1
4, 0, 2 // tri2
),
gsSPNTriangles_5b(0, 5, 1, // tri0
5, 6, 1, // tri1
7, 8, 9, // tri2
8, 10, 9 // tri3
),
gsSPNTriangles_5b(8, 11, 10, // tri0
11, 12, 10, // tri1
12, 13, 10, // tri2
12, 6, 13 // tri3
),
gsSPNTriangles_5b(6, 5, 13, // tri0
3, 14, 4, // tri1
3, 15, 14, // tri2
15, 16, 14 // tri3
),
gsSPNTriangles_5b(16, 17, 14, // tri0
16, 18, 17, // tri1
19, 20, 21, // tri2
20, 22, 21 // tri3
),
gsSPNTriangles_5b(22, 23, 21, // tri0
22, 24, 23, // tri1
24, 25, 23, // tri2
19, 26, 20 // tri3
),
gsSPNTriangles_5b(25, 27, 23, // tri0
25, 28, 27, // tri1
28, 29, 27, // tri2
28, 30, 29 // tri3
),
gsSPNTriangles_5b(30, 31, 29, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_2_v[179], 7, 0),
gsSPNTrianglesInit_5b(5, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
3, 4, 2 // tri2
),
gsSPNTriangles_5b(3, 5, 4, // tri0
3, 6, 5, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r3_2_v[186], 32, 0),
gsSPNTrianglesInit_5b(39, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
7, 8, 6, // tri1
7, 9, 8, // tri2
10, 11, 12 // tri3
),
gsSPNTriangles_5b(5, 4, 3, // tri0
4, 2, 3, // tri1
13, 5, 3, // tri2
11, 7, 14 // tri3
),
gsSPNTriangles_5b(7, 5, 14, // tri0
5, 13, 14, // tri1
10, 12, 15, // tri2
12, 16, 15 // tri3
),
gsSPNTriangles_5b(17, 18, 19, // tri0
20, 19, 21, // tri1
20, 17, 19, // tri2
13, 3, 22 // tri3
),
gsSPNTriangles_5b(1, 22, 3, // tri0
1, 23, 22, // tri1
24, 21, 25, // tri2
24, 20, 21 // tri3
),
gsSPNTriangles_5b(24, 26, 20, // tri0
24, 27, 26, // tri1
26, 17, 20, // tri2
26, 28, 17 // tri3
),
gsSPNTriangles_5b(28, 29, 17, // tri0
28, 15, 29, // tri1
28, 30, 15, // tri2
30, 31, 15 // tri3
),
gsSPNTriangles_5b(31, 10, 15, // tri0
31, 9, 10, // tri1
31, 8, 9, // tri2
17, 29, 18 // tri3
),
gsSPNTriangles_5b(29, 15, 18, // tri0
15, 16, 18, // tri1
10, 9, 11, // tri2
9, 7, 11 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r3_2_v[218], 11, 0),
gsSPNTrianglesInit_5b(5, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 6, 7 // tri2
),
gsSPNTriangles_5b(1, 8, 9, // tri0
8, 3, 10, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,7 @@
#include "evw_anime.h"
static EVW_ANIME_SCROLL grd_s_c1_r3_2_evw_anime_1[] = { { 1, -1, 32, 32 }, { -1, -2, 32, 32 } };
extern EVW_ANIME_DATA grd_s_c1_r3_2_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_s_c1_r3_2_evw_anime_1 },
};
@@ -0,0 +1,359 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 water_2_tex_dummy[];
extern u8 water_1_tex_dummy[];
extern u8 river_tex_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_r3_3_v[] = {
#include "assets/field/bg/grd_s_c1_r3_3_v.inc"
};
extern Gfx grd_s_c1_r3_3_modelT[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 1, 0, TEXEL0, TEXEL1, COMBINED, 0, SHADE, TEXEL0,
COMBINED, 0, PRIM_LOD_FRAC, PRIMITIVE),
gsDPSetPrimColor(0, 50, 255, 255, 255, 50),
gsDPSetEnvColor(0x00, 0x3C, 0xFF, 0xFF),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2),
gsDPLoadTextureBlock_4b_Dolphin(water_1_tex_dummy, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPLoadMultiBlock_4b_Dolphin(water_2_tex_dummy, 1, G_IM_FMT_I, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPDisplayList(0x08000000),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r3_3_v[256], 14, 0),
gsSPNTrianglesInit_5b(12, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
3, 4, 2 // tri2
),
gsSPNTriangles_5b(3, 5, 4, // tri0
5, 6, 4, // tri1
6, 7, 4, // tri2
6, 8, 7 // tri3
),
gsSPNTriangles_5b(8, 9, 7, // tri0
8, 10, 9, // tri1
8, 11, 10, // tri2
11, 12, 10 // tri3
),
gsSPNTriangles_5b(12, 13, 10, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_r3_3_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_r3_3_v[243], 13, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 3, 6 // tri2
),
gsSPNTriangles_5b(7, 5, 8, // tri0
9, 7, 10, // tri1
11, 9, 12, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r3_3_v[0], 32, 0),
gsSPNTrianglesInit_5b(20, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
0, 4, 3 // tri2
),
gsSPNTriangles_5b(0, 5, 4, // tri0
6, 7, 8, // tri1
9, 10, 11, // tri2
12, 10, 9 // tri3
),
gsSPNTriangles_5b(10, 13, 14, // tri0
10, 15, 13, // tri1
12, 15, 10, // tri2
16, 17, 18 // tri3
),
gsSPNTriangles_5b(18, 17, 19, // tri0
14, 20, 17, // tri1
20, 19, 17, // tri2
2, 21, 22 // tri3
),
gsSPNTriangles_5b(21, 23, 22, // tri0
23, 24, 22, // tri1
25, 26, 27, // tri2
26, 28, 27 // tri3
),
gsSPNTriangles_5b(29, 30, 31, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_3_v[32], 32, 0),
gsSPNTrianglesInit_5b(20, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 7, 5, // tri0
8, 9, 7, // tri1
10, 11, 12, // tri2
13, 14, 10 // tri3
),
gsSPNTriangles_5b(15, 16, 17, // tri0
18, 19, 20, // tri1
21, 22, 23, // tri2
22, 24, 25 // tri3
),
gsSPNTriangles_5b(24, 26, 25, // tri0
24, 27, 26, // tri1
27, 28, 29, // tri2
28, 1, 0 // tri3
),
gsSPNTriangles_5b(1, 30, 3, // tri0
30, 8, 3, // tri1
30, 31, 8, // tri2
27, 29, 26 // tri3
),
gsSPNTriangles_5b(28, 0, 29, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_3_v[64], 32, 0),
gsSPNTrianglesInit_5b(20, // tri count
0, 1, 2, // tri0
3, 1, 0, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(5, 7, 6, // tri0
8, 9, 10, // tri1
9, 8, 11, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(15, 13, 12, // tri0
15, 16, 13, // tri1
16, 15, 17, // tri2
17, 18, 16 // tri3
),
gsSPNTriangles_5b(19, 18, 17, // tri0
19, 20, 18, // tri1
21, 20, 19, // tri2
21, 22, 20 // tri3
),
gsSPNTriangles_5b(21, 23, 22, // tri0
24, 25, 26, // tri1
26, 25, 27, // tri2
28, 24, 29 // tri3
),
gsSPNTriangles_5b(24, 30, 29, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_3_v[95], 10, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
3, 1, 0, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(4, 7, 5, // tri0
8, 7, 4, // tri1
8, 9, 7, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r3_3_v[105], 32, 0),
gsSPNTrianglesInit_5b(17, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 7, 8 // tri2
),
gsSPNTriangles_5b(7, 3, 8, // tri0
1, 9, 10, // tri1
9, 6, 11, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(15, 12, 16, // tri0
17, 18, 19, // tri1
18, 20, 21, // tri2
20, 15, 22 // tri3
),
gsSPNTriangles_5b(23, 24, 25, // tri0
23, 26, 24, // tri1
25, 27, 28, // tri2
27, 17, 29 // tri3
),
gsSPNTriangles_5b(25, 28, 23, // tri0
30, 24, 31, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_3_v[137], 12, 0),
gsSPNTrianglesInit_5b(8, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 7, 4 // tri2
),
gsSPNTriangles_5b(8, 9, 10, // tri0
6, 8, 7, // tri1
1, 11, 5, // tri2
11, 3, 5 // tri3
),
gsSPNTriangles_5b(3, 6, 4, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_r3_3_v[149], 32, 0),
gsSPNTrianglesInit_5b(37, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(0, 5, 3, // tri0
0, 6, 5, // tri1
4, 3, 7, // tri2
3, 8, 7 // tri3
),
gsSPNTriangles_5b(3, 5, 8, // tri0
5, 9, 8, // tri1
7, 10, 11, // tri2
7, 8, 10 // tri3
),
gsSPNTriangles_5b(8, 12, 10, // tri0
8, 9, 12, // tri1
11, 13, 14, // tri2
11, 10, 13 // tri3
),
gsSPNTriangles_5b(10, 12, 13, // tri0
12, 15, 13, // tri1
14, 16, 17, // tri2
14, 13, 16 // tri3
),
gsSPNTriangles_5b(13, 18, 16, // tri0
13, 15, 18, // tri1
17, 16, 19, // tri2
16, 20, 19 // tri3
),
gsSPNTriangles_5b(16, 21, 20, // tri0
16, 18, 21, // tri1
19, 22, 23, // tri2
19, 20, 22 // tri3
),
gsSPNTriangles_5b(20, 24, 22, // tri0
20, 21, 24, // tri1
23, 25, 26, // tri2
23, 22, 25 // tri3
),
gsSPNTriangles_5b(22, 27, 25, // tri0
22, 24, 27, // tri1
26, 25, 28, // tri2
25, 29, 28 // tri3
),
gsSPNTriangles_5b(25, 30, 29, // tri0
25, 27, 30, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_3_v[180], 6, 0),
gsSPNTrianglesInit_5b(4, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(4, 5, 1, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(river_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r3_3_v[186], 32, 0),
gsSPNTrianglesInit_5b(28, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(3, 5, 4, // tri0
5, 6, 4, // tri1
5, 7, 6, // tri2
7, 8, 6 // tri3
),
gsSPNTriangles_5b(7, 9, 8, // tri0
9, 10, 8, // tri1
9, 11, 10, // tri2
9, 12, 11 // tri3
),
gsSPNTriangles_5b(12, 13, 11, // tri0
12, 14, 13, // tri1
14, 15, 13, // tri2
14, 16, 15 // tri3
),
gsSPNTriangles_5b(14, 17, 16, // tri0
17, 18, 16, // tri1
18, 19, 16, // tri2
20, 21, 22 // tri3
),
gsSPNTriangles_5b(23, 20, 22, // tri0
20, 24, 21, // tri1
24, 25, 21, // tri2
24, 26, 25 // tri3
),
gsSPNTriangles_5b(26, 27, 25, // tri0
26, 28, 27, // tri1
28, 29, 27, // tri2
29, 30, 27 // tri3
),
gsSPNTriangles_5b(30, 31, 27, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_r3_3_v[218], 12, 0),
gsSPNTrianglesInit_5b(10, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(4, 5, 3, // tri0
5, 6, 3, // tri1
5, 7, 6, // tri2
7, 8, 6 // tri3
),
gsSPNTriangles_5b(7, 9, 8, // tri0
9, 10, 8, // tri1
9, 11, 10, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_r3_3_v[230], 13, 0),
gsSPNTrianglesInit_5b(6, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(1, 5, 8, // tri0
9, 10, 11, // tri1
10, 3, 12, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,7 @@
#include "evw_anime.h"
static EVW_ANIME_SCROLL grd_s_c1_r3_3_evw_anime_1[] = { { 1, -1, 32, 32 }, { -1, -2, 32, 32 } };
extern EVW_ANIME_DATA grd_s_c1_r3_3_evw_anime[] = {
{ -1, EVW_ANIME_TYPE_SCROLL2, grd_s_c1_r3_3_evw_anime_1 },
};
@@ -0,0 +1,268 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_s_1_v[] = {
#include "assets/field/bg/grd_s_c1_s_1_v.inc"
};
extern Gfx grd_s_c1_s_1_modelT[] = {
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_s_1_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_s_1_v[193], 11, 0),
gsSPNTrianglesInit_5b(
5, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 3, 6 // tri2
),
gsSPNTriangles_5b(
7, 5, 8, // tri0
9, 7, 10, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_s_1_v[0], 32, 0),
gsSPNTrianglesInit_5b(
22, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 3, 5 // tri2
),
gsSPNTriangles_5b(
3, 6, 5, // tri0
7, 8, 9, // tri1
7, 10, 8, // tri2
10, 11, 8 // tri3
),
gsSPNTriangles_5b(
12, 13, 14, // tri0
15, 16, 1, // tri1
15, 17, 16, // tri2
17, 18, 16 // tri3
),
gsSPNTriangles_5b(
13, 19, 14, // tri0
19, 20, 14, // tri1
21, 22, 23, // tri2
21, 24, 22 // tri3
),
gsSPNTriangles_5b(
24, 25, 22, // tri0
25, 26, 22, // tri1
13, 12, 27, // tri2
12, 28, 27 // tri3
),
gsSPNTriangles_5b(
12, 29, 28, // tri0
30, 23, 31, // tri1
30, 21, 23, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_1_v[32], 32, 0),
gsSPNTrianglesInit_5b(
19, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
7, 8, 9, // tri0
10, 11, 12, // tri1
10, 13, 11, // tri2
14, 8, 11 // tri3
),
gsSPNTriangles_5b(
15, 5, 16, // tri0
5, 4, 16, // tri1
17, 18, 19, // tri2
18, 12, 19 // tri3
),
gsSPNTriangles_5b(
18, 10, 12, // tri0
20, 21, 22, // tri1
23, 24, 25, // tri2
0, 26, 27 // tri3
),
gsSPNTriangles_5b(
28, 7, 29, // tri0
30, 31, 23, // tri1
31, 24, 23, // tri2
30, 5, 31 // tri3
),
gsSPVertex(&grd_s_c1_s_1_v[64], 18, 0),
gsSPNTrianglesInit_5b(
13, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
7, 1, 8, // tri0
1, 3, 8, // tri1
9, 8, 3, // tri2
10, 9, 3 // tri3
),
gsSPNTriangles_5b(
6, 11, 4, // tri0
11, 12, 4, // tri1
6, 13, 11, // tri2
6, 14, 13 // tri3
),
gsSPNTriangles_5b(
7, 13, 14, // tri0
15, 16, 17, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_s_1_v[82], 32, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
5, 7, 6, // tri0
8, 9, 10, // tri1
9, 11, 10, // tri2
12, 13, 14 // tri3
),
gsSPNTriangles_5b(
13, 15, 14, // tri0
16, 17, 7, // tri1
17, 18, 7, // tri2
19, 20, 21 // tri3
),
gsSPNTriangles_5b(
22, 19, 23, // tri0
20, 24, 25, // tri1
24, 26, 27, // tri2
28, 29, 30 // tri3
),
gsSPNTriangles_5b(
28, 31, 29, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_1_v[114], 32, 0),
gsSPNTrianglesInit_5b(
14, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
7, 8, 9, // tri0
10, 11, 7, // tri1
12, 13, 14, // tri2
15, 16, 17 // tri3
),
gsSPNTriangles_5b(
18, 19, 20, // tri0
21, 18, 22, // tri1
23, 24, 25, // tri2
26, 27, 28 // tri3
),
gsSPNTriangles_5b(
29, 15, 30, // tri0
29, 30, 27, // tri1
19, 26, 28, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_1_v[145], 13, 0),
gsSPNTrianglesInit_5b(
6, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(
8, 9, 10, // tri0
11, 3, 0, // tri1
12, 11, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_s_1_v[158], 24, 0),
gsSPNTrianglesInit_5b(
25, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
5, 7, 6, // tri0
4, 8, 5, // tri1
4, 9, 8, // tri2
8, 10, 5 // tri3
),
gsSPNTriangles_5b(
10, 11, 5, // tri0
11, 7, 5, // tri1
12, 13, 14, // tri2
3, 14, 2 // tri3
),
gsSPNTriangles_5b(
3, 12, 14, // tri0
15, 16, 12, // tri1
15, 17, 16, // tri2
17, 18, 16 // tri3
),
gsSPNTriangles_5b(
12, 16, 13, // tri0
16, 18, 13, // tri1
18, 19, 13, // tri2
15, 12, 20 // tri3
),
gsSPNTriangles_5b(
12, 3, 20, // tri0
1, 20, 3, // tri1
17, 21, 18, // tri2
21, 22, 18 // tri3
),
gsSPNTriangles_5b(
22, 23, 18, // tri0
23, 19, 18, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_s_1_v[182], 11, 0),
gsSPNTrianglesInit_5b(
5, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 6, 7 // tri2
),
gsSPNTriangles_5b(
1, 8, 9, // tri0
8, 3, 10, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,322 @@
#include "libforest/gbi_extensions.h"
extern u8 bush_pal_dummy[];
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 grass_tex_dummy[];
extern u8 bush_b_tex_dummy[];
extern u8 bush_a_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_s_2_v[] = {
#include "assets/field/bg/grd_s_c1_s_2_v.inc"
};
extern Gfx grd_s_c1_s_2_modelT[] = {
gsSPEndDisplayList(),
};
extern Gfx grd_s_c1_s_2_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_a_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_s_2_v[223], 13, 0),
gsSPNTrianglesInit_5b(
6, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 3, 6 // tri2
),
gsSPNTriangles_5b(
7, 5, 8, // tri0
9, 7, 10, // tri1
11, 9, 12, // tri2
0, 0, 0 // tri3
),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_s_2_v[0], 32, 0),
gsSPNTrianglesInit_5b(
25, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
0, 2, 4 // tri2
),
gsSPNTriangles_5b(
5, 6, 7, // tri0
6, 8, 7, // tri1
8, 4, 7, // tri2
8, 0, 4 // tri3
),
gsSPNTriangles_5b(
9, 10, 11, // tri0
10, 12, 11, // tri1
13, 14, 15, // tri2
13, 16, 14 // tri3
),
gsSPNTriangles_5b(
16, 17, 14, // tri0
17, 11, 14, // tri1
17, 18, 11, // tri2
11, 15, 14 // tri3
),
gsSPNTriangles_5b(
18, 9, 11, // tri0
12, 15, 11, // tri1
19, 20, 21, // tri2
20, 22, 21 // tri3
),
gsSPNTriangles_5b(
23, 24, 25, // tri0
24, 26, 25, // tri1
27, 28, 8, // tri2
29, 6, 5 // tri3
),
gsSPNTriangles_5b(
22, 30, 21, // tri0
21, 31, 19, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_2_v[32], 32, 0),
gsSPNTrianglesInit_5b(
20, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
7, 8, 5, // tri0
9, 10, 11, // tri1
10, 12, 11, // tri2
10, 13, 12 // tri3
),
gsSPNTriangles_5b(
13, 14, 12, // tri0
15, 16, 17, // tri1
15, 18, 16, // tri2
16, 19, 17 // tri3
),
gsSPNTriangles_5b(
19, 20, 17, // tri0
19, 21, 20, // tri1
22, 23, 24, // tri2
25, 23, 22 // tri3
),
gsSPNTriangles_5b(
25, 26, 23, // tri0
26, 25, 27, // tri1
26, 28, 23, // tri2
29, 30, 26 // tri3
),
gsSPNTriangles_5b(
3, 31, 1, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_2_v[64], 24, 0),
gsSPNTrianglesInit_5b(
16, // tri count
0, 1, 2, // tri0
1, 3, 4, // tri1
3, 5, 4 // tri2
),
gsSPNTriangles_5b(
6, 7, 8, // tri0
7, 9, 8, // tri1
3, 10, 5, // tri2
10, 11, 5 // tri3
),
gsSPNTriangles_5b(
10, 12, 11, // tri0
10, 13, 12, // tri1
10, 14, 13, // tri2
13, 15, 16 // tri3
),
gsSPNTriangles_5b(
13, 17, 15, // tri0
9, 18, 0, // tri1
18, 1, 0, // tri2
19, 20, 21 // tri3
),
gsSPNTriangles_5b(
22, 23, 19, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_s_2_v[88], 31, 0),
gsSPNTrianglesInit_5b(
17, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
5, 7, 6, // tri0
7, 8, 6, // tri1
9, 10, 11, // tri2
9, 12, 10 // tri3
),
gsSPNTriangles_5b(
13, 14, 15, // tri0
14, 16, 15, // tri1
15, 17, 18, // tri2
19, 20, 13 // tri3
),
gsSPNTriangles_5b(
8, 21, 19, // tri0
4, 22, 23, // tri1
11, 24, 25, // tri2
10, 26, 27 // tri3
),
gsSPNTriangles_5b(
27, 28, 2, // tri0
3, 29, 30, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_s_2_v[119], 32, 0),
gsSPNTrianglesInit_5b(
23, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
1, 4, 2 // tri2
),
gsSPNTriangles_5b(
5, 6, 7, // tri0
5, 8, 6, // tri1
6, 9, 7, // tri2
5, 10, 8 // tri3
),
gsSPNTriangles_5b(
11, 12, 13, // tri0
11, 14, 12, // tri1
15, 1, 16, // tri2
1, 17, 16 // tri3
),
gsSPNTriangles_5b(
18, 19, 20, // tri0
19, 21, 20, // tri1
21, 19, 22, // tri2
19, 23, 22 // tri3
),
gsSPNTriangles_5b(
10, 24, 8, // tri0
10, 25, 24, // tri1
25, 26, 24, // tri2
25, 27, 26 // tri3
),
gsSPNTriangles_5b(
27, 28, 26, // tri0
17, 1, 29, // tri1
1, 3, 29, // tri2
30, 31, 14 // tri3
),
gsSPVertex(&grd_s_c1_s_2_v[151], 32, 0),
gsSPNTrianglesInit_5b(
24, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(
4, 5, 6, // tri0
5, 7, 6, // tri1
5, 8, 7, // tri2
4, 6, 3 // tri3
),
gsSPNTriangles_5b(
9, 10, 11, // tri0
10, 12, 11, // tri1
9, 11, 13, // tri2
11, 14, 13 // tri3
),
gsSPNTriangles_5b(
14, 15, 13, // tri0
16, 17, 18, // tri1
16, 0, 17, // tri2
18, 17, 19 // tri3
),
gsSPNTriangles_5b(
17, 0, 20, // tri0
8, 5, 21, // tri1
5, 22, 21, // tri2
5, 4, 22 // tri3
),
gsSPNTriangles_5b(
23, 24, 25, // tri0
24, 26, 25, // tri1
15, 27, 28, // tri2
27, 29, 28 // tri3
),
gsSPNTriangles_5b(
15, 14, 27, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_2_v[181], 29, 0),
gsSPNTrianglesInit_5b(
21, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
4, 6, 5 // tri2
),
gsSPNTriangles_5b(
6, 4, 7, // tri0
3, 8, 4, // tri1
3, 9, 8, // tri2
8, 7, 4 // tri3
),
gsSPNTriangles_5b(
8, 10, 7, // tri0
11, 12, 13, // tri1
11, 14, 12, // tri2
15, 16, 17 // tri3
),
gsSPNTriangles_5b(
15, 18, 16, // tri0
18, 19, 16, // tri1
19, 20, 16, // tri2
21, 22, 23 // tri3
),
gsSPNTriangles_5b(
22, 24, 23, // tri0
25, 26, 14, // tri1
26, 15, 14, // tri2
22, 27, 24 // tri3
),
gsSPNTriangles_5b(
27, 28, 24, // tri0
25, 14, 11, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, bush_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(bush_b_tex_dummy, G_IM_FMT_CI, 64, 32, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_s_2_v[210], 13, 0),
gsSPNTrianglesInit_5b(
6, // tri count
0, 1, 2, // tri0
3, 0, 4, // tri1
5, 6, 7 // tri2
),
gsSPNTriangles_5b(
1, 5, 8, // tri0
9, 10, 11, // tri1
10, 3, 12, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};
@@ -0,0 +1,323 @@
#include "libforest/gbi_extensions.h"
extern u8 cliff_pal_dummy[];
extern u8 earth_pal_dummy[];
extern u8 grass_tex_dummy[];
extern u8 cliff_tex_dummy[];
extern u8 earth_tex_dummy[];
static Vtx grd_s_c1_s_3_v[] = {
#include "assets/field/bg/grd_s_c1_s_3_v.inc"
};
extern Gfx grd_s_c1_s_3_model[] = {
gsSPTexture(0, 0, 0, 0, G_ON),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPLoadTLUT_Dolphin(15, 16, 1, earth_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(grass_tex_dummy, G_IM_FMT_CI, 32, 32, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(&grd_s_c1_s_3_v[0], 32, 0),
gsSPNTrianglesInit_5b(
20, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
4, 7, 5, // tri0
8, 7, 9, // tri1
7, 10, 9, // tri2
11, 12, 13 // tri3
),
gsSPNTriangles_5b(
12, 8, 13, // tri0
14, 15, 16, // tri1
0, 17, 1, // tri2
18, 19, 14 // tri3
),
gsSPNTriangles_5b(
18, 20, 19, // tri0
18, 21, 20, // tri1
20, 22, 19, // tri2
23, 24, 25 // tri3
),
gsSPNTriangles_5b(
23, 26, 24, // tri0
23, 27, 26, // tri1
28, 6, 5, // tri2
28, 29, 6 // tri3
),
gsSPNTriangles_5b(
30, 28, 5, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_3_v[31], 32, 0),
gsSPNTrianglesInit_5b(
18, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
1, 4, 3 // tri2
),
gsSPNTriangles_5b(
5, 6, 7, // tri0
6, 8, 7, // tri1
9, 10, 11, // tri2
10, 12, 11 // tri3
),
gsSPNTriangles_5b(
12, 13, 11, // tri0
14, 15, 16, // tri1
14, 17, 15, // tri2
17, 18, 15 // tri3
),
gsSPNTriangles_5b(
19, 20, 21, // tri0
7, 22, 5, // tri1
23, 10, 24, // tri2
10, 9, 24 // tri3
),
gsSPNTriangles_5b(
20, 25, 26, // tri0
27, 28, 7, // tri1
29, 30, 31, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_3_v[63], 32, 0),
gsSPNTrianglesInit_5b(
18, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
3, 6, 4 // tri2
),
gsSPNTriangles_5b(
7, 8, 9, // tri0
8, 10, 9, // tri1
11, 12, 4, // tri2
13, 14, 15 // tri3
),
gsSPNTriangles_5b(
16, 17, 18, // tri0
19, 20, 21, // tri1
19, 22, 20, // tri2
22, 23, 20 // tri3
),
gsSPNTriangles_5b(
21, 24, 19, // tri0
0, 5, 25, // tri1
0, 26, 5, // tri2
26, 3, 5 // tri3
),
gsSPNTriangles_5b(
27, 28, 29, // tri0
0, 2, 26, // tri1
30, 31, 13, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_3_v[95], 12, 0),
gsSPNTrianglesInit_5b(
5, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 7, 3 // tri2
),
gsSPNTriangles_5b(
8, 9, 10, // tri0
8, 11, 9, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTextureBlock_4b_Dolphin(earth_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_CLAMP, 0, 0),
gsSPVertex(&grd_s_c1_s_3_v[107], 32, 0),
gsSPNTrianglesInit_5b(
17, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
4, 7, 5, // tri0
2, 3, 8, // tri1
0, 9, 1, // tri2
10, 11, 12 // tri3
),
gsSPNTriangles_5b(
10, 13, 11, // tri0
14, 11, 15, // tri1
14, 16, 11, // tri2
9, 17, 18 // tri3
),
gsSPNTriangles_5b(
19, 20, 8, // tri0
6, 21, 19, // tri1
4, 22, 23, // tri2
24, 25, 26 // tri3
),
gsSPNTriangles_5b(
27, 28, 29, // tri0
15, 27, 30, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_3_v[138], 32, 0),
gsSPNTrianglesInit_5b(
14, // tri count
0, 1, 2, // tri0
3, 4, 5, // tri1
6, 7, 8 // tri2
),
gsSPNTriangles_5b(
6, 8, 4, // tri0
9, 3, 5, // tri1
10, 11, 12, // tri2
13, 10, 14 // tri3
),
gsSPNTriangles_5b(
11, 15, 16, // tri0
15, 17, 18, // tri1
19, 20, 21, // tri2
20, 13, 22 // tri3
),
gsSPNTriangles_5b(
23, 24, 25, // tri0
26, 23, 27, // tri1
28, 29, 30, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_3_v[169], 9, 0),
gsSPNTrianglesInit_5b(
5, // tri count
0, 1, 2, // tri0
1, 3, 2, // tri1
4, 5, 6 // tri2
),
gsSPNTriangles_5b(
5, 7, 8, // tri0
5, 0, 7, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsDPLoadTLUT_Dolphin(15, 16, 1, cliff_pal_dummy),
gsDPLoadTextureBlock_4b_Dolphin(cliff_tex_dummy, G_IM_FMT_CI, 64, 64, 15, GX_REPEAT, GX_REPEAT, 0, 0),
gsSPVertex(&grd_s_c1_s_3_v[178], 32, 0),
gsSPNTrianglesInit_5b(
29, // tri count
0, 1, 2, // tri0
0, 3, 1, // tri1
3, 4, 1 // tri2
),
gsSPNTriangles_5b(
3, 5, 4, // tri0
6, 7, 8, // tri1
7, 9, 8, // tri2
9, 10, 8 // tri3
),
gsSPNTriangles_5b(
7, 11, 12, // tri0
11, 13, 12, // tri1
14, 15, 16, // tri2
14, 11, 15 // tri3
),
gsSPNTriangles_5b(
11, 17, 15, // tri0
11, 18, 17, // tri1
11, 7, 18, // tri2
7, 6, 18 // tri3
),
gsSPNTriangles_5b(
4, 19, 1, // tri0
19, 20, 1, // tri1
21, 3, 0, // tri2
21, 22, 3 // tri3
),
gsSPNTriangles_5b(
21, 23, 22, // tri0
1, 24, 2, // tri1
1, 20, 24, // tri2
7, 25, 9 // tri3
),
gsSPNTriangles_5b(
25, 26, 9, // tri0
7, 12, 25, // tri1
27, 28, 29, // tri2
28, 10, 29 // tri3
),
gsSPNTriangles_5b(
30, 31, 29, // tri0
31, 27, 29, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_3_v[210], 32, 0),
gsSPNTrianglesInit_5b(
24, // tri count
0, 1, 2, // tri0
3, 2, 4, // tri1
3, 0, 2 // tri2
),
gsSPNTriangles_5b(
5, 6, 7, // tri0
8, 9, 10, // tri1
11, 8, 10, // tri2
12, 7, 6 // tri3
),
gsSPNTriangles_5b(
13, 12, 6, // tri0
14, 15, 4, // tri1
16, 14, 4, // tri2
16, 4, 2 // tri3
),
gsSPNTriangles_5b(
17, 16, 2, // tri0
17, 2, 1, // tri1
17, 1, 18, // tri2
19, 17, 18 // tri3
),
gsSPNTriangles_5b(
20, 21, 22, // tri0
23, 20, 22, // tri1
11, 10, 24, // tri2
25, 18, 1 // tri3
),
gsSPNTriangles_5b(
0, 25, 1, // tri0
26, 27, 28, // tri1
29, 30, 28, // tri2
30, 26, 28 // tri3
),
gsSPNTriangles_5b(
29, 28, 31, // tri0
0, 0, 0, // tri1
0, 0, 0, // tri2
0, 0, 0 // tri3
),
gsSPVertex(&grd_s_c1_s_3_v[242], 14, 0),
gsSPNTrianglesInit_5b(
14, // tri count
0, 1, 2, // tri0
3, 4, 2, // tri1
4, 0, 2 // tri2
),
gsSPNTriangles_5b(
3, 2, 5, // tri0
6, 7, 5, // tri1
7, 3, 5, // tri2
8, 9, 6 // tri3
),
gsSPNTriangles_5b(
8, 6, 5, // tri0
8, 5, 2, // tri1
10, 8, 2, // tri2
10, 2, 1 // tri3
),
gsSPNTriangles_5b(
11, 12, 13, // tri0
1, 11, 13, // tri1
10, 1, 13, // tri2
0, 0, 0 // tri3
),
gsSPEndDisplayList(),
};

Some files were not shown because too many files have changed in this diff Show More