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

@@ -412,7 +412,7 @@ void func_802C4C14(Actor *this){
sp44 = 0.0f;
if(this->state == 4 && (sp84 == 0 || sp84 == 1))
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);
}
else{//L802C5188

View File

@@ -2,16 +2,16 @@
#include "functions.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);
void mole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1, s32 arg2);
void chmole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1, s32 arg2);
typedef struct{
s16 learn_text;
s16 refresher_text;
s8 camera_node;
s8 ability;
} struct_mole;
} ChMoleDescription;
/* .data */
ActorAnimationInfo moleAnimations[]= {
@@ -23,15 +23,15 @@ ActorAnimationInfo moleAnimations[]= {
{ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f},
};
ActorInfo D_80367DA0 = {
ActorInfo gChMole = {
0x1DF, ACTOR_37A_BOTTLES, ASSET_387_MODEL_BOTTLES,
1, moleAnimations,
mole_update, func_80326224, func_802D94B4,
chmole_update, func_80326224, func_802D94B4,
0, 0, 0.0f, 0
};
// D_80367DC4
struct_mole moleTable[] = {
ChMoleDescription moleTable[] = {
{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_B48_DIALOG_BEAKBUSTER_LEARN, ASSET_B4C_DIALOG_BEAKBUSTER_REFRESHER, 0x17, ABILITY_2_BEAK_BUSTER},
@@ -46,7 +46,7 @@ struct_mole moleTable[] = {
/* .code */
// 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.
switch (level){
case LEVEL_1_MUMBOS_MOUNTAIN:
@@ -70,11 +70,11 @@ int mole_learnedAllLevelAbilities(enum level_e level){
}
// 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 learned all level abilities, use "learned world abilities" dialog
s32 level_id = level_get();
int learned_all_moves = mole_learnedAllLevelAbilities(level_id);
int learned_all_moves = chmole_learnedAllLevelAbilities(level_id);
switch(level_id){
case LEVEL_1_MUMBOS_MOUNTAIN:
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
int mole_learnedAllGameAbilities(void){
int chmole_learnedAllGameAbilities(void){
// Checks if the player has learned all non-Spiral Mountain abilities.
return ability_isUnlocked(ABILITY_6_EGGS)
&& ability_isUnlocked(ABILITY_2_BEAK_BUSTER)
@@ -143,13 +143,13 @@ void func_802D9600(Actor * this){
}
// func_802D9658
void mole_setStaticCamera(Actor *this){
void chmole_setStaticCamera(Actor *this){
// Sets the camera to a static camera
timed_setStaticCameraToNode(0.0f, moleTable[this->unkF4_8-9].camera_node);
}
// 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
// Also releases the camera
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
&& 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
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
if(actor->unk138_24){
@@ -179,7 +179,7 @@ void mole_healthRefill(ActorMarker *marker, enum asset_e arg1, s32 arg2){
}
// 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
Actor *actor = marker_getActor(marker);
switch(arg2){
@@ -189,7 +189,7 @@ void mole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1,
break;
case 2:
levelSpecificFlags_set(0x1A, 0);
mole_setStaticCamera(actor);
chmole_setStaticCamera(actor);
break;
case 3: // Turbo Talon Trainer
timed_setStaticCameraToNode(0.0f, 0x29);
@@ -197,7 +197,7 @@ void mole_additionalAbilityLearnActions(ActorMarker *marker, enum asset_e arg1,
break;
case 4:
levelSpecificFlags_set(0x1A, 0);
mole_setStaticCamera(actor);
chmole_setStaticCamera(actor);
break;
case 5: // Egg Firing
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));
break;
case 0xff:
mole_setStaticCamera(actor);
chmole_setStaticCamera(actor);
break;
}
}
// func_802D997C
int mole_learnAbility(Actor *this){
int chmole_learnAbility(Actor *this){
s32 sp2C;
s32 sp28 = 0xe;
// Known Ability: Refresher Dialog
@@ -242,7 +242,7 @@ int mole_learnAbility(Actor *this){
break;
}
}//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;
}
@@ -260,28 +260,28 @@ void func_802D9ADC(Actor *this){
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 26000);
mole_setStaticCamera(this);
chmole_setStaticCamera(this);
func_8028F94C(2, this->position);
}
// 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.
subaddie_set_state(this, 5);
mole_setStaticCamera(this);
chmole_setStaticCamera(this);
func_8028F94C(2, this->position);
mole_learnAbility(this);
chmole_learnAbility(this);
}
// func_802D9C1C
void mole_setFacingDirection(Actor *this){
void chmole_setFacingDirection(Actor *this){
// Sets the actor to always be facing the player
subaddie_set_state_with_direction(this, 3, 0.0001f, 1);
actor_loopAnimation(this);
}
// func_802D9C54
void mole_spawnMolehill(ActorMarker *marker){
void chmole_spawnMolehill(ActorMarker *marker){
// Spawns a molehill for the actor
Actor *actor = marker_getActor(marker);
Actor *other = spawn_child_actor(ACTOR_12C_MOLEHILL, &actor);
@@ -299,11 +299,11 @@ void func_802D9C90(Actor *this){
}
// func_802D9CBC
void mole_startingDialog(Actor *this){
void chmole_startingDialog(Actor *this){
// If the player knows the ability, use refresher function
// Otherwise, set player's position and spawn mole
if(ability_isUnlocked(moleTable[this->unkF4_8 - 9].ability)){
mole_Refresher(this);
chmole_Refresher(this);
}
else{
if(func_80329530(this, 150)){
@@ -317,7 +317,7 @@ void mole_startingDialog(Actor *this){
}
// func_802D9D60
void mole_update(Actor *this){
void chmole_update(Actor *this){
// Sets up the initial functions and state for the actor
s32 sp50[6];
f32 sp4C;
@@ -358,7 +358,7 @@ void mole_update(Actor *this){
nodeprop_getPosition(node_prop, this->unk1C);
}
// 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->collidable = FALSE;
this->initialized = TRUE;
@@ -388,7 +388,7 @@ void mole_update(Actor *this){
){
player_getPosition(sp34);
if(ml_distance_vec3f(sp34, this->velocity) < this->unk28){
mole_startingDialog(this);
chmole_startingDialog(this);
}
}
else{//L802DA054
@@ -397,7 +397,7 @@ void mole_update(Actor *this){
&& func_8028EFC8()
&& 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);
}//L802DA128
if(actor_animationIsAt(this, 0.9999f)){
mole_setFacingDirection(this);
chmole_setFacingDirection(this);
func_8030DA44(this->unk44_31);
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);
}
else if(actor_animationIsAt(this, 0.35f)){//L802DA1EC
mole_learnAbility(this);
chmole_learnAbility(this);
}
break;
case 3://L802DA210
@@ -474,7 +474,7 @@ void mole_update(Actor *this){
}
// func_802DA498
int mole_learnedAllSpiralMountainAbilities(void){
int chmole_learnedAllSpiralMountainAbilities(void){
// Checks if the player has learned all of the Spiral Mountain abilities.
return ability_isUnlocked(ABILITY_F_DIVE)
&& ability_isUnlocked(ABILITY_4_BEAR_PUNCH)

View File

@@ -16,17 +16,17 @@ ActorInfo D_803731B0 = {
int func_803616F0(Actor *this){
switch(this->unkF4_8){
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
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
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
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
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
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:
return FALSE;
}

View File

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

View File

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