Implement & link ac_ant, move insect defs to ac_insect_h header

This commit is contained in:
Cuyler36
2025-01-26 11:08:31 -05:00
parent adf42b6491
commit 28cb1a64ef
22 changed files with 416 additions and 225 deletions
+1 -1
View File
@@ -941,7 +941,7 @@ config.libs = [
[
Object(Matching, "actor/ac_airplane.c"),
Object(Matching, "actor/ac_animal_logo.c"),
Object(NonMatching, "actor/ac_ant.c"),
Object(Matching, "actor/ac_ant.c"),
Object(Matching, "actor/ac_aprilfool_control.c"),
Object(Matching, "actor/ac_arrange_ftr.c"),
Object(Matching, "actor/ac_arrange_room.c"),
+14 -1
View File
@@ -8,6 +8,20 @@
extern "C" {
#endif
typedef struct ant_actor_s ANT_ACTOR;
typedef void (*aANT_ACT_PROC)(ANT_ACTOR* ant, GAME* game);
struct ant_actor_s {
/* 0x000 */ ACTOR actor_class;
/* 0x174 */ aANT_ACT_PROC act_proc;
/* 0x178 */ int action;
/* 0x17C */ int alpha;
/* 0x180 */ ACTOR* insect_actor;
/* 0x184 */ int disappear_counter;
/* 0x188 */ mActor_name_t* below_fg_p;
};
extern ACTOR_PROFILE Ant_Profile;
#ifdef __cplusplus
@@ -15,4 +29,3 @@ extern ACTOR_PROFILE Ant_Profile;
#endif
#endif
+48
View File
@@ -14,6 +14,54 @@ extern "C" {
#define aINS_MAX_STRESS_DIST (3 * mFI_UNIT_BASE_SIZE_F)
#define aINS_PATIENCE_STEP 0.5f
enum insect_type {
aINS_INSECT_TYPE_COMMON_BUTTERFLY,
aINS_INSECT_TYPE_YELLOW_BUTTERFLY,
aINS_INSECT_TYPE_TIGER_BUTTERFLY,
aINS_INSECT_TYPE_PURPLE_BUTTERFLY,
aINS_INSECT_TYPE_ROBUST_CICADA,
aINS_INSECT_TYPE_WALKER_CICADA,
aINS_INSECT_TYPE_EVENING_CICADA,
aINS_INSECT_TYPE_BROWN_CICADA,
aINS_INSECT_TYPE_BEE,
aINS_INSECT_TYPE_COMMON_DRAGONFLY,
aINS_INSECT_TYPE_RED_DRAGONFLY,
aINS_INSECT_TYPE_DARNER_DRAGONFLY,
aINS_INSECT_TYPE_BANDED_DRAGONFLY,
aINS_INSECT_TYPE_LONG_LOCUST,
aINS_INSECT_TYPE_MIGRATORY_LOCUST,
aINS_INSECT_TYPE_CRICKET,
aINS_INSECT_TYPE_GRASSHOPPER,
aINS_INSECT_TYPE_BELL_CRICKET,
aINS_INSECT_TYPE_PINE_CRICKET,
aINS_INSECT_TYPE_DRONE_BEETLE,
aINS_INSECT_TYPE_DYNASTID_BEETLE,
aINS_INSECT_TYPE_FLAT_STAG_BEETLE,
aINS_INSECT_TYPE_JEWEL_BEETLE,
aINS_INSECT_TYPE_LONGHORN_BEETLE,
aINS_INSECT_TYPE_LADYBUG,
aINS_INSECT_TYPE_SPOTTED_LADYBUG,
aINS_INSECT_TYPE_MANTIS,
aINS_INSECT_TYPE_FIREFLY,
aINS_INSECT_TYPE_COCKROACH,
aINS_INSECT_TYPE_SAW_STAG_BEETLE,
aINS_INSECT_TYPE_MOUNTAIN_BEETLE,
aINS_INSECT_TYPE_GIANT_BEETLE,
aINS_INSECT_TYPE_SNAIL,
aINS_INSECT_TYPE_MOLE_CRICKET,
aINS_INSECT_TYPE_POND_SKATER,
aINS_INSECT_TYPE_BAGWORM,
aINS_INSECT_TYPE_PILL_BUG,
aINS_INSECT_TYPE_SPIDER,
aINS_INSECT_TYPE_ANT,
aINS_INSECT_TYPE_MOSQUITO,
aINS_INSECT_TYPE_NUM,
aINS_INSECT_TYPE_SPIRIT = aINS_INSECT_TYPE_NUM,
aINS_INSECT_TYPE_NONE,
aINS_INSECT_TYPE_EXTENDED_NUM
};
enum {
aINS_MAKE_NEW,
aINS_MAKE_EXIST,
+2 -49
View File
@@ -3,6 +3,7 @@
#include "types.h"
#include "ac_set_manager.h"
#include "ac_insect_h.h"
#ifdef __cplusplus
extern "C" {
@@ -10,55 +11,7 @@ extern "C" {
#define aSOI_TERM_TRANSITION_MAX_DAYS 5
#define aSOI_INSECT_TYPE_INVALID -1
enum insect_type {
aSOI_INSECT_TYPE_COMMON_BUTTERFLY,
aSOI_INSECT_TYPE_YELLOW_BUTTERFLY,
aSOI_INSECT_TYPE_TIGER_BUTTERFLY,
aSOI_INSECT_TYPE_PURPLE_BUTTERFLY,
aSOI_INSECT_TYPE_ROBUST_CICADA,
aSOI_INSECT_TYPE_WALKER_CICADA,
aSOI_INSECT_TYPE_EVENING_CICADA,
aSOI_INSECT_TYPE_BROWN_CICADA,
aSOI_INSECT_TYPE_BEE,
aSOI_INSECT_TYPE_COMMON_DRAGONFLY,
aSOI_INSECT_TYPE_RED_DRAGONFLY,
aSOI_INSECT_TYPE_DARNER_DRAGONFLY,
aSOI_INSECT_TYPE_BANDED_DRAGONFLY,
aSOI_INSECT_TYPE_LONG_LOCUST,
aSOI_INSECT_TYPE_MIGRATORY_LOCUST,
aSOI_INSECT_TYPE_CRICKET,
aSOI_INSECT_TYPE_GRASSHOPPER,
aSOI_INSECT_TYPE_BELL_CRICKET,
aSOI_INSECT_TYPE_PINE_CRICKET,
aSOI_INSECT_TYPE_DRONE_BEETLE,
aSOI_INSECT_TYPE_DYNASTID_BEETLE,
aSOI_INSECT_TYPE_FLAT_STAG_BEETLE,
aSOI_INSECT_TYPE_JEWEL_BEETLE,
aSOI_INSECT_TYPE_LONGHORN_BEETLE,
aSOI_INSECT_TYPE_LADYBUG,
aSOI_INSECT_TYPE_SPOTTED_LADYBUG,
aSOI_INSECT_TYPE_MANTIS,
aSOI_INSECT_TYPE_FIREFLY,
aSOI_INSECT_TYPE_COCKROACH,
aSOI_INSECT_TYPE_SAW_STAG_BEETLE,
aSOI_INSECT_TYPE_MOUNTAIN_BEETLE,
aSOI_INSECT_TYPE_GIANT_BEETLE,
aSOI_INSECT_TYPE_SNAIL,
aSOI_INSECT_TYPE_MOLE_CRICKET,
aSOI_INSECT_TYPE_POND_SKATER,
aSOI_INSECT_TYPE_BAGWORM,
aSOI_INSECT_TYPE_PILL_BUG,
aSOI_INSECT_TYPE_SPIDER,
aSOI_INSECT_TYPE_ANT,
aSOI_INSECT_TYPE_MOSQUITO,
aSOI_INSECT_TYPE_NUM,
aSOI_INSECT_TYPE_SPIRIT = aSOI_INSECT_TYPE_NUM,
aSOI_INSECT_TYPE_NONE,
aSOI_INSECT_TYPE_EXTENDED_NUM
};
#define aINS_INSECT_TYPE_INVALID -1
#define aSOI_SPAWN_AREA_INVALID -1
+1 -1
View File
@@ -453,7 +453,7 @@ typedef enum bank_id {
ACTOR_OBJ_BANK_EF_MINSECT,
ACTOR_OBJ_BANK_AC_SIGN,
ACTOR_OBJ_BANK_MURAL,
ACTOR_OBJ_BANK_413,
ACTOR_OBJ_BANK_ANT,
ACTOR_OBJ_BANK_414,
ACTOR_OBJ_BANK_415,
ACTOR_OBJ_BANK_416,
+1 -1
View File
@@ -714,7 +714,7 @@ enum {
enum {
mPlayer_NET_CATCH_TYPE_INSECT,
mPlayer_NET_CATCH_TYPE_UNK1,
mPlayer_NET_CATCH_TYPE_ANT,
mPlayer_NET_CATCH_TYPE_NUM
};
+179
View File
@@ -0,0 +1,179 @@
#include "ac_ant.h"
#include "m_common_data.h"
#include "m_player_lib.h"
#include "m_rcp.h"
#include "sys_matrix.h"
enum {
aANT_ACT_WAIT,
aANT_ACT_CAUGHT,
aANT_ACT_DISAPPEAR,
aANT_ACT_NUM
};
static void aANT_actor_ct(ACTOR* actorx, GAME* game);
static void aANT_actor_move(ACTOR* actorx, GAME* game);
static void aANT_actor_draw(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Ant_Profile = {
mAc_PROFILE_ANT,
ACTOR_PART_BG,
ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_ANT,
sizeof(ANT_ACTOR),
&aANT_actor_ct,
mActor_NONE_PROC1,
&aANT_actor_move,
&aANT_actor_draw,
NULL,
};
// clang-format on
static void aANT_setupAction(ANT_ACTOR* ant, int action);
static void aANT_actor_ct(ACTOR* actorx, GAME* game) {
ANT_ACTOR* ant = (ANT_ACTOR*)actorx;
ant->below_fg_p = mFI_GetUnitFG(actorx->world.position);
actorx->home.position.y = actorx->world.position.y = mCoBG_GetBgY_OnlyCenter_FromWpos(actorx->world.position, -10.0f);
actorx->shape_info.rotation.x = DEG2SHORT_ANGLE2(45.0f);
ant->alpha = 255;
actorx->mv_proc = &aANT_actor_move;
aANT_setupAction(ant, aANT_ACT_WAIT);
}
static void aANT_calc_scale(ANT_ACTOR* ant, f32 step, f32 target_scale) {
f32 scale = ant->actor_class.scale.x;
chase_f(&scale, target_scale, step * 0.5f);
ant->actor_class.scale.x = scale;
ant->actor_class.scale.y = scale;
ant->actor_class.scale.z = scale;
}
static void aANT_wait(ANT_ACTOR* ant, GAME* game) {
if (ant->below_fg_p == NULL || (*ant->below_fg_p != ITM_FOOD_CANDY && *ant->below_fg_p != ITM_KABU_SPOILED)) {
aANT_setupAction(ant, aANT_ACT_DISAPPEAR);
} else {
u32 catch_label = mPlib_Get_item_net_catch_label();
if ((u32)ant == catch_label) {
aANT_setupAction(ant, aANT_ACT_CAUGHT);
} else {
f32 catch_swing_timer = GET_PLAYER_ACTOR_NOW()->Get_Item_net_catch_swing_timer_proc(GET_PLAYER_ACTOR_NOW_ACTOR(), gamePT);
xyz_t stop_net_pos;
if ((catch_swing_timer > 0.0f || mPlib_Check_StopNet(&stop_net_pos)) && ant->actor_class.player_distance_xz < mFI_UNIT_BASE_SIZE_F) {
GET_PLAYER_ACTOR_NOW()->Set_Item_net_catch_request_force_proc(GET_PLAYER_ACTOR_NOW_ACTOR(), gamePT, (u32)ant, mPlayer_NET_CATCH_TYPE_ANT);
} else {
GET_PLAYER_ACTOR_NOW()->Set_Item_net_catch_request_table_proc(GET_PLAYER_ACTOR_NOW_ACTOR(), gamePT, (u32)ant, mPlayer_NET_CATCH_TYPE_ANT, &ant->actor_class.world.position, 24.0f);
}
}
}
}
static void aANT_caught(ANT_ACTOR* ant, GAME* game) {
aINS_Init_c insect_init;
insect_init.insect_type = aINS_INSECT_TYPE_ANT;
xyz_t_move(&insect_init.position, &ant->actor_class.world.position);
insect_init.extra_data = 0;
insect_init.game = game;
ant->insect_actor = CLIP(insect_clip)->make_insect_proc(&insect_init, aINS_MAKE_EXIST);
if (ant->insect_actor != NULL) {
if (mPlib_Change_item_net_catch_label((u32)ant->insect_actor, mPlayer_NET_CATCH_TYPE_INSECT)) {
aANT_setupAction(ant, aANT_ACT_DISAPPEAR);
}
} else {
ant->disappear_counter++;
if (ant->disappear_counter > 1) {
aANT_setupAction(ant, aANT_ACT_DISAPPEAR);
}
}
}
static void aANT_disappear(ANT_ACTOR* ant, GAME* game) {
ant->alpha -= 15;
if (ant->alpha < 0) {
ant->alpha = 0;
Actor_delete((ACTOR*)ant);
} else {
aANT_calc_scale(ant, 0.1f, 0.01f);
}
}
static void aANT_caught_init(ANT_ACTOR* ant) {
ant->disappear_counter = 0;
}
static void aANT_disappear_init(ANT_ACTOR* ant) {
ant->actor_class.shape_info.rotation.x = 0;
ant->actor_class.shape_info.rotation.z = 0;
}
typedef void (*aANT_INIT_PROC)(ANT_ACTOR* ant);
static void aANT_setupAction(ANT_ACTOR* ant, int action) {
static aANT_INIT_PROC init_proc[] = {
(aANT_INIT_PROC)&none_proc1,
&aANT_caught_init,
&aANT_disappear_init,
};
static aANT_ACT_PROC act_proc[] = {
&aANT_wait,
&aANT_caught,
&aANT_disappear,
};
ant->action = action;
ant->act_proc = act_proc[action];
(*init_proc[action])(ant);
}
static void aANT_actor_move(ACTOR* actorx, GAME* game) {
ANT_ACTOR* ant = (ANT_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
if ((actorx->state_bitfield & ACTOR_STATE_NO_CULL) == 0 &&
(actorx->block_x != play->block_table.block_x || actorx->block_z != play->block_table.block_z)) {
Actor_delete(actorx);
} else {
if (actorx->world.position.x < 0.0f && actorx->world.position.z < 0.0f) {
return;
}
(*ant->act_proc)(ant, game);
Actor_world_to_eye(actorx, 0.0f);
}
}
extern EVW_ANIME_DATA act_ant_evw_anime;
extern Gfx act_antT_model[];
static void aANT_actor_draw(ACTOR* actorx, GAME* game) {
ANT_ACTOR* ant = (ANT_ACTOR*)actorx;
GAME_PLAY* play = (GAME_PLAY*)game;
GRAPH* graph = game->graph;
if (actorx->world.position.x < 0.0f || actorx->world.position.z < 0.0f) {
return;
}
_texture_z_light_fog_prim_xlu(graph);
Setpos_HiliteReflect_xlu_init(&actorx->world.position, play);
Evw_Anime_Set(play, &act_ant_evw_anime);
OPEN_POLY_XLU_DISP(graph);
gSPMatrix(POLY_XLU_DISP++, _Matrix_to_Mtx_new(graph), G_MTX_LOAD | G_MTX_NOPUSH);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 255, 0, 0, 0, ant->alpha);
gSPDisplayList(POLY_XLU_DISP++, act_antT_model);
CLOSE_POLY_XLU_DISP(graph);
}
+1 -1
View File
@@ -212,7 +212,7 @@ static void aBEE_caught(ACTOR* actorx, GAME* game) {
if (bee->insect_actor == NULL) {
aINS_Init_c insect_data;
insect_data.insect_type = aSOI_INSECT_TYPE_BEE;
insect_data.insect_type = aINS_INSECT_TYPE_BEE;
xyz_t_move(&insect_data.position, &bee->actor_class.world.position);
insect_data.extra_data = 0;
insect_data.game = game;
+14 -14
View File
@@ -32,22 +32,22 @@ extern void aIBT_actor_init(ACTOR* actor, GAME* game) {
insect->bg_type = 2;
switch (insect->type) {
case aSOI_INSECT_TYPE_LONG_LOCUST:
case aINS_INSECT_TYPE_LONG_LOCUST:
insect->item = ITM_INSECT13;
break;
case aSOI_INSECT_TYPE_MIGRATORY_LOCUST:
case aINS_INSECT_TYPE_MIGRATORY_LOCUST:
insect->item = ITM_INSECT14;
break;
case aSOI_INSECT_TYPE_CRICKET:
case aINS_INSECT_TYPE_CRICKET:
insect->item = ITM_INSECT15;
break;
case aSOI_INSECT_TYPE_GRASSHOPPER:
case aINS_INSECT_TYPE_GRASSHOPPER:
insect->item = ITM_INSECT16;
break;
case aSOI_INSECT_TYPE_BELL_CRICKET:
case aINS_INSECT_TYPE_BELL_CRICKET:
insect->item = ITM_INSECT17;
break;
case aSOI_INSECT_TYPE_PINE_CRICKET:
case aINS_INSECT_TYPE_PINE_CRICKET:
insect->item = ITM_INSECT18;
break;
}
@@ -109,7 +109,7 @@ static int aIBT_check_live_condition(aINS_INSECT_ACTOR* insect) {
static void aIBT_anime_proc(aINS_INSECT_ACTOR* insect) {
switch (insect->type) {
case aSOI_INSECT_TYPE_BELL_CRICKET:
case aINS_INSECT_TYPE_BELL_CRICKET:
insect->_1E0 += 1.0f;
break;
default:
@@ -136,10 +136,10 @@ static int aIBT_check_ball(aINS_INSECT_ACTOR* insect) {
static void aIBT_set_fly_se(aINS_INSECT_ACTOR* insect) {
switch (insect->type) {
case aSOI_INSECT_TYPE_LONG_LOCUST:
case aINS_INSECT_TYPE_LONG_LOCUST:
sAdo_OngenPos((u32)insect, 0xA2, &insect->tools_actor.actor_class.world.position);
break;
case aSOI_INSECT_TYPE_MIGRATORY_LOCUST:
case aINS_INSECT_TYPE_MIGRATORY_LOCUST:
sAdo_OngenPos((u32)insect, 0xA3, &insect->tools_actor.actor_class.world.position);
break;
}
@@ -250,7 +250,7 @@ static void aIBT_set_avoid_jump_spd(aINS_INSECT_ACTOR* insect) {
int absRot;
switch (insect->type) {
case aSOI_INSECT_TYPE_MIGRATORY_LOCUST:
case aINS_INSECT_TYPE_MIGRATORY_LOCUST:
insect->tools_actor.actor_class.speed = 7.5f;
insect->tools_actor.actor_class.position_speed.y = 9.0f;
insect->tools_actor.actor_class.gravity = 0.6f;
@@ -373,7 +373,7 @@ static void aIBT_chg_direction(ACTOR* actor, GAME* game) {
angle += (s16)(range[insect->s32_work0] * (2.0f * (fqrand() - 0.5f)));
xyz_t_move(&pos, &insect->tools_actor.actor_class.world.position);
mod = 53.0f;
if (insect->type == aSOI_INSECT_TYPE_MIGRATORY_LOCUST) {
if (insect->type == aINS_INSECT_TYPE_MIGRATORY_LOCUST) {
mod = 218.0f;
}
pos.x += (mod * sin_s(angle));
@@ -421,7 +421,7 @@ static void aIBT_wait(ACTOR* actor, GAME* game) {
int idx = insect->type - 15;
if ((actor->bg_collision_check.result.on_ground) &&
(insect->patience < 20.0f)) {
if (insect->type == aSOI_INSECT_TYPE_BELL_CRICKET) {
if (insect->type == aINS_INSECT_TYPE_BELL_CRICKET) {
aIBT_anime_proc(insect);
}
if (insect->s32_work1 == 0) {
@@ -438,7 +438,7 @@ static void aIBT_wait(ACTOR* actor, GAME* game) {
if (aIBT_chk_active_range(NULL, insect) == FALSE) {
action = aIBT_ACTION_JUMP;
} else {
if ((insect->type == aSOI_INSECT_TYPE_LONG_LOCUST) || (insect->type == aSOI_INSECT_TYPE_MIGRATORY_LOCUST)) {
if ((insect->type == aINS_INSECT_TYPE_LONG_LOCUST) || (insect->type == aINS_INSECT_TYPE_MIGRATORY_LOCUST)) {
if ((int)(play->game_frame % 200) > 20) {
action = aIBT_ACTION_JUMP;
}
@@ -591,4 +591,4 @@ static void aIBT_actor_first_move(ACTOR* actor, GAME* game) {
}
aIBT_actor_move(actor, game);
}
}
}
+21 -22
View File
@@ -41,16 +41,16 @@ extern void aICH_actor_init(ACTOR* actor, GAME* game) {
}
insect->bg_type = 2;
switch (insect->type) {
case aSOI_INSECT_TYPE_COMMON_BUTTERFLY:
case aINS_INSECT_TYPE_COMMON_BUTTERFLY:
insect->item = ITM_INSECT00;
break;
case aSOI_INSECT_TYPE_YELLOW_BUTTERFLY:
case aINS_INSECT_TYPE_YELLOW_BUTTERFLY:
insect->item = ITM_INSECT01;
break;
case aSOI_INSECT_TYPE_TIGER_BUTTERFLY:
case aINS_INSECT_TYPE_TIGER_BUTTERFLY:
insect->item = ITM_INSECT02;
break;
case aSOI_INSECT_TYPE_PURPLE_BUTTERFLY:
case aINS_INSECT_TYPE_PURPLE_BUTTERFLY:
insect->item = ITM_INSECT03;
break;
}
@@ -60,7 +60,7 @@ extern void aICH_actor_init(ACTOR* actor, GAME* game) {
static int aICH_check_live_condition(aINS_INSECT_ACTOR* insect, mActor_name_t* name) {
int ret = TRUE;
if (insect->type != aSOI_INSECT_TYPE_PURPLE_BUTTERFLY) {
if (insect->type != aINS_INSECT_TYPE_PURPLE_BUTTERFLY) {
if (mCoBG_ExistHeightGap_KeepAndNow(insect->tools_actor.actor_class.world.position) == TRUE) {
ret = FALSE;
} else if ((name == NULL) || (*name == RSV_NO)) {
@@ -154,7 +154,7 @@ static void aICH_flower_search(aINS_INSECT_ACTOR* insect) {
unit = mFI_UtNum2UtFG(bx, bz);
if ((!(fqrand() < 0.5f) || (unit == NULL) || (((*unit < FLOWER_PANSIES0))) || (*unit > FLOWER_TULIP2)) &&
(insect->type != aSOI_INSECT_TYPE_PURPLE_BUTTERFLY)) {
(insect->type != aINS_INSECT_TYPE_PURPLE_BUTTERFLY)) {
aICH_flower_search_sub(insect, 1);
}
}
@@ -246,7 +246,7 @@ static void aICH_rest_check(aINS_INSECT_ACTOR* insect, GAME* game) {
if (F32_IS_ZERO(insect->f32_work3)) {
unit = mFI_GetUnitFG(insect->tools_actor.actor_class.world.position);
if ((unit != NULL) && (*unit == FLOWER_PANSIES0)) {
aICH_setupAction(insect, aSOI_INSECT_TYPE_PURPLE_BUTTERFLY, game);
aICH_setupAction(insect, aINS_INSECT_TYPE_PURPLE_BUTTERFLY, game);
}
} else {
insect->f32_work3 -= 0.5f;
@@ -342,8 +342,8 @@ static void aICH_BGcheck(ACTOR* actor) {
if ((insect->tools_actor.actor_class.bg_collision_check.result.hit_wall & mCoBG_HIT_WALL_FRONT) != 0) {
if (insect->f32_work2 <= 0.0f) {
switch (insect->type) {
case aSOI_INSECT_TYPE_TIGER_BUTTERFLY:
case aSOI_INSECT_TYPE_PURPLE_BUTTERFLY:
case aINS_INSECT_TYPE_TIGER_BUTTERFLY:
case aINS_INSECT_TYPE_PURPLE_BUTTERFLY:
if (aICH_flower_search_sub(insect, 0) == TRUE) {
insect->f32_work2 = 10.0f;
}
@@ -381,10 +381,10 @@ static void aICH_avoid(ACTOR* actor, GAME* game) {
aICH_anime_proc(insect);
switch (insect->type) {
case aSOI_INSECT_TYPE_TIGER_BUTTERFLY:
case aINS_INSECT_TYPE_TIGER_BUTTERFLY:
base = -80.0f;
break;
case aSOI_INSECT_TYPE_PURPLE_BUTTERFLY:
case aINS_INSECT_TYPE_PURPLE_BUTTERFLY:
base = -100.0f;
break;
default:
@@ -415,10 +415,10 @@ static void aICH_fly(ACTOR* actor, GAME* game) {
aICH_BGcheck(actor);
switch (insect->type) {
case aSOI_INSECT_TYPE_TIGER_BUTTERFLY:
case aINS_INSECT_TYPE_TIGER_BUTTERFLY:
base = -40.0f;
break;
case aSOI_INSECT_TYPE_PURPLE_BUTTERFLY:
case aINS_INSECT_TYPE_PURPLE_BUTTERFLY:
base = -50.0f;
break;
default:
@@ -430,14 +430,14 @@ static void aICH_fly(ACTOR* actor, GAME* game) {
aICH_loop_move_ctrl(insect);
switch (insect->type) {
case aSOI_INSECT_TYPE_TIGER_BUTTERFLY:
case aINS_INSECT_TYPE_TIGER_BUTTERFLY:
if (insect->patience > 90.0f) {
aICH_setupAction(insect, aICH_ACTION_AVOID, game);
break;
}
aICH_rest_check(insect, game);
break;
case aSOI_INSECT_TYPE_PURPLE_BUTTERFLY:
case aINS_INSECT_TYPE_PURPLE_BUTTERFLY:
if (insect->patience > 90.0f) {
aICH_setupAction(insect, aICH_ACTION_AVOID, game);
break;
@@ -461,8 +461,8 @@ static void aICH_landing(ACTOR* actor, GAME* game) {
if (aICH_check_patience(insect) == TRUE) {
int action;
switch (insect->type) {
case aSOI_INSECT_TYPE_TIGER_BUTTERFLY:
case aSOI_INSECT_TYPE_PURPLE_BUTTERFLY:
case aINS_INSECT_TYPE_TIGER_BUTTERFLY:
case aINS_INSECT_TYPE_PURPLE_BUTTERFLY:
action = aICH_ACTION_AVOID;
break;
default:
@@ -479,8 +479,8 @@ static void aICH_landing(ACTOR* actor, GAME* game) {
insect->bg_height = rest_wait_data[insect->light_flag].y;
pos.z += rest_wait_data[insect->light_flag].z;
switch (insect->type) {
case aSOI_INSECT_TYPE_COMMON_BUTTERFLY:
case aSOI_INSECT_TYPE_YELLOW_BUTTERFLY:
case aINS_INSECT_TYPE_COMMON_BUTTERFLY:
case aINS_INSECT_TYPE_YELLOW_BUTTERFLY:
insect->bg_height -= 3.0f;
break;
}
@@ -503,8 +503,8 @@ static void aICH_hover(ACTOR* actor, GAME* game) {
}
if (aICH_check_patience(insect) == TRUE) {
switch (insect->type) {
case aSOI_INSECT_TYPE_TIGER_BUTTERFLY:
case aSOI_INSECT_TYPE_PURPLE_BUTTERFLY:
case aINS_INSECT_TYPE_TIGER_BUTTERFLY:
case aINS_INSECT_TYPE_PURPLE_BUTTERFLY:
action = aICH_ACTION_AVOID;
break;
default:
@@ -632,4 +632,3 @@ static void aICH_actor_move(ACTOR* actor, GAME* game) {
insect->action_proc(actor,game);
}
}
+3 -4
View File
@@ -44,12 +44,12 @@ extern void aIDG_actor_init(ACTOR* actor, GAME* game) {
insect->bg_range = 2.0f;
switch (insect->type) {
case aSOI_INSECT_TYPE_SPIDER:
case aINS_INSECT_TYPE_SPIDER:
break;
case aSOI_INSECT_TYPE_PILL_BUG:
case aINS_INSECT_TYPE_PILL_BUG:
insect->item = ITM_INSECT36;
break;
case aSOI_INSECT_TYPE_ANT:
case aINS_INSECT_TYPE_ANT:
insect->item = ITM_INSECT38;
break;
}
@@ -401,4 +401,3 @@ static void aIDG_actor_move(ACTOR* actor, GAME* game) {
insect->action_proc(actor,game);
}
}
+8 -8
View File
@@ -64,28 +64,28 @@ extern void aIKB_actor_init(ACTOR* actorx, GAME* game) {
}
switch (insect->type) {
case aSOI_INSECT_TYPE_DRONE_BEETLE:
case aINS_INSECT_TYPE_DRONE_BEETLE:
insect->item = ITM_INSECT19;
break;
case aSOI_INSECT_TYPE_DYNASTID_BEETLE:
case aINS_INSECT_TYPE_DYNASTID_BEETLE:
insect->item = ITM_INSECT20;
break;
case aSOI_INSECT_TYPE_FLAT_STAG_BEETLE:
case aINS_INSECT_TYPE_FLAT_STAG_BEETLE:
insect->item = ITM_INSECT21;
break;
case aSOI_INSECT_TYPE_JEWEL_BEETLE:
case aINS_INSECT_TYPE_JEWEL_BEETLE:
insect->item = ITM_INSECT22;
break;
case aSOI_INSECT_TYPE_LONGHORN_BEETLE:
case aINS_INSECT_TYPE_LONGHORN_BEETLE:
insect->item = ITM_INSECT23;
break;
case aSOI_INSECT_TYPE_SAW_STAG_BEETLE:
case aINS_INSECT_TYPE_SAW_STAG_BEETLE:
insect->item = ITM_INSECT29;
break;
case aSOI_INSECT_TYPE_MOUNTAIN_BEETLE:
case aINS_INSECT_TYPE_MOUNTAIN_BEETLE:
insect->item = ITM_INSECT30;
break;
case aSOI_INSECT_TYPE_GIANT_BEETLE:
case aINS_INSECT_TYPE_GIANT_BEETLE:
insect->item = ITM_INSECT31;
break;
}
+18 -18
View File
@@ -65,13 +65,13 @@ static void aINS_destruct(ACTOR* actorx, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
switch (insect->type) {
case aSOI_INSECT_TYPE_SPIRIT:
case aINS_INSECT_TYPE_SPIRIT:
/* If we didn't catch the spirit, update it's location */
if ((ACTOR*)mPlib_Get_item_net_catch_label() != actorx) {
aINS_regist_set_block_table(actorx);
}
/* fallthrough spirit -> firefly */
case aSOI_INSECT_TYPE_FIREFLY:
case aINS_INSECT_TYPE_FIREFLY:
if (insect->light_flag) {
Global_light_list_delete(&play->global_light, insect->light_list);
insect->light_flag = FALSE;
@@ -245,28 +245,28 @@ static void aINS_setupActor(ACTOR* actorx, aINS_Init_c* init) {
actorx->cull_radius = 350.0f;
switch (insect->type) {
case aSOI_INSECT_TYPE_TIGER_BUTTERFLY:
case aSOI_INSECT_TYPE_PURPLE_BUTTERFLY:
case aSOI_INSECT_TYPE_ROBUST_CICADA:
case aSOI_INSECT_TYPE_WALKER_CICADA:
case aSOI_INSECT_TYPE_EVENING_CICADA:
case aSOI_INSECT_TYPE_BROWN_CICADA:
case aSOI_INSECT_TYPE_BEE:
case aSOI_INSECT_TYPE_COMMON_DRAGONFLY:
case aSOI_INSECT_TYPE_RED_DRAGONFLY:
case aSOI_INSECT_TYPE_DARNER_DRAGONFLY:
case aSOI_INSECT_TYPE_BANDED_DRAGONFLY:
case aINS_INSECT_TYPE_TIGER_BUTTERFLY:
case aINS_INSECT_TYPE_PURPLE_BUTTERFLY:
case aINS_INSECT_TYPE_ROBUST_CICADA:
case aINS_INSECT_TYPE_WALKER_CICADA:
case aINS_INSECT_TYPE_EVENING_CICADA:
case aINS_INSECT_TYPE_BROWN_CICADA:
case aINS_INSECT_TYPE_BEE:
case aINS_INSECT_TYPE_COMMON_DRAGONFLY:
case aINS_INSECT_TYPE_RED_DRAGONFLY:
case aINS_INSECT_TYPE_DARNER_DRAGONFLY:
case aINS_INSECT_TYPE_BANDED_DRAGONFLY:
shadow_size = 8.0f;
break;
case aSOI_INSECT_TYPE_BAGWORM:
case aSOI_INSECT_TYPE_PILL_BUG:
case aSOI_INSECT_TYPE_SPIDER:
case aSOI_INSECT_TYPE_MOSQUITO:
case aINS_INSECT_TYPE_BAGWORM:
case aINS_INSECT_TYPE_PILL_BUG:
case aINS_INSECT_TYPE_SPIDER:
case aINS_INSECT_TYPE_MOSQUITO:
shadow_size = 4.0f;
break;
case aSOI_INSECT_TYPE_ANT:
case aINS_INSECT_TYPE_ANT:
shadow_size = 2.0f;
break;
+14 -14
View File
@@ -11,16 +11,16 @@ static void aINS_actor_draw_sub(GRAPH* graph, aINS_INSECT_ACTOR* insect, GAME* g
angleY = angleX;
switch (insect->type) {
case aSOI_INSECT_TYPE_LONG_LOCUST:
case aSOI_INSECT_TYPE_MIGRATORY_LOCUST:
case aSOI_INSECT_TYPE_GRASSHOPPER:
case aINS_INSECT_TYPE_LONG_LOCUST:
case aINS_INSECT_TYPE_MIGRATORY_LOCUST:
case aINS_INSECT_TYPE_GRASSHOPPER:
angleY = DEG2SHORT_ANGLE2(-90.0f);
break;
case aSOI_INSECT_TYPE_SPIDER:
case aINS_INSECT_TYPE_SPIDER:
angleX = DEG2SHORT_ANGLE2(90.0f);
break;
case aSOI_INSECT_TYPE_FIREFLY:
case aSOI_INSECT_TYPE_SPIRIT:
case aINS_INSECT_TYPE_FIREFLY:
case aINS_INSECT_TYPE_SPIRIT:
break;
default:
angleX = DEG2SHORT_ANGLE2(90.0f);
@@ -39,12 +39,12 @@ static void aINS_actor_draw_sub(GRAPH* graph, aINS_INSECT_ACTOR* insect, GAME* g
insect->tools_actor.actor_class.world.position.z, 0);
switch (insect->type) {
case aSOI_INSECT_TYPE_MOLE_CRICKET:
case aINS_INSECT_TYPE_MOLE_CRICKET:
Matrix_RotateY(angleY, 1);
Matrix_RotateX(angleX, 1);
Matrix_RotateZ(insect->tools_actor.actor_class.shape_info.rotation.z, 1);
break;
case aSOI_INSECT_TYPE_SPIDER:
case aINS_INSECT_TYPE_SPIDER:
switch (draw_type) {
case 2:
Matrix_RotateX(angleX, 1);
@@ -76,11 +76,11 @@ static void aINS_actor_draw_sub(GRAPH* graph, aINS_INSECT_ACTOR* insect, GAME* g
/* initialize settings for env and billboard mtx */
switch (insect->type) {
case aSOI_INSECT_TYPE_FIREFLY:
case aINS_INSECT_TYPE_FIREFLY:
gSPMatrix(gfx++, play->billboard_mtx_p, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetEnvColor(gfx++, 0, 255, 155, alpha);
break;
case aSOI_INSECT_TYPE_SPIRIT:
case aINS_INSECT_TYPE_SPIRIT:
gSPMatrix(gfx++, play->billboard_mtx_p, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetEnvColor(gfx++, 255, 255, 255, alpha);
break;
@@ -114,12 +114,12 @@ static void aINS_actor_draw(ACTOR* actorx, GAME* game) {
(insect->tools_actor.actor_class.state_bitfield &
(ACTOR_STATE_NO_CULL | ACTOR_STATE_NO_DRAW_WHILE_CULLED)) ==
(ACTOR_STATE_NO_CULL | ACTOR_STATE_NO_DRAW_WHILE_CULLED)) {
if (insect->tools_actor.init_matrix == TRUE && insect->type != aSOI_INSECT_TYPE_SPIRIT) {
if (insect->tools_actor.init_matrix == TRUE && insect->type != aINS_INSECT_TYPE_SPIRIT) {
draw_type = 0;
}
switch (insect->type) {
case aSOI_INSECT_TYPE_FIREFLY:
case aINS_INSECT_TYPE_FIREFLY:
draw_type = (int)insect->_1E0;
alpha = insect->alpha0 - insect->alpha2;
@@ -144,7 +144,7 @@ static void aINS_actor_draw(ACTOR* actorx, GAME* game) {
aINS_actor_draw_sub(graph, insect, game, draw_type, alpha);
switch (insect->type) {
case aSOI_INSECT_TYPE_FIREFLY: {
case aINS_INSECT_TYPE_FIREFLY: {
draw_type = insect->_1E4;
alpha = insect->alpha1 - insect->alpha2;
@@ -155,7 +155,7 @@ static void aINS_actor_draw(ACTOR* actorx, GAME* game) {
aINS_actor_draw_sub(graph, insect, game, draw_type, alpha);
break;
}
case aSOI_INSECT_TYPE_SPIRIT:
case aINS_INSECT_TYPE_SPIRIT:
break;
default:
aINS_actor_draw_sub(graph, insect, game, draw_type + 1, alpha);
+24 -24
View File
@@ -8,13 +8,13 @@ static void aINS_position_move(ACTOR* actorx) {
actorx->position_speed.z = actorx->speed * cos_s(angleY);
switch (insect->type) {
case aSOI_INSECT_TYPE_COMMON_BUTTERFLY:
case aSOI_INSECT_TYPE_YELLOW_BUTTERFLY:
case aSOI_INSECT_TYPE_TIGER_BUTTERFLY:
case aSOI_INSECT_TYPE_PURPLE_BUTTERFLY:
case aSOI_INSECT_TYPE_FIREFLY:
case aSOI_INSECT_TYPE_MOSQUITO:
case aSOI_INSECT_TYPE_SPIRIT:
case aINS_INSECT_TYPE_COMMON_BUTTERFLY:
case aINS_INSECT_TYPE_YELLOW_BUTTERFLY:
case aINS_INSECT_TYPE_TIGER_BUTTERFLY:
case aINS_INSECT_TYPE_PURPLE_BUTTERFLY:
case aINS_INSECT_TYPE_FIREFLY:
case aINS_INSECT_TYPE_MOSQUITO:
case aINS_INSECT_TYPE_SPIRIT:
break;
default:
@@ -218,7 +218,7 @@ static void aINS_calc_alpha_time(aINS_INSECT_ACTOR* insect) {
}
switch (insect->type) {
case aSOI_INSECT_TYPE_FIREFLY: {
case aINS_INSECT_TYPE_FIREFLY: {
int alpha = insect->alpha2;
alpha += 11;
@@ -299,27 +299,27 @@ static f32 aINS_get_catch_range(ACTOR* actorx) {
f32 range = 8.0f;
switch (insect->type) {
case aSOI_INSECT_TYPE_COMMON_BUTTERFLY:
case aSOI_INSECT_TYPE_YELLOW_BUTTERFLY:
case aINS_INSECT_TYPE_COMMON_BUTTERFLY:
case aINS_INSECT_TYPE_YELLOW_BUTTERFLY:
range = 24.0f;
break;
case aSOI_INSECT_TYPE_ROBUST_CICADA:
case aSOI_INSECT_TYPE_WALKER_CICADA:
case aSOI_INSECT_TYPE_EVENING_CICADA:
case aSOI_INSECT_TYPE_BROWN_CICADA:
case aSOI_INSECT_TYPE_BEE:
case aSOI_INSECT_TYPE_DRONE_BEETLE:
case aSOI_INSECT_TYPE_DYNASTID_BEETLE:
case aSOI_INSECT_TYPE_FLAT_STAG_BEETLE:
case aSOI_INSECT_TYPE_JEWEL_BEETLE:
case aSOI_INSECT_TYPE_LONGHORN_BEETLE:
case aSOI_INSECT_TYPE_SAW_STAG_BEETLE:
case aSOI_INSECT_TYPE_MOUNTAIN_BEETLE:
case aSOI_INSECT_TYPE_GIANT_BEETLE:
case aINS_INSECT_TYPE_ROBUST_CICADA:
case aINS_INSECT_TYPE_WALKER_CICADA:
case aINS_INSECT_TYPE_EVENING_CICADA:
case aINS_INSECT_TYPE_BROWN_CICADA:
case aINS_INSECT_TYPE_BEE:
case aINS_INSECT_TYPE_DRONE_BEETLE:
case aINS_INSECT_TYPE_DYNASTID_BEETLE:
case aINS_INSECT_TYPE_FLAT_STAG_BEETLE:
case aINS_INSECT_TYPE_JEWEL_BEETLE:
case aINS_INSECT_TYPE_LONGHORN_BEETLE:
case aINS_INSECT_TYPE_SAW_STAG_BEETLE:
case aINS_INSECT_TYPE_MOUNTAIN_BEETLE:
case aINS_INSECT_TYPE_GIANT_BEETLE:
range = aINS_get_catch_range_sub(actorx);
break;
case aSOI_INSECT_TYPE_COCKROACH:
case aINS_INSECT_TYPE_COCKROACH:
if (insect->flag == 4) {
range = aINS_get_catch_range_sub(actorx);
}
+50 -50
View File
@@ -16,53 +16,53 @@ typedef struct insect_birth_sum_s {
u8 additional_range; // min_birth_count + [0, n)
} aSOI_insect_birth_sum_c;
static aSOI_insect_birth_sum_c l_insect_birth_sum[aSOI_INSECT_TYPE_EXTENDED_NUM] = {
{ 1, 0 }, // aSOI_INSECT_TYPE_COMMON_BUTTERFLY
{ 1, 0 }, // aSOI_INSECT_TYPE_YELLOW_BUTTERFLY
{ 1, 0 }, // aSOI_INSECT_TYPE_TIGER_BUTTERFLY
{ 1, 0 }, // aSOI_INSECT_TYPE_PURPLE_BUTTERFLY
{ 1, 0 }, // aSOI_INSECT_TYPE_ROBUST_CICADA
{ 1, 0 }, // aSOI_INSECT_TYPE_WALKER_CICADA
{ 1, 0 }, // aSOI_INSECT_TYPE_EVENING_CICADA
{ 1, 0 }, // aSOI_INSECT_TYPE_BROWN_CICADA
{ 1, 0 }, // aSOI_INSECT_TYPE_BEE
{ 1, 0 }, // aSOI_INSECT_TYPE_COMMON_DRAGONFLY
{ 6, 3 }, // aSOI_INSECT_TYPE_RED_DRAGONFLY
{ 1, 0 }, // aSOI_INSECT_TYPE_DARNER_DRAGONFLY
{ 1, 0 }, // aSOI_INSECT_TYPE_BANDED_DRAGONFLY
{ 1, 0 }, // aSOI_INSECT_TYPE_LONG_LOCUST
{ 1, 0 }, // aSOI_INSECT_TYPE_MIGRATORY_LOCUST
{ 1, 0 }, // aSOI_INSECT_TYPE_CRICKET
{ 1, 0 }, // aSOI_INSECT_TYPE_GRASSHOPPER
{ 1, 0 }, // aSOI_INSECT_TYPE_BELL_CRICKET
{ 1, 0 }, // aSOI_INSECT_TYPE_PINE_CRICKET
{ 1, 0 }, // aSOI_INSECT_TYPE_DRONE_BEETLE
{ 1, 0 }, // aSOI_INSECT_TYPE_DYNASTID_BEETLE
{ 1, 0 }, // aSOI_INSECT_TYPE_FLAT_STAG_BEETLE
{ 1, 0 }, // aSOI_INSECT_TYPE_JEWEL_BEETLE
{ 1, 0 }, // aSOI_INSECT_TYPE_LONGHORN_BEETLE
{ 1, 0 }, // aSOI_INSECT_TYPE_LADYBUG
{ 1, 0 }, // aSOI_INSECT_TYPE_SPOTTED_LADYBUG
{ 1, 0 }, // aSOI_INSECT_TYPE_MANTIS
{ 6, 3 }, // aSOI_INSECT_TYPE_FIREFLY
{ 1, 0 }, // aSOI_INSECT_TYPE_COCKROACH
{ 1, 0 }, // aSOI_INSECT_TYPE_SAW_STAG_BEETLE
{ 1, 0 }, // aSOI_INSECT_TYPE_MOUNTAIN_BEETLE
{ 1, 0 }, // aSOI_INSECT_TYPE_GIANT_BEETLE
{ 1, 0 }, // aSOI_INSECT_TYPE_SNAIL
{ 1, 0 }, // aSOI_INSECT_TYPE_MOLE_CRICKET
{ 1, 0 }, // aSOI_INSECT_TYPE_POND_SKATER
{ 1, 0 }, // aSOI_INSECT_TYPE_BAGWORM
{ 1, 0 }, // aSOI_INSECT_TYPE_PILL_BUG
{ 1, 0 }, // aSOI_INSECT_TYPE_SPIDER
{ 1, 0 }, // aSOI_INSECT_TYPE_ANT
{ 1, 0 }, // aSOI_INSECT_TYPE_MOSQUITO
{ 1, 0 }, // aSOI_INSECT_TYPE_SPIRIT
static aSOI_insect_birth_sum_c l_insect_birth_sum[aINS_INSECT_TYPE_EXTENDED_NUM] = {
{ 1, 0 }, // aINS_INSECT_TYPE_COMMON_BUTTERFLY
{ 1, 0 }, // aINS_INSECT_TYPE_YELLOW_BUTTERFLY
{ 1, 0 }, // aINS_INSECT_TYPE_TIGER_BUTTERFLY
{ 1, 0 }, // aINS_INSECT_TYPE_PURPLE_BUTTERFLY
{ 1, 0 }, // aINS_INSECT_TYPE_ROBUST_CICADA
{ 1, 0 }, // aINS_INSECT_TYPE_WALKER_CICADA
{ 1, 0 }, // aINS_INSECT_TYPE_EVENING_CICADA
{ 1, 0 }, // aINS_INSECT_TYPE_BROWN_CICADA
{ 1, 0 }, // aINS_INSECT_TYPE_BEE
{ 1, 0 }, // aINS_INSECT_TYPE_COMMON_DRAGONFLY
{ 6, 3 }, // aINS_INSECT_TYPE_RED_DRAGONFLY
{ 1, 0 }, // aINS_INSECT_TYPE_DARNER_DRAGONFLY
{ 1, 0 }, // aINS_INSECT_TYPE_BANDED_DRAGONFLY
{ 1, 0 }, // aINS_INSECT_TYPE_LONG_LOCUST
{ 1, 0 }, // aINS_INSECT_TYPE_MIGRATORY_LOCUST
{ 1, 0 }, // aINS_INSECT_TYPE_CRICKET
{ 1, 0 }, // aINS_INSECT_TYPE_GRASSHOPPER
{ 1, 0 }, // aINS_INSECT_TYPE_BELL_CRICKET
{ 1, 0 }, // aINS_INSECT_TYPE_PINE_CRICKET
{ 1, 0 }, // aINS_INSECT_TYPE_DRONE_BEETLE
{ 1, 0 }, // aINS_INSECT_TYPE_DYNASTID_BEETLE
{ 1, 0 }, // aINS_INSECT_TYPE_FLAT_STAG_BEETLE
{ 1, 0 }, // aINS_INSECT_TYPE_JEWEL_BEETLE
{ 1, 0 }, // aINS_INSECT_TYPE_LONGHORN_BEETLE
{ 1, 0 }, // aINS_INSECT_TYPE_LADYBUG
{ 1, 0 }, // aINS_INSECT_TYPE_SPOTTED_LADYBUG
{ 1, 0 }, // aINS_INSECT_TYPE_MANTIS
{ 6, 3 }, // aINS_INSECT_TYPE_FIREFLY
{ 1, 0 }, // aINS_INSECT_TYPE_COCKROACH
{ 1, 0 }, // aINS_INSECT_TYPE_SAW_STAG_BEETLE
{ 1, 0 }, // aINS_INSECT_TYPE_MOUNTAIN_BEETLE
{ 1, 0 }, // aINS_INSECT_TYPE_GIANT_BEETLE
{ 1, 0 }, // aINS_INSECT_TYPE_SNAIL
{ 1, 0 }, // aINS_INSECT_TYPE_MOLE_CRICKET
{ 1, 0 }, // aINS_INSECT_TYPE_POND_SKATER
{ 1, 0 }, // aINS_INSECT_TYPE_BAGWORM
{ 1, 0 }, // aINS_INSECT_TYPE_PILL_BUG
{ 1, 0 }, // aINS_INSECT_TYPE_SPIDER
{ 1, 0 }, // aINS_INSECT_TYPE_ANT
{ 1, 0 }, // aINS_INSECT_TYPE_MOSQUITO
{ 1, 0 }, // aINS_INSECT_TYPE_SPIRIT
};
/* sizeof(aSOI_term_info_c) == 0xC */
typedef struct term_info_s {
/* 0x00 */ int type; /* insect type (aSOI_INSECT_TYPE_*) */
/* 0x00 */ int type; /* insect type (aINS_INSECT_TYPE_*) */
/* 0x04 */ u8 spawn_area; /* spawn area (aSOI_SPAWN_AREA_*) */
/* 0x05 */ u8 weight; /* weight value */
} aSOI_term_info_c;
@@ -73,7 +73,7 @@ typedef struct term_list_s {
/* 0x04 */ aSOI_term_info_c* term_info; /* pointer to term info items */
} aSOI_term_list_c;
#define INSECT_SPAWN(insect, area, weight) { aSOI_INSECT_TYPE_##insect, aSOI_SPAWN_AREA_##area, weight }
#define INSECT_SPAWN(insect, area, weight) { aINS_INSECT_TYPE_##insect, aSOI_SPAWN_AREA_##area, weight }
static aSOI_term_info_c l_insect_m3_t1[5] = {
INSECT_SPAWN(COCKROACH, ON_FLOWER, 1), /* 5.26% */
@@ -978,7 +978,7 @@ typedef struct insect_set_data_s {
} aSOI_set_data_c;
static void aSOI_ins_clear_set_data(aSOI_set_data_c* set_data) {
set_data->type = 0; /* should this be aSOI_INSECT_TYPE_COMMON_BUTTERFLY? */
set_data->type = 0; /* should this be aINS_INSECT_TYPE_COMMON_BUTTERFLY? */
set_data->ut_x = -1;
set_data->ut_z = -1;
set_data->should_spawn = FALSE;
@@ -1686,7 +1686,7 @@ static int aSOI_ins_get_idx(aSOI_insect_spawn_info_f_c* spawn_info, int info_num
f32 total_weight = 0.0f;
f32 env_rate;
f32 selected_weight;
int selected = aSOI_INSECT_TYPE_INVALID;
int selected = aINS_INSECT_TYPE_INVALID;
int i;
int rank;
aSOI_insect_spawn_info_f_c* spawn_info_p = spawn_info;
@@ -1738,7 +1738,7 @@ static int aSOI_ins_get_idx(aSOI_insect_spawn_info_f_c* spawn_info, int info_num
}
static void aSOI_ins_set_insect_data(aSOI_set_data_c* set_data, int type, aSetMgr_player_pos_c* player_pos) {
if (type != aSOI_INSECT_TYPE_INVALID) {
if (type != aINS_INSECT_TYPE_INVALID) {
int live_ut_x;
int live_ut_z;
@@ -1751,7 +1751,7 @@ static void aSOI_ins_set_insect_data(aSOI_set_data_c* set_data, int type, aSetMg
set_data->should_spawn = TRUE;
set_data->extra_data = 0;
if (type == aSOI_INSECT_TYPE_COCKROACH && mFI_GetBlockUtNum2FG(&item, player_pos->next_bx, player_pos->next_bz, live_ut_x, live_ut_z) == TRUE) {
if (type == aINS_INSECT_TYPE_COCKROACH && mFI_GetBlockUtNum2FG(&item, player_pos->next_bx, player_pos->next_bz, live_ut_x, live_ut_z) == TRUE) {
if (aSOI_tree_check(item)) {
set_data->extra_data = 4; // TODO: definition (*_ON_TREE)
}
@@ -2045,7 +2045,7 @@ static void aSOI_ins_decide_insect(aSOI_set_data_c* set_data, aSetMgr_player_pos
}
spawn_idx = aSOI_ins_get_idx(spawn_info, info_num, candy_spawn | trash_spawn);
if (spawn_idx != aSOI_INSECT_TYPE_INVALID) {
if (spawn_idx != aINS_INSECT_TYPE_INVALID) {
aSOI_insect_spawn_info_f_c* info = spawn_info + spawn_idx;
int spawn_area = info->spawn_area;
@@ -2072,7 +2072,7 @@ static int aSOI_ins_make_sub(aSOI_set_data_c* set_data, aSetMgr_player_pos_c* pl
insect_init.extra_data = set_data->extra_data;
insect_init.game = game;
if (insect_init.insect_type == aSOI_INSECT_TYPE_ANT) {
if (insect_init.insect_type == aINS_INSECT_TYPE_ANT) {
(*Common_Get(clip).insect_clip->make_ant_proc)(&insect_init, player_pos->next_bx, player_pos->next_bz);
res = TRUE;
}
+1 -1
View File
@@ -82,7 +82,7 @@ static u8 mIV_fish_collect_list[] = {
// clang-format on
// clang-format off
#define I(n) aSOI_INSECT_TYPE_##n
#define I(n) aINS_INSECT_TYPE_##n
/* Insect collection layout */
static u8 mIV_insect_collect_list[] = {
+3 -3
View File
@@ -4507,12 +4507,12 @@ static int Player_actor_Change_item_net_catch_label(ACTOR* actorx, u32 label, s8
player->item_net_catch_insect_idx = insect_actor->type;
} else if (insect_actor != NULL) {
if (insect_actor->tools_actor.actor_class.id == mAc_PROFILE_BEE) {
player->item_net_catch_insect_idx = aSOI_INSECT_TYPE_BEE;
player->item_net_catch_insect_idx = aINS_INSECT_TYPE_BEE;
} else {
player->item_net_catch_insect_idx = aSOI_INSECT_TYPE_ANT;
player->item_net_catch_insect_idx = aINS_INSECT_TYPE_ANT;
}
} else {
player->item_net_catch_insect_idx = aSOI_INSECT_TYPE_INVALID;
player->item_net_catch_insect_idx = aINS_INSECT_TYPE_INVALID;
}
return TRUE;
+6 -6
View File
@@ -14,8 +14,8 @@ static int Player_actor_request_main_notice_net(GAME* game, int already_collecte
static void Player_actor_setup_main_Notice_net(ACTOR* actor, GAME* game) {
static int use_mark_insect_type[] = {
aSOI_INSECT_TYPE_ANT,
aSOI_INSECT_TYPE_MOSQUITO,
aINS_INSECT_TYPE_ANT,
aINS_INSECT_TYPE_MOSQUITO,
};
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
mPlayer_main_notice_net_c* main_notice = &player->main_data.notice_net;
@@ -37,7 +37,7 @@ static void Player_actor_setup_main_Notice_net(ACTOR* actor, GAME* game) {
if (type == 0) {
item = ((aINS_INSECT_ACTOR*)label)->item;
} else if (player->item_net_catch_insect_idx == aSOI_INSECT_TYPE_BEE) {
} else if (player->item_net_catch_insect_idx == aINS_INSECT_TYPE_BEE) {
item = ITM_INSECT08;
} else {
item = ITM_INSECT38;
@@ -57,7 +57,7 @@ static void Player_actor_setup_main_Notice_net(ACTOR* actor, GAME* game) {
main_notice->not_full_pocket = FALSE;
}
if (idx != aSOI_INSECT_TYPE_SPIRIT) {
if (idx != aINS_INSECT_TYPE_SPIRIT) {
mSM_COLLECT_INSECT_SET(idx);
}
@@ -88,7 +88,7 @@ static void Player_actor_settle_main_Notice_net(ACTOR* actor, GAME* game) {
mPlayer_main_notice_net_c* main_notice = &player->main_data.notice_net;
if (idx < 0) {
idx = aSOI_INSECT_TYPE_BEE;
idx = aINS_INSECT_TYPE_BEE;
}
if (main_notice->already_collected != FALSE) {
@@ -97,7 +97,7 @@ static void Player_actor_settle_main_Notice_net(ACTOR* actor, GAME* game) {
mBGMPsComp_delete_ps_fanfare(0x28, 0x168);
}
if (idx == aSOI_INSECT_TYPE_BEE) {
if (idx == aINS_INSECT_TYPE_BEE) {
Common_Set(player_bee_chase_flag, FALSE);
if (player->bee_chase_bgm_flag != FALSE) {
+3 -3
View File
@@ -32,7 +32,7 @@ static void Player_actor_setup_main_Pull_net(ACTOR* actor, GAME* game) {
if (player->item_net_catch_label != 0) {
int idx = player->item_net_catch_insect_idx;
if (idx == aSOI_INSECT_TYPE_SPIRIT) {
if (idx == aINS_INSECT_TYPE_SPIRIT) {
main_pull->already_collected = FALSE;
} else {
main_pull->already_collected = mSM_CHECK_LAST_INSECT_GET(idx);
@@ -116,7 +116,7 @@ static void Player_actor_Pull_net_demo_ct(ACTOR* actor) {
if (type != 0) {
player->item_net_has_catch = TRUE;
}
if (idx == aSOI_INSECT_TYPE_SPIRIT) {
if (idx == aINS_INSECT_TYPE_SPIRIT) {
int item_idx = mPr_GetPossessionItemIdxKindWithCond(Save_GetPointer(private_data[Common_Get(player_no)]),
ITM_SPIRIT0, ITM_SPIRIT4, FALSE);
@@ -132,7 +132,7 @@ static void Player_actor_Pull_net_demo_ct(ACTOR* actor) {
if (main_pull->already_collected) {
if (type != 0) {
if (idx != aSOI_INSECT_TYPE_COMMON_BUTTERFLY) {
if (idx != aINS_INSECT_TYPE_COMMON_BUTTERFLY) {
mIN_copy_name_str(str, ITM_INSECT08);
item = ITM_INSECT08;
} else {
+3 -3
View File
@@ -255,12 +255,12 @@ static int Player_actor_CatchSomethingCheck_common(ACTOR* actor, f32 frame) {
player->item_net_catch_insect_idx = ((aINS_INSECT_ACTOR*)label)->type;
} else if (label != 0) {
if (((ACTOR*)label)->id == mAc_PROFILE_BEE) {
player->item_net_catch_insect_idx = aSOI_INSECT_TYPE_BEE;
player->item_net_catch_insect_idx = aINS_INSECT_TYPE_BEE;
} else {
player->item_net_catch_insect_idx = aSOI_INSECT_TYPE_ANT;
player->item_net_catch_insect_idx = aINS_INSECT_TYPE_ANT;
}
} else {
player->item_net_catch_insect_idx = aSOI_INSECT_TYPE_INVALID;
player->item_net_catch_insect_idx = aINS_INSECT_TYPE_INVALID;
}
Player_actor_sound_AMI_GET(actor);
ret = 1;
+1 -1
View File
@@ -4860,7 +4860,7 @@ static void mTG_bury_proc(Submenu* submenu, mSM_MenuInfo_c* menu_info) {
static void mTG_insect_release_sub(mActor_name_t item, int gold_scoop) {
if (ITEM_IS_WISP(item)) {
mPlib_request_main_release_creature_insect_from_submenu(aSOI_INSECT_TYPE_SPIRIT, gold_scoop);
mPlib_request_main_release_creature_insect_from_submenu(aINS_INSECT_TYPE_SPIRIT, gold_scoop);
} else {
mPlib_request_main_release_creature_insect_from_submenu(ITEM_IS_INSECT(item) ? item - ITM_INSECT_START : 0,
gold_scoop);