Ability name corrections.

This commit is contained in:
MaikelChan
2023-08-10 00:26:00 +02:00
parent e0fee1831b
commit c25a349249
20 changed files with 77 additions and 77 deletions

View File

@@ -2,8 +2,8 @@
#include "functions.h"
#include "variables.h"
s32 D_8037C3A0;
s32 D_8037C3A4;
s32 learnedAbilities;
s32 usedAbilities;
void ability_use(s32 arg0){
s32 sp2C;
@@ -12,7 +12,7 @@ void ability_use(s32 arg0){
sp2C = 0;
sp28 = 1;
if(D_8037C3A4 & (1 << arg0))
if(usedAbilities & (1 << arg0))
return;
switch(arg0){
@@ -53,7 +53,7 @@ void ability_use(s32 arg0){
return;
}
else{
D_8037C3A4 |= (1 << arg0);
usedAbilities |= (1 << arg0);
}
break;
case 0x8://L80295738 //fly
@@ -69,49 +69,49 @@ void ability_use(s32 arg0){
if(sp2C)
func_80311480(sp2C, 4, NULL, NULL, NULL, 0);
D_8037C3A4 |= (1 << arg0);
usedAbilities |= (1 << arg0);
}
int ability_hasUsed(enum ability_e move){
return (1 << move) & D_8037C3A4;
return (1 << move) & usedAbilities;
}
void ability_setHasUsed(enum ability_e move){
D_8037C3A4 |= (1 << move);
usedAbilities |= (1 << move);
}
int ability_hasLearned(enum ability_e move){
return (1 << move) & D_8037C3A0;
return (1 << move) & learnedAbilities;
}
s32 ability_getAllLearned(void){
return D_8037C3A0;
return learnedAbilities;
}
void ability_debug(void){}
void ability_clearAll(void){
D_8037C3A0 = 0;
D_8037C3A4 = 0;
learnedAbilities = 0;
usedAbilities = 0;
}
void func_80295818(s32 move, s32 val){
void ability_setLearned(s32 move, s32 val){
if(val){
D_8037C3A0 |= (1 << move);
learnedAbilities |= (1 << move);
}else{
D_8037C3A0 &= ~(1 << move);
learnedAbilities &= ~(1 << move);
}
}
void ability_setAllLearned(s32 val){
D_8037C3A0 = val;
learnedAbilities = val;
}
void ability_setAllUsed(s32 val){
D_8037C3A4 = val;
usedAbilities = val;
}
void ability_getSizeAndPtr(s32 *size, u8 **addr){
*size = 8;
*addr = &D_8037C3A0;
*addr = &learnedAbilities;
}

View File

@@ -723,7 +723,7 @@ void __baMarker_resolveCollision(Prop *other_prop){
case MARKER_45_FLIGHT_PAD: //L8028CE3C
case MARKER_240_LAIR_SWITCH_FLIGHT_PAD: //L8028CE3C
case MARKER_261_FIGHT_FLIGHT_PAD: //L8028CE3C
if(ability_isUnlocked(ABILITY_9_FLY)){
if(ability_isUnlocked(ABILITY_9_FLIGHT)){
miscflag_set(MISC_FLAG_1_ON_FLIGHT_PAD);
}
else if(! func_80320454(0xD, 1)){

View File

@@ -92,7 +92,7 @@ void bsbshock_charge_update(void){
func_80297970(0.0f);
}
else{//L802A6D18
if(should_flap())
if(should_feathery_flap())
sp2C = BS_BFLAP;
if(should_beak_bust())
@@ -174,7 +174,7 @@ void bsbshock_update(void){
if(func_8028B424())
sp2C = BS_3D_FALL_TUMBLING;
if(should_flap())
if(should_feathery_flap())
sp2C = BS_BFLAP;
if(should_beak_bust())

View File

@@ -197,7 +197,7 @@ enum bs_e func_802ADCD4(enum bs_e arg0){
if(should_shoot_egg())
func_80346C10(&arg0, -1, BS_9_EGG_HEAD, ITEM_D_EGGS, 0);
if(should_flip())
if(should_flap_flip())
arg0 = BS_12_BFLIP;
if(should_beak_barge())

View File

@@ -141,7 +141,7 @@ void bsjump_update(void){
if(button_released(BUTTON_A))
D_8037D4C2 = 0;
if(should_flap())
if(should_feathery_flap())
sp34 = BS_BFLAP;
if(should_peck())
@@ -218,7 +218,7 @@ void bsjump_fall_update(void){
if(func_8028B424())
sp2C = BS_3D_FALL_TUMBLING;
if(should_flap() && miscflag_isFalse(MISC_FLAG_5_HAS_PECKED))
if(should_feathery_flap() && miscflag_isFalse(MISC_FLAG_5_HAS_PECKED))
sp2C = BS_BFLAP;
if(should_peck())
@@ -412,7 +412,7 @@ void bsjump_tumble_update(void){
pitch_setIdeal(pitch_getIdeal() + 20.0f);
}
if(func_8029E348(0)){
if(should_flap())
if(should_feathery_flap())
sp1C = BS_BFLAP;
if(should_peck())

View File

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

View File

@@ -36,7 +36,7 @@ struct_core2_52290 D_80367DC4[] = {
{ASSET_B48_DIALOG_BEAKBUSTER_LEARN, ASSET_B4C_DIALOG_BEAKBUSTER_REFRESHER, 0x17, ABILITY_2_BEAK_BUSTER},
{ASSET_B49_DIALOG_TALON_TROT_LEARN, ASSET_B4A_DIALOG_TALON_TROT_REFRESHER, 0x18, ABILITY_10_TALON_TROT},
{ASSET_A1F_DIALOG_SHOCKJUMP_LEARN, ASSET_A23_DIALOG_SHOCKJUMP_REFRESHER, 0x0C, ABILITY_D_SHOCK_JUMP},
{ASSET_A20_DIALOG_FLY_LEARN, ASSET_A22_DIALOG_FLY_REFRESHER, 0x0D, ABILITY_9_FLY},
{ASSET_A20_DIALOG_FLY_LEARN, ASSET_A22_DIALOG_FLY_REFRESHER, 0x0D, ABILITY_9_FLIGHT},
{ASSET_D35_DIALOG_WONDERWING_LEARN, ASSET_D36_DIALOG_WONDERWING_REFRESHER, 0x01, ABILITY_12_WONDERWING},
{ASSET_C88_DIALOG_LONGLEG_LEARN, ASSET_C89_DIALOG_LONGLEG_REFRESHER, 0x10, ABILITY_E_WADING_BOOTS},
{ASSET_A84_DIALOG_TURBOTRAINERS_LEARN, ASSET_A85_DIALOG_TURBOTRAINERS_REFRESHER, 0x19, ABILITY_11_TURBO_TALON},
@@ -52,7 +52,7 @@ int func_802D9220(enum level_e level){
&& ability_isUnlocked(ABILITY_10_TALON_TROT);
case LEVEL_2_TREASURE_TROVE_COVE:
return ability_isUnlocked(ABILITY_D_SHOCK_JUMP)
&& ability_isUnlocked(ABILITY_9_FLY);
&& ability_isUnlocked(ABILITY_9_FLIGHT);
case LEVEL_3_CLANKERS_CAVERN:
return ability_isUnlocked(ABILITY_12_WONDERWING);
case LEVEL_4_BUBBLEGLOOP_SWAMP:
@@ -94,7 +94,7 @@ int func_802D93EC(void){
&& ability_isUnlocked(ABILITY_2_BEAK_BUSTER)
&& ability_isUnlocked(ABILITY_10_TALON_TROT)
&& ability_isUnlocked(ABILITY_D_SHOCK_JUMP)
&& ability_isUnlocked(ABILITY_9_FLY)
&& ability_isUnlocked(ABILITY_9_FLIGHT)
&& ability_isUnlocked(ABILITY_12_WONDERWING)
&& ability_isUnlocked(ABILITY_E_WADING_BOOTS)
&& ability_isUnlocked(ABILITY_1_BEAK_BOMB)
@@ -216,7 +216,7 @@ int func_802D997C(Actor *this){
sp2C = D_80367DC4[this->unkF4_8-9].learn_text;
ability_unlock(D_80367DC4[this->unkF4_8-9].ability);
switch(D_80367DC4[this->unkF4_8-9].ability){
case ABILITY_9_FLY:
case ABILITY_9_FLIGHT:
case ABILITY_D_SHOCK_JUMP:
func_8030E6A4(SFX_113_PAD_APPEARS, 0.9f, 32000);
break;
@@ -440,15 +440,15 @@ void func_802D9D60(Actor *this){
}//L802DA488
}
int func_802DA498(void){
int learnedAllTutorialAbilities(void){
return ability_isUnlocked(ABILITY_F_DIVE)
&& ability_isUnlocked(ABILITY_4_BEAR_PUNCH)
&& ability_isUnlocked(ABILITY_4_CLAW_SWIPE)
&& ability_isUnlocked(ABILITY_C_ROLL)
&& ability_isUnlocked(ABILITY_B_RATATAT_RAP)
&& ability_isUnlocked(ABILITY_0_BARGE)
&& ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER)
&& ability_isUnlocked(ABILITY_7_FLAP)
&& ability_isUnlocked(ABILITY_8_FLIP)
&& ability_isUnlocked(ABILITY_7_FEATHERY_FLAP)
&& ability_isUnlocked(ABILITY_8_FLAP_FLIP)
&& ability_isUnlocked(ABILITY_5_CLIMB)
;
}

View File

@@ -752,7 +752,7 @@ void func_8029C748(void) {
}
enum bs_e func_8029C780(void){
if(button_held(BUTTON_Z) && can_flip())
if(button_held(BUTTON_Z) && can_flap_flip())
return BS_12_BFLIP;
if(miscflag_isTrue(MISC_FLAG_2_ON_SPRING_PAD))

View File

@@ -32,7 +32,7 @@ s32 can_control_camera(void){
}
s32 can_claw(void){
return ability_hasLearned(ABILITY_4_BEAR_PUNCH);
return ability_hasLearned(ABILITY_4_CLAW_SWIPE);
}
s32 can_climb(void){
@@ -49,18 +49,18 @@ s32 can_egg(void){
return ability_hasLearned(ABILITY_6_EGGS);
}
int can_flap(void){
int can_feathery_flap(void){
return miscflag_isFalse(MISC_FLAG_12_HAS_FLAPPED)
&& miscflag_isFalse(MISC_FLAG_5_HAS_PECKED)
&& ability_hasLearned(ABILITY_7_FLAP);
&& ability_hasLearned(ABILITY_7_FEATHERY_FLAP);
}
s32 can_flip(void){
return ability_hasLearned(ABILITY_8_FLIP);
s32 can_flap_flip(void){
return ability_hasLearned(ABILITY_8_FLAP_FLIP);
}
s32 can_fly(void){
return ability_hasLearned(ABILITY_9_FLY);
return ability_hasLearned(ABILITY_9_FLIGHT);
}
s32 can_control_jump_height(void){

View File

@@ -62,10 +62,10 @@ void func_802CA9D0(Actor *this){
void func_802CAA44(Actor *this){
this->marker->propPtr->unk8_3 = TRUE;
if(func_803203FC(UNKFLAGS1_8A_SANDCASTLE_FLIGHT_UNLOCKED)){
ability_unlock(ABILITY_9_FLY);
ability_unlock(ABILITY_9_FLIGHT);
}
if(ability_isUnlocked(ABILITY_9_FLY)){
if(ability_isUnlocked(ABILITY_9_FLIGHT)){
actor_setOpacity(this, 0xff);
}
else{

View File

@@ -675,7 +675,7 @@ bool func_8028F364(f32 position[3], f32 radius, f32 vert_range, enum actor_e act
}
void ability_unlock(enum ability_e uid){
func_80295818(uid, TRUE);
ability_setLearned(uid, TRUE);
}
void func_8028F3D8(f32 arg0[3], f32 arg1, void(*arg2)(ActorMarker *), ActorMarker *arg3){

View File

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

View File

@@ -37,12 +37,12 @@ int should_shoot_egg(void){
return button_pressed(BUTTON_C_UP) && can_egg();
}
int should_flap(void){
return button_pressed(BUTTON_A) && can_flap();
int should_feathery_flap(void){
return button_pressed(BUTTON_A) && can_feathery_flap();
}
int should_flip(void){
return button_pressed(BUTTON_A) && can_flip();
int should_flap_flip(void){
return button_pressed(BUTTON_A) && can_flap_flip();
}
int should_peck(void){