From 5b54800b8416defc6748bd7deb48aa0f30443e01 Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 12:31:41 +0200 Subject: [PATCH 01/11] Renaming game modes --- src/MM/crc.c | 2 +- src/MMM/code_47D0.c | 2 +- src/core2/code_5C870.c | 26 +++++++++++++------------- src/core2/code_956B0.c | 2 +- src/core2/code_AD5B0.c | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/MM/crc.c b/src/MM/crc.c index dfaf8c47..a775a979 100644 --- a/src/MM/crc.c +++ b/src/MM/crc.c @@ -16,7 +16,7 @@ void func_80387EC0(void) { u32 temp_a0; temp_v0 = (u32* )chmumbo_func_802D1724; - if (getGameMode() != 7) { + if (getGameMode() != GAME_MODE_7_ATTRACT_DEMO) { temp_a0 = (temp_v0[2] & 0x03FFFFFF)*4; //get offset temp_a0 += (u32)&temp_v0[3] & 0xF0000000; //get region ((u32 *)temp_a0)[0] = 0x03E00008; //jr $ra diff --git a/src/MMM/code_47D0.c b/src/MMM/code_47D0.c index 46df191f..7e15054f 100644 --- a/src/MMM/code_47D0.c +++ b/src/MMM/code_47D0.c @@ -16,7 +16,7 @@ typedef struct { /* .code */ void MMM_func_8038ABC0(s32 arg0) { - if (getGameMode() != 7) { + if (getGameMode() != GAME_MODE_7_ATTRACT_DEMO) { ability_setAllLearned(ability_getAllLearned() & ~arg0); } } diff --git a/src/core2/code_5C870.c b/src/core2/code_5C870.c index 1cb72504..d9d9b8d5 100644 --- a/src/core2/code_5C870.c +++ b/src/core2/code_5C870.c @@ -174,7 +174,7 @@ void func_802E3BF0(void){ } //_set_game_mode -void func_802E3BF8(enum game_mode_e next_mode, s32 arg1){ +void game_setMode(enum game_mode_e next_mode, s32 arg1){ s32 prev_mode = D_8037E8E0.game_mode; s32 sp20; s32 sp1C; @@ -261,7 +261,7 @@ void func_802E3E7C(enum game_mode_e mode){ map = D_8037E8E0.map; sp28 = D_8037E8E0.exit; prev_mode = D_8037E8E0.unk0; - func_802E3BF8(GAME_MODE_2_UNKNOWN, 0); + game_setMode(GAME_MODE_2_UNKNOWN, 0); if(!volatileFlag_getAndSet(VOLATILE_FLAG_21, 0) || map_getLevel(map_get()) == map_getLevel(D_8037E8E0.map)){ if(!volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE)) mapSavestate_save(map_get()); @@ -270,7 +270,7 @@ void func_802E3E7C(enum game_mode_e mode){ func_802E38E8(map, sp28, sp34); mapSavestate_apply(map); D_8037E8E0.unk0 = prev_mode; - func_802E3BF8(mode, sp30); + game_setMode(mode, sp30); jiggylist_map_actors(); func_80346CA8(); } @@ -357,7 +357,7 @@ void func_802E412C(s32 arg0, s32 arg1){ } void func_802E4170(void){ - func_802E3BF8(GAME_MODE_2_UNKNOWN,0); + game_setMode(GAME_MODE_2_UNKNOWN,0); defragManager_free(); func_802E5F68(); if(!func_802E4A08()) @@ -405,7 +405,7 @@ void func_802E4214(enum map_e map_id){ func_8033DC70(); func_8033DC04(); func_8031FBA0(); - D_8037E8E0.game_mode = 2; + D_8037E8E0.game_mode = GAME_MODE_2_UNKNOWN; D_8037E8E0.unk8 = 0.0f; func_8033DC9C(0.0f); func_8033DD04(0); @@ -414,7 +414,7 @@ void func_802E4214(enum map_e map_id){ func_802E3854(); func_802E38E8(map_id, 0, 0); D_8037E8E0.unk0 = 0; - func_802E3BF8(GAME_MODE_3_NORMAL,1); + game_setMode(GAME_MODE_3_NORMAL,1); } void func_802E4384(void){ @@ -512,7 +512,7 @@ bool func_802E4424(void) { } } if (D_8037E8E0.unk1A != 0) { - func_802E3BF8(D_8037E8E0.unk1A - 1, D_8037E8E0.unk1B); + game_setMode(D_8037E8E0.unk1A - 1, D_8037E8E0.unk1B); D_8037E8E0.unk1A = 0; } sp1C = func_80334ECC(); @@ -528,7 +528,7 @@ bool func_802E4424(void) { case GAME_MODE_9_BANJO_AND_KAZOOIE: func_8034BB90(); if ((func_8024E67C(0) == 1) && (D_8037E8E0.unk0 != 0)) { - func_802E3BF8(GAME_MODE_1_UNKNOWN, 0U); + game_setMode(GAME_MODE_1_UNKNOWN, 0U); } break; case GAME_MODE_3_NORMAL: /* switch 2 */ @@ -546,11 +546,11 @@ bool func_802E4424(void) { && levelSpecificFlags_validateCRC1() && dummy_func_80320248() ) { - func_802E3BF8(GAME_MODE_4_PAUSED, 0U); + game_setMode(GAME_MODE_4_PAUSED, 0U); } else if ((func_8024E67C(0) == 1) && (D_8037E8E0.unk0 != 0)) { - func_802E3BF8(GAME_MODE_1_UNKNOWN, 0U); + game_setMode(GAME_MODE_1_UNKNOWN, 0U); } else if (sp1C == 0) { - func_802E3BF8(GAME_MODE_3_NORMAL, 1U); + game_setMode(GAME_MODE_3_NORMAL, 1U); } break; @@ -561,7 +561,7 @@ bool func_802E4424(void) { func_8025A430(-1, 2000, 3); func_8025A2B0(); func_80335128(1); - func_802E3BF8(GAME_MODE_3_NORMAL, 0U); + game_setMode(GAME_MODE_3_NORMAL, 0U); } break; } @@ -577,7 +577,7 @@ bool func_802E4424(void) { } void func_802E48B8(enum game_mode_e mode, s32 arg1){ - func_802E3BF8(mode, arg1); + game_setMode(mode, arg1); } s32 game_defrag(void){ diff --git a/src/core2/code_956B0.c b/src/core2/code_956B0.c index c1f21473..35b85a1c 100644 --- a/src/core2/code_956B0.c +++ b/src/core2/code_956B0.c @@ -201,7 +201,7 @@ void func_8031CE70(f32 *arg0, s32 arg1, s32 arg2) { NodeProp *phi_s0; f32 phi_f2; - if ((D_80383190 == 0) && (getGameMode() != 8) && (getGameMode() != 7)) { + if ((D_80383190 == 0) && (getGameMode() != GAME_MODE_8_BOTTLES_BONUS) && (getGameMode() != GAME_MODE_7_ATTRACT_DEMO)) { if (arg0 != 0) { phi_s0 = func_80304ED0(&D_8036DDD0[1], arg0); } else { diff --git a/src/core2/code_AD5B0.c b/src/core2/code_AD5B0.c index 42669e0b..91f8fbd7 100644 --- a/src/core2/code_AD5B0.c +++ b/src/core2/code_AD5B0.c @@ -302,7 +302,7 @@ s32 func_80334ECC(void) { func_80356734(); func_802D5628(); itemPrint_update(); - if (getGameMode() != 4) { + if (getGameMode() != GAME_MODE_4_PAUSED) { func_802F7E54(); } if (D_803835DC == 0) { From 8af5e336a2fbe0be2f83a1edd06f38599b68b260 Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 12:31:47 +0200 Subject: [PATCH 02/11] Renaming Mumbo Mountains --- include/enums.h | 15 +++++++-- src/MM/ch/chimpystump.c | 75 +++++++++++++++++++++++++---------------- src/MM/ch/conga.c | 4 +-- src/MM/ch/juju.c | 2 +- src/MM/ch/jujuhitbox.c | 6 ++-- src/MM/ch/lmonkey.c | 8 ++--- src/MM/ch/orange.c | 4 +-- src/MM/ch/orangepad.c | 6 ++-- 8 files changed, 73 insertions(+), 47 deletions(-) diff --git a/include/enums.h b/include/enums.h index 962df97f..09ceaec9 100644 --- a/include/enums.h +++ b/include/enums.h @@ -2290,9 +2290,18 @@ enum bs_e BS_A5_WONDERWING_UNKA5 }; -enum map_flags_e -{ - mapflag_mm_main_hit_with_orange = 8 +enum mm_specific_flags { + MM_SPECIFIC_FLAG_0_UNKNOWN, + + MM_SPECIFIC_FLAG_2_UNKNOWN = 0x2, + MM_SPECIFIC_FLAG_3_UNKNOWN, + MM_SPECIFIC_FLAG_4_SHAKE, + + MM_SPECIFIC_FLAG_6_UNKNOWN = 0x6, + + MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE = 0x8, + MM_SPECIFIC_FLAG_9_UNKNOWN, + MM_SPECIFIC_FLAG_A_UNKNOWN }; enum item_e diff --git a/src/MM/ch/chimpystump.c b/src/MM/ch/chimpystump.c index 60efb6e8..42614abc 100644 --- a/src/MM/ch/chimpystump.c +++ b/src/MM/ch/chimpystump.c @@ -9,58 +9,75 @@ void func_80353064(f32 *, f32); void func_802BB3DC(s32, f32, f32); void func_80244BB0(s32, s32, s32, f32); +s32 mapSpecificFlags_get(s32); /* public function declarations */ void chchimpystump_update(Actor *this); /* .data */ -ActorInfo chchimpystump = { MARKER_95_CHIMPY_STUMP, ACTOR_C5_CHIMPY_STUMP, ASSET_3C8_MODEL_CHIMPY_STUMP, +enum chchimpystump_state_e { + CHIMPY_STUMP_STATE_1_LOWERED = 1, + CHIMPY_STUMP_STATE_2_RAISING, + CHIMPY_STUMP_STATE_3_RAISED +}; + +ActorInfo chchimpystump = { + MARKER_95_CHIMPY_STUMP, ACTOR_C5_CHIMPY_STUMP, ASSET_3C8_MODEL_CHIMPY_STUMP, 1, NULL, chchimpystump_update, func_80326224, actor_drawFullDepth, 0, 0, 0.0f, 0 }; -void _chchimpystump_80386CA0(Actor *this){ - if(mapSpecificFlags_get(4)){ - if(this->unk10_12 == 0){ +/* .code */ +void __chchimpystump_updateShaking(Actor *this) { + if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_4_SHAKE)) { + if (this->unk10_12 == 0) { this->unk10_12 = 1; func_802BB3DC(1, 3.0f, 1.0f); func_80244BB0(0, 0x6A, 0x7FF8, 0.2f); }//L80386D0C - this->position_x = ((globalTimer_getTime() & 1) * 2) ^ (s32)this->position_x; - this->position_z = ((globalTimer_getTime() & 2) * 2) ^ (s32)this->position_z; + + this->position_x = ((globalTimer_getTime() & 1) * 2) ^ (s32) this->position_x; + this->position_z = ((globalTimer_getTime() & 2) * 2) ^ (s32) this->position_z; } } -void chchimpystump_update(Actor *this){ - if(!this->initialized){ +void chchimpystump_update(Actor *this) { + if (!this->initialized) { actor_collisionOff(this); this->initialized = TRUE; this->unk28 = this->position_y; this->position_y -= 134.0f; this->marker->propPtr->unk8_3 = 1; } - switch (this->state) - { - case 1: - if(mapSpecificFlags_get(0)) - subaddie_set_state(this, 2); - _chchimpystump_80386CA0(this); - break; - case 2: - _chchimpystump_80386CA0(this); - this->position_y += 2.5; - if(this->unk28 <= this->position_y){ - this->position_y = this->unk28; - subaddie_set_state(this, 3); - func_802BB41C(1); - func_80244C78(0); - } - if((globalTimer_getTime() & 3) == 2) - func_80353064(this->position, 40.0f); - break; - case 3: - break; + switch (this->state) { + case CHIMPY_STUMP_STATE_1_LOWERED: + if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_0_UNKNOWN)) { + subaddie_set_state(this, CHIMPY_STUMP_STATE_2_RAISING); + } + + __chchimpystump_updateShaking(this); + break; + + case CHIMPY_STUMP_STATE_2_RAISING: + __chchimpystump_updateShaking(this); + this->position_y += 2.5; + + if (this->unk28 <= this->position_y) { + this->position_y = this->unk28; + subaddie_set_state(this, CHIMPY_STUMP_STATE_3_RAISED); + func_802BB41C(1); + func_80244C78(0); + } + + if ((globalTimer_getTime() & 3) == 2) { + func_80353064(this->position, 40.0f); + } + + break; + + case CHIMPY_STUMP_STATE_3_RAISED: + break; } } diff --git a/src/MM/ch/conga.c b/src/MM/ch/conga.c index a42048b3..fe3165d4 100644 --- a/src/MM/ch/conga.c +++ b/src/MM/ch/conga.c @@ -122,7 +122,7 @@ void func_80387168(ActorMarker *marker, ActorMarker *other_marker){ if(((ActorLocal_Conga *)&actorPtr->local)->unkC == 1){ if(actorPtr->unk10_12 == 0){ ((ActorLocal_Conga *)&actorPtr->local)->unkC = 0; - if(mapSpecificFlags_get(0xA)) + if(mapSpecificFlags_get(MM_SPECIFIC_FLAG_A_UNKNOWN)) actorPtr->unk38_31++; actorPtr->unk10_12 = MIN(actorPtr->unk38_31, 0xA); @@ -252,7 +252,7 @@ void func_803876D0(Actor *this){ && func_80311480(ASSET_B37_TEXT_CONGA_SAFE_UP_HERE, 0, 0, 0, 0, 0) ){ this->unk138_23 = 1; - mapSpecificFlags_set(0xA, 1); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_A_UNKNOWN, TRUE); }//L803878F8 if( sp3C && !this->is_first_encounter){ diff --git a/src/MM/ch/juju.c b/src/MM/ch/juju.c index 6865adbe..da46f9c5 100644 --- a/src/MM/ch/juju.c +++ b/src/MM/ch/juju.c @@ -191,7 +191,7 @@ void func_80389598(Actor *this){ }//L803896B4 if(jujuPtr->unk18){ if(sp38 || (sp34 < 180.0f && 180.0f <= this->yaw)){ - mapSpecificFlags_set(9,1); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_UNKNOWN, TRUE); } } break; diff --git a/src/MM/ch/jujuhitbox.c b/src/MM/ch/jujuhitbox.c index 9610a518..d03d3a83 100644 --- a/src/MM/ch/jujuhitbox.c +++ b/src/MM/ch/jujuhitbox.c @@ -155,10 +155,10 @@ void func_80388E20(Actor *this){ else{ func_80389514(jujuCtlPtr->unk8); } - - if(mapSpecificFlags_get(0x9)){ + + if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_9_UNKNOWN)) { func_80388D14(this); - mapSpecificFlags_set(0x9, 0); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_UNKNOWN, FALSE); } } } diff --git a/src/MM/ch/lmonkey.c b/src/MM/ch/lmonkey.c index d6a4f503..76784813 100644 --- a/src/MM/ch/lmonkey.c +++ b/src/MM/ch/lmonkey.c @@ -69,7 +69,7 @@ void __chLMonkey_spawnJiggy(s32 x, s32 y, s32 z){ void __chLMonkey_complete(ActorMarker *marker, enum asset_e arg1, s32 arg2){ Actor * actor = marker_getActor(marker); - mapSpecificFlags_set(4,1); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_4_SHAKE, TRUE); subaddie_set_state(actor, 3); timed_setStaticCameraToNode(2.3f, 0x12); timedFunc_set_3(2.9f,__chLMonkey_spawnJiggy, actor->position_x, actor->position_y + 150.0f, actor->position_z); @@ -89,7 +89,7 @@ void chLMonkey_update(Actor *this){ }//L8038865C switch(this->state){ case 1://L80388690 - if(mapSpecificFlags_get(2)){ + if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_2_UNKNOWN)) { subaddie_set_state(this, 4); if(!jiggyscore_isCollected(JIGGY_9_MM_CHIMPY)){ func_80311480(ASSET_B40_DIALOG_CHIMPY_COMPLETE, 0xE, this->position, this->marker, __chLMonkey_complete, NULL); @@ -124,10 +124,10 @@ void chLMonkey_update(Actor *this){ func_80343DEC(this); actor_loopAnimation(this); if(0.19 <= this->unk48){ - mapSpecificFlags_set(0, 1); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_0_UNKNOWN, TRUE); } if(0.24 <= this->unk48){ - mapSpecificFlags_set(3, 1); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_3_UNKNOWN, TRUE); } if(0.99 <= this->unk48){ marker_despawn(this->marker); diff --git a/src/MM/ch/orange.c b/src/MM/ch/orange.c index 1260a3f4..2567b6f0 100644 --- a/src/MM/ch/orange.c +++ b/src/MM/ch/orange.c @@ -34,10 +34,10 @@ f32 D_80389A00[3] = {0.0f, 0.0f, 0.0f}; void func_80387F90(ActorMarker *arg0, ActorMarker *other_marker){ if( !func_8028F22C(arg0) - && !mapSpecificFlags_get(mapflag_mm_main_hit_with_orange) + && !mapSpecificFlags_get(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE) && func_80311480(ASSET_B3A_TEXT_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL) ){ - mapSpecificFlags_set(mapflag_mm_main_hit_with_orange, 1); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE, TRUE); } if(arg0); diff --git a/src/MM/ch/orangepad.c b/src/MM/ch/orangepad.c index 6b8b33ec..24970234 100644 --- a/src/MM/ch/orangepad.c +++ b/src/MM/ch/orangepad.c @@ -118,11 +118,11 @@ void func_80386768(Actor * this){ if( func_80329530(this, 0x28) && !func_8028ECAC() - && !mapSpecificFlags_get(6) + && !mapSpecificFlags_get(MM_SPECIFIC_FLAG_6_UNKNOWN) && closest_actor->state != 3 ){ - if(func_80311480(0xb3d, 0, NULL, NULL, NULL, NULL)) { - mapSpecificFlags_set(6,1); + if (func_80311480(0xb3d, 0, NULL, NULL, NULL, NULL)) { + mapSpecificFlags_set(MM_SPECIFIC_FLAG_6_UNKNOWN, TRUE); } } From 17f1f826b51ff9828e026daf0f0ea45b6a815890 Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 12:31:50 +0200 Subject: [PATCH 03/11] Renaming Actor.unk28 --- include/functions.h | 2 +- include/prop.h | 2 +- src/FP/ch/wozza.c | 2 +- src/GV/code_4740.c | 10 ++++----- src/MM/ch/chimpystump.c | 6 +++--- src/MM/ch/conga.c | 10 ++++----- src/MM/ch/orange.c | 8 +++---- src/SM/ch/vegetables.c | 10 ++++----- src/SM/code_2990.c | 6 +++--- src/TTC/ch/blubber.c | 6 +++--- src/TTC/ch/clam.c | 16 +++++++------- src/core2/ch/badShad.c | 6 +++--- src/core2/ch/bigbutt.c | 19 ++++++++-------- src/core2/ch/collectible.c | 18 ++++++++-------- src/core2/ch/crab.c | 8 +++---- src/core2/ch/ghost.c | 8 +++---- src/core2/ch/gravestone.c | 14 ++++++------ src/core2/ch/icecube.c | 26 ++++++++++++---------- src/core2/ch/mole.c | 6 +++--- src/core2/ch/shrapnel.c | 12 +++++------ src/core2/ch/snacker.c | 14 ++++++------ src/core2/ch/termite.c | 16 ++++++++------ src/core2/code_47BD0.c | 8 +++---- src/core2/code_51950.c | 2 +- src/core2/code_53C10.c | 10 ++++----- src/core2/code_5BEB0.c | 2 -- src/core2/code_9E370.c | 9 ++++---- src/core2/code_A4D00.c | 4 ++-- src/core2/code_D6600.c | 18 ++++++++-------- src/core2/code_D89E0.c | 24 ++++++++++----------- src/fight/chfinalboss.c | 44 +++++++++++++++++++------------------- src/lair/code_AD70.c | 6 +++--- 32 files changed, 178 insertions(+), 174 deletions(-) diff --git a/include/functions.h b/include/functions.h index e3dacff6..d600b572 100644 --- a/include/functions.h +++ b/include/functions.h @@ -25,7 +25,7 @@ extern f32 fabsf(f32); #pragma intrinsic (fabsf) - +#define AS_BOOL(expr) ((expr) ? TRUE : FALSE) #define TUPLE_ASSIGN(out, a, b, c) {\ out[0] = a;\ diff --git a/include/prop.h b/include/prop.h index f72bc381..08f6d612 100644 --- a/include/prop.h +++ b/include/prop.h @@ -166,7 +166,7 @@ typedef struct actor_s{ AnimCtrl *animctrl; ActorAnimationInfo *unk18; TUPLE(f32, unk1C); - f32 unk28; //used in cheggs + f32 actor_specific_1_f; //used in cheggs TUPLE(f32, velocity); u32 unk38_31:10; u32 unk38_21:9; diff --git a/src/FP/ch/wozza.c b/src/FP/ch/wozza.c index 098ca665..824d7b00 100644 --- a/src/FP/ch/wozza.c +++ b/src/FP/ch/wozza.c @@ -138,7 +138,7 @@ bool func_8038F5D4(Actor *this, f32 arg1[3], f32 arg2, f32 arg3, s32 arg4){ if(actor_animationIsAt(this, 0.9f)){ FUNC_8030E8B4(SFX_3F2_UNKNOWN, 0.8f, 24000, this->position, 500, 2000); } - this->unk28 = (1.0f- sp24)*arg2; + this->actor_specific_1_f = (1.0f- sp24)*arg2; func_80329054(this, 2); if(ml_distance_vec3f(this->position, arg1) <= arg4) return TRUE; diff --git a/src/GV/code_4740.c b/src/GV/code_4740.c index 68da486f..3fc154f3 100644 --- a/src/GV/code_4740.c +++ b/src/GV/code_4740.c @@ -106,12 +106,12 @@ void func_8038AF10(Actor *this){ animctrl_setSmoothTransition(this->animctrl, TRUE); subaddie_set_state_with_direction(this, 3, 0.00001f, 1); actor_loopAnimation(this); - this->unk28 = 16.0f; + this->actor_specific_1_f = 16.0f; this->unk1C[0] = 1.0f; } int func_8038AF78(Actor *this, f32 arg1, f32 arg2){ - this->unk28 = arg2; + this->actor_specific_1_f = arg2; this->yaw_ideal = (f32)func_80329784(this); func_80328FB0(this, arg1); if(!func_80329030(this, 0) && func_80329480(this)) @@ -192,7 +192,7 @@ void func_8038B124(Actor *this){ subaddie_set_state_with_direction(this, 2, 0.00001f, 1); actor_playAnimationOnce(this); this->yaw = (f32)func_80329784(this); - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; this->unk1C[0] = 1.0f; func_802BB3DC(0, 14.0f, 0.92f); func_8038ABD8(this->position, 8); @@ -200,7 +200,7 @@ void func_8038B124(Actor *this){ else{//L8038B3E0 this->yaw_ideal = func_80257204(this->position_x, this->position_z, this->velocity_x, this->velocity_z); func_80328FB0(this, 18.0f); - this->unk28 = 18.0f; + this->actor_specific_1_f = 18.0f; func_80329030(this, 0); animctrl_setAnimTimer(this->animctrl, 0.0f); @@ -233,7 +233,7 @@ void func_8038B124(Actor *this){ func_8038ABD8(this->position, 8); } else{ - GV_D_80391A70[0] = 2*this->unk28; + GV_D_80391A70[0] = 2 * this->actor_specific_1_f; GV_D_80391A70[1] = 0.0f; GV_D_80391A70[2] = 0.0f; ml_vec3f_yaw_rotate_copy(GV_D_80391A70, GV_D_80391A70, this->yaw - 90.0); diff --git a/src/MM/ch/chimpystump.c b/src/MM/ch/chimpystump.c index 42614abc..d6592cfc 100644 --- a/src/MM/ch/chimpystump.c +++ b/src/MM/ch/chimpystump.c @@ -46,7 +46,7 @@ void chchimpystump_update(Actor *this) { if (!this->initialized) { actor_collisionOff(this); this->initialized = TRUE; - this->unk28 = this->position_y; + this->actor_specific_1_f = this->position_y; this->position_y -= 134.0f; this->marker->propPtr->unk8_3 = 1; } @@ -64,8 +64,8 @@ void chchimpystump_update(Actor *this) { __chchimpystump_updateShaking(this); this->position_y += 2.5; - if (this->unk28 <= this->position_y) { - this->position_y = this->unk28; + if (this->actor_specific_1_f <= this->position_y) { + this->position_y = this->actor_specific_1_f; subaddie_set_state(this, CHIMPY_STUMP_STATE_3_RAISED); func_802BB41C(1); func_80244C78(0); diff --git a/src/MM/ch/conga.c b/src/MM/ch/conga.c index fe3165d4..fd6f7165 100644 --- a/src/MM/ch/conga.c +++ b/src/MM/ch/conga.c @@ -72,7 +72,7 @@ bool __chConga_isPlayerNearCongaTree(Actor * this){ unused_tmpz = plyr_pos[2] - 5029.0f; - if (52900.0f < (plyr_pos[0] - - 5011.0f)*(plyr_pos[0] - - 5011.0f) + (plyr_pos[2]- 5029.0f)*(plyr_pos[2] - 5029.0f)) { + if (52900.0f < (plyr_pos[0] - -5011.0f) * (plyr_pos[0] - -5011.0f) + (plyr_pos[2] - 5029.0f) * (plyr_pos[2] - 5029.0f)) { return FALSE; } @@ -181,7 +181,7 @@ void __chConga_sendOrangeProjectile(ActorMarker *congaMarker){ congaPtr->unk10_12 -= (congaPtr->unk10_12 && ( conga_state == 7)); MM_func_80387F44(); - congaPtr->unk28 = 2.0f; + congaPtr->actor_specific_1_f = 2.0f; orangePtr = func_8032811C(ACTOR_14_ORANGE_PROJECTILE, conga_localPtr->orangeSpawnPosition, congaPtr->yaw); if(orangePtr != NULL){ @@ -220,13 +220,13 @@ void func_803876D0(Actor *this){ this->unk16C_0 = 1; this->initialized = TRUE; this->velocity_x = 0.0f; - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; node_prop = func_80304C38(0x150, this); ((ActorLocal_Conga *)&this->local)->unk1C = nodeprop_getRadius(node_prop); nodeprop_getPosition_s32(node_prop, &((ActorLocal_Conga *)&this->local)->unk10); } - if(0.0f == this->unk28){ - this->unk28 = (actorArray_findActorFromMarkerId(MARKER_36_ORANGE_COLLECTIBLE) != NULL)? 2.0f: 1.0f; + if(0.0f == this->actor_specific_1_f){ + this->actor_specific_1_f = (actorArray_findActorFromMarkerId(MARKER_36_ORANGE_COLLECTIBLE) != NULL)? 2.0f: 1.0f; } if(0.0f != this->velocity_x){ this->velocity_x -= 1.0f; diff --git a/src/MM/ch/orange.c b/src/MM/ch/orange.c index 2567b6f0..2f55011b 100644 --- a/src/MM/ch/orange.c +++ b/src/MM/ch/orange.c @@ -66,7 +66,7 @@ void MM_func_80387FF4(Actor * this){ this->unk1C_y = ground_position_y; func_8030E6D4(SFX_2F_ORANGE_SPLAT); - this->unk28 = 1.0f; + this->actor_specific_1_f = 1.0f; this->lifetime_value = 340.0f; this->state = 2; } @@ -95,10 +95,10 @@ Actor *func_80388188(ActorMarker *this, Gfx **dl, Mtx **mptr, Vtx **vtx){ position[2] = actorPtr->position_z; modelRender_setAlpha( (s32) MIN(255.0f, actorPtr->lifetime_value) ); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); - modelRender_draw(dl, mptr, position, rotation, actorPtr->unk28, sp60, func_8030A428(0x18)); + modelRender_draw(dl, mptr, position, rotation, actorPtr->actor_specific_1_f, sp60, func_8030A428(0x18)); actorPtr->position_y -= 1.9; - if(actorPtr->unk28 < 2.428){ - actorPtr->unk28 += 0.1; + if(actorPtr->actor_specific_1_f < 2.428){ + actorPtr->actor_specific_1_f += 0.1; } } return actorPtr; diff --git a/src/SM/ch/vegetables.c b/src/SM/ch/vegetables.c index ed9d54e3..a877ad07 100644 --- a/src/SM/ch/vegetables.c +++ b/src/SM/ch/vegetables.c @@ -371,7 +371,7 @@ void func_80388080(Actor *this){ } }else{//L80388520 if(local->unkC == 1){ - this->unk28 = 3.0f; + this->actor_specific_1_f = 3.0f; if(mapSpecificFlags_get(0xC) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){//L80388554 if(!func_80329030(this, 0) && func_80329480(this)){ func_80328CEC(this, (s32)this->yaw, 0x78, 0xb4); @@ -391,7 +391,7 @@ void func_80388080(Actor *this){ } } else if(local->unkC == 2){//L80388634 - this->unk28 = 4.0f; + this->actor_specific_1_f = 4.0f; if(!func_80329030(this, 0) && func_80329480(this)){ func_80328CEC(this, (s32)this->yaw, 0x78, 0xB4); this->unk38_0 = 1; @@ -426,9 +426,9 @@ void func_80388080(Actor *this){ if(ml_distance_vec3f(this->position, this->unk1C) < 20.0f){ func_80387E64(this); } - this->unk28 = 5.0f; + this->actor_specific_1_f = 5.0f; if(mapSpecificFlags_get(0xC) || (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE))){ //L8038892C - if(!func_80387FA8(this, local, (s32)this->yaw, (s32)this->unk28)){ + if(!func_80387FA8(this, local, (s32)this->yaw, (s32)this->actor_specific_1_f)){ if(func_80329480(this)){ func_80328CEC(this, (s32)this->yaw, 0x78, 0xb4); this->unk38_0 = 1; @@ -441,7 +441,7 @@ void func_80388080(Actor *this){ this->unk1C_x -= local->unk0_x; this->unk1C_y -= local->unk0_y; this->unk1C_z -= local->unk0_z; - TUPLE_ASSIGN(sp60, this->unk28, 0.0f, 0.0f); + TUPLE_ASSIGN(sp60, this->actor_specific_1_f, 0.0f, 0.0f); ml_vec3f_yaw_rotate_copy(sp60, sp60, this->yaw - 90.0); local->unk0_x = sp60[0] + local->unk0_x; local->unk0_y = sp60[1] + local->unk0_y; diff --git a/src/SM/code_2990.c b/src/SM/code_2990.c index 0e7212bd..2987014b 100644 --- a/src/SM/code_2990.c +++ b/src/SM/code_2990.c @@ -414,10 +414,10 @@ void chsmmole_Update(Actor * this){ this->unk1C_x = this->position_x; this->unk1C_y = this->position_y; this->unk1C_z = this->position_z; - this->unk28 = 300.0f; + this->actor_specific_1_f = 300.0f; } else{ //L80389A68 nodeprop_getPosition(sp40, this->unk1C); - this->unk28 = nodeprop_getRadius(sp40); + this->actor_specific_1_f = nodeprop_getRadius(sp40); }//L80389A8C if(this->unkF4_8 == 1){ if(volatileFlag_get(VOLATILE_FLAG_1) || volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE)){ @@ -458,7 +458,7 @@ void chsmmole_Update(Actor * this){ || (this->unkF4_8 == 8 && mapSpecificFlags_get(3) && !mapSpecificFlags_get(0xF)) ){//L80389C50 - if( ((ml_distance_vec3f(sp44, this->unk1C) < this->unk28) && func_8028F20C()) + if( ((ml_distance_vec3f(sp44, this->unk1C) < this->actor_specific_1_f) && func_8028F20C()) || mapSpecificFlags_get(0x10) ){//L80389C8C if(func_80329530(this, 0x96)) diff --git a/src/TTC/ch/blubber.c b/src/TTC/ch/blubber.c index eedaf6da..1c9985a6 100644 --- a/src/TTC/ch/blubber.c +++ b/src/TTC/ch/blubber.c @@ -79,7 +79,7 @@ void func_803875D4(ActorMarker *marker){ subaddie_set_state(this, 4); actor_loopAnimation(this); - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; if(!mapSpecificFlags_get(2)) { text_id = jiggyscore_isCollected(JIGGY_14_TTC_BLUBBER) ? 0xa2a : 0xa0d; @@ -187,7 +187,7 @@ void func_803878CC(Actor * this){ if( actor_animationIsAt(this, 0.99f) && subaddie_maybe_set_state_position_direction(this, 1, 0.0f, 1, 0.78f) ){ - this->unk28 = 4.0f; + this->actor_specific_1_f = 4.0f; break; } @@ -215,7 +215,7 @@ void func_803878CC(Actor * this){ local = (ActorLocal_Blubber*)&this->local; if(actor_animationIsAt(this, 0.99f) && !local->unk24){ subaddie_set_state(this, 5); - this->unk28 = 8.0f; + this->actor_specific_1_f = 8.0f; } } diff --git a/src/TTC/ch/clam.c b/src/TTC/ch/clam.c index 32bfca8e..8cc23d61 100644 --- a/src/TTC/ch/clam.c +++ b/src/TTC/ch/clam.c @@ -83,10 +83,10 @@ bool __chClam_updateTarget(Actor *this, f32 arg1) { return FALSE; } - this->unk28 = phi_f2 / arg1; + this->actor_specific_1_f = phi_f2 / arg1; this->yaw_ideal = func_80257204(this->position[0], this->position[2], target_position[0], target_position[2]); - if ((volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11) < this->unk28) { - this->unk28 = (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) != 0) ? 0.0f : 17.0f; + if ((volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11) < this->actor_specific_1_f) { + this->actor_specific_1_f = (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) != 0) ? 0.0f : 17.0f; } else if (sp38 == 0) { __chClam_func_803863F0(SFX_AE_YUMYUM_TALKING, randf2(0.9f, 1.0f), 22000, this->position, 500.0f, 2000.0f); } @@ -108,13 +108,13 @@ bool __chClam_rotateTowardTarget(Actor *this, s32 arg1) { if (((f64) animctrl_getAnimTimer(this->animctrl) < 0.1) && ((f64) randf() < 0.5)) { if (this->unk1C[0] != 0.0f) { arg1 *= 2; - this->unk28 = (f32) randi2(0, 0.5*(volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11)); + this->actor_specific_1_f = (f32) randi2(0, 0.5*(volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11)); this->yaw_ideal += (f32) randi2(-arg1, arg1); } else if ((f64) randf() < 0.4) { - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; this->yaw_ideal += (f32) randi2(-arg1, arg1); } else { - this->unk28 = (f32) randi2(0.33 * (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11), volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11); + this->actor_specific_1_f = (f32) randi2(0.33 * (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11), volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0 : 0x11); this->yaw_ideal = this->yaw; } this->unk1C[0] = 0.0f; @@ -124,13 +124,13 @@ bool __chClam_rotateTowardTarget(Actor *this, s32 arg1) { return FALSE; } } - temp_f0_2 = this->unk28 * sp2C; + temp_f0_2 = this->actor_specific_1_f * sp2C; this->velocity[1] = ((f32)(0.3*temp_f0_2) / sp2C) - (f32) ((s32) (sp2C * -5) / 2); if (func_80329078(this, this->yaw_ideal, temp_f0_2)) { return TRUE; } this->unk1C[0] = 1.0f; - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; this->yaw_ideal = this->yaw; return FALSE; } diff --git a/src/core2/ch/badShad.c b/src/core2/ch/badShad.c index f2cf4eb2..d314a2b2 100644 --- a/src/core2/ch/badShad.c +++ b/src/core2/ch/badShad.c @@ -52,7 +52,7 @@ Actor *chBadShad_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ if(other) modelRender_setAlpha(other->alpha_124_19); - sp40 = ml_map_f(this->unk28, 0.0f , 800.0f, 0.53f, 0.18f)*this->unk1C[1]; + sp40 = ml_map_f(this->actor_specific_1_f, 0.0f , 800.0f, 0.53f, 0.18f)*this->unk1C[1]; modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE); modelRender_draw(gfx, mtx, this->position, sp44, sp40, NULL, marker_loadModelBin(marker)); return this; @@ -120,7 +120,7 @@ void func_802D71A0(s32 this, s32 arg1){ sp3C->unk104 = marker; sp3C->unk1C[0] = globalTimer_getTime(); sp3C->unk1C[1] = sp40; - sp3C->unk28 = sp28; + sp3C->actor_specific_1_f = sp28; } } } @@ -148,7 +148,7 @@ void func_802D729C(Actor *actor, f32 arg1){ return; if(!((globalTimer_getTime() ^ actor->marker->actrArrayIdx) & 0x7)){ - sp1C->unk28 = func_802D7038(actor); + sp1C->actor_specific_1_f = func_802D7038(actor); sp1C->position_x = D_8037DE10[0]; sp1C->position_y = D_8037DE10[1] + 6.0f; sp1C->position_z = D_8037DE10[2]; diff --git a/src/core2/ch/bigbutt.c b/src/core2/ch/bigbutt.c index 325cef14..9cff30e3 100644 --- a/src/core2/ch/bigbutt.c +++ b/src/core2/ch/bigbutt.c @@ -40,7 +40,7 @@ ActorInfo D_803660B4 = {0x9, ACTOR_E_BULL_INTRO, ASSET_354_MODEL_BULL_INTRO, /* .code */ void func_802C5E80(Actor *this){ - this->unk28 = randf2(3.5f, 4.9f); + this->actor_specific_1_f = randf2(3.5f, 4.9f); } void func_802C5EB8(Actor *this){ @@ -83,7 +83,7 @@ void func_802C5FF8(Actor *this){ void func_802C60AC(ActorMarker *marker, ActorMarker *other_marker){ Actor *actor = marker_getActor(marker); if( actor->state == 4 - && 5.0 <= actor->unk28 + && 5.0 <= actor->actor_specific_1_f && func_803294F0(actor, 80, func_80329784(actor)) ){ animctrl_setPlaybackType(actor->animctrl, ANIMCTRL_ONCE); @@ -171,7 +171,7 @@ void func_802C6240(Actor *this){ && func_80329078(this, (s32)this->yaw_ideal, 150) && subaddie_maybe_set_state(this, 3, 0.13f) ){ - this->unk28 = randf2(7.1f, 8.4f); + this->actor_specific_1_f = randf2(7.1f, 8.4f); } func_802C5EB8(this); break; @@ -212,7 +212,7 @@ void func_802C6240(Actor *this){ if(this->unk10_12 == 0 || (this->unk10_12 < 3 && func_80329530(this, 300))){ subaddie_set_state(this, 9); - this->unk28 = 13.0f; + this->actor_specific_1_f = 13.0f; } break; @@ -220,9 +220,10 @@ void func_802C6240(Actor *this){ if(actor_animationIsAt(this, 0.35f)) func_8030E58C(SFX_2E_BIGBUTT_RUNNING, 1.0f); - this->unk28 += 0.15; - if(30.0f < this->unk28) - this->unk28 = 30.0f; + this->actor_specific_1_f += 0.15; + if (30.0f < this->actor_specific_1_f) { + this->actor_specific_1_f = 30.0f; + } this->yaw_ideal = (f32)func_80329784(this); func_80328FB0(this, 9.0f); @@ -233,7 +234,7 @@ void func_802C6240(Actor *this){ if(func_80329078(this, (s32)this->yaw_ideal,200)){ animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE); subaddie_set_state(this, 4); - this->unk28 += 5.7; + this->actor_specific_1_f += 5.7; tmp_a0 = this->unk44_31; if(this->unk44_31 == 0){ this->unk44_31 = func_8030D90C(); @@ -259,7 +260,7 @@ void func_802C6240(Actor *this){ func_8030E2C4(this->unk44_31); if(0.99 <= animctrl_getAnimTimer(this->animctrl)){ func_80329878(this, func_80329530(this, 250)? 0.8: 1.2); - if(0.0f == this->unk28){ + if (0.0f == this->actor_specific_1_f) { animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP); subaddie_set_state_with_direction(this, 1, 0.65f, 1); func_8030DA44(this->unk44_31); diff --git a/src/core2/ch/collectible.c b/src/core2/ch/collectible.c index 6d5f3cb7..4c6cf982 100644 --- a/src/core2/ch/collectible.c +++ b/src/core2/ch/collectible.c @@ -38,7 +38,7 @@ void chCollectible_setState(Actor *arg0, s32 next_state){ default: break; case 1: - arg0->unk28 = 0.0f; + arg0->actor_specific_1_f = 0.0f; //fall-through case 3: actor_collisionOff(arg0); @@ -122,13 +122,13 @@ void chCollectible_collectGoldFeather(ActorProp *arg0){ Actor *chCollectible_draw(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ Actor *thisActor = marker_getActor(this); - if(thisActor->unk28 != 0.0f){ + if (thisActor->actor_specific_1_f != 0.0f) { if(thisActor->unk38_0){ func_80344C2C(1); - if(thisActor->unk28 == 255.0f){ + if (thisActor->actor_specific_1_f == 255.0f) { func_803262B8(thisActor); } else{ - actor_setOpacity(thisActor, thisActor->unk28); + actor_setOpacity(thisActor, thisActor->actor_specific_1_f); } } return func_80325934(this, gdl, mptr, arg3); @@ -148,7 +148,7 @@ void chCollectible_update(Actor *this) { } this->unk10_12 = -1; this->unk38_0 = (map_get() == MAP_90_GL_BATTLEMENTS); - this->unk28 = this->unk38_0 ? 0.0f: 255.0f; + this->actor_specific_1_f = this->unk38_0 ? 0.0f : 255.0f; this->initialized = TRUE; } if(!this->unk38_0) @@ -167,13 +167,13 @@ void chCollectible_update(Actor *this) { } /* fallthrough */ case 3: - if (this->unk28 > 0) { - this->unk28 = MAX(this->unk28 - 8, 0); + if (this->actor_specific_1_f > 0) { + this->actor_specific_1_f = MAX(this->actor_specific_1_f - 8, 0); } break; case 2: - if (this->unk28 < 255) { - this->unk28 = MIN(this->unk28 + 8, 255); + if (this->actor_specific_1_f < 255) { + this->actor_specific_1_f = MIN(this->actor_specific_1_f + 8, 255); } break; } diff --git a/src/core2/ch/crab.c b/src/core2/ch/crab.c index 10de9c57..c185f734 100644 --- a/src/core2/ch/crab.c +++ b/src/core2/ch/crab.c @@ -33,7 +33,7 @@ ActorAnimationInfo chCrabMutantAnimations[] = { /* .code */ void __chCrab_802CB040(Actor *this) { - this->unk28 = randf2(1.5f, 2.3f); + this->actor_specific_1_f = randf2(1.5f, 2.3f); } void __chCrab_802CB078(Actor *this) { @@ -49,7 +49,7 @@ void __chCrab_802CB078(Actor *this) { if( func_80329530(this, 1500) && ( (this->modelCacheIndex == ACTOR_F2_BLACK_SNIPPET) || func_803292E0(this)) ) { - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; subaddie_set_state(this, 3U); } } @@ -327,7 +327,7 @@ void chCrab_update(Actor *this) { func_80328FB0(this, 4.0f); if (func_80329480(this)) { subaddie_set_state(this, 4); - this->unk28 = 12.0f; + this->actor_specific_1_f = 12.0f; } break; @@ -336,7 +336,7 @@ void chCrab_update(Actor *this) { func_80328FB0(this, 4.0f); if (func_80329480(this)) { subaddie_set_state(this, 9); - this->unk28 = 12.0f; + this->actor_specific_1_f = 12.0f; } else if (!levelSpecificFlags_get(0xE)) { subaddie_set_state_with_direction(this, 3, 0.0f, 1); } diff --git a/src/core2/ch/ghost.c b/src/core2/ch/ghost.c index 509b400d..f032faa7 100644 --- a/src/core2/ch/ghost.c +++ b/src/core2/ch/ghost.c @@ -169,14 +169,14 @@ void func_8035B674(Actor *this){ void func_8035B6CC(Actor *this){ subaddie_set_state_with_direction(this, 2, 0.01f, 1); actor_playAnimationOnce(this); - this->unk28 = 1.0f; + this->actor_specific_1_f = 1.0f; func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f); } void func_8035B75C(Actor *this){ subaddie_set_state_with_direction(this, 3, 0.01f, 1); actor_loopAnimation(this); - this->unk28 = volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0.0 : 12.0; + this->actor_specific_1_f = volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 0.0 : 12.0; func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f); } @@ -186,10 +186,8 @@ void func_8035B824(Actor *this){ subaddie_set_state_with_direction(this, 4, 0.01f, 1); actor_loopAnimation(this); func_80328CEC(this, (s32)this->yaw_ideal, 0xA, 0x1E); - this->unk28 = 4.0f; + this->actor_specific_1_f = 4.0f; local->unk4 = randf2(2.0f, 4.5f); - - } void func_8035B8A8(Actor *this){ diff --git a/src/core2/ch/gravestone.c b/src/core2/ch/gravestone.c index 12e648ae..c6252465 100644 --- a/src/core2/ch/gravestone.c +++ b/src/core2/ch/gravestone.c @@ -99,14 +99,14 @@ void func_8035EE48(Actor *this){ void func_8035EE80(Actor *this){ subaddie_set_state(this, 3); actor_loopAnimation(this); - this->unk28 = 10.5f; + this->actor_specific_1_f = 10.5f; func_8035EE48(this); } void func_8035EEC0(Actor *this){ subaddie_set_state(this, 4); actor_loopAnimation(this); - this->unk28 = 9.0f; + this->actor_specific_1_f = 9.0f; func_8035EE48(this); } @@ -192,7 +192,7 @@ void func_8035F138(Actor *this) { marker_setCollisionScripts(this->marker, func_8035F0E8, func_8035F048, func_8035EF9C); local->unk0 = 1; this->unk1C[0] = this->position[0]; - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; this->velocity[1] = 0.0f; this->unk1C[2] = this->position[2]; this->velocity[0] = this->yaw; @@ -237,8 +237,8 @@ void func_8035F138(Actor *this) { break; } - if (((this->unk28 + 0.28) <= 18.0) && ( 0.36 <= animctrl_getDuration(this->animctrl) - 0.0056000000000000008)) { - this->unk28 += 0.28; + if (((this->actor_specific_1_f + 0.28) <= 18.0) && ( 0.36 <= animctrl_getDuration(this->animctrl) - 0.0056000000000000008)) { + this->actor_specific_1_f += 0.28; animctrl_setDuration(this->animctrl, animctrl_getDuration(this->animctrl) - 0.0056000000000000008); } break; @@ -253,7 +253,7 @@ void func_8035F138(Actor *this) { if (func_8035ED60(this)) { subaddie_set_state_with_direction(this, 5, 0.99f, 0); actor_playAnimationOnce(this); - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; this->unk1C[1] = 1.9f; this->unk44_31 = func_8030ED2C(SFX_2C_PULLING_NOISE, 3); break; @@ -277,7 +277,7 @@ void func_8035F138(Actor *this) { if (animctrl_getAnimTimer(this->animctrl) <= 0.02) { subaddie_set_state_with_direction(this, 1, 0.02f, 1); actor_playAnimationOnce(this); - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; func_8035EE48(this); break; } diff --git a/src/core2/ch/icecube.c b/src/core2/ch/icecube.c index acebfc2c..c16f9f8e 100644 --- a/src/core2/ch/icecube.c +++ b/src/core2/ch/icecube.c @@ -176,7 +176,7 @@ void func_8035A694(Actor *this){ f32 sp28[3]; sp3C = this->yaw; - sp38 = this->unk28*1.5 + 1.0; + sp38 = this->actor_specific_1_f * 1.5 + 1.0; tmp_v0 = globalTimer_getTime(); this->yaw += sp38; if(360.0f < this->yaw) @@ -215,7 +215,7 @@ void __chicecube_ow(ActorMarker *marker, ActorMarker *other_marker){ Actor *actor = marker_getActor(marker); FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 0.9f, 22000, actor->position, 1500, 3000); actor->velocity[1] = 0.8f; - actor->unk28 = 0.0f; + actor->actor_specific_1_f = 0.0f; } //__chicecube_die @@ -241,7 +241,7 @@ void func_8035A9E0(Actor *this){ subaddie_set_state_with_direction(this, 3, animctrl_getAnimTimer(this->animctrl), 1); actor_loopAnimation(this); this->unk38_31 = 1; - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; } void func_8035AA40(Actor *this){ @@ -322,11 +322,11 @@ void chicecube_update(Actor *this){ break; case 3: // L8035AD88 animctrl_setAnimTimer(this->animctrl, 0.999f); - if(this->unk28 + 0.28 < 18.0){ - this->unk28 = this->unk28 + 0.28; + if (this->actor_specific_1_f + 0.28 < 18.0) { + this->actor_specific_1_f = this->actor_specific_1_f + 0.28; } - else{ - this->unk28 = 18.0f; + else { + this->actor_specific_1_f = 18.0f; } func_8035A694(this); if(!func_80359DF4(this, 1300)){ @@ -343,10 +343,14 @@ void chicecube_update(Actor *this){ break; case 4: // L8035AE64 animctrl_setAnimTimer(this->animctrl, 0.999f); - if(this->unk28 - 0.28 > 8.0) - this->unk28 = this->unk28 - 0.28; - else - this->unk28 = 8.0f; + + if (this->actor_specific_1_f - 0.28 > 8.0) { + this->actor_specific_1_f = this->actor_specific_1_f - 0.28; + } + else { + this->actor_specific_1_f = 8.0f; + } + func_8035A694(this); if(func_80359DF4(this, 900)){ func_8035A9E0(this); diff --git a/src/core2/ch/mole.c b/src/core2/ch/mole.c index 5668f48c..ebfaf1fd 100644 --- a/src/core2/ch/mole.c +++ b/src/core2/ch/mole.c @@ -368,11 +368,11 @@ void chmole_update(Actor *this){ this->velocity[0] = this->position[0]; this->velocity[1] = this->position[1]; this->velocity[2] = this->position[2]; - this->unk28 = 500.0f; + this->actor_specific_1_f = 500.0f; } else{ //L802D9F08 nodeprop_getPosition(node_prop, this->velocity); - this->unk28 = 2*nodeprop_getRadius(node_prop); + this->actor_specific_1_f = 2 * nodeprop_getRadius(node_prop); } } }//L802D9F34 @@ -387,7 +387,7 @@ void chmole_update(Actor *this){ && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT) ){ player_getPosition(sp34); - if(ml_distance_vec3f(sp34, this->velocity) < this->unk28){ + if (ml_distance_vec3f(sp34, this->velocity) < this->actor_specific_1_f) { chmole_startingDialog(this); } } diff --git a/src/core2/ch/shrapnel.c b/src/core2/ch/shrapnel.c index 339e51ed..daa5385a 100644 --- a/src/core2/ch/shrapnel.c +++ b/src/core2/ch/shrapnel.c @@ -26,7 +26,7 @@ ActorAnimationInfo chShrapnelAnimations[] = { /* .code */ void chShrapnel_func_802D0A00(Actor *this) { - this->unk28 = randf2(1.5f, 2.3f); + this->actor_specific_1_f = randf2(1.5f, 2.3f); } void chShrapnel_func_802D0A38(Actor *this){ @@ -35,7 +35,7 @@ void chShrapnel_func_802D0A38(Actor *this){ } else{ if(func_80329530(this, 600) && func_803292E0(this)){ - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; subaddie_set_state_with_direction(this, 2, 0.0f, 1); } } @@ -123,7 +123,7 @@ void chShrapnel_explode(ActorMarker *marker, ActorMarker *other_marker) { void chShrapnel_func_802D0FC8(Actor *this) { this->unk4C += time_getDelta(); - if (MAX(0.25, (12.0 - this->unk28) / 12.0) < this->unk4C) { + if (MAX(0.25, (12.0 - this->actor_specific_1_f) / 12.0) < this->unk4C) { *(s32 *)(&this->local) = NOT(*(s32 *)(&this->local)); this->unk4C = 0.0f; if (*(s32 *)(&this->local)) { @@ -170,15 +170,15 @@ void chshrapnel_update(Actor *this) { subaddie_set_state(this, 3); actor_loopAnimation(this); FUNC_8030E8B4(SFX_C4_TWINKLY_MUNCHER_GRR, 0.6f, 32750, this->position, 1250, 2500); - this->unk28 = 4.0f; + this->actor_specific_1_f = 4.0f; } } break; case 3: this->yaw_ideal = (f32) func_80329784(this); - func_80328FB0(this, this->unk28 / 2); - this->unk28 = MIN( 50.0, (this->unk28 + tick)); + func_80328FB0(this, this->actor_specific_1_f / 2); + this->actor_specific_1_f = MIN(50.0, (this->actor_specific_1_f + tick)); if ((250.0 <= ABS(player_position[1] - this->unk1C[1])) || !func_80329054(this, 0)) { chShrapnel_func_802D0AB8(this); } diff --git a/src/core2/ch/snacker.c b/src/core2/ch/snacker.c index 65b81e93..a46a26f2 100644 --- a/src/core2/ch/snacker.c +++ b/src/core2/ch/snacker.c @@ -65,7 +65,7 @@ s32 D_8037E630; /* .code */ void func_802E0CD0(Actor *this){ - this->unk28 = 4.0f; + this->actor_specific_1_f = 4.0f; } static void __chsnacker_start_dialog(Actor *this) { @@ -76,7 +76,7 @@ static void __chsnacker_start_dialog(Actor *this) { this->unk38_31--; } else{ - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; if (level_get() == LEVEL_2_TREASURE_TROVE_COVE) { text_index = mapSpecificFlags_getN(8, 3); if( !this->is_first_encounter ) { @@ -103,7 +103,7 @@ bool func_802E0DC0(f32 snacker_position[3]){ } void func_802E0E88(Actor *this){ - this->unk28 = 2.0f; + this->actor_specific_1_f = 2.0f; subaddie_set_state_with_direction(this, 5, 0.0f, -1); actor_playAnimationOnce(this); } @@ -235,7 +235,7 @@ void chsnacker_update(Actor *this) { func_80328FF0(this, 3.0f); if (func_80329480(this)) { subaddie_set_state_with_direction(this, 4, 0.0f, 1); - this->unk28 = 9.0f; + this->actor_specific_1_f = 9.0f; } break; @@ -243,9 +243,9 @@ void chsnacker_update(Actor *this) { func_803297FC(this, &sp44, &sp40); this->yaw_ideal = sp40; this->unk6C = func_802E10F0(sp44); - func_80328FB0(this, this->unk28 / 2); - func_80328FF0(this, this->unk28 / 2); - this->unk28 = MIN(50.0, this->unk28 + dt); + func_80328FB0(this, this->actor_specific_1_f / 2); + func_80328FF0(this, this->actor_specific_1_f / 2); + this->actor_specific_1_f = MIN(50.0, this->actor_specific_1_f + dt); func_8032CA80(this, (s_chSnacker_inRbb) ? 15 : 9); break; diff --git a/src/core2/ch/termite.c b/src/core2/ch/termite.c index 1b04f1c6..0628766d 100644 --- a/src/core2/ch/termite.c +++ b/src/core2/ch/termite.c @@ -25,12 +25,14 @@ void __chTermite_updateRandomSpeed(Actor *this) { } void __chTermite_updateAnimationSpeed(Actor *this) { - if ((this->velocity[0] - 0.1 <= this->unk28) && (this->unk28 <= this->velocity[0] + 0.1)) { - this->unk28 = this->velocity[0]; - } else { - this->unk28 += (this->velocity[0] < this->unk28)? -0.2 : 0.2; + if ((this->velocity[0] - 0.1 <= this->actor_specific_1_f) && (this->actor_specific_1_f <= this->velocity[0] + 0.1)) { + this->actor_specific_1_f = this->velocity[0]; } - animctrl_setDuration(this->animctrl, ml_map_f(this->unk28, 5.0f, 12.0f, 0.54f, 0.36f)); + else { + this->actor_specific_1_f += (this->velocity[0] < this->actor_specific_1_f) ? -0.2 : 0.2; + } + + animctrl_setDuration(this->animctrl, ml_map_f(this->actor_specific_1_f, 5.0f, 12.0f, 0.54f, 0.36f)); } void __chTermite_updateRandomRotationSpeed(Actor *this) { @@ -193,7 +195,7 @@ void chTermite_update(Actor *this) { if (subaddie_maybe_set_state_position_direction(this, 2, 0.0f, 1, 0.06f)) { __chTermite_updateRandomRotationSpeed(this); __chTermite_updateRandomSpeed(this); - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; return; } return; @@ -216,7 +218,7 @@ void chTermite_update(Actor *this) { if (func_8034A6FC(0.73f, 0.76f) && func_80329078(this, (s32) this->yaw, 750) ) { this->yaw_ideal = this->yaw; this->velocity[0] = 35.0f; - this->unk28 = 19.4444447f; + this->actor_specific_1_f = 19.4444447f; this->unk38_31 = 0x3A; } if ((sp34 & 0x1F) == 3 && 0.58 < (f64) randf()) { diff --git a/src/core2/code_47BD0.c b/src/core2/code_47BD0.c index 69d1dc82..c5086e53 100644 --- a/src/core2/code_47BD0.c +++ b/src/core2/code_47BD0.c @@ -153,7 +153,7 @@ void func_802CEF54(Actor *this, f32 arg1[3], f32 arg2){ phi_v1 = (this->state == 5) ? 200 : 50; phi_v0 = (this->state == 5) ? 200 : 100; - func_802CEDE4(sp34, this->unk1C, arg2, &this->unk28, (f32) phi_v1, (f32) phi_v0); + func_802CEDE4(sp34, this->unk1C, arg2, &this->actor_specific_1_f, (f32) phi_v1, (f32) phi_v0); this->unk1C[0] = this->unk1C[0] + arg1[0]; this->unk1C[1] = this->unk1C[1] + arg1[1]; this->unk1C[2] = this->unk1C[2] + arg1[2]; @@ -418,7 +418,7 @@ void chBeeSwarm_update(Actor *this) { subaddie_set_state(this, 6); } } - chBeeSwarm_802CF1C8(this->unk1C, this->position, this->velocity, this->unk28, 100.0f, 0, &spA0); + chBeeSwarm_802CF1C8(this->unk1C, this->position, this->velocity, this->actor_specific_1_f, 100.0f, 0, &spA0); } if (map_get() == MAP_78_GL_RBB_AND_MMM_PUZZLE) { if (this->unk38_31++ == 0x1E) { @@ -470,7 +470,7 @@ void chBeeSwarm_update(Actor *this) { this->unk1C[1] = spB4[1]; this->unk1C[2] = spB4[2]; this->unk1C[1] += 50.0f; - this->unk28 = 400.0f; + this->actor_specific_1_f = 400.0f; if (ml_distance_vec3f(this->position, this->unk1C) < 100.0f) { func_802CEF54(this, spB4, 50.0f); subaddie_set_state(this, 4); @@ -547,7 +547,7 @@ void chBeeSwarm_update(Actor *this) { sfxsource_set_fade_distances(this->unk44_31, 500.0f, 1500.0f); sfxsource_set_position(this->unk44_31, this->position); func_8030E2C4(this->unk44_31); - sfxsource_setSampleRate(this->unk44_31, (s32)(((gu_sqrtf(this->velocity[0]*this->velocity[0] + this->velocity[1]*this->velocity[1] + this->velocity[2]*this->velocity[2])/ this->unk28) * 8000.0f) + 2000.0f)); + sfxsource_setSampleRate(this->unk44_31, (s32)(((gu_sqrtf(this->velocity[0] * this->velocity[0] + this->velocity[1] * this->velocity[1] + this->velocity[2] * this->velocity[2]) / this->actor_specific_1_f) * 8000.0f) + 2000.0f)); } } } diff --git a/src/core2/code_51950.c b/src/core2/code_51950.c index 09405d4d..737d94e5 100644 --- a/src/core2/code_51950.c +++ b/src/core2/code_51950.c @@ -83,7 +83,7 @@ void func_802D8B20(enum actor_e actor_id){ temp_v0 = (randf() > 0.5) ? 0x1E : -0x1E; feather = spawn_actor_f32(actor_id, plyr_pos, (s32) (temp2 + temp_v0)); func_8032AA58(feather, 0.45f); - feather->unk28 = 22.0f; + feather->actor_specific_1_f = 22.0f; feather->unk1C[1] = 48.0f; feather->lifetime_value = 1.2f; } diff --git a/src/core2/code_53C10.c b/src/core2/code_53C10.c index 12770100..3e1714a4 100644 --- a/src/core2/code_53C10.c +++ b/src/core2/code_53C10.c @@ -84,7 +84,7 @@ void func_802DAE10(Actor *this){ ActorLocal_core2_53C10 *local; local = (ActorLocal_core2_53C10 *)&this->local; - this->unk28 = randf2(local->unk0, local->unk4); + this->actor_specific_1_f = randf2(local->unk0, local->unk4); } void func_802DAE40(Actor *this) { @@ -132,7 +132,7 @@ bool func_802DAFBC(Actor *this) { func_8032C9E0(sp38); sp34 = func_80257248(sp38, this->position); if (((globalTimer_getTime() - local->unk38) == 0x1E) && ((sp34 - this->yaw_ideal < 15.0f) && (sp34 - this->yaw_ideal > -15.0f))) { - func_802DAF2C(this->position, this->yaw, this->unk28); + func_802DAF2C(this->position, this->yaw, this->actor_specific_1_f); } else { func_80328CEC(this, (s32) sp34, 0, 0xF); } @@ -208,7 +208,7 @@ void func_802DB440(ActorMarker *marker, ActorMarker *other_marker) { this = marker_getActor(marker); if( this->state == 7 - && this->unk28 >= 3.0 + && this->actor_specific_1_f >= 3.0 && func_803294F0(this, 0x50, func_80329784(this)) ) { FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 20000, this->position, 1250, 2500); @@ -294,7 +294,7 @@ void func_802DB5A0(Actor *this) { && func_80329078(this, (s32) this->yaw_ideal, 0x96) ) { if (subaddie_maybe_set_state(this, 3, 0.13f) != 0) { - this->unk28 = randf2((f32)local->unk8, (f32)local->unk9); + this->actor_specific_1_f = randf2((f32)local->unk8, (f32)local->unk9); } } func_802DB220(this); @@ -341,7 +341,7 @@ void func_802DB5A0(Actor *this) { || (this->unk10_12 < local->unkC_31 && func_80329530(this, 0xFA)) ) { subaddie_set_state(this, 7); - this->unk28 = (f32)local->unkA; + this->actor_specific_1_f = (f32) local->unkA; this->unk38_31 = 0; } if(!func_80329078(this, (s32) this->yaw, 0x14)) { diff --git a/src/core2/code_5BEB0.c b/src/core2/code_5BEB0.c index 295376fe..d24f6e0c 100644 --- a/src/core2/code_5BEB0.c +++ b/src/core2/code_5BEB0.c @@ -83,8 +83,6 @@ void mapSavestate_save(enum map_e map) D_8037E650[map] = actors_appendToSavestate(D_8037E650[map], ((u32 *) D_8037E650[map]) + (4 * ((iBit + 0x7F) >> 7))); } -#define AS_BOOL(expr) ((expr)? TRUE : FALSE) - void mapSavestate_apply(enum map_e map_id) { s32 iBit = 0; u32* flag_ptr; diff --git a/src/core2/code_9E370.c b/src/core2/code_9E370.c index 7cbf85e1..e618c89a 100644 --- a/src/core2/code_9E370.c +++ b/src/core2/code_9E370.c @@ -790,7 +790,7 @@ Actor *actor_new(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ suLastBaddie->pitch = 0.0f; suLastBaddie->roll = 0.0f; suLastBaddie->unk6C = 0.0f; - suLastBaddie->unk28 = 0.0f; + suLastBaddie->actor_specific_1_f = 0.0f; suLastBaddie->unk10_12 = 0; suLastBaddie->unk38_0 = 0; suLastBaddie->unk38_31 = 0; @@ -1604,9 +1604,10 @@ void func_803297FC(Actor *arg0, f32 *o1, f32 *o2){ } void func_80329878(Actor *arg0, f32 arg1){ - arg0->unk28 -= arg1; - if(arg0->unk28 < 0.0f){ - arg0->unk28 = 0.0f; + arg0->actor_specific_1_f -= arg1; + + if (arg0->actor_specific_1_f < 0.0f) { + arg0->actor_specific_1_f = 0.0f; } } diff --git a/src/core2/code_A4D00.c b/src/core2/code_A4D00.c index 9dd06b8f..1f4b6042 100644 --- a/src/core2/code_A4D00.c +++ b/src/core2/code_A4D00.c @@ -214,7 +214,7 @@ bool func_8032C2F0(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3) { f32 sp60[3]; f32 sp20[4][4]; - sp6C[0] = arg0->unk28; + sp6C[0] = arg0->actor_specific_1_f; sp6C[1] = 0.0f; sp6C[2] = 0.0f; guRotateRPYF(sp20[0], arg0->roll, 90.0f - arg0->yaw, arg0->pitch); @@ -230,7 +230,7 @@ bool func_8032C2F0(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3) { bool func_8032C404(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3) { f32 sp1C[3]; - sp1C[0] = arg0->unk28; + sp1C[0] = arg0->actor_specific_1_f; sp1C[1] = 0.0f; sp1C[2] = 0.0f; ml_vec3f_yaw_rotate_copy(sp1C, sp1C, arg0->yaw - 90.0); diff --git a/src/core2/code_D6600.c b/src/core2/code_D6600.c index c13cf059..f96794ed 100644 --- a/src/core2/code_D6600.c +++ b/src/core2/code_D6600.c @@ -63,14 +63,14 @@ void func_8035D65C(Actor *this) { return; } if (func_80329530(this, 500) && func_8028B470() && func_8035D608(this)) { - this->unk28 = 2.0f; + this->actor_specific_1_f = 2.0f; subaddie_set_state_with_direction(this, 4, 0.0f, -1); } } void func_8035D6FC(Actor *this) { subaddie_set_state_with_direction(this, 3, 0.0f, -1); - this->unk28 = 2.0f; + this->actor_specific_1_f = 2.0f; subaddie_set_ideal_yaw(this, (s32) (randf2(-45.0f, 45.0f) + (this->yaw + 180.0f))); func_80328CA8(this, (s32) func_8035D590(randf2(-45.0f, 45.0f) + (360.0f - this->pitch))); this->unk38_31 = 0x78; @@ -78,7 +78,7 @@ void func_8035D6FC(Actor *this) { void func_8035D7CC(Actor *this) { subaddie_set_state_with_direction(this, 3, 0.0f, -1); - this->unk28 = 2.0f; + this->actor_specific_1_f = 2.0f; subaddie_set_ideal_yaw(this, (s32) (randf2(-45.0f, 45.0f) + (this->yaw + 180.0f))); func_80328CA8(this, (s32) func_8035D590(randf2(-45.0f, 45.0f) + (360.0f - this->pitch))); } @@ -128,10 +128,10 @@ void func_8035DA1C(Actor *this) { if (!this->initialized) { this->initialized = TRUE; this->unk138_25 = TRUE; - this->unk28 = 4.0f; + this->actor_specific_1_f = 4.0f; LOCAL_D6600(this)->unk4 =(map_get() == MAP_71_GL_STATUE_ROOM) ? 8 : 0xf; if (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)) { - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; subaddie_set_state_with_direction(this, 1, 0.0f, 1); } func_8032CA80(this, LOCAL_D6600(this)->unk4); @@ -152,7 +152,7 @@ void func_8035DA1C(Actor *this) { func_80328FF0(this, 0.5f); func_8032CA80(this, LOCAL_D6600(this)->unk4); if (subaddie_maybe_set_state(this, 2, 0.05f) && !volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)) { - this->unk28 = 4.0f; + this->actor_specific_1_f = 4.0f; } func_8035D65C(this); break; @@ -174,7 +174,7 @@ void func_8035DA1C(Actor *this) { func_80328CA8(this, 0); } if (subaddie_maybe_set_state_position_direction(this, 1, 0.0f, 1, 0.005f)) { - this->unk28 = 2.0f; + this->actor_specific_1_f = 2.0f; } func_8035D65C(this); break; @@ -185,7 +185,7 @@ void func_8035DA1C(Actor *this) { func_8032CA80(this, LOCAL_D6600(this)->unk4); if (func_80329480(this) && func_8032944C(this)) { subaddie_set_state_with_direction(this, 2, 0.0f, -1); - this->unk28 = 4.0f; + this->actor_specific_1_f = 4.0f; } break; @@ -198,7 +198,7 @@ void func_8035DA1C(Actor *this) { func_8032CA80(this, LOCAL_D6600(this)->unk4); if (func_80329480(this) && func_8032944C(this)) { subaddie_set_state_with_direction(this, 5, 0.0f, -1); - this->unk28 = 10.5f; + this->actor_specific_1_f = 10.5f; } break; diff --git a/src/core2/code_D89E0.c b/src/core2/code_D89E0.c index 312e2c5f..ed269305 100644 --- a/src/core2/code_D89E0.c +++ b/src/core2/code_D89E0.c @@ -43,7 +43,7 @@ void func_8035F99C(Actor *this){ if(!volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){ subaddie_set_state_with_direction(this, 2, 0.01f, 1); actor_playAnimationOnce(this); - this->unk28 = 5.0f; + this->actor_specific_1_f = 5.0f; FUNC_8030E8B4(SFX_419_UNKNOWN, 1.0f, 28000, this->position, 0x4e2, 0x9c4); } } @@ -51,7 +51,7 @@ void func_8035F99C(Actor *this){ void func_8035FA0C(Actor *this){ subaddie_set_state(this, 3); actor_loopAnimation(this); - this->unk28 = 5.0f; + this->actor_specific_1_f = 5.0f; } void func_8035FA48(Actor *this){ @@ -75,7 +75,7 @@ void func_8035FAE0(Actor *this){ subaddie_set_state_with_direction(this, 7, 0.01f, 1); actor_loopAnimation(this); this->yaw += 180.0f; - this->unk28 = 20.0f; + this->actor_specific_1_f = 20.0f; this->velocity_x = 300.0f; } @@ -181,7 +181,7 @@ bool func_8035FEDC(Actor *this){ } if(func_80329480(this)){ - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; return FALSE; } } @@ -190,7 +190,7 @@ bool func_8035FEDC(Actor *this){ bool func_8035FF5C(Actor *this){ if(func_8032CA80(this, 5) && func_80329480(this)){ - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; return FALSE; } return TRUE; @@ -241,12 +241,12 @@ bool func_80360198(Actor *this) { func_80328FB0(this, 5.0f); func_80360044(this); - this->unk28 += (this->velocity[1] * 0.45) - (0.001 * this->unk28); - if (this->unk28 > 13.0) { - this->unk28 = 13.0f; + this->actor_specific_1_f += (this->velocity[1] * 0.45) - (0.001 * this->actor_specific_1_f); + if (this->actor_specific_1_f > 13.0) { + this->actor_specific_1_f = 13.0f; } - if (this->unk28 < -13.0) { - this->unk28 = -13.0f; + if (this->actor_specific_1_f < -13.0) { + this->actor_specific_1_f = -13.0f; } this->velocity[0] += ((this->velocity[1] * 0.9) - 0.6); @@ -302,7 +302,7 @@ f32 func_803603AC(Actor *this, s32 arg1, u8 arg2){ return 0.0f; - phi_f2 = -(this->unk28*(dy))/(D1 + D2); + phi_f2 = -(this->actor_specific_1_f*(dy))/(D1 + D2); if (phi_f2 >= 4.0f) { phi_f2 = 4.0f; } else if (phi_f2 <= -4.0f) { @@ -395,7 +395,7 @@ void func_80360828(Actor *this){ this->initialized = TRUE; marker_setCollisionScripts(this->marker, NULL, func_803607FC, func_80360790); this->unk38_0 = FALSE; - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; this->velocity_x = 0.0f; this->unk1C_x = this->position_x; this->unk1C_y = this->position_y; diff --git a/src/fight/chfinalboss.c b/src/fight/chfinalboss.c index 759167a9..68d6e1cb 100644 --- a/src/fight/chfinalboss.c +++ b/src/fight/chfinalboss.c @@ -756,9 +756,9 @@ void func_80387BFC(Actor *this, f32 arg1) { sp44[1] = 2.0 * local->unk20 * sp50; sp44[2] = this->velocity[2] * sp58; ml_vec3f_normalize(sp44); - sp44[0] *= this->unk28; - sp44[1] *= this->unk28; - sp44[2] *= this->unk28; + sp44[0] *= this->actor_specific_1_f; + sp44[1] *= this->actor_specific_1_f; + sp44[2] *= this->actor_specific_1_f; } void fight_func_80387D4C(Actor *actor) { @@ -776,9 +776,9 @@ void fight_func_80387D4C(Actor *actor) { sp20[2] = actor->velocity[2] * local->unk14; ml_vec3f_normalize(sp20, actor); - sp20[0] = sp20[0] * actor->unk28; - sp20[1] = sp20[1] * actor->unk28; - sp20[2] = sp20[2] * actor->unk28; + sp20[0] = sp20[0] * actor->actor_specific_1_f; + sp20[1] = sp20[1] * actor->actor_specific_1_f; + sp20[2] = sp20[2] * actor->actor_specific_1_f; } void func_80387E1C(Actor *this, f32 arg1[3]) { @@ -875,14 +875,14 @@ void chfinalboss_phase1_setState(Actor *this, s32 next_state) { } else { func_8030E878(SFX_14B_GRUNTY_LAUGH_4, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); } - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; this->lifetime_value = 0.0f; break; case 6: local = local; func_80386600(this->marker, 1); func_80324D54(0.4f, SFX_C1_BUZZBOMB_ATTACK, 0.85f, 32000, this->position, 5000.0f, 12000.0f); - this->unk28 = 0.0f; + this->actor_specific_1_f = 0.0f; func_80387B00(this); local->unkA = 0; break; @@ -890,13 +890,13 @@ void chfinalboss_phase1_setState(Actor *this, s32 next_state) { local->unk14 = (local->unk14 > 2000.0f) ? local->unk14 : 2000.0f; local->unk14 = (local->unk14 < 2700.0f) ? local->unk14 : 2700.0f; local->unk18 = 400.0f; - local->unk28 = (-this->unk28 * this->unk28) / (2.0 * local->unk14); + local->unk28 = (-this->actor_specific_1_f * this->actor_specific_1_f) / (2.0 * local->unk14); func_80386600(this->marker, 1); animctrl_setAnimTimer(this->animctrl, sp3C); break; case 8: temp_f12 = 1150.0f; - local->unk28 = (-this->unk28 * this->unk28) / (2.0 * temp_f12); + local->unk28 = (-this->actor_specific_1_f * this->actor_specific_1_f) / (2.0 * temp_f12); local->unk2C = (100.0f - local->unk1C) / temp_f12; break; case 9: @@ -1013,11 +1013,11 @@ void chfinalboss_phase1_update(ActorMarker *marker) { func_80387B00(this); this->lifetime_value += sp54; if (this->lifetime_value < 0.3333333333333333) { - this->unk28 += 3300.0 * sp54; + this->actor_specific_1_f += 3300.0 * sp54; } else if (0.7333333333333334 < this->lifetime_value) { - this->unk28 -= 3300.0 * sp54; + this->actor_specific_1_f -= 3300.0 * sp54; } - local->unk20 += this->unk28 * sp54; + local->unk20 += this->actor_specific_1_f * sp54; func_80387BFC(this, 45.0f * sp54); func_80328FB0(this, 30.0f * sp54); if (this->lifetime_value > 1.0) { @@ -1027,11 +1027,11 @@ void chfinalboss_phase1_update(ActorMarker *marker) { case 6: func_803869BC(this); if (local->unk4 >= (local->hits + 1)) { - this->unk28 += (D_80391738[local->hits] * sp54) * 0.66; + this->actor_specific_1_f += (D_80391738[local->hits] * sp54) * 0.66; } else { - this->unk28 += D_80391738[local->hits] * sp54; + this->actor_specific_1_f += D_80391738[local->hits] * sp54; } - local->unk20 -= this->unk28 * sp54; + local->unk20 -= this->actor_specific_1_f * sp54; func_80387BFC(this, 180.0f * sp54); func_80328FB0(this, 30.0f * sp54); if ((local->unkA == 0) && (local->unk20 < (local->unk14 * 0.65))) { @@ -1065,11 +1065,11 @@ void chfinalboss_phase1_update(ActorMarker *marker) { break; case 7: func_803869BC(this); - this->unk28 = this->unk28 + local->unk28 * sp54; - local->unk20 = local->unk20 - this->unk28 * sp54; + this->actor_specific_1_f = this->actor_specific_1_f + local->unk28 * sp54; + local->unk20 = local->unk20 - this->actor_specific_1_f * sp54; func_80387BFC(this, 180.0f * sp54); func_80328FB0(this, 30.0f * sp54); - if (this->unk28 < 0) { + if (this->actor_specific_1_f < 0) { chfinalboss_phase1_setState(this, 4); func_80386654(1.5f, fight_D_80391390, fight_D_80391380); } @@ -1077,12 +1077,12 @@ void chfinalboss_phase1_update(ActorMarker *marker) { case 8: func_803885DC(this); func_803869BC(this); - this->unk28 = this->unk28 + local->unk28 * sp54; - local->unk20 = local->unk20 - this->unk28 * sp54; + this->actor_specific_1_f = this->actor_specific_1_f + local->unk28 * sp54; + local->unk20 = local->unk20 - this->actor_specific_1_f * sp54; func_80387ACC(this, 60.0f * sp54); fight_func_80387D4C(this); func_80328FB0(this, 30.0f * sp54); - if (this->unk28 < 0) { + if (this->actor_specific_1_f < 0) { chfinalboss_phase1_setState(this, 9); func_80386654(2.0f, fight_D_80391390, fight_D_80391380); this->lifetime_value = 4.0f; diff --git a/src/lair/code_AD70.c b/src/lair/code_AD70.c index 14453625..2e4fee23 100644 --- a/src/lair/code_AD70.c +++ b/src/lair/code_AD70.c @@ -164,8 +164,8 @@ void func_80391810(Actor *this, s32 next_state) { local = (ActorLocal_lair_AD70 *)&this->local; switch (next_state) { case 1: - sp34 = (this->position[1] + this->unk28) - this->unk1C[1]; - this->velocity[1] = gu_sqrtf(this->unk28 * 2000.0); + sp34 = (this->position[1] + this->actor_specific_1_f) - this->unk1C[1]; + this->velocity[1] = gu_sqrtf(this->actor_specific_1_f * 2000.0); local->unk0 = -this->velocity[1] / -1000.0f; local->unk0 += gu_sqrtf((sp34 * -2.0) / -1000.0); this->velocity[0] = this->unk1C[0] - this->position[0]; @@ -296,7 +296,7 @@ void func_80391EA8(ActorMarker *marker, ActorMarker *a1, f32 a2[3], f32 f1, f32 actor->unk1C[1] = a2[1]; actor->unk1C[2] = a2[2]; - actor->unk28 = f1; + actor->actor_specific_1_f = f1; actor->yaw_ideal = randf2( 240, 480); actor->unk6C = randf2(-240, -480); From 4f714c2d5a76f194c57e471541dd37b4c1b75b0e Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 12:31:53 +0200 Subject: [PATCH 04/11] Renaming boolean values --- include/functions.h | 2 - src/BGS/ch/yumblie.c | 15 ++-- src/BGS/code_3420.c | 2 +- src/FP/ch/twinklybox.c | 2 +- src/FP/code_A1C0.c | 2 +- src/MMM/ch/napper.c | 2 +- src/MMM/code_2040.c | 2 +- src/TTC/ch/nipper.c | 4 +- src/core1/code_10A00.c | 4 +- src/core1/memory.c | 2 +- src/core2/bs/bSwim.c | 2 +- src/core2/code_33C30.c | 2 +- src/core2/code_33F90.c | 4 +- src/core2/code_4A6F0.c | 2 +- src/core2/code_4C020.c | 2 +- src/core2/code_581D0.c | 2 +- src/core2/code_5BEB0.c | 2 +- src/core2/code_7AF80.c | 6 +- src/core2/code_91E10.c | 6 +- src/core2/code_9B180.c | 5 +- src/core2/code_A4D00.c | 142 ++++++++++++++++++++--------------- src/core2/gc/pauseMenu.c | 4 +- src/core2/gc/zoombox.c | 6 +- src/core2/mapspecificflags.c | 4 +- src/core2/modelRender.c | 2 +- src/core2/particle.c | 2 +- src/lair/ch/cauldron.c | 4 +- 27 files changed, 130 insertions(+), 104 deletions(-) diff --git a/include/functions.h b/include/functions.h index d600b572..bf0a12cf 100644 --- a/include/functions.h +++ b/include/functions.h @@ -25,8 +25,6 @@ extern f32 fabsf(f32); #pragma intrinsic (fabsf) -#define AS_BOOL(expr) ((expr) ? TRUE : FALSE) - #define TUPLE_ASSIGN(out, a, b, c) {\ out[0] = a;\ out[1] = b;\ diff --git a/src/BGS/ch/yumblie.c b/src/BGS/ch/yumblie.c index 4bceaa3e..11a90129 100644 --- a/src/BGS/ch/yumblie.c +++ b/src/BGS/ch/yumblie.c @@ -41,13 +41,16 @@ bool func_8038B160(Actor *this){ local = (ActorLocal_Yumblie *)&this->local; temp_v0 = func_8038A9E0(local->game_marker); - if ((temp_v0 == 1) || (temp_v0 == 4)) - return FALSE; - - if ((temp_v0 == 2) || (temp_v0 == 5)) - return (0.7 <= randf ()) ? TRUE : FALSE; - return (randf () >= 0.5)? TRUE : FALSE; + if ((temp_v0 == 1) || (temp_v0 == 4)) { + return FALSE; + } + + if ((temp_v0 == 2) || (temp_v0 == 5)) { + return BOOL(0.7 <= randf()); + } + + return BOOL(randf() >= 0.5); } void chyumblie_set_state(Actor* this, enum chyumblie_state_e next_state){ diff --git a/src/BGS/code_3420.c b/src/BGS/code_3420.c index 7da9da10..8ac58faf 100644 --- a/src/BGS/code_3420.c +++ b/src/BGS/code_3420.c @@ -693,7 +693,7 @@ void chvilegame_update(Actor *this) { if (item_empty(ITEM_6_HOURGLASS)) { if (volatileFlag_get(VOLATILE_FLAG_2_FF_IN_MINIGAME)) { volatileFlag_set(VOLATILE_FLAG_3, 0); - volatileFlag_set(VOLATILE_FLAG_5_FF_MINIGAME_WON, ( local->vile_score < local->player_score) ? TRUE : FALSE); + volatileFlag_set(VOLATILE_FLAG_5_FF_MINIGAME_WON, BOOL(local->vile_score < local->player_score)); func_8038A068(this, 1); } else if (local->vile_score < local->player_score) { if (local->unkC == 3) { diff --git a/src/FP/ch/twinklybox.c b/src/FP/ch/twinklybox.c index 1de52093..4a97ea5f 100644 --- a/src/FP/ch/twinklybox.c +++ b/src/FP/ch/twinklybox.c @@ -279,7 +279,7 @@ void func_8038D6C8(Actor *this){ bool sp20; sp24 = time_getDelta(); - mapSpecificFlags_set(0xd, (this->state != 1 && this->state != 2) ? TRUE : FALSE); + mapSpecificFlags_set(0xd, BOOL(this->state != 1 && this->state != 2)); if(func_8038BFA0() || fileProgressFlag_get(FILEPROG_13_COMPLETED_TWINKLIES_MINIGAME)){ this->marker->propPtr->unk8_3 = FALSE; diff --git a/src/FP/code_A1C0.c b/src/FP/code_A1C0.c index 88b58803..52c42f06 100644 --- a/src/FP/code_A1C0.c +++ b/src/FP/code_A1C0.c @@ -17,5 +17,5 @@ void func_803905B0(Actor *this){ this->volatile_initialized = TRUE; actor_collisionOff(this); } - this->marker->propPtr->unk8_3 = func_8038DD14(this) ? TRUE : FALSE; + this->marker->propPtr->unk8_3 = BOOL(func_8038DD14(this)); } diff --git a/src/MMM/ch/napper.c b/src/MMM/ch/napper.c index b2357293..78afd1b3 100644 --- a/src/MMM/ch/napper.c +++ b/src/MMM/ch/napper.c @@ -80,7 +80,7 @@ Actor *chnapper_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ } else { func_8033A45C(1, FALSE); - func_8033A45C(2, (local->unk10) ? TRUE : FALSE); + func_8033A45C(2, BOOL(local->unk10)); func_8033A45C(3, (local->unk10) ? FALSE : TRUE); } diff --git a/src/MMM/code_2040.c b/src/MMM/code_2040.c index 54c5c0a2..597967a1 100644 --- a/src/MMM/code_2040.c +++ b/src/MMM/code_2040.c @@ -287,7 +287,7 @@ void func_80388BDC(Actor *this) { f64 phi_f0; func_802D3D74(this); - mapSpecificFlags_set(1, ((this->yaw > 260.0f) && (this->yaw < 330.0f)) ? TRUE : FALSE); + mapSpecificFlags_set(1, BOOL((this->yaw > 260.0f) && (this->yaw < 330.0f))); if (!this->volatile_initialized) { if (this->yaw != 0.0f) { this->lifetime_value = 0.5f; diff --git a/src/TTC/ch/nipper.c b/src/TTC/ch/nipper.c index 3dfc48e0..0a9e4679 100644 --- a/src/TTC/ch/nipper.c +++ b/src/TTC/ch/nipper.c @@ -112,11 +112,11 @@ bool func_80388088(Actor *this){ return FALSE; } - return (-35.0f < sp2C && sp2C < 35.0f) ? TRUE : FALSE; + return BOOL(-35.0f < sp2C && sp2C < 35.0f); } bool func_8038812C(Actor *this){ - return (func_80329530(this, 1300) && func_80388088(this)) ? TRUE : FALSE; + return BOOL(func_80329530(this, 1300) && func_80388088(this)); } void func_80388178(ActorMarker *this_marker, ActorMarker *other_marker) { diff --git a/src/core1/code_10A00.c b/src/core1/code_10A00.c index 9e485021..7520a9b1 100644 --- a/src/core1/code_10A00.c +++ b/src/core1/code_10A00.c @@ -314,8 +314,8 @@ void pfsManager_init(void){ osStartThread(&pfsManagerThread); } -bool pfsManager_contErr(void){ - return pfsManagerContStatus.errno ? TRUE : FALSE; +bool pfsManager_contErr(void) { + return BOOL(pfsManagerContStatus.errno); } void func_8024F150(void){ diff --git a/src/core1/memory.c b/src/core1/memory.c index 0c9916eb..56784333 100644 --- a/src/core1/memory.c +++ b/src/core1/memory.c @@ -251,7 +251,7 @@ u32 heap_get_occupied_size(void){ bool func_8025498C(s32 size){ s32 v0 = func_802549BC(size); - return v0 ? TRUE : FALSE; + return BOOL(v0); } EmptyHeapBlock *func_802549BC(s32 size){ diff --git a/src/core2/bs/bSwim.c b/src/core2/bs/bSwim.c index 804d4d19..a862f573 100644 --- a/src/core2/bs/bSwim.c +++ b/src/core2/bs/bSwim.c @@ -384,7 +384,7 @@ void func_802A7F4C(void){ } void func_802A7F6C(void) { - D_8037D394 = (bs_getPrevState() == BS_41_DIE) ? TRUE : FALSE; + D_8037D394 = BOOL(bs_getPrevState() == BS_41_DIE); if (D_8037D394 || level_get() == LEVEL_9_RUSTY_BUCKET_BAY || map_get() == MAP_46_CCW_WINTER) { D_8037D395 = 0; diff --git a/src/core2/code_33C30.c b/src/core2/code_33C30.c index b204c1e6..fb0ed47a 100644 --- a/src/core2/code_33C30.c +++ b/src/core2/code_33C30.c @@ -26,7 +26,7 @@ void func_802BAC10(void){ } bool func_802BAC1C(void) { - return (func_80320EB0(D_8037D810, 100.0f, 1) != NULL) ? TRUE : FALSE; + return BOOL(func_80320EB0(D_8037D810, 100.0f, 1) != NULL); } void func_802BAC58(void) { diff --git a/src/core2/code_33F90.c b/src/core2/code_33F90.c index daa931d8..ee9e4b59 100644 --- a/src/core2/code_33F90.c +++ b/src/core2/code_33F90.c @@ -481,8 +481,8 @@ void func_802BB22C(void){ } } -bool func_802BB270(void){ - return (!D_80364E00) ? TRUE : FALSE; +bool func_802BB270(void) { + return BOOL(!D_80364E00); } s32 func_802BB294(void){ diff --git a/src/core2/code_4A6F0.c b/src/core2/code_4A6F0.c index 611bbb03..6298ab28 100644 --- a/src/core2/code_4A6F0.c +++ b/src/core2/code_4A6F0.c @@ -105,7 +105,7 @@ bool chMumbo_withinHorzDistToPlayer(s32 x, s32 z, s32 dist) { bool chMumbo_func_802D181C(s32 arg0) { s32 search_start_cube[3] = D_80367504; - return (cubeList_findNodePropByActorId(arg0, search_start_cube))? TRUE : FALSE; + return BOOL(cubeList_findNodePropByActorId(arg0, search_start_cube)); } void chMumbo_func_802D186C(Actor *this) { diff --git a/src/core2/code_4C020.c b/src/core2/code_4C020.c index fdf48337..fdbb74d8 100644 --- a/src/core2/code_4C020.c +++ b/src/core2/code_4C020.c @@ -505,7 +505,7 @@ bool func_802D42F8(Actor *this) { void func_802D4388(Actor *this){ func_802D3CE8(this); - this->unk38_0 = ( map_get() == MAP_7A_GL_CRYPT || item_getCount(ITEM_1C_MUMBO_TOKEN) >= this->unkF4_8 || func_802D42F8(this)) ? TRUE : FALSE; + this->unk38_0 = BOOL(map_get() == MAP_7A_GL_CRYPT || item_getCount(ITEM_1C_MUMBO_TOKEN) >= this->unkF4_8 || func_802D42F8(this)); mapSpecificFlags_set(0x1F, (func_8028F20C() && func_8028FB48(0x78000000)) || func_8028ECAC() == BSGROUP_D_TRANSFORMING); switch(this->state){ case 0x12: //L802D4468 diff --git a/src/core2/code_581D0.c b/src/core2/code_581D0.c index f10f08f5..a112f62d 100644 --- a/src/core2/code_581D0.c +++ b/src/core2/code_581D0.c @@ -70,7 +70,7 @@ void func_802DF2C4(Actor *this) { for( i = 0; i < 20; i++){ prev_val = D_8037E008[i]; temp_v0 = func_8034C2C4(this->marker, i + 0x190); - D_8037E008[i] = (i == temp_fp) ? TRUE : FALSE; + D_8037E008[i] = BOOL(i == temp_fp); if (prev_val != D_8037E008[i] ) { val = D_8037E008[i]; switch(val){ diff --git a/src/core2/code_5BEB0.c b/src/core2/code_5BEB0.c index d24f6e0c..ca102b92 100644 --- a/src/core2/code_5BEB0.c +++ b/src/core2/code_5BEB0.c @@ -100,7 +100,7 @@ void mapSavestate_apply(enum map_e map_id) { func_803083B0(-1); while ( - bit_value = AS_BOOL((((u32*)D_8037E650[map_id])[iBit >> 5] & (1 << (iBit & 0x1f)))), + bit_value = BOOL(((u32*)D_8037E650[map_id])[iBit >> 5] & (1 << (iBit & 0x1f))), func_803083B0(bit_value) != -1 ) { iBit++; diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index 1b82efa4..c0f6b294 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -1384,8 +1384,8 @@ void func_80305CD8(s32 arg0, s32 arg1){ } } -bool func_80305D14(void){ - return (D_8036ABA4 != NULL) ? TRUE : FALSE; +bool func_80305D14(void) { + return BOOL(D_8036ABA4 != NULL); } void func_80305D38(void){ @@ -2435,5 +2435,5 @@ void func_80308F0C(Cube *cube) { } bool func_80308F54(s32 cube_index) { - return D_803821E0[cube_index >> 5] & (1 << (cube_index & 0x1F))? TRUE: FALSE; + return BOOL(D_803821E0[cube_index >> 5] & (1 << (cube_index & 0x1F))); } diff --git a/src/core2/code_91E10.c b/src/core2/code_91E10.c index 5685170f..43eb94a7 100644 --- a/src/core2/code_91E10.c +++ b/src/core2/code_91E10.c @@ -402,9 +402,11 @@ void func_803197AC(s32 arg0){ item_set(ITEM_6_HOURGLASS, TRUE); D_803830E0->unk15 = 0; D_803830E0->unk13 = 1U; - for(i = 1; i < 4; i++){ - func_80319758(i, (i == D_803830E0->unk13) ? TRUE : FALSE); + + for (i = 1; i < 4; i++) { + func_80319758(i, BOOL(i == D_803830E0->unk13)); } + break; case 7: //80319C0C diff --git a/src/core2/code_9B180.c b/src/core2/code_9B180.c index 8e70782c..e67f7b51 100644 --- a/src/core2/code_9B180.c +++ b/src/core2/code_9B180.c @@ -175,7 +175,6 @@ void func_803224FC(void) { } } - -void func_803225B0(s32 arg0, s32 arg1){ - D_80383330 =(arg1 == 2) ? TRUE : FALSE; +void func_803225B0(s32 arg0, s32 arg1) { + D_80383330 = BOOL(arg1 == 2); } diff --git a/src/core2/code_A4D00.c b/src/core2/code_A4D00.c index 1f4b6042..3f258024 100644 --- a/src/core2/code_A4D00.c +++ b/src/core2/code_A4D00.c @@ -3,15 +3,22 @@ #include "variables.h" #include "structs.h" -extern s32 func_80244E54(f32[3], f32[3], f32 [3], u32, f32, f32); +extern s32 func_80244E54(f32[3], f32[3], f32 [3], u32, f32, f32); + extern void func_80244F00(f32[3], f32, f32, s32, s32); -extern s32 func_80320DB0(f32[3], f32, f32[3], u32); +extern s32 func_80320DB0(f32[3], f32, f32[3], u32); + extern void func_80320ED8(ActorMarker *, f32, s32); -extern f32 func_8033229C(ActorMarker *marker); -extern f32 func_80309B24(f32 [3]); -extern f32 ml_dotProduct_vec3f(f32[3], f32[3]); -extern f32 ml_distanceSquared_vec3f(f32[3], f32[3]); + +extern f32 func_8033229C(ActorMarker *marker); + +extern f32 func_80309B24(f32 [3]); + +extern f32 ml_dotProduct_vec3f(f32[3], f32[3]); + +extern f32 ml_distanceSquared_vec3f(f32[3], f32[3]); + extern BKCollisionTri *func_80320C94(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3], s32 arg4, u32 arg5); /* .h */ @@ -20,7 +27,7 @@ typedef bool (*method_core2_A4D00_0)(Actor *, f32[3], s32, s32); typedef struct { f32 unk0[3]; f32 unkC[3]; - BKCollisionTri * unk18; + BKCollisionTri *unk18; f32 unk1C[3]; f32 unk28[3]; f32 unk34[3]; @@ -28,43 +35,54 @@ typedef struct { f32 unk44[3]; u8 pad50[0x3C]; s32 unk8C; -}Struct_A4D00; +} Struct_A4D00; bool func_8032BC90(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032BD88(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032C280(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032C2F0(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032C404(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032C4AC(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032C660(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032C6E0(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032C79C(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032C99C(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032C9C0(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3); + bool func_8032CA40(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3); /* .data */ method_core2_A4D00_0 D_8036E5D0[][6] = { - {func_8032C404, func_8032C4AC, NULL, func_8032C280, NULL, func_8032C79C}, - {func_8032C404, func_8032C4AC, NULL, func_8032BD88, NULL, NULL}, - {func_8032C404, func_8032C4AC, NULL, NULL, NULL, func_8032C79C}, - {func_8032C404, func_8032C4AC, NULL, NULL, NULL, NULL}, - {func_8032C404, NULL, NULL, func_8032C280, NULL, func_8032C79C}, - {func_8032C404, NULL, NULL, func_8032BD88, NULL, NULL}, - {func_8032C404, NULL, NULL, NULL, NULL, func_8032C79C}, - {func_8032C404, NULL, NULL, NULL, NULL, NULL}, - {func_8032C2F0, func_8032C660, NULL, func_8032C280, NULL, func_8032C79C}, - {func_8032C2F0, func_8032C660, NULL, func_8032BD88, NULL, NULL}, - {func_8032C2F0, func_8032C660, NULL, func_8032C280, func_8032CA40, func_8032C79C}, - {func_8032C2F0, func_8032C660, NULL, func_8032BD88, func_8032CA40, NULL}, - { NULL, NULL, NULL, func_8032BC90, NULL, NULL}, - {func_8032C2F0, func_8032C4AC, NULL, func_8032C280, NULL, func_8032C6E0}, - {func_8032C2F0, func_8032C660, NULL, NULL, NULL, func_8032C6E0}, - {func_8032C2F0, func_8032C660, NULL, func_8032BD88, NULL, func_8032C6E0}, - { NULL, NULL, NULL, func_8032BC90, NULL, func_8032C6E0}, - {func_8032C404, func_8032C4AC, func_8032C9C0, func_8032C280, NULL, func_8032C79C}, - {func_8032C404, func_8032C4AC, func_8032C99C, func_8032C280, NULL, func_8032C79C}, - {func_8032C404, NULL, NULL, NULL, NULL, func_8032C6E0} + {func_8032C404, func_8032C4AC, NULL, func_8032C280, NULL, func_8032C79C}, + {func_8032C404, func_8032C4AC, NULL, func_8032BD88, NULL, NULL}, + {func_8032C404, func_8032C4AC, NULL, NULL, NULL, func_8032C79C}, + {func_8032C404, func_8032C4AC, NULL, NULL, NULL, NULL}, + {func_8032C404, NULL, NULL, func_8032C280, NULL, func_8032C79C}, + {func_8032C404, NULL, NULL, func_8032BD88, NULL, NULL}, + {func_8032C404, NULL, NULL, NULL, NULL, func_8032C79C}, + {func_8032C404, NULL, NULL, NULL, NULL, NULL}, + {func_8032C2F0, func_8032C660, NULL, func_8032C280, NULL, func_8032C79C}, + {func_8032C2F0, func_8032C660, NULL, func_8032BD88, NULL, NULL}, + {func_8032C2F0, func_8032C660, NULL, func_8032C280, func_8032CA40, func_8032C79C}, + {func_8032C2F0, func_8032C660, NULL, func_8032BD88, func_8032CA40, NULL}, + {NULL, NULL, NULL, func_8032BC90, NULL, NULL}, + {func_8032C2F0, func_8032C4AC, NULL, func_8032C280, NULL, func_8032C6E0}, + {func_8032C2F0, func_8032C660, NULL, NULL, NULL, func_8032C6E0}, + {func_8032C2F0, func_8032C660, NULL, func_8032BD88, NULL, func_8032C6E0}, + {NULL, NULL, NULL, func_8032BC90, NULL, func_8032C6E0}, + {func_8032C404, func_8032C4AC, func_8032C9C0, func_8032C280, NULL, func_8032C79C}, + {func_8032C404, func_8032C4AC, func_8032C99C, func_8032C280, NULL, func_8032C79C}, + {func_8032C404, NULL, NULL, NULL, NULL, func_8032C6E0} }; /* .bss */ @@ -89,14 +107,14 @@ bool func_8032BC90(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3) { } actor->marker->propPtr->unk8_3 = sp40; - return (phi_v0)? 1 : 0; + return (phi_v0) ? 1 : 0; } -void func_8032BD64(f32 arg0[3]){ +void func_8032BD64(f32 arg0[3]) { ml_vec3f_copy(arg0, D_803833D8); } -bool func_8032BD88(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3){ +bool func_8032BD88(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3) { s32 i; s32 temp_s7; Struct_A4D00 *var_fp; @@ -117,7 +135,7 @@ bool func_8032BD88(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3){ temp_s7 = arg0->unk154; var_f24 = func_8033229C(arg0->marker); var_fp = NULL; - sp290 = arg0->marker->propPtr->unk8_3; + sp290 = arg0->marker->propPtr->unk8_3; arg0->marker->propPtr->unk8_3 = 0; ml_vec3f_diff_copy(sp278, arg0->position, arg1); sp284[0] = arg1[0] - arg0->position[0]; @@ -127,22 +145,24 @@ bool func_8032BD88(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3){ sp29C = TRUE; var_f24 = var_f24 * 0.6; var_f22 = MAX(arg0->marker->unk38[1], var_f24 * 1.25); - } else { - if (!spBC[i].unk44){} + } + else { + if (!spBC[i].unk44) {} sp29C = FALSE; var_f24 = var_f24 * 0.5; var_f22 = arg0->marker->unk38[1]; } func_80244F00(arg1, var_f24, var_f22, sp29C, temp_s7); sp88 = ((var_f24 * 2) - 4); - sp84 = sp88* sp88; + sp84 = sp88 * sp88; - for(i = 0; i < 3; i++){ + for (i = 0; i < 3; i++) { var_s2 = (i != 0) ? &spBC[i - 1] : NULL; if (i != 0) { ml_vec3f_copy(spBC[i].unk0, var_s2->unk0); ml_vec3f_copy(spBC[i].unkC, var_s2->unkC); - } else { + } + else { ml_vec3f_copy(spBC[i].unk0, arg0->position); ml_vec3f_copy(spBC[i].unkC, arg1); } @@ -154,10 +174,11 @@ bool func_8032BD88(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3){ spBC[i].unk0[1] = temp_f20; } } - } else { + } + else { spBC[i].unk40 = 0; } - + spBC[i].unk8C = sp29C; spBC[i].unk34[0] = spBC[i].unkC[0];\ spBC[i].unk34[1] = spBC[i].unkC[1] + var_f22;\ @@ -169,7 +190,7 @@ bool func_8032BD88(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3){ spBC[i].unk18 = func_80320C94(spBC[i].unk34, spBC[i].unk28, var_f24, spBC[i].unk1C, 3, temp_s7); - if(spBC[i].unk18 == NULL) + if (spBC[i].unk18 == NULL) break; var_fp = &spBC[i]; @@ -186,7 +207,8 @@ bool func_8032BD88(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3){ if (i == 3) { ml_vec3f_copy(arg0->position, arg1); - } else if (var_fp != NULL) { + } + else if (var_fp != NULL) { temp_f20 = gu_sqrtf((sp284[0] * sp284[0]) + (sp284[1] * sp284[1]) + (sp284[2] * sp284[2])); arg0->position[0] = var_fp->unk0[0]; arg0->position[1] = var_fp->unk0[1]; @@ -199,7 +221,8 @@ bool func_8032BD88(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3){ if (var_fp != NULL) { ml_vec3f_copy(D_803833D8, var_fp->unk1C); } - return (var_fp != NULL) ? TRUE : FALSE; + + return BOOL(var_fp != NULL); } bool func_8032C280(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3) { @@ -218,9 +241,9 @@ bool func_8032C2F0(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3) { sp6C[1] = 0.0f; sp6C[2] = 0.0f; guRotateRPYF(sp20[0], arg0->roll, 90.0f - arg0->yaw, arg0->pitch); - sp60[0] = (sp20[0][0]*sp6C[0]) + (sp20[0][1]*sp6C[1]) + (sp20[0][2]*sp6C[2]); - sp60[1] = (sp20[1][0]*sp6C[0]) + (sp20[1][1]*sp6C[1]) + (sp20[1][2]*sp6C[2]); - sp60[2] = (sp20[2][0]*sp6C[0]) + (sp20[2][1]*sp6C[1]) + (sp20[2][2]*sp6C[2]); + sp60[0] = (sp20[0][0] * sp6C[0]) + (sp20[0][1] * sp6C[1]) + (sp20[0][2] * sp6C[2]); + sp60[1] = (sp20[1][0] * sp6C[0]) + (sp20[1][1] * sp6C[1]) + (sp20[1][2] * sp6C[2]); + sp60[2] = (sp20[2][0] * sp6C[0]) + (sp20[2][1] * sp6C[1]) + (sp20[2][2] * sp6C[2]); arg0->position[0] += sp60[0]; arg0->position[1] += sp60[1]; arg0->position[2] += sp60[2]; @@ -249,7 +272,7 @@ bool func_8032C4AC(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3) { if (arg0->unk138_8) { arg0->position[1] = mapModel_getFloorY(arg0->position); } - else{ + else { sp30 = func_8033229C(arg0->marker) / 3.0; sp4C[0] = arg0->position[0]; sp4C[1] = arg0->position[1]; @@ -260,13 +283,14 @@ bool func_8032C4AC(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3) { sp40[2] = arg0->position[2]; sp40[1] += arg0->unk170; arg0->unk170 = (-sp30 < time_getDelta() * (arg0->unk170 * 40.0)) ? time_getDelta() * (arg0->unk170 * 40.0) - : -sp30; + : -sp30; if (func_80309B48(sp4C, sp40, sp34, 0x5E0000)) { arg0->unk170 = -10.0f; arg0->position[0] = sp40[0]; arg0->position[1] = sp40[1]; arg0->position[2] = sp40[2]; - } else { + } + else { arg0->position[1] = MAX(-100000.0f, arg0->position[1] + arg0->unk170); } } @@ -328,7 +352,7 @@ bool func_8032C850(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3, bool nonactor) actor->marker->collidable = TRUE; func_80320ED8(actor->marker, temp_f0 / 2, 2); actor->marker->collidable = stored_collidability; - for(var_v1 = func_8032F528(); var_v1 != NULL; var_v1 = func_8032F528()) { + for (var_v1 = func_8032F528(); var_v1 != NULL; var_v1 = func_8032F528()) { if (nonactor || (var_v1->markerFlag && (var_v1->actorProp.marker->id == actor->marker->id))) { D_803833D0 = var_v1; actor->position[0] = (f32) arg1[0]; @@ -341,12 +365,12 @@ bool func_8032C850(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3, bool nonactor) return FALSE; } -bool func_8032C99C(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3){ +bool func_8032C99C(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3) { return func_8032C850(actor, arg1, arg2, arg3, 1); } -bool func_8032C9C0(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3){ +bool func_8032C9C0(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3) { return func_8032C850(actor, arg1, arg2, arg3, 0); } @@ -358,13 +382,13 @@ void func_8032C9E0(f32 arg0[3]) { } } -bool func_8032CA40(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3){ - bool var_v1 = (arg3 & 8) ? TRUE : FALSE; - if(var_v1){ - actor->position[0] = arg1[0]; - actor->position[1] = arg1[1]; - actor->position[2] = arg1[2]; +bool func_8032CA40(Actor *actor, f32 arg1[3], s32 arg2, s32 arg3) { + bool var_v1 = BOOL(arg3 & 8); + + if (var_v1) { + TUPLE_COPY(actor->position, arg1) } + return var_v1; } @@ -378,8 +402,8 @@ s32 func_8032CA80(Actor *actor, s32 arg1) { sp40[1] = actor->position[1]; sp40[2] = actor->position[2]; var_s1 = 0; - for(var_s0 = 0; var_s0 < 6; var_s0++){ - if(D_8036E5D0[arg1][var_s0] != NULL){ + for (var_s0 = 0; var_s0 < 6; var_s0++) { + if (D_8036E5D0[arg1][var_s0] != NULL) { temp_v0_2 = D_8036E5D0[arg1][var_s0](actor, sp40, arg1, var_s1); if (temp_v0_2 != 0) { var_s1 |= temp_v0_2 << var_s0; diff --git a/src/core2/gc/pauseMenu.c b/src/core2/gc/pauseMenu.c index 570a3130..ef0914dd 100644 --- a/src/core2/gc/pauseMenu.c +++ b/src/core2/gc/pauseMenu.c @@ -726,7 +726,7 @@ s32 gcpausemenu_80312D78(struct1As *arg0, s32 arg1) { for(var_s2 = 0; var_s2 < arg1; var_s2++){ if (arg0[var_s2].delay <= D_80383010.unkC) { if (!arg0[var_s2].unkF) { - var_v0 = func_803183A4(D_80383010.zoombox[var_s2], arg0[var_s2].str) ? TRUE : FALSE; + var_v0 = BOOL(func_803183A4(D_80383010.zoombox[var_s2], arg0[var_s2].str)); arg0[var_s2].unkF = var_v0; if (arg0[var_s2].unkF) { gczoombox_open(D_80383010.zoombox[var_s2]); @@ -835,7 +835,7 @@ void gcpausemenu_updateBButtonAndJoystickSprites(void) { } D_80383010.unk20 -= var_f0; } - D_80383010.left_joystick_visible = (D_80383010.selection != 0) ? TRUE : FALSE; + D_80383010.left_joystick_visible = BOOL(D_80383010.selection != 0); D_80383010.right_joystick_visible = (gcpausemenu_getMaxPage() == D_80383010.selection) ? FALSE : TRUE; D_80383010.unk28 += time_getDelta(); diff --git a/src/core2/gc/zoombox.c b/src/core2/gc/zoombox.c index 903cd8b9..248bbc83 100644 --- a/src/core2/gc/zoombox.c +++ b/src/core2/gc/zoombox.c @@ -1567,8 +1567,8 @@ void func_803184C8(GcZoombox *this, f32 arg1, s32 arg2, s32 arg3, f32 arg4, bool if (this->anim_ctrl != NULL) { animctrl_setDuration(this->anim_ctrl, arg4); } - this->unk1A4_12 = arg5 ? TRUE : FALSE; - this->unk1A4_10 = arg6 ? TRUE : FALSE; + this->unk1A4_12 = BOOL(arg5); + this->unk1A4_10 = BOOL(arg6); } } @@ -1617,7 +1617,7 @@ void func_80318640(GcZoombox *this, s32 arg1, f32 arg2, f32 arg3, s32 arg4) { } this->unk198 = arg2; this->unk194 = arg3; - this->unk1A4_15 = (arg4) ? TRUE : FALSE; + this->unk1A4_15 = BOOL(arg4); } } diff --git a/src/core2/mapspecificflags.c b/src/core2/mapspecificflags.c index 84414271..917e7e14 100644 --- a/src/core2/mapspecificflags.c +++ b/src/core2/mapspecificflags.c @@ -92,8 +92,8 @@ void bitfield_setBit(s32 *arg0, s32 arg1, bool arg2){ } } -bool bitfield_isBitSet(s32 *arg0, s32 arg1){ - return (arg0[(arg1 >> 5) + 1] & (1 << (arg1 & 0x1F))) ? TRUE : FALSE; +bool bitfield_isBitSet(s32 *arg0, s32 arg1) { + return BOOL(arg0[(arg1 >> 5) + 1] & (1 << (arg1 & 0x1F))); } void bitfield_setAll(s32 *arg0, bool arg1) { diff --git a/src/core2/modelRender.c b/src/core2/modelRender.c index d668334f..d3ec888b 100644 --- a/src/core2/modelRender.c +++ b/src/core2/modelRender.c @@ -1403,7 +1403,7 @@ f32 func_8033A244(f32 arg0){ } void func_8033A25C(bool arg0){ - D_80383704 = arg0 ? TRUE : FALSE; + D_80383704 = BOOL(arg0); } void func_8033A280(f32 arg0){ diff --git a/src/core2/particle.c b/src/core2/particle.c index 7d24aec4..76fd44b0 100644 --- a/src/core2/particle.c +++ b/src/core2/particle.c @@ -866,7 +866,7 @@ void partEmitMgr_defrag(void){ } void func_802F0E80(void* arg0, s32 arg1){ - partEmitMgrEnable = (arg1 == 2) ? TRUE : FALSE; + partEmitMgrEnable = BOOL(arg1 == 2); } void func_802F0EAC(ParticleEmitter *this, f32 arg1){ diff --git a/src/lair/ch/cauldron.c b/src/lair/ch/cauldron.c index 73b8fd58..cd960f3a 100644 --- a/src/lair/ch/cauldron.c +++ b/src/lair/ch/cauldron.c @@ -323,7 +323,7 @@ void chWarpCauldron_update(Actor *this) { for(sp3C = 0; D_803936E4[sp3C] < temp_f0; sp3C++) ; - this->unk38_0 = (sp3C & 1) ? TRUE : FALSE; + this->unk38_0 = BOOL(sp3C & 1); if (actor_animationIsAt(this, 0.95f)) { func_8038A704(this); fileProgressFlag_set(chWarpCauldron_getFileProgressFlagIndex(this), 1); @@ -435,7 +435,7 @@ Actor *chWarpCauldron_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) this = marker_getActor(marker); if(this->modelCacheIndex == ACTOR_23B_WARP_CAULDRON) { - func_8033A45C(3, this->unk38_0 ? TRUE : FALSE); + func_8033A45C(3, BOOL(this->unk38_0)); func_8033A45C(4, this->unk38_0 ? FALSE : TRUE); } this = actor_draw(marker, gfx, mtx, vtx); From 7883c762dffa251f1b6b955884aa31e0d6aa581b Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 12:31:56 +0200 Subject: [PATCH 05/11] Renaming Orange --- src/MM/ch/chimpystump.c | 1 - src/MM/ch/orange.c | 88 +++++++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 44 deletions(-) diff --git a/src/MM/ch/chimpystump.c b/src/MM/ch/chimpystump.c index d6592cfc..6af64942 100644 --- a/src/MM/ch/chimpystump.c +++ b/src/MM/ch/chimpystump.c @@ -9,7 +9,6 @@ void func_80353064(f32 *, f32); void func_802BB3DC(s32, f32, f32); void func_80244BB0(s32, s32, s32, f32); -s32 mapSpecificFlags_get(s32); /* public function declarations */ void chchimpystump_update(Actor *this); diff --git a/src/MM/ch/orange.c b/src/MM/ch/orange.c index 2f55011b..1cc9584a 100644 --- a/src/MM/ch/orange.c +++ b/src/MM/ch/orange.c @@ -3,103 +3,105 @@ #include "functions.h" #include "variables.h" -#ifndef MIN -#define MIN(s,t) ((s < t)?(s):(t)) -#endif - -#ifndef ORANGE_FALLING_STATE -#define ORANGE_FALLING_STATE 1 -#endif - -#ifndef ORANGE_LANDED_STATE -#define ORANGE_LANDED_STATE 2 -#endif - /* extern functions */ -f32 mapModel_getFloorY(f32*); +f32 mapModel_getFloorY(f32 *); /* public functions */ -void MM_func_80387FF4(Actor *this); -Actor* func_80388188(ActorMarker *, Gfx **, Mtx**, Vtx**); +void chorange_update(Actor *this); +Actor *chorange_draw(ActorMarker *, Gfx **, Mtx **, Vtx **); /* .data */ -ActorInfo chorangeInfo = { MARKER_C_ORANGE_PROJECTILE, ACTOR_14_ORANGE_PROJECTILE, ASSET_2D2_MODEL_ORANGE, +enum chorange_state_e { + ORANGE_STATE_1_FALLING = 1, + ORANGE_STATE_2_LANDED +}; + +ActorInfo chorangeInfo = { + MARKER_C_ORANGE_PROJECTILE, ACTOR_14_ORANGE_PROJECTILE, ASSET_2D2_MODEL_ORANGE, 1, NULL, - MM_func_80387FF4, func_80326224, func_80388188, + chorange_update, func_80326224, chorange_draw, 0, 0, 0.6f, 0 }; -f32 D_803899F4[3] = {0.0f,-8.0f, 0.0f}; +f32 D_803899F4[3] = {0.0f, -8.0f, 0.0f}; f32 D_80389A00[3] = {0.0f, 0.0f, 0.0f}; -void func_80387F90(ActorMarker *arg0, ActorMarker *other_marker){ - if( !func_8028F22C(arg0) - && !mapSpecificFlags_get(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE) - && func_80311480(ASSET_B3A_TEXT_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL) - ){ +/* .code */ +void __chorange_collisionCallback(ActorMarker *marker, ActorMarker *other_marker) { + if (!func_8028F22C() && + !mapSpecificFlags_get(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE) && + func_80311480(ASSET_B3A_TEXT_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL)) { + mapSpecificFlags_set(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE, TRUE); } - if(arg0); + if (marker); } -void MM_func_80387FF4(Actor * this){ - f32 ground_position_y; +void chorange_update(Actor *this) { + f32 floor_position_y; f32 velocity_y; - if(!this->initialized){ + if (!this->initialized) { this->marker->unk2C_1 = 1; - marker_setCollisionScripts(this->marker, NULL, func_80387F90, NULL); + marker_setCollisionScripts(this->marker, NULL, __chorange_collisionCallback, NULL); } - switch(this->state){ - case ORANGE_FALLING_STATE: + + switch (this->state) { + case ORANGE_STATE_1_FALLING: this->position_x += this->velocity_x; velocity_y = this->velocity_y - 5.0; this->velocity_y = velocity_y; this->position_y += velocity_y; this->position_z += this->velocity_z; - ground_position_y = mapModel_getFloorY(this->position); + floor_position_y = mapModel_getFloorY(this->position); - if(this->position_y < ground_position_y){ - this->position_y = ground_position_y; - this->unk1C_y = ground_position_y; + if (this->position_y < floor_position_y) { + this->position_y = floor_position_y; + this->unk1C_y = floor_position_y; func_8030E6D4(SFX_2F_ORANGE_SPLAT); this->actor_specific_1_f = 1.0f; this->lifetime_value = 340.0f; - this->state = 2; + this->state = ORANGE_STATE_2_LANDED; } break; - case ORANGE_LANDED_STATE: - if(this->lifetime_value < 324.0){ + + case ORANGE_STATE_2_LANDED: + if (this->lifetime_value < 324.0) { this->marker->collidable = FALSE; } + this->lifetime_value -= 4.0; - if(this->lifetime_value < 4.0){ + + if (this->lifetime_value < 4.0) { marker_despawn(this->marker); } break; } } -Actor *func_80388188(ActorMarker *this, Gfx **dl, Mtx **mptr, Vtx **vtx){ - Actor* actorPtr = actor_drawFullDepth(this, dl, mptr, vtx); +Actor *chorange_draw(ActorMarker *this, Gfx **dl, Mtx **mptr, Vtx **vtx) { + Actor *actorPtr = actor_drawFullDepth(this, dl, mptr, vtx); f32 sp60[3] = D_803899F4; f32 rotation[3] = D_80389A00; f32 position[3]; - if(actorPtr->state == 2){ + if (actorPtr->state == ORANGE_STATE_2_LANDED) { position[0] = actorPtr->position_x; position[1] = actorPtr->unk1C_y + 3.0f; position[2] = actorPtr->position_z; - modelRender_setAlpha( (s32) MIN(255.0f, actorPtr->lifetime_value) ); + + modelRender_setAlpha((s32) MIN(255.0f, actorPtr->lifetime_value)); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_draw(dl, mptr, position, rotation, actorPtr->actor_specific_1_f, sp60, func_8030A428(0x18)); actorPtr->position_y -= 1.9; - if(actorPtr->actor_specific_1_f < 2.428){ + + if (actorPtr->actor_specific_1_f < 2.428) { actorPtr->actor_specific_1_f += 0.1; } } + return actorPtr; } From f0d53d6fcd6e0bce07efca23530a1e34a559158b Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 12:31:59 +0200 Subject: [PATCH 06/11] Renaming Orange Pad --- include/enums.h | 2 +- src/MM/ch/chimpystump.c | 2 +- src/MM/ch/lmonkey.c | 68 +++++++++++++++++++----------------- src/MM/ch/orangepad.c | 77 +++++++++++++++++------------------------ 4 files changed, 71 insertions(+), 78 deletions(-) diff --git a/include/enums.h b/include/enums.h index 09ceaec9..f9b7a288 100644 --- a/include/enums.h +++ b/include/enums.h @@ -2291,7 +2291,7 @@ enum bs_e }; enum mm_specific_flags { - MM_SPECIFIC_FLAG_0_UNKNOWN, + MM_SPECIFIC_FLAG_0_CHIMPY_STUMP_RAISED, MM_SPECIFIC_FLAG_2_UNKNOWN = 0x2, MM_SPECIFIC_FLAG_3_UNKNOWN, diff --git a/src/MM/ch/chimpystump.c b/src/MM/ch/chimpystump.c index 6af64942..d2b2a29c 100644 --- a/src/MM/ch/chimpystump.c +++ b/src/MM/ch/chimpystump.c @@ -52,7 +52,7 @@ void chchimpystump_update(Actor *this) { switch (this->state) { case CHIMPY_STUMP_STATE_1_LOWERED: - if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_0_UNKNOWN)) { + if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_0_CHIMPY_STUMP_RAISED)) { subaddie_set_state(this, CHIMPY_STUMP_STATE_2_RAISING); } diff --git a/src/MM/ch/lmonkey.c b/src/MM/ch/lmonkey.c index 76784813..fd1a583d 100644 --- a/src/MM/ch/lmonkey.c +++ b/src/MM/ch/lmonkey.c @@ -6,7 +6,7 @@ void func_8028E668(f32 *, f32, f32, f32); int actor_animationIsAt(Actor *, f32); void subaddie_set_state_with_direction(Actor *, s32, f32, s32); void timed_exitStaticCamera(f32); -void func_80324E38(f32,s32); +void func_80324E38(f32, s32); void timed_setStaticCameraToNode(f32, s32); s32 func_8028F31C(f32 *, f32, s32, Actor **); void func_8028FA34(s32, Actor *); @@ -16,35 +16,38 @@ void chLMonkey_update(Actor *); /* .data */ ActorAnimationInfo chlmonkeyAnimations[5] = { - {0, 0.0f}, + {0, 0.0f}, {ASSET_5C_ANIM_CHIMPY_IDLE, 2.3f}, {ASSET_5B_ANIM_CHIMPY_JUMP, 0.67f}, {ASSET_5D_ANIM_CHIMPY_WALK, 0.5f}, {ASSET_5C_ANIM_CHIMPY_IDLE, 2.3f} }; -ActorInfo chlmonkeyInfo = { MARKER_A_CHIMPY, ACTOR_F_CHIMPY, ASSET_35D_MODEL_CHIMPY, +ActorInfo chlmonkeyInfo = { + MARKER_A_CHIMPY, ACTOR_F_CHIMPY, ASSET_35D_MODEL_CHIMPY, 1, chlmonkeyAnimations, NULL, chLMonkey_update, actor_draw, 2500, 0, 0.8f, 0 }; /* .code */ -void func_80388300(Actor **arg0){ +void func_80388300(Actor **arg0) { func_8028F31C((*arg0)->position, 800.0f, ACTOR_29_ORANGE_COLLECTIBLE, arg0); - if( func_80329530(*arg0, 345) + + if (func_80329530(*arg0, 345) && bacarry_get_markerId() == MARKER_36_ORANGE_COLLECTIBLE - && func_8028FC34() - ){ + && func_8028FC34()) { + func_8028FA34(0xc6, *arg0); (*arg0)->is_first_encounter = TRUE; timed_setStaticCameraToNode(1.2f, 0xF); func_80324E38(1.2f, 3); } - if(arg0); + + if (arg0); } -void __chLMonkey_playRandomNoise(Actor *this){ +void __chLMonkey_playRandomNoise(Actor *this) { f32 scaled_noise_volume; f32 random_noise; static sNoiseCooldown = 0; @@ -53,26 +56,26 @@ void __chLMonkey_playRandomNoise(Actor *this){ random_noise = randf(); sNoiseCooldown--; - if(sNoiseCooldown < 0){ - if(randf() < 0.2){ + if (sNoiseCooldown < 0) { + if (randf() < 0.2) { sNoiseCooldown = 6; - func_8030E6A4(((random_noise < 0.5) ? SFX_58_CHIMPY_NOISE_1 : SFX_59_CHIMPY_NOISE_2 ), randf()*0.25 + 0.85, scaled_noise_volume); + func_8030E6A4(((random_noise < 0.5) ? SFX_58_CHIMPY_NOISE_1 : SFX_59_CHIMPY_NOISE_2), randf() * 0.25 + 0.85, scaled_noise_volume); } } } -void __chLMonkey_spawnJiggy(s32 x, s32 y, s32 z){ +void __chLMonkey_spawnJiggy(s32 x, s32 y, s32 z) { f32 sp1C[3]; TUPLE_ASSIGN(sp1C, x, y, z); jiggy_spawn(JIGGY_9_MM_CHIMPY, sp1C); } -void __chLMonkey_complete(ActorMarker *marker, enum asset_e arg1, s32 arg2){ - Actor * actor = marker_getActor(marker); +void __chLMonkey_complete(ActorMarker *marker, enum asset_e arg1, s32 arg2) { + Actor *actor = marker_getActor(marker); mapSpecificFlags_set(MM_SPECIFIC_FLAG_4_SHAKE, TRUE); subaddie_set_state(actor, 3); timed_setStaticCameraToNode(2.3f, 0x12); - timedFunc_set_3(2.9f,__chLMonkey_spawnJiggy, actor->position_x, actor->position_y + 150.0f, actor->position_z); + timedFunc_set_3(2.9f, __chLMonkey_spawnJiggy, actor->position_x, actor->position_y + 150.0f, actor->position_z); timed_exitStaticCamera(4.3f); func_80324E38(4.3f, 0); } @@ -81,28 +84,31 @@ void chLMonkey_update(Actor *this){ func_8028E668(this->position, 35.0f, 0.0f, 65.0f); actor_collisionOff(this); this->marker->propPtr->unk8_3 = 1; - if(map_get() != MAP_2_MM_MUMBOS_MOUNTAIN){ + if (map_get() != MAP_2_MM_MUMBOS_MOUNTAIN) { func_80343DEC(this); - }else{//L80388630 - if(func_80329530(this, 700) && !func_803114B0()){ + } + else {//L80388630 + if (func_80329530(this, 700) && !func_803114B0()) { __chLMonkey_playRandomNoise(this); }//L8038865C - switch(this->state){ + switch (this->state) { case 1://L80388690 if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_2_UNKNOWN)) { subaddie_set_state(this, 4); - if(!jiggyscore_isCollected(JIGGY_9_MM_CHIMPY)){ + if (!jiggyscore_isCollected(JIGGY_9_MM_CHIMPY)) { func_80311480(ASSET_B40_DIALOG_CHIMPY_COMPLETE, 0xE, this->position, this->marker, __chLMonkey_complete, NULL); - }else{//L803886E8 + } + else {//L803886E8 __chLMonkey_complete(this->marker, ASSET_B40_DIALOG_CHIMPY_COMPLETE, -1); }//L80388898 - }else{ + } + else { func_80388300(&this); - if( func_80329530(this, 345) + if (func_80329530(this, 345) && !func_80329530(this, 150) && !item_getCount(ITEM_19_ORANGE) && !this->is_first_encounter - ){ + ) { func_80311480(ASSET_B3F_DIALOG_CHIMPY_MEET, 0xe, this->position, NULL, NULL, NULL); this->is_first_encounter = TRUE; }//L80388774 @@ -113,8 +119,8 @@ void chLMonkey_update(Actor *this){ case 2: //L803887A4 func_80388300(&this); actor_playAnimationOnce(this); - if(actor_animationIsAt(this, 0.99f)){ - subaddie_set_state_with_direction(this,1,0.0f,-1); + if (actor_animationIsAt(this, 0.99f)) { + subaddie_set_state_with_direction(this, 1, 0.0f, -1); } break; case 4: //L803887E4 @@ -123,13 +129,13 @@ void chLMonkey_update(Actor *this){ case 3: //L803887F4 func_80343DEC(this); actor_loopAnimation(this); - if(0.19 <= this->unk48){ - mapSpecificFlags_set(MM_SPECIFIC_FLAG_0_UNKNOWN, TRUE); + if (0.19 <= this->unk48) { + mapSpecificFlags_set(MM_SPECIFIC_FLAG_0_CHIMPY_STUMP_RAISED, TRUE); } - if(0.24 <= this->unk48){ + if (0.24 <= this->unk48) { mapSpecificFlags_set(MM_SPECIFIC_FLAG_3_UNKNOWN, TRUE); } - if(0.99 <= this->unk48){ + if (0.99 <= this->unk48) { marker_despawn(this->marker); } break; diff --git a/src/MM/ch/orangepad.c b/src/MM/ch/orangepad.c index 24970234..5453d1e7 100644 --- a/src/MM/ch/orangepad.c +++ b/src/MM/ch/orangepad.c @@ -7,27 +7,25 @@ void func_80326224(Actor *); void func_80329904(ActorMarker *, s32, void *); extern void func_802EFA20(ParticleEmitter *, f32, f32); - /* public functions */ -void func_80386768(Actor *); +void chorangepad_update(Actor *); /* .data */ -ActorInfo chorangepadInfo = { MARKER_66_ORANGE_PAD, ACTOR_57_ORANGE_PAD, ASSET_2EB_MODEL_ORANGE_PAD, +ActorInfo chorangepadInfo = { + MARKER_66_ORANGE_PAD, ACTOR_57_ORANGE_PAD, ASSET_2EB_MODEL_ORANGE_PAD, 0, NULL, - func_80386768, func_80326224, actor_draw, + chorangepad_update, func_80326224, actor_draw, 0, 0, 0.0f, 0 }; /*.code */ -void MM_func_803863F0(s32 x, s32 y, s32 z){ +void __chorangepad_spawnJiggy(s32 x, s32 y, s32 z) { f32 pos[3]; - TUPLE_ASSIGN(pos, x, y, z); - jiggy_spawn(JIGGY_8_MM_ORANGE_PADS, pos); } -void func_80386444(ActorMarker *marker){ +void func_80386444(ActorMarker *marker) { f32 distance_to_orange_pad; Actor *closest_orange_pad; f32 position[3]; @@ -39,24 +37,24 @@ void func_80386444(ActorMarker *marker){ position[2] = marker->propPtr->z; closest_orange_pad = actorArray_findClosestActorFromActorId(position, ACTOR_57_ORANGE_PAD, 1, &distance_to_orange_pad); - - if(closest_orange_pad && !(500.0f < distance_to_orange_pad)){ + if (closest_orange_pad && !(500.0f < distance_to_orange_pad)) { closest_orange_pad->state = 1; - if(actorArray_findClosestActorFromActorId(position, ACTOR_57_ORANGE_PAD, 1, &distance_to_orange_pad)){ + if (actorArray_findClosestActorFromActorId(position, ACTOR_57_ORANGE_PAD, 1, &distance_to_orange_pad)) { func_8025A6EC(COMUSIC_2B_DING_B, 22000); - }else{ + } + else { temp_a0 = (closest_orange_pad->unk78_13 == 0x106) ? 0x10 : (closest_orange_pad->unk78_13 == 0x76) ? 0xf : 0xe; func_802BAFE4(temp_a0); position[1] += 50.0f; - timedFunc_set_3(0.6f, (GenFunction_3) MM_func_803863F0, (s32)position[0], (s32)position[1], (s32)position[2]); + timedFunc_set_3(0.6f, (GenFunction_3) __chorangepad_spawnJiggy, (s32) position[0], (s32) position[1], (s32) position[2]); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); - if(!jiggyscore_isCollected(JIGGY_8_MM_ORANGE_PADS)){ + if (!jiggyscore_isCollected(JIGGY_8_MM_ORANGE_PADS)) { func_80311480(0xB3B, 4, NULL, NULL, NULL, NULL); } }// L803865D8 @@ -67,21 +65,9 @@ void func_80386444(ActorMarker *marker){ particleEmitter_setModel(p_ctrl, 0x89f); particleEmitter_setStartingScaleRange(p_ctrl, 0.09f, 0.19f); particleEmitter_setFinalScaleRange(p_ctrl, 0.0f, 0.0f); - - particleEmitter_setParticleVelocityRange(p_ctrl, - -200.0f, 500.0f, -200.0f, - 200.0f, 700.0f, 200.0f - ); - - particleEmitter_setParticleAccelerationRange(p_ctrl, - 0.0f, -1200.0f, 0.0f, - 0.0f, -1200.0f, 0.0f - ); - - particleEmitter_setAngularVelocityRange(p_ctrl, - -600.0f, -600.0f, -600.0f, - 600.0f, 600.0f, 600.0f - ); + particleEmitter_setParticleVelocityRange(p_ctrl, -200.0f, 500.0f, -200.0f, 200.0f, 700.0f, 200.0f); + particleEmitter_setParticleAccelerationRange(p_ctrl, 0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f); + particleEmitter_setAngularVelocityRange(p_ctrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); particleEmitter_setSpawnIntervalRange(p_ctrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(p_ctrl, 4.0f, 4.0f); func_802EF9F8(p_ctrl, 0.01f); @@ -95,49 +81,50 @@ void func_80386744(s32 arg0, ActorMarker *arg1) { func_80386444(arg1); } -void func_80386768(Actor * this){ +void chorangepad_update(Actor *this) { Actor *closest_actor; f32 unused; f32 min_distance; - - if(!this->initialized){ + if (!this->initialized) { this->marker->propPtr->unk8_3 = 1; actor_collisionOff(this); this->initialized = TRUE; }//L803867B0 - if(!this->volatile_initialized){ - this->unk100 = actorArray_findClosestActorFromActorId(this->position, 8,-1, &min_distance)->marker; + if (!this->volatile_initialized) { + this->unk100 = actorArray_findClosestActorFromActorId(this->position, 8, -1, &min_distance)->marker; this->volatile_initialized = TRUE; }//L803867E0 - if(this->unk100){ + if (this->unk100) { closest_actor = marker_getActor(this->unk100); } - if( func_80329530(this, 0x28) - && !func_8028ECAC() - && !mapSpecificFlags_get(MM_SPECIFIC_FLAG_6_UNKNOWN) - && closest_actor->state != 3 - ){ + if (func_80329530(this, 0x28) && + !func_8028ECAC() && + !mapSpecificFlags_get(MM_SPECIFIC_FLAG_6_UNKNOWN) && + closest_actor->state != 3) { + if (func_80311480(0xb3d, 0, NULL, NULL, NULL, NULL)) { mapSpecificFlags_set(MM_SPECIFIC_FLAG_6_UNKNOWN, TRUE); } } - if(this->state == 1){ - if(this->lifetime_value < 72.0f){ + if (this->state == 1) { + if (this->lifetime_value < 72.0f) { func_8033E73C(this->marker, 5, func_80329904); func_8033E3F0(9, this->marker->unk14_21); } + this->lifetime_value = MIN(255.0, this->lifetime_value + 7.0); - if(255.0 == this->lifetime_value){ + if (255.0 == this->lifetime_value) { marker_despawn(this->marker); } - }else{ + } + else { }//L80386928 - actor_setOpacity(this, 0xFF - (s32)this->lifetime_value); + actor_setOpacity(this, 0xFF - (s32) this->lifetime_value); }//*/ From db8a2007996c86cbe6048803c74cadb312295675 Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 12:32:02 +0200 Subject: [PATCH 07/11] Renaming player_isDead function --- manual_syms.pal.txt | 2 +- src/FP/racectrl.c | 6 +++--- src/MM/ch/orange.c | 2 +- src/core1/code_CE60.c | 2 +- src/core2/ch/snacker.c | 2 +- src/core2/code_16010.c | 2 +- src/core2/code_5C870.c | 2 +- src/core2/code_7060.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manual_syms.pal.txt b/manual_syms.pal.txt index f50b8b46..4ad1b1c8 100644 --- a/manual_syms.pal.txt +++ b/manual_syms.pal.txt @@ -47,7 +47,7 @@ func_8028F170 = 0x8028ef90; ability_isUnlocked = 0x8028efb0; player_is_present = 0x8028eff4; func_8028F1E0 = 0x8028f000; -func_8028F22C = 0x8028f04c; +player_isDead = 0x8028f04c; func_8028F25C = 0x8028f07c; func_8028F428 = 0x8028f248; func_8028F55C = 0x8028f37c; diff --git a/src/FP/racectrl.c b/src/FP/racectrl.c index 96a6ac7b..8fa28dbc 100644 --- a/src/FP/racectrl.c +++ b/src/FP/racectrl.c @@ -525,7 +525,7 @@ void func_8038BC0C(s32 arg0){ break; FP_D_803935A8.unk1A = TRUE; FP_func_8038AB60(0); - if(!func_8028F22C()){ + if(!player_isDead()){ func_8028F918(2); func_80311480(0xc10, 0x20, NULL, NULL, func_8038B2C8, NULL); }//L8038BD40 @@ -533,7 +533,7 @@ void func_8038BC0C(s32 arg0){ break; case 3: - if(!FP_D_803935A8.unk19 && !func_8028F22C()){ + if(!FP_D_803935A8.unk19 && !player_isDead()){ FP_D_803935A8.unk19 = 1; func_80311480(0xc0f, 0x20, NULL, NULL, NULL, NULL); }//L8038BD94 @@ -541,7 +541,7 @@ void func_8038BC0C(s32 arg0){ break; case 2: - if(!FP_D_803935A8.unk18 && !func_8028F22C()){ + if(!FP_D_803935A8.unk18 && !player_isDead()){ FP_D_803935A8.unk18 = 1; func_80311480(0xc0e, 0x20, NULL, NULL, NULL, NULL); }//L8038BDF0 diff --git a/src/MM/ch/orange.c b/src/MM/ch/orange.c index 1cc9584a..a550b53e 100644 --- a/src/MM/ch/orange.c +++ b/src/MM/ch/orange.c @@ -28,7 +28,7 @@ f32 D_80389A00[3] = {0.0f, 0.0f, 0.0f}; /* .code */ void __chorange_collisionCallback(ActorMarker *marker, ActorMarker *other_marker) { - if (!func_8028F22C() && + if (!player_isDead() && !mapSpecificFlags_get(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE) && func_80311480(ASSET_B3A_TEXT_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL)) { diff --git a/src/core1/code_CE60.c b/src/core1/code_CE60.c index 22650c06..ac11456e 100644 --- a/src/core1/code_CE60.c +++ b/src/core1/code_CE60.c @@ -184,7 +184,7 @@ void func_8024AF48(void){ if(volatileFlag_get(VOLATILE_FLAG_1)) return; if(volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE)) return; if(func_802D686C()) return; - if(func_8028F22C()) return; + if(player_isDead()) return; if(gctransition_8030BDC0()) return; if(getGameMode() == GAME_MODE_A_SNS_PICTURE) return; diff --git a/src/core2/ch/snacker.c b/src/core2/ch/snacker.c index a46a26f2..a5d97e04 100644 --- a/src/core2/ch/snacker.c +++ b/src/core2/ch/snacker.c @@ -156,7 +156,7 @@ static void __chsnacker_ow(ActorMarker *marker, ActorMarker *other){ Actor *this; this = marker_getActor(marker); - if(level_get() == LEVEL_2_TREASURE_TROVE_COVE && !func_8028F22C()){ + if(level_get() == LEVEL_2_TREASURE_TROVE_COVE && !player_isDead()){ func_80311480(0xA29, 0, NULL, NULL, NULL, NULL); }//L802E10A4 diff --git a/src/core2/code_16010.c b/src/core2/code_16010.c index e4ecf392..6b2055eb 100644 --- a/src/core2/code_16010.c +++ b/src/core2/code_16010.c @@ -232,7 +232,7 @@ bool func_8029D7B4(void){ && func_8028EC04() < 1U && func_80297C6C() != 3 && bs_getState() != BS_3D_FALL_TUMBLING - && func_8028F22C() < 1U + && player_isDead() < 1U ; } return 0; diff --git a/src/core2/code_5C870.c b/src/core2/code_5C870.c index d9d9b8d5..37af0d91 100644 --- a/src/core2/code_5C870.c +++ b/src/core2/code_5C870.c @@ -541,7 +541,7 @@ bool func_802E4424(void) { && (level_get() != 0) && (0.6 < D_8037E8E0.unk10) && gcpausemenu_80314B00() - && !func_8028F22C() + && !player_isDead() && func_8032056C() && levelSpecificFlags_validateCRC1() && dummy_func_80320248() diff --git a/src/core2/code_7060.c b/src/core2/code_7060.c index 50fc292c..a5370311 100644 --- a/src/core2/code_7060.c +++ b/src/core2/code_7060.c @@ -631,7 +631,7 @@ bool func_8028F20C(void){ return player_isStable(); } -bool func_8028F22C(void){ +bool player_isDead(void){ if(bs_getState() == BS_41_DIE){ return TRUE; } From 6cf31d1df007af838d71bedadbc59af9ac369368 Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 12:32:04 +0200 Subject: [PATCH 08/11] Renaming gcdialog_showText function --- include/enums.h | 80 +++++++++++++++++++++++++++++--- include/functions.h | 2 +- manual_syms.pal.txt | 2 +- src/BGS/ch/code_2270.c | 24 +++++----- src/BGS/ch/croctus.c | 2 +- src/BGS/ch/frogminigame.c | 9 ++-- src/BGS/ch/tanktup.c | 6 +-- src/BGS/code_3420.c | 22 ++++----- src/CC/code_1F70.c | 2 +- src/CC/code_BF0.c | 4 +- src/CCW/ch/vacationtexttrigger.c | 2 +- src/CCW/code_14B0.c | 2 +- src/CCW/code_160.c | 6 +-- src/CCW/code_2270.c | 6 +-- src/CCW/code_3310.c | 8 ++-- src/CCW/code_3DA0.c | 2 +- src/CCW/code_4530.c | 2 +- src/CCW/code_4960.c | 2 +- src/CCW/code_4D00.c | 2 +- src/CCW/code_50D0.c | 2 +- src/CCW/code_5540.c | 6 +-- src/CCW/code_5BF0.c | 2 +- src/CCW/code_6620.c | 2 +- src/CCW/code_6AC0.c | 4 +- src/CCW/code_6EC0.c | 4 +- src/FP/ch/bearcub.c | 17 +++---- src/FP/ch/boggy1.c | 10 ++-- src/FP/ch/boggy2.c | 16 +++---- src/FP/ch/boggy3.c | 4 +- src/FP/ch/cavewozza.c | 4 +- src/FP/ch/twinkly.c | 4 +- src/FP/ch/twinklybox.c | 2 +- src/FP/ch/twinklymuncher.c | 4 +- src/FP/ch/wozza.c | 4 +- src/FP/ch/xmastree.c | 2 +- src/FP/racectrl.c | 6 +-- src/GV/ch/ancientone.c | 4 +- src/GV/ch/gobi1.c | 2 +- src/GV/ch/gobi2.c | 2 +- src/GV/ch/gobi3.c | 2 +- src/GV/ch/mazectrl.c | 6 +-- src/GV/ch/trunker.c | 2 +- src/GV/code_3630.c | 4 +- src/GV/code_5570.c | 6 +-- src/GV/code_7060.c | 4 +- src/MM/ch/conga.c | 8 ++-- src/MM/ch/jujuhitbox.c | 2 +- src/MM/ch/lmonkey.c | 4 +- src/MM/ch/orange.c | 2 +- src/MM/ch/orangepad.c | 4 +- src/MMM/ch/loggo.c | 6 +-- src/MMM/ch/napper.c | 2 +- src/MMM/code_3420.c | 10 ++-- src/MMM/code_47D0.c | 4 +- src/RBB/ch/bossboombox.c | 2 +- src/RBB/ch/dolphin.c | 2 +- src/SM/ch/attacktutorial.c | 43 ++++++++--------- src/SM/code_2990.c | 12 ++--- src/SM/code_4070.c | 10 ++-- src/TTC/ch/blubber.c | 11 +++-- src/TTC/ch/clam.c | 2 +- src/TTC/ch/leaky.c | 4 +- src/TTC/ch/lockup.c | 2 +- src/TTC/ch/nipper.c | 8 ++-- src/TTC/ch/treasurehunt.c | 6 +-- src/TTC/code_3E30.c | 6 +-- src/core2/abilityprogress.c | 38 ++++++++------- src/core2/ba/marker.c | 6 +-- src/core2/bs/jig.c | 2 +- src/core2/ch/beehive.c | 2 +- src/core2/ch/bottlesbonus.c | 6 +-- src/core2/ch/crab.c | 6 +-- src/core2/ch/gloop.c | 2 +- src/core2/ch/jinjo.c | 2 +- src/core2/ch/mole.c | 6 +-- src/core2/ch/snacker.c | 4 +- src/core2/ch/termite.c | 6 +-- src/core2/ch/trainers.c | 2 +- src/core2/ch/wadingboots.c | 2 +- src/core2/code_14420.c | 2 +- src/core2/code_47BD0.c | 2 +- src/core2/code_4A6F0.c | 30 ++++++------ src/core2/code_4C020.c | 4 +- src/core2/code_53A10.c | 2 +- src/core2/code_BEF20.c | 6 +-- src/core2/code_CF3E0.c | 4 +- src/core2/code_DA760.c | 4 +- src/core2/gc/dialog.c | 2 +- src/core2/snackerctl.c | 10 ++-- src/core2/timedfuncqueue.c | 4 +- src/fight/chfinalboss.c | 34 +++++++------- src/fight/chjinjonator.c | 2 +- src/fight/chspellfireball.c | 10 ++-- src/lair/ch/brentilda.c | 6 +-- src/lair/ch/cauldron.c | 8 ++-- src/lair/code_5ED0.c | 2 +- src/lair/code_86F0.c | 12 ++--- src/lair/code_9C40.c | 2 +- src/lair/code_C1C0.c | 6 +-- src/lair/code_C6C0.c | 2 +- 100 files changed, 386 insertions(+), 312 deletions(-) diff --git a/include/enums.h b/include/enums.h index f9b7a288..3c6078fc 100644 --- a/include/enums.h +++ b/include/enums.h @@ -3982,6 +3982,12 @@ enum asset_e ASSET_8A0_SPRITE_WATER_DROP = 0x8a0, + ASSET_A0B_TEXT_UNKNOWN = 0xA0B, + ASSET_A0C_TEXT_UNKNOWN = 0xA0C, + ASSET_A0D_TEXT_UNKNOWN = 0xA0D, + + ASSET_A14_TEXT_UNKNOWN = 0xA14, + ASSET_A17_TEXT_BURIED_TREASURE_SPAWNED = 0xa17, ASSET_A1F_DIALOG_SHOCKJUMP_LEARN = VER_SELECT(0xa1f, 0x91f, 0, 0), @@ -3995,6 +4001,8 @@ enum asset_e ASSET_A27_TEXT_BOTTLES_ALL_TTC_MOVES_LEARNED, ASSET_A28_TEXT_LEAKY_DONE, + ASSET_A2A_TEXT_UNKNOWN = 0xA2A, + ASSET_A6F_TEXT_CHARMER_MEET = 0xA6F, ASSET_A70_TEXT_CHARMER_HELPED, ASSET_A71_TEXT_TRUNKER_MEET, @@ -4045,20 +4053,46 @@ enum asset_e ASSET_B4A_DIALOG_TALON_TROT_REFRESHER, ASSET_B4B_DIALOG_EGGS_REFRESHER, ASSET_B4C_DIALOG_BEAKBUSTER_REFRESHER, + ASSET_B4D_TEXT_UNKNOWN, ASSET_B4E_TEXT_BOTTLES_ALL_MM_MOVES_LEARNED = 0xB4E, ASSET_B51_TEXT_BOTTLES_HOW_TO_EXIT_LEVEL = 0xb51, + ASSET_B9F_TEXT_UNKNOWN = 0xb9f, + + ASSET_BFF_TEXT_UNKNOWN = 0xbff, + + ASSET_C01_TEXT_UNKNOWN = 0xc01, + ASSET_C02_TEXT_UNKNOWN, + + ASSET_C05_TEXT_UNKNOWN = 0xc05, + + ASSET_C08_TEXT_UNKNOWN = 0xc08, + ASSET_C09_TEXT_UNKNOWN, + ASSET_C0A_TEXT_UNKNOWN, + ASSET_C15_TEXT_TWINKLIE_MINIGAME_LOST = 0xc15, + ASSET_C17_TEXT_UNKNOWN = 0xC17, + ASSET_C18_TEXT_UNKNOWN, + ASSET_C19_TEXT_UNKNOWN, + ASSET_C1A_TEXT_UNKNOWN, + + ASSET_C1E_TEXT_UNKNOWN = 0xc1e, + ASSET_C1F_TEXT_UNKNOWN, + ASSET_C20_DIALOG_PRESENT_COLLECTIBLE_MEET_BLUE = 0xC20, - ASSET_C21_DIALOG_PRESENT_COLLECTIBLE_MEET_GREEN = 0xC21, - ASSET_C22_DIALOG_PRESENT_COLLECTIBLE_MEET_RED = 0xC22, + ASSET_C21_DIALOG_PRESENT_COLLECTIBLE_MEET_GREEN, + ASSET_C22_DIALOG_PRESENT_COLLECTIBLE_MEET_RED, ASSET_C23_DIALOG_BEAKBOMB_LEARN, ASSET_C24_DIALOG_BEAKBOMB_REFRESHER, + ASSET_C26_TEXT_UNKNOWN = 0xc26, + ASSET_C27_TEXT_UNKNOWN, + ASSET_C2A_TEXT_BOTTLES_ALL_FP_GV_MOVES_LEARNED = 0xC2A, + ASSET_C2B_TEXT_UNKNOWN, ASSET_C63_TEXT_MR_VILE_INTRO = 0xC63, ASSET_C64_TEXT_MR_VILE_ROUND_1_START, @@ -4075,11 +4109,18 @@ enum asset_e ASSET_C6F_TEXT_MR_VILE_LOSE_ROUND_3_REMATCH, ASSET_C70_TEXT_MR_VILE_WIN_ROUND_2_REMATCH, ASSET_C71_TEXT_MR_VILE_WIN_ROUND_3_REMATCH, + ASSET_C72_TEXT_UNKNOWN, + + ASSET_C74_TEXT_UNKNOWN = 0xc74, + + ASSET_C76_TEXT_UNKNOWN = 0xc76, text_flibbits_meet = 0xc81, text_flibbits_defeat = 0xc82, text_flibbits_return = 0xc83, + ASSET_C86_TEXT_UNKNOWN = 0xc86, + ASSET_C88_DIALOG_LONGLEG_LEARN = 0xC88, ASSET_C89_DIALOG_LONGLEG_REFRESHER, ASSET_C8A_TEXT_BOTTLES_ALL_BGS_MOVES_LEARNED, @@ -4097,6 +4138,10 @@ enum asset_e ASSET_C97_TEXT_MR_VILE_LOSES_EXTRA_CHALLENGE_3, ASSET_C98_TEXT_MR_VILE_GIVES_PRIZE, + ASSET_CC7_TEXT_UNKNOWN = 0xcc7, + + ASSET_D2B_TEXT_UNKNOWN = 0xd2b, + ASSET_D32_DIALOG_MUTANT_CRAB_MEET = 0xD32, ASSET_D33_DIALOG_MUTANT_CRAB_DEFEAT, ASSET_D34_TEXT_GLOOP_MEET, @@ -4147,16 +4192,16 @@ enum asset_e ASSET_DFA_TEXT_BOTTLES_JUMP_REFRESHER = 0xDFA, ASSET_DFB_TEXT_BOTTLES_DIVE_LEARN, - - ASSET_DFD_TEXT_BOTTLES_SWIM_LEARN = 0xDFD, + ASSET_DFC_TEXT_UNKNOWN, + ASSET_DFD_TEXT_BOTTLES_SWIM_LEARN, ASSET_DFE_TEXT_BOTTLES_DIVE_REFRESHER, ASSET_DFF_TEXT_BOTTLES_CLAW_SWIPE_LEARN, ASSET_E00_TEXT_BOTTLES_ATTACK_REFRESHER = 0xE00, ASSET_E01_TEXT_BOTTLES_CLIMB_LEARN, - - ASSET_E03_TEXT_BOTTLES_CLIMB_REFRESHER = 0xE03, + ASSET_E02_TEXT_UNKNOWN, + ASSET_E03_TEXT_BOTTLES_CLIMB_REFRESHER, ASSET_E04_TEXT_BOTTLES_BEAK_BARGE_LEARN, - + ASSET_E05_TEXT_UNKNOWN, ASSET_E06_TEXT_BOTTLES_BEAK_BARGE_REFRESHER = 0xE06, ASSET_E08_TEXT_BOTTLES_FIND_ANOTHER_MOLEHILL = 0xE08, @@ -4171,15 +4216,25 @@ enum asset_e ASSET_E11_TEXT_BOTTLES_BRIDGE_STILL_BROKEN, ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES, + ASSET_E14_TEXT_UNKNOWN = 0xE14, + ASSET_E15_TEXT_UNKNOWN, + ASSET_E16_TEXT_UNKNOWN, + ASSET_E17_TEXT_UNKNOWN, + ASSET_E18_TEXT_UNKNOWN, + ASSET_E19_TEXT_UNKNOWN, + ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT = 0xE1D, ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER = VER_SELECT(0xE1F, 0xa61, 0, 0), ASSET_E20_DIALOG_BOTTLES_BONUS_NOT_READY, ASSET_E21_DIALOG_BOTTLES_BONUS_DISCOVERED, + ASSET_E24_TEXT_UNKNOWN = 0xE24, + ASSET_E35_DIALOG_BOTTLES_BONUS_REMINDER = VER_SELECT(0xE35, 0xa77, 0, 0), ASSET_E37_TEXT_BOTTLES_STOP_WASTING_TIME_AFTER_FURNACE_FUN = 0xE37, // Talk to bottles after beating furnace fun + ASSET_E38_TEXT_UNKNOWN, ASSET_E57_DIALOG_FIRST_JIGGY = VER_SELECT(0xF57, 0xabd, 0, 0), @@ -4191,7 +4246,18 @@ enum asset_e ASSET_F64_DIALOG_NOTEDOORS_LEARN = 0xf64, ASSET_F65_DIALOG_NOTEDOORS_REFRESHER, + ASSET_F79_TEXT_UNKNOWN = 0xf79, + ASSET_F7A_TEXT_UNKNOWN, + + ASSET_FAD_TEXT_UNKNOWN = 0xfad, + + ASSET_FBE_TEXT_UNKNOWN = 0xfbe, + ASSET_FBF_TEXT_UNKNOWN, + ASSET_10A1_DIALOG_BRENTILDA_MEET = 0x10A1, + ASSET_10A2_TEXT_UNKNOWN, + + ASSET_10E7_TEXT_UNKNOWN = 0x10E7, ASSET_146B_MODEL_TTC_TREASURE_TROVE_COVE_OPA = 0x146B, ASSET_146C_MODEL_TTC_TREASURE_TROVE_COVE_XLU, diff --git a/include/functions.h b/include/functions.h index bf0a12cf..72c2ca22 100644 --- a/include/functions.h +++ b/include/functions.h @@ -541,7 +541,7 @@ void __spawnQueue_add_1(GenFunction_1, s32); void func_802FAD64(enum item_e); void nodeprop_getPosition(NodeProp *, f32[3]); -bool func_80311480(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*callback)(ActorMarker *, enum asset_e, s32), void(*arg5)(ActorMarker *, enum asset_e, s32)); +bool gcdialog_showText(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*callback)(ActorMarker *, enum asset_e, s32), void(*arg5)(ActorMarker *, enum asset_e, s32)); void ability_unlock(enum ability_e); extern void func_802EE278(Actor *, s32, s32, s32, f32, f32); diff --git a/manual_syms.pal.txt b/manual_syms.pal.txt index 4ad1b1c8..2c843d43 100644 --- a/manual_syms.pal.txt +++ b/manual_syms.pal.txt @@ -214,7 +214,7 @@ func_8030ED70 = 0x8030ef10; func_8030E394 = 0x8030e534; func_803012F8 = 0x803014d8; fxairscore_count_to_time = 0x80301f5c; -func_80311480 = 0x803116cc; +gcdialog_showText = 0x803116cc; gcpausemenu_80314AC8 = 0x80314e1c; func_8031B908 = 0x8031bce8; diff --git a/src/BGS/ch/code_2270.c b/src/BGS/ch/code_2270.c index 5951cbc0..73c7a4d6 100644 --- a/src/BGS/ch/code_2270.c +++ b/src/BGS/ch/code_2270.c @@ -142,17 +142,19 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ if(this->state == 2){ skeletalAnim_set(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f); unqPtr->unkC = randf2(5.0f, 15.0f); - if(!this->is_first_encounter){ - this->is_first_encounter = TRUE; - if(unqPtr->unkA == 0){ - func_80311480(0xc72, 0xe, this->position, this->marker, func_80388784, 0); - }else{ - func_80311480(0xc74, 0xf, this->position, this->marker, func_80388784, 0); + if (!this->is_first_encounter) { + this->is_first_encounter = TRUE; + + if (unqPtr->unkA == 0) { + gcdialog_showText(ASSET_C72_TEXT_UNKNOWN, 0xe, this->position, this->marker, func_80388784, 0); + } + else { + gcdialog_showText(ASSET_C74_TEXT_UNKNOWN, 0xf, this->position, this->marker, func_80388784, 0); } } - else{ - func_80311480(D_80390854[unqPtr->unkA], 0xf, this->position, this->marker, func_80388784, 0); + else { + gcdialog_showText(D_80390854[unqPtr->unkA], 0xf, this->position, this->marker, func_80388784, 0); } } if(this->state == 3){ @@ -233,7 +235,7 @@ void func_80388E94(ActorMarker *this, s32 arg1){ thisActor = marker_getActor(this); unqPtr = (ActorLocal_BGS_2270 *)&thisActor->local; if((s32)unqPtr->unk0 >= (s32) vector_size(unqPtr->unk4)){ - if(!mapSpecificFlags_get(0) && func_80311480(0xc76, 0, 0, 0, 0, 0)) + if(!mapSpecificFlags_get(0) && gcdialog_showText(ASSET_C76_TEXT_UNKNOWN, 0, 0, 0, 0, 0)) mapSpecificFlags_set(0,1); }else{ tmp = (Struct_BGS_2270_0s *)vector_at(unqPtr->unk4, unqPtr->unk0); @@ -243,7 +245,7 @@ void func_80388E94(ActorMarker *this, s32 arg1){ else{ func_8028F55C(1, thisActor->marker); timedFunc_set_0(0.5f, BGS_func_80388760); - if(!mapSpecificFlags_get(1) && !volatileFlag_get(VOLATILE_FLAG_2_FF_IN_MINIGAME) && func_80311480(0xc75, 0, NULL, NULL, NULL, NULL)) + if(!mapSpecificFlags_get(1) && !volatileFlag_get(VOLATILE_FLAG_2_FF_IN_MINIGAME) && gcdialog_showText(0xc75, 0, NULL, NULL, NULL, NULL)) mapSpecificFlags_set(1,TRUE); } } @@ -340,7 +342,7 @@ void func_80389080(Actor *this){ if(this->state == 6){ if(ml_distance_vec3f(this->position, player_position) < 300.0f && !unqPtr->unk8){ unqPtr->unk8 = 1; - func_80311480(0xc7d, 4, 0, 0, 0, 0); + gcdialog_showText(0xc7d, 4, 0, 0, 0, 0); } } } diff --git a/src/BGS/ch/croctus.c b/src/BGS/ch/croctus.c index 114be9ca..350c93e5 100644 --- a/src/BGS/ch/croctus.c +++ b/src/BGS/ch/croctus.c @@ -143,7 +143,7 @@ void func_80387FD4(Actor *this){ func_8025A6EC(COMUSIC_2B_DING_B, 28000); //TODO ISSUE HERE if (this->unkF4_8 == 1) { func_8028F94C(2, this->position); - func_80311480(0xC86, 0xE, this->position, this->marker, func_80387E68, NULL); + gcdialog_showText(ASSET_C86_TEXT_UNKNOWN, 0xE, this->position, this->marker, func_80387E68, NULL); subaddie_set_state_with_direction(this, 6, 0.79f, 1); } else { timed_playSfx(0.4f, SFX_C9_PAUSEMENU_ENTER, 1.0f, 32000); //0.4f diff --git a/src/BGS/ch/frogminigame.c b/src/BGS/ch/frogminigame.c index 432ff6a1..dc292ab2 100644 --- a/src/BGS/ch/frogminigame.c +++ b/src/BGS/ch/frogminigame.c @@ -56,10 +56,10 @@ void chFrogMinigame_setState(Actor * arg0, u32 next_state){ mapSpecificFlags_set(0x10, 1); if(!fileProgressFlag_get(FILEPROG_1B_MET_YELLOW_FLIBBITS)){ fileProgressFlag_set(FILEPROG_1B_MET_YELLOW_FLIBBITS, 1); - func_80311480(text_flibbits_meet, 0xf, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0); + gcdialog_showText(text_flibbits_meet, 0xf, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0); }else{ if(!arg0->bgs_6730.unk8){ - func_80311480(text_flibbits_return, 0x4, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0); + gcdialog_showText(text_flibbits_return, 0x4, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0); } else{ __chFrogMinigame_textCallback(arg0->marker, text_flibbits_return, 0); @@ -92,9 +92,10 @@ void chFrogMinigame_setState(Actor * arg0, u32 next_state){ } } - if(next_state == 4){ - func_80311480(text_flibbits_defeat, 0xf, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0); + if (next_state == 4) { + gcdialog_showText(text_flibbits_defeat, 0xf, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0); } + if(next_state == 5){ func_80324E38(0.0f, 3); timed_setStaticCameraToNode(0.0f, 0x27); diff --git a/src/BGS/ch/tanktup.c b/src/BGS/ch/tanktup.c index c7682fed..84b1e5a5 100644 --- a/src/BGS/ch/tanktup.c +++ b/src/BGS/ch/tanktup.c @@ -142,7 +142,7 @@ void func_8038F6A4(Actor *this) { if ((((ml_distance_vec3f(local->unk18, sp48) < 250.0f) && (ml_distance_vec3f(local->unk18, sp48) > 80.0f)) && (!func_8028ECAC())) && (player_getTransformation() == TRANSFORM_1_BANJO)) { - func_80311480(0xC7E, 0, 0, 0, 0, 0); + gcdialog_showText(0xC7E, 0, 0, 0, 0, 0); this->is_first_encounter = TRUE; } } @@ -163,7 +163,7 @@ void func_8038F6A4(Actor *this) if ((!this->unk138_23) && (!local->unk14)) { - if (func_80311480(0xC80, 0, 0, 0, 0, 0)) + if (gcdialog_showText(0xC80, 0, 0, 0, 0, 0)) { this->unk138_23 = 1; } @@ -214,7 +214,7 @@ void func_8038F6A4(Actor *this) func_8028F918(0); if (jiggyscore_isCollected(JIGGY_26_BGS_TANKTUP) == 0) { - func_80311480(0xC7F, 0xF, this->position, this->marker, func_8038F5E4, 0); + gcdialog_showText(0xC7F, 0xF, this->position, this->marker, func_8038F5E4, 0); } else { diff --git a/src/BGS/code_3420.c b/src/BGS/code_3420.c index 8ac58faf..6da32e1d 100644 --- a/src/BGS/code_3420.c +++ b/src/BGS/code_3420.c @@ -226,7 +226,7 @@ void func_80389C58(ActorMarker *marker) { this = marker_getActor(marker); local = (ActorLocal_BGS_3420 *)&this->local; BGS_func_80389850(this, 0); - func_80311480(D_80390984[local->unkC], 0xF, chVile_getPostion(local->vile_marker), this->marker, func_80389BF8, NULL); + gcdialog_showText(D_80390984[local->unkC], 0xF, chVile_getPostion(local->vile_marker), this->marker, func_80389BF8, NULL); } void BGS_func_80389CD8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ @@ -246,9 +246,9 @@ void func_80389D20(ActorMarker *marker) { local = (ActorLocal_BGS_3420 *)&this->local; BGS_func_80389850(this, 0); if (local->unkC == local->unkD) { - func_80311480(D_803909A4[local->unkC], 0xF, chVile_getPostion(local->vile_marker), this->marker, BGS_func_80389CD8, NULL); + gcdialog_showText(D_803909A4[local->unkC], 0xF, chVile_getPostion(local->vile_marker), this->marker, BGS_func_80389CD8, NULL); } else { - func_80311480(D_803909C0[local->unkC], 0xF, chVile_getPostion(local->vile_marker), this->marker, BGS_func_80389CD8, NULL); + gcdialog_showText(D_803909C0[local->unkC], 0xF, chVile_getPostion(local->vile_marker), this->marker, BGS_func_80389CD8, NULL); } func_80347A14(0); } @@ -270,7 +270,7 @@ void func_80389E40(ActorMarker *marker) { local = (ActorLocal_BGS_3420 *)&this->local; BGS_func_80389850(this, 1); - func_80311480(0xC6B, 0xF, chVile_getPostion(local->vile_marker), this->marker, func_80389DF8, NULL); + gcdialog_showText(0xC6B, 0xF, chVile_getPostion(local->vile_marker), this->marker, func_80389DF8, NULL); } void func_80389EAC(ActorMarker *marker, enum asset_e text_id, s32 arg2){ @@ -310,7 +310,7 @@ void func_80389F08(ActorMarker *marker) { item_inc(ITEM_16_LIFE); } } - func_80311480(0xC98, 0xF, chVile_getPostion(local->vile_marker), this->marker, func_80389EAC, NULL); + gcdialog_showText(0xC98, 0xF, chVile_getPostion(local->vile_marker), this->marker, func_80389EAC, NULL); } @@ -332,22 +332,22 @@ void func_8038A068(Actor *this, s32 next_state) { func_8038C3B0(local->vile_marker); if (local->unkC == 3) { if (local->unkD >= 4) { - func_80311480(0xC91, 0xE, chVile_getPostion(local->vile_marker), this->marker, func_80389B48, NULL); + gcdialog_showText(0xC91, 0xE, chVile_getPostion(local->vile_marker), this->marker, func_80389B48, NULL); } else { - func_80311480((local->unkC == local->unkD) ? 0xC8D : 0xC90, 0xE, chVile_getPostion(local->vile_marker), this->marker, func_80389B48, NULL); + gcdialog_showText((local->unkC == local->unkD) ? 0xC8D : 0xC90, 0xE, chVile_getPostion(local->vile_marker), this->marker, func_80389B48, NULL); } } else { - func_80311480((local->unkC == local->unkD) ? 0xC63 : 0xC6C, 0xE, chVile_getPostion(local->vile_marker), this->marker, func_80389B48, NULL); + gcdialog_showText((local->unkC == local->unkD) ? 0xC63 : 0xC6C, 0xE, chVile_getPostion(local->vile_marker), this->marker, func_80389B48, NULL); } } if (next_state == 3) { - func_80311480(D_803909DC[local->unkC], 4, chVile_getPostion(local->vile_marker), this->marker, func_80389B98, NULL); + gcdialog_showText(D_803909DC[local->unkC], 4, chVile_getPostion(local->vile_marker), this->marker, func_80389B98, NULL); } if (next_state == 4) { if (local->unkC == local->unkD) { - func_80311480(BGS_D_803909F8[local->unkC], 0xE | ((BGS_D_803909F8[local->unkC] == 0xC8E) ? 1 : 0) | 0xE, chVile_getPostion(local->vile_marker), this->marker, func_80389BC8, NULL); + gcdialog_showText(BGS_D_803909F8[local->unkC], 0xE | ((BGS_D_803909F8[local->unkC] == 0xC8E) ? 1 : 0) | 0xE, chVile_getPostion(local->vile_marker), this->marker, func_80389BC8, NULL); } else { - func_80311480(D_80390A18[local->unkC], 0xF , chVile_getPostion(local->vile_marker), this->marker, func_80389BC8, NULL); + gcdialog_showText(D_80390A18[local->unkC], 0xF , chVile_getPostion(local->vile_marker), this->marker, func_80389BC8, NULL); } func_80347A14(0); } diff --git a/src/CC/code_1F70.c b/src/CC/code_1F70.c index 7c6f553d..e4a8e709 100644 --- a/src/CC/code_1F70.c +++ b/src/CC/code_1F70.c @@ -362,7 +362,7 @@ void CC_func_80388F4C(void){ if(D_80389FA0.unk20 && skeletalAnim_getAnimId(D_80389FA0.unk0) != ASSET_C4_ANIM_CLANKER_BITE){ skeletalAnim_set(D_80389FA0.unk0, ASSET_C4_ANIM_CLANKER_BITE, 1.0f, 10.0f); if(!D_80389FA0.unk48){ - func_80311480(0xd2b, 0xE, D_80389FA0.unk28, NULL, NULL, NULL); + gcdialog_showText(ASSET_D2B_TEXT_UNKNOWN, 0xE, D_80389FA0.unk28, NULL, NULL, NULL); D_80389FA0.unk48 = TRUE; } }//L8038918C diff --git a/src/CC/code_BF0.c b/src/CC/code_BF0.c index f823bd46..5ea52781 100644 --- a/src/CC/code_BF0.c +++ b/src/CC/code_BF0.c @@ -127,9 +127,7 @@ void func_803870F8(Actor *this){ else if(this->state == 2 && 1.0f <= local->unk8){ flagCnt = levelSpecificFlags_get(LEVEL_FLAG_0_CC_TOKEN_TOOTH_OPEN) + levelSpecificFlags_get(LEVEL_FLAG_1_CC_JIGGY_TOOTH_OPEN); if(!jiggyscore_isCollected(JIGGY_1B_CC_TOOTH)){ - func_80311480((local->unk0 == 1)? - ((flagCnt == 0)? 0xd30 : 0xd31) : - ((flagCnt == 0)? 0xd2e : 0xd2f), 4, NULL, NULL, NULL, NULL); + gcdialog_showText((local->unk0 == 1)? ((flagCnt == 0)? 0xd30 : 0xd31) : ((flagCnt == 0)? 0xd2e : 0xd2f), 4, NULL, NULL, NULL, NULL); } CC_func_80386FE0(this, 3); }//L80387474 diff --git a/src/CCW/ch/vacationtexttrigger.c b/src/CCW/ch/vacationtexttrigger.c index 16ad4dea..2cada924 100644 --- a/src/CCW/ch/vacationtexttrigger.c +++ b/src/CCW/ch/vacationtexttrigger.c @@ -37,7 +37,7 @@ void chVacationTextTrigger_update(Actor* this) { // Start dialog if player is within trigger if (__playerIsWithinTrigger(0, -107, 188) != 0) { - func_80311480(0xDA9, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xDA9, 4, NULL, NULL, NULL, NULL); volatileFlag_set(VOLATILE_FLAG_13_HAS_TRIGGERED_MUMBO_VACATION_TEXT, 1); } } diff --git a/src/CCW/code_14B0.c b/src/CCW/code_14B0.c index e0b6b204..c8fe17db 100644 --- a/src/CCW/code_14B0.c +++ b/src/CCW/code_14B0.c @@ -122,7 +122,7 @@ void CCW_func_80387A40(Actor *this) { player_getPosition(sp44); if (sp44[2] > -600.0f) { if (!local->unk4->unk3 || !jiggyscore_isCollected(local->unk4->unk3) ) { - func_80311480(local->unk4->unk4, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(local->unk4->unk4, 4, NULL, NULL, NULL, NULL); mapSpecificFlags_set(local->unk4->unk2, TRUE); } } diff --git a/src/CCW/code_160.c b/src/CCW/code_160.c index 7473bc64..90b317b0 100644 --- a/src/CCW/code_160.c +++ b/src/CCW/code_160.c @@ -45,9 +45,9 @@ void func_803865F4(Actor *this, s32 next_state) { local->unkC = 0.0f; if (next_state == 2) { if (!volatileFlag_getAndSet(VOLATILE_FLAG_B5, 1)) { - func_80311480(0xCE2, 4, NULL, this->marker, func_803865C4, NULL); + gcdialog_showText(0xCE2, 4, NULL, this->marker, func_803865C4, NULL); } else { - func_80311480(0xCE3, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCE3, 4, NULL, NULL, NULL, NULL); func_803865F4(this, 3); return; } @@ -65,7 +65,7 @@ void func_803865F4(Actor *this, s32 next_state) { volatileFlag_set(VOLATILE_FLAG_3, 0); volatileFlag_set(VOLATILE_FLAG_5_FF_MINIGAME_WON, 1); } else { - func_80311480(0xCE4, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCE4, 4, NULL, NULL, NULL, NULL); func_8025A58C(-1, 400); comusic_8025AB44(COMUSIC_4B_CCW_ZUBBA_FIGHT, 0, 400); func_8025AABC(COMUSIC_4B_CCW_ZUBBA_FIGHT); diff --git a/src/CCW/code_2270.c b/src/CCW/code_2270.c index e3213f0e..f17a802b 100644 --- a/src/CCW/code_2270.c +++ b/src/CCW/code_2270.c @@ -48,7 +48,7 @@ void CCW_func_8038868C(Actor *this, s32 next_state) { } if (next_state == 2) { if (local->unk0->unk4 != 0) { - func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); } skeletalAnim_set(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 3.0f); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); @@ -73,7 +73,7 @@ void CCW_func_8038868C(Actor *this, s32 next_state) { } if (next_state == 5) { if (local->unk0->unk6 != 0) { - func_80311480((s32) local->unk0->unk6, 4, NULL, NULL, NULL, NULL); + gcdialog_showText((s32) local->unk0->unk6, 4, NULL, NULL, NULL, NULL); } skeletalAnim_set(this->unk148, ASSET_FD_ANIM_GOBI2_GETTING_UP, 0.23f, 0.5f); timed_setStaticCameraToNode(0.0f, 3); @@ -163,7 +163,7 @@ void chGobiCCW_update(Actor *this) { player_getPosition(sp48); if (ml_distance_vec3f(this->position, sp48) < 600.0f) { if (local->unk0->unk2 != 0) { - func_80311480((s32) local->unk0->unk2, 4, NULL, NULL, NULL, NULL); + gcdialog_showText((s32) local->unk0->unk2, 4, NULL, NULL, NULL, NULL); } this->is_first_encounter = TRUE; } diff --git a/src/CCW/code_3310.c b/src/CCW/code_3310.c index 39b00f2e..cfa4d230 100644 --- a/src/CCW/code_3310.c +++ b/src/CCW/code_3310.c @@ -153,14 +153,14 @@ void func_803897B8(Actor *this, s32 next_state) { skeletalAnim_set(this->unk148, local->unk0->unk14, 0.5f, 8.5f); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); if (local->unk0->map_id == MAP_43_CCW_SPRING) { - func_80311480(0xCD6, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCD6, 4, NULL, NULL, NULL, NULL); skeletalAnim_setCallback_0(this->unk148, 0.65f, &func_80389798); } if (local->unk0->map_id == MAP_44_CCW_SUMMER) { - func_80311480(0xCD9, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCD9, 4, NULL, NULL, NULL, NULL); } if (local->unk0->map_id == MAP_45_CCW_AUTUMN) { - func_80311480(0xCDB, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCDB, 4, NULL, NULL, NULL, NULL); } local->unk8 = local->unk0->unk18; } @@ -274,7 +274,7 @@ void CCW_func_80389BFC(Actor *this) { if ((local->unk0->unkE != 0) && (carriedObj_getActorId() == ACTOR_2A2_CATERPILLAR) && (ml_distance_vec3f(this->position, sp4C) < 1010.0f) && (func_8028FC34() != 0)) { func_8028FA54(D_8038FDE0); if ((local->unk0->map_id == MAP_44_CCW_SUMMER) && (local->unk4 == 0)) { - func_80311480(0xCD8, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCD8, 4, NULL, NULL, NULL, NULL); } local->unk4++; if (local->unk4 < local->unk0->unk25) { diff --git a/src/CCW/code_3DA0.c b/src/CCW/code_3DA0.c index 1ad8d044..be0acaf1 100644 --- a/src/CCW/code_3DA0.c +++ b/src/CCW/code_3DA0.c @@ -153,7 +153,7 @@ void chcaterpillar_update(Actor *this){ if(ml_distance_vec3f(this->position, sp74) < 50.0f){ func_8028F030(ACTOR_2A2_CATERPILLAR); if(!volatileFlag_get(VOLATILE_FLAG_B2)){ - func_80311480(0xcc7, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_CC7_TEXT_UNKNOWN, 4, NULL, NULL, NULL, NULL); volatileFlag_set(VOLATILE_FLAG_B2, TRUE); } FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 25000, this->position, 0x1f4, 0x9c4); diff --git a/src/CCW/code_4530.c b/src/CCW/code_4530.c index c31a6686..07220be6 100644 --- a/src/CCW/code_4530.c +++ b/src/CCW/code_4530.c @@ -44,7 +44,7 @@ void func_8038A950(Actor *this, s32 next_state) { skeletalAnim_set(this->unk148, 0x199, 0.0f, 6.5f); } if (next_state == 2) { - func_80311480(0xCDC, 0xA, this->position, this->marker, func_8038A920, NULL); + gcdialog_showText(0xCDC, 0xA, this->position, this->marker, func_8038A920, NULL); } if (next_state == 3) { skeletalAnim_set(this->unk148, 0x19A, 0.0f, 7.0f); diff --git a/src/CCW/code_4960.c b/src/CCW/code_4960.c index 43e6328a..1d363dbc 100644 --- a/src/CCW/code_4960.c +++ b/src/CCW/code_4960.c @@ -28,7 +28,7 @@ Struct_CCW_4960_0 D_8038F254[] = { /* .code */ void func_8038AD50(Actor *this, s32 next_state) { if (next_state == 2) { - func_80311480(0xCDD, 0, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCDD, 0, NULL, NULL, NULL, NULL); if (this->state == 1) { mapSpecificFlags_set(6, 0); timed_setStaticCameraToNode(0.0f, 1); diff --git a/src/CCW/code_4D00.c b/src/CCW/code_4D00.c index 96d5b63b..a3961621 100644 --- a/src/CCW/code_4D00.c +++ b/src/CCW/code_4D00.c @@ -90,7 +90,7 @@ void func_8038B19C(Actor *this) { } if (!this->is_first_encounter && func_803292E0(this)) { this->is_first_encounter = TRUE; - func_80311480(0xCC8, 0, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCC8, 0, NULL, NULL, NULL, NULL); } func_8028E668(this->position, 300.0f, -50.0f, 120.0f); } diff --git a/src/CCW/code_50D0.c b/src/CCW/code_50D0.c index aa0b87ab..5a4c867f 100644 --- a/src/CCW/code_50D0.c +++ b/src/CCW/code_50D0.c @@ -92,7 +92,7 @@ void func_8038B87C(Actor *this) { } if (!this->is_first_encounter && func_803292E0(this)) { this->is_first_encounter = TRUE; - func_80311480(0xCC9, 0, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCC9, 0, NULL, NULL, NULL, NULL); } func_8028E668(this->position, 300.0f, -50.0f, 120.0f); } diff --git a/src/CCW/code_5540.c b/src/CCW/code_5540.c index a3f49cf4..5f011c3d 100644 --- a/src/CCW/code_5540.c +++ b/src/CCW/code_5540.c @@ -49,7 +49,7 @@ void chnabnut_setState(Actor *this, s32 next_state) { skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); func_80324E38(0.0f, 3); timed_setStaticCameraToNode(0.0f, 0xB); - func_80311480(0xCCC, 0x20, this->position, NULL, NULL, NULL); + gcdialog_showText(0xCCC, 0x20, this->position, NULL, NULL, NULL); } if (next_state == NABNUT_STATE_4_THANK_PLAYER) { @@ -135,7 +135,7 @@ void chnabnut_update(Actor *this) { player_getPosition(sp30); if (!this->is_first_encounter && (ml_distance_vec3f(this->position, sp30) < 400.0f)) { this->is_first_encounter = TRUE; - func_80311480(0xCCA, 0xE, this->position, NULL, NULL, NULL); + gcdialog_showText(0xCCA, 0xE, this->position, NULL, NULL, NULL); } if (item_getCount(ITEM_23_ACORNS) > 0) { func_80258A4C(this->position, this->yaw - 90.0f, sp30, &sp2C, &sp28, &sp24); @@ -149,7 +149,7 @@ void chnabnut_update(Actor *this) { if (local->returned_acorn_count == 6) { chnabnut_setState(this, NABNUT_STATE_2_WAIT); } else if (item_getCount(ITEM_23_ACORNS) == 1) { - func_80311480(0xCCB, 0x20, this->position, NULL, NULL, NULL); + gcdialog_showText(0xCCB, 0x20, this->position, NULL, NULL, NULL); } } } diff --git a/src/CCW/code_5BF0.c b/src/CCW/code_5BF0.c index 2218fb19..2988de7c 100644 --- a/src/CCW/code_5BF0.c +++ b/src/CCW/code_5BF0.c @@ -116,7 +116,7 @@ void func_8038C41C(Actor *this) { player_getPosition(sp2C); if (!this->is_first_encounter && (ml_distance_vec3f(this->position, sp2C) < 400.0f)) { this->is_first_encounter = TRUE; - func_80311480(0xCCD, 0, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCCD, 0, NULL, NULL, NULL, NULL); } } } diff --git a/src/CCW/code_6620.c b/src/CCW/code_6620.c index a83e8f46..fff4395c 100644 --- a/src/CCW/code_6620.c +++ b/src/CCW/code_6620.c @@ -117,7 +117,7 @@ void func_8038CC4C(Actor *this) { player_getPosition(sp38); if (ml_distance_vec3f(this->position, sp38) < 900.0f) { if (local->unk0->map_id != MAP_46_CCW_WINTER || func_8028F2FC()) { - func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); this->is_first_encounter = TRUE; } } diff --git a/src/CCW/code_6AC0.c b/src/CCW/code_6AC0.c index cda5e126..8a905765 100644 --- a/src/CCW/code_6AC0.c +++ b/src/CCW/code_6AC0.c @@ -61,7 +61,7 @@ void func_8038CEB0(Actor *this, s32 next_state) { this->marker->propPtr->unk8_3 = FALSE; skeletalAnim_set(this->unk148, 0x1A7, 0.2f, 3.0f); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); - func_80311480(0xCD0, 0x24, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCD0, 0x24, NULL, NULL, NULL, NULL); } if (next_state == 3) { skeletalAnim_set(this->unk148, 0x1A8, 0.2f, 0.5f); @@ -117,7 +117,7 @@ void func_8038CFB4(Actor *this) { if (!this->is_first_encounter) { player_getPosition(sp60); if (ml_distance_vec3f(this->position, sp60) < 900.0f) { - func_80311480(0xCCF, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xCCF, 4, NULL, NULL, NULL, NULL); this->is_first_encounter = TRUE; } } diff --git a/src/CCW/code_6EC0.c b/src/CCW/code_6EC0.c index 07af862c..7ec1b9aa 100644 --- a/src/CCW/code_6EC0.c +++ b/src/CCW/code_6EC0.c @@ -70,10 +70,10 @@ void func_8038D368(Actor *this) { player_getPosition(plyr_pos); if (ml_distance_vec3f(this->position, plyr_pos) < 600.0f) { if (!jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) { - func_80311480(local->unk0->unk2, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(local->unk0->unk2, 4, NULL, NULL, NULL, NULL); } else { if (local->unk0->unk4) { - func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); } } this->is_first_encounter = TRUE; diff --git a/src/FP/ch/bearcub.c b/src/FP/ch/bearcub.c index 8ab52e9c..e76131a8 100644 --- a/src/FP/ch/bearcub.c +++ b/src/FP/ch/bearcub.c @@ -116,9 +116,9 @@ void func_8038A384(Actor *this){ }//L8038A4E4 sp34 = levelSpecificFlags_get(0x11) + levelSpecificFlags_get(0x12) + levelSpecificFlags_get(0x13); - sp38 = (sp34 == 1) ? 0xC17 - : (sp34 == 2) ? 0xC18 - : 0xC19; + sp38 = (sp34 == 1) ? ASSET_C17_TEXT_UNKNOWN + : (sp34 == 2) ? ASSET_C18_TEXT_UNKNOWN + : ASSET_C19_TEXT_UNKNOWN; this->yaw_ideal = (f32)func_80329784(this); func_80328FB0(this, 2.0f); @@ -132,8 +132,9 @@ void func_8038A384(Actor *this){ && !jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3) && !jiggyscore_isSpawned(JIGGY_2C_FP_BOGGY_3) ){ - if(func_80311480(0xc1a, 0x2a, NULL, NULL, NULL, NULL)) + if (gcdialog_showText(ASSET_C1A_TEXT_UNKNOWN, 0x2a, NULL, NULL, NULL, NULL)) { levelSpecificFlags_set(0x19, TRUE); + } } } @@ -154,11 +155,11 @@ void func_8038A384(Actor *this){ } if(levelSpecificFlags_get(D_80391E80[sp3C].unk0)){ subaddie_set_state_with_direction(this, 2, 0.001f, 1); - if(sp38 == 0xc19){ - func_80311480(sp38, 0x2f, this->position, this->marker, func_8038A318, NULL); + if (sp38 == ASSET_C19_TEXT_UNKNOWN) { + gcdialog_showText(sp38, 0x2f, this->position, this->marker, func_8038A318, NULL); } - else{ - func_80311480(sp38, 0x3, this->position, this->marker, func_8038A318, NULL); + else { + gcdialog_showText(sp38, 0x3, this->position, this->marker, func_8038A318, NULL); } } else{//L8038A73C diff --git a/src/FP/ch/boggy1.c b/src/FP/ch/boggy1.c index 03e02cc8..d52a8d65 100644 --- a/src/FP/ch/boggy1.c +++ b/src/FP/ch/boggy1.c @@ -85,8 +85,8 @@ void func_803877A8(ActorMarker *caller, enum asset_e text_id, s32 arg2){ void func_80387828(ActorMarker *caller, enum asset_e text_id, s32 arg2){ Actor *this = marker_getActor(caller); - if(text_id == 0xc00){ - func_80311480(0xc2b, 0xf, NULL, this->marker, NULL, func_803877A8); + if (text_id == 0xc00) { + gcdialog_showText(ASSET_C2B_TEXT_UNKNOWN, 0xf, NULL, this->marker, NULL, func_803877A8); } } @@ -149,9 +149,9 @@ void func_8038794C(Actor *this){ if(!this->is_first_encounter && func_80329530(this, 0x1f4)){ if(!func_8028ECAC() || func_8028ECAC() == BSGROUP_8_TROT){ - if(func_80311480(0xbff, 0x2a, this->position, NULL, NULL, NULL)){ - for(i = 0; i <5; i++ ){ - timedFunc_set_1(D_80391BEC[i], (GenFunction_1)func_8038787C, (s32)this->marker); + if (gcdialog_showText(ASSET_BFF_TEXT_UNKNOWN, 0x2a, this->position, NULL, NULL, NULL)) { + for (i = 0; i < 5; i++) { + timedFunc_set_1(D_80391BEC[i], (GenFunction_1) func_8038787C, (s32) this->marker); } this->is_first_encounter = TRUE; } diff --git a/src/FP/ch/boggy2.c b/src/FP/ch/boggy2.c index 7bc6e623..eba59eee 100644 --- a/src/FP/ch/boggy2.c +++ b/src/FP/ch/boggy2.c @@ -124,10 +124,10 @@ void func_80388A50(Actor *this){ void func_80388A94(Actor *this){ func_80388A50(this); if(mapSpecificFlags_get(6)){ - func_80311480(0xc0a, 0xe, this->position, this->marker, func_80388D70, NULL); + gcdialog_showText(ASSET_C0A_TEXT_UNKNOWN, 0xe, this->position, this->marker, func_80388D70, NULL); } else{ - func_80311480(0xc09, 0xe, this->position, this->marker, func_80388D70, NULL); + gcdialog_showText(ASSET_C09_TEXT_UNKNOWN, 0xe, this->position, this->marker, func_80388D70, NULL); } } @@ -136,15 +136,15 @@ void func_80388B18(Actor *this, u8 arg1){ if(player_getTransformation() == TRANSFORM_4_WALRUS){ func_80388A50(this); if(mapSpecificFlags_get(5)){ - func_80311480(0xc05, 0xf, this->position, this->marker, func_80388D70, NULL); + gcdialog_showText(ASSET_C05_TEXT_UNKNOWN, 0xf, this->position, this->marker, func_80388D70, NULL); } else{ - func_80311480(0xc02, 0xf, this->position, this->marker, func_80388D70, NULL); + gcdialog_showText(ASSET_C02_TEXT_UNKNOWN, 0xf, this->position, this->marker, func_80388D70, NULL); } } else{//L80388BB8 if(!volatileFlag_get(VOLATILE_FLAG_B3)){ - if(func_80311480(0xc01, 0xe, this->position, this->marker, func_80388D70, NULL)){ + if(gcdialog_showText(ASSET_C01_TEXT_UNKNOWN, 0xe, this->position, this->marker, func_80388D70, NULL)){ volatileFlag_set(VOLATILE_FLAG_B3, TRUE); func_80388A50(this); } @@ -154,7 +154,7 @@ void func_80388B18(Actor *this, u8 arg1){ else{//L80388C08 if(player_getTransformation() == TRANSFORM_4_WALRUS){ if(!volatileFlag_get(VOLATILE_FLAG_B4)){ - if(func_80311480(0xc08, 0xe, this->position, this->marker, func_80388D70, NULL)){ + if(gcdialog_showText(ASSET_C08_TEXT_UNKNOWN, 0xe, this->position, this->marker, func_80388D70, NULL)){ volatileFlag_set(VOLATILE_FLAG_B4, TRUE); func_80388A50(this); } @@ -478,13 +478,13 @@ void func_803896FC(Actor *this){ && player_getTransformation() != TRANSFORM_4_WALRUS && volatileFlag_get(VOLATILE_FLAG_B3) ){ - func_80311480(0xC01, 0xf, this->position, this->marker, func_80388D70, NULL); + gcdialog_showText(ASSET_C01_TEXT_UNKNOWN, 0xf, this->position, this->marker, func_80388D70, NULL); } else if( local->unk19 == 2){ if( player_getTransformation() == TRANSFORM_4_WALRUS && volatileFlag_get(VOLATILE_FLAG_B4) ){ - func_80311480(0xC08, 0xf, this->position, this->marker, func_80388D70, NULL); + gcdialog_showText(ASSET_C08_TEXT_UNKNOWN, 0xf, this->position, this->marker, func_80388D70, NULL); } else if( player_getTransformation() != TRANSFORM_4_WALRUS){ func_80388A94(this); diff --git a/src/FP/ch/boggy3.c b/src/FP/ch/boggy3.c index df69d629..93308808 100644 --- a/src/FP/ch/boggy3.c +++ b/src/FP/ch/boggy3.c @@ -76,14 +76,14 @@ void func_80390388(Actor *this){ && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT) ){ if(0.0f == this->unk1C[0] && func_80390334()){ - if(func_80311480(0xc1f, 0xb, this->position, NULL, NULL, NULL)){ + if(gcdialog_showText(ASSET_C1F_TEXT_UNKNOWN, 0xb, this->position, NULL, NULL, NULL)){ this->is_first_encounter = TRUE; this->unk1C[0] = 1.0f; } } else{ if( !this->is_first_encounter ){ - if(func_80311480(0xc1e, 0x2b, this->position, NULL, NULL, NULL)){ + if(gcdialog_showText(ASSET_C1E_TEXT_UNKNOWN, 0x2b, this->position, NULL, NULL, NULL)){ this->is_first_encounter = TRUE; } } diff --git a/src/FP/ch/cavewozza.c b/src/FP/ch/cavewozza.c index 02cd2f09..627f30f4 100644 --- a/src/FP/ch/cavewozza.c +++ b/src/FP/ch/cavewozza.c @@ -69,14 +69,14 @@ void func_80390630(Actor *this){ if(func_80329530(this, 350)){ if(player_getTransformation() == TRANSFORM_4_WALRUS){ if(!levelSpecificFlags_get(0x31)){ - if(func_80311480(0xc27, 0x23, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(ASSET_C27_TEXT_UNKNOWN, 0x23, NULL, NULL, NULL, NULL)){ levelSpecificFlags_set(0x31, TRUE); } } } else{ if(!levelSpecificFlags_get(0x32)){ - if(func_80311480(0xc26, 0x23, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(ASSET_C26_TEXT_UNKNOWN, 0x23, NULL, NULL, NULL, NULL)){ levelSpecificFlags_set(0x32, TRUE); } } diff --git a/src/FP/ch/twinkly.c b/src/FP/ch/twinkly.c index be79c1a1..218c7bff 100644 --- a/src/FP/ch/twinkly.c +++ b/src/FP/ch/twinkly.c @@ -336,11 +336,11 @@ void func_8038C9A0(Actor *this){ if(this->unk1C[1] <= this->position_y){ this->position_y = this->unk1C[1]; if(!fileProgressFlag_get(FILEPROG_82_MET_TWINKLIES)){ - func_80311480(0xc12, 0x2a, this->position, this->marker, func_8038C94C, NULL); + gcdialog_showText(0xc12, 0x2a, this->position, this->marker, func_8038C94C, NULL); fileProgressFlag_set(FILEPROG_82_MET_TWINKLIES, TRUE); } else{ - func_80311480(0xc25, 0x2b, this->position, this->marker, func_8038C94C, NULL); + gcdialog_showText(0xc25, 0x2b, this->position, this->marker, func_8038C94C, NULL); } subaddie_set_state(this, 5); this->pitch -= 3.0f; diff --git a/src/FP/ch/twinklybox.c b/src/FP/ch/twinklybox.c index 4a97ea5f..332dd390 100644 --- a/src/FP/ch/twinklybox.c +++ b/src/FP/ch/twinklybox.c @@ -177,7 +177,7 @@ void func_8038D294(ActorMarker *marker){ func_8038D01C(this->position, 12, ASSET_700_SPRITE_DUST); this->velocity[1] = 0.0f; FUNC_8030E8B4(SFX_30_MAGIC_POOF, 1.0f, 32000, this->position, 1000, 3500); - func_80311480(0xc13, 0, NULL, NULL, NULL, NULL); + gcdialog_showText(0xc13, 0, NULL, NULL, NULL, NULL); } void func_8038D324(Actor *this){ diff --git a/src/FP/ch/twinklymuncher.c b/src/FP/ch/twinklymuncher.c index 80d80c7f..735d4444 100644 --- a/src/FP/ch/twinklymuncher.c +++ b/src/FP/ch/twinklymuncher.c @@ -127,7 +127,7 @@ void func_8038E094(Actor *this){ if(this->unkF4_8 == 1 && !fileProgressFlag_get(FILEPROG_13_COMPLETED_TWINKLIES_MINIGAME)){ if(this->state != 6 && this->state != 7 && 0.0f == this->velocity[0]){ timed_setStaticCameraToNode(0.5f, 0xd); - func_80311480(ASSET_C15_TEXT_TWINKLIE_MINIGAME_LOST, 0x2b, this->position, this->marker, func_8038E040, NULL); + gcdialog_showText(ASSET_C15_TEXT_TWINKLIE_MINIGAME_LOST, 0x2b, this->position, this->marker, func_8038E040, NULL); this->velocity[0] = 1.0f; subaddie_set_state_with_direction(this, 6, 0.03f, 1); actor_loopAnimation(this); @@ -201,7 +201,7 @@ void func_8038E094(Actor *this){ FUNC_8030E8B4(SFX_27_JINJO_HI, 1.6f, 32000, this->position, 1250, 2500); func_80324D54(0.35f, SFX_110_TWINKLY_DEATH, 1.0f, 32000, this->position, 1250.0f, 2500.0f); marker_despawn(sp38->marker); - if( !mapSpecificFlags_get(0xa) && func_80311480(0xc16, 0, NULL, NULL, NULL, NULL)){ + if( !mapSpecificFlags_get(0xa) && gcdialog_showText(0xc16, 0, NULL, NULL, NULL, NULL)){ mapSpecificFlags_set(0xa, TRUE); } } diff --git a/src/FP/ch/wozza.c b/src/FP/ch/wozza.c index 824d7b00..045710f8 100644 --- a/src/FP/ch/wozza.c +++ b/src/FP/ch/wozza.c @@ -273,7 +273,7 @@ void FP_func_8038F7AC(Actor *this){ func_8038F560(this); if(!local->unk30){ - if(func_80311480(0xc1d, 0x20, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(0xc1d, 0x20, NULL, NULL, NULL, NULL)){ local->unk30 = TRUE; } } @@ -300,7 +300,7 @@ void FP_func_8038F7AC(Actor *this){ } if(func_80329530(this, 500) && !this->is_first_encounter){ - if(func_80311480(0xc1c, 0xAA, this->position, this->marker, func_8038F330, func_8038F3C4)){ + if(gcdialog_showText(0xc1c, 0xAA, this->position, this->marker, func_8038F330, func_8038F3C4)){ timed_setStaticCameraToNode(0.0f, 0x2E); this->is_first_encounter = TRUE; } diff --git a/src/FP/ch/xmastree.c b/src/FP/ch/xmastree.c index bcbad51c..b18430d9 100644 --- a/src/FP/ch/xmastree.c +++ b/src/FP/ch/xmastree.c @@ -127,7 +127,7 @@ void chXmasTree_update(Actor *this){ this->lifetime_value = 2.0f; func_8025A6EC(COMUSIC_61_XMAS_TREE_LIGHTS_UP, 28000); func_802BAFE4(0x1A); - func_80311480(0xC14, 0, NULL, NULL, NULL, NULL); + gcdialog_showText(0xC14, 0, NULL, NULL, NULL, NULL); break; case 3: // L803872F0 diff --git a/src/FP/racectrl.c b/src/FP/racectrl.c index 8fa28dbc..1aa762aa 100644 --- a/src/FP/racectrl.c +++ b/src/FP/racectrl.c @@ -527,7 +527,7 @@ void func_8038BC0C(s32 arg0){ FP_func_8038AB60(0); if(!player_isDead()){ func_8028F918(2); - func_80311480(0xc10, 0x20, NULL, NULL, func_8038B2C8, NULL); + gcdialog_showText(0xc10, 0x20, NULL, NULL, func_8038B2C8, NULL); }//L8038BD40 FP_D_803935A8.unk0 = 4; break; @@ -535,7 +535,7 @@ void func_8038BC0C(s32 arg0){ case 3: if(!FP_D_803935A8.unk19 && !player_isDead()){ FP_D_803935A8.unk19 = 1; - func_80311480(0xc0f, 0x20, NULL, NULL, NULL, NULL); + gcdialog_showText(0xc0f, 0x20, NULL, NULL, NULL, NULL); }//L8038BD94 func_8025AEA0(0x3a, 0x411aa); break; @@ -543,7 +543,7 @@ void func_8038BC0C(s32 arg0){ case 2: if(!FP_D_803935A8.unk18 && !player_isDead()){ FP_D_803935A8.unk18 = 1; - func_80311480(0xc0e, 0x20, NULL, NULL, NULL, NULL); + gcdialog_showText(0xc0e, 0x20, NULL, NULL, NULL, NULL); }//L8038BDF0 func_8025AEA0(0x3a, 0x493e0); break; diff --git a/src/GV/ch/ancientone.c b/src/GV/ch/ancientone.c index 0a3e291f..826a550d 100644 --- a/src/GV/ch/ancientone.c +++ b/src/GV/ch/ancientone.c @@ -149,7 +149,7 @@ void chAncientOne_update(Actor *this){ mapSpecificFlags_set(sp38, TRUE); if(sp38== 0xB){ if(!jiggyscore_isCollected(JIGGY_46_GV_ANCIENT_ONES)){ - func_80311480(ASSET_A80_TEXT_ANICIENT_ONES_DONE, 0xE, NULL, this->marker, func_80386850, NULL); + gcdialog_showText(ASSET_A80_TEXT_ANICIENT_ONES_DONE, 0xE, NULL, this->marker, func_80386850, NULL); } else{ func_80386850(this->marker, 0xA80, -1); @@ -158,7 +158,7 @@ void chAncientOne_update(Actor *this){ else { if(sp38== 7){ if(!jiggyscore_isCollected(JIGGY_46_GV_ANCIENT_ONES)){ - func_80311480(ASSET_A7F_TEXT_ANICIENT_ONES_MEET, 0x4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_A7F_TEXT_ANICIENT_ONES_MEET, 0x4, NULL, NULL, NULL, NULL); } } diff --git a/src/GV/ch/gobi1.c b/src/GV/ch/gobi1.c index 891fe2d0..3479c443 100644 --- a/src/GV/ch/gobi1.c +++ b/src/GV/ch/gobi1.c @@ -180,7 +180,7 @@ void chGobi1_update(Actor *this){ && func_80329530(this, 250) && !func_80329530(this, 80) && func_8028F2A0() - && func_80311480(0xa73, 0, NULL, NULL, NULL, NULL) + && gcdialog_showText(0xa73, 0, NULL, NULL, NULL, NULL) ){ this->is_first_encounter = TRUE; } diff --git a/src/GV/ch/gobi2.c b/src/GV/ch/gobi2.c index c98c6638..5ca4ede1 100644 --- a/src/GV/ch/gobi2.c +++ b/src/GV/ch/gobi2.c @@ -203,7 +203,7 @@ void chGobi2_update(Actor *this){ if(!this->is_first_encounter){ if(func_80329530(this, 0xFA) && !func_80329530(this, 0x50)){ if(func_8028F2A0()){ - if(func_80311480(ASSET_A75_TEXT_GOBI2_MEET, 0, this->position, NULL, NULL, NULL)) + if(gcdialog_showText(ASSET_A75_TEXT_GOBI2_MEET, 0, this->position, NULL, NULL, NULL)) this->is_first_encounter = TRUE; } } diff --git a/src/GV/ch/gobi3.c b/src/GV/ch/gobi3.c index f3c55bb0..863cfd9e 100644 --- a/src/GV/ch/gobi3.c +++ b/src/GV/ch/gobi3.c @@ -72,7 +72,7 @@ void chGobi3_setState(Actor *this, s32 next_state){ if(next_state == 5){ skeletalAnim_set(this->unk148, 0xd9, 0.5f, 4.0f); - func_80311480(ASSET_A77_TEXT_GOBI3_DONE, 0xe, this->position, this->marker, __chGobi3_runaway, NULL); + gcdialog_showText(ASSET_A77_TEXT_GOBI3_DONE, 0xe, this->position, this->marker, __chGobi3_runaway, NULL); } if(next_state == 4){ diff --git a/src/GV/ch/mazectrl.c b/src/GV/ch/mazectrl.c index b4c46a36..1e9fa19b 100644 --- a/src/GV/ch/mazectrl.c +++ b/src/GV/ch/mazectrl.c @@ -84,7 +84,7 @@ void __chMazeCtrl_setState(Actor *this, s32 next_state){ timed_playSfx(1.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000); } if(!levelSpecificFlags_get(0x16)){ - func_80311480(ASSET_A82_TEXT_SANDYBUTT_START_MAZE, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_A82_TEXT_SANDYBUTT_START_MAZE, 4, NULL, NULL, NULL, NULL); levelSpecificFlags_set(0x16, TRUE); } }//L8038F794 @@ -134,7 +134,7 @@ void __chMazeCtrl_setState(Actor *this, s32 next_state){ func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff); if(!levelSpecificFlags_get(0x17)){ - func_80311480(ASSET_A83_TEXT_SANDYBUTT_DONE, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_A83_TEXT_SANDYBUTT_DONE, 4, NULL, NULL, NULL, NULL); levelSpecificFlags_set(0x17, TRUE); } } @@ -176,7 +176,7 @@ void chMazeCtrl_update(Actor *this){ } if( !levelSpecificFlags_get(0x15) && ml_timer_update(&local->unk8, sp34) - && func_80311480(ASSET_A81_TEXT_SANDYBUTT_ENTER, 0, NULL, NULL, NULL, NULL) + && gcdialog_showText(ASSET_A81_TEXT_SANDYBUTT_ENTER, 0, NULL, NULL, NULL, NULL) ){ levelSpecificFlags_set(0x15, TRUE); } diff --git a/src/GV/ch/trunker.c b/src/GV/ch/trunker.c index 8094676e..f77b7ad6 100644 --- a/src/GV/ch/trunker.c +++ b/src/GV/ch/trunker.c @@ -74,7 +74,7 @@ void chTrucker_update(Actor *this){ && !func_80329530(this, 80) && func_8028F2A0() ){ - func_80311480(ASSET_A71_TEXT_TRUNKER_MEET, 0xe, this->position, NULL, NULL, NULL); + gcdialog_showText(ASSET_A71_TEXT_TRUNKER_MEET, 0xe, this->position, NULL, NULL, NULL); this->is_first_encounter = TRUE; }//L80389254 diff --git a/src/GV/code_3630.c b/src/GV/code_3630.c index 96b47bb4..36c2e1bb 100644 --- a/src/GV/code_3630.c +++ b/src/GV/code_3630.c @@ -29,7 +29,7 @@ void func_80389A20(ActorMarker *caller, enum asset_e text_id, s32 arg2){ } void func_80389A60(Actor *this){ - func_80311480(ASSET_A70_TEXT_CHARMER_HELPED, 4, NULL, this->marker, func_80389A20, NULL); + gcdialog_showText(ASSET_A70_TEXT_CHARMER_HELPED, 4, NULL, this->marker, func_80389A20, NULL); this->is_first_encounter = TRUE; subaddie_set_state(this, 5); } @@ -63,7 +63,7 @@ void func_80389B1C(Actor *this){ if(this->state == 1 || this->state == 2){ if(! this->is_first_encounter && func_80329530(this, 250) && !func_80329530(this, 0x50)){ - func_80311480(ASSET_A6F_TEXT_CHARMER_MEET, 0xe, this->position, NULL, NULL, NULL); + gcdialog_showText(ASSET_A6F_TEXT_CHARMER_MEET, 0xe, this->position, NULL, NULL, NULL); this->is_first_encounter = TRUE; mapSpecificFlags_set(0, TRUE); } diff --git a/src/GV/code_5570.c b/src/GV/code_5570.c index 175b7799..64bd1dc5 100644 --- a/src/GV/code_5570.c +++ b/src/GV/code_5570.c @@ -63,7 +63,7 @@ void func_8038BA08(Actor *this){ if(func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS) player_stateTimer_set(STATE_TIMER_3_TURBO_TALON, 0.0f); - func_80311480(ASSET_A79_TEXT_GRABBA_DEFEAT, 0xf, this->position, this->marker, func_8038B988, NULL); + gcdialog_showText(ASSET_A79_TEXT_GRABBA_DEFEAT, 0xf, this->position, this->marker, func_8038B988, NULL); comusic_8025AB44(COMUSIC_57_TURBO_TRAINERS, 7000, 700); } @@ -245,7 +245,7 @@ void GV_func_8038BEA0(Actor *this){ } else{ if(!this->is_first_encounter){ - if(func_80311480(ASSET_A78_TEXT_GRABBA_MEET, 0, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(ASSET_A78_TEXT_GRABBA_MEET, 0, NULL, NULL, NULL, NULL)){ this->is_first_encounter = TRUE; } } @@ -276,7 +276,7 @@ void GV_func_8038BEA0(Actor *this){ } if(!this->unk138_23){ - if(func_80311480(ASSET_A7A_TEXT_GRABBA_TOO_FAST, 0, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(ASSET_A7A_TEXT_GRABBA_TOO_FAST, 0, NULL, NULL, NULL, NULL)){ this->unk138_23 = TRUE; } } diff --git a/src/GV/code_7060.c b/src/GV/code_7060.c index 9fb05f67..62affb7a 100644 --- a/src/GV/code_7060.c +++ b/src/GV/code_7060.c @@ -73,7 +73,7 @@ void func_8038D47C(Actor *this){ player_getPosition(sp3C); if(func_8028ECAC() == 0){ if( ml_distance_vec3f(sp3C, this->unk1C) < 100.0f || ml_distance_vec3f(sp3C, this->velocity) < 100.0f){ - if(func_80311480(ASSET_A7B_TEXT_JINXY_MEET, 0, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(ASSET_A7B_TEXT_JINXY_MEET, 0, NULL, NULL, NULL, NULL)){ mapSpecificFlags_set(0x14, 1); } } @@ -102,7 +102,7 @@ void func_8038D47C(Actor *this){ } if( actor_animationIsAt(this, 0.99f) ){ if(--this->unk38_31 == 0){ - func_80311480(ASSET_A7C_TEXT_JINXY_ONE_EGG, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_A7C_TEXT_JINXY_ONE_EGG, 4, NULL, NULL, NULL, NULL); mapSpecificFlags_set(0x14, TRUE); subaddie_set_state_forward(this, 1); } diff --git a/src/MM/ch/conga.c b/src/MM/ch/conga.c index fd6f7165..6d44e77a 100644 --- a/src/MM/ch/conga.c +++ b/src/MM/ch/conga.c @@ -140,7 +140,7 @@ void func_80387168(ActorMarker *marker, ActorMarker *other_marker){ ){ func_8038708C(actorPtr, 2); if(actorPtr->unk38_31 == 1){ - func_80311480(ASSET_B39_TEXT_CONGA_HIT_BY_EGG, 4, actorPtr->position, 0, 0, 0); + gcdialog_showText(ASSET_B39_TEXT_CONGA_HIT_BY_EGG, 4, actorPtr->position, 0, 0, 0); } } } @@ -249,14 +249,14 @@ void func_803876D0(Actor *this){ sp3C = func_80329530(this, 1000); if( func_8032A9E4(((ActorLocal_Conga *)&this->local)->unk10, ((ActorLocal_Conga *)&this->local)->unk18, ((ActorLocal_Conga *)&this->local)->unk1C) && !this->unk138_23 - && func_80311480(ASSET_B37_TEXT_CONGA_SAFE_UP_HERE, 0, 0, 0, 0, 0) + && gcdialog_showText(ASSET_B37_TEXT_CONGA_SAFE_UP_HERE, 0, 0, 0, 0, 0) ){ this->unk138_23 = 1; mapSpecificFlags_set(MM_SPECIFIC_FLAG_A_UNKNOWN, TRUE); }//L803878F8 if( sp3C && !this->is_first_encounter){ - if(func_80311480((player_getTransformation()== TRANSFORM_2_TERMITE) ? ASSET_B3E_TEXT_CONGA_MEET_AS_TERMITE : ASSET_B3C_TEXT_CONGA_MEET, 0, this->position, 0,0,0)){ + if(gcdialog_showText((player_getTransformation()== TRANSFORM_2_TERMITE) ? ASSET_B3E_TEXT_CONGA_MEET_AS_TERMITE : ASSET_B3C_TEXT_CONGA_MEET, 0, this->position, 0,0,0)){ this->is_first_encounter = TRUE; } } //L80387968 @@ -348,7 +348,7 @@ void func_803876D0(Actor *this){ actor_playAnimationOnce(this); if(actor_animationIsAt(this, 0.99f)){ subaddie_set_state_with_direction(this, 3, 0.0f, 1); - func_80311480(ASSET_B38_TEXT_CONGA_DEFEAT, 0xe, this->position, this->marker, func_80387370, NULL); + gcdialog_showText(ASSET_B38_TEXT_CONGA_DEFEAT, 0xe, this->position, this->marker, func_80387370, NULL); } break; diff --git a/src/MM/ch/jujuhitbox.c b/src/MM/ch/jujuhitbox.c index d03d3a83..d2490515 100644 --- a/src/MM/ch/jujuhitbox.c +++ b/src/MM/ch/jujuhitbox.c @@ -134,7 +134,7 @@ void func_80388E20(Actor *this){ && !func_8028ECAC() ){ if( !this->is_first_encounter ){ - if(func_80311480(ASSET_B44_TEXT_JUJU_MEET, 0, 0, 0, NULL, NULL)){ + if(gcdialog_showText(ASSET_B44_TEXT_JUJU_MEET, 0, 0, 0, NULL, NULL)){ this->is_first_encounter = TRUE; } } diff --git a/src/MM/ch/lmonkey.c b/src/MM/ch/lmonkey.c index fd1a583d..7a39d6e3 100644 --- a/src/MM/ch/lmonkey.c +++ b/src/MM/ch/lmonkey.c @@ -96,7 +96,7 @@ void chLMonkey_update(Actor *this){ if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_2_UNKNOWN)) { subaddie_set_state(this, 4); if (!jiggyscore_isCollected(JIGGY_9_MM_CHIMPY)) { - func_80311480(ASSET_B40_DIALOG_CHIMPY_COMPLETE, 0xE, this->position, this->marker, __chLMonkey_complete, NULL); + gcdialog_showText(ASSET_B40_DIALOG_CHIMPY_COMPLETE, 0xE, this->position, this->marker, __chLMonkey_complete, NULL); } else {//L803886E8 __chLMonkey_complete(this->marker, ASSET_B40_DIALOG_CHIMPY_COMPLETE, -1); @@ -109,7 +109,7 @@ void chLMonkey_update(Actor *this){ && !item_getCount(ITEM_19_ORANGE) && !this->is_first_encounter ) { - func_80311480(ASSET_B3F_DIALOG_CHIMPY_MEET, 0xe, this->position, NULL, NULL, NULL); + gcdialog_showText(ASSET_B3F_DIALOG_CHIMPY_MEET, 0xe, this->position, NULL, NULL, NULL); this->is_first_encounter = TRUE; }//L80388774 actor_loopAnimation(this); diff --git a/src/MM/ch/orange.c b/src/MM/ch/orange.c index a550b53e..62f54a49 100644 --- a/src/MM/ch/orange.c +++ b/src/MM/ch/orange.c @@ -30,7 +30,7 @@ f32 D_80389A00[3] = {0.0f, 0.0f, 0.0f}; void __chorange_collisionCallback(ActorMarker *marker, ActorMarker *other_marker) { if (!player_isDead() && !mapSpecificFlags_get(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE) && - func_80311480(ASSET_B3A_TEXT_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL)) { + gcdialog_showText(ASSET_B3A_TEXT_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL)) { mapSpecificFlags_set(MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE, TRUE); } diff --git a/src/MM/ch/orangepad.c b/src/MM/ch/orangepad.c index 5453d1e7..0943cac0 100644 --- a/src/MM/ch/orangepad.c +++ b/src/MM/ch/orangepad.c @@ -55,7 +55,7 @@ void func_80386444(ActorMarker *marker) { func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); if (!jiggyscore_isCollected(JIGGY_8_MM_ORANGE_PADS)) { - func_80311480(0xB3B, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xB3B, 4, NULL, NULL, NULL, NULL); } }// L803865D8 @@ -106,7 +106,7 @@ void chorangepad_update(Actor *this) { !mapSpecificFlags_get(MM_SPECIFIC_FLAG_6_UNKNOWN) && closest_actor->state != 3) { - if (func_80311480(0xb3d, 0, NULL, NULL, NULL, NULL)) { + if (gcdialog_showText(0xb3d, 0, NULL, NULL, NULL, NULL)) { mapSpecificFlags_set(MM_SPECIFIC_FLAG_6_UNKNOWN, TRUE); } } diff --git a/src/MMM/ch/loggo.c b/src/MMM/ch/loggo.c index f96c8d66..5d0809b8 100644 --- a/src/MMM/ch/loggo.c +++ b/src/MMM/ch/loggo.c @@ -36,7 +36,7 @@ void __chLoggo_textCallback(ActorMarker* caller, enum asset_e text_id, s32 arg3) void __chLoggo_collide(ActorMarker* this_marker, ActorMarker *other_marker) { Actor *this = marker_getActor(this_marker); if ((player_getTransformation() == TRANSFORM_3_PUMPKIN) && !fileProgressFlag_get(FILEPROG_89_ENTERED_LOGGO_AS_PUMPKIN)) { - if (func_80311480(ASSET_ADF_TEXT_ENTER_LOGGO, 0x2B, this->position, this->marker, &__chLoggo_textCallback, 0) != 0) { + if (gcdialog_showText(ASSET_ADF_TEXT_ENTER_LOGGO, 0x2B, this->position, this->marker, &__chLoggo_textCallback, 0) != 0) { actor_collisionOff(this); fileProgressFlag_set(FILEPROG_89_ENTERED_LOGGO_AS_PUMPKIN, TRUE); @@ -50,7 +50,7 @@ void __chLoggo_collide(ActorMarker* this_marker, ActorMarker *other_marker) { } if ((player_getTransformation() == TRANSFORM_1_BANJO) && !fileProgressFlag_get(FILEPROG_88_TRIED_LOGGO_AS_BEAR)){ - if(func_80311480(ASSET_ADE_TEXT_LOGGO_AS_BEAR, 0x2A, this->position, NULL, NULL, NULL)) { + if(gcdialog_showText(ASSET_ADE_TEXT_LOGGO_AS_BEAR, 0x2A, this->position, NULL, NULL, NULL)) { fileProgressFlag_set(FILEPROG_88_TRIED_LOGGO_AS_BEAR, TRUE); } } @@ -71,7 +71,7 @@ void chLoggo_update(Actor *this){ actor_loopAnimation(this); this->lifetime_value = 0.0f; if(!fileProgressFlag_get(FILEPROG_8A_EXITED_LOGGO) && levelSpecificFlags_get(0x33)){ - if(func_80311480(ASSET_AE0_TEXT_EXIT_LOGGO, 4, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(ASSET_AE0_TEXT_EXIT_LOGGO, 4, NULL, NULL, NULL, NULL)){ fileProgressFlag_set(FILEPROG_8A_EXITED_LOGGO, TRUE); } } diff --git a/src/MMM/ch/napper.c b/src/MMM/ch/napper.c index 78afd1b3..d2e8e042 100644 --- a/src/MMM/ch/napper.c +++ b/src/MMM/ch/napper.c @@ -63,7 +63,7 @@ void func_80386ACC(ActorMarker *this_marker, ActorMarker *other_marker){ Actor *this = marker_getActor(this_marker); if(!this->is_first_encounter){ - if(func_80311480(0xad8, 0, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(0xad8, 0, NULL, NULL, NULL, NULL)){ this->is_first_encounter = TRUE; } } diff --git a/src/MMM/code_3420.c b/src/MMM/code_3420.c index eea14df9..9abbb008 100644 --- a/src/MMM/code_3420.c +++ b/src/MMM/code_3420.c @@ -175,7 +175,7 @@ void func_803898EC() { } void func_80389910() { - func_80311480(0xAD5, 0xE, NULL, NULL, MMM_func_80389810, NULL); + gcdialog_showText(0xAD5, 0xE, NULL, NULL, MMM_func_80389810, NULL); timedFunc_set_2(0.0f, func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); timed_setStaticCameraToNode(2.0f, 0); timedFunc_set_0(2.1f, MMM_func_803898A0); @@ -195,10 +195,10 @@ void organMinigame_setState(s32 next_state){ if(next_state == 2){ if(D_8038C4F0.pattern == 0){ D_8038C4F0.pattern = 1; - func_80311480(0xad3, 4, NULL, NULL, MMM_func_80389810, NULL); + gcdialog_showText(0xad3, 4, NULL, NULL, MMM_func_80389810, NULL); } else{//L80389A84 - func_80311480(0xad6, 4, NULL, NULL, MMM_func_80389810, NULL); + gcdialog_showText(0xad6, 4, NULL, NULL, MMM_func_80389810, NULL); } }//L80389A9C @@ -215,13 +215,13 @@ void organMinigame_setState(s32 next_state){ }//L80389AF4 if(next_state == 4){ - func_80311480(0xadd, 4, NULL, NULL, MMM_func_80389810, NULL); + gcdialog_showText(0xadd, 4, NULL, NULL, MMM_func_80389810, NULL); func_80387720(D_8038C4F0.motzhand_marker); } if(next_state == 5){ D_8038C4F0.pattern++; - func_80311480(0xad4, 4, NULL, NULL, MMM_func_80389810, NULL); + gcdialog_showText(0xad4, 4, NULL, NULL, MMM_func_80389810, NULL); func_80387720(D_8038C4F0.motzhand_marker); } diff --git a/src/MMM/code_47D0.c b/src/MMM/code_47D0.c index 7e15054f..1a3595fd 100644 --- a/src/MMM/code_47D0.c +++ b/src/MMM/code_47D0.c @@ -104,7 +104,7 @@ void func_8038AF0C(ActorMarker *marker, enum asset_e text_id, s32 arg2) { } void func_8038AF3C(Struct_MMM_47D0_0 *arg0, s32 arg1) { - func_80311480(0xADB, 4, NULL, arg0->unk0, func_8038AF0C, NULL); + gcdialog_showText(0xADB, 4, NULL, arg0->unk0, func_8038AF0C, NULL); arg0->unk4 = 1; } @@ -178,7 +178,7 @@ void func_8038AF90(Struct_MMM_47D0_0 *arg0, Struct68s *arg1, f32 arg2) { player_getPosition(sp48); func_8035179C(arg1, sp54); if (!mapSpecificFlags_get(0) && (arg0->unk4 == 0) && (func_80258640(sp54, sp48) < 250.0f)){ - if(func_80311480(0xADA, 0, NULL, NULL, NULL, NULL)) { + if(gcdialog_showText(0xADA, 0, NULL, NULL, NULL, NULL)) { mapSpecificFlags_set(0, TRUE); } } diff --git a/src/RBB/ch/bossboombox.c b/src/RBB/ch/bossboombox.c index 8fea46b3..6635d601 100644 --- a/src/RBB/ch/bossboombox.c +++ b/src/RBB/ch/bossboombox.c @@ -367,7 +367,7 @@ void RBB_func_8038CC9C(Actor *this, s32 new_state){ } else{//L8038D220 timedFunc_set_3(0.0f, (GenFunction_3)chbossboombox_respawnJiggy, (s32)this->position_x, (s32)this->position_y, (s32)this->position_z); - func_80311480(0xb9f, 4, 0, 0, 0, 0); + gcdialog_showText(ASSET_B9F_TEXT_UNKNOWN, 4, 0, 0, 0, 0); } }//L8038D278 } diff --git a/src/RBB/ch/dolphin.c b/src/RBB/ch/dolphin.c index 454b6bba..369d4f93 100644 --- a/src/RBB/ch/dolphin.c +++ b/src/RBB/ch/dolphin.c @@ -89,7 +89,7 @@ void func_8038B900(Actor *this){ && func_80329530(this, 0x258) && !func_8028ECAC() ){ - func_80311480(0xb9b, 4, 0, 0, 0, 0); + gcdialog_showText(0xb9b, 4, 0, 0, 0, 0); this->is_first_encounter = TRUE; } } diff --git a/src/SM/ch/attacktutorial.c b/src/SM/ch/attacktutorial.c index d6f4b6a6..a2a1945a 100644 --- a/src/SM/ch/attacktutorial.c +++ b/src/SM/ch/attacktutorial.c @@ -73,10 +73,10 @@ void chAttackTutorial_setState(Actor * this, s32 arg1){ case 5: if(this->unk10_12 == 0){ ability_unlock(ABILITY_4_CLAW_SWIPE); - func_80311480(0xDFF, 0xE, this->unk1C, this->marker, func_80387288, func_80387258); + gcdialog_showText(ASSET_DFF_TEXT_BOTTLES_CLAW_SWIPE_LEARN, 0xE, this->unk1C, this->marker, func_80387288, func_80387258); } else{ - func_80311480((this->unk10_12 == 1) ? 0xe15 : 0xe17, 0xE, this->unk1C, this->marker, func_80387288, NULL); + gcdialog_showText((this->unk10_12 == 1) ? ASSET_E15_TEXT_UNKNOWN : ASSET_E17_TEXT_UNKNOWN, 0xE, this->unk1C, this->marker, func_80387288, NULL); } break; case 2://L803873E0 @@ -185,35 +185,36 @@ void func_80387764(ActorMarker * marker){ sp2C = 0xE; } - switch (actor->unk10_12) - { - case 0x1: //L803877D8 - sp34 = temp_a2 ? 0xe15 : 0xe14; //dialog enums - break; + switch (actor->unk10_12) { + case 0x1: //L803877D8 + sp34 = temp_a2 ? ASSET_E15_TEXT_UNKNOWN : ASSET_E14_TEXT_UNKNOWN; //dialog enums + break; - case 0x2: //L803877F4 - sp34 = temp_a2 ? 0xe17 : 0xe16; //dialog enums - break; + case 0x2: //L803877F4 + sp34 = temp_a2 ? ASSET_E17_TEXT_UNKNOWN : ASSET_E16_TEXT_UNKNOWN; //dialog enums + break; - case 3: //L80387810 - sp34 = temp_a2 ? 0xe19 : 0xe18; //dialog enums - break; - default: - //sp34 = actor->unk38_31; - break; + case 3: //L80387810 + sp34 = temp_a2 ? ASSET_E19_TEXT_UNKNOWN : ASSET_E18_TEXT_UNKNOWN; //dialog enums + break; + default: + //sp34 = actor->unk38_31; + break; }//L8038782C - if(sp34 == 0xe19){ + + if (sp34 == ASSET_E19_TEXT_UNKNOWN) { func_8028F94C(2, actor->unk1C); } //L80387848 - if(!mapSpecificFlags_get(3) && chmole_learnedAllSpiralMountainAbilities() && temp_a2){ + if (!mapSpecificFlags_get(3) && chmole_learnedAllSpiralMountainAbilities() && temp_a2) { mapSpecificFlags_set(3, 1); - sp34 = 0xE12; + sp34 = ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES; }//L80387898 - if(temp_a2){ + + if (temp_a2) { timed_setStaticCameraToNode(0.0f, 6); }//L803878B0 - func_80311480(sp34, sp2C, actor->unk1C, actor->marker, func_80387690, NULL); + gcdialog_showText(sp34, sp2C, actor->unk1C, actor->marker, func_80387690, NULL); actor->unk38_31++; } diff --git a/src/SM/code_2990.c b/src/SM/code_2990.c index 2987014b..7e4d8456 100644 --- a/src/SM/code_2990.c +++ b/src/SM/code_2990.c @@ -213,7 +213,7 @@ void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ actor = marker_getActor(marker); if(!mapSpecificFlags_get(3) && chmole_learnedAllSpiralMountainAbilities()){ mapSpecificFlags_set(3, 1); - func_80311480(ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES, 0xe, actor->position, actor->marker, func_803892C8, NULL); + gcdialog_showText(ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES, 0xe, actor->position, actor->marker, func_803892C8, NULL); }//L8038933C else{ if(!(text_id == ASSET_DF3_TEXT_BOTTLES_INTRODUCTION @@ -225,7 +225,7 @@ void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ case ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED: break; case ASSET_DF3_TEXT_BOTTLES_INTRODUCTION: /* 2FB8 803893A8 3C188039 */ - func_80311480(ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER, 0x8e, actor->position, actor->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions); + gcdialog_showText(ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER, 0x8e, actor->position, actor->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions); break; case ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER: /* 2FEC 803893DC 9209003B */ @@ -249,7 +249,7 @@ void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ default: if(actor->state != 5) - func_80311480(ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED, 4, NULL, NULL, NULL, NULL); func_80388FA0(actor, actor->state == 5 ? 1:4); break; @@ -363,7 +363,7 @@ void chsmmole_80389610(Actor * this){ break; }//L80389904 if(sp2C){ - func_80311480(sp2C, sp28, this->position, this->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions); + gcdialog_showText(sp2C, sp28, this->position, this->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions); } } @@ -567,13 +567,13 @@ void chsmmole_Update(Actor * this){ if( user_input != -1){ //button was pressed fileProgressFlag_set(FILEPROG_DB_SKIPPED_TUTORIAL, (user_input)?0:1); - func_80311480((user_input)? 0xe07 : 0xe09, 0xe, this->position, this->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions); + gcdialog_showText((user_input)? 0xe07 : 0xe09, 0xe, this->position, this->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions); if(!user_input){ chsmmole_skipIntroTutorial(); //give all SM moves } this->unk38_0 = 0; }else if(!this->is_first_encounter && 5.0 < this->lifetime_value){ - func_80311480(0xe1d, 0x86, this->position, this->marker, func_803892C8, NULL); + gcdialog_showText(0xe1d, 0x86, this->position, this->marker, func_803892C8, NULL); this->is_first_encounter = TRUE; } } diff --git a/src/SM/code_4070.c b/src/SM/code_4070.c index e81fe197..3794b1ae 100644 --- a/src/SM/code_4070.c +++ b/src/SM/code_4070.c @@ -43,7 +43,7 @@ void func_8038A4DC(Actor *this, s32 arg1){ }else{//L8038A560 func_8038A460(this); ability_unlock(ABILITY_A_HOLD_A_JUMP_HIGHER); - func_80311480(0xdf6, 0xe, this->unk1C, this->marker, func_8038A488, NULL); + gcdialog_showText(0xdf6, 0xe, this->unk1C, this->marker, func_8038A488, NULL); this->sm_4070.unk0 = 0xe1a; mapSpecificFlags_set(8, 0); } @@ -95,7 +95,7 @@ void SM_func_8038A5D8(Actor *this){ if(mapSpecificFlags_get(8)){ func_8038A460(this); ability_unlock(ABILITY_7_FEATHERY_FLAP); - func_80311480(0xdf7, 0xa, this->unk1C, this->marker, func_8038A488, NULL); + gcdialog_showText(0xdf7, 0xa, this->unk1C, this->marker, func_8038A488, NULL); this->sm_4070.unk0 = 0xe1b; mapSpecificFlags_set(8,0); }//L8038A730 @@ -103,7 +103,7 @@ void SM_func_8038A5D8(Actor *this){ if(mapSpecificFlags_get(9)){ func_8038A460(this); ability_unlock(ABILITY_8_FLAP_FLIP); - func_80311480(0xdf8, 0xa, this->unk1C, this->marker, func_8038A488, NULL); + gcdialog_showText(0xdf8, 0xa, this->unk1C, this->marker, func_8038A488, NULL); this->sm_4070.unk0 = 0xe1c; mapSpecificFlags_set(9,0); }//L8038A794 @@ -119,7 +119,7 @@ void SM_func_8038A5D8(Actor *this){ temp_a0 = 0xdf9; } - func_80311480(temp_a0, 0xe, this->unk1C, this->marker, func_8038A488, NULL); + gcdialog_showText(temp_a0, 0xe, this->unk1C, this->marker, func_8038A488, NULL); mapSpecificFlags_set(0xa,0); this->sm_4070.unk0 = 0; } @@ -133,7 +133,7 @@ void SM_func_8038A5D8(Actor *this){ && func_8028F20C() ){ if(this->sm_4070.unk0) - func_80311480(temp_a0 = this->sm_4070.unk0, 0, NULL, NULL, NULL, NULL); + gcdialog_showText(temp_a0 = this->sm_4070.unk0, 0, NULL, NULL, NULL, NULL); } break; diff --git a/src/TTC/ch/blubber.c b/src/TTC/ch/blubber.c index 1c9985a6..b2a79151 100644 --- a/src/TTC/ch/blubber.c +++ b/src/TTC/ch/blubber.c @@ -82,8 +82,8 @@ void func_803875D4(ActorMarker *marker){ this->actor_specific_1_f = 0.0f; if(!mapSpecificFlags_get(2)) { - text_id = jiggyscore_isCollected(JIGGY_14_TTC_BLUBBER) ? 0xa2a : 0xa0d; - func_80311480( text_id, 0xf, this->position, this->marker, func_80387520, func_80387574); + text_id = jiggyscore_isCollected(JIGGY_14_TTC_BLUBBER) ? ASSET_A2A_TEXT_UNKNOWN : ASSET_A0D_TEXT_UNKNOWN; + gcdialog_showText(text_id, 0xf, this->position, this->marker, func_80387520, func_80387574); mapSpecificFlags_set(2, TRUE); } } @@ -149,7 +149,7 @@ void func_803878CC(Actor * this){ && !this->is_first_encounter && item_getCount(ITEM_18_GOLD_BULLIONS) == 0 ){ - func_80311480(0xa0b, 0xe, this->position, this->marker, func_80387520, NULL); + gcdialog_showText(ASSET_A0B_TEXT_UNKNOWN, 0xe, this->position, this->marker, func_80387520, NULL); this->is_first_encounter = TRUE; subaddie_set_state_forward(this, 3); } @@ -157,8 +157,9 @@ void func_803878CC(Actor * this){ if( mapSpecificFlags_get(0) && !this->unk138_23 ){ - if(item_getCount(ITEM_18_GOLD_BULLIONS) == 0) - func_80311480(0xa0c, 4, NULL, NULL, NULL, NULL); + if (item_getCount(ITEM_18_GOLD_BULLIONS) == 0) { + gcdialog_showText(ASSET_A0C_TEXT_UNKNOWN, 4, NULL, NULL, NULL, NULL); + } this->unk138_23 = TRUE; this->is_first_encounter = TRUE; diff --git a/src/TTC/ch/clam.c b/src/TTC/ch/clam.c index 8cc23d61..4451cf9a 100644 --- a/src/TTC/ch/clam.c +++ b/src/TTC/ch/clam.c @@ -249,7 +249,7 @@ void __chClam_attackOther(ActorMarker *this_marker, ActorMarker *other_marker){ if(func_80297C6C() == 3) return; - if( !mapSpecificFlags_get(5) && func_80311480(0xA14, 0, NULL, NULL, NULL, NULL)){ + if( !mapSpecificFlags_get(5) && gcdialog_showText(ASSET_A14_TEXT_UNKNOWN, 0, NULL, NULL, NULL, NULL)){ mapSpecificFlags_set(5, TRUE); } diff --git a/src/TTC/ch/leaky.c b/src/TTC/ch/leaky.c index 2e11ff9c..59e95927 100644 --- a/src/TTC/ch/leaky.c +++ b/src/TTC/ch/leaky.c @@ -57,7 +57,7 @@ void chLeaky_update(Actor *this) { && !this->is_first_encounter && func_80329530(this, 250) && !func_80329530(this, 160) && !func_8028ECAC() - && func_80311480(0xA1A, 0, NULL, NULL, NULL, NULL) + && gcdialog_showText(0xA1A, 0, NULL, NULL, NULL, NULL) ){ this->is_first_encounter = TRUE; } @@ -111,6 +111,6 @@ bool chLeaky_eggCollision(ActorMarker *marker){ levelSpecificFlags_set(2, TRUE); levelSpecificFlags_set(5, TRUE); - func_80311480(ASSET_A28_TEXT_LEAKY_DONE, 0x2a, this->position, this->marker, __chLeaky_startCutscene, NULL); + gcdialog_showText(ASSET_A28_TEXT_LEAKY_DONE, 0x2a, this->position, this->marker, __chLeaky_startCutscene, NULL); return TRUE; } diff --git a/src/TTC/ch/lockup.c b/src/TTC/ch/lockup.c index a13732bf..1a663474 100644 --- a/src/TTC/ch/lockup.c +++ b/src/TTC/ch/lockup.c @@ -81,7 +81,7 @@ void func_80389600(Actor *this){ && func_80329530(this, 320) && !func_80329530(this, 160) && !func_8028ECAC() - && func_80311480(0xA15, 0, NULL, NULL, NULL, NULL) + && gcdialog_showText(0xA15, 0, NULL, NULL, NULL, NULL) ){ this->is_first_encounter = TRUE; }//L803896AC diff --git a/src/TTC/ch/nipper.c b/src/TTC/ch/nipper.c index 0a9e4679..7074f2ac 100644 --- a/src/TTC/ch/nipper.c +++ b/src/TTC/ch/nipper.c @@ -147,7 +147,7 @@ void func_80388178(ActorMarker *this_marker, ActorMarker *other_marker) { TTC_func_80387FF4(this); this->lifetime_value = 80.0f; - func_80311480(0xA10, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xA10, 4, NULL, NULL, NULL, NULL); return; } @@ -168,7 +168,7 @@ void func_80388344(ActorMarker * this_marker, ActorMarker *other_marker){ this = marker_getActor(this_marker); if( !mapSpecificFlags_get(7) && this->is_first_encounter - && func_80311480(0xa0f, 0, NULL, NULL, NULL, NULL) + && gcdialog_showText(0xa0f, 0, NULL, NULL, NULL, NULL) ){ mapSpecificFlags_set(7, TRUE); } @@ -179,7 +179,7 @@ void func_803883C8(ActorMarker * this_marker, ActorMarker *other_marker){ Actor *this = marker_getActor(this_marker); if( !this->unk138_23 && this->is_first_encounter - && func_80311480(0xa11, 0, NULL, NULL, NULL, NULL) + && gcdialog_showText(0xa11, 0, NULL, NULL, NULL, NULL) ){ this->unk138_23 = TRUE; } @@ -234,7 +234,7 @@ void func_80388434(Actor *this){ && temp_v0 != 10 ){ subaddie_set_state_with_direction(this, 5, 0.01f, 1); - if(func_80311480(0xa0e, 0xf, this->position, this->marker, TTC_func_80387FB0, NULL)){ + if(gcdialog_showText(0xa0e, 0xf, this->position, this->marker, TTC_func_80387FB0, NULL)){ this->is_first_encounter = TRUE; } comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 5000, 300); diff --git a/src/TTC/ch/treasurehunt.c b/src/TTC/ch/treasurehunt.c index f423908f..5c31d7b0 100644 --- a/src/TTC/ch/treasurehunt.c +++ b/src/TTC/ch/treasurehunt.c @@ -116,10 +116,10 @@ void func_80389A9C(void) { void func_80389B38(s32 arg0){ if(D_8037DCB4 == arg0 && TTC_func_803899C0()){ if(arg0 == 0 && !jiggyscore_isCollected(JIGGY_11_TTC_RED_X)){ - func_80311480(0xA18, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xA18, 4, NULL, NULL, NULL, NULL); } else if(arg0 == 4){ - func_80311480(0xA19, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xA19, 4, NULL, NULL, NULL, NULL); } D_8037DCB4++; @@ -170,7 +170,7 @@ void func_80389CC4(s16 arg0[3], s32 arg1){ gcpausemenu_80314AC8(0); timedFunc_set_2(0.1f, (GenFunction_2) func_8028F45C, 9, (s32)&D_8038D708); timedFunc_set_1(0.1f, (GenFunction_1) gcpausemenu_80314AC8, 1); - func_80311480(ASSET_A17_TEXT_BURIED_TREASURE_SPAWNED, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_A17_TEXT_BURIED_TREASURE_SPAWNED, 4, NULL, NULL, NULL, NULL); D_8037DCB4++; }//L80389E70 } diff --git a/src/TTC/code_3E30.c b/src/TTC/code_3E30.c index 3c1d910d..9267fca5 100644 --- a/src/TTC/code_3E30.c +++ b/src/TTC/code_3E30.c @@ -681,7 +681,7 @@ void __sandcastleCodes_eraseGameDialogCallback(ActorMarker *caller, enum asset_e if (confirmed == 1) { __sandcastleCodes_setNumberEntered(3); func_8038B800(D_8038CAD4); - func_80311480(0xFBF, 0xC, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_FBF_TEXT_UNKNOWN, 0xC, NULL, NULL, NULL, NULL); gameFile_clear(func_802C5A30()); gameFile_8033CFD4(func_802C5A30()); func_802C5A3C(-1); @@ -710,11 +710,11 @@ void TTC_func_8038BBA0(s32 secretCodeIndex) { __sandcastleCodes_setNumberEntered(2); func_8038B800(secretCodeIndex); func_8038B5B4(); - func_80311480(0xFBE, 0xC, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_FBE_TEXT_UNKNOWN, 0xC, NULL, NULL, NULL, NULL); return; case 2: D_8038CAD4 = secretCodeIndex; - func_80311480(0xE38, 0xC, NULL, NULL, __sandcastleCodes_eraseGameDialogCallback, NULL); + gcdialog_showText(ASSET_E38_TEXT_UNKNOWN, 0xC, NULL, NULL, __sandcastleCodes_eraseGameDialogCallback, NULL); return; } return; diff --git a/src/core2/abilityprogress.c b/src/core2/abilityprogress.c index 4d1634fc..b32c1547 100644 --- a/src/core2/abilityprogress.c +++ b/src/core2/abilityprogress.c @@ -30,45 +30,49 @@ void ability_use(s32 arg0){ break; case 0x3://L8029569C // if(map_get() == MAP_1_SM_SPIRAL_MOUNTAIN){ - sp2C = 0xDFC; + sp2C = ASSET_DFC_TEXT_UNKNOWN; } break; case 0x4://L802956B8 // if(map_get() == MAP_1_SM_SPIRAL_MOUNTAIN){ - sp2C = 0xE02; + sp2C = ASSET_E02_TEXT_UNKNOWN; } break; case 0x5://L802956D4 //barge if(map_get() == MAP_1_SM_SPIRAL_MOUNTAIN){ - sp2C = 0xE05; + sp2C = ASSET_E05_TEXT_UNKNOWN; } break; case 0x6://L802956F0 //slide sp28 = 0; - if(!ability_isUnlocked(ABILITY_10_TALON_TROT)){ - if(map_get() == MAP_2_MM_MUMBOS_MOUNTAIN){ - sp2C = 0xB4D; + if (!ability_isUnlocked(ABILITY_10_TALON_TROT)) { + if (map_get() == MAP_2_MM_MUMBOS_MOUNTAIN) { + sp2C = ASSET_B4D_TEXT_UNKNOWN; } - else + else { return; + } } - else{ + else { abilityprogress_usedAbilities |= (1 << arg0); } break; case 0x8://L80295738 //fly - sp2C = 0xA26; + sp2C = ASSET_A26_DIALOG_NEED_RED_FEATHERS_TO_FLY; break; case 0x7://L80295740 //egg case 0x9://L80295740 //shock break; }//L80295744 - if(sp28) + + if (sp28) { comusic_playTrack(COMUSIC_2B_DING_B); - - if(sp2C) - func_80311480(sp2C, 4, NULL, NULL, NULL, 0); - + } + + if (sp2C) { + gcdialog_showText(sp2C, 4, NULL, NULL, NULL, 0); + } + abilityprogress_usedAbilities |= (1 << arg0); } @@ -77,7 +81,7 @@ int ability_hasUsed(enum ability_e move){ } void ability_setHasUsed(enum ability_e move){ - abilityprogress_usedAbilities |= (1 << move); + abilityprogress_usedAbilities |= (1 << move); } int ability_hasLearned(enum ability_e move){ @@ -97,9 +101,9 @@ void ability_clearAll(void){ void ability_setLearned(s32 move, s32 val){ if(val){ - abilityprogress_learnedAbilities |= (1 << move); + abilityprogress_learnedAbilities |= (1 << move); }else{ - abilityprogress_learnedAbilities &= ~(1 << move); + abilityprogress_learnedAbilities &= ~(1 << move); } } diff --git a/src/core2/ba/marker.c b/src/core2/ba/marker.c index a3f7c6a6..7acacdc7 100644 --- a/src/core2/ba/marker.c +++ b/src/core2/ba/marker.c @@ -123,7 +123,7 @@ void __baMarker_8028B848(void){ if(player_getTransformation() == TRANSFORM_1_BANJO){ __baMarker_8028B7F4(); } - func_80311480(s0, 0x2A, NULL, NULL, NULL, 0); + gcdialog_showText(s0, 0x2A, NULL, NULL, NULL, 0); } } @@ -717,7 +717,7 @@ void __baMarker_resolveCollision(Prop *other_prop){ miscFlag_set(MISC_FLAG_2_ON_SPRING_PAD); }else{ if(!volatileFlag_getAndSet(VOLATILE_FLAG_C_HAS_SEEN_SPRING_PAD, 1)){ - func_80311480(ASSET_A24_DIALOG_JUMP_PAD_DISCOVERED, 4, 0, 0, 0, 0); + gcdialog_showText(ASSET_A24_DIALOG_JUMP_PAD_DISCOVERED, 4, 0, 0, 0, 0); } } break; @@ -729,7 +729,7 @@ void __baMarker_resolveCollision(Prop *other_prop){ miscFlag_set(MISC_FLAG_1_ON_FLIGHT_PAD); } else if(! volatileFlag_getAndSet(VOLATILE_FLAG_D_HAS_SEEN_FLIGHT_PAD, 1)){ - func_80311480(ASSET_A25_DIALOG_FLY_DISC_DISCOVERED, 4, 0, 0, 0, 0); + gcdialog_showText(ASSET_A25_DIALOG_FLY_DISC_DISCOVERED, 4, 0, 0, 0, 0); } break; diff --git a/src/core2/bs/jig.c b/src/core2/bs/jig.c index 21b0e5a8..8ea501b5 100644 --- a/src/core2/bs/jig.c +++ b/src/core2/bs/jig.c @@ -134,7 +134,7 @@ void bsjig_jiggy_end(void){ } }//L802B0E88 if(sp2C != 0){ - func_80311480(sp2C, sp28, 0, 0, 0, 0); + gcdialog_showText(sp2C, sp28, 0, 0, 0, 0); } }//L802B0EA4 func_80298A64(); diff --git a/src/core2/ch/beehive.c b/src/core2/ch/beehive.c index 74a80315..0ba25e1c 100644 --- a/src/core2/ch/beehive.c +++ b/src/core2/ch/beehive.c @@ -62,7 +62,7 @@ void chBeehive_update(Actor *this){ ){ if(func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT){ if( player_getTransformation() == TRANSFORM_1_BANJO - && func_80311480(ASSET_D96_DIALOG_BEEHIVE_MEET, 0, NULL, NULL, NULL, 0) + && gcdialog_showText(ASSET_D96_DIALOG_BEEHIVE_MEET, 0, NULL, NULL, NULL, 0) ){ fileProgressFlag_set(FILEPROG_D_BEEHIVE_TEXT, 1); } diff --git a/src/core2/ch/bottlesbonus.c b/src/core2/ch/bottlesbonus.c index 6e661681..3d5c7723 100644 --- a/src/core2/ch/bottlesbonus.c +++ b/src/core2/ch/bottlesbonus.c @@ -405,7 +405,7 @@ void chBottlesBonus_lose(u8 *arg0, enum asset_e text_id) { *arg0 = 1; timedFunc_set_0(2.0f, chBottlesBonusCursor_func_802DF99C); func_80311714(0); - func_80311480(text_id, 0x86, actor->position, chBottlesBonusMarker, chBottlesBonus_func_802DE224, NULL); + gcdialog_showText(text_id, 0x86, actor->position, chBottlesBonusMarker, chBottlesBonus_func_802DE224, NULL); func_80311714(1); } else{ @@ -424,7 +424,7 @@ void chBottlesBonus_completedPuzzle(void) { actor = marker_getActor(chBottlesBonusMarker); D_8037DCC0[chBottleBonusPuzzleIndex] = TRUE; func_80311714(0); - func_80311480(D_803681A0[chBottleBonusPuzzleIndex + 1].text_id, 0x86, actor->position, chBottlesBonusMarker, chBottlesBonus_IncrementPuzzle, NULL); + gcdialog_showText(D_803681A0[chBottleBonusPuzzleIndex + 1].text_id, 0x86, actor->position, chBottlesBonusMarker, chBottlesBonus_IncrementPuzzle, NULL); func_80311714(1); } @@ -521,7 +521,7 @@ void chBottlesBonus_update(Actor *this) { func_8025A7DC(COMUSIC_98_BBONUS_PIECES_SHUFFLE); if (D_8037DCC7 == 0) { func_80311714(0); - func_80311480(0xE24, 0x87, this->position, chBottlesBonusMarker, chBottlesBonus_startTimer, NULL); + gcdialog_showText(ASSET_E24_TEXT_UNKNOWN, 0x87, this->position, chBottlesBonusMarker, chBottlesBonus_startTimer, NULL); func_80311714(1); D_8037DCC7 = 1; } diff --git a/src/core2/ch/crab.c b/src/core2/ch/crab.c index c185f734..bd74921d 100644 --- a/src/core2/ch/crab.c +++ b/src/core2/ch/crab.c @@ -270,7 +270,7 @@ void chCrab_update(Actor *this) { && !func_8028ECAC() ) { if ((this->state != 6) && (this->state != 5)) { - func_80311480(ASSET_D32_DIALOG_MUTANT_CRAB_MEET, 0xF, this->position, NULL, __chCrab_mutantTextCallback, NULL); + gcdialog_showText(ASSET_D32_DIALOG_MUTANT_CRAB_MEET, 0xF, this->position, NULL, __chCrab_mutantTextCallback, NULL); mapSpecificFlags_set(0, TRUE); levelSpecificFlags_set(0xE, TRUE); this->is_first_encounter = TRUE; @@ -283,10 +283,10 @@ void chCrab_update(Actor *this) { && !jiggyscore_isCollected(JIGGY_10_TTC_SANDCASTLE) && func_80329530(this, 1600) ) { - func_80311480(0xA12, 4, this->position, NULL, NULL, NULL); + gcdialog_showText(0xA12, 4, this->position, NULL, NULL, NULL); mapSpecificFlags_set(0, TRUE); } else if (mapSpecificFlags_get(1)) { - func_80311480(0xA13, 4, this->position, NULL, NULL, NULL); + gcdialog_showText(0xA13, 4, this->position, NULL, NULL, NULL); mapSpecificFlags_set(1, FALSE); } } diff --git a/src/core2/ch/gloop.c b/src/core2/ch/gloop.c index cf460ecb..4e172498 100644 --- a/src/core2/ch/gloop.c +++ b/src/core2/ch/gloop.c @@ -60,7 +60,7 @@ void chgloop_update(Actor *this){ if( !mapSpecificFlags_get(2) && func_80329530(this, 350) - && func_80311480(ASSET_D34_TEXT_GLOOP_MEET, 0, NULL, NULL, NULL, NULL) + && gcdialog_showText(ASSET_D34_TEXT_GLOOP_MEET, 0, NULL, NULL, NULL, NULL) ){ mapSpecificFlags_set(2, TRUE); } diff --git a/src/core2/ch/jinjo.c b/src/core2/ch/jinjo.c index 45fc9eed..f8fef90a 100644 --- a/src/core2/ch/jinjo.c +++ b/src/core2/ch/jinjo.c @@ -46,7 +46,7 @@ void __chJinjo_802CDBA8(ActorMarker *this, ActorMarker *other){ if(actorPtr->state < 5){ if(!fileProgressFlag_get(FILEPROG_E_JINJO_TEXT)){ - func_80311480(__chJinjo_getMeetDialogId(actorPtr->marker->id), 4, 0, 0, 0, 0); + gcdialog_showText(__chJinjo_getMeetDialogId(actorPtr->marker->id), 4, 0, 0, 0, 0); fileProgressFlag_set(FILEPROG_E_JINJO_TEXT, 1); } subaddie_set_state_with_direction(actorPtr, 6, 0.0f , -1); diff --git a/src/core2/ch/mole.c b/src/core2/ch/mole.c index ebfaf1fd..8ccff89f 100644 --- a/src/core2/ch/mole.c +++ b/src/core2/ch/mole.c @@ -157,10 +157,10 @@ void chmole_healthRefill(ActorMarker *marker, enum asset_e arg1, s32 arg2){ if( arg1 == moleTable[actor->unkF4_8-9].learn_text && item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL) ){ - func_80311480(ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH, 7, 0, actor->marker, chmole_healthRefill, chmole_additionalAbilityLearnActions); + gcdialog_showText(ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH, 7, 0, actor->marker, chmole_healthRefill, chmole_additionalAbilityLearnActions); }//L802D9738 else if(arg1 == moleTable[actor->unkF4_8-9].learn_text || arg1 == ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH){ - func_80311480(chmole_learnedAllGameAbilities()? 0xa87 : chmole_learnedAllLevelAbilitiesDialog(), 7, 0, actor->marker, chmole_healthRefill, NULL); + gcdialog_showText(chmole_learnedAllGameAbilities()? 0xa87 : chmole_learnedAllLevelAbilitiesDialog(), 7, 0, actor->marker, chmole_healthRefill, NULL); } else{//L802D97BC if(actor->is_first_encounter){ @@ -242,7 +242,7 @@ int chmole_learnAbility(Actor *this){ break; } }//L802D9A9C - func_80311480(sp2C, sp28, this->position, this->marker, chmole_healthRefill, chmole_additionalAbilityLearnActions); + gcdialog_showText(sp2C, sp28, this->position, this->marker, chmole_healthRefill, chmole_additionalAbilityLearnActions); return TRUE; } diff --git a/src/core2/ch/snacker.c b/src/core2/ch/snacker.c index a5d97e04..1f8b9537 100644 --- a/src/core2/ch/snacker.c +++ b/src/core2/ch/snacker.c @@ -81,7 +81,7 @@ static void __chsnacker_start_dialog(Actor *this) { text_index = mapSpecificFlags_getN(8, 3); if( !this->is_first_encounter ) { if(text_index < 4) { - if(func_80311480(0xA1B + text_index, 0, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(0xA1B + text_index, 0, NULL, NULL, NULL, NULL)){ text_index++; mapSpecificFlags_setN(8, text_index, 3); this->is_first_encounter = TRUE; @@ -157,7 +157,7 @@ static void __chsnacker_ow(ActorMarker *marker, ActorMarker *other){ this = marker_getActor(marker); if(level_get() == LEVEL_2_TREASURE_TROVE_COVE && !player_isDead()){ - func_80311480(0xA29, 0, NULL, NULL, NULL, NULL); + gcdialog_showText(0xA29, 0, NULL, NULL, NULL, NULL); }//L802E10A4 if(this->state == 4){ diff --git a/src/core2/ch/termite.c b/src/core2/ch/termite.c index 0628766d..5ae10aed 100644 --- a/src/core2/ch/termite.c +++ b/src/core2/ch/termite.c @@ -170,7 +170,7 @@ void chTermite_update(Actor *this) { && func_8028ECAC() == 0 && player_getTransformation() == TRANSFORM_1_BANJO ) { - func_80311480(ASSET_B43_DIALOG_TERMITE_MEET_AS_BEAR, 7, this->position, this->marker, __chTermite_testCallback, NULL); + gcdialog_showText(ASSET_B43_DIALOG_TERMITE_MEET_AS_BEAR, 7, this->position, this->marker, __chTermite_testCallback, NULL); mapSpecificFlags_set(0, TRUE); levelSpecificFlags_set(0xD, TRUE); this->is_first_encounter = TRUE; @@ -182,11 +182,11 @@ void chTermite_update(Actor *this) { && player_getTransformation() == TRANSFORM_2_TERMITE ) { if (!levelSpecificFlags_get(0xB)) { - if (func_80311480(ASSET_B41_DIALOG_TERMITE_COOL_SHORTS, 0, NULL, NULL, NULL, NULL)) { + if (gcdialog_showText(ASSET_B41_DIALOG_TERMITE_COOL_SHORTS, 0, NULL, NULL, NULL, NULL)) { levelSpecificFlags_set(0xB, TRUE); this->unk138_23 = TRUE; } - } else if (!levelSpecificFlags_get(0xC) && !this->unk138_23 && (func_80311480(ASSET_B42_DIALOG_TERMITE_COOL_BACKPACK, 0, NULL, NULL, NULL, NULL))) { + } else if (!levelSpecificFlags_get(0xC) && !this->unk138_23 && (gcdialog_showText(ASSET_B42_DIALOG_TERMITE_COOL_BACKPACK, 0, NULL, NULL, NULL, NULL))) { levelSpecificFlags_set(0xC, TRUE); } } diff --git a/src/core2/ch/trainers.c b/src/core2/ch/trainers.c index df2d2cb1..91c950b0 100644 --- a/src/core2/ch/trainers.c +++ b/src/core2/ch/trainers.c @@ -81,7 +81,7 @@ void chtrainers_update(Actor *this){ && !volatileFlag_get(VOLATILE_FLAG_F_HAS_MEET_TURBO_SHOES) && player_getTransformation() == TRANSFORM_1_BANJO ){ - if(func_80311480(0xda4, 0, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(0xda4, 0, NULL, NULL, NULL, NULL)){ volatileFlag_set(VOLATILE_FLAG_F_HAS_MEET_TURBO_SHOES, TRUE); } }//L802CA620 diff --git a/src/core2/ch/wadingboots.c b/src/core2/ch/wadingboots.c index c3f2aec1..8e4a93ab 100644 --- a/src/core2/ch/wadingboots.c +++ b/src/core2/ch/wadingboots.c @@ -69,7 +69,7 @@ void chwadingboots_update(Actor *this){ if(!func_80329530(this, 250)) break; if(player_getTransformation() != TRANSFORM_1_BANJO) break; - if(func_80311480(ASSET_DA5_DIALOG_WADINGBOOTS_MEET, 0, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(ASSET_DA5_DIALOG_WADINGBOOTS_MEET, 0, NULL, NULL, NULL, NULL)){ volatileFlag_set(VOLATILE_FLAG_10_HAS_MEET_WADING_BOOTS, TRUE); } diff --git a/src/core2/code_14420.c b/src/core2/code_14420.c index 3461a6a8..6e607c4f 100644 --- a/src/core2/code_14420.c +++ b/src/core2/code_14420.c @@ -342,7 +342,7 @@ void func_8029B890(void){ func_8029B62C(); return; } - func_80311480(0xf81, 7, NULL, NULL, func_8029B85C, NULL); + gcdialog_showText(0xf81, 7, NULL, NULL, func_8029B85C, NULL); fileProgressFlag_set(FILEPROG_A8_HAS_DIED, TRUE); } else{ diff --git a/src/core2/code_47BD0.c b/src/core2/code_47BD0.c index c5086e53..5100954f 100644 --- a/src/core2/code_47BD0.c +++ b/src/core2/code_47BD0.c @@ -448,7 +448,7 @@ void chBeeSwarm_update(Actor *this) { if (!fileProgressFlag_get(FILEPROG_8F_MET_BEE_INFESTED_BEEHIVE) && subaddie_playerIsWithinCylinder(this, 250, 300) && ((func_8028ECAC() == 0) || (func_8028ECAC() == BSGROUP_8_TROT)) && (player_getTransformation() == TRANSFORM_1_BANJO) - && (func_80311480(0xDA6, 0, NULL, NULL, NULL, NULL) != 0) + && (gcdialog_showText(0xDA6, 0, NULL, NULL, NULL, NULL) != 0) ) { fileProgressFlag_set(FILEPROG_8F_MET_BEE_INFESTED_BEEHIVE, TRUE); } diff --git a/src/core2/code_4A6F0.c b/src/core2/code_4A6F0.c index 6298ab28..f76e583f 100644 --- a/src/core2/code_4A6F0.c +++ b/src/core2/code_4A6F0.c @@ -144,12 +144,12 @@ static void __chMumbo_textCallback(ActorMarker *caller, enum asset_e text_id, s3 this = marker_getActor(caller); switch(text_id){ case ASSET_D8F_DIALOG_MUMBO_MEET: //L802D1A04 - func_80311480((this->unk38_0) ? ASSET_DAA_DIALOG_MUMBO_HAS_ENOUGH_TOKENS : ASSET_DAB_DIALOG_MUMBO_NOT_ENOUGH_TOKENS, 0xe, this->position, this->marker, __chMumbo_textCallback, NULL); + gcdialog_showText((this->unk38_0) ? ASSET_DAA_DIALOG_MUMBO_HAS_ENOUGH_TOKENS : ASSET_DAB_DIALOG_MUMBO_NOT_ENOUGH_TOKENS, 0xe, this->position, this->marker, __chMumbo_textCallback, NULL); return; case ASSET_D90_DIALOG_MUMBO_MAGIC_PAID_FOR: //L802D1A40 fileProgressFlag_set(FILEPROG_12_HAS_TRANSFORMED_BEFORE, TRUE); - func_80311480(ASSET_D8F_DIALOG_MUMBO_MEET + D_8037DDF0, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_D8F_DIALOG_MUMBO_MEET + D_8037DDF0, 4, NULL, NULL, NULL, NULL); gcpausemenu_80314AC8(1); break; @@ -192,16 +192,16 @@ static void __chMumbo_textCallback(ActorMarker *caller, enum asset_e text_id, s3 void chMumbo_func_802D1B8C(Actor *this, enum transformation_e transform_id) { if (this->unk10_12 != 0) { - func_80311480(fileProgressFlag_getN(FILEPROG_BB_MUMBO_MISTAKE_INDEX, 2) + ASSET_DAF_DIALOG_MUMBO_TREX_MISTAKE, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); + gcdialog_showText(fileProgressFlag_getN(FILEPROG_BB_MUMBO_MISTAKE_INDEX, 2) + ASSET_DAF_DIALOG_MUMBO_TREX_MISTAKE, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); return; } if (fileProgressFlag_get(FILEPROG_12_HAS_TRANSFORMED_BEFORE)) { if (this->velocity[0] == 0.0f) { - func_80311480(transform_id + ASSET_D8F_DIALOG_MUMBO_MEET, 6, this->position, this->marker, __chMumbo_textCallback, NULL); + gcdialog_showText(transform_id + ASSET_D8F_DIALOG_MUMBO_MEET, 6, this->position, this->marker, __chMumbo_textCallback, NULL); return; } if (map_get() == MAP_7A_GL_CRYPT && transform_id == TRANSFORM_3_PUMPKIN && !fileProgressFlag_get(FILEPROG_F7_HAS_TRANSFORMED_IN_CRYPT)) { - func_80311480(ASSET_DAD_DIALOG_MUMBO_XFORM_IN_CRYPT, 6, this->position, this->marker, __chMumbo_textCallback, NULL); + gcdialog_showText(ASSET_DAD_DIALOG_MUMBO_XFORM_IN_CRYPT, 6, this->position, this->marker, __chMumbo_textCallback, NULL); fileProgressFlag_set(FILEPROG_F7_HAS_TRANSFORMED_IN_CRYPT, TRUE); return; } @@ -209,7 +209,7 @@ void chMumbo_func_802D1B8C(Actor *this, enum transformation_e transform_id) { subaddie_set_state(this, 4U); return; } - func_80311480(ASSET_D90_DIALOG_MUMBO_MAGIC_PAID_FOR, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); + gcdialog_showText(ASSET_D90_DIALOG_MUMBO_MAGIC_PAID_FOR, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); } void chMumbo_update(Actor *this) { @@ -282,7 +282,7 @@ void chMumbo_update(Actor *this) { && !volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE) ) { subaddie_set_state(this, 3); - func_80311480(ASSET_D8F_DIALOG_MUMBO_MEET, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); + gcdialog_showText(ASSET_D8F_DIALOG_MUMBO_MEET, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); fileProgressFlag_set(FILEPROG_11_HAS_MET_MUMBO, TRUE); break; } @@ -293,7 +293,7 @@ void chMumbo_update(Actor *this) { && this->unk38_0 ){ subaddie_set_state(this, 3); - func_80311480(ASSET_DAA_DIALOG_MUMBO_HAS_ENOUGH_TOKENS, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); + gcdialog_showText(ASSET_DAA_DIALOG_MUMBO_HAS_ENOUGH_TOKENS, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); fileProgressFlag_set(FILEPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE, TRUE); break; } @@ -331,7 +331,7 @@ void chMumbo_update(Actor *this) { && randf() < 0.01 && sp48 ) { - func_80311480(ASSET_DAE_DIALOG_MUMBO_TREX_START, 6, NULL, this->marker, __chMumbo_textCallback, NULL); + gcdialog_showText(ASSET_DAE_DIALOG_MUMBO_TREX_START, 6, NULL, this->marker, __chMumbo_textCallback, NULL); fileProgressFlag_set(FILEPROG_BA_HAS_SEEN_TREX_TEXT, 1); this->is_first_encounter = TRUE; subaddie_set_state(this, 3); @@ -360,7 +360,7 @@ void chMumbo_update(Actor *this) { break; } func_8025A6EC(COMUSIC_2C_BUZZER, 22000); - if ((levelSpecificFlags_get(0x3E) == 0) && (func_80311480(ASSET_DAC_DIALOG_MUMBO_FAIL_TO_BUY, 0, NULL, NULL, NULL, NULL) != 0)) { + if ((levelSpecificFlags_get(0x3E) == 0) && (gcdialog_showText(ASSET_DAC_DIALOG_MUMBO_FAIL_TO_BUY, 0, NULL, NULL, NULL, NULL) != 0)) { levelSpecificFlags_set(0x3E, 1); } } @@ -418,7 +418,7 @@ void chMumbo_update(Actor *this) { } if (this->is_first_encounter) { subaddie_set_state(this, 3); - func_80311480(ASSET_DAF_DIALOG_MUMBO_TREX_MISTAKE, 6, NULL, this->marker, __chMumbo_textCallback, NULL); + gcdialog_showText(ASSET_DAF_DIALOG_MUMBO_TREX_MISTAKE, 6, NULL, this->marker, __chMumbo_textCallback, NULL); break; } gcpausemenu_80314AC8(1); @@ -435,7 +435,7 @@ void chMumbo_update(Actor *this) { sp48 = chMumbo_withinHorzDistToPlayer(0, -0x6B, 0xBC); } if (sp48 != 0) { - func_80311480(ASSET_DA7_DIALOG_MUMBO_CCW_SUMMER, 7, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_DA7_DIALOG_MUMBO_CCW_SUMMER, 7, NULL, NULL, NULL, NULL); volatileFlag_set(FILEPROG_11_HAS_MET_MUMBO, TRUE); } } @@ -451,7 +451,7 @@ void chMumbo_update(Actor *this) { sp48 = chMumbo_withinHorzDistToPlayer(0, -0x6B, 0xBC); } if (sp48 != 0) { - func_80311480(ASSET_DA8_DIALOG_MUMBO_CCW_AUTUMN, 7, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_DA8_DIALOG_MUMBO_CCW_AUTUMN, 7, NULL, NULL, NULL, NULL); volatileFlag_set(FILEPROG_12_HAS_TRANSFORMED_BEFORE, TRUE); } } @@ -512,7 +512,7 @@ void chMumbo_detransformWarn(s32 this, s32 arg1){ if(D_8037DDF3) return; - func_80311480(fileProgressFlag_getAndSet(FILEPROG_83_MAGIC_GET_WEAK_TEXT, TRUE) ? ASSET_F5C_DIALOG_MUMBO_MAGIC_GET_WEAK_ABREV : ASSET_F5B_DIALOG_MUMBO_MAGIC_GET_WEAK_FULL, 0xe, NULL, NULL, NULL, NULL); + gcdialog_showText(fileProgressFlag_getAndSet(FILEPROG_83_MAGIC_GET_WEAK_TEXT, TRUE) ? ASSET_F5C_DIALOG_MUMBO_MAGIC_GET_WEAK_ABREV : ASSET_F5B_DIALOG_MUMBO_MAGIC_GET_WEAK_FULL, 0xe, NULL, NULL, NULL, NULL); } void chMumbo_detransformTrigger(s32 this, s32 arg1){ @@ -520,7 +520,7 @@ void chMumbo_detransformTrigger(s32 this, s32 arg1){ xform = player_getTransformation(); if(xform == TRANSFORM_1_BANJO || xform == TRANSFORM_7_WISHWASHY || D_8037DDF1) return; - func_80311480(fileProgressFlag_getAndSet(FILEPROG_84_MAGIC_ALL_GONE_TEXT, TRUE) ? ASSET_F5E_DIALOG_MUMBO_MAGIC_RUN_OUT_ABREV: ASSET_F5D_DIALOG_MUMBO_MAGIC_RUN_OUT_FULL, 0xe, NULL, NULL, NULL, NULL); + gcdialog_showText(fileProgressFlag_getAndSet(FILEPROG_84_MAGIC_ALL_GONE_TEXT, TRUE) ? ASSET_F5E_DIALOG_MUMBO_MAGIC_RUN_OUT_ABREV: ASSET_F5D_DIALOG_MUMBO_MAGIC_RUN_OUT_FULL, 0xe, NULL, NULL, NULL, NULL); D_8037DDF1++; func_8028FB88(TRANSFORM_1_BANJO); } diff --git a/src/core2/code_4C020.c b/src/core2/code_4C020.c index fdbb74d8..8d35e27b 100644 --- a/src/core2/code_4C020.c +++ b/src/core2/code_4C020.c @@ -1057,7 +1057,7 @@ void func_802D5628(void){ }//L802D5F1C if(volatileFlag_get(VOLATILE_FLAG_22)){ - if(func_80311480(0xF82, 4, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(0xF82, 4, NULL, NULL, NULL, NULL)){ fileProgressFlag_set(FILEPROG_C1_BADDIES_ESCAPE_TEXT, TRUE); volatileFlag_set(VOLATILE_FLAG_22, 0); D_8037DE04 = 0.0f; @@ -1067,7 +1067,7 @@ void func_802D5628(void){ } } else{//L802D5FCC - if(func_80311480(D_8037DE00, 0, NULL, NULL, NULL, NULL)){ + if(gcdialog_showText(D_8037DE00, 0, NULL, NULL, NULL, NULL)){ D_8037DE00++; if(!(D_8037DE00 < sp4C)){ D_8037DE00 = 0xF86; diff --git a/src/core2/code_53A10.c b/src/core2/code_53A10.c index 80535b34..c1a4cfc2 100644 --- a/src/core2/code_53A10.c +++ b/src/core2/code_53A10.c @@ -78,7 +78,7 @@ void func_802DAA14(Actor *this){ tmp = 0xf67; text_id = tmp; } - func_80311480(text_id, 4, NULL, this->marker, func_802DA9A0, NULL); + gcdialog_showText(text_id, 4, NULL, this->marker, func_802DA9A0, NULL); this->is_first_encounter = TRUE; } } diff --git a/src/core2/code_BEF20.c b/src/core2/code_BEF20.c index 8811349a..49149ff5 100644 --- a/src/core2/code_BEF20.c +++ b/src/core2/code_BEF20.c @@ -392,15 +392,15 @@ void func_80346DB4(s32 note_count) { if (D_80385FF0[level_id] < note_count) { D_80385FF0[level_id] = note_count; if ((level_get() == LEVEL_1_MUMBOS_MOUNTAIN) && (note_count == 50)) { - func_80311480(0xF74, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xF74, 4, NULL, NULL, NULL, NULL); } if (note_count == 100) { - func_80311480(0xF78, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xF78, 4, NULL, NULL, NULL, NULL); } if (note_count == 1) { levelSpecificFlags_set(0x34, TRUE); } - if (!levelSpecificFlags_get(0x34) && (func_80311480(0xF76, 0, NULL, NULL, NULL, NULL))) { + if (!levelSpecificFlags_get(0x34) && (gcdialog_showText(0xF76, 0, NULL, NULL, NULL, NULL))) { levelSpecificFlags_set(0x34, TRUE); } if (volatileFlag_get(VOLATILE_FLAG_17) == 0) { diff --git a/src/core2/code_CF3E0.c b/src/core2/code_CF3E0.c index 2a52de74..af97ebf8 100644 --- a/src/core2/code_CF3E0.c +++ b/src/core2/code_CF3E0.c @@ -83,7 +83,7 @@ s32 func_803563B8(enum file_progress_e progress_flag, s32 arg1) { } else { index = __findIndex(fileProgressDialogMap, progress_flag); if (index != -1) { - if (func_80311480(fileProgressDialogMap[index].value, arg1, 0, 0, 0, 0) != 0) { + if (gcdialog_showText(fileProgressDialogMap[index].value, arg1, 0, 0, 0, 0) != 0) { fileProgressFlag_set(progress_flag, 1); } return fileProgressFlag_get(progress_flag); @@ -109,7 +109,7 @@ s32 volatileFlag_setAndTriggerDialog(enum volatile_flags_e id, s32 arg1) { } else { index = __findIndex(gVolatileFlagDialogMap, id); if (index != -1) { - if (func_80311480(gVolatileFlagDialogMap[index].value, arg1, 0, 0, 0, 0) != 0) { + if (gcdialog_showText(gVolatileFlagDialogMap[index].value, arg1, 0, 0, 0, 0) != 0) { volatileFlag_set(id, 1); } return volatileFlag_get(id); diff --git a/src/core2/code_DA760.c b/src/core2/code_DA760.c index efa502f9..e2351fa4 100644 --- a/src/core2/code_DA760.c +++ b/src/core2/code_DA760.c @@ -49,7 +49,7 @@ void func_80361870(Actor *this){ if(!this->is_first_encounter && func_80329530(this, 400) && !func_80329530(this, 50)){ if(this->unkF4_8 == 1 && !fileProgressFlag_get(FILEPROG_31_MM_OPEN) && level_get() == LEVEL_6_LAIR){ text_id = fileProgressFlag_get(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT)? 0xF80 : 0xF7F; - if(func_80311480(text_id, 0, 0, 0, 0, 0)){ + if(gcdialog_showText(text_id, 0, 0, 0, 0, 0)){ this->is_first_encounter = TRUE; } } @@ -59,7 +59,7 @@ void func_80361870(Actor *this){ this->is_first_encounter = TRUE; } else{ - if(func_80311480(sp28, 0, 0, 0, 0, 0)){ + if(gcdialog_showText(sp28, 0, 0, 0, 0, 0)){ this->is_first_encounter = TRUE; volatileFlag_set(VOLATILE_FLAG_16, 0); } diff --git a/src/core2/gc/dialog.c b/src/core2/gc/dialog.c index be1f68e7..858888ea 100644 --- a/src/core2/gc/dialog.c +++ b/src/core2/gc/dialog.c @@ -942,7 +942,7 @@ int func_80311174(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*ca return 0; } -bool func_80311480(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*callback)(ActorMarker *, enum asset_e, s32), void(*arg5)(ActorMarker *, enum asset_e, s32)){ +bool gcdialog_showText(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*callback)(ActorMarker *, enum asset_e, s32), void(*arg5)(ActorMarker *, enum asset_e, s32)){ return func_80311174(text_id, arg1, pos, marker, callback, arg5, 0); } diff --git a/src/core2/snackerctl.c b/src/core2/snackerctl.c index c071b307..4fdcaf39 100644 --- a/src/core2/snackerctl.c +++ b/src/core2/snackerctl.c @@ -83,7 +83,7 @@ static SnackerCtlState _snackerctl_update_bottles_bonus(void){ return 0; if(func_8034BB48() && chBottlesBonus_getPuzzleIndex() != 7){ - func_80311480(SNACKER_BB_DIALOG_0 + (chBottlesBonus_getPuzzleIndex() << 1), 6, D_80363610, NULL, NULL, NULL); + gcdialog_showText(SNACKER_BB_DIALOG_0 + (chBottlesBonus_getPuzzleIndex() << 1), 6, D_80363610, NULL, NULL, NULL); } if(!func_8028F25C() && func_80321960() == 3) func_803219F4(1); @@ -93,12 +93,12 @@ static SnackerCtlState _snackerctl_update_bottles_bonus(void){ if(chBottlesBonus_getPuzzleIndex() == 6){ if(!D_8037DCCC){ func_8028F94C(4, &D_80363610); - func_80311480(SNACKER_BB_DIALOG_1, 0x6, D_80363610, NULL, func_8028A584, NULL); + gcdialog_showText(SNACKER_BB_DIALOG_1, 0x6, D_80363610, NULL, func_8028A584, NULL); } }//L8028A70C else if(chBottlesBonus_getPuzzleIndex() == 7){ func_8028F94C(4, &D_80363610); - func_80311480(ASSET_E35_DIALOG_BOTTLES_BONUS_REMINDER, 0x6, D_80363610, NULL, func_8028A558, NULL); + gcdialog_showText(ASSET_E35_DIALOG_BOTTLES_BONUS_REMINDER, 0x6, D_80363610, NULL, func_8028A558, NULL); D_8037DCCC = 1; }//L8028A764 else if(jiggyscore_isCollected(0x10)){ @@ -108,7 +108,7 @@ static SnackerCtlState _snackerctl_update_bottles_bonus(void){ ){ if(!D_8037DCCA){ func_8028F94C(4, &D_80363610); - func_80311480(ASSET_E21_DIALOG_BOTTLES_BONUS_DISCOVERED, 6, D_80363610, 0, func_8028A584, NULL); + gcdialog_showText(ASSET_E21_DIALOG_BOTTLES_BONUS_DISCOVERED, 6, D_80363610, 0, func_8028A584, NULL); D_8037DCCA = 1; }else{ func_8028A584(0,0,0); @@ -118,7 +118,7 @@ static SnackerCtlState _snackerctl_update_bottles_bonus(void){ else{ if(!D_8037DCCB){ func_8028F94C(4, &D_80363610); - func_80311480(ASSET_E20_DIALOG_BOTTLES_BONUS_NOT_READY, 6, D_80363610, 0, func_8028A558, NULL); + gcdialog_showText(ASSET_E20_DIALOG_BOTTLES_BONUS_NOT_READY, 6, D_80363610, 0, func_8028A558, NULL); D_8037DCCB = 1; } } diff --git a/src/core2/timedfuncqueue.c b/src/core2/timedfuncqueue.c index 419e1559..4a0a2970 100644 --- a/src/core2/timedfuncqueue.c +++ b/src/core2/timedfuncqueue.c @@ -127,10 +127,10 @@ void func_80324AA4(timefuncqueue_Struct2 *arg0){ void func_80324AEC(DelayedTextCallback *arg0) { if ((arg0->position[0] == 0.0f) && (arg0->position[1] == 0.0f) && (arg0->position[2] == 0.0f)) { - func_80311480(arg0->text_id, arg0->unk4, NULL, arg0->caller, arg0->callback_method_1, arg0->callback_method_2); + gcdialog_showText(arg0->text_id, arg0->unk4, NULL, arg0->caller, arg0->callback_method_1, arg0->callback_method_2); } else{ - func_80311480(arg0->text_id, arg0->unk4, arg0->position, arg0->caller, arg0->callback_method_1, arg0->callback_method_2); + gcdialog_showText(arg0->text_id, arg0->unk4, arg0->position, arg0->caller, arg0->callback_method_1, arg0->callback_method_2); } } diff --git a/src/fight/chfinalboss.c b/src/fight/chfinalboss.c index 68d6e1cb..9747ae8d 100644 --- a/src/fight/chfinalboss.c +++ b/src/fight/chfinalboss.c @@ -671,7 +671,7 @@ void chfinalboss_setPhase(ActorMarker *this, u32 phase_id) actor->unk1C_x = D_803927D0[(local->unk5)][0]; actor->unk1C_y = D_803927D0[(local->unk5)][1]; actor->unk1C_z = D_803927D0[(local->unk5)][2]; - func_80311480(randi2(0, 5) + 0x1106, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x1106, 4, NULL, NULL, NULL, NULL); return; @@ -841,7 +841,7 @@ void func_80388110(ActorMarker *marker, enum asset_e text_id, s32 arg2) { actor = marker_getActor(marker); actorLocal = (ActorLocal_fight_180 *)&actor->local; ncStaticCamera_exit(); - func_80311480(randi2(0, 5) + 0x1101, 4, NULL, actor->marker, func_803880E0, NULL); + gcdialog_showText(randi2(0, 5) + 0x1101, 4, NULL, actor->marker, func_803880E0, NULL); actorLocal->unk9 = (u8)1; } @@ -1247,8 +1247,8 @@ void chfinalboss_phase2_update(ActorMarker *marker) { case 20: if (actor_animationIsAt(this, 0.9999f)) { if (local->hits >= 4) { - func_80311480(randi2(0, 5) + 0x1115, 0x20, NULL, NULL, NULL, NULL); - func_80311480(randi2(0, 3) + 0x111A, 4, NULL, this->marker, NULL, chfinalboss_phase2_endTextCallback); + gcdialog_showText(randi2(0, 5) + 0x1115, 0x20, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 3) + 0x111A, 4, NULL, this->marker, NULL, chfinalboss_phase2_endTextCallback); chfinalboss_phase2_setState(this, 0x11); } else{ @@ -1353,7 +1353,7 @@ void chfinalboss_phase3_setState(Actor *this, s32 arg1) { case 26: fight_func_80386CF8(this); func_80324E38(0.0f, 1); - func_80311480(randi2(0, 5) + 0x112C, 0xA8, NULL, this->marker, chfinalboss_phase3_endTextCallback, NULL); + gcdialog_showText(randi2(0, 5) + 0x112C, 0xA8, NULL, this->marker, chfinalboss_phase3_endTextCallback, NULL); break; } } @@ -1494,7 +1494,7 @@ void chfinalboss_phase4_setState(Actor *this, s32 arg1) { if ((local->unk3 == 2) && (local->unkA == 0)) { iter.D_803928C4_ptr = &D_803928C4; D_803927C8 = 1; - func_80311480(randi2(0, 5) + 0x1136, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x1136, 4, NULL, NULL, NULL, NULL); if ( !fileProgressFlag_get(FILEPROG_D2_HAS_SPAWNED_A_JINJO_STATUE_IN_FINAL_FIGHT) ) { local->unkA = 1U; D_803927C4 = 1; @@ -1556,7 +1556,7 @@ void chfinalboss_phase4_setState(Actor *this, s32 arg1) { break; case 34: actor_playAnimationOnce(this); - func_80311480(randi2(0, 5) + 0x1145, 0x20, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x1145, 0x20, NULL, NULL, NULL, NULL); func_8030E6A4(SFX_1F_HITTING_AN_ENEMY_3, randf2(0.95f, 1.05f), 32000); func_8030E6A4(SFX_133_GRUNTY_OHW, randf2(0.95f, 1.05f), 32000); this->unk44_31 = func_8030D90C(); @@ -1630,7 +1630,7 @@ void chfinalboss_phase4_update(ActorMarker *marker) { func_80324E38(1.0f, 0); } if (local->hits == 0) { - func_80311480(randi2(0, 5) + 0x1140, 0x20, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x1140, 0x20, NULL, NULL, NULL, NULL); } if ((local->hits + 1) < 4) { local->hits++; @@ -1762,7 +1762,7 @@ void chfinalboss_phase5_setState(Actor *this, s32 next_state) { subaddie_set_state_with_direction(this, next_state, 0.0001f, 1); switch (next_state) { case 35: - func_80311480(randi2(0, 5) + 0x114F, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x114F, 4, NULL, NULL, NULL, NULL); if (local->mirror_phase5) { sp28 = 0x13; } @@ -1886,7 +1886,7 @@ void chfinalboss_phase5_update(ActorMarker *marker) { func_8028FAEC(D_803928C8); } if (__chFinalBossJinjonatorHits == 3) { - func_80311480(randi2(0, 5) + 0x1159, 0x20, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x1159, 0x20, NULL, NULL, NULL, NULL); } } } @@ -2036,10 +2036,10 @@ void func_8038B780(ActorMarker *marker) { sp24 = marker_getActor(marker); if (!fileProgressFlag_get(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT)) { fileProgressFlag_set(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT, TRUE); - func_80311480(0x10E7, 0x2A, sp24->position, sp24->marker, chfinalboss_phase0_endTextCallback, NULL); + gcdialog_showText(ASSET_10E7_TEXT_UNKNOWN, 0x2A, sp24->position, sp24->marker, chfinalboss_phase0_endTextCallback, NULL); } else{ - func_80311480(randi2(0, 5) + 0x10E8, 0x2B, sp24->position, sp24->marker, chfinalboss_phase0_endTextCallback, NULL); + gcdialog_showText(randi2(0, 5) + 0x10E8, 0x2B, sp24->position, sp24->marker, chfinalboss_phase0_endTextCallback, NULL); } } @@ -2091,7 +2091,7 @@ void func_8038B9AC(ActorMarker *marker, ActorMarker *other_marker) { switch (local->phase) { case 1: if (local->hits == 0) { - func_80311480(randi2(0, 5) + 0x10F7, 0x20, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x10F7, 0x20, NULL, NULL, NULL, NULL); } if ((local->hits + 1) < 5) { local->hits++; @@ -2105,7 +2105,7 @@ void func_8038B9AC(ActorMarker *marker, ActorMarker *other_marker) { if ((local->unk2 + 1) >= 3) { local->unk2 = 0; if (local->hits == 0) { - func_80311480(randi2(0, 5) + 0x1110, 0x20, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x1110, 0x20, NULL, NULL, NULL, NULL); } if ((local->hits + 1) < 5) { local->hits++; @@ -2119,7 +2119,7 @@ void func_8038B9AC(ActorMarker *marker, ActorMarker *other_marker) { break; case 3: if (local->hits == 0) { - func_80311480(randi2(0, 5) + 0x1127, 0x20, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x1127, 0x20, NULL, NULL, NULL, NULL); } if ((local->hits + 1) < 5) { local->hits++; @@ -2142,7 +2142,7 @@ void func_8038BB8C(ActorMarker *marker, ActorMarker *other_marker) { if (local->phase == 1) { func_8030E878(SFX_EA_GRUNTY_LAUGH_1, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); if (local->unk10 == 0) { - if (func_80311480(randi2(0, 5) + 0x10ED, 0, NULL, NULL, NULL, NULL)) { + if (gcdialog_showText(randi2(0, 5) + 0x10ED, 0, NULL, NULL, NULL, NULL)) { local->unk10++; } } @@ -2151,7 +2151,7 @@ void func_8038BB8C(ActorMarker *marker, ActorMarker *other_marker) { temp_v0_2 = local->unk6; if ((local->unk6 == 0) && (this->state != 0x1A)) { local->unk6++; - func_80311480(randi2(0, 5) + 0x111D, 0, NULL, NULL, NULL, NULL); + gcdialog_showText(randi2(0, 5) + 0x111D, 0, NULL, NULL, NULL, NULL); } } } diff --git a/src/fight/chjinjonator.c b/src/fight/chjinjonator.c index 5da45a3f..e2dec998 100644 --- a/src/fight/chjinjonator.c +++ b/src/fight/chjinjonator.c @@ -337,7 +337,7 @@ void chjinjonator_update(Actor *this){ actor_playAnimationOnce(this); func_802BB41C(0); text_id = 0x115e + randi2(0,5); - func_80311480(text_id, 0x20, 0, 0, 0, 0); + gcdialog_showText(text_id, 0x20, 0, 0, 0, 0); } break; case 11: //80390EF8 diff --git a/src/fight/chspellfireball.c b/src/fight/chspellfireball.c index 23407535..25def0c1 100644 --- a/src/fight/chspellfireball.c +++ b/src/fight/chspellfireball.c @@ -228,28 +228,28 @@ void func_8038F3B4(ActorMarker *marker, ActorMarker *other){ func_8038F084(marker); switch(volatileFlag_getN(VOLATILE_FLAG_23_FINAL_BOSS_PHASE, 3)){ case 1: //8038F41C - if(!fight_D_803928E0 && func_80311480(randi2(0, 5) + 0x10f2, 0, 0, 0, 0, 0)) + if(!fight_D_803928E0 && gcdialog_showText(randi2(0, 5) + 0x10f2, 0, 0, 0, 0, 0)) fight_D_803928E0 = 1; break; case 2: //8038F468 - if(!D_803928E1 && func_80311480(randi2(0, 5) + 0x110b, 0, 0, 0, 0, 0)) + if(!D_803928E1 && gcdialog_showText(randi2(0, 5) + 0x110b, 0, 0, 0, 0, 0)) D_803928E1 = 1; break; case 3: //8038F4B4 - if(!D_803928E2 && func_80311480(randi2(0, 5) + 0x1122, 0, 0, 0, 0, 0)) + if(!D_803928E2 && gcdialog_showText(randi2(0, 5) + 0x1122, 0, 0, 0, 0, 0)) D_803928E2 = 1; break; case 4: //8038F500 if( !D_803928E3 && func_8038C2A4() - && func_80311480(randi2(0, 5) + 0x113b, 0, 0, 0, 0, 0) + && gcdialog_showText(randi2(0, 5) + 0x113b, 0, 0, 0, 0, 0) ) D_803928E3 = 1; break; case 5: if( !D_803928E4 && func_8038C2B0() - && func_80311480(randi2(0, 5) + 0x1154, 0, 0, 0, 0, 0) + && gcdialog_showText(randi2(0, 5) + 0x1154, 0, 0, 0, 0, 0) ) D_803928E4 = 1; break; diff --git a/src/lair/ch/brentilda.c b/src/lair/ch/brentilda.c index 9c919426..23a4a6fb 100644 --- a/src/lair/ch/brentilda.c +++ b/src/lair/ch/brentilda.c @@ -44,11 +44,11 @@ void func_8038BADC(ActorMarker *marker, enum asset_e text_id, s32 arg2) { if (text_id == ((ActorLocal_lair_5640 *)&this->local)->unk0 + 2) { if (!fileProgressFlag_get(this->unkF4_8 - 1 + FILEPROG_E9_HEALED_BY_BRENTILDA_1)) { if (item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL)) { - func_80311480(0x10A2, 0xF, this->position, this->marker, func_8038BADC, lair_func_8038BA88); + gcdialog_showText(ASSET_10A2_TEXT_UNKNOWN, 0xF, this->position, this->marker, func_8038BADC, lair_func_8038BA88); return; } } - func_80311480(0xD38, 0xC, this->position, this->marker, func_8038BADC, NULL); + gcdialog_showText(ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED, 0xC, this->position, this->marker, func_8038BADC, NULL); return; } subaddie_set_state(this, 1); @@ -182,7 +182,7 @@ void chBrentilda_update(Actor *this) { && func_8028F20C() && !func_803114B0()) { if (!fileProgressFlag_get(FILEPROG_96_MET_BRENTILDA)) { - func_80311480(ASSET_10A1_DIALOG_BRENTILDA_MEET, 0xA, this->position, this->marker, func_8038BADC, NULL); + gcdialog_showText(ASSET_10A1_DIALOG_BRENTILDA_MEET, 0xA, this->position, this->marker, func_8038BADC, NULL); fileProgressFlag_set(FILEPROG_96_MET_BRENTILDA, TRUE); subaddie_set_state(this, 2); return; diff --git a/src/lair/ch/cauldron.c b/src/lair/ch/cauldron.c index cd960f3a..bfe7a2b8 100644 --- a/src/lair/ch/cauldron.c +++ b/src/lair/ch/cauldron.c @@ -184,7 +184,7 @@ void func_8038AC7C(Actor *this) { if (35.0 < this->lifetime_value) { sp2C = (fileProgressFlag_get(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT)) ? 0xFB7 : 0xFAE; sp28 = (fileProgressFlag_get(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT)) ? 0xFBC : 0xFB7; - if (func_80311480(sp2C + this->unk38_31, 0, NULL, NULL, NULL, NULL)) { + if (gcdialog_showText(sp2C + this->unk38_31, 0, NULL, NULL, NULL, NULL)) { this->unk38_31++; this->lifetime_value = 0.0f; if (sp2C + this->unk38_31 >= sp28) { @@ -256,7 +256,7 @@ void chWarpCauldron_update(Actor *this) { } if (!fileProgressFlag_get(FILEPROG_F5_COMPLETED_A_WARP_CAULDRON_SET) && fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this))) { if (func_802D677C(-1) != map_get()) { - func_80311480(0xF7A, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_F7A_TEXT_UNKNOWN, 4, NULL, NULL, NULL, NULL); fileProgressFlag_set(FILEPROG_F5_COMPLETED_A_WARP_CAULDRON_SET, 1); } } @@ -278,7 +278,7 @@ void chWarpCauldron_update(Actor *this) { phi_a0 = (fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this)) != 0) ? SFX_107_CAULDRON_ACTIVATION_1 : SFX_108_CAULDRON_ACTIVATION_2; sfxsource_play(phi_a0, 32000); if (!fileProgressFlag_get(FILEPROG_F5_COMPLETED_A_WARP_CAULDRON_SET) && !fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this))) { - func_80311480(0xF79, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(ASSET_F79_TEXT_UNKNOWN, 4, NULL, NULL, NULL, NULL); } if (fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this))){ switch(this->unkF4_8){ @@ -385,7 +385,7 @@ void chWarpCauldron_update(Actor *this) { case 6: //L8038B64C if (func_8038A690(this) && !fileProgressFlag_get(FILEPROG_F3_MET_DINGPOT)) { - func_80311480(0xFAD, 0xA, this->position, NULL, __chWarpCauldron_dingpotDialogCallback, NULL); + gcdialog_showText(ASSET_FAD_TEXT_UNKNOWN, 0xA, this->position, NULL, __chWarpCauldron_dingpotDialogCallback, NULL); } this->unk38_0 = TRUE; diff --git a/src/lair/code_5ED0.c b/src/lair/code_5ED0.c index aef1b78e..115b1884 100644 --- a/src/lair/code_5ED0.c +++ b/src/lair/code_5ED0.c @@ -1234,7 +1234,7 @@ void lair_func_8038E0B0(void) { func_802FACA4(0x16); if (sp38 != FFTT_0_NIL) { sp28 = sp38 - 1 + FILEPROG_55_FF_BK_SQUARE_INSTRUCTIONS; - if (!fileProgressFlag_get(sp28) && func_80311480(sp38 + 0x101E, 0, NULL, NULL, NULL, NULL)) { + if (!fileProgressFlag_get(sp28) && gcdialog_showText(sp38 + 0x101E, 0, NULL, NULL, NULL, NULL)) { fileProgressFlag_set(sp28, TRUE); } if ((sp38 == FFTT_6_SKULL) && (item_getCount(ITEM_16_LIFE) == 1)) { diff --git a/src/lair/code_86F0.c b/src/lair/code_86F0.c index 35a3f046..0fa4e15f 100644 --- a/src/lair/code_86F0.c +++ b/src/lair/code_86F0.c @@ -262,7 +262,7 @@ void func_8038F250(Actor *this){ && !func_8038EB58(this) && !fileProgressFlag_get(FILEPROG_DF_CAN_REMOVE_ALL_PUZZLE_PIECES) ) { - if (func_80311480(0xF7C, 2, NULL, NULL, NULL, NULL)) { + if (gcdialog_showText(0xF7C, 2, NULL, NULL, NULL, NULL)) { fileProgressFlag_set(FILEPROG_DF_CAN_REMOVE_ALL_PUZZLE_PIECES, TRUE); } } else if ((this->unkF4_8 >= 3) @@ -270,7 +270,7 @@ void func_8038F250(Actor *this){ && !func_8038EB58(this) && !fileProgressFlag_get(FILEPROG_E0_CAN_PLACE_ALL_PUZZLE_PIECES) ){ - if(func_80311480(0xF7D, 2, NULL, NULL, NULL, NULL)) { + if(gcdialog_showText(0xF7D, 2, NULL, NULL, NULL, NULL)) { fileProgressFlag_set(FILEPROG_E0_CAN_PLACE_ALL_PUZZLE_PIECES, TRUE); } } @@ -300,10 +300,10 @@ void func_8038F350(Actor *this, s32 next_state){ func_803115C4(0xF80); func_803115C4(0xF7F); if (item_getCount(ITEM_26_JIGGY_TOTAL) > 0) { - func_80311480(fileProgressFlag_get(FILEPROG_16_STOOD_ON_JIGSAW_PODIUM) ? 0xF5A : 0xF59, 6, sp50, this->marker, func_8038F078, NULL); + gcdialog_showText(fileProgressFlag_get(FILEPROG_16_STOOD_ON_JIGSAW_PODIUM) ? 0xF5A : 0xF59, 6, sp50, this->marker, func_8038F078, NULL); fileProgressFlag_set(FILEPROG_17_HAS_HAD_ENOUGH_JIGSAW_PIECES, 1); } else { - func_80311480(0xF58, 6, sp50, this->marker, func_8038F078, NULL); + gcdialog_showText(0xF58, 6, sp50, this->marker, func_8038F078, NULL); } fileProgressFlag_set(FILEPROG_16_STOOD_ON_JIGSAW_PODIUM, 1); fileProgressFlag_set(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT, 1); @@ -395,7 +395,7 @@ void lair_func_8038F894(Actor *this, s32 arg1) { func_8038F350(this, 1); return; } - func_80311480(0xFBC, 4, NULL, NULL, NULL, NULL); + gcdialog_showText(0xFBC, 4, NULL, NULL, NULL, NULL); fileProgressFlag_set(FILEPROG_DE_USED_ALL_YOUR_PUZZLE_PIECES, 1); } @@ -479,7 +479,7 @@ void lair_func_8038F924(Actor *this) { if (func_80329530(this, 300)) { if ((this->unkF4_8 == 0xA) && !fileProgressFlag_get(FILEPROG_F6_SEEN_DOOR_OF_GRUNTY_PUZZLE_PODIUM)) { phi_a0 = (item_getCount(ITEM_26_JIGGY_TOTAL) < D_803947F8[this->unkF4_8 - 1].cost) ? 0xFAB : 0xFC0; - if (func_80311480(phi_a0, 0, NULL, NULL, NULL, NULL)) { + if (gcdialog_showText(phi_a0, 0, NULL, NULL, NULL, NULL)) { fileProgressFlag_set(FILEPROG_F6_SEEN_DOOR_OF_GRUNTY_PUZZLE_PODIUM, TRUE); } } else if (this->unkF4_8 == 1) { diff --git a/src/lair/code_9C40.c b/src/lair/code_9C40.c index 7f0442e8..264cac74 100644 --- a/src/lair/code_9C40.c +++ b/src/lair/code_9C40.c @@ -64,7 +64,7 @@ void func_80390174(ActorMarker *marker, s32 arg1) { sp28 = this->marker->id - 0x16D; func_8028F94C(2, this->position); if (fileProgressFlag_get(sp28 + 0xAD)) { - func_80311480(sp28 + 0xF83, 0xE, this->position, this->marker, func_803900EC, lair_func_803900DC); + gcdialog_showText(sp28 + 0xF83, 0xE, this->position, this->marker, func_803900EC, lair_func_803900DC); return; } func_80311174(func_80390084() + 0xFA5, 0xE, this->position, this->marker, func_803900EC, lair_func_803900DC, func_80390158); diff --git a/src/lair/code_C1C0.c b/src/lair/code_C1C0.c index ea8e96a8..86a024a4 100644 --- a/src/lair/code_C1C0.c +++ b/src/lair/code_C1C0.c @@ -55,11 +55,11 @@ void func_80392690(ActorMarker *marker, enum asset_e text_id, s32 arg2){ void func_80392700(Actor *this) { if (mapSpecificFlags_get(4)) { if (fileProgressFlag_get(FILEPROG_F4_ENTER_FF_CUTSCENE)) { - func_80311480(0x1031, 0xF, this->position, this->marker, func_80392664, func_80392610); + gcdialog_showText(0x1031, 0xF, this->position, this->marker, func_80392664, func_80392610); } else { func_802BC280(); ncStaticCamera_setToNode(0x1F); - func_80311480(0x102C, 0xE, this->position, this->marker, func_80392664, func_80392610); + gcdialog_showText(0x102C, 0xE, this->position, this->marker, func_80392664, func_80392610); fileProgressFlag_set(FILEPROG_F4_ENTER_FF_CUTSCENE, TRUE); } mapSpecificFlags_set(4, 0); @@ -70,7 +70,7 @@ void func_80392700(Actor *this) { ncStaticCamera_setToNode(9); mapSpecificFlags_set(9, 1); func_8028F94C(2, this->position); - func_80311480(0x103F, 0x2A, this->position, this->marker, func_80392690, func_80392610); + gcdialog_showText(0x103F, 0x2A, this->position, this->marker, func_80392690, func_80392610); mapSpecificFlags_set(6, 0); subaddie_set_state_with_direction(this, 3, 0.0f, 1); actor_playAnimationOnce(this); diff --git a/src/lair/code_C6C0.c b/src/lair/code_C6C0.c index 19257db9..d54dc109 100644 --- a/src/lair/code_C6C0.c +++ b/src/lair/code_C6C0.c @@ -22,7 +22,7 @@ void func_80392AF4(ActorMarker *marker, enum asset_e text_id, s32 arg2){ void func_80392B1C(ActorMarker *marker) { func_8028E6EC(0); - func_80311480(0x1040, 8, NULL, marker, func_80392AB0, func_80392AF4); + gcdialog_showText(0x1040, 8, NULL, marker, func_80392AB0, func_80392AF4); } void func_80392B6C(Actor *this) { From 3127ba4a68d53dc9de75c3ad3eee7a6a484bb54a Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 12:32:08 +0200 Subject: [PATCH 09/11] Renaming LMonkey --- include/enums.h | 6 +- include/functions.h | 2 +- src/CCW/code_3310.c | 2 +- src/CCW/code_5540.c | 2 +- src/FP/ch/bearcub.c | 18 ++++-- src/MM/ch/lmonkey.c | 111 ++++++++++++++++++++++--------------- src/SM/ch/vegetables.c | 4 +- src/TTC/ch/blubber.c | 2 +- src/core2/code_509D0.c | 10 ++-- src/core2/code_6B30.c | 2 +- src/core2/code_7060.c | 14 +++-- src/core2/code_9E370.c | 10 ++-- src/core2/timedfuncqueue.c | 27 +++++---- 13 files changed, 123 insertions(+), 87 deletions(-) diff --git a/include/enums.h b/include/enums.h index 3c6078fc..457c2bd9 100644 --- a/include/enums.h +++ b/include/enums.h @@ -2292,9 +2292,9 @@ enum bs_e enum mm_specific_flags { MM_SPECIFIC_FLAG_0_CHIMPY_STUMP_RAISED, - - MM_SPECIFIC_FLAG_2_UNKNOWN = 0x2, - MM_SPECIFIC_FLAG_3_UNKNOWN, + MM_SPECIFIC_FLAG_1_ORANGE_HAS_BEEN_COLLECTED, + MM_SPECIFIC_FLAG_2_ORANGE_HAS_BEEN_RETURNED, + MM_SPECIFIC_FLAG_3_CHIMPY_HAS_LEAVED, MM_SPECIFIC_FLAG_4_SHAKE, MM_SPECIFIC_FLAG_6_UNKNOWN = 0x6, diff --git a/include/functions.h b/include/functions.h index 72c2ca22..646f11c8 100644 --- a/include/functions.h +++ b/include/functions.h @@ -432,7 +432,7 @@ void subaddie_set_state(Actor *, u32); ActorMarker *func_8032B16C(enum jiggy_e jiggy_id); int subaddie_maybe_set_state(Actor *, s32, f32); void subaddie_set_state_with_direction(Actor * this, s32 myAnimId, f32 arg2, s32 direction); -int subaddie_maybe_set_state_position_direction(Actor *, s32, f32, s32, f32 ); +bool subaddie_maybe_set_state_position_direction(Actor *, s32, f32, s32, f32 ); void func_80328CEC(Actor *, s32, s32, s32); void func_80328FB0(Actor *, f32); int func_80329030(Actor *, s32); diff --git a/src/CCW/code_3310.c b/src/CCW/code_3310.c index cfa4d230..0c603822 100644 --- a/src/CCW/code_3310.c +++ b/src/CCW/code_3310.c @@ -271,7 +271,7 @@ void CCW_func_80389BFC(Actor *this) { } if ((local->unk0->map_id != MAP_43_CCW_SPRING) && ((this->position[0] + 500.0f) < sp4C[0])) { func_8028F364(this->position, 1110.0f, 200.0f, ACTOR_2A2_CATERPILLAR, &this); - if ((local->unk0->unkE != 0) && (carriedObj_getActorId() == ACTOR_2A2_CATERPILLAR) && (ml_distance_vec3f(this->position, sp4C) < 1010.0f) && (func_8028FC34() != 0)) { + if ((local->unk0->unkE != 0) && (carriedObj_getActorId() == ACTOR_2A2_CATERPILLAR) && (ml_distance_vec3f(this->position, sp4C) < 1010.0f) && (player_throwCarriedObject() != 0)) { func_8028FA54(D_8038FDE0); if ((local->unk0->map_id == MAP_44_CCW_SUMMER) && (local->unk4 == 0)) { gcdialog_showText(0xCD8, 4, NULL, NULL, NULL, NULL); diff --git a/src/CCW/code_5540.c b/src/CCW/code_5540.c index 5f011c3d..5f64902c 100644 --- a/src/CCW/code_5540.c +++ b/src/CCW/code_5540.c @@ -143,7 +143,7 @@ void chnabnut_update(Actor *this) { } if (this->is_first_encounter && !func_803114B0()) { func_8028F364(this->position, 500.0f, 200.0f, ACTOR_2A9_ACORN, &this); - if ((carriedObj_getActorId() == ACTOR_2A9_ACORN) && (ml_distance_vec3f(this->position, sp30) < 300.0f) && func_8028FC34()) { + if ((carriedObj_getActorId() == ACTOR_2A9_ACORN) && (ml_distance_vec3f(this->position, sp30) < 300.0f) && player_throwCarriedObject()) { func_8028FA54(D_8038F350); local->returned_acorn_count++; if (local->returned_acorn_count == 6) { diff --git a/src/FP/ch/bearcub.c b/src/FP/ch/bearcub.c index e76131a8..373b6792 100644 --- a/src/FP/ch/bearcub.c +++ b/src/FP/ch/bearcub.c @@ -3,7 +3,7 @@ #include "variables.h" extern void func_8028E668(f32[3], f32, f32, f32); -extern s32 func_8028F31C(f32[3], f32, s32, Actor **); +extern s32 player_setCarryObjectPoseInHorizontalRadius(f32[3], f32, s32, Actor **); typedef struct { s32 unk0; @@ -48,11 +48,19 @@ Struct_FP_3E00 D_80391E80[] ={ /* .code */ void func_8038A1F0(Actor **this_ptr, enum marker_e carried_obj_marker_id, enum actor_e actor_id, enum actor_e arg3){ - func_8028F31C((*this_ptr)->position, 600.0f, actor_id, this_ptr); + player_setCarryObjectPoseInHorizontalRadius((*this_ptr)->position, 600.0f, actor_id, this_ptr); - if(!func_80329530(*this_ptr, 400)) return; - if(bacarry_get_markerId() != carried_obj_marker_id) return; - if(!func_8028FC34()) return; + if (!func_80329530(*this_ptr, 400)) { + return; + } + + if (bacarry_get_markerId() != carried_obj_marker_id) { + return; + } + + if (!player_throwCarriedObject()) { + return; + } func_8028FA34(arg3, *this_ptr); } diff --git a/src/MM/ch/lmonkey.c b/src/MM/ch/lmonkey.c index 7a39d6e3..a67fd8b8 100644 --- a/src/MM/ch/lmonkey.c +++ b/src/MM/ch/lmonkey.c @@ -2,19 +2,28 @@ #include "functions.h" #include "variables.h" +/* external function declarations */ void func_8028E668(f32 *, f32, f32, f32); int actor_animationIsAt(Actor *, f32); void subaddie_set_state_with_direction(Actor *, s32, f32, s32); void timed_exitStaticCamera(f32); void func_80324E38(f32, s32); void timed_setStaticCameraToNode(f32, s32); -s32 func_8028F31C(f32 *, f32, s32, Actor **); +s32 player_setCarryObjectPoseInHorizontalRadius(f32 *, f32, s32, Actor **); + void func_8028FA34(s32, Actor *); - -void chLMonkey_update(Actor *); +/* public function declarations */ +void chlmonkey_update(Actor *); /* .data */ +enum chlmonkey_state_e { + LMONKEY_STATE_1_IDLE = 1, + LMONKEY_STATE_2_JUMPING, + LMONKEY_STATE_3_WALKING, + LMONKEY_STATE_4_LEAVING +}; + ActorAnimationInfo chlmonkeyAnimations[5] = { {0, 0.0f}, {ASSET_5C_ANIM_CHIMPY_IDLE, 2.3f}, @@ -26,28 +35,28 @@ ActorAnimationInfo chlmonkeyAnimations[5] = { ActorInfo chlmonkeyInfo = { MARKER_A_CHIMPY, ACTOR_F_CHIMPY, ASSET_35D_MODEL_CHIMPY, 1, chlmonkeyAnimations, - NULL, chLMonkey_update, actor_draw, + NULL, chlmonkey_update, actor_draw, 2500, 0, 0.8f, 0 }; /* .code */ -void func_80388300(Actor **arg0) { - func_8028F31C((*arg0)->position, 800.0f, ACTOR_29_ORANGE_COLLECTIBLE, arg0); +void __chlmonkey_updateBringOrange(Actor **this_ptr) { + player_setCarryObjectPoseInHorizontalRadius((*this_ptr)->position, 800.0f, ACTOR_29_ORANGE_COLLECTIBLE, this_ptr); - if (func_80329530(*arg0, 345) - && bacarry_get_markerId() == MARKER_36_ORANGE_COLLECTIBLE - && func_8028FC34()) { + if (func_80329530(*this_ptr, 345) && + bacarry_get_markerId() == MARKER_36_ORANGE_COLLECTIBLE && + player_throwCarriedObject()) { - func_8028FA34(0xc6, *arg0); - (*arg0)->is_first_encounter = TRUE; + func_8028FA34(0xc6, *this_ptr); + (*this_ptr)->is_first_encounter = TRUE; timed_setStaticCameraToNode(1.2f, 0xF); func_80324E38(1.2f, 3); } - if (arg0); + if (this_ptr); } -void __chLMonkey_playRandomNoise(Actor *this) { +void __chlmonkey_playRandomNoise(Actor *this) { f32 scaled_noise_volume; f32 random_noise; static sNoiseCooldown = 0; @@ -56,85 +65,97 @@ void __chLMonkey_playRandomNoise(Actor *this) { random_noise = randf(); sNoiseCooldown--; - if (sNoiseCooldown < 0) { - if (randf() < 0.2) { - sNoiseCooldown = 6; - func_8030E6A4(((random_noise < 0.5) ? SFX_58_CHIMPY_NOISE_1 : SFX_59_CHIMPY_NOISE_2), randf() * 0.25 + 0.85, scaled_noise_volume); - } + if (sNoiseCooldown < 0 && randf() < 0.2) { + sNoiseCooldown = 6; + func_8030E6A4(((random_noise < 0.5) ? SFX_58_CHIMPY_NOISE_1 : SFX_59_CHIMPY_NOISE_2), randf() * 0.25 + 0.85, scaled_noise_volume); } } -void __chLMonkey_spawnJiggy(s32 x, s32 y, s32 z) { - f32 sp1C[3]; - TUPLE_ASSIGN(sp1C, x, y, z); - jiggy_spawn(JIGGY_9_MM_CHIMPY, sp1C); +void __chlmonkey_spawnJiggy(s32 x, s32 y, s32 z) { + f32 pos[3]; + + TUPLE_ASSIGN(pos, x, y, z) + jiggy_spawn(JIGGY_9_MM_CHIMPY, pos); } -void __chLMonkey_complete(ActorMarker *marker, enum asset_e arg1, s32 arg2) { +void __chlmonkey_complete(ActorMarker *marker, enum asset_e unused_1, s32 unused_2) { Actor *actor = marker_getActor(marker); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_4_SHAKE, TRUE); - subaddie_set_state(actor, 3); + subaddie_set_state(actor, LMONKEY_STATE_3_WALKING); timed_setStaticCameraToNode(2.3f, 0x12); - timedFunc_set_3(2.9f, __chLMonkey_spawnJiggy, actor->position_x, actor->position_y + 150.0f, actor->position_z); + timedFunc_set_3(2.9f, __chlmonkey_spawnJiggy, actor->position_x, actor->position_y + 150.0f, actor->position_z); timed_exitStaticCamera(4.3f); func_80324E38(4.3f, 0); } -void chLMonkey_update(Actor *this){ +void chlmonkey_update(Actor *this) { func_8028E668(this->position, 35.0f, 0.0f, 65.0f); actor_collisionOff(this); this->marker->propPtr->unk8_3 = 1; + if (map_get() != MAP_2_MM_MUMBOS_MOUNTAIN) { func_80343DEC(this); } else {//L80388630 if (func_80329530(this, 700) && !func_803114B0()) { - __chLMonkey_playRandomNoise(this); + __chlmonkey_playRandomNoise(this); }//L8038865C + switch (this->state) { - case 1://L80388690 - if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_2_UNKNOWN)) { - subaddie_set_state(this, 4); + case LMONKEY_STATE_1_IDLE://L80388690 + if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_2_ORANGE_HAS_BEEN_RETURNED)) { + subaddie_set_state(this, LMONKEY_STATE_4_LEAVING); + if (!jiggyscore_isCollected(JIGGY_9_MM_CHIMPY)) { - gcdialog_showText(ASSET_B40_DIALOG_CHIMPY_COMPLETE, 0xE, this->position, this->marker, __chLMonkey_complete, NULL); + gcdialog_showText(ASSET_B40_DIALOG_CHIMPY_COMPLETE, 0xE, this->position, this->marker, __chlmonkey_complete, NULL); } else {//L803886E8 - __chLMonkey_complete(this->marker, ASSET_B40_DIALOG_CHIMPY_COMPLETE, -1); + __chlmonkey_complete(this->marker, ASSET_B40_DIALOG_CHIMPY_COMPLETE, -1); }//L80388898 } else { - func_80388300(&this); - if (func_80329530(this, 345) - && !func_80329530(this, 150) - && !item_getCount(ITEM_19_ORANGE) - && !this->is_first_encounter - ) { + __chlmonkey_updateBringOrange(&this); + + if (func_80329530(this, 345) && + !func_80329530(this, 150) && + !item_getCount(ITEM_19_ORANGE) && + !this->is_first_encounter) { + gcdialog_showText(ASSET_B3F_DIALOG_CHIMPY_MEET, 0xe, this->position, NULL, NULL, NULL); this->is_first_encounter = TRUE; }//L80388774 + actor_loopAnimation(this); - subaddie_maybe_set_state_position_direction(this, 2, 0.0f, -1, 0.02f); + subaddie_maybe_set_state_position_direction(this, LMONKEY_STATE_2_JUMPING, 0.0f, -1, 0.02f); } break; - case 2: //L803887A4 - func_80388300(&this); + + case LMONKEY_STATE_2_JUMPING: //L803887A4 + __chlmonkey_updateBringOrange(&this); actor_playAnimationOnce(this); + if (actor_animationIsAt(this, 0.99f)) { - subaddie_set_state_with_direction(this, 1, 0.0f, -1); + subaddie_set_state_with_direction(this, LMONKEY_STATE_1_IDLE, 0.0f, -1); } break; - case 4: //L803887E4 + + case LMONKEY_STATE_4_LEAVING: //L803887E4 actor_loopAnimation(this); break; - case 3: //L803887F4 + + case LMONKEY_STATE_3_WALKING: //L803887F4 func_80343DEC(this); actor_loopAnimation(this); + if (0.19 <= this->unk48) { mapSpecificFlags_set(MM_SPECIFIC_FLAG_0_CHIMPY_STUMP_RAISED, TRUE); } + if (0.24 <= this->unk48) { - mapSpecificFlags_set(MM_SPECIFIC_FLAG_3_UNKNOWN, TRUE); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_3_CHIMPY_HAS_LEAVED, TRUE); } + if (0.99 <= this->unk48) { marker_despawn(this->marker); } diff --git a/src/SM/ch/vegetables.c b/src/SM/ch/vegetables.c index a877ad07..7f731744 100644 --- a/src/SM/ch/vegetables.c +++ b/src/SM/ch/vegetables.c @@ -7,7 +7,7 @@ //external f32 mapModel_getFloorY(f32*); void func_802C4218(s32, f32, f32, f32); -void func_803252D0(f32, s32); +void timed_mapSpecificFlags_setTrue(f32, s32); void subaddie_set_state_with_direction(Actor *, s32, f32, s32); //typedefs @@ -205,7 +205,7 @@ void func_80387C28(Actor * this){ func_802CA1CC(HONEYCOMB_17_SM_COLIWOBBLE); __spawnQueue_add_4((GenFunction_4)func_802C4218, 0x1f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z)); }//L80387D64 - func_803252D0(1.5f, 7); + timed_mapSpecificFlags_setTrue(1.5f, 7); actor_collisionOff(this); if(local->unkC != 3){ subaddie_set_state_with_direction(this, 3, 0.0f, 1); diff --git a/src/TTC/ch/blubber.c b/src/TTC/ch/blubber.c index b2a79151..c4d49d6e 100644 --- a/src/TTC/ch/blubber.c +++ b/src/TTC/ch/blubber.c @@ -114,7 +114,7 @@ void func_80387774(Actor **this_ptr){ func_8028F364(local->throw_target_position, local->throw_target_radius, 100.0f, ACTOR_2A_GOLD_BULLION, this_ptr); if( func_80329530(*this_ptr, 200) && bacarry_get_markerId() == MARKER_37_GOLD_BULLION - && func_8028FC34() + && player_throwCarriedObject() ){ func_8028FA34(!mapSpecificFlags_get(0)? 0x149 : 0x14a, *this_ptr); (*this_ptr)->is_first_encounter = TRUE; diff --git a/src/core2/code_509D0.c b/src/core2/code_509D0.c index 1947ded8..1ce901a4 100644 --- a/src/core2/code_509D0.c +++ b/src/core2/code_509D0.c @@ -6,7 +6,7 @@ extern void func_8028F7D4(f32, f32); void chLevelCollectible_update(Actor *this); extern void func_80329904(ActorMarker *, s32, f32*); extern ActorMarker *func_8028E86C(void); -extern void func_803252D0(f32, s32); +extern void timed_mapSpecificFlags_setTrue(f32, s32); extern void func_8035646C(s32); ActorAnimationInfo D_80367B50[] = { @@ -107,8 +107,10 @@ void __chLevelCollectible_collide(ActorMarker *marker, ActorMarker *other_marker sp18[2] = this->position[2]; switch (marker->id) { case MARKER_36_ORANGE_COLLECTIBLE: - if (mapSpecificFlags_get(1)) + if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_1_ORANGE_HAS_BEEN_COLLECTED)) { return; + } + func_8035646C(FILEPROG_8_ORANGE_TEXT); func_8030E6D4(SFX_B3_ORANGE_TALKING); dialog_id = 0; @@ -234,7 +236,7 @@ void __chLevelCollectible_returnObj(Actor *this) { case MARKER_37_GOLD_BULLION: break; case MARKER_36_ORANGE_COLLECTIBLE: - func_803252D0(1.7f, 2); + timed_mapSpecificFlags_setTrue(1.7f, MM_SPECIFIC_FLAG_2_ORANGE_HAS_BEEN_RETURNED); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); break; case MARKER_1FD_BLUE_PRESENT_COLLECTIBLE: @@ -363,7 +365,7 @@ void chLevelCollectible_update(Actor *this){ func_802D83EC(this); break; case MARKER_36_ORANGE_COLLECTIBLE: //L802D86DC - if(mapSpecificFlags_get(3) && map_get() == MAP_2_MM_MUMBOS_MOUNTAIN){ + if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_3_CHIMPY_HAS_LEAVED) && map_get() == MAP_2_MM_MUMBOS_MOUNTAIN) { marker_despawn(this->marker); } break; diff --git a/src/core2/code_6B30.c b/src/core2/code_6B30.c index b02f725e..10d554fc 100644 --- a/src/core2/code_6B30.c +++ b/src/core2/code_6B30.c @@ -89,7 +89,7 @@ enum hitbox_e hitbox_getHitboxForActor(ActorMarker *arg0){ } // break ?? // -bool func_8028DD60(enum actor_e actor_id, Actor **arg1){ +bool player_setCarryObjectPose(enum actor_e actor_id, Actor **arg1){ ActorMarker *m1; ActorMarker *m2; Actor *actor; diff --git a/src/core2/code_7060.c b/src/core2/code_7060.c index a5370311..8c5c7f0d 100644 --- a/src/core2/code_7060.c +++ b/src/core2/code_7060.c @@ -660,9 +660,9 @@ bool func_8028F2FC(void){ } //sets carry actor if player is within a horizantal radius around a point -bool func_8028F31C(f32 position[3], f32 radius, enum actor_e actor_id, Actor **arg3){ - if(player_isInHorizontalRadius(position, radius)){ - return func_8028DD60(actor_id, arg3); +bool player_setCarryObjectPoseInHorizontalRadius(f32 position[3], f32 radius, enum actor_e actor_id, Actor **arg3){ + if (player_isInHorizontalRadius(position, radius)) { + return player_setCarryObjectPose(actor_id, arg3); } return FALSE; } @@ -670,7 +670,7 @@ bool func_8028F31C(f32 position[3], f32 radius, enum actor_e actor_id, Actor **a //sets carry actor if player is within a cylinder around a point bool func_8028F364(f32 position[3], f32 radius, f32 vert_range, enum actor_e actor_id, Actor **arg4) { if (player_isInVerticalRange(position, vert_range)) { - return func_8028F31C(position, radius, actor_id, arg4); + return player_setCarryObjectPoseInHorizontalRadius(position, radius, actor_id, arg4); } return FALSE; } @@ -933,9 +933,11 @@ bool func_8028FBD4(f32 arg0[3]) { return bs_checkInterrupt(BS_INTR_8) == 2; } -bool func_8028FC34(void){ - if (func_8028E86C() && bscarry_inSet(bs_getState())) +bool player_throwCarriedObject(void){ + if (func_8028E86C() && bscarry_inSet(bs_getState())) { return bs_checkInterrupt(BS_INTR_16_THROW_CARRIED_OBJ) == 2; + } + return FALSE; } diff --git a/src/core2/code_9E370.c b/src/core2/code_9E370.c index e618c89a..f33fa28b 100644 --- a/src/core2/code_9E370.c +++ b/src/core2/code_9E370.c @@ -1318,15 +1318,15 @@ void subaddie_set_state_with_direction(Actor * this, s32 myAnimId, f32 arg2, s32 func_803289EC(this, arg2, direction); } -int subaddie_maybe_set_state_position_direction(Actor * this, s32 myAnimId, f32 start_position, s32 direction, f32 probability){ - if(randf() < probability){ - if(__subaddie_set_state(this, myAnimId) && this->animctrl){ +bool subaddie_maybe_set_state_position_direction(Actor *this, s32 myAnimId, f32 start_position, s32 direction, f32 probability) { + if (randf() < probability) { + if (__subaddie_set_state(this, myAnimId) && this->animctrl) { func_803285E8(this, start_position, direction); animctrl_start(this->animctrl, "subaddie.c", 0x705); } - return 1; + return TRUE; } - return 0; + return FALSE; } void subaddie_set_ideal_yaw(Actor * this, int arg1){ diff --git a/src/core2/timedfuncqueue.c b/src/core2/timedfuncqueue.c index 4a0a2970..a8ad249d 100644 --- a/src/core2/timedfuncqueue.c +++ b/src/core2/timedfuncqueue.c @@ -135,17 +135,20 @@ void func_80324AEC(DelayedTextCallback *arg0) { } void func_80324BA0(s32 arg0){ - if(arg0 == 1) + if (arg0 == 1) { func_8028F918(1); - else if(arg0 == 2) + } + else if (arg0 == 2) { func_8028F918(3); - else if(arg0 == 3) + } + else if (arg0 == 3) { func_8028F918(2); - else{ - if(arg0 == 0) - func_8028F918(0); - else if (arg0 == 4) - func_802D6114(); + } + else if (arg0 == 0) { + func_8028F918(0); + } + else if (arg0 == 4) { + func_802D6114(); } } @@ -319,10 +322,10 @@ void timedFuncQueue_defrag(void){ D_80383380.ptr = vector_defrag(D_80383380.ptr); } -void func_803252B0(s32 arg0){ - mapSpecificFlags_set(arg0, 1); +void mapSpecificFlags_setTrue(s32 flag){ + mapSpecificFlags_set(flag, TRUE); } -void func_803252D0(f32 time, s32 arg0){ - timedFunc_set_1(time, func_803252B0, arg0); +void timed_mapSpecificFlags_setTrue(f32 time, s32 flag){ + timedFunc_set_1(time, mapSpecificFlags_setTrue, flag); } From 0224f958638e02f785fee1c7a37bfe96699b4b14 Mon Sep 17 00:00:00 2001 From: Nabnut Date: Thu, 19 Sep 2024 13:01:49 +0200 Subject: [PATCH 10/11] Renaming Hut --- include/enums.h | 7 ++- src/MM/ch/hut.c | 108 ++++++++++++++++++-------------------- src/core2/ch/gameSelect.c | 2 +- src/core2/code_41FB0.c | 45 ++++++++-------- 4 files changed, 78 insertions(+), 84 deletions(-) diff --git a/include/enums.h b/include/enums.h index 457c2bd9..9a70a738 100644 --- a/include/enums.h +++ b/include/enums.h @@ -1723,10 +1723,9 @@ enum actor_e ACTOR_47_EMPTY_HONEYCOMB, ACTOR_49_EXTRA_LIFE = 0x49, - - ACTOR_4A_WOOD_EXPLOSION = 0x4A, - - ACTOR_4C_STEAM = 0x4C, + ACTOR_4A_WOOD_EXPLOSION, + ACTOR_4B_WOOD_EXPLOSION_2, + ACTOR_4C_STEAM, ACTOR_4D_STEAM_2, ACTOR_50_HONEYCOMB = 0x50, diff --git a/src/MM/ch/hut.c b/src/MM/ch/hut.c index c6615639..5e065263 100644 --- a/src/MM/ch/hut.c +++ b/src/MM/ch/hut.c @@ -5,85 +5,72 @@ #include "prop.h" -#ifndef HUT_STATE_INTACT -#define HUT_STATE_INTACT 0 -#endif - -#ifndef HUT_STATE_DAMAGED -#define HUT_STATE_DAMAGED 1 -#endif - -#ifndef HUT_STATE_DESTROYED -#define HUT_STATE_DESTROYED 2 -#endif - /* extern function declarations */ - void func_802C8F70(f32); void func_802C4218(s32, s32, s32, s32); /* public function declarations */ -Actor *chhut_draw(ActorMarker *, Gfx **, Mtx**, Vtx **); -void chhut_update(Actor *); +Actor *chhut_draw(ActorMarker *, Gfx **, Mtx **, Vtx **); +void chhut_update(Actor *); /* .bss */ -extern s32 D_8037DCB0; //mm_hut_smash_count - +extern s32 mm_hut_smash_count; //mm_hut_smash_count /* .data */ +enum chhut_state_e { + HUT_STATE_0_INTACT, + HUT_STATE_1_DAMAGED, + HUT_STATE_2_DESTROYED +}; + ActorAnimationInfo chhutAnimations[3] = { - {0, 0.0f}, - {ASSET_4E_ANIM_MUDHUT_SMASH, 0.25f}, + {0, 0.0f}, + {ASSET_4E_ANIM_MUDHUT_SMASH, 0.25f}, {ASSET_4E_ANIM_MUDHUT_SMASH, 1000000.0f} }; /* .code */ -Actor *chhut_draw(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx){ - Actor *actorPtr; - s32 is_not_destroyed; - s32 is_intact_or_destroyed; +Actor *chhut_draw(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *actorPtr = marker_getActor(this); + s32 is_not_destroyed = actorPtr->state != HUT_STATE_2_DESTROYED; + s32 is_intact_or_destroyed = actorPtr->state == HUT_STATE_0_INTACT || actorPtr->state == HUT_STATE_2_DESTROYED; - actorPtr = marker_getActor(this); - - is_not_destroyed = actorPtr->state != HUT_STATE_DESTROYED; - is_intact_or_destroyed = actorPtr->state == HUT_STATE_INTACT || actorPtr->state == HUT_STATE_DESTROYED; this->propPtr->unk8_3 = is_intact_or_destroyed; func_8033A45C(1, is_not_destroyed); - return actor_draw(this, gfx, mtx, vtx); } -void func_803869EC(ActorMarker *this){ - Actor * actorPtr; - f32 *pos; - - actorPtr = marker_getActor(this); - actorPtr = spawn_actor_f32(0x4B, actorPtr->position, 0); +void __chhut_spawnExplosion(ActorMarker *this) { + Actor *actorPtr = marker_getActor(this); + actorPtr = spawn_actor_f32(ACTOR_4B_WOOD_EXPLOSION_2, actorPtr->position, 0); spawn_actor_f32(ACTOR_4D_STEAM_2, actorPtr->position, 0); - - if(this); + + if (this); } -void chhut_update(Actor *this){ - static s32 D_803898D8[6] = { 0, 1, 2, 3, 6, 4}; +void chhut_update(Actor *this) { + static s32 D_803898D8[6] = {0, 1, 2, 3, 6, 4}; f32 diff_pos[3]; f32 plyr_pos[3]; - if(func_80334904() != 2) + if (func_80334904() != 2) { return; + } - if(!this->initialized){ + if (!this->initialized) { this->marker->collidable = FALSE; this->initialized = TRUE; } - switch(this->state){ - case HUT_STATE_INTACT: + + switch (this->state) { + case HUT_STATE_0_INTACT: player_getPosition(plyr_pos); diff_pos[0] = plyr_pos[0] - this->position_x; diff_pos[1] = plyr_pos[1] - this->position_y; diff_pos[2] = plyr_pos[2] - this->position_z; - if(150.0f < diff_pos[1] - && player_getActiveHitbox(this->marker) == HITBOX_1_BEAK_BUSTER + + if (150.0f < diff_pos[1] + && player_getActiveHitbox(this->marker) == HITBOX_1_BEAK_BUSTER && func_8028F20C() && gu_sqrtf(diff_pos[0]*diff_pos[0] + diff_pos[1]*diff_pos[1] + diff_pos[2]*diff_pos[2]) < 350.0f ){ @@ -91,38 +78,43 @@ void chhut_update(Actor *this){ diff_pos[1] = this->position_y; diff_pos[2] = this->position_z; diff_pos[1] += 125.0; + func_8030E484(SFX_5B_HEAVY_STUFF_FALLING); - subaddie_set_state(this, HUT_STATE_DAMAGED); + subaddie_set_state(this, HUT_STATE_1_DAMAGED); actor_playAnimationOnce(this); - __spawnQueue_add_1((GenFunction_1)func_803869EC, (s32)this->marker); + __spawnQueue_add_1((GenFunction_1) __chhut_spawnExplosion, (s32) this->marker); func_802C8F70(this->yaw); - if(D_8037DCB0 < 5){ - __spawnQueue_add_4((GenFunction_4)func_802C4218, D_803898D8[D_8037DCB0], *(s32*)(&diff_pos[0]),*(s32*)(&diff_pos[1]),*(s32*)(&diff_pos[2])); + + if (mm_hut_smash_count < 5) { + __spawnQueue_add_4((GenFunction_4) func_802C4218, D_803898D8[mm_hut_smash_count], *(s32 * )(&diff_pos[0]), *(s32 * )(&diff_pos[1]),*(s32 * )(&diff_pos[2])); } - else{ + else { jiggy_spawn(JIGGY_5_MM_HUTS, diff_pos); } - D_8037DCB0 = ( D_8037DCB0 + 1 ) % 6; + + mm_hut_smash_count = (mm_hut_smash_count + 1) % 6; } break; - case HUT_STATE_DAMAGED: - if(animctrl_getAnimTimer(this->animctrl) > 0.99){ + + case HUT_STATE_1_DAMAGED: + if (animctrl_getAnimTimer(this->animctrl) > 0.99) { animctrl_setTransitionDuration(this->animctrl, 0.0f); - subaddie_set_state(this, HUT_STATE_DESTROYED); + subaddie_set_state(this, HUT_STATE_2_DESTROYED); this->position_y -= 160.0f; } break; - case HUT_STATE_DESTROYED: + + case HUT_STATE_2_DESTROYED: break; } - } -void mm_resetHuts(void){ - D_8037DCB0 = 0; +void mm_resetHuts(void) { + mm_hut_smash_count = 0; } -ActorInfo chhutInfo = { MARKER_51_MM_HUT, ACTOR_9_MM_HUT, ASSET_7D7_MODEL_MM_HUT, +ActorInfo chhutInfo = { + MARKER_51_MM_HUT, ACTOR_9_MM_HUT, ASSET_7D7_MODEL_MM_HUT, 0, chhutAnimations, chhut_update, func_80326224, chhut_draw, 0, 0x100, 0.0f, 0 diff --git a/src/core2/ch/gameSelect.c b/src/core2/ch/gameSelect.c index b844bfdd..0fa19ab6 100644 --- a/src/core2/ch/gameSelect.c +++ b/src/core2/ch/gameSelect.c @@ -79,7 +79,7 @@ ActorInfo D_80365F00 = { 0xE6, 0x197, 0x532, 0x1, D_80365ED0, func_802C4C14, fun /* .bss */ -s32 D_8037DCB0; +s32 mm_hut_smash_count; u32 D_8037DCB4; struct FF_StorageStruct* D_8037DCB8; s32 D_8037DCBC; diff --git a/src/core2/code_41FB0.c b/src/core2/code_41FB0.c index 76bb1e53..f159e238 100644 --- a/src/core2/code_41FB0.c +++ b/src/core2/code_41FB0.c @@ -134,45 +134,46 @@ void func_802C8F7C(f32 arg0){ Actor *func_802C8F88(s32 arg0, s32 arg1[3]){ f32 sp1C[3]; - sp1C[0] = arg1[0]; - sp1C[1] = arg1[1]; - sp1C[2] = arg1[2]; + TUPLE_COPY(sp1C, arg1) return func_802C937C(arg0, sp1C); } -Actor *func_802C8FE4(s32 arg0, f32 position[3], Actor *arg2){ +Actor *func_802C8FE4(s32 index, f32 position[3], Actor *arg2) { static f32 D_80366C4C = 400.0f; - struct41FB0s * sp74; //s2 - Actor *actor; //s3 + struct41FB0s *sp74 = D_80366460 + index; + Actor *actor = NULL; //s3 + s32 i; struct41FB0s_1 *s0; - sp74 = D_80366460 + arg0; - actor = NULL; - for(i = 0; i < sp74->count; i++){//L802C90B0 - D_8037DDB4 += 360.0/sp74->count; - while(360.0 <= D_8037DDB4){ D_8037DDB4 -= 360.0;} + for (i = 0; i < sp74->count; i++) {//L802C90B0 + D_8037DDB4 += 360.0 / sp74->count; + while (360.0 <= D_8037DDB4) { D_8037DDB4 -= 360.0; } //L802C9114 - actor =(i == 0 && arg2) ? arg2 : spawn_actor_f32(sp74->actor_id, position, 0); + + actor = (i == 0 && arg2) ? arg2 : spawn_actor_f32(sp74->actor_id, position, 0); actor->unk10_0 = 1; + s0 = (struct41FB0s_1 *) &actor->unkBC; - s0->unk0 = arg0; + s0->unk0 = index; s0->unk2F = 1; s0->unk6 = 1; + ml_vec3f_copy(s0->unk8, actor->position); ml_vec3f_copy(actor->position, s0->unk8); - if(D_8037DDB8 != 1.0f){ - s0->unk14[0] = sp74->unk14*D_8037DDB8; + + if (D_8037DDB8 != 1.0f) { + s0->unk14[0] = sp74->unk14 * D_8037DDB8; s0->unk14[1] = sp74->unk1C + randf2(0.0f, sp74->unk20); - s0->unk14[2] = sp74->unk24*D_8037DDB8; + s0->unk14[2] = sp74->unk24 * D_8037DDB8; D_8037DDB8 = 1.0f; } - else{//L802C91CC + else {//L802C91CC s0->unk14[0] = sp74->unk14 + randf2(0.0f, sp74->unk18); s0->unk14[1] = sp74->unk1C + randf2(0.0f, sp74->unk20); s0->unk14[2] = sp74->unk24 + randf2(0.0f, sp74->unk28); - }//L802C9210 + ml_vec3f_yaw_rotate_copy(s0->unk14, s0->unk14, D_8037DDB4); s0->unk24 = D_80366C4C *= -1; actor->yaw = s0->unk20 = (sp74->unk0 & 0x20) ? sp74->unk30 : randf2(0.0f, 360.0f); @@ -180,11 +181,13 @@ Actor *func_802C8FE4(s32 arg0, f32 position[3], Actor *arg2){ s0->unk2C = 0; s0->unk2D = 1; s0->unk4 = sp74->unk0; - s0->unk2E = (sp74->unk0 & 0x1) ? (0.5 < randf()) : 0 ; - if(sp74->unk0 & 0x200){ + s0->unk2E = (sp74->unk0 & 0x1) ? (0.5 < randf()) : 0; + + if (sp74->unk0 & 0x200) { actor->unk5C = s0->unk8[1]; } }//L802C92E8 + return actor; } @@ -194,7 +197,7 @@ Actor *func_802C9334(s32 arg0, Actor * arg1){ } Actor *func_802C937C(s32 arg0, f32 position[3]){ - return func_802C8FE4(arg0, position, 0); + return func_802C8FE4(arg0, position, NULL); } bool func_802C939C(Actor *actor, f32 arg1[3], f32 arg2[3], f32 arg3[3], bool arg4) { From 249f5a73299f0767489438b9fe4066b8770676ed Mon Sep 17 00:00:00 2001 From: Nabnut Date: Sun, 22 Sep 2024 11:30:51 +0200 Subject: [PATCH 11/11] Renaming Juju --- include/enums.h | 4 +- include/functions.h | 2 +- include/prop.h | 2 +- manual_syms.pal.txt | 2 +- src/BGS/ch/code_2270.c | 4 +- src/BGS/ch/tanktup.c | 6 +- src/CC/code_3400.c | 2 +- src/CCW/ch/grublinhood.c | 4 +- src/CCW/code_2270.c | 6 +- src/CCW/code_3310.c | 6 +- src/CCW/code_4D00.c | 6 +- src/CCW/code_50D0.c | 6 +- src/CCW/code_5540.c | 8 +- src/CCW/code_5BF0.c | 6 +- src/CCW/code_6620.c | 6 +- src/CCW/code_6AC0.c | 6 +- src/CCW/code_6EC0.c | 6 +- src/FP/ch/boggy1.c | 6 +- src/FP/ch/boggy3.c | 8 +- src/FP/ch/wozza.c | 4 +- src/GV/ch/gobi1.c | 4 +- src/GV/ch/gobi2.c | 4 +- src/GV/ch/mazectrl.c | 14 +- src/GV/ch/sarcophagus.c | 6 +- src/GV/ch/trunker.c | 4 +- src/GV/code_3630.c | 8 +- src/GV/code_5570.c | 4 +- src/GV/code_6370.c | 10 +- src/GV/matchinggame.c | 2 +- src/GV/waterctrl.c | 6 +- src/MM/ch/conga.c | 4 +- src/MM/ch/hut.c | 2 +- src/MM/ch/juju.c | 283 +++++++++++++++++------------- src/MM/ch/jujuhitbox.c | 175 +++++++++--------- src/MM/ch/lmonkey.c | 6 +- src/MMM/ch/napper.c | 8 +- src/RBB/ch/anchorctrl.c | 2 +- src/RBB/ch/dolphin.c | 4 +- src/SM/ch/vegetables.c | 6 +- src/SM/code_2990.c | 6 +- src/TTC/ch/blubber.c | 8 +- src/TTC/ch/leaky.c | 4 +- src/TTC/ch/lockup.c | 4 +- src/TTC/ch/nipper.c | 8 +- src/core2/ba/marker.c | 2 +- src/core2/bs/bFly.c | 2 +- src/core2/bs/bLongLeg.c | 2 +- src/core2/bs/bShock.c | 4 +- src/core2/bs/bTrot.c | 4 +- src/core2/bs/croc.c | 2 +- src/core2/bs/jig.c | 2 +- src/core2/ch/bigbutt.c | 4 +- src/core2/ch/bottlesbonuscursor.c | 2 +- src/core2/ch/crab.c | 8 +- src/core2/ch/gameSelect.c | 4 +- src/core2/ch/mole.c | 6 +- src/core2/ch/snacker.c | 4 +- src/core2/ch/termite.c | 6 +- src/core2/code_4A6F0.c | 14 +- src/core2/code_53A10.c | 4 +- src/core2/code_85800.c | 2 +- src/core2/code_935F0.c | 6 +- src/core2/code_9E370.c | 2 +- src/core2/code_DA760.c | 8 +- src/core2/fx/honeycarrierscore.c | 2 +- src/fight/chbossjinjo.c | 2 +- src/fight/chbossjinjobase.c | 2 +- src/fight/chjinjonatorbase.c | 2 +- src/lair/ch/brentilda.c | 6 +- src/lair/code_0.c | 8 +- src/lair/code_86F0.c | 10 +- src/lair/code_9C40.c | 4 +- src/lair/code_A4A0.c | 2 +- src/lair/code_AD70.c | 4 +- src/lair/code_C1C0.c | 4 +- 75 files changed, 426 insertions(+), 390 deletions(-) diff --git a/include/enums.h b/include/enums.h index 9a70a738..be064f45 100644 --- a/include/enums.h +++ b/include/enums.h @@ -1364,7 +1364,7 @@ enum sfx_e SFX_3F2_UNKNOWN, //gold_chest_ttc SFX_3F5_UNKNOWN = 0x3F5, //RBB/code_5F80 - SFX_3F6_UNKNOWN, //lair/code_0 func_803880BC + SFX_3F6_RUBBING, //lair/code_0 func_803880BC SFX_3F7_UNKNOWN, //gv/histup SFX_3F8_UNKNOWN, //gv/histup SFX_3F9_UNKNOWN, //chmole @@ -2299,7 +2299,7 @@ enum mm_specific_flags { MM_SPECIFIC_FLAG_6_UNKNOWN = 0x6, MM_SPECIFIC_FLAG_8_HIT_WITH_ORANGE = 0x8, - MM_SPECIFIC_FLAG_9_UNKNOWN, + MM_SPECIFIC_FLAG_9_JUJU_HAS_HALF_TURNED, MM_SPECIFIC_FLAG_A_UNKNOWN }; diff --git a/include/functions.h b/include/functions.h index 646f11c8..c7ba59e2 100644 --- a/include/functions.h +++ b/include/functions.h @@ -393,7 +393,7 @@ void func_8030E0FC(u8, f32, f32, f32); f32 func_8030E200(u8); void func_8030E2C4(u8); void func_8030E394(u8 indx); -void func_8030E484(enum sfx_e uid); +void sfxsource_playHighPriority(enum sfx_e uid); void func_8030E4E4(enum sfx_e uid); void sfxsource_play(enum sfx_e uid, s32 sample_rate); void func_8030E540(enum sfx_e uid); diff --git a/include/prop.h b/include/prop.h index 08f6d612..ca7690a6 100644 --- a/include/prop.h +++ b/include/prop.h @@ -260,7 +260,7 @@ typedef struct actor_s{ u32 unk138_28:1; u32 unk138_27:2; u32 unk138_25:1; - u32 is_first_encounter:TRUE; + u32 has_met_before:1; u32 unk138_23:1; u32 unk138_22:1; u32 unk138_21:1; diff --git a/manual_syms.pal.txt b/manual_syms.pal.txt index 2c843d43..456c0acb 100644 --- a/manual_syms.pal.txt +++ b/manual_syms.pal.txt @@ -205,7 +205,7 @@ sfxsource_setSfxId = 0x8030dc20; sfxsource_setSampleRate = 0x8030dc5c; func_8030DBB4 = 0x8030dd54; func_8030E2C4 = 0x8030e464; -func_8030E484 = 0x8030e624; +sfxsource_playHighPriority = 0x8030e624; func_8030E58C = 0x8030e72c; func_8030E624 = 0x8030e7c4; func_8030E6A4 = 0x8030e844; diff --git a/src/BGS/ch/code_2270.c b/src/BGS/ch/code_2270.c index 73c7a4d6..c93898de 100644 --- a/src/BGS/ch/code_2270.c +++ b/src/BGS/ch/code_2270.c @@ -143,8 +143,8 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ skeletalAnim_set(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f); unqPtr->unkC = randf2(5.0f, 15.0f); - if (!this->is_first_encounter) { - this->is_first_encounter = TRUE; + if (!this->has_met_before) { + this->has_met_before = TRUE; if (unqPtr->unkA == 0) { gcdialog_showText(ASSET_C72_TEXT_UNKNOWN, 0xe, this->position, this->marker, func_80388784, 0); diff --git a/src/BGS/ch/tanktup.c b/src/BGS/ch/tanktup.c index 84b1e5a5..a8d65887 100644 --- a/src/BGS/ch/tanktup.c +++ b/src/BGS/ch/tanktup.c @@ -111,7 +111,7 @@ void func_8038F6A4(Actor *this) { nodeprop_getPosition(temp_v0, local->unk18); } - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; this->initialized = TRUE; } if (!this->volatile_initialized) @@ -138,12 +138,12 @@ void func_8038F6A4(Actor *this) case 1: func_8038F610(this); player_getPosition(sp48); - if (!this->is_first_encounter) + if (!this->has_met_before) { if ((((ml_distance_vec3f(local->unk18, sp48) < 250.0f) && (ml_distance_vec3f(local->unk18, sp48) > 80.0f)) && (!func_8028ECAC())) && (player_getTransformation() == TRANSFORM_1_BANJO)) { gcdialog_showText(0xC7E, 0, 0, 0, 0, 0); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } if (local->unk10) diff --git a/src/CC/code_3400.c b/src/CC/code_3400.c index 5df97f60..e728c5d5 100644 --- a/src/CC/code_3400.c +++ b/src/CC/code_3400.c @@ -43,7 +43,7 @@ void func_803897F0(Actor *this, s32 next_state){ if(next_state == 2){ func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, -1); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.9f, 29000); local->unk4 = 0.0f; } diff --git a/src/CCW/ch/grublinhood.c b/src/CCW/ch/grublinhood.c index 9f168294..23cf0c63 100644 --- a/src/CCW/ch/grublinhood.c +++ b/src/CCW/ch/grublinhood.c @@ -89,7 +89,7 @@ void __chgrublinhood_die(ActorMarker* marker, s32 arg1) { __chgrublinhood_emitHat(pCtrl, actor, ASSET_52D_MODEL_GRUBLIN_HOOD_HAT); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32,actor->position_x), reinterpret_cast(s32,actor->position_y), reinterpret_cast(s32,actor->position_z)); actor_collisionOff(actor); - actor->is_first_encounter = TRUE; + actor->has_met_before = TRUE; } Actor *chgrublinhood_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ @@ -109,7 +109,7 @@ Actor *chgrublinhood_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ func_8033A45C(11, (local->season < AUTUMN) ? 0 : (local->season == AUTUMN) ? 1 : 2); func_8033A45C(12, (local->season == WINTER) ? 2 : 1); func_8033A45C(13, (local->season == WINTER) ? 1 : 0); - func_8033A45C(14, (this->is_first_encounter)? FALSE : TRUE); + func_8033A45C(14, (this->has_met_before)? FALSE : TRUE); return actor_draw(marker, gfx, mtx, vtx); } diff --git a/src/CCW/code_2270.c b/src/CCW/code_2270.c index f17a802b..c740d882 100644 --- a/src/CCW/code_2270.c +++ b/src/CCW/code_2270.c @@ -137,7 +137,7 @@ void chGobiCCW_update(Actor *this) { this->volatile_initialized = TRUE; this->marker->propPtr->unk8_3 = TRUE; this->marker->actorFreeFunc = chGobiCCW_free; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; local->unk4 = skeletalAnim_new(); local->spit_model = assetcache_get(ASSET_3F3_MODEL_GOBI_SPIT); marker_setCollisionScripts(this->marker, 0, func_8038894C, 0); @@ -159,13 +159,13 @@ void chGobiCCW_update(Actor *this) { return; } if(this->state == 1){ - if (!this->is_first_encounter) { + if (!this->has_met_before) { player_getPosition(sp48); if (ml_distance_vec3f(this->position, sp48) < 600.0f) { if (local->unk0->unk2 != 0) { gcdialog_showText((s32) local->unk0->unk2, 4, NULL, NULL, NULL, NULL); } - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } } diff --git a/src/CCW/code_3310.c b/src/CCW/code_3310.c index 0c603822..2b85258c 100644 --- a/src/CCW/code_3310.c +++ b/src/CCW/code_3310.c @@ -214,7 +214,7 @@ void CCW_func_80389BFC(Actor *this) { if (!this->volatile_initialized) { this->volatile_initialized = TRUE; this->marker->propPtr->unk8_3 = TRUE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; this->position[0] = -4900.0f; this->position[1] = 4619.0f; this->position[2] = 0.0f; @@ -253,12 +253,12 @@ void CCW_func_80389BFC(Actor *this) { } if (this->state == 1) { player_getPosition(sp4C); - if( !this->is_first_encounter + if( !this->has_met_before && (local->unkC[2] >= 6500) && (sp4C[2] < 6500.0f) && (local->unk0->unk28 != 0) ){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; func_80324E38(0.0f, 3); timed_setStaticCameraToNode(0.0f, local->unk0->unk24); func_80324DBC(0.0f, local->unk0->unk28, 6, NULL, this->marker, func_80389700, NULL); diff --git a/src/CCW/code_4D00.c b/src/CCW/code_4D00.c index a3961621..757f50dc 100644 --- a/src/CCW/code_4D00.c +++ b/src/CCW/code_4D00.c @@ -61,7 +61,7 @@ void func_8038B19C(Actor *this) { if (!this->volatile_initialized) { this->volatile_initialized = TRUE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; func_8038B0F0(this, 1); } @@ -88,8 +88,8 @@ void func_8038B19C(Actor *this) { func_8038B0F0(this, 1); } } - if (!this->is_first_encounter && func_803292E0(this)) { - this->is_first_encounter = TRUE; + if (!this->has_met_before && func_803292E0(this)) { + this->has_met_before = TRUE; gcdialog_showText(0xCC8, 0, NULL, NULL, NULL, NULL); } func_8028E668(this->position, 300.0f, -50.0f, 120.0f); diff --git a/src/CCW/code_50D0.c b/src/CCW/code_50D0.c index 5a4c867f..501637dd 100644 --- a/src/CCW/code_50D0.c +++ b/src/CCW/code_50D0.c @@ -87,11 +87,11 @@ void func_8038B814(Actor *this, s32 next_state) { void func_8038B87C(Actor *this) { if (!this->volatile_initialized) { this->volatile_initialized = TRUE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; func_8038B814(this, 1); } - if (!this->is_first_encounter && func_803292E0(this)) { - this->is_first_encounter = TRUE; + if (!this->has_met_before && func_803292E0(this)) { + this->has_met_before = TRUE; gcdialog_showText(0xCC9, 0, NULL, NULL, NULL, NULL); } func_8028E668(this->position, 300.0f, -50.0f, 120.0f); diff --git a/src/CCW/code_5540.c b/src/CCW/code_5540.c index 5f64902c..355663ec 100644 --- a/src/CCW/code_5540.c +++ b/src/CCW/code_5540.c @@ -121,7 +121,7 @@ void chnabnut_update(Actor *this) { D_8038F350[1] = this->position[1]; D_8038F350[2] = this->position[2]; if (this->state == 0) { - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; local->returned_acorn_count = NULL; } chnabnut_setState(this, 1); @@ -133,15 +133,15 @@ void chnabnut_update(Actor *this) { if (this->state == NABNUT_STATE_1_SAD) { player_getPosition(sp30); - if (!this->is_first_encounter && (ml_distance_vec3f(this->position, sp30) < 400.0f)) { - this->is_first_encounter = TRUE; + if (!this->has_met_before && (ml_distance_vec3f(this->position, sp30) < 400.0f)) { + this->has_met_before = TRUE; gcdialog_showText(0xCCA, 0xE, this->position, NULL, NULL, NULL); } if (item_getCount(ITEM_23_ACORNS) > 0) { func_80258A4C(this->position, this->yaw - 90.0f, sp30, &sp2C, &sp28, &sp24); this->yaw += sp24 * 10.0f; } - if (this->is_first_encounter && !func_803114B0()) { + if (this->has_met_before && !func_803114B0()) { func_8028F364(this->position, 500.0f, 200.0f, ACTOR_2A9_ACORN, &this); if ((carriedObj_getActorId() == ACTOR_2A9_ACORN) && (ml_distance_vec3f(this->position, sp30) < 300.0f) && player_throwCarriedObject()) { func_8028FA54(D_8038F350); diff --git a/src/CCW/code_5BF0.c b/src/CCW/code_5BF0.c index 2988de7c..6f153fb4 100644 --- a/src/CCW/code_5BF0.c +++ b/src/CCW/code_5BF0.c @@ -93,7 +93,7 @@ void func_8038C41C(Actor *this) { if (!this->volatile_initialized) { this->marker->propPtr->unk8_3 = TRUE; this->volatile_initialized = TRUE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; return; } @@ -114,8 +114,8 @@ void func_8038C41C(Actor *this) { if ((this->marker->id == 0x1CB) && (this->state == 2)) { player_getPosition(sp2C); - if (!this->is_first_encounter && (ml_distance_vec3f(this->position, sp2C) < 400.0f)) { - this->is_first_encounter = TRUE; + if (!this->has_met_before && (ml_distance_vec3f(this->position, sp2C) < 400.0f)) { + this->has_met_before = TRUE; gcdialog_showText(0xCCD, 0, NULL, NULL, NULL, NULL); } } diff --git a/src/CCW/code_6620.c b/src/CCW/code_6620.c index fff4395c..12c63c00 100644 --- a/src/CCW/code_6620.c +++ b/src/CCW/code_6620.c @@ -91,7 +91,7 @@ void func_8038CC4C(Actor *this) { if (!this->volatile_initialized) { this->marker->propPtr->unk8_3 = TRUE; this->volatile_initialized = TRUE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; local->unk0 = &D_8038F490[0]; while(local->unk0->map_id != 0 && map_get() != local->unk0->map_id){ local->unk0++; @@ -113,12 +113,12 @@ void func_8038CC4C(Actor *this) { this->yaw += 30.0f * sp44; } } - if (!this->is_first_encounter) { + if (!this->has_met_before) { player_getPosition(sp38); if (ml_distance_vec3f(this->position, sp38) < 900.0f) { if (local->unk0->map_id != MAP_46_CCW_WINTER || func_8028F2FC()) { gcdialog_showText(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } } diff --git a/src/CCW/code_6AC0.c b/src/CCW/code_6AC0.c index 8a905765..b8fd4e2f 100644 --- a/src/CCW/code_6AC0.c +++ b/src/CCW/code_6AC0.c @@ -82,7 +82,7 @@ void func_8038CFB4(Actor *this) { if (!this->volatile_initialized) { this->marker->propPtr->unk8_3 = TRUE; this->volatile_initialized = TRUE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; func_8038CEB0(this, 1); if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY) != 0) { levelSpecificFlags_set(0x25, 1); @@ -114,11 +114,11 @@ void func_8038CFB4(Actor *this) { } if (this->state == 1) { - if (!this->is_first_encounter) { + if (!this->has_met_before) { player_getPosition(sp60); if (ml_distance_vec3f(this->position, sp60) < 900.0f) { gcdialog_showText(0xCCF, 4, NULL, NULL, NULL, NULL); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } if (levelSpecificFlags_get(0x25) != 0) { diff --git a/src/CCW/code_6EC0.c b/src/CCW/code_6EC0.c index 7ec1b9aa..dead429e 100644 --- a/src/CCW/code_6EC0.c +++ b/src/CCW/code_6EC0.c @@ -53,7 +53,7 @@ void func_8038D368(Actor *this) { if (!this->volatile_initialized) { this->marker->propPtr->unk8_3 = TRUE; this->volatile_initialized = TRUE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; local->unk0 = D_8038F600; while (local->unk0->map != 0 && map_get() != local->unk0->map) { local->unk0++; @@ -66,7 +66,7 @@ void func_8038D368(Actor *this) { return; } - if(!this->is_first_encounter){ + if(!this->has_met_before){ player_getPosition(plyr_pos); if (ml_distance_vec3f(this->position, plyr_pos) < 600.0f) { if (!jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) { @@ -76,7 +76,7 @@ void func_8038D368(Actor *this) { gcdialog_showText(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); } } - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } diff --git a/src/FP/ch/boggy1.c b/src/FP/ch/boggy1.c index d52a8d65..50e1ce2f 100644 --- a/src/FP/ch/boggy1.c +++ b/src/FP/ch/boggy1.c @@ -137,7 +137,7 @@ void func_8038794C(Actor *this){ switch(this->state){ case 1://L80387AB0 if(mapSpecificFlags_get(0xb)) - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; if(mapSpecificFlags_get(0x1)){ func_8028F94C(1, this->position); @@ -147,13 +147,13 @@ void func_8038794C(Actor *this){ break; }//L80387B38 - if(!this->is_first_encounter && func_80329530(this, 0x1f4)){ + if(!this->has_met_before && func_80329530(this, 0x1f4)){ if(!func_8028ECAC() || func_8028ECAC() == BSGROUP_8_TROT){ if (gcdialog_showText(ASSET_BFF_TEXT_UNKNOWN, 0x2a, this->position, NULL, NULL, NULL)) { for (i = 0; i < 5; i++) { timedFunc_set_1(D_80391BEC[i], (GenFunction_1) func_8038787C, (s32) this->marker); } - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } } diff --git a/src/FP/ch/boggy3.c b/src/FP/ch/boggy3.c index 93308808..6e245409 100644 --- a/src/FP/ch/boggy3.c +++ b/src/FP/ch/boggy3.c @@ -69,7 +69,7 @@ void func_80390388(Actor *this){ || jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS) || func_80390334() ){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } if( func_80329530(this, 0xFA) @@ -77,14 +77,14 @@ void func_80390388(Actor *this){ ){ if(0.0f == this->unk1C[0] && func_80390334()){ if(gcdialog_showText(ASSET_C1F_TEXT_UNKNOWN, 0xb, this->position, NULL, NULL, NULL)){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; this->unk1C[0] = 1.0f; } } else{ - if( !this->is_first_encounter ){ + if( !this->has_met_before ){ if(gcdialog_showText(ASSET_C1E_TEXT_UNKNOWN, 0x2b, this->position, NULL, NULL, NULL)){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } } diff --git a/src/FP/ch/wozza.c b/src/FP/ch/wozza.c index 045710f8..1441708f 100644 --- a/src/FP/ch/wozza.c +++ b/src/FP/ch/wozza.c @@ -299,10 +299,10 @@ void FP_func_8038F7AC(Actor *this){ break; } - if(func_80329530(this, 500) && !this->is_first_encounter){ + if(func_80329530(this, 500) && !this->has_met_before){ if(gcdialog_showText(0xc1c, 0xAA, this->position, this->marker, func_8038F330, func_8038F3C4)){ timed_setStaticCameraToNode(0.0f, 0x2E); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } break; }//L8038FD40 diff --git a/src/GV/ch/gobi1.c b/src/GV/ch/gobi1.c index 3479c443..c51819a6 100644 --- a/src/GV/ch/gobi1.c +++ b/src/GV/ch/gobi1.c @@ -176,13 +176,13 @@ void chGobi1_update(Actor *this){ } if(this->state == 1 || this->state == 2){ - if( !this->is_first_encounter + if( !this->has_met_before && func_80329530(this, 250) && !func_80329530(this, 80) && func_8028F2A0() && gcdialog_showText(0xa73, 0, NULL, NULL, NULL, NULL) ){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } }//L803877A4 diff --git a/src/GV/ch/gobi2.c b/src/GV/ch/gobi2.c index 5ca4ede1..d5cfc02f 100644 --- a/src/GV/ch/gobi2.c +++ b/src/GV/ch/gobi2.c @@ -200,11 +200,11 @@ void chGobi2_update(Actor *this){ }//L80388114 if(this->state == 2){ - if(!this->is_first_encounter){ + if(!this->has_met_before){ if(func_80329530(this, 0xFA) && !func_80329530(this, 0x50)){ if(func_8028F2A0()){ if(gcdialog_showText(ASSET_A75_TEXT_GOBI2_MEET, 0, this->position, NULL, NULL, NULL)) - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } } diff --git a/src/GV/ch/mazectrl.c b/src/GV/ch/mazectrl.c index 1e9fa19b..09479e43 100644 --- a/src/GV/ch/mazectrl.c +++ b/src/GV/ch/mazectrl.c @@ -69,9 +69,9 @@ void __chMazeCtrl_setState(Actor *this, s32 next_state){ item_set(ITEM_0_HOURGLASS_TIMER, 0xdd3); item_set(ITEM_6_HOURGLASS, TRUE); func_8038F520(1.0f); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.8f, 25000); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 25000); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.5f, 25000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.8f, 25000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.7f, 25000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.5f, 25000); if(1500.0f < plyr_pos[0]){ func_80324E38(0.0f, 3); timed_setStaticCameraToNode(0.0f, 8); @@ -104,10 +104,10 @@ void __chMazeCtrl_setState(Actor *this, s32 next_state){ }//L8038F850 if(next_state == 4){ - FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.8f, 29000); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 28000); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.5f, 31000); + FUNC_8030E624(SFX_3F6_RUBBING, 1.0f, 30000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.8f, 29000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.7f, 28000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.5f, 31000); func_8030E6D4(SFX_52_BANJO_YAH_OH); tmp_v0 = func_8034C528(400); if(tmp_v0){ diff --git a/src/GV/ch/sarcophagus.c b/src/GV/ch/sarcophagus.c index a96b3c1e..dd203a9c 100644 --- a/src/GV/ch/sarcophagus.c +++ b/src/GV/ch/sarcophagus.c @@ -74,7 +74,7 @@ void chSarcophagus_update(Actor *this){ if(func_80329530(this, 500) && func_8038957C(this)){ subaddie_set_state_with_direction(this, 2, 0.01f, 1); FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500); - FUNC_8030E8B4(SFX_3F6_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500); + FUNC_8030E8B4(SFX_3F6_RUBBING, 1.0f, 32000, this->position, 1250, 2500); } break; @@ -96,7 +96,7 @@ void chSarcophagus_update(Actor *this){ if(!func_80329530(this, 700)){ subaddie_set_state_with_direction(this, 4, 0.5f, 1); FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500); - FUNC_8030E8B4(SFX_3F6_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500); + FUNC_8030E8B4(SFX_3F6_RUBBING, 1.0f, 32000, this->position, 1250, 2500); } break; case 4: //L803897E4 @@ -134,7 +134,7 @@ void chSarcophagus_updateSNS(Actor *this){ if(this->unk1C[0] == 0.0f){ subaddie_set_state_with_direction(this, 5, 0.01f, 1); FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 0.5f, 32000, this->position, 1250, 2500); - FUNC_8030E8B4(SFX_3F6_UNKNOWN, 0.5f, 32000, this->position, 1250, 2500); + FUNC_8030E8B4(SFX_3F6_RUBBING, 0.5f, 32000, this->position, 1250, 2500); } } else{//L803899C0 diff --git a/src/GV/ch/trunker.c b/src/GV/ch/trunker.c index f77b7ad6..8beefe2b 100644 --- a/src/GV/ch/trunker.c +++ b/src/GV/ch/trunker.c @@ -69,13 +69,13 @@ void chTrucker_update(Actor *this){ } }//L803891D8 if( this->state == 1 - && !this->is_first_encounter + && !this->has_met_before && func_80329530(this, 250) && !func_80329530(this, 80) && func_8028F2A0() ){ gcdialog_showText(ASSET_A71_TEXT_TRUNKER_MEET, 0xe, this->position, NULL, NULL, NULL); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; }//L80389254 if(this->state == 1 && mapSpecificFlags_get(0xC)){ diff --git a/src/GV/code_3630.c b/src/GV/code_3630.c index 36c2e1bb..712f7ee2 100644 --- a/src/GV/code_3630.c +++ b/src/GV/code_3630.c @@ -30,7 +30,7 @@ void func_80389A20(ActorMarker *caller, enum asset_e text_id, s32 arg2){ void func_80389A60(Actor *this){ gcdialog_showText(ASSET_A70_TEXT_CHARMER_HELPED, 4, NULL, this->marker, func_80389A20, NULL); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; subaddie_set_state(this, 5); } @@ -48,7 +48,7 @@ void func_80389ABC(Actor *this){ void func_80389B1C(Actor *this){ if(!this->volatile_initialized){ this->lifetime_value = (f32) func_8038E184(); - this->is_first_encounter = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(0); + this->has_met_before = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(0); this->unk138_23 = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(2); this->volatile_initialized = TRUE; } @@ -62,9 +62,9 @@ void func_80389B1C(Actor *this){ animctrl_setTransitionDuration(this->animctrl, 0.15f); if(this->state == 1 || this->state == 2){ - if(! this->is_first_encounter && func_80329530(this, 250) && !func_80329530(this, 0x50)){ + if(! this->has_met_before && func_80329530(this, 250) && !func_80329530(this, 0x50)){ gcdialog_showText(ASSET_A6F_TEXT_CHARMER_MEET, 0xe, this->position, NULL, NULL, NULL); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; mapSpecificFlags_set(0, TRUE); } } diff --git a/src/GV/code_5570.c b/src/GV/code_5570.c index 64bd1dc5..49da160c 100644 --- a/src/GV/code_5570.c +++ b/src/GV/code_5570.c @@ -244,9 +244,9 @@ void GV_func_8038BEA0(Actor *this){ } } else{ - if(!this->is_first_encounter){ + if(!this->has_met_before){ if(gcdialog_showText(ASSET_A78_TEXT_GRABBA_MEET, 0, NULL, NULL, NULL, NULL)){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } } diff --git a/src/GV/code_6370.c b/src/GV/code_6370.c index de91efd6..da914b73 100644 --- a/src/GV/code_6370.c +++ b/src/GV/code_6370.c @@ -44,9 +44,9 @@ ActorInfo D_8039123C = { 0xBB, 0x287, 0x3E6, void func_8038C760(Actor *this, s32 arg1){ ActorLocal_GV_6370 *local = (ActorLocal_GV_6370 *)&this->local; chBuriedPyramid_setRaisedAmount(local->unk14, arg1); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 28000); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000); - FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.7f, 28000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.9f, 29000); + FUNC_8030E624(SFX_3F6_RUBBING, 1.0f, 30000); timed_setStaticCameraToNode(0.0f, 8); if(arg1 < 3){ timed_setStaticCameraToNode(3.5f, arg1 + 0x15); @@ -95,7 +95,7 @@ void func_8038C8A0(Actor *this, s32 next_state){ local->unk18[2] = this->position_z; if(this->state == 1){ rumbleManager_80250E94(0.0f, 0.6f, 1.0f, 0, 1.3f, 0.0f); - timed_playSfx(1.0f, SFX_3F6_UNKNOWN, 0.8f, 30000); + timed_playSfx(1.0f, SFX_3F6_RUBBING, 0.8f, 30000); } }//L8038CA6C @@ -126,7 +126,7 @@ void func_8038C8A0(Actor *this, s32 next_state){ local->unk18[1] = this->position_y; local->unk18[2] = this->position_z; rumbleManager_80250D94(0.7f, 0.5f, 1.3f); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.8f, 30000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.8f, 30000); } if(next_state == 8){ diff --git a/src/GV/matchinggame.c b/src/GV/matchinggame.c index 5b64b5a3..0c19443b 100644 --- a/src/GV/matchinggame.c +++ b/src/GV/matchinggame.c @@ -53,7 +53,7 @@ Struct_GV_9DB0_1 * func_803901A0(s32 arg0){ } void func_803901F0(void *arg0){ - FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000); + FUNC_8030E624(SFX_3F6_RUBBING, 1.0f, 30000); } void func_80390218(void *arg0){ diff --git a/src/GV/waterctrl.c b/src/GV/waterctrl.c index 7c5736ff..19b0a3d7 100644 --- a/src/GV/waterctrl.c +++ b/src/GV/waterctrl.c @@ -29,9 +29,9 @@ void __waterCtrl_setState(s32 arg0){ func_80324E38(6.0f, 0); tmp_v0 = func_8034C528(400); if(tmp_v0){ - func_8030E760(SFX_3F6_UNKNOWN, 0.7f, 28000); - func_8030E760(SFX_3F6_UNKNOWN, 0.9f, 29000); - func_8030E760(SFX_3F6_UNKNOWN, 1.0f, 30000); + func_8030E760(SFX_3F6_RUBBING, 0.7f, 28000); + func_8030E760(SFX_3F6_RUBBING, 0.9f, 29000); + func_8030E760(SFX_3F6_RUBBING, 1.0f, 30000); func_8034DE60(tmp_v0, 0.0f, 400.0f, 2.5f, 1); } } diff --git a/src/MM/ch/conga.c b/src/MM/ch/conga.c index 6d44e77a..3327b4a9 100644 --- a/src/MM/ch/conga.c +++ b/src/MM/ch/conga.c @@ -255,9 +255,9 @@ void func_803876D0(Actor *this){ mapSpecificFlags_set(MM_SPECIFIC_FLAG_A_UNKNOWN, TRUE); }//L803878F8 - if( sp3C && !this->is_first_encounter){ + if( sp3C && !this->has_met_before){ if(gcdialog_showText((player_getTransformation()== TRANSFORM_2_TERMITE) ? ASSET_B3E_TEXT_CONGA_MEET_AS_TERMITE : ASSET_B3C_TEXT_CONGA_MEET, 0, this->position, 0,0,0)){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } //L80387968 diff --git a/src/MM/ch/hut.c b/src/MM/ch/hut.c index 5e065263..8235ea43 100644 --- a/src/MM/ch/hut.c +++ b/src/MM/ch/hut.c @@ -79,7 +79,7 @@ void chhut_update(Actor *this) { diff_pos[2] = this->position_z; diff_pos[1] += 125.0; - func_8030E484(SFX_5B_HEAVY_STUFF_FALLING); + sfxsource_playHighPriority(SFX_5B_HEAVY_STUFF_FALLING); subaddie_set_state(this, HUT_STATE_1_DAMAGED); actor_playAnimationOnce(this); __spawnQueue_add_1((GenFunction_1) __chhut_spawnExplosion, (s32) this->marker); diff --git a/src/MM/ch/juju.c b/src/MM/ch/juju.c index da46f9c5..5d77fba5 100644 --- a/src/MM/ch/juju.c +++ b/src/MM/ch/juju.c @@ -3,91 +3,106 @@ #include "variables.h" /* extern functions */ -int func_80353064(f32*, f32); -void func_802BB3DC(s32, f32, f32); +int func_80353064(f32 *, f32); +void func_802BB3DC(s32, f32, f32); -typedef struct{ - s32 unk0; - s32 unk4; - TUPLE(f32, unk8); - f32 unk14; - s32 unk18; -}ActorLocal_Juju_2; +typedef struct { + s32 animation_state; + s32 animation_countdown; + TUPLE(f32, next_pos); + f32 scale; + s32 unk18; +} ActorLocal_Juju_2; /* public functions */ -void func_80389598(Actor *this); -Actor* func_80389014(ActorMarker *, Gfx **, Mtx**, Vtx** ); +void chjuju_update(Actor *this); +Actor *chjuju_draw(ActorMarker *, Gfx **, Mtx **, Vtx **); /* .bss */ u8 MM_pad_80389C80[0x10]; -s32 MM_D_80389C90; +s32 mm_juju_count; /* .data */ -ActorInfo chjujuInfo = { MARKER_67_JUJU, ACTOR_59_JUJU, ASSET_2E6_MODEL_JUJU, +enum chjuju_animation_state_e { + JUJU_ANIMATION_STATE_1_YAWING = 1, + JUJU_ANIMATION_STATE_2_DESPAWNED, + JUJU_ANIMATION_STATE_3_WAITING_TO_FALL, + JUJU_ANIMATION_STATE_4_FALLING, + JUJU_ANIMATION_STATE_5_DISAPPEARING +}; + +ActorInfo chjujuInfo = { + MARKER_67_JUJU, ACTOR_59_JUJU, ASSET_2E6_MODEL_JUJU, 0, NULL, - func_80389598, func_80326224, func_80389014, + chjuju_update, func_80326224, chjuju_draw, 0, 0, 0.0f, 0 }; -void func_80388FD0(Actor *this, f32 *arg1, f32 *arg2, s32 arg3){ +/* .code */ +void __chjuju_initialize(Actor *this, f32 *arg1, f32 *arg2, s32 animationState) { ActorLocal_Juju_2 *local; - local = (ActorLocal_Juju_2 *)&this->local; - local->unk0 = arg3; - local->unk14 = 1.0f; + local = (ActorLocal_Juju_2 *) &this->local; + local->animation_state = animationState; + local->scale = 1.0f; this->position_x = arg1[0]; this->position_y = arg1[1]; this->position_z = arg1[2]; - - local->unk8_x = arg2[0]; - local->unk8_y = arg2[1]; - local->unk8_z = arg2[2]; + + local->next_pos_x = arg2[0]; + local->next_pos_y = arg2[1]; + local->next_pos_z = arg2[2]; } -Actor* func_80389014(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg2){ +Actor *chjuju_draw(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg2) { f32 rotation[3]; - Actor * actorPtr; + Actor *actorPtr; ActorLocal_Juju_2 *jujuPtr; actorPtr = marker_getActorAndRotation(this, rotation); - jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local; - if(jujuPtr->unk0 != 2){ + jujuPtr = (ActorLocal_Juju_2 *) &actorPtr->local; + + if (jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) { modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); - modelRender_draw(dl, mPtr, actorPtr->position, rotation, jujuPtr->unk14, NULL, marker_loadModelBin(this)); + modelRender_draw(dl, mPtr, actorPtr->position, rotation, jujuPtr->scale, NULL, marker_loadModelBin(this)); } + return actorPtr; } -void func_803890A0(ActorMarker *marker, s32 arg1){ - int s1; - Actor* actorPtr = marker_getActor(marker); +void __chjuju_initialize_all(ActorMarker *marker, s32 count) { + int should_spawn; + Actor *actorPtr = marker_getActor(marker); f32 position[3]; s32 i; - Actor* jujuPtr; + Actor *jujuPtr; position[0] = actorPtr->position_x; position[1] = actorPtr->position_y; position[2] = actorPtr->position_z; - for(i = 0; i < 4; i++){ + + for (i = 0; i < 4; i++) { jujuPtr = spawn_actor_f32(ACTOR_59_JUJU, actorPtr->position, actorPtr->yaw); jujuPtr->marker->collidable = FALSE; + actorPtr = marker_getActor(marker); - func_80388DE8(actorPtr, i, jujuPtr); + chjujuhitbox_setJuju(actorPtr, i, jujuPtr); - s1 = (i >= arg1); - func_80388FD0(jujuPtr, position, actorPtr->position, (s1)? 1 : 2); + should_spawn = (i >= count); + __chjuju_initialize(jujuPtr, position, actorPtr->position, should_spawn ? JUJU_ANIMATION_STATE_1_YAWING : JUJU_ANIMATION_STATE_2_DESPAWNED); - if(s1){ + if (should_spawn) { position[1] += 250.0f; } - if(i == arg1){ - ((ActorLocal_Juju_2 *)&jujuPtr->local)->unk18 = 1; + + if (i == count) { + ((ActorLocal_Juju_2 *) &jujuPtr->local)->unk18 = TRUE; } } } -void func_803891E8(s32 x, s32 y, s32 z, s32 yaw){ +void __chjuju_spawnJiggy(s32 x, s32 y, s32 z, s32 yaw) { f32 sp1C[3]; sp1C[0] = x; sp1C[1] = y + 0x14; @@ -95,13 +110,13 @@ void func_803891E8(s32 x, s32 y, s32 z, s32 yaw){ jiggy_spawn(JIGGY_4_MM_JUJU, sp1C); } -void func_80389244(s32 x, s32 y, s32 z, s32 yaw){ - __spawnQueue_add_4((GenFunction_4)func_803891E8, x, y, z, yaw); +void __chjuju_solvePuzzle(s32 x, s32 y, s32 z, s32 yaw) { + __spawnQueue_add_4((GenFunction_4) __chjuju_spawnJiggy, x, y, z, yaw); func_802BB3DC(0, 10.0f, 0.8f); gcpausemenu_80314AC8(1); } -void func_803892A8(ActorMarker **ptr){ +void func_803892A8(ActorMarker **ptr) { s32 i; s32 j; s32 s2; @@ -109,123 +124,141 @@ void func_803892A8(ActorMarker **ptr){ Actor *actorPtr; ActorLocal_Juju_2 *jujuPtr; - for(i = 0; i < 4; i++){ + for (i = 0; i < 4; i++) { actorPtr = marker_getActor(ptr[i]); - jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local; - if(jujuPtr->unk0 != 2){ - jujuPtr->unk0 = 5; - jujuPtr->unk4 = 0xC; - func_8030E484(0x3f6); - if(i == 3){ + jujuPtr = (ActorLocal_Juju_2 *) &actorPtr->local; + + if (jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) { + jujuPtr->animation_state = JUJU_ANIMATION_STATE_5_DISAPPEARING; + jujuPtr->animation_countdown = 12; + sfxsource_playHighPriority(0x3f6); + + if (i == 3) { gcpausemenu_80314AC8(0); - timedFunc_set_4(1.25f, func_80389244, jujuPtr->unk8_x, jujuPtr->unk8_y, jujuPtr->unk8_z, actorPtr->yaw); + timedFunc_set_4(1.25f, __chjuju_solvePuzzle, jujuPtr->next_pos_x, jujuPtr->next_pos_y, jujuPtr->next_pos_z, actorPtr->yaw); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x6d60); } - else{//L80389384 + else {//L80389384 func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff); } - for(s2 = 3, j = i + 1; j < 4; s2+=5, j++){ - actorPtr = marker_getActor(ptr[j]); - jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local; - if(j == i+1){ - jujuPtr->unk18 = 1; - } - jujuPtr->unk4 = s2; - jujuPtr->unk0 = 3; + for (s2 = 3, j = i + 1; j < 4; s2 += 5, j++) { + actorPtr = marker_getActor(ptr[j]); + jujuPtr = (ActorLocal_Juju_2 *) &actorPtr->local; + + if (j == i + 1) { + jujuPtr->unk18 = TRUE; + } + + jujuPtr->animation_countdown = s2; + jujuPtr->animation_state = JUJU_ANIMATION_STATE_3_WAITING_TO_FALL; } return; } } } -int func_8038941C(ActorMarker **ptr){ +bool __chjuju_isEveryJujuDespawned(ActorMarker **ptr) { s32 i; ActorLocal_Juju_2 *jujuPtr; - for(i = 0; i < 4; i++){ - jujuPtr = (ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local; - if(jujuPtr->unk0 != 2) - return 0; + for (i = 0; i < 4; i++) { + jujuPtr = (ActorLocal_Juju_2 *) &marker_getActor(ptr[i])->local; + + if (jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) { + return FALSE; + } } - return 1; + + return TRUE; } -int func_8038948C(ActorMarker **ptr){ +bool __chjuju_isEveryJujuStable(ActorMarker **ptr) { s32 i; ActorLocal_Juju_2 *jujuPtr; - for(i = 0; i < 4; i++){ - jujuPtr = (ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local; - if(jujuPtr->unk0 != 1 && jujuPtr->unk0 != 2) - return 0; + for (i = 0; i < 4; i++) { + jujuPtr = (ActorLocal_Juju_2 *) &marker_getActor(ptr[i])->local; + + if (jujuPtr->animation_state != JUJU_ANIMATION_STATE_1_YAWING && jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) { + return FALSE; + } } - return 1; + + return TRUE; } -void func_80389514(ActorMarker **ptr){ +void __chjuju_updateCount(ActorMarker **ptr) { s32 i; - MM_D_80389C90 = 0; - for(i = 0; i < 4; i++){ - if(((ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local)->unk0 != 2){ - MM_D_80389C90++; - }; + mm_juju_count = 0; + + for (i = 0; i < 4; i++) { + if (((ActorLocal_Juju_2 *) &marker_getActor(ptr[i])->local)->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) { + mm_juju_count++; + } } } -void func_80389598(Actor *this){ - ActorLocal_Juju_2 *jujuPtr = (ActorLocal_Juju_2 *)&this->local; - s32 sp38 = 0; - f32 sp34; - f32 sp28[3]; - - this->marker->propPtr->unk8_3 = (jujuPtr->unk0 != 2) && (jujuPtr->unk0 != 5); +void chjuju_update(Actor *this) { + ActorLocal_Juju_2 *jujuPtr = (ActorLocal_Juju_2 *) &this->local; + s32 has_completed_full_turn = FALSE; + f32 previous_yaw; + f32 pos_offset[3]; - switch(jujuPtr->unk0){ - case 1: //L80389624 - sp34 = this->yaw; - this->yaw += ((0xb - MM_D_80389C90*2)*time_getDelta()*60.0f)/2; - if(360.0f < this->yaw){ - sp38 = 1; + this->marker->propPtr->unk8_3 = (jujuPtr->animation_state != JUJU_ANIMATION_STATE_2_DESPAWNED) && (jujuPtr->animation_state != JUJU_ANIMATION_STATE_5_DISAPPEARING); + + switch (jujuPtr->animation_state) { + case JUJU_ANIMATION_STATE_1_YAWING: //L80389624 + previous_yaw = this->yaw; + this->yaw += ((11 - mm_juju_count * 2) * time_getDelta() * 60.0f) / 2; + + if (360.0f < this->yaw) { + has_completed_full_turn = TRUE; this->yaw -= 360.0f; }//L803896B4 - if(jujuPtr->unk18){ - if(sp38 || (sp34 < 180.0f && 180.0f <= this->yaw)){ - mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_UNKNOWN, TRUE); + + if (jujuPtr->unk18 && (has_completed_full_turn || (previous_yaw < 180.0f && 180.0f <= this->yaw))) { + mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_JUJU_HAS_HALF_TURNED, TRUE); + } + break; + + case JUJU_ANIMATION_STATE_3_WAITING_TO_FALL: //L80389700 + if (--jujuPtr->animation_countdown == 0) { + jujuPtr->animation_state = JUJU_ANIMATION_STATE_4_FALLING; + jujuPtr->next_pos_y = this->position_y - 250.0f; + } + break; + + case JUJU_ANIMATION_STATE_5_DISAPPEARING: //L80389738 + jujuPtr->animation_countdown--; + jujuPtr->scale *= 0.85; + + pos_offset[0] = 100.0f; + pos_offset[1] = 0.0f; + pos_offset[2] = 0.0f; + ml_vec3f_yaw_rotate_copy(pos_offset, pos_offset, this->yaw + 90.0); + + this->position_x += pos_offset[0]; + this->position_y += pos_offset[1]; + this->position_z += pos_offset[2]; + + if (!jujuPtr->animation_countdown) { + jujuPtr->animation_state = JUJU_ANIMATION_STATE_2_DESPAWNED; + } + break; + + case JUJU_ANIMATION_STATE_4_FALLING: //L803897F8 + this->position_y -= 25.0; + + if (jujuPtr->next_pos_y == this->position_y) { + jujuPtr->animation_state = JUJU_ANIMATION_STATE_1_YAWING; + sfxsource_playHighPriority(SFX_3_DULL_CANNON_SHOT); + func_802BB3DC(0, 10.0f, 0.8f); + + if (jujuPtr->unk18) { + func_80353064(this->position, 24.0f); } } break; - case 3: //L80389700 - if(--jujuPtr->unk4 == 0){ - jujuPtr->unk0 = 4; - jujuPtr->unk8_y = this->position_y - 250.0f; - } - break; - case 5: //L80389738 - jujuPtr->unk4--; - jujuPtr->unk14 *= 0.85; - {sp28[0] = 100.0f; - sp28[1] = 0.0f; - sp28[2] = 0.0f;} - ml_vec3f_yaw_rotate_copy(sp28, sp28, this->yaw + 90.0); - this->position_x += sp28[0]; - this->position_y += sp28[1]; - this->position_z += sp28[2]; - if(!jujuPtr->unk4){ - jujuPtr->unk0 = 2; - } - break; - case 4: //L803897F8 - this->position_y -= 25.0; - if(jujuPtr->unk8_y == this->position_y){ - jujuPtr->unk0 = 1; - func_8030E484(SFX_3_DULL_CANNON_SHOT); - func_802BB3DC(0, 10.0f, 0.8f); - if(jujuPtr->unk18) - func_80353064(this->position, 24.0f); - } - break; - }//L8038987C } - diff --git a/src/MM/ch/jujuhitbox.c b/src/MM/ch/jujuhitbox.c index d2490515..9e3ad8b5 100644 --- a/src/MM/ch/jujuhitbox.c +++ b/src/MM/ch/jujuhitbox.c @@ -4,161 +4,164 @@ #include "variables.h" /* extern functions */ -void func_80388DFC(ActorMarker *, s32); -s32 func_80329784(Actor *); +void __chjujuhitbox_initialize_all(ActorMarker *, s32); +s32 func_80329784(Actor *); void func_80353580(ActorMarker *); -typedef struct juju_hitbox_s{ - u8 pad0[0x4]; - s32 unk4; - ActorMarker *unk8[4]; - f32 unk18; -}ActorLocal_JujuHitbox; +typedef struct juju_hitbox_s { + u8 pad0[0x4]; + s32 unk4; + ActorMarker *jujus[4]; + f32 unk18; +} ActorLocal_JujuHitbox; /* public functions */ -void func_80388E20(Actor *this); -Actor* func_80388DC0(ActorMarker *, Gfx **, Mtx**, Vtx **); -void func_80388DE8(Actor* this, s32 slave_id, Actor *slavePtr); +void chjujuhitbox_update(Actor *this); +Actor *chjujuhitbox_draw(ActorMarker *, Gfx **, Mtx **, Vtx **); +void chjujuhitbox_setJuju(Actor *this, s32 slave_id, Actor *slavePtr); /* .data */ -ActorInfo chjujuhitboxInfo = { MARKER_67_JUJU, ACTOR_11_JUJU_CTRL, 0, +ActorInfo chjujuhitboxInfo = { + MARKER_67_JUJU, ACTOR_11_JUJU_CTRL, 0, 3, NULL, - func_80388E20, func_80326224, func_80388DC0, + chjujuhitbox_update, func_80326224, chjujuhitbox_draw, 0, 0, 0.0f, 0 }; -int func_80388B30(Actor *this, float arg1){ +/* code */ +bool func_80388B30(Actor *this, float arg1) { f32 yaw; yaw = this->yaw - func_80329784(this); - if(180.0f <= yaw){ + if (180.0f <= yaw) { yaw -= 360.0f; } - else if(yaw < -180.0f){ + else if (yaw < -180.0f) { yaw += 360.0f; } - if (yaw < 0.0f){ + if (yaw < 0.0f) { yaw = -yaw; } - if (yaw < arg1){ - return 1; + if (yaw < arg1) { + return TRUE; } - return 0; + + return FALSE; } -void func_80388BEC(NodeProp *node, ActorMarker *marker){ +void func_80388BEC(NodeProp *node, ActorMarker *marker) { f32 distance_to_closest_actor; Actor *closest_actor; Actor *temp_v0; f32 position[3]; - - position[0] = (f32)node->x; - position[1] = (f32)node->y; - position[2] = (f32)node->z; + position[0] = (f32) node->x; + position[1] = (f32) node->y; + position[2] = (f32) node->z; - closest_actor = actorArray_findClosestActorFromActorId(position, 0x11, -1, &distance_to_closest_actor); + closest_actor = actorArray_findClosestActorFromActorId(position, ACTOR_11_JUJU_CTRL, -1, &distance_to_closest_actor); - if( closest_actor != NULL - && !( distance_to_closest_actor > 500.0f ) - && (closest_actor->state ==3) - ){ - temp_v0 = marker_getActor(((ActorLocal_JujuHitbox *)&closest_actor->local)->unk8[((ActorLocal_JujuHitbox *)&closest_actor->local)->unk4]); + if (closest_actor != NULL + && !(distance_to_closest_actor > 500.0f) + && (closest_actor->state == 3) + ) { + temp_v0 = marker_getActor(((ActorLocal_JujuHitbox *) &closest_actor->local)->jujus[((ActorLocal_JujuHitbox *) &closest_actor->local)->unk4]); - if(temp_v0 != NULL){ - if(func_80388B30(temp_v0, 90.0f)){ + if (temp_v0 != NULL) { + if (func_80388B30(temp_v0, 90.0f)) { closest_actor->state = 1; - ((ActorLocal_JujuHitbox *)&closest_actor->local)->unk4++; - func_803892A8(((ActorLocal_JujuHitbox *)&closest_actor->local)->unk8); + ((ActorLocal_JujuHitbox *) &closest_actor->local)->unk4++; + func_803892A8(((ActorLocal_JujuHitbox *) &closest_actor->local)->jujus); func_80353580(marker); - __spawnQueue_add_4((GenFunction_4)func_802C4140, 0x58, *(s32 *)&position[0], *(s32 *)&position[1], *(s32 *)&position[2]); + __spawnQueue_add_4((GenFunction_4) func_802C4140, 0x58, *(s32 * ) & position[0], *(s32 * ) & position[1], *(s32 * ) & position[2]); } } } } -void func_80388D14(Actor *this){ +void __chjujuhitbox_playRubbingSfx(Actor *this) { ActorLocal_JujuHitbox *jujuCtlPtr; - jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local; - func_8030E878(0x3F6, jujuCtlPtr->unk18, 20000, this->position, 300.0f, 2000.0f); + jujuCtlPtr = (ActorLocal_JujuHitbox *) &this->local; + func_8030E878(SFX_3F6_RUBBING, jujuCtlPtr->unk18, 20000, this->position, 300.0f, 2000.0f); } -void func_80388D60(Actor *this){ +void func_80388D60(Actor *this) { ActorLocal_JujuHitbox *jujuCtlPtr; - jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local; - if(!func_8038941C(jujuCtlPtr->unk8)){ + jujuCtlPtr = (ActorLocal_JujuHitbox *) &this->local; + + if (!__chjuju_isEveryJujuDespawned(jujuCtlPtr->jujus)) { jujuCtlPtr->unk18 *= 1.05; } + this->state = 3; } -Actor* func_80388DC0(ActorMarker *this, Gfx **dl, Mtx**mPtr, Vtx **arg3){ +Actor *chjujuhitbox_draw(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg3) { return marker_getActor(this); } -void func_80388DE8(Actor *this, s32 child_id, Actor *childPtr){ +void chjujuhitbox_setJuju(Actor *this, s32 child_id, Actor *childPtr) { ActorLocal_JujuHitbox *jujuCtlPtr; - jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local; - jujuCtlPtr->unk8[child_id] = childPtr->marker; + jujuCtlPtr = (ActorLocal_JujuHitbox *) &this->local; + jujuCtlPtr->jujus[child_id] = childPtr->marker; } -void func_80388DFC(ActorMarker *arg0, s32 arg1){ - func_803890A0(arg0, arg1); +void __chjujuhitbox_initialize_all(ActorMarker *marker, s32 count) { + __chjuju_initialize_all(marker, count); - if(arg0 && arg1); //for args to save + if (marker && count); //for args to save } -void func_80388E20(Actor *this){ +void chjujuhitbox_update(Actor *this) { ActorLocal_JujuHitbox *jujuCtlPtr; s32 i; - jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local; - if(!this->initialized){ + jujuCtlPtr = (ActorLocal_JujuHitbox *) &this->local; + + if (!this->initialized) { this->initialized = TRUE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; jujuCtlPtr->unk18 = 0.5f; } - if(!this->volatile_initialized){ + + if (!this->volatile_initialized) { this->volatile_initialized = TRUE; - __spawnQueue_add_2((GenFunction_2)func_80388DFC,this->marker, jujuCtlPtr->unk4); - func_80388D14(this); - }else{ - if( func_80329530(this, 0xfa) - && !func_80329530(this, 0x50) - && !func_8028ECAC() - ){ - if( !this->is_first_encounter ){ - if(gcdialog_showText(ASSET_B44_TEXT_JUJU_MEET, 0, 0, 0, NULL, NULL)){ - this->is_first_encounter = TRUE; - } - } - } + __spawnQueue_add_2((GenFunction_2) __chjujuhitbox_initialize_all, this->marker, jujuCtlPtr->unk4); + __chjujuhitbox_playRubbingSfx(this); + return; + } - if(this->state == 1){ - if(func_8038948C(jujuCtlPtr->unk8)){ - func_80388D60(this); - } - if(func_8038941C(jujuCtlPtr->unk8)){ - marker_despawn(this->marker); - for(i = 0; i < 4; i++){ - marker_despawn(jujuCtlPtr->unk8[i]); - } - return; - } - } - else{ - func_80389514(jujuCtlPtr->unk8); - } - - if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_9_UNKNOWN)) { - func_80388D14(this); - mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_UNKNOWN, FALSE); + if (func_80329530(this, 0xfa) && !func_80329530(this, 0x50) && !func_8028ECAC()) { + if (!this->has_met_before && gcdialog_showText(ASSET_B44_TEXT_JUJU_MEET, 0, 0, 0, NULL, NULL)) { + this->has_met_before = TRUE; } } + + if (this->state == 1) { + if (__chjuju_isEveryJujuStable(jujuCtlPtr->jujus)) { + func_80388D60(this); + } + + if (__chjuju_isEveryJujuDespawned(jujuCtlPtr->jujus)) { + marker_despawn(this->marker); + for (i = 0; i < 4; i++) { + marker_despawn(jujuCtlPtr->jujus[i]); + } + return; + } + } + else { + __chjuju_updateCount(jujuCtlPtr->jujus); + } + + if (mapSpecificFlags_get(MM_SPECIFIC_FLAG_9_JUJU_HAS_HALF_TURNED)) { + __chjujuhitbox_playRubbingSfx(this); + mapSpecificFlags_set(MM_SPECIFIC_FLAG_9_JUJU_HAS_HALF_TURNED, FALSE); + } } diff --git a/src/MM/ch/lmonkey.c b/src/MM/ch/lmonkey.c index a67fd8b8..a986bcdf 100644 --- a/src/MM/ch/lmonkey.c +++ b/src/MM/ch/lmonkey.c @@ -48,7 +48,7 @@ void __chlmonkey_updateBringOrange(Actor **this_ptr) { player_throwCarriedObject()) { func_8028FA34(0xc6, *this_ptr); - (*this_ptr)->is_first_encounter = TRUE; + (*this_ptr)->has_met_before = TRUE; timed_setStaticCameraToNode(1.2f, 0xF); func_80324E38(1.2f, 3); } @@ -120,10 +120,10 @@ void chlmonkey_update(Actor *this) { if (func_80329530(this, 345) && !func_80329530(this, 150) && !item_getCount(ITEM_19_ORANGE) && - !this->is_first_encounter) { + !this->has_met_before) { gcdialog_showText(ASSET_B3F_DIALOG_CHIMPY_MEET, 0xe, this->position, NULL, NULL, NULL); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; }//L80388774 actor_loopAnimation(this); diff --git a/src/MMM/ch/napper.c b/src/MMM/ch/napper.c index d2e8e042..159e8841 100644 --- a/src/MMM/ch/napper.c +++ b/src/MMM/ch/napper.c @@ -42,11 +42,11 @@ void __chnapper_setState(Actor *this, s32 next_state){ if(next_state == 3){ skeletalAnim_set(this->unk148, ASSET_A5_ANIM_NAPPER_WALK, 0.2f, 1.5f); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); - func_8030E484(SFX_41_MUMBO_ERGHHH); + sfxsource_playHighPriority(SFX_41_MUMBO_ERGHHH); } if(next_state == 4){ - func_8030E484(SFX_C_TAKING_FLIGHT_LIFTOFF); + sfxsource_playHighPriority(SFX_C_TAKING_FLIGHT_LIFTOFF); func_803895B0(0); } @@ -62,9 +62,9 @@ void __chnapper_setState(Actor *this, s32 next_state){ void func_80386ACC(ActorMarker *this_marker, ActorMarker *other_marker){ Actor *this = marker_getActor(this_marker); - if(!this->is_first_encounter){ + if(!this->has_met_before){ if(gcdialog_showText(0xad8, 0, NULL, NULL, NULL, NULL)){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } } diff --git a/src/RBB/ch/anchorctrl.c b/src/RBB/ch/anchorctrl.c index 935a2bec..81de593e 100644 --- a/src/RBB/ch/anchorctrl.c +++ b/src/RBB/ch/anchorctrl.c @@ -42,7 +42,7 @@ void __chAnchorCtrl_setState(Actor *this, s32 new_state){ func_80324E38(0.0f, 3); timedFunc_set_0(1.0f, func_8038C000); timedFunc_set_2(1.0f, (GenFunction_2)mapSpecificFlags_set, 8, TRUE); - timed_playSfx(2.1f, SFX_3F6_UNKNOWN, 0.6f, 32700); + timed_playSfx(2.1f, SFX_3F6_RUBBING, 0.6f, 32700); timedFunc_set_2(2.7f, (GenFunction_2)mapSpecificFlags_set, 4, TRUE); timedFunc_set_0(3.0f, func_8038C058); func_80324DBC(3.0f, 0xb9C, 7, NULL, this->marker, __chAnchorCtrl_spawnJiggy, NULL); diff --git a/src/RBB/ch/dolphin.c b/src/RBB/ch/dolphin.c index 369d4f93..8024a7ef 100644 --- a/src/RBB/ch/dolphin.c +++ b/src/RBB/ch/dolphin.c @@ -85,12 +85,12 @@ void func_8038B900(Actor *this){ } if(this->state == 1){ - if( !this->is_first_encounter + if( !this->has_met_before && func_80329530(this, 0x258) && !func_8028ECAC() ){ gcdialog_showText(0xb9b, 4, 0, 0, 0, 0); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } diff --git a/src/SM/ch/vegetables.c b/src/SM/ch/vegetables.c index 7f731744..23ac13bf 100644 --- a/src/SM/ch/vegetables.c +++ b/src/SM/ch/vegetables.c @@ -223,7 +223,7 @@ void func_80387DCC(ActorMarker *marker, ActorMarker *other_marker){ Actor *func_80387DF4(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3){ Actor *actor = marker_getActor(marker); - if(actor->is_first_encounter) + if(actor->has_met_before) func_8033A470(3, 7); else func_8033A45C(3, 0); @@ -320,7 +320,7 @@ void func_80388080(Actor *this){ this->velocity_x = temp_velX; this->velocity_y = (local->unkC == 3) ? 90.0f : 70.0f; this->velocity_z = temp_velZ; - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; this->unk138_23 = 0; this->unk38_0 = 0; this->initialized = TRUE; @@ -483,7 +483,7 @@ void func_80388080(Actor *this){ sp54[2] = this->position_z; if(local->unkC == 1) sp54[1] += 150.0f; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; func_80387A80(partEmitMgr_newEmitter(3), sp54, 3, (local->unkC == 1)? 0x4f0: 0x4f1); }//L80388CC4 diff --git a/src/SM/code_2990.c b/src/SM/code_2990.c index 7e4d8456..1c298e0e 100644 --- a/src/SM/code_2990.c +++ b/src/SM/code_2990.c @@ -233,7 +233,7 @@ void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ break; case ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT: /* 2FFC 803893EC 920B0138 */ - actor->is_first_encounter = FALSE; + actor->has_met_before = FALSE; actor->lifetime_value = 0.0f; break; @@ -572,9 +572,9 @@ void chsmmole_Update(Actor * this){ chsmmole_skipIntroTutorial(); //give all SM moves } this->unk38_0 = 0; - }else if(!this->is_first_encounter && 5.0 < this->lifetime_value){ + }else if(!this->has_met_before && 5.0 < this->lifetime_value){ gcdialog_showText(0xe1d, 0x86, this->position, this->marker, func_803892C8, NULL); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } break; diff --git a/src/TTC/ch/blubber.c b/src/TTC/ch/blubber.c index c4d49d6e..eac1b01b 100644 --- a/src/TTC/ch/blubber.c +++ b/src/TTC/ch/blubber.c @@ -117,7 +117,7 @@ void func_80387774(Actor **this_ptr){ && player_throwCarriedObject() ){ func_8028FA34(!mapSpecificFlags_get(0)? 0x149 : 0x14a, *this_ptr); - (*this_ptr)->is_first_encounter = TRUE; + (*this_ptr)->has_met_before = TRUE; } } @@ -146,11 +146,11 @@ void func_803878CC(Actor * this){ }//L80387970 if(func_80329530(this, 250) && !func_80329530(this, 80) - && !this->is_first_encounter + && !this->has_met_before && item_getCount(ITEM_18_GOLD_BULLIONS) == 0 ){ gcdialog_showText(ASSET_A0B_TEXT_UNKNOWN, 0xe, this->position, this->marker, func_80387520, NULL); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; subaddie_set_state_forward(this, 3); } @@ -162,7 +162,7 @@ void func_803878CC(Actor * this){ } this->unk138_23 = TRUE; - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; }//L80387A54 diff --git a/src/TTC/ch/leaky.c b/src/TTC/ch/leaky.c index 59e95927..e8c715c3 100644 --- a/src/TTC/ch/leaky.c +++ b/src/TTC/ch/leaky.c @@ -54,12 +54,12 @@ void chLeaky_update(Actor *this) { } } if( this->state == 1 - && !this->is_first_encounter + && !this->has_met_before && func_80329530(this, 250) && !func_80329530(this, 160) && !func_8028ECAC() && gcdialog_showText(0xA1A, 0, NULL, NULL, NULL, NULL) ){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } if (func_803114B0() == 0) { if (actor_animationIsAt(this, 0.83f)) { diff --git a/src/TTC/ch/lockup.c b/src/TTC/ch/lockup.c index 1a663474..ae66bdde 100644 --- a/src/TTC/ch/lockup.c +++ b/src/TTC/ch/lockup.c @@ -75,7 +75,7 @@ void func_80389600(Actor *this){ s32 tmp_v1; int i; - if( !this->is_first_encounter + if( !this->has_met_before && this->unkF4_8 == 0xA && !jiggyscore_isCollected(JIGGY_13_TTC_LOCKUP) && func_80329530(this, 320) @@ -83,7 +83,7 @@ void func_80389600(Actor *this){ && !func_8028ECAC() && gcdialog_showText(0xA15, 0, NULL, NULL, NULL, NULL) ){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; }//L803896AC if(!this->volatile_initialized){ diff --git a/src/TTC/ch/nipper.c b/src/TTC/ch/nipper.c index 7074f2ac..279c44c9 100644 --- a/src/TTC/ch/nipper.c +++ b/src/TTC/ch/nipper.c @@ -167,7 +167,7 @@ void func_80388344(ActorMarker * this_marker, ActorMarker *other_marker){ if(other_marker->id == 1){ this = marker_getActor(this_marker); if( !mapSpecificFlags_get(7) - && this->is_first_encounter + && this->has_met_before && gcdialog_showText(0xa0f, 0, NULL, NULL, NULL, NULL) ){ mapSpecificFlags_set(7, TRUE); @@ -178,7 +178,7 @@ void func_80388344(ActorMarker * this_marker, ActorMarker *other_marker){ void func_803883C8(ActorMarker * this_marker, ActorMarker *other_marker){ Actor *this = marker_getActor(this_marker); if( !this->unk138_23 - && this->is_first_encounter + && this->has_met_before && gcdialog_showText(0xa11, 0, NULL, NULL, NULL, NULL) ){ this->unk138_23 = TRUE; @@ -229,13 +229,13 @@ void func_80388434(Actor *this){ }//L8038860C if(func_8038812C(this)){ temp_v0 = func_8028ECAC(); - if( !this->is_first_encounter + if( !this->has_met_before && temp_v0 != 1 && temp_v0 != 10 ){ subaddie_set_state_with_direction(this, 5, 0.01f, 1); if(gcdialog_showText(0xa0e, 0xf, this->position, this->marker, TTC_func_80387FB0, NULL)){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 5000, 300); ncStaticCamera_setToNode(11); diff --git a/src/core2/ba/marker.c b/src/core2/ba/marker.c index 7acacdc7..99232021 100644 --- a/src/core2/ba/marker.c +++ b/src/core2/ba/marker.c @@ -321,7 +321,7 @@ void __baMarker_resolveCollision(Prop *other_prop){ case 0x28: //L8028BF74 if( plyr_hitbox_type == HITBOX_6_WONDERWING){ - func_8030E484(SFX_20_METAL_CLANK_1); + sfxsource_playHighPriority(SFX_20_METAL_CLANK_1); } else{ func_8030E6D4(SFX_65_METALLIC_SCRATCH); diff --git a/src/core2/bs/bFly.c b/src/core2/bs/bFly.c index 591da81e..fc409181 100644 --- a/src/core2/bs/bFly.c +++ b/src/core2/bs/bFly.c @@ -513,7 +513,7 @@ void func_802A4664(void){ func_80299E90(); next_state = bs_getNextState(); if(next_state == BS_20_LANDING || next_state == BS_24_FLY || next_state == BS_2D_SWIM_IDLE){ - func_8030E484(SFX_3EA_UNKNOWN); + sfxsource_playHighPriority(SFX_3EA_UNKNOWN); } func_802A34C8(); func_8029E070(0); diff --git a/src/core2/bs/bLongLeg.c b/src/core2/bs/bLongLeg.c index 1cabdd46..fedb0242 100644 --- a/src/core2/bs/bLongLeg.c +++ b/src/core2/bs/bLongLeg.c @@ -58,7 +58,7 @@ int bslongleg_inSet(s32 move_indx){ void func_802A531C(void){ func_80299650(stateTimer_getPrevious(STATE_TIMER_2_LONGLEG), stateTimer_get(STATE_TIMER_2_LONGLEG)); if(stateTimer_isAt(STATE_TIMER_2_LONGLEG, 0.01f)) - func_8030E484(SFX_3EB_UNKNOWN); + sfxsource_playHighPriority(SFX_3EB_UNKNOWN); } void func_802A5374(void){ diff --git a/src/core2/bs/bShock.c b/src/core2/bs/bShock.c index 8733a283..cdf1bb12 100644 --- a/src/core2/bs/bShock.c +++ b/src/core2/bs/bShock.c @@ -145,7 +145,7 @@ void bsbshock_init(void){ baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity()); baphysics_set_vertical_velocity(D_80364A70); baphysics_set_gravity(D_80364A74); - func_8030E484(SFX_E_SHOCKSPRING_BOING); + sfxsource_playHighPriority(SFX_E_SHOCKSPRING_BOING); func_8029E064(1); func_8029E070(1); ability_use(9); @@ -162,7 +162,7 @@ void bsbshock_update(void){ func_802B6FA8(); baphysics_get_velocity(sp20); if(animctrl_isAt(aCtrl, 0.7f)) - func_8030E484(SFX_53_BANJO_HUIII); + sfxsource_playHighPriority(SFX_53_BANJO_HUIII); if(button_released(BUTTON_A) && 0.0f < sp20[1]) baphysics_reset_gravity(); diff --git a/src/core2/bs/bTrot.c b/src/core2/bs/bTrot.c index bd319340..30de1a3b 100644 --- a/src/core2/bs/bTrot.c +++ b/src/core2/bs/bTrot.c @@ -123,7 +123,7 @@ void func_802A8AD8(void){ if(func_8029DFE0()){ func_8029E0DC(0); if(miscFlag_isFalse(MISC_FLAG_14_LOSE_BOGGY_RACE)) - func_8030E484(0x3eb); + sfxsource_playHighPriority(0x3eb); func_803219F4(1); } }else{ @@ -365,7 +365,7 @@ void bsbtrot_jump_init(void){ baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity()); baphysics_set_vertical_velocity(D_80364ABC); baphysics_set_gravity(D_80364AC0); - func_8030E484(SFX_48_KAZOOIE_RUUH); + sfxsource_playHighPriority(SFX_48_KAZOOIE_RUUH); D_8037D3A4 = 0; } diff --git a/src/core2/bs/croc.c b/src/core2/bs/croc.c index 77227f16..b0fd9ba7 100644 --- a/src/core2/bs/croc.c +++ b/src/core2/bs/croc.c @@ -581,7 +581,7 @@ void bscroc_eat_bad_update(void){ } if(animctrl_isAt(aCtrl, 0.6671f)){ - func_8030E484(SFX_C6_SHAKING_MOUTH); + sfxsource_playHighPriority(SFX_C6_SHAKING_MOUTH); } if(animctrl_isStopped(aCtrl)){ diff --git a/src/core2/bs/jig.c b/src/core2/bs/jig.c index 8ea501b5..89eaef6d 100644 --- a/src/core2/bs/jig.c +++ b/src/core2/bs/jig.c @@ -71,7 +71,7 @@ void bsjig_jiggy_update(void){ } if(animctrl_isAt(aCtrl, 0.94f)) - func_8030E484(0x3ea); + sfxsource_playHighPriority(0x3ea); if(animctrl_isStopped(aCtrl)){ if(D_8037D4B1) diff --git a/src/core2/ch/bigbutt.c b/src/core2/ch/bigbutt.c index 9cff30e3..62140991 100644 --- a/src/core2/ch/bigbutt.c +++ b/src/core2/ch/bigbutt.c @@ -121,7 +121,7 @@ void func_802C6240(Actor *this){ this->marker->dieFunc = func_802C61C0; this->marker->collisionFunc = func_802C60AC; this->marker->collision2Func = func_802C6150; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; this->unk16C_0 = 1; this->initialized = TRUE; return; @@ -265,7 +265,7 @@ void func_802C6240(Actor *this){ subaddie_set_state_with_direction(this, 1, 0.65f, 1); func_8030DA44(this->unk44_31); this->unk44_31 = 0; - func_8030E484(SFX_19_BANJO_LANDING_08); + sfxsource_playHighPriority(SFX_19_BANJO_LANDING_08); } }//L802C6B1C break; diff --git a/src/core2/ch/bottlesbonuscursor.c b/src/core2/ch/bottlesbonuscursor.c index 01de7ec5..e3cf427f 100644 --- a/src/core2/ch/bottlesbonuscursor.c +++ b/src/core2/ch/bottlesbonuscursor.c @@ -320,7 +320,7 @@ void chBottlesBonusCursor_update(Actor *this) { held_piece = &D_8037E248[D_8037E5C0.unk0]; held_piece->state = 2; chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0); - func_8030E484(SFX_112_TINKER_ATTENTION); + sfxsource_playHighPriority(SFX_112_TINKER_ATTENTION); subaddie_set_state_with_direction(this, 2, 0.0f, 1); } } diff --git a/src/core2/ch/crab.c b/src/core2/ch/crab.c index bd74921d..58e58c40 100644 --- a/src/core2/ch/crab.c +++ b/src/core2/ch/crab.c @@ -239,7 +239,7 @@ void chCrab_update(Actor *this) { marker_setCollisionScripts(this->marker, __chCrab_touch, __chCrab_ow, __chCrab_die); func_803300C0(this->marker, &__chCrab_802CB76C); this->unk124_0 = this->unk138_31 = FALSE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; this->volatile_initialized = TRUE; animctrl_setTransitionDuration(this->animctrl, 0.25f); if (map_get() == MAP_A_TTC_SANDCASTLE) { @@ -273,7 +273,7 @@ void chCrab_update(Actor *this) { gcdialog_showText(ASSET_D32_DIALOG_MUTANT_CRAB_MEET, 0xF, this->position, NULL, __chCrab_mutantTextCallback, NULL); mapSpecificFlags_set(0, TRUE); levelSpecificFlags_set(0xE, TRUE); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } if (map_get() == MAP_A_TTC_SANDCASTLE) { @@ -292,8 +292,8 @@ void chCrab_update(Actor *this) { } if (levelSpecificFlags_get(0xE)) { if ((this->state != 8) && (this->state != 9)) { - subaddie_set_state_with_direction(this, (this->is_first_encounter) ? 8 : 9, 0.0f, 1); - this->is_first_encounter = FALSE; + subaddie_set_state_with_direction(this, (this->has_met_before) ? 8 : 9, 0.0f, 1); + this->has_met_before = FALSE; } } diff --git a/src/core2/ch/gameSelect.c b/src/core2/ch/gameSelect.c index 0fa19ab6..bbcdaecc 100644 --- a/src/core2/ch/gameSelect.c +++ b/src/core2/ch/gameSelect.c @@ -454,7 +454,7 @@ void func_802C4C14(Actor *this){ break; case 2://L802C5364 timedFunc_set_2(0.15f, (GenFunction_2)sfxsource_play, SFX_32_BANJO_EGHEE, 28000); - sfxsource_play(SFX_3F6_UNKNOWN, 28000); + sfxsource_play(SFX_3F6_RUBBING, 28000); func_8030E540(SFX_8F_SNOWBALL_FLYING); break; }//L802C5394 @@ -462,7 +462,7 @@ void func_802C4C14(Actor *this){ levelSpecificFlags_set(sp84 + 0x35, 1); } else{//L802C53B4 - func_8030E484(SFX_3EA_UNKNOWN); + sfxsource_playHighPriority(SFX_3EA_UNKNOWN); subaddie_set_state(this, 3); } }else{//L802C53D0 diff --git a/src/core2/ch/mole.c b/src/core2/ch/mole.c index 8ccff89f..33d2bb01 100644 --- a/src/core2/ch/mole.c +++ b/src/core2/ch/mole.c @@ -163,9 +163,9 @@ void chmole_healthRefill(ActorMarker *marker, enum asset_e arg1, s32 arg2){ gcdialog_showText(chmole_learnedAllGameAbilities()? 0xa87 : chmole_learnedAllLevelAbilitiesDialog(), 7, 0, actor->marker, chmole_healthRefill, NULL); } else{//L802D97BC - if(actor->is_first_encounter){ + if(actor->has_met_before){ func_80347A14(1); - actor->is_first_encounter = FALSE; + actor->has_met_before = FALSE; } timed_exitStaticCamera(0.0f); if(actor->state == 5){ @@ -229,7 +229,7 @@ int chmole_learnAbility(Actor *this){ // New Ability: Learn Dialog & Misc Actions else{ func_80347A14(0); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; sp2C = moleTable[this->unkF4_8-9].learn_text; ability_unlock(moleTable[this->unkF4_8-9].ability); switch(moleTable[this->unkF4_8-9].ability){ diff --git a/src/core2/ch/snacker.c b/src/core2/ch/snacker.c index 1f8b9537..428ee0db 100644 --- a/src/core2/ch/snacker.c +++ b/src/core2/ch/snacker.c @@ -79,12 +79,12 @@ static void __chsnacker_start_dialog(Actor *this) { this->actor_specific_1_f = 0.0f; if (level_get() == LEVEL_2_TREASURE_TROVE_COVE) { text_index = mapSpecificFlags_getN(8, 3); - if( !this->is_first_encounter ) { + if( !this->has_met_before ) { if(text_index < 4) { if(gcdialog_showText(0xA1B + text_index, 0, NULL, NULL, NULL, NULL)){ text_index++; mapSpecificFlags_setN(8, text_index, 3); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } } diff --git a/src/core2/ch/termite.c b/src/core2/ch/termite.c index 5ae10aed..4784659b 100644 --- a/src/core2/ch/termite.c +++ b/src/core2/ch/termite.c @@ -146,7 +146,7 @@ void __chTermite_testCallback(ActorMarker *caller, enum asset_e text_id, s32 arg Actor *this; this = marker_getActor(caller); - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; levelSpecificFlags_set(0xd, FALSE); } @@ -159,7 +159,7 @@ void chTermite_update(Actor *this) { if (!this->volatile_initialized) { marker_setCollisionScripts(this->marker, NULL, __chTermite_ow, __chTermite_die); this->unk124_0 = this->unk138_31 = FALSE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; this->unk16C_0 = TRUE; this->volatile_initialized = TRUE; } @@ -173,7 +173,7 @@ void chTermite_update(Actor *this) { gcdialog_showText(ASSET_B43_DIALOG_TERMITE_MEET_AS_BEAR, 7, this->position, this->marker, __chTermite_testCallback, NULL); mapSpecificFlags_set(0, TRUE); levelSpecificFlags_set(0xD, TRUE); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } if( func_80329530(this, 300) diff --git a/src/core2/code_4A6F0.c b/src/core2/code_4A6F0.c index f76e583f..b3ac781c 100644 --- a/src/core2/code_4A6F0.c +++ b/src/core2/code_4A6F0.c @@ -160,7 +160,7 @@ static void __chMumbo_textCallback(ActorMarker *caller, enum asset_e text_id, s3 break; case ASSET_DAF_DIALOG_MUMBO_TREX_MISTAKE: //L802D1A98 - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; if(this->unk38_31 != 0){ func_8025A6EC(COMUSIC_2B_DING_B, 28000); item_adjustByDiffWithHud(ITEM_1C_MUMBO_TOKEN, -this->unk38_31); @@ -249,7 +249,7 @@ void chMumbo_update(Actor *this) { } this->unk38_0 = (item_getCount(ITEM_1C_MUMBO_TOKEN) >= this->unk38_31); this->unk10_12 = 0; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; this->volatile_initialized = TRUE; } @@ -273,7 +273,7 @@ void chMumbo_update(Actor *this) { case 2: //L802D1F90 if (actor_animationIsAt(this, 0.25f) != 0) { - func_8030E484(0x41); + sfxsource_playHighPriority(0x41); } actor_playAnimationOnce(this); if (actor_animationIsAt(this, 0.999f)) { @@ -333,7 +333,7 @@ void chMumbo_update(Actor *this) { ) { gcdialog_showText(ASSET_DAE_DIALOG_MUMBO_TREX_START, 6, NULL, this->marker, __chMumbo_textCallback, NULL); fileProgressFlag_set(FILEPROG_BA_HAS_SEEN_TREX_TEXT, 1); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; subaddie_set_state(this, 3); } else if ( sp44 @@ -385,7 +385,7 @@ void chMumbo_update(Actor *this) { } if (actor_animationIsAt(this, 0.01f)) { - if ( this->is_first_encounter + if ( this->has_met_before || (this->unk10_12 == 0 && (player_getTransformation() != TRANSFORM_1_BANJO) && (player_getTransformation() != TRANSFORM_7_WISHWASHY)) @@ -407,7 +407,7 @@ void chMumbo_update(Actor *this) { func_8025A58C(-1, 1000); } if (actor_animationIsAt(this, 0.999f)) { - if (!this->is_first_encounter) { + if (!this->has_met_before) { func_8028F918(0); } func_8025A7DC(COMUSIC_1D_MUMBO_TRANSFORMATION); @@ -416,7 +416,7 @@ void chMumbo_update(Actor *this) { chMumbo_func_802D1B8C(this, D_8037DDF0); break; } - if (this->is_first_encounter) { + if (this->has_met_before) { subaddie_set_state(this, 3); gcdialog_showText(ASSET_DAF_DIALOG_MUMBO_TREX_MISTAKE, 6, NULL, this->marker, __chMumbo_textCallback, NULL); break; diff --git a/src/core2/code_53A10.c b/src/core2/code_53A10.c index c1a4cfc2..e8a644fc 100644 --- a/src/core2/code_53A10.c +++ b/src/core2/code_53A10.c @@ -67,7 +67,7 @@ void func_802DAA14(Actor *this){ return; } - if(!this->is_first_encounter){ + if(!this->has_met_before){ if(level_get() == LEVEL_A_MAD_MONSTER_MANSION){ text_id = 0xadc; } @@ -79,6 +79,6 @@ void func_802DAA14(Actor *this){ text_id = tmp; } gcdialog_showText(text_id, 4, NULL, this->marker, func_802DA9A0, NULL); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } diff --git a/src/core2/code_85800.c b/src/core2/code_85800.c index 93fb3213..c7066bc6 100644 --- a/src/core2/code_85800.c +++ b/src/core2/code_85800.c @@ -838,7 +838,7 @@ int func_8030E3FC(u8 indx){ } } -void func_8030E484(enum sfx_e uid){ +void sfxsource_playHighPriority(enum sfx_e uid){ func_8030D6C4(uid, 1.0f, 22000, 0, 2); } diff --git a/src/core2/code_935F0.c b/src/core2/code_935F0.c index ded6e7f7..7af9ebe9 100644 --- a/src/core2/code_935F0.c +++ b/src/core2/code_935F0.c @@ -104,7 +104,7 @@ void func_8031A678(Actor *this){ void __chMinigame_textCallback1(ActorMarker *marker, enum asset_e text_id, s32 arg2){ Actor *this = marker_getActor(marker); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } void __chMinigame_transformToCroc(ActorMarker *marker, enum asset_e text_id, s32 arg2){ @@ -164,7 +164,7 @@ void chMinigame_update(Actor *this){ func_8028FAB0(this->position); this->unk1C[0] = 0.0f; this->unk1C[1] = this->yaw; this->unk1C[2] = 0.0f; func_8028FAEC(this->unk1C); - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; if(this->unk10_12 >= 7){ marker_despawn(this->marker); return; @@ -177,7 +177,7 @@ void chMinigame_update(Actor *this){ if(volatileFlag_get(VOLATILE_FLAG_2_FF_IN_MINIGAME)){ switch(this->state){ case MINIGAME_STATE_1_INTRODUCE_GAME://L8031AB2C - if(this->is_first_encounter) + if(this->has_met_before) __chMinigame_setState(this, MINIGAME_STATE_2_IN_PROGESS); break; case MINIGAME_STATE_2_IN_PROGESS://L8031AB50 diff --git a/src/core2/code_9E370.c b/src/core2/code_9E370.c index f33fa28b..15885a43 100644 --- a/src/core2/code_9E370.c +++ b/src/core2/code_9E370.c @@ -883,7 +883,7 @@ Actor *actor_new(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ suLastBaddie->unk14C[0] = NULL; suLastBaddie->unk14C[1] = NULL; suLastBaddie->unk138_27 = 0; - suLastBaddie->is_first_encounter = FALSE; + suLastBaddie->has_met_before = FALSE; suLastBaddie->unk138_23 = 0; suLastBaddie->unk138_22 = 0; suLastBaddie->unk138_21 = 0; diff --git a/src/core2/code_DA760.c b/src/core2/code_DA760.c index e2351fa4..aec41812 100644 --- a/src/core2/code_DA760.c +++ b/src/core2/code_DA760.c @@ -46,21 +46,21 @@ void func_80361870(Actor *this){ this->volatile_initialized = TRUE; } - if(!this->is_first_encounter && func_80329530(this, 400) && !func_80329530(this, 50)){ + if(!this->has_met_before && func_80329530(this, 400) && !func_80329530(this, 50)){ if(this->unkF4_8 == 1 && !fileProgressFlag_get(FILEPROG_31_MM_OPEN) && level_get() == LEVEL_6_LAIR){ text_id = fileProgressFlag_get(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT)? 0xF80 : 0xF7F; if(gcdialog_showText(text_id, 0, 0, 0, 0, 0)){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } } else if(func_803616F0(this)){ sp28 = (volatileFlag_get(VOLATILE_FLAG_16)?0xf6e:0xf68) + this->unkF4_8 - 1; if(!volatileFlag_get(VOLATILE_FLAG_16) && level_get() == LEVEL_6_LAIR){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } else{ if(gcdialog_showText(sp28, 0, 0, 0, 0, 0)){ - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; volatileFlag_set(VOLATILE_FLAG_16, 0); } } diff --git a/src/core2/fx/honeycarrierscore.c b/src/core2/fx/honeycarrierscore.c index 7a705038..6766dec8 100644 --- a/src/core2/fx/honeycarrierscore.c +++ b/src/core2/fx/honeycarrierscore.c @@ -233,7 +233,7 @@ void fxhoneycarrierscore_update(s32 arg0, struct8s *arg1){ timedFunc_set_2(0.25f, (GenFunction_2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); item_adjustByDiffWithHud(ITEM_14_HEALTH, 0); timedFunc_set_1(1.25f, (GenFunction_1)item_inc, ITEM_15_HEALTH_TOTAL); - timedFunc_set_1(1.25f, (GenFunction_1)func_8030E484, SFX_3EA_UNKNOWN); + timedFunc_set_1(1.25f, (GenFunction_1)sfxsource_playHighPriority, SFX_3EA_UNKNOWN); timedFunc_set_2(1.25f, (GenFunction_2)item_set, ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL)+1); timedFunc_set_1(1.5f, (GenFunction_1)gcpausemenu_80314AC8, 1); } diff --git a/src/fight/chbossjinjo.c b/src/fight/chbossjinjo.c index 02c6f99c..511b0bee 100644 --- a/src/fight/chbossjinjo.c +++ b/src/fight/chbossjinjo.c @@ -282,7 +282,7 @@ void chBossJinjo_update(Actor *this){ if(actor_animationIsAt(this, 0.85f)){ if(func_8030E3FC(this->unk44_31)) func_8030E394(this->unk44_31); - func_8030E484(SFX_19_BANJO_LANDING_08); + sfxsource_playHighPriority(SFX_19_BANJO_LANDING_08); func_8025A7DC(COMUSIC_43_ENTER_LEVEL_GLITTER); }//L8038CD20 } diff --git a/src/fight/chbossjinjobase.c b/src/fight/chbossjinjobase.c index 1c5298f5..12557805 100644 --- a/src/fight/chbossjinjobase.c +++ b/src/fight/chbossjinjobase.c @@ -126,7 +126,7 @@ void chBossJinjoBase_update(Actor *this) { func_8030DD14(local->unk0, 2); func_8030DBB4(local->unk0, 0.7f); sfxsource_setSampleRate(local->unk0, 12000); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 20000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.6f, 20000); func_8038D3DC(this, 0x19a, 0.0f, -200.0f, 0.0f); TUPLE_COPY(this->unk1C, this->position); this->position_y = -400.0f; diff --git a/src/fight/chjinjonatorbase.c b/src/fight/chjinjonatorbase.c index 2aeace1b..f77aaabb 100644 --- a/src/fight/chjinjonatorbase.c +++ b/src/fight/chjinjonatorbase.c @@ -145,7 +145,7 @@ void chjinjonatorbase_update(Actor *this){ this->unk1C[1] = this->position_y; this->unk1C[2] = this->position_z; this->position_y = -600.0f; - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 25000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.6f, 25000); if(0.0f != this->lifetime_value){ this->velocity_y = 600.0f/this->lifetime_value; }else{ diff --git a/src/lair/ch/brentilda.c b/src/lair/ch/brentilda.c index 23a4a6fb..072330f2 100644 --- a/src/lair/ch/brentilda.c +++ b/src/lair/ch/brentilda.c @@ -143,10 +143,10 @@ void chBrentilda_update(Actor *this) { if (phi_f2 < 500.0) { if (sp74 < 0xFF) { sp74 = (sp74 + 0xC < 0xFF) ? sp74 + 0xC : 0xFF; - if (!this->is_first_encounter) { + if (!this->has_met_before) { comusic_playTrack(COMUSIC_81_ACTIVATING_BRENTILDA); func_80324D2C(1.0f, COMUSIC_81_ACTIVATING_BRENTILDA); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; this->unk138_23 = FALSE; } } @@ -159,7 +159,7 @@ void chBrentilda_update(Actor *this) { comusic_playTrack(COMUSIC_8B_DEACTIVATE_BRENTILDA); func_80324D2C(1.0f, COMUSIC_8B_DEACTIVATE_BRENTILDA); this->unk138_23 = TRUE; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; } } } diff --git a/src/lair/code_0.c b/src/lair/code_0.c index a849a1b4..876ce688 100644 --- a/src/lair/code_0.c +++ b/src/lair/code_0.c @@ -382,7 +382,7 @@ void func_803867A8(Actor *this) { this->velocity[0] += 1.0f; if((this->velocity[0] < 0.0f) || (this->velocity[0] > 19.0f)) { this->velocity[0] = 0.0f; - func_8030E6A4(SFX_3F6_UNKNOWN, 0.5f, this->alpha_124_19*0x25 + 0x3840); + func_8030E6A4(SFX_3F6_RUBBING, 0.5f, this->alpha_124_19*0x25 + 0x3840); } } } @@ -390,7 +390,7 @@ void func_803867A8(Actor *this) { this->velocity[0] += 1.0f; if ((this->velocity[0] < 0.0f) || (this->velocity[0] > 19.0f)) { this->velocity[0] = 0.0f; - FUNC_8030E8B4(SFX_3F6_UNKNOWN, 0.5f, 24000, this->position, 100, 2300); + FUNC_8030E8B4(SFX_3F6_RUBBING, 0.5f, 24000, this->position, 100, 2300); } } @@ -873,7 +873,7 @@ void func_803880BC(Actor *this) __spawnQueue_add_1((GenFunction_1)func_80387E94, reinterpret_cast(s32, this->marker)); if (volatileFlag_get(VOLATILE_FLAG_BC_WITCH_SWITCH_PRESSED_CC) && !fileProgressFlag_get(FILEPROG_9A_CC_WITCH_SWITCH_PRESSED)) - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.75f, 30000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.75f, 30000); } if (fileProgressFlag_get(FILEPROG_9B_LAIR_CC_WITCH_SWITCH_EYES_ACTIVE)) @@ -1628,7 +1628,7 @@ void func_80389934(Actor *this) { subaddie_set_state_forward(this, 0x17); actor_playAnimationOnce(this); - FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 32000); + FUNC_8030E624(SFX_3F6_RUBBING, 0.6f, 32000); func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF); } diff --git a/src/lair/code_86F0.c b/src/lair/code_86F0.c index 0fa4e15f..34282dbf 100644 --- a/src/lair/code_86F0.c +++ b/src/lair/code_86F0.c @@ -197,7 +197,7 @@ void func_8038EFD8(Actor *this) { f32 sp30[3]; f32 sp24[3]; - this->is_first_encounter = FALSE; + this->has_met_before = FALSE; player_getPosition(sp30); sp24[0] = this->position[0]; sp24[1] = this->position[1]; @@ -421,7 +421,7 @@ void lair_func_8038F924(Actor *this) { local->unk0 = 0; local->unk4 = 0; local->unk8 = (func_8038ECA8(this->marker)) ? 0xff : 1; - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; for(phi_v1 = 0; phi_v1 < sp64; phi_v1 ++){ local->unk4++; local->unk0 |= (1 << func_8038F0EC(this)); @@ -473,8 +473,8 @@ void lair_func_8038F924(Actor *this) { func_8038EDBC(this); switch(this->state){ case 1://L8038FCD0 - if (!this->is_first_encounter && (!func_8028F20C() || !func_8028FB48(0x08000000))) { - this->is_first_encounter = TRUE; + if (!this->has_met_before && (!func_8028F20C() || !func_8028FB48(0x08000000))) { + this->has_met_before = TRUE; } if (func_80329530(this, 300)) { if ((this->unkF4_8 == 0xA) && !fileProgressFlag_get(FILEPROG_F6_SEEN_DOOR_OF_GRUNTY_PUZZLE_PODIUM)) { @@ -486,7 +486,7 @@ void lair_func_8038F924(Actor *this) { func_8035644C(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT); } } - if (func_8038ECA8(this->marker) && this->is_first_encounter && !func_8038EB58(this) && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT)) { + if (func_8038ECA8(this->marker) && this->has_met_before && !func_8038EB58(this) && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT)) { func_8038F350(this, 2); } break; diff --git a/src/lair/code_9C40.c b/src/lair/code_9C40.c index 264cac74..0d9c5b25 100644 --- a/src/lair/code_9C40.c +++ b/src/lair/code_9C40.c @@ -91,11 +91,11 @@ void func_803902B8(Actor *this) { sp54 = this->marker->id - 0x16D; if (!this->initialized) { marker_setFreeMethod(this->marker, func_80390298); - this->is_first_encounter = volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE); + this->has_met_before = volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE); this->initialized = TRUE; } _player_getPosition(sp5C); - sp58 = func_80259384(this->position, sp5C, 1750.0f) && !this->is_first_encounter; + sp58 = func_80259384(this->position, sp5C, 1750.0f) && !this->has_met_before; if (sp58 && !this->unk38_0) { func_8032BB88(this, 0, 0x1F4); func_8025A6EC(COMUSIC_79_CHEATO, 0); diff --git a/src/lair/code_A4A0.c b/src/lair/code_A4A0.c index 48639a11..21d8e08b 100644 --- a/src/lair/code_A4A0.c +++ b/src/lair/code_A4A0.c @@ -56,7 +56,7 @@ void func_80390890(ActorMarker *marker, ActorMarker *other_marker) { func_8030E878(SFX_C2_GRUBLIN_EGH, local->unkC_27*0.1 + 0.8, 32000, this->position, 1250.0f, 2500.0f); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); actor_collisionOff(this); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } void func_80390994(Actor *this) { diff --git a/src/lair/code_AD70.c b/src/lair/code_AD70.c index 2e4fee23..f183cf97 100644 --- a/src/lair/code_AD70.c +++ b/src/lair/code_AD70.c @@ -263,9 +263,9 @@ void func_80391B04(Actor *this) { func_80391810(this, 2); } } - if ((local->unk8 < this->position[1]) && !this->is_first_encounter) { + if ((local->unk8 < this->position[1]) && !this->has_met_before) { FUNC_8030E8B4(SFX_14E_SOFT_EXPLOSION, 1.0f, 20000, this->position, 1500, 3000); - this->is_first_encounter = TRUE; + this->has_met_before = TRUE; } break; case 3: diff --git a/src/lair/code_C1C0.c b/src/lair/code_C1C0.c index 86a024a4..a1bf66c3 100644 --- a/src/lair/code_C1C0.c +++ b/src/lair/code_C1C0.c @@ -104,8 +104,8 @@ void func_80392918(Actor *this) { return; } func_80326224(this); - if ((this->unk48 > 0.5) && !this->is_first_encounter) { - this->is_first_encounter = TRUE; + if ((this->unk48 > 0.5) && !this->has_met_before) { + this->has_met_before = TRUE; ncStaticCamera_setToNode(0x1E); } if ((0.999 < this->unk48) && !this->unk38_0) {