From 81c2817b09d6407581685058cdf5d62605b80d74 Mon Sep 17 00:00:00 2001 From: HailSanta <53960937+HailSanta@users.noreply.github.com> Date: Tue, 13 Sep 2022 02:36:06 -0400 Subject: [PATCH] PLAYER_STATUS_FLAGS begone (#772) Co-authored-by: HailSanta --- include/enums.h | 126 ++++++++--------- src/1a1f0_len_5390.c | 6 +- src/39210_len_aa0.c | 2 +- src/77480.c | 170 +++++++++++------------ src/7B440.c | 4 +- src/7E9D0.c | 62 ++++----- src/7bb60_len_41b0.c | 64 ++++----- src/7fd10_len_b40.c | 26 ++-- src/891b0_len_fb0.c | 2 +- src/C50A0.c | 4 +- src/E21870.c | 10 +- src/camera.c | 2 +- src/e20eb0.c | 12 +- src/entity/Block.c | 6 +- src/entity/BlueWarpPipe.c | 2 +- src/entity/Chest.c | 4 +- src/entity/HeartBlock.c | 4 +- src/entity/HiddenPanel.c | 4 +- src/entity/ItemBlock.c | 4 +- src/entity/Shadow.c | 2 +- src/entity/Signpost.c | 4 +- src/entity/SimpleSpring.c | 4 +- src/entity/Switch.c | 2 +- src/entity/jan_iwa/ArrowSign.c | 2 +- src/entity/jan_iwa/Plants1.c | 14 +- src/entity/jan_iwa/Plants2.c | 6 +- src/entity/sbk_omo/Tweester.c | 6 +- src/evt/player_api.c | 36 ++--- src/npc.c | 2 +- src/state_battle.c | 2 +- src/trigger.c | 2 +- src/world/action/hammer.c | 30 ++-- src/world/action/hit_fire.c | 14 +- src/world/action/hit_lava.c | 18 +-- src/world/action/idle.c | 30 ++-- src/world/action/jump.c | 72 +++++----- src/world/action/knockback.c | 10 +- src/world/action/land.c | 42 +++--- src/world/action/misc.c | 50 +++---- src/world/action/slide.c | 4 +- src/world/action/sneaky_parasol.c | 6 +- src/world/action/spin.c | 26 ++-- src/world/action/spin_jump.c | 20 +-- src/world/action/step_up.c | 16 +-- src/world/action/tornado_jump.c | 28 ++-- src/world/action/use_munchlesia.c | 4 +- src/world/action/use_spinning_flower.c | 16 +-- src/world/action/use_tweester.c | 8 +- src/world/action/walk.c | 68 ++++----- src/world/area_iwa/iwa_00/90CEF0.c | 2 +- src/world/area_iwa/iwa_01/912960.c | 2 +- src/world/area_iwa/iwa_03/918EF0.c | 2 +- src/world/area_kkj/kkj_00/ABB290.c | 2 +- src/world/common/UnkFunc11.inc.c | 2 +- src/world/common/atomic/Pipe.inc.c | 2 +- src/world/common/atomic/PipeData.inc.c | 4 +- src/world/common/atomic/QuizmoData.inc.c | 4 +- src/world/common/atomic/Reflection.inc.c | 6 +- src/world/common/enemy/FireBarAI.inc.c | 4 +- src/world/partner/bombette.c | 2 +- src/world/partner/bow.c | 30 ++-- src/world/partner/kooper.c | 6 +- src/world/partner/lakilester.c | 68 ++++----- src/world/partner/parakarry.c | 18 +-- src/world/partner/sushie.c | 2 +- src/world/partner/watt.c | 26 ++-- src/world/partners.c | 24 ++-- src/world/script_api/7E3700.c | 2 +- src/world/script_api/7E4690.c | 4 +- 69 files changed, 635 insertions(+), 635 deletions(-) diff --git a/include/enums.h b/include/enums.h index 22ab4645f5..1415e80046 100644 --- a/include/enums.h +++ b/include/enums.h @@ -3123,73 +3123,73 @@ enum NpcFlags { }; enum PlayerStatusFlags { - PLAYER_STATUS_FLAGS_AIRBORNE = 0x0000000E, - PLAYER_STATUS_FLAGS_JUMPING = 0x00000002, - PLAYER_STATUS_FLAGS_FALLING = 0x00000004, - PLAYER_STATUS_FLAGS_FLYING = 0x00000008, - PLAYER_STATUS_FLAGS_10 = 0x00000010, - PLAYER_STATUS_FLAGS_20 = 0x00000020, - PLAYER_STATUS_FLAGS_40 = 0x00000040, - PLAYER_STATUS_FLAGS_80 = 0x00000080, - PLAYER_STATUS_FLAGS_100 = 0x00000100, - PLAYER_STATUS_FLAGS_200 = 0x00000200, - PLAYER_STATUS_FLAGS_400 = 0x00000400, - PLAYER_STATUS_FLAGS_800 = 0x00000800, - PLAYER_STATUS_FLAGS_1000 = 0x00001000, - PLAYER_STATUS_FLAGS_INPUT_DISABLED = 0x00002000, - PLAYER_STATUS_FLAGS_4000 = 0x00004000, - PLAYER_STATUS_FLAGS_8000 = 0x00008000, - PLAYER_STATUS_FLAGS_20000 = 0x00020000, - PLAYER_STATUS_FLAGS_40000 = 0x00040000, // physics and animations run at half speed - PLAYER_STATUS_FLAGS_80000 = 0x00080000, - PLAYER_STATUS_FLAGS_100000 = 0x00100000, - PLAYER_STATUS_FLAGS_200000 = 0x00200000, // using hammer? - PLAYER_STATUS_FLAGS_400000 = 0x00400000, // taking quiz? - PLAYER_STATUS_FLAGS_800000 = 0x00800000, - PLAYER_STATUS_FLAGS_1000000 = 0x01000000, - PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC = 0x02000000, - PLAYER_STATUS_FLAGS_CAMERA_DOESNT_FOLLOW = 0x04000000, - PLAYER_STATUS_FLAGS_8000000 = 0x08000000, - PLAYER_STATUS_FLAGS_10000000 = 0x10000000, - PLAYER_STATUS_FLAGS_20000000 = 0x20000000, // done hammer? - PLAYER_STATUS_FLAGS_40000000 = 0x40000000, - PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED = 0x80000000, + PS_FLAGS_AIRBORNE = 0x0000000E, + PS_FLAGS_JUMPING = 0x00000002, + PS_FLAGS_FALLING = 0x00000004, + PS_FLAGS_FLYING = 0x00000008, + PS_FLAGS_10 = 0x00000010, + PS_FLAGS_20 = 0x00000020, + PS_FLAGS_40 = 0x00000040, + PS_FLAGS_80 = 0x00000080, + PS_FLAGS_100 = 0x00000100, + PS_FLAGS_200 = 0x00000200, + PS_FLAGS_400 = 0x00000400, + PS_FLAGS_800 = 0x00000800, + PS_FLAGS_1000 = 0x00001000, + PS_FLAGS_INPUT_DISABLED = 0x00002000, + PS_FLAGS_4000 = 0x00004000, + PS_FLAGS_8000 = 0x00008000, + PS_FLAGS_20000 = 0x00020000, + PS_FLAGS_40000 = 0x00040000, // physics and animations run at half speed + PS_FLAGS_80000 = 0x00080000, + PS_FLAGS_100000 = 0x00100000, + PS_FLAGS_200000 = 0x00200000, // using hammer? + PS_FLAGS_400000 = 0x00400000, // taking quiz? + PS_FLAGS_800000 = 0x00800000, + PS_FLAGS_1000000 = 0x01000000, + PS_FLAGS_HAS_CONVERSATION_NPC = 0x02000000, + PS_FLAGS_CAMERA_DOESNT_FOLLOW = 0x04000000, + PS_FLAGS_8000000 = 0x08000000, + PS_FLAGS_10000000 = 0x10000000, + PS_FLAGS_20000000 = 0x20000000, // done hammer? + PS_FLAGS_40000000 = 0x40000000, + PS_FLAGS_ACTION_STATE_CHANGED = 0x80000000, }; /// @see PlayerStatus::animFlags enum PlayerStatusAnimFlags { - PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT = 0x00000001, - PLAYER_STATUS_ANIM_FLAGS_2 = 0x00000002, - PLAYER_STATUS_ANIM_FLAGS_4 = 0x00000004, - PLAYER_STATUS_ANIM_FLAGS_8 = 0x00000008, ///< triggers partner use when set - PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE = 0x00000010, ///< ! prompt - PLAYER_STATUS_ANIM_FLAGS_SPEECH_PROMPT_AVAILABLE = 0x00000020, ///< (...) prompt - PLAYER_STATUS_ANIM_FLAGS_40 = 0x00000040, - PLAYER_STATUS_ANIM_FLAGS_USING_PULSE_STONE = 0x00000080, - PLAYER_STATUS_ANIM_FLAGS_100 = 0x00000100, - PLAYER_STATUS_ANIM_FLAGS_RAISED_ARMS = 0x00000200, ///< Sets action state to ACTION_STATE_RAISE_ARMS on idle - PLAYER_STATUS_ANIM_FLAGS_SHIVERING = 0x00000400, - PLAYER_STATUS_ANIM_FLAGS_800 = 0x00000800, - PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS = 0x00001000, - PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE = 0x00002000, - PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO = 0x00004000, - PLAYER_STATUS_ANIM_FLAGS_8000 = 0x00008000, - PLAYER_STATUS_ANIM_FLAGS_SPINNING = 0x00010000, - PLAYER_STATUS_ANIM_FLAGS_20000 = 0x00020000, - PLAYER_STATUS_ANIM_FLAGS_40000 = 0x00040000, - PLAYER_STATUS_ANIM_FLAGS_80000 = 0x00080000, - PLAYER_STATUS_ANIM_FLAGS_100000 = 0x00100000, ///< set when using pipes - PLAYER_STATUS_ANIM_FLAGS_200000 = 0x00200000, - PLAYER_STATUS_ANIM_FLAGS_400000 = 0x00400000, - PLAYER_STATUS_ANIM_FLAGS_800000 = 0x00800000, - PLAYER_STATUS_ANIM_FLAGS_1000000 = 0x01000000, - PLAYER_STATUS_ANIM_FLAGS_2000000 = 0x02000000, - PLAYER_STATUS_ANIM_FLAGS_4000000 = 0x04000000, - PLAYER_STATUS_ANIM_FLAGS_8000000 = 0x08000000, - PLAYER_STATUS_ANIM_FLAGS_10000000 = 0x10000000, - PLAYER_STATUS_ANIM_FLAGS_20000000 = 0x20000000, - PLAYER_STATUS_ANIM_FLAGS_40000000 = 0x40000000, - PLAYER_STATUS_ANIM_FLAGS_80000000 = 0x80000000, + PA_FLAGS_HOLDING_WATT = 0x00000001, + PA_FLAGS_2 = 0x00000002, + PA_FLAGS_4 = 0x00000004, + PA_FLAGS_8 = 0x00000008, ///< triggers partner use when set + PA_FLAGS_INTERACT_PROMPT_AVAILABLE = 0x00000010, ///< ! prompt + PA_FLAGS_SPEECH_PROMPT_AVAILABLE = 0x00000020, ///< (...) prompt + PA_FLAGS_40 = 0x00000040, + PA_FLAGS_USING_PULSE_STONE = 0x00000080, + PA_FLAGS_100 = 0x00000100, + PA_FLAGS_RAISED_ARMS = 0x00000200, ///< Sets action state to ACTION_STATE_RAISE_ARMS on idle + PA_FLAGS_SHIVERING = 0x00000400, + PA_FLAGS_800 = 0x00000800, + PA_FLAGS_USING_PEACH_PHYSICS = 0x00001000, + PA_FLAGS_IN_DISGUISE = 0x00002000, + PA_FLAGS_8BIT_MARIO = 0x00004000, + PA_FLAGS_8000 = 0x00008000, + PA_FLAGS_SPINNING = 0x00010000, + PA_FLAGS_20000 = 0x00020000, + PA_FLAGS_40000 = 0x00040000, + PA_FLAGS_80000 = 0x00080000, + PA_FLAGS_100000 = 0x00100000, ///< set when using pipes + PA_FLAGS_200000 = 0x00200000, + PA_FLAGS_400000 = 0x00400000, + PA_FLAGS_800000 = 0x00800000, + PA_FLAGS_1000000 = 0x01000000, + PA_FLAGS_2000000 = 0x02000000, + PA_FLAGS_4000000 = 0x04000000, + PA_FLAGS_8000000 = 0x08000000, + PA_FLAGS_10000000 = 0x10000000, + PA_FLAGS_20000000 = 0x20000000, + PA_FLAGS_40000000 = 0x40000000, + PA_FLAGS_80000000 = 0x80000000, }; enum PopupType { diff --git a/src/1a1f0_len_5390.c b/src/1a1f0_len_5390.c index 83fc64c777..2e266c075e 100644 --- a/src/1a1f0_len_5390.c +++ b/src/1a1f0_len_5390.c @@ -711,7 +711,7 @@ s32 check_conversation_trigger(void) { s32 i, j; playerStatus->encounteredNPC = NULL; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC; + playerStatus->flags &= ~PS_FLAGS_HAS_CONVERSATION_NPC; playerColliderHeight = playerStatus->colliderHeight; playerColliderRadius = playerStatus->colliderDiameter / 2; playerX = playerStatus->position.x; @@ -808,9 +808,9 @@ s32 check_conversation_trigger(void) { } } - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) && npc != NULL && !is_picking_up_item()) { + if (!(playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) && npc != NULL && !is_picking_up_item()) { playerStatus->encounteredNPC = npc; - playerStatus->flags |= PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC; + playerStatus->flags |= PS_FLAGS_HAS_CONVERSATION_NPC; if (playerStatus->pressedButtons & BUTTON_A) { close_status_menu(); gCurrentEncounter.hitType = ENCOUNTER_TRIGGER_CONVERSATION; diff --git a/src/39210_len_aa0.c b/src/39210_len_aa0.c index 648a0a0f93..a62f1f9025 100644 --- a/src/39210_len_aa0.c +++ b/src/39210_len_aa0.c @@ -13,7 +13,7 @@ void get_npc_pos(s32 npcID, f32* outX, f32* outY, f32* outZ, s32* arg4) { *outX = playerStatus->position.x; *outY = playerStatus->position.y; *outZ = playerStatus->position.z; - if (playerStatus->flags & (PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING)) { + if (playerStatus->flags & (PS_FLAGS_FALLING | PS_FLAGS_JUMPING)) { *arg4 = TRUE; } } else { diff --git a/src/77480.c b/src/77480.c index 9af930024f..0d2557bf73 100644 --- a/src/77480.c +++ b/src/77480.c @@ -367,7 +367,7 @@ s32 player_test_lateral_overlap(s32 mode, PlayerStatus* playerStatus, f32* x, f3 radius = playerStatus->colliderDiameter * 0.5f; ret = -1; - if (!(playerStatus->flags & (PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING))) { + if (!(playerStatus->flags & (PS_FLAGS_FALLING | PS_FLAGS_JUMPING))) { height = playerStatus->colliderHeight * 0.286f; } else { height = 1.0f; @@ -545,7 +545,7 @@ s32 player_test_move_with_slipping(PlayerStatus* playerStatus, f32* x, f32* y, f s32 ret = -1; height = 0.0f; - if (!(playerStatus->flags & (PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FALLING))) { + if (!(playerStatus->flags & (PS_FLAGS_JUMPING | PS_FLAGS_FALLING))) { height = 10.01f; } radius = playerStatus->colliderDiameter * 0.5f; @@ -593,16 +593,16 @@ void update_player(void) { update_partner_timers(); if ((playerStatus->timeInAir > 100) || (playerStatus->position.y < -2000.0f)) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_10000000)) { + if (!(playerStatus->animFlags & PA_FLAGS_10000000)) { playerStatus->timeInAir = 0; playerStatus->position.x = playerStatus->lastGoodPosition.x; playerStatus->position.y = playerStatus->lastGoodPosition.y; playerStatus->position.z = playerStatus->lastGoodPosition.z; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_400000) { + if (playerStatus->animFlags & PA_FLAGS_400000) { Npc* partner; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_20000000 | PLAYER_STATUS_ANIM_FLAGS_4; + playerStatus->animFlags |= PA_FLAGS_20000000 | PA_FLAGS_4; partner = get_npc_unsafe(NPC_PARTNER); partner->pos.x = playerStatus->lastGoodPosition.x; partner->pos.y = playerStatus->lastGoodPosition.y + playerStatus->colliderHeight; @@ -620,10 +620,10 @@ void update_player(void) { collisionStatus->floorBelow = 1; update_player_input(); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_400; + playerStatus->flags &= ~PS_FLAGS_400; update_player_blink(); - if (playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->flags & PA_FLAGS_USING_PEACH_PHYSICS) { phys_update_action_state(); if (!func_800E0208()) { collision_main_lateral(); @@ -634,15 +634,15 @@ void update_player(void) { phys_update_lava_reset(); } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_4000) { + if (playerStatus->flags & PS_FLAGS_4000) { playerStatus->moveFrames--; if (playerStatus->moveFrames <= 0) { playerStatus->moveFrames = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_4000; + playerStatus->flags &= ~PS_FLAGS_4000; } } - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) { + if (!(playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS)) { func_800EFD08(); } @@ -655,7 +655,7 @@ void update_player(void) { gameStatus->playerYaw = playerStatus->currentYaw; check_input_open_menus(); - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) { + if (!(playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS)) { check_input_status_menu(); } @@ -668,8 +668,8 @@ void update_player(void) { playerStatus->extraVelocity.x = 0.0f; playerStatus->extraVelocity.y = 0.0f; playerStatus->extraVelocity.z = 0.0f; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_10; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_8; + playerStatus->flags &= ~PS_FLAGS_10; + playerStatus->animFlags &= ~PA_FLAGS_8; } void check_input_use_partner(void) { @@ -677,10 +677,10 @@ void check_input_use_partner(void) { PlayerData* playerData = &gPlayerData; u32 actionState = playerStatus->actionState; - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO)) { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8 || playerStatus->inputEnabledCounter == 0) { - if (playerStatus->pressedButtons & BUTTON_C_DOWN && !(playerStatus->flags & PLAYER_STATUS_FLAGS_80) && - !(playerStatus->pressedButtons & BUTTON_B) && !(playerStatus->animFlags & PLAYER_STATUS_FLAGS_1000) && + if (!(playerStatus->animFlags & PA_FLAGS_8BIT_MARIO)) { + if (playerStatus->animFlags & PA_FLAGS_8 || playerStatus->inputEnabledCounter == 0) { + if (playerStatus->pressedButtons & BUTTON_C_DOWN && !(playerStatus->flags & PS_FLAGS_80) && + !(playerStatus->pressedButtons & BUTTON_B) && !(playerStatus->animFlags & PS_FLAGS_1000) && actionState <= ACTION_STATE_RUN) { if (playerData->currentPartner == PARTNER_GOOMBARIO) { @@ -699,14 +699,14 @@ void phys_update_standard(void) { check_input_use_partner(); phys_update_action_state(); - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_FLYING)) { - if (playerStatus->flags & PLAYER_STATUS_FLAGS_JUMPING) { + if (!(playerStatus->flags & PS_FLAGS_FLYING)) { + if (playerStatus->flags & PS_FLAGS_JUMPING) { phys_update_jump(); } } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_FALLING) { - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_FLYING)) { + if (playerStatus->flags & PS_FLAGS_FALLING) { + if (!(playerStatus->flags & PS_FLAGS_FLYING)) { phys_update_falling(); } } @@ -718,7 +718,7 @@ void phys_update_standard(void) { collision_check_player_overlaps(); if (collision_main_above() < 0 && playerStatus->timeInAir == 0 && - playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { func_800E4F10(); } @@ -728,11 +728,11 @@ void phys_update_standard(void) { } } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_2) { + if (playerStatus->animFlags & PA_FLAGS_2) { world_watt_sync_held_position(); } - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_CAMERA_DOESNT_FOLLOW)) { + if (!(playerStatus->flags & PS_FLAGS_CAMERA_DOESNT_FOLLOW)) { gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; @@ -744,7 +744,7 @@ void phys_update_lava_reset(void) { collision_main_lateral(); collision_lava_reset_check_additional_overlaps(); - if (!(gPlayerStatusPtr->flags & PLAYER_STATUS_FLAGS_CAMERA_DOESNT_FOLLOW)) { + if (!(gPlayerStatusPtr->flags & PS_FLAGS_CAMERA_DOESNT_FOLLOW)) { Camera* camera = &gCameras[CAM_DEFAULT]; camera->targetPos.x = gPlayerStatusPtr->position.x; @@ -810,17 +810,17 @@ s32 get_overriding_player_anim(s32 anim) { } if (anim == ANIM_Mario_6000C || anim == ANIM_Peach_C0010 || anim == ANIM_Mario_10002) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) { + if (!(playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS)) { if (!func_800DFCF4()) { return -1; } - } else if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + } else if (!(playerStatus->animFlags & PA_FLAGS_IN_DISGUISE)) { anim = ANIM_Peach_C0010; } else { peach_set_disguise_anim(BasicPeachDisguiseAnims[playerStatus->peachDisguise].hold); return -1; } - } else if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + } else if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { if ((playerStatus->peachItemHeld != 0) && (anim == ANIM_Peach_C0000 || anim == ANIM_Peach_C0001 || anim == ANIM_Peach_C0002)) { anim = ANIM_Peach_D0000; @@ -841,7 +841,7 @@ void suggest_player_anim_clearUnkFlag(AnimID anim) { if (newAnim != -1) { playerStatus->anim = newAnim; playerStatus->unk_BC = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_10000000; + playerStatus->flags &= ~PS_FLAGS_10000000; } } @@ -850,7 +850,7 @@ void force_player_anim(AnimID anim) { playerStatus->anim = anim; playerStatus->unk_BC = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_10000000; + playerStatus->flags &= ~PS_FLAGS_10000000; } void suggest_player_anim_setUnkFlag(AnimID anim) { @@ -860,7 +860,7 @@ void suggest_player_anim_setUnkFlag(AnimID anim) { if (newAnim != -1) { playerStatus->anim = newAnim; playerStatus->unk_BC = 0; - playerStatus->flags |= PLAYER_STATUS_FLAGS_10000000; + playerStatus->flags |= PS_FLAGS_10000000; } } @@ -891,13 +891,13 @@ void update_player_blink(void) { if (!playerStatus->blinkTimer) { if (outtaSight) { playerStatus->alpha1 = 128; - playerStatus->flags |= PLAYER_STATUS_FLAGS_8000; + playerStatus->flags |= PS_FLAGS_8000; } else { playerStatus->alpha1 = 255; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_8000; + playerStatus->flags &= ~PS_FLAGS_8000; } } else { - playerStatus->flags |= PLAYER_STATUS_FLAGS_8000; + playerStatus->flags |= PS_FLAGS_8000; } } } @@ -920,7 +920,7 @@ void disable_player_shadow(void) { s32 disable_player_static_collisions(void) { PlayerStatus* playerStatus = &gPlayerStatus; - playerStatus->flags |= PLAYER_STATUS_FLAGS_1000; + playerStatus->flags |= PS_FLAGS_1000; playerStatus->enableCollisionOverlapsCheck++; return playerStatus->enableCollisionOverlapsCheck; } @@ -930,7 +930,7 @@ s32 enable_player_static_collisions(void) { playerStatus->enableCollisionOverlapsCheck--; if (playerStatus->enableCollisionOverlapsCheck == 0) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_1000; + playerStatus->flags &= ~PS_FLAGS_1000; } return playerStatus->enableCollisionOverlapsCheck; } @@ -938,7 +938,7 @@ s32 enable_player_static_collisions(void) { s32 disable_player_input(void) { PlayerStatus* playerStatus = &gPlayerStatus; - playerStatus->flags |= PLAYER_STATUS_FLAGS_INPUT_DISABLED; + playerStatus->flags |= PS_FLAGS_INPUT_DISABLED; playerStatus->inputEnabledCounter++; return playerStatus->inputEnabledCounter; } @@ -948,7 +948,7 @@ s32 enable_player_input(void) { playerStatus->inputEnabledCounter--; if (playerStatus->inputEnabledCounter == 0) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_INPUT_DISABLED; + playerStatus->flags &= ~PS_FLAGS_INPUT_DISABLED; } return playerStatus->inputEnabledCounter; } @@ -956,8 +956,8 @@ s32 enable_player_input(void) { void func_800E01DC(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE) { - playerStatus->flags |= PLAYER_STATUS_FLAGS_8000000; + if (playerStatus->animFlags & PA_FLAGS_INTERACT_PROMPT_AVAILABLE) { + playerStatus->flags |= PS_FLAGS_8000000; } } @@ -985,7 +985,7 @@ void check_for_ispy(void) { if (D_8015A57A != 0 && D_8010C93C == NULL) { if (!(playerStatus->animFlags & - (PLAYER_STATUS_ANIM_FLAGS_SPEECH_PROMPT_AVAILABLE | PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE))) { + (PA_FLAGS_SPEECH_PROMPT_AVAILABLE | PA_FLAGS_INTERACT_PROMPT_AVAILABLE))) { dma_copy(E225B0_ROM_START, E225B0_ROM_END, E225B0_VRAM_DEF); D_8010C93C = func_802B72C0_E22870; } @@ -997,14 +997,14 @@ void check_for_ispy(void) { } void func_800E0330(void) { - if ((gPlayerStatusPtr->animFlags & PLAYER_STATUS_ANIM_FLAGS_100) && (D_8010C93C != NULL)) { + if ((gPlayerStatusPtr->animFlags & PA_FLAGS_100) && (D_8010C93C != NULL)) { func_802B7000_E225B0(); } } void func_800E0374(void) { D_8010C93C = NULL; - gPlayerStatusPtr->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_100; + gPlayerStatusPtr->animFlags &= ~PA_FLAGS_100; } void check_for_pulse_stone(void) { @@ -1012,7 +1012,7 @@ void check_for_pulse_stone(void) { s32 dx, dy; if (D_8010C920 == NULL) { - if (gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_100) { + if (gPlayerStatus.animFlags & PA_FLAGS_100) { return; } @@ -1026,15 +1026,15 @@ void check_for_pulse_stone(void) { return; } - if (!(gPlayerStatus.animFlags & (PLAYER_STATUS_ANIM_FLAGS_USING_PULSE_STONE | PLAYER_STATUS_ANIM_FLAGS_40))) { + if (!(gPlayerStatus.animFlags & (PA_FLAGS_USING_PULSE_STONE | PA_FLAGS_40))) { return; } - if (gPlayerStatus.flags & PLAYER_STATUS_FLAGS_20 || gPlayerStatus.inputEnabledCounter) { + if (gPlayerStatus.flags & PS_FLAGS_20 || gPlayerStatus.inputEnabledCounter) { return; } - if (!(gPlayerStatus.animFlags & (PLAYER_STATUS_ANIM_FLAGS_SPEECH_PROMPT_AVAILABLE | PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE))) { + if (!(gPlayerStatus.animFlags & (PA_FLAGS_SPEECH_PROMPT_AVAILABLE | PA_FLAGS_INTERACT_PROMPT_AVAILABLE))) { dma_copy(E21870_ROM_START, E21870_ROM_END, E21870_VRAM_DEF); D_8010C920 = func_802B7140; } @@ -1046,14 +1046,14 @@ void check_for_pulse_stone(void) { } void func_800E04D0(void) { - if ((gPlayerStatusPtr->animFlags & PLAYER_STATUS_ANIM_FLAGS_40) && (D_8010C920 != 0)) { + if ((gPlayerStatusPtr->animFlags & PA_FLAGS_40) && (D_8010C920 != 0)) { func_802B71D4(); } } void func_800E0514(void) { D_8010C920 = 0; - gPlayerStatusPtr->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_40; + gPlayerStatusPtr->animFlags &= ~PA_FLAGS_40; } s32 has_valid_conversation_npc(void) { @@ -1063,20 +1063,20 @@ s32 has_valid_conversation_npc(void) { s32 cond; if (npc != NULL && !(npc->flags & 0x10000000)) { - cond = (playerStatus->flags & (PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC | PLAYER_STATUS_FLAGS_INPUT_DISABLED)) - == PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC; + cond = (playerStatus->flags & (PS_FLAGS_HAS_CONVERSATION_NPC | PS_FLAGS_INPUT_DISABLED)) + == PS_FLAGS_HAS_CONVERSATION_NPC; ret = cond; } return ret; } void check_for_conversation_prompt(void) { - if (gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_100 || D_8010C958 || D_8010C920) { + if (gPlayerStatus.animFlags & PA_FLAGS_100 || D_8010C958 || D_8010C920) { return; } if (D_8010C940 == NULL) { - if (gPlayerStatus.inputEnabledCounter || gPlayerStatus.flags & PLAYER_STATUS_FLAGS_20) { + if (gPlayerStatus.inputEnabledCounter || gPlayerStatus.flags & PS_FLAGS_20) { return; } @@ -1096,14 +1096,14 @@ void check_for_conversation_prompt(void) { } void func_800E0658(void) { - if ((gPlayerStatusPtr->animFlags & PLAYER_STATUS_ANIM_FLAGS_SPEECH_PROMPT_AVAILABLE) && (D_8010C940 != 0)) { + if ((gPlayerStatusPtr->animFlags & PA_FLAGS_SPEECH_PROMPT_AVAILABLE) && (D_8010C940 != 0)) { func_802B71C8(); } } void func_800E069C(void) { D_8010C940 = 0; - gPlayerStatusPtr->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_SPEECH_PROMPT_AVAILABLE; + gPlayerStatusPtr->animFlags &= ~PA_FLAGS_SPEECH_PROMPT_AVAILABLE; } void func_800E06C0(s32 arg0) { @@ -1122,7 +1122,7 @@ s32 func_800E06D8(void) { if (gCollisionStatus.currentWall == -1) { return FALSE; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC && !(playerStatus->flags & PLAYER_STATUS_FLAGS_INPUT_DISABLED) + if (playerStatus->flags & PS_FLAGS_HAS_CONVERSATION_NPC && !(playerStatus->flags & PS_FLAGS_INPUT_DISABLED) && npc != NULL && npc->flags & NPC_FLAG_10000000) { playerStatus->interactingWithID = -1; return TRUE; @@ -1141,11 +1141,11 @@ s32 func_800E06D8(void) { } if (temp == wall) { - if (playerStatus->flags & PLAYER_STATUS_FLAGS_8000000) { + if (playerStatus->flags & PS_FLAGS_8000000) { return FALSE; } } else { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_8000000; + playerStatus->flags &= ~PS_FLAGS_8000000; } playerStatus->interactingWithID = -1; @@ -1159,7 +1159,7 @@ void check_for_interactables(void) { Npc* npc = gPlayerStatus.encounteredNPC; s32 phi_s2; - if ((playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100) || D_8010C940 || D_8010C920) { + if ((playerStatus->animFlags & PA_FLAGS_100) || D_8010C940 || D_8010C920) { return; } @@ -1194,7 +1194,7 @@ void check_for_interactables(void) { curInteraction = -1; break; } - } else if (((playerStatus->flags & (PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC | PLAYER_STATUS_FLAGS_INPUT_DISABLED)) == PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC) + } else if (((playerStatus->flags & (PS_FLAGS_HAS_CONVERSATION_NPC | PS_FLAGS_INPUT_DISABLED)) == PS_FLAGS_HAS_CONVERSATION_NPC) && (npc != NULL) && (npc->flags & NPC_FLAG_10000000)) { curInteraction = npc->npcID | COLLISION_WITH_NPC_BIT; if (playerStatus->interactingWithID == curInteraction) { @@ -1203,7 +1203,7 @@ void check_for_interactables(void) { phi_s2 = 0; } else { playerStatus->interactingWithID = -1; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_8000000; + playerStatus->flags &= ~PS_FLAGS_8000000; return; } } else { @@ -1212,7 +1212,7 @@ void check_for_interactables(void) { if (!(curInteraction & COLLISION_WITH_NPC_BIT)) { if (!should_collider_allow_interact(curInteraction)) { playerStatus->interactingWithID = -1; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_8000000; + playerStatus->flags &= ~PS_FLAGS_8000000; return; } } @@ -1220,30 +1220,30 @@ void check_for_interactables(void) { if (!phys_can_player_interact()) { phi_s2 = 1; playerStatus->interactingWithID = -1; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_8000000; + playerStatus->flags &= ~PS_FLAGS_8000000; return; } phi_s2 = 1; } } if (playerStatus->interactingWithID == curInteraction) { - if ((playerStatus->flags & PLAYER_STATUS_FLAGS_8000000)) { + if ((playerStatus->flags & PS_FLAGS_8000000)) { return; } } else { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_8000000; + playerStatus->flags &= ~PS_FLAGS_8000000; } playerStatus->interactingWithID = curInteraction; if ((phi_s2 == 0) || curInteraction >= 0 && get_entity_by_index(curInteraction)->flags & ENTITY_FLAGS_SHOWS_INSPECT_PROMPT) { if (playerStatus->actionState == ACTION_STATE_IDLE || playerStatus->actionState == ACTION_STATE_WALK || playerStatus->actionState == ACTION_STATE_RUN) { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE; + playerStatus->animFlags |= PA_FLAGS_INTERACT_PROMPT_AVAILABLE; func_800EF3D4(2); } } } - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE)) { + if (!(playerStatus->animFlags & PA_FLAGS_INTERACT_PROMPT_AVAILABLE)) { func_800EF3D4(0); repartner_set_tether_distance(); return; @@ -1263,14 +1263,14 @@ void check_for_interactables(void) { void func_802B71E8_E202F8(void); void func_800E0AD0(void) { - if ((gPlayerStatusPtr->animFlags & PLAYER_STATUS_FLAGS_10) && (D_8010C958 != 0)) { + if ((gPlayerStatusPtr->animFlags & PS_FLAGS_10) && (D_8010C958 != 0)) { func_802B71E8_E202F8(); } } void func_800E0B14(void) { D_8010C958 = 0; - gPlayerStatusPtr->animFlags &= ~PLAYER_STATUS_FLAGS_10; + gPlayerStatusPtr->animFlags &= ~PS_FLAGS_10; } void update_partner_timers(void) { @@ -1335,7 +1335,7 @@ void func_800E0B90(void) { } } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_200000) { + if (playerStatus->flags & PS_FLAGS_200000) { angle = 0.0f; } @@ -1348,15 +1348,15 @@ void func_800E0B90(void) { } trueAnim = playerStatus->anim; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_20000) { + if (playerStatus->flags & PS_FLAGS_20000) { playerStatus->trueAnimation = trueAnim; } else { sprIndex = (trueAnim >> 0x10) & 0xFF; - if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP && !(playerStatus->flags & PLAYER_STATUS_FLAGS_100000)) { + if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP && !(playerStatus->flags & PS_FLAGS_100000)) { playerStatus->spriteFacingAngle = angle + D_800F7B48; trueAnim = playerStatus->anim; - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_10000000) && + if (!(playerStatus->flags & PS_FLAGS_10000000) && (sprIndex == SPR_Mario_1 || sprIndex == SPR_Mario_6 || sprIndex == SPR_Peach_A) && fabsf(get_clamped_angle_diff(cameraYaw, playerStatus->currentYaw)) < 60.0f) { @@ -1366,7 +1366,7 @@ void func_800E0B90(void) { playerStatus->currentYaw = playerStatus->targetYaw; } else { trueAnim = playerStatus->anim; - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_10000000) && + if (!(playerStatus->flags & PS_FLAGS_10000000) && (sprIndex == SPR_Mario_1 || sprIndex == SPR_Mario_6 || sprIndex == SPR_Peach_A) && playerStatus->spriteFacingAngle < 350.0f && playerStatus->spriteFacingAngle > 190.0f) { @@ -1377,14 +1377,14 @@ void func_800E0B90(void) { } timescale = 1.0f; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000) { + if (playerStatus->flags & PS_FLAGS_40000) { timescale = 0.5f; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_20000000) { + if (playerStatus->flags & PS_FLAGS_20000000) { timescale = 0.0f; } playerStatus->unk_BC = spr_update_player_sprite(0, playerStatus->trueAnimation, timescale); - playerStatus->flags |= PLAYER_STATUS_FLAGS_40000000; + playerStatus->flags |= PS_FLAGS_40000000; } s32 get_player_back_anim(s32 anim) { @@ -1449,14 +1449,14 @@ void render_player_model(void) { s8 renderModeTemp; void (*appendGfx)(void*); - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000000) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_40000000; + if (playerStatus->flags & PS_FLAGS_40000000) { + playerStatus->flags &= ~PS_FLAGS_40000000; get_screen_coords(gCurrentCamID, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, &x, &y, &z); - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_20000)) { + if (!(playerStatus->flags & PS_FLAGS_20000)) { if (playerStatus->alpha1 != playerStatus->alpha2) { if (playerStatus->alpha1 < 254) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_1000000)) { + if (!(playerStatus->animFlags & PA_FLAGS_1000000)) { renderModeTemp = RENDER_MODE_SURFACE_XLU_LAYER1; } else { renderModeTemp = RENDER_MODE_SURFACE_XLU_LAYER2; @@ -1478,13 +1478,13 @@ void render_player_model(void) { playerStatus->alpha2 = 0; } - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + if (!(playerStatus->animFlags & PA_FLAGS_IN_DISGUISE)) { rtPtr->appendGfxArg = playerStatus; rtPtr->distance = -z; rtPtr->renderMode = playerStatus->renderMode; - if (!(playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_20000)) { + if (!(playerStatus->flags & PA_FLAGS_20000)) { appendGfx = appendGfx_player; } else { appendGfx = appendGfx_player_spin; @@ -1530,8 +1530,8 @@ void appendGfx_player(void* data) { guTranslateF(sp60, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); guMtxCatF(sp20, sp60, sp20); - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_SHIVERING) { - playerStatus->animFlags = playerStatus->animFlags & ~PLAYER_STATUS_ANIM_FLAGS_SHIVERING; + if (playerStatus->animFlags & PA_FLAGS_SHIVERING) { + playerStatus->animFlags = playerStatus->animFlags & ~PA_FLAGS_SHIVERING; playerStatus->unk_0A = 22; func_802DDEE4(0, -1, 0, 0, 0, 0, 0, 0); func_802DDFF8(playerStatus->anim, 5, 1, 1, 1, 0, 0); diff --git a/src/7B440.c b/src/7B440.c index 853d0973c3..7f798ccae4 100644 --- a/src/7B440.c +++ b/src/7B440.c @@ -22,7 +22,7 @@ void update_player_input(void) { playerStatus->heldButtonsBuffer[inputBufPos] = playerStatus->heldButtons; playerStatus->inputBufPos = inputBufPos; - if (playerStatus->flags & (PLAYER_STATUS_FLAGS_INPUT_DISABLED | PLAYER_STATUS_FLAGS_1000)) { + if (playerStatus->flags & (PS_FLAGS_INPUT_DISABLED | PS_FLAGS_1000)) { playerStatus->stickAxis[0] = 0; playerStatus->stickAxis[1] = 0; playerStatus->currentButtons = 0; @@ -31,7 +31,7 @@ void update_player_input(void) { } if (playerStatus->animFlags & 8) { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_200000; + playerStatus->animFlags |= PA_FLAGS_200000; playerStatus->pressedButtons |= 4; } } diff --git a/src/7E9D0.c b/src/7E9D0.c index 2483fd9836..99b1139c49 100644 --- a/src/7E9D0.c +++ b/src/7E9D0.c @@ -212,11 +212,11 @@ void phys_update_action_state(void) { PlayerStatus* playerStatus = &gPlayerStatus; PlayerSpinState* playerSpinState = &gPlayerSpinState; - if (!(playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_40000)) { - playerStatus->flags &= ~PLAYER_STATUS_ANIM_FLAGS_20000000; + if (!(playerStatus->flags & PA_FLAGS_40000)) { + playerStatus->flags &= ~PA_FLAGS_20000000; } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { phys_peach_update(); return; } @@ -239,7 +239,7 @@ void phys_update_action_state(void) { if (playerSpinState->stopSoundTimer != 0) { playerSpinState->stopSoundTimer--; if (playerSpinState->stopSoundTimer == 0) { - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_SPINNING; + playerStatus->animFlags &= ~PA_FLAGS_SPINNING; if (playerSpinState->spinSoundID != 0) { sfx_stop_sound(playerSpinState->spinSoundID); } @@ -252,19 +252,19 @@ void phys_update_action_state(void) { if (actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN) { s32 cond; - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_INPUT_DISABLED)) { + if (!(playerStatus->flags & PS_FLAGS_INPUT_DISABLED)) { cond = check_conversation_trigger(); } else { cond = FALSE; } - if ((partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE) && !(playerStatus->flags & PLAYER_STATUS_FLAGS_20) && cond) { + if ((partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE) && !(playerStatus->flags & PS_FLAGS_20) && cond) { set_action_state(ACTION_STATE_TALK); } check_input_spin(); } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { void* dmaStart = PlayerActionsTable[playerStatus->actionState].dmaStart; if (dmaStart != NULL && dmaStart != D_8010C924) { @@ -273,7 +273,7 @@ void phys_update_action_state(void) { } } PlayerActionsTable[playerStatus->actionState].update(); - } while (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED); + } while (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED); } void phys_peach_update(void) { @@ -282,11 +282,11 @@ void phys_peach_update(void) { func_800E24F8(); do { - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_20) && check_conversation_trigger()) { + if (!(playerStatus->flags & PS_FLAGS_20) && check_conversation_trigger()) { set_action_state(ACTION_STATE_TALK); } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { Action* action = &PlayerActionsTable[playerStatus->actionState]; if (action->flag) { @@ -306,10 +306,10 @@ void phys_peach_update(void) { PlayerActionsTable[playerStatus->actionState].update(); } } - } while (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED); + } while (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED); peach_check_for_parasol_input(); - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE) { + if (playerStatus->animFlags & PA_FLAGS_IN_DISGUISE) { peach_sync_disguise_npc(); } } @@ -319,12 +319,12 @@ void set_action_state(s32 actionState) { PlayerData* playerData = &gPlayerData; PlayerSpinState* spinState = &gPlayerSpinState; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_200) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_200; + if (playerStatus->flags & PS_FLAGS_200) { + playerStatus->flags &= ~PS_FLAGS_200; enable_player_input(); } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) { // TODO figure this out #ifdef NON_EQUIVALENT if ( @@ -341,7 +341,7 @@ void set_action_state(s32 actionState) { #endif playerStatus->prevActionState = playerStatus->actionState; playerStatus->actionState = actionState; - playerStatus->flags |= PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + playerStatus->flags |= PS_FLAGS_ACTION_STATE_CHANGED; } return; } @@ -358,17 +358,17 @@ void set_action_state(s32 actionState) { if (partner == PARTNER_SUSHIE || partner == PARTNER_LAKILESTER || partner == PARTNER_PARAKARRY) { if (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE) { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; - playerStatus->flags |= PLAYER_STATUS_FLAGS_800; + playerStatus->animFlags |= PA_FLAGS_4; + playerStatus->flags |= PS_FLAGS_800; return; } } } if (actionState == ACTION_STATE_SLIDING) { - playerStatus->flags |= PLAYER_STATUS_FLAGS_10; + playerStatus->flags |= PS_FLAGS_10; playerStatus->moveFrames = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_4000; + playerStatus->flags &= ~PS_FLAGS_4000; } playerStatus->prevActionState = playerStatus->actionState; @@ -377,17 +377,17 @@ void set_action_state(s32 actionState) { } if (actionState == ACTION_STATE_ENEMY_FIRST_STRIKE) { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; + playerStatus->animFlags |= PA_FLAGS_4; } playerStatus->actionState = actionState; - playerStatus->flags |= PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + playerStatus->flags |= PS_FLAGS_ACTION_STATE_CHANGED; if (playerStatus->actionState == ACTION_STATE_SPIN) { return; } - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_20000; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_SPINNING; + playerStatus->flags &= ~PS_FLAGS_20000; + playerStatus->animFlags &= ~PA_FLAGS_SPINNING; if (spinState->spinSoundID != 0) { sfx_stop_sound(spinState->spinSoundID); @@ -444,7 +444,7 @@ s32 check_input_hammer(void) { PlayerData* playerData = &gPlayerData; if (playerStatus->pressedButtons & BUTTON_B) { - if (playerStatus->flags & PLAYER_STATUS_FLAGS_FALLING) { + if (playerStatus->flags & PS_FLAGS_FALLING) { return FALSE; } @@ -478,8 +478,8 @@ s32 check_input_jump(void) { } if (collisionStatus->touchingWallTrigger != 0 || - (playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_SPEECH_PROMPT_AVAILABLE | - PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE))) + (playerStatus->animFlags & (PA_FLAGS_SPEECH_PROMPT_AVAILABLE | + PA_FLAGS_INTERACT_PROMPT_AVAILABLE))) { return FALSE; } @@ -510,7 +510,7 @@ void check_input_spin(void) { PlayerSpinState* spinState = &gPlayerSpinState; PlayerSpinState* temp2 = spinState; - if (!(playerStatus->flags & (PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO | PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) && + if (!(playerStatus->flags & (PA_FLAGS_8BIT_MARIO | PA_FLAGS_USING_PEACH_PHYSICS)) && !(playerStatus->animFlags & 1) && !(playerStatus->currentButtons & D_CBUTTONS) && !is_ability_active(ABILITY_SLOW_GO)) { @@ -522,7 +522,7 @@ void check_input_spin(void) { if (actionState != ACTION_STATE_RIDE) { if (actionState < ACTION_STATE_STEP_UP) { if (actionState < ACTION_STATE_JUMP) { - if (actionState >= 0 && !(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_SPINNING)) { + if (actionState >= 0 && !(playerStatus->animFlags & PA_FLAGS_SPINNING)) { if (btnPressed || spinState->hasBufferedSpin) { set_action_state(ACTION_STATE_SPIN); if (spinState->hasBufferedSpin != FALSE) { @@ -554,7 +554,7 @@ void func_800E63A4(s32 arg0) { if (arg0 != 0) { set_action_state(ACTION_STATE_USE_SNEAKY_PARASOL); } else { - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE; + playerStatus->animFlags &= ~PA_FLAGS_IN_DISGUISE; gGameStatusPtr->peachFlags &= ~0x2; playerStatus->peachDisguise = 0; free_npc_by_index(D_8010C96C); @@ -574,7 +574,7 @@ void peach_check_for_parasol_input(void) { D_8010C92C--; if (D_8010C92C == 0) { if (gGameStatusPtr->peachFlags & 2) { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE; + playerStatus->animFlags |= PA_FLAGS_IN_DISGUISE; gGameStatusPtr->peachFlags |= 2; disguiseNpc = peach_make_disguise_npc(gGameStatusPtr->peachDisguise); diff --git a/src/7bb60_len_41b0.c b/src/7bb60_len_41b0.c index 14f982ae05..1db56eec27 100644 --- a/src/7bb60_len_41b0.c +++ b/src/7bb60_len_41b0.c @@ -35,7 +35,7 @@ s32 can_trigger_loading_zone(void) { if (partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE) { return TRUE; } else { - gPlayerStatusPtr->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; + gPlayerStatusPtr->animFlags |= PA_FLAGS_4; return FALSE; } } else { @@ -43,7 +43,7 @@ s32 can_trigger_loading_zone(void) { return partnerActionStatus->partnerActionState != PARTNER_ACTION_NONE; } if (partnerActionStatus->actingPartner == PARTNER_PARAKARRY) { - gPlayerStatusPtr->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; + gPlayerStatusPtr->animFlags |= PA_FLAGS_4; return FALSE; } } @@ -52,12 +52,12 @@ s32 can_trigger_loading_zone(void) { } void move_player(s32 duration, f32 heading, f32 speed) { - gPlayerStatus.flags |= PLAYER_STATUS_FLAGS_4000; + gPlayerStatus.flags |= PS_FLAGS_4000; gPlayerStatus.heading = heading; gPlayerStatus.moveFrames = duration; gPlayerStatus.currentSpeed = speed; - if (!(gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_400000)) { + if (!(gPlayerStatus.animFlags & PA_FLAGS_400000)) { set_action_state(speed > gPlayerStatus.walkSpeed ? ACTION_STATE_RUN : ACTION_STATE_WALK); } } @@ -124,8 +124,8 @@ void func_800E29C8(void) { f32 groundPosY; AnimID anim; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->actionSubstate = LANDING_ON_SWITCH_SUBSTATE_0; } @@ -152,7 +152,7 @@ void func_800E29C8(void) { func_800E315C(colliderID); playerStatus->position.y = groundPosY; if (colliderID >= 0) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) { anim = ANIM_Mario_10009; } else { anim = ANIM_Mario_6000B; @@ -243,7 +243,7 @@ void phys_update_jump(void) { record_jump_apex(); set_action_state(ACTION_STATE_HOP); integrate_gravity(); - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000) { + if (playerStatus->flags & PS_FLAGS_40000) { playerStatus->gravityIntegrator[1] *= 0.5f; playerStatus->gravityIntegrator[2] *= 0.5f; playerStatus->gravityIntegrator[3] *= 0.5f; @@ -286,7 +286,7 @@ void phys_init_integrator_for_current_state(void) { case ACTION_STATE_HIT_FIRE: case ACTION_STATE_HIT_LAVA: params = GravityParamsStartJump; - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_40000)) { + if (!(playerStatus->flags & PS_FLAGS_40000)) { playerStatus->gravityIntegrator[0] = *params++; playerStatus->gravityIntegrator[1] = *params++; playerStatus->gravityIntegrator[2] = *params++; @@ -310,7 +310,7 @@ void gravity_use_fall_parms(void) { do {} while (0); playerStatus = &gPlayerStatus; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000) { + if (playerStatus->flags & PS_FLAGS_40000) { playerStatus->gravityIntegrator[0] = *params++ / 12.0f; playerStatus->gravityIntegrator[1] = *params++ / 12.0f; playerStatus->gravityIntegrator[2] = *params++ / 12.0f; @@ -384,10 +384,10 @@ void phys_player_land(void) { playerStatus->timeInAir = 0; playerStatus->unk_C2 = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_800000; + playerStatus->flags &= ~PS_FLAGS_800000; playerStatus->landPos.x = playerStatus->position.x; playerStatus->landPos.z = playerStatus->position.z; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_AIRBORNE; + playerStatus->flags &= ~PS_FLAGS_AIRBORNE; sfx_play_sound_at_player(SOUND_SOFT_LAND, 0); if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) { phys_adjust_cam_on_landing(); @@ -417,7 +417,7 @@ void phys_player_land(void) { } } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_4000) { + if (playerStatus->flags & PS_FLAGS_4000) { set_action_state(ACTION_STATE_RUN); return; } @@ -446,7 +446,7 @@ void phys_player_land(void) { f32 integrate_gravity(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000) { + if (playerStatus->flags & PS_FLAGS_40000) { playerStatus->gravityIntegrator[2] += playerStatus->gravityIntegrator[3] / 1.7f; playerStatus->gravityIntegrator[1] += playerStatus->gravityIntegrator[2] / 1.7f; playerStatus->gravityIntegrator[0] += playerStatus->gravityIntegrator[1] / 1.7f; @@ -509,9 +509,9 @@ void collision_main_lateral(void) { f32 zBump; gCollisionStatus.pushingAgainstWall = -1; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_4000) { + if (playerStatus->flags & PS_FLAGS_4000) { speed = playerStatus->currentSpeed; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000) { + if (playerStatus->flags & PS_FLAGS_40000) { speed *= 0.5f; } add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, speed, playerStatus->heading); @@ -598,21 +598,21 @@ void collision_main_lateral(void) { } break; default: - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_FLYING)) { + if (!(playerStatus->flags & PS_FLAGS_FLYING)) { f32 new_var; speed = 0.0f; - if (!(playerStatus->flags & (PLAYER_STATUS_FLAGS_800000 | PLAYER_STATUS_FLAGS_INPUT_DISABLED))) { + if (!(playerStatus->flags & (PS_FLAGS_800000 | PS_FLAGS_INPUT_DISABLED))) { player_input_to_move_vector(&yaw, &speed); - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_SPINNING)) { + if (!(playerStatus->animFlags & PA_FLAGS_SPINNING)) { speed *= 0.03125f; - if (!(playerStatus->flags & (PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING))) { + if (!(playerStatus->flags & (PS_FLAGS_FALLING | PS_FLAGS_JUMPING))) { speed *= 0.25; } if (playerStatus->actionState == ACTION_STATE_LAUNCH) { speed *= 1.5; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000) { + if (playerStatus->flags & PS_FLAGS_40000) { speed *= 0.5f; } } @@ -626,7 +626,7 @@ void collision_main_lateral(void) { xBump = 0.0f; zBump = -speed * cosTheta; } - } else if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_SPINNING)) { + } else if (!(playerStatus->animFlags & PA_FLAGS_SPINNING)) { xBump = speed * sinTheta; zBump = -speed * cosTheta; } else { @@ -636,14 +636,14 @@ void collision_main_lateral(void) { sin_cos_rad(playerStatus->targetYaw * TAU / 360.0f, &sinTheta, &cosTheta); speed = playerStatus->currentSpeed; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000) { + if (playerStatus->flags & PS_FLAGS_40000) { speed *= 0.5f; } playerX = xBump + (speed * sinTheta); playerZ = zBump - (speed * cosTheta); yaw = atan2(0.0f, 0.0f, playerX, playerZ); speed = sqrtf(SQ(playerX) + SQ(playerZ)); - if (playerStatus->flags & (PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING)) { + if (playerStatus->flags & (PS_FLAGS_FALLING | PS_FLAGS_JUMPING)) { if (speed > playerStatus->runSpeed) { speed = playerStatus->runSpeed; } @@ -730,7 +730,7 @@ void collision_main_lateral(void) { } if (playerStatus->enableCollisionOverlapsCheck == 0) { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_SPINNING) { + if (playerStatus->animFlags & PA_FLAGS_SPINNING) { yaw2 = playerStatus->targetYaw; } else { yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw; @@ -904,7 +904,7 @@ void phys_main_collision_below(void) { return; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_AIRBORNE) { + if (playerStatus->flags & PS_FLAGS_AIRBORNE) { return; } @@ -912,7 +912,7 @@ void phys_main_collision_below(void) { return; } - if ((!(playerStatus->flags & PLAYER_STATUS_FLAGS_10) || + if ((!(playerStatus->flags & PS_FLAGS_10) || (phys_adjust_cam_on_landing(), !phys_should_player_be_sliding()) || (set_action_state(ACTION_STATE_SLIDING), (playerStatus->actionState != ACTION_STATE_SLIDING)))) { @@ -950,7 +950,7 @@ void phys_main_collision_below(void) { } if (playerStatus->actionState != ACTION_STATE_STEP_UP && !cond) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) { + if (!(playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS)) { if (playerY - playerStatus->position.y < 6.0f) { playerStatus->position.y = playerY; } else { @@ -965,7 +965,7 @@ void phys_main_collision_below(void) { } break; } - } else if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_FLYING) && + } else if (!(playerStatus->flags & PS_FLAGS_FLYING) && playerStatus->actionState != ACTION_STATE_USE_SPINNING_FLOWER) { if (outLength <= collHeightHalf + temp_f24 && hitDirX == 0.0f && hitDirZ == 0.0f) { @@ -995,7 +995,7 @@ void collision_lava_reset_check_additional_overlaps(void) { f32 x, y, z; f32 temp_f0; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { func_800E4F10(); return; } @@ -1079,7 +1079,7 @@ void func_800E4F10(void) { } void check_input_midair_jump(void) { - if (!(gPlayerStatus.flags & (PLAYER_STATUS_FLAGS_800000 | PLAYER_STATUS_FLAGS_10 | PLAYER_STATUS_FLAGS_FLYING)) && + if (!(gPlayerStatus.flags & (PS_FLAGS_800000 | PS_FLAGS_10 | PS_FLAGS_FLYING)) && !(gPlayerStatus.animFlags & 0x4001) && gPlayerStatus.unk_C2 >= 6 && gPlayerStatus.timeInAir < 18 && @@ -1135,7 +1135,7 @@ s32 phys_check_interactable_collision(void) { f32 x, y, z, yaw; s32 ret = -1; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_INPUT_DISABLED) { + if (playerStatus->flags & PS_FLAGS_INPUT_DISABLED) { return ret; } diff --git a/src/7fd10_len_b40.c b/src/7fd10_len_b40.c index aba4263b44..8defd368db 100644 --- a/src/7fd10_len_b40.c +++ b/src/7fd10_len_b40.c @@ -44,12 +44,12 @@ s32 func_800E6904(void) { PlayerStatus* playerStatus = &gPlayerStatus; s32 actionState = playerStatus->actionState; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100000) { + if (playerStatus->animFlags & PA_FLAGS_100000) { return FALSE; } if (partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE) { - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_1000) && + if (!(playerStatus->flags & PS_FLAGS_1000) && (actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN)) { return TRUE; @@ -75,17 +75,17 @@ s32 can_pause(s32 currentButtons, s32 pressedButtons) { PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus; s32 actionState = gPlayerStatus.actionState; - if (!(gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_100000) && - !(gPlayerStatus.flags & PLAYER_STATUS_FLAGS_100) && + if (!(gPlayerStatus.animFlags & PA_FLAGS_100000) && + !(gPlayerStatus.flags & PS_FLAGS_100) && !(currentButtons & (BUTTON_Z | BUTTON_R)) && (pressedButtons & (BUTTON_START | BUTTON_C_LEFT | BUTTON_C_RIGHT)) && ((gGameStatusPtr->mapShop == NULL) || !(gGameStatusPtr->mapShop->flags & 1)) && !(gOverrideFlags & GLOBAL_OVERRIDES_DISABLE_MENUS) && !is_picking_up_item()) { - if (!(gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO)) { + if (!(gPlayerStatus.animFlags & PA_FLAGS_8BIT_MARIO)) { if (partnerActionStatus->partnerActionState == PARTNER_ACTION_NONE) { - if (!(gPlayerStatus.flags & PLAYER_STATUS_FLAGS_1000)) { + if (!(gPlayerStatus.flags & PS_FLAGS_1000)) { if (actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN) @@ -232,11 +232,11 @@ void check_input_open_menus(void) { block_17: switch (D_8010CCF8) { case 0: - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40) { + if (playerStatus->flags & PS_FLAGS_40) { sfx_play_sound(SOUND_MENU_ERROR); if (D_8010C9C0) { func_800E6860(); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_20; + playerStatus->flags &= ~PS_FLAGS_20; gOverrideFlags &= ~GLOBAL_OVERRIDES_40; set_time_freeze_mode(TIME_FREEZE_NORMAL); } @@ -261,7 +261,7 @@ block_17: popup->initialPos = 0; break; } - playerStatus->flags |= PLAYER_STATUS_FLAGS_20; + playerStatus->flags |= PS_FLAGS_20; disable_player_input(); partner_disable_input(); D_8010CCFA = 3; @@ -270,7 +270,7 @@ block_17: } break; case 1: - flags = ~PLAYER_STATUS_FLAGS_20; + flags = ~PS_FLAGS_20; if ((func_800E6904() == 0) || is_picking_up_item() || D_8010CCFE < playerStatus->inputEnabledCounter) { playerStatus->flags &= flags; enable_player_input(); @@ -278,7 +278,7 @@ block_17: D_8010CD00 = 0; if (D_8010C9C0) { func_800E6860(); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_20; + playerStatus->flags &= ~PS_FLAGS_20; gOverrideFlags &= ~GLOBAL_OVERRIDES_40; set_time_freeze_mode(TIME_FREEZE_NORMAL); } @@ -351,7 +351,7 @@ block_17: } } func_800E6860(); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_20; + playerStatus->flags &= ~PS_FLAGS_20; gOverrideFlags &= ~GLOBAL_OVERRIDES_40; set_time_freeze_mode(TIME_FREEZE_NORMAL); } @@ -361,7 +361,7 @@ block_17: if (D_8010CCFA == 0) { func_800E6860(); D_8010CD00 = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_20; + playerStatus->flags &= ~PS_FLAGS_20; gOverrideFlags &= ~GLOBAL_OVERRIDES_40; enable_player_input(); partner_enable_input(); diff --git a/src/891b0_len_fb0.c b/src/891b0_len_fb0.c index d47b522083..39a2b307d8 100644 --- a/src/891b0_len_fb0.c +++ b/src/891b0_len_fb0.c @@ -35,7 +35,7 @@ void func_800EFD08(void) { colliderType = D_80109480; } - if (playerStatus->actionState == ACTION_STATE_LAND && playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->actionState == ACTION_STATE_LAND && playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { D_8010CFF4 = D_8010CFF0; } diff --git a/src/C50A0.c b/src/C50A0.c index 83e8fac9c1..e39eddc309 100644 --- a/src/C50A0.c +++ b/src/C50A0.c @@ -1845,7 +1845,7 @@ void update_item_entity_temp(ItemEntity* itemEntity) { if (!(itemEntity->flags & ITEM_ENTITY_FLAGS_2000000)) { s32 actionState = playerStatus->actionState; - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_10000000) && + if (!(playerStatus->animFlags & PA_FLAGS_10000000) && ((playerStatus->timeInAir == 0 && actionState != ACTION_STATE_JUMP && actionState != ACTION_STATE_FALLING) || @@ -2033,7 +2033,7 @@ block_47: // TODO required to match item_entity_disable_shadow(itemEntity); if (func_800DFCF4() && playerStatus->actionState != ACTION_STATE_USE_SPINNING_FLOWER && - !(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_10000000)) + !(playerStatus->animFlags & PA_FLAGS_10000000)) { set_action_state(ACTION_STATE_IDLE); } diff --git a/src/E21870.c b/src/E21870.c index ceda324f2c..5cdae745da 100644 --- a/src/E21870.c +++ b/src/E21870.c @@ -38,8 +38,8 @@ s32 func_802B704C(void) { PlayerStatus* playerStatus = &gPlayerStatus; if (!is_starting_conversation()) { - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_20)) { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PULSE_STONE) { + if (!(playerStatus->flags & PS_FLAGS_20)) { + if (playerStatus->animFlags & PA_FLAGS_USING_PULSE_STONE) { if (!has_valid_conversation_npc()) { if (!func_800E06D8()) { s32 dx = abs((gGameStatusPtr->mapID % 7) - 2); @@ -67,7 +67,7 @@ void func_802B7140(void) { D_802B7D18_E22588->pos.x = playerStatus->position.x; D_802B7D18_E22588->pos.y = playerStatus->position.y + playerStatus->colliderHeight + 8.0f; D_802B7D18_E22588->pos.z = playerStatus->position.z; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_40; + playerStatus->animFlags |= PA_FLAGS_40; D_8010C920 = func_802B74F0; } @@ -78,7 +78,7 @@ void func_802B71D4(void) { s32 var_v1; s32 dx, dy; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_40) { + if (playerStatus->animFlags & PA_FLAGS_40) { guScaleF(sp18, D_802B7D18_E22588->scale, D_802B7D18_E22588->scale, D_802B7D18_E22588->scale); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp18, sp58, sp18); @@ -153,7 +153,7 @@ void func_802B74F0(void) { if (!func_802B704C()) { D_8010C920 = NULL; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_40; + playerStatus->animFlags &= ~PA_FLAGS_40; return; } diff --git a/src/camera.c b/src/camera.c index e77ce3f3d1..c25b5e1183 100644 --- a/src/camera.c +++ b/src/camera.c @@ -76,7 +76,7 @@ void func_80032970(Camera* camera, f32 arg1) { camera->unk_514 = 1.0f; camera->unk_510 = 0.0f; } else { - if (gPlayerStatusPtr->animFlags & PLAYER_STATUS_ANIM_FLAGS_400000) { + if (gPlayerStatusPtr->animFlags & PA_FLAGS_400000) { stickX = gPartnerActionStatus.stickX; } else { stickX = gPlayerStatusPtr->stickAxis[0]; diff --git a/src/e20eb0.c b/src/e20eb0.c index ec832d9b2f..338cdb9104 100644 --- a/src/e20eb0.c +++ b/src/e20eb0.c @@ -91,13 +91,13 @@ void func_802B742C(void) { Npc* npc; if (((playerStatus->flags & - (PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC | - PLAYER_STATUS_FLAGS_40000 | - PLAYER_STATUS_FLAGS_20)) != PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC) || + (PS_FLAGS_HAS_CONVERSATION_NPC | + PS_FLAGS_40000 | + PS_FLAGS_20)) != PS_FLAGS_HAS_CONVERSATION_NPC) || (gGameState == 4) || - (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT) || + (playerStatus->animFlags & PA_FLAGS_HOLDING_WATT) || (playerStatus->inputEnabledCounter != 0) || - (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_SPINNING)) + (playerStatus->animFlags & PA_FLAGS_SPINNING)) { D_802B79A8_E21858->unk_2A = 3; } @@ -138,7 +138,7 @@ void func_802B742C(void) { if ((unk10 >= 70.0f && unk10 <= 110.0f) || (unk10 >= 250.0f && unk10 <= 290.0f)) { D_8010C940 = NULL; playerStatus->encounteredNPC = NULL; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_SPEECH_PROMPT_AVAILABLE; + playerStatus->animFlags &= ~PA_FLAGS_SPEECH_PROMPT_AVAILABLE; return; } var_a2 = e20eb0_UnkAngleFunc1(unk10); diff --git a/src/entity/Block.c b/src/entity/Block.c index 314d5bd020..ac2cd10749 100644 --- a/src/entity/Block.c +++ b/src/entity/Block.c @@ -121,7 +121,7 @@ void entity_base_block_update_slow_sinking(Entity* entity) { } } else { if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_CEILING) { - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_JUMPING)) { + if (!(playerStatus->flags & PS_FLAGS_JUMPING)) { Shadow* shadow = get_shadow_by_index(entity->shadowIndex); if (shadow != NULL) { f32 temp2 = entity->position.y - shadow->position.y; @@ -331,7 +331,7 @@ s32 entity_block_handle_collision(Entity* entity) { return FALSE; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_JUMPING) { + if (playerStatus->flags & PS_FLAGS_JUMPING) { exec_entity_commandlist(entity); } return TRUE; @@ -356,7 +356,7 @@ s32 entity_block_handle_collision(Entity* entity) { if (!(entity->collisionFlags & ENTITY_COLLISION_PLAYER_HAMMER)) { return TRUE; } - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_1000000)) { + if (!(playerStatus->flags & PS_FLAGS_1000000)) { return TRUE; } } diff --git a/src/entity/BlueWarpPipe.c b/src/entity/BlueWarpPipe.c index 05c1670774..e2d1913a97 100644 --- a/src/entity/BlueWarpPipe.c +++ b/src/entity/BlueWarpPipe.c @@ -61,7 +61,7 @@ void entity_BlueWarpPipe_idle(Entity* entity) { if ((entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) != 0) { gOverrideFlags |= GLOBAL_OVERRIDES_40; - if (!(playerStatus->flags & (PLAYER_STATUS_FLAGS_1000 | PLAYER_STATUS_FLAGS_INPUT_DISABLED))) { + if (!(playerStatus->flags & (PS_FLAGS_1000 | PS_FLAGS_INPUT_DISABLED))) { s32 stickAxisX = abs(playerStatus->stickAxis[0]); s32 stickAxisZ = playerStatus->stickAxis[1]; diff --git a/src/entity/Chest.c b/src/entity/Chest.c index 9a0077a745..ea7a55fb78 100644 --- a/src/entity/Chest.c +++ b/src/entity/Chest.c @@ -125,11 +125,11 @@ void entity_Chest_idle(Entity* entity) { rotation = clamp_angle(180.0f - entity->rotation.y); angle = fabsf(rotation - clamp_angle(atan2(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z))); - if ((!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) && + if ((!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) && (!(entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR)) && ((angle <= 40.0f) || (angle >= 320.0f))) { entity->flags |= ENTITY_FLAGS_SHOWS_INSPECT_PROMPT; - if ((playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE) && (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_WALL)) { + if ((playerStatus->animFlags & PA_FLAGS_INTERACT_PROMPT_AVAILABLE) && (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_WALL)) { exec_entity_commandlist(entity); data = entity->dataBuf.chest; data->state = 0; diff --git a/src/entity/HeartBlock.c b/src/entity/HeartBlock.c index c9427489d9..3995a818b5 100644 --- a/src/entity/HeartBlock.c +++ b/src/entity/HeartBlock.c @@ -157,7 +157,7 @@ void entity_HeartBlockContent_anim_idle(Entity* entity, s32 arg1) { exec_entity_commandlist(entity); disable_player_input(); gPlayerStatus.currentSpeed = 0; - gPlayerStatus.animFlags |= PLAYER_STATUS_ANIM_FLAGS_RAISED_ARMS; + gPlayerStatus.animFlags |= PA_FLAGS_RAISED_ARMS; set_time_freeze_mode(TIME_FREEZE_PARTIAL); gOverrideFlags |= GLOBAL_OVERRIDES_40; } @@ -275,7 +275,7 @@ void entity_HeartBlockContent__anim_heal(Entity* entity, s32 arg1) { } break; case 5: - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_RAISED_ARMS; + playerStatus->animFlags &= ~PA_FLAGS_RAISED_ARMS; enable_player_input(); set_time_freeze_mode(TIME_FREEZE_NORMAL); gOverrideFlags &= ~GLOBAL_OVERRIDES_40; diff --git a/src/entity/HiddenPanel.c b/src/entity/HiddenPanel.c index 54ca6bfdbf..2d94c11c4a 100644 --- a/src/entity/HiddenPanel.c +++ b/src/entity/HiddenPanel.c @@ -125,7 +125,7 @@ void entity_HiddenPanel_flip_over(Entity* entity) { data->rotationSpeed = 65.0f; set_time_freeze_mode(TIME_FREEZE_PARTIAL); disable_player_static_collisions(); - gPlayerStatusPtr->animFlags |= PLAYER_STATUS_ANIM_FLAGS_800; + gPlayerStatusPtr->animFlags |= PA_FLAGS_800; if (data->needSpawnItem) { data->needSpawnItem = FALSE; data->spawnedItemIndex = make_item_entity_nodelay(data->itemID, entity->position.x, entity->position.y + 2.0, entity->position.z, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, data->pickupVar); @@ -232,7 +232,7 @@ void entity_HiddenPanel_flip_over(Entity* entity) { exec_entity_commandlist(entity); if (data->unk_02) { set_time_freeze_mode(TIME_FREEZE_NORMAL); - gPlayerStatusPtr->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_800; + gPlayerStatusPtr->animFlags &= ~PA_FLAGS_800; } entity->flags &= ~ENTITY_FLAGS_DISABLE_COLLISION; if (data->standingNpcIndex >= 0) { diff --git a/src/entity/ItemBlock.c b/src/entity/ItemBlock.c index 04c9364a3c..8a240e3c5d 100644 --- a/src/entity/ItemBlock.c +++ b/src/entity/ItemBlock.c @@ -30,7 +30,7 @@ void entity_ItemBlock_idle(Entity* entity) { void entity_HiddenItemBlock_idle(Entity* entity) { s32 alpha = entity->alpha; - if (gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT) { + if (gPlayerStatus.animFlags & PA_FLAGS_HOLDING_WATT) { alpha += 32; if (alpha > 192) { alpha = 192; @@ -208,7 +208,7 @@ s32 entity_TriggerBlock_start_bound_script(Entity* entity) { void entity_TriggerBlock_disable_player_input(void) { disable_player_input(); gPlayerStatus.currentSpeed = 0.0f; - gPlayerStatus.flags |= PLAYER_STATUS_FLAGS_800000; + gPlayerStatus.flags |= PS_FLAGS_800000; set_action_state(ACTION_STATE_FALLING); gravity_use_fall_parms(); } diff --git a/src/entity/Shadow.c b/src/entity/Shadow.c index 3cef3b4f14..a454f04bf4 100644 --- a/src/entity/Shadow.c +++ b/src/entity/Shadow.c @@ -9,7 +9,7 @@ void entity_Shadow_init(Shadow* shadow) { s32 entity_can_collide_with_jumping_player(Entity* entity) { if ((entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_CEILING) && - (gPlayerStatus.flags & PLAYER_STATUS_FLAGS_JUMPING)) { + (gPlayerStatus.flags & PS_FLAGS_JUMPING)) { return TRUE; } return FALSE; diff --git a/src/entity/Signpost.c b/src/entity/Signpost.c index 379d503e76..c8f6e3b856 100644 --- a/src/entity/Signpost.c +++ b/src/entity/Signpost.c @@ -9,9 +9,9 @@ void entity_Signpost_idle(Entity* entity) { f32 val = fabsf(clamp_angle(180.0f - entity->rotation.y) - clamp_angle(atan2(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z))); - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT) && !(entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) && (val <= 40.0f || val >= 320.0f)) { + if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT) && !(entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) && (val <= 40.0f || val >= 320.0f)) { entity->flags |= ENTITY_FLAGS_SHOWS_INSPECT_PROMPT; - if ((playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE) && (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_WALL)) { + if ((playerStatus->animFlags & PA_FLAGS_INTERACT_PROMPT_AVAILABLE) && (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_WALL)) { entity_start_script(entity); } } else { diff --git a/src/entity/SimpleSpring.c b/src/entity/SimpleSpring.c index 31e72edf02..da68d41bad 100644 --- a/src/entity/SimpleSpring.c +++ b/src/entity/SimpleSpring.c @@ -15,8 +15,8 @@ void entity_ScriptSpring_idle(Entity* entity) { if (playerStatus->actionState != ACTION_STATE_RIDE && (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR)) { playerStatus->unk_C5 = 5; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_FALLING; - playerStatus->flags |= PLAYER_STATUS_FLAGS_800000; + playerStatus->flags &= ~PS_FLAGS_FALLING; + playerStatus->flags |= PS_FLAGS_800000; play_model_animation(entity->virtualModelIndex, Entity_ScriptSpring_AnimLaunch); if (entity_start_script(entity)) { set_action_state(ACTION_STATE_USE_SPRING); diff --git a/src/entity/Switch.c b/src/entity/Switch.c index 8f0a1b7b1c..873dd05256 100644 --- a/src/entity/Switch.c +++ b/src/entity/Switch.c @@ -436,7 +436,7 @@ void entity_base_switch_init(Entity* entity) { PlayerStatus* playerStatus = &gPlayerStatus; SwitchData* data = entity->dataBuf.swtch; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_1000000; + playerStatus->animFlags |= PA_FLAGS_1000000; data->baseScale.x = 1.0f; data->baseScale.y = 1.0f; data->baseScale.z = 1.0f; diff --git a/src/entity/jan_iwa/ArrowSign.c b/src/entity/jan_iwa/ArrowSign.c index fa9a4ee062..6480d91f8e 100644 --- a/src/entity/jan_iwa/ArrowSign.c +++ b/src/entity/jan_iwa/ArrowSign.c @@ -39,7 +39,7 @@ void entity_ArrowSign_init(Entity* entity) { } s32 entity_ArrowSign_handle_collision(Entity* entity) { - if (!(gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT) && + if (!(gPlayerStatus.animFlags & PA_FLAGS_HOLDING_WATT) && (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_WALL)) { entity_start_script(entity); } diff --git a/src/entity/jan_iwa/Plants1.c b/src/entity/jan_iwa/Plants1.c index b034397f04..577c6f5a83 100644 --- a/src/entity/jan_iwa/Plants1.c +++ b/src/entity/jan_iwa/Plants1.c @@ -55,7 +55,7 @@ void func_802BB000_E2D930(Entity* entity) { if ((entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) && !is_picking_up_item()) { if (playerStatus->actionState == ACTION_STATE_RIDE) { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; + playerStatus->animFlags |= PA_FLAGS_4; } else if (playerStatus->actionState != ACTION_STATE_USE_SPINNING_FLOWER) { D_802BCE34 = data->unk_28; D_802BCE30 = data->unk_2A; @@ -98,7 +98,7 @@ void func_802BB0A0_E2D9D0(Entity* entity) { data->rotation.y = clamp_angle(data->rotation.y + data->spinSpeed); if (!(entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) && - (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_SPINNING) && + (playerStatus->animFlags & PA_FLAGS_SPINNING) && fabs(dist2D(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z)) < 60.0) { exec_entity_commandlist(entity); @@ -274,10 +274,10 @@ void entity_CymbalPlant_idle(Entity* entity) { case 0: if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) { if (partnerActionStatus->actingPartner != 0) { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; + playerStatus->animFlags |= PA_FLAGS_4; } func_800EF300(); - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_40000; + playerStatus->animFlags |= PA_FLAGS_40000; data->timer = 4; data->unk_01++; data->state++; @@ -291,14 +291,14 @@ void entity_CymbalPlant_idle(Entity* entity) { } break; case 1: - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_40000; + playerStatus->animFlags |= PA_FLAGS_40000; if (--data->timer == 0) { start_rumble(128, 10); data->timer = 30; data->state++; yaw = playerStatus->spriteFacingAngle; playerStatus->spriteFacingAngle = 80.0f; - playerStatus->flags |= PLAYER_STATUS_FLAGS_100000; + playerStatus->flags |= PS_FLAGS_100000; D_802BCE20 = yaw; } func_802BB98C_E2E2BC(entity); @@ -328,7 +328,7 @@ void entity_CymbalPlant_idle(Entity* entity) { data->state++; func_802DDEE4(0, -1, 0, 0, 0, 0, 0, 0); enable_player_input(); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100000; + playerStatus->flags &= ~PS_FLAGS_100000; } break; case 6: diff --git a/src/entity/jan_iwa/Plants2.c b/src/entity/jan_iwa/Plants2.c index aee98dde24..bde732bb87 100644 --- a/src/entity/jan_iwa/Plants2.c +++ b/src/entity/jan_iwa/Plants2.c @@ -38,7 +38,7 @@ extern AnimScript Entity_MunchlesiaReset1_Animation; extern StaticAnimatorNode* Entity_MunchlesiaReset1_Mesh[]; void entity_BellbellPlant_idle(Entity* entity) { - if ((gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE) && + if ((gPlayerStatus.animFlags & PA_FLAGS_INTERACT_PROMPT_AVAILABLE) && (entity->collisionFlags & (ENTITY_COLLISION_PLAYER_HAMMER | ENTITY_COLLISION_PLAYER_TOUCH_WALL))) { exec_entity_commandlist(entity); play_model_animation(entity->virtualModelIndex, Entity_BellbellPlant_AnimationUse); @@ -46,7 +46,7 @@ void entity_BellbellPlant_idle(Entity* entity) { } void entity_TrumpetPlant_idle(Entity* entity) { - if ((gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE) && + if ((gPlayerStatus.animFlags & PA_FLAGS_INTERACT_PROMPT_AVAILABLE) && (entity->collisionFlags & (ENTITY_COLLISION_PLAYER_HAMMER | ENTITY_COLLISION_PLAYER_TOUCH_WALL))) { exec_entity_commandlist(entity); play_model_animation(entity->virtualModelIndex, Entity_TrumpetPlant_AnimationUse); @@ -147,7 +147,7 @@ void func_802BC2B4_E2EBE4(Entity* entity) { entity_Munchlesia_create_child(entity, &Entity_MunchlesiaBeginChew); gPlayerStatus.prevActionState = 0; gPlayerStatus.actionState = 0; - gPlayerStatus.flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + gPlayerStatus.flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; suggest_player_anim_setUnkFlag(ANIM_Mario_8001F); } diff --git a/src/entity/sbk_omo/Tweester.c b/src/entity/sbk_omo/Tweester.c index b21c10aa5e..abd29faa77 100644 --- a/src/entity/sbk_omo/Tweester.c +++ b/src/entity/sbk_omo/Tweester.c @@ -209,7 +209,7 @@ void entity_Tweester_idle(Entity* entity) { if (get_time_freeze_mode() == TIME_FREEZE_NORMAL && !is_picking_up_item() && - !(playerStatus->flags & PLAYER_STATUS_FLAGS_20) && + !(playerStatus->flags & PS_FLAGS_20) && (playerData->currentPartner != PARTNER_GOOMBARIO || playerStatus->inputEnabledCounter == 0 || playerStatus->actionState == ACTION_STATE_USE_TWEESTER @@ -274,13 +274,13 @@ void entity_Tweester_idle(Entity* entity) { } if (!is_picking_up_item() && - !(playerStatus->flags & PLAYER_STATUS_FLAGS_20) && + !(playerStatus->flags & PS_FLAGS_20) && playerStatus->actionState != ACTION_STATE_USE_TWEESTER && playerStatus->blinkTimer == 0 && fabs(dist2D(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z)) <= 50.0 ) { TweesterTouchingPlayer = entity; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; + playerStatus->animFlags |= PA_FLAGS_4; set_action_state(ACTION_STATE_USE_TWEESTER); } } diff --git a/src/evt/player_api.c b/src/evt/player_api.c index c7eeb7d9b6..255afc1265 100644 --- a/src/evt/player_api.c +++ b/src/evt/player_api.c @@ -255,12 +255,12 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) { } playerNpc->jumpVelocity = (playerNpc->jumpScale * (playerNpc->duration - 1) / 2) + (yTemp / playerNpc->duration); - playerStatus->flags |= PLAYER_STATUS_FLAGS_FLYING; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_10000000; + playerStatus->flags |= PS_FLAGS_FLYING; + playerStatus->animFlags |= PA_FLAGS_10000000; if (mode == 0) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO)) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + if (!(playerStatus->animFlags & PA_FLAGS_8BIT_MARIO)) { + if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) { anim = ANIM_Mario_AnimMidairStill; } else { anim = ANIM_Mario_60009; @@ -280,8 +280,8 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) { playerNpc->jumpVelocity -= playerNpc->jumpScale; if (mode == 0 && jumpVelocity > 0.0f && playerNpc->jumpVelocity <= 0.0f) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO)) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + if (!(playerStatus->animFlags & PA_FLAGS_8BIT_MARIO)) { + if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) { anim = ANIM_Mario_AnimMidair; } else { anim = ANIM_Mario_6000A; @@ -302,12 +302,12 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) { playerNpc->duration--; if (playerNpc->duration == 0) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_FLYING; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_10000000; + playerStatus->flags &= ~PS_FLAGS_FLYING; + playerStatus->animFlags &= ~PA_FLAGS_10000000; if (mode == 0) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO)) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + if (!(playerStatus->animFlags & PA_FLAGS_8BIT_MARIO)) { + if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) { anim = ANIM_Mario_10009; } else { anim = ANIM_Mario_6000B; @@ -746,9 +746,9 @@ ApiStatus DisablePulseStone(Evt* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; if (evt_get_variable(script, *script->ptrReadPos)) { - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_USING_PULSE_STONE; + playerStatus->animFlags &= ~PA_FLAGS_USING_PULSE_STONE; } else { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_USING_PULSE_STONE; + playerStatus->animFlags |= PA_FLAGS_USING_PULSE_STONE; } return ApiStatus_DONE2; @@ -771,14 +771,14 @@ ApiStatus GetCurrentPartner(Evt* script, s32 isInitialCall) { ApiStatus func_802D2B50(void) { PlayerStatus* playerStatus = &gPlayerStatus; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_8; + playerStatus->animFlags |= PA_FLAGS_8; return ApiStatus_DONE2; } ApiStatus func_802D2B6C(Evt* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; + playerStatus->animFlags |= PA_FLAGS_4; return ApiStatus_DONE2; } @@ -789,13 +789,13 @@ ApiStatus Disable8bitMario(Evt* script, s32 isInitialCall) { if (evt_get_variable(script, *args)) { playerStatus->colliderHeight = 37; playerStatus->colliderDiameter = 26; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO; + playerStatus->animFlags &= ~PA_FLAGS_8BIT_MARIO; } else { playerStatus->colliderHeight = 19; playerStatus->colliderDiameter = 26; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO - | PLAYER_STATUS_ANIM_FLAGS_40000 - | PLAYER_STATUS_ANIM_FLAGS_4; + playerStatus->animFlags |= PA_FLAGS_8BIT_MARIO + | PA_FLAGS_40000 + | PA_FLAGS_4; } return ApiStatus_DONE2; diff --git a/src/npc.c b/src/npc.c index ea8ebe2dcf..7b455a3e7f 100644 --- a/src/npc.c +++ b/src/npc.c @@ -507,7 +507,7 @@ void update_npcs(void) { f32 x, y, z; f32 hitYaw, hitPitch, hitLength; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_8000; + playerStatus->animFlags &= ~PA_FLAGS_8000; if (!(gOverrideFlags & (GLOBAL_OVERRIDES_800 | GLOBAL_OVERRIDES_400))) { s32 i; diff --git a/src/state_battle.c b/src/state_battle.c index 56a9387e31..fd5d789afd 100644 --- a/src/state_battle.c +++ b/src/state_battle.c @@ -78,7 +78,7 @@ void state_step_battle(void) { btl_save_world_cameras(); load_battle_section(); D_800A0904 = gPlayerStatusPtr->animFlags; - gPlayerStatusPtr->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_40; + gPlayerStatusPtr->animFlags &= ~PA_FLAGS_40; D_800A0908 = get_time_freeze_mode(); set_time_freeze_mode(TIME_FREEZE_NORMAL); gOverrideFlags &= ~GLOBAL_OVERRIDES_8; diff --git a/src/trigger.c b/src/trigger.c index 7df85dceed..225e0ff23f 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -149,7 +149,7 @@ void update_triggers(void) { if (listTrigger->flags.flags & TRIGGER_FLOOR_PRESS_A) { if ((listTrigger->location.colliderID != collisionStatus->currentFloor) || - !(gGameStatusPtr->pressedButtons[0] & BUTTON_A) || (gPlayerStatus.flags & PLAYER_STATUS_FLAGS_INPUT_DISABLED)) { + !(gGameStatusPtr->pressedButtons[0] & BUTTON_A) || (gPlayerStatus.flags & PS_FLAGS_INPUT_DISABLED)) { continue; } } diff --git a/src/world/action/hammer.c b/src/world/action/hammer.c index eeb0b43425..d16d2df294 100644 --- a/src/world/action/hammer.c +++ b/src/world/action/hammer.c @@ -188,7 +188,7 @@ s32 func_802B62A4_E25174(void) { if (hammerLevel >= 0) { ret = -1; } else { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_SHIVERING; + playerStatus->animFlags |= PA_FLAGS_SHIVERING; } break; case ENTITY_TYPE_HAMMER2_BLOCK: @@ -196,7 +196,7 @@ s32 func_802B62A4_E25174(void) { if (hammerLevel >= 1) { ret = -1; } else { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_SHIVERING; + playerStatus->animFlags |= PA_FLAGS_SHIVERING; } break; case ENTITY_TYPE_HAMMER3_BLOCK: @@ -204,12 +204,12 @@ s32 func_802B62A4_E25174(void) { if (hammerLevel >= 2) { ret = -1; } else { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_SHIVERING; + playerStatus->animFlags |= PA_FLAGS_SHIVERING; } break; case ENTITY_TYPE_WOODEN_CRATE: case ENTITY_TYPE_BOMBABLE_ROCK: - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_SHIVERING; + playerStatus->animFlags |= PA_FLAGS_SHIVERING; break; case ENTITY_TYPE_BLUE_SWITCH: case ENTITY_TYPE_RED_SWITCH: @@ -227,12 +227,12 @@ void action_update_hammer(void) { HammerHit->unk_1C = 0; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { AnimID anim; s32 soundID; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; - playerStatus->flags |= PLAYER_STATUS_FLAGS_200000; + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; + playerStatus->flags |= PS_FLAGS_200000; HammerHit->timer = 0; playerStatus->actionSubstate = SUBSTATE_HAMMER_0; playerStatus->currentSpeed = 0.0f; @@ -268,9 +268,9 @@ void action_update_hammer(void) { HammerHit->unk_14 = 0; } - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_1000000; - if (HammerHit->timer < 3 && (playerStatus->flags & PLAYER_STATUS_FLAGS_40000)) { - playerStatus->flags |= PLAYER_STATUS_FLAGS_20000000; + playerStatus->flags &= ~PS_FLAGS_1000000; + if (HammerHit->timer < 3 && (playerStatus->flags & PS_FLAGS_40000)) { + playerStatus->flags |= PS_FLAGS_20000000; } else if (HammerHit->timer < 2) { HammerHit->timer++; } else { @@ -381,9 +381,9 @@ void func_802B6820_E256F0(void) { if (collisionStatus->lastWallHammered >= 0 && (collisionStatus->lastWallHammered & COLLISION_WITH_ENTITY_BIT)) { get_entity_by_index(collisionStatus->lastWallHammered)->collisionTimer = 0; - playerStatus->flags |= PLAYER_STATUS_FLAGS_1000000; + playerStatus->flags |= PS_FLAGS_1000000; } else if (HammerHit->hitID < 0) { - playerStatus->flags |= PLAYER_STATUS_FLAGS_1000000; + playerStatus->flags |= PS_FLAGS_1000000; } if (HammerHit->hitID < 0 && gPlayerData.hammerLevel >= 2) { @@ -403,7 +403,7 @@ void func_802B6820_E256F0(void) { HammerHit->unk_14 = 1; } if (HammerHit->timer == 6) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_200000; + playerStatus->flags &= ~PS_FLAGS_200000; } unk_BC = playerStatus->unk_BC; @@ -415,9 +415,9 @@ void func_802B6820_E256F0(void) { HammerHit->unk_14 = 0; ten = 10; // required to match if (HammerHit->unk_1C != 0 || HammerHit->timer > ten) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_1000000; + playerStatus->flags &= ~PS_FLAGS_1000000; set_action_state(ACTION_STATE_IDLE); } - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_200000; + playerStatus->flags &= ~PS_FLAGS_200000; } } diff --git a/src/world/action/hit_fire.c b/src/world/action/hit_fire.c index d29fe72a22..ca39f1a402 100644 --- a/src/world/action/hit_fire.c +++ b/src/world/action/hit_fire.c @@ -12,11 +12,11 @@ void action_update_hit_fire(void) { static f32 ReturnAngle; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; - playerStatus->flags |= (PLAYER_STATUS_FLAGS_800 | PLAYER_STATUS_FLAGS_FLYING); + playerStatus->animFlags |= PA_FLAGS_4; + playerStatus->flags |= (PS_FLAGS_800 | PS_FLAGS_FLYING); suggest_player_anim_setUnkFlag(ANIM_Mario_Scared); @@ -36,7 +36,7 @@ void action_update_hit_fire(void) { sin_cos_rad(ReturnAngle * TAU / 360.0f, &dx, &dy); speed = playerStatus->currentSpeed; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000) { + if (playerStatus->flags & PS_FLAGS_40000) { speed *= 0.5; } @@ -48,7 +48,7 @@ void action_update_hit_fire(void) { playerStatus->position.y += playerStatus->gravityIntegrator[0]; if (playerStatus->gravityIntegrator[0] < 0.0f) { playerStatus->actionSubstate = SUBSTATE_FALLING; - playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING; + playerStatus->flags |= PS_FLAGS_FALLING; } } else { s32 colliderID; @@ -59,7 +59,7 @@ void action_update_hit_fire(void) { set_action_state(ACTION_STATE_LAND); playerStatus->blinkTimer = 60; playerStatus->hazardType = HAZARD_TYPE_NONE; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_800; + playerStatus->flags &= ~PS_FLAGS_800; gOverrideFlags &= ~GLOBAL_OVERRIDES_40; } } diff --git a/src/world/action/hit_lava.c b/src/world/action/hit_lava.c index 87a2f3f22b..7284a11cc6 100644 --- a/src/world/action/hit_lava.c +++ b/src/world/action/hit_lava.c @@ -29,11 +29,11 @@ void action_update_hit_lava(void) { static f32 ReturnAngle; static f32 InitialPosY; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; - playerStatus->flags |= (PLAYER_STATUS_FLAGS_800000 | PLAYER_STATUS_FLAGS_FLYING); - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_4; - playerStatus->flags |= PLAYER_STATUS_FLAGS_800; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; + playerStatus->flags |= (PS_FLAGS_800000 | PS_FLAGS_FLYING); + playerStatus->animFlags |= PA_FLAGS_4; + playerStatus->flags |= PS_FLAGS_800; if (playerStatus->hazardType == HAZARD_TYPE_LAVA) { playerStatus->actionSubstate = SUBSTATE_DELAY_INIT_SINK; playerStatus->currentStateTime = 2; @@ -80,7 +80,7 @@ void action_update_hit_lava(void) { playerStatus->jumpFromPos.x = playerStatus->position.x; playerStatus->jumpFromPos.z = playerStatus->position.z; playerStatus->jumpFromHeight = playerStatus->position.y; - playerStatus->flags |= PLAYER_STATUS_FLAGS_JUMPING; + playerStatus->flags |= PS_FLAGS_JUMPING; break; case SUBSTATE_DELAY_LAUNCH: if (--playerStatus->currentStateTime <= 0) { @@ -176,8 +176,8 @@ void action_update_hit_lava(void) { gCameras[CAM_DEFAULT].moveFlags &= ~CAMERA_MOVE_FLAGS_2; sfx_play_sound_at_player(SOUND_3FB, 0); suggest_player_anim_setUnkFlag(ANIM_Mario_8001A); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_800; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_FLYING; + playerStatus->flags &= ~PS_FLAGS_800; + playerStatus->flags &= ~PS_FLAGS_FLYING; playerStatus->hazardType = HAZARD_TYPE_NONE; playerStatus->gravityIntegrator[0] = 6.0f; playerStatus->position.y += 6.0f; @@ -195,7 +195,7 @@ void action_update_hit_lava(void) { case SUBSTATE_DELAY_DONE: if (--playerStatus->currentStateTime <= 0) { set_action_state(ACTION_STATE_LAND); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_800000; + playerStatus->flags &= ~PS_FLAGS_800000; gOverrideFlags &= ~GLOBAL_OVERRIDES_40; } break; diff --git a/src/world/action/idle.c b/src/world/action/idle.c index bc19eddb75..b653f022e3 100644 --- a/src/world/action/idle.c +++ b/src/world/action/idle.c @@ -40,17 +40,17 @@ void action_update_idle(void) { f32 angle, magnitude; AnimID anim; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { action_update_idle_peach(); return; } playerStatus->currentStateTime++; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED - | PLAYER_STATUS_FLAGS_80000 | PLAYER_STATUS_FLAGS_AIRBORNE); + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED + | PS_FLAGS_80000 | PS_FLAGS_AIRBORNE); wasMoving = TRUE; playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT; playerStatus->currentStateTime = 0; @@ -59,9 +59,9 @@ void action_update_idle(void) { playerStatus->currentSpeed = 0.0f; playerStatus->pitch = 0.0f; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) { anim = ANIM_Mario_90002; - } else if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + } else if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) { anim = ANIM_Mario_10002; } else if (playerStatus->prevActionState == ACTION_STATE_IDLE) { anim = ANIM_Mario_60005; @@ -71,7 +71,7 @@ void action_update_idle(void) { suggest_player_anim_clearUnkFlag(anim); } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_RAISED_ARMS) { + if (playerStatus->animFlags & PA_FLAGS_RAISED_ARMS) { set_action_state(ACTION_STATE_RAISE_ARMS); } else { player_input_to_move_vector(&angle, &magnitude); @@ -89,7 +89,7 @@ void action_update_idle(void) { set_action_state(ACTION_STATE_WALK); if (magnitude != 0.0f) { playerStatus->targetYaw = angle; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_80000000; + playerStatus->animFlags &= ~PA_FLAGS_80000000; } } } @@ -101,16 +101,16 @@ void action_update_idle_peach(void) { PlayerData* playerData = &gPlayerData; f32 angle, magnitude; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT; playerStatus->currentStateTime = 0; playerStatus->timeInAir = 0; playerStatus->unk_C2 = 0; playerStatus->currentSpeed = 0.0f; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_AIRBORNE; + playerStatus->flags &= ~PS_FLAGS_AIRBORNE; - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + if (!(playerStatus->animFlags & PA_FLAGS_IN_DISGUISE)) { if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_HAS_INGREDIENT)) { suggest_player_anim_clearUnkFlag(IdlePeachAnims[gGameStatusPtr->peachCookingIngredient]); } else { @@ -121,10 +121,10 @@ void action_update_idle_peach(void) { } } - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + if (!(playerStatus->animFlags & PA_FLAGS_IN_DISGUISE)) { switch (playerStatus->actionSubstate) { case SUBSTATE_IDLE_DEFAULT: - if (!(playerStatus->flags & (PLAYER_STATUS_FLAGS_1000 | PLAYER_STATUS_FLAGS_INPUT_DISABLED)) + if (!(playerStatus->flags & (PS_FLAGS_1000 | PS_FLAGS_INPUT_DISABLED)) && (playerStatus->peachItemHeld == 0)) { if (playerStatus->currentStateTime > 1800) { // begin first yawm @@ -153,7 +153,7 @@ void action_update_idle_peach(void) { break; case SUBSTATE_IDLE_SLEEP: // peach is asleep - if (playerStatus->flags & (PLAYER_STATUS_FLAGS_1000 | PLAYER_STATUS_FLAGS_INPUT_DISABLED)) { + if (playerStatus->flags & (PS_FLAGS_1000 | PS_FLAGS_INPUT_DISABLED)) { suggest_player_anim_clearUnkFlag(ANIM_Peach_A0001); playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT; } else if (playerStatus->unk_BC != 0) { diff --git a/src/world/action/jump.c b/src/world/action/jump.c index ff8719aaa7..09fd6c2bd9 100644 --- a/src/world/action/jump.c +++ b/src/world/action/jump.c @@ -16,17 +16,17 @@ void initialize_jump(void) { playerStatus->actionSubstate = JUMP_SUBSTATE_0; playerStatus->timeInAir = 0; playerStatus->unk_C2 = 0; - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_FLYING); - playerStatus->flags |= PLAYER_STATUS_FLAGS_JUMPING; + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_FLYING); + playerStatus->flags |= PS_FLAGS_JUMPING; playerStatus->jumpFromPos.x = playerStatus->position.x; playerStatus->jumpFromPos.z = playerStatus->position.z; playerStatus->jumpFromHeight = playerStatus->position.y; phys_init_integrator_for_current_state(); - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) { anim = ANIM_Mario_90005; - } else if (!(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) { + } else if (!(playerStatus->animFlags & (PA_FLAGS_HOLDING_WATT | PA_FLAGS_2))) { anim = ANIM_Mario_AnimMidairStill; } else { anim = ANIM_Mario_60009; @@ -41,8 +41,8 @@ void action_update_jump(void) { PlayerStatus* playerStatus = &gPlayerStatus; AnimID anim; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; initialize_jump(); if (playerStatus->actionState == ACTION_STATE_LAUNCH) { @@ -52,7 +52,7 @@ void action_update_jump(void) { } if (playerStatus->actionState == ACTION_STATE_JUMP) { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) { sfx_play_sound_at_player(SOUND_JUMP_8BIT_MARIO, 0); } else { @@ -61,9 +61,9 @@ void action_update_jump(void) { } } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) { anim = ANIM_Mario_90005; - } else if (!(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) { + } else if (!(playerStatus->animFlags & (PA_FLAGS_HOLDING_WATT | PA_FLAGS_2))) { anim = ANIM_Mario_AnimMidairStill; } else { anim = ANIM_Mario_60009; @@ -78,13 +78,13 @@ void action_update_landing_on_switch(void) { CollisionStatus* collisionStatus = &gCollisionStatus; AnimID anim; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { Entity* entity = get_entity_by_index(collisionStatus->currentFloor); JumpedOnSwitchX = entity->position.x; JumpedOnSwitchZ = entity->position.z; initialize_jump(); - playerStatus->flags |= (PLAYER_STATUS_FLAGS_800000 | PLAYER_STATUS_FLAGS_80000); + playerStatus->flags |= (PS_FLAGS_800000 | PS_FLAGS_80000); disable_player_input(); } @@ -94,11 +94,11 @@ void action_update_landing_on_switch(void) { return; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING); - playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_JUMPING | PS_FLAGS_FLYING); + playerStatus->flags |= PS_FLAGS_FALLING; - if (!(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) { + if (!(playerStatus->animFlags & (PA_FLAGS_HOLDING_WATT | PA_FLAGS_2))) { anim = ANIM_Mario_AnimMidair; } else { anim = ANIM_Mario_6000A; @@ -114,20 +114,20 @@ void action_update_landing_on_switch(void) { void action_update_falling(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { action_update_peach_falling(); return; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { s32 anim; - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING); - playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING; + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_JUMPING | PS_FLAGS_FLYING); + playerStatus->flags |= PS_FLAGS_FALLING; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) { anim = ANIM_Mario_90005; - } else if (!(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) { + } else if (!(playerStatus->animFlags & (PA_FLAGS_HOLDING_WATT | PA_FLAGS_2))) { anim = ANIM_Mario_AnimMidair; } else { anim = ANIM_Mario_6000A; @@ -147,14 +147,14 @@ void action_update_step_down(void) { f32 hitDirX, hitDirZ; f32 height; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { action_update_peach_step_down(); return; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING); - playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_JUMPING | PS_FLAGS_FLYING); + playerStatus->flags |= PS_FLAGS_FALLING; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1; } @@ -169,7 +169,7 @@ void action_update_step_down(void) { surfaceType = get_collider_flags(colliderID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (!(surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA) && check_input_jump()) { set_action_state(ACTION_STATE_JUMP); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_AIRBORNE; + playerStatus->flags &= ~PS_FLAGS_AIRBORNE; action_update_jump(); } } @@ -178,12 +178,12 @@ void action_update_peach_falling(void) { PlayerStatus* playerStatus = &gPlayerStatus; AnimID anim; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING); - playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; + playerStatus->flags &= ~(PS_FLAGS_JUMPING | PS_FLAGS_FLYING); + playerStatus->flags |= PS_FLAGS_FALLING; - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) { + if (!(playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS)) { anim = ANIM_Mario_AnimMidair; } else { anim = ANIM_Peach_A0006; @@ -198,13 +198,13 @@ void action_update_peach_falling(void) { void action_update_peach_step_down(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING); - playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; + playerStatus->flags &= ~(PS_FLAGS_JUMPING | PS_FLAGS_FLYING); + playerStatus->flags |= PS_FLAGS_FALLING; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { suggest_player_anim_clearUnkFlag(ANIM_Peach_A0006); } } diff --git a/src/world/action/knockback.c b/src/world/action/knockback.c index 3cd1f1d15d..af3c6330ce 100644 --- a/src/world/action/knockback.c +++ b/src/world/action/knockback.c @@ -12,12 +12,12 @@ void action_update_knockback(void) { static f32 ReturnAngle; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; suggest_player_anim_setUnkFlag(ANIM_Mario_FallBack); - playerStatus->flags |= PLAYER_STATUS_FLAGS_FLYING; + playerStatus->flags |= PS_FLAGS_FLYING; playerStatus->actionSubstate = SUBSTATE_FLYING; playerStatus->gravityIntegrator[0] = 18.3473f; @@ -36,7 +36,7 @@ void action_update_knockback(void) { speed = playerStatus->currentSpeed; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_40000) { + if (playerStatus->flags & PS_FLAGS_40000) { speed *= 0.5f; } @@ -50,7 +50,7 @@ void action_update_knockback(void) { if (playerStatus->gravityIntegrator[0] < 0.0f) { playerStatus->actionSubstate = SUBSTATE_FALLING; - playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING; + playerStatus->flags |= PS_FLAGS_FALLING; } } else { s32 colliderID; diff --git a/src/world/action/land.c b/src/world/action/land.c index 80d479ed2e..572269b62b 100644 --- a/src/world/action/land.c +++ b/src/world/action/land.c @@ -17,17 +17,17 @@ void action_update_land(void) { s32 jumpInputCheck; AnimID anim; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { action_update_peach_land(); return; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { playerStatus->flags &= ~( - PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | - PLAYER_STATUS_FLAGS_800000 | - PLAYER_STATUS_FLAGS_80000 | - PLAYER_STATUS_FLAGS_AIRBORNE + PS_FLAGS_ACTION_STATE_CHANGED | + PS_FLAGS_800000 | + PS_FLAGS_80000 | + PS_FLAGS_AIRBORNE ); playerStatus->actionSubstate = SUBSTATE_INIT; playerStatus->timeInAir = 0; @@ -35,9 +35,9 @@ void action_update_land(void) { playerStatus->landPos.x = playerStatus->position.x; playerStatus->landPos.z = playerStatus->position.z; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) { anim = ANIM_Mario_90002; - } else if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + } else if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) { anim = ANIM_Mario_10009; } else { anim = ANIM_Mario_6000B; @@ -52,7 +52,7 @@ void action_update_land(void) { } collisionStatus->lastTouchedFloor = -1; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_40000; + playerStatus->animFlags &= ~PA_FLAGS_40000; camera->moveFlags &= ~CAMERA_MOVE_FLAGS_4; } playerStatus->actionSubstate++; // SUBSTATE_DONE @@ -79,17 +79,17 @@ void action_update_step_down_land(void) { f32 inputMoveMagnitude; f32 inputMoveAngle; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { action_update_peach_step_down_land(); return; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { playerStatus->flags &= ~( - PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | - PLAYER_STATUS_FLAGS_800000 | - PLAYER_STATUS_FLAGS_80000 | - PLAYER_STATUS_FLAGS_AIRBORNE + PS_FLAGS_ACTION_STATE_CHANGED | + PS_FLAGS_800000 | + PS_FLAGS_80000 | + PS_FLAGS_AIRBORNE ); playerStatus->actionSubstate = SUBSTATE_INIT; playerStatus->timeInAir = 0; @@ -123,12 +123,12 @@ void action_update_peach_land(void) { f32 inputMoveMagnitude; f32 inputMoveAngle; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->actionSubstate = SUBSTATE_INIT; playerStatus->timeInAir = 0; playerStatus->unk_C2 = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_AIRBORNE; + playerStatus->flags &= ~PS_FLAGS_AIRBORNE; playerStatus->landPos.x = playerStatus->position.x; playerStatus->landPos.z = playerStatus->position.z; @@ -167,12 +167,12 @@ void action_update_peach_step_down_land(void) { f32 inputMoveMagnitude; f32 inputMoveAngle; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->actionSubstate = SUBSTATE_INIT; playerStatus->timeInAir = 0; playerStatus->unk_C2 = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_AIRBORNE; + playerStatus->flags &= ~PS_FLAGS_AIRBORNE; playerStatus->landPos.x = playerStatus->position.x; playerStatus->landPos.z = playerStatus->position.z; diff --git a/src/world/action/misc.c b/src/world/action/misc.c index 649fbe176c..8ca4f79f58 100644 --- a/src/world/action/misc.c +++ b/src/world/action/misc.c @@ -7,9 +7,9 @@ s32 action_update_ride(void) { PlayerStatus* playerStatus = &gPlayerStatus; s32 oldFlags = playerStatus->flags; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { playerStatus->flags &= ~( - PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_80000 | PLAYER_STATUS_FLAGS_AIRBORNE + PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_80000 | PS_FLAGS_AIRBORNE ); playerStatus->actionSubstate = 0; playerStatus->currentStateTime = 0; @@ -19,7 +19,7 @@ s32 action_update_ride(void) { playerStatus->pitch = 0.0f; } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_400000) { + if (playerStatus->animFlags & PA_FLAGS_400000) { if (partnerActionStatus->actingPartner == PARTNER_LAKILESTER) { return func_802BD100_317020(oldFlags); } @@ -53,9 +53,9 @@ void action_update_state_23(void) { f32 zDelta; f32 playerOffsetTempVar; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED - | PLAYER_STATUS_FLAGS_80000 | PLAYER_STATUS_FLAGS_AIRBORNE); + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED + | PS_FLAGS_80000 | PS_FLAGS_AIRBORNE); playerStatus->actionSubstate = 0; playerStatus->currentStateTime = 0; playerStatus->timeInAir = 0; @@ -125,8 +125,8 @@ void action_update_state_23(void) { void action_update_launch(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_80000 | PLAYER_STATUS_FLAGS_AIRBORNE); + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_80000 | PS_FLAGS_AIRBORNE); playerStatus->actionSubstate = 0; playerStatus->currentStateTime = 0; playerStatus->timeInAir = 0; @@ -134,7 +134,7 @@ void action_update_launch(void) { playerStatus->currentSpeed = 0.0f; playerStatus->pitch = 0.0f; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { return; } playerStatus->currentStateTime = 5; @@ -149,8 +149,8 @@ void action_update_launch(void) { void action_update_first_strike(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_AIRBORNE); + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_AIRBORNE); playerStatus->actionSubstate = 0; playerStatus->timeInAir = 0; playerStatus->unk_C2 = 0; @@ -170,9 +170,9 @@ void action_update_first_strike(void) { void action_update_raise_arms(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; - playerStatus->flags |= PLAYER_STATUS_FLAGS_80000; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; + playerStatus->flags |= PS_FLAGS_80000; playerStatus->currentStateTime = 0; playerStatus->actionSubstate = 0; playerStatus->currentSpeed = 0.0f; @@ -180,20 +180,20 @@ void action_update_raise_arms(void) { suggest_player_anim_setUnkFlag(ANIM_Mario_GotItem); } - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_RAISED_ARMS)) { + if (!(playerStatus->animFlags & PA_FLAGS_RAISED_ARMS)) { set_action_state(ACTION_STATE_IDLE); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_80000; + playerStatus->flags &= ~PS_FLAGS_80000; } } void action_update_pushing_block(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { f32 angle; f32 magnitude; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->currentSpeed = 0.0f; playerStatus->unk_60 = 0; playerStatus->currentStateTime = 5; @@ -208,7 +208,7 @@ void action_update_pushing_block(void) { check_input_jump(); - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_800000) { + if (playerStatus->animFlags & PA_FLAGS_800000) { if (playerStatus->currentStateTime != 0) { playerStatus->currentStateTime--; if (playerStatus->currentStateTime == 0) { @@ -221,15 +221,15 @@ void action_update_pushing_block(void) { void action_update_talk(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->currentSpeed = 0.0f; playerStatus->unk_60 = 0; - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) { + if (!(playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS)) { suggest_player_anim_setUnkFlag(ANIM_Mario_80007); } else if (playerStatus->peachItemHeld == 0) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + if (!(playerStatus->animFlags & PA_FLAGS_IN_DISGUISE)) { suggest_player_anim_setUnkFlag(ANIM_Peach_C0000); } else { peach_set_disguise_anim(BasicPeachDisguiseAnims[playerStatus->peachDisguise].talk); @@ -238,11 +238,11 @@ void action_update_talk(void) { playerStatus->currentStateTime = 30; } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { if (playerStatus->currentStateTime != 0) { playerStatus->currentStateTime--; } else if (playerStatus->peachItemHeld == 0) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + if (!(playerStatus->animFlags & PA_FLAGS_IN_DISGUISE)) { suggest_player_anim_setUnkFlag(ANIM_Peach_A0001); } else { peach_set_disguise_anim(BasicPeachDisguiseAnims[playerStatus->peachDisguise].idle); diff --git a/src/world/action/slide.c b/src/world/action/slide.c index f959c1ce71..d75086c8ae 100644 --- a/src/world/action/slide.c +++ b/src/world/action/slide.c @@ -44,8 +44,8 @@ void action_update_sliding(void) { f32 hitRx, hitRy, hitDirX, hitDirZ; s32 hitID; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->actionSubstate = SUBSTATE_SLIDING; playerStatus->currentSpeed = 0.0f; playerStatus->animFlags |= 4; diff --git a/src/world/action/sneaky_parasol.c b/src/world/action/sneaky_parasol.c index 933ae541f0..d0fe2b8a5e 100644 --- a/src/world/action/sneaky_parasol.c +++ b/src/world/action/sneaky_parasol.c @@ -63,8 +63,8 @@ void action_update_parasol(void) { f32 phi_f20; f32 phi_f22; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; mem_clear(&D_802B6E80, sizeof(D_802B6E80)); disable_player_static_collisions(); tempUnk_1C = ¶solStruct->unk_1C; @@ -78,7 +78,7 @@ void action_update_parasol(void) { phi_f4 = 2; } *tempUnk_1C = phi_f4; - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + if (!(playerStatus->animFlags & PA_FLAGS_IN_DISGUISE)) { playerStatus->currentStateTime = 20; playerStatus->actionSubstate = 0; parasolStruct->unk_08 = 0xF; diff --git a/src/world/action/spin.c b/src/world/action/spin.c index d8f653463c..e5c35b68dd 100644 --- a/src/world/action/spin.c +++ b/src/world/action/spin.c @@ -34,11 +34,11 @@ void action_update_spin(void) { s32 firstCall = FALSE; // initialization - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_80000); - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_40000; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_SPINNING; - playerStatus->flags |= PLAYER_STATUS_FLAGS_20000; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_80000); + playerStatus->animFlags &= ~PA_FLAGS_40000; + playerStatus->animFlags |= PA_FLAGS_SPINNING; + playerStatus->flags |= PS_FLAGS_20000; playerStatus->currentStateTime = 0; playerStatus->actionSubstate = SUBSTATE_SPIN_0; playerSpinState->stopSoundTimer = 0; @@ -142,8 +142,8 @@ void action_update_spin(void) { // check for spin cancel if (!firstCall && (check_input_hammer() || check_input_jump())) { - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_SPINNING; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_20000; + playerStatus->animFlags &= ~PA_FLAGS_SPINNING; + playerStatus->flags &= ~PS_FLAGS_20000; sfx_stop_sound(playerSpinState->spinSoundID); player_input_to_move_vector(&angle, &magnitude); playerStatus->targetYaw = angle; @@ -172,8 +172,8 @@ void action_update_spin(void) { if ((playerStatus->currentStateTime) == 0) { playerSpinState->stopSoundTimer = 4; set_action_state(ACTION_STATE_IDLE); - playerStatus->flags &= ~PLAYER_STATUS_ANIM_FLAGS_20000; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_SPINNING; + playerStatus->flags &= ~PA_FLAGS_20000; + playerStatus->animFlags &= ~PA_FLAGS_SPINNING; sfx_stop_sound(playerSpinState->spinSoundID); } playerStatus->currentSpeed = 0.0f; @@ -181,7 +181,7 @@ void action_update_spin(void) { } if (playerStatus->actionSubstate == SUBSTATE_SPIN_0) { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_40000) { + if (playerStatus->animFlags & PA_FLAGS_40000) { playerStatus->actionSubstate = SUBSTATE_SPIN_1; } else if (gCollisionStatus.pushingAgainstWall >= 0) { playerSpinState->hitWallTime++; @@ -255,21 +255,21 @@ void action_update_spin(void) { if (playerSpinState->hasBufferedSpin) { playerStatus->currentStateTime = 2; playerStatus->actionSubstate = SUBSTATE_SPIN_2; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_20000; + playerStatus->flags &= ~PS_FLAGS_20000; suggest_player_anim_clearUnkFlag(ANIM_Mario_10002); } else if (angle < playerStatus->spriteFacingAngle) { if (playerStatus->spriteFacingAngle >= 180.0f && angle < 180.0f) { playerStatus->spriteFacingAngle = 180.0f; playerStatus->currentStateTime = 2; playerStatus->actionSubstate = SUBSTATE_SPIN_2; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_20000; + playerStatus->flags &= ~PS_FLAGS_20000; suggest_player_anim_clearUnkFlag(ANIM_Mario_10002); } } else if (playerStatus->spriteFacingAngle <= 0.0f && angle < 90.0f) { playerStatus->spriteFacingAngle = 0.0f; playerStatus->currentStateTime = 2; playerStatus->actionSubstate = SUBSTATE_SPIN_2; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_20000; + playerStatus->flags &= ~PS_FLAGS_20000; suggest_player_anim_clearUnkFlag(ANIM_Mario_10002); } playerStatus->spriteFacingAngle = clamp_angle(playerStatus->spriteFacingAngle); diff --git a/src/world/action/spin_jump.c b/src/world/action/spin_jump.c index 8c63f109c0..12cb3323c6 100644 --- a/src/world/action/spin_jump.c +++ b/src/world/action/spin_jump.c @@ -27,9 +27,9 @@ void action_update_spin_jump(void) { static f32 RotationRate; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FALLING); - playerStatus->flags |= (PLAYER_STATUS_FLAGS_JUMPING | PLAYER_STATUS_FLAGS_FLYING); + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_JUMPING | PS_FLAGS_FALLING); + playerStatus->flags |= (PS_FLAGS_JUMPING | PS_FLAGS_FLYING); playerStatus->actionSubstate = SUBSTATE_SPIN; playerStatus->currentSpeed = 0.0f; @@ -37,7 +37,7 @@ void action_update_spin_jump(void) { playerStatus->gravityIntegrator[0] = 5.2f; suggest_player_anim_clearUnkFlag(ANIM_Mario_1000A); disable_player_input(); - playerStatus->flags |= PLAYER_STATUS_FLAGS_200; + playerStatus->flags |= PS_FLAGS_200; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1; sfx_play_sound_at_player(SOUND_SPIN_JUMP, 0); } @@ -109,19 +109,19 @@ void action_update_spin_jump(void) { entityType == ENTITY_TYPE_RED_SWITCH || entityType == ENTITY_TYPE_BLUE_SWITCH)) { get_entity_by_index(collisionStatus->currentFloor)->collisionFlags |= ENTITY_COLLISION_PLAYER_TOUCH_FLOOR; playerStatus->actionSubstate = SUBSTATE_HIT_SWITCH; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_FLYING; + playerStatus->flags &= ~PS_FLAGS_FLYING; break; } else { surfaceType = get_collider_flags(belowColliderID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (surfaceType == SURFACE_TYPE_LAVA) { playerStatus->hazardType = HAZARD_TYPE_LAVA; set_action_state(ACTION_STATE_HIT_LAVA); - playerStatus->flags |= PLAYER_STATUS_FLAGS_800; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_FLYING; + playerStatus->flags |= PS_FLAGS_800; + playerStatus->flags &= ~PS_FLAGS_FLYING; return; } else if (surfaceType == SURFACE_TYPE_SPIKES) { set_action_state(ACTION_STATE_HIT_LAVA); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_FLYING; + playerStatus->flags &= ~PS_FLAGS_FLYING; return; } else { playerStatus->gravityIntegrator[1] = -3.4744f; @@ -140,7 +140,7 @@ void action_update_spin_jump(void) { panels = &gCurrentHiddenPanels; panels->tryFlipTrigger = TRUE; panels->flipTriggerPosY = playerStatus->position.y; - playerStatus->flags |= PLAYER_STATUS_FLAGS_400; + playerStatus->flags |= PS_FLAGS_400; } } } @@ -186,7 +186,7 @@ void action_update_spin_jump(void) { if (landed) { set_action_state(ACTION_STATE_LAND); - playerStatus->flags &= ~PLAYER_STATUS_ANIM_FLAGS_8; + playerStatus->flags &= ~PA_FLAGS_8; } if (playerStatus->gravityIntegrator[0] < 0.0f) { belowColliderID = get_collider_below_spin_jump(); diff --git a/src/world/action/step_up.c b/src/world/action/step_up.c index c6bbda3840..c5a84ea8e6 100644 --- a/src/world/action/step_up.c +++ b/src/world/action/step_up.c @@ -31,11 +31,11 @@ void action_update_step_up(void) { s32 colliderID; AnimID anim; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; phys_adjust_cam_on_landing(); - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + if (!(playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS)) { + if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) { anim = ANIM_Mario_Walking; } else { anim = ANIM_Mario_60000; @@ -75,7 +75,7 @@ void action_update_step_up(void) { } void func_802B6198_E24768(void) { - if (!(gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + if (!(gPlayerStatus.animFlags & PA_FLAGS_IN_DISGUISE)) { if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_HAS_INGREDIENT)) { suggest_player_anim_clearUnkFlag((StepUpPeachAnims)[gGameStatusPtr->peachCookingIngredient]); } else { @@ -89,8 +89,8 @@ void func_802B6198_E24768(void) { void action_update_step_up_peach(void) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; suggest_player_anim_clearUnkFlag(ANIM_Peach_A0005); playerStatus->currentStateTime = 8; } @@ -101,7 +101,7 @@ void action_update_step_up_peach(void) { try_player_footstep_sounds(1); } } else { - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_4000)) { + if (!(playerStatus->flags & PS_FLAGS_4000)) { set_action_state(ACTION_STATE_IDLE); } else if (playerStatus->currentSpeed >= playerStatus->runSpeed) { set_action_state(ACTION_STATE_RUN); diff --git a/src/world/action/tornado_jump.c b/src/world/action/tornado_jump.c index 0ee63a355d..e67f40fc81 100644 --- a/src/world/action/tornado_jump.c +++ b/src/world/action/tornado_jump.c @@ -28,9 +28,9 @@ void action_update_tornado_jump(void) { s32 colliderBelow; u32 entityType; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; - playerStatus->flags |= (PLAYER_STATUS_FLAGS_20000 | PLAYER_STATUS_FLAGS_FLYING | PLAYER_STATUS_FLAGS_JUMPING); + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; + playerStatus->flags |= (PS_FLAGS_20000 | PS_FLAGS_FLYING | PS_FLAGS_JUMPING); phys_clear_spin_history(); playerStatus->actionSubstate = SUBSTATE_ASCEND; playerStatus->currentSpeed = 0.0f; @@ -40,7 +40,7 @@ void action_update_tornado_jump(void) { playerStatus->gravityIntegrator[3] = -0.75f; suggest_player_anim_setUnkFlag(ANIM_Mario_80000); disable_player_input(); - playerStatus->flags |= PLAYER_STATUS_FLAGS_200; + playerStatus->flags |= PS_FLAGS_200; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1; cameraRelativeYaw = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].currentYaw); if (cameraRelativeYaw <= 180.0f) { @@ -89,12 +89,12 @@ void action_update_tornado_jump(void) { if (fallVelocity <= 0.0f) { record_jump_apex(); playerStatus->currentStateTime = 3; - playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING; + playerStatus->flags |= PS_FLAGS_FALLING; playerStatus->actionSubstate++; sfx_play_sound_at_player(SOUND_TORNADO_JUMP, 0); } if (colliderBelow >= 0) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_20000 | PLAYER_STATUS_FLAGS_FLYING); + playerStatus->flags &= ~(PS_FLAGS_20000 | PS_FLAGS_FLYING); set_action_state(ACTION_STATE_LAND); } break; @@ -116,11 +116,11 @@ void action_update_tornado_jump(void) { if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) { entityType = get_entity_type(collisionStatus->currentFloor); if (entityType == ENTITY_TYPE_SIMPLE_SPRING || entityType == ENTITY_TYPE_SCRIPT_SPRING) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_20000 | PLAYER_STATUS_FLAGS_FLYING); + playerStatus->flags &= ~(PS_FLAGS_20000 | PS_FLAGS_FLYING); set_action_state(ACTION_STATE_LAND); return; } else if (entityType == ENTITY_TYPE_BLUE_SWITCH || entityType == ENTITY_TYPE_RED_SWITCH) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_20000 | PLAYER_STATUS_FLAGS_FLYING); + playerStatus->flags &= ~(PS_FLAGS_20000 | PS_FLAGS_FLYING); phys_player_land(); exec_ShakeCam1(0, 0, 4); sfx_play_sound_at_player(SOUND_14A, 0); @@ -128,7 +128,7 @@ void action_update_tornado_jump(void) { gCurrentHiddenPanels.tryFlipTrigger = TRUE; gCurrentHiddenPanels.flipTriggerPosY = playerStatus->position.y; - playerStatus->flags |= PLAYER_STATUS_FLAGS_400; + playerStatus->flags |= PS_FLAGS_400; return; } } @@ -136,13 +136,13 @@ void action_update_tornado_jump(void) { surfaceType = get_collider_flags(colliderBelow) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (surfaceType == SURFACE_TYPE_LAVA) { playerStatus->hazardType = HAZARD_TYPE_LAVA; - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_20000 | PLAYER_STATUS_FLAGS_FLYING); + playerStatus->flags &= ~(PS_FLAGS_20000 | PS_FLAGS_FLYING); set_action_state(ACTION_STATE_HIT_LAVA); - playerStatus->flags |= PLAYER_STATUS_FLAGS_800; + playerStatus->flags |= PS_FLAGS_800; return; } else if (surfaceType == SURFACE_TYPE_SPIKES) { set_action_state(ACTION_STATE_HIT_LAVA); - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_20000 | PLAYER_STATUS_FLAGS_FLYING); + playerStatus->flags &= ~(PS_FLAGS_20000 | PS_FLAGS_FLYING); return; } playerStatus->currentStateTime = 8; @@ -155,13 +155,13 @@ void action_update_tornado_jump(void) { gCurrentHiddenPanels.tryFlipTrigger = TRUE; gCurrentHiddenPanels.flipTriggerPosY = playerStatus->position.y; - playerStatus->flags |= PLAYER_STATUS_FLAGS_400; + playerStatus->flags |= PS_FLAGS_400; } break; case SUBSTATE_IMPACT: if (--playerStatus->currentStateTime == 0) { playerStatus->actionSubstate++; - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_20000 | PLAYER_STATUS_FLAGS_FLYING); + playerStatus->flags &= ~(PS_FLAGS_20000 | PS_FLAGS_FLYING); set_action_state(ACTION_STATE_LAND); } break; diff --git a/src/world/action/use_munchlesia.c b/src/world/action/use_munchlesia.c index d6927dc56a..a5265b7ab6 100644 --- a/src/world/action/use_munchlesia.c +++ b/src/world/action/use_munchlesia.c @@ -19,8 +19,8 @@ void action_update_use_munchlesia(void) { s32 colliderID; f32 hitPosY; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->actionSubstate = SUBSTATE_INIT; gOverrideFlags |= GLOBAL_OVERRIDES_40; disable_player_static_collisions(); diff --git a/src/world/action/use_spinning_flower.c b/src/world/action/use_spinning_flower.c index a45905c57d..01902cbb9a 100644 --- a/src/world/action/use_spinning_flower.c +++ b/src/world/action/use_spinning_flower.c @@ -48,8 +48,8 @@ void action_update_use_spinning_flower(void) { f32 distToCenter; s8 switchCondition; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; gOverrideFlags |= GLOBAL_OVERRIDES_40; func_800EF300(); playerStatus->actionSubstate = SUBSTATE_ATTRACT; @@ -60,7 +60,7 @@ void action_update_use_spinning_flower(void) { D_802B6EDC = 3.0f; disable_player_static_collisions(); disable_player_input(); - playerStatus->flags |= PLAYER_STATUS_FLAGS_100000; + playerStatus->flags |= PS_FLAGS_100000; entityID = gCollisionStatus.currentFloor; TempPointer = &SpinningFlower_EntityIndex; @@ -73,7 +73,7 @@ void action_update_use_spinning_flower(void) { } else { SpinningFlower_EntityIndex = -1; } - if (!(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) { + if (!(playerStatus->animFlags & (PA_FLAGS_HOLDING_WATT | PA_FLAGS_2))) { suggest_player_anim_clearUnkFlag(ANIM_Mario_1002B); } } @@ -126,10 +126,10 @@ void action_update_use_spinning_flower(void) { D_802B6EF4 = playerStatus->position.y; playerStatus->actionSubstate++; D_802B6EF0 = 1.6f; - playerStatus->flags |= PLAYER_STATUS_FLAGS_800000; + playerStatus->flags |= PS_FLAGS_800000; } if (gGameStatusPtr->pressedButtons[0] & BUTTON_Z && - !(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) { + !(playerStatus->animFlags & (PA_FLAGS_HOLDING_WATT | PA_FLAGS_2))) { suggest_player_anim_setUnkFlag(ANIM_Mario_AnimMidairStill); playerStatus->actionSubstate = SUBSTATE_SPIN_UP; playerStatus->currentStateTime = 30; @@ -142,7 +142,7 @@ void action_update_use_spinning_flower(void) { gOverrideFlags |= GLOBAL_OVERRIDES_40; if (--D_802B6EE4 < 0.0f) { D_802B6EE4 = 0.0f; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100000; + playerStatus->flags &= ~PS_FLAGS_100000; } playerStatus->spriteFacingAngle = clamp_angle(playerStatus->spriteFacingAngle + D_802B6EE4); sin_cos_rad((SpinningFlower_AngleToCenter - 60.0f) * TAU / 360.0f, &dx, &dz); @@ -158,7 +158,7 @@ void action_update_use_spinning_flower(void) { gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; if (entityID >= 0) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100000; + playerStatus->flags &= ~PS_FLAGS_100000; enable_player_input(); enable_player_static_collisions(); set_action_state(ACTION_STATE_LAND); diff --git a/src/world/action/use_tweester.c b/src/world/action/use_tweester.c index 2d2abd0ee8..8bfdf90bf6 100644 --- a/src/world/action/use_tweester.c +++ b/src/world/action/use_tweester.c @@ -15,11 +15,11 @@ void action_update_use_tweester(void) { Entity* entity; entity = TweesterTouchingPlayer; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; disable_player_static_collisions(); disable_player_input(); - playerStatus->flags |= (PLAYER_STATUS_FLAGS_100000 | PLAYER_STATUS_FLAGS_FLYING); + playerStatus->flags |= (PS_FLAGS_100000 | PS_FLAGS_FLYING); suggest_player_anim_clearUnkFlag(ANIM_Mario_8001F); playerStatus->actionSubstate = SUBSTATE_LAUNCH; mem_clear(PlayerTweesterPhysics, sizeof(*PlayerTweesterPhysics)); @@ -69,7 +69,7 @@ void action_update_use_tweester(void) { playerStatus->blinkTimer = 50; enable_player_static_collisions(); enable_player_input(); - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_100000 | PLAYER_STATUS_FLAGS_FLYING); + playerStatus->flags &= ~(PS_FLAGS_100000 | PS_FLAGS_FLYING); set_action_state(ACTION_STATE_IDLE); break; } diff --git a/src/world/action/walk.c b/src/world/action/walk.c index 6e5f2cdbf2..91b8c3078c 100644 --- a/src/world/action/walk.c +++ b/src/world/action/walk.c @@ -36,25 +36,25 @@ void action_update_walk(void) { s32 stickAxisY; AnimID anim; s32 changedAnim = FALSE; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { action_update_walk_peach(); return; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { playerStatus->flags &= ~( - PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_800000 | PLAYER_STATUS_FLAGS_80000); + PS_FLAGS_ACTION_STATE_CHANGED | PS_FLAGS_800000 | PS_FLAGS_80000); playerStatus->unk_60 = 0; changedAnim = TRUE; - if (!(playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO)) { + if (!(playerStatus->flags & PA_FLAGS_8BIT_MARIO)) { playerStatus->currentSpeed = playerStatus->walkSpeed; } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) { anim = ANIM_Mario_90003; } - else if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + else if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) { anim = ANIM_Mario_Walking; } else { @@ -63,7 +63,7 @@ void action_update_walk(void) { suggest_player_anim_clearUnkFlag(anim); } - if (playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->flags & PA_FLAGS_8BIT_MARIO) { playerStatus->targetYaw = playerStatus->heading; try_player_footstep_sounds(8); return; @@ -81,17 +81,17 @@ void action_update_walk(void) { } if (fabsf(PrevPlayerCamRelativeYaw - moveVectorAngle) <= 90.0f && abs(moveVectorMagnitude - D_800F7B44) < 20) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_80000000)) { + if (!(playerStatus->animFlags & PA_FLAGS_80000000)) { if (moveVectorMagnitude >= 20.0f) { playerStatus->targetYaw = moveVectorAngle; } } - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_80000000; + playerStatus->animFlags &= ~PA_FLAGS_80000000; } else { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_80000000) { + if (playerStatus->animFlags & PA_FLAGS_80000000) { playerStatus->targetYaw = moveVectorAngle; } else { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_80000000; + playerStatus->animFlags |= PA_FLAGS_80000000; } } @@ -121,25 +121,25 @@ void action_update_run(void) { s32 phi_s3; phi_s3 = 0; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { + if (playerStatus->animFlags & PA_FLAGS_USING_PEACH_PHYSICS) { action_update_run_peach(); return; } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | - PLAYER_STATUS_FLAGS_800000 | PLAYER_STATUS_FLAGS_80000); + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~(PS_FLAGS_ACTION_STATE_CHANGED | + PS_FLAGS_800000 | PS_FLAGS_80000); D_8010C980 = 0; playerStatus->unk_60 = 0; phi_s3 = 1; - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_4000)) { + if (!(playerStatus->flags & PS_FLAGS_4000)) { playerStatus->currentSpeed = playerStatus->runSpeed; } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { + if (playerStatus->animFlags & PA_FLAGS_8BIT_MARIO) { anim = ANIM_Mario_90003; } else { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + if (!(playerStatus->animFlags & PA_FLAGS_HOLDING_WATT)) { anim = ANIM_Mario_Running; } else { anim = ANIM_Mario_60002; @@ -148,7 +148,7 @@ void action_update_run(void) { suggest_player_anim_clearUnkFlag(anim); } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_4000) { + if (playerStatus->flags & PS_FLAGS_4000) { playerStatus->targetYaw = playerStatus->heading; try_player_footstep_sounds(4); return; @@ -157,7 +157,7 @@ void action_update_run(void) { D_8010C980++; runSpeedModifier = 1.0f; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_SPINNING) { + if (playerStatus->animFlags & PA_FLAGS_SPINNING) { runSpeedModifier = 1.5f; } @@ -178,15 +178,15 @@ void action_update_run(void) { } if (fabsf(PrevPlayerCamRelativeYaw - moveX) <= 90.0f) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_80000000)) { + if (!(playerStatus->animFlags & PA_FLAGS_80000000)) { playerStatus->targetYaw = moveX; } - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_80000000; + playerStatus->animFlags &= ~PA_FLAGS_80000000; } else { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_80000000) { + if (playerStatus->animFlags & PA_FLAGS_80000000) { playerStatus->targetYaw = moveX; } else { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_80000000; + playerStatus->animFlags |= PA_FLAGS_80000000; } } @@ -205,7 +205,7 @@ void action_update_run(void) { } void func_802B6550_E23C30(void) { - if (!(gPlayerStatus.animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + if (!(gPlayerStatus.animFlags & PA_FLAGS_IN_DISGUISE)) { if (!(gGameStatusPtr->peachFlags & 0x10)) { suggest_player_anim_clearUnkFlag(WalkPeachAnims[gGameStatusPtr->peachCookingIngredient]); return; @@ -221,16 +221,16 @@ static void action_update_walk_peach(void) { f32 magnitude; f32 angle; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->unk_60 = 0; - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_4000)) { + if (!(playerStatus->flags & PS_FLAGS_4000)) { playerStatus->currentSpeed = playerStatus->walkSpeed; } func_802B6550_E23C30(); } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_4000) { + if (playerStatus->flags & PS_FLAGS_4000) { playerStatus->targetYaw = playerStatus->heading; try_player_footstep_sounds(8); return; @@ -258,14 +258,14 @@ static void action_update_run_peach(void) { f32 moveX; f32 moveY; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; + if (playerStatus->flags & PS_FLAGS_ACTION_STATE_CHANGED) { + playerStatus->flags &= ~PS_FLAGS_ACTION_STATE_CHANGED; playerStatus->unk_60 = 0; - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_4000)) { + if (!(playerStatus->flags & PS_FLAGS_4000)) { playerStatus->currentSpeed = playerStatus->runSpeed; } - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) { + if (!(playerStatus->animFlags & PA_FLAGS_IN_DISGUISE)) { gameStatus = gGameStatusPtr; if (!(gameStatus->peachFlags & PEACH_STATUS_FLAG_HAS_INGREDIENT)) { if (!gameStatus->peachCookingIngredient) { @@ -281,7 +281,7 @@ static void action_update_run_peach(void) { } } - if (playerStatus->flags & PLAYER_STATUS_FLAGS_4000) { + if (playerStatus->flags & PS_FLAGS_4000) { playerStatus->targetYaw = playerStatus->heading; try_player_footstep_sounds(4); return; diff --git a/src/world/area_iwa/iwa_00/90CEF0.c b/src/world/area_iwa/iwa_00/90CEF0.c index 24c3e6b989..2c0b80203e 100644 --- a/src/world/area_iwa/iwa_00/90CEF0.c +++ b/src/world/area_iwa/iwa_00/90CEF0.c @@ -2,6 +2,6 @@ ApiStatus func_802402B0_90CEF0(Evt* script, s32 isInitialCall) { gPlayerStatus.slideParams = script->varTablePtr[0]; - gPlayerStatus.flags |= PLAYER_STATUS_FLAGS_10; + gPlayerStatus.flags |= PS_FLAGS_10; return ApiStatus_DONE2; } diff --git a/src/world/area_iwa/iwa_01/912960.c b/src/world/area_iwa/iwa_01/912960.c index 63e5aecdd2..13a02866e0 100644 --- a/src/world/area_iwa/iwa_01/912960.c +++ b/src/world/area_iwa/iwa_01/912960.c @@ -2,6 +2,6 @@ ApiStatus func_802432B0_912960(Evt* script, s32 isInitialCall) { gPlayerStatus.slideParams = script->varTablePtr[0]; - gPlayerStatus.flags |= PLAYER_STATUS_ANIM_FLAGS_INTERACT_PROMPT_AVAILABLE; + gPlayerStatus.flags |= PA_FLAGS_INTERACT_PROMPT_AVAILABLE; return ApiStatus_DONE2; } diff --git a/src/world/area_iwa/iwa_03/918EF0.c b/src/world/area_iwa/iwa_03/918EF0.c index 1403a13aab..74865c4968 100644 --- a/src/world/area_iwa/iwa_03/918EF0.c +++ b/src/world/area_iwa/iwa_03/918EF0.c @@ -4,6 +4,6 @@ ApiStatus func_80241320_919ED0(Evt* script, s32 isInitialCall) { gPlayerStatus.slideParams = script->varTablePtr[0]; - gPlayerStatus.flags |= PLAYER_STATUS_FLAGS_10; + gPlayerStatus.flags |= PS_FLAGS_10; return ApiStatus_DONE2; } diff --git a/src/world/area_kkj/kkj_00/ABB290.c b/src/world/area_kkj/kkj_00/ABB290.c index bcfaf84e4b..a91e408c1a 100644 --- a/src/world/area_kkj/kkj_00/ABB290.c +++ b/src/world/area_kkj/kkj_00/ABB290.c @@ -24,6 +24,6 @@ ApiStatus func_80240040_ABB2D0(Evt* script, s32 isInitialCall) { status->slideParams = &D_8024162C_ABC8BC; } - status->flags |= PLAYER_STATUS_FLAGS_10; + status->flags |= PS_FLAGS_10; return ApiStatus_DONE2; } diff --git a/src/world/common/UnkFunc11.inc.c b/src/world/common/UnkFunc11.inc.c index d4b1a29e52..e8c4fa0ee8 100644 --- a/src/world/common/UnkFunc11.inc.c +++ b/src/world/common/UnkFunc11.inc.c @@ -18,7 +18,7 @@ ApiStatus N(UnkFunc11)(Evt* script, s32 isInitialCall) { } else if ((playerStatus->actionState != ACTION_STATE_PUSHING_BLOCK) && (playerStatus->actionState != ACTION_STATE_WALK) && (playerStatus->actionState != ACTION_STATE_RUN)) { script->varTable[0] = 0; - } else if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT) { + } else if (playerStatus->animFlags & PA_FLAGS_HOLDING_WATT) { script->varTable[0] = 0; } else { script->varTable[0] = 1; diff --git a/src/world/common/atomic/Pipe.inc.c b/src/world/common/atomic/Pipe.inc.c index 8f91ef4818..b4ac2ed385 100644 --- a/src/world/common/atomic/Pipe.inc.c +++ b/src/world/common/atomic/Pipe.inc.c @@ -2,7 +2,7 @@ #include "npc.h" ApiStatus N(Pipe_SetAnimFlag)(Evt* script, s32 isInitialCall) { - gPlayerStatusPtr->animFlags |= PLAYER_STATUS_ANIM_FLAGS_100000; + gPlayerStatusPtr->animFlags |= PA_FLAGS_100000; return ApiStatus_DONE2; } diff --git a/src/world/common/atomic/PipeData.inc.c b/src/world/common/atomic/PipeData.inc.c index a4bd9dfa4e..100dedd261 100644 --- a/src/world/common/atomic/PipeData.inc.c +++ b/src/world/common/atomic/PipeData.inc.c @@ -153,11 +153,11 @@ EvtScript N(Pipe_ScriptD) = { EVT_SET(LVar0, LVarA) EVT_CALL(N(Pipe_GetEntryPos)) EVT_CALL(SetPlayerPos, LVar1, LVar2, LVar3) - EVT_CALL(SetPlayerFlagBits, PLAYER_STATUS_ANIM_FLAGS_200000, TRUE) + EVT_CALL(SetPlayerFlagBits, PA_FLAGS_200000, TRUE) EVT_CALL(N(Pipe_GetCameraYaw)) EVT_CALL(InterpPlayerYaw, LVar0, 0) EVT_WAIT(2) - EVT_CALL(SetPlayerFlagBits, PLAYER_STATUS_ANIM_FLAGS_200000, FALSE) + EVT_CALL(SetPlayerFlagBits, PA_FLAGS_200000, FALSE) EVT_CALL(PlaySound, SOUND_ENTER_PIPE) EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) EVT_THREAD diff --git a/src/world/common/atomic/QuizmoData.inc.c b/src/world/common/atomic/QuizmoData.inc.c index f8da15dc6a..1334c3d2d1 100644 --- a/src/world/common/atomic/QuizmoData.inc.c +++ b/src/world/common/atomic/QuizmoData.inc.c @@ -660,10 +660,10 @@ EvtScript N(EVS_Quizmo_NPC_Interact) = { EVT_USE_ARRAY(EVT_PTR(N(Quizmo_ScriptArray))) EVT_SET(GF_Quizmo_ChangedLocation, TRUE) EVT_CALL(DisablePlayerPhysics, TRUE) - EVT_CALL(SetPlayerFlagBits, PLAYER_STATUS_FLAGS_400000, 1) + EVT_CALL(SetPlayerFlagBits, PS_FLAGS_400000, 1) EVT_EXEC_WAIT(N(EVS_Quizmo_QuizMain)) EVT_CALL(DisablePlayerPhysics, FALSE) - EVT_CALL(SetPlayerFlagBits, PLAYER_STATUS_FLAGS_400000, 0) + EVT_CALL(SetPlayerFlagBits, PS_FLAGS_400000, 0) EVT_RETURN EVT_END }; diff --git a/src/world/common/atomic/Reflection.inc.c b/src/world/common/atomic/Reflection.inc.c index 91ec40788e..8426950f45 100644 --- a/src/world/common/atomic/Reflection.inc.c +++ b/src/world/common/atomic/Reflection.inc.c @@ -93,7 +93,7 @@ void N(reflection_setup_wall)(void) { spr_update_player_sprite(2, anim, 1.0f); - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_20000)) { + if (!(playerStatus->flags & PS_FLAGS_20000)) { if (playerStatus->alpha1 != D_802D9D70) { if (playerStatus->alpha1 < 254) { renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; @@ -168,7 +168,7 @@ void N(reflection_setup_floor)(void) { spr_update_player_sprite(1, playerStatus->trueAnimation, 1.0f); - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_20000)) { + if (!(playerStatus->flags & PS_FLAGS_20000)) { if (playerStatus->alpha1 != D_802D9D71) { if (playerStatus->alpha1 < 254) { renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; @@ -188,7 +188,7 @@ void N(reflection_setup_floor)(void) { renderTaskPtr->appendGfxArg = playerStatus; renderTaskPtr->distance = -screenZ; renderTaskPtr->appendGfx = (void (*)(void*)) ( - !(playerStatus->flags & PLAYER_STATUS_FLAGS_20000) + !(playerStatus->flags & PS_FLAGS_20000) ? N(reflection_render_floor) : N(reflection_render_floor_fancy) ); diff --git a/src/world/common/enemy/FireBarAI.inc.c b/src/world/common/enemy/FireBarAI.inc.c index 337c75d43a..d9390bd7de 100644 --- a/src/world/common/enemy/FireBarAI.inc.c +++ b/src/world/common/enemy/FireBarAI.inc.c @@ -67,7 +67,7 @@ ApiStatus N(FireBarAI_Main)(Evt* script, s32 isInitialCall) { npc->pos.z = data->centerPos.z + dZ; npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); } - if (!(data->flags & 2) && !(playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_8000)) { + if (!(data->flags & 2) && !(playerStatus->flags & PA_FLAGS_8000)) { dY = playerStatus->position.y - npc->pos.y; if (partnerActionStatus->partnerActionState == PARTNER_ACTION_USE) { if (partnerActionStatus->actingPartner == PARTNER_LAKILESTER) { @@ -84,7 +84,7 @@ ApiStatus N(FireBarAI_Main)(Evt* script, s32 isInitialCall) { } } } - if (playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_8000) { + if (playerStatus->flags & PA_FLAGS_8000) { hitDetected = -1; } data->yaw += data->rotationRate; diff --git a/src/world/partner/bombette.c b/src/world/partner/bombette.c index e4d8ce95c9..6d6944d6ff 100644 --- a/src/world/partner/bombette.c +++ b/src/world/partner/bombette.c @@ -637,7 +637,7 @@ void world_bombette_pre_battle(Npc* bombette) { } D_802BE928 = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_JUMPING; + playerStatus->flags &= ~PS_FLAGS_JUMPING; bombette->jumpVelocity = 0.0f; bombette->flags &= ~NPC_FLAG_JUMPING; diff --git a/src/world/partner/bow.c b/src/world/partner/bow.c index 1220b88e51..4676c0a0aa 100644 --- a/src/world/partner/bow.c +++ b/src/world/partner/bow.c @@ -169,10 +169,10 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { if (isInitialCall) { func_802BD4FC_323E4C(bow); - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100000)) { + if (!(playerStatus->animFlags & PA_FLAGS_100000)) { if (func_800EA52C(9)) { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_200000) { - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_200000; + if (playerStatus->animFlags & PA_FLAGS_200000) { + playerStatus->animFlags &= ~PA_FLAGS_200000; script->functionTemp[2] = disable_player_input(); D_802BE0C4 = TRUE; script->functionTemp[0] = 20; @@ -193,7 +193,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } - playerStatus->flags |= PLAYER_STATUS_FLAGS_100; + playerStatus->flags |= PS_FLAGS_100; script->functionTemp[1] = 3; script->functionTemp[2] = disable_player_input(); D_802BE0C4 = TRUE; @@ -206,7 +206,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { enable_player_input(); D_802BE0C4 = FALSE; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; return ApiStatus_DONE2; } script->functionTemp[1]--; @@ -216,7 +216,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { enable_player_input(); D_802BE0C4 = FALSE; } - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; return ApiStatus_DONE2; } script->functionTemp[0] = 20; @@ -226,8 +226,8 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { switch (script->functionTemp[0]) { case 20: - if (playerStatus->flags & PLAYER_STATUS_FLAGS_800) { - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + if (playerStatus->flags & PS_FLAGS_800) { + playerStatus->flags &= ~PS_FLAGS_100; if (D_802BE0C4) { enable_player_input(); D_802BE0C4 = FALSE; @@ -242,7 +242,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { bow->flags &= ~(NPC_FLAG_JUMPING | NPC_FLAG_GRAVITY); partnerActionStatus->partnerActionState = 1; partnerActionStatus->actingPartner = 9; - playerStatus->flags |= PLAYER_STATUS_FLAGS_8000; + playerStatus->flags |= PS_FLAGS_8000; func_800EF4E0(); bow->moveToPos.x = playerStatus->position.x; bow->moveToPos.y = playerStatus->position.y + (playerStatus->colliderHeight * 0.5f); @@ -260,7 +260,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { break; case 21: if (collisionStatus->currentFloor >= 0 && - (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100000) == 0) { + (playerStatus->animFlags & PA_FLAGS_100000) == 0) { bow->moveToPos.x = playerStatus->position.x; bow->moveToPos.y = playerStatus->position.y + (playerStatus->colliderHeight * 0.5f); bow->moveToPos.z = playerStatus->position.z; @@ -290,7 +290,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { playerStatus->alpha1 = 128; bow->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2; script->functionTemp[0]++; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; bow->flags |= 0x40; } @@ -317,7 +317,7 @@ ApiStatus BowUseAbility(Evt* script, s32 isInitialCall) { distance = dist2D(0.0f, 0.0f, partnerActionStatus->stickX, partnerActionStatus->stickY); if ((collisionStatus->currentFloor < 0) || distance > 10.0f || partnerActionStatus->pressedButtons & (BUTTON_B | BUTTON_C_DOWN) || - playerStatus->flags & PLAYER_STATUS_FLAGS_800) { + playerStatus->flags & PS_FLAGS_800) { if (func_802BD540_323E90() < 0) { script->functionTemp[0]++; script->functionTemp[1] = 3; @@ -363,19 +363,19 @@ void func_802BDDF0_324740(Npc* bow) { enable_player_input(); } - playerStatus->flags &= ~(PLAYER_STATUS_FLAGS_8000 | PLAYER_STATUS_FLAGS_JUMPING); + playerStatus->flags &= ~(PS_FLAGS_8000 | PS_FLAGS_JUMPING); bow->flags &= ~(NPC_FLAG_40 | NPC_FLAG_2); D_802BE0C4 = FALSE; actionState = ACTION_STATE_IDLE; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_800) { + if (playerStatus->flags & PS_FLAGS_800) { actionState = ACTION_STATE_HIT_LAVA; } set_action_state(actionState); partnerActionStatus->partnerActionState = 0; partnerActionStatus->actingPartner = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; partner_clear_player_tracking(bow); D_802BE0C0 = FALSE; } diff --git a/src/world/partner/kooper.c b/src/world/partner/kooper.c index f2046c7dcf..43e2d2989f 100644 --- a/src/world/partner/kooper.c +++ b/src/world/partner/kooper.c @@ -278,7 +278,7 @@ ApiStatus func_802BD638_31B658(Evt* script, s32 isInitialCall) { } disable_npc_blur(kooper); if (script->functionTemp[2] < playerStatus->inputEnabledCounter) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100000)) { + if (!(playerStatus->animFlags & PA_FLAGS_100000)) { suggest_player_anim_clearUnkFlag(ANIM_Mario_10002); } else { suggest_player_anim_clearUnkFlag(ANIM_Mario_Running); @@ -294,7 +294,7 @@ ApiStatus func_802BD638_31B658(Evt* script, s32 isInitialCall) { kooper->moveToPos.y = playerStatus->position.y; kooper->moveToPos.z = playerStatus->position.y + playerStatus->colliderHeight / 3; - playerStatus->flags |= PLAYER_STATUS_FLAGS_JUMPING; + playerStatus->flags |= PS_FLAGS_JUMPING; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_FLAGS_1; suggest_player_anim_clearUnkFlag(ANIM_Mario_AnimMidairStill); @@ -693,7 +693,7 @@ void world_kooper_pre_battle(Npc* kooper) { } D_802BEB40_31CB60 = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_JUMPING; + playerStatus->flags &= ~PS_FLAGS_JUMPING; kooper->jumpVelocity = 0.0f; kooper->flags &= ~NPC_FLAG_JUMPING; diff --git a/src/world/partner/lakilester.c b/src/world/partner/lakilester.c index 43063a1947..4ad5470e41 100644 --- a/src/world/partner/lakilester.c +++ b/src/world/partner/lakilester.c @@ -26,9 +26,9 @@ void func_802BD100_320C50(void) { f32 playerSpeedCopy; s32 temp_v0_2; - if (playerFlags & PLAYER_STATUS_FLAGS_4000) { + if (playerFlags & PS_FLAGS_4000) { playerSpeedCopy = playerStatus->currentSpeed; - if (playerFlags & PLAYER_STATUS_FLAGS_40000) { + if (playerFlags & PS_FLAGS_40000) { playerSpeedCopy *= 0.5f; } @@ -206,8 +206,8 @@ s32 func_802BD7DC(void) { s32 raycastResult; s32 ret; - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_20000000) { - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_20000000; + if (playerStatus->animFlags & PA_FLAGS_20000000) { + playerStatus->animFlags &= ~PA_FLAGS_20000000; return TRUE; } @@ -545,20 +545,20 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { f32 yaw, camYaw; s32 i; - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_400000; + playerStatus->animFlags &= ~PA_FLAGS_400000; if (isInitialCall) { func_802BD678_3211C8(npc); - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100000)) { - npc->flags = npc->flags & ~PLAYER_STATUS_ANIM_FLAGS_40; + if (!(playerStatus->animFlags & PA_FLAGS_100000)) { + npc->flags = npc->flags & ~PA_FLAGS_40; npc->moveToPos.x = npc->pos.x; npc->moveToPos.y = npc->pos.y; npc->moveToPos.z = npc->pos.z; if (gGameStatusPtr->keepUsingPartnerOnMapChange || - (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_200000)) { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_200000) { - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_200000; + (playerStatus->animFlags & PA_FLAGS_200000)) { + if (playerStatus->animFlags & PA_FLAGS_200000) { + playerStatus->animFlags &= ~PA_FLAGS_200000; } D_802BFF14 = 100; } else { @@ -573,14 +573,14 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { playerStatus->actionState == ACTION_STATE_RUN || playerStatus->actionState == ACTION_STATE_FALLING) { - playerStatus->flags |= PLAYER_STATUS_ANIM_FLAGS_100; + playerStatus->flags |= PA_FLAGS_100; } else { return ApiStatus_DONE2; } } } else { partnerActionStatus->partnerAction_unk_1 = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; npc->flags &= ~(NPC_FLAG_40 | NPC_FLAG_ENABLE_HIT_SCRIPT); npc->flags |= NPC_FLAG_100; set_action_state(ACTION_STATE_RIDE); @@ -621,7 +621,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { switch (D_802BFF14) { case 40: - if (playerStatus->flags & PLAYER_STATUS_FLAGS_800 || + if (playerStatus->flags & PS_FLAGS_800 || playerStatus->inputEnabledCounter) { playerStatus->flags &= ~NPC_FLAG_100; @@ -633,7 +633,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { D_802BFF14 += 1; break; case 41: - if (playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_800) { + if (playerStatus->flags & PA_FLAGS_800) { playerStatus->flags &= ~NPC_FLAG_100; if (D_802BFF04 != 0) { enable_player_input(); @@ -642,12 +642,12 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100000) { + if (playerStatus->animFlags & PA_FLAGS_100000) { if (script->functionTemp[2] < playerStatus->inputEnabledCounter) { enable_player_input(); D_802BFF04 = 0; } - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; return ApiStatus_DONE2; } @@ -655,7 +655,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { if (script->functionTemp[2] < playerStatus->inputEnabledCounter) { enable_player_input(); D_802BFF04 = 0; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; return ApiStatus_DONE2; } D_802BFF14 = 100; @@ -713,7 +713,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { D_802BFF14 += 1; /* fallthrough */ case 103: - if (!(playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_800)) { + if (!(playerStatus->flags & PA_FLAGS_800)) { npc->pos.x += (npc->moveToPos.x - npc->pos.x) / npc->duration; npc->pos.z += (npc->moveToPos.z - npc->pos.z) / npc->duration; npc->pos.y += (npc->moveToPos.y - npc->pos.y) / npc->duration; @@ -746,20 +746,20 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { disable_player_shadow(); partnerActionStatus->actingPartner = PARTNER_LAKILESTER; partnerActionStatus->partnerActionState = PARTNER_ACTION_LAKILESTER_1; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; gGameStatusPtr->keepUsingPartnerOnMapChange = 0; D_802BFF18 = 0; D_802BFF0C = 2; func_802BFB44_323694(2.0f); D_802BFF14 = 104; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_400000; + playerStatus->animFlags |= PA_FLAGS_400000; } } else { D_802BFF14 = 10; } break; case 104: - if (playerStatus->flags & PLAYER_STATUS_ANIM_FLAGS_800) { + if (playerStatus->flags & PA_FLAGS_800) { D_802BFF14 = 10; break; } else { @@ -776,7 +776,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { } case 1: func_802BDDD8_321928(npc); - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_400000; + playerStatus->animFlags |= PA_FLAGS_400000; D_802BFF18++; npc->pos.y = npc->moveToPos.y + 2.0f; @@ -788,15 +788,15 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { playerStatus->targetYaw = npc->yaw; } - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_800)) { + if (!(playerStatus->flags & PS_FLAGS_800)) { if (partnerActionStatus->pressedButtons & (B_BUTTON | D_CBUTTONS)) { if (func_802BD7DC()) { D_802BFF14 = 3; } else { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_40000000)) { + if (!(playerStatus->animFlags & PA_FLAGS_40000000)) { sfx_play_sound_at_npc(SOUND_MENU_ERROR, 0, NPC_PARTNER); } - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_40000000; + playerStatus->animFlags &= ~PA_FLAGS_40000000; } } } else { @@ -879,7 +879,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { enable_player_shadow(); gGameStatusPtr->keepUsingPartnerOnMapChange = 0; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_800) { + if (playerStatus->flags & PS_FLAGS_800) { partnerActionStatus->actingPartner = PARTNER_NONE; partnerActionStatus->partnerActionState = PARTNER_ACTION_NONE; @@ -890,7 +890,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { partner_clear_player_tracking(npc); set_action_state(ACTION_STATE_HIT_FIRE); - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; return ApiStatus_DONE1; } @@ -904,7 +904,7 @@ ApiStatus func_802BE724_322274(Evt* script, s32 isInitialCall) { npc->flags &= ~(NPC_FLAG_40 | NPC_FLAG_400000 | NPC_FLAG_ENABLE_HIT_SCRIPT); partnerActionStatus->actingPartner = PARTNER_NONE; partnerActionStatus->partnerActionState = PARTNER_ACTION_NONE; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; if (D_802BFF04 != 0) { D_802BFF04 = 0; enable_player_input(); @@ -937,8 +937,8 @@ ApiStatus func_802BF4F0_323040(Evt* script, s32 isInitialCall) { D_802BFF00 = (D_802BFF0C == 0) ? 3 : 0; partner_init_put_away(lakilester); func_802BD7DC(); - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_400000; - playerStatus->flags |= PLAYER_STATUS_FLAGS_100; + playerStatus->animFlags &= ~PA_FLAGS_400000; + playerStatus->flags |= PS_FLAGS_100; } switch (D_802BFF00) { @@ -977,7 +977,7 @@ ApiStatus func_802BF4F0_323040(Evt* script, s32 isInitialCall) { lakilester->moveSpeed, lakilester->yaw); func_800E4AD8(0); if (lakilester->jumpVelocity <= 0.0f) { - playerStatus->flags |= PLAYER_STATUS_FLAGS_FALLING; + playerStatus->flags |= PS_FLAGS_FALLING; if (lakilester->jumpVelocity < -10.0) { lakilester->jumpVelocity = -10.0f; } @@ -1010,7 +1010,7 @@ ApiStatus func_802BF4F0_323040(Evt* script, s32 isInitialCall) { enable_player_shadow(); - if (playerStatus->flags & PLAYER_STATUS_FLAGS_800) { + if (playerStatus->flags & PS_FLAGS_800) { partnerActionStatus->actingPartner = PARTNER_NONE; partnerActionStatus->partnerActionState = PARTNER_ACTION_NONE; if (D_802BFF04) { @@ -1037,7 +1037,7 @@ ApiStatus func_802BF4F0_323040(Evt* script, s32 isInitialCall) { case 4: partnerActionStatus->actingPartner = PARTNER_NONE; partnerActionStatus->partnerActionState = PARTNER_ACTION_NONE; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_100; + playerStatus->flags &= ~PS_FLAGS_100; if (D_802BFF04) { D_802BFF04 = FALSE; @@ -1153,7 +1153,7 @@ s32 func_802BFBA0_3236F0(Evt* script, s32 isInitialCall) { sfx_play_sound_at_npc(SOUND_295, 0, -4); playerStatus->anim = ANIM_Mario_8000E; playerStatus->unk_BC = 0; - playerStatus->flags |= PLAYER_STATUS_FLAGS_10000000; + playerStatus->flags |= PS_FLAGS_10000000; func_802BFB44_323694(2.0f); gGameStatusPtr->keepUsingPartnerOnMapChange = 1; npc->flags |= NPC_FLAG_100; diff --git a/src/world/partner/parakarry.c b/src/world/partner/parakarry.c index a8d5fdf33a..d32d8136aa 100644 --- a/src/world/partner/parakarry.c +++ b/src/world/partner/parakarry.c @@ -154,7 +154,7 @@ s32 func_802BD558_319AC8(void) { if (surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA) { gPlayerStatus.hazardType = HAZARD_TYPE_SPIKES; D_802BEBC0_31CBE0 = 0x15; - gPlayerStatus.flags |= PLAYER_STATUS_FLAGS_800; + gPlayerStatus.flags |= PS_FLAGS_800; } return raycastResult; @@ -179,7 +179,7 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) { if (gCurrentEncounter.unk_08 == 0) { if (isInitialCall) { func_802BD514_319A84(parakarry); - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100000)) { + if (!(playerStatus->animFlags & PA_FLAGS_100000)) { if (partnerActionStatus->partnerAction_unk_1 == 0) { if (!func_800EA52C(4)) { return ApiStatus_DONE2; @@ -364,7 +364,7 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) { } } - if (testMove == 0 && !(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8000)) { + if (testMove == 0 && !(playerStatus->animFlags & PA_FLAGS_8000)) { add_vec2D_polar(¶karry->pos.x, ¶karry->pos.z, parakarry->moveSpeed, parakarry->yaw); add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, parakarry->moveSpeed, parakarry->yaw); parakarry->planarFlyDist += parakarry->moveSpeed; @@ -379,7 +379,7 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) { if (surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA) { playerStatus->hazardType = HAZARD_TYPE_SPIKES; D_802BEBC0_31CBE0 = 0x15; - playerStatus->flags |= PLAYER_STATUS_FLAGS_800; + playerStatus->flags |= PS_FLAGS_800; } playerStatus->position.y += (y - playerStatus->position.y) * 0.25f; @@ -414,7 +414,7 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) { gCollisionStatus.currentFloor = func_802BD558_319AC8(); if (playerStatus->actionState != ACTION_STATE_HIT_FIRE && playerStatus->actionState != ACTION_STATE_HIT_LAVA && playerStatus->actionState != ACTION_STATE_KNOCKBACK) { suggest_player_anim_setUnkFlag(ANIM_Mario_8000D); - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_800)) { + if (!(playerStatus->flags & PS_FLAGS_800)) { if (partnerActionStatus->pressedButtons & (BUTTON_A | BUTTON_B | BUTTON_C_DOWN)) { if (partnerActionStatus->pressedButtons & buttonTemp) { // TODO find a way to remove this while still loading 0x15 instead of moving it from register if (!parakarry->pos.x) { @@ -438,7 +438,7 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) { parakarry->pos.y += parakarry->jumpVelocity; playerStatus->position.y += parakarry->jumpVelocity; - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8000)) { + if (!(playerStatus->animFlags & PA_FLAGS_8000)) { parakarry->moveSpeed += 0.1; if (parakarry->moveSpeed > 2.0) { parakarry->moveSpeed = 2.0f; @@ -454,7 +454,7 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) { if (parakarry->planarFlyDist > 80.0f) { parakarry->animationSpeed += 0.5; } - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8000)) { + if (!(playerStatus->animFlags & PA_FLAGS_8000)) { x = playerStatus->position.x; y = playerStatus->position.y; z = playerStatus->position.z; @@ -551,13 +551,13 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) { if (D_802BEBB8 != 0) { enable_player_static_collisions(); } - if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_800)) { + if (!(playerStatus->flags & PS_FLAGS_800)) { if (D_802BEBC0_31CBE0 == 0x14) { start_bounce_b(); } else if (D_802BEBC0_31CBE0 == 0x15) { start_falling(); gravity_use_fall_parms(); - playerStatus->flags |= PLAYER_STATUS_FLAGS_800000; + playerStatus->flags |= PS_FLAGS_800000; } else { set_action_state(ACTION_STATE_IDLE); } diff --git a/src/world/partner/sushie.c b/src/world/partner/sushie.c index 4250ff95cb..290fb94e3b 100644 --- a/src/world/partner/sushie.c +++ b/src/world/partner/sushie.c @@ -248,7 +248,7 @@ s32 SushiePutAway(Evt* script, s32 isInitialCall) { if (isInitialCall) { partner_init_put_away(sushie); - gPlayerStatusPtr->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_400000; + gPlayerStatusPtr->animFlags &= ~PA_FLAGS_400000; } return partner_put_away(sushie) ? ApiStatus_DONE1 : ApiStatus_BLOCK; diff --git a/src/world/partner/watt.c b/src/world/partner/watt.c index 95183821e0..884ca9e6dd 100644 --- a/src/world/partner/watt.c +++ b/src/world/partner/watt.c @@ -213,18 +213,18 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) { if (isInitialCall) { func_802BD710_31D280(npc); - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100000)) { + if (!(playerStatus->animFlags & PA_FLAGS_100000)) { if (partnerActionStatus->partnerAction_unk_1 == 0) { if ((partnerActionStatus->partnerActionState != ACTION_STATE_IDLE) || (func_800EA52C(6) && !is_starting_conversation())) { if (gGameStatusPtr->keepUsingPartnerOnMapChange) { - if (playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2)) { + if (playerStatus->animFlags & (PA_FLAGS_HOLDING_WATT | PA_FLAGS_2)) { D_802BE304 = 20; } else { D_802BE304 = 40; } - } else if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT) { + } else if (playerStatus->animFlags & PA_FLAGS_HOLDING_WATT) { D_802BE304 = 2; } else { D_802BE304 = 40; @@ -234,7 +234,7 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) { } } else { partnerActionStatus->partnerAction_unk_1 = 0; - playerStatus->animFlags |= (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2); + playerStatus->animFlags |= (PA_FLAGS_HOLDING_WATT | PA_FLAGS_2); func_802BE014_31DB84(); npc->currentAnim = 0x60001; D_802BE304 = 1; @@ -257,7 +257,7 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) { case 41: if (script->functionTemp[1] == 0) { if (script->functionTemp[2] >= playerStatus->inputEnabledCounter) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_100000)) { + if (!(playerStatus->animFlags & PA_FLAGS_100000)) { if (func_800EA52C(6)) { if (!is_starting_conversation()) { D_802BE304 = 20; @@ -275,7 +275,7 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) { switch (D_802BE304) { case 20: if (gGameStatusPtr->keepUsingPartnerOnMapChange) { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT; + playerStatus->animFlags |= PA_FLAGS_HOLDING_WATT; D_802BE30C = 1; npc->flags |= NPC_FLAG_100 | NPC_FLAG_ENABLE_HIT_SCRIPT; npc->flags &= ~(NPC_FLAG_JUMPING | NPC_FLAG_GRAVITY); @@ -289,13 +289,13 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) { add_vec2D_polar(&npc->moveToPos.x, &npc->moveToPos.z, 15.0f, playerStatus->targetYaw); npc->yaw = playerStatus->targetYaw; npc->currentAnim = 0x60001; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_2; + playerStatus->animFlags |= PA_FLAGS_2; func_802BE014_31DB84(); npc_set_palswap_mode_A(npc, 1); script->functionTemp[1] = 2; D_802BE304 = 1; } else { - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT; + playerStatus->animFlags |= PA_FLAGS_HOLDING_WATT; D_802BE30C = 1; npc->flags &= ~(NPC_FLAG_JUMPING | NPC_FLAG_GRAVITY); gGameStatusPtr->keepUsingPartnerOnMapChange = 0; @@ -321,7 +321,7 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) { npc->yaw = playerStatus->targetYaw; npc->currentAnim = 0x60001; partnerActionStatus->actingPartner = PARTNER_WATT; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_2; + playerStatus->animFlags |= PA_FLAGS_2; func_802BE014_31DB84(); script->functionTemp[1] = 2; D_802BE304 = 1; @@ -329,7 +329,7 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) { break; case 1: world_watt_sync_held_position(); - if ((playerStatus->flags & PLAYER_STATUS_FLAGS_800)) { + if ((playerStatus->flags & PS_FLAGS_800)) { D_802BE304 = 2; } else { s32 actionState = playerStatus->actionState; @@ -353,7 +353,7 @@ ApiStatus func_802BD754_31D2C4(Evt* script, s32 isInitialCall) { } if (D_802BE304 == 2) { - playerStatus->animFlags &= ~(PLAYER_STATUS_ANIM_FLAGS_2 | PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT); + playerStatus->animFlags &= ~(PA_FLAGS_2 | PA_FLAGS_HOLDING_WATT); npc->currentAnim = 0x60001; partner_clear_player_tracking(npc); D_802BE30C = 0; @@ -394,7 +394,7 @@ s32 WattPutAway(Evt* script, s32 isInitialCall) { force_player_anim(ANIM_Mario_10002); wattActionStatus->actingPartner = PARTNER_NONE; wattActionStatus->partnerActionState = PARTNER_ACTION_NONE; - playerStatus->animFlags &= ~(PLAYER_STATUS_ANIM_FLAGS_2 | PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT); + playerStatus->animFlags &= ~(PA_FLAGS_2 | PA_FLAGS_HOLDING_WATT); gGameStatusPtr->keepUsingPartnerOnMapChange = 0; } @@ -459,7 +459,7 @@ ApiStatus func_802BDE88_31D9F8(Evt* script, s32 isInitialCall) { world_watt_sync_held_position(); watt->flags &= ~NPC_FLAG_GRAVITY; watt->flags |= NPC_FLAG_100; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_2 | PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT; + playerStatus->animFlags |= (PA_FLAGS_2 | PA_FLAGS_HOLDING_WATT); gGameStatusPtr->keepUsingPartnerOnMapChange = 1; wattActionStatus->partnerActionState = PARTNER_ACTION_WATT_SHINE; wattActionStatus->actingPartner = PARTNER_WATT; diff --git a/src/world/partners.c b/src/world/partners.c index 3d99583b12..10e8e31eaf 100644 --- a/src/world/partners.c +++ b/src/world/partners.c @@ -486,7 +486,7 @@ s32 func_800EA52C(s32 arg0) { u32 playerActionState = playerStatus->actionState; s32 ret = FALSE; - if (playerStatus->flags & PLAYER_STATUS_FLAGS_800) { + if (playerStatus->flags & PS_FLAGS_800) { return FALSE; } @@ -585,10 +585,10 @@ void _use_partner_ability(void) { partnerActionStatus->heldButtons = 0; } - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_4) { - playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_4; + if (playerStatus->animFlags & PA_FLAGS_4) { + playerStatus->animFlags &= ~PA_FLAGS_4; partnerActionStatus->pressedButtons |= BUTTON_B | BUTTON_C_DOWN; - playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_40000000; + playerStatus->animFlags |= PA_FLAGS_40000000; } if (D_8010CFE8 != 0) { @@ -1028,8 +1028,8 @@ void partner_handle_after_battle(void) { D_8010CFE8 = 1; if (playerData->currentPartner != PARTNER_WATT && actionStatus->actingPartner == PARTNER_WATT) { - gPlayerStatusPtr->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT; - gPlayerStatusPtr->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_2; + gPlayerStatusPtr->animFlags &= ~PA_FLAGS_HOLDING_WATT; + gPlayerStatusPtr->animFlags &= ~PA_FLAGS_2; actionStatus->actingPartner = PARTNER_NONE; } @@ -1115,7 +1115,7 @@ void partner_walking_update_player_tracking(Npc* partner) { s32 isPlayerJumping; PlayerPathElement* currentSnapshot; - if (playerStatus->flags & (PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING)) { + if (playerStatus->flags & (PS_FLAGS_FALLING | PS_FLAGS_JUMPING)) { isPlayerJumping = (playerStatus->actionState == ACTION_STATE_LAND || playerStatus->actionState == ACTION_STATE_STEP_DOWN) ^ 1; } else { isPlayerJumping = FALSE; @@ -1141,9 +1141,9 @@ void partner_walking_update_motion(Npc* partner) { PlayerStatus* playerStatus = &gPlayerStatus; PartnerActionStatus* actionStatus = &gPartnerActionStatus; - if (gGameStatusPtr->multiplayerEnabled == 0 || playerStatus->flags & (PLAYER_STATUS_FLAGS_INPUT_DISABLED | PLAYER_STATUS_FLAGS_1000) + if (gGameStatusPtr->multiplayerEnabled == 0 || playerStatus->flags & (PS_FLAGS_INPUT_DISABLED | PS_FLAGS_1000) || actionStatus->inputDisabled != 0 || actionStatus->partnerAction_unk_2 != 0) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_800)) { + if (!(playerStatus->animFlags & PA_FLAGS_800)) { partner_walking_follow_player(partner); } if (actionStatus->pressedButtons & (BUTTON_Z | BUTTON_B | BUTTON_C_LEFT | BUTTON_C_DOWN)) { @@ -1157,7 +1157,7 @@ void partner_walking_update_motion(Npc* partner) { partner->pos.z = playerStatus->position.z; partner->jumpVelocity = 0.0f; partner->jumpScale = 0.0f; - partner->flags = partner->flags & ~PLAYER_STATUS_ANIM_FLAGS_800; + partner->flags = partner->flags & ~PA_FLAGS_800; } partner_do_player_collision(partner); @@ -1247,11 +1247,11 @@ void partner_flying_update_motion(Npc* partner) { f32 var_f2; if (gGameStatusPtr->multiplayerEnabled == 0 || - (playerStatus->flags & (PLAYER_STATUS_FLAGS_INPUT_DISABLED | PLAYER_STATUS_FLAGS_1000)) || + (playerStatus->flags & (PS_FLAGS_INPUT_DISABLED | PS_FLAGS_1000)) || partnerActionStatus->inputDisabled || partnerActionStatus->partnerAction_unk_2 != 0) { - if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_800) || D_800F8020 == 0) { + if (!(playerStatus->animFlags & PA_FLAGS_800) || D_800F8020 == 0) { partner_flying_follow_player(partner); } if (partnerActionStatus->pressedButtons & (BUTTON_B | BUTTON_Z | BUTTON_C_DOWN | BUTTON_C_LEFT)) { diff --git a/src/world/script_api/7E3700.c b/src/world/script_api/7E3700.c index d3adecbed1..5620f829d5 100644 --- a/src/world/script_api/7E3700.c +++ b/src/world/script_api/7E3700.c @@ -229,7 +229,7 @@ ApiStatus func_80283174(Evt* script, s32 isInitialCall) { if (playerStatus->actionState == ACTION_STATE_PUSHING_BLOCK || playerStatus->actionState == ACTION_STATE_WALK || playerStatus->actionState == ACTION_STATE_RUN) { - if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT) { + if (playerStatus->animFlags & PA_FLAGS_HOLDING_WATT) { script->varTable[13] = FALSE; } else { script->varTable[13] = TRUE; diff --git a/src/world/script_api/7E4690.c b/src/world/script_api/7E4690.c index 7622f3c2cd..03f13882f3 100644 --- a/src/world/script_api/7E4690.c +++ b/src/world/script_api/7E4690.c @@ -76,13 +76,13 @@ ApiStatus EnterPlayerPostPipe(Evt* script, s32 isInitialCall) { playerStatus->position.z = (*mapSettings->entryList)[gGameStatusPtr->entryID].z; script->varTable[2] = (*mapSettings->entryList)[gGameStatusPtr->entryID].y; playerStatus->position.y = script->varTable[2] - 40; - playerStatus->flags |= PLAYER_STATUS_FLAGS_CAMERA_DOESNT_FOLLOW; + playerStatus->flags |= PS_FLAGS_CAMERA_DOESNT_FOLLOW; } else { do { playerStatus->position.y += 1.0f; if (!(playerStatus->position.y < script->varTable[2])) { playerStatus->position.y = script->varTable[2]; - playerStatus->flags &= ~PLAYER_STATUS_FLAGS_CAMERA_DOESNT_FOLLOW; + playerStatus->flags &= ~PS_FLAGS_CAMERA_DOESNT_FOLLOW; ret = ApiStatus_DONE2; } } while (0); // todo required to match