rename function prefixes to better follow guidelines

This commit is contained in:
Banjo Kazooie 2024-09-01 16:23:14 -05:00
parent 0964b8e08a
commit 892f773f80
11 changed files with 115 additions and 110 deletions

View File

@ -19,5 +19,5 @@ lair_func_8038E0B0 = 0x8038E0B0;
lair_func_8038E768 = 0x8038E768; lair_func_8038E768 = 0x8038E768;
fight_func_803863F0 = 0x803863F0; fight_func_803863F0 = 0x803863F0;
cutscene_func_8038C4E0 = 0x8038C4E0; cutscene_func_8038C4E0 = 0x8038C4E0;
mole_learnedAllSpiralMountainAbilities = 0x802DA498; chmole_learnedAllSpiralMountainAbilities = 0x802DA498;

View File

@ -206,7 +206,7 @@ void func_80387764(ActorMarker * marker){
func_8028F94C(2, actor->unk1C); func_8028F94C(2, actor->unk1C);
} }
//L80387848 //L80387848
if(!mapSpecificFlags_get(3) && mole_learnedAllSpiralMountainAbilities() && temp_a2){ if(!mapSpecificFlags_get(3) && chmole_learnedAllSpiralMountainAbilities() && temp_a2){
mapSpecificFlags_set(3, 1); mapSpecificFlags_set(3, 1);
sp34 = 0xE12; sp34 = 0xE12;
}//L80387898 }//L80387898

View File

@ -16,11 +16,11 @@ typedef struct {
s16 refresher_text; s16 refresher_text;
s8 camera_node; s8 camera_node;
s8 ability; s8 ability;
} struct_smMole; } ChSmMoleDescription;
//public //public
void smMole_Update(Actor * this); void chsmmole_Update(Actor * this);
void SM_func_80389610(Actor * this); void chsmmole_80389610(Actor * this);
/* .data */ /* .data */
ActorAnimationInfo smMoleAnimations[6] = { ActorAnimationInfo smMoleAnimations[6] = {
@ -32,14 +32,14 @@ ActorAnimationInfo smMoleAnimations[6] = {
{ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f} {ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f}
}; };
ActorInfo D_8038AF90 = { ActorInfo chSmMole = {
MARKER_B7_TUTORIAL_BOTTLES, ACTOR_12B_TUTORIAL_BOTTLES, ASSET_387_MODEL_BOTTLES, MARKER_B7_TUTORIAL_BOTTLES, ACTOR_12B_TUTORIAL_BOTTLES, ASSET_387_MODEL_BOTTLES,
1, smMoleAnimations, 1, smMoleAnimations,
smMole_Update, func_80326224, func_802D94B4, chsmmole_Update, func_80326224, func_802D94B4,
0, 0, 0.0f, 0 0, 0, 0.0f, 0
}; };
struct_smMole smMoleTable[8] = { ChSmMoleDescription smMoleTable[8] = {
{ASSET_DF3_TEXT_BOTTLES_INTRODUCTION, ASSET_E08_TEXT_BOTTLES_FIND_ANOTHER_MOLEHILL, 1, -1}, {ASSET_DF3_TEXT_BOTTLES_INTRODUCTION, ASSET_E08_TEXT_BOTTLES_FIND_ANOTHER_MOLEHILL, 1, -1},
{ASSET_DF4_TEXT_BOTTLES_CAMERA_CONTROL_LEARN, ASSET_DF5_TEXT_BOTTLES_CAMERA_CONTROL_REFRESHER, 3, ABILITY_3_CAMERA_CONTROL}, {ASSET_DF4_TEXT_BOTTLES_CAMERA_CONTROL_LEARN, ASSET_DF5_TEXT_BOTTLES_CAMERA_CONTROL_REFRESHER, 3, ABILITY_3_CAMERA_CONTROL},
{ASSET_DFB_TEXT_BOTTLES_DIVE_LEARN, ASSET_DFE_TEXT_BOTTLES_DIVE_REFRESHER, 5, ABILITY_F_DIVE}, {ASSET_DFB_TEXT_BOTTLES_DIVE_LEARN, ASSET_DFE_TEXT_BOTTLES_DIVE_REFRESHER, 5, ABILITY_F_DIVE},
@ -54,9 +54,11 @@ s32 D_8038AFE4 = 0;
/* .code */ /* .code */
// func_80388D80
int code_2990_learnedAnySpiralMountainAbilities(void){ /**
// Checks if any Spiral Mountain abilities have been learned * @brief Checks if any Spiral Mountain abilities have been learned
*/
int chsmmole_learnedAnySpiralMountainAbilities(void){
return ability_isUnlocked(ABILITY_F_DIVE) return ability_isUnlocked(ABILITY_F_DIVE)
|| ability_isUnlocked(ABILITY_4_BEAR_PUNCH) || ability_isUnlocked(ABILITY_4_BEAR_PUNCH)
|| ability_isUnlocked(ABILITY_C_ROLL) || ability_isUnlocked(ABILITY_C_ROLL)
@ -68,10 +70,11 @@ int code_2990_learnedAnySpiralMountainAbilities(void){
|| ability_isUnlocked(ABILITY_5_CLIMB); || ability_isUnlocked(ABILITY_5_CLIMB);
} }
// func_80388E48 /**
void code_2990_setSpiralMountainAbilitiesAsUsed(void){ * @brief Sets all Spiral Mountain abilities to used & disables the noise
// Sets all Spiral Mountain abilities to used & disables the noise * played when the player uses an ability for the first time.
// played when the player uses an ability for the first time. */
void chsmmole_setSpiralMountainAbilitiesAsUsed(void){
ability_unlock(ABILITY_3_CAMERA_CONTROL); ability_unlock(ABILITY_3_CAMERA_CONTROL);
ability_setHasUsed(ABILITY_0_BARGE); ability_setHasUsed(ABILITY_0_BARGE);
ability_setHasUsed(ABILITY_1_BEAK_BOMB); ability_setHasUsed(ABILITY_1_BEAK_BOMB);
@ -84,9 +87,10 @@ void code_2990_setSpiralMountainAbilitiesAsUsed(void){
ability_setHasUsed(ABILITY_A_HOLD_A_JUMP_HIGHER); ability_setHasUsed(ABILITY_A_HOLD_A_JUMP_HIGHER);
} }
// func_80388EB0 /**
void code_2990_skipIntroTutorial(void){ * @brief Unlocks all of the Spiral Mountain moves.
// Unlocks all of the Spiral Mountain moves. */
void chsmmole_skipIntroTutorial(void){
ability_unlock(ABILITY_F_DIVE); ability_unlock(ABILITY_F_DIVE);
ability_unlock(ABILITY_4_BEAR_PUNCH); ability_unlock(ABILITY_4_BEAR_PUNCH);
ability_unlock(ABILITY_C_ROLL); ability_unlock(ABILITY_C_ROLL);
@ -96,15 +100,15 @@ void code_2990_skipIntroTutorial(void){
ability_unlock(ABILITY_7_FLAP); ability_unlock(ABILITY_7_FLAP);
ability_unlock(ABILITY_8_FLIP); ability_unlock(ABILITY_8_FLIP);
ability_unlock(ABILITY_5_CLIMB); ability_unlock(ABILITY_5_CLIMB);
code_2990_setSpiralMountainAbilitiesAsUsed(); chsmmole_setSpiralMountainAbilitiesAsUsed();
mapSpecificFlags_set(3,1); mapSpecificFlags_set(3,1);
} }
/**
* @brief If the player is talking to Intro Bottles for the first time, use the
* camera that points to the lair. Otherwise, use the camera for the ability.
*/
void chsmmole_setSpiralMountainStaticCamera(Actor *this){
// func_80388F24
void code_2990_setSpiralMountainStaticCamera(Actor *this){
// If the player is talking to Intro Bottles for the first time,
// use the camera that points to the lair.
// Otherwise, use the camera for the ability.
if(this->unkF4_8 == 1 && !mapSpecificFlags_get(1)){ if(this->unkF4_8 == 1 && !mapSpecificFlags_get(1)){
timed_setStaticCameraToNode(0.0f, 0x12); timed_setStaticCameraToNode(0.0f, 0x12);
} }
@ -152,9 +156,9 @@ void func_80388FA0(Actor *this, s32 arg1){
animctrl_setSmoothTransition(this->animctrl, 0); animctrl_setSmoothTransition(this->animctrl, 0);
break; break;
case 5: case 5:
code_2990_setSpiralMountainStaticCamera(this); chsmmole_setSpiralMountainStaticCamera(this);
func_8028F94C(2,this->position); func_8028F94C(2,this->position);
SM_func_80389610(this); chsmmole_80389610(this);
break; break;
case 3: case 3:
actor_loopAnimation(this); actor_loopAnimation(this);
@ -171,16 +175,18 @@ void func_80388FA0(Actor *this, s32 arg1){
func_8030DD14(this->unk44_31, 2); func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f); func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 0x6590); sfxsource_setSampleRate(this->unk44_31, 0x6590);
code_2990_setSpiralMountainStaticCamera(this); chsmmole_setSpiralMountainStaticCamera(this);
func_8028F94C(2, this->position); func_8028F94C(2, this->position);
break; break;
} }
subaddie_set_state_with_direction(this, arg1, 0.0001f, 1); subaddie_set_state_with_direction(this, arg1, 0.0001f, 1);
} }
// func_80389214 /**
void smMole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e text_id, s32 arg2){ * @brief Performs actions depending on what move is being learned
// Performs actions depending on what move is being learned *
*/
static void __chsmmole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e text_id, s32 arg2){
Actor *actor = marker_getActor(marker); Actor *actor = marker_getActor(marker);
switch(arg2){ switch(arg2){
case 3: case 3:
@ -196,7 +202,7 @@ void smMole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e text
func_8025A70C(COMUSIC_2B_DING_B); func_8025A70C(COMUSIC_2B_DING_B);
break; break;
case 0xff: case 0xff:
code_2990_setSpiralMountainStaticCamera(actor); chsmmole_setSpiralMountainStaticCamera(actor);
break; break;
} }
} }
@ -205,7 +211,7 @@ void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){
Actor *actor; Actor *actor;
actor = marker_getActor(marker); actor = marker_getActor(marker);
if(!mapSpecificFlags_get(3) && mole_learnedAllSpiralMountainAbilities()){ if(!mapSpecificFlags_get(3) && chmole_learnedAllSpiralMountainAbilities()){
mapSpecificFlags_set(3, 1); mapSpecificFlags_set(3, 1);
func_80311480(ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES, 0xe, actor->position, actor->marker, func_803892C8, NULL); func_80311480(ASSET_E12_TEXT_BOTTLES_LEARNED_TUTORIAL_MOVES, 0xe, actor->position, actor->marker, func_803892C8, NULL);
}//L8038933C }//L8038933C
@ -219,7 +225,7 @@ void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){
case ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED: case ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED:
break; break;
case ASSET_DF3_TEXT_BOTTLES_INTRODUCTION: /* 2FB8 803893A8 3C188039 */ case ASSET_DF3_TEXT_BOTTLES_INTRODUCTION: /* 2FB8 803893A8 3C188039 */
func_80311480(ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER, 0x8e, actor->position, actor->marker, func_803892C8, smMole_additionalAbilityLearnActions); func_80311480(ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER, 0x8e, actor->position, actor->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions);
break; break;
case ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER: /* 2FEC 803893DC 9209003B */ case ASSET_E1F_TEXT_BOTTLES_TUTORIAL_OFFER: /* 2FEC 803893DC 9209003B */
@ -251,8 +257,7 @@ void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){
} }
} }
// func_80389494 void chsmmole_learnAbility(Actor * this, s32* arg1, s32 *arg2){
void smMole_learnAbility(Actor * this, s32* arg1, s32 *arg2){
// Selects the learn and refresh dialogs. // Selects the learn and refresh dialogs.
// Gives the player the ability if not learned. // Gives the player the ability if not learned.
if(ability_isUnlocked(smMoleTable[this->unkF4_8 -1].ability)){ if(ability_isUnlocked(smMoleTable[this->unkF4_8 -1].ability)){
@ -276,7 +281,7 @@ void smMole_learnAbility(Actor * this, s32* arg1, s32 *arg2){
} }
} }
void SM_func_80389610(Actor * this){ void chsmmole_80389610(Actor * this){
s32 sp2C; s32 sp2C;
s32 sp28; s32 sp28;
@ -310,7 +315,7 @@ void SM_func_80389610(Actor * this){
sp2C = ASSET_E0F_TEXT_BOTTLES_STOP_WASTING_TIME_BEFORE_FURNACE_FUN; sp2C = ASSET_E0F_TEXT_BOTTLES_STOP_WASTING_TIME_BEFORE_FURNACE_FUN;
sp28 |= 1; sp28 |= 1;
}else{//L80389780 }else{//L80389780
code_2990_setSpiralMountainAbilitiesAsUsed(); chsmmole_setSpiralMountainAbilitiesAsUsed();
sp2C = fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL) ? 0xe1e : 0xe13; sp2C = fileProgressFlag_get(FILEPROG_DB_SKIPPED_TUTORIAL) ? 0xe1e : 0xe13;
mapSpecificFlags_set(0xf, 1); mapSpecificFlags_set(0xf, 1);
} }
@ -338,7 +343,7 @@ void SM_func_80389610(Actor * this){
mapSpecificFlags_set(4, 1); mapSpecificFlags_set(4, 1);
} }
else{//L803898E4 else{//L803898E4
smMole_learnAbility(this, &sp2C, &sp28); chsmmole_learnAbility(this, &sp2C, &sp28);
} }
break; break;
@ -350,21 +355,22 @@ void SM_func_80389610(Actor * this){
mapSpecificFlags_set(0xE, 1); mapSpecificFlags_set(0xE, 1);
} }
else{//L803898E4 else{//L803898E4
smMole_learnAbility(this, &sp2C, &sp28); chsmmole_learnAbility(this, &sp2C, &sp28);
} }
break; break;
default://L803898F8 default://L803898F8
smMole_learnAbility(this, &sp2C, &sp28); chsmmole_learnAbility(this, &sp2C, &sp28);
break; break;
}//L80389904 }//L80389904
if(sp2C){ if(sp2C){
func_80311480(sp2C, sp28, this->position, this->marker, func_803892C8, smMole_additionalAbilityLearnActions); func_80311480(sp2C, sp28, this->position, this->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions);
} }
} }
// func_80389948 /**
void smMole_spawnMolehill(ActorMarker * marker){ * @brief Spawns a molehill for the actor
// Spawns a molehill for the actor */
void chsmmole_spawnMolehill(ActorMarker * marker){
Actor *actor; Actor *actor;
Actor *other; Actor *other;
s32 pad; s32 pad;
@ -384,14 +390,13 @@ void func_80389984(Actor * this){
func_8030DA44(tmp); func_8030DA44(tmp);
} }
// func_803899B0 void chsmmole_Update(Actor * this){
void smMole_Update(Actor * this){
// Sets up the initial functions and state for the actor // Sets up the initial functions and state for the actor
s32 sp50[6]; // face buttons s32 sp50[6]; // face buttons
f32 sp44[3]; // player position f32 sp44[3]; // player position
void *sp40; void *sp40;
int sp34; int sp34;
int sp38; int user_input;
// Checks the actor's selector value is lower than 0x9 // Checks the actor's selector value is lower than 0x9
// Anything higher is a non-Spiral Mountain ability, and should use a different actor id // Anything higher is a non-Spiral Mountain ability, and should use a different actor id
@ -420,10 +425,10 @@ void smMole_Update(Actor * this){
} }
} }
}//L80389AC8 }//L80389AC8
if(code_2990_learnedAnySpiralMountainAbilities()){ if(chsmmole_learnedAnySpiralMountainAbilities()){
mapSpecificFlags_set(1,1); mapSpecificFlags_set(1,1);
if(mole_learnedAllSpiralMountainAbilities()){ if(chmole_learnedAllSpiralMountainAbilities()){
mapSpecificFlags_set(3, 1); mapSpecificFlags_set(3, 1);
mapSpecificFlags_set(2, 1); mapSpecificFlags_set(2, 1);
mapSpecificFlags_set(0xC, 1); mapSpecificFlags_set(0xC, 1);
@ -433,7 +438,7 @@ void smMole_Update(Actor * this){
}//L80389B20 }//L80389B20
if(!this->unk16C_4){ if(!this->unk16C_4){
__spawnQueue_add_1((GenFunction_1)smMole_spawnMolehill, reinterpret_cast(s32, this->marker)); __spawnQueue_add_1((GenFunction_1)chsmmole_spawnMolehill, reinterpret_cast(s32, this->marker));
this->unk16C_4 = 1; this->unk16C_4 = 1;
}//L80389B4C }//L80389B4C
@ -502,7 +507,7 @@ void smMole_Update(Actor * this){
}//L80389EA0 }//L80389EA0
if(actor_animationIsAt(this, 0.9999f)){ if(actor_animationIsAt(this, 0.9999f)){
if(!mapSpecificFlags_get(1)){ if(!mapSpecificFlags_get(1)){
SM_func_80389610(this); chsmmole_80389610(this);
} }
func_80388FA0(this, 3); func_80388FA0(this, 3);
}//L80389EE0 }//L80389EE0
@ -515,7 +520,7 @@ void smMole_Update(Actor * this){
}else if(actor_animationIsAt(this, 0.35f)){//L80389F78 }else if(actor_animationIsAt(this, 0.35f)){//L80389F78
if(mapSpecificFlags_get(1)){ if(mapSpecificFlags_get(1)){
SM_func_80389610(this); chsmmole_80389610(this);
} }
} }
break; break;
@ -550,21 +555,21 @@ void smMole_Update(Actor * this){
mapSpecificFlags_set(5,0); mapSpecificFlags_set(5,0);
func_80388FA0(this, 4); func_80388FA0(this, 4);
}//L8038A1B8 }//L8038A1B8
sp38 = -1; user_input = -1;
if(this->unk38_0){ if(this->unk38_0){
this->unk60 += time_getDelta(); this->unk60 += time_getDelta();
if(func_803114C4() != 0xe1d){ if(func_803114C4() != 0xe1d){
if(sp50[FACE_BUTTON(BUTTON_A)] == 1) if(sp50[FACE_BUTTON(BUTTON_A)] == 1)
sp38 = 1; //A button pressed user_input = 1; //A button pressed
else if(sp50[FACE_BUTTON(BUTTON_B)] == 1) else if(sp50[FACE_BUTTON(BUTTON_B)] == 1)
sp38 = 0; //B button pressed user_input = 0; //B button pressed
}//L8038A218 }//L8038A218
if( sp38 != -1){ //button was pressed if( user_input != -1){ //button was pressed
fileProgressFlag_set(FILEPROG_DB_SKIPPED_TUTORIAL, (sp38)?0:1); fileProgressFlag_set(FILEPROG_DB_SKIPPED_TUTORIAL, (user_input)?0:1);
func_80311480((sp38)? 0xe07 : 0xe09, 0xe, this->position, this->marker, func_803892C8, smMole_additionalAbilityLearnActions); func_80311480((user_input)? 0xe07 : 0xe09, 0xe, this->position, this->marker, func_803892C8, __chsmmole_additionalAbilityLearnActions);
if(!sp38){ if(!user_input){
code_2990_skipIntroTutorial(); //give all SM moves chsmmole_skipIntroTutorial(); //give all SM moves
} }
this->unk38_0 = 0; this->unk38_0 = 0;
}else if(!this->unk138_24 && 5.0 < this->unk60){ }else if(!this->unk138_24 && 5.0 < this->unk60){

View File

@ -112,7 +112,7 @@ void SM_func_8038A5D8(Actor *this){
func_8038A460(this); func_8038A460(this);
func_8028F94C(2, this->unk1C); func_8028F94C(2, this->unk1C);
if(!mapSpecificFlags_get(3) && mole_learnedAllSpiralMountainAbilities()){ if(!mapSpecificFlags_get(3) && chmole_learnedAllSpiralMountainAbilities()){
mapSpecificFlags_set(3,1); mapSpecificFlags_set(3,1);
temp_a0 = 0xe12; temp_a0 = 0xe12;
}else{ }else{

View File

@ -17,7 +17,7 @@ extern ActorInfo D_8038AD58; //ch cauliflower A
extern ActorInfo D_8038AC9C; //chCarrot FreeRange? extern ActorInfo D_8038AC9C; //chCarrot FreeRange?
extern ActorInfo D_8038AD0C; //ch onion B extern ActorInfo D_8038AD0C; //ch onion B
extern ActorInfo D_8038AD7C; //ch cauliflower B extern ActorInfo D_8038AD7C; //ch cauliflower B
extern ActorInfo D_8038AF90; //D_8038AF90 bottles extern ActorInfo chSmMole; //chSmMole bottles
extern ActorInfo D_8038B0B0; //chJumpTutorial code_4070 extern ActorInfo D_8038B0B0; //chJumpTutorial code_4070
extern ActorInfo D_8038B0E0; extern ActorInfo D_8038B0E0;
extern ActorInfo D_8038B008; //chBanjosBed extern ActorInfo D_8038B008; //chBanjosBed
@ -148,7 +148,7 @@ void SM_func_80386810(void)
spawnableActorList_add(&D_8038AC9C, actor_new, 0X2000121); spawnableActorList_add(&D_8038AC9C, actor_new, 0X2000121);
spawnableActorList_add(&D_8038AD0C, actor_new, 0X2000121); spawnableActorList_add(&D_8038AD0C, actor_new, 0X2000121);
spawnableActorList_add(&D_8038AD7C, actor_new, 0X2200121); spawnableActorList_add(&D_8038AD7C, actor_new, 0X2200121);
spawnableActorList_add(&D_8038AF90, actor_new, 0X100); spawnableActorList_add(&chSmMole, actor_new, 0X100);
spawnableActorList_add(&D_8038B0B0, actor_new, 0); spawnableActorList_add(&D_8038B0B0, actor_new, 0);
spawnableActorList_add(&D_8038B0E0, actor_new, 0); spawnableActorList_add(&D_8038B0E0, actor_new, 0);
spawnableActorList_add(&D_8038B008, actor_new, 0X6C8); spawnableActorList_add(&D_8038B008, actor_new, 0X6C8);

View File

@ -266,7 +266,7 @@ void func_8024AF48(void){
func_8024A880(0x9000); func_8024A880(0x9000);
} }
else{ else{
if(mole_learnedAllSpiralMountainAbilities()) if(chmole_learnedAllSpiralMountainAbilities())
func_8024A9EC(0); func_8024A9EC(0);
func_8024A880(0x6fff); func_8024A880(0x6fff);
} }

View File

@ -412,7 +412,7 @@ void func_802C4C14(Actor *this){
sp44 = 0.0f; sp44 = 0.0f;
if(this->state == 4 && (sp84 == 0 || sp84 == 1)) if(this->state == 4 && (sp84 == 0 || sp84 == 1))
sp44 = 0.25f; sp44 = 0.25f;
if(mole_learnedAllSpiralMountainAbilities() && fileProgressFlag_get(FILEPROG_BD_ENTER_LAIR_CUTSCENE)){ if(chmole_learnedAllSpiralMountainAbilities() && fileProgressFlag_get(FILEPROG_BD_ENTER_LAIR_CUTSCENE)){
timedFunc_set_2(sp44, (GenFunction_2)warp_lairEnterLairFromSMLevel, 0, 0); timedFunc_set_2(sp44, (GenFunction_2)warp_lairEnterLairFromSMLevel, 0, 0);
} }
else{//L802C5188 else{//L802C5188

View File

@ -2,16 +2,16 @@
#include "functions.h" #include "functions.h"
#include "variables.h" #include "variables.h"
void mole_update(Actor *this); void chmole_update(Actor *this);
Actor *func_802D94B4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); Actor *func_802D94B4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void mole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1, s32 arg2); void chmole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1, s32 arg2);
typedef struct{ typedef struct{
s16 learn_text; s16 learn_text;
s16 refresher_text; s16 refresher_text;
s8 camera_node; s8 camera_node;
s8 ability; s8 ability;
} struct_mole; } ChMoleDescription;
/* .data */ /* .data */
ActorAnimationInfo moleAnimations[]= { ActorAnimationInfo moleAnimations[]= {
@ -23,15 +23,15 @@ ActorAnimationInfo moleAnimations[]= {
{ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f}, {ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f},
}; };
ActorInfo D_80367DA0 = { ActorInfo gChMole = {
0x1DF, ACTOR_37A_BOTTLES, ASSET_387_MODEL_BOTTLES, 0x1DF, ACTOR_37A_BOTTLES, ASSET_387_MODEL_BOTTLES,
1, moleAnimations, 1, moleAnimations,
mole_update, func_80326224, func_802D94B4, chmole_update, func_80326224, func_802D94B4,
0, 0, 0.0f, 0 0, 0, 0.0f, 0
}; };
// D_80367DC4 // D_80367DC4
struct_mole moleTable[] = { ChMoleDescription moleTable[] = {
{ASSET_C23_DIALOG_BEAKBOMB_LEARN, ASSET_C24_DIALOG_BEAKBOMB_REFRESHER, 0x0F, ABILITY_1_BEAK_BOMB}, {ASSET_C23_DIALOG_BEAKBOMB_LEARN, ASSET_C24_DIALOG_BEAKBOMB_REFRESHER, 0x0F, ABILITY_1_BEAK_BOMB},
{ASSET_B47_DIALOG_EGGS_LEARN, ASSET_B4B_DIALOG_EGGS_REFRESHER, 0x16, ABILITY_6_EGGS}, {ASSET_B47_DIALOG_EGGS_LEARN, ASSET_B4B_DIALOG_EGGS_REFRESHER, 0x16, ABILITY_6_EGGS},
{ASSET_B48_DIALOG_BEAKBUSTER_LEARN, ASSET_B4C_DIALOG_BEAKBUSTER_REFRESHER, 0x17, ABILITY_2_BEAK_BUSTER}, {ASSET_B48_DIALOG_BEAKBUSTER_LEARN, ASSET_B4C_DIALOG_BEAKBUSTER_REFRESHER, 0x17, ABILITY_2_BEAK_BUSTER},
@ -46,7 +46,7 @@ struct_mole moleTable[] = {
/* .code */ /* .code */
// func_802D9220 // func_802D9220
int mole_learnedAllLevelAbilities(enum level_e level){ int chmole_learnedAllLevelAbilities(enum level_e level){
// Checks if all of the level's abilities are learned. // Checks if all of the level's abilities are learned.
switch (level){ switch (level){
case LEVEL_1_MUMBOS_MOUNTAIN: case LEVEL_1_MUMBOS_MOUNTAIN:
@ -70,11 +70,11 @@ int mole_learnedAllLevelAbilities(enum level_e level){
} }
// func_802D9304 // func_802D9304
enum asset_e mole_learnedAllLevelAbilitiesDialog(void){ enum asset_e chmole_learnedAllLevelAbilitiesDialog(void){
// If the player has learned all game abilities, use "learned all abilities" dialog // If the player has learned all game abilities, use "learned all abilities" dialog
// If the player learned all level abilities, use "learned world abilities" dialog // If the player learned all level abilities, use "learned world abilities" dialog
s32 level_id = level_get(); s32 level_id = level_get();
int learned_all_moves = mole_learnedAllLevelAbilities(level_id); int learned_all_moves = chmole_learnedAllLevelAbilities(level_id);
switch(level_id){ switch(level_id){
case LEVEL_1_MUMBOS_MOUNTAIN: case LEVEL_1_MUMBOS_MOUNTAIN:
return learned_all_moves ? ASSET_B4E_TEXT_BOTTLES_ALL_MM_MOVES_LEARNED : ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED; return learned_all_moves ? ASSET_B4E_TEXT_BOTTLES_ALL_MM_MOVES_LEARNED : ASSET_D38_TEXT_BOTTLES_ALL_MOVES_LEARNED;
@ -95,7 +95,7 @@ enum asset_e mole_learnedAllLevelAbilitiesDialog(void){
} }
// func_802D93EC // func_802D93EC
int mole_learnedAllGameAbilities(void){ int chmole_learnedAllGameAbilities(void){
// Checks if the player has learned all non-Spiral Mountain abilities. // Checks if the player has learned all non-Spiral Mountain abilities.
return ability_isUnlocked(ABILITY_6_EGGS) return ability_isUnlocked(ABILITY_6_EGGS)
&& ability_isUnlocked(ABILITY_2_BEAK_BUSTER) && ability_isUnlocked(ABILITY_2_BEAK_BUSTER)
@ -143,13 +143,13 @@ void func_802D9600(Actor * this){
} }
// func_802D9658 // func_802D9658
void mole_setStaticCamera(Actor *this){ void chmole_setStaticCamera(Actor *this){
// Sets the camera to a static camera // Sets the camera to a static camera
timed_setStaticCameraToNode(0.0f, moleTable[this->unkF4_8-9].camera_node); timed_setStaticCameraToNode(0.0f, moleTable[this->unkF4_8-9].camera_node);
} }
// func_802D9698 // func_802D9698
void mole_healthRefill(ActorMarker *marker, enum asset_e arg1, s32 arg2){ void chmole_healthRefill(ActorMarker *marker, enum asset_e arg1, s32 arg2){
// Refills the player's health upon learning a new ability, if needed // Refills the player's health upon learning a new ability, if needed
// Also releases the camera // Also releases the camera
Actor *actor = marker_getActor(marker); Actor *actor = marker_getActor(marker);
@ -157,10 +157,10 @@ void mole_healthRefill(ActorMarker *marker, enum asset_e arg1, s32 arg2){
if( arg1 == moleTable[actor->unkF4_8-9].learn_text if( arg1 == moleTable[actor->unkF4_8-9].learn_text
&& item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL) && item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL)
){ ){
func_80311480(ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH, 7, 0, actor->marker, mole_healthRefill, mole_additionalAbilityLearnActions); func_80311480(ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH, 7, 0, actor->marker, chmole_healthRefill, chmole_additionalAbilityLearnActions);
}//L802D9738 }//L802D9738
else if(arg1 == moleTable[actor->unkF4_8-9].learn_text || arg1 == ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH){ else if(arg1 == moleTable[actor->unkF4_8-9].learn_text || arg1 == ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH){
func_80311480(mole_learnedAllGameAbilities()? 0xa87 : mole_learnedAllLevelAbilitiesDialog(), 7, 0, actor->marker, mole_healthRefill, NULL); func_80311480(chmole_learnedAllGameAbilities()? 0xa87 : chmole_learnedAllLevelAbilitiesDialog(), 7, 0, actor->marker, chmole_healthRefill, NULL);
} }
else{//L802D97BC else{//L802D97BC
if(actor->unk138_24){ if(actor->unk138_24){
@ -179,7 +179,7 @@ void mole_healthRefill(ActorMarker *marker, enum asset_e arg1, s32 arg2){
} }
// func_802D9830 // func_802D9830
void mole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1, s32 arg2){ void chmole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1, s32 arg2){
// Performs actions depending on what move is being learned // Performs actions depending on what move is being learned
Actor *actor = marker_getActor(marker); Actor *actor = marker_getActor(marker);
switch(arg2){ switch(arg2){
@ -189,7 +189,7 @@ void mole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1,
break; break;
case 2: case 2:
levelSpecificFlags_set(0x1A, 0); levelSpecificFlags_set(0x1A, 0);
mole_setStaticCamera(actor); chmole_setStaticCamera(actor);
break; break;
case 3: // Turbo Talon Trainer case 3: // Turbo Talon Trainer
timed_setStaticCameraToNode(0.0f, 0x29); timed_setStaticCameraToNode(0.0f, 0x29);
@ -197,7 +197,7 @@ void mole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1,
break; break;
case 4: case 4:
levelSpecificFlags_set(0x1A, 0); levelSpecificFlags_set(0x1A, 0);
mole_setStaticCamera(actor); chmole_setStaticCamera(actor);
break; break;
case 5: // Egg Firing case 5: // Egg Firing
item_adjustByDiffWithHud(ITEM_D_EGGS, 50); item_adjustByDiffWithHud(ITEM_D_EGGS, 50);
@ -212,13 +212,13 @@ void mole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1,
item_set(ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL)); item_set(ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL));
break; break;
case 0xff: case 0xff:
mole_setStaticCamera(actor); chmole_setStaticCamera(actor);
break; break;
} }
} }
// func_802D997C // func_802D997C
int mole_learnAbility(Actor *this){ int chmole_learnAbility(Actor *this){
s32 sp2C; s32 sp2C;
s32 sp28 = 0xe; s32 sp28 = 0xe;
// Known Ability: Refresher Dialog // Known Ability: Refresher Dialog
@ -242,7 +242,7 @@ int mole_learnAbility(Actor *this){
break; break;
} }
}//L802D9A9C }//L802D9A9C
func_80311480(sp2C, sp28, this->position, this->marker, mole_healthRefill, mole_additionalAbilityLearnActions); func_80311480(sp2C, sp28, this->position, this->marker, chmole_healthRefill, chmole_additionalAbilityLearnActions);
return TRUE; return TRUE;
} }
@ -260,28 +260,28 @@ void func_802D9ADC(Actor *this){
func_8030DD14(this->unk44_31, 2); func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f); func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 26000); sfxsource_setSampleRate(this->unk44_31, 26000);
mole_setStaticCamera(this); chmole_setStaticCamera(this);
func_8028F94C(2, this->position); func_8028F94C(2, this->position);
} }
// func_802D9BD8 // func_802D9BD8
void mole_Refresher(Actor *this){ void chmole_Refresher(Actor *this){
// Plays the scene where Bottles gives the player a refresher on the ability. // Plays the scene where Bottles gives the player a refresher on the ability.
subaddie_set_state(this, 5); subaddie_set_state(this, 5);
mole_setStaticCamera(this); chmole_setStaticCamera(this);
func_8028F94C(2, this->position); func_8028F94C(2, this->position);
mole_learnAbility(this); chmole_learnAbility(this);
} }
// func_802D9C1C // func_802D9C1C
void mole_setFacingDirection(Actor *this){ void chmole_setFacingDirection(Actor *this){
// Sets the actor to always be facing the player // Sets the actor to always be facing the player
subaddie_set_state_with_direction(this, 3, 0.0001f, 1); subaddie_set_state_with_direction(this, 3, 0.0001f, 1);
actor_loopAnimation(this); actor_loopAnimation(this);
} }
// func_802D9C54 // func_802D9C54
void mole_spawnMolehill(ActorMarker *marker){ void chmole_spawnMolehill(ActorMarker *marker){
// Spawns a molehill for the actor // Spawns a molehill for the actor
Actor *actor = marker_getActor(marker); Actor *actor = marker_getActor(marker);
Actor *other = spawn_child_actor(ACTOR_12C_MOLEHILL, &actor); Actor *other = spawn_child_actor(ACTOR_12C_MOLEHILL, &actor);
@ -299,11 +299,11 @@ void func_802D9C90(Actor *this){
} }
// func_802D9CBC // func_802D9CBC
void mole_startingDialog(Actor *this){ void chmole_startingDialog(Actor *this){
// If the player knows the ability, use refresher function // If the player knows the ability, use refresher function
// Otherwise, set player's position and spawn mole // Otherwise, set player's position and spawn mole
if(ability_isUnlocked(moleTable[this->unkF4_8 - 9].ability)){ if(ability_isUnlocked(moleTable[this->unkF4_8 - 9].ability)){
mole_Refresher(this); chmole_Refresher(this);
} }
else{ else{
if(func_80329530(this, 150)){ if(func_80329530(this, 150)){
@ -317,7 +317,7 @@ void mole_startingDialog(Actor *this){
} }
// func_802D9D60 // func_802D9D60
void mole_update(Actor *this){ void chmole_update(Actor *this){
// Sets up the initial functions and state for the actor // Sets up the initial functions and state for the actor
s32 sp50[6]; s32 sp50[6];
f32 sp4C; f32 sp4C;
@ -358,7 +358,7 @@ void mole_update(Actor *this){
nodeprop_getPosition(node_prop, this->unk1C); nodeprop_getPosition(node_prop, this->unk1C);
} }
// Spawns molehill // Spawns molehill
__spawnQueue_add_1((GenFunction_1)mole_spawnMolehill, reinterpret_cast(s32, this->marker)); __spawnQueue_add_1((GenFunction_1)chmole_spawnMolehill, reinterpret_cast(s32, this->marker));
this->marker->propPtr->unk8_3 = FALSE; this->marker->propPtr->unk8_3 = FALSE;
this->marker->collidable = FALSE; this->marker->collidable = FALSE;
this->initialized = TRUE; this->initialized = TRUE;
@ -388,7 +388,7 @@ void mole_update(Actor *this){
){ ){
player_getPosition(sp34); player_getPosition(sp34);
if(ml_distance_vec3f(sp34, this->velocity) < this->unk28){ if(ml_distance_vec3f(sp34, this->velocity) < this->unk28){
mole_startingDialog(this); chmole_startingDialog(this);
} }
} }
else{//L802DA054 else{//L802DA054
@ -397,7 +397,7 @@ void mole_update(Actor *this){
&& func_8028EFC8() && func_8028EFC8()
&& sp50[FACE_BUTTON(BUTTON_B)] == 1 && sp50[FACE_BUTTON(BUTTON_B)] == 1
){ ){
mole_startingDialog(this); chmole_startingDialog(this);
} }
} }
} }
@ -412,7 +412,7 @@ void mole_update(Actor *this){
func_8030E2C4(this->unk44_31); func_8030E2C4(this->unk44_31);
}//L802DA128 }//L802DA128
if(actor_animationIsAt(this, 0.9999f)){ if(actor_animationIsAt(this, 0.9999f)){
mole_setFacingDirection(this); chmole_setFacingDirection(this);
func_8030DA44(this->unk44_31); func_8030DA44(this->unk44_31);
this->unk44_31 = 0; this->unk44_31 = 0;
} }
@ -426,7 +426,7 @@ void mole_update(Actor *this){
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1250, 2500); FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1250, 2500);
} }
else if(actor_animationIsAt(this, 0.35f)){//L802DA1EC else if(actor_animationIsAt(this, 0.35f)){//L802DA1EC
mole_learnAbility(this); chmole_learnAbility(this);
} }
break; break;
case 3://L802DA210 case 3://L802DA210
@ -474,7 +474,7 @@ void mole_update(Actor *this){
} }
// func_802DA498 // func_802DA498
int mole_learnedAllSpiralMountainAbilities(void){ int chmole_learnedAllSpiralMountainAbilities(void){
// Checks if the player has learned all of the Spiral Mountain abilities. // Checks if the player has learned all of the Spiral Mountain abilities.
return ability_isUnlocked(ABILITY_F_DIVE) return ability_isUnlocked(ABILITY_F_DIVE)
&& ability_isUnlocked(ABILITY_4_BEAR_PUNCH) && ability_isUnlocked(ABILITY_4_BEAR_PUNCH)

View File

@ -16,17 +16,17 @@ ActorInfo D_803731B0 = {
int func_803616F0(Actor *this){ int func_803616F0(Actor *this){
switch(this->unkF4_8){ switch(this->unkF4_8){
case 1:// L80361728 case 1:// L80361728
return fileProgressFlag_get(FILEPROG_31_MM_OPEN) && !mole_learnedAllLevelAbilities(LEVEL_1_MUMBOS_MOUNTAIN); return fileProgressFlag_get(FILEPROG_31_MM_OPEN) && !chmole_learnedAllLevelAbilities(LEVEL_1_MUMBOS_MOUNTAIN);
case 2:// L80361750 case 2:// L80361750
return fileProgressFlag_get(FILEPROG_32_TTC_OPEN) && !mole_learnedAllLevelAbilities(LEVEL_2_TREASURE_TROVE_COVE); return fileProgressFlag_get(FILEPROG_32_TTC_OPEN) && !chmole_learnedAllLevelAbilities(LEVEL_2_TREASURE_TROVE_COVE);
case 3:// L80361778 case 3:// L80361778
return fileProgressFlag_get(FILEPROG_33_CC_OPEN) && !mole_learnedAllLevelAbilities(LEVEL_3_CLANKERS_CAVERN); return fileProgressFlag_get(FILEPROG_33_CC_OPEN) && !chmole_learnedAllLevelAbilities(LEVEL_3_CLANKERS_CAVERN);
case 4:// L803617A0 case 4:// L803617A0
return fileProgressFlag_get(FILEPROG_34_BGS_OPEN) && !mole_learnedAllLevelAbilities(LEVEL_4_BUBBLEGLOOP_SWAMP); return fileProgressFlag_get(FILEPROG_34_BGS_OPEN) && !chmole_learnedAllLevelAbilities(LEVEL_4_BUBBLEGLOOP_SWAMP);
case 5:// L803617C8 case 5:// L803617C8
return fileProgressFlag_get(FILEPROG_35_FP_OPEN) && !mole_learnedAllLevelAbilities(LEVEL_5_FREEZEEZY_PEAK); return fileProgressFlag_get(FILEPROG_35_FP_OPEN) && !chmole_learnedAllLevelAbilities(LEVEL_5_FREEZEEZY_PEAK);
case 6:// L803617F0 case 6:// L803617F0
return fileProgressFlag_get(FILEPROG_36_GV_OPEN) && !mole_learnedAllLevelAbilities(LEVEL_7_GOBIS_VALLEY); return fileProgressFlag_get(FILEPROG_36_GV_OPEN) && !chmole_learnedAllLevelAbilities(LEVEL_7_GOBIS_VALLEY);
default: default:
return FALSE; return FALSE;
} }

View File

@ -30,7 +30,7 @@ void func_803634BC(void){
void func_80363500(Actor *this){ void func_80363500(Actor *this){
if(!this->unk16C_4){ if(!this->unk16C_4){
if(!mole_learnedAllSpiralMountainAbilities()){ if(!chmole_learnedAllSpiralMountainAbilities()){
func_803634BC(); func_803634BC();
} }
else{ else{
@ -40,7 +40,7 @@ void func_80363500(Actor *this){
this->unk16C_4 = 1; this->unk16C_4 = 1;
}//L8036355C }//L8036355C
if(mole_learnedAllSpiralMountainAbilities()){ if(chmole_learnedAllSpiralMountainAbilities()){
func_80363470(); func_80363470();
marker_despawn(this->marker); marker_despawn(this->marker);
} }

View File

@ -97,7 +97,7 @@ extern ActorInfo D_80367CB4; //spent_goldfeather
extern ActorInfo D_80367D00; //egg extern ActorInfo D_80367D00; //egg
extern ActorInfo D_80367D24; //redfeather extern ActorInfo D_80367D24; //redfeather
extern ActorInfo D_80367D48; //goldfeather extern ActorInfo D_80367D48; //goldfeather
extern ActorInfo D_80367DA0; //bottles extern ActorInfo gChMole; //bottles
extern ActorInfo D_80367E20; //chmolehill extern ActorInfo D_80367E20; //chmolehill
extern ActorInfo D_80367E70; extern ActorInfo D_80367E70;
extern ActorInfo D_80367F30; extern ActorInfo D_80367F30;
@ -259,7 +259,7 @@ void spawnQueue_reset(void){
spawnableActorList_add(&D_80367D48, actor_new, 0x0200000); //goldfeather spawnableActorList_add(&D_80367D48, actor_new, 0x0200000); //goldfeather
spawnableActorList_add(&D_80367C90, actor_new, 0x0000004); //spent_redfeather spawnableActorList_add(&D_80367C90, actor_new, 0x0000004); //spent_redfeather
spawnableActorList_add(&D_80367CB4, actor_new, 0x0000004); //spent_goldfeather spawnableActorList_add(&D_80367CB4, actor_new, 0x0000004); //spent_goldfeather
spawnableActorList_add(&D_80367DA0, actor_new, 0x0000180); //bottles spawnableActorList_add(&gChMole, actor_new, 0x0000180); //bottles
spawnableActorList_add(&D_80367E20, actor_new, 0x44); //chmolehill spawnableActorList_add(&D_80367E20, actor_new, 0x44); //chmolehill
spawnableActorList_add(&D_80373DC0, actor_new, 0x80000); spawnableActorList_add(&D_80373DC0, actor_new, 0x80000);
spawnableActorList_add(&D_80367E70, actor_new, 0x0); spawnableActorList_add(&D_80367E70, actor_new, 0x0);