From 935fd145309cda2048c7a94313e72a44e4b82861 Mon Sep 17 00:00:00 2001 From: HailSanta <53960937+HailSanta@users.noreply.github.com> Date: Sun, 15 Jan 2023 04:22:41 -0500 Subject: [PATCH] misc battle cleanup III (#911) * misc * fix one type * yeah * misc * all substates * almost done * renames * comments * a couple maps Co-authored-by: HailSanta --- include/common_structs.h | 12 +- include/dead_structs.h | 2 +- include/enums.h | 782 +++--- include/npc.h | 4 +- include/script_api/battle.h | 6 +- include/script_api/common.h | 4 +- include/variables.h | 6 +- src/16F740.c | 1392 +++++----- src/16c8e0.c | 40 +- src/17D6A0.c | 433 ++-- src/17FEB0.c | 2 +- src/18C790.c | 300 +-- src/18F340.c | 24 +- src/190B20.c | 32 +- src/19FAF0.c | 4 +- src/1A5830.c | 10 +- src/1AC760.c | 2 +- src/1AF230.c | 10 +- src/415D90.c | 2241 +++++++++-------- src/7fd10_len_b40.c | 2 +- src/8a860_len_3f30.c | 197 +- src/actor_api.c | 6 +- src/battle/action_cmd.c | 10 +- src/battle/area_arn/actor/tubbas_heart.c | 2 +- src/battle/area_dgb/actor/tubba_blubba.c | 2 +- src/battle/area_dig/actor/tubba_blubba.c | 2 +- src/battle/area_dig/script/dig_01.c | 2 +- src/battle/area_dig/script/dig_02.c | 2 +- src/battle/area_dig/script/dig_03.c | 4 +- src/battle/area_dig/script/dig_04.c | 6 +- src/battle/area_dig/stage/dig_04.c | 4 +- src/battle/area_flo/actor/amazy_dayzee.c | 2 +- src/battle/area_flo/actor/crazee_dayzee.c | 2 +- src/battle/area_hos/actor/goombario_tutor.c | 81 +- src/battle/area_hos/actor/magikoopa.c | 10 +- .../area_isk_part_1/actor/pokey_mummy.c | 2 +- src/battle/area_iwa/stage/iwa_01.c | 6 +- src/battle/area_kkj/actor/kammy_koopa.c | 4 +- .../area_kmr_part_3/actor/egg_jr_troopa.c | 2 +- .../area_kmr_part_3/actor/final_jr_troopa.c | 4 +- .../area_kmr_part_3/actor/mage_jr_troopa.c | 4 +- .../area_kmr_part_3/actor/para_jr_troopa.c | 4 +- .../actor/spiked_para_jr_troopa.c | 4 +- src/battle/area_kpa/actor/bony_beetle.c | 2 +- src/battle/area_kpa2/actor/bowser_intro.c | 2 +- src/battle/area_kpa2/actor/bowser_phase_2.c | 2 +- src/battle/area_kpa2/actor/bowser_phase_3.c | 4 +- src/battle/area_omo/actor/spy_guy.c | 2 +- src/battle/area_omo/stage/omo_04.c | 4 +- src/battle/area_omo2_1/actor/shy_squad.c | 2 +- src/battle/area_omo2_2/actor/stilt_guy.c | 10 +- src/battle/area_omo2_3/actor/shy_stack.c | 4 +- src/battle/area_omo3/stage/omo_04.c | 4 +- .../area_trd_part_2/actor/fake_bowser.c | 34 +- src/battle/area_trd_part_3/actor/eldstar.c | 30 +- src/battle/battle.c | 34 +- src/battle/battle.h | 440 ++-- src/battle/common/actor/bandit.inc.c | 4 +- src/battle/common/actor/gray_magikoopa.inc.c | 2 +- src/battle/common/actor/green_magikoopa.inc.c | 2 +- src/battle/common/actor/magikoopa.inc.c | 2 +- src/battle/common/actor/red_magikoopa.inc.c | 2 +- src/battle/common/actor/white_magikoopa.inc.c | 2 +- .../common/actor/yellow_magikoopa.inc.c | 2 +- src/battle/item/ItemRefund.inc.c | 4 +- src/battle/item/electro_pop.c | 2 +- src/battle/item/food.c | 2 +- src/battle/item/life_shroom.c | 2 +- src/battle/item/mushroom.c | 2 +- src/battle/item/mystery.c | 4 +- src/battle/item/repel_gel.c | 2 +- src/battle/item/stone_cap.c | 2 +- src/battle/item/strange_cake.c | 10 +- src/battle/item/super_soda.c | 2 +- src/battle/item/volt_shroom.c | 2 +- src/battle/partner/bombette.c | 2 +- src/battle/partner/bow.c | 2 +- src/battle/partner/goombario.c | 2 +- src/battle/partner/goompa.c | 2 +- src/battle/partner/kooper.c | 2 +- src/battle/partner/lakilester.c | 2 +- src/battle/partner/parakarry.c | 2 +- src/battle/partner/sushie.c | 2 +- src/battle/partner/watt.c | 2 +- src/battle_cam.c | 2 +- src/encounter.c | 12 +- src/encounter_api.c | 18 +- src/evt/fa4c0_len_3bf0.c | 2 +- src/hud_element.h | 8 +- src/load_script.c | 14 +- src/main_loop.c | 34 +- src/move_table.inc.c | 4 +- src/state_pause.c | 2 +- src/world/area_dro/dro_02/npc_merlee.c | 4 +- src/world/area_isk/isk_02/isk_02_5_npc.c | 6 +- src/world/area_isk/isk_07/isk_07_3_npc.c | 6 +- src/world/area_jan/jan_04/B45730.c | 2 +- src/world/area_kmr/kmr_02/kmr_02_3_npc.c | 27 +- src/world/area_omo/omo.h | 58 +- src/world/area_omo/omo_02/D9D510.c | 2 +- src/world/area_omo/omo_04/DAD400.c | 36 - src/world/area_omo/omo_04/DAF240.c | 4 - src/world/area_omo/omo_04/omo_04.h | 36 +- src/world/area_omo/omo_04/omo_04_0_header.c | 13 + src/world/area_omo/omo_04/omo_04_1_music.c | 11 + src/world/area_omo/omo_04/omo_04_2_main.c | 46 + src/world/area_omo/omo_04/omo_04_3_gizmos.c | 61 + src/world/area_omo/omo_04/omo_04_4_entity.c | 160 ++ src/world/area_omo/omo_04/omo_04_5_npc.c | 216 ++ src/world/area_omo/omo_04/omo_04_6_scenes.c | 243 ++ src/world/area_omo/omo_05/DB22C0.c | 91 - src/world/area_omo/omo_05/omo_05.h | 21 +- src/world/area_omo/omo_05/omo_05_0_header.c | 16 + src/world/area_omo/omo_05/omo_05_1_music.c | 7 + src/world/area_omo/omo_05/omo_05_2_main.c | 40 + src/world/area_omo/omo_05/omo_05_3_gizmos.c | 85 + src/world/area_omo/omo_05/omo_05_4_npc.c | 519 ++++ src/world/area_omo/omo_05/omo_05_5_entity.c | 20 + src/world/area_omo/omo_07/DBD2B0.c | 31 - src/world/area_omo/omo_07/DC01D0.c | 15 - src/world/area_omo/omo_07/DC04D0.c | 4 - src/world/area_omo/omo_07/omo_07.h | 40 +- src/world/area_omo/omo_07/omo_07_0_header.c | 13 + src/world/area_omo/omo_07/omo_07_1_music.c | 11 + src/world/area_omo/omo_07/omo_07_2_main.c | 48 + src/world/area_omo/omo_07/omo_07_3_gizmos.c | 49 + src/world/area_omo/omo_07/omo_07_4_npc.c | 636 +++++ src/world/area_omo/omo_07/omo_07_5_entity.c | 108 + src/world/area_omo/omo_07/omo_07_6_scenes.c | 118 + src/world/area_omo/omo_09/DCD6B0.c | 4 +- src/world/area_omo/omo_17/DEF400.c | 2 +- src/world/area_osr/osr_03/osr_03_2_npc.c | 27 +- src/world/common/enemy/ai/FireBarAI.inc.c | 2 +- src/world/common/enemy/ai/KoopaPatrolAI.inc.c | 2 +- src/world/common/enemy/ai/TackleAI.inc.c | 10 +- src/world/common/enemy/complete/Clubba.h | 20 + .../common/enemy/complete/DryBones.inc.c | 2 +- src/world/common/enemy/complete/Goomba.inc.c | 10 + src/world/common/enemy/complete/GrooveGuy.h | 39 + .../common/enemy/complete/GrooveGuy.inc.c | 32 + .../common/enemy/complete/HammerBros.inc.c | 2 +- src/world/common/enemy/complete/Kammy.h | 22 + .../complete/MontyMole_StoneThrower.inc.c | 2 +- src/world/common/enemy/complete/Pokey.inc.c | 4 +- .../common/enemy/complete/PokeyMummy.inc.c | 4 +- src/world/common/enemy/complete/ShyGuy.h | 59 + .../common/enemy/complete/ShyGuy_Patrol.inc.c | 49 + .../common/enemy/complete/ShyGuy_Wander.inc.c | 34 + src/world/common/enemy/complete/SkyGuy.h | 36 + src/world/common/enemy/complete/SkyGuy.inc.c | 37 + .../common/todo/SetInstigatorValue_3.inc.c | 7 + src/world/common/todo/SetNpcB5_3.inc.c | 7 - src/world/world.c | 7 +- tools/disasm_script.py | 2 +- ver/us/asm/bss.s | 10 +- .../data/world/area_omo/omo_02/DA1CD0.data.s | 4 +- .../data/world/area_omo/omo_04/DAF320.data.s | 6 - .../data/world/area_omo/omo_04/DAF3E0.data.s | 162 -- .../data/world/area_omo/omo_05/DB46C0.data.s | 6 - .../data/world/area_omo/omo_05/DB4770.data.s | 75 - .../data/world/area_omo/omo_05/DB7410.data.s | 6 - .../data/world/area_omo/omo_07/DC05B0.data.s | 6 - .../data/world/area_omo/omo_07/DC0670.data.s | 9 - .../data/world/area_omo/omo_07/DC0910.data.s | 9 - .../data/world/area_omo/omo_07/DC0B80.data.s | 99 - .../data/world/area_omo/omo_07/DC30B0.data.s | 39 - .../data/world/area_omo/omo_07/DC3730.data.s | 6 - .../data/world/area_omo/omo_09/DD4150.data.s | 6 +- .../data/world/area_omo/omo_17/DF4EB0.data.s | 4 +- .../asm/nonmatchings/415D90/func_802A3C98.s | 88 +- .../asm/nonmatchings/415D90/func_802A5290.s | 12 +- .../omo_05/DB22C0/func_80242178_DB4438.s | 28 - ver/us/splat.yaml | 43 +- ver/us/symbol_addrs.txt | 213 +- 174 files changed, 6392 insertions(+), 4072 deletions(-) delete mode 100644 src/world/area_omo/omo_04/DAD400.c delete mode 100644 src/world/area_omo/omo_04/DAF240.c create mode 100644 src/world/area_omo/omo_04/omo_04_0_header.c create mode 100644 src/world/area_omo/omo_04/omo_04_1_music.c create mode 100644 src/world/area_omo/omo_04/omo_04_2_main.c create mode 100644 src/world/area_omo/omo_04/omo_04_3_gizmos.c create mode 100644 src/world/area_omo/omo_04/omo_04_4_entity.c create mode 100644 src/world/area_omo/omo_04/omo_04_5_npc.c create mode 100644 src/world/area_omo/omo_04/omo_04_6_scenes.c delete mode 100644 src/world/area_omo/omo_05/DB22C0.c create mode 100644 src/world/area_omo/omo_05/omo_05_0_header.c create mode 100644 src/world/area_omo/omo_05/omo_05_1_music.c create mode 100644 src/world/area_omo/omo_05/omo_05_2_main.c create mode 100644 src/world/area_omo/omo_05/omo_05_3_gizmos.c create mode 100644 src/world/area_omo/omo_05/omo_05_4_npc.c create mode 100644 src/world/area_omo/omo_05/omo_05_5_entity.c delete mode 100644 src/world/area_omo/omo_07/DBD2B0.c delete mode 100644 src/world/area_omo/omo_07/DC01D0.c delete mode 100644 src/world/area_omo/omo_07/DC04D0.c create mode 100644 src/world/area_omo/omo_07/omo_07_0_header.c create mode 100644 src/world/area_omo/omo_07/omo_07_1_music.c create mode 100644 src/world/area_omo/omo_07/omo_07_2_main.c create mode 100644 src/world/area_omo/omo_07/omo_07_3_gizmos.c create mode 100644 src/world/area_omo/omo_07/omo_07_4_npc.c create mode 100644 src/world/area_omo/omo_07/omo_07_5_entity.c create mode 100644 src/world/area_omo/omo_07/omo_07_6_scenes.c create mode 100644 src/world/common/enemy/complete/Goomba.inc.c create mode 100644 src/world/common/enemy/complete/GrooveGuy.h create mode 100644 src/world/common/enemy/complete/GrooveGuy.inc.c create mode 100644 src/world/common/enemy/complete/Kammy.h create mode 100644 src/world/common/enemy/complete/ShyGuy_Patrol.inc.c create mode 100644 src/world/common/enemy/complete/ShyGuy_Wander.inc.c create mode 100644 src/world/common/enemy/complete/SkyGuy.h create mode 100644 src/world/common/enemy/complete/SkyGuy.inc.c create mode 100644 src/world/common/todo/SetInstigatorValue_3.inc.c delete mode 100644 src/world/common/todo/SetNpcB5_3.inc.c delete mode 100644 ver/us/asm/data/world/area_omo/omo_04/DAF320.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_04/DAF3E0.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_05/DB46C0.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_05/DB4770.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_05/DB7410.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_07/DC05B0.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_07/DC0670.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_07/DC0910.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_07/DC0B80.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_07/DC30B0.data.s delete mode 100644 ver/us/asm/data/world/area_omo/omo_07/DC3730.data.s delete mode 100644 ver/us/asm/nonmatchings/world/area_omo/omo_05/DB22C0/func_80242178_DB4438.s diff --git a/include/common_structs.h b/include/common_structs.h index 3d4aece6ec..b2b5529c1b 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -850,13 +850,13 @@ typedef struct BattleStatus { /* 0x049 */ s8 unk_49; /* 0x04A */ s8 unk_4A; /* 0x04B */ s8 unk_4B; - /* 0x04C */ s8 unk_4C[16]; - /* 0x05C */ s8 unk_5C[16]; + /* 0x04C */ s8 lastPlayerMenuSelection[16]; + /* 0x05C */ s8 lastPartnerMenuSelection[16]; /* 0x06C */ s16 cancelTargetMenuSubstate; // might be more generally for returning from nested 'inner' state /* 0x06E */ s16 acceptTargetMenuSubstate; // might be more generally for returning from nested 'inner' state /* 0x070 */ s16 menuDisableFlags; /* 1 = jump, 2 = hammer, 4 = items */ /* 0x072 */ char unk_72[2]; - /* 0x074 */ s32 unk_74; + /* 0x074 */ s32 enabledStarPowersMask; // zero'd bits will be unavailable, used only for tutorial battles /* 0x078 */ s8 totalStarPoints; /* 0x079 */ s8 pendingStarPoints; /* how many to add */ /* 0x07A */ s8 incrementStarPointDelay; /* related to star points, set to 0x28 when they are dropped */ @@ -921,7 +921,7 @@ typedef struct BattleStatus { /* 0x174 */ struct Actor* currentTurnEnemy; /* 0x178 */ s8 moveCategory; ///< 0 = jump, 1 = hammer, 5 = partner, ... /* 0x179 */ char unk_179; - /* 0x17A */ s16 selectedItemID; + /* 0x17A */ s16 moveArgument; // argument provided for move; can be hammer/boots level, itemID, etc /* 0x17C */ s16 selectedMoveID; /* 0x17E */ s16 currentAttackDamage; /* 0x180 */ s16 lastAttackDamage; @@ -1889,7 +1889,7 @@ typedef struct Actor { /* 0x205 */ s8 unk_205; /* 0x206 */ s8 unk_206; /* 0x207 */ s8 extraCoinBonus; - /* 0x208 */ s8 unk_208; + /* 0x208 */ s8 instigatorValue; // from the enemy which initiated the encounter if this actor is first in the formation. allows that enemy to pass information to its actor. /* 0x209 */ char unk_209[3]; /* 0x20C */ s32* statusTable; /* 0x210 */ s8 debuff; @@ -1903,7 +1903,7 @@ typedef struct Actor { /* 0x218 */ s8 transparentStatus; /* 0E = yes */ /* 0x219 */ s8 transparentDuration; /* 0x21A */ char unk_21A[2]; - /* 0x21C */ s8 status; + /* 0x21C */ s8 statusAfflicted; /* 0x21D */ s8 disableDismissTimer; /* 0x21E */ s16 unk_21E; /* 0x220 */ s8 isGlowing; // charge amount for goombario diff --git a/include/dead_structs.h b/include/dead_structs.h index c39dd90692..ffd6d738c2 100644 --- a/include/dead_structs.h +++ b/include/dead_structs.h @@ -40,7 +40,7 @@ typedef struct DeadEnemy { /* 0x0AC */ s32 aiDetectFlags; /* 0x0B0 */ s32 aiFlags; /* 0x0B4 */ s8 aiPaused; - /* 0x0B5 */ s8 unk_B5; + /* 0x0B5 */ s8 instigatorValue; /* 0x0B6 */ char unk_B6[2]; /* 0x0B8 */ EvtScript* unk_B8; // some bytecode /* 0x0BC */ struct Evt* unk_BC; // some script diff --git a/include/enums.h b/include/enums.h index 7f0cb17f06..cf011c3e9c 100644 --- a/include/enums.h +++ b/include/enums.h @@ -2444,8 +2444,8 @@ enum MerleeSpellType { MERLEE_SPELL_0 = 0, MERLEE_SPELL_1 = 1, MERLEE_SPELL_2 = 2, - MERLEE_SPELL_3 = 3, - MERLEE_SPELL_4 = 4, // extra coins + MERLEE_SPELL_EXP_BOOST = 3, + MERLEE_SPELL_COIN_BOOST = 4, }; enum NpcDecorationIDs { @@ -2638,7 +2638,7 @@ enum Events { EVENT_RECOVER_STATUS = 0x00000031, EVENT_32 = 0x00000032, EVENT_33 = 0x00000033, - EVENT_RECOVER_PARTNER = 0x00000034, + EVENT_RECOVER_FROM_KO = 0x00000034, EVENT_END_FIRST_STRIKE = 0x00000035, EVENT_LUCKY = 0x00000037, EVENT_BEGIN_FIRST_STRIKE = 0x00000038, @@ -3459,6 +3459,8 @@ enum PopupType { POPUP_MENU_READ_POSTCARD = 0xB, POPUP_MENU_USEKEY = 0xC, POPUP_MENU_POST_OFFICE = 0xD, + POPUP_MENU_DOUBLE_DIP = 100, + POPUP_MENU_TRIPLE_DIP = 200, }; /// not really @@ -3683,17 +3685,17 @@ enum AnyEnemyAnims { }; enum FirstStrikes { - FIRST_STRIKE_NONE = 0x00000000, - FIRST_STRIKE_PLAYER = 0x00000001, - FIRST_STRIKE_ENEMY = 0x00000002, + FIRST_STRIKE_NONE = 0, + FIRST_STRIKE_PLAYER = 1, + FIRST_STRIKE_ENEMY = 2, }; enum TimeFreezeMode { - TIME_FREEZE_NORMAL = 0x00000000, - TIME_FREEZE_PARTIAL = 0x00000001, - TIME_FREEZE_FULL = 0x00000002, - TIME_FREEZE_PARTNER_MENU = 0x00000003, - TIME_FREEZE_EXIT = 0x00000004, + TIME_FREEZE_NORMAL = 0, + TIME_FREEZE_PARTIAL = 1, + TIME_FREEZE_FULL = 2, + TIME_FREEZE_POPUP_MENU = 3, + TIME_FREEZE_EXIT = 4, }; enum ActionCommand { @@ -3972,6 +3974,8 @@ enum MoveIDs { MOVE_FAN_SMACK = 0x000000B8, }; +#define STAR_POWER_INDEX(x) (x - MOVE_FOCUS) + enum GameModeIDs { GAME_MODE_STARTUP = 0x00000000, GAME_MODE_LOGOS = 0x00000001, @@ -4030,103 +4034,103 @@ enum IntroStates { }; enum BattleStatusFlags1 { - BS_FLAGS1_0 = 0x00000000, - BS_FLAGS1_ACTORS_VISIBLE = 0x00000001, // show actors - BS_FLAGS1_2 = 0x00000002, // menu is open - BS_FLAGS1_4 = 0x00000004, - BS_FLAGS1_8 = 0x00000008, - BS_FLAGS1_10 = 0x00000010, // enable attack bonuses (power plus, etc)? - BS_FLAGS1_SP_EVT_ACTIVE = 0x00000020, // enable special events (other than hit/death/immune?) - BS_FLAGS1_40 = 0x00000040, - BS_FLAGS1_80 = 0x00000080, - BS_FLAGS1_100 = 0x00000100, - BS_FLAGS1_200 = 0x00000200, - BS_FLAGS1_400 = 0x00000400, // UNUSED - BS_FLAGS1_FORCE_HIT_IMMUNE = 0x00000800, - BS_FLAGS1_AUTO_SUCCEED_ACTION = 0x00001000, - BS_FLAGS1_2000 = 0x00002000, - BS_FLAGS1_4000 = 0x00004000, - BS_FLAGS1_8000 = 0x00008000, - BS_FLAGS1_10000 = 0x00010000, - BS_FLAGS1_DISABLE_CELEBRATION = 0x00020000, - BS_FLAGS1_ENEMY_FLED = 0x00040000, - BS_FLAGS1_80000 = 0x00080000, // partner will act (partner turn?) - BS_FLAGS1_100000 = 0x00100000, // player in back (after pressing z) - BS_FLAGS1_200000 = 0x00200000, // enemy turn pending - BS_FLAGS1_PLAYER_DEFENDING = 0x00400000, // player is defending - BS_FLAGS1_NO_GAME_OVER = 0x00800000, // don’t game over on loss - BS_FLAGS1_STAR_POINTS_DROPPED = 0x01000000, - BS_FLAGS1_2000000 = 0x02000000, - BS_FLAGS1_HUSTLED = 0x04000000, - BS_FLAGS1_8000000 = 0x08000000, - BS_FLAGS1_HAMMER_CHARGED = 0x10000000, - BS_FLAGS1_JUMP_CHARGED = 0x20000000, - BS_FLAGS1_40000000 = 0x40000000, - BS_FLAGS1_ATK_BLOCKED = 0x80000000, + BS_FLAGS1_0 = 0x00000000, + BS_FLAGS1_ACTORS_VISIBLE = 0x00000001, + BS_FLAGS1_MENU_OPEN = 0x00000002, + BS_FLAGS1_4 = 0x00000004, + BS_FLAGS1_8 = 0x00000008, + BS_FLAGS1_10 = 0x00000010, // enable attack bonuses (power plus, etc)? + BS_FLAGS1_SP_EVT_ACTIVE = 0x00000020, // enable special events (other than hit/death/immune?) + BS_FLAGS1_40 = 0x00000040, + BS_FLAGS1_80 = 0x00000080, + BS_FLAGS1_100 = 0x00000100, + BS_FLAGS1_200 = 0x00000200, + BS_FLAGS1_400 = 0x00000400, // UNUSED + BS_FLAGS1_FORCE_HIT_IMMUNE = 0x00000800, + BS_FLAGS1_AUTO_SUCCEED_ACTION = 0x00001000, + BS_FLAGS1_2000 = 0x00002000, + BS_FLAGS1_4000 = 0x00004000, + BS_FLAGS1_8000 = 0x00008000, + BS_FLAGS1_10000 = 0x00010000, + BS_FLAGS1_DISABLE_CELEBRATION = 0x00020000, + BS_FLAGS1_BATTLE_FLED = 0x00040000, // used both when the player flees sucessfully or an enemy flees + BS_FLAGS1_PARTNER_ACTING = 0x00080000, + BS_FLAGS1_PLAYER_IN_BACK = 0x00100000, + BS_FLAGS1_200000 = 0x00200000, // enemy turn pending (?) + BS_FLAGS1_PLAYER_DEFENDING = 0x00400000, + BS_FLAGS1_NO_GAME_OVER = 0x00800000, // don’t game over on loss + BS_FLAGS1_STAR_POINTS_DROPPED = 0x01000000, + BS_FLAGS1_TUTORIAL_BATTLE = 0x02000000, // prevent player from swapping to/from partner + BS_FLAGS1_HUSTLED = 0x04000000, + BS_FLAGS1_SORT_ENEMIES_BY_POSX = 0x08000000, // enemy turn order ignores priority; sorts bases on x position instead + BS_FLAGS1_HAMMER_CHARGED = 0x10000000, + BS_FLAGS1_JUMP_CHARGED = 0x20000000, + BS_FLAGS1_40000000 = 0x40000000, + BS_FLAGS1_ATK_BLOCKED = 0x80000000, }; enum BattleStatusFlags2 { - BS_FLAGS2_1 = 0x00000001, - BS_FLAGS2_2 = 0x00000002, - BS_FLAGS2_4 = 0x00000004, - BS_FLAGS2_8 = 0x00000008, - BS_FLAGS2_10 = 0x00000010, - BS_FLAGS2_CANT_FLEE = 0x00000020, - BS_FLAGS2_PEACH_BATTLE = 0x00000040, - BS_FLAGS2_80 = 0x00000080, - BS_FLAGS2_100 = 0x00000100, // dont decrement turbo charge on begin player turn - BS_FLAGS2_200 = 0x00000200, - BS_FLAGS2_400 = 0x00000400, - BS_FLAGS2_800 = 0x00000800, - BS_FLAGS2_NO_TARGET_AVAILABLE = 0x00001000, - BS_FLAGS2_4000 = 0x00004000, - BS_FLAGS2_10000 = 0x00010000, - BS_FLAGS2_100000 = 0x00100000, - BS_FLAGS2_1000000 = 0x01000000, // possible IS_FIRST_STRIKE - BS_FLAGS2_DONT_STOP_MUSIC = 0x02000000, // don't stop playing the current song when the battle ends - BS_FLAGS2_HAS_DRAINED_HP = 0x04000000, - BS_FLAGS2_HAS_RUSH = 0x08000000, - BS_FLAGS2_DROP_WHACKA_BUMP = 0x10000000, + BS_FLAGS2_1 = 0x00000001, + BS_FLAGS2_2 = 0x00000002, + BS_FLAGS2_4 = 0x00000004, + BS_FLAGS2_8 = 0x00000008, + BS_FLAGS2_10 = 0x00000010, + BS_FLAGS2_CANT_FLEE = 0x00000020, + BS_FLAGS2_PEACH_BATTLE = 0x00000040, + BS_FLAGS2_80 = 0x00000080, + BS_FLAGS2_100 = 0x00000100, // dont decrement turbo charge on begin player turn + BS_FLAGS2_200 = 0x00000200, + BS_FLAGS2_400 = 0x00000400, + BS_FLAGS2_800 = 0x00000800, + BS_FLAGS2_NO_TARGET_AVAILABLE = 0x00001000, + BS_FLAGS2_4000 = 0x00004000, + BS_FLAGS2_10000 = 0x00010000, + BS_FLAGS2_100000 = 0x00100000, + BS_FLAGS2_1000000 = 0x01000000, // possible IS_FIRST_STRIKE + BS_FLAGS2_DONT_STOP_MUSIC = 0x02000000, // don't stop playing the current song when the battle ends + BS_FLAGS2_HAS_DRAINED_HP = 0x04000000, + BS_FLAGS2_HAS_RUSH = 0x08000000, + BS_FLAGS2_DROP_WHACKA_BUMP = 0x10000000, }; enum BattleStates { - BATTLE_STATE_NEGATIVE_1 = -1, - BATTLE_STATE_0 = 0, - BATTLE_STATE_NORMAL_START = 1, - BATTLE_STATE_FIRST_STRIKE = 2, - BATTLE_STATE_PARTNER_FIRST_STRIKE = 3, - BATTLE_STATE_ENEMY_FIRST_STRIKE = 4, - BATTLE_STATE_BEGIN_TURN = 5, - BATTLE_STATE_END_TURN = 6, - BATTLE_STATE_BEGIN_PLAYER_TURN = 7, - BATTLE_STATE_BEGIN_PARTNER_TURN = 8, - BATTLE_STATE_9 = 9, - BATTLE_STATE_SWITCH_TO_PLAYER = 10, - BATTLE_STATE_SWITCH_TO_PARTNER = 11, - BATTLE_STATE_PREPARE_MENU = 12, - BATTLE_STATE_PLAYER_MENU = 13, - BATTLE_STATE_PARTNER_MENU = 14, - BATTLE_STATE_PEACH_MENU = 15, - BATTLE_STATE_TWINK_MENU = 16, - BATTLE_STATE_SELECT_TARGET = 17, - BATTLE_STATE_PLAYER_MOVE = 18, - BATTLE_STATE_PARTNER_MOVE = 19, - BATTLE_STATE_NEXT_ENEMY = 20, - BATTLE_STATE_ENEMY_MOVE = 21, - BATTLE_STATE_END_PLAYER_TURN = 22, - BATTLE_STATE_END_PARTNER_TURN = 23, - BATTLE_STATE_RUN_AWAY = 24, - BATTLE_STATE_DEFEND = 25, - BATTLE_STATE_VICTORY = 26, - BATTLE_STATE_DEFEAT = 27, - BATTLE_STATE_28 = 28, - BATTLE_STATE_CHANGE_PARTNER = 29, - BATTLE_STATE_END_TRAINING_BATTLE = 30, - BATTLE_STATE_31 = 31, - BATTLE_STATE_END_BATTLE = 32, - BATTLE_STATE_CELEBRATION = 33, - BATTLE_STATE_34 = 34, - BATTLE_STATE_END_DEMO_BATTLE = 35, + BATTLE_STATE_NEGATIVE_1 = -1, + BATTLE_STATE_0 = 0, + BATTLE_STATE_NORMAL_START = 1, + BATTLE_STATE_FIRST_STRIKE = 2, + BATTLE_STATE_PARTNER_FIRST_STRIKE = 3, + BATTLE_STATE_ENEMY_FIRST_STRIKE = 4, + BATTLE_STATE_BEGIN_TURN = 5, + BATTLE_STATE_END_TURN = 6, + BATTLE_STATE_BEGIN_PLAYER_TURN = 7, + BATTLE_STATE_BEGIN_PARTNER_TURN = 8, + BATTLE_STATE_9 = 9, // can be reached from BATTLE_STATE_PARTNER_MOVE if partner == NULL + BATTLE_STATE_SWITCH_TO_PLAYER = 10, + BATTLE_STATE_SWITCH_TO_PARTNER = 11, + BATTLE_STATE_PREPARE_MENU = 12, + BATTLE_STATE_PLAYER_MENU = 13, + BATTLE_STATE_PARTNER_MENU = 14, + BATTLE_STATE_PEACH_MENU = 15, + BATTLE_STATE_TWINK_MENU = 16, + BATTLE_STATE_SELECT_TARGET = 17, + BATTLE_STATE_PLAYER_MOVE = 18, + BATTLE_STATE_PARTNER_MOVE = 19, + BATTLE_STATE_NEXT_ENEMY = 20, + BATTLE_STATE_ENEMY_MOVE = 21, + BATTLE_STATE_END_PLAYER_TURN = 22, + BATTLE_STATE_END_PARTNER_TURN = 23, + BATTLE_STATE_RUN_AWAY = 24, + BATTLE_STATE_DEFEND = 25, + BATTLE_STATE_VICTORY = 26, + BATTLE_STATE_DEFEAT = 27, + BATTLE_STATE_28 = 28, + BATTLE_STATE_CHANGE_PARTNER = 29, + BATTLE_STATE_END_TRAINING_BATTLE = 30, + BATTLE_STATE_31 = 31, + BATTLE_STATE_END_BATTLE = 32, + BATTLE_STATE_CELEBRATION = 33, + BATTLE_STATE_34 = 34, + BATTLE_STATE_END_DEMO_BATTLE = 35, }; enum BattleSubStates { @@ -4134,11 +4138,11 @@ enum BattleSubStates { BTL_SUBSTATE_INIT = 0, // BATTLE_STATE_NORMAL_START - BTL_SUBSTATE_NORMAL_START_UNK_0 = 0, - BTL_SUBSTATE_NORMAL_START_UNK_1 = 1, - BTL_SUBSTATE_NORMAL_START_UNK_4 = 4, - BTL_SUBSTATE_NORMAL_START_UNK_7 = 7, - BTL_SUBSTATE_NORMAL_START_UNK_8 = 8, + BTL_SUBSTATE_NORMAL_START_INIT = 0, // loads assets, initializes state, and runs OnBattleInit script + BTL_SUBSTATE_NORMAL_START_CREATE_ENEMIES = 1, + BTL_SUBSTATE_NORMAL_START_CHECK_FIRST_STRIKE = 4, // wait for actor scripts to finish + BTL_SUBSTATE_NORMAL_START_FADE_IN = 7, + BTL_SUBSTATE_NORMAL_START_DONE = 8, // BATTLE_STATE_FIRST_STRIKE BTL_SUBSTATE_FIRST_STRIKE_INIT = 0, @@ -4166,7 +4170,7 @@ enum BattleSubStates { BTL_SUBSTATE_END_TURN_CHECK_FOR_SWAP = 1, BTL_SUBSTATE_END_TURN_AWAIT_SCRIPTS = 2, BTL_SUBSTATE_END_TURN_BEGIN_NEXT = 3, - BTL_SUBSTATE_END_TURN_UNK_4 = 4, + BTL_SUBSTATE_END_TURN_UNUSED_4 = 4, BTL_SUBSTATE_END_TURN_PERFORM_SWAP = 11, BTL_SUBSTATE_END_TURN_START_SCRIPTS = 12, @@ -4203,319 +4207,318 @@ enum BattleSubStates { BTL_SUBSTATE_9_6 = 6, BTL_SUBSTATE_9_7 = 7, - // BATTLE_STATE_9 // BATTLE_STATE_SWITCH_TO_PLAYER // BATTLE_STATE_SWITCH_TO_PARTNER // BATTLE_STATE_PREPARE_MENU - BATTLE_SUBSTATE_PREPARE_MENU_UNK_70 = 70, + BATTLE_SUBSTATE_PREPARE_MENU_DIPPING = 70, // BATTLE_STATE_PLAYER_MENU // BATTLE_STATE_PARTNER_MENU // BATTLE_STATE_PEACH_MENU - BTL_SUBSTATE_PEACH_MENU_UNK_0 = 0, - BTL_SUBSTATE_PEACH_MENU_UNK_1 = 1, - BTL_SUBSTATE_PEACH_MENU_UNK_2 = 2, - BTL_SUBSTATE_PEACH_MENU_UNK_3 = 3, - BTL_SUBSTATE_PEACH_MENU_UNK_4 = 4, - BTL_SUBSTATE_PEACH_MENU_UNK_5 = 5, - BTL_SUBSTATE_PEACH_MENU_UNK_6 = 6, - BTL_SUBSTATE_PEACH_MENU_UNK_7 = 7, - BTL_SUBSTATE_PEACH_MENU_UNK_8 = 8, - BTL_SUBSTATE_PEACH_MENU_UNK_9 = 9, - BTL_SUBSTATE_PEACH_MENU_UNK_A = 10, - BTL_SUBSTATE_PEACH_MENU_UNK_B = 11, + BTL_SUBSTATE_PEACH_MENU_INIT = 0, + BTL_SUBSTATE_PEACH_MENU_CHOOSE_CATEGORY = 1, + BTL_SUBSTATE_PEACH_MENU_CHOOSE_TARGET = 2, + BTL_SUBSTATE_PEACH_MENU_UNUSED_3 = 3, + BTL_SUBSTATE_PEACH_MENU_TARGET_CANCEL = 4, + BTL_SUBSTATE_PEACH_MENU_TARGET_CHOSEN = 5, + BTL_SUBSTATE_PEACH_MENU_UNUSED_6 = 6, + BTL_SUBSTATE_PEACH_MENU_UNUSED_7 = 7, + BTL_SUBSTATE_PEACH_MENU_SHOW_CANT_SWITCH = 8, + BTL_SUBSTATE_PEACH_MENU_AWAIT_CANT_SWITCH_POPUP = 9, + BTL_SUBSTATE_PEACH_MENU_PERFORM_SWAP = 10, + BTL_SUBSTATE_PEACH_CREATE_MAIN_MENU = 11, // BATTLE_STATE_TWINK_MENU - BTL_SUBSTATE_TWINK_MENU_INIT = 0, - BTL_SUBSTATE_TWINK_MENU_UNK_1 = 1, - BTL_SUBSTATE_TWINK_MENU_UNK_2 = 2, - BTL_SUBSTATE_TWINK_MENU_UNK_3 = 3, - BTL_SUBSTATE_TWINK_MENU_UNK_4 = 4, - BTL_SUBSTATE_TWINK_MENU_UNK_5 = 5, - BTL_SUBSTATE_TWINK_MENU_UNK_6 = 6, - BTL_SUBSTATE_TWINK_MENU_UNK_7 = 7, - BTL_SUBSTATE_TWINK_MENU_SHOW_CANT_SWITCH = 8, - BTL_SUBSTATE_TWINK_MENU_AWAIT_CANT_SWITCH_POPUP = 9, - BTL_SUBSTATE_TWINK_MENU_PERFORM_SWAP = 10, - BTL_SUBSTATE_TWINK_MENU_UNK_B = 11, + BTL_SUBSTATE_TWINK_MENU_INIT = 0, + BTL_SUBSTATE_TWINK_MENU_CHOOSE_CATEGORY = 1, + BTL_SUBSTATE_TWINK_MENU_CHOOSE_TARGET = 2, + BTL_SUBSTATE_TWINK_MENU_UNUSED_3 = 3, + BTL_SUBSTATE_TWINK_MENU_TARGET_CANCEL = 4, + BTL_SUBSTATE_TWINK_MENU_TARGET_CHOSEN = 5, + BTL_SUBSTATE_TWINK_MENU_UNUSED_6 = 6, + BTL_SUBSTATE_TWINK_MENU_UNUSED_7 = 7, + BTL_SUBSTATE_TWINK_MENU_SHOW_CANT_SWITCH = 8, + BTL_SUBSTATE_TWINK_MENU_AWAIT_CANT_SWITCH_POPUP = 9, + BTL_SUBSTATE_TWINK_MENU_PERFORM_SWAP = 10, + BTL_SUBSTATE_TWINK_MENU_CREATE_MAIN_MENU = 11, // BATTLE_STATE_SELECT_TARGET - BTL_SUBSTATE_SELECT_TARGET_INIT = 0, - BTL_SUBSTATE_SELECT_TARGET_CHOOSE = 1, - BTL_SUBSTATE_SELECT_TARGET_DONE = 2, - BTL_SUBSTATE_SELECT_TARGET_CANCEL = 10, + BTL_SUBSTATE_SELECT_TARGET_INIT = 0, + BTL_SUBSTATE_SELECT_TARGET_CHOOSE = 1, + BTL_SUBSTATE_SELECT_TARGET_DONE = 2, + BTL_SUBSTATE_SELECT_TARGET_CANCEL = 10, // BATTLE_STATE_PLAYER_MOVE - BTL_SUBSTATE_PLAYER_MOVE_INIT = 0, - BTL_SUBSTATE_PLAYER_MOVE_BEGIN_SHOW_TIP = 1, - BTL_SUBSTATE_PLAYER_MOVE_SHOW_TIP_DELAY = 2, - BTL_SUBSTATE_PLAYER_MOVE_EXECUTE_MOVE = 3, - BTL_SUBSTATE_PLAYER_MOVE_HANDLE_RESULTS = 4, - BTL_SUBSTATE_PLAYER_MOVE_AWAIT_ENEMY_STATUS_POPUP = 11, - BTL_SUBSTATE_PLAYER_MOVE_POST_ENEMY_STATUS_POPUP = 12, - BTL_SUBSTATE_PLAYER_MOVE_CHECK_PLAYER_STATUS = 20, - BTL_SUBSTATE_PLAYER_MOVE_AWAIT_PLAYER_STATUS_POPUP = 21, - BTL_SUBSTATE_PLAYER_MOVE_POST_PLAYER_STATUS_POPUP = 22, - BTL_SUBSTATE_PLAYER_MOVE_AWAIT_DONE = 30, + BTL_SUBSTATE_PLAYER_MOVE_INIT = 0, + BTL_SUBSTATE_PLAYER_MOVE_BEGIN_SHOW_TIP = 1, + BTL_SUBSTATE_PLAYER_MOVE_SHOW_TIP_DELAY = 2, + BTL_SUBSTATE_PLAYER_MOVE_EXECUTE_MOVE = 3, + BTL_SUBSTATE_PLAYER_MOVE_HANDLE_RESULTS = 4, + BTL_SUBSTATE_PLAYER_MOVE_AWAIT_ENEMY_STATUS_POPUP = 11, + BTL_SUBSTATE_PLAYER_MOVE_POST_ENEMY_STATUS_POPUP = 12, + BTL_SUBSTATE_PLAYER_MOVE_CHECK_PLAYER_STATUS = 20, + BTL_SUBSTATE_PLAYER_MOVE_AWAIT_PLAYER_STATUS_POPUP = 21, + BTL_SUBSTATE_PLAYER_MOVE_POST_PLAYER_STATUS_POPUP = 22, + BTL_SUBSTATE_PLAYER_MOVE_AWAIT_DONE = 30, // BATTLE_STATE_PARTNER_MOVE - BTL_SUBSTATE_PARTNER_MOVE_UNK_0 = 0, - BTL_SUBSTATE_PARTNER_MOVE_UNK_2 = 2, - BTL_SUBSTATE_PARTNER_MOVE_UNK_3 = 3, - BTL_SUBSTATE_PARTNER_MOVE_UNK_B = 11, - BTL_SUBSTATE_PARTNER_MOVE_UNK_C = 12, - BTL_SUBSTATE_PARTNER_MOVE_UNK_14 = 20, - BTL_SUBSTATE_PARTNER_MOVE_UNK_15 = 21, - BTL_SUBSTATE_PARTNER_MOVE_UNK_16 = 22, - BTL_SUBSTATE_PARTNER_MOVE_UNK_1E = 30, + BTL_SUBSTATE_PARTNER_MOVE_INIT = 0, + BTL_SUBSTATE_PARTNER_MOVE_EXECUTE_MOVE = 2, + BTL_SUBSTATE_PARTNER_MOVE_HANDLE_RESULTS = 3, + BTL_SUBSTATE_PARTNER_MOVE_AWAIT_PARTNER_STATUS_POPUP = 11, + BTL_SUBSTATE_PARTNER_MOVE_POST_PARTNER_STATUS_POPUP = 12, + BTL_SUBSTATE_PARTNER_MOVE_CHECK_ENEMY_STATUS = 20, + BTL_SUBSTATE_PARTNER_MOVE_AWAIT_ENEMY_STATUS_POPUP = 21, + BTL_SUBSTATE_PARTNER_MOVE_POST_ENEMY_STATUS_POPUP = 22, + BTL_SUBSTATE_PARTNER_MOVE_DONE = 30, // BATTLE_STATE_NEXT_ENEMY - BTL_SUBSTATE_NEXT_ENEMY_INIT = 0, - BTL_SUBSTATE_NEXT_ENEMY_UNK_1 = 1, - BTL_SUBSTATE_NEXT_ENEMY_DONE = 2, // enemy has been found + BTL_SUBSTATE_NEXT_ENEMY_INIT = 0, + BTL_SUBSTATE_NEXT_ENEMY_UNUSED_1 = 1, + BTL_SUBSTATE_NEXT_ENEMY_DONE = 2, // enemy has been found // BATTLE_STATE_ENEMY_MOVE - BTL_SUBSTATE_ENEMY_MOVE_EXECUTE = 0, - BTL_SUBSTATE_ENEMY_MOVE_UNK_1 = 1, - BTL_SUBSTATE_ENEMY_MOVE_AWAIT_SCRIPTS = 2, - BTL_SUBSTATE_ENEMY_MOVE_AWAIT_PLAYER_POPUP_DONE = 11, // wait for popups regarding player status to finish - BTL_SUBSTATE_ENEMY_MOVE_POST_PLAYER_POPUP_DELAY = 12, // a brief delay after the popup vanishes - BTL_SUBSTATE_ENEMY_MOVE_CHECK_PARTNER = 20, - BTL_SUBSTATE_ENEMY_MOVE_AWAIT_PARTNER_POPUP_DONE = 21, // wait for popups regarding partner status to finish - BTL_SUBSTATE_ENEMY_MOVE_POST_PARTNER_POPUP_DELAY = 22, // a brief delay after the popup vanishes - BTL_SUBSTATE_ENEMY_MOVE_DONE = 30, + BTL_SUBSTATE_ENEMY_MOVE_EXECUTE = 0, + BTL_SUBSTATE_ENEMY_MOVE_UNUSED_1 = 1, + BTL_SUBSTATE_ENEMY_MOVE_AWAIT_SCRIPTS = 2, + BTL_SUBSTATE_ENEMY_MOVE_AWAIT_PLAYER_POPUP_DONE = 11, // wait for popups regarding player status to finish + BTL_SUBSTATE_ENEMY_MOVE_POST_PLAYER_POPUP_DELAY = 12, // a brief delay after the popup vanishes + BTL_SUBSTATE_ENEMY_MOVE_CHECK_PARTNER = 20, + BTL_SUBSTATE_ENEMY_MOVE_AWAIT_PARTNER_POPUP_DONE = 21, // wait for popups regarding partner status to finish + BTL_SUBSTATE_ENEMY_MOVE_POST_PARTNER_POPUP_DELAY = 22, // a brief delay after the popup vanishes + BTL_SUBSTATE_ENEMY_MOVE_DONE = 30, // BATTLE_STATE_END_PLAYER_TURN - BTL_SUBSTATE_END_PLAYER_TURN_UNK_0 = 0, - BTL_SUBSTATE_END_PLAYER_TURN_UNK_5 = 5, - BTL_SUBSTATE_END_PLAYER_TURN_UNK_6 = 6, - BTL_SUBSTATE_END_PLAYER_TURN_UNK_A = 10, + BTL_SUBSTATE_END_PLAYER_TURN_CHECK_HAPPY = 0, + BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY = 5, + BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_SWAP = 6, + BTL_SUBSTATE_END_PLAYER_TURN_DONE = 10, // BATTLE_STATE_END_PARTNER_TURN // BATTLE_STATE_RUN_AWAY - BTL_SUBSTATE_RUN_AWAY_UNK_0 = 0, - BTL_SUBSTATE_RUN_AWAY_UNK_2 = 2, - BTL_SUBSTATE_RUN_AWAY_UNK_3 = 3, - BTL_SUBSTATE_RUN_AWAY_UNK_4 = 4, - BTL_SUBSTATE_RUN_AWAY_UNK_A = 10, - BTL_SUBSTATE_RUN_AWAY_UNK_B = 11, + BTL_SUBSTATE_RUN_AWAY_EXEC_SCRIPT = 0, + BTL_SUBSTATE_RUN_AWAY_AWAIT_SCRIPT = 2, + BTL_SUBSTATE_RUN_AWAY_EXEC_POST_FAILURE = 3, + BTL_SUBSTATE_RUN_AWAY_AWAIT_POST_FAILURE = 4, + BTL_SUBSTATE_RUN_AWAY_GIVE_STAR_POINTS = 10, + BTL_SUBSTATE_RUN_AWAY_DONE = 11, // BATTLE_STATE_DEFEND - BTL_SUBSTATE_DEFEND_INIT = 0, - BTL_SUBSTATE_DEFEND_AWAIT_SCRIPT = 1, + BTL_SUBSTATE_DEFEND_INIT = 0, + BTL_SUBSTATE_DEFEND_AWAIT_SCRIPT = 1, // BATTLE_STATE_VICTORY - BTL_SUBSTATE_VICTORY_UNK_0 = 0, - BTL_SUBSTATE_VICTORY_UNK_1 = 1, - BTL_SUBSTATE_VICTORY_UNK_2 = 2, - BTL_SUBSTATE_VICTORY_UNK_3 = 3, - BTL_SUBSTATE_VICTORY_UNK_4 = 4, - BTL_SUBSTATE_VICTORY_UNK_5 = 5, - BTL_SUBSTATE_VICTORY_UNK_A = 10, - BTL_SUBSTATE_VICTORY_UNK_B = 11, - BTL_SUBSTATE_VICTORY_UNK_C = 12, + BTL_SUBSTATE_VICTORY_CHECK_OUTTA_SIGHT = 0, + BTL_SUBSTATE_VICTORY_AWAIT_OUTTA_SIGHT = 1, + BTL_SUBSTATE_VICTORY_CHECK_MERLEE = 2, + BTL_SUBSTATE_VICTORY_AWAIT_MERLEE = 3, + BTL_SUBSTATE_VICTORY_DONE = 4, + BTL_SUBSTATE_VICTORY_RECOVER_STATUS = 5, + BTL_SUBSTATE_VICTORY_AWAIT_RECOVER_KO = 10, + BTL_SUBSTATE_VICTORY_CHECK_SWAP = 11, + BTL_SUBSTATE_VICTORY_AWAIT_SWAP = 12, // BATTLE_STATE_DEFEAT - BTL_SUBSTATE_DEFEAT_UNK_0 = 0, - BTL_SUBSTATE_DEFEAT_UNK_1 = 1, - BTL_SUBSTATE_DEFEAT_UNK_2 = 2, - BTL_SUBSTATE_DEFEAT_UNK_A = 10, + BTL_SUBSTATE_DEFEAT_INIT = 0, + BTL_SUBSTATE_DEFEAT_CHECK_LIFE_SHROOM = 1, + BTL_SUBSTATE_DEFEAT_AWAIT_LIFE_SHROOM = 2, + BTL_SUBSTATE_DEFEAT_DONE = 10, // BATTLE_STATE_28 // BATTLE_STATE_CHANGE_PARTNER - BTL_SUBSTATE_CHANGE_PARTNER_UNK_0 = 0, - BTL_SUBSTATE_CHANGE_PARTNER_UNK_2 = 2, - BTL_SUBSTATE_CHANGE_PARTNER_UNK_3 = 3, - BTL_SUBSTATE_CHANGE_PARTNER_UNK_4 = 4, - BTL_SUBSTATE_CHANGE_PARTNER_UNK_5 = 5, - BTL_SUBSTATE_CHANGE_PARTNER_UNK_6 = 6, - BTL_SUBSTATE_CHANGE_PARTNER_UNK_7 = 7, - + BTL_SUBSTATE_CHANGE_PARTNER_INIT = 0, + BTL_SUBSTATE_CHANGE_PARTNER_EXEC_PUT_AWAY = 2, + BTL_SUBSTATE_CHANGE_PARTNER_LOAD_NEW_PARTNER = 3, + BTL_SUBSTATE_CHANGE_PARTNER_EXEC_BRING_OUT = 4, + BTL_SUBSTATE_CHANGE_PARTNER_EXEC_PHASE = 5, + BTL_SUBSTATE_CHANGE_PARTNER_AWAIT_PHASE = 6, + BTL_SUBSTATE_CHANGE_PARTNER_DONE = 7, + // BATTLE_STATE_END_TRAINING_BATTLE - BTL_SUBSTATE_END_TRAINING_UNK_0 = 0, - BTL_SUBSTATE_END_TRAINING_UNK_A = 10, - BTL_SUBSTATE_END_TRAINING_UNK_B = 11, - BTL_SUBSTATE_END_TRAINING_UNK_C = 12, - BTL_SUBSTATE_END_TRAINING_UNK_D = 13, - BTL_SUBSTATE_END_TRAINING_UNK_E = 14, + BTL_SUBSTATE_END_TRAINING_INIT = 0, + BTL_SUBSTATE_END_TRAINING_AWAIT_RECOVERING = 10, + BTL_SUBSTATE_END_TRAINING_CHECK_OUTTA_SIGHT = 11, + BTL_SUBSTATE_END_TRAINING_AWAIT_OUTTA_SIGHT = 12, + BTL_SUBSTATE_END_TRAINING_RESET_CAM = 13, + BTL_SUBSTATE_END_TRAINING_DONE = 14, // BATTLE_STATE_31 - // BATTLE_STATE_END_BATTLE (TODO) - BTL_SUBSTATE_END_BATTLE_UNK_0 = 0, - BTL_SUBSTATE_END_BATTLE_UNK_1 = 1, - BTL_SUBSTATE_END_BATTLE_UNK_2 = 2, - BTL_SUBSTATE_END_BATTLE_AWAIT_STAGE_SCRIPT = 3, - BTL_SUBSTATE_END_BATTLE_CLEANUP = 4, + // BATTLE_STATE_END_BATTLE + BTL_SUBSTATE_END_BATTLE_INIT = 0, + BTL_SUBSTATE_END_BATTLE_FADE_OUT = 1, + BTL_SUBSTATE_END_BATTLE_EXEC_STAGE_SCRIPT = 2, + BTL_SUBSTATE_END_BATTLE_AWAIT_STAGE_SCRIPT = 3, + BTL_SUBSTATE_END_BATTLE_CLEANUP = 4, // BATTLE_STATE_CELEBRATION - BTL_SUBSTATE_CELEBRATE_INIT = 0, - BTL_SUBSTATE_CELEBRATE_LOAD_STAR_POINTS = 1, - BTL_SUBSTATE_CELEBRATE_TALLY_STAR_POINTS = 2, - BTL_SUBSTATE_CELEBRATE_POST_STAR_POINTS = 3, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_LOAD = 4, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_BEGIN = 5, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CREATE_HUD = 6, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_SHOW_HUD = 7, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CHOOSE = 8, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_UPGRADE = 9, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_FADE_OUT = 10, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_DESTROY_HUD = 11, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID = 15, - BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID_DELAY = 16, - BTL_SUBSTATE_CELEBRATE_SKIPPABLE_END_DELAY = 20, - BTL_SUBSTATE_CELEBRATE_WALK_AWAY = 21, - BTL_SUBSTATE_CELEBRATE_DONE = 22, + BTL_SUBSTATE_CELEBRATE_INIT = 0, + BTL_SUBSTATE_CELEBRATE_LOAD_STAR_POINTS = 1, + BTL_SUBSTATE_CELEBRATE_TALLY_STAR_POINTS = 2, + BTL_SUBSTATE_CELEBRATE_POST_STAR_POINTS = 3, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_LOAD = 4, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_BEGIN = 5, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CREATE_HUD = 6, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_SHOW_HUD = 7, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CHOOSE = 8, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_UPGRADE = 9, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_FADE_OUT = 10, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_DESTROY_HUD = 11, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID = 15, + BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID_DELAY = 16, + BTL_SUBSTATE_CELEBRATE_SKIPPABLE_END_DELAY = 20, + BTL_SUBSTATE_CELEBRATE_WALK_AWAY = 21, + BTL_SUBSTATE_CELEBRATE_DONE = 22, // BATTLE_STATE_34 // BATTLE_STATE_END_DEMO_BATTLE - BTL_SUBSTATE_END_DEMO_BATTLE_UNK_0 = 0, - BTL_SUBSTATE_END_DEMO_BATTLE_UNK_1 = 1, - BTL_SUBSTATE_END_DEMO_BATTLE_UNK_2 = 2, - BTL_SUBSTATE_END_DEMO_BATTLE_UNK_3 = 3, - BTL_SUBSTATE_END_DEMO_BATTLE_UNK_4 = 4, + BTL_SUBSTATE_END_DEMO_BATTLE_INIT = 0, + BTL_SUBSTATE_END_DEMO_BATTLE_FADE_OUT = 1, + BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT = 2, + BTL_SUBSTATE_END_DEMO_BATTLE_AWAIT_STAGE_SCRIPT = 3, + BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP = 4, }; // used with BATTLE_STATE_PLAYER_MENU enum BattlePlayerMenuSubstates { - BTL_SUBSTATE_PLAYER_MENU_NONE = 0, + BTL_SUBSTATE_PLAYER_MENU_INIT = 0, // Main menu - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1 = 1, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_2 = 2, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_3 = 3, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_4 = 4, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_5 = 5, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_6 = 6, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_7 = 7, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_8 = 8, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_9 = 9, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_10 = 10, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_11 = 11, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_12 = 12, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_13 = 13, - BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_14 = 14, + BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY = 1, + BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_2 = 2, + BTL_SUBSTATE_PLAYER_MENU_MOVE_CHOOSE_TARGET = 3, + BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_4 = 4, + BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CANCEL = 5, + BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CHOSEN = 6, + BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_7 = 7, + BTL_SUBSTATE_PLAYER_MENU_MAIN_SHOW_CANT_SWAP = 8, + BTL_SUBSTATE_PLAYER_MENU_MAIN_AWAIT_CANT_SWAP = 9, + BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_10 = 10, + BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_11 = 11, + BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_12 = 12, + BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_13 = 13, + BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_14 = 14, // Unknown - BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_1 = 20, - BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_2 = 21, - BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_3 = 22, - BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_4 = 23, - BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_5 = 24, - BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_6 = 25, + BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_1 = 20, + BTL_SUBSTATE_PLAYER_MENU_DIPPING_CHOOSE_TARGET = 21, + BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_3 = 22, + BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_4 = 23, + BTL_SUBSTATE_PLAYER_MENU_DIPPING_TARGET_CANCEL = 24, + BTL_SUBSTATE_PLAYER_MENU_DIPPING_TARGET_CHOSEN = 25, // Change Member - BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_1 = 30, - BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_2 = 31, - BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_3 = 32, - BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_4 = 33, - BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_5 = 34, - BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_6 = 35, - BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_7 = 36, + BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_1 = 30, + BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_2 = 31, + BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_3 = 32, + BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_4 = 33, + BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_5 = 34, + BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_6 = 35, + BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_7 = 36, // Items - BTL_SUBSTATE_PLAYER_MENU_ITEMS_1 = 40, - BTL_SUBSTATE_PLAYER_MENU_ITEMS_2 = 41, - BTL_SUBSTATE_PLAYER_MENU_ITEMS_3 = 42, - BTL_SUBSTATE_PLAYER_MENU_ITEMS_4 = 43, - BTL_SUBSTATE_PLAYER_MENU_ITEMS_5 = 44, - BTL_SUBSTATE_PLAYER_MENU_ITEMS_6 = 45, + BTL_SUBSTATE_PLAYER_MENU_ITEMS_1 = 40, + BTL_SUBSTATE_PLAYER_MENU_ITEMS_2 = 41, + BTL_SUBSTATE_PLAYER_MENU_ITEMS_3 = 42, + BTL_SUBSTATE_PLAYER_MENU_ITEMS_4 = 43, + BTL_SUBSTATE_PLAYER_MENU_ITEMS_5 = 44, + BTL_SUBSTATE_PLAYER_MENU_ITEMS_6 = 45, // Star Spirits - BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_1 = 60, - BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_2 = 61, - BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_3 = 62, - BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_4 = 63, - BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_5 = 64, - BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_6 = 65, - BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_7 = 66, - // Unused - BTL_SUBSTATE_PLAYER_MENU_UNUSED_1 = 70, - BTL_SUBSTATE_PLAYER_MENU_UNUSED_2 = 71, - BTL_SUBSTATE_PLAYER_MENU_UNUSED_3 = 72, - BTL_SUBSTATE_PLAYER_MENU_UNUSED_4 = 73, - BTL_SUBSTATE_PLAYER_MENU_UNUSED_5 = 74, - BTL_SUBSTATE_PLAYER_MENU_UNUSED_6 = 75, + BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_1 = 60, + BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_2 = 61, + BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_3 = 62, + BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_4 = 63, + BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_5 = 64, + BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_6 = 65, + BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_7 = 66, + // additional item use from Double/Triple dip + BTL_SUBSTATE_PLAYER_MENU_DIPPING_1 = 70, + BTL_SUBSTATE_PLAYER_MENU_DIPPING_2 = 71, + BTL_SUBSTATE_PLAYER_MENU_DIPPING_3 = 72, + BTL_SUBSTATE_PLAYER_MENU_DIPPING_4 = 73, + BTL_SUBSTATE_PLAYER_MENU_DIPPING_5 = 74, + BTL_SUBSTATE_PLAYER_MENU_DIPPING_6 = 75, // Berserker - BTL_SUBSTATE_PLAYER_MENU_BERSERKER_1 = 100, + BTL_SUBSTATE_PLAYER_MENU_BERSERKER_1 = 100, // Strategies - BTL_SUBSTATE_PLAYER_MENU_BUILD_STRATEGIES = 200, - BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_2 = 201, - BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_3 = 202, - BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_4 = 203, - BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_5 = 204, - BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6 = 205, - BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_8 = 207, + BTL_SUBSTATE_PLAYER_MENU_BUILD_STRATEGIES = 200, + BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_2 = 201, + BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_3 = 202, + BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_4 = 203, + BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_5 = 204, + BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6 = 205, + BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_8 = 207, // initialize - BTL_SUBSTATE_PLAYER_MENU_INIT_12C = 300, - BTL_SUBSTATE_PLAYER_MENU_INIT_MENU = 302, + BTL_SUBSTATE_PLAYER_MENU_PERFORM_SWAP = 300, + BTL_SUBSTATE_PLAYER_MENU_CREATE_MAIN_MENU = 302, }; enum BattlePartnerMenuSubstates { - BTL_SUBSTATE_PARTNER_MENU_NONE = 0, + BTL_SUBSTATE_PARTNER_MENU_NONE = 0, // Main menu - BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1 = 2, - BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_2 = 3, - BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_3 = 4, - BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_4 = 5, - BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_5 = 6, - BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_6 = 7, - BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_7 = 8, - BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_8 = 9, + BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1 = 2, + BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_2 = 3, + BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_3 = 4, + BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_4 = 5, + BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_5 = 6, + BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_6 = 7, + BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_7 = 8, + BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_8 = 9, // Abilities - BTL_SUBSTATE_PARTNER_MENU_ABILITIES_1 = 10, - BTL_SUBSTATE_PARTNER_MENU_ABILITIES_2 = 11, - BTL_SUBSTATE_PARTNER_MENU_ABILITIES_3 = 12, - BTL_SUBSTATE_PARTNER_MENU_ABILITIES_4 = 13, - BTL_SUBSTATE_PARTNER_MENU_ABILITIES_5 = 14, - BTL_SUBSTATE_PARTNER_MENU_ABILITIES_6 = 15, - BTL_SUBSTATE_PARTNER_MENU_ABILITIES_7 = 16, + BTL_SUBSTATE_PARTNER_MENU_ABILITIES_1 = 10, + BTL_SUBSTATE_PARTNER_MENU_ABILITIES_2 = 11, + BTL_SUBSTATE_PARTNER_MENU_ABILITIES_3 = 12, + BTL_SUBSTATE_PARTNER_MENU_ABILITIES_4 = 13, + BTL_SUBSTATE_PARTNER_MENU_ABILITIES_5 = 14, + BTL_SUBSTATE_PARTNER_MENU_ABILITIES_6 = 15, + BTL_SUBSTATE_PARTNER_MENU_ABILITIES_7 = 16, // Unknown, referenced only in btl_state_draw_partner_menu - BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_1 = 20, - BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_2 = 21, - BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_3 = 22, - BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_4 = 23, - BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_5 = 24, + BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_1 = 20, + BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_2 = 21, + BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_3 = 22, + BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_4 = 23, + BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_5 = 24, // Change Partner - BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_1 = 30, - BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_2 = 31, - BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_3 = 32, - BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_4 = 33, - BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_5 = 34, - BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_6 = 35, - BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_7 = 36, + BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_1 = 30, + BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_2 = 31, + BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_3 = 32, + BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_4 = 33, + BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_5 = 34, + BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_6 = 35, + BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_7 = 36, // Items - BTL_SUBSTATE_PARTNER_MENU_ITEMS_1 = 40, - BTL_SUBSTATE_PARTNER_MENU_ITEMS_2 = 41, - BTL_SUBSTATE_PARTNER_MENU_ITEMS_3 = 42, - BTL_SUBSTATE_PARTNER_MENU_ITEMS_4 = 43, - BTL_SUBSTATE_PARTNER_MENU_ITEMS_5 = 44, - BTL_SUBSTATE_PARTNER_MENU_ITEMS_6 = 45, + BTL_SUBSTATE_PARTNER_MENU_ITEMS_1 = 40, + BTL_SUBSTATE_PARTNER_MENU_ITEMS_2 = 41, + BTL_SUBSTATE_PARTNER_MENU_ITEMS_3 = 42, + BTL_SUBSTATE_PARTNER_MENU_ITEMS_4 = 43, + BTL_SUBSTATE_PARTNER_MENU_ITEMS_5 = 44, + BTL_SUBSTATE_PARTNER_MENU_ITEMS_6 = 45, // Switch partner (unused) - BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_1 = 50, - BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_2 = 51, - BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_3 = 52, - BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_4 = 53, - BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_5 = 54, - BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_6 = 55, - BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_7 = 56, + BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_1 = 50, + BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_2 = 51, + BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_3 = 52, + BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_4 = 53, + BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_5 = 54, + BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_6 = 55, + BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_7 = 56, // Focus - BTL_SUBSTATE_PARTNER_MENU_FOCUS_1 = 60, - BTL_SUBSTATE_PARTNER_MENU_FOCUS_2 = 61, - BTL_SUBSTATE_PARTNER_MENU_FOCUS_3 = 62, - BTL_SUBSTATE_PARTNER_MENU_FOCUS_4 = 63, - BTL_SUBSTATE_PARTNER_MENU_FOCUS_5 = 64, - BTL_SUBSTATE_PARTNER_MENU_FOCUS_6 = 65, + BTL_SUBSTATE_PARTNER_MENU_FOCUS_1 = 60, + BTL_SUBSTATE_PARTNER_MENU_FOCUS_2 = 61, + BTL_SUBSTATE_PARTNER_MENU_FOCUS_3 = 62, + BTL_SUBSTATE_PARTNER_MENU_FOCUS_4 = 63, + BTL_SUBSTATE_PARTNER_MENU_FOCUS_5 = 64, + BTL_SUBSTATE_PARTNER_MENU_FOCUS_6 = 65, // Strategies - BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_1 = 200, - BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_2 = 201, - BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_3 = 202, - BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_4 = 203, - BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_5 = 204, - BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_6 = 205, + BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_1 = 200, + BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_2 = 201, + BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_3 = 202, + BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_4 = 203, + BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_5 = 204, + BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_6 = 205, // initialize - BTL_SUBSTATE_PARTNER_MENU_12D = 301, - BTL_SUBSTATE_PARTNER_MENU_INIT_MENU = 302, + BTL_SUBSTATE_PARTNER_MENU_12D = 301, + BTL_SUBSTATE_PARTNER_MENU_INIT_MENU = 302, }; enum BattleMessages { @@ -4606,20 +4609,71 @@ enum BattleMessages { BTL_MSG_54 = 0x54, }; +// BattleMenuState +enum BattleMenuStates { + BTL_MENU_STATE_OPENED_SUBMENU = -1, + BTL_MENU_STATE_CREATE = 0, + BTL_MENU_STATE_UNK_1 = 1, + BTL_MENU_STATE_ACCEPT_INPUT = 2, + BTL_MENU_STATE_UNK_A = 10, + BTL_MENU_STATE_UNK_B = 11, + BTL_MENU_STATE_UNK_14 = 20, + BTL_MENU_STATE_UNK_1E = 30, + BTL_MENU_STATE_SHOW_DISABLED_POPUP = 100, + BTL_MENU_STATE_AWAIT_DISABLED_POPUP = 101, +}; + +enum BattleMoveSubmenuStates { + BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_TWO = -2, // go back + BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_ONE = -1, + BTL_SUBMENU_MOVES_STATE_UNK_0 = 0, + BTL_SUBMENU_MOVES_STATE_UNK_1 = 1, + BTL_SUBMENU_MOVES_STATE_UNK_A = 10, + BTL_SUBMENU_MOVES_STATE_UNK_B = 11, + BTL_SUBMENU_MOVES_STATE_UNK_14 = 20, + BTL_SUBMENU_MOVES_STATE_UNK_1E = 30, + BTL_SUBMENU_MOVES_STATE_UNK_28 = 40, + BTL_SUBMENU_MOVES_STATE_UNK_29 = 41, + BTL_SUBMENU_MOVES_STATE_UNK_2A = 42, +}; + +enum BattleMenuIndex { + BTL_MENU_IDX_MAIN = 0, + BTL_MENU_IDX_JUMP = 1, + BTL_MENU_IDX_SMASH = 2, + BTL_MENU_IDX_ITEMS = 3, + BTL_MENU_IDX_DIP = 4, + BTL_MENU_IDX_PARTNER = 5, + BTL_MENU_IDX_STAR_POWER = 6, + BTL_MENU_IDX_STRATEGY = 7, + // partners only + BTL_MENU_IDX_ABILITY = 1, + BTL_MENU_IDX_PARTNER_ITEM = 4, +}; + enum BattleMenuTypes { - BTL_MENU_TYPE_INVALID = -1, - BTL_MENU_TYPE_JUMP = 0, - BTL_MENU_TYPE_SMASH = 1, - BTL_MENU_TYPE_ITEM = 2, - BTL_MENU_TYPE_3 = 3, - BTL_MENU_TYPE_4 = 4, // defend? - BTL_MENU_TYPE_5 = 5, // partner/ability? - BTL_MENU_TYPE_6 = 6, - BTL_MENU_TYPE_7 = 7, // strategies? - BTL_MENU_TYPE_8 = 8, // spirits? - BTL_MENU_TYPE_9 = 9, // do nothing? - BTL_MENU_TYPE_A = 10, // switch to partner? - BTL_MENU_TYPE_B = 11, + BTL_MENU_TYPE_INVALID = -1, + BTL_MENU_TYPE_JUMP = 0, + BTL_MENU_TYPE_SMASH = 1, + BTL_MENU_TYPE_ITEMS = 2, + BTL_MENU_TYPE_RUN_AWAY = 3, + BTL_MENU_TYPE_DEFEND = 4, + BTL_MENU_TYPE_CHANGE_PARTNER = 5, + BTL_MENU_TYPE_ABILITY = 6, + BTL_MENU_TYPE_STRATEGIES = 7, + BTL_MENU_TYPE_STAR_POWERS = 8, + BTL_MENU_TYPE_DO_NOTHING = 9, + BTL_MENU_TYPE_ACT_LATER = 10, + BTL_MENU_TYPE_PARTNER_FOCUS = 11, +}; + +enum BattleMenuDisableFlags { + BTL_MENU_DISABLED_JUMP = 1 << BTL_MENU_TYPE_JUMP, + BTL_MENU_DISABLED_SMASH = 1 << BTL_MENU_TYPE_SMASH, + BTL_MENU_DISABLED_ITEMS = 1 << BTL_MENU_TYPE_ITEMS, + BTL_MENU_DISABLED_STRATEGIES = 1 << BTL_MENU_TYPE_STRATEGIES, + BTL_MENU_DISABLED_STAR_POWERS = 1 << BTL_MENU_TYPE_STAR_POWERS, + BTL_MENU_DISABLED_PARTNER_FOCUS = 1 << BTL_MENU_TYPE_PARTNER_FOCUS, }; enum DebugEnemyContactModes { @@ -5543,7 +5597,7 @@ enum MoveType { MOVE_TYPE_JUMP = 2, MOVE_TYPE_3 = 3, MOVE_TYPE_ITEMS = 4, - MOVE_TYPE_TACTICS = 5, + MOVE_TYPE_SWITCH = 5, MOVE_TYPE_6 = 6, MOVE_TYPE_ATTACK_UP = 7, MOVE_TYPE_DEFENSE_UP = 8, diff --git a/include/npc.h b/include/npc.h index 0db334ff21..1bcdebabd3 100644 --- a/include/npc.h +++ b/include/npc.h @@ -338,7 +338,7 @@ typedef struct Enemy { /* 0xAD */ char unk_AD[3]; /* 0xB0 */ u32 aiFlags; /* 0xB4 */ s8 aiPaused; - /* 0xB5 */ s8 unk_B5; + /* 0xB5 */ s8 instigatorValue; // value is passed to first actor in formation if a battle is triggered with this enemy /* 0xB6 */ char unk_B6[2]; /* 0xB8 */ EvtScript* unk_B8; // some bytecode /* 0xBC */ struct Evt* unk_BC; // some script @@ -376,7 +376,7 @@ typedef struct EncounterStatus { /* 0x00C */ u8 damageTaken; /* valid after battle */ /* 0x00D */ char unk_0D; /* 0x00E */ s16 coinsEarned; /* valid after battle */ - /* 0x010 */ char unk_10; + /* 0x010 */ s8 instigatorValue; /* 0x011 */ s8 allowFleeing; /* 0x012 */ s8 scriptedBattle; ///< battle started by StartBattle but not by encounter /* 0x013 */ s8 dropWhackaBump; diff --git a/include/script_api/battle.h b/include/script_api/battle.h index d0ae48432f..873d42c813 100644 --- a/include/script_api/battle.h +++ b/include/script_api/battle.h @@ -145,7 +145,7 @@ ApiStatus SummonEnemy(Evt* script, s32 isInitialCall); ApiStatus GetOwnerID(Evt* script, s32 isInitialCall); ApiStatus SetOwnerID(Evt* script, s32 isInitialCall); ApiStatus ActorExists(Evt* script, s32 isInitialCall); -ApiStatus func_8026E038(Evt* script, s32 isInitialCall); +ApiStatus SetEnabledStarPowers(Evt* script, s32 isInitialCall); ApiStatus SetBattleInputMask(Evt* script, s32 isInitialCall); ApiStatus SetBattleInputButtons(Evt* script, s32 isInitialCall); ApiStatus CheckButtonPress(Evt* script, s32 isInitialCall); @@ -246,7 +246,7 @@ ApiStatus SetTargetOffset(Evt* script, s32 isInitialCall); ApiStatus func_8027D4C8(Evt* script, s32 isInitialCall); ApiStatus EnableActorBlur(Evt* script, s32 isInitialCall); ApiStatus AfflictActor(Evt* script, s32 isInitialCall); -ApiStatus func_8027D75C(Evt* script, s32 isInitialCall); +ApiStatus GetInstigatorValue(Evt* script, s32 isInitialCall); ApiStatus GetEncounterState(Evt* script, s32 isInitialCall); ApiStatus YieldTurn(Evt* script, s32 isInitialCall); ApiStatus SetActorSize(Evt* script, s32 isInitialCall); @@ -302,7 +302,7 @@ ApiStatus ShowStartRecoveryShimmer(Evt* script, s32 isInitialCall); ApiStatus ShowRecoveryShimmer(Evt* script, s32 isInitialCall); ApiStatus func_80273444(Evt* script, s32 isInitialCall); ApiStatus WaitForState(Evt* script, s32 isInitialCall); -ApiStatus func_8026E020(Evt* script, s32 isInitialCall); +ApiStatus SetBattleMenuDisableFlags(Evt* script, s32 isInitialCall); ApiStatus SetBattleState(Evt* script, s32 isInitialCall); ApiStatus func_8027D434(Evt* script, s32 isInitialCall); ApiStatus func_8026F1A0(Evt* script, s32 isInitialCall); diff --git a/include/script_api/common.h b/include/script_api/common.h index d05cd55d33..95898abc25 100644 --- a/include/script_api/common.h +++ b/include/script_api/common.h @@ -45,8 +45,8 @@ ApiStatus GetSelfNpcID(Evt* script, s32 isInitialCall); ApiStatus ClearDefeatedEnemies(Evt* script, s32 isInitialCall); ApiStatus SetEnemyFlagBits(Evt* script, s32 isInitialCall); ApiStatus GetSelfAnimationFromTable(Evt* script, s32 isInitialCall); -ApiStatus func_800457F8(Evt* script, s32 isInitialCall); -ApiStatus func_800457C4(Evt* script, s32 isInitialCall); +ApiStatus SetBattleAsScripted(Evt* script, s32 isInitialCall); +ApiStatus SetOwnerInstigatorValue(Evt* script, s32 isInitialCall); ApiStatus ShowCoinCounter(Evt* script, s32 isInitialCall); ApiStatus MakeEntity(Evt* script, s32 isInitialCall); ApiStatus SetEntityCullMode(Evt* script, s32 isInitialCall); diff --git a/include/variables.h b/include/variables.h index 406419fe8c..1a8ead3c3e 100644 --- a/include/variables.h +++ b/include/variables.h @@ -18,16 +18,16 @@ extern MoveData gMoveTable[185]; extern s32 gBattleState; extern BattleStatus gBattleStatus; -extern s32 D_800DC4D0; +extern s32 gLastDrawBattleState; extern s32 D_800DC4D4; extern s32 gDefeatedBattleSubstate; extern s32 gBattleSubState; extern s32 gDefeatedBattleState; extern s32 gCurrentBattleID; extern s32 D_800DC4E0; -extern s32 D_800DC4EC; +extern s32 gCurrentStageID; extern s32 D_800DC4F0; -extern struct Battle* D_800DC4F4; +extern struct Battle* gOverrideBattlePtr; extern s32 D_800DC4F8; extern s32 D_802DAC98; diff --git a/src/16F740.c b/src/16F740.c index 39cb2f70ca..c5e6e126bf 100644 --- a/src/16F740.c +++ b/src/16F740.c @@ -6,25 +6,25 @@ #include "battle/battle.h" #include "model.h" -extern StageListRow* D_800DC064; +extern StageListRow* gCurrentStagePtr; extern s16 D_802809F6; extern s16 D_802809F8; -extern s32 D_80280A30; -extern EvtScript D_80280EB8[]; +extern s32 BattleScreenFadeAmt; +extern EvtScript EVS_OnBattleInit[]; extern s32 D_80281454[]; -extern EvtScript D_80284A20[]; -extern EvtScript D_80284A30[]; +extern EvtScript EVS_Mario_OnActorCreate[]; +extern EvtScript EVS_Peach_OnActorCreate[]; -BSS s32 D_8029F240; +BSS s32 BattleEnemiesCreated; BSS u8 D_8029F244; BSS s32 D_8029F248; BSS s32 D_8029F24C; -BSS s32 D_8029F250; +BSS s32 RunAwayRewardStep; BSS s32 D_8029F254; BSS s32 D_8029F258; -BSS s32 D_8029F25C; -BSS s32 D_8029F260; +BSS s32 RunAwayRewardTotal; +BSS s32 RunAwayRewardIncrement; BSS s32 D_8029F264; s32 dispatch_damage_event_player_0(s32 damageAmount, s32 event); @@ -36,8 +36,8 @@ void btl_merlee_on_start_turn(void) { do { if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) && - battleStatus->nextMerleeSpellType != MERLEE_SPELL_3 && - battleStatus->nextMerleeSpellType != MERLEE_SPELL_4 && + battleStatus->nextMerleeSpellType != MERLEE_SPELL_EXP_BOOST && + battleStatus->nextMerleeSpellType != MERLEE_SPELL_COIN_BOOST && playerData->merleeCastsLeft > 0) { if (playerData->merleeTurnCount <= 0) { @@ -50,25 +50,25 @@ void btl_merlee_on_start_turn(void) { } else if (temp <= 90) { playerData->merleeSpellType = MERLEE_SPELL_2; } else { - playerData->merleeSpellType = MERLEE_SPELL_3; + playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; } } else if (temp <= 30) { playerData->merleeSpellType = MERLEE_SPELL_1; } else if (temp <= 60) { playerData->merleeSpellType = MERLEE_SPELL_2; } else if (temp <= 80) { - playerData->merleeSpellType = MERLEE_SPELL_3; + playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; } else { - playerData->merleeSpellType = MERLEE_SPELL_4; + playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; } } else if (temp <= 30) { playerData->merleeSpellType = MERLEE_SPELL_1; } else if (temp <= 60) { playerData->merleeSpellType = MERLEE_SPELL_2; } else if (temp <= 80) { - playerData->merleeSpellType = MERLEE_SPELL_3; + playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; } else { - playerData->merleeSpellType = MERLEE_SPELL_4; + playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; } temp = rand_int(10) + 6; @@ -93,8 +93,8 @@ void btl_merlee_on_first_strike(void) { do { if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) && - battleStatus->nextMerleeSpellType != MERLEE_SPELL_3 && - battleStatus->nextMerleeSpellType != MERLEE_SPELL_4 && + battleStatus->nextMerleeSpellType != MERLEE_SPELL_EXP_BOOST && + battleStatus->nextMerleeSpellType != MERLEE_SPELL_COIN_BOOST && playerData->merleeCastsLeft > 0) { if (playerData->merleeTurnCount <= 0) { @@ -107,28 +107,28 @@ void btl_merlee_on_first_strike(void) { } else if (temp <= 90) { playerData->merleeSpellType = MERLEE_SPELL_2; } else { - playerData->merleeSpellType = MERLEE_SPELL_3; + playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; } } else if (temp <= 30) { playerData->merleeSpellType = MERLEE_SPELL_1; } else if (temp <= 60) { playerData->merleeSpellType = MERLEE_SPELL_2; } else if (temp <= 80) { - playerData->merleeSpellType = MERLEE_SPELL_3; + playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; } else { - playerData->merleeSpellType = MERLEE_SPELL_4; + playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; } } else if (temp <= 30) { playerData->merleeSpellType = MERLEE_SPELL_1; } else if (temp <= 60) { playerData->merleeSpellType = MERLEE_SPELL_2; } else if (temp <= 80) { - playerData->merleeSpellType = MERLEE_SPELL_3; + playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; } else { - playerData->merleeSpellType = MERLEE_SPELL_4; + playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; } - if (playerData->merleeSpellType != MERLEE_SPELL_4) { + if (playerData->merleeSpellType != MERLEE_SPELL_COIN_BOOST) { // same outcome either way. has to be written like this, and the check does exist in the code. bug? if (playerData->merleeTurnCount == -1) { temp = rand_int(5) + 5; @@ -142,7 +142,7 @@ void btl_merlee_on_first_strike(void) { playerData->merleeTurnCount = temp; } - if (playerData->merleeSpellType == MERLEE_SPELL_3 || playerData->merleeSpellType == MERLEE_SPELL_4) { + if (playerData->merleeSpellType == MERLEE_SPELL_EXP_BOOST || playerData->merleeSpellType == MERLEE_SPELL_COIN_BOOST) { if (playerData->merleeTurnCount >= 2) { playerData->merleeTurnCount--; } else { @@ -187,33 +187,34 @@ void btl_state_update_normal_start(void) { Battle* battle; Stage* stage; s32 size; + UiStatus* uiStatus; void* compressedAsset; ModelNode* model; s32 textureRom; Actor* actor; Evt* script; - s32 cond; + s32 enemyNotDone; s32 type; s32 i; s32 j; s32* types; - battle = (*D_800DC4FC); - if (D_800DC4F4 != NULL) { - battle = D_800DC4F4; + battle = gCurrentBattlePtr; + if (gOverrideBattlePtr != NULL) { + battle = gOverrideBattlePtr; } - if (D_800DC064 == NULL) { + if (gCurrentStagePtr == NULL) { stage = battle->stage; } else { - stage = D_800DC064->stage; + stage = gCurrentStagePtr->stage; } battleStatus->currentStage = stage; switch (gBattleSubState) { - case BTL_SUBSTATE_NORMAL_START_UNK_0: - D_8029F240 = battle->formationSize; + case BTL_SUBSTATE_NORMAL_START_INIT: + BattleEnemiesCreated = battle->formationSize; set_screen_overlay_params_back(255, -1.0f); compressedAsset = load_asset_by_name(stage->shape, &size); decode_yay0(compressedAsset, &D_80210000); @@ -261,7 +262,7 @@ void btl_state_update_normal_start(void) { battleStatus->actionSuccess = 0; battleStatus->unk_82 = 0; battleStatus->menuDisableFlags = -1; - battleStatus->unk_74 = -1; + battleStatus->enabledStarPowersMask = -1; battleStatus->itemUsesLeft = 0; battleStatus->hammerCharge = 0; battleStatus->jumpCharge = 0; @@ -305,69 +306,70 @@ void btl_state_update_normal_start(void) { battleStatus->varTable[i] = 0; } - D_80280A30 = 255; - battleStatus->inputBitmask = 0xFEF3F; + BattleScreenFadeAmt = 255; + battleStatus->inputBitmask = 0xFFFFF & ~(BUTTON_START | 0xC0); battleStatus->buffEffect = fx_partner_buff(0, 0.0f, 0.0f, 0.0f, 0.0f, 0); func_800E9810(); gCurrentCameraID = CAM_BATTLE; - script = start_script(D_80280EB8, EVT_PRIORITY_A, 0); + script = start_script(EVS_OnBattleInit, EVT_PRIORITY_A, 0); battleStatus->camMovementScript = script; battleStatus->camMovementScriptID = script->id; - gBattleSubState = BTL_SUBSTATE_NORMAL_START_UNK_1; + gBattleSubState = BTL_SUBSTATE_NORMAL_START_CREATE_ENEMIES; break; - case BTL_SUBSTATE_NORMAL_START_UNK_1: - if (!does_script_exist(battleStatus->camMovementScriptID)) { - UiStatus* uiStatus = &gUIStatus; + case BTL_SUBSTATE_NORMAL_START_CREATE_ENEMIES: + uiStatus = &gUIStatus; + if (does_script_exist(battleStatus->camMovementScriptID)) { + break; + } - if (stage->preBattle != NULL) { - script = start_script(stage->preBattle, 0xA, 0); - battleStatus->controlScript = script; - battleStatus->controlScriptID = script->id; - } + if (stage->preBattle != NULL) { + script = start_script(stage->preBattle, EVT_PRIORITY_A, 0); + battleStatus->controlScript = script; + battleStatus->controlScriptID = script->id; + } - uiStatus->hidden = FALSE; - gBattleStatus.flags1 |= BS_FLAGS1_ACTORS_VISIBLE; + uiStatus->hidden = FALSE; + gBattleStatus.flags1 |= BS_FLAGS1_ACTORS_VISIBLE; - for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { - battleStatus->enemyActors[i] = NULL; - } - battleStatus->initialEnemyCount = 0; + for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { + battleStatus->enemyActors[i] = NULL; + } + battleStatus->initialEnemyCount = 0; - for (i = 0; i < D_8029F240; i++) { - create_actor(&(*battle->formation)[i]); - types = D_80281454; - actor = battleStatus->enemyActors[i]; + for (i = 0; i < BattleEnemiesCreated; i++) { + create_actor(&(*battle->formation)[i]); + types = D_80281454; + actor = battleStatus->enemyActors[i]; - while (TRUE) { - type = *types; - if (type == -1) { - battleStatus->initialEnemyCount++; - break; - } else if (actor->actorType == type) { - break; - } - types++; + while (TRUE) { + type = *types; + if (type == -1) { + battleStatus->initialEnemyCount++; + break; + } else if (actor->actorType == type) { + break; } + types++; + } - actor->unk_208 = 0; - if (i == 0) { - actor->unk_208 = currentEncounter->unk_10; - if (currentEncounter->dizzyAttackStatus == STATUS_DIZZY) { - inflict_status_set_duration(actor, STATUS_DIZZY, STATUS_DIZZY_TURN_MOD, currentEncounter->dizzyAttackDuration); - } + actor->instigatorValue = 0; + if (i == 0) { + actor->instigatorValue = currentEncounter->instigatorValue; + if (currentEncounter->dizzyAttackStatus == STATUS_DIZZY) { + inflict_status_set_duration(actor, STATUS_DIZZY, STATUS_DIZZY_TURN_MOD, currentEncounter->dizzyAttackDuration); } } + } - if (stage->specialFormationSize != 0 && - (stage->unk_24 == 0 || (stage->unk_24 > 0 && (rand_int(stage->unk_24) == 0)))) - { - D_8029F240 += stage->specialFormationSize; - for (j = 0; i < D_8029F240; i++, j++) { - create_actor(&(*stage->specialFormation)[j]); + if (stage->stageEnemyCount != 0) { + if (stage->stageEnemyChance == 0 || (stage->stageEnemyChance > 0 && (rand_int(stage->stageEnemyChance) == 0))) { + BattleEnemiesCreated += stage->stageEnemyCount; + for (j = 0; i < BattleEnemiesCreated; i++, j++) { + create_actor(&(*stage->stageFormation)[j]); actor = battleStatus->enemyActors[i]; - actor->unk_208 = 0; + actor->instigatorValue = 0; if (i == 0) { - actor->unk_208 = 0; + actor->instigatorValue = 0; if (currentEncounter->dizzyAttackStatus == STATUS_DIZZY) { inflict_status_set_duration(actor, STATUS_DIZZY, STATUS_DIZZY_TURN_MOD, currentEncounter->dizzyAttackDuration); } @@ -375,101 +377,103 @@ void btl_state_update_normal_start(void) { } } - - load_player_actor(); - actor = battleStatus->playerActor; - if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { - script = start_script(D_80284A30, EVT_PRIORITY_A, 0); - } else { - script = start_script(D_80284A20, EVT_PRIORITY_A, 0); - } - actor->takeTurnScript = script; - actor->takeTurnScriptID = script->id; - script->owner1.actorID = ACTOR_PLAYER; - load_partner_actor(); - gBattleSubState = BTL_SUBSTATE_NORMAL_START_UNK_4; } + + load_player_actor(); + actor = battleStatus->playerActor; + if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { + script = start_script(EVS_Peach_OnActorCreate, EVT_PRIORITY_A, 0); + } else { + script = start_script(EVS_Mario_OnActorCreate, EVT_PRIORITY_A, 0); + } + actor->takeTurnScript = script; + actor->takeTurnScriptID = script->id; + script->owner1.actorID = ACTOR_PLAYER; + load_partner_actor(); + gBattleSubState = BTL_SUBSTATE_NORMAL_START_CHECK_FIRST_STRIKE; break; - case BTL_SUBSTATE_NORMAL_START_UNK_4: - cond = FALSE; - for (i = 0; i < D_8029F240; i++) { + case BTL_SUBSTATE_NORMAL_START_CHECK_FIRST_STRIKE: + enemyNotDone = FALSE; + for (i = 0; i < BattleEnemiesCreated; i++) { actor = battleStatus->enemyActors[i]; if (does_script_exist(actor->takeTurnScriptID)) { - cond = TRUE; + enemyNotDone = TRUE; break; } else { actor->takeTurnScript = NULL; } } + if (enemyNotDone) { + break; + } - if (!cond) { - actor = battleStatus->playerActor; - if (!does_script_exist(actor->takeTurnScriptID)) { - actor->takeTurnScript = NULL; - actor = battleStatus->partnerActor; - if (actor != NULL) { - if (!does_script_exist(battleStatus->partnerActor->takeTurnScriptID)) { - actor->takeTurnScript = NULL; - } else { - return; - } - } + actor = battleStatus->playerActor; + if (does_script_exist(actor->takeTurnScriptID)) { + break; + } + actor->takeTurnScript = NULL; - if (battle->unk_10 != 0) { - script = start_script(battle->unk_10, 0xA, 0); - battleStatus->controlScript = script; - battleStatus->controlScriptID = script->id; - } - if (battleStatus->darknessMode > BTL_DARKNESS_STATE_NONE) { - set_screen_overlay_color(1, 0, 0, 0); - set_screen_overlay_params_back(0, 215.0f); - } - if (is_ability_active(ABILITY_CHILL_OUT) && currentEncounter->firstStrikeType == FIRST_STRIKE_ENEMY) { - currentEncounter->firstStrikeType = FIRST_STRIKE_NONE; - } - - switch (currentEncounter->firstStrikeType) { - case FIRST_STRIKE_PLAYER: - btl_set_state(BATTLE_STATE_FIRST_STRIKE); - break; - case FIRST_STRIKE_ENEMY: - btl_set_state(BATTLE_STATE_ENEMY_FIRST_STRIKE); - break; - default: - if (!(gGameStatusPtr->demoFlags & 1)) { - actor = battleStatus->playerActor; - if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { - script = start_script(&PeachEnterStage, EVT_PRIORITY_A, 0); - } else { - script = start_script(&MarioEnterStage, EVT_PRIORITY_A, 0); - } - actor->takeTurnScript = script; - actor->takeTurnScriptID = script->id; - script->owner1.actorID = ACTOR_PLAYER; - } - - if (currentEncounter->currentEnemy != NULL && - currentEncounter->currentEnemy->encountered == 3 && - is_ability_active(ABILITY_DIZZY_ATTACK)) - { - actor = battleStatus->enemyActors[0]; - script = start_script(&DoDizzyAttack, EVT_PRIORITY_A, 0); - actor->takeTurnScript = script; - actor->takeTurnScriptID = script->id; - script->owner1.enemyID = ACTOR_ENEMY0; - } - - D_80280A30 = 305; - D_8029F248 = 0; - gBattleSubState = BTL_SUBSTATE_NORMAL_START_UNK_7; - break; - } + actor = battleStatus->partnerActor; + if (actor != NULL) { + if (does_script_exist(actor->takeTurnScriptID)) { + break; } + actor->takeTurnScript = NULL; + } + + if (battle->onBattleStart != NULL) { + script = start_script(battle->onBattleStart, EVT_PRIORITY_A, 0); + battleStatus->controlScript = script; + battleStatus->controlScriptID = script->id; + } + if (battleStatus->darknessMode > BTL_DARKNESS_STATE_NONE) { + set_screen_overlay_color(1, 0, 0, 0); + set_screen_overlay_params_back(0, 215.0f); + } + if (is_ability_active(ABILITY_CHILL_OUT) && currentEncounter->firstStrikeType == FIRST_STRIKE_ENEMY) { + currentEncounter->firstStrikeType = FIRST_STRIKE_NONE; + } + + switch (currentEncounter->firstStrikeType) { + case FIRST_STRIKE_PLAYER: + btl_set_state(BATTLE_STATE_FIRST_STRIKE); + break; + case FIRST_STRIKE_ENEMY: + btl_set_state(BATTLE_STATE_ENEMY_FIRST_STRIKE); + break; + default: + if (!(gGameStatusPtr->demoFlags & 1)) { + actor = battleStatus->playerActor; + if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { + script = start_script(&PeachEnterStage, EVT_PRIORITY_A, 0); + } else { + script = start_script(&MarioEnterStage, EVT_PRIORITY_A, 0); + } + actor->takeTurnScript = script; + actor->takeTurnScriptID = script->id; + script->owner1.actorID = ACTOR_PLAYER; + } + + if (currentEncounter->currentEnemy != NULL && + currentEncounter->currentEnemy->encountered == ENCOUNTER_TRIGGER_SPIN && + is_ability_active(ABILITY_DIZZY_ATTACK)) + { + actor = battleStatus->enemyActors[0]; + script = start_script(&DoDizzyAttack, EVT_PRIORITY_A, 0); + actor->takeTurnScript = script; + actor->takeTurnScriptID = script->id; + script->owner1.enemyID = ACTOR_ENEMY0; + } + + BattleScreenFadeAmt = 305; + D_8029F248 = 0; + gBattleSubState = BTL_SUBSTATE_NORMAL_START_FADE_IN; + break; } break; - case BTL_SUBSTATE_NORMAL_START_UNK_7: - if (D_80280A30 == 0) { - gBattleSubState = BTL_SUBSTATE_NORMAL_START_UNK_8; + case BTL_SUBSTATE_NORMAL_START_FADE_IN: + if (BattleScreenFadeAmt == 0) { + gBattleSubState = BTL_SUBSTATE_NORMAL_START_DONE; break; } @@ -479,16 +483,16 @@ void btl_state_update_normal_start(void) { } if (!(gGameStatusPtr->demoFlags & 1)) { - D_80280A30 -= 10; + BattleScreenFadeAmt -= 10; } else { - D_80280A30 -= 50; + BattleScreenFadeAmt -= 50; } - if (D_80280A30 < 0) { - D_80280A30 = 0; + if (BattleScreenFadeAmt < 0) { + BattleScreenFadeAmt = 0; } break; - case BTL_SUBSTATE_NORMAL_START_UNK_8: + case BTL_SUBSTATE_NORMAL_START_DONE: if (battleStatus->unk_8C == 0) { set_screen_overlay_params_front(255, -1.0f); btl_set_state(BATTLE_STATE_BEGIN_TURN); @@ -500,10 +504,10 @@ void btl_state_update_normal_start(void) { void btl_state_draw_normal_start(void) { set_screen_overlay_color(0, 0, 0, 0); - if (D_80280A30 > 255) { + if (BattleScreenFadeAmt > 255) { set_screen_overlay_params_front(0, 255.0f); } else { - set_screen_overlay_params_front(0, D_80280A30); + set_screen_overlay_params_front(0, BattleScreenFadeAmt); } } @@ -563,7 +567,7 @@ void btl_state_update_begin_turn(void) { id2 = enemyIDs[j]; enemy1 = battleStatus->enemyActors[id1 & 0xFF]; enemy2 = battleStatus->enemyActors[id2 & 0xFF]; - if (gBattleStatus.flags1 & BS_FLAGS1_8000000) { + if (gBattleStatus.flags1 & BS_FLAGS1_SORT_ENEMIES_BY_POSX) { if (enemy1->homePos.x > enemy2->homePos.x) { enemyIDs[i] = id2; enemyIDs[j] = id1; @@ -706,7 +710,7 @@ void btl_state_update_begin_player_turn(void) { switch (gBattleSubState) { case BTL_SUBSTATE_BEGIN_PLAYER_TURN_RESET_STATE: if (btl_cam_is_moving_done()) { - gBattleStatus.flags1 &= ~BS_FLAGS1_80000; + gBattleStatus.flags1 &= ~BS_FLAGS1_PARTNER_ACTING; reset_actor_turn_info(); battleStatus->unk_86 = 127; battleStatus->blockResult = 127; @@ -1046,7 +1050,7 @@ void btl_state_update_switch_to_player(void) { s32 i; if (gBattleSubState == BTL_SUBSTATE_INIT) { - gBattleStatus.flags1 &= ~BS_FLAGS1_80000; + gBattleStatus.flags1 &= ~BS_FLAGS1_PARTNER_ACTING; reset_actor_turn_info(); gBattleStatus.selectedMoveID = MOVE_NONE; gBattleStatus.unk_86 = 127; @@ -1107,8 +1111,8 @@ void btl_state_update_begin_partner_turn(void) { battleStatus->unk_86 = 127; battleStatus->blockResult = 127; D_8029F254 = 0; - gBattleStatus.flags1 |= BS_FLAGS1_80000; - gBattleStatus.flags2 |= BS_FLAGS1_100000; + gBattleStatus.flags1 |= BS_FLAGS1_PARTNER_ACTING; + gBattleStatus.flags2 |= BS_FLAGS1_PLAYER_IN_BACK; partner->flags |= ACTOR_FLAG_8000000; if (partner->koStatus != 0) { @@ -1119,7 +1123,7 @@ void btl_state_update_begin_partner_turn(void) { partner->disableEffect->data.disableX->koDuration = partner->koDuration; } else { partner->koStatus = 0; - dispatch_event_partner(EVENT_RECOVER_PARTNER); + dispatch_event_partner(EVENT_RECOVER_FROM_KO); partner->disableEffect->data.disableX->koDuration = 0; gBattleStatus.flags2 |= BS_FLAGS2_8; } @@ -1194,7 +1198,7 @@ void btl_state_update_switch_to_partner(void) { if (gBattleSubState == BTL_SUBSTATE_INIT) { reset_actor_turn_info(); - gBattleStatus.flags1 |= BS_FLAGS1_80000; + gBattleStatus.flags1 |= BS_FLAGS1_PARTNER_ACTING; gBattleStatus.selectedMoveID = MOVE_NONE; gBattleStatus.unk_86 = 127; gBattleStatus.blockResult = 127; @@ -1372,7 +1376,7 @@ void btl_state_update_9(void) { } btl_cam_use_preset(BTL_CAM_PRESET_C); - if (partner == NULL || !(gBattleStatus.flags1 & BS_FLAGS1_100000)) { + if (partner == NULL || !(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { gBattleSubState = BTL_SUBSTATE_9_4; } else if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { gBattleSubState = BTL_SUBSTATE_9_4; @@ -1451,7 +1455,7 @@ void btl_state_update_9(void) { player->takeTurnScriptID = script->id; script->owner1.actorID = ACTOR_PLAYER; } - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; player->flags &= ~ACTOR_FLAG_8000000; player->flags |= ACTOR_FLAG_4000000; if (partner != NULL) { @@ -1508,25 +1512,24 @@ void btl_state_draw_9(void) { void btl_state_update_prepare_menu(void) { BattleStatus* battleStatus = &gBattleStatus; - battleStatus->unk_4C[1] = -1; - battleStatus->unk_4C[2] = -1; - battleStatus->unk_4C[3] = -1; - battleStatus->unk_4C[4] = -1; - battleStatus->unk_4C[5] = -1; - battleStatus->unk_4C[5] = -1; - battleStatus->unk_4C[6] = -1; - battleStatus->unk_4C[7] = -1; - battleStatus->unk_5C[1] = -1; - battleStatus->unk_5C[6] = -1; - battleStatus->unk_5C[7] = -1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] = -1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] = -1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] = -1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = -1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] = -1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER] = -1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] = -1; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_ABILITY] = -1; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STAR_POWER] = -1; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STRATEGY] = -1; dma_copy(_415D90_ROM_START, _415D90_ROM_END, _415D90_VRAM); - if (battleStatus->flags1 & BS_FLAGS1_80000) { + if (battleStatus->flags1 & BS_FLAGS1_PARTNER_ACTING) { btl_set_state(BATTLE_STATE_PARTNER_MENU); - } else if (gBattleSubState == BATTLE_SUBSTATE_PREPARE_MENU_UNK_70) { + } else if (gBattleSubState == BATTLE_SUBSTATE_PREPARE_MENU_DIPPING) { btl_set_state(BATTLE_STATE_PLAYER_MENU); - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNUSED_1; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_DIPPING_1; } else { btl_set_state(BATTLE_STATE_PLAYER_MENU); } @@ -1582,7 +1585,7 @@ void btl_state_update_end_turn(void) { if (gBattleSubState == BTL_SUBSTATE_END_TURN_CHECK_FOR_SWAP) { if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { gBattleSubState = BTL_SUBSTATE_END_TURN_START_SCRIPTS; - } else if (!(gBattleStatus.flags1 & BS_FLAGS1_100000)) { + } else if (!(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { gBattleSubState = BTL_SUBSTATE_END_TURN_START_SCRIPTS; } else { player->flags &= ~ACTOR_FLAG_8000000; @@ -1625,9 +1628,9 @@ void btl_state_update_end_turn(void) { player->flags |= ACTOR_FLAG_8000000; partner->flags |= ACTOR_FLAG_8000000; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { - gBattleStatus.flags1 |= BS_FLAGS1_100000; + gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK; } else { - gBattleStatus.flags1 &= ~BS_FLAGS1_100000; + gBattleStatus.flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK; } gBattleSubState = BTL_SUBSTATE_END_TURN_START_SCRIPTS; } @@ -1691,10 +1694,10 @@ void btl_state_update_end_turn(void) { } } - // proceed to next to + // proceed to next turn switch (gBattleSubState) { case BTL_SUBSTATE_END_TURN_BEGIN_NEXT: - case BTL_SUBSTATE_END_TURN_UNK_4: + case BTL_SUBSTATE_END_TURN_UNUSED_4: btl_set_state(BATTLE_STATE_BEGIN_TURN); break; } @@ -1720,7 +1723,7 @@ void btl_state_update_victory(void) { Evt* script; switch (gBattleSubState) { - case BTL_SUBSTATE_VICTORY_UNK_0: + case BTL_SUBSTATE_VICTORY_CHECK_OUTTA_SIGHT: player->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000); if (partner != NULL) { partner->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000); @@ -1728,7 +1731,7 @@ void btl_state_update_victory(void) { battleStatus->unk_8C = 0; if (battleStatus->outtaSightActive == 0) { - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_5; + gBattleSubState = BTL_SUBSTATE_VICTORY_RECOVER_STATUS; } else { if (battleStatus->outtaSightActive > 0) { D_8029F254 = 1; @@ -1738,25 +1741,25 @@ void btl_state_update_victory(void) { partner->handlePhaseScript = script; partner->handleBatttlePhaseScriptID = script->id; script->owner1.actorID = ACTOR_PARTNER; - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_1; + gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_OUTTA_SIGHT; } break; - case BTL_SUBSTATE_VICTORY_UNK_1: + case BTL_SUBSTATE_VICTORY_AWAIT_OUTTA_SIGHT: if (!does_script_exist(partner->handleBatttlePhaseScriptID)) { battleStatus->outtaSightActive = 0; - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_5; + gBattleSubState = BTL_SUBSTATE_VICTORY_RECOVER_STATUS; } break; } switch (gBattleSubState) { - case BTL_SUBSTATE_VICTORY_UNK_5: + case BTL_SUBSTATE_VICTORY_RECOVER_STATUS: player->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000); if (partner != NULL) { partner->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000); } - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_B; + gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_SWAP; gBattleStatus.flags2 &= ~BS_FLAGS2_2; gBattleStatus.flags2 &= ~BS_FLAGS2_4; gBattleStatus.flags2 &= ~BS_FLAGS2_8; @@ -1764,8 +1767,8 @@ void btl_state_update_victory(void) { gBattleStatus.flags1 &= ~BS_FLAGS1_8; if (player->koStatus == STATUS_DAZE) { - dispatch_event_player(EVENT_RECOVER_PARTNER); - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_A; + dispatch_event_player(EVENT_RECOVER_FROM_KO); + gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_RECOVER_KO; } player->debuff = 0; player->staticStatus = 0; @@ -1777,8 +1780,8 @@ void btl_state_update_victory(void) { if (partner != NULL) { if (partner->koStatus == STATUS_DAZE) { - dispatch_event_partner(EVENT_RECOVER_PARTNER); - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_A; + dispatch_event_partner(EVENT_RECOVER_FROM_KO); + gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_RECOVER_KO; } partner->debuff = 0; partner->staticStatus = 0; @@ -1789,24 +1792,25 @@ void btl_state_update_victory(void) { partner->disableEffect->data.disableX->koDuration = 0; } break; - case BTL_SUBSTATE_VICTORY_UNK_A: - if (player->handleEventScript == NULL || !does_script_exist(player->handleEventScriptID)) { - player->handleEventScript = NULL; - if (partner != NULL) { - if (partner->handleEventScript == NULL || !does_script_exist(partner->handleEventScriptID)) { - partner->handleEventScript = NULL; - } else { - break; - } - } - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_B; + case BTL_SUBSTATE_VICTORY_AWAIT_RECOVER_KO: + if (player->handleEventScript != NULL && does_script_exist(player->handleEventScriptID)) { + break; } + player->handleEventScript = NULL; + + if (partner != NULL) { + if (partner->handleEventScript != NULL && does_script_exist(partner->handleEventScriptID)) { + break; + } + partner->handleEventScript = NULL; + } + gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_SWAP; break; } - if (gBattleSubState == BTL_SUBSTATE_VICTORY_UNK_B) { - if (partner == NULL || !(gBattleStatus.flags1 & BS_FLAGS1_100000)) { - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_2; + if (gBattleSubState == BTL_SUBSTATE_VICTORY_CHECK_SWAP) { + if (partner == NULL || !(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { + gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_MERLEE; } else { partner->state.currentPos.x = partner->currentPos.x; partner->state.currentPos.z = partner->currentPos.z; @@ -1814,20 +1818,16 @@ void btl_state_update_victory(void) { partner->state.goalPos.z = player->currentPos.z; partner->state.moveTime = 4; partner->state.angle = 0.0f; - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_C; + gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_SWAP; } } - if (gBattleSubState == BTL_SUBSTATE_VICTORY_UNK_C) { + if (gBattleSubState == BTL_SUBSTATE_VICTORY_AWAIT_SWAP) { if (partner->state.moveTime != 0) { - partner->currentPos.x += (partner->state.goalPos.x - partner->currentPos.x) - / partner->state.moveTime; - partner->currentPos.z += (partner->state.goalPos.z - partner->currentPos.z) - / partner->state.moveTime; - player->currentPos.x += (partner->state.currentPos.x - player->currentPos.x) - / partner->state.moveTime; - player->currentPos.z += (partner->state.currentPos.z - player->currentPos.z) - / partner->state.moveTime; + partner->currentPos.x += (partner->state.goalPos.x - partner->currentPos.x) / partner->state.moveTime; + partner->currentPos.z += (partner->state.goalPos.z - partner->currentPos.z) / partner->state.moveTime; + player->currentPos.x += (partner->state.currentPos.x - player->currentPos.x) / partner->state.moveTime; + player->currentPos.z += (partner->state.currentPos.z - player->currentPos.z) / partner->state.moveTime; } partner->currentPos.z += sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; partner->yaw = clamp_angle(-partner->state.angle); @@ -1846,14 +1846,14 @@ void btl_state_update_victory(void) { partner->homePos.z = partner->currentPos.z; player->homePos.x = player->currentPos.x; player->homePos.z = player->currentPos.z; - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_2; - gBattleStatus.flags1 &= ~BS_FLAGS1_100000; + gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_MERLEE; + gBattleStatus.flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK; } } - if (gBattleSubState == BTL_SUBSTATE_VICTORY_UNK_2) { + if (gBattleSubState == BTL_SUBSTATE_VICTORY_CHECK_MERLEE) { btl_cam_use_preset(BTL_CAM_PRESET_C); - if (battleStatus->nextMerleeSpellType == MERLEE_SPELL_3) { + if (battleStatus->nextMerleeSpellType == MERLEE_SPELL_EXP_BOOST) { if (battleStatus->totalStarPoints == 0) { battleStatus->nextMerleeSpellType = MERLEE_SPELL_0; playerData->merleeTurnCount = 0; @@ -1866,37 +1866,39 @@ void btl_state_update_victory(void) { script->owner1.actorID = ACTOR_PLAYER; } } - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_3; + gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_MERLEE; D_8029F248 = 0; - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; } - if (gBattleSubState == BTL_SUBSTATE_VICTORY_UNK_3) { + if (gBattleSubState == BTL_SUBSTATE_VICTORY_AWAIT_MERLEE) { if (D_8029F248 != 0) { D_8029F248--; - } else if (player->takeTurnScript == NULL || !does_script_exist(player->takeTurnScriptID)) { - player->takeTurnScript = NULL; - if (battleStatus->nextMerleeSpellType != MERLEE_SPELL_3) { - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_4; - } else { - battleStatus->incrementStarPointDelay = 20; - battleStatus->nextMerleeSpellType = MERLEE_SPELL_0; - gBattleSubState = BTL_SUBSTATE_VICTORY_UNK_4; - battleStatus->pendingStarPoints = battleStatus->totalStarPoints - + battleStatus->pendingStarPoints + battleStatus->pendingStarPoints; + } else { + if (player->takeTurnScript == NULL || !does_script_exist(player->takeTurnScriptID)) { + player->takeTurnScript = NULL; + if (battleStatus->nextMerleeSpellType != MERLEE_SPELL_EXP_BOOST) { + gBattleSubState = BTL_SUBSTATE_VICTORY_DONE; + } else { + battleStatus->incrementStarPointDelay = 20; + battleStatus->nextMerleeSpellType = MERLEE_SPELL_0; + gBattleSubState = BTL_SUBSTATE_VICTORY_DONE; + battleStatus->pendingStarPoints = battleStatus->totalStarPoints + + battleStatus->pendingStarPoints + battleStatus->pendingStarPoints; + } } } } - if (gBattleSubState == BTL_SUBSTATE_VICTORY_UNK_4) { + if (gBattleSubState == BTL_SUBSTATE_VICTORY_DONE) { if (battleStatus->pendingStarPoints <= 0) { if (gBattleStatus.flags1 & BS_FLAGS1_STAR_POINTS_DROPPED) { - gBattleStatus.flags1 &= ~BS_FLAGS1_ENEMY_FLED; + gBattleStatus.flags1 &= ~BS_FLAGS1_BATTLE_FLED; } if (playerData->battlesWon < 9999) { playerData->battlesWon++; } - if (gBattleStatus.flags1 & BS_FLAGS1_ENEMY_FLED) { + if (gBattleStatus.flags1 & BS_FLAGS1_BATTLE_FLED) { currentEncounter->battleOutcome = OUTCOME_ENEMY_FLED; } else { currentEncounter->battleOutcome = OUTCOME_PLAYER_WON; @@ -1922,22 +1924,23 @@ void btl_state_update_end_training_battle(void) { EncounterStatus* encounterStatus = &gCurrentEncounter; Actor* player = gBattleStatus.playerActor; Actor* partner = gBattleStatus.partnerActor; + Evt* script; switch (gBattleSubState) { - case BTL_SUBSTATE_END_TRAINING_UNK_0: + case BTL_SUBSTATE_END_TRAINING_INIT: player->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000); if (partner != NULL) { partner->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000); } - gBattleSubState = BTL_SUBSTATE_END_TRAINING_UNK_B; + gBattleSubState = BTL_SUBSTATE_END_TRAINING_CHECK_OUTTA_SIGHT; gBattleStatus.flags2 &= ~BS_FLAGS2_2; gBattleStatus.flags2 &= ~BS_FLAGS2_4; gBattleStatus.flags2 &= ~BS_FLAGS2_8; gBattleStatus.flags2 &= ~BS_FLAGS2_10; if (player->koStatus == STATUS_DAZE) { - dispatch_event_player(EVENT_RECOVER_PARTNER); - gBattleSubState = BTL_SUBSTATE_END_TRAINING_UNK_A; + dispatch_event_player(EVENT_RECOVER_FROM_KO); + gBattleSubState = BTL_SUBSTATE_END_TRAINING_AWAIT_RECOVERING; } player->debuff = 0; player->staticStatus = 0; @@ -1948,8 +1951,8 @@ void btl_state_update_end_training_battle(void) { player->disableEffect->data.disableX->koDuration = 0; if (partner != NULL) { if (partner->koStatus == STATUS_DAZE) { - dispatch_event_partner(EVENT_RECOVER_PARTNER); - gBattleSubState = BTL_SUBSTATE_END_TRAINING_UNK_A; + dispatch_event_partner(EVENT_RECOVER_FROM_KO); + gBattleSubState = BTL_SUBSTATE_END_TRAINING_AWAIT_RECOVERING; } partner->debuff = 0; partner->staticStatus = 0; @@ -1960,23 +1963,25 @@ void btl_state_update_end_training_battle(void) { partner->disableEffect->data.disableX->koDuration = 0; } break; - case BTL_SUBSTATE_END_TRAINING_UNK_A: - if (player->handleEventScript == NULL || !does_script_exist(player->handleEventScriptID)) { - player->handleEventScript = NULL; - if (partner != NULL) { - if (partner->handleEventScript == NULL || !does_script_exist(partner->handleEventScriptID)) { - partner->handleEventScript = NULL; - } else { - break; - } - } - gBattleSubState = BTL_SUBSTATE_END_TRAINING_UNK_B; + case BTL_SUBSTATE_END_TRAINING_AWAIT_RECOVERING: + if (player->handleEventScript != NULL && does_script_exist(player->handleEventScriptID)) { + break; } + player->handleEventScript = NULL; + + if (partner != NULL) { + if (partner->handleEventScript != NULL && does_script_exist(partner->handleEventScriptID)) { + break; + } + partner->handleEventScript = NULL; + } + + gBattleSubState = BTL_SUBSTATE_END_TRAINING_CHECK_OUTTA_SIGHT; break; } switch (gBattleSubState) { - case BTL_SUBSTATE_END_TRAINING_UNK_B: + case BTL_SUBSTATE_END_TRAINING_CHECK_OUTTA_SIGHT: battleStatus->unk_8C = 0; gBattleStatus.flags2 &= ~BS_FLAGS2_2; gBattleStatus.flags2 &= ~BS_FLAGS2_4; @@ -1984,33 +1989,31 @@ void btl_state_update_end_training_battle(void) { gBattleStatus.flags2 &= ~BS_FLAGS2_10; if (!battleStatus->outtaSightActive) { - gBattleSubState = BTL_SUBSTATE_END_TRAINING_UNK_D; + gBattleSubState = BTL_SUBSTATE_END_TRAINING_RESET_CAM; } else { - Evt* script; - battleStatus->battlePhase = PHASE_ENEMY_BEGIN; script = start_script(partner->handlePhaseSource, EVT_PRIORITY_A, 0); partner->handlePhaseScript = script; - gBattleSubState = BTL_SUBSTATE_END_TRAINING_UNK_C; partner->handleBatttlePhaseScriptID = script->id; script->owner1.actorID = ACTOR_PARTNER; + gBattleSubState = BTL_SUBSTATE_END_TRAINING_AWAIT_OUTTA_SIGHT; } break; - case BTL_SUBSTATE_END_TRAINING_UNK_D: + case BTL_SUBSTATE_END_TRAINING_RESET_CAM: //@bug should be BTL_SUBSTATE_END_TRAINING_AWAIT_OUTTA_SIGHT if (!does_script_exist(partner->handleBatttlePhaseScriptID)) { battleStatus->outtaSightActive = FALSE; - gBattleSubState = BTL_SUBSTATE_END_TRAINING_UNK_D; + gBattleSubState = BTL_SUBSTATE_END_TRAINING_RESET_CAM; } break; } switch (gBattleSubState) { - case BTL_SUBSTATE_END_TRAINING_UNK_D: + case BTL_SUBSTATE_END_TRAINING_RESET_CAM: btl_cam_use_preset(BTL_CAM_PRESET_C); D_8029F248 = 30; - gBattleSubState = BTL_SUBSTATE_END_TRAINING_UNK_E; + gBattleSubState = BTL_SUBSTATE_END_TRAINING_DONE; break; - case BTL_SUBSTATE_END_TRAINING_UNK_E: + case BTL_SUBSTATE_END_TRAINING_DONE: if (D_8029F248 != 0) { D_8029F248--; return; @@ -2031,18 +2034,18 @@ void btl_state_draw_end_training_battle(void) { } void btl_state_update_end_battle(void) { - Battle* blah = (*D_800DC4FC); EncounterStatus* encounterStatus = &gCurrentEncounter; BattleStatus* battleStatus = &gBattleStatus; + Battle* battle = gCurrentBattlePtr; Stage* stage; Evt* script; s32 i; switch (gBattleSubState) { - case BTL_SUBSTATE_END_BATTLE_UNK_0: - D_80280A30 = 0; + case BTL_SUBSTATE_END_BATTLE_INIT: + BattleScreenFadeAmt = 0; if (gGameStatusPtr->debugEnemyContact == DEBUG_CONTACT_DIE_ON_TOUCH) { - D_80280A30 = 255; + BattleScreenFadeAmt = 255; } if (encounterStatus->battleOutcome == OUTCOME_PLAYER_LOST && !(gBattleStatus.flags1 & BS_FLAGS1_NO_GAME_OVER)) { btl_cam_unfreeze(); @@ -2050,25 +2053,25 @@ void btl_state_update_end_battle(void) { set_screen_overlay_color(0, 0, 0, 0); set_screen_overlay_center(0, 0, 160, 120); } - gBattleSubState = BTL_SUBSTATE_END_BATTLE_UNK_1; + gBattleSubState = BTL_SUBSTATE_END_BATTLE_FADE_OUT; break; - case BTL_SUBSTATE_END_BATTLE_UNK_1: - if (D_80280A30 == 255) { - gBattleSubState = BTL_SUBSTATE_END_BATTLE_UNK_2; + case BTL_SUBSTATE_END_BATTLE_FADE_OUT: + if (BattleScreenFadeAmt == 255) { + gBattleSubState = BTL_SUBSTATE_END_BATTLE_EXEC_STAGE_SCRIPT; break; } - D_80280A30 += battleStatus->unk_8D; - if (D_80280A30 > 255) { - D_80280A30 = 255; + BattleScreenFadeAmt += battleStatus->unk_8D; + if (BattleScreenFadeAmt > 255) { + BattleScreenFadeAmt = 255; } break; - case BTL_SUBSTATE_END_BATTLE_UNK_2: - D_80280A30 = 255; + case BTL_SUBSTATE_END_BATTLE_EXEC_STAGE_SCRIPT: + BattleScreenFadeAmt = 255; gBattleStatus.flags1 &= ~BS_FLAGS1_ACTORS_VISIBLE; - if (D_800DC064 == NULL) { - stage = blah->stage; + if (gCurrentStagePtr == NULL) { + stage = battle->stage; } else { - stage = D_800DC064->stage;; + stage = gCurrentStagePtr->stage; } if (stage->postBattle == NULL) { gBattleSubState = BTL_SUBSTATE_END_BATTLE_CLEANUP; @@ -2080,12 +2083,11 @@ void btl_state_update_end_battle(void) { gBattleSubState = BTL_SUBSTATE_END_BATTLE_AWAIT_STAGE_SCRIPT; break; case BTL_SUBSTATE_END_BATTLE_AWAIT_STAGE_SCRIPT: - if (!does_script_exist(battleStatus->controlScriptID)) { - gBattleSubState = BTL_SUBSTATE_END_BATTLE_CLEANUP; - // fallthrough - } else { + if (does_script_exist(battleStatus->controlScriptID)) { break; } + gBattleSubState = BTL_SUBSTATE_END_BATTLE_CLEANUP; + // fallthrough case BTL_SUBSTATE_END_BATTLE_CLEANUP: kill_all_scripts(); for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { @@ -2099,7 +2101,7 @@ void btl_state_update_end_battle(void) { btl_delete_player_actor(battleStatus->playerActor); - if (battleStatus->nextMerleeSpellType == MERLEE_SPELL_4) { + if (battleStatus->nextMerleeSpellType == MERLEE_SPELL_COIN_BOOST) { encounterStatus->merleeCoinBonus = TRUE; battleStatus->nextMerleeSpellType = MERLEE_SPELL_0; } @@ -2124,7 +2126,7 @@ void btl_state_update_end_battle(void) { s16 mapID; btl_set_state(BATTLE_STATE_0); - D_800DC4D0 = gBattleState; + gLastDrawBattleState = gBattleState; get_map_IDs_by_name("gv_01", &areaID, &mapID); gGameStatusPtr->areaID = areaID; gGameStatusPtr->mapID = mapID; @@ -2132,7 +2134,7 @@ void btl_state_update_end_battle(void) { set_game_mode(GAME_MODE_ENTER_WORLD); } else { btl_set_state(BATTLE_STATE_0); - D_800DC4D0 = gBattleState; + gLastDrawBattleState = gBattleState; func_8003E514(1); set_game_mode(GAME_MODE_END_BATTLE); } @@ -2145,9 +2147,9 @@ void btl_state_draw_end_battle(void) { if (gCurrentEncounter.battleOutcome == OUTCOME_PLAYER_LOST && !(gBattleStatus.flags1 & BS_FLAGS1_NO_GAME_OVER)) { camera->auxBoomZOffset += 256; - set_screen_overlay_params_front(7, D_80280A30); + set_screen_overlay_params_front(7, BattleScreenFadeAmt); } else { - set_screen_overlay_params_front(0, D_80280A30); + set_screen_overlay_params_front(0, BattleScreenFadeAmt); } } @@ -2182,21 +2184,23 @@ void btl_state_update_run_away(void) { Actor* player = battleStatus->playerActor; Actor* partner = battleStatus->partnerActor; Actor* enemy; - s32 var_s0; - f32 var_f2; + s32 enemyCount; + f32 totalEscapeChance; Evt* script; s32 i; switch (gBattleSubState) { - case BTL_SUBSTATE_RUN_AWAY_UNK_0: + case BTL_SUBSTATE_RUN_AWAY_EXEC_SCRIPT: battleStatus->unk_8C = 0; - gBattleStatus.flags1 &= ~BS_FLAGS1_ENEMY_FLED; + gBattleStatus.flags1 &= ~BS_FLAGS1_BATTLE_FLED; gBattleStatus.flags2 |= BS_FLAGS2_10 | BS_FLAGS2_8 | BS_FLAGS2_4 | BS_FLAGS2_2; playerData->unk_2A6++; btl_cam_use_preset(BTL_CAM_PRESET_25); - var_s0 = 0; btl_cam_target_actor(ACTOR_PLAYER); - var_f2 = 0.0f; + + // calculate average escape chance + enemyCount = 0; + totalEscapeChance = 0.0f; for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { enemy = battleStatus->enemyActors[i]; @@ -2205,26 +2209,28 @@ void btl_state_update_run_away(void) { if (!(enemy->flags & ACTOR_FLAG_NO_DMG_APPLY)) { f32 escapeChance = enemy->actorBlueprint->escapeChance; - var_s0 += 1; - if (enemy->debuff == 3 || - enemy->debuff == 4 || - enemy->debuff == 5 || - enemy->debuff == 6 || - enemy->debuff == 7 || - enemy->debuff == 8) + + if (enemy->debuff == STATUS_FEAR || + enemy->debuff == STATUS_DIZZY || + enemy->debuff == STATUS_PARALYZE || + enemy->debuff == STATUS_SLEEP || + enemy->debuff == STATUS_FROZEN || + enemy->debuff == STATUS_STOP) { escapeChance = 100.0f; } - var_f2 += escapeChance; + totalEscapeChance += escapeChance; + enemyCount += 1; } } } } + player->state.varTable[0] = totalEscapeChance / enemyCount; - player->state.varTable[0] = var_f2 / var_s0; if (gGameStatusPtr->debugEnemyContact == DEBUG_CONTACT_AUTO_FLEE) { player->state.varTable[0] = 100; } + battleStatus->battlePhase = PHASE_RUN_AWAY_START; script = start_script(&PlayerScriptDispatcher, EVT_PRIORITY_A, 0); player->takeTurnScript = script; @@ -2236,47 +2242,50 @@ void btl_state_update_run_away(void) { partner->takeTurnScriptID = script->id; script->owner1.actorID = ACTOR_PARTNER; } - gBattleSubState = BTL_SUBSTATE_RUN_AWAY_UNK_2; + gBattleSubState = BTL_SUBSTATE_RUN_AWAY_AWAIT_SCRIPT; break; - case BTL_SUBSTATE_RUN_AWAY_UNK_2: - if (!does_script_exist(player->takeTurnScriptID) && battleStatus->unk_8C == 0) { - if (!(gBattleStatus.flags1 & BS_FLAGS1_ENEMY_FLED)) { - gBattleSubState = BTL_SUBSTATE_RUN_AWAY_UNK_3; + case BTL_SUBSTATE_RUN_AWAY_AWAIT_SCRIPT: + if (does_script_exist(player->takeTurnScriptID) || battleStatus->unk_8C != 0) { + break; + } + if (!(gBattleStatus.flags1 & BS_FLAGS1_BATTLE_FLED)) { + gBattleSubState = BTL_SUBSTATE_RUN_AWAY_EXEC_POST_FAILURE; + } else { + currentEncounter->battleOutcome = OUTCOME_PLAYER_FLED; + if (is_ability_active(ABILITY_RUNAWAY_PAY) == 0) { + gBattleSubState = BTL_SUBSTATE_RUN_AWAY_DONE; } else { - currentEncounter->battleOutcome = OUTCOME_PLAYER_FLED; - if (is_ability_active(ABILITY_RUNAWAY_PAY) == 0) { - gBattleSubState = BTL_SUBSTATE_RUN_AWAY_UNK_B; - } else { - status_menu_start_blinking_starpoints(); - func_8023E104(); - D_8029F264 = 0; - D_8029F24C = 0; - D_80280A30 = 0; - D_8029F25C = battleStatus->totalStarPoints * 100; - D_8029F250 = 20; - D_8029F260 = D_8029F25C / D_8029F250; - gBattleSubState = BTL_SUBSTATE_RUN_AWAY_UNK_A; - } + status_menu_start_blinking_starpoints(); + func_8023E104(); + D_8029F264 = 0; + D_8029F24C = 0; + BattleScreenFadeAmt = 0; + // divide reward into 20 increments + RunAwayRewardTotal = battleStatus->totalStarPoints * 100; + RunAwayRewardStep = 20; + RunAwayRewardIncrement = RunAwayRewardTotal / RunAwayRewardStep; + gBattleSubState = BTL_SUBSTATE_RUN_AWAY_GIVE_STAR_POINTS; } } break; } - if (gBattleSubState == BTL_SUBSTATE_RUN_AWAY_UNK_A) { + if (gBattleSubState == BTL_SUBSTATE_RUN_AWAY_GIVE_STAR_POINTS) { if (battleStatus->totalStarPoints != 0) { - s8 temp_v1_4; + s32 prevSP; - D_8029F25C -= D_8029F260; - temp_v1_4 = D_8029F25C / 100; - var_s0 = battleStatus->totalStarPoints - temp_v1_4; - battleStatus->totalStarPoints = temp_v1_4; + //TODO shouldnt need to reuse enemyCount here, see BTL_SUBSTATE_CELEBRATE_TALLY_STAR_POINTS + RunAwayRewardTotal -= RunAwayRewardIncrement; + prevSP = battleStatus->totalStarPoints; + battleStatus->totalStarPoints = (s8)(RunAwayRewardTotal / 100); + enemyCount = prevSP - battleStatus->totalStarPoints; - if (var_s0 > 0) { + if (enemyCount > 0) { sfx_play_sound(SOUND_211); } - playerData->starPoints += var_s0; - D_80280A30 += 1; - if (D_8029F250 == 0 && battleStatus->totalStarPoints != 0) { + playerData->starPoints += enemyCount; + BattleScreenFadeAmt++; + if (RunAwayRewardStep == 0 && battleStatus->totalStarPoints != 0) { playerData->starPoints++; } } @@ -2284,17 +2293,17 @@ void btl_state_update_run_away(void) { playerData->starPoints = 99; } if (battleStatus->totalStarPoints == 0) { - if (D_8029F250 != 0) { - D_8029F250--; + if (RunAwayRewardStep != 0) { + RunAwayRewardStep--; } else { status_menu_stop_blinking_starpoints(); func_8023E11C(); - gBattleSubState = BTL_SUBSTATE_RUN_AWAY_UNK_B; + gBattleSubState = BTL_SUBSTATE_RUN_AWAY_DONE; } } } - if (gBattleSubState == BTL_SUBSTATE_RUN_AWAY_UNK_B) { + if (gBattleSubState == BTL_SUBSTATE_RUN_AWAY_DONE) { playerData->battlesFled++; if (!(gBattleStatus.flags2 & BS_FLAGS2_DONT_STOP_MUSIC)) { bgm_set_song(0, -1, 0, 1500, 8); @@ -2303,7 +2312,7 @@ void btl_state_update_run_away(void) { } switch (gBattleSubState) { - case BTL_SUBSTATE_RUN_AWAY_UNK_3: + case BTL_SUBSTATE_RUN_AWAY_EXEC_POST_FAILURE: battleStatus->battlePhase = PHASE_RUN_AWAY_FAIL; script = start_script(&PlayerScriptDispatcher, EVT_PRIORITY_A, 0); player->takeTurnScript = script; @@ -2315,9 +2324,9 @@ void btl_state_update_run_away(void) { partner->takeTurnScriptID = script->id; script->owner1.actorID = ACTOR_PARTNER; } - gBattleSubState = BTL_SUBSTATE_RUN_AWAY_UNK_4; + gBattleSubState = BTL_SUBSTATE_RUN_AWAY_AWAIT_POST_FAILURE; break; - case BTL_SUBSTATE_RUN_AWAY_UNK_4: + case BTL_SUBSTATE_RUN_AWAY_AWAIT_POST_FAILURE: if (D_8029F248 != 0) { D_8029F248--; return; @@ -2343,7 +2352,7 @@ void btl_state_update_defeat(void) { Evt* script; switch (gBattleSubState) { - case BTL_SUBSTATE_DEFEAT_UNK_0: + case BTL_SUBSTATE_DEFEAT_INIT: battleStatus->flags1 &= ~BS_FLAGS1_8; gBattleStatus.flags2 &= ~BS_FLAGS2_2; gBattleStatus.flags2 &= ~BS_FLAGS2_4; @@ -2366,7 +2375,7 @@ void btl_state_update_defeat(void) { } btl_cam_use_preset(BTL_CAM_PRESET_25); - btl_cam_target_actor(0); + btl_cam_target_actor(ACTOR_PLAYER); battleStatus->battlePhase = PHASE_RUN_AWAY_RESET; script = start_script(&PlayerScriptDispatcher, EVT_PRIORITY_A, 0); player->takeTurnScript = script; @@ -2379,30 +2388,34 @@ void btl_state_update_defeat(void) { partner->takeTurnScriptID = script->id; script->owner1.actorID = ACTOR_PARTNER; } - gBattleSubState = BTL_SUBSTATE_DEFEAT_UNK_1; + gBattleSubState = BTL_SUBSTATE_DEFEAT_CHECK_LIFE_SHROOM; break; - case BTL_SUBSTATE_DEFEAT_UNK_1: - if (!does_script_exist(player->takeTurnScriptID) && battleStatus->unk_8C == 0) { - if (find_item(ITEM_LIFE_SHROOM) >= 0) { - battleStatus->battlePhase = PHASE_USE_LIFE_SHROOM; - script = start_script(&PlayerScriptDispatcher, EVT_PRIORITY_A, 0); - player->takeTurnScript = script; - player->takeTurnScriptID = script->id; - script->owner1.actorID = ACTOR_PLAYER; - gBattleSubState = BTL_SUBSTATE_DEFEAT_UNK_2; - } else { - gBattleSubState = BTL_SUBSTATE_DEFEAT_UNK_A; - } + case BTL_SUBSTATE_DEFEAT_CHECK_LIFE_SHROOM: + if (does_script_exist(player->takeTurnScriptID) || battleStatus->unk_8C != 0) { + break; + } + if (find_item(ITEM_LIFE_SHROOM) >= 0) { + battleStatus->battlePhase = PHASE_USE_LIFE_SHROOM; + script = start_script(&PlayerScriptDispatcher, EVT_PRIORITY_A, 0); + player->takeTurnScript = script; + player->takeTurnScriptID = script->id; + script->owner1.actorID = ACTOR_PLAYER; + gBattleSubState = BTL_SUBSTATE_DEFEAT_AWAIT_LIFE_SHROOM; + } else { + gBattleSubState = BTL_SUBSTATE_DEFEAT_DONE; } break; - case BTL_SUBSTATE_DEFEAT_UNK_2: - if (!does_script_exist(player->takeTurnScriptID) && battleStatus->unk_8C == 0) { - gBattleSubState = BTL_SUBSTATE_DEFEAT_UNK_A; + case BTL_SUBSTATE_DEFEAT_AWAIT_LIFE_SHROOM: + if (does_script_exist(player->takeTurnScriptID) || battleStatus->unk_8C != 0) { + break; } + // never reached if life shroom is successful. its item script calls RestorePreDefeatState, + // resetting the state to BATTLE_STATE_ENEMY_MOVE (based on the value of gDefeatedBattleState) + gBattleSubState = BTL_SUBSTATE_DEFEAT_DONE; break; } - if (gBattleSubState == BTL_SUBSTATE_DEFEAT_UNK_A) { + if (gBattleSubState == BTL_SUBSTATE_DEFEAT_DONE) { currentEncounter->battleOutcome = OUTCOME_PLAYER_LOST; if (!(gBattleStatus.flags2 & BS_FLAGS2_DONT_STOP_MUSIC)) { bgm_set_song(0, -1, 0, 1500, 8); @@ -2435,7 +2448,7 @@ void btl_state_update_change_partner(void) { s32 i; switch (gBattleSubState) { - case BTL_SUBSTATE_CHANGE_PARTNER_UNK_0: + case BTL_SUBSTATE_CHANGE_PARTNER_INIT: player->flags &= ~ACTOR_FLAG_8000000; partner->flags &= ~ACTOR_FLAG_8000000; battleStatus->unk_8C = 0; @@ -2444,7 +2457,7 @@ void btl_state_update_change_partner(void) { btl_cam_set_target_pos(-89.0, 40.0, -99.0); btl_cam_set_zoom(372); btl_cam_set_zoffset(0); - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { enemyActor = battleStatus->enemyActors[i]; @@ -2454,11 +2467,11 @@ void btl_state_update_change_partner(void) { } } - battleStatus->unk_5C[0] = -1; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] = -1; D_8029F248 = 10; - gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_UNK_2; + gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_EXEC_PUT_AWAY; - case BTL_SUBSTATE_CHANGE_PARTNER_UNK_2: + case BTL_SUBSTATE_CHANGE_PARTNER_EXEC_PUT_AWAY: if (D_8029F248 != 0) { D_8029F248--; break; @@ -2471,80 +2484,84 @@ void btl_state_update_change_partner(void) { state->unk_18.x = partner->currentPos.x; state->unk_18.y = 0.0f; state->unk_18.z = partner->currentPos.z; - gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_UNK_3; + gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_LOAD_NEW_PARTNER; break; - case BTL_SUBSTATE_CHANGE_PARTNER_UNK_3: - if (!does_script_exist(battleStatus->controlScriptID)) { - btl_delete_actor(partner); - playerData->currentPartner = battleStatus->unk_1AC; - load_partner_actor(); - partner = battleStatus->partnerActor; - partner->scale.x = 0.1f; - partner->scale.y = 0.1f; - partner->scale.z = 0.1f; - partner->state.goalPos.x = state->unk_18.x; - partner->state.goalPos.y = partner->currentPos.y; - partner->state.goalPos.z = state->unk_18.z; - partner->currentPos.x = player->currentPos.x; - partner->currentPos.y = player->currentPos.y + 25.0f; - partner->currentPos.z = player->currentPos.z; - gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_UNK_4; + case BTL_SUBSTATE_CHANGE_PARTNER_LOAD_NEW_PARTNER: + if (does_script_exist(battleStatus->controlScriptID)) { + break; } + btl_delete_actor(partner); + playerData->currentPartner = battleStatus->unk_1AC; + load_partner_actor(); + partner = battleStatus->partnerActor; + partner->scale.x = 0.1f; + partner->scale.y = 0.1f; + partner->scale.z = 0.1f; + partner->state.goalPos.x = state->unk_18.x; + partner->state.goalPos.y = partner->currentPos.y; + partner->state.goalPos.z = state->unk_18.z; + partner->currentPos.x = player->currentPos.x; + partner->currentPos.y = player->currentPos.y + 25.0f; + partner->currentPos.z = player->currentPos.z; + gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_EXEC_BRING_OUT; break; - case BTL_SUBSTATE_CHANGE_PARTNER_UNK_4: + case BTL_SUBSTATE_CHANGE_PARTNER_EXEC_BRING_OUT: partner = battleStatus->partnerActor; if (partner != NULL) { - if (!does_script_exist(partner->takeTurnScriptID)) { - partner->takeTurnScript = NULL; - } else { + if (does_script_exist(partner->takeTurnScriptID)) { break; } + partner->takeTurnScript = NULL; } script = start_script(&BtlBringPartnerOut, EVT_PRIORITY_A, 0); battleStatus->controlScript = script; battleStatus->controlScriptID = script->id; script->owner1.actorID = ACTOR_PARTNER; - gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_UNK_5; + gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_EXEC_PHASE; break; - case BTL_SUBSTATE_CHANGE_PARTNER_UNK_5: - if (!does_script_exist(battleStatus->controlScriptID)) { - partner = battleStatus->partnerActor; - if (partner != NULL) { - if (partner->handlePhaseSource != NULL) { - battleStatus->battlePhase = PHASE_PLAYER_BEGIN; - script = start_script(partner->handlePhaseSource, EVT_PRIORITY_A, 0); - partner->handlePhaseScript = script; - partner->handleBatttlePhaseScriptID = script->id; - script->owner1.actorID = ACTOR_PARTNER; - } - } - gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_UNK_6; + case BTL_SUBSTATE_CHANGE_PARTNER_EXEC_PHASE: + if (does_script_exist(battleStatus->controlScriptID)) { + break; } - break; - case BTL_SUBSTATE_CHANGE_PARTNER_UNK_6: partner = battleStatus->partnerActor; - if (partner == NULL || partner->handlePhaseSource == NULL - || !does_script_exist(partner->handleBatttlePhaseScriptID)) { - btl_cam_use_preset(BTL_CAM_PRESET_C); - gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_UNK_7; + if (partner != NULL) { + if (partner->handlePhaseSource != NULL) { + battleStatus->battlePhase = PHASE_PLAYER_BEGIN; + script = start_script(partner->handlePhaseSource, EVT_PRIORITY_A, 0); + partner->handlePhaseScript = script; + partner->handleBatttlePhaseScriptID = script->id; + script->owner1.actorID = ACTOR_PARTNER; + } } + gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_AWAIT_PHASE; break; - case BTL_SUBSTATE_CHANGE_PARTNER_UNK_7: - if (battleStatus->unk_8C == 0) { - gBattleStatus.flags2 &= ~BS_FLAGS2_10; - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { - if (player_team_is_ability_active(player, ABILITY_QUICK_CHANGE) != FALSE) { - btl_set_state(BATTLE_STATE_PREPARE_MENU); - } else { - btl_set_state(BATTLE_STATE_END_PLAYER_TURN); - } + case BTL_SUBSTATE_CHANGE_PARTNER_AWAIT_PHASE: + partner = battleStatus->partnerActor; + if (partner != NULL) { + if (partner->handlePhaseSource != NULL && does_script_exist(partner->handleBatttlePhaseScriptID)) { + break; + } + } + btl_cam_use_preset(BTL_CAM_PRESET_C); + gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_DONE; + break; + case BTL_SUBSTATE_CHANGE_PARTNER_DONE: + if (battleStatus->unk_8C != 0) { + break; + } + gBattleStatus.flags2 &= ~BS_FLAGS2_10; + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { + if (player_team_is_ability_active(player, ABILITY_QUICK_CHANGE) != FALSE) { + btl_set_state(BATTLE_STATE_PREPARE_MENU); } else { - if (player_team_is_ability_active(player, ABILITY_QUICK_CHANGE) == FALSE) { - btl_set_state(BATTLE_STATE_END_PARTNER_TURN); - } else { - btl_set_state(BATTLE_STATE_PREPARE_MENU); - } + btl_set_state(BATTLE_STATE_END_PLAYER_TURN); + } + } else { + if (player_team_is_ability_active(player, ABILITY_QUICK_CHANGE) == FALSE) { + btl_set_state(BATTLE_STATE_END_PARTNER_TURN); + } else { + btl_set_state(BATTLE_STATE_PREPARE_MENU); } } break; @@ -2561,33 +2578,33 @@ void btl_state_update_player_move(void) { s32 messageIndex; Actor* actor; Evt* script; - s32 foundEnemy; + s32 enemyNotDone; s8 tipIndex; s32 i; if (gBattleSubState == BTL_SUBSTATE_PLAYER_MOVE_INIT) { + battleStatus->unk_8C = 0; battleStatus->unk_86 = 127; battleStatus->blockResult = 127; - battleStatus->unk_8C = 0; battleStatus->lastAttackDamage = 0; battleStatus->unk_19A = 0; gBattleStatus.flags1 &= ~BS_FLAGS1_AUTO_SUCCEED_ACTION; - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; reset_actor_turn_info(); player->flags &= ~ACTOR_FLAG_8000000; if (partner != NULL) { partner->flags &= ~ACTOR_FLAG_8000000; } - btl_cam_target_actor(0); + btl_cam_target_actor(ACTOR_PLAYER); gBattleStatus.flags1 &= ~BS_FLAGS1_8; - player->status = 0; + player->statusAfflicted = 0; gBattleStatus.flags2 |= BS_FLAGS2_8; gBattleStatus.flags1 &= ~BS_FLAGS1_200000; for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { actor = battleStatus->enemyActors[i]; if (actor != NULL) { - actor->status = 0; + actor->statusAfflicted = 0; } } @@ -2613,29 +2630,30 @@ void btl_state_update_player_move(void) { gBattleSubState = BTL_SUBSTATE_PLAYER_MOVE_BEGIN_SHOW_TIP; } else { gBattleSubState = BTL_SUBSTATE_PLAYER_MOVE_EXECUTE_MOVE; - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; } } else { gBattleSubState = BTL_SUBSTATE_PLAYER_MOVE_EXECUTE_MOVE; - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; } } switch (gBattleSubState) { case BTL_SUBSTATE_PLAYER_MOVE_BEGIN_SHOW_TIP: - if (player->takeTurnScript == NULL || !does_script_exist(player->takeTurnScriptID)) { - player->takeTurnScript = NULL; - if (!is_ability_active(ABILITY_BERSERKER)) { - if (battleStatus->selectedMoveID != MOVE_NONE) { - tipIndex = gMoveTable[battleStatus->selectedMoveID].actionTip; - if (tipIndex >= 0) { - btl_show_battle_message(BTL_MSG_2E + tipIndex, 60); - } + if (player->takeTurnScript != NULL && does_script_exist(player->takeTurnScriptID)) { + break; + } + player->takeTurnScript = NULL; + if (!is_ability_active(ABILITY_BERSERKER)) { + if (battleStatus->selectedMoveID != MOVE_NONE) { + tipIndex = gMoveTable[battleStatus->selectedMoveID].actionTip; + if (tipIndex >= 0) { + btl_show_battle_message(BTL_MSG_2E + tipIndex, 60); } } - D_8029F248 = 2; - gBattleSubState = BTL_SUBSTATE_PLAYER_MOVE_SHOW_TIP_DELAY; } + D_8029F248 = 2; + gBattleSubState = BTL_SUBSTATE_PLAYER_MOVE_SHOW_TIP_DELAY; break; case BTL_SUBSTATE_PLAYER_MOVE_SHOW_TIP_DELAY: if (D_8029F248 != 0) { @@ -2690,34 +2708,34 @@ void btl_state_update_player_move(void) { } // wait for all enemy battle phase scripts to finish - foundEnemy = FALSE; + enemyNotDone = FALSE; for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { actor = battleStatus->enemyActors[i]; if (actor != NULL && actor->takeTurnScript != NULL) { if (does_script_exist(actor->takeTurnScriptID)) { - foundEnemy = TRUE; + enemyNotDone = TRUE; } else { actor->takeTurnScript = NULL; } } } - if (foundEnemy) { + if (enemyNotDone) { break; } // wait for all enemy battle event scripts to finish - foundEnemy = FALSE; + enemyNotDone = FALSE; for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { actor = battleStatus->enemyActors[i]; if (actor != NULL && actor->handleEventScript != NULL) { if (does_script_exist(actor->handleEventScriptID)) { - foundEnemy = TRUE; + enemyNotDone = TRUE; } else { actor->handleEventScript = NULL; } } } - if (foundEnemy) { + if (enemyNotDone) { break; } @@ -2777,22 +2795,22 @@ void btl_state_update_player_move(void) { btl_update_ko_status(); - foundEnemy = FALSE; + enemyNotDone = FALSE; for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { actor = battleStatus->enemyActors[i]; if (actor != NULL) { - if (actor->status != 0) { - foundEnemy = TRUE; + if (actor->statusAfflicted != 0) { + enemyNotDone = TRUE; break; } } } - if (!foundEnemy) { + if (!enemyNotDone) { gBattleSubState = BTL_SUBSTATE_PLAYER_MOVE_CHECK_PLAYER_STATUS; } else { btl_cam_use_preset(BTL_CAM_PRESET_D); - switch (actor->status) { + switch (actor->statusAfflicted) { case 4: messageIndex = BTL_MSG_12; break; @@ -2827,7 +2845,7 @@ void btl_state_update_player_move(void) { for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { actor = battleStatus->enemyActors[i]; if (actor != NULL) { - actor->status = 0; + actor->statusAfflicted = 0; } } gBattleSubState = BTL_SUBSTATE_PLAYER_MOVE_AWAIT_ENEMY_STATUS_POPUP; @@ -2852,9 +2870,9 @@ void btl_state_update_player_move(void) { switch (gBattleSubState) { case BTL_SUBSTATE_PLAYER_MOVE_CHECK_PLAYER_STATUS: - if (player->status != 0) { + if (player->statusAfflicted != 0) { btl_cam_use_preset(BTL_CAM_PRESET_33); - switch (player->status) { + switch (player->statusAfflicted) { case 4: messageIndex = BTL_MSG_0A; break; @@ -2882,7 +2900,7 @@ void btl_state_update_player_move(void) { break; } btl_show_battle_message(messageIndex, 60); - player->status = 0; + player->statusAfflicted = 0; player->disableDismissTimer = 0; player->flags |= ACTOR_FLAG_8000000; gBattleSubState = BTL_SUBSTATE_PLAYER_MOVE_AWAIT_PLAYER_STATUS_POPUP; @@ -2925,18 +2943,18 @@ void btl_state_update_end_player_turn(void) { Actor* partner = battleStatus->partnerActor; Evt* script; - if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_UNK_0) { - if (battleStatus->moveCategory == BTL_MENU_TYPE_ITEM && battleStatus->itemUsesLeft >= 2) { - gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_UNK_5; + if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_CHECK_HAPPY) { + if (battleStatus->moveCategory == BTL_MENU_TYPE_ITEMS && battleStatus->itemUsesLeft >= 2) { + gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY; } else if ( !(gBattleStatus.flags2 & BS_FLAGS2_HAS_DRAINED_HP) && !is_ability_active(ABILITY_HAPPY_HEART) && !is_ability_active(ABILITY_CRAZY_HEART) && !is_ability_active(ABILITY_HAPPY_FLOWER)) { - gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_UNK_5; + gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY; } else if (player->stoneStatus == STATUS_STONE || battleStatus->outtaSightActive) { - gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_UNK_5; + gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY; } else { s32 prevHPDrainCount = 0; s32 hpRecovery = 0; @@ -2958,7 +2976,7 @@ void btl_state_update_end_player_turn(void) { } if (prevHPDrainCount + hpRecovery + fpRecovery == 0) { - gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_UNK_5; + gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY; } else { battleStatus->battlePhase = PHASE_PLAYER_HAPPY; script = start_script(&PlayerScriptDispatcher, EVT_PRIORITY_A, 0); @@ -2984,16 +3002,20 @@ void btl_state_update_end_player_turn(void) { } gBattleStatus.flags2 &= ~BS_FLAGS2_HAS_DRAINED_HP; - gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_UNK_5; + gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY; } } } - if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_UNK_5) { - if ((player->takeTurnScript == NULL) || !does_script_exist(player->takeTurnScriptID)) { + switch (gBattleSubState) { + case BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_HAPPY: + if (player->takeTurnScript != NULL && does_script_exist(player->takeTurnScriptID)) { + break; + } player->takeTurnScript = NULL; - if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) || (gBattleStatus.flags1 & BS_FLAGS1_100000)) { - gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_UNK_A; + + if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) || (gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { + gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_DONE; } else { player->state.currentPos.x = player->homePos.x; player->state.currentPos.z = player->homePos.z; @@ -3001,12 +3023,12 @@ void btl_state_update_end_player_turn(void) { player->state.goalPos.z = partner->homePos.z; player->state.moveTime = 4; player->state.angle = 0.0f; - gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_UNK_6; + gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_SWAP; } - } + break; } - if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_UNK_6) { + if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_SWAP) { if (player->state.moveTime != 0) { player->currentPos.x += (player->state.goalPos.x - player->currentPos.x) / player->state.moveTime; player->currentPos.z += (player->state.goalPos.z - player->currentPos.z) / player->state.moveTime; @@ -3030,14 +3052,14 @@ void btl_state_update_end_player_turn(void) { player->homePos.z = player->currentPos.z; partner->homePos.x = partner->currentPos.x; partner->homePos.z = partner->currentPos.z; - gBattleStatus.flags1 |= BS_FLAGS1_100000; - gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_UNK_A; + gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK; + gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_DONE; } } - if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_UNK_A) { + if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_DONE) { if(!btl_check_enemies_defeated()) { - if (battleStatus->moveCategory == BTL_MENU_TYPE_ITEM && battleStatus->itemUsesLeft >= 2) { + if (battleStatus->moveCategory == BTL_MENU_TYPE_ITEMS && battleStatus->itemUsesLeft >= 2) { btl_cam_use_preset(BTL_CAM_PRESET_C); btl_cam_move(10); gBattleStatus.flags2 &= ~BS_FLAGS2_2; @@ -3055,8 +3077,9 @@ void btl_state_update_end_player_turn(void) { if (battleStatus->itemUsesLeft != 0) { battleStatus->itemUsesLeft--; if (battleStatus->itemUsesLeft != 0) { + // double or triple dip has not run out yet, let the player choose another item btl_set_state(BATTLE_STATE_PREPARE_MENU); - gBattleSubState = BATTLE_SUBSTATE_PREPARE_MENU_UNK_70; + gBattleSubState = BATTLE_SUBSTATE_PREPARE_MENU_DIPPING; return; } @@ -3068,13 +3091,13 @@ void btl_state_update_end_player_turn(void) { if (battleStatus->hustleTurns != 0 && (gBattleStatus.flags1 & BS_FLAGS1_HUSTLED)) { gBattleStatus.flags2 &= ~BS_FLAGS2_2; - btl_set_state(BATTLE_STATE_PREPARE_MENU); + return; } else { gBattleStatus.flags1 &= ~BS_FLAGS1_HUSTLED; btl_set_state(BATTLE_STATE_BEGIN_PARTNER_TURN); + return; } - return; } if (gBattleStatus.flags1 & BS_FLAGS1_HUSTLED) { @@ -3109,41 +3132,41 @@ void btl_state_update_partner_move(void) { Actor* enemyActor; Evt* script; s8 switchCondition; - s32 phi_s3; + s32 enemyFound; s32 messageIndex; s32 i; switch (gBattleSubState) { - case BTL_SUBSTATE_PARTNER_MOVE_UNK_0: + case BTL_SUBSTATE_PARTNER_MOVE_INIT: if (partner == NULL) { btl_set_state(BATTLE_STATE_9); - } else { - battleStatus->unk_8C = 0; - battleStatus->unk_86 = 127; - battleStatus->blockResult = 127; - battleStatus->unk_19A = 0; - gBattleStatus.flags1 &= ~BS_FLAGS1_AUTO_SUCCEED_ACTION; - gBattleStatus.flags1 &= ~BS_FLAGS1_2; - reset_actor_turn_info(); - partner->status = 0; - partner->flags &= ~ACTOR_FLAG_8000000; - player->flags &= ~ACTOR_FLAG_8000000; - deduct_current_move_fp(); - btl_cam_target_actor(ACTOR_PARTNER); - gBattleStatus.flags2 |= BS_FLAGS2_10; - gBattleStatus.flags1 &= ~BS_FLAGS1_200000; - - for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { - enemyActor = battleStatus->enemyActors[i]; - if (enemyActor != NULL) { - enemyActor->status = 0; - } - } - btl_cam_use_preset(BTL_CAM_PRESET_C); - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_2; + break; } + battleStatus->unk_8C = 0; + battleStatus->unk_86 = 127; + battleStatus->blockResult = 127; + battleStatus->unk_19A = 0; + gBattleStatus.flags1 &= ~BS_FLAGS1_AUTO_SUCCEED_ACTION; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; + reset_actor_turn_info(); + partner->statusAfflicted = 0; + partner->flags &= ~ACTOR_FLAG_8000000; + player->flags &= ~ACTOR_FLAG_8000000; + deduct_current_move_fp(); + btl_cam_target_actor(ACTOR_PARTNER); + gBattleStatus.flags2 |= BS_FLAGS2_10; + gBattleStatus.flags1 &= ~BS_FLAGS1_200000; + + for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { + enemyActor = battleStatus->enemyActors[i]; + if (enemyActor != NULL) { + enemyActor->statusAfflicted = 0; + } + } + btl_cam_use_preset(BTL_CAM_PRESET_C); + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_EXECUTE_MOVE; break; - case BTL_SUBSTATE_PARTNER_MOVE_UNK_2: + case BTL_SUBSTATE_PARTNER_MOVE_EXECUTE_MOVE: for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { enemyActor = battleStatus->enemyActors[i]; if (enemyActor != NULL) { @@ -3161,128 +3184,141 @@ void btl_state_update_partner_move(void) { partner->takeTurnScript = script; partner->takeTurnScriptID = script->id; script->owner1.actorID = ACTOR_PARTNER; - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_3; + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_HANDLE_RESULTS; break; - case BTL_SUBSTATE_PARTNER_MOVE_UNK_3: + case BTL_SUBSTATE_PARTNER_MOVE_HANDLE_RESULTS: if (!(gBattleStatus.flags1 & BS_FLAGS1_200000)) { - if (partner->takeTurnScript == NULL || !does_script_exist(partner->takeTurnScriptID)) { - partner->takeTurnScript = NULL; - } else { + if (partner->takeTurnScript != NULL && does_script_exist(partner->takeTurnScriptID)) { break; } + partner->takeTurnScript = NULL; } gBattleStatus.flags1 &= ~BS_FLAGS1_100; - if ((partner->handleEventScript == NULL || !does_script_exist(partner->handleEventScriptID)) - && ((partner->handleEventScript = NULL, player->handleEventScript == NULL) - || !does_script_exist(player->handleEventScriptID))) { + if (partner->handleEventScript != NULL && does_script_exist(partner->handleEventScriptID)) { + break; + } + partner->handleEventScript = NULL; - player->handleEventScript = NULL; - for (phi_s3 = FALSE, i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { - enemyActor = battleStatus->enemyActors[i]; - if (enemyActor != NULL && enemyActor->takeTurnScript != NULL) { - if (does_script_exist(enemyActor->takeTurnScriptID)) { - phi_s3 = TRUE; - } else { - enemyActor->takeTurnScript = NULL; - } - } - } - - if (phi_s3 == FALSE) { - for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { - enemyActor = battleStatus->enemyActors[i]; - if (enemyActor != NULL && enemyActor->handleEventScript != NULL) { - if (does_script_exist(enemyActor->handleEventScriptID)) { - phi_s3 = TRUE; - } else { - enemyActor->handleEventScript = NULL; - } - } - } - - if (phi_s3 == FALSE) { - for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { - enemyActor = battleStatus->enemyActors[i]; - if (enemyActor != NULL) { - enemyActor->flags &= ~ACTOR_FLAG_80000; - } - } - if (battleStatus->unk_8C == 0) { - if (gGameStatusPtr->demoFlags & 1) { - btl_set_state(BATTLE_STATE_END_DEMO_BATTLE); - break; - } - decrement_status_menu_disabled(); - if (playerData->currentPartner == PARTNER_GOOMBARIO && battleStatus->moveCategory == BTL_MENU_TYPE_5 - && battleStatus->selectedMoveID != MOVE_CHARGE) { - partner->isGlowing = 0; - gBattleStatus.flags1 &= ~BS_FLAGS1_40000000; - } - if (btl_check_player_defeated()) { - return; - } - - for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { - enemyActor = battleStatus->enemyActors[i]; - if (enemyActor != NULL) { - if (!(enemyActor->flags & ACTOR_FLAG_NO_DMG_APPLY)) { - enemyActor->flags |= (ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000); - } - } - } - - btl_update_ko_status(); - - if (partner->status == 0xD && !btl_are_all_enemies_defeated()) { - btl_cam_use_preset(BTL_CAM_PRESET_54); - btl_show_battle_message(BTL_MSG_23, 60); - partner->status = 0; - partner->disableDismissTimer = 0; - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_B; - partner->flags |= ACTOR_FLAG_8000000; - } else { - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_14; - } - } + if (player->handleEventScript != NULL && does_script_exist(player->handleEventScriptID)) { + break; + } + player->handleEventScript = NULL; + + enemyFound = FALSE; + for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { + enemyActor = battleStatus->enemyActors[i]; + if (enemyActor != NULL && enemyActor->takeTurnScript != NULL) { + if (does_script_exist(enemyActor->takeTurnScriptID)) { + enemyFound = TRUE; + } else { + enemyActor->takeTurnScript = NULL; } } } - break; - case BTL_SUBSTATE_PARTNER_MOVE_UNK_B: - if (btl_is_popup_displayed() == FALSE) { - btl_cam_use_preset(BTL_CAM_PRESET_C); - btl_cam_move(15); - D_8029F248 = 10; - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_C; + if (enemyFound) { + break; + } + + enemyFound = FALSE; + for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { + enemyActor = battleStatus->enemyActors[i]; + if (enemyActor != NULL && enemyActor->handleEventScript != NULL) { + if (does_script_exist(enemyActor->handleEventScriptID)) { + enemyFound = TRUE; + } else { + enemyActor->handleEventScript = NULL; + } + } + } + if (enemyFound) { + break; + } + + for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { + enemyActor = battleStatus->enemyActors[i]; + if (enemyActor != NULL) { + enemyActor->flags &= ~ACTOR_FLAG_80000; + } + } + + if (battleStatus->unk_8C != 0) { + break; + } + + if (gGameStatusPtr->demoFlags & 1) { + btl_set_state(BATTLE_STATE_END_DEMO_BATTLE); + break; + } + decrement_status_menu_disabled(); + if (playerData->currentPartner == PARTNER_GOOMBARIO + && battleStatus->moveCategory == BTL_MENU_TYPE_CHANGE_PARTNER + && battleStatus->selectedMoveID != MOVE_CHARGE) { + partner->isGlowing = 0; + gBattleStatus.flags1 &= ~BS_FLAGS1_40000000; + } + if (btl_check_player_defeated()) { + return; + } + + for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { + enemyActor = battleStatus->enemyActors[i]; + if (enemyActor != NULL) { + if (!(enemyActor->flags & ACTOR_FLAG_NO_DMG_APPLY)) { + enemyActor->flags |= (ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000); + } + } + } + + btl_update_ko_status(); + + if (partner->statusAfflicted == STATUS_DAZE && !btl_are_all_enemies_defeated()) { + btl_cam_use_preset(BTL_CAM_PRESET_54); + btl_show_battle_message(BTL_MSG_23, 60); + partner->statusAfflicted = 0; + partner->disableDismissTimer = 0; + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_AWAIT_PARTNER_STATUS_POPUP; + partner->flags |= ACTOR_FLAG_8000000; + } else { + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_CHECK_ENEMY_STATUS; } break; - case BTL_SUBSTATE_PARTNER_MOVE_UNK_C: + case BTL_SUBSTATE_PARTNER_MOVE_AWAIT_PARTNER_STATUS_POPUP: + if (btl_is_popup_displayed()) { + break; + } + btl_cam_use_preset(BTL_CAM_PRESET_C); + btl_cam_move(15); + D_8029F248 = 10; + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_POST_PARTNER_STATUS_POPUP; + break; + case BTL_SUBSTATE_PARTNER_MOVE_POST_PARTNER_STATUS_POPUP: if (D_8029F248 != 0) { D_8029F248--; } else { - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_14; + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_CHECK_ENEMY_STATUS; } break; } switch (gBattleSubState) { - case BTL_SUBSTATE_PARTNER_MOVE_UNK_14: - for (phi_s3 = FALSE, i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { + case BTL_SUBSTATE_PARTNER_MOVE_CHECK_ENEMY_STATUS: + enemyFound = FALSE; + for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { enemyActor = battleStatus->enemyActors[i]; if (enemyActor != NULL) { - if ((s8)enemyActor->status != 0) { - phi_s3 = TRUE; + if (enemyActor->statusAfflicted != 0) { + enemyFound = TRUE; break; } } } - if (phi_s3 == FALSE) { - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_1E; + if (!enemyFound) { + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_DONE; } else { btl_cam_use_preset(BTL_CAM_PRESET_D); - switchCondition = enemyActor->status - 4; + switchCondition = enemyActor->statusAfflicted - 4; switch (switchCondition) { case 0: messageIndex = BTL_MSG_12; @@ -3310,7 +3346,7 @@ void btl_state_update_partner_move(void) { break; default: messageIndex = 0; - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_14; + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_CHECK_ENEMY_STATUS; break; } @@ -3320,30 +3356,30 @@ void btl_state_update_partner_move(void) { for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { enemyActor = battleStatus->enemyActors[i]; if (enemyActor != NULL) { - enemyActor->status = 0; + enemyActor->statusAfflicted = 0; } } - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_15; + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_AWAIT_ENEMY_STATUS_POPUP; } break; - case BTL_SUBSTATE_PARTNER_MOVE_UNK_15: + case BTL_SUBSTATE_PARTNER_MOVE_AWAIT_ENEMY_STATUS_POPUP: if (btl_is_popup_displayed() == FALSE) { btl_cam_use_preset(BTL_CAM_PRESET_C); btl_cam_move(15); D_8029F248 = 10; - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_16; + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_POST_ENEMY_STATUS_POPUP; } break; - case BTL_SUBSTATE_PARTNER_MOVE_UNK_16: + case BTL_SUBSTATE_PARTNER_MOVE_POST_ENEMY_STATUS_POPUP: if (D_8029F248 != 0) { D_8029F248--; } else { - gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_UNK_1E; + gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_DONE; } break; } - if (gBattleSubState == BTL_SUBSTATE_PARTNER_MOVE_UNK_1E) { + if (gBattleSubState == BTL_SUBSTATE_PARTNER_MOVE_DONE) { if (partner->takeTurnScript != NULL && does_script_exist(partner->takeTurnScriptID)) { return; } @@ -3363,7 +3399,7 @@ void btl_state_update_end_partner_turn(void) { if (btl_check_enemies_defeated()) { return; } - battleStatus->flags1 &= ~BS_FLAGS1_80000; + battleStatus->flags1 &= ~BS_FLAGS1_PARTNER_ACTING; battleStatus->flags2 &= ~BS_FLAGS2_10; if (battleStatus->unk_94 < 0) { @@ -3388,7 +3424,7 @@ void btl_state_update_next_enemy(void) { switch (gBattleSubState) { case BTL_SUBSTATE_NEXT_ENEMY_INIT: - case BTL_SUBSTATE_NEXT_ENEMY_UNK_1: + case BTL_SUBSTATE_NEXT_ENEMY_UNUSED_1: i = battleStatus->nextEnemyIndex; if (i >= battleStatus->numEnemyActors) { // all enemies have been exhausted @@ -3458,10 +3494,10 @@ void btl_state_update_next_enemy(void) { } battleStatus->unk_8C = 0; - gBattleStatus.flags1 &= ~BS_FLAGS1_2; - gBattleStatus.flags1 &= ~BS_FLAGS1_ENEMY_FLED; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; + gBattleStatus.flags1 &= ~BS_FLAGS1_BATTLE_FLED; gBattleStatus.flags1 &= ~BS_FLAGS1_AUTO_SUCCEED_ACTION; - gBattleStatus.flags1 &= ~BS_FLAGS1_80000; + gBattleStatus.flags1 &= ~BS_FLAGS1_PARTNER_ACTING; player->flags &= ~ACTOR_FLAG_8000000; player->flags |= ACTOR_FLAG_4000000; @@ -3524,8 +3560,8 @@ void btl_state_update_enemy_move(void) { switch (gBattleSubState) { case BTL_SUBSTATE_ENEMY_MOVE_EXECUTE: - case BTL_SUBSTATE_ENEMY_MOVE_UNK_1: - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + case BTL_SUBSTATE_ENEMY_MOVE_UNUSED_1: + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; gBattleStatus.flags1 &= ~BS_FLAGS1_200000; player->flags &= ~ACTOR_FLAG_8000000; if (partner != NULL) { @@ -3539,9 +3575,9 @@ void btl_state_update_enemy_move(void) { battleStatus->unk_19A = 0; reset_actor_turn_info(); gBattleStatus.flags1 |= BS_FLAGS1_100; - player->status = 0; + player->statusAfflicted = 0; if (partner != NULL) { - partner->status = 0; + partner->statusAfflicted = 0; } gBattleStatus.flags2 |= BS_FLAGS2_4000; @@ -3633,14 +3669,14 @@ void btl_state_update_enemy_move(void) { btl_set_state(BATTLE_STATE_END_DEMO_BATTLE); } else { btl_update_ko_status(); - if (player->status != 0) { + if (player->statusAfflicted != 0) { player->flags |= ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000; if (partner != NULL) { partner->flags |= ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000; } btl_cam_use_preset(BTL_CAM_PRESET_33); - switch (player->status) { + switch (player->statusAfflicted) { case STATUS_DIZZY: messageIndex = BTL_MSG_0A; break; @@ -3665,7 +3701,7 @@ void btl_state_update_enemy_move(void) { break; } btl_show_battle_message(messageIndex, 60); - player->status = 0; + player->statusAfflicted = 0; gBattleSubState = BTL_SUBSTATE_ENEMY_MOVE_AWAIT_PLAYER_POPUP_DONE; break; } else { @@ -3697,12 +3733,12 @@ void btl_state_update_enemy_move(void) { switch (gBattleSubState) { case BTL_SUBSTATE_ENEMY_MOVE_CHECK_PARTNER: if (partner != NULL) { - if (partner->status == STATUS_DAZE) { + if (partner->statusAfflicted == STATUS_DAZE) { player->flags |= ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000; partner->flags |= ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000; btl_cam_use_preset(BTL_CAM_PRESET_54); btl_show_battle_message(BTL_MSG_23, 60); - partner->status = 0; + partner->statusAfflicted = 0; gBattleSubState = BTL_SUBSTATE_ENEMY_MOVE_AWAIT_PARTNER_POPUP_DONE; } else { gBattleSubState = BTL_SUBSTATE_ENEMY_MOVE_DONE; @@ -3775,13 +3811,13 @@ void btl_state_update_first_strike(void) { case ENCOUNTER_TRIGGER_JUMP: battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; battleStatus->selectedMoveID = MOVE_UNUSED_JUMP4; - battleStatus->selectedItemID = encounterStatus->hitTier; + battleStatus->moveArgument = encounterStatus->hitTier; battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_JUMP4].flags; break; case ENCOUNTER_TRIGGER_HAMMER: battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; battleStatus->selectedMoveID = MOVE_UNUSED_HAMMER4; - battleStatus->selectedItemID = encounterStatus->hitTier; + battleStatus->moveArgument = encounterStatus->hitTier; battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_HAMMER4].flags; break; case ENCOUNTER_TRIGGER_PARTNER: @@ -3813,12 +3849,12 @@ void btl_state_update_first_strike(void) { battleStatus->unk_8C = 0; battleStatus->lastAttackDamage = 0; battleStatus->unk_19A = 0; - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; gBattleStatus.flags2 |= BS_FLAGS2_1000000; - gBattleStatus.flags1 &= ~BS_FLAGS1_80000; + gBattleStatus.flags1 &= ~BS_FLAGS1_PARTNER_ACTING; increment_status_menu_disabled(); btl_cam_use_preset(BTL_CAM_PRESET_10); - btl_cam_target_actor(0); + btl_cam_target_actor(ACTOR_PLAYER); reset_actor_turn_info(); // begin the partner turn script battleStatus->battlePhase = PHASE_FIRST_STRIKE; @@ -3949,19 +3985,19 @@ void btl_state_update_first_strike(void) { void btl_state_draw_first_stike(void) { if (D_802809F6 == -1 && D_8029F254 != 0) { - if (D_80280A30 == 0) { + if (BattleScreenFadeAmt == 0) { set_screen_overlay_params_front(255, -1.0f); } else { if (!(gGameStatusPtr->demoFlags & 1)) { - D_80280A30 -= 20; + BattleScreenFadeAmt -= 20; } else { - D_80280A30 -= 50; + BattleScreenFadeAmt -= 50; } - if (D_80280A30 < 0) { - D_80280A30 = 0; + if (BattleScreenFadeAmt < 0) { + BattleScreenFadeAmt = 0; } - set_screen_overlay_params_front(0, D_80280A30); + set_screen_overlay_params_front(0, BattleScreenFadeAmt); } } } @@ -3985,14 +4021,14 @@ void btl_state_update_partner_striking_first(void) { level = partner->actorBlueprint->level; switch (playerData->currentPartner) { case PARTNER_KOOPER: - battleStatus->moveCategory = BTL_MENU_TYPE_5; - battleStatus->selectedItemID = ITEM_NONE; + battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; + battleStatus->moveArgument = 0; battleStatus->selectedMoveID = level + MOVE_SHELL_TOSS1; battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; break; case PARTNER_BOMBETTE: - battleStatus->moveCategory = BTL_MENU_TYPE_5; - battleStatus->selectedItemID = ITEM_NONE; + battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; + battleStatus->moveArgument = 0; battleStatus->selectedMoveID = level + MOVE_BODY_SLAM1; battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; break; @@ -4016,9 +4052,9 @@ void btl_state_update_partner_striking_first(void) { battleStatus->unk_8C = 0; battleStatus->lastAttackDamage = 0; battleStatus->unk_19A = 0; - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; gBattleStatus.flags2 |= BS_FLAGS2_1000000; - gBattleStatus.flags1 |= BS_FLAGS1_80000; + gBattleStatus.flags1 |= BS_FLAGS1_PARTNER_ACTING; increment_status_menu_disabled(); btl_cam_use_preset(BTL_CAM_PRESET_10); btl_cam_target_actor(ACTOR_PARTNER); @@ -4133,15 +4169,15 @@ void btl_state_update_partner_striking_first(void) { void btl_state_draw_partner_striking_first(void) { if (D_8029F254 != 0) { - if (D_80280A30 == 0) { + if (BattleScreenFadeAmt == 0) { set_screen_overlay_params_front(255, -1.0f); } else { - D_80280A30 -= 20; - if (D_80280A30 < 0) { - D_80280A30 = 0; + BattleScreenFadeAmt -= 20; + if (BattleScreenFadeAmt < 0) { + BattleScreenFadeAmt = 0; } - set_screen_overlay_params_front(0, D_80280A30); + set_screen_overlay_params_front(0, BattleScreenFadeAmt); } } } @@ -4168,7 +4204,7 @@ void btl_state_update_enemy_striking_first(void) { battleStatus->lastAttackDamage = 0; battleStatus->unk_19A = 0; playerData->enemyFirstStrikes++; - battleStatus->flags1 &= ~BS_FLAGS1_2; + battleStatus->flags1 &= ~BS_FLAGS1_MENU_OPEN; D_8029F254 = 0; player->flags &= ~ACTOR_FLAG_8000000; if (partner != NULL) { @@ -4310,77 +4346,77 @@ void btl_state_update_enemy_striking_first(void) { void btl_state_draw_enemy_striking_first(void) { if (D_8029F254 != 0) { - if (D_80280A30 == 0) { + if (BattleScreenFadeAmt == 0) { set_screen_overlay_params_front(255, -1.0f); } else { - D_80280A30 -= 20; - if (D_80280A30 < 0) { - D_80280A30 = 0; + BattleScreenFadeAmt -= 20; + if (BattleScreenFadeAmt < 0) { + BattleScreenFadeAmt = 0; } - set_screen_overlay_params_front(0, D_80280A30); + set_screen_overlay_params_front(0, BattleScreenFadeAmt); } } } void btl_state_update_end_demo_battle(void) { BattleStatus* battleStatus = &gBattleStatus; - Battle* blah = (*D_800DC4FC); + Battle* battle = gCurrentBattlePtr; Stage* stage; s32 i; switch (gBattleSubState) { - case BTL_SUBSTATE_END_DEMO_BATTLE_UNK_0: - D_80280A30 = 0; + case BTL_SUBSTATE_END_DEMO_BATTLE_INIT: + BattleScreenFadeAmt = 0; if (D_802809F6 == -1) { if (D_802809F8 != 0) { D_802809F8--; break; } } - gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_UNK_1; + gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_FADE_OUT; break; - case BTL_SUBSTATE_END_DEMO_BATTLE_UNK_1: + case BTL_SUBSTATE_END_DEMO_BATTLE_FADE_OUT: switch (D_802809F6) { case 255: - gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_UNK_2; + gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT; return; case -1: - if (D_80280A30 == 255) { - gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_UNK_2; + if (BattleScreenFadeAmt == 255) { + gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT; return; } - D_80280A30 += 50; - if (D_80280A30 > 255) { - D_80280A30 = 255; + BattleScreenFadeAmt += 50; + if (BattleScreenFadeAmt > 255) { + BattleScreenFadeAmt = 255; } return; } break; - case BTL_SUBSTATE_END_DEMO_BATTLE_UNK_2: - D_80280A30 = 255; + case BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT: + BattleScreenFadeAmt = 255; gBattleStatus.flags1 &= ~BS_FLAGS1_ACTORS_VISIBLE; - if (D_800DC064 == NULL) { - stage = blah->stage; + if (gCurrentStagePtr == NULL) { + stage = battle->stage; } else { - stage = D_800DC064->stage; + stage = gCurrentStagePtr->stage; } if (stage->postBattle == NULL) { - gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_UNK_4; + gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP; } else { battleStatus->controlScript = start_script(stage->postBattle, EVT_PRIORITY_A, 0); battleStatus->controlScriptID = battleStatus->controlScript->id; - gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_UNK_3; + gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_AWAIT_STAGE_SCRIPT; } break; - case BTL_SUBSTATE_END_DEMO_BATTLE_UNK_3: + case BTL_SUBSTATE_END_DEMO_BATTLE_AWAIT_STAGE_SCRIPT: if (does_script_exist(battleStatus->controlScriptID)) { break; } - gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_UNK_4; + gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP; //fallthrough - case BTL_SUBSTATE_END_DEMO_BATTLE_UNK_4: + case BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP: kill_all_scripts(); for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) { @@ -4408,7 +4444,7 @@ void btl_state_update_end_demo_battle(void) { } btl_set_state(BATTLE_STATE_0); - D_800DC4D0 = gBattleState; + gLastDrawBattleState = gBattleState; set_game_mode(GAME_MODE_END_BATTLE); break; } @@ -4419,6 +4455,6 @@ const static f32 padding[] = { 0.0f, 0.0f, 0.0f }; void btl_state_draw_end_demo_battle(void) { if (D_802809F6 == -1) { set_screen_overlay_color(0, 0, 0, 0); - set_screen_overlay_params_front(0, D_80280A30); + set_screen_overlay_params_front(0, BattleScreenFadeAmt); } } diff --git a/src/16c8e0.c b/src/16c8e0.c index 68f261ecca..79ee09d040 100644 --- a/src/16c8e0.c +++ b/src/16c8e0.c @@ -48,7 +48,7 @@ HudScript* bHPDigitHudScripts[] = { NULL, NULL, NULL, }; -s32 D_80280A30 = 0xFF; +s32 BattleScreenFadeAmt = 0xFF; EvtScript BtlPutPartnerAway = { EVT_CALL(DispatchEvent, 256, 62) @@ -181,9 +181,9 @@ void initialize_battle(void) { battleStatus->playerActor = NULL; battleStatus->partnerActor = NULL; - for (i = 0; i < ARRAY_COUNT(battleStatus->unk_4C); i++) { - battleStatus->unk_4C[i] = -1; - battleStatus->unk_5C[i] = -1; + for (i = 0; i < ARRAY_COUNT(battleStatus->lastPlayerMenuSelection); i++) { + battleStatus->lastPlayerMenuSelection[i] = -1; + battleStatus->lastPartnerMenuSelection[i] = -1; } for (i = 0; i < ARRAY_COUNT(battleStatus->tattleFlags); i++) { @@ -254,7 +254,7 @@ void btl_update(void) { s32 cond; if (battleStatus->inputBitmask != -1) { - if ((battleStatus->flags1 & BS_FLAGS1_80000) && gGameStatusPtr->multiplayerEnabled != 0) { + if ((battleStatus->flags1 & BS_FLAGS1_PARTNER_ACTING) && gGameStatusPtr->multiplayerEnabled != 0) { s32 inputBitmask = battleStatus->inputBitmask; battleStatus->currentButtonsDown = gGameStatusPtr->currentButtons[1] & inputBitmask; @@ -478,31 +478,33 @@ void btl_update(void) { } void btl_draw_ui(void) { - s32 cond = FALSE; + s32 changed = FALSE; s32 state; do { } while (0); // TODO required to match (probably can be removed with some sort of control flow inversion) + // do not draw UI during the frame of a state change state = gBattleState; - if (gBattleState != D_800DC4D0) { - state = D_800DC4D0; - D_800DC4D0 = gBattleState; - cond = TRUE; + if (gBattleState != gLastDrawBattleState) { + state = gLastDrawBattleState; + gLastDrawBattleState = gBattleState; + changed = TRUE; } else { - if (gBattleState == BATTLE_STATE_NEGATIVE_1) { - btl_update_starpoints_display(); - btl_draw_enemy_health_bars(); - draw_status_ui(); - return; - } else if (gBattleState == BATTLE_STATE_0) { - return; + switch (state) { + case BATTLE_STATE_NEGATIVE_1: + btl_update_starpoints_display(); + btl_draw_enemy_health_bars(); + draw_status_ui(); + return; + case BATTLE_STATE_0: + return; } } btl_update_starpoints_display(); btl_draw_enemy_health_bars(); - if (!cond) { + if (!changed) { switch (state) { case BATTLE_STATE_NORMAL_START: btl_state_draw_normal_start(); @@ -884,7 +886,7 @@ void btl_draw_enemy_health_bars(void) { } if (!(enemy->flags & (ACTOR_FLAG_40000 | ACTOR_FLAG_TARGET_ONLY)) && - ((gBattleStatus.flags1 & BS_FLAGS1_2) || (enemy->flags & ACTOR_FLAG_80000)) && + ((gBattleStatus.flags1 & BS_FLAGS1_MENU_OPEN) || (enemy->flags & ACTOR_FLAG_80000)) && is_actor_hp_bar_visible(enemy)) { f32 x = enemy->healthBarPosition.x; diff --git a/src/17D6A0.c b/src/17D6A0.c index c841d84301..058ffc7ee6 100644 --- a/src/17D6A0.c +++ b/src/17D6A0.c @@ -70,221 +70,228 @@ PlayerCelebrationAnimOptions D_80280FC0 = { }; s32 bActorNames[ACTOR_TYPE_COUNT] = { - [ACTOR_TYPE_RED_GOOMBA] = MSG_EnemyName_RedGoomba, - [ACTOR_TYPE_RED_PARAGOOMBA] = MSG_EnemyName_RedParagoomba, - [ACTOR_TYPE_GLOOMBA] = MSG_EnemyName_Gloomba, - [ACTOR_TYPE_PARAGLOOMBA] = MSG_EnemyName_Paragloomba, - [ACTOR_TYPE_SPIKED_GLOOMBA] = MSG_EnemyName_SpikedGloomba, - [ACTOR_TYPE_DARK_KOOPA] = MSG_EnemyName_DarkKoopa, - [ACTOR_TYPE_DARK_PARATROOPA] = MSG_EnemyName_DarkParatroopa, - [ACTOR_TYPE_GOOMBA] = MSG_EnemyName_Goomba, - [ACTOR_TYPE_PARAGOOMBA] = MSG_EnemyName_Paragoomba, - [ACTOR_TYPE_SPIKED_GOOMBA] = MSG_EnemyName_SpikedGoomba, - [ACTOR_TYPE_FUZZY] = MSG_EnemyName_Fuzzy, - [ACTOR_TYPE_KOOPA_TROOPA] = MSG_EnemyName_KoopaTroopa, - [ACTOR_TYPE_PARATROOPA] = MSG_EnemyName_Paratroopa, - [ACTOR_TYPE_BOB_OMB] = MSG_EnemyName_BobOmb, - [ACTOR_TYPE_BOB_OMB_DUP] = MSG_EnemyName_BobOmb, - [ACTOR_TYPE_BULLET_BILL] = MSG_EnemyName_BulletBill, - [ACTOR_TYPE_BILL_BLASTER] = MSG_EnemyName_BillBlaster, - [ACTOR_TYPE_CLEFT] = MSG_EnemyName_Cleft, - [ACTOR_TYPE_MONTY_MOLE] = MSG_EnemyName_MontyMole, - [ACTOR_TYPE_BANDIT] = MSG_EnemyName_Bandit, - [ACTOR_TYPE_POKEY] = MSG_EnemyName_Pokey, - [ACTOR_TYPE_POKEY_MUMMY] = MSG_EnemyName_PokeyMummy, - [ACTOR_TYPE_SWOOPER] = MSG_EnemyName_Swooper, - [ACTOR_TYPE_BUZZY_BEETLE] = MSG_EnemyName_BuzzyBeetle, - [ACTOR_TYPE_STONE_CHOMP] = MSG_EnemyName_StoneChomp, - [ACTOR_TYPE_PIRANHA_PLANT] = MSG_EnemyName_PiranhaPlant, - [ACTOR_TYPE_FOREST_FUZZY] = MSG_EnemyName_ForestFuzzy, - [ACTOR_TYPE_HYPER_GOOMBA] = MSG_EnemyName_HyperGoomba, - [ACTOR_TYPE_HYPER_PARAGOOMBA] = MSG_EnemyName_HyperParagoomba, - [ACTOR_TYPE_HYPER_CLEFT] = MSG_EnemyName_HyperCleft, - [ACTOR_TYPE_CLUBBA] = MSG_EnemyName_Clubba, - [ACTOR_TYPE_SHY_GUY] = MSG_EnemyName_ShyGuy, - [ACTOR_TYPE_GROOVE_GUY] = MSG_EnemyName_GrooveGuy, - [ACTOR_TYPE_SKY_GUY] = MSG_EnemyName_SkyGuy, - [ACTOR_TYPE_MEDI_GUY] = MSG_EnemyName_MediGuy, - [ACTOR_TYPE_PYRO_GUY] = MSG_EnemyName_PyroGuy, - [ACTOR_TYPE_SPY_GUY] = MSG_EnemyName_SpyGuy, - [ACTOR_TYPE_FUZZIPEDE] = MSG_EnemyName_Fuzzipede, - [ACTOR_TYPE_HURT_PLANT] = MSG_EnemyName_HurtPlant, - [ACTOR_TYPE_M_BUSH] = MSG_EnemyName_MBush, - [ACTOR_TYPE_AQUA_FUZZY] = MSG_EnemyName_AquaFuzzy, - [ACTOR_TYPE_JUNGLE_FUZZY] = MSG_EnemyName_JungleFuzzy, - [ACTOR_TYPE_SPEAR_GUY] = MSG_EnemyName_SpearGuy, - [ACTOR_TYPE_LAVA_BUBBLE] = MSG_EnemyName_LavaBubble, - [ACTOR_TYPE_SPIKE_TOP] = MSG_EnemyName_SpikeTop, - [ACTOR_TYPE_PUTRID_PIRANHA] = MSG_EnemyName_PutridPiranha, - [ACTOR_TYPE_LAKITU] = MSG_EnemyName_Lakitu, - [ACTOR_TYPE_SPINY] = MSG_EnemyName_Spiny, - [ACTOR_TYPE_MONTY_MOLE_BOSS] = MSG_EnemyName_MontyMoleBoss, - [ACTOR_TYPE_BZZAP] = MSG_EnemyName_Bzzap, - [ACTOR_TYPE_CRAZEE_DAYZEE] = MSG_EnemyName_CrazeeDayzee, - [ACTOR_TYPE_AMAZY_DAYZEE] = MSG_EnemyName_AmazyDayzee, - [ACTOR_TYPE_RUFF_PUFF] = MSG_EnemyName_RuffPuff, - [ACTOR_TYPE_SPIKE] = MSG_EnemyName_Spike, - [ACTOR_TYPE_GULPIT] = MSG_EnemyName_Gulpit, - [ACTOR_TYPE_GULPIT_ROCKS] = MSG_EnemyName_GulpitRocks, - [ACTOR_TYPE_WHITE_CLUBBA] = MSG_EnemyName_WhiteClubba, - [ACTOR_TYPE_FROST_PIRANHA] = MSG_EnemyName_FrostPiranha, - [ACTOR_TYPE_SWOOPULA] = MSG_EnemyName_Swoopula, - [ACTOR_TYPE_DUPLIGHOST] = MSG_EnemyName_Duplighost, - [ACTOR_TYPE_GHOST_GOOMBARIO] = MSG_EnemyName_GhostGoombario, - [ACTOR_TYPE_GHOST_KOOPER] = MSG_EnemyName_GhostKooper, - [ACTOR_TYPE_GHOST_BOMBETTE] = MSG_EnemyName_GhostBombette, - [ACTOR_TYPE_GHOST_PARAKARRY] = MSG_EnemyName_GhostParakarry, - [ACTOR_TYPE_GHOST_BOW] = MSG_EnemyName_GhostBow, - [ACTOR_TYPE_GHOST_WATT] = MSG_EnemyName_GhostWatt, - [ACTOR_TYPE_GHOST_SUSHIE] = MSG_EnemyName_GhostSushie, - [ACTOR_TYPE_GHOST_LAKILESTER] = MSG_EnemyName_GhostLakilester, - [ACTOR_TYPE_ALBINO_DINO] = MSG_EnemyName_AlbinoDino, - [ACTOR_TYPE_EMBER] = MSG_EnemyName_Ember, - [ACTOR_TYPE_BONY_BEETLE] = MSG_EnemyName_BonyBeetle, - [ACTOR_TYPE_DRY_BONES] = MSG_EnemyName_DryBones, - [ACTOR_TYPE_DRY_BONES2] = MSG_EnemyName_DryBones, - [ACTOR_TYPE_BOMBSHELL_BLASTER] = MSG_EnemyName_BombshellBlaster, - [ACTOR_TYPE_BOMBSHELL_BILL] = MSG_EnemyName_BombshellBill, - [ACTOR_TYPE_HAMMER_BROS] = MSG_EnemyName_HammerBros, - [ACTOR_TYPE_KOOPATROL] = MSG_EnemyName_Koopatrol, - [ACTOR_TYPE_MAGIKOOPA] = MSG_EnemyName_Magikoopa, - [ACTOR_TYPE_FLYING_MAGIKOOPA] = MSG_EnemyName_Magikoopa, - [ACTOR_TYPE_MAGICLONE] = MSG_EnemyName_Magikoopa, - [ACTOR_TYPE_FLYING_MAGICLONE] = MSG_EnemyName_Magikoopa, - [ACTOR_TYPE_RED_MAGIKOOPA] = MSG_EnemyName_RedMagikoopa, - [ACTOR_TYPE_FLYING_RED_MAGIKOOPA] = MSG_EnemyName_RedMagikoopa, - [ACTOR_TYPE_GREEN_MAGIKOOPA] = MSG_EnemyName_GreenMagikoopa, - [ACTOR_TYPE_FLYING_GREEN_MAGIKOOPA] = MSG_EnemyName_GreenMagikoopa, - [ACTOR_TYPE_YELLOW_MAGIKOOPA] = MSG_EnemyName_YellowMagikoopa, - [ACTOR_TYPE_FLYING_YELLOW_MAGIKOOPA] = MSG_EnemyName_YellowMagikoopa, - [ACTOR_TYPE_GRAY_MAGIKOOPA] = MSG_EnemyName_GrayMagikoopa, - [ACTOR_TYPE_FLYING_GRAY_MAGIKOOPA] = MSG_EnemyName_GrayMagikoopa, - [ACTOR_TYPE_WHITE_MAGIKOOPA] = MSG_EnemyName_WhiteMagikoopa, - [ACTOR_TYPE_FLYING_WHITE_MAGIKOOPA] = MSG_EnemyName_WhiteMagikoopa, - [ACTOR_TYPE_UNUSED_5B] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_5C] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_5D] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_5E] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_5F] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_60] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_61] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_62] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_63] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_64] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_65] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_66] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_67] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_68] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_69] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_6A] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_MONTY_HOLE] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_6C] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_6D] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_PLAYER] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_GOOMBARIO] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_KOOPER] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_BOMBETTE] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_PARAKARRY] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_BOW] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_WATT] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_SUSHIE] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_LAKILESTER] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_TWINK] = MSG_Menus_Party_Twink, - [ACTOR_TYPE_UNUSED_78] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_UNUSED_79] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_THE_MASTER_1] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_THE_MASTER_2] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_THE_MASTER_3] = MSG_EnemyName_TheMaster, - [ACTOR_TYPE_CHAN] = MSG_EnemyName_Chan, - [ACTOR_TYPE_LEE] = MSG_EnemyName_Lee, - [ACTOR_TYPE_LEE_GOOMBARIO] = MSG_Menus_Party_Goombario, - [ACTOR_TYPE_LEE_KOOPER] = MSG_Menus_Party_Kooper, - [ACTOR_TYPE_LEE_BOMBETTE] = MSG_Menus_Party_Bombette, - [ACTOR_TYPE_LEE_PARAKARRY] = MSG_Menus_Party_Parakarry, - [ACTOR_TYPE_LEE_BOW] = MSG_Menus_Party_Bow, - [ACTOR_TYPE_LEE_WATT] = MSG_Menus_Party_Watt, - [ACTOR_TYPE_LEE_SUSHIE] = MSG_Menus_Party_Sushie, - [ACTOR_TYPE_LEE_LAKILESTER] = MSG_Menus_Party_Lakilester, - [ACTOR_TYPE_KAMMY_KOOPA] = MSG_EnemyName_KammyKoopa, - [ACTOR_TYPE_JR_TROOPA1] = MSG_EnemyName_JrTroopa, - [ACTOR_TYPE_JR_TROOPA2] = MSG_EnemyName_JrTroopa, - [ACTOR_TYPE_JR_TROOPA3] = MSG_EnemyName_JrTroopa, - [ACTOR_TYPE_JR_TROOPA4] = MSG_EnemyName_JrTroopa, - [ACTOR_TYPE_JR_TROOPA5] = MSG_EnemyName_JrTroopa, - [ACTOR_TYPE_JR_TROOPA6] = MSG_EnemyName_JrTroopa, - [ACTOR_TYPE_JR_TROOPA_DUP1] = MSG_EnemyName_JrTroopa, - [ACTOR_TYPE_JR_TROOPA_DUP2] = MSG_EnemyName_JrTroopa, - [ACTOR_TYPE_BLUE_GOOMBA_BOSS] = MSG_EnemyName_BlueGoombaBoss, - [ACTOR_TYPE_RED_GOOMBA_BOSS] = MSG_EnemyName_RedGoombaBoss, - [ACTOR_TYPE_GOOMBA_KING] = MSG_EnemyName_GoombaKing, - [ACTOR_TYPE_GOOMNUT_TREE] = MSG_EnemyName_GoomnutTree, - [ACTOR_TYPE_GOOMBARIO_TUTOR1] = MSG_Menus_Party_Goombario, - [ACTOR_TYPE_MAGIKOOPA_BOSS] = MSG_EnemyName_Magikoopa, - [ACTOR_TYPE_FLYING_MAGIKOOPA_BOSS] = MSG_EnemyName_Magikoopa, - [ACTOR_TYPE_MAGIKOOPA_DUP1] = MSG_EnemyName_Magikoopa, - [ACTOR_TYPE_MAGIKOOPA_DUP2] = MSG_EnemyName_Magikoopa, - [ACTOR_TYPE_FAKE_BOWSER] = MSG_EnemyName_FakeBowser, - [ACTOR_TYPE_KOOPA_BROS] = MSG_EnemyName_KoopaBros, - [ACTOR_TYPE_GREEN_NINJAKOOPA] = MSG_EnemyName_GreenNinjakoopa, - [ACTOR_TYPE_RED_NINJAKOOPA] = MSG_EnemyName_RedNinjakoopa, - [ACTOR_TYPE_BLUE_NINJAKOOPA] = MSG_EnemyName_BlueNinjakoopa, - [ACTOR_TYPE_YELLOW_NINJAKOOPA] = MSG_EnemyName_YellowNinjakoopa, - [ACTOR_TYPE_ELDSTAR] = MSG_Menus_Party_Goombario, - [ACTOR_TYPE_BUZZAR] = MSG_EnemyName_Buzzar, - [ACTOR_TYPE_TUTANKOOPA] = MSG_EnemyName_Tutankoopa, - [ACTOR_TYPE_CHOMP] = MSG_EnemyName_Chomp, - [ACTOR_TYPE_TUBBA_BLUBBA_INVINCIBLE] = MSG_EnemyName_TubbaBlubba, - [ACTOR_TYPE_TUBBA_BLUBBA] = MSG_EnemyName_TubbaBlubba, - [ACTOR_TYPE_TUBBA_HEART] = MSG_EnemyName_TubbaHeart, - [ACTOR_TYPE_STILT_GUY] = MSG_EnemyName_StiltGuy, - [ACTOR_TYPE_SHY_STACK] = MSG_EnemyName_ShyStack, - [ACTOR_TYPE_SHY_SQUAD] = MSG_EnemyName_ShySquad, - [ACTOR_TYPE_GENERAL_GUY] = MSG_EnemyName_GeneralGuyDup, - [ACTOR_TYPE_TOY_TANK] = MSG_EnemyName_GeneralGuy, - [ACTOR_TYPE_LIGHT_BULB] = MSG_EnemyName_Bulb, - [ACTOR_TYPE_SIGNAL_GUY] = MSG_EnemyName_ShyGuy, - [ACTOR_TYPE_SHY_SQUAD_DUP] = MSG_EnemyName_ShySquadDup, - [ACTOR_TYPE_SHY_GUY_DUP] = MSG_EnemyName_ShyGuy, - [ACTOR_TYPE_ANTI_GUY] = MSG_EnemyName_AntiGuy, - [ACTOR_TYPE_ANTI_GUY_DUP] = MSG_EnemyName_AntiGuy, - [ACTOR_TYPE_BIG_LANTERN_GHOST] = MSG_EnemyName_BigLanternGhost, - [ACTOR_TYPE_GOOMBA_KING_DUP] = MSG_EnemyName_GoombaKing, - [ACTOR_TYPE_LAVA_PIRANHA_PHASE_1] = MSG_EnemyName_LavaPiranha, - [ACTOR_TYPE_LAVA_PIRANHA_PHASE_2] = MSG_EnemyName_LavaPiranha, - [ACTOR_TYPE_LAVA_BUD_PHASE_1] = MSG_EnemyName_LavaBud, - [ACTOR_TYPE_LAVA_BUD_PHASE_2] = MSG_EnemyName_LavaBud, - [ACTOR_TYPE_PETIT_PIRANHA] = MSG_EnemyName_PetitPiranha, - [ACTOR_TYPE_PETIT_PIRANHA_BOMB] = MSG_EnemyName_LavaPiranha, - [ACTOR_TYPE_KENT_C_KOOPA] = MSG_EnemyName_KentCKoopa, - [ACTOR_TYPE_HUFF_N_PUFF] = MSG_EnemyName_HuffNPuff, - [ACTOR_TYPE_TUFF_PUFF] = MSG_EnemyName_TuffPuff, - [ACTOR_TYPE_MONSTAR] = MSG_EnemyName_Monstar, - [ACTOR_TYPE_CRYSTAL_KING] = MSG_EnemyName_CrystalKing, - [ACTOR_TYPE_CRYSTAL_CLONE] = MSG_EnemyName_CrystalKing, - [ACTOR_TYPE_CRYSTAL_BIT] = MSG_EnemyName_CrystalBit, - [ACTOR_TYPE_INTRO_BOWSER] = MSG_EnemyName_Bowser, - [ACTOR_TYPE_BOWSER_PHASE_1] = MSG_EnemyName_Bowser, - [ACTOR_TYPE_BOWSER_DUP1] = MSG_EnemyName_Bowser, - [ACTOR_TYPE_BOWSER_PHASE_2] = MSG_EnemyName_Bowser, - [ACTOR_TYPE_BOWSER_DUP2] = MSG_EnemyName_Bowser, - [ACTOR_TYPE_BOWSER_PHASE_3] = MSG_EnemyName_Bowser, - [ACTOR_TYPE_BOWSER_DUP3] = MSG_EnemyName_Bowser, - [ACTOR_TYPE_BLOOPER] = MSG_EnemyName_Blooper, - [ACTOR_TYPE_ELECTRO_BLOOPER1] = MSG_EnemyName_ElectroBlooper, - [ACTOR_TYPE_ELECTRO_BLOOPER2] = MSG_EnemyName_ElectroBlooper, - [ACTOR_TYPE_SUPER_BLOOPER1] = MSG_EnemyName_SuperBlooper, - [ACTOR_TYPE_SUPER_BLOOPER2] = MSG_EnemyName_SuperBlooper, - [ACTOR_TYPE_BLOOPER_BABY] = MSG_EnemyName_BlooperBaby, - [ACTOR_TYPE_LAKILESTER_DUP] = MSG_EnemyName_GhostLakilester, - [ACTOR_TYPE_SLOT_MACHINE_START] = MSG_EnemyName_SlotMachineStart, - [ACTOR_TYPE_SLOT_MACHINE_STOP] = MSG_EnemyName_SlotMachineStop, - [ACTOR_TYPE_WHACKA] = MSG_EnemyName_Whacka, - [ACTOR_TYPE_SLOT_MACHINE_START_DUP1] = MSG_EnemyName_SlotMachineStart, - [ACTOR_TYPE_SLOT_MACHINE_START_DUP2] = MSG_EnemyName_SlotMachineStart, - [ACTOR_TYPE_SLOT_MACHINE_START_DUP3] = MSG_EnemyName_SlotMachineStart, + [ACTOR_TYPE_RED_GOOMBA] MSG_EnemyName_RedGoomba, + [ACTOR_TYPE_RED_PARAGOOMBA] MSG_EnemyName_RedParagoomba, + [ACTOR_TYPE_GLOOMBA] MSG_EnemyName_Gloomba, + [ACTOR_TYPE_PARAGLOOMBA] MSG_EnemyName_Paragloomba, + [ACTOR_TYPE_SPIKED_GLOOMBA] MSG_EnemyName_SpikedGloomba, + [ACTOR_TYPE_DARK_KOOPA] MSG_EnemyName_DarkKoopa, + [ACTOR_TYPE_DARK_PARATROOPA] MSG_EnemyName_DarkParatroopa, + [ACTOR_TYPE_GOOMBA] MSG_EnemyName_Goomba, + [ACTOR_TYPE_PARAGOOMBA] MSG_EnemyName_Paragoomba, + [ACTOR_TYPE_SPIKED_GOOMBA] MSG_EnemyName_SpikedGoomba, + [ACTOR_TYPE_FUZZY] MSG_EnemyName_Fuzzy, + [ACTOR_TYPE_KOOPA_TROOPA] MSG_EnemyName_KoopaTroopa, + [ACTOR_TYPE_PARATROOPA] MSG_EnemyName_Paratroopa, + [ACTOR_TYPE_BOB_OMB] MSG_EnemyName_BobOmb, + [ACTOR_TYPE_BOB_OMB_DUP] MSG_EnemyName_BobOmb, + [ACTOR_TYPE_BULLET_BILL] MSG_EnemyName_BulletBill, + [ACTOR_TYPE_BILL_BLASTER] MSG_EnemyName_BillBlaster, + [ACTOR_TYPE_CLEFT] MSG_EnemyName_Cleft, + [ACTOR_TYPE_MONTY_MOLE] MSG_EnemyName_MontyMole, + [ACTOR_TYPE_BANDIT] MSG_EnemyName_Bandit, + [ACTOR_TYPE_POKEY] MSG_EnemyName_Pokey, + [ACTOR_TYPE_POKEY_MUMMY] MSG_EnemyName_PokeyMummy, + [ACTOR_TYPE_SWOOPER] MSG_EnemyName_Swooper, + [ACTOR_TYPE_BUZZY_BEETLE] MSG_EnemyName_BuzzyBeetle, + [ACTOR_TYPE_STONE_CHOMP] MSG_EnemyName_StoneChomp, + [ACTOR_TYPE_PIRANHA_PLANT] MSG_EnemyName_PiranhaPlant, + [ACTOR_TYPE_FOREST_FUZZY] MSG_EnemyName_ForestFuzzy, + [ACTOR_TYPE_HYPER_GOOMBA] MSG_EnemyName_HyperGoomba, + [ACTOR_TYPE_HYPER_PARAGOOMBA] MSG_EnemyName_HyperParagoomba, + [ACTOR_TYPE_HYPER_CLEFT] MSG_EnemyName_HyperCleft, + [ACTOR_TYPE_CLUBBA] MSG_EnemyName_Clubba, + [ACTOR_TYPE_SHY_GUY] MSG_EnemyName_ShyGuy, + [ACTOR_TYPE_GROOVE_GUY] MSG_EnemyName_GrooveGuy, + [ACTOR_TYPE_SKY_GUY] MSG_EnemyName_SkyGuy, + [ACTOR_TYPE_MEDI_GUY] MSG_EnemyName_MediGuy, + [ACTOR_TYPE_PYRO_GUY] MSG_EnemyName_PyroGuy, + [ACTOR_TYPE_SPY_GUY] MSG_EnemyName_SpyGuy, + [ACTOR_TYPE_FUZZIPEDE] MSG_EnemyName_Fuzzipede, + [ACTOR_TYPE_HURT_PLANT] MSG_EnemyName_HurtPlant, + [ACTOR_TYPE_M_BUSH] MSG_EnemyName_MBush, + [ACTOR_TYPE_AQUA_FUZZY] MSG_EnemyName_AquaFuzzy, + [ACTOR_TYPE_JUNGLE_FUZZY] MSG_EnemyName_JungleFuzzy, + [ACTOR_TYPE_SPEAR_GUY] MSG_EnemyName_SpearGuy, + [ACTOR_TYPE_LAVA_BUBBLE] MSG_EnemyName_LavaBubble, + [ACTOR_TYPE_SPIKE_TOP] MSG_EnemyName_SpikeTop, + [ACTOR_TYPE_PUTRID_PIRANHA] MSG_EnemyName_PutridPiranha, + [ACTOR_TYPE_LAKITU] MSG_EnemyName_Lakitu, + [ACTOR_TYPE_SPINY] MSG_EnemyName_Spiny, + [ACTOR_TYPE_MONTY_MOLE_BOSS] MSG_EnemyName_MontyMoleBoss, + [ACTOR_TYPE_BZZAP] MSG_EnemyName_Bzzap, + [ACTOR_TYPE_CRAZEE_DAYZEE] MSG_EnemyName_CrazeeDayzee, + [ACTOR_TYPE_AMAZY_DAYZEE] MSG_EnemyName_AmazyDayzee, + [ACTOR_TYPE_RUFF_PUFF] MSG_EnemyName_RuffPuff, + [ACTOR_TYPE_SPIKE] MSG_EnemyName_Spike, + [ACTOR_TYPE_GULPIT] MSG_EnemyName_Gulpit, + [ACTOR_TYPE_GULPIT_ROCKS] MSG_EnemyName_GulpitRocks, + [ACTOR_TYPE_WHITE_CLUBBA] MSG_EnemyName_WhiteClubba, + [ACTOR_TYPE_FROST_PIRANHA] MSG_EnemyName_FrostPiranha, + [ACTOR_TYPE_SWOOPULA] MSG_EnemyName_Swoopula, + [ACTOR_TYPE_DUPLIGHOST] MSG_EnemyName_Duplighost, + [ACTOR_TYPE_GHOST_GOOMBARIO] MSG_EnemyName_GhostGoombario, + [ACTOR_TYPE_GHOST_KOOPER] MSG_EnemyName_GhostKooper, + [ACTOR_TYPE_GHOST_BOMBETTE] MSG_EnemyName_GhostBombette, + [ACTOR_TYPE_GHOST_PARAKARRY] MSG_EnemyName_GhostParakarry, + [ACTOR_TYPE_GHOST_BOW] MSG_EnemyName_GhostBow, + [ACTOR_TYPE_GHOST_WATT] MSG_EnemyName_GhostWatt, + [ACTOR_TYPE_GHOST_SUSHIE] MSG_EnemyName_GhostSushie, + [ACTOR_TYPE_GHOST_LAKILESTER] MSG_EnemyName_GhostLakilester, + [ACTOR_TYPE_ALBINO_DINO] MSG_EnemyName_AlbinoDino, + [ACTOR_TYPE_EMBER] MSG_EnemyName_Ember, + [ACTOR_TYPE_BONY_BEETLE] MSG_EnemyName_BonyBeetle, + [ACTOR_TYPE_DRY_BONES] MSG_EnemyName_DryBones, + [ACTOR_TYPE_DRY_BONES2] MSG_EnemyName_DryBones, + [ACTOR_TYPE_BOMBSHELL_BLASTER] MSG_EnemyName_BombshellBlaster, + [ACTOR_TYPE_BOMBSHELL_BILL] MSG_EnemyName_BombshellBill, + [ACTOR_TYPE_HAMMER_BROS] MSG_EnemyName_HammerBros, + [ACTOR_TYPE_KOOPATROL] MSG_EnemyName_Koopatrol, + [ACTOR_TYPE_MAGIKOOPA] MSG_EnemyName_Magikoopa, + [ACTOR_TYPE_FLYING_MAGIKOOPA] MSG_EnemyName_Magikoopa, + [ACTOR_TYPE_MAGICLONE] MSG_EnemyName_Magikoopa, + [ACTOR_TYPE_FLYING_MAGICLONE] MSG_EnemyName_Magikoopa, + [ACTOR_TYPE_RED_MAGIKOOPA] MSG_EnemyName_RedMagikoopa, + [ACTOR_TYPE_FLYING_RED_MAGIKOOPA] MSG_EnemyName_RedMagikoopa, + [ACTOR_TYPE_GREEN_MAGIKOOPA] MSG_EnemyName_GreenMagikoopa, + [ACTOR_TYPE_FLYING_GREEN_MAGIKOOPA] MSG_EnemyName_GreenMagikoopa, + [ACTOR_TYPE_YELLOW_MAGIKOOPA] MSG_EnemyName_YellowMagikoopa, + [ACTOR_TYPE_FLYING_YELLOW_MAGIKOOPA] MSG_EnemyName_YellowMagikoopa, + [ACTOR_TYPE_GRAY_MAGIKOOPA] MSG_EnemyName_GrayMagikoopa, + [ACTOR_TYPE_FLYING_GRAY_MAGIKOOPA] MSG_EnemyName_GrayMagikoopa, + [ACTOR_TYPE_WHITE_MAGIKOOPA] MSG_EnemyName_WhiteMagikoopa, + [ACTOR_TYPE_FLYING_WHITE_MAGIKOOPA] MSG_EnemyName_WhiteMagikoopa, + [ACTOR_TYPE_UNUSED_5B] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_5C] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_5D] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_5E] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_5F] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_60] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_61] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_62] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_63] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_64] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_65] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_66] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_67] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_68] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_69] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_6A] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_MONTY_HOLE] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_6C] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_6D] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_PLAYER] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_GOOMBARIO] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_KOOPER] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_BOMBETTE] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_PARAKARRY] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_BOW] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_WATT] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_SUSHIE] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_LAKILESTER] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_TWINK] MSG_Menus_Party_Twink, + [ACTOR_TYPE_UNUSED_78] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_UNUSED_79] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_THE_MASTER_1] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_THE_MASTER_2] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_THE_MASTER_3] MSG_EnemyName_TheMaster, + [ACTOR_TYPE_CHAN] MSG_EnemyName_Chan, + [ACTOR_TYPE_LEE] MSG_EnemyName_Lee, + [ACTOR_TYPE_LEE_GOOMBARIO] MSG_Menus_Party_Goombario, + [ACTOR_TYPE_LEE_KOOPER] MSG_Menus_Party_Kooper, + [ACTOR_TYPE_LEE_BOMBETTE] MSG_Menus_Party_Bombette, + [ACTOR_TYPE_LEE_PARAKARRY] MSG_Menus_Party_Parakarry, + [ACTOR_TYPE_LEE_BOW] MSG_Menus_Party_Bow, + [ACTOR_TYPE_LEE_WATT] MSG_Menus_Party_Watt, + [ACTOR_TYPE_LEE_SUSHIE] MSG_Menus_Party_Sushie, + [ACTOR_TYPE_LEE_LAKILESTER] MSG_Menus_Party_Lakilester, + [ACTOR_TYPE_KAMMY_KOOPA] MSG_EnemyName_KammyKoopa, + [ACTOR_TYPE_JR_TROOPA1] MSG_EnemyName_JrTroopa, + [ACTOR_TYPE_JR_TROOPA2] MSG_EnemyName_JrTroopa, + [ACTOR_TYPE_JR_TROOPA3] MSG_EnemyName_JrTroopa, + [ACTOR_TYPE_JR_TROOPA4] MSG_EnemyName_JrTroopa, + [ACTOR_TYPE_JR_TROOPA5] MSG_EnemyName_JrTroopa, + [ACTOR_TYPE_JR_TROOPA6] MSG_EnemyName_JrTroopa, + [ACTOR_TYPE_JR_TROOPA_DUP1] MSG_EnemyName_JrTroopa, + [ACTOR_TYPE_JR_TROOPA_DUP2] MSG_EnemyName_JrTroopa, + [ACTOR_TYPE_BLUE_GOOMBA_BOSS] MSG_EnemyName_BlueGoombaBoss, + [ACTOR_TYPE_RED_GOOMBA_BOSS] MSG_EnemyName_RedGoombaBoss, + [ACTOR_TYPE_GOOMBA_KING] MSG_EnemyName_GoombaKing, + [ACTOR_TYPE_GOOMNUT_TREE] MSG_EnemyName_GoomnutTree, + [ACTOR_TYPE_GOOMBARIO_TUTOR1] MSG_Menus_Party_Goombario, + [ACTOR_TYPE_MAGIKOOPA_BOSS] MSG_EnemyName_Magikoopa, + [ACTOR_TYPE_FLYING_MAGIKOOPA_BOSS] MSG_EnemyName_Magikoopa, + [ACTOR_TYPE_MAGIKOOPA_DUP1] MSG_EnemyName_Magikoopa, + [ACTOR_TYPE_MAGIKOOPA_DUP2] MSG_EnemyName_Magikoopa, + [ACTOR_TYPE_FAKE_BOWSER] MSG_EnemyName_FakeBowser, + [ACTOR_TYPE_KOOPA_BROS] MSG_EnemyName_KoopaBros, + [ACTOR_TYPE_GREEN_NINJAKOOPA] MSG_EnemyName_GreenNinjakoopa, + [ACTOR_TYPE_RED_NINJAKOOPA] MSG_EnemyName_RedNinjakoopa, + [ACTOR_TYPE_BLUE_NINJAKOOPA] MSG_EnemyName_BlueNinjakoopa, + [ACTOR_TYPE_YELLOW_NINJAKOOPA] MSG_EnemyName_YellowNinjakoopa, + [ACTOR_TYPE_ELDSTAR] MSG_Menus_Party_Goombario, + [ACTOR_TYPE_BUZZAR] MSG_EnemyName_Buzzar, + [ACTOR_TYPE_TUTANKOOPA] MSG_EnemyName_Tutankoopa, + [ACTOR_TYPE_CHOMP] MSG_EnemyName_Chomp, + [ACTOR_TYPE_TUBBA_BLUBBA_INVINCIBLE] MSG_EnemyName_TubbaBlubba, + [ACTOR_TYPE_TUBBA_BLUBBA] MSG_EnemyName_TubbaBlubba, + [ACTOR_TYPE_TUBBA_HEART] MSG_EnemyName_TubbaHeart, + [ACTOR_TYPE_STILT_GUY] MSG_EnemyName_StiltGuy, + [ACTOR_TYPE_SHY_STACK] MSG_EnemyName_ShyStack, + [ACTOR_TYPE_SHY_SQUAD] MSG_EnemyName_ShySquad, + [ACTOR_TYPE_GENERAL_GUY] MSG_EnemyName_GeneralGuyDup, + [ACTOR_TYPE_TOY_TANK] MSG_EnemyName_GeneralGuy, + [ACTOR_TYPE_LIGHT_BULB] MSG_EnemyName_Bulb, + [ACTOR_TYPE_SIGNAL_GUY] MSG_EnemyName_ShyGuy, + [ACTOR_TYPE_SHY_SQUAD_DUP] MSG_EnemyName_ShySquadDup, + [ACTOR_TYPE_SHY_GUY_DUP] MSG_EnemyName_ShyGuy, + [ACTOR_TYPE_ANTI_GUY] MSG_EnemyName_AntiGuy, + [ACTOR_TYPE_ANTI_GUY_DUP] MSG_EnemyName_AntiGuy, + [ACTOR_TYPE_BIG_LANTERN_GHOST] MSG_EnemyName_BigLanternGhost, + [ACTOR_TYPE_GOOMBA_KING_DUP] MSG_EnemyName_GoombaKing, + [ACTOR_TYPE_LAVA_PIRANHA_PHASE_1] MSG_EnemyName_LavaPiranha, + [ACTOR_TYPE_LAVA_PIRANHA_PHASE_2] MSG_EnemyName_LavaPiranha, + [ACTOR_TYPE_LAVA_BUD_PHASE_1] MSG_EnemyName_LavaBud, + [ACTOR_TYPE_LAVA_BUD_PHASE_2] MSG_EnemyName_LavaBud, + [ACTOR_TYPE_PETIT_PIRANHA] MSG_EnemyName_PetitPiranha, + [ACTOR_TYPE_PETIT_PIRANHA_BOMB] MSG_EnemyName_LavaPiranha, + [ACTOR_TYPE_KENT_C_KOOPA] MSG_EnemyName_KentCKoopa, + [ACTOR_TYPE_HUFF_N_PUFF] MSG_EnemyName_HuffNPuff, + [ACTOR_TYPE_TUFF_PUFF] MSG_EnemyName_TuffPuff, + [ACTOR_TYPE_MONSTAR] MSG_EnemyName_Monstar, + [ACTOR_TYPE_CRYSTAL_KING] MSG_EnemyName_CrystalKing, + [ACTOR_TYPE_CRYSTAL_CLONE] MSG_EnemyName_CrystalKing, + [ACTOR_TYPE_CRYSTAL_BIT] MSG_EnemyName_CrystalBit, + [ACTOR_TYPE_INTRO_BOWSER] MSG_EnemyName_Bowser, + [ACTOR_TYPE_BOWSER_PHASE_1] MSG_EnemyName_Bowser, + [ACTOR_TYPE_BOWSER_DUP1] MSG_EnemyName_Bowser, + [ACTOR_TYPE_BOWSER_PHASE_2] MSG_EnemyName_Bowser, + [ACTOR_TYPE_BOWSER_DUP2] MSG_EnemyName_Bowser, + [ACTOR_TYPE_BOWSER_PHASE_3] MSG_EnemyName_Bowser, + [ACTOR_TYPE_BOWSER_DUP3] MSG_EnemyName_Bowser, + [ACTOR_TYPE_BLOOPER] MSG_EnemyName_Blooper, + [ACTOR_TYPE_ELECTRO_BLOOPER1] MSG_EnemyName_ElectroBlooper, + [ACTOR_TYPE_ELECTRO_BLOOPER2] MSG_EnemyName_ElectroBlooper, + [ACTOR_TYPE_SUPER_BLOOPER1] MSG_EnemyName_SuperBlooper, + [ACTOR_TYPE_SUPER_BLOOPER2] MSG_EnemyName_SuperBlooper, + [ACTOR_TYPE_BLOOPER_BABY] MSG_EnemyName_BlooperBaby, + [ACTOR_TYPE_LAKILESTER_DUP] MSG_EnemyName_GhostLakilester, + [ACTOR_TYPE_SLOT_MACHINE_START] MSG_EnemyName_SlotMachineStart, + [ACTOR_TYPE_SLOT_MACHINE_STOP] MSG_EnemyName_SlotMachineStop, + [ACTOR_TYPE_WHACKA] MSG_EnemyName_Whacka, + [ACTOR_TYPE_SLOT_MACHINE_START_DUP1] MSG_EnemyName_SlotMachineStart, + [ACTOR_TYPE_SLOT_MACHINE_START_DUP2] MSG_EnemyName_SlotMachineStart, + [ACTOR_TYPE_SLOT_MACHINE_START_DUP3] MSG_EnemyName_SlotMachineStart, }; -s32 D_80281454[] = { 0x78, 0x93, 0x99, 0xB2, -1 }; +// enemy types to ignore when deciding initialEnemyCount +s32 D_80281454[] = { + ACTOR_TYPE_UNUSED_78, + ACTOR_TYPE_GOOMNUT_TREE, + ACTOR_TYPE_FAKE_BOWSER, + ACTOR_TYPE_GOOMBA_KING_DUP, + -1 +}; ActorSounds bActorSoundTable[ACTOR_TYPE_COUNT] = { [ACTOR_TYPE_RED_GOOMBA] = { diff --git a/src/17FEB0.c b/src/17FEB0.c index 3c5fa42f81..e89893e27b 100644 --- a/src/17FEB0.c +++ b/src/17FEB0.c @@ -83,7 +83,7 @@ s32 calc_item_damage_enemy(void) { target->lastDamageTaken = 0; actorClass = currentTargetID & ACTOR_CLASS_MASK; - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { state = &player->state; } else { state = &partner->state; diff --git a/src/18C790.c b/src/18C790.c index e29ffa4f38..f0b3122712 100644 --- a/src/18C790.c +++ b/src/18C790.c @@ -26,14 +26,14 @@ enum { MENU_BP = 2, }; -// first index for LevelUpStatTextHEIDs +// first index for LevelUpStatTextIDs enum { LVL_UP_FP = 0, LVL_UP_HP = 1, LVL_UP_BP = 2, }; -// second index for LevelUpStatTextHEIDs +// second index for LevelUpStatTextIDs enum { LVL_UP_TITLE = 0, LVL_UP_CUR_TENS = 1, @@ -44,13 +44,13 @@ enum { LVL_UP_BONUS = 6, }; -BSS s32 LevelUpStatEmblemHEIDs[4]; -BSS s32 LevelUpStatTextHEIDs[3][7]; +BSS HudElemID LevelUpStatEmblemIDs[4]; +BSS HudElemID LevelUpStatTextIDs[3][7]; BSS s32 D_8029FAE4; // unused? -BSS s32 LevelUpSpotlightHEID; +BSS HudElemID LevelUpSpotlightID; BSS s32 D_8029FAEC[23]; // unused? -BSS s32 LevelUpSelectTextHEID; +BSS HudElemID LevelUpSelectTextID; BSS s32 CelebrateSubstateTime; BSS s32 D_8029FB50; BSS s32 EndBattleRewardStep; @@ -198,7 +198,7 @@ HudScript* levelup_stat_scripts[3] = { &HES_level_up_BP, }; -HudScript* level_up_digit_scripts[3][10] = { +HudScript* HES_LevelUpDigits[3][10] = { { &HES_level_up_green_digit_0, &HES_level_up_green_digit_1, @@ -650,57 +650,57 @@ void btl_state_update_celebration(void) { } } else { id = hud_element_create(&HES_level_up_heart); - LevelUpStatEmblemHEIDs[0] = id; + LevelUpStatEmblemIDs[0] = id; hud_element_set_render_pos(id, 310, 140); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); id = hud_element_create(&HES_level_up_flower); - LevelUpStatEmblemHEIDs[1] = id; + LevelUpStatEmblemIDs[1] = id; hud_element_set_render_pos(id, 158, 340); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); id = hud_element_create(&HES_level_up_leaves); - LevelUpStatEmblemHEIDs[3] = id; + LevelUpStatEmblemIDs[3] = id; hud_element_set_render_pos(id, 158, 340); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); id = hud_element_create(&HES_level_up_badge); - LevelUpStatEmblemHEIDs[2] = id; + LevelUpStatEmblemIDs[2] = id; hud_element_set_render_pos(id, 6, 140); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); id = hud_element_create(levelup_stat_scripts[0]); - LevelUpStatTextHEIDs[LVL_UP_FP][LVL_UP_TITLE] = id; + LevelUpStatTextIDs[LVL_UP_FP][LVL_UP_TITLE] = id; hud_element_set_render_pos(id, 160, 317); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); - for (i = 1; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_FP]); i++) { - id = hud_element_create(level_up_digit_scripts[LVL_UP_FP][0]); - LevelUpStatTextHEIDs[LVL_UP_FP][i] = id; + for (i = 1; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) { + id = hud_element_create(HES_LevelUpDigits[LVL_UP_FP][0]); + LevelUpStatTextIDs[LVL_UP_FP][i] = id; hud_element_set_render_pos(id, 160, 317); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED); } id = hud_element_create(levelup_stat_scripts[1]); - LevelUpStatTextHEIDs[LVL_UP_HP][LVL_UP_TITLE] = id; + LevelUpStatTextIDs[LVL_UP_HP][LVL_UP_TITLE] = id; hud_element_set_render_pos(id, 312, 117); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); - for (i = 1; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_HP]); i++) { - id = hud_element_create(level_up_digit_scripts[LVL_UP_HP][0]); - LevelUpStatTextHEIDs[LVL_UP_HP][i] = id; + for (i = 1; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_HP]); i++) { + id = hud_element_create(HES_LevelUpDigits[LVL_UP_HP][0]); + LevelUpStatTextIDs[LVL_UP_HP][i] = id; hud_element_set_render_pos(id, 312, 117); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED); } id = hud_element_create(levelup_stat_scripts[2]); - LevelUpStatTextHEIDs[LVL_UP_BP][LVL_UP_TITLE] = id; + LevelUpStatTextIDs[LVL_UP_BP][LVL_UP_TITLE] = id; hud_element_set_render_pos(id, 8, 117); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); - for (i = 1; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_BP]); i++) { - id = hud_element_create(level_up_digit_scripts[LVL_UP_BP][0]); - LevelUpStatTextHEIDs[LVL_UP_BP][i] = id; + for (i = 1; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_BP]); i++) { + id = hud_element_create(HES_LevelUpDigits[LVL_UP_BP][0]); + LevelUpStatTextIDs[LVL_UP_BP][i] = id; hud_element_set_render_pos(id, 8, 117); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED); } @@ -713,7 +713,7 @@ void btl_state_update_celebration(void) { // current FP tensDigit = playerData->curMaxFP / 10; onesDigit = playerData->curMaxFP % 10; - id = LevelUpStatTextHEIDs[LVL_UP_FP][LVL_UP_CUR_TENS]; + id = LevelUpStatTextIDs[LVL_UP_FP][LVL_UP_CUR_TENS]; hud_element_set_script(id, level_up_small_digit_scripts[LVL_UP_FP][tensDigit]); if (tensDigit != 0) { hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); @@ -721,13 +721,13 @@ void btl_state_update_celebration(void) { hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x - 14, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_FP][LVL_UP_CUR_ONES]; + id = LevelUpStatTextIDs[LVL_UP_FP][LVL_UP_CUR_ONES]; hud_element_set_script(id, level_up_small_digit_scripts[LVL_UP_FP][onesDigit]); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x - 8, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_FP][LVL_UP_ARROW]; + id = LevelUpStatTextIDs[LVL_UP_FP][LVL_UP_ARROW]; hud_element_set_script(id, &HES_level_up_small_green_arrow); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); @@ -736,33 +736,33 @@ void btl_state_update_celebration(void) { // upgraded FP tensDigit = (playerData->curMaxFP + 5) / 10; onesDigit = (playerData->curMaxFP + 5) % 10; - id = LevelUpStatTextHEIDs[LVL_UP_FP][LVL_UP_NEXT_TENS]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_FP][tensDigit]); + id = LevelUpStatTextIDs[LVL_UP_FP][LVL_UP_NEXT_TENS]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_FP][tensDigit]); if (tensDigit != 0) { hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); } hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x + 3, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_FP][LVL_UP_NEXT_ONES]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_FP][onesDigit]); + id = LevelUpStatTextIDs[LVL_UP_FP][LVL_UP_NEXT_ONES]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_FP][onesDigit]); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x + 10, y + 46); } else { // upgraded FP only - id = LevelUpStatTextHEIDs[LVL_UP_FP][LVL_UP_NEXT_TENS]; + id = LevelUpStatTextIDs[LVL_UP_FP][LVL_UP_NEXT_TENS]; tensDigit = playerData->curMaxFP / 10; onesDigit = playerData->curMaxFP % 10; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_FP][tensDigit]); + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_FP][tensDigit]); if (tensDigit != 0) { hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); } hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x - 6, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_FP][LVL_UP_NEXT_ONES]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_FP][onesDigit]); + id = LevelUpStatTextIDs[LVL_UP_FP][LVL_UP_NEXT_ONES]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_FP][onesDigit]); hud_element_clear_flags(id, 2); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x + 2, y + 46); @@ -770,7 +770,7 @@ void btl_state_update_celebration(void) { } if (is_ability_active(ABILITY_FP_PLUS)) { - id = LevelUpStatTextHEIDs[LVL_UP_FP][LVL_UP_BONUS]; + id = LevelUpStatTextIDs[LVL_UP_FP][LVL_UP_BONUS]; itemHudElemID = gItemTable[ITEM_FP_PLUS_A].hudElemID; hud_element_set_script(id, gItemHudScripts[itemHudElemID].enabled); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); @@ -784,7 +784,7 @@ void btl_state_update_celebration(void) { tensDigit = playerData->curMaxHP / 10; onesDigit = playerData->curMaxHP % 10; - id = LevelUpStatTextHEIDs[LVL_UP_HP][LVL_UP_CUR_TENS]; + id = LevelUpStatTextIDs[LVL_UP_HP][LVL_UP_CUR_TENS]; hud_element_set_script(id, level_up_small_digit_scripts[LVL_UP_HP][tensDigit]); if (tensDigit != 0) { hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); @@ -792,13 +792,13 @@ void btl_state_update_celebration(void) { hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x - 14, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_HP][LVL_UP_CUR_ONES]; + id = LevelUpStatTextIDs[LVL_UP_HP][LVL_UP_CUR_ONES]; hud_element_set_script(id, level_up_small_digit_scripts[LVL_UP_HP][onesDigit]); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x - 8, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_HP][LVL_UP_ARROW]; + id = LevelUpStatTextIDs[LVL_UP_HP][LVL_UP_ARROW]; hud_element_set_script(id, &HES_level_up_small_red_arrow); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); @@ -807,16 +807,16 @@ void btl_state_update_celebration(void) { tensDigit = (playerData->curMaxHP + 5) / 10; onesDigit = (playerData->curMaxHP + 5) % 10; - id = LevelUpStatTextHEIDs[LVL_UP_HP][LVL_UP_NEXT_TENS]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_HP][tensDigit]); + id = LevelUpStatTextIDs[LVL_UP_HP][LVL_UP_NEXT_TENS]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_HP][tensDigit]); if (tensDigit != 0) { hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); } hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x + 3, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_HP][LVL_UP_NEXT_ONES]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_HP][onesDigit]); + id = LevelUpStatTextIDs[LVL_UP_HP][LVL_UP_NEXT_ONES]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_HP][onesDigit]); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x + 10, y + 46); @@ -824,16 +824,16 @@ void btl_state_update_celebration(void) { tensDigit = playerData->curMaxHP / 10; onesDigit = playerData->curMaxHP % 10; - id = LevelUpStatTextHEIDs[LVL_UP_HP][LVL_UP_NEXT_TENS]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_HP][tensDigit]); + id = LevelUpStatTextIDs[LVL_UP_HP][LVL_UP_NEXT_TENS]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_HP][tensDigit]); if (tensDigit != 0) { hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); } hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x - 6, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_HP][LVL_UP_NEXT_ONES]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_HP][onesDigit]); + id = LevelUpStatTextIDs[LVL_UP_HP][LVL_UP_NEXT_ONES]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_HP][onesDigit]); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x + 2, y + 46); @@ -841,7 +841,7 @@ void btl_state_update_celebration(void) { } if (is_ability_active(ABILITY_HP_PLUS)) { - id = LevelUpStatTextHEIDs[LVL_UP_HP][LVL_UP_BONUS]; + id = LevelUpStatTextIDs[LVL_UP_HP][LVL_UP_BONUS]; itemHudElemID = gItemTable[ITEM_HP_PLUS_A].hudElemID; hud_element_set_script(id, gItemHudScripts[itemHudElemID].enabled); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); @@ -854,7 +854,7 @@ void btl_state_update_celebration(void) { tensDigit = playerData->maxBP / 10; onesDigit = playerData->maxBP % 10; - id = LevelUpStatTextHEIDs[LVL_UP_BP][LVL_UP_CUR_TENS]; + id = LevelUpStatTextIDs[LVL_UP_BP][LVL_UP_CUR_TENS]; hud_element_set_script(id, level_up_small_digit_scripts[LVL_UP_BP][tensDigit]); if (tensDigit != 0) { hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); @@ -862,13 +862,13 @@ void btl_state_update_celebration(void) { hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x - 14, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_BP][LVL_UP_CUR_ONES]; + id = LevelUpStatTextIDs[LVL_UP_BP][LVL_UP_CUR_ONES]; hud_element_set_script(id, level_up_small_digit_scripts[LVL_UP_BP][onesDigit]); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x - 8, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_BP][LVL_UP_ARROW]; + id = LevelUpStatTextIDs[LVL_UP_BP][LVL_UP_ARROW]; hud_element_set_script(id, &HES_level_up_small_blue_arrow); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); @@ -877,35 +877,35 @@ void btl_state_update_celebration(void) { tensDigit = (playerData->maxBP + 3) / 10; onesDigit = (playerData->maxBP + 3) % 10; - id = LevelUpStatTextHEIDs[LVL_UP_BP][LVL_UP_NEXT_TENS]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_BP][tensDigit]); + id = LevelUpStatTextIDs[LVL_UP_BP][LVL_UP_NEXT_TENS]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_BP][tensDigit]); if (tensDigit != 0) { hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); } hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x + 3, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_BP][LVL_UP_NEXT_ONES]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_BP][onesDigit]); + id = LevelUpStatTextIDs[LVL_UP_BP][LVL_UP_NEXT_ONES]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_BP][onesDigit]); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x + 10, y + 46); } else { - id = LevelUpStatTextHEIDs[LVL_UP_BP][LVL_UP_NEXT_TENS]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_BP][3]); + id = LevelUpStatTextIDs[LVL_UP_BP][LVL_UP_NEXT_TENS]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_BP][3]); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x - 6, y + 46); - id = LevelUpStatTextHEIDs[LVL_UP_BP][LVL_UP_NEXT_ONES]; - hud_element_set_script(id, level_up_digit_scripts[LVL_UP_BP][0]); + id = LevelUpStatTextIDs[LVL_UP_BP][LVL_UP_NEXT_ONES]; + hud_element_set_script(id, HES_LevelUpDigits[LVL_UP_BP][0]); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); hud_element_get_render_pos(id, &x, &y); hud_element_set_render_pos(id, x + 2, y + 46); CantLevelUpStat[MENU_BP] = TRUE; } - id = LevelUpSpotlightHEID = hud_element_create(&HES_ProjectorBeam); + id = LevelUpSpotlightID = hud_element_create(&HES_ProjectorBeam); hud_element_create_transform_B(id); hud_element_set_render_pos(id, 156, 13); hud_element_set_tint(id, 255, 255, 255); @@ -915,7 +915,7 @@ void btl_state_update_celebration(void) { hud_element_set_alpha(id, 200); hud_element_set_flags(id, HUD_ELEMENT_FLAG_FILTER_TEX | HUD_ELEMENT_FLAG_80); - id = LevelUpSelectTextHEID = hud_element_create(&HES_level_up_select_one_to_upgrade); + id = LevelUpSelectTextID = hud_element_create(&HES_level_up_select_one_to_upgrade); hud_element_set_render_pos(id, 0, 0); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); battleStatus->currentSubmenu = 1; @@ -925,42 +925,42 @@ void btl_state_update_celebration(void) { } break; case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_SHOW_HUD: - id = LevelUpStatEmblemHEIDs[0]; + id = LevelUpStatEmblemIDs[0]; hud_element_get_render_pos(id, &x, &y); x -= 20; hud_element_set_render_pos(id, x, y); - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_HP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_HP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_HP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_HP][i]; hud_element_get_render_pos(id, &x, &y); x -= 20; hud_element_set_render_pos(id, x, y); } - id = LevelUpStatEmblemHEIDs[1]; + id = LevelUpStatEmblemIDs[1]; hud_element_get_render_pos(id, &x, &y); y -= 20; hud_element_set_render_pos(id, x, y); - id = LevelUpStatEmblemHEIDs[3]; + id = LevelUpStatEmblemIDs[3]; hud_element_get_render_pos(id, &x, &y); y -= 20; hud_element_set_render_pos(id, x, y); - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_FP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_FP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_FP][i]; hud_element_get_render_pos(id, &x, &y); y -= 20; hud_element_set_render_pos(id, x, y); } - id = LevelUpStatEmblemHEIDs[2]; + id = LevelUpStatEmblemIDs[2]; hud_element_get_render_pos(id, &x, &y); x += 20; hud_element_set_render_pos(id, x, y); - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_BP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_BP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_BP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_BP][i]; hud_element_get_render_pos(id, &x, &y); x += 20; hud_element_set_render_pos(id, x, y); @@ -1014,7 +1014,7 @@ void btl_state_update_celebration(void) { } break; case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_UPGRADE: - hud_element_free(LevelUpSpotlightHEID); + hud_element_free(LevelUpSpotlightID); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE); switch (battleStatus->currentSubmenu) { @@ -1068,27 +1068,27 @@ void btl_state_update_celebration(void) { if ((gGameStatusPtr->frameCounter % 2) != 0) { switch (battleStatus->currentSubmenu) { case 0: - hud_element_set_flags(LevelUpStatEmblemHEIDs[0], HUD_ELEMENT_FLAG_DISABLED); + hud_element_set_flags(LevelUpStatEmblemIDs[0], HUD_ELEMENT_FLAG_DISABLED); break; case 1: - hud_element_set_flags(LevelUpStatEmblemHEIDs[1], HUD_ELEMENT_FLAG_DISABLED); - hud_element_set_flags(LevelUpStatEmblemHEIDs[3], HUD_ELEMENT_FLAG_DISABLED); + hud_element_set_flags(LevelUpStatEmblemIDs[1], HUD_ELEMENT_FLAG_DISABLED); + hud_element_set_flags(LevelUpStatEmblemIDs[3], HUD_ELEMENT_FLAG_DISABLED); break; case 2: - hud_element_set_flags(LevelUpStatEmblemHEIDs[2], HUD_ELEMENT_FLAG_DISABLED); + hud_element_set_flags(LevelUpStatEmblemIDs[2], HUD_ELEMENT_FLAG_DISABLED); break; } } else { switch (battleStatus->currentSubmenu) { case 0: - hud_element_clear_flags(LevelUpStatEmblemHEIDs[0], HUD_ELEMENT_FLAG_DISABLED); + hud_element_clear_flags(LevelUpStatEmblemIDs[0], HUD_ELEMENT_FLAG_DISABLED); break; case 1: - hud_element_clear_flags(LevelUpStatEmblemHEIDs[1], HUD_ELEMENT_FLAG_DISABLED); - hud_element_clear_flags(LevelUpStatEmblemHEIDs[3], HUD_ELEMENT_FLAG_DISABLED); + hud_element_clear_flags(LevelUpStatEmblemIDs[1], HUD_ELEMENT_FLAG_DISABLED); + hud_element_clear_flags(LevelUpStatEmblemIDs[3], HUD_ELEMENT_FLAG_DISABLED); break; case 2: - hud_element_clear_flags(LevelUpStatEmblemHEIDs[2], HUD_ELEMENT_FLAG_DISABLED); + hud_element_clear_flags(LevelUpStatEmblemIDs[2], HUD_ELEMENT_FLAG_DISABLED); break; } } @@ -1102,21 +1102,21 @@ void btl_state_update_celebration(void) { } break; case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_DESTROY_HUD: - hud_element_free(LevelUpStatEmblemHEIDs[0]); - hud_element_free(LevelUpStatEmblemHEIDs[1]); - hud_element_free(LevelUpStatEmblemHEIDs[3]); - hud_element_free(LevelUpStatEmblemHEIDs[2]); + hud_element_free(LevelUpStatEmblemIDs[0]); + hud_element_free(LevelUpStatEmblemIDs[1]); + hud_element_free(LevelUpStatEmblemIDs[3]); + hud_element_free(LevelUpStatEmblemIDs[2]); - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs); i++) { - for (j = 0; j < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_FP]); j++) { - hud_element_free(LevelUpStatTextHEIDs[i][j]); + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs); i++) { + for (j = 0; j < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); j++) { + hud_element_free(LevelUpStatTextIDs[i][j]); } } - hud_element_free(LevelUpSelectTextHEID); + hud_element_free(LevelUpSelectTextID); set_background_color_blend(0, 0, 0, 0); btl_set_state(BATTLE_STATE_END_BATTLE); - gBattleSubState = BTL_SUBSTATE_END_BATTLE_UNK_2; + gBattleSubState = BTL_SUBSTATE_END_BATTLE_EXEC_STAGE_SCRIPT; break; case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID: width = get_msg_width(MSG_Menus_CantIncrease, 0) + 31; @@ -1191,7 +1191,7 @@ void btl_state_update_celebration(void) { kill_script_by_ID(partner->takeTurnScriptID); } btl_set_state(BATTLE_STATE_END_BATTLE); - gBattleSubState = BTL_SUBSTATE_END_BATTLE_UNK_2; + gBattleSubState = BTL_SUBSTATE_END_BATTLE_EXEC_STAGE_SCRIPT; break; } CelebrateStateTime++; @@ -1237,13 +1237,13 @@ void btl_draw_upgrade_windows(s32 phase) { break; } - hud_element_get_render_pos(LevelUpStatEmblemHEIDs[0], &x, &y); + hud_element_get_render_pos(LevelUpStatEmblemIDs[0], &x, &y); draw_box(0, WINDOW_STYLE_15, x - 22, y - 22, 0, 44, 44, 255, d1, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL, SCREEN_WIDTH, SCREEN_HEIGHT, NULL); - hud_element_get_render_pos(LevelUpStatEmblemHEIDs[3], &x, &y); + hud_element_get_render_pos(LevelUpStatEmblemIDs[3], &x, &y); draw_box(0, WINDOW_STYLE_15, x - 22, y - 22, 0, 44, 44, 255, d2, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL, SCREEN_WIDTH, SCREEN_HEIGHT, NULL); - hud_element_get_render_pos(LevelUpStatEmblemHEIDs[2], &x, &y); + hud_element_get_render_pos(LevelUpStatEmblemIDs[2], &x, &y); draw_box(0, WINDOW_STYLE_15, x - 22, y - 22, 0, 44, 44, 255, d3, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL, SCREEN_WIDTH, SCREEN_HEIGHT, NULL); } @@ -1258,22 +1258,22 @@ void btl_state_draw_celebration(void) { switch (gBattleSubState) { case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_SHOW_HUD: btl_draw_upgrade_windows(0); - id = LevelUpStatEmblemHEIDs[0]; + id = LevelUpStatEmblemIDs[0]; hud_element_set_tint(id, 128, 128, 128); hud_element_draw_clipped(id); - id = LevelUpStatEmblemHEIDs[3]; + id = LevelUpStatEmblemIDs[3]; hud_element_set_tint(id, 128, 128, 128); hud_element_draw_clipped(id); - id = LevelUpStatEmblemHEIDs[1]; + id = LevelUpStatEmblemIDs[1]; hud_element_set_tint(id, 128, 128, 128); hud_element_draw_clipped(id); - id = LevelUpStatEmblemHEIDs[2]; + id = LevelUpStatEmblemIDs[2]; hud_element_set_tint(id, 128, 128, 128); hud_element_draw_clipped(id); - for (j = 0; j < ARRAY_COUNT(LevelUpStatTextHEIDs); j++) { - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_FP]); i++) { - id = LevelUpStatTextHEIDs[j][i]; + for (j = 0; j < ARRAY_COUNT(LevelUpStatTextIDs); j++) { + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) { + id = LevelUpStatTextIDs[j][i]; hud_element_set_tint(id, 128, 128, 128); hud_element_draw_clipped(id); @@ -1286,67 +1286,67 @@ void btl_state_draw_celebration(void) { switch (battleStatus->currentSubmenu) { case 0: rotZ = 152; - hud_element_set_tint(LevelUpStatEmblemHEIDs[0], 255, 255, 255); - hud_element_set_tint(LevelUpStatEmblemHEIDs[3], 128, 128, 128); - hud_element_set_tint(LevelUpStatEmblemHEIDs[1], 128, 128, 128); - hud_element_set_tint(LevelUpStatEmblemHEIDs[2], 128, 128, 128); + hud_element_set_tint(LevelUpStatEmblemIDs[0], 255, 255, 255); + hud_element_set_tint(LevelUpStatEmblemIDs[3], 128, 128, 128); + hud_element_set_tint(LevelUpStatEmblemIDs[1], 128, 128, 128); + hud_element_set_tint(LevelUpStatEmblemIDs[2], 128, 128, 128); - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_FP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_FP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_FP][i]; hud_element_set_tint(id, 128, 128, 128); } - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_HP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_HP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_HP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_HP][i]; hud_element_set_tint(id, 255, 255, 255); } - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_BP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_BP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_BP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_BP][i]; hud_element_set_tint(id, 128, 128, 128); } - id = LevelUpStatEmblemHEIDs[0]; + id = LevelUpStatEmblemIDs[0]; if (hud_element_get_script(id) != &HES_level_up_heart_copy) { hud_element_set_script(id, &HES_level_up_heart_copy); } - id = LevelUpStatEmblemHEIDs[3]; + id = LevelUpStatEmblemIDs[3]; if (hud_element_get_script(id) != &HES_level_up_leaves) { hud_element_set_script(id, &HES_level_up_leaves); } - id = LevelUpStatEmblemHEIDs[1]; + id = LevelUpStatEmblemIDs[1]; if (hud_element_get_script(id) != &HES_level_up_flower) { hud_element_set_script(id, &HES_level_up_flower); } - id = LevelUpStatEmblemHEIDs[2]; + id = LevelUpStatEmblemIDs[2]; if (hud_element_get_script(id) != &HES_level_up_badge) { hud_element_set_script(id, &HES_level_up_badge); } break; case 1: rotZ = 180; - hud_element_set_tint(LevelUpStatEmblemHEIDs[0], 128, 128, 128); - hud_element_set_tint(LevelUpStatEmblemHEIDs[3], 255, 255, 255); - hud_element_set_tint(LevelUpStatEmblemHEIDs[1], 255, 255, 255); - hud_element_set_tint(LevelUpStatEmblemHEIDs[2], 128, 128, 128); + hud_element_set_tint(LevelUpStatEmblemIDs[0], 128, 128, 128); + hud_element_set_tint(LevelUpStatEmblemIDs[3], 255, 255, 255); + hud_element_set_tint(LevelUpStatEmblemIDs[1], 255, 255, 255); + hud_element_set_tint(LevelUpStatEmblemIDs[2], 128, 128, 128); - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_FP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_FP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_FP][i]; hud_element_set_tint(id, 255, 255, 255); } - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_HP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_HP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_HP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_HP][i]; hud_element_set_tint(id, 128, 128, 128); } - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_BP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_BP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_BP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_BP][i]; hud_element_set_tint(id, 128, 128, 128); } @@ -1354,25 +1354,25 @@ void btl_state_draw_celebration(void) { case 2: default: rotZ = 208; - hud_element_set_tint(LevelUpStatEmblemHEIDs[0], 128, 128, 128); - hud_element_set_tint(LevelUpStatEmblemHEIDs[3], 128, 128, 128); - hud_element_set_tint(LevelUpStatEmblemHEIDs[1], 128, 128, 128); - hud_element_set_tint(LevelUpStatEmblemHEIDs[2], 255, 255, 255); + hud_element_set_tint(LevelUpStatEmblemIDs[0], 128, 128, 128); + hud_element_set_tint(LevelUpStatEmblemIDs[3], 128, 128, 128); + hud_element_set_tint(LevelUpStatEmblemIDs[1], 128, 128, 128); + hud_element_set_tint(LevelUpStatEmblemIDs[2], 255, 255, 255); - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_FP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_FP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_FP][i]; hud_element_set_tint(id, 128, 128, 128); } - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_HP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_HP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_HP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_HP][i]; hud_element_set_tint(id, 128, 128, 128); } - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_BP]); i++) { - id = LevelUpStatTextHEIDs[LVL_UP_BP][i]; + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_BP]); i++) { + id = LevelUpStatTextIDs[LVL_UP_BP][i]; hud_element_set_tint(id, 255, 255, 255); } @@ -1380,33 +1380,33 @@ void btl_state_draw_celebration(void) { } btl_draw_upgrade_windows(1); - hud_element_draw_clipped(LevelUpStatEmblemHEIDs[0]); - hud_element_draw_clipped(LevelUpStatEmblemHEIDs[3]); - hud_element_draw_clipped(LevelUpStatEmblemHEIDs[1]); - hud_element_draw_clipped(LevelUpStatEmblemHEIDs[2]); + hud_element_draw_clipped(LevelUpStatEmblemIDs[0]); + hud_element_draw_clipped(LevelUpStatEmblemIDs[3]); + hud_element_draw_clipped(LevelUpStatEmblemIDs[1]); + hud_element_draw_clipped(LevelUpStatEmblemIDs[2]); - for (j = 0; j < ARRAY_COUNT(LevelUpStatTextHEIDs); j++) { - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_FP]); i++) { - hud_element_draw_clipped(LevelUpStatTextHEIDs[j][i]); + for (j = 0; j < ARRAY_COUNT(LevelUpStatTextIDs); j++) { + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) { + hud_element_draw_clipped(LevelUpStatTextIDs[j][i]); } } func_80144218(-1); - id = LevelUpSpotlightHEID; + id = LevelUpSpotlightID; hud_element_set_transform_rotation(id, 0.0f, 0.0f, rotZ); func_80144238(id); break; case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_UPGRADE: case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_FADE_OUT: btl_draw_upgrade_windows(1); - hud_element_draw_clipped(LevelUpStatEmblemHEIDs[0]); - hud_element_draw_clipped(LevelUpStatEmblemHEIDs[3]); - hud_element_draw_clipped(LevelUpStatEmblemHEIDs[1]); - hud_element_draw_clipped(LevelUpStatEmblemHEIDs[2]); + hud_element_draw_clipped(LevelUpStatEmblemIDs[0]); + hud_element_draw_clipped(LevelUpStatEmblemIDs[3]); + hud_element_draw_clipped(LevelUpStatEmblemIDs[1]); + hud_element_draw_clipped(LevelUpStatEmblemIDs[2]); - for (j = 0; j < ARRAY_COUNT(LevelUpStatTextHEIDs); j++) { - for (i = 0; i < ARRAY_COUNT(LevelUpStatTextHEIDs[LVL_UP_FP]); i++) { - hud_element_draw_clipped(LevelUpStatTextHEIDs[j][i]); + for (j = 0; j < ARRAY_COUNT(LevelUpStatTextIDs); j++) { + for (i = 0; i < ARRAY_COUNT(LevelUpStatTextIDs[LVL_UP_FP]); i++) { + hud_element_draw_clipped(LevelUpStatTextIDs[j][i]); } } @@ -1432,7 +1432,7 @@ void btl_state_draw_celebration(void) { LevelUpSelectTextOffsetX = 200; LevelUpSelectTextVelX = -LevelUpSelectTextVelX / 3; // rebounding } - id = LevelUpSelectTextHEID; + id = LevelUpSelectTextID; hud_element_set_render_pos(id, LevelUpSelectTextOffsetX - 43, 176); hud_element_draw_clipped(id); break; @@ -1442,7 +1442,7 @@ void btl_state_draw_celebration(void) { if (LevelUpSelectTextOffsetX > 500) { LevelUpSelectTextOffsetX = 500; } - id = LevelUpSelectTextHEID; + id = LevelUpSelectTextID; hud_element_set_render_pos(id, LevelUpSelectTextOffsetX - 43, 176); hud_element_draw_clipped(id); break; diff --git a/src/18F340.c b/src/18F340.c index 447a3a08b0..442541d3cb 100644 --- a/src/18F340.c +++ b/src/18F340.c @@ -131,8 +131,8 @@ ApiStatus ChoosePlayerCelebrationAnim(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus func_80260DB8(Evt* script, s32 isInitialCall) { - gBattleStatus.flags1 |= BS_FLAGS1_ENEMY_FLED; +ApiStatus SetFledBattleFlag(Evt* script, s32 isInitialCall) { + gBattleStatus.flags1 |= BS_FLAGS1_BATTLE_FLED; return ApiStatus_DONE2; } @@ -169,7 +169,7 @@ ApiStatus func_80260E5C(Evt* script, s32 isInitialCall) { ApiStatus N(GiveRefund)(Evt* script, s32 isInitialCall) { BattleStatus* battleStatus = &gBattleStatus; Actor* player = battleStatus->playerActor; - s32 sellValue = gItemTable[battleStatus->selectedItemID].sellValue; + s32 sellValue = gItemTable[battleStatus->moveArgument].sellValue; f32 facingAngleSign = 0.0f; s32 sleepTime = 0; f32 posX, posY, posZ; @@ -206,7 +206,7 @@ ApiStatus N(GiveRefund)(Evt* script, s32 isInitialCall) { } ApiStatus N(GiveRefundCleanup)(Evt* script, s32 isInitialCall) { - s32 sellValue = gItemTable[gBattleStatus.selectedItemID].sellValue; + s32 sellValue = gItemTable[gBattleStatus.moveArgument].sellValue; if (player_team_is_ability_active(gBattleStatus.playerActor, ABILITY_REFUND) && sellValue > 0) { hud_element_free(D_8029FBA0); @@ -297,8 +297,8 @@ ApiStatus func_80261388(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus func_802613A8(Evt* script, s32 isInitialCall) { - gBattleStatus.selectedItemID = ITEM_LIFE_SHROOM; +ApiStatus SetItemAsLifeShroom(Evt* script, s32 isInitialCall) { + gBattleStatus.moveArgument = ITEM_LIFE_SHROOM; return ApiStatus_DONE2; } @@ -646,12 +646,12 @@ ApiStatus func_802620F8(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -EvtScript D_80284A20 = { +EvtScript EVS_Mario_OnActorCreate = { EVT_RETURN EVT_END }; -EvtScript D_80284A30 = { +EvtScript EVS_Peach_OnActorCreate = { EVT_RETURN EVT_END }; @@ -1021,7 +1021,7 @@ EvtScript HandleEvent_Player = { EVT_SET(LVar2, 0) EVT_EXEC_WAIT(D_802988F0) EVT_RETURN - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_CALL(SetActorJumpGravity, ACTOR_PLAYER, EVT_FLOAT(1.8)) EVT_CALL(GetActorPos, ACTOR_PLAYER, LVar7, LVar8, LVar9) EVT_CALL(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario_AnimMidairStill, ANIM_Mario_AnimMidair, ANIM_Mario_BeforeJump) @@ -1087,7 +1087,7 @@ EvtScript D_80286228 = { EVT_CALL(func_80273444, 8, 0, 0) EVT_CALL(func_80260DD8) EVT_IF_EQ(LVar0, 1) - EVT_CALL(func_80260DB8) + EVT_CALL(SetFledBattleFlag) EVT_CALL(PlaySoundAtActor, ACTOR_PLAYER, SOUND_15E) EVT_CALL(SetGoalPos, ACTOR_PLAYER, -240, 0, 10) EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(16.0)) @@ -1201,7 +1201,7 @@ EvtScript RunAwayStart = { EVT_CALL(GetActionSuccess, LVar0) EVT_CALL(func_80260DD8) EVT_IF_EQ(LVar0, 1) - EVT_CALL(func_80260DB8) + EVT_CALL(SetFledBattleFlag) EVT_CALL(PlaySoundAtActor, ACTOR_PLAYER, SOUND_15E) EVT_CALL(SetGoalPos, ACTOR_PLAYER, -240, 0, 10) EVT_CALL(SetActorSpeed, ACTOR_PLAYER, EVT_FLOAT(16.0)) @@ -1458,7 +1458,7 @@ EvtScript UseLifeShroom = { EVT_SET(LVar3, LVar0) EVT_SET(LVar4, LVar1) EVT_SET(LVar5, LVar2) - EVT_CALL(func_802613A8) + EVT_CALL(SetItemAsLifeShroom) EVT_CALL(base_GiveRefund) EVT_IF_GT(LVar0, 0) EVT_WAIT(LVar0) diff --git a/src/190B20.c b/src/190B20.c index e4c419a8bd..d69b4b2a9a 100644 --- a/src/190B20.c +++ b/src/190B20.c @@ -200,8 +200,8 @@ void func_80263300(void) { ItemData* itemData = &gItemTable[itemID]; if (itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE) { - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = playerData->invItems[i]; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = playerData->invItems[i]; battleStatus->currentTargetListFlags = itemData->targetFlags; player_create_target_list(player); @@ -315,7 +315,7 @@ void btl_init_menu_boots(void) { // See if there are any targets for this move battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; - battleStatus->selectedItemID = playerData->bootsLevel; + battleStatus->moveArgument = playerData->bootsLevel; battleStatus->currentTargetListFlags = move->flags; // Controls target filters player_create_target_list(player); @@ -409,7 +409,7 @@ void btl_init_menu_hammer(void) { // See if there are any targets for this move battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; - battleStatus->selectedItemID = playerData->hammerLevel; + battleStatus->moveArgument = playerData->hammerLevel; battleStatus->currentTargetListFlags = move->flags; player_create_target_list(player); @@ -496,8 +496,8 @@ void btl_init_menu_partner(void) { } } - battleStatus->moveCategory = BTL_MENU_TYPE_5; - battleStatus->selectedItemID = partner->actorBlueprint->level; + battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; + battleStatus->moveArgument = partner->actorBlueprint->level; battleStatus->currentTargetListFlags = move->flags; player_create_target_list(partner); @@ -886,7 +886,7 @@ void load_player_actor(void) { player->defenseBoost = 0; player->chillOutAmount = 0; player->chillOutTurns = 0; - player->status = 0; + player->statusAfflicted = 0; player->actorTypeData1[0] = bActorSoundTable[player->actorType].walk[0]; player->actorTypeData1[1] = bActorSoundTable[player->actorType].walk[1]; player->actorTypeData1[2] = bActorSoundTable[player->actorType].fly[0]; @@ -1042,7 +1042,7 @@ void load_partner_actor(void) { x = -95.0f; y = partnerData->y; z = 0.0f; - gBattleStatus.flags1 |= BS_FLAGS1_100000; + gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK; } else { x = -130.0f; y = partnerData->y; @@ -1125,7 +1125,7 @@ void load_partner_actor(void) { partnerActor->defenseBoost = 0; partnerActor->chillOutAmount = 0; partnerActor->chillOutTurns = 0; - partnerActor->status = 0; + partnerActor->statusAfflicted = 0; partnerActor->actorTypeData1[0] = bActorSoundTable[partnerActor->actorType].walk[0]; partnerActor->actorTypeData1[1] = bActorSoundTable[partnerActor->actorType].walk[1]; partnerActor->actorTypeData1[2] = bActorSoundTable[partnerActor->actorType].fly[0]; @@ -1377,7 +1377,7 @@ Actor* create_actor(Formation formation) { actor->defenseBoost = 0; actor->chillOutAmount = 0; actor->chillOutTurns = 0; - actor->status = 0; + actor->statusAfflicted = 0; actor->actorTypeData1[0] = bActorSoundTable[actor->actorType].walk[0]; actor->actorTypeData1[1] = bActorSoundTable[actor->actorType].walk[1]; actor->actorTypeData1[2] = bActorSoundTable[actor->actorType].fly[0]; @@ -1396,7 +1396,7 @@ Actor* create_actor(Formation formation) { actor->state.varTable[2] = formation->var2; actor->state.varTable[3] = formation->var3; actor->renderMode = RENDER_MODE_ALPHATEST; - actor->unk_208 = 0; + actor->instigatorValue = 0; part = heap_malloc(sizeof(*part)); actor->partsTable = part; ASSERT(part != NULL); @@ -1691,7 +1691,7 @@ s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) { if (target->actorID != ACTOR_PARTNER) { if (target->debuff != statusTypeKey) { - target->status = statusTypeKey; + target->statusAfflicted = statusTypeKey; } target->disableEffect->data.disableX->koDuration = 0; target->debuff = statusTypeKey; @@ -1748,7 +1748,7 @@ s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) { if ((s8)duration > 9) { target->staticDuration = 9; } - target->status = STATUS_STATIC; + target->statusAfflicted = STATUS_STATIC; func_80266DAC(target, 4); create_status_static(target->hudElementDataIndex, STATUS_STATIC); } @@ -1760,7 +1760,7 @@ s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) { if ((s8)duration > 9) { target->stoneDuration = 9; } - target->status = STATUS_STONE; + target->statusAfflicted = STATUS_STONE; } return TRUE; case STATUS_DAZE: @@ -1770,7 +1770,7 @@ s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) { if ((s8)duration > 9) { target->koDuration = 9; } - target->status = STATUS_DAZE; + target->statusAfflicted = STATUS_DAZE; } return TRUE; case STATUS_TRANSPARENT: @@ -1780,7 +1780,7 @@ s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) { if ((s8)duration > 9) { target->transparentDuration = 9; } - target->status = STATUS_TRANSPARENT; + target->statusAfflicted = STATUS_TRANSPARENT; create_status_transparent(target->hudElementDataIndex, STATUS_TRANSPARENT); } return TRUE; diff --git a/src/19FAF0.c b/src/19FAF0.c index 010b896fd2..5574bd0442 100644 --- a/src/19FAF0.c +++ b/src/19FAF0.c @@ -573,7 +573,7 @@ s32 calc_player_damage_enemy(void) { retVal = 0; target->hpChangeCounter -= currentAttackDamage; - if (!(targetPart->flags & ACTOR_PART_FLAG_2000) && !(gBattleStatus.flags1 & BS_FLAGS1_2000000) && !sp1C && + if (!(targetPart->flags & ACTOR_PART_FLAG_2000) && !(gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE) && !sp1C && !(targetPart->targetFlags & ACTOR_PART_FLAG_4)) { target->currentHP -= currentAttackDamage; @@ -1051,7 +1051,7 @@ ApiStatus GetMenuSelection(Evt* script, s32 isInitialCall) { s32 outVar3 = *args++; evt_set_variable(script, outVar1, battleStatus->moveCategory); - evt_set_variable(script, outVar2, battleStatus->selectedItemID); + evt_set_variable(script, outVar2, battleStatus->moveArgument); evt_set_variable(script, outVar3, battleStatus->selectedMoveID); return ApiStatus_DONE2; diff --git a/src/1A5830.c b/src/1A5830.c index aaf9b7e78c..9b42aaf1fc 100644 --- a/src/1A5830.c +++ b/src/1A5830.c @@ -473,7 +473,7 @@ s32 calc_enemy_damage_target(Actor* attacker) { battleStatus->lastAttackDamage = 0; hitResult = HIT_RESULT_HIT; if (!(targetPart->flags & ACTOR_PART_FLAG_2000)) { - if (!(gBattleStatus.flags1 & BS_FLAGS1_2000000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE)) { if (!(target->flags & ACTOR_FLAG_NO_DMG_APPLY)) { target->currentHP -= damage; } @@ -3117,7 +3117,7 @@ ApiStatus AfflictActor(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus func_8027D75C(Evt* script, s32 isInitialCall) { +ApiStatus GetInstigatorValue(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 actorID = evt_get_variable(script, *args++); s32 outVar = *args++; @@ -3126,7 +3126,7 @@ ApiStatus func_8027D75C(Evt* script, s32 isInitialCall) { actorID = script->owner1.actorID; } - evt_set_variable(script, outVar, get_actor(actorID)->unk_208); + evt_set_variable(script, outVar, get_actor(actorID)->instigatorValue); return ApiStatus_DONE2; } @@ -3319,8 +3319,8 @@ ApiStatus CopyStatusEffects(Evt* script, s32 isInitialCall) { inflict_status(actorTo, actorFrom->koStatus, actorFrom->koDuration); inflict_status(actorTo, actorFrom->transparentStatus, actorFrom->transparentDuration); - actorFrom->status = 0; - actorTo->status = 0; + actorFrom->statusAfflicted = 0; + actorTo->statusAfflicted = 0; return ApiStatus_DONE2; } diff --git a/src/1AC760.c b/src/1AC760.c index 20bee3043f..aa1b84a10c 100644 --- a/src/1AC760.c +++ b/src/1AC760.c @@ -383,7 +383,7 @@ s32 calc_partner_damage_enemy(void) { dispatchEvent = EVENT_HIT_COMBO; retVal = 0; - if (!(targetPart->flags & ACTOR_PART_FLAG_2000) && !(gBattleStatus.flags1 & BS_FLAGS1_2000000) && !sp2C && !(targetPart->targetFlags & ACTOR_PART_FLAG_4)) { + if (!(targetPart->flags & ACTOR_PART_FLAG_2000) && !(gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE) && !sp2C && !(targetPart->targetFlags & ACTOR_PART_FLAG_4)) { target->currentHP -= damageDealt; if (target->currentHP <= 0) { diff --git a/src/1AF230.c b/src/1AF230.c index 2b2aa32726..aae86edfc4 100644 --- a/src/1AF230.c +++ b/src/1AF230.c @@ -117,12 +117,12 @@ s32 D_8029C890[][5] = { ApiStatus LoadStarPowerScript(Evt* script, s32 isInitialCall) { BattleStatus* battleStatus = &gBattleStatus; PlayerData* playerData = &gPlayerData; - s16 selectedItemID; + s16 starPowerIdx; playerData->specialBarsFilled -= gMoveTable[battleStatus->selectedMoveID].costFP * 256; - selectedItemID = battleStatus->selectedItemID; - dma_copy((&D_8029C7D0[selectedItemID])->dmaStart, (&D_8029C7D0[selectedItemID])->dmaEnd, - (&D_8029C7D0[selectedItemID])->dmaDest); - script->varTable[0] = (s32) (&D_8029C7D0[selectedItemID])->init; + starPowerIdx = battleStatus->moveArgument; + dma_copy((&D_8029C7D0[starPowerIdx])->dmaStart, (&D_8029C7D0[starPowerIdx])->dmaEnd, + (&D_8029C7D0[starPowerIdx])->dmaDest); + script->varTable[0] = (s32) (&D_8029C7D0[starPowerIdx])->init; return ApiStatus_DONE2; } diff --git a/src/415D90.c b/src/415D90.c index 36871997c7..e8bcf689dd 100644 --- a/src/415D90.c +++ b/src/415D90.c @@ -143,6 +143,7 @@ IconHudScriptPair battle_menu_ItemHudScripts = { &HES_MenuItem, &HES_MenuItemDis IconHudScriptPair battle_menu_StarPowerHudScripts = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled }; +//TODO retype to IconHudScriptPair[] HudScript* battle_menu_StarPowerMovesHudScripts[] = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled, &HES_Eldstar, &HES_EldstarDisabled, @@ -178,46 +179,30 @@ IconHudScriptPair battle_menu_DoNothingHudScripts = { &HES_MenuDoNothing, &HES_M IconHudScriptPair battle_menu_FleeHudScripts = { &HES_MenuFlee, &HES_MenuFleeDisabled }; -s32 battle_menu_leftJustfiedMessagesA[] = { +s32 BattleMenu_LeftJustMessages[] = { MSG_Menus_Jump, MSG_Menus_Hammer, MSG_Menus_Items, MSG_Menus_RunAway, MSG_Menus_Defense, -}; - -s32 battle_menu_leftJustfiedMessagesB[] = { MSG_Menus_ChangeMember, MSG_Menus_Abilities, MSG_Menus_Strategies, MSG_Menus_StarSpirits, -}; - -s32 battle_menu_leftJustfiedMessagesC[] = { MSG_Menus_DoNothing, MSG_Menus_ActLater, MSG_Menus_Focus, }; -// Jump, Hammer -s32 battle_menu_centeredMessagesA[] = { +s32 BattleMenu_CenteredMessages[] = { MSG_Menus_Jump_Centered, MSG_Menus_Hammer_Centered, -}; - -s32 battle_menu_centeredMessagesB[] = { MSG_Menus_Items_Centered, MSG_Menus_RunAway_Centered, MSG_Menus_Defense_Centered, MSG_Menus_ChangeMember_Centered, MSG_Menus_Abilities_Centered, -}; - -s32 battle_menu_centeredMessagesC[] = { MSG_Menus_Strategies_Centered, -}; - -s32 battle_menu_centeredMessagesD[] = { MSG_Menus_StarSpirits_Centered, MSG_Menus_DoNothing_Centered, MSG_Menus_ActLater_Centered, @@ -225,22 +210,21 @@ s32 battle_menu_centeredMessagesD[] = { }; s32 D_802AB4F0[] = { - [BTL_MENU_TYPE_JUMP] MOVE_TYPE_JUMP, - [BTL_MENU_TYPE_SMASH] MOVE_TYPE_HAMMER, - [BTL_MENU_TYPE_ITEM] MOVE_TYPE_ITEMS, - [BTL_MENU_TYPE_3] MOVE_TYPE_6, - [BTL_MENU_TYPE_4] MOVE_TYPE_3, - [BTL_MENU_TYPE_5] MOVE_TYPE_TACTICS, - [BTL_MENU_TYPE_6] 0x1A, - [BTL_MENU_TYPE_7] MOVE_TYPE_3, - [BTL_MENU_TYPE_8] 0x34, - [BTL_MENU_TYPE_9] 0x39, - [BTL_MENU_TYPE_A] 0x31, - [BTL_MENU_TYPE_B] 0x37 + [BTL_MENU_TYPE_JUMP] MOVE_TYPE_JUMP, + [BTL_MENU_TYPE_SMASH] MOVE_TYPE_HAMMER, + [BTL_MENU_TYPE_ITEMS] MOVE_TYPE_ITEMS, + [BTL_MENU_TYPE_RUN_AWAY] MOVE_TYPE_6, + [BTL_MENU_TYPE_DEFEND] MOVE_TYPE_3, + [BTL_MENU_TYPE_CHANGE_PARTNER] MOVE_TYPE_SWITCH, + [BTL_MENU_TYPE_ABILITY] 0x1A, + [BTL_MENU_TYPE_STRATEGIES] MOVE_TYPE_3, + [BTL_MENU_TYPE_STAR_POWERS] 0x34, + [BTL_MENU_TYPE_DO_NOTHING] 0x39, + [BTL_MENU_TYPE_ACT_LATER] 0x31, + [BTL_MENU_TYPE_PARTNER_FOCUS] 0x37 }; -AnimID battle_menu_partnerChooseMoveAnimations[] = { - [PARTNER_NONE] 0, +AnimID BattleMenu_PartnerThinkAnims[] = { [PARTNER_GOOMBARIO] ANIM_BattleGoombario_Think, [PARTNER_KOOPER] ANIM_BattleKooper_Think, [PARTNER_BOMBETTE] ANIM_BattleBombette_Think, @@ -256,8 +240,7 @@ AnimID battle_menu_partnerChooseMoveAnimations[] = { 0x00000000 }; -AnimID D_802AB558[] = { - [PARTNER_NONE] 0, +AnimID BattleMenu_PartnerIdleAnims[] = { [PARTNER_GOOMBARIO] ANIM_BattleGoombario_Walk, [PARTNER_KOOPER] ANIM_BattleKooper_Walk, [PARTNER_BOMBETTE] ANIM_BattleBombette_Walk, @@ -274,7 +257,6 @@ AnimID D_802AB558[] = { }; HudScript* battle_menu_PartnerMoveHudScripts[10][10] = { - { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }, [PARTNER_GOOMBARIO] { &HES_Goombario, &HES_GoombarioDisabled, &HES_MoveDiamond, &HES_MoveDiamondDisabled, &HES_MoveBlueOrb, &HES_MoveBlueOrbDisabled, &HES_MoveGreenOrb, &HES_MoveGreenOrbDisabled, &HES_MoveRedOrb, &HES_MoveRedOrbDisabled, }, [PARTNER_KOOPER] { &HES_Kooper, &HES_KooperDisabled, &HES_MoveDiamond, &HES_MoveDiamondDisabled, &HES_MoveBlueOrb, &HES_MoveBlueOrbDisabled, &HES_MoveGreenOrb, &HES_MoveGreenOrbDisabled, &HES_MoveRedOrb, &HES_MoveRedOrbDisabled, }, [PARTNER_BOMBETTE] { &HES_Bombette, &HES_BombetteDisabled, &HES_MoveDiamond, &HES_MoveDiamondDisabled, &HES_MoveBlueOrb, &HES_MoveBlueOrbDisabled, &HES_MoveGreenOrb, &HES_MoveGreenOrbDisabled, &HES_MoveRedOrb, &HES_MoveRedOrbDisabled, }, @@ -292,13 +274,13 @@ s32 D_802AB728[] = { MSG_Menus_Focus_Centered, }; -HudScript* battle_menu_TwinkStarPowerHudScripts[] = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled }; +IconHudScriptPair battle_menu_TwinkStarPowerHudScripts = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled }; s32 D_802AB734[] = { MSG_Menus_Dash_Centered, }; -s32 D_802AB738[] = { +s32 PartnerNameMessages[] = { 0x00000000, MSG_Menus_Party_Goombario, MSG_Menus_Party_Kooper, @@ -321,13 +303,13 @@ BSS s32 D_802ACC68; BSS s32 D_802ACC6C; BSS s32 D_802ACC70[24]; BSS PopupMenu D_802ACCD0; -BSS s8 D_802AD000; +BSS s8 BattleMenuState; BSS s8 D_802AD001; -BSS s8 D_802AD002; -BSS s8 D_802AD003; +BSS s8 BattleMenu_CurPos; +BSS s8 BattleMenu_PrevPos; BSS s8 D_802AD004; BSS s16 D_802AD006; -BSS s16 D_802AD008; +BSS s16 BattleMenuAlpha; BSS s16 D_802AD00A; BSS s16 D_802AD00C; // unused? BSS s32 D_802AD010[6]; @@ -340,26 +322,26 @@ BSS s32 D_802AD050; BSS s32 D_802AD054; BSS s32 D_802AD058; BSS s32 D_802AD05C; -BSS s32 D_802AD060; -BSS s32 D_802AD064; -BSS s8 D_802AD068; -BSS s8 D_802AD069; -BSS s8 D_802AD06A; -BSS s8 D_802AD06B; -BSS f32 D_802AD06C; +BSS s32 BattleMenu_BasePosX; +BSS s32 BattleMenu_BasePosY; +BSS s8 BattleMenuDisableMsg; +BSS s8 BattleMenu_MinIdx; +BSS s8 BattleMenu_MaxIdx; +BSS s8 BattleMenu_HomePos; +BSS f32 BattleMenu_WheelAngle; BSS f32 D_802AD070; BSS s32 D_802AD074; // unused? -BSS HudScript* main_battle_menu_JumpHudScripts[6]; -BSS s32 battle_menu_messageIDs[6]; +BSS HudScript* BattleMenu_HudScripts[6]; +BSS s32 BattleMenu_TitleMessages[6]; BSS s32 D_802AD0A8; -BSS s32 main_menu_numOptions; +BSS s32 BattleMenu_NumOptions; BSS s32 D_802AD0B0; BSS s32 D_802AD0B4; // unused? BSS s32 battle_menu_submenuIDs[6]; -BSS s32 battle_menu_isEnabled[6]; +BSS s32 BattleMenu_OptionEnabled[6]; BSS s32 battle_menu_isMessageDisabled[6]; BSS s32 D_802AD100; -BSS s32 D_802AD104; +BSS s32 BattleMenu_ShowSwapIcons; BSS s8 battle_menu_moveState; BSS s8 battle_menu_moveCursorPos; BSS s8 D_802AD10A; @@ -370,20 +352,20 @@ BSS s8 D_802AD10E; BSS s8 D_802AD10F; BSS s16 battle_menu_moveScrollOffset; BSS s16 D_802AD112; -BSS s16 battle_menu_moveTextColor; -BSS s16 battle_menu_moveTextOpacity; -BSS s32 battle_menu_moveCursorIcon; -BSS s32 battle_menu_moveUpArrowIcon; -BSS s32 battle_menu_moveDownArrowIcon; +BSS s16 BattleMenu_Moves_TextColor; +BSS s16 BattleMenu_Moves_TextAlpha; +BSS HudElemID BattleMenu_Moves_CursorID; +BSS HudElemID BattleMenu_Moves_UpArrowID; +BSS HudElemID BattleMenu_Moves_DownArrowID; BSS s32 D_802AD124; // unused? -BSS s32 battle_menu_moveOptionIconIDs[24]; -BSS s32 battle_menu_moveTitleIcon; +BSS HudElemID BattleMenu_Moves_OptionIDs[24]; +BSS HudElemID BattleMenu_Moves_TitleID; BSS s32 D_802AD18C; // unused? -BSS s32 battle_menu_moveOptionCostUnitIconIDs[24]; -BSS s16 battle_menu_moveX; -BSS s16 battle_menu_moveY; +BSS HudElemID BattleMenu_Moves_OptionCostUnitIDs[24]; +BSS s16 BattleMenu_Moves_PosX; +BSS s16 BattleMenu_Moves_PosY; BSS s32 D_802AD1F4; // unused? -BSS s32 battle_menu_moveOptionIndexMap[24]; +BSS s32 BattleMenu_Moves_OptionIndexMap[24]; BSS s32 D_802AD258; BSS s32 D_802AD25C; // unused? BSS HudScript* battle_menu_moveOptionIconScripts[24]; @@ -392,17 +374,17 @@ BSS s32 battle_menu_moveOptionDisplayCosts[24]; BSS s32 battle_menu_moveOptionDisplayCostReductions[24]; BSS s32 battle_menu_moveOptionDisplayCostReductionColors[24]; BSS s32 battle_menu_moveOptionBPCosts[24]; -BSS s32 battle_menu_hasSpiritsMenu; -BSS s32 battle_menu_moveOptionCount; +BSS s32 BattleMenu_UsingSpiritsSubmenu; +BSS s32 BattleMenu_Moves_OptionCount; BSS s32 D_802AD4A8; BSS s32 D_802AD4AC; // unused? -BSS s32 battle_menu_moveIndices[24]; -BSS s32 battle_menu_moveOptionsEnabled[24]; -BSS s32 battle_menu_moveOptionDescriptions[24]; -BSS s8 battle_menu_moveOptionSortPriorities[24]; -BSS s8 battle_menu_moveOptionCantUseTypes[24]; +BSS s32 BattleMenu_Moves_OptionIndices[24]; +BSS s32 BattleMenu_Moves_OptionEnabled[24]; +BSS s32 BattleMenu_Moves_OptionDescMessages[24]; +BSS s8 BattleMenu_Moves_OptionSortPriority[24]; +BSS s8 BattleMenu_Moves_OptionCantUseMessages[24]; BSS s32 battle_menu_moveOptionActive; -BSS s8 D_802AD604; +BSS s8 BattleSubmenuStratsState; BSS s8 D_802AD605; BSS s8 D_802AD606; BSS s8 D_802AD607; @@ -416,8 +398,8 @@ BSS s16 D_802AD610; BSS s16 D_802AD612; BSS s8 D_802AD614; BSS s32 D_802AD618; -BSS s32 D_802AD61C; -BSS s32 D_802AD620; +BSS HudElemID GreenArrowUpID; +BSS HudElemID GreenArrowDownID; BSS s32 D_802AD624; BSS s32 D_802AD628[5]; BSS s16 D_802AD63C; @@ -440,15 +422,15 @@ BSS s32 D_802AD6D4; void func_800F513C(PopupMenu* popup); s32 func_80265D44(s32 animID); -void func_802A3C98(s32 x, s32 y); -void func_802A43DC(s32 arg0, s32 x, s32 y); -void func_802A4448(s32 arg0, s32 x, s32 y); -void func_802A4494(s32 arg0, s32 x, s32 y); -void func_802A4534(s32 arg0, s32 x, s32 y); -void func_802A5290(s32 arg0, s32 x, s32 y); -void func_802A56F8(s32 arg0, s32 x, s32 y); -void func_802A5738(s32 arg0, s32 x, s32 y); -void func_802A57C8(s32* userData, s32 x, s32 y, s32 width, s32 height, s32 opacity, s32 darkening); +void func_802A3C98(void* data, s32 x, s32 y); +void func_802A43DC(void* data, s32 x, s32 y); +void func_802A4448(void* data, s32 x, s32 y); +void func_802A4494(void* data, s32 x, s32 y); +void func_802A4534(void* data, s32 x, s32 y); +void func_802A5290(void* data, s32 x, s32 y); +void func_802A56F8(void* data, s32 x, s32 y); +void func_802A5738(void* data, s32 x, s32 y); +void func_802A57C8(void* data, s32 x, s32 y); void func_80263300(void); void func_80263268(void); @@ -456,38 +438,42 @@ void btl_init_menu_partner(void); void func_800F52BC(void); void func_800F16CC(void); -void func_802A1000(void) { +void btl_main_menu_init(void) { D_802AD006 = 255; - D_802AD008 = 255; - D_802AD000 = 0; - D_802AD068 = -1; + BattleMenuAlpha = 255; + BattleMenuState = BTL_MENU_STATE_CREATE; + BattleMenuDisableMsg = -1; } +// btl_main_menu_hide? (after begin targeting) void func_802A1030(void) { D_802AD001 = 3; - D_802AD000 = 10; + BattleMenuState = BTL_MENU_STATE_UNK_A; } +// (after submenu closed/cancelled) void func_802A1050(void) { - D_802AD000 = 2; + BattleMenuState = BTL_MENU_STATE_ACCEPT_INPUT; D_802AD006 = 255; - D_802AD008 = 255; + BattleMenuAlpha = 255; } +// btl_main_menu_show? (canceling targeting -> main menu) void func_802A1078(void) { - D_802AD008 = 255; - D_802AD000 = 20; + BattleMenuAlpha = 255; + BattleMenuState = BTL_MENU_STATE_UNK_14; } +// btl_main_menu_show? (canceling targeting -> submenu) void func_802A1098(void) { - D_802AD008 = 100; - D_802AD000 = 30; + BattleMenuAlpha = 100; + BattleMenuState = BTL_MENU_STATE_UNK_1E; } -void func_802A10B8(void) { +void btl_main_menu_destroy(void) { s32 i; - for (i = 0; i < main_menu_numOptions; i++) { + for (i = 0; i < BattleMenu_NumOptions; i++) { s32* icons1 = D_802AD010; s32* icons2 = D_802AD028; @@ -505,7 +491,7 @@ void func_802A10B8(void) { hud_element_free(D_802AD058); } -s32 func_802A11B0(void) { +s32 btl_main_menu_update(void) { BattleStatus* battleStatus = &gBattleStatus; f32 theta; s32 id; @@ -513,19 +499,20 @@ s32 func_802A11B0(void) { f32 x, y; s32 l, t; - switch (D_802AD000) { - case 0: - D_802AD060 = 54; - D_802AD064 = 173; + switch (BattleMenuState) { + case BTL_MENU_STATE_CREATE: + BattleMenu_BasePosX = 54; + BattleMenu_BasePosY = 173; D_802AD070 = 0.3f; D_802AD004 = 0; - D_802AD06B = D_802AD0B0; - D_802AD069 = -D_802AD0B0; - D_802AD06A = main_menu_numOptions - 1; - D_802AD06A -= D_802AD0B0; + BattleMenu_HomePos = D_802AD0B0; + BattleMenu_MinIdx = 0; + BattleMenu_MinIdx -= D_802AD0B0; + BattleMenu_MaxIdx = BattleMenu_NumOptions - 1; + BattleMenu_MaxIdx -= D_802AD0B0; - for (i = 0; i < main_menu_numOptions; i++) { - D_802AD010[i] = id = hud_element_create(main_battle_menu_JumpHudScripts[i]); + for (i = 0; i < BattleMenu_NumOptions; i++) { + D_802AD010[i] = id = hud_element_create(BattleMenu_HudScripts[i]); hud_element_set_render_depth(id, 5); hud_element_set_flags(id, HUD_ELEMENT_FLAG_FILTER_TEX); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); @@ -552,7 +539,7 @@ s32 func_802A11B0(void) { hud_element_set_render_depth(id, 0); hud_element_set_render_pos(id, 40, 212); hud_element_set_tint(id, 0, 91, 127); - hud_element_set_transform_rotation_pivot(id, 0x10, -0x10); + hud_element_set_transform_rotation_pivot(id, 16, -16); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_FILTER_TEX); hud_element_set_alpha(id, 240); @@ -606,10 +593,10 @@ s32 func_802A11B0(void) { hud_element_set_render_pos(id, 102, 210); D_802AD00A = 100; D_802AD001 = 3; - D_802AD000 = 1; - D_802AD06C = theta = D_802AD100 * 28; + BattleMenuState = BTL_MENU_STATE_UNK_1; + BattleMenu_WheelAngle = theta = D_802AD100 * 28; break; - case 1: + case BTL_MENU_STATE_UNK_1: D_802AD00A = (D_802AD001 * 100) / 3; switch (D_802AD001) { @@ -622,16 +609,16 @@ s32 func_802A11B0(void) { D_802AD001--; break; case 0: - D_802AD002 = 0; - D_802AD003 = 0; - D_802AD06C = theta = D_802AD100 * 28; - for (i = 0; i < main_menu_numOptions; i++, theta += 28.0f) { + BattleMenu_CurPos = 0; + BattleMenu_PrevPos = 0; + BattleMenu_WheelAngle = theta = D_802AD100 * 28; + for (i = 0; i < BattleMenu_NumOptions; i++, theta += 28.0f) { x = 0.0f; y = 0.0f; add_vec2D_polar(&x, &y, 87.0f, theta); - l = D_802AD060 + x; - t = D_802AD064 + y; + l = BattleMenu_BasePosX + x; + t = BattleMenu_BasePosY + y; id = D_802AD010[i]; hud_element_set_render_pos(id, l, t); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); @@ -647,83 +634,84 @@ s32 func_802A11B0(void) { theta = D_802AD100 * 28; add_vec2D_polar(&x, &y, 87.0f, theta); - l = D_802AD060 + x; - t = D_802AD064 + y; + l = BattleMenu_BasePosX + x; + t = BattleMenu_BasePosY + y; id = D_802AD040; hud_element_set_render_pos(id, l, t); hud_element_set_alpha(id, 180); hud_element_set_scale(id, 0.85f); hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED); - D_802AD000 = 2; + BattleMenuState = BTL_MENU_STATE_ACCEPT_INPUT; break; } break; - case 2: + case BTL_MENU_STATE_ACCEPT_INPUT: if (battleStatus->currentButtonsPressed & BUTTON_A) { - if (battle_menu_isEnabled[D_802AD002 + D_802AD06B] == TRUE) { + if (BattleMenu_OptionEnabled[BattleMenu_CurPos + BattleMenu_HomePos] == TRUE) { sfx_play_sound(SOUND_MENU_NEXT); - D_802AD000 = -1; + BattleMenuState = BTL_MENU_STATE_OPENED_SUBMENU; } else { sfx_play_sound(SOUND_MENU_ERROR); - D_802AD068 = battle_menu_isMessageDisabled[D_802AD002 + D_802AD06B]; - D_802AD000 = 100; + BattleMenuDisableMsg = battle_menu_isMessageDisabled[BattleMenu_CurPos + BattleMenu_HomePos]; + BattleMenuState = BTL_MENU_STATE_SHOW_DISABLED_POPUP; } } else { - D_802AD003 = D_802AD002; + BattleMenu_PrevPos = BattleMenu_CurPos; if (D_802AD004 == 0) { if ((battleStatus->currentButtonsHeld & (BUTTON_STICK_LEFT | BUTTON_STICK_UP)) && - D_802AD069 < D_802AD002) + BattleMenu_MinIdx < BattleMenu_CurPos) { - D_802AD002--; + BattleMenu_CurPos--; } if ((battleStatus->currentButtonsHeld & (BUTTON_STICK_RIGHT | BUTTON_STICK_DOWN)) && - D_802AD002 < D_802AD06A) + BattleMenu_CurPos < BattleMenu_MaxIdx) { - D_802AD002++; + BattleMenu_CurPos++; } } - if (D_802AD003 != D_802AD002) { + if (BattleMenu_PrevPos != BattleMenu_CurPos) { D_802AD004 = 1; sfx_play_sound(SOUND_MENU_CHANGE_TAB); } } break; - case -1: - D_802AD008 = 100; - return D_802AD002 + D_802AD06B + 1; - case 10: + case BTL_MENU_STATE_OPENED_SUBMENU: + BattleMenuAlpha = 100; + return BattleMenu_CurPos + BattleMenu_HomePos + 1; + case BTL_MENU_STATE_UNK_A: D_802AD001 = 0; D_802AD006 = 0; - D_802AD000 = 11; - return D_802AD002 + D_802AD06B + 1; - case 11: - return D_802AD002 + D_802AD06B + 1; - case 20: + BattleMenuState = BTL_MENU_STATE_UNK_B; + return BattleMenu_CurPos + BattleMenu_HomePos + 1; + case BTL_MENU_STATE_UNK_B: + return BattleMenu_CurPos + BattleMenu_HomePos + 1; + case BTL_MENU_STATE_UNK_14: D_802AD001 = 3; D_802AD006 = 255; - D_802AD000 = 2; - return D_802AD002 + D_802AD06B + 1; - case 30: + BattleMenuState = BTL_MENU_STATE_ACCEPT_INPUT; + return BattleMenu_CurPos + BattleMenu_HomePos + 1; + case BTL_MENU_STATE_UNK_1E: D_802AD001 = 3; D_802AD006 = 255; - D_802AD000 = -1; + BattleMenuState = BTL_MENU_STATE_OPENED_SUBMENU; break; - case 100: - btl_show_battle_message(D_802AD068, 90); - D_802AD000 = 101; + case BTL_MENU_STATE_SHOW_DISABLED_POPUP: + btl_show_battle_message(BattleMenuDisableMsg, 90); + BattleMenuState = BTL_MENU_STATE_AWAIT_DISABLED_POPUP; break; - case 101: - if (!btl_is_popup_displayed()) { - D_802AD068 = -1; - D_802AD000 = 2; + case BTL_MENU_STATE_AWAIT_DISABLED_POPUP: + if (btl_is_popup_displayed()) { + break; } + BattleMenuDisableMsg = -1; + BattleMenuState = BTL_MENU_STATE_ACCEPT_INPUT; break; } return 0; } -void btl_draw_menu_wheel(void) { +void btl_main_menu_draw(void) { s32 id; s32 opacity; f32 theta; @@ -733,8 +721,8 @@ void btl_draw_menu_wheel(void) { s32 i; s32 l, t; - switch (D_802AD000) { - case 1: + switch (BattleMenuState) { + case BTL_MENU_STATE_UNK_1: func_80144218(-1); id = D_802AD048; hud_element_set_transform_rotation(id, 0.0f, 0.0f, 0.0f); @@ -746,26 +734,26 @@ void btl_draw_menu_wheel(void) { hud_element_set_render_pos(id, 40 - D_802AD00A, D_802AD00A + 212); func_80144238(id); break; - case -1: - case 2: - case 10: - case 20: - case 30: - opacity = (D_802AD006 * D_802AD008) / 255; + case BTL_MENU_STATE_OPENED_SUBMENU: + case BTL_MENU_STATE_ACCEPT_INPUT: + case BTL_MENU_STATE_UNK_A: + case BTL_MENU_STATE_UNK_14: + case BTL_MENU_STATE_UNK_1E: + opacity = (D_802AD006 * BattleMenuAlpha) / 255; func_80144218(-1); - theta = (D_802AD100 - D_802AD002) * 28; + theta = (D_802AD100 - BattleMenu_CurPos) * 28; cond = FALSE; - if (D_802AD06C > theta) { - D_802AD06C -= D_802AD070; - if (D_802AD06C < theta) { - D_802AD06C = theta; + if (BattleMenu_WheelAngle > theta) { + BattleMenu_WheelAngle -= D_802AD070; + if (BattleMenu_WheelAngle < theta) { + BattleMenu_WheelAngle = theta; cond = TRUE; } - } else if (D_802AD06C < theta) { - D_802AD06C += D_802AD070; - if (D_802AD06C > theta) { - D_802AD06C = theta; + } else if (BattleMenu_WheelAngle < theta) { + BattleMenu_WheelAngle += D_802AD070; + if (BattleMenu_WheelAngle > theta) { + BattleMenu_WheelAngle = theta; cond = TRUE; } } else { @@ -779,14 +767,14 @@ void btl_draw_menu_wheel(void) { D_802AD070 = 0.3f; } - theta = D_802AD06C; - for (i = 0; i < main_menu_numOptions; i++, theta += 28.0f) { + theta = BattleMenu_WheelAngle; + for (i = 0; i < BattleMenu_NumOptions; i++, theta += 28.0f) { x = 0.0f; y = 0.0f; add_vec2D_polar(&x, &y, 87.0f, theta); id = D_802AD028[i]; - x = D_802AD060 + x; - y = D_802AD064 + y; + x = BattleMenu_BasePosX + x; + y = BattleMenu_BasePosY + y; hud_element_set_transform_pos(id, x, -y, 0.0f); hud_element_set_render_pos(id, 0, 0); hud_element_set_alpha(id, (opacity * 150) / 255); @@ -798,12 +786,12 @@ void btl_draw_menu_wheel(void) { } func_80144238(id); - if (i == D_802AD06B + D_802AD002) { + if (i == BattleMenu_HomePos + BattleMenu_CurPos) { x = 0.0f; y = 0.0f; add_vec2D_polar(&x, &y, 87.0f, 56.0f); - x = D_802AD060 + x; - y = D_802AD064 + y; + x = BattleMenu_BasePosX + x; + y = BattleMenu_BasePosY + y; id = D_802AD040; hud_element_set_transform_pos(id, x, -y, 0.0f); hud_element_set_render_pos(id, 0, 0); @@ -817,8 +805,8 @@ void btl_draw_menu_wheel(void) { func_80144238(id); } } - theta = (D_802AD100 - D_802AD002) * 28; - scale = (fabsf(fabsf((D_802AD06C - theta) * (45.0 / 28.0)) - 22.5) / 22.5) + 0.01; + theta = (D_802AD100 - BattleMenu_CurPos) * 28; + scale = (fabsf(fabsf((BattleMenu_WheelAngle - theta) * (45.0 / 28.0)) - 22.5) / 22.5) + 0.01; if (cond) { scale = 1.0f; } @@ -833,8 +821,8 @@ void btl_draw_menu_wheel(void) { func_80144238(id); id = D_802AD048; - theta = (D_802AD100 - D_802AD002) * 28; - scale = (D_802AD06C - theta) * (45.0 / 28.0); + theta = (D_802AD100 - BattleMenu_CurPos) * 28; + scale = (BattleMenu_WheelAngle - theta) * (45.0 / 28.0); hud_element_set_transform_rotation(id, 0.0f, 0.0f, -scale); hud_element_set_transform_rotation_pivot(id, 18, -20); hud_element_set_scale(id, 0.95f); @@ -848,35 +836,35 @@ void btl_draw_menu_wheel(void) { hud_element_set_scale(id, 1.0f); func_80144238(id); - theta = D_802AD06C; - for (i = 0; i < main_menu_numOptions; i++, theta += 28.0f) { + theta = BattleMenu_WheelAngle; + for (i = 0; i < BattleMenu_NumOptions; i++, theta += 28.0f) { x = 0.0f; y = 0.0f; add_vec2D_polar(&x, &y, 87.0f, theta); - l = x = D_802AD060 + x; - t = y = D_802AD064 + y; + l = x = BattleMenu_BasePosX + x; + t = y = BattleMenu_BasePosY + y; btl_draw_prim_quad(0, 0, 0, 0, l - 12, t - 12, 24, 24); id = D_802AD010[i]; hud_element_set_render_pos(id, l, t); hud_element_set_alpha(id, (opacity * 180) / 255); - if (i == D_802AD06B + D_802AD002) { + if (i == BattleMenu_HomePos + BattleMenu_CurPos) { hud_element_set_alpha(id, opacity); } hud_element_draw_clipped(id); } if (cond) { - l = D_802AD060 + 20; - t = D_802AD064 - 34; + l = BattleMenu_BasePosX + 20; + t = BattleMenu_BasePosY - 34; btl_draw_prim_quad(0, 0, 0, 0, l + 26, t, 48, 16); - draw_msg(battle_menu_messageIDs[D_802AD002 + D_802AD06B], l, t, opacity, MSG_PAL_35, 0); + draw_msg(BattleMenu_TitleMessages[BattleMenu_CurPos + BattleMenu_HomePos], l, t, opacity, MSG_PAL_35, 0); } - if ((gBattleStatus.flags1 & BS_FLAGS1_2000000) || (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE)) { - D_802AD104 = 0; + if ((gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE) || (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE)) { + BattleMenu_ShowSwapIcons = FALSE; } - if (D_802AD104) { + if (BattleMenu_ShowSwapIcons) { id = D_802AD05C; hud_element_set_alpha(id, (opacity * 200) / 255); hud_element_draw_clipped(id); @@ -896,26 +884,26 @@ void btl_draw_menu_wheel(void) { // Very similar to func_802A45D8 - maybe can be used to reduce fake matches there void func_802A2684(void) { - if (D_802AD4A8 >= battle_menu_moveOptionCount) { - D_802AD4A8 = battle_menu_moveOptionCount - 1; + if (D_802AD4A8 >= BattleMenu_Moves_OptionCount) { + D_802AD4A8 = BattleMenu_Moves_OptionCount - 1; } - battle_menu_moveState = 0; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_0; battle_menu_moveScrollLine = 0; battle_menu_moveCursorPos = D_802AD4A8; D_802AD10A = D_802AD4A8; - D_802AD10E = battle_menu_moveOptionCount; + D_802AD10E = BattleMenu_Moves_OptionCount; if (D_802AD10E > 6) { D_802AD10E = 6; } D_802AD10D = 6; - if (battle_menu_moveOptionCount < 6) { - D_802AD10D = battle_menu_moveOptionCount; + if (BattleMenu_Moves_OptionCount < 6) { + D_802AD10D = BattleMenu_Moves_OptionCount; } - battle_menu_moveTextOpacity = 255; + BattleMenu_Moves_TextAlpha = 255; D_802AD10F = 1; if (D_802AD10A < 0) { @@ -926,8 +914,8 @@ void func_802A2684(void) { } D_802AD10D = battle_menu_moveScrollLine + 6; - if (D_802AD10D > battle_menu_moveOptionCount) { - D_802AD10D = battle_menu_moveOptionCount; + if (D_802AD10D > BattleMenu_Moves_OptionCount) { + D_802AD10D = BattleMenu_Moves_OptionCount; } battle_menu_moveScrollOffset = -battle_menu_moveScrollLine * 13; @@ -936,7 +924,7 @@ void func_802A2684(void) { } void func_802A27D0(void) { - battle_menu_moveState = 10; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_A; } void func_802A27E4(void) { @@ -944,7 +932,7 @@ void func_802A27E4(void) { set_window_update(WINDOW_ID_1, WINDOW_UPDATE_HIDE); - if (!battle_menu_hasSpiritsMenu) { + if (!BattleMenu_UsingSpiritsSubmenu) { set_window_update(WINDOW_ID_2, WINDOW_UPDATE_HIDE); set_window_update(WINDOW_ID_3, WINDOW_UPDATE_HIDE); } else { @@ -954,17 +942,17 @@ void func_802A27E4(void) { set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE); - for (i = 0; i < battle_menu_moveOptionCount; i++) { - hud_element_free(battle_menu_moveOptionIconIDs[i]); + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { + hud_element_free(BattleMenu_Moves_OptionIDs[i]); } - hud_element_free(battle_menu_moveCursorIcon); - hud_element_free(battle_menu_moveUpArrowIcon); - hud_element_free(battle_menu_moveDownArrowIcon); - hud_element_free(battle_menu_moveTitleIcon); + hud_element_free(BattleMenu_Moves_CursorID); + hud_element_free(BattleMenu_Moves_UpArrowID); + hud_element_free(BattleMenu_Moves_DownArrowID); + hud_element_free(BattleMenu_Moves_TitleID); - for (i = 0; i < battle_menu_moveOptionCount; i++) { - hud_element_free(battle_menu_moveOptionCostUnitIconIDs[i]); + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { + hud_element_free(BattleMenu_Moves_OptionCostUnitIDs[i]); } } @@ -973,27 +961,27 @@ void func_802A2910(void) { s32* moveOptionCostUnitIconIDs; s32 i; - moveOptionIconIDs = battle_menu_moveOptionIconIDs; + moveOptionIconIDs = BattleMenu_Moves_OptionIDs; - for (i = 0; i < battle_menu_moveOptionCount; i++) { + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { hud_element_set_tint(moveOptionIconIDs[i], 255, 255, 255); } - hud_element_set_tint(battle_menu_moveCursorIcon, 255, 255, 255); - hud_element_set_tint(battle_menu_moveUpArrowIcon, 255, 255, 255); - hud_element_set_tint(battle_menu_moveDownArrowIcon, 255, 255, 255); - hud_element_set_tint(battle_menu_moveTitleIcon, 255, 255, 255); + hud_element_set_tint(BattleMenu_Moves_CursorID, 255, 255, 255); + hud_element_set_tint(BattleMenu_Moves_UpArrowID, 255, 255, 255); + hud_element_set_tint(BattleMenu_Moves_DownArrowID, 255, 255, 255); + hud_element_set_tint(BattleMenu_Moves_TitleID, 255, 255, 255); - moveOptionCostUnitIconIDs = battle_menu_moveOptionCostUnitIconIDs; + moveOptionCostUnitIconIDs = BattleMenu_Moves_OptionCostUnitIDs; - for (i = 0; i < battle_menu_moveOptionCount; i++) { + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { hud_element_set_tint(moveOptionCostUnitIconIDs[i], 255, 255, 255); } - hud_element_set_script(battle_menu_moveCursorIcon, &HES_AnimatedHandPointer); + hud_element_set_script(BattleMenu_Moves_CursorID, &HES_AnimatedHandPointer); set_window_update(WINDOW_ID_1, WINDOW_UPDATE_TRANSPARENT); - if (!battle_menu_hasSpiritsMenu) { + if (!BattleMenu_UsingSpiritsSubmenu) { set_window_update(WINDOW_ID_2, WINDOW_UPDATE_TRANSPARENT); set_window_update(WINDOW_ID_3, WINDOW_UPDATE_TRANSPARENT); } else { @@ -1002,10 +990,10 @@ void func_802A2910(void) { } set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); - battle_menu_moveTextColor = MSG_PAL_STANDARD; + BattleMenu_Moves_TextColor = MSG_PAL_STANDARD; D_802AD10F = 1; - battle_menu_moveTextOpacity = 255; - battle_menu_moveState = 1; + BattleMenu_Moves_TextAlpha = 255; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_1; } void func_802A2AB8(void) { @@ -1015,7 +1003,7 @@ void func_802A2AB8(void) { set_window_update(WINDOW_ID_1, WINDOW_UPDATE_TRANSPARENT); - if (!battle_menu_hasSpiritsMenu) { + if (!BattleMenu_UsingSpiritsSubmenu) { set_window_update(WINDOW_ID_2, WINDOW_UPDATE_TRANSPARENT); set_window_update(WINDOW_ID_3, WINDOW_UPDATE_TRANSPARENT); } else { @@ -1024,35 +1012,35 @@ void func_802A2AB8(void) { } set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); - moveOptionIconIDs = battle_menu_moveOptionIconIDs; + moveOptionIconIDs = BattleMenu_Moves_OptionIDs; - for (i = 0; i < battle_menu_moveOptionCount; i++) { + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { hud_element_set_tint(moveOptionIconIDs[i], 255, 255, 255); } - hud_element_set_tint(battle_menu_moveCursorIcon, 255, 255, 255); - hud_element_set_tint(battle_menu_moveUpArrowIcon, 255, 255, 255); - hud_element_set_tint(battle_menu_moveDownArrowIcon, 255, 255, 255); - hud_element_set_tint(battle_menu_moveTitleIcon, 255, 255, 255); + hud_element_set_tint(BattleMenu_Moves_CursorID, 255, 255, 255); + hud_element_set_tint(BattleMenu_Moves_UpArrowID, 255, 255, 255); + hud_element_set_tint(BattleMenu_Moves_DownArrowID, 255, 255, 255); + hud_element_set_tint(BattleMenu_Moves_TitleID, 255, 255, 255); - moveOptionCostUnitIconIDs = battle_menu_moveOptionCostUnitIconIDs; + moveOptionCostUnitIconIDs = BattleMenu_Moves_OptionCostUnitIDs; - for (i = 0; i < battle_menu_moveOptionCount; i++) { + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { hud_element_set_tint(moveOptionCostUnitIconIDs[i], 255, 255, 255); } - hud_element_set_script(battle_menu_moveCursorIcon, &HES_AnimatedHandPointer); - battle_menu_moveTextColor = MSG_PAL_STANDARD; + hud_element_set_script(BattleMenu_Moves_CursorID, &HES_AnimatedHandPointer); + BattleMenu_Moves_TextColor = MSG_PAL_STANDARD; D_802AD10F = 1; - battle_menu_moveState = 20; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_14; } void func_802A2C58(void) { set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); - battle_menu_moveState = 30; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_1E; } -s32 func_802A2C84(void) { +s32 btl_submenu_moves_update(void) { BattleStatus* battleStatus = &gBattleStatus; s8 temp_v0_14; s32 moveX; @@ -1066,118 +1054,118 @@ s32 func_802A2C84(void) { s32 j; switch (battle_menu_moveState) { - case 0: + case BTL_SUBMENU_MOVES_STATE_UNK_0: battle_menu_moveScrollOffset = -battle_menu_moveScrollLine * 13; D_802AD112 = (battle_menu_moveCursorPos - battle_menu_moveScrollLine) * 13; - battle_menu_moveX = 20; - battle_menu_moveY = 68; + BattleMenu_Moves_PosX = 20; + BattleMenu_Moves_PosY = 68; - for (i = 0; i < battle_menu_moveOptionCount; i++) { - battle_menu_moveOptionIndexMap[i] = i; + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { + BattleMenu_Moves_OptionIndexMap[i] = i; } - if (!battle_menu_hasSpiritsMenu) { - for (i = 0; i < (battle_menu_moveOptionCount - 1); i++) { - for (j = i + 1; j < battle_menu_moveOptionCount; j++) { + if (!BattleMenu_UsingSpiritsSubmenu) { + for (i = 0; i < (BattleMenu_Moves_OptionCount - 1); i++) { + for (j = i + 1; j < BattleMenu_Moves_OptionCount; j++) { do { - s32 temp1 = battle_menu_moveOptionIndexMap[i]; - s32 temp2 = battle_menu_moveOptionIndexMap[j]; + s32 temp1 = BattleMenu_Moves_OptionIndexMap[i]; + s32 temp2 = BattleMenu_Moves_OptionIndexMap[j]; - if (battle_menu_moveOptionSortPriorities[temp1] < battle_menu_moveOptionSortPriorities[temp2]) { + if (BattleMenu_Moves_OptionSortPriority[temp1] < BattleMenu_Moves_OptionSortPriority[temp2]) { continue; } if ( - battle_menu_moveOptionSortPriorities[temp1] != battle_menu_moveOptionSortPriorities[temp2] || + BattleMenu_Moves_OptionSortPriority[temp1] != BattleMenu_Moves_OptionSortPriority[temp2] || (battle_menu_moveOptionDisplayCosts[temp1] >= battle_menu_moveOptionDisplayCosts[temp2]) && (battle_menu_moveOptionDisplayCosts[temp1] != battle_menu_moveOptionDisplayCosts[temp2] || battle_menu_moveOptionBPCosts[temp1] >= battle_menu_moveOptionBPCosts[temp2]) ) { - s32 swapTmp = battle_menu_moveOptionIndexMap[i]; - battle_menu_moveOptionIndexMap[i] = battle_menu_moveOptionIndexMap[j]; - battle_menu_moveOptionIndexMap[j] = swapTmp; + s32 swapTmp = BattleMenu_Moves_OptionIndexMap[i]; + BattleMenu_Moves_OptionIndexMap[i] = BattleMenu_Moves_OptionIndexMap[j]; + BattleMenu_Moves_OptionIndexMap[j] = swapTmp; } } while (0); } } } - for (i = 0; i < battle_menu_moveOptionCount; i++) { - id = hud_element_create(battle_menu_moveOptionIconScripts[battle_menu_moveOptionIndexMap[i]]); - battle_menu_moveOptionIconIDs[i] = id; + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { + id = hud_element_create(battle_menu_moveOptionIconScripts[BattleMenu_Moves_OptionIndexMap[i]]); + BattleMenu_Moves_OptionIDs[i] = id; hud_element_set_scale(id, 0.45f); hud_element_set_flags(id, HUD_ELEMENT_FLAG_FILTER_TEX | HUD_ELEMENT_FLAG_80); } id = hud_element_create(&HES_AnimatedHandPointer); - battle_menu_moveCursorIcon = id; + BattleMenu_Moves_CursorID = id; hud_element_set_flags(id, HUD_ELEMENT_FLAG_DROP_SHADOW | HUD_ELEMENT_FLAG_80); - hud_element_set_render_pos(id, battle_menu_moveX, battle_menu_moveY); + hud_element_set_render_pos(id, BattleMenu_Moves_PosX, BattleMenu_Moves_PosY); id = hud_element_create(&HES_GreenArrowUp); - battle_menu_moveUpArrowIcon = id; + BattleMenu_Moves_UpArrowID = id; hud_element_set_flags(id, HUD_ELEMENT_FLAG_DROP_SHADOW | HUD_ELEMENT_FLAG_80); - hud_element_set_render_pos(id, battle_menu_moveX + 39, battle_menu_moveY - 7); + hud_element_set_render_pos(id, BattleMenu_Moves_PosX + 39, BattleMenu_Moves_PosY - 7); id = hud_element_create(&HES_GreenArrowDown); - battle_menu_moveDownArrowIcon = id; + BattleMenu_Moves_DownArrowID = id; hud_element_set_flags(id, HUD_ELEMENT_FLAG_DROP_SHADOW | HUD_ELEMENT_FLAG_80); - hud_element_set_render_pos(id, battle_menu_moveX + 39, battle_menu_moveY + 78); + hud_element_set_render_pos(id, BattleMenu_Moves_PosX + 39, BattleMenu_Moves_PosY + 78); - if (battle_menu_hasSpiritsMenu == 0) { + if (!BattleMenu_UsingSpiritsSubmenu) { id = hud_element_create(&HES_StatusFlower); - battle_menu_moveTitleIcon = id; + BattleMenu_Moves_TitleID = id; hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); } else { id = hud_element_create(&HES_MenuStarPower); - battle_menu_moveTitleIcon = id; + BattleMenu_Moves_TitleID = id; hud_element_set_scale(id, 0.75f); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); } - hud_element_set_render_pos(id, battle_menu_moveX + 56, battle_menu_moveY); + hud_element_set_render_pos(id, BattleMenu_Moves_PosX + 56, BattleMenu_Moves_PosY); - for (i = 0; i < battle_menu_moveOptionCount; i++) { - if (!battle_menu_hasSpiritsMenu) { + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { + if (!BattleMenu_UsingSpiritsSubmenu) { switch (battle_menu_moveOptionDisplayCostReductionColors[i]) { case 0: id = hud_element_create(&HES_FPCost); - battle_menu_moveOptionCostUnitIconIDs[i] = id; + BattleMenu_Moves_OptionCostUnitIDs[i] = id; break; case 1: id = hud_element_create(&HES_FPCostReduced); - battle_menu_moveOptionCostUnitIconIDs[i] = id; + BattleMenu_Moves_OptionCostUnitIDs[i] = id; break; default: id = hud_element_create(&HES_FPCostReducedTwice); - battle_menu_moveOptionCostUnitIconIDs[i] = id; + BattleMenu_Moves_OptionCostUnitIDs[i] = id; break; } } else { switch (battle_menu_moveOptionDisplayCostReductionColors[i]) { case 0: id = hud_element_create(&HES_POWCost); - battle_menu_moveOptionCostUnitIconIDs[i] = id; + BattleMenu_Moves_OptionCostUnitIDs[i] = id; break; case 1: id = hud_element_create(&HES_POWCostReduced); - battle_menu_moveOptionCostUnitIconIDs[i] = id; + BattleMenu_Moves_OptionCostUnitIDs[i] = id; break; default: id = hud_element_create(&HES_POWCostReducedTwice); - battle_menu_moveOptionCostUnitIconIDs[i] = id; + BattleMenu_Moves_OptionCostUnitIDs[i] = id; break; } } hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); - hud_element_set_render_pos(id, battle_menu_moveX + 56, battle_menu_moveY); + hud_element_set_render_pos(id, BattleMenu_Moves_PosX + 56, BattleMenu_Moves_PosY); } - battle_menu_moveTextColor = MSG_PAL_STANDARD; + BattleMenu_Moves_TextColor = MSG_PAL_STANDARD; - moveX = battle_menu_moveX; - moveY = battle_menu_moveY; - if (!battle_menu_hasSpiritsMenu) { + moveX = BattleMenu_Moves_PosX; + moveY = BattleMenu_Moves_PosY; + if (!BattleMenu_UsingSpiritsSubmenu) { set_window_properties(1, moveX, moveY, 150, (D_802AD10E * 13) + 28, 0, func_802A3C98, NULL, -1); set_window_properties(2, moveX + 16, moveY - 6, 90, 16, 1, func_802A43DC, NULL, -1); set_window_properties(3, moveX + 114, moveY - 12, 32, 32, 1, func_802A4448, NULL, -1); @@ -1191,24 +1179,24 @@ s32 func_802A2C84(void) { } moveX = 20; - moveY = battle_menu_moveY; + moveY = BattleMenu_Moves_PosY; set_window_properties(8, moveX, 186, 280, 32, 20, func_802A4494, NULL, -1); - set_window_update(1, 1); - if (!battle_menu_hasSpiritsMenu) { - set_window_update(2, 1); - set_window_update(3, 1); + set_window_update(WINDOW_ID_1, 1); + if (!BattleMenu_UsingSpiritsSubmenu) { + set_window_update(WINDOW_ID_2, 1); + set_window_update(WINDOW_ID_3, 1); } else { - set_window_update(4, 1); - set_window_update(5, 1); + set_window_update(WINDOW_ID_4, 1); + set_window_update(WINDOW_ID_5, 1); } - set_window_update(8, 1); + set_window_update(WINDOW_ID_8, 1); do { cond = FALSE; if (battle_menu_moveCursorPos >= (battle_menu_moveScrollLine + D_802AD10D) - 1) { battle_menu_moveScrollLine++; - if (battle_menu_moveScrollLine > battle_menu_moveOptionCount - 6) { - battle_menu_moveScrollLine = battle_menu_moveOptionCount - 6; + if (battle_menu_moveScrollLine > BattleMenu_Moves_OptionCount - 6) { + battle_menu_moveScrollLine = BattleMenu_Moves_OptionCount - 6; if (battle_menu_moveScrollLine < 0) { battle_menu_moveScrollLine = 0; } @@ -1218,12 +1206,12 @@ s32 func_802A2C84(void) { } } while (cond); - battle_menu_moveState = 1; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_1; D_802AD10D = battle_menu_moveScrollLine + 6; battle_menu_moveScrollOffset = -battle_menu_moveScrollLine * 13; D_802AD112 = (battle_menu_moveCursorPos - battle_menu_moveScrollLine) * 13; break; - case 1: + case BTL_SUBMENU_MOVES_STATE_UNK_1: D_802AD10A = battle_menu_moveCursorPos; if (battleStatus->currentButtonsHeld & (BUTTON_STICK_UP | BUTTON_Z)) { if (battle_menu_moveCursorPos > 0) { @@ -1234,7 +1222,7 @@ s32 func_802A2C84(void) { } if (battleStatus->currentButtonsHeld & (BUTTON_STICK_DOWN | BUTTON_R)) { - if (battle_menu_moveCursorPos < battle_menu_moveOptionCount - 1) { + if (battle_menu_moveCursorPos < BattleMenu_Moves_OptionCount - 1) { battle_menu_moveCursorPos++; } else if (battleStatus->currentButtonsPressed & (BUTTON_STICK_DOWN | BUTTON_R)) { battle_menu_moveCursorPos++; @@ -1242,15 +1230,15 @@ s32 func_802A2C84(void) { } if (battle_menu_moveCursorPos < 0) { - battle_menu_moveCursorPos = battle_menu_moveOptionCount - 1; + battle_menu_moveCursorPos = BattleMenu_Moves_OptionCount - 1; } - if (battle_menu_moveOptionCount - 1 < battle_menu_moveCursorPos) { + if (BattleMenu_Moves_OptionCount - 1 < battle_menu_moveCursorPos) { battle_menu_moveCursorPos = 0; } if (D_802AD10A != battle_menu_moveCursorPos) { - hud_element_set_scale(battle_menu_moveOptionIconIDs[D_802AD10A], 0.45f); + hud_element_set_scale(BattleMenu_Moves_OptionIDs[D_802AD10A], 0.45f); sfx_play_sound(SOUND_MENU_CHANGE_SELECTION); } @@ -1263,8 +1251,8 @@ s32 func_802A2C84(void) { if (battle_menu_moveCursorPos >= (D_802AD10D - 1)) { battle_menu_moveScrollLine++; - if (battle_menu_moveScrollLine > battle_menu_moveOptionCount - 6) { - battle_menu_moveScrollLine = battle_menu_moveOptionCount - 6; + if (battle_menu_moveScrollLine > BattleMenu_Moves_OptionCount - 6) { + battle_menu_moveScrollLine = BattleMenu_Moves_OptionCount - 6; if (battle_menu_moveScrollLine < 0) { battle_menu_moveScrollLine = 0; } @@ -1273,17 +1261,17 @@ s32 func_802A2C84(void) { D_802AD10D = battle_menu_moveScrollLine + 6; if (battleStatus->currentButtonsPressed & BUTTON_A) { - if (battle_menu_moveOptionsEnabled[battle_menu_moveOptionIndexMap[battle_menu_moveCursorPos]] == 1) { + if (BattleMenu_Moves_OptionEnabled[BattleMenu_Moves_OptionIndexMap[battle_menu_moveCursorPos]] == 1) { sfx_play_sound(SOUND_MENU_NEXT); - battle_menu_moveState = -1; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_ONE; } else { sfx_play_sound(SOUND_MENU_ERROR); D_802AD258 = 0; - temp_v0_14 = battle_menu_moveOptionCantUseTypes[battle_menu_moveOptionIndexMap[battle_menu_moveCursorPos]]; + temp_v0_14 = BattleMenu_Moves_OptionCantUseMessages[BattleMenu_Moves_OptionIndexMap[battle_menu_moveCursorPos]]; if (temp_v0_14 != 0) { D_802AD258 = temp_v0_14; } - battle_menu_moveState = 40; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_28; } break; } @@ -1291,113 +1279,113 @@ s32 func_802A2C84(void) { if (battleStatus->currentButtonsPressed & BUTTON_B) { sfx_play_sound(SOUND_MENU_BACK); func_802A27E4(); - battle_menu_moveState = -2; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_TWO; } break; - case -1: - for (i = 0; i < battle_menu_moveOptionCount; i++) { - id = battle_menu_moveOptionIconIDs[i]; + case BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_ONE: + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { + id = BattleMenu_Moves_OptionIDs[i]; hud_element_set_tint(id, 160, 160, 160); } - hud_element_set_tint(battle_menu_moveCursorIcon, 160, 160, 160); - hud_element_set_tint(battle_menu_moveUpArrowIcon, 160, 160, 160); - hud_element_set_tint(battle_menu_moveDownArrowIcon, 160, 160, 160); - hud_element_set_tint(battle_menu_moveTitleIcon, 160, 160, 160); + hud_element_set_tint(BattleMenu_Moves_CursorID, 160, 160, 160); + hud_element_set_tint(BattleMenu_Moves_UpArrowID, 160, 160, 160); + hud_element_set_tint(BattleMenu_Moves_DownArrowID, 160, 160, 160); + hud_element_set_tint(BattleMenu_Moves_TitleID, 160, 160, 160); - for (i = 0; i < battle_menu_moveOptionCount; i++) { - id = battle_menu_moveOptionCostUnitIconIDs[i]; + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { + id = BattleMenu_Moves_OptionCostUnitIDs[i]; hud_element_set_tint(id, 160, 160, 160); } - hud_element_set_script(battle_menu_moveCursorIcon, &HES_HandPointer); - battle_menu_moveTextColor = MSG_PAL_0D; - set_window_update(1, 4); - if (!battle_menu_hasSpiritsMenu) { - set_window_update(2, 4); - set_window_update(3, 4); + hud_element_set_script(BattleMenu_Moves_CursorID, &HES_HandPointer); + BattleMenu_Moves_TextColor = MSG_PAL_0D; + set_window_update(WINDOW_ID_1, 4); + if (!BattleMenu_UsingSpiritsSubmenu) { + set_window_update(WINDOW_ID_2, 4); + set_window_update(WINDOW_ID_3, 4); } else { - set_window_update(4, 4); - set_window_update(5, 4); + set_window_update(WINDOW_ID_4, 4); + set_window_update(WINDOW_ID_5, 4); } - set_window_update(8, 2); - if (!battle_menu_hasSpiritsMenu) { + set_window_update(WINDOW_ID_8, 2); + if (!BattleMenu_UsingSpiritsSubmenu) { status_menu_stop_blinking_fp(); } else { status_menu_stop_blinking_sp(); } battle_menu_moveOptionActive = battle_menu_moveCursorPos; - return battle_menu_moveOptionIndexMap[battle_menu_moveCursorPos] + 1; - case -2: - if (!battle_menu_hasSpiritsMenu) { + return BattleMenu_Moves_OptionIndexMap[battle_menu_moveCursorPos] + 1; + case BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_TWO: + if (!BattleMenu_UsingSpiritsSubmenu) { status_menu_stop_blinking_fp(); } else { status_menu_stop_blinking_sp(); } return 255; - case 10: - set_window_update(1, 2); - if (!battle_menu_hasSpiritsMenu) { - set_window_update(2, 2); - set_window_update(3, 2); + case BTL_SUBMENU_MOVES_STATE_UNK_A: + set_window_update(WINDOW_ID_1, 2); + if (!BattleMenu_UsingSpiritsSubmenu) { + set_window_update(WINDOW_ID_2, 2); + set_window_update(WINDOW_ID_3, 2); } else { - set_window_update(4, 2); - set_window_update(5, 2); + set_window_update(WINDOW_ID_4, 2); + set_window_update(WINDOW_ID_5, 2); } - set_window_update(8, 2); - if (!battle_menu_hasSpiritsMenu) { + set_window_update(WINDOW_ID_8, 2); + if (!BattleMenu_UsingSpiritsSubmenu) { status_menu_stop_blinking_fp(); } else { status_menu_stop_blinking_sp(); } - battle_menu_moveState = 11; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_B; battle_menu_moveOptionActive = battle_menu_moveCursorPos; - return battle_menu_moveOptionIndexMap[battle_menu_moveCursorPos] + 1; - case 11: + return BattleMenu_Moves_OptionIndexMap[battle_menu_moveCursorPos] + 1; + case BTL_SUBMENU_MOVES_STATE_UNK_B: battle_menu_moveOptionActive = battle_menu_moveCursorPos; - return battle_menu_moveOptionIndexMap[battle_menu_moveCursorPos] + 1; - case 20: - set_window_update(1, 1); - if (!battle_menu_hasSpiritsMenu) { - set_window_update(2, 1); - set_window_update(3, 1); + return BattleMenu_Moves_OptionIndexMap[battle_menu_moveCursorPos] + 1; + case BTL_SUBMENU_MOVES_STATE_UNK_14: + set_window_update(WINDOW_ID_1, 1); + if (!BattleMenu_UsingSpiritsSubmenu) { + set_window_update(WINDOW_ID_2, 1); + set_window_update(WINDOW_ID_3, 1); } else { - set_window_update(4, 1); - set_window_update(5, 1); + set_window_update(WINDOW_ID_4, 1); + set_window_update(WINDOW_ID_5, 1); } - set_window_update(8, 1); - battle_menu_moveState = 1; + set_window_update(WINDOW_ID_8, 1); + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_1; battle_menu_moveOptionActive = battle_menu_moveCursorPos; - return battle_menu_moveOptionIndexMap[battle_menu_moveCursorPos] + 1; - case 30: - set_window_update(1, 9); - if (!battle_menu_hasSpiritsMenu) { - set_window_update(2, 9); - set_window_update(3, 9); + return BattleMenu_Moves_OptionIndexMap[battle_menu_moveCursorPos] + 1; + case BTL_SUBMENU_MOVES_STATE_UNK_1E: + set_window_update(WINDOW_ID_1, 9); + if (!BattleMenu_UsingSpiritsSubmenu) { + set_window_update(WINDOW_ID_2, 9); + set_window_update(WINDOW_ID_3, 9); } else { - set_window_update(4, 9); - set_window_update(5, 9); + set_window_update(WINDOW_ID_4, 9); + set_window_update(WINDOW_ID_5, 9); } - set_window_update(8, 2); - battle_menu_moveState = -1; + set_window_update(WINDOW_ID_8, 2); + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_ONE; break; - case 40: + case BTL_SUBMENU_MOVES_STATE_UNK_28: battle_menu_moveOptionActive = -1; - battle_menu_moveState = 41; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_29; return -1; - case 41: - set_window_update(1, 2); - if (!battle_menu_hasSpiritsMenu) { - set_window_update(2, 2); - set_window_update(3, 2); + case BTL_SUBMENU_MOVES_STATE_UNK_29: + set_window_update(WINDOW_ID_1, 2); + if (!BattleMenu_UsingSpiritsSubmenu) { + set_window_update(WINDOW_ID_2, 2); + set_window_update(WINDOW_ID_3, 2); } else { - set_window_update(4, 2); - set_window_update(5, 2); + set_window_update(WINDOW_ID_4, 2); + set_window_update(WINDOW_ID_5, 2); } - set_window_update(8, 2); + set_window_update(WINDOW_ID_8, 2); msgID = MSG_Menus_Battle_CantSelectNow; if (D_802AD258 == 0) { - if (!battle_menu_hasSpiritsMenu) { + if (!BattleMenu_UsingSpiritsSubmenu) { msgID = MSG_Menus_NotEnoughFP; } else { msgID = MSG_Menus_NotEnoughStarPower; @@ -1407,11 +1395,11 @@ s32 func_802A2C84(void) { msgWidth = get_msg_width(msgID, 0) + 23; moveX = (SCREEN_WIDTH / 2) - (msgWidth / 2); set_window_properties(9, moveX, 80, msgWidth, D_802AB340[get_msg_lines(msgID) - 1], 20, func_802A4534, NULL, -1); - set_window_update(9, 1); + set_window_update(WINDOW_ID_9, 1); D_802AD10B = 60; - battle_menu_moveState = 42; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_2A; return -1; - case 42: + case BTL_SUBMENU_MOVES_STATE_UNK_2A: if (gGameStatusPtr->pressedButtons[0] & (BUTTON_A | BUTTON_B)) { D_802AD10B = 0; } @@ -1420,8 +1408,8 @@ s32 func_802A2C84(void) { return -1; } set_window_update(WINDOW_ID_9, 2); - set_window_update(1, 1); - if (!battle_menu_hasSpiritsMenu) { + set_window_update(WINDOW_ID_1, 1); + if (!BattleMenu_UsingSpiritsSubmenu) { set_window_update(WINDOW_ID_2, 1); set_window_update(WINDOW_ID_3, 1); } else { @@ -1429,7 +1417,7 @@ s32 func_802A2C84(void) { set_window_update(WINDOW_ID_5, 1); } set_window_update(WINDOW_ID_8, 1); - battle_menu_moveState = 1; + battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_1; break; } return 0; @@ -1437,7 +1425,7 @@ s32 func_802A2C84(void) { const f32 padding3 = 0.0f; -// needs a lot of work +// needs a lot of work -- args should be (void* data, s32 x, s32 y) #ifdef NON_MATCHING void func_802A3C98(s32 x, s32 y) { s32 palette; @@ -1482,25 +1470,25 @@ void func_802A3C98(s32 x, s32 y) { temp1 ); - for (i = 0; i < battle_menu_moveOptionCount; i++) { + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { if ((i >= battle_menu_moveScrollLine - 1) && (i <= battle_menu_moveScrollLine + D_802AD10E)) { - palette = battle_menu_moveTextColor; - if (battle_menu_moveOptionsEnabled[battle_menu_moveOptionIndexMap[i]] <= 0) { + palette = BattleMenu_Moves_TextColor; + if (BattleMenu_Moves_OptionEnabled[BattleMenu_Moves_OptionIndexMap[i]] <= 0) { palette = MSG_PAL_0B; } - if (battle_menu_moveOptionNames[battle_menu_moveOptionIndexMap[i]] >= 0) { - draw_msg(battle_menu_moveOptionNames[battle_menu_moveOptionIndexMap[i]], moveOptX, moveOptY, battle_menu_moveTextOpacity, palette, DRAW_MSG_STYLE_MENU); + if (battle_menu_moveOptionNames[BattleMenu_Moves_OptionIndexMap[i]] >= 0) { + draw_msg(battle_menu_moveOptionNames[BattleMenu_Moves_OptionIndexMap[i]], moveOptX, moveOptY, BattleMenu_Moves_TextAlpha, palette, DRAW_MSG_STYLE_MENU); } - num = battle_menu_moveOptionDisplayCosts[battle_menu_moveOptionIndexMap[i]] - battle_menu_moveOptionDisplayCostReductions[battle_menu_moveOptionIndexMap[i]]; - if ((battle_menu_moveOptionDisplayCosts[battle_menu_moveOptionIndexMap[i]] != 0) && (num <= 0)) { + num = battle_menu_moveOptionDisplayCosts[BattleMenu_Moves_OptionIndexMap[i]] - battle_menu_moveOptionDisplayCostReductions[BattleMenu_Moves_OptionIndexMap[i]]; + if ((battle_menu_moveOptionDisplayCosts[BattleMenu_Moves_OptionIndexMap[i]] != 0) && (num <= 0)) { num = 1; } - if (!battle_menu_hasSpiritsMenu) { + if (!BattleMenu_UsingSpiritsSubmenu) { if (i == battle_menu_moveCursorPos) { - if (num == 0 || (battle_menu_moveOptionsEnabled[battle_menu_moveOptionIndexMap[i]] <= 0)) { + if (num == 0 || (BattleMenu_Moves_OptionEnabled[BattleMenu_Moves_OptionIndexMap[i]] <= 0)) { status_menu_stop_blinking_fp(); } else { status_menu_start_blinking_fp(); @@ -1508,10 +1496,10 @@ void func_802A3C98(s32 x, s32 y) { } } else { if (i == battle_menu_moveCursorPos) { - if (num == 0 || (battle_menu_moveOptionsEnabled[battle_menu_moveOptionIndexMap[i]] <= 0)) { + if (num == 0 || (BattleMenu_Moves_OptionEnabled[BattleMenu_Moves_OptionIndexMap[i]] <= 0)) { status_menu_stop_blinking_sp(); } else { - status_menu_start_blinking_sp_bars(battle_menu_moveOptionDisplayCosts[battle_menu_moveOptionIndexMap[i]]); + status_menu_start_blinking_sp_bars(battle_menu_moveOptionDisplayCosts[BattleMenu_Moves_OptionIndexMap[i]]); } } } @@ -1528,27 +1516,27 @@ void func_802A3C98(s32 x, s32 y) { break; } - if (battle_menu_moveOptionsEnabled[battle_menu_moveOptionIndexMap[i]] <= 0) { + if (BattleMenu_Moves_OptionEnabled[BattleMenu_Moves_OptionIndexMap[i]] <= 0) { palette = MSG_PAL_0B; } - if (battle_menu_moveOptionDisplayCosts[battle_menu_moveOptionIndexMap[i]] != 0) { - id = battle_menu_moveOptionCostUnitIconIDs[i]; - if (!battle_menu_hasSpiritsMenu) { - draw_number(num, moveOptX + 108, moveOptY, DRAW_NUMBER_CHARSET_THIN, palette, battle_menu_moveTextOpacity, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); - if (battle_menu_moveOptionsEnabled[battle_menu_moveOptionIndexMap[i]] <= 0) { + if (battle_menu_moveOptionDisplayCosts[BattleMenu_Moves_OptionIndexMap[i]] != 0) { + id = BattleMenu_Moves_OptionCostUnitIDs[i]; + if (!BattleMenu_UsingSpiritsSubmenu) { + draw_number(num, moveOptX + 108, moveOptY, DRAW_NUMBER_CHARSET_THIN, palette, BattleMenu_Moves_TextAlpha, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); + if (BattleMenu_Moves_OptionEnabled[BattleMenu_Moves_OptionIndexMap[i]] <= 0) { hud_element_set_script(id, &HES_NotEnoughFP); } moveOptX += 116; } else { - draw_number(num, moveOptX + 93, moveOptY, DRAW_NUMBER_CHARSET_THIN, palette, battle_menu_moveTextOpacity, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); - if (battle_menu_moveOptionsEnabled[battle_menu_moveOptionIndexMap[i]] <= 0) { + draw_number(num, moveOptX + 93, moveOptY, DRAW_NUMBER_CHARSET_THIN, palette, BattleMenu_Moves_TextAlpha, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); + if (BattleMenu_Moves_OptionEnabled[BattleMenu_Moves_OptionIndexMap[i]] <= 0) { hud_element_set_script(id, &HES_NotEnoughPOW); } moveOptX += 102; } hud_element_set_render_pos(id, moveOptX, moveOptY + 7); - hud_element_set_alpha(id, battle_menu_moveTextOpacity); + hud_element_set_alpha(id, BattleMenu_Moves_TextAlpha); hud_element_draw_without_clipping(id); } moveOptY += 13; @@ -1557,11 +1545,11 @@ void func_802A3C98(s32 x, s32 y) { moveOptX = x + 24; moveOptY = battle_menu_moveScrollOffset + y + 24; - for (i = 0; i < battle_menu_moveOptionCount; i++) { + for (i = 0; i < BattleMenu_Moves_OptionCount; i++) { if (i >= (battle_menu_moveScrollLine - 1) && i <= (battle_menu_moveScrollLine + D_802AD10E)) { - id = battle_menu_moveOptionIconIDs[i]; + id = BattleMenu_Moves_OptionIDs[i]; hud_element_set_render_pos(id, moveOptX, moveOptY); - hud_element_set_alpha(id, battle_menu_moveTextOpacity); + hud_element_set_alpha(id, BattleMenu_Moves_TextAlpha); hud_element_draw_without_clipping(id); } moveOptY += 13; @@ -1574,27 +1562,27 @@ void func_802A3C98(s32 x, s32 y) { } D_802AD112 = var_t0_4; - id = battle_menu_moveCursorIcon; + id = BattleMenu_Moves_CursorID; hud_element_set_render_pos(id, x + 10, y + (var_t0_4 + 26)); - hud_element_set_alpha(id, battle_menu_moveTextOpacity); + hud_element_set_alpha(id, BattleMenu_Moves_TextAlpha); hud_element_draw_without_clipping(id); if (battle_menu_moveScrollLine > 0) { - id = battle_menu_moveUpArrowIcon; + id = BattleMenu_Moves_UpArrowID; hud_element_set_render_pos(id, x + 72, y + 15); - hud_element_set_alpha(id, battle_menu_moveTextOpacity); + hud_element_set_alpha(id, BattleMenu_Moves_TextAlpha); hud_element_draw_clipped(id); } - if (D_802AD10D < battle_menu_moveOptionCount) { - id = battle_menu_moveDownArrowIcon; + if (D_802AD10D < BattleMenu_Moves_OptionCount) { + id = BattleMenu_Moves_DownArrowID; hud_element_set_render_pos(id, x + 72, y + 100); - hud_element_set_alpha(id, battle_menu_moveTextOpacity); + hud_element_set_alpha(id, BattleMenu_Moves_TextAlpha); hud_element_draw_clipped(id); } if (battle_menu_moveState == -1) { - if (!battle_menu_hasSpiritsMenu) { + if (!BattleMenu_UsingSpiritsSubmenu) { status_menu_stop_blinking_fp(); } else { status_menu_stop_blinking_sp(); @@ -1607,53 +1595,53 @@ void func_802A3C98(s32 x, s32 y) { INCLUDE_ASM(s32, "415D90", func_802A3C98); #endif -void func_802A43DC(s32 arg0, s32 x, s32 y) { +void func_802A43DC(void* data, s32 x, s32 y) { s32 msgID; s32 posX; s32 posY; s32 opacity; s32 palette; - if (!battle_menu_hasSpiritsMenu) { - msgID = 0x1D0045; + if (!BattleMenu_UsingSpiritsSubmenu) { + msgID = MSG_Menus_Abilities; posX = x + 16; posY = y + 2; - opacity = battle_menu_moveTextOpacity; - palette = 0x30; + opacity = BattleMenu_Moves_TextAlpha; + palette = MSG_PAL_30; } else { - msgID = 0x1D003A; + msgID = MSG_Menus_StarSpirits; posX = x + 6; posY = y + 2; - opacity = battle_menu_moveTextOpacity; - palette = 0x31; + opacity = BattleMenu_Moves_TextAlpha; + palette = MSG_PAL_31; } draw_msg(msgID, posX, posY, opacity, palette, DRAW_MSG_STYLE_MENU); } -void func_802A4448(s32 arg0, s32 x, s32 y) { - s32 icon = battle_menu_moveTitleIcon; +void func_802A4448(void* data, s32 x, s32 y) { + s32 icon = BattleMenu_Moves_TitleID; hud_element_set_render_pos(icon, x + 16, y + 15); - hud_element_set_alpha(icon, battle_menu_moveTextOpacity); + hud_element_set_alpha(icon, BattleMenu_Moves_TextAlpha); hud_element_draw_clipped(icon); } -void func_802A4494(s32 arg0, s32 x, s32 y) { +void func_802A4494(void* data, s32 x, s32 y) { switch (battle_menu_moveState) { - case -1: - case 1: - case 10: - case 20: - case 30: + case BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_ONE: + case BTL_SUBMENU_MOVES_STATE_UNK_1: + case BTL_SUBMENU_MOVES_STATE_UNK_A: + case BTL_SUBMENU_MOVES_STATE_UNK_14: + case BTL_SUBMENU_MOVES_STATE_UNK_1E: if (D_802AD10F != 0) { - draw_msg(battle_menu_moveOptionDescriptions[battle_menu_moveOptionIndexMap[battle_menu_moveCursorPos]], - x + 8, y, battle_menu_moveTextOpacity, battle_menu_moveTextColor, 0); + draw_msg(BattleMenu_Moves_OptionDescMessages[BattleMenu_Moves_OptionIndexMap[battle_menu_moveCursorPos]], + x + 8, y, BattleMenu_Moves_TextAlpha, BattleMenu_Moves_TextColor, 0); } break; } } -void func_802A4534(s32 arg0, s32 x, s32 y) { +void func_802A4534(void* data, s32 x, s32 y) { s32 posY = y; s32 posX; s32 msgID; @@ -1662,11 +1650,11 @@ void func_802A4534(s32 arg0, s32 x, s32 y) { posX = x + 11; if (D_802AD258 != 0) { - msgID = 0x1D00C3; - } else if (!battle_menu_hasSpiritsMenu) { - msgID = 0x1D009F; + msgID = MSG_Menus_Battle_CantSelectNow; + } else if (!BattleMenu_UsingSpiritsSubmenu) { + msgID = MSG_Menus_NotEnoughFP; } else { - msgID = 0x1D00A0; + msgID = MSG_Menus_NotEnoughStarPower; } draw_msg(msgID, posX, posY + D_802AB344[get_msg_lines(msgID) - 1], 255, MSG_PAL_0F, 0); } @@ -1675,7 +1663,7 @@ void func_802A45D8(void) { s32 sixTemp; s8 temp802AD673; - D_802AD604 = 0; + BattleSubmenuStratsState = 0; D_802AD605 = D_802AD673; D_802AD606 = D_802AD673; D_802AD608 = 0; @@ -1714,7 +1702,7 @@ void func_802A45D8(void) { } void func_802A4718(void) { - D_802AD604 = 10; + BattleSubmenuStratsState = 10; } void func_802A472C(void) { @@ -1729,20 +1717,20 @@ void func_802A472C(void) { } hud_element_free(D_802AD618); - hud_element_free(D_802AD61C); - hud_element_free(D_802AD620); + hud_element_free(GreenArrowUpID); + hud_element_free(GreenArrowDownID); } void func_802A47E0(void) { s32 i; for (i = 0; i < D_802AD66C; i++) { - hud_element_set_tint(D_802AD628[i], 0xFF, 0xFF, 0xFF); + hud_element_set_tint(D_802AD628[i], 255, 255, 255); } - hud_element_set_tint(D_802AD618, 0xFF, 0xFF, 0xFF); - hud_element_set_tint(D_802AD61C, 0xFF, 0xFF, 0xFF); - hud_element_set_tint(D_802AD620, 0xFF, 0xFF, 0xFF); + hud_element_set_tint(D_802AD618, 255, 255, 255); + hud_element_set_tint(GreenArrowUpID, 255, 255, 255); + hud_element_set_tint(GreenArrowDownID, 255, 255, 255); hud_element_set_script(D_802AD618, &HES_AnimatedHandPointer); set_window_update(WINDOW_ID_6, WINDOW_UPDATE_TRANSPARENT); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_TRANSPARENT); @@ -1750,7 +1738,7 @@ void func_802A47E0(void) { D_802AD614 = MSG_PAL_STANDARD; D_802AD60B = 1; D_802AD624 = 255; - D_802AD604 = 1; + BattleSubmenuStratsState = 1; } void func_802A48FC(void) { @@ -1761,23 +1749,23 @@ void func_802A48FC(void) { set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); for (i = 0; i < D_802AD66C; i++) { - hud_element_set_tint(D_802AD628[i], 0xFF, 0xFF, 0xFF); + hud_element_set_tint(D_802AD628[i], 255, 255, 255); } - hud_element_set_tint(D_802AD618, 0xFF, 0xFF, 0xFF); - hud_element_set_tint(D_802AD61C, 0xFF, 0xFF, 0xFF); - hud_element_set_tint(D_802AD620, 0xFF, 0xFF, 0xFF); + hud_element_set_tint(D_802AD618, 255, 255, 255); + hud_element_set_tint(GreenArrowUpID, 255, 255, 255); + hud_element_set_tint(GreenArrowDownID, 255, 255, 255); hud_element_set_script(D_802AD618, &HES_AnimatedHandPointer); D_802AD614 = MSG_PAL_STANDARD; D_802AD60B = 1; - D_802AD604 = 20; + BattleSubmenuStratsState = 20; } void func_802A4A10(void) { set_window_update(WINDOW_ID_6, WINDOW_UPDATE_TRANSPARENT); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_TRANSPARENT); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); - D_802AD604 = 30; + BattleSubmenuStratsState = 30; } s32 func_802A4A54(void) { @@ -1788,7 +1776,7 @@ s32 func_802A4A54(void) { s32 msgID; s32 i; - switch (D_802AD604) { + switch (BattleSubmenuStratsState) { case 0: D_802AD63C = 20; D_802AD63E = 68; @@ -1805,11 +1793,11 @@ s32 func_802A4A54(void) { hud_element_set_flags(id, HUD_ELEMENT_FLAG_DROP_SHADOW | HUD_ELEMENT_FLAG_80); hud_element_set_render_pos(id, D_802AD63C, D_802AD63E); - D_802AD61C = id = hud_element_create(&HES_GreenArrowUp); + GreenArrowUpID = id = hud_element_create(&HES_GreenArrowUp); hud_element_set_flags(id, HUD_ELEMENT_FLAG_DROP_SHADOW | HUD_ELEMENT_FLAG_80); hud_element_set_render_pos(id, D_802AD63C + 39, D_802AD63E - 7); - D_802AD620 = id = hud_element_create(&HES_GreenArrowDown); + GreenArrowDownID = id = hud_element_create(&HES_GreenArrowDown); hud_element_set_flags(id, HUD_ELEMENT_FLAG_DROP_SHADOW | HUD_ELEMENT_FLAG_80); hud_element_set_render_pos(id, D_802AD63C + 39, D_802AD63E + 78); @@ -1824,7 +1812,7 @@ s32 func_802A4A54(void) { set_window_update(WINDOW_ID_6, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); - D_802AD604 = 1; + BattleSubmenuStratsState = 1; break; case 1: if (D_802AD607 == 0) { @@ -1871,10 +1859,10 @@ s32 func_802A4A54(void) { if (battleStatus->currentButtonsPressed & BUTTON_A) { if (D_802AD690[D_802AD605] == 1) { sfx_play_sound(SOUND_MENU_NEXT); - D_802AD604 = -1; + BattleSubmenuStratsState = -1; } else { sfx_play_sound(SOUND_MENU_ERROR); - D_802AD604 = 40; + BattleSubmenuStratsState = 40; D_802AD610 = D_802AD6A8[D_802AD605]; } break; @@ -1883,7 +1871,7 @@ s32 func_802A4A54(void) { if (battleStatus->currentButtonsPressed & BUTTON_B) { sfx_play_sound(SOUND_MENU_BACK); func_802A472C(); - D_802AD604 = -2; + BattleSubmenuStratsState = -2; } } break; @@ -1892,8 +1880,8 @@ s32 func_802A4A54(void) { hud_element_set_tint(D_802AD628[i], 160, 160, 160); } hud_element_set_tint(D_802AD618, 160, 160, 160); - hud_element_set_tint(D_802AD61C, 160, 160, 160); - hud_element_set_tint(D_802AD620, 160, 160, 160); + hud_element_set_tint(GreenArrowUpID, 160, 160, 160); + hud_element_set_tint(GreenArrowDownID, 160, 160, 160); hud_element_set_script(D_802AD618, &HES_HandPointer); D_802AD614 = MSG_PAL_0D; set_window_update(WINDOW_ID_6, WINDOW_UPDATE_DARKENED); @@ -1906,7 +1894,7 @@ s32 func_802A4A54(void) { set_window_update(WINDOW_ID_6, WINDOW_UPDATE_HIDE); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_HIDE); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE); - D_802AD604 = 11; + BattleSubmenuStratsState = 11; return D_802AD605 + 1; case 11: return D_802AD605 + 1; @@ -1914,17 +1902,17 @@ s32 func_802A4A54(void) { set_window_update(WINDOW_ID_6, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); - D_802AD604 = 1; + BattleSubmenuStratsState = 1; return D_802AD605 + 1; case 30: set_window_update(WINDOW_ID_6, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); - D_802AD604 = -1; + BattleSubmenuStratsState = -1; break; case 40: D_802AD6D4 = -1; - D_802AD604 = 41; + BattleSubmenuStratsState = 41; return -1; case 41: set_window_update(WINDOW_ID_6, WINDOW_UPDATE_HIDE); @@ -1945,7 +1933,7 @@ s32 func_802A4A54(void) { set_window_properties(WINDOW_ID_9, (SCREEN_WIDTH / 2) - (width / 2), 80, width, 28, 20, func_802A57C8, NULL, -1); set_window_update(WINDOW_ID_9, 1); D_802AD612 = 60; - D_802AD604 = 42; + BattleSubmenuStratsState = 42; return -1; case 42: if (gGameStatusPtr->pressedButtons[0] & (BUTTON_A | BUTTON_B)) { @@ -1959,7 +1947,7 @@ s32 func_802A4A54(void) { set_window_update(WINDOW_ID_6, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_7, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); - D_802AD604 = 1; + BattleSubmenuStratsState = 1; break; } return 0; @@ -1969,7 +1957,7 @@ static const f32 padding4 = 0.0f; // getting there but needs work #ifdef NON_EQUIVALENT -void func_802A5290(s32 arg0, s32 x, s32 y) { +void func_802A5290(void* data, s32 x, s32 y) { s16 temp_s1; s16 temp_s1_3; s32 temp_f6; @@ -1987,7 +1975,7 @@ void func_802A5290(s32 arg0, s32 x, s32 y) { s32 i; s32 j; - switch (D_802AD604) { + switch (BattleSubmenuStratsState) { case -1: case 1: case 10: @@ -2046,14 +2034,14 @@ void func_802A5290(s32 arg0, s32 x, s32 y) { hud_element_draw_clipped(id); if (D_802AD608 > 0) { - id = D_802AD61C; + id = GreenArrowUpID; hud_element_set_render_pos(id, x + 67, y + 16); hud_element_set_alpha(id, D_802AD624); hud_element_draw_clipped(id); } if (D_802AD609 < D_802AD66C) { - id = D_802AD620; + id = GreenArrowDownID; hud_element_set_render_pos(id, x + 67, y + 100); hud_element_set_alpha(id, D_802AD624); hud_element_draw_clipped(id); @@ -2066,12 +2054,12 @@ void func_802A5290(s32 arg0, s32 x, s32 y) { INCLUDE_ASM(s32, "415D90", func_802A5290); #endif -void func_802A56F8(s32 arg0, s32 x, s32 y) { +void func_802A56F8(void* data, s32 x, s32 y) { draw_msg(MSG_Menus_Strategies, x + 15, y + 2, D_802AD624, MSG_PAL_33, DRAW_MSG_STYLE_MENU); } -void func_802A5738(s32 arg0, s32 x, s32 y) { - switch (D_802AD604) { +void func_802A5738(void* data, s32 x, s32 y) { + switch (BattleSubmenuStratsState) { case -1: case 1: case 10: @@ -2084,10 +2072,10 @@ void func_802A5738(s32 arg0, s32 x, s32 y) { } } -void func_802A57C8(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) { - s32 x = baseX + 11; - s32 y = baseY + 6; +void func_802A57C8(void* data, s32 x, s32 y) { s32 msgID; + x += 11; + y += 6; switch (D_802AD610) { case 0: @@ -2217,7 +2205,7 @@ void btl_state_update_player_menu(void) { PartnerPopupProperties* prop; switch (gBattleSubState) { - case BTL_SUBSTATE_PLAYER_MENU_NONE: + case BTL_SUBSTATE_PLAYER_MENU_INIT: battleStatus->moveCategory = BTL_MENU_TYPE_INVALID; battleStatus->selectedMoveID = 0; battleStatus->currentAttackElement = 0; @@ -2227,10 +2215,10 @@ void btl_state_update_player_menu(void) { } btl_cam_use_preset(BTL_CAM_PRESET_C); btl_cam_move(10); - if (!(battleStatus->flags1 & BS_FLAGS1_100000)) { - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_INIT_MENU; + if (!(battleStatus->flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CREATE_MAIN_MENU; } else { - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_INIT_12C; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_PERFORM_SWAP; partnerActor->state.currentPos.x = partnerActor->homePos.x; partnerActor->state.currentPos.z = partnerActor->homePos.z; partnerActor->state.goalPos.x = playerActor->homePos.x; @@ -2239,7 +2227,7 @@ void btl_state_update_player_menu(void) { partnerActor->state.angle = 0.0f; } break; - case BTL_SUBSTATE_PLAYER_MENU_INIT_12C: + case BTL_SUBSTATE_PLAYER_MENU_PERFORM_SWAP: if (partnerActor->state.moveTime != 0) { partnerActor->currentPos.x += (partnerActor->state.goalPos.x - partnerActor->currentPos.x) / partnerActor->state.moveTime; partnerActor->currentPos.z += (partnerActor->state.goalPos.z - partnerActor->currentPos.z) / partnerActor->state.moveTime; @@ -2262,15 +2250,15 @@ void btl_state_update_player_menu(void) { partnerActor->homePos.z = partnerActor->currentPos.z; playerActor->homePos.x = playerActor->currentPos.x; playerActor->homePos.z = playerActor->currentPos.z; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_INIT_MENU; - battleStatus->flags1 &= ~BS_FLAGS1_100000; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CREATE_MAIN_MENU; + battleStatus->flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK; } break; } switch (gBattleSubState) { - case BTL_SUBSTATE_PLAYER_MENU_INIT_MENU: - gBattleStatus.flags1 |= BS_FLAGS1_2; + case BTL_SUBSTATE_PLAYER_MENU_CREATE_MAIN_MENU: + gBattleStatus.flags1 |= BS_FLAGS1_MENU_OPEN; playerActor->flags &= ~ACTOR_FLAG_4000000; playerActor->flags |= ACTOR_FLAG_8000000; if (partnerActor != NULL) { @@ -2285,163 +2273,167 @@ void btl_state_update_player_menu(void) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_BERSERKER_1; break; } + entryIdx = 0; initialPos = 2; - if (battleStatus->unk_4C[0] < 0) { - battleStatus->unk_4C[0] = 0; + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = 0; } - battle_menu_submenuIDs[0] = 7; - battle_menu_isEnabled[0] = TRUE; - main_battle_menu_JumpHudScripts[0] = battle_menu_StrategiesHudScript.enabled; - battle_menu_messageIDs[0] = battle_menu_centeredMessagesC[0]; - if (battleStatus->actionCommandMode != ACTION_COMMAND_MODE_TUTORIAL) { - if (gBattleStatus.flags1 & BS_FLAGS1_2000000) { - battle_menu_messageIDs[0] = MSG_Menus_EndTraining_Centered; - } - } else { - battle_menu_messageIDs[0] = MSG_Menus_EndTraining_Centered; + + // strategies menu category + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_STRATEGIES; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + BattleMenu_HudScripts[entryIdx] = battle_menu_StrategiesHudScript.enabled; + BattleMenu_TitleMessages[entryIdx] = BattleMenu_CenteredMessages[BTL_MENU_TYPE_STRATEGIES]; + if (battleStatus->actionCommandMode == ACTION_COMMAND_MODE_TUTORIAL || gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE) { + BattleMenu_TitleMessages[entryIdx] = MSG_Menus_EndTraining_Centered; } battle_menu_isMessageDisabled[entryIdx] = 0; - if (!(battleStatus->menuDisableFlags & 0x80)) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_StrategiesHudScript.disabled; - battle_menu_isEnabled[entryIdx] = FALSE; + if (!(battleStatus->menuDisableFlags & BTL_MENU_DISABLED_STRATEGIES)) { + BattleMenu_HudScripts[entryIdx] = battle_menu_StrategiesHudScript.disabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } - if (battleStatus->unk_4C[0] == 7) { + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_STRATEGIES) { initialPos = entryIdx; } entryIdx++; + + // items menu category if (battleStatus->menuStatus[0] >= 0) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_ItemHudScripts.enabled; - battle_menu_submenuIDs[entryIdx] = 2; - battle_menu_isEnabled[entryIdx] = TRUE; - battle_menu_messageIDs[entryIdx] = battle_menu_centeredMessagesB[0]; + BattleMenu_HudScripts[entryIdx] = battle_menu_ItemHudScripts.enabled; + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_ITEMS; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + BattleMenu_TitleMessages[entryIdx] = BattleMenu_CenteredMessages[BTL_MENU_TYPE_ITEMS]; if(battleStatus->menuStatus[0] == 0) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_ItemHudScripts.disabled; - battle_menu_isEnabled[entryIdx] = FALSE; + BattleMenu_HudScripts[entryIdx] = battle_menu_ItemHudScripts.disabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_45; } - if (!(battleStatus->menuDisableFlags & 0x4)) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_ItemHudScripts.disabled; - battle_menu_isEnabled[entryIdx] = FALSE; + if (!(battleStatus->menuDisableFlags & BTL_MENU_DISABLED_ITEMS)) { + BattleMenu_HudScripts[entryIdx] = battle_menu_ItemHudScripts.disabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } if (battleStatus->itemLossTurns >= 0) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_ItemHudScripts.disabled; - battle_menu_isEnabled[entryIdx] = FALSE; + BattleMenu_HudScripts[entryIdx] = battle_menu_ItemHudScripts.disabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } - if (battleStatus->unk_4C[0] == 2) { + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_ITEMS) { initialPos = entryIdx; } entryIdx++; } - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_JumpHudScripts[playerData->bootsLevel + 1].enabled; - battle_menu_submenuIDs[entryIdx] = 0; - battle_menu_isEnabled[entryIdx] = TRUE; - battle_menu_messageIDs[entryIdx] = battle_menu_centeredMessagesA[0]; + // jump menu category + BattleMenu_HudScripts[entryIdx] = battle_menu_JumpHudScripts[playerData->bootsLevel + 1].enabled; + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_JUMP; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + BattleMenu_TitleMessages[entryIdx] = BattleMenu_CenteredMessages[BTL_MENU_TYPE_JUMP]; if (battleStatus->menuStatus[1] <= 0) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_JumpHudScripts[0].enabled; - battle_menu_isEnabled[entryIdx] = FALSE; - battle_menu_isMessageDisabled[entryIdx] = 0x43; + BattleMenu_HudScripts[entryIdx] = battle_menu_JumpHudScripts[0].enabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_43; } - if (!(battleStatus->menuDisableFlags & 0x1)) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_JumpHudScripts[0].disabled; - battle_menu_isEnabled[entryIdx] = FALSE; - battle_menu_isMessageDisabled[entryIdx] = 0x48; + if (!(battleStatus->menuDisableFlags & BTL_MENU_DISABLED_JUMP)) { + BattleMenu_HudScripts[entryIdx] = battle_menu_JumpHudScripts[0].disabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } if (battleStatus->jumpLossTurns >= 0) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_JumpHudScripts[0].disabled; - battle_menu_isEnabled[entryIdx] = FALSE; - battle_menu_isMessageDisabled[entryIdx] = 0x48; + BattleMenu_HudScripts[entryIdx] = battle_menu_JumpHudScripts[0].disabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } - if (battleStatus->unk_4C[0] == 0) { + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_JUMP) { initialPos = entryIdx; } entryIdx++; + // hammer menu category if (playerData->hammerLevel >= 0) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_HammerHudScripts[playerData->hammerLevel + 1].enabled; - battle_menu_submenuIDs[entryIdx] = 1; - battle_menu_isEnabled[entryIdx] = TRUE; - battle_menu_messageIDs[entryIdx] = battle_menu_centeredMessagesA[1]; + BattleMenu_HudScripts[entryIdx] = battle_menu_HammerHudScripts[playerData->hammerLevel + 1].enabled; + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_SMASH; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + BattleMenu_TitleMessages[entryIdx] = BattleMenu_CenteredMessages[BTL_MENU_TYPE_SMASH]; if (battleStatus->menuStatus[2] <= 0) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_HammerHudScripts[0].enabled; - battle_menu_isEnabled[entryIdx] = FALSE; - battle_menu_isMessageDisabled[entryIdx] = 0x44; + BattleMenu_HudScripts[entryIdx] = battle_menu_HammerHudScripts[0].enabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_44; } - if (!(battleStatus->menuDisableFlags & 0x2)) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_HammerHudScripts[0].disabled; - battle_menu_isEnabled[entryIdx] = FALSE; - battle_menu_isMessageDisabled[entryIdx] = 0x48; + if (!(battleStatus->menuDisableFlags & BTL_MENU_DISABLED_SMASH)) { + BattleMenu_HudScripts[entryIdx] = battle_menu_HammerHudScripts[0].disabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } if (battleStatus->hammerLossTurns >= 0) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_HammerHudScripts[0].disabled; - battle_menu_isEnabled[entryIdx] = FALSE; - battle_menu_isMessageDisabled[entryIdx] = 0x48; + BattleMenu_HudScripts[entryIdx] = battle_menu_HammerHudScripts[0].disabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } - if (battleStatus->unk_4C[0] == 1) { + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_SMASH) { initialPos = entryIdx; } entryIdx++; } + // star powers menu category if (playerData->maxStarPower != 0) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_StarPowerHudScripts.enabled; - battle_menu_submenuIDs[entryIdx] = 8; - battle_menu_isEnabled[entryIdx] = TRUE; - battle_menu_messageIDs[entryIdx] = battle_menu_centeredMessagesD[0]; + BattleMenu_HudScripts[entryIdx] = battle_menu_StarPowerHudScripts.enabled; + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_STAR_POWERS; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + BattleMenu_TitleMessages[entryIdx] = BattleMenu_CenteredMessages[BTL_MENU_TYPE_STAR_POWERS]; battle_menu_isMessageDisabled[entryIdx] = 0; - if (!(battleStatus->menuDisableFlags & 0x100)) { - main_battle_menu_JumpHudScripts[entryIdx] = battle_menu_StarPowerHudScripts.disabled; - battle_menu_isEnabled[entryIdx] = FALSE; - battle_menu_isMessageDisabled[entryIdx] = 0x48; + if (!(battleStatus->menuDisableFlags & BTL_MENU_DISABLED_STAR_POWERS)) { + BattleMenu_HudScripts[entryIdx] = battle_menu_StarPowerHudScripts.disabled; + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } - if (battleStatus->unk_4C[0] == 8) { + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_STAR_POWERS) { initialPos = entryIdx; } entryIdx++; } - main_menu_numOptions = entryIdx; + BattleMenu_NumOptions = entryIdx; D_802AD0A8 = 0; D_802AD0B0 = initialPos; D_802AD100 = 2 - initialPos; - if (func_802A58D0() != 0) { - D_802AD104 = 1; + if (func_802A58D0()) { + BattleMenu_ShowSwapIcons = TRUE; } else { - D_802AD104 = 0; + BattleMenu_ShowSwapIcons = FALSE; } - func_802A1000(); + btl_main_menu_init(); D_802ACC60 = 8; D_802ACC6C = 0; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY; break; - case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1: + case BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY: if (battleStatus->hustleTurns != 0) { set_animation(ACTOR_PLAYER, 0, ANIM_Mario_RunThinking); } else { - set_animation(ACTOR_PLAYER, 0, func_80265D44(0x1c)); + set_animation(ACTOR_PLAYER, 0, func_80265D44(STATUS_THINKING)); } - submenuResult = func_802A11B0(); + submenuResult = btl_main_menu_update(); if (D_802ACC6C != 0) { D_802ACC6C--; - } else if (!(gBattleStatus.flags1 & BS_FLAGS1_2000000) && (gGameStatusPtr->pressedButtons[0] & BUTTON_Z)) { + } else if (!(gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE) && (gGameStatusPtr->pressedButtons[0] & BUTTON_Z)) { if (func_802A58D0() && battleStatus->hustleTurns != 1) { sfx_play_sound(SOUND_F); - battleStatus->unk_4C[0] = battle_menu_submenuIDs[D_802AD002 + D_802AD06B]; - func_802A10B8(); + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = battle_menu_submenuIDs[BattleMenu_CurPos + BattleMenu_HomePos]; + btl_main_menu_destroy(); btl_set_state(BATTLE_STATE_SWITCH_TO_PARTNER); } else if (partnerActor != NULL && !(partnerActor->flags & BS_FLAGS1_200000) && battleStatus->hustleTurns != 1) { sfx_play_sound(SOUND_MENU_ERROR); - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_8; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_SHOW_CANT_SWAP; } break; } @@ -2450,7 +2442,7 @@ void btl_state_update_player_menu(void) { D_802ACC60--; } else if (submenuResult != 0) { set_animation(ACTOR_PLAYER, 0, ANIM_Mario_Walking); - battleStatus->unk_4C[0] = battleStatus->currentSubmenu = battle_menu_submenuIDs[submenuResult - 1]; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = battleStatus->currentSubmenu = battle_menu_submenuIDs[submenuResult - 1]; for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) { battleStatus->submenuMoves[i] = 0; battleStatus->submenuIcons[0] = 0; ///< @bug ? @@ -2458,18 +2450,18 @@ void btl_state_update_player_menu(void) { } switch (battleStatus->currentSubmenu) { - case 2: + case BTL_MENU_TYPE_ITEMS: + battleStatus->submenuMoves[0] = D_802AB4F0[8]; battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK; battleStatus->submenuStatus[0] = 1; - battleStatus->submenuMoves[0] = D_802AB4F0[8]; for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) { if (playerData->invItems[i] == 0) { continue; } itemData = &gItemTable[playerData->invItems[i]]; - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = playerData->invItems[i]; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = playerData->invItems[i]; battleStatus->currentTargetListFlags = itemData->targetFlags; player_create_target_list(playerActor); } @@ -2495,7 +2487,7 @@ void btl_state_update_player_menu(void) { } break; do { // required to match - case 1: + case BTL_MENU_TYPE_SMASH: btl_init_menu_hammer(); if (battleStatus->submenuMoveCount == 1) { battleStatus->submenuMoveCount = 0; @@ -2504,7 +2496,7 @@ void btl_state_update_player_menu(void) { battleStatus->submenuMoveCount = 0; } break; - case 0: + case BTL_MENU_TYPE_JUMP: btl_init_menu_boots(); if (battleStatus->submenuMoveCount == 1) { battleStatus->submenuMoveCount = 0; @@ -2513,7 +2505,7 @@ void btl_state_update_player_menu(void) { battleStatus->submenuMoveCount = 0; } break; - case 8: + case BTL_MENU_TYPE_STAR_POWERS: battleStatus->submenuMoves[0] = MOVE_FOCUS; battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK; battleStatus->submenuStatus[0] = 1; @@ -2523,8 +2515,8 @@ void btl_state_update_player_menu(void) { moveData = &gMoveTable[MOVE_REFRESH + i]; battleStatus->submenuMoves[entryIdx] = MOVE_REFRESH + i; battleStatus->submenuIcons[entryIdx] = 0; - battleStatus->moveCategory = BTL_MENU_TYPE_8; - battleStatus->selectedItemID = MOVE_REFRESH + i; + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; + battleStatus->moveArgument = MOVE_REFRESH + i; battleStatus->currentTargetListFlags = moveData->flags; player_create_target_list(playerActor); battleStatus->submenuStatus[entryIdx] = 1; @@ -2545,8 +2537,8 @@ void btl_state_update_player_menu(void) { moveData = &gMoveTable[MOVE_STAR_BEAM]; battleStatus->submenuMoves[entryIdx] = MOVE_STAR_BEAM; battleStatus->submenuIcons[entryIdx] = 0; - battleStatus->moveCategory = BTL_MENU_TYPE_8; - battleStatus->selectedItemID = MOVE_REFRESH + i; + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; + battleStatus->moveArgument = MOVE_REFRESH + i; battleStatus->currentTargetListFlags = moveData->flags; player_create_target_list(playerActor); battleStatus->submenuStatus[entryIdx] = starBeamLevel; @@ -2568,8 +2560,8 @@ void btl_state_update_player_menu(void) { moveData = &gMoveTable[MOVE_PEACH_BEAM]; battleStatus->submenuMoves[entryIdx] = MOVE_PEACH_BEAM; battleStatus->submenuIcons[entryIdx] = 0; - battleStatus->moveCategory = BTL_MENU_TYPE_8; - battleStatus->selectedItemID = MOVE_REFRESH + i; + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; + battleStatus->moveArgument = MOVE_REFRESH + i; battleStatus->currentTargetListFlags = moveData->flags; player_create_target_list(playerActor); battleStatus->submenuStatus[entryIdx] = 1; @@ -2592,28 +2584,28 @@ void btl_state_update_player_menu(void) { } currentSubmenu = battleStatus->currentSubmenu; - if (currentSubmenu == BTL_MENU_TYPE_8) { + if (currentSubmenu == BTL_MENU_TYPE_STAR_POWERS) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_1; btl_state_update_player_menu(); btl_state_update_player_menu(); break; - } else if (currentSubmenu == BTL_MENU_TYPE_7) { - if (battleStatus->actionCommandMode != ACTION_COMMAND_MODE_TUTORIAL && !(gBattleStatus.flags1 & BS_FLAGS1_2000000)) { + } else if (currentSubmenu == BTL_MENU_TYPE_STRATEGIES) { + if (battleStatus->actionCommandMode != ACTION_COMMAND_MODE_TUTORIAL && !(gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE)) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_BUILD_STRATEGIES; btl_state_update_player_menu(); btl_state_update_player_menu(); break; } else { - func_802A10B8(); + btl_main_menu_destroy(); battleStatus->moveCategory = currentSubmenu; - battleStatus->selectedItemID = 0; + battleStatus->moveArgument = 0; battleStatus->selectedMoveID = 0; btl_set_state(BATTLE_STATE_PLAYER_MOVE); break; } } else { if (battleStatus->submenuMoveCount == 0) { - if (currentSubmenu != BTL_MENU_TYPE_ITEM) { + if (currentSubmenu != BTL_MENU_TYPE_ITEMS) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_10; break; } else { @@ -2626,22 +2618,22 @@ void btl_state_update_player_menu(void) { initialPos = 0; if (currentSubmenu == BTL_MENU_TYPE_JUMP) { - if (battleStatus->unk_4C[1] < 0) { - battleStatus->unk_4C[1] = 0; + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] = 0; } - initialPos = battleStatus->unk_4C[1]; + initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP]; } if (battleStatus->currentSubmenu == BTL_MENU_TYPE_SMASH) { - if (battleStatus->unk_4C[2] < 0) { - battleStatus->unk_4C[2] = 0; + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] = 0; } - initialPos = battleStatus->unk_4C[2]; + initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH]; } - if (battleStatus->currentSubmenu == BTL_MENU_TYPE_ITEM) { - if (battleStatus->unk_4C[3] < 0) { - battleStatus->unk_4C[3] = 0; + if (battleStatus->currentSubmenu == BTL_MENU_TYPE_ITEMS) { + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] = 0; } - initialPos = battleStatus->unk_4C[3]; + initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS]; } for (i = 0; i < battleStatus->submenuMoveCount; i++) { @@ -2649,21 +2641,21 @@ void btl_state_update_player_menu(void) { itemData = &gItemTable[battleStatus->submenuIcons[i]]; hudScriptPair = &gItemHudScripts[itemData->hudElemID]; - battle_menu_moveOptionCantUseTypes[i] = 0; + BattleMenu_Moves_OptionCantUseMessages[i] = 0; if (battleStatus->submenuStatus[i] == 0) { - battle_menu_moveOptionCantUseTypes[i] = 0; + BattleMenu_Moves_OptionCantUseMessages[i] = 0; } if (battleStatus->submenuStatus[i] == -1) { battleStatus->submenuStatus[i] = 0; - battle_menu_moveOptionCantUseTypes[i] = 0x48; + BattleMenu_Moves_OptionCantUseMessages[i] = BTL_MSG_48; } if (battleStatus->submenuStatus[i] == -2) { battleStatus->submenuStatus[i] = 0; - battle_menu_moveOptionCantUseTypes[i] = 0x48; + BattleMenu_Moves_OptionCantUseMessages[i] = BTL_MSG_48; } if (battleStatus->submenuStatus[i] == -3) { battleStatus->submenuStatus[i] = 0; - battle_menu_moveOptionCantUseTypes[i] = 0x54; + BattleMenu_Moves_OptionCantUseMessages[i] = BTL_MSG_54; } battle_menu_moveOptionIconScripts[i] = hudScriptPair->enabled; if (battleStatus->submenuStatus[i] == 0) { @@ -2672,7 +2664,7 @@ void btl_state_update_player_menu(void) { battle_menu_moveOptionDisplayCosts[i] = moveData->costFP; battle_menu_moveOptionBPCosts[i] = moveData->costBP; - battle_menu_moveOptionSortPriorities[i] = 0; + BattleMenu_Moves_OptionSortPriority[i] = 0; battle_menu_moveOptionDisplayCostReductions[i] = 0; battle_menu_moveOptionDisplayCostReductionColors[i] = 0; @@ -2685,15 +2677,15 @@ void btl_state_update_player_menu(void) { battle_menu_moveOptionDisplayCostReductionColors[i] = 2; } - battle_menu_moveIndices[i] = i; - battle_menu_moveOptionsEnabled[i] = battleStatus->submenuStatus[i]; + BattleMenu_Moves_OptionIndices[i] = i; + BattleMenu_Moves_OptionEnabled[i] = battleStatus->submenuStatus[i]; battle_menu_moveOptionNames[i] = moveData->nameMsg; - battle_menu_moveOptionDescriptions[i] = moveData->shortDescMsg; + BattleMenu_Moves_OptionDescMessages[i] = moveData->shortDescMsg; } - battle_menu_hasSpiritsMenu = 0; + BattleMenu_UsingSpiritsSubmenu = FALSE; D_802AD4A8 = initialPos; - battle_menu_moveOptionCount = battleStatus->submenuMoveCount; + BattleMenu_Moves_OptionCount = battleStatus->submenuMoveCount; func_802A2684(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_2; break; @@ -2701,7 +2693,7 @@ void btl_state_update_player_menu(void) { } break; case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_2: - submenuResult = func_802A2C84(); + submenuResult = btl_submenu_moves_update(); if (submenuResult == -1) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_7; } else if (submenuResult == 0) { @@ -2709,21 +2701,21 @@ void btl_state_update_player_menu(void) { func_802A1050(); D_802ACC60 = 8; D_802ACC6C = 4; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY; btl_state_update_player_menu(); btl_state_update_player_menu(); } else { - battleStatus->unk_49 = battle_menu_moveIndices[submenuResult - 1]; + battleStatus->unk_49 = BattleMenu_Moves_OptionIndices[submenuResult - 1]; battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_49]; if (battleStatus->currentSubmenu == BTL_MENU_TYPE_JUMP) { - battleStatus->unk_4C[1] = battle_menu_moveOptionActive; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] = battle_menu_moveOptionActive; } if (battleStatus->currentSubmenu == BTL_MENU_TYPE_SMASH) { - battleStatus->unk_4C[2] = battle_menu_moveOptionActive; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] = battle_menu_moveOptionActive; } currentSubmenu2 = battleStatus->currentSubmenu; - if (battleStatus->currentSubmenu == BTL_MENU_TYPE_ITEM) { - battleStatus->unk_4C[3] = battle_menu_moveOptionActive; + if (battleStatus->currentSubmenu == BTL_MENU_TYPE_ITEMS) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] = battle_menu_moveOptionActive; if (battleStatus->currentSubmenu == currentSubmenu2) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_1; btl_state_update_player_menu(); @@ -2733,87 +2725,89 @@ void btl_state_update_player_menu(void) { } func_802A27D0(); func_802A1030(); - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_3; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MOVE_CHOOSE_TARGET; } break; - case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_3: - submenuResult = func_802A2C84(); + case BTL_SUBSTATE_PLAYER_MENU_MOVE_CHOOSE_TARGET: + submenuResult = btl_submenu_moves_update(); if ((battleStatus->currentButtonsPressed & BUTTON_B) && submenuResult == 0) { func_802A2AB8(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_4; break; } - if (func_802A11B0() == 0) { + if (btl_main_menu_update() == 0) { break; } - battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_5; - battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_6; + battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CANCEL; + battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CHOSEN; battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_49]; battleStatus->currentTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_49]].flags; currentSubmenu = battleStatus->currentSubmenu; switch (currentSubmenu) { case BTL_MENU_TYPE_JUMP: battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; - battleStatus->selectedItemID = playerData->bootsLevel; + battleStatus->moveArgument = playerData->bootsLevel; btl_set_state(BATTLE_STATE_SELECT_TARGET); break; case BTL_MENU_TYPE_SMASH: battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; - battleStatus->selectedItemID = playerData->hammerLevel; + battleStatus->moveArgument = playerData->hammerLevel; btl_set_state(BATTLE_STATE_SELECT_TARGET); break; - case BTL_MENU_TYPE_4: + case BTL_MENU_TYPE_DEFEND: gBattleSubState = battleStatus->acceptTargetMenuSubstate; btl_state_update_player_menu(); - battleStatus->moveCategory = BTL_MENU_TYPE_4; + battleStatus->moveCategory = BTL_MENU_TYPE_DEFEND; btl_set_state(BATTLE_STATE_DEFEND); break; } break; case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_4: - func_802A2C84(); - if (func_802A11B0() != 0) { - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_2; + btl_submenu_moves_update(); + if (btl_main_menu_update() == 0) { + break; } + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_2; break; - case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_5: + case BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CANCEL: func_802A2AB8(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_4; break; - case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_6: + case BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CHOSEN: func_802A27E4(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_7: - if (func_802A2C84() != -1) { + if (btl_submenu_moves_update() != -1) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_2; } break; - case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_8: + case BTL_SUBSTATE_PLAYER_MENU_MAIN_SHOW_CANT_SWAP: if (gBattleStatus.flags2 & BS_FLAGS2_4) { btl_show_variable_battle_message(BTL_MSG_50, 60, 0); } else { btl_show_variable_battle_message(BTL_MSG_51, 60, playerData->currentPartner); } D_802AD607 = 1; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_9; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_AWAIT_CANT_SWAP; break; - case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_9: - if (!btl_is_popup_displayed()) { - D_802ACC6C = 4; - D_802AD607 = 0; - D_802ACC60 = 0; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1; + case BTL_SUBSTATE_PLAYER_MENU_MAIN_AWAIT_CANT_SWAP: + if (btl_is_popup_displayed()) { + break; } + D_802ACC6C = 4; + D_802AD607 = 0; + D_802ACC60 = 0; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY; break; case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_10: func_802A1030(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_11; break; case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_11: - submenuResult = func_802A11B0(); + submenuResult = btl_main_menu_update(); if ((battleStatus->currentButtonsPressed & BUTTON_B) && submenuResult == 0) { func_802A1078(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_12; @@ -2823,14 +2817,14 @@ void btl_state_update_player_menu(void) { switch (battleStatus->currentSubmenu) { case BTL_MENU_TYPE_JUMP: battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; - battleStatus->selectedItemID = playerData->bootsLevel; + battleStatus->moveArgument = playerData->bootsLevel; battleStatus->selectedMoveID = playerData->bootsLevel + MOVE_JUMP1; battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; btl_set_state(BATTLE_STATE_SELECT_TARGET); break; case BTL_MENU_TYPE_SMASH: battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; - battleStatus->selectedItemID = playerData->hammerLevel; + battleStatus->moveArgument = playerData->hammerLevel; battleStatus->selectedMoveID = playerData->hammerLevel + MOVE_HAMMER1; battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; btl_set_state(BATTLE_STATE_SELECT_TARGET); @@ -2842,18 +2836,19 @@ void btl_state_update_player_menu(void) { break; CASE_C: case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_12: - if (func_802A11B0() != 0) { - D_802ACC60 = 8; - D_802ACC6C = 4; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1; + if (btl_main_menu_update() == 0) { + break; } + D_802ACC60 = 8; + D_802ACC6C = 4; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY; break; case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_13: func_802A1078(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_12; break; case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_14: - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_1: if (battleStatus->selectedMoveID == MOVE_DOUBLE_DIP) { @@ -2872,8 +2867,8 @@ void btl_state_update_player_menu(void) { if (!(itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE)) { continue; } - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = playerData->invItems[i]; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = playerData->invItems[i]; battleStatus->currentTargetListFlags = itemData->targetFlags; player_create_target_list(playerActor); popup->ptrIcon[entryIdx] = hudScriptPair->enabled; @@ -2887,30 +2882,30 @@ void btl_state_update_player_menu(void) { } entryIdx++; } - popup->unk_31C = 0; - popup->unk_320 = 0; + popup->dipMode = 0; + popup->titleNumber = 0; if (battleStatus->selectedMoveID == MOVE_DOUBLE_DIP) { - popup->unk_31C = 1; - popup->unk_320 = battleStatus->itemUsesLeft; + popup->dipMode = 1; + popup->titleNumber = battleStatus->itemUsesLeft; } if (battleStatus->selectedMoveID == MOVE_TRIPLE_DIP) { - popup->unk_31C = 2; - popup->unk_320 = battleStatus->itemUsesLeft; + popup->dipMode = 2; + popup->titleNumber = battleStatus->itemUsesLeft; } - if (battleStatus->unk_4C[4] < 0) { - battleStatus->unk_4C[4] = 0; + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = 0; } popup->popupType = 0; popup->numEntries = entryIdx; - initialPos = battleStatus->unk_4C[4]; + initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP]; popup->initialPos = initialPos; func_800F513C(popup); func_800F52BC(); - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_2; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_DIPPING_CHOOSE_TARGET; break; - case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_2: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_CHOOSE_TARGET: if (popup->result != 0) { - if (popup->result == 0xff) { + if (popup->result == 255) { func_802A2910(); battleStatus->selectedMoveID = 0; battleStatus->itemUsesLeft = 0; @@ -2918,14 +2913,14 @@ void btl_state_update_player_menu(void) { btl_state_update_player_menu(); btl_state_update_player_menu(); } else { - battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_5; - battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_6; + battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_DIPPING_TARGET_CANCEL; + battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_DIPPING_TARGET_CHOSEN; battleStatus->unk_1AA = popup->userIndex[popup->result - 1]; - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = battleStatus->unk_1AA; - battleStatus->currentTargetListFlags = gItemTable[battleStatus->selectedItemID].targetFlags | ITEM_TARGET_FLAG_8000; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = battleStatus->unk_1AA; + battleStatus->currentTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | ITEM_TARGET_FLAG_8000; battleStatus->currentAttackElement = 0; - battleStatus->unk_4C[4] = popup->result - 1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1; hide_popup_menu(); func_802A27D0(); func_802A1030(); @@ -2941,29 +2936,29 @@ void btl_state_update_player_menu(void) { battleStatus->selectedMoveID = 0; gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_4; } else { - func_802A2C84(); - if (func_802A11B0()) { + btl_submenu_moves_update(); + if (btl_main_menu_update()) { btl_set_state(BATTLE_STATE_SELECT_TARGET); } } break; case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_4: - func_802A2C84(); - if (func_802A11B0() != 0) { - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_2; + btl_submenu_moves_update(); + if (btl_main_menu_update() != 0) { + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_DIPPING_CHOOSE_TARGET; } break; - case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_5: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_TARGET_CANCEL: func_800F16CC(); func_802A2C58(); func_802A1098(); - func_802A2C84(); + btl_submenu_moves_update(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_4; break; - case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_6: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_TARGET_CHOSEN: destroy_popup_menu(); func_802A27E4(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PLAYER_MENU_ITEMS_1: entryIdx = 0; @@ -2976,8 +2971,8 @@ void btl_state_update_player_menu(void) { if (!(itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE)) { continue; } - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = playerData->invItems[i]; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = playerData->invItems[i]; battleStatus->currentTargetListFlags = itemData->targetFlags; player_create_target_list(playerActor); popup->ptrIcon[entryIdx] = hudScriptPair->enabled; @@ -2992,14 +2987,14 @@ void btl_state_update_player_menu(void) { } entryIdx++; } - if (battleStatus->unk_4C[4] < 0) { - battleStatus->unk_4C[4] = 0; + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = 0; } - initialPos = battleStatus->unk_4C[4]; + initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP]; popup->popupType = 0; popup->numEntries = entryIdx; - popup->unk_31C = 0; - popup->unk_320 = 0; + popup->dipMode = 0; + popup->titleNumber = 0; popup->initialPos = initialPos; func_800F513C(popup); func_800F52BC(); @@ -3007,23 +3002,23 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_ITEMS_2: if (popup->result != 0) { - if (popup->result == 0xff) { + if (popup->result == 255) { func_802A1050(); D_802ACC60 = 8; D_802ACC6C = 4; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY; btl_state_update_player_menu(); btl_state_update_player_menu(); } else { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_ITEMS_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_ITEMS_6; battleStatus->unk_1AA = popup->userIndex[popup->result - 1]; - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = battleStatus->unk_1AA; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = battleStatus->unk_1AA; battleStatus->selectedMoveID = MOVE_ITEMS; - battleStatus->currentTargetListFlags = gItemTable[battleStatus->selectedItemID].targetFlags | ITEM_TARGET_FLAG_8000; + battleStatus->currentTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | ITEM_TARGET_FLAG_8000; battleStatus->currentAttackElement = 0; - battleStatus->unk_4C[4] = popup->result - 1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1; hide_popup_menu(); func_802A1030(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_ITEMS_3; @@ -3036,13 +3031,13 @@ void btl_state_update_player_menu(void) { func_802A1098(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_ITEMS_4; } else { - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { btl_set_state(BATTLE_STATE_SELECT_TARGET); } } break; case BTL_SUBSTATE_PLAYER_MENU_ITEMS_4: - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_ITEMS_2; } break; @@ -3053,96 +3048,96 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_ITEMS_6: destroy_popup_menu(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_1: for (i = 0; i < battleStatus->submenuMoveCount; i++) { moveData = &gMoveTable[battleStatus->submenuMoves[i]]; - battle_menu_moveOptionCantUseTypes[i] = 0; + BattleMenu_Moves_OptionCantUseMessages[i] = 0; if (battleStatus->submenuStatus[i] == 0) { - battle_menu_moveOptionCantUseTypes[i] = 0; + BattleMenu_Moves_OptionCantUseMessages[i] = 0; } if (battleStatus->submenuStatus[i] == -1) { battleStatus->submenuStatus[i] = 0; - battle_menu_moveOptionCantUseTypes[i] = 0x48; + BattleMenu_Moves_OptionCantUseMessages[i] = BTL_MSG_48; } if (battleStatus->submenuStatus[i] == -2) { battleStatus->submenuStatus[i] = 0; - battle_menu_moveOptionCantUseTypes[i] = 0x48; + BattleMenu_Moves_OptionCantUseMessages[i] = BTL_MSG_48; } - if (!(battleStatus->unk_74 & (1 << i))) { + if (!(battleStatus->enabledStarPowersMask & (1 << i))) { battleStatus->submenuStatus[i] = 0; - battle_menu_moveOptionCantUseTypes[i] = 0x48; + BattleMenu_Moves_OptionCantUseMessages[i] = BTL_MSG_48; } - battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * (battleStatus->submenuMoves[i] - MOVE_FOCUS) + 0]; + battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * STAR_POWER_INDEX(battleStatus->submenuMoves[i]) + 0]; if (battleStatus->submenuStatus[i] == 0) { - battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * (battleStatus->submenuMoves[i] - MOVE_FOCUS) + 1]; + battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * STAR_POWER_INDEX(battleStatus->submenuMoves[i]) + 1]; } battle_menu_moveOptionDisplayCosts[i] = moveData->costFP; battle_menu_moveOptionBPCosts[i] = moveData->costBP; - battle_menu_moveOptionSortPriorities[i] = 0; - battle_menu_moveIndices[i] = i; - battle_menu_moveOptionsEnabled[i] = battleStatus->submenuStatus[i]; + BattleMenu_Moves_OptionSortPriority[i] = 0; + BattleMenu_Moves_OptionIndices[i] = i; + BattleMenu_Moves_OptionEnabled[i] = battleStatus->submenuStatus[i]; battle_menu_moveOptionNames[i] = moveData->nameMsg; - battle_menu_moveOptionDescriptions[i] = moveData->shortDescMsg; + BattleMenu_Moves_OptionDescMessages[i] = moveData->shortDescMsg; battle_menu_moveOptionDisplayCostReductions[i] = 0; battle_menu_moveOptionDisplayCostReductionColors[i] = 0; } - if (battleStatus->unk_4C[6] < 0) { - battleStatus->unk_4C[6] = 0; + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER] = 0; } - initialPos = battleStatus->unk_4C[6]; - battle_menu_moveOptionCount = battleStatus->submenuMoveCount; + initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER]; + BattleMenu_Moves_OptionCount = battleStatus->submenuMoveCount; D_802AD4A8 = initialPos; - battle_menu_hasSpiritsMenu = 1; + BattleMenu_UsingSpiritsSubmenu = TRUE; func_802A2684(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_2; break; case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_2: - submenuResult = func_802A2C84(); + submenuResult = btl_submenu_moves_update(); if (submenuResult == -1) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_7; } else if (submenuResult == 0) { - } else if (submenuResult == 0xff) { + } else if (submenuResult == 255) { func_802A1050(); D_802ACC60 = 8; D_802ACC6C = 4; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY; btl_state_update_player_menu(); btl_state_update_player_menu(); } else { - battleStatus->unk_49 = battle_menu_moveIndices[submenuResult - 1]; - battleStatus->unk_4C[6] = battle_menu_moveOptionActive; + battleStatus->unk_49 = BattleMenu_Moves_OptionIndices[submenuResult - 1]; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER] = battle_menu_moveOptionActive; func_802A27D0(); func_802A1030(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_3; } break; case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_3: - submenuResult = func_802A2C84(); + submenuResult = btl_submenu_moves_update(); if ((battleStatus->currentButtonsPressed & BUTTON_B) && submenuResult == 0) { func_802A2AB8(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_4; - } else if (func_802A11B0() != 0) { + } else if (btl_main_menu_update() != 0) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_6; - battleStatus->moveCategory = BTL_MENU_TYPE_8; + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_49]; battleStatus->currentTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_49]].flags; - battleStatus->selectedItemID = battleStatus->unk_49; - if (playerData->starBeamLevel == 2 && battleStatus->selectedItemID == 8) { - battleStatus->selectedItemID++; + battleStatus->moveArgument = battleStatus->unk_49; + if (playerData->starBeamLevel == 2 && battleStatus->moveArgument == 8) { + battleStatus->moveArgument++; } btl_set_state(BATTLE_STATE_SELECT_TARGET); } break; case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_4: - func_802A2C84(); - if (func_802A11B0() != 0) { + btl_submenu_moves_update(); + if (btl_main_menu_update() != 0) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_2; } break; @@ -3153,14 +3148,14 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_6: func_802A27E4(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_7: - if (func_802A2C84() != -1) { + if (btl_submenu_moves_update() != -1) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_2; } break; - case BTL_SUBSTATE_PLAYER_MENU_UNUSED_1: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_1: if (!can_btl_state_update_switch_to_player()) { battleStatus->itemUsesLeft = 1; btl_set_state(BATTLE_STATE_END_PLAYER_TURN); @@ -3176,8 +3171,8 @@ void btl_state_update_player_menu(void) { continue; } - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = playerData->invItems[i]; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = playerData->invItems[i]; battleStatus->currentTargetListFlags = itemData->targetFlags; player_create_target_list(playerActor); popup->ptrIcon[entryIdx] = hudScriptPair->enabled; @@ -3197,67 +3192,67 @@ void btl_state_update_player_menu(void) { } else { popup->popupType = 0; if (battleStatus->selectedMoveID == MOVE_DOUBLE_DIP) { - popup->popupType = 100; - popup->unk_31C = 1; - popup->unk_320 = battleStatus->itemUsesLeft; + popup->popupType += POPUP_MENU_DOUBLE_DIP; + popup->dipMode = 1; + popup->titleNumber = battleStatus->itemUsesLeft; } if (battleStatus->selectedMoveID == MOVE_TRIPLE_DIP) { - popup->unk_31C = 2; - popup->popupType += 200; - popup->unk_320 = battleStatus->itemUsesLeft; + popup->popupType += POPUP_MENU_TRIPLE_DIP; + popup->dipMode = 2; + popup->titleNumber = battleStatus->itemUsesLeft; } - if (battleStatus->unk_4C[4] < 0) { - battleStatus->unk_4C[4] = 0; + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = 0; } popup->numEntries = entryIdx; - initialPos = battleStatus->unk_4C[4]; + initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP]; popup->initialPos = initialPos; func_800F513C(popup); func_800F52BC(); - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNUSED_2; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_DIPPING_2; } } break; - case BTL_SUBSTATE_PLAYER_MENU_UNUSED_2: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_2: if (popup->result != 0) { if (popup->result == 255) { battleStatus->itemUsesLeft = 1; btl_set_state(BATTLE_STATE_END_PLAYER_TURN); } else { - battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_UNUSED_5; - battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_UNUSED_6; + battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_DIPPING_5; + battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_DIPPING_6; battleStatus->unk_1AA = popup->userIndex[popup->result - 1]; - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = battleStatus->unk_1AA; - battleStatus->currentTargetListFlags = gItemTable[battleStatus->selectedItemID].targetFlags | ITEM_TARGET_FLAG_8000; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = battleStatus->unk_1AA; + battleStatus->currentTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | ITEM_TARGET_FLAG_8000; battleStatus->currentAttackElement = 0; - battleStatus->unk_4C[4] = popup->result - 1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1; hide_popup_menu(); D_802ACC60 = 5; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNUSED_3; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_DIPPING_3; } } break; - case BTL_SUBSTATE_PLAYER_MENU_UNUSED_3: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_3: if (D_802ACC60 != 0) { D_802ACC60--; } else { btl_set_state(BATTLE_STATE_SELECT_TARGET); } break; - case BTL_SUBSTATE_PLAYER_MENU_UNUSED_4: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_4: if (D_802ACC60 != 0) { D_802ACC60--; } else { - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNUSED_2; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_DIPPING_2; } break; - case BTL_SUBSTATE_PLAYER_MENU_UNUSED_5: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_5: func_800F16CC(); D_802ACC60 = 5; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNUSED_4; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_DIPPING_4; break; - case BTL_SUBSTATE_PLAYER_MENU_UNUSED_6: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_6: destroy_popup_menu(); break; case BTL_SUBSTATE_PLAYER_MENU_BERSERKER_1: @@ -3278,7 +3273,7 @@ void btl_state_update_player_menu(void) { } if (jumpTargetCount <= 0 && hammerTargetCount <= 0) { - battleStatus->moveCategory = BTL_MENU_TYPE_9; + battleStatus->moveCategory = BTL_MENU_TYPE_DO_NOTHING; battleStatus->unk_95 = 0; btl_set_state(BATTLE_STATE_END_PLAYER_TURN); } else { @@ -3293,13 +3288,13 @@ void btl_state_update_player_menu(void) { battleStatus->selectedMoveID = MOVE_UNUSED_JUMP5; battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_JUMP5].flags; - battleStatus->selectedItemID = playerData->bootsLevel; + battleStatus->moveArgument = playerData->bootsLevel; player_create_target_list(playerActor); } else { battleStatus->selectedMoveID = MOVE_UNUSED_HAMMER5; battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_HAMMER5].flags; - battleStatus->selectedItemID = playerData->hammerLevel; + battleStatus->moveArgument = playerData->hammerLevel; player_create_target_list(playerActor); } btl_set_state(BATTLE_STATE_PLAYER_MOVE); @@ -3309,8 +3304,8 @@ void btl_state_update_player_menu(void) { entryIdx = 0; func_80263268(); if (battleStatus->changePartnerAllowed >= 0) { - D_802AD678[0] = 5; - D_802AD658[0] = battle_menu_leftJustfiedMessagesB[0]; + D_802AD678[0] = BTL_MENU_TYPE_CHANGE_PARTNER; + D_802AD658[0] = BattleMenu_LeftJustMessages[BTL_MENU_TYPE_CHANGE_PARTNER]; D_802AD640[0] = battle_menu_PartnerHudScripts[playerData->currentPartner]; D_802AD690[0] = 1; D_802AD6C0[0] = MSG_Menus_Action_ChangePartner; @@ -3323,16 +3318,16 @@ void btl_state_update_player_menu(void) { } D_802AD640[entryIdx] = battle_menu_DoNothingHudScripts.enabled; - D_802AD678[entryIdx] = 9; + D_802AD678[entryIdx] = BTL_MENU_TYPE_DO_NOTHING; D_802AD690[entryIdx] = 1; - D_802AD658[entryIdx] = battle_menu_leftJustfiedMessagesA[9]; + D_802AD658[entryIdx] = BattleMenu_LeftJustMessages[BTL_MENU_TYPE_DO_NOTHING]; D_802AD6C0[entryIdx] = MSG_Menus_Action_DoNothing; entryIdx++; D_802AD640[entryIdx] = battle_menu_FleeHudScripts.enabled; - D_802AD678[entryIdx] = 3; + D_802AD678[entryIdx] = BTL_MENU_TYPE_RUN_AWAY; D_802AD690[entryIdx] = 1; - D_802AD658[entryIdx] = battle_menu_leftJustfiedMessagesA[3]; + D_802AD658[entryIdx] = BattleMenu_LeftJustMessages[BTL_MENU_TYPE_RUN_AWAY]; D_802AD6C0[entryIdx] = MSG_Menus_Action_RunAway; if (!(gBattleStatus.flags2 & BS_FLAGS2_CANT_FLEE)) { D_802AD640[entryIdx] = battle_menu_FleeHudScripts.disabled; @@ -3341,10 +3336,10 @@ void btl_state_update_player_menu(void) { } entryIdx++; - if (battleStatus->unk_4C[7] < 0) { - battleStatus->unk_4C[7] = 0; + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] = 0; } - initialPos = battleStatus->unk_4C[7]; + initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY]; D_802AD66C = entryIdx; D_802AD670 = initialPos; func_802A45D8(); @@ -3359,12 +3354,12 @@ void btl_state_update_player_menu(void) { func_802A1050(); D_802ACC60 = 8; D_802ACC6C = 4; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY; btl_state_update_player_menu(); btl_state_update_player_menu(); } else { battleStatus->currentSubmenu = D_802AD678[submenuResult - 1]; - battleStatus->unk_4C[7] = submenuResult - 1; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] = submenuResult - 1; if (battleStatus->currentSubmenu == 5) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_1; btl_state_update_player_menu(); @@ -3382,14 +3377,14 @@ void btl_state_update_player_menu(void) { func_802A48FC(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_4; - } else if (func_802A11B0() != 0) { + } else if (btl_main_menu_update() != 0) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6; switch (battleStatus->currentSubmenu) { case 3: gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6; btl_state_update_player_menu(); - battleStatus->moveCategory = BTL_MENU_TYPE_3; + battleStatus->moveCategory = BTL_MENU_TYPE_RUN_AWAY; battleStatus->selectedMoveID = MOVE_UNUSED_39; btl_set_state(BATTLE_STATE_RUN_AWAY); break; @@ -3404,7 +3399,7 @@ void btl_state_update_player_menu(void) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6; btl_state_update_player_menu(); battleStatus->selectedMoveID = MOVE_UNUSED_DEFEND_PLUS; - battleStatus->moveCategory = BTL_MENU_TYPE_4; + battleStatus->moveCategory = BTL_MENU_TYPE_DEFEND; btl_set_state(BATTLE_STATE_DEFEND); break; case 10: @@ -3417,10 +3412,10 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_4: func_802A4A54(); - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { D_802ACC60 = 8; D_802ACC6C = 4; - gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1; + gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY; } break; case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_5: @@ -3430,7 +3425,7 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6: func_802A472C(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_8: if (func_802A4A54() != -1) { @@ -3456,14 +3451,14 @@ void btl_state_update_player_menu(void) { entryIdx++; } } - if (battleStatus->unk_4C[5] < 0) { - battleStatus->unk_4C[5] = 0; + if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] < 0) { + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] = 0; } popup->popupType = 1; popup->numEntries = entryIdx; popup->initialPos = D_8008EEF0[playerData->currentPartner] - 1; - popup->unk_31C = 0; - popup->unk_320 = 0; + popup->dipMode = 0; + popup->titleNumber = 0; func_800F513C(popup); func_800F52BC(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_2; @@ -3481,11 +3476,11 @@ void btl_state_update_player_menu(void) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_6; battleStatus->unk_1AC = popup->userIndex[popup->result - 1]; - battleStatus->moveCategory = BTL_MENU_TYPE_5; + battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; battleStatus->selectedMoveID = MOVE_UNUSED_37; battleStatus->currentTargetListFlags = ITEM_TARGET_FLAG_2; - battleStatus->selectedItemID = battleStatus->unk_1AC; - battleStatus->unk_4C[5] = popup->result - 1; + battleStatus->moveArgument = battleStatus->unk_1AC; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] = popup->result - 1; hide_popup_menu(); func_802A4718(); func_802A1030(); @@ -3501,7 +3496,7 @@ void btl_state_update_player_menu(void) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_4; } else { func_802A4A54(); - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { gBattleSubState = battleStatus->acceptTargetMenuSubstate; btl_state_update_player_menu(); btl_set_state(BATTLE_STATE_CHANGE_PARTNER); @@ -3510,7 +3505,7 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_4: func_802A4A54(); - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_2; } break; @@ -3523,7 +3518,7 @@ void btl_state_update_player_menu(void) { case BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_6: destroy_popup_menu(); func_802A472C(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_7: set_window_update(WINDOW_ID_6, WINDOW_UPDATE_HIDE); @@ -3539,22 +3534,22 @@ void btl_state_update_player_menu(void) { void btl_state_draw_player_menu(void) { switch (gBattleSubState) { - case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_1: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY: + btl_main_menu_draw(); break; case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_2: - case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_3: + case BTL_SUBSTATE_PLAYER_MENU_MOVE_CHOOSE_TARGET: case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_4: - case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_5: + case BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CANCEL: case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_10: case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_11: case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_12: case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_13: case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_1: - case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_2: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_CHOOSE_TARGET: case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_3: case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_4: - case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_5: + case BTL_SUBSTATE_PLAYER_MENU_DIPPING_TARGET_CANCEL: case BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_1: case BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_2: case BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_3: @@ -3568,25 +3563,25 @@ void btl_state_draw_player_menu(void) { case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_2: case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_3: case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_4: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_5: case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_6: case BTL_SUBSTATE_PLAYER_MENU_BUILD_STRATEGIES: case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_2: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_3: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_4: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_5: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; } } @@ -3599,10 +3594,10 @@ void btl_state_update_partner_menu(void) { Actor* playerActor = battleStatus->playerActor; Actor* partnerActor = battleStatus->partnerActor; PopupMenu* popupMenu = &D_802ACCD0; - s32 numOptions; + s32 entryIdx; s32 i; s32 popupIndex; - s32 s1; + s32 initialPos; MoveData* moveData; PartnerPopupProperties* popupProps; @@ -3614,10 +3609,10 @@ void btl_state_update_partner_menu(void) { btl_set_state(BATTLE_STATE_9); } else { btl_cam_use_preset(BTL_CAM_PRESET_C); - battleStatus->flags1 |= BS_FLAGS1_2; + battleStatus->flags1 |= BS_FLAGS1_MENU_OPEN; playerActor->flags &= ~(ACTOR_FLAG_4000000 | ACTOR_FLAG_8000000); partnerActor->flags &= ~(ACTOR_FLAG_4000000 | ACTOR_FLAG_8000000); - if (battleStatus->flags1 & BS_FLAGS1_100000) { + if (battleStatus->flags1 & BS_FLAGS1_PLAYER_IN_BACK) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_INIT_MENU; } else { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_12D; @@ -3654,7 +3649,7 @@ void btl_state_update_partner_menu(void) { partnerActor->homePos.z = partnerActor->currentPos.z; playerActor->homePos.x = playerActor->currentPos.x; playerActor->homePos.z = playerActor->currentPos.z; - gBattleStatus.flags1 |= BS_FLAGS1_100000; + gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK; } } switch (gBattleSubState) { @@ -3664,94 +3659,96 @@ void btl_state_update_partner_menu(void) { playerActor->flags |= ACTOR_FLAG_4000000; playerActor->flags |= ACTOR_FLAG_8000000; func_80263300(); - s1 = 1; func_80263268(); - if (battleStatus->unk_5C[0] < 0) { - battleStatus->unk_5C[0] = 6; + entryIdx = 0; + initialPos = 1; + if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] < 0) { + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] = BTL_MENU_TYPE_ABILITY; } btl_init_menu_partner(); func_80263268(); - // Strategies - battle_menu_submenuIDs[0] = 7; - battle_menu_isEnabled[0] = TRUE; - battle_menu_isMessageDisabled[0] = 0; - main_battle_menu_JumpHudScripts[0] = battle_menu_StrategiesHudScript.enabled; - battle_menu_messageIDs[0] = battle_menu_centeredMessagesA[7]; - if (!(battleStatus->menuDisableFlags & 0x80)) { - battle_menu_isEnabled[0] = FALSE; - battle_menu_isMessageDisabled[0] = 0x48; - main_battle_menu_JumpHudScripts[0] = battle_menu_StrategiesHudScript.disabled; + // strategies menu category + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_STRATEGIES; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + battle_menu_isMessageDisabled[entryIdx] = 0; + BattleMenu_HudScripts[entryIdx] = battle_menu_StrategiesHudScript.enabled; + BattleMenu_TitleMessages[entryIdx] = BattleMenu_CenteredMessages[BTL_MENU_TYPE_STRATEGIES]; + if (!(battleStatus->menuDisableFlags & BTL_MENU_DISABLED_STRATEGIES)) { + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; + BattleMenu_HudScripts[entryIdx] = battle_menu_StrategiesHudScript.disabled; } - if (battleStatus->unk_5C[0] == 7) { - s1 = 0; + if (battleStatus->lastPartnerMenuSelection[entryIdx] == BTL_MENU_TYPE_STRATEGIES) { + initialPos = entryIdx; } - numOptions = 1; + entryIdx++; - // Abilities - main_battle_menu_JumpHudScripts[1] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][0]; - battle_menu_submenuIDs[1] = 6; - battle_menu_isEnabled[1] = TRUE; - battle_menu_messageIDs[1] = battle_menu_centeredMessagesA[6]; + // abilities menu category + BattleMenu_HudScripts[entryIdx] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][0]; + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_ABILITY; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + BattleMenu_TitleMessages[entryIdx] = BattleMenu_CenteredMessages[BTL_MENU_TYPE_ABILITY]; if (battleStatus->menuStatus[3] <= 0) { - main_battle_menu_JumpHudScripts[1] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][1]; - battle_menu_isEnabled[1] = FALSE; - battle_menu_isMessageDisabled[1] = 0x48; + BattleMenu_HudScripts[entryIdx] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][1]; + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } - if (!(battleStatus->menuDisableFlags & 0x40)) { - main_battle_menu_JumpHudScripts[1] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][1]; - battle_menu_isEnabled[1] = FALSE; - battle_menu_isMessageDisabled[1] = 0x48; + if (!(battleStatus->menuDisableFlags & BTL_MSG_40)) { + BattleMenu_HudScripts[entryIdx] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][1]; + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; } - if (battleStatus->unk_5C[0] == 6) { - s1 = 1; + if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_ABILITY) { + initialPos = entryIdx; } - numOptions = 2; + entryIdx++; - // Focus + // focus menu category if (playerData->maxStarPower != 0 && is_ability_active(ABILITY_GROUP_FOCUS)) { - battle_menu_submenuIDs[2] = 11; - battle_menu_isEnabled[2] = TRUE; - battle_menu_isMessageDisabled[2] = 0; - main_battle_menu_JumpHudScripts[2] = battle_menu_StarPowerHudScripts.enabled; - battle_menu_messageIDs[2] = battle_menu_centeredMessagesA[11]; - if (!(battleStatus->menuDisableFlags & 0x800)) { - battle_menu_isEnabled[2] = FALSE; - battle_menu_isMessageDisabled[2] = 0x48; - main_battle_menu_JumpHudScripts[2] = battle_menu_StarPowerHudScripts.disabled; + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_PARTNER_FOCUS; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + battle_menu_isMessageDisabled[entryIdx] = 0; + BattleMenu_HudScripts[entryIdx] = battle_menu_StarPowerHudScripts.enabled; + BattleMenu_TitleMessages[entryIdx] = BattleMenu_CenteredMessages[BTL_MENU_TYPE_PARTNER_FOCUS]; + if (!(battleStatus->menuDisableFlags & BTL_MENU_DISABLED_PARTNER_FOCUS)) { + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; + BattleMenu_HudScripts[entryIdx] = battle_menu_StarPowerHudScripts.disabled; } - if (battleStatus->unk_5C[0] == 11) { - s1 = 2; + if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_PARTNER_FOCUS) { + initialPos = entryIdx; } - numOptions = 3; + entryIdx++; } - main_menu_numOptions = numOptions; + BattleMenu_NumOptions = entryIdx; D_802AD0A8 = 1; - D_802AD0B0 = s1; - D_802AD100 = 2 - s1; + D_802AD0B0 = initialPos; + D_802AD100 = 2 - initialPos; if (can_btl_state_update_switch_to_player()) { - D_802AD104 = TRUE; + BattleMenu_ShowSwapIcons = TRUE; } else { - D_802AD104 = FALSE; + BattleMenu_ShowSwapIcons = FALSE; } - func_802A1000(); + btl_main_menu_init(); D_802ACC60 = 8; D_802ACC6C = 0; gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1; return; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1: - set_animation(ACTOR_PARTNER, 0, battle_menu_partnerChooseMoveAnimations[playerData->currentPartner]); + set_animation(ACTOR_PARTNER, 0, BattleMenu_PartnerThinkAnims[playerData->currentPartner]); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_2; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_2: - numOptions = func_802A11B0(); + entryIdx = btl_main_menu_update(); + if (D_802ACC6C != 0) { - D_802ACC6C -= 1; - } else if (!(gBattleStatus.flags1 & BS_FLAGS1_2000000) && (gGameStatusPtr->pressedButtons[0] & BUTTON_Z)) { + D_802ACC6C--; + } else if (!(gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE) && (gGameStatusPtr->pressedButtons[0] & BUTTON_Z)) { if (can_btl_state_update_switch_to_player()) { sfx_play_sound(SOUND_F); - battleStatus->unk_5C[0] = battle_menu_submenuIDs[D_802AD002 + D_802AD06B]; - func_802A10B8(); + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] = battle_menu_submenuIDs[BattleMenu_CurPos + BattleMenu_HomePos]; + btl_main_menu_destroy(); btl_set_state(BATTLE_STATE_SWITCH_TO_PLAYER); } else { sfx_play_sound(SOUND_MENU_ERROR); @@ -3759,11 +3756,12 @@ void btl_state_update_partner_menu(void) { } break; } + if (D_802ACC60 != 0) { D_802ACC60--; - } else if (numOptions != 0) { - set_animation(ACTOR_PARTNER, 0, D_802AB558[playerData->currentPartner]); - battleStatus->unk_5C[0] = battleStatus->unk_4A = battle_menu_submenuIDs[numOptions - 1]; + } else if (entryIdx != 0) { + set_animation(ACTOR_PARTNER, 0, BattleMenu_PartnerIdleAnims[playerData->currentPartner]); + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] = battleStatus->unk_4A = battle_menu_submenuIDs[entryIdx - 1]; if (battleStatus->unk_4A == 7) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_1; btl_state_update_partner_menu(); @@ -3793,23 +3791,23 @@ void btl_state_update_partner_menu(void) { } break; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_3: - numOptions = func_802A11B0(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && numOptions == 0) { + entryIdx = btl_main_menu_update(); + if ((battleStatus->currentButtonsPressed & BUTTON_B) && entryIdx == 0) { func_802A1078(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_4; return; } - if (numOptions != 0) { - battleStatus->moveCategory = BTL_MENU_TYPE_8; + if (entryIdx != 0) { + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->selectedMoveID = MOVE_FOCUS; - battleStatus->selectedItemID = 0; + battleStatus->moveArgument = 0; battleStatus->currentTargetListFlags = gMoveTable[MOVE_FOCUS].flags; btl_set_state(BATTLE_STATE_SELECT_TARGET); return; } break; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_4: - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { D_802ACC60 = 8; D_802ACC6C = 4; gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1; @@ -3820,7 +3818,7 @@ void btl_state_update_partner_menu(void) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_4; break; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_6: - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_7: if (can_btl_state_update_switch_to_player() == 0) { @@ -3843,29 +3841,29 @@ void btl_state_update_partner_menu(void) { for (i = 0; i < battleStatus->submenuMoveCount; i++) { moveData = &gMoveTable[battleStatus->submenuMoves[i]]; - battle_menu_moveOptionCantUseTypes[i] = 0; + BattleMenu_Moves_OptionCantUseMessages[i] = 0; if (battleStatus->submenuStatus[i] == 0) { - battle_menu_moveOptionCantUseTypes[i] = 0; + BattleMenu_Moves_OptionCantUseMessages[i] = 0; } if (battleStatus->submenuStatus[i] == -1) { battleStatus->submenuStatus[i] = 0; - battle_menu_moveOptionCantUseTypes[i] = 0x48; + BattleMenu_Moves_OptionCantUseMessages[i] = BTL_MSG_48; } if (battleStatus->submenuStatus[i] == -2) { battleStatus->submenuStatus[i] = 0; - battle_menu_moveOptionCantUseTypes[i] = 0x48; + BattleMenu_Moves_OptionCantUseMessages[i] = BTL_MSG_48; } battle_menu_moveOptionIconScripts[i] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][2 * i + 2]; if (battleStatus->submenuStatus[i] == 0) { battle_menu_moveOptionIconScripts[i] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][2 * i + 3]; } - battle_menu_moveIndices[i] = battleStatus->submenuMoves[i]; - battle_menu_moveOptionsEnabled[i] = battleStatus->submenuStatus[i]; + BattleMenu_Moves_OptionIndices[i] = battleStatus->submenuMoves[i]; + BattleMenu_Moves_OptionEnabled[i] = battleStatus->submenuStatus[i]; battle_menu_moveOptionNames[i] = moveData->nameMsg; - battle_menu_moveOptionDescriptions[i] = moveData->shortDescMsg; + BattleMenu_Moves_OptionDescMessages[i] = moveData->shortDescMsg; battle_menu_moveOptionDisplayCosts[i] = moveData->costFP; battle_menu_moveOptionBPCosts[i] = moveData->costBP; - battle_menu_moveOptionSortPriorities[i] = i; + BattleMenu_Moves_OptionSortPriority[i] = i; battle_menu_moveOptionDisplayCostReductions[i] = 0; battle_menu_moveOptionDisplayCostReductionColors[i] = 0; @@ -3878,22 +3876,22 @@ void btl_state_update_partner_menu(void) { battle_menu_moveOptionDisplayCostReductionColors[i] = 2; } } - if (battleStatus->unk_5C[1] < 0) { - battleStatus->unk_5C[1] = 0; + if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_ABILITY] < 0) { + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_ABILITY] = 0; } - battle_menu_hasSpiritsMenu = 0; - battle_menu_moveOptionCount = battleStatus->submenuMoveCount; - s1 = battleStatus->unk_5C[1]; - D_802AD4A8 = s1; + BattleMenu_UsingSpiritsSubmenu = FALSE; + BattleMenu_Moves_OptionCount = battleStatus->submenuMoveCount; + initialPos = battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_ABILITY]; + D_802AD4A8 = initialPos; func_802A2684(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_2; break; case BTL_SUBSTATE_PARTNER_MENU_ABILITIES_2: - numOptions = func_802A2C84(); - if (numOptions == -1) { + entryIdx = btl_submenu_moves_update(); + if (entryIdx == -1) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_7; - } else if (numOptions != 0) { - if (numOptions == 255) { + } else if (entryIdx != 0) { + if (entryIdx == 255) { func_802A1050(); D_802ACC60 = 8; D_802ACC6C = 4; @@ -3901,7 +3899,7 @@ void btl_state_update_partner_menu(void) { btl_state_update_partner_menu(); btl_state_update_partner_menu(); } else { - battleStatus->unk_4B = numOptions - 1; + battleStatus->unk_4B = entryIdx - 1; func_802A27D0(); func_802A1030(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_3; @@ -3909,24 +3907,24 @@ void btl_state_update_partner_menu(void) { } break; case BTL_SUBSTATE_PARTNER_MENU_ABILITIES_3: - numOptions = func_802A2C84(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && numOptions == 0) { + entryIdx = btl_submenu_moves_update(); + if ((battleStatus->currentButtonsPressed & BUTTON_B) && entryIdx == 0) { func_802A2AB8(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_4; - } else if (func_802A11B0() != 0) { - battleStatus->moveCategory = BTL_MENU_TYPE_6; - battleStatus->selectedMoveID = battle_menu_moveIndices[battleStatus->unk_4B]; + } else if (btl_main_menu_update() != 0) { + battleStatus->moveCategory = BTL_MENU_TYPE_ABILITY; + battleStatus->selectedMoveID = BattleMenu_Moves_OptionIndices[battleStatus->unk_4B]; battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; - battleStatus->unk_5C[1] = battle_menu_moveOptionActive; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_ABILITY] = battle_menu_moveOptionActive; battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_6; - btl_set_state(0x11); + btl_set_state(BATTLE_STATE_SELECT_TARGET); } break; case BTL_SUBSTATE_PARTNER_MENU_ABILITIES_4: - func_802A2C84(); - if (func_802A11B0() != 0) { + btl_submenu_moves_update(); + if (btl_main_menu_update() != 0) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_2; } break; @@ -3937,10 +3935,10 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_ABILITIES_6: func_802A27E4(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PARTNER_MENU_ABILITIES_7: - if (func_802A2C84() != -1) { + if (btl_submenu_moves_update() != -1) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_2; } break; @@ -3965,15 +3963,15 @@ void btl_state_update_partner_menu(void) { popupMenu->descMsg[popupIndex] = item->shortDescMsg; popupIndex++; } - if (battleStatus->unk_5C[4] < 0) { - battleStatus->unk_5C[4] = 0; + if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER_ITEM] < 0) { + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER_ITEM] = 0; } popupMenu->popupType = POPUP_MENU_USE_ITEM; popupMenu->numEntries = popupIndex; - popupMenu->unk_31C = 0; - popupMenu->unk_320 = 0; - s1 = battleStatus->unk_5C[4]; - popupMenu->initialPos = s1; + popupMenu->dipMode = 0; + popupMenu->titleNumber = 0; + initialPos = battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER_ITEM]; + popupMenu->initialPos = initialPos; func_800F513C(popupMenu); func_800F52BC(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ITEMS_2; @@ -3991,11 +3989,11 @@ void btl_state_update_partner_menu(void) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_ITEMS_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_ITEMS_6; battleStatus->unk_1AA = popupMenu->userIndex[popupMenu->result - 1]; - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = battleStatus->unk_1AA; - battleStatus->currentTargetListFlags = gItemTable[battleStatus->selectedItemID].targetFlags | ITEM_TARGET_FLAG_8000; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = battleStatus->unk_1AA; + battleStatus->currentTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | ITEM_TARGET_FLAG_8000; battleStatus->currentAttackElement = 0; - battleStatus->unk_5C[4] = popupMenu->result - 1; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER_ITEM] = popupMenu->result - 1; hide_popup_menu(); func_802A1030(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ITEMS_3; @@ -4007,12 +4005,12 @@ void btl_state_update_partner_menu(void) { func_800F16CC(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ITEMS_4; - } else if (func_802A11B0() != 0) { + } else if (btl_main_menu_update() != 0) { btl_set_state(BATTLE_STATE_SELECT_TARGET); } break; case BTL_SUBSTATE_PARTNER_MENU_ITEMS_4: - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ITEMS_2; } break; @@ -4023,7 +4021,7 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_ITEMS_6: destroy_popup_menu(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_1: popupIndex = 0; @@ -4044,14 +4042,14 @@ void btl_state_update_partner_menu(void) { popupIndex++; } } - if (battleStatus->unk_5C[5] < 0) { - battleStatus->unk_5C[5] = 0; + if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] < 0) { + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] = 0; } popupMenu->popupType = POPUP_MENU_SWITCH_PARTNER; popupMenu->numEntries = popupIndex; popupMenu->initialPos = D_8008EEF0[playerData->currentPartner] - 1; - popupMenu->unk_31C = 0; - popupMenu->unk_320 = 0; + popupMenu->dipMode = 0; + popupMenu->titleNumber = 0; func_800F513C(popupMenu); func_800F52BC(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_2; @@ -4071,11 +4069,11 @@ void btl_state_update_partner_menu(void) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_6; battleStatus->unk_1AC = popupMenu->userIndex[popupMenu->result - 1]; - battleStatus->moveCategory = BTL_MENU_TYPE_5; + battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; battleStatus->selectedMoveID = MOVE_UNUSED_37; battleStatus->currentTargetListFlags = ITEM_TARGET_FLAG_2; - battleStatus->selectedItemID = battleStatus->unk_1AC; - battleStatus->unk_5C[5] = popupMenu->result - 1; + battleStatus->moveArgument = battleStatus->unk_1AC; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] = popupMenu->result - 1; hide_popup_menu(); func_802A1030(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_3; @@ -4087,14 +4085,14 @@ void btl_state_update_partner_menu(void) { func_800F16CC(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_4; - } else if (func_802A11B0() != 0) { + } else if (btl_main_menu_update() != 0) { gBattleSubState = battleStatus->acceptTargetMenuSubstate; btl_state_update_partner_menu(); btl_set_state(BATTLE_STATE_CHANGE_PARTNER); } break; case BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_4: - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_2; } break; @@ -4105,7 +4103,7 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_6: destroy_popup_menu(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_7: if (popupMenu->result != -1) { @@ -4113,41 +4111,41 @@ void btl_state_update_partner_menu(void) { } break; case BTL_SUBSTATE_PARTNER_MENU_FOCUS_1: - numOptions = 1; + entryIdx = 1; battleStatus->submenuMoves[0] = MOVE_FOCUS; - battleStatus->submenuMoveCount = numOptions; + battleStatus->submenuMoveCount = entryIdx; battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK; battleStatus->submenuStatus[0] = 1; for (i = 0; i < battleStatus->submenuMoveCount; i++) { moveData = &gMoveTable[battleStatus->submenuMoves[i]]; - battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[(battleStatus->submenuMoves[i] - MOVE_FOCUS) * 2 + 0]; + battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * STAR_POWER_INDEX(battleStatus->submenuMoves[i]) + 0]; if (battleStatus->submenuStatus[i] == 0) { - battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[(battleStatus->submenuMoves[i] - MOVE_FOCUS) * 2 + 1]; + battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * STAR_POWER_INDEX(battleStatus->submenuMoves[i]) + 1]; } battle_menu_moveOptionDisplayCosts[i] = moveData->costFP; battle_menu_moveOptionBPCosts[i] = moveData->costBP; - battle_menu_moveIndices[i] = i; - battle_menu_moveOptionSortPriorities[i] = i; - battle_menu_moveOptionsEnabled[i] = battleStatus->submenuStatus[i]; + BattleMenu_Moves_OptionIndices[i] = i; + BattleMenu_Moves_OptionSortPriority[i] = i; + BattleMenu_Moves_OptionEnabled[i] = battleStatus->submenuStatus[i]; battle_menu_moveOptionNames[i] = moveData->nameMsg; - battle_menu_moveOptionDescriptions[i] = moveData->shortDescMsg; + BattleMenu_Moves_OptionDescMessages[i] = moveData->shortDescMsg; battle_menu_moveOptionDisplayCostReductions[i] = 0; battle_menu_moveOptionDisplayCostReductionColors[i] = 0; } - if (battleStatus->unk_5C[6] < 0) { - battleStatus->unk_5C[6] = 0; + if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STAR_POWER] < 0) { + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STAR_POWER] = 0; } - battle_menu_hasSpiritsMenu = 1; - battle_menu_moveOptionCount = battleStatus->submenuMoveCount; - s1 = battleStatus->unk_5C[6]; - D_802AD4A8 = s1; + BattleMenu_UsingSpiritsSubmenu = TRUE; + BattleMenu_Moves_OptionCount = battleStatus->submenuMoveCount; + initialPos = battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STAR_POWER]; + D_802AD4A8 = initialPos; func_802A2684(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_FOCUS_2; break; case BTL_SUBSTATE_PARTNER_MENU_FOCUS_2: - numOptions = func_802A2C84(); - if (numOptions != 0) { - if (numOptions == 255) { + entryIdx = btl_submenu_moves_update(); + if (entryIdx != 0) { + if (entryIdx == 255) { func_802A1050(); D_802ACC60 = 8; D_802ACC6C = 4; @@ -4155,7 +4153,7 @@ void btl_state_update_partner_menu(void) { btl_state_update_partner_menu(); btl_state_update_partner_menu(); } else { - battleStatus->unk_4B = battle_menu_moveIndices[numOptions - 1]; + battleStatus->unk_4B = BattleMenu_Moves_OptionIndices[entryIdx - 1]; func_802A27D0(); func_802A1030(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_FOCUS_3; @@ -4163,25 +4161,25 @@ void btl_state_update_partner_menu(void) { } break; case BTL_SUBSTATE_PARTNER_MENU_FOCUS_3: - numOptions = func_802A2C84(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && (numOptions == 0)) { + entryIdx = btl_submenu_moves_update(); + if ((battleStatus->currentButtonsPressed & BUTTON_B) && (entryIdx == 0)) { func_802A2AB8(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_FOCUS_4; - } else if (func_802A11B0() != 0) { + } else if (btl_main_menu_update() != 0) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_FOCUS_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_FOCUS_6; - battleStatus->moveCategory = BTL_MENU_TYPE_8; + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_4B]; battleStatus->currentTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_4B]].flags; - battleStatus->selectedItemID = battleStatus->unk_4B; - battleStatus->unk_5C[6] = battle_menu_moveOptionActive; + battleStatus->moveArgument = battleStatus->unk_4B; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STAR_POWER] = battle_menu_moveOptionActive; btl_set_state(BATTLE_STATE_SELECT_TARGET); } break; case BTL_SUBSTATE_PARTNER_MENU_FOCUS_4: - func_802A2C84(); - if (func_802A11B0() != 0) { + btl_submenu_moves_update(); + if (btl_main_menu_update() != 0) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_FOCUS_2; } break; @@ -4192,14 +4190,14 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_FOCUS_6: func_802A27E4(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_1: popupIndex = 0; func_80263268(); if (battleStatus->changePartnerAllowed >= 0) { - D_802AD678[popupIndex] = 5; - D_802AD658[popupIndex] = battle_menu_leftJustfiedMessagesB[0]; + D_802AD678[popupIndex] = BTL_MENU_TYPE_CHANGE_PARTNER; + D_802AD658[popupIndex] = BattleMenu_LeftJustMessages[BTL_MENU_TYPE_CHANGE_PARTNER]; D_802AD640[popupIndex] = battle_menu_PartnerHudScripts[playerData->currentPartner]; D_802AD690[popupIndex] = 1; D_802AD6C0[popupIndex] = MSG_Menus_Action_ChangePartner; @@ -4211,25 +4209,25 @@ void btl_state_update_partner_menu(void) { popupIndex++; } D_802AD640[popupIndex] = battle_menu_DoNothingHudScripts.enabled; - D_802AD678[popupIndex] = 9; + D_802AD678[popupIndex] = BTL_MENU_TYPE_DO_NOTHING; D_802AD690[popupIndex] = 1; - D_802AD658[popupIndex] = battle_menu_leftJustfiedMessagesC[0]; + D_802AD658[popupIndex] = BattleMenu_LeftJustMessages[BTL_MENU_TYPE_DO_NOTHING]; D_802AD6C0[popupIndex] = MSG_Menus_Action_DoNothing; popupIndex++; - if (battleStatus->unk_5C[7] < 0) { - battleStatus->unk_5C[7] = 0; + if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STRATEGY] < 0) { + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STRATEGY] = 0; } D_802AD66C = popupIndex; - s1 = battleStatus->unk_5C[7]; - D_802AD670 = s1; + initialPos = battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STRATEGY]; + D_802AD670 = initialPos; func_802A45D8(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_2; break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_2: - numOptions = func_802A4A54(); - if (numOptions != 0) { - if (numOptions == 255) { + entryIdx = func_802A4A54(); + if (entryIdx != 0) { + if (entryIdx == 255) { func_802A1050(); D_802ACC60 = 8; D_802ACC6C = 4; @@ -4237,8 +4235,8 @@ void btl_state_update_partner_menu(void) { btl_state_update_partner_menu(); btl_state_update_partner_menu(); } else { - battleStatus->unk_4A = D_802AD678[numOptions - 1]; - battleStatus->unk_5C[7] = numOptions - 1; + battleStatus->unk_4A = D_802AD678[entryIdx - 1]; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STRATEGY] = entryIdx - 1; if (battleStatus->unk_4A == 5) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_1; btl_state_update_partner_menu(); @@ -4252,16 +4250,16 @@ void btl_state_update_partner_menu(void) { } break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_3: - numOptions = func_802A4A54(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && numOptions == 0) { + entryIdx = func_802A4A54(); + if ((battleStatus->currentButtonsPressed & BUTTON_B) && entryIdx == 0) { func_802A48FC(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_4; - } else if (func_802A11B0() != 0) { + } else if (btl_main_menu_update() != 0) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_6; - numOptions = battleStatus->unk_4A; - switch (numOptions) { + entryIdx = battleStatus->unk_4A; + switch (entryIdx) { case 9: gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_6; btl_state_update_partner_menu(); @@ -4270,7 +4268,7 @@ void btl_state_update_partner_menu(void) { case 3: gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_6; btl_state_update_partner_menu(); - battleStatus->moveCategory = numOptions; + battleStatus->moveCategory = entryIdx; battleStatus->selectedMoveID = MOVE_UNUSED_39; btl_set_state(BATTLE_STATE_RUN_AWAY); break; @@ -4284,7 +4282,7 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_4: func_802A4A54(); - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { D_802ACC60 = 8; D_802ACC6C = 4; gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1; @@ -4297,7 +4295,7 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_6: func_802A472C(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_1: popupIndex = 0; @@ -4318,14 +4316,14 @@ void btl_state_update_partner_menu(void) { popupIndex++; } } - if (battleStatus->unk_5C[5] < 0) { - battleStatus->unk_5C[5] = 0; + if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] < 0) { + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] = 0; } popupMenu->popupType = POPUP_MENU_SWITCH_PARTNER; popupMenu->numEntries = popupIndex; popupMenu->initialPos = D_8008EEF0[playerData->currentPartner] - 1; - popupMenu->unk_31C = 0; - popupMenu->unk_320 = 0; + popupMenu->dipMode = 0; + popupMenu->titleNumber = 0; func_800F513C(popupMenu); func_800F52BC(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_2; @@ -4343,11 +4341,11 @@ void btl_state_update_partner_menu(void) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_6; battleStatus->unk_1AC = popupMenu->userIndex[popupMenu->result - 1]; - battleStatus->moveCategory = BTL_MENU_TYPE_5; + battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; battleStatus->selectedMoveID = MOVE_UNUSED_37; battleStatus->currentTargetListFlags = ITEM_TARGET_FLAG_2; - battleStatus->selectedItemID = battleStatus->unk_1AC; - battleStatus->unk_5C[5] = popupMenu->result - 1; + battleStatus->moveArgument = battleStatus->unk_1AC; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] = popupMenu->result - 1; hide_popup_menu(); func_802A4718(); func_802A1030(); @@ -4363,7 +4361,7 @@ void btl_state_update_partner_menu(void) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_4; } else { func_802A4A54(); - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { gBattleSubState = battleStatus->acceptTargetMenuSubstate; btl_state_update_partner_menu(); btl_set_state(BATTLE_STATE_CHANGE_PARTNER); @@ -4372,7 +4370,7 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_4: func_802A4A54(); - if (func_802A11B0() != 0) { + if (btl_main_menu_update() != 0) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_2; } break; @@ -4385,7 +4383,7 @@ void btl_state_update_partner_menu(void) { case BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_6: destroy_popup_menu(); func_802A472C(); - func_802A10B8(); + btl_main_menu_destroy(); break; case BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_7: set_window_update(WINDOW_ID_6, WINDOW_UPDATE_HIDE); @@ -4402,7 +4400,7 @@ void btl_state_update_partner_menu(void) { void btl_state_draw_partner_menu(void) { switch (gBattleSubState) { case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_2: case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_3: @@ -4439,52 +4437,55 @@ void btl_state_draw_partner_menu(void) { case BTL_SUBSTATE_PARTNER_MENU_FOCUS_6: case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_1: case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_2: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_3: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_4: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_5: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_6: - btl_draw_menu_wheel(); + btl_main_menu_draw(); break; } } -s32 func_802A9B30(void) { - return (gBattleStatus.flags2 & BS_FLAGS2_4) <= 0; +s32 btl_menu_show_switch_to_twink(void) { + if (gBattleStatus.flags2 & BS_FLAGS2_4) { + return FALSE; + } + return TRUE; } void btl_state_update_peach_menu(void) { BattleStatus* battleStatus = &gBattleStatus; Actor* player = battleStatus->playerActor; Actor* partner = battleStatus->partnerActor; - s32 temp_s0_2; - s32 s1; - s32 s0; + s32 selectedOption; + s32 initialPos; + s32 entryIdx; switch (gBattleSubState) { - case BTL_SUBSTATE_PEACH_MENU_UNK_0: + case BTL_SUBSTATE_PEACH_MENU_INIT: btl_cam_use_preset(BTL_CAM_PRESET_C); btl_cam_move(10); - if (!(gBattleStatus.flags1 & BS_FLAGS1_100000)) { - gBattleSubState = BTL_SUBSTATE_PEACH_MENU_UNK_B; + if (!(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { + gBattleSubState = BTL_SUBSTATE_PEACH_CREATE_MAIN_MENU; break; } player->state.currentPos.x = player->homePos.x; player->state.currentPos.z = player->homePos.z; - gBattleSubState = BTL_SUBSTATE_PEACH_MENU_UNK_A; + gBattleSubState = BTL_SUBSTATE_PEACH_MENU_PERFORM_SWAP; player->state.goalPos.x = partner->homePos.x; player->state.goalPos.z = partner->homePos.z; player->state.moveTime = 4; player->state.angle = 0.0f; break; - case BTL_SUBSTATE_PEACH_MENU_UNK_A: + case BTL_SUBSTATE_PEACH_MENU_PERFORM_SWAP: if (player->state.moveTime != 0) { player->currentPos.x += (player->state.goalPos.x - player->currentPos.x) / player->state.moveTime; player->currentPos.z += (player->state.goalPos.z - player->currentPos.z) / player->state.moveTime; @@ -4511,90 +4512,92 @@ void btl_state_update_peach_menu(void) { player->homePos.z = player->currentPos.z; partner->homePos.x = partner->currentPos.x; partner->homePos.z = partner->currentPos.z; - gBattleStatus.flags1 &= ~BS_FLAGS1_100000; - case BTL_SUBSTATE_PEACH_MENU_UNK_B: - gBattleStatus.flags1 |= BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK; + case BTL_SUBSTATE_PEACH_CREATE_MAIN_MENU: + gBattleStatus.flags1 |= BS_FLAGS1_MENU_OPEN; player->flags &= ~ACTOR_FLAG_4000000; player->flags |= ACTOR_FLAG_8000000; if (partner != NULL) { partner->flags |= ACTOR_FLAG_4000000; partner->flags |= ACTOR_FLAG_8000000; } - battleStatus->selectedMoveID = 0; - battle_menu_submenuIDs[0] = 8; - battle_menu_isEnabled[0] = TRUE; - battle_menu_isMessageDisabled[0] = 0; - main_battle_menu_JumpHudScripts[0] = battle_menu_PeachStarPowerHudScripts.enabled; - battle_menu_messageIDs[0] = D_802AB728[0]; - if (!(battleStatus->menuDisableFlags & 0x100)) { - battle_menu_isEnabled[0] = FALSE; - battle_menu_isMessageDisabled[0] = 0x48; - main_battle_menu_JumpHudScripts[0] = battle_menu_PeachStarPowerHudScripts.disabled; + + entryIdx = 0; + battleStatus->selectedMoveID = MOVE_NONE; + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_STAR_POWERS; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + battle_menu_isMessageDisabled[entryIdx] = 0; + BattleMenu_HudScripts[entryIdx] = battle_menu_PeachStarPowerHudScripts.enabled; + BattleMenu_TitleMessages[entryIdx] = D_802AB728[entryIdx]; + if (!(battleStatus->menuDisableFlags & BTL_MENU_DISABLED_STAR_POWERS)) { + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; + BattleMenu_HudScripts[entryIdx] = battle_menu_PeachStarPowerHudScripts.disabled; } - s1 = 0; - s0 = 1; + initialPos = 0; + entryIdx++; - if (func_802A9B30()) { - D_802AD104 = TRUE; + if (btl_menu_show_switch_to_twink()) { + BattleMenu_ShowSwapIcons = TRUE; } else { - D_802AD104 = FALSE; + BattleMenu_ShowSwapIcons = FALSE; } - main_menu_numOptions = s0; + BattleMenu_NumOptions = entryIdx; D_802AD0A8 = 0; - D_802AD0B0 = s1; - D_802AD100 = 2 - s1; + D_802AD0B0 = initialPos; + D_802AD100 = 2 - initialPos; - func_802A1000(); + btl_main_menu_init(); D_802ACC60 = 8; - gBattleSubState = BTL_SUBSTATE_PEACH_MENU_UNK_1; + gBattleSubState = BTL_SUBSTATE_PEACH_MENU_CHOOSE_CATEGORY; break; - case BTL_SUBSTATE_PEACH_MENU_UNK_1: + case BTL_SUBSTATE_PEACH_MENU_CHOOSE_CATEGORY: set_animation(ACTOR_PLAYER, 0, ANIM_Peach_C0009); - temp_s0_2 = func_802A11B0(); + selectedOption = btl_main_menu_update(); if (D_802ACC60 != 0) { D_802ACC60--; break; } - if (temp_s0_2 != 0) { + if (selectedOption != 0) { set_animation(ACTOR_PLAYER, 0, ANIM_Peach_A0002); - battleStatus->currentSubmenu = battle_menu_submenuIDs[temp_s0_2 - 1]; + battleStatus->currentSubmenu = battle_menu_submenuIDs[selectedOption - 1]; func_802A1030(); D_802ACC60 = 8; D_802ACC6C = 4; - gBattleSubState = BTL_SUBSTATE_PEACH_MENU_UNK_2; + gBattleSubState = BTL_SUBSTATE_PEACH_MENU_CHOOSE_TARGET; } break; - case BTL_SUBSTATE_PEACH_MENU_UNK_2: - if (func_802A11B0() != 0) { - battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PEACH_MENU_UNK_4; - battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PEACH_MENU_UNK_5; - battleStatus->moveCategory = BTL_MENU_TYPE_8; - battleStatus->selectedMoveID = MOVE_PEACH_FOCUS; - battleStatus->selectedItemID = ITEM_FIRST_DEGREE_CARD; + case BTL_SUBSTATE_PEACH_MENU_CHOOSE_TARGET: + if (btl_main_menu_update() != 0) { + battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PEACH_MENU_TARGET_CANCEL; + battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PEACH_MENU_TARGET_CHOSEN; battleStatus->currentTargetListFlags = gMoveTable[MOVE_PEACH_FOCUS].flags; + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; + battleStatus->selectedMoveID = MOVE_PEACH_FOCUS; + battleStatus->moveArgument = STAR_POWER_INDEX(MOVE_PEACH_FOCUS); btl_set_state(BATTLE_STATE_SELECT_TARGET); } break; - case BTL_SUBSTATE_PEACH_MENU_UNK_4: + case BTL_SUBSTATE_PEACH_MENU_TARGET_CANCEL: func_802A1050(); - gBattleSubState = BTL_SUBSTATE_PEACH_MENU_UNK_1; + gBattleSubState = BTL_SUBSTATE_PEACH_MENU_CHOOSE_CATEGORY; btl_state_update_peach_menu(); btl_state_update_peach_menu(); break; - case BTL_SUBSTATE_PEACH_MENU_UNK_5: - func_802A10B8(); + case BTL_SUBSTATE_PEACH_MENU_TARGET_CHOSEN: + btl_main_menu_destroy(); break; - case BTL_SUBSTATE_PEACH_MENU_UNK_8: + case BTL_SUBSTATE_PEACH_MENU_SHOW_CANT_SWITCH: btl_show_variable_battle_message(BTL_MSG_50, 60, 0); D_802AD607 = 1; - gBattleSubState = BTL_SUBSTATE_PEACH_MENU_UNK_9; + gBattleSubState = BTL_SUBSTATE_PEACH_MENU_AWAIT_CANT_SWITCH_POPUP; break; - case BTL_SUBSTATE_PEACH_MENU_UNK_9: + case BTL_SUBSTATE_PEACH_MENU_AWAIT_CANT_SWITCH_POPUP: if (!btl_is_popup_displayed()) { D_802AD607 = 0; D_802ACC60 = 0; - gBattleSubState = BTL_SUBSTATE_PEACH_MENU_UNK_1; + gBattleSubState = BTL_SUBSTATE_PEACH_MENU_CHOOSE_CATEGORY; } break; } @@ -4602,33 +4605,36 @@ void btl_state_update_peach_menu(void) { void btl_state_draw_peach_menu(void) { switch (gBattleSubState) { - case BTL_SUBSTATE_PEACH_MENU_UNK_1: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_PEACH_MENU_CHOOSE_CATEGORY: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_PEACH_MENU_UNK_2: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_PEACH_MENU_CHOOSE_TARGET: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_PEACH_MENU_UNK_3: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_PEACH_MENU_UNUSED_3: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_PEACH_MENU_UNK_4: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_PEACH_MENU_TARGET_CANCEL: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_PEACH_MENU_UNK_5: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_PEACH_MENU_TARGET_CHOSEN: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_PEACH_MENU_UNK_6: - case BTL_SUBSTATE_PEACH_MENU_UNK_7: - case BTL_SUBSTATE_PEACH_MENU_UNK_8: - case BTL_SUBSTATE_PEACH_MENU_UNK_9: + case BTL_SUBSTATE_PEACH_MENU_UNUSED_6: + case BTL_SUBSTATE_PEACH_MENU_UNUSED_7: + case BTL_SUBSTATE_PEACH_MENU_SHOW_CANT_SWITCH: + case BTL_SUBSTATE_PEACH_MENU_AWAIT_CANT_SWITCH_POPUP: break; } } static const f32 padding2 = 0.0f; -s32 func_802AA0A4(void) { - return (gBattleStatus.flags2 & 2) <= 0; +s32 btl_menu_show_switch_to_peach(void) { + if (gBattleStatus.flags2 & BS_FLAGS2_2) { + return FALSE; + } + return TRUE; } void btl_state_update_twink_menu(void) { @@ -4636,11 +4642,11 @@ void btl_state_update_twink_menu(void) { Actor* player = battleStatus->playerActor; Actor* partner = battleStatus->partnerActor; s32 s1; - s32 temp_s0_2; + s32 selection; s32 var_v0_2; s32 shouldSkipTurn; - s32 z; - s32 s0; + s32 initialPos; + s32 entryIdx; switch (gBattleSubState) { case BTL_SUBSTATE_TWINK_MENU_INIT: @@ -4677,7 +4683,7 @@ void btl_state_update_twink_menu(void) { btl_cam_use_preset(BTL_CAM_PRESET_C); btl_cam_move(10); - if (!(gBattleStatus.flags1 & BS_FLAGS1_100000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { player->state.currentPos.x = player->homePos.x; player->state.currentPos.z = player->homePos.z; player->state.goalPos.x = partner->homePos.x; @@ -4687,7 +4693,7 @@ void btl_state_update_twink_menu(void) { player->state.angle = 0.0f; break; } - gBattleSubState = BTL_SUBSTATE_TWINK_MENU_UNK_B; + gBattleSubState = BTL_SUBSTATE_TWINK_MENU_CREATE_MAIN_MENU; break; case BTL_SUBSTATE_TWINK_MENU_PERFORM_SWAP: if (player->state.moveTime != 0) { @@ -4713,80 +4719,81 @@ void btl_state_update_twink_menu(void) { player->homePos.z = player->currentPos.z; partner->homePos.x = partner->currentPos.x; partner->homePos.z = partner->currentPos.z; - gBattleStatus.flags1 |= BS_FLAGS1_100000; - case BTL_SUBSTATE_TWINK_MENU_UNK_B: - gBattleStatus.flags1 |= BS_FLAGS1_2; + gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK; + case BTL_SUBSTATE_TWINK_MENU_CREATE_MAIN_MENU: + gBattleStatus.flags1 |= BS_FLAGS1_MENU_OPEN; player->flags &= ~ACTOR_FLAG_4000000; player->flags |= ACTOR_FLAG_8000000; if (partner != NULL) { partner->flags |= ACTOR_FLAG_4000000; partner->flags |= ACTOR_FLAG_8000000; } + + entryIdx = 0; battleStatus->selectedMoveID = MOVE_NONE; - battle_menu_submenuIDs[0] = 8; - battle_menu_isEnabled[0] = TRUE; - battle_menu_isMessageDisabled[0] = 0; - main_battle_menu_JumpHudScripts[0] = battle_menu_TwinkStarPowerHudScripts[0]; - - battle_menu_messageIDs[0] = D_802AB734[0]; - - if (!(battleStatus->menuDisableFlags & 0x100)) { - battle_menu_isEnabled[0] = FALSE; - battle_menu_isMessageDisabled[0] = BTL_MSG_48; - main_battle_menu_JumpHudScripts[0] = battle_menu_TwinkStarPowerHudScripts[1]; + battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_STAR_POWERS; + BattleMenu_OptionEnabled[entryIdx] = TRUE; + battle_menu_isMessageDisabled[entryIdx] = 0; + BattleMenu_HudScripts[entryIdx] = battle_menu_TwinkStarPowerHudScripts.enabled; + BattleMenu_TitleMessages[entryIdx] = D_802AB734[entryIdx]; + if (!(battleStatus->menuDisableFlags & BTL_MENU_DISABLED_STAR_POWERS)) { + BattleMenu_OptionEnabled[entryIdx] = FALSE; + battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_48; + BattleMenu_HudScripts[entryIdx] = battle_menu_TwinkStarPowerHudScripts.disabled; } - z = 0; - s0 = 1; - if (func_802AA0A4()) { - D_802AD104 = TRUE; + initialPos = 0; + entryIdx++; + + if (btl_menu_show_switch_to_peach()) { + BattleMenu_ShowSwapIcons = TRUE; } else { - D_802AD104 = FALSE; + BattleMenu_ShowSwapIcons = FALSE; } - main_menu_numOptions = s0; + BattleMenu_NumOptions = entryIdx; D_802AD0A8 = 0; - D_802AD0B0 = z; - D_802AD100 = 2 - z; + D_802AD0B0 = initialPos; + D_802AD100 = 2 - initialPos; - func_802A1000(); + btl_main_menu_init(); D_802ACC60 = 8; - gBattleSubState = BTL_SUBSTATE_TWINK_MENU_UNK_1; + gBattleSubState = BTL_SUBSTATE_TWINK_MENU_CHOOSE_CATEGORY; break; - case BTL_SUBSTATE_TWINK_MENU_UNK_1: + case BTL_SUBSTATE_TWINK_MENU_CHOOSE_CATEGORY: set_animation(ACTOR_PARTNER, 0, ANIM_Twink_Idle); - temp_s0_2 = func_802A11B0(); + selection = btl_main_menu_update(); if (D_802ACC60 != 0) { D_802ACC60--; break; } - if (temp_s0_2 != 0) { + if (selection != 0) { set_animation(ACTOR_PARTNER, 0, ANIM_Twink_Angry); - battleStatus->currentSubmenu = battle_menu_submenuIDs[temp_s0_2 - 1]; + battleStatus->currentSubmenu = battle_menu_submenuIDs[selection - 1]; func_802A1030(); D_802ACC60 = 8; D_802ACC6C = 4; - gBattleSubState = BTL_SUBSTATE_TWINK_MENU_UNK_2; + gBattleSubState = BTL_SUBSTATE_TWINK_MENU_CHOOSE_TARGET; } break; - case BTL_SUBSTATE_TWINK_MENU_UNK_2: - if (func_802A11B0() != 0) { - battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_TWINK_MENU_UNK_4; - battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_TWINK_MENU_UNK_5; - battleStatus->moveCategory = BTL_MENU_TYPE_8; + case BTL_SUBSTATE_TWINK_MENU_CHOOSE_TARGET: + if (btl_main_menu_update() != 0) { + battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_TWINK_MENU_TARGET_CANCEL; + battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_TWINK_MENU_TARGET_CHOSEN; + battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->selectedMoveID = MOVE_TWINK_DASH; - battleStatus->selectedItemID = ITEM_NONE; + battleStatus->moveArgument = 0; battleStatus->currentTargetListFlags = gMoveTable[MOVE_TWINK_DASH].flags; btl_set_state(BATTLE_STATE_SELECT_TARGET); } break; - case BTL_SUBSTATE_TWINK_MENU_UNK_4: + case BTL_SUBSTATE_TWINK_MENU_TARGET_CANCEL: func_802A1050(); - gBattleSubState = BTL_SUBSTATE_TWINK_MENU_UNK_1; + gBattleSubState = BTL_SUBSTATE_TWINK_MENU_CHOOSE_CATEGORY; btl_state_update_twink_menu(); btl_state_update_twink_menu(); break; - case BTL_SUBSTATE_TWINK_MENU_UNK_5: - func_802A10B8(); + case BTL_SUBSTATE_TWINK_MENU_TARGET_CHOSEN: + btl_main_menu_destroy(); break; case BTL_SUBSTATE_TWINK_MENU_SHOW_CANT_SWITCH: btl_show_variable_battle_message(BTL_MSG_50, 60, 0); @@ -4797,7 +4804,7 @@ void btl_state_update_twink_menu(void) { if (!btl_is_popup_displayed()) { D_802AD607 = 0; D_802ACC60 = 0; - gBattleSubState = BTL_SUBSTATE_TWINK_MENU_UNK_1; + gBattleSubState = BTL_SUBSTATE_TWINK_MENU_CHOOSE_CATEGORY; } break; } @@ -4805,23 +4812,23 @@ void btl_state_update_twink_menu(void) { void btl_state_draw_twink_menu(void) { switch (gBattleSubState) { - case BTL_SUBSTATE_TWINK_MENU_UNK_1: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_TWINK_MENU_CHOOSE_CATEGORY: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_TWINK_MENU_UNK_2: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_TWINK_MENU_CHOOSE_TARGET: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_TWINK_MENU_UNK_3: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_TWINK_MENU_UNUSED_3: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_TWINK_MENU_UNK_4: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_TWINK_MENU_TARGET_CANCEL: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_TWINK_MENU_UNK_5: - btl_draw_menu_wheel(); + case BTL_SUBSTATE_TWINK_MENU_TARGET_CHOSEN: + btl_main_menu_draw(); break; - case BTL_SUBSTATE_TWINK_MENU_UNK_6: - case BTL_SUBSTATE_TWINK_MENU_UNK_7: + case BTL_SUBSTATE_TWINK_MENU_UNUSED_6: + case BTL_SUBSTATE_TWINK_MENU_UNUSED_7: case BTL_SUBSTATE_TWINK_MENU_SHOW_CANT_SWITCH: case BTL_SUBSTATE_TWINK_MENU_AWAIT_CANT_SWITCH_POPUP: break; @@ -4838,7 +4845,7 @@ void btl_state_update_select_target(void) { SelectableTarget* target; s32 i; - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { actor = battleStatus->playerActor; } else { actor = battleStatus->partnerActor; @@ -4850,10 +4857,10 @@ void btl_state_update_select_target(void) { targetIndexList = actor->targetIndexList; switch (gBattleSubState) { case BTL_SUBSTATE_SELECT_TARGET_INIT: - D_802ACC64 = 0xFF; + D_802ACC64 = 255; D_802ACC68 = -100; - gBattleStatus.flags1 &= ~BS_FLAGS1_2; - if (!is_ability_active(ABILITY_BERSERKER) || (gBattleStatus.flags1 & BS_FLAGS1_80000)) { + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; + if (!is_ability_active(ABILITY_BERSERKER) || (gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { if (battleStatus->selectedMoveID != MOVE_NONE) { s8 actionTip = gMoveTable[battleStatus->selectedMoveID].actionTip; @@ -4876,7 +4883,7 @@ void btl_state_update_select_target(void) { } if (battleStatus->currentTargetListFlags & 0x80000000) { - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { gBattleSubState = battleStatus->acceptTargetMenuSubstate; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { btl_state_update_player_menu(); @@ -4897,7 +4904,7 @@ void btl_state_update_select_target(void) { } if (targetListLength == 0) { - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { gBattleSubState = battleStatus->acceptTargetMenuSubstate; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { btl_state_update_player_menu(); @@ -4947,9 +4954,9 @@ void btl_state_update_select_target(void) { break; } - gBattleStatus.flags1 |= BS_FLAGS1_2; + gBattleStatus.flags1 |= BS_FLAGS1_MENU_OPEN; if (battleStatus->currentButtonsDown & (BUTTON_Z | BUTTON_R)) { - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; break; } @@ -4986,7 +4993,7 @@ void btl_state_update_select_target(void) { } break; case BTL_SUBSTATE_SELECT_TARGET_DONE: - gBattleStatus.flags1 &= ~BS_FLAGS1_2; + gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; target = &actor->targetData[targetIndexList[actor->selectedTargetIndex]]; actor->targetActorID = target->actorID; actor->targetPartIndex = target->partID; @@ -4994,7 +5001,7 @@ void btl_state_update_select_target(void) { hud_element_free(D_802ACC70[i]); } - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { gBattleSubState = battleStatus->acceptTargetMenuSubstate; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { btl_state_update_peach_menu(); @@ -5016,7 +5023,7 @@ void btl_state_update_select_target(void) { for (i = 0; i < targetListLength; i++) { hud_element_free(D_802ACC70[i]); } - gBattleStatus.flags1 |= BS_FLAGS1_10000 | BS_FLAGS1_2; + gBattleStatus.flags1 |= BS_FLAGS1_10000 | BS_FLAGS1_MENU_OPEN; actor->flags |= ACTOR_FLAG_8000000; if (battleStatus->itemUsesLeft != 0) { @@ -5027,7 +5034,7 @@ void btl_state_update_select_target(void) { } else { btl_state_update_player_menu(); } - } else if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { + } else if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { btl_set_state(BATTLE_STATE_PLAYER_MENU); gBattleSubState = battleStatus->cancelTargetMenuSubstate; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { @@ -5069,7 +5076,7 @@ void btl_state_draw_select_target(void) { s8* targetIndexList; s32* tmpPtr; // TODO required to match and CURSED - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { actor = battleStatus->playerActor; } else { actor = battleStatus->partnerActor; @@ -5149,7 +5156,7 @@ void btl_state_draw_select_target(void) { if (actorID == ACTOR_PLAYER) { msgWidth = get_msg_width(MSG_Menus_Battle_TargetMario, 0) + 10; } else if (actorID == ACTOR_PARTNER) { - msgWidth = get_msg_width(D_802AB738[currentPartner], 0) + 10; + msgWidth = get_msg_width(PartnerNameMessages[currentPartner], 0) + 10; } else { target = &actor->targetData[targetIndexList[selectedTargetIndex]]; anotherActor = get_actor(target->actorID); @@ -5165,7 +5172,7 @@ void btl_state_draw_select_target(void) { if (actorID == ACTOR_PLAYER) { msgWidth = get_msg_width(MSG_Menus_Battle_TargetMario, 0) + 10; } else if (actorID == ACTOR_PARTNER) { - msgWidth = get_msg_width(D_802AB738[currentPartner], 0) + 10; + msgWidth = get_msg_width(PartnerNameMessages[currentPartner], 0) + 10; } else { msgWidth = get_msg_width(MSG_Menus_Battle_TargetAllEnemies, 0) + 10; } @@ -5181,7 +5188,7 @@ void btl_state_draw_select_target(void) { if (actorID == ACTOR_PLAYER) { draw_msg(MSG_Menus_Battle_TargetMario, screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); } else if (actorID == ACTOR_PARTNER) { - draw_msg(D_802AB738[currentPartner], screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); + draw_msg(PartnerNameMessages[currentPartner], screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); } else { target = &actor->targetData[targetIndexList[selectedTargetIndex]]; anotherActor = get_actor(target->actorID); @@ -5195,11 +5202,11 @@ void btl_state_draw_select_target(void) { target = &actor->targetData[targetIndexList[selectedTargetIndex]]; actorID = target->actorID; if (actorID == ACTOR_PLAYER) { - draw_msg(0x1D00C4, screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); + draw_msg(MSG_Menus_Battle_TargetMario, screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); } else if (actorID == ACTOR_PARTNER) { - draw_msg(D_802AB738[currentPartner], screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); + draw_msg(PartnerNameMessages[currentPartner], screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); } else { - draw_msg(0x1D00C5, screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); + draw_msg(MSG_Menus_Battle_TargetAllEnemies, screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); } } } diff --git a/src/7fd10_len_b40.c b/src/7fd10_len_b40.c index 31a51b663a..4c53111d74 100644 --- a/src/7fd10_len_b40.c +++ b/src/7fd10_len_b40.c @@ -302,7 +302,7 @@ block_17: return; } create_popup_menu(popup); - set_time_freeze_mode(TIME_FREEZE_PARTNER_MENU); + set_time_freeze_mode(TIME_FREEZE_POPUP_MENU); if (*partnerActionState == PARTNER_ACTION_NONE) { set_action_state(ACTION_STATE_IDLE); } diff --git a/src/8a860_len_3f30.c b/src/8a860_len_3f30.c index 87a1a99bd8..a75f56f42f 100644 --- a/src/8a860_len_3f30.c +++ b/src/8a860_len_3f30.c @@ -1,5 +1,6 @@ #include "common.h" #include "hud_element.h" +#include "message_ids.h" extern HudScript HES_HandPointer; extern HudScript HES_StatusStarPiece; @@ -385,66 +386,66 @@ s32 popup_menu_update(void) { case POPUP_MENU_CHECK_ITEM: case POPUP_MENU_CLAIM_ITEM: case POPUP_MENU_USEKEY: - set_window_properties(WINDOW_ID_14, posX, posY, 0x91, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - if (gPopupMenu->unk_31C == 0) { - set_window_properties(WINDOW_ID_15, 0x19, -6, 0x5F, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 145, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + if (gPopupMenu->dipMode == 0) { + set_window_properties(WINDOW_ID_15, 25, -6, 95, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); } else { - set_window_properties(WINDOW_ID_15, 0xC, -6, 0x79, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_15, 12, -6, 121, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); } set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case POPUP_MENU_SWITCH_PARTNER: - set_window_properties(WINDOW_ID_14, posX, posY, 0x8B, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - set_window_properties(WINDOW_ID_17, 0xD, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 139, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + set_window_properties(WINDOW_ID_17, 13, -6, 114, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW); break; case POPUP_MENU_TRADE_FOR_BADGE: - set_window_properties(WINDOW_ID_14, posX, posY, 0xA2, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - set_window_properties(WINDOW_ID_15, 0x11, -6, 0x60, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 162, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + set_window_properties(WINDOW_ID_15, 17, -6, 96, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case POPUP_MENU_UPGRADE_PARTNER: - set_window_properties(WINDOW_ID_14, posX, posY, 0x92, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - set_window_properties(WINDOW_ID_17, 0xC, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 146, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + set_window_properties(WINDOW_ID_17, 12, -6, 114, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW); break; case POPUP_MENU_SELL_ITEM: - set_window_properties(WINDOW_ID_14, posX, posY, 0xA7, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - set_window_properties(WINDOW_ID_15, 0x16, -6, 0x5F, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 167, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + set_window_properties(WINDOW_ID_15, 22, -6, 95, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case POPUP_MENU_READ_LETTER: - set_window_properties(WINDOW_ID_14, posX, posY, 0xAA, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - set_window_properties(WINDOW_ID_15, 0x20, -6, 0x68, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 170, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + set_window_properties(WINDOW_ID_15, 32, -6, 104, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case POPUP_MENU_TAKE_FROM_CHEST: - set_window_properties(WINDOW_ID_14, posX, posY, 0x91, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - set_window_properties(WINDOW_ID_15, 0xC, -6, 0x79, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 145, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + set_window_properties(WINDOW_ID_15, 12, -6, 121, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case POPUP_MENU_READ_DIARY_PAGE: - set_window_properties(WINDOW_ID_14, posX, posY, 0x80, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - set_window_properties(WINDOW_ID_15, 0xC, -6, 0x68, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 128, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + set_window_properties(WINDOW_ID_15, 12, -6, 104, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case POPUP_MENU_READ_POSTCARD: - set_window_properties(WINDOW_ID_14, posX, posY, 0x95, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - set_window_properties(WINDOW_ID_15, 6, -6, 0x8B, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 149, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + set_window_properties(WINDOW_ID_15, 6, -6, 139, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case POPUP_MENU_POST_OFFICE: - set_window_properties(WINDOW_ID_14, posX, posY, 0x83, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); - set_window_properties(WINDOW_ID_17, 0xA, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); + set_window_properties(WINDOW_ID_14, posX, posY, 131, (D_8010D656 * 13) + 26, 0x14, popup_menu_draw_menu_contents, NULL, -1); + set_window_properties(WINDOW_ID_17, 10, -6, 114, 16, 0x15, popup_menu_draw_title_contents, NULL, WINDOW_ID_14); set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE); set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW); break; @@ -452,15 +453,15 @@ s32 popup_menu_update(void) { switch (gPopupMenu->popupType) { case POPUP_MENU_TRADE_FOR_BADGE: - set_window_properties(WINDOW_ID_16, 0x7E, -0xE, 0x20, 0x20, 0x15, func_800F4C6C, NULL, 0xE); + set_window_properties(WINDOW_ID_16, 126, -14, 32, 32, 0x15, func_800F4C6C, NULL, WINDOW_ID_14); break; case POPUP_MENU_SELL_ITEM: - set_window_properties(WINDOW_ID_16, 0x83, -0xE, 0x20, 0x20, 0x15, func_800F4C6C, NULL, 0xE); + set_window_properties(WINDOW_ID_16, 131, -14, 32, 32, 0x15, func_800F4C6C, NULL, WINDOW_ID_14); break; } if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) { - set_window_properties(WINDOW_ID_20, D_8010D688, D_8010D68A, 0x40, 0x14, 0x15, func_800F4D28, NULL, -1); + set_window_properties(WINDOW_ID_20, D_8010D688, D_8010D68A, 64, 20, 0x15, func_800F4D28, NULL, -1); } do { @@ -483,7 +484,7 @@ s32 popup_menu_update(void) { if (gPopupMenu->popupType >= POPUP_MENU_USE_ITEM && (gPopupMenu->popupType < POPUP_MENU_READ_DIARY_PAGE || gPopupMenu->popupType == POPUP_MENU_USEKEY)) { - set_window_properties(WINDOW_ID_19, D_8010D680, D_8010D682, 0x118, 0x20, 0x14, func_800F48F4, NULL, -1); + set_window_properties(WINDOW_ID_19, D_8010D680, D_8010D682, 280, 32, 0x14, func_800F48F4, NULL, -1); } posX = D_8010D684; @@ -494,26 +495,26 @@ s32 popup_menu_update(void) { case POPUP_MENU_CLAIM_ITEM: case POPUP_MENU_TAKE_FROM_CHEST: case POPUP_MENU_USEKEY: - set_window_properties(WINDOW_ID_21, posX, posY, 0x90, 0x20, 0x14, func_800F4944, NULL, -1); + set_window_properties(WINDOW_ID_21, posX, posY, 144, 32, 0x14, func_800F4944, NULL, -1); break; case POPUP_MENU_SWITCH_PARTNER: case POPUP_MENU_THROW_AWAY_ITEM: case POPUP_MENU_POST_OFFICE: - set_window_properties(WINDOW_ID_21, posX, posY, 0x90, 0x28, 0x14, func_800F4944, NULL, -1); + set_window_properties(WINDOW_ID_21, posX, posY, 144, 40, 0x14, func_800F4944, NULL, -1); break; case POPUP_MENU_TRADE_FOR_BADGE: case POPUP_MENU_READ_DIARY_PAGE: case POPUP_MENU_READ_POSTCARD: - set_window_properties(WINDOW_ID_21, posX, posY, 0x80, 0x28, 0x14, func_800F4944, NULL, -1); + set_window_properties(WINDOW_ID_21, posX, posY, 128, 40, 0x14, func_800F4944, NULL, -1); break; case POPUP_MENU_UPGRADE_PARTNER: - set_window_properties(WINDOW_ID_21, posX, posY, 0x88, 0x28, 0x14, func_800F4944, NULL, -1); + set_window_properties(WINDOW_ID_21, posX, posY, 136, 40, 0x14, func_800F4944, NULL, -1); break; case POPUP_MENU_READ_LETTER: - set_window_properties(WINDOW_ID_21, posX, posY, 0x70, 0x28, 0x14, func_800F4944, NULL, -1); + set_window_properties(WINDOW_ID_21, posX, posY, 112, 40, 0x14, func_800F4944, NULL, -1); break; case POPUP_MENU_SELL_ITEM: - set_window_properties(WINDOW_ID_21, posX, posY, 0x78, 0x20, 0x14, func_800F4944, NULL, -1); + set_window_properties(WINDOW_ID_21, posX, posY, 120, 32, 0x14, func_800F4944, NULL, -1); break; } @@ -847,7 +848,7 @@ s32 popup_menu_update(void) { if (D_8010D68E) { set_window_update(WINDOW_ID_21, WINDOW_UPDATE_HIDE); } - width = get_msg_width(0x1D006B, 0) + 23; + width = get_msg_width(MSG_Menus_006B, 0) + 23; set_window_properties(WINDOW_ID_9, 160 - (width / 2), 0x50, width, 0x28, 0x14, func_800F4CF0, NULL, -1); set_window_update(WINDOW_ID_9, WINDOW_UPDATE_SHOW); D_8010D644 = 0x3C; @@ -920,9 +921,9 @@ s32 popup_menu_update(void) { D_8010D690 = MSG_PAL_0D; if (D_8010D699 == 1) { - msgID = 0x1D0068; + msgID = MSG_Menus_0068; } else { - msgID = 0x1D0069; + msgID = MSG_Menus_0069; } width = get_msg_width(msgID, 0) + 23; set_window_properties(WINDOW_ID_21, 160 - (width / 2), 76, width, 32, 0x13, func_800F4C1C, NULL, -1); @@ -1197,7 +1198,7 @@ block_14: } set_message_value(gPopupMenu->userIndex[i] + 1, 0); - draw_msg(0x1D00CD, x + 8, var_s1_3, D_8010D650, s0, 1); + draw_msg(MSG_Menus_00CD, x + 8, var_s1_3, D_8010D650, s0, 1); break; case 11: if (gPopupMenu->value[i] != 0) { @@ -1443,48 +1444,48 @@ void popup_menu_draw_title_contents( { switch (gPopupMenu->popupType) { case POPUP_MENU_USE_ITEM: - case POPUP_MENU_THROW_AWAY_ITEM: case POPUP_MENU_SELL_ITEM: case POPUP_MENU_CHECK_ITEM: case POPUP_MENU_CLAIM_ITEM: - switch (gPopupMenu->unk_31C) { + case POPUP_MENU_THROW_AWAY_ITEM: + switch (gPopupMenu->dipMode) { case 0: - draw_msg(0x1D003F, baseX + 26, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); + draw_msg(MSG_Menus_Items, baseX + 26, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); break; case 1: - draw_msg(0x1D0041, baseX + 4, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); - draw_number(gPopupMenu->unk_320, baseX + 94, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); + draw_msg(MSG_Menus_DoubleDip, baseX + 4, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); + draw_number(gPopupMenu->titleNumber, baseX + 94, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); draw_number(2, baseX + 114, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); break; case 2: - draw_msg(0x1D0042, baseX + 6, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); - draw_number(gPopupMenu->unk_320, baseX + 94, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); + draw_msg(MSG_Menus_TripleDip, baseX + 6, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); + draw_number(gPopupMenu->titleNumber, baseX + 94, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); draw_number(3, baseX + 114, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); break; } break; case POPUP_MENU_TRADE_FOR_BADGE: - draw_msg(0x1F0032, baseX + 27, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); + draw_msg(MSG_MenuTip_0032, baseX + 27, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); break; case POPUP_MENU_READ_LETTER: - draw_msg(0x1F0033, baseX + 23, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); + draw_msg(MSG_MenuTip_0033, baseX + 23, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); break; case POPUP_MENU_TAKE_FROM_CHEST: - draw_msg(0x1D00D7, baseX + 4, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); + draw_msg(MSG_Menus_00D7, baseX + 4, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); break; case POPUP_MENU_READ_DIARY_PAGE: - draw_msg(0x1D00CE, baseX + 8, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); + draw_msg(MSG_Menus_00CE, baseX + 8, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); break; case POPUP_MENU_READ_POSTCARD: - draw_msg(0x1D00D0, baseX + 6, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); + draw_msg(MSG_Menus_00D0, baseX + 6, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); break; case POPUP_MENU_USEKEY: - draw_msg(0x1D003F, baseX + 27, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); + draw_msg(MSG_Menus_Items, baseX + 27, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU); break; case POPUP_MENU_SWITCH_PARTNER: case POPUP_MENU_UPGRADE_PARTNER: case POPUP_MENU_POST_OFFICE: - draw_msg(0x1D003D, baseX + 8, baseY + 2, D_8010D650, MSG_PAL_34, DRAW_MSG_STYLE_MENU); + draw_msg(MSG_Menus_PartyMember, baseX + 8, baseY + 2, D_8010D650, MSG_PAL_34, DRAW_MSG_STYLE_MENU); break; } } @@ -1501,86 +1502,86 @@ void func_800F4944(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s if (D_8010D68E) { switch (gPopupMenu->popupType) { case POPUP_MENU_USE_ITEM: - msgWidth = get_msg_width(0x1D0061, 0); + msgWidth = get_msg_width(MSG_Menus_0061, 0); baseX += 72 - (msgWidth / 2); - draw_msg(0x1D0061, baseX, baseY, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_0061, baseX, baseY, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_SWITCH_PARTNER: - msgWidth = get_msg_width(0x1D0063, 0); + msgWidth = get_msg_width(MSG_Menus_0063, 0); baseX += 72 - (msgWidth / 2); - draw_msg(0x1D0063, baseX, baseY - 4, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_0063, baseX, baseY - 4, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_THROW_AWAY_ITEM: - msgWidth = get_msg_width(0x1D0064, 0); + msgWidth = get_msg_width(MSG_Menus_0064, 0); baseX += 72 - (msgWidth / 2); - draw_msg(0x1D0064, baseX, baseY - 4, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_0064, baseX, baseY - 4, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_TRADE_FOR_BADGE: - msgWidth = get_msg_width(0x1D0070, 0); + msgWidth = get_msg_width(MSG_Menus_0070, 0); baseX += 64 - (msgWidth / 2); - draw_msg(0x1D0070, baseX, baseY - 4, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_0070, baseX, baseY - 4, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_UPGRADE_PARTNER: - msgWidth = get_msg_width(0x1D006A, 0); + msgWidth = get_msg_width(MSG_Menus_006A, 0); baseX += 68 - (msgWidth / 2); - draw_msg(0x1D006A, baseX, baseY - 4, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_006A, baseX, baseY - 4, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_SELL_ITEM: - msgWidth = get_msg_width(0x1D0065, 0); + msgWidth = get_msg_width(MSG_Menus_0065, 0); baseX += 60 - (msgWidth / 2); - draw_msg(0x1D0065, baseX, baseY, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_0065, baseX, baseY, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_CHECK_ITEM: - msgWidth = get_msg_width(0x1D0066, 0); + msgWidth = get_msg_width(MSG_Menus_0066, 0); baseX += 72 - (msgWidth / 2); - draw_msg(0x1D0066, baseX, baseY, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_0066, baseX, baseY, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_CLAIM_ITEM: - msgWidth = get_msg_width(0x1D0067, 0); + msgWidth = get_msg_width(MSG_Menus_0067, 0); baseX += 72 - (msgWidth / 2); - draw_msg(0x1D0067, baseX, baseY, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_0067, baseX, baseY, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_POST_OFFICE: - msgWidth = get_msg_width(0x1D006F, 0); + msgWidth = get_msg_width(MSG_Menus_006F, 0); baseX += 72 - (msgWidth / 2); - draw_msg(0x1D006F, baseX, baseY - 4, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_006F, baseX, baseY - 4, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_READ_LETTER: - msgWidth = get_msg_width(0x1D006D, 0); + msgWidth = get_msg_width(MSG_Menus_006D, 0); baseX += 56 - (msgWidth / 2); - draw_msg(0x1D006D, baseX, baseY - 4, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_006D, baseX, baseY - 4, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_TAKE_FROM_CHEST: - msgWidth = get_msg_width(0x1D00D6, 0); + msgWidth = get_msg_width(MSG_Menus_00D6, 0); baseX += 72 - (msgWidth / 2); - draw_msg(0x1D00D6, baseX, baseY, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_00D6, baseX, baseY, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_READ_DIARY_PAGE: - msgWidth = get_msg_width(0x1D006C, 0); + msgWidth = get_msg_width(MSG_Menus_006C, 0); baseX += 64 - (msgWidth / 2); - draw_msg(0x1D006C, baseX, baseY - 4, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_006C, baseX, baseY - 4, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_READ_POSTCARD: - msgWidth = get_msg_width(0x1D006D, 0); + msgWidth = get_msg_width(MSG_Menus_006D, 0); baseX += 64 - (msgWidth / 2); - draw_msg(0x1D006D, baseX, baseY - 4, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_006D, baseX, baseY - 4, 255, MSG_PAL_0F, 0); break; case POPUP_MENU_USEKEY: - msgWidth = get_msg_width(0x1D0062, 0); + msgWidth = get_msg_width(MSG_Menus_0062, 0); baseX += 72 - (msgWidth / 2); - draw_msg(0x1D0062, baseX, baseY, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_0062, baseX, baseY, 255, MSG_PAL_0F, 0); break; } } } void func_800F4C1C(PopupMessage* popup, s32 x, s32 y) { - s32 msg = 0x1D0069; + s32 msg = MSG_Menus_0069; s32 xPos = x + 11; s32 yPos = y + 8; if (D_8010D699 == 1) { - msg = 0x1D0068; + msg = MSG_Menus_0068; } draw_msg(msg, xPos, yPos, 255, MSG_PAL_0F, 0); } @@ -1611,7 +1612,7 @@ void func_800F4C6C(PopupMessage* popup, s32 x, s32 y) { } void func_800F4CF0(PopupMessage* popup, s32 x, s32 y) { - draw_msg(0x1D006B, x + 16, y + 2, 255, MSG_PAL_0F, 0); + draw_msg(MSG_Menus_006B, x + 16, y + 2, 255, MSG_PAL_0F, 0); } void func_800F4D28(PopupMessage* popup, s32 x, s32 y) { @@ -1652,15 +1653,15 @@ void create_popup_menu(PopupMenu* popup) { open_status_menu_short(); gPopupMenu = popup; popup->result = 0; - popup->unk_31C = 0; - popup->unk_320 = 0; + popup->dipMode = 0; + popup->titleNumber = 0; D_8010D699 = 0; D_8010D698 = 1; - if (popup->popupType >= 100) { - popup->popupType -= 100; + if (popup->popupType >= POPUP_MENU_DOUBLE_DIP) { + popup->popupType -= POPUP_MENU_DOUBLE_DIP; D_8010D699 = 1; - if (popup->popupType >= 100) { - popup->popupType -= 100; + if (popup->popupType >= POPUP_MENU_DOUBLE_DIP) { + popup->popupType -= POPUP_MENU_DOUBLE_DIP; D_8010D699 = 2; } D_8010D698 = 0; @@ -1700,16 +1701,16 @@ void func_800F4FC4(PopupMenu* popup) { gPopupMenu = popup; popup->result = 0; - popup->unk_31C = 0; - popup->unk_320 = 0; + popup->dipMode = 0; + popup->titleNumber = 0; D_8010D69A = func_800E98D4(); D_8010D699 = 0; D_8010D698 = 1; - if (gPopupMenu->popupType >= 100) { - gPopupMenu->popupType -= 100; + if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) { + gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP; D_8010D699 = 1; - if (gPopupMenu->popupType >= 100) { - gPopupMenu->popupType -= 100; + if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) { + gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP; D_8010D699 = 2; } D_8010D698 = 0; @@ -1745,15 +1746,15 @@ void func_800F513C(PopupMenu* popup) { gPopupMenu = popup; popup->result = 0; - D_8010D693 = popup->unk_320; + D_8010D693 = popup->titleNumber; D_8010D69A = func_800E98D4(); D_8010D699 = 0; D_8010D698 = 1; - if (gPopupMenu->popupType >= 100) { - gPopupMenu->popupType -= 100; + if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) { + gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP; D_8010D699 = 1; - if (gPopupMenu->popupType >= 100) { - gPopupMenu->popupType -= 100; + if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) { + gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP; D_8010D699 = 2; } D_8010D698 = 0; diff --git a/src/actor_api.c b/src/actor_api.c index d03bab5a7d..e6c5236058 100644 --- a/src/actor_api.c +++ b/src/actor_api.c @@ -2157,15 +2157,15 @@ ApiStatus func_8026DF88(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus func_8026E020(Evt* script, s32 isInitialCall) { +ApiStatus SetBattleMenuDisableFlags(Evt* script, s32 isInitialCall) { s32 flagsValue = *script->ptrReadPos; gBattleStatus.menuDisableFlags = flagsValue; return ApiStatus_DONE2; } -ApiStatus func_8026E038(Evt* script, s32 isInitialCall) { - gBattleStatus.unk_74 = *script->ptrReadPos; +ApiStatus SetEnabledStarPowers(Evt* script, s32 isInitialCall) { + gBattleStatus.enabledStarPowersMask = *script->ptrReadPos; return ApiStatus_DONE2; } diff --git a/src/battle/action_cmd.c b/src/battle/action_cmd.c index e5764b369f..50bfb26621 100644 --- a/src/battle/action_cmd.c +++ b/src/battle/action_cmd.c @@ -99,7 +99,7 @@ ApiStatus LoadActionCommand(Evt* script, s32 isInitialCall) { } s32 adjust_action_command_difficulty(s32 arg0) { - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { arg0 -= is_ability_active(ABILITY_DODGE_MASTER) * 3; } @@ -259,12 +259,12 @@ void action_command_init_status(void) { actionCommandStatus->autoSucceed = FALSE; actionCommandStatus->berserkerEnabled = FALSE; - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { if (is_ability_active(ABILITY_RIGHT_ON)) { actionCommandStatus->autoSucceed = TRUE; } - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000) && is_ability_active(ABILITY_BERSERKER)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING) && is_ability_active(ABILITY_BERSERKER)) { actionCommandStatus->showHud = FALSE; actionCommandStatus->berserkerEnabled = TRUE; @@ -548,7 +548,7 @@ s32 check_block_input(s32 buttonMask) { battleStatus->blockResult = 0; // Fail - if (battleStatus->actionCommandMode == ACTION_COMMAND_MODE_TUTORIAL_BLOCK && (battleStatus->flags1 & BS_FLAGS1_2000000)) { + if (battleStatus->actionCommandMode == ACTION_COMMAND_MODE_TUTORIAL_BLOCK && (battleStatus->flags1 & BS_FLAGS1_TUTORIAL_BATTLE)) { battleStatus->blockResult = 1; return TRUE; } @@ -568,7 +568,7 @@ s32 check_block_input(s32 buttonMask) { blockWindow = 3; mashWindow = 10; - if (!(gBattleStatus.flags1 & BS_FLAGS1_80000) && is_ability_active(ABILITY_DODGE_MASTER)) { + if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING) && is_ability_active(ABILITY_DODGE_MASTER)) { blockWindow = 5; } diff --git a/src/battle/area_arn/actor/tubbas_heart.c b/src/battle/area_arn/actor/tubbas_heart.c index cd1852a058..452611ae83 100644 --- a/src/battle/area_arn/actor/tubbas_heart.c +++ b/src/battle/area_arn/actor/tubbas_heart.c @@ -279,7 +279,7 @@ EvtScript N(80224414) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C) EVT_CALL(MoveBattleCamOver, 25) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_DMG_APPLY, 1) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(func_8026F60C, 20) EVT_RETURN EVT_END diff --git a/src/battle/area_dgb/actor/tubba_blubba.c b/src/battle/area_dgb/actor/tubba_blubba.c index 29204b2d52..9f5b56a3be 100644 --- a/src/battle/area_dgb/actor/tubba_blubba.c +++ b/src/battle/area_dgb/actor/tubba_blubba.c @@ -341,7 +341,7 @@ EvtScript N(takeTurn_80219750) = { EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) EVT_KILL_THREAD(LVar0) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_DMG_APPLY, 1) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(func_8026F60C, 10) EVT_RETURN EVT_END_IF diff --git a/src/battle/area_dig/actor/tubba_blubba.c b/src/battle/area_dig/actor/tubba_blubba.c index 22930cb8d6..a5b991a74b 100644 --- a/src/battle/area_dig/actor/tubba_blubba.c +++ b/src/battle/area_dig/actor/tubba_blubba.c @@ -213,7 +213,7 @@ EvtScript N(takeTurn) = { EVT_CALL(GetActorVar, ACTOR_SELF, 2, LVar0) EVT_KILL_THREAD(LVar0) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_DMG_APPLY, 1) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(func_8026F60C, 10) EVT_RETURN EVT_END_IF diff --git a/src/battle/area_dig/script/dig_01.c b/src/battle/area_dig/script/dig_01.c index 898db1d9db..c0ba9c6e12 100644 --- a/src/battle/area_dig/script/dig_01.c +++ b/src/battle/area_dig/script/dig_01.c @@ -12,7 +12,7 @@ ApiStatus func_80218644_6DE404(Evt* script, s32 isInitialCall) { battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; battleStatus->selectedMoveID = MOVE_HAMMER1; - battleStatus->selectedItemID = gCurrentEncounter.hitTier; + battleStatus->moveArgument = gCurrentEncounter.hitTier; battleStatus->currentTargetListFlags = gMoveTable[MOVE_HAMMER1].flags; player_create_target_list(player); diff --git a/src/battle/area_dig/script/dig_02.c b/src/battle/area_dig/script/dig_02.c index e4bfe4840f..a75e39bfc8 100644 --- a/src/battle/area_dig/script/dig_02.c +++ b/src/battle/area_dig/script/dig_02.c @@ -10,7 +10,7 @@ ApiStatus func_802186E0_6DE4A0(Evt* script, s32 isInitialCall) { battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; battleStatus->selectedMoveID = MOVE_POWER_BOUNCE; - battleStatus->selectedItemID = gCurrentEncounter.hitTier; + battleStatus->moveArgument = gCurrentEncounter.hitTier; battleStatus->currentTargetListFlags = gMoveTable[MOVE_POWER_BOUNCE].flags; player_create_target_list(player); diff --git a/src/battle/area_dig/script/dig_03.c b/src/battle/area_dig/script/dig_03.c index 424c5b0963..3332ffd34b 100644 --- a/src/battle/area_dig/script/dig_03.c +++ b/src/battle/area_dig/script/dig_03.c @@ -8,8 +8,8 @@ ApiStatus func_80218770_6DE530(Evt* script, s32 isInitialCall) { Actor* partner = battleStatus->partnerActor; SelectableTarget* selectableTarget; - battleStatus->moveCategory = BTL_MENU_TYPE_6; - battleStatus->selectedItemID = 0; + battleStatus->moveCategory = BTL_MENU_TYPE_ABILITY; + battleStatus->moveArgument = 0; battleStatus->selectedMoveID = MOVE_SHELL_SHOT; battleStatus->currentTargetListFlags = gMoveTable[MOVE_SHELL_SHOT].flags; diff --git a/src/battle/area_dig/script/dig_04.c b/src/battle/area_dig/script/dig_04.c index 82bccf8166..51e65e8953 100644 --- a/src/battle/area_dig/script/dig_04.c +++ b/src/battle/area_dig/script/dig_04.c @@ -10,9 +10,9 @@ ApiStatus func_802187F0_6DE5B0(Evt* script, s32 isInitialCall) { Actor* player = battleStatus->playerActor; SelectableTarget* selectableTarget; - battleStatus->moveCategory = BTL_MENU_TYPE_ITEM; - battleStatus->selectedItemID = ITEM_THUNDER_RAGE; - selectedItemID = battleStatus->selectedItemID; + battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; + battleStatus->moveArgument = ITEM_THUNDER_RAGE; + selectedItemID = battleStatus->moveArgument; battleStatus->selectedMoveID = 0; battleStatus->currentAttackElement = 0; playerData->invItems[0] = selectedItemID; diff --git a/src/battle/area_dig/stage/dig_04.c b/src/battle/area_dig/stage/dig_04.c index f95addd71d..37b6d2c7da 100644 --- a/src/battle/area_dig/stage/dig_04.c +++ b/src/battle/area_dig/stage/dig_04.c @@ -42,8 +42,8 @@ Stage NAMESPACE = { .preBattle = &N(beforeBattle), .postBattle = &N(afterBattle), .foregroundModelList = N(foregroundModelList), - .specialFormationSize = 4, - .specialFormation = &N(formation_slot_machine), + .stageEnemyCount = 4, + .stageFormation = &N(formation_slot_machine), }; Vec3i N(slot_machine_pos1) = { -49, 56, -68 }; diff --git a/src/battle/area_flo/actor/amazy_dayzee.c b/src/battle/area_flo/actor/amazy_dayzee.c index 6fe0ba1543..0d52cf9a96 100644 --- a/src/battle/area_flo/actor/amazy_dayzee.c +++ b/src/battle/area_flo/actor/amazy_dayzee.c @@ -352,7 +352,7 @@ EvtScript N(flee) = { EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CALL(EnableActorBlur, ACTOR_SELF, 0) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_CALL(RemoveActor, ACTOR_SELF) EVT_RETURN diff --git a/src/battle/area_flo/actor/crazee_dayzee.c b/src/battle/area_flo/actor/crazee_dayzee.c index 12a0a0418d..cf8c229376 100644 --- a/src/battle/area_flo/actor/crazee_dayzee.c +++ b/src/battle/area_flo/actor/crazee_dayzee.c @@ -345,7 +345,7 @@ EvtScript N(flee) = { EVT_CALL(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) EVT_CALL(EnableActorBlur, ACTOR_SELF, 0) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_CALL(RemoveActor, ACTOR_SELF) EVT_RETURN diff --git a/src/battle/area_hos/actor/goombario_tutor.c b/src/battle/area_hos/actor/goombario_tutor.c index 62731ff515..0dd6ed5fac 100644 --- a/src/battle/area_hos/actor/goombario_tutor.c +++ b/src/battle/area_hos/actor/goombario_tutor.c @@ -4,6 +4,7 @@ #include "battle/action_cmd/jump.h" #include "battle/action_cmd.h" #include "sprite/npc/BattleGoombario.h" +#include "sprite/npc/Twink.h" #define NAMESPACE b_area_hos_goombario_tutor @@ -99,7 +100,7 @@ EvtScript N(init_80219160) = { EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_PTR(N(takeTurn_80219444))) EVT_CALL(BindIdle, ACTOR_SELF, EVT_PTR(N(idle_802191D0))) EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_802191E0))) - EVT_CALL(SetActorVar, -127, 0, 1) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) EVT_EXEC(N(80219C74)) EVT_RETURN EVT_END @@ -283,7 +284,7 @@ ApiStatus func_80218000_47F0B0(Evt* script, s32 isInitialCall) { } EvtScript N(80219C74) = { - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_2000000, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_TUTORIAL_BATTLE, 1) EVT_CALL(func_802535B4, 0) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MENU) EVT_WAIT(15) @@ -294,9 +295,9 @@ EvtScript N(80219C74) = { EVT_CALL(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2) EVT_CALL(JumpToGoal, ACTOR_PARTNER, 10, FALSE, FALSE, FALSE) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_0019, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0019, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) - EVT_CALL(func_8026E020, 1) + EVT_CALL(SetBattleMenuDisableFlags, BTL_MENU_DISABLED_JUMP) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_TUTORIAL) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MOVE) EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C) @@ -304,7 +305,7 @@ EvtScript N(80219C74) = { EVT_CALL(SetGoalPos, ACTOR_PARTNER, -73, 40, 202) EVT_CALL(FlyToGoal, ACTOR_PARTNER, 20, 20, 10) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_001A, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_001A, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_LEARNED) EVT_CALL(SetBattleFlagBits, BS_FLAGS1_4000, 0) @@ -320,7 +321,7 @@ EvtScript N(80219C74) = { EVT_CALL(FlyToGoal, ACTOR_PARTNER, 20, 20, 10) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_TUTORIAL) EVT_CALL(WaitForState, BATTLE_STATE_0) - EVT_CALL(SetBattleFlagBits2, 512, 1) + EVT_CALL(SetBattleFlagBits2, BS_FLAGS2_200, 1) EVT_LOOP(0) EVT_CALL(GetActionCommandMode, LVar0) EVT_IF_NE(LVar0, ACTION_COMMAND_MODE_TUTORIAL) @@ -329,22 +330,22 @@ EvtScript N(80219C74) = { EVT_WAIT(1) EVT_END_LOOP EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_001B, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_001B, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_LOOP(0) - EVT_CALL(CheckButtonDown, 32768, LVar0) + EVT_CALL(CheckButtonDown, BUTTON_A, LVar0) EVT_IF_EQ(LVar0, 0) EVT_BREAK_LOOP EVT_END_IF EVT_WAIT(1) EVT_END_LOOP EVT_LOOP(0) - EVT_CALL(CheckButtonPress, 32768, LVar0) + EVT_CALL(CheckButtonPress, BUTTON_A, LVar0) EVT_IF_EQ(LVar0, 1) EVT_BREAK_LOOP EVT_END_IF EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(EndActorSpeech, 256, 1, 2097161, 2097157) + EVT_CALL(EndActorSpeech, 256, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(SetActionSuccess, 1) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_LEARNED) @@ -352,13 +353,13 @@ EvtScript N(80219C74) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C) EVT_WAIT(15) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_001D, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_001D, 256, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(WaitForState, BATTLE_STATE_9) EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C) EVT_WAIT(15) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_001E, 512, 1, 589839, 589825) + EVT_CALL(ActorSpeak, MSG_HOS_001E, BS_FLAGS2_200, 1, ANIM_BattleGoombario_Talk, ANIM_BattleGoombario_Idle) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_TUTORIAL) EVT_CALL(WaitForState, BATTLE_STATE_0) @@ -370,22 +371,22 @@ EvtScript N(80219C74) = { EVT_WAIT(1) EVT_END_LOOP EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_001F, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_001F, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_LOOP(0) - EVT_CALL(CheckButtonDown, 32768, LVar0) + EVT_CALL(CheckButtonDown, BUTTON_A, LVar0) EVT_IF_EQ(LVar0, 0) EVT_BREAK_LOOP EVT_END_IF EVT_WAIT(1) EVT_END_LOOP EVT_LOOP(0) - EVT_CALL(CheckButtonPress, 32768, LVar0) + EVT_CALL(CheckButtonPress, BUTTON_A, LVar0) EVT_IF_EQ(LVar0, 1) EVT_BREAK_LOOP EVT_END_IF EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(EndActorSpeech, 256, 1, 2097161, 2097157) + EVT_CALL(EndActorSpeech, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(SetActionSuccess, 1) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_TUTORIAL_BLOCK) @@ -394,14 +395,14 @@ EvtScript N(80219C74) = { EVT_WAIT(15) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_LEARNED) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_0020, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0020, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MENU) - EVT_CALL(func_8026E020, 2) + EVT_CALL(SetBattleMenuDisableFlags, BTL_MENU_DISABLED_SMASH) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_TUTORIAL) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MOVE) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_0022, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0022, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_LOOP(0) EVT_CALL(CheckButtonDown, 262144, LVar0) EVT_IF_EQ(LVar0, 0) @@ -416,7 +417,7 @@ EvtScript N(80219C74) = { EVT_END_IF EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(EndActorSpeech, 256, 1, 2097161, 2097157) + EVT_CALL(EndActorSpeech, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_LEARNED) EVT_CALL(WaitForState, BATTLE_STATE_0) @@ -432,7 +433,7 @@ EvtScript N(80219C74) = { EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_TUTORIAL_BLOCK) EVT_CALL(PauseTakeTurn, 0) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_0023, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0023, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_LOOP(0) EVT_CALL(CheckButtonPress, 262144, LVar0) EVT_IF_EQ(LVar0, 1) @@ -440,7 +441,7 @@ EvtScript N(80219C74) = { EVT_END_IF EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(EndActorSpeech, 256, 1, 2097161, 2097157) + EVT_CALL(EndActorSpeech, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_TUTORIAL) EVT_CALL(ResumeTakeTurn, 0) @@ -455,7 +456,7 @@ EvtScript N(80219C74) = { EVT_WAIT(1) EVT_END_LOOP EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_0024, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0024, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_LOOP(0) EVT_CALL(CheckButtonDown, 262144, LVar0) EVT_IF_EQ(LVar0, 0) @@ -463,7 +464,7 @@ EvtScript N(80219C74) = { EVT_END_IF EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(EndActorSpeech, 256, 1, 2097161, 2097157) + EVT_CALL(EndActorSpeech, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(SetActionSuccess, 1) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_LEARNED) @@ -471,24 +472,24 @@ EvtScript N(80219C74) = { EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C) EVT_WAIT(15) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_0025, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0025, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(SetActorFlagBits, ACTOR_ENEMY0, ACTOR_FLAG_NO_ATTACK, 1) EVT_CALL(WaitForState, BATTLE_STATE_0) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MENU) - EVT_CALL(ShowBattleChoice, 1966109) - EVT_CALL(EndActorSpeech, 256, 1, 2097161, 2097157) + EVT_CALL(ShowBattleChoice, MSG_Choice_001D) + EVT_CALL(EndActorSpeech, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_IF_EQ(LVar0, 1) - EVT_CALL(ActorSpeak, MSG_HOS_0027, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0027, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_GOTO(100) EVT_END_IF EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_0028, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0028, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) - EVT_CALL(SetActorVar, -127, 0, 0) - EVT_CALL(SetBattleFlagBits2, 512, 0) + EVT_CALL(SetActorVar, ACTOR_SELF, 0, 0) + EVT_CALL(SetBattleFlagBits2, BS_FLAGS2_200, 0) EVT_LABEL(10) - EVT_CALL(func_8026E020, 131) + EVT_CALL(SetBattleMenuDisableFlags, BTL_MENU_DISABLED_JUMP | BTL_MENU_DISABLED_SMASH | BTL_MENU_DISABLED_STRATEGIES) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_TUTORIAL) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MOVE) EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2) @@ -501,14 +502,14 @@ EvtScript N(80219C74) = { EVT_CALL(func_80269524, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(-1) - EVT_CALL(ActorSpeak, MSG_HOS_002A, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_002A, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CASE_EQ(0) - EVT_CALL(ActorSpeak, MSG_HOS_002B, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_002B, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CASE_EQ(1) - EVT_CALL(ActorSpeak, MSG_HOS_0029, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0029, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_END_SWITCH EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) - EVT_CALL(SetEnemyHP, 512, 99) + EVT_CALL(SetEnemyHP, ACTOR_ENEMY0, 99) EVT_CALL(SetActorFlagBits, ACTOR_ENEMY0, ACTOR_FLAG_NO_ATTACK, 0) EVT_CALL(SetActionCommandMode, ACTION_COMMAND_MODE_LEARNED) EVT_CALL(WaitForState, BATTLE_STATE_END_TURN) @@ -516,18 +517,18 @@ EvtScript N(80219C74) = { EVT_CALL(GetBlockResult, LVar0) EVT_SWITCH(LVar0) EVT_CASE_EQ(-1) - EVT_CALL(ActorSpeak, MSG_HOS_002A, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_002A, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CASE_EQ(0) - EVT_CALL(ActorSpeak, MSG_HOS_002B, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_002B, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_CASE_EQ(1) - EVT_CALL(ActorSpeak, MSG_HOS_0029, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_0029, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_END_SWITCH EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MENU) EVT_GOTO(10) EVT_LABEL(99) EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE) - EVT_CALL(ActorSpeak, MSG_HOS_002C, 256, 1, 2097161, 2097157) + EVT_CALL(ActorSpeak, MSG_HOS_002C, ACTOR_PARTNER, 1, ANIM_Twink_Talk, ANIM_Twink_Fly) EVT_LABEL(100) EVT_CALL(WaitForState, BATTLE_STATE_0) EVT_CALL(SetBattleState, 30) diff --git a/src/battle/area_hos/actor/magikoopa.c b/src/battle/area_hos/actor/magikoopa.c index 60913c055f..ee7eeb6e01 100644 --- a/src/battle/area_hos/actor/magikoopa.c +++ b/src/battle/area_hos/actor/magikoopa.c @@ -219,17 +219,17 @@ EvtScript N(idle_8021D774) = { EvtScript N(8021D784) = { EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_IF_FLAG(LVar0, BS_FLAGS1_200 | BS_FLAGS1_40) EVT_CALL(SetActorVar, -127, 2, 1) EVT_END_IF EVT_ELSE EVT_CALL(N(GetSelectedMoveID), LVar0) EVT_SWITCH(LVar0) - EVT_CASE_OR_EQ(131) - EVT_CASE_OR_EQ(132) - EVT_CASE_OR_EQ(133) - EVT_CASE_OR_EQ(136) + EVT_CASE_OR_EQ(MOVE_HEADBONK1) + EVT_CASE_OR_EQ(MOVE_HEADBONK2) + EVT_CASE_OR_EQ(MOVE_HEADBONK3) + EVT_CASE_OR_EQ(MOVE_MULTIBONK) EVT_CALL(GetBattleFlags, LVar0) EVT_IF_FLAG(LVar0, BS_FLAGS1_200 | BS_FLAGS1_40) EVT_CALL(SetActorVar, -127, 2, 1) diff --git a/src/battle/area_isk_part_1/actor/pokey_mummy.c b/src/battle/area_isk_part_1/actor/pokey_mummy.c index 410ab89b40..5cdcc16491 100644 --- a/src/battle/area_isk_part_1/actor/pokey_mummy.c +++ b/src/battle/area_isk_part_1/actor/pokey_mummy.c @@ -405,7 +405,7 @@ EvtScript N(handleEvent_80219050) = { EVT_END_CASE_GROUP EVT_CASE_EQ(EVENT_SPIKE_TAUNT) EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(AfflictActor, 0, 9, 3) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) diff --git a/src/battle/area_iwa/stage/iwa_01.c b/src/battle/area_iwa/stage/iwa_01.c index cda04a0a2c..0757ea28fa 100644 --- a/src/battle/area_iwa/stage/iwa_01.c +++ b/src/battle/area_iwa/stage/iwa_01.c @@ -33,9 +33,9 @@ Stage NAMESPACE = { .preBattle = &N(beforeBattle_80220860), .postBattle = &N(afterBattle_80220894), .foregroundModelList = N(foregroundModelList_802208A4), - .specialFormationSize = 1, - .specialFormation = &N(specialFormation_802208E4), - .unk_24 = 0x200, + .stageEnemyCount = 1, + .stageFormation = &N(specialFormation_802208E4), + .stageEnemyChance = 512, }; Vec3i N(vector3D_802208D8) = { 116, 0, -30 }; diff --git a/src/battle/area_kkj/actor/kammy_koopa.c b/src/battle/area_kkj/actor/kammy_koopa.c index f525604b8c..759fff2c7f 100644 --- a/src/battle/area_kkj/actor/kammy_koopa.c +++ b/src/battle/area_kkj/actor/kammy_koopa.c @@ -519,14 +519,14 @@ EvtScript N(onDeath) = { EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 3) EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_BattleKammy_Anim03) EVT_WAIT(50) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_DMG_APPLY, 1) EVT_CALL(ActorSpeak, MSG_CH8_009B, ACTOR_SELF, 1, ANIM_BattleKammy_Anim03, ANIM_BattleKammy_Anim03) EVT_WAIT(10) EVT_CALL(UseBattleCamPreset, BTL_CAM_PRESET_C) EVT_CALL(MoveBattleCamOver, 60) EVT_WAIT(40) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_100000, 0) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_PLAYER_IN_BACK, 0) EVT_RETURN EVT_END }; diff --git a/src/battle/area_kmr_part_3/actor/egg_jr_troopa.c b/src/battle/area_kmr_part_3/actor/egg_jr_troopa.c index 0eea0dde9e..9d15764079 100644 --- a/src/battle/area_kmr_part_3/actor/egg_jr_troopa.c +++ b/src/battle/area_kmr_part_3/actor/egg_jr_troopa.c @@ -340,7 +340,7 @@ EvtScript N(802250E4) = { EVT_IF_EQ(LVar0, 0) EVT_CALL(GetLastDamage, -127, LVar1) EVT_CALL(GetBattleFlags, LVar2) - EVT_IF_NOT_FLAG(LVar2, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar2, BS_FLAGS1_PARTNER_ACTING) EVT_IF_NE(LVar1, 0) EVT_CALL(SetActorVar, -127, 1, 1) EVT_CALL(GetStatusFlags, ACTOR_SELF, LVar0) diff --git a/src/battle/area_kmr_part_3/actor/final_jr_troopa.c b/src/battle/area_kmr_part_3/actor/final_jr_troopa.c index c59e19ec17..c5cf4f3dcc 100644 --- a/src/battle/area_kmr_part_3/actor/final_jr_troopa.c +++ b/src/battle/area_kmr_part_3/actor/final_jr_troopa.c @@ -206,9 +206,9 @@ EvtScript N(8022C6D4) = { EVT_RETURN EVT_END_IF EVT_CALL(GetBattleFlags, LVar2) - EVT_IF_FLAG(LVar2, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar2, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2) - EVT_IF_EQ(LVar2, 183) + EVT_IF_EQ(LVar2, MOVE_SPOOK) EVT_CALL(SetActorVar, -127, 1, 1) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_263) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) diff --git a/src/battle/area_kmr_part_3/actor/mage_jr_troopa.c b/src/battle/area_kmr_part_3/actor/mage_jr_troopa.c index f6bdbec069..c1d966d672 100644 --- a/src/battle/area_kmr_part_3/actor/mage_jr_troopa.c +++ b/src/battle/area_kmr_part_3/actor/mage_jr_troopa.c @@ -137,9 +137,9 @@ EvtScript N(8022A750) = { EVT_RETURN EVT_END_IF EVT_CALL(GetBattleFlags, LVar2) - EVT_IF_FLAG(LVar2, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar2, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2) - EVT_IF_EQ(LVar2, 183) + EVT_IF_EQ(LVar2, MOVE_SPOOK) EVT_CALL(SetActorVar, -127, 3, 1) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_263) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) diff --git a/src/battle/area_kmr_part_3/actor/para_jr_troopa.c b/src/battle/area_kmr_part_3/actor/para_jr_troopa.c index 005c483740..6755cb643e 100644 --- a/src/battle/area_kmr_part_3/actor/para_jr_troopa.c +++ b/src/battle/area_kmr_part_3/actor/para_jr_troopa.c @@ -123,9 +123,9 @@ EvtScript N(80225F7C) = { EVT_RETURN EVT_END_IF EVT_CALL(GetBattleFlags, LVar2) - EVT_IF_FLAG(LVar2, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar2, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2) - EVT_IF_EQ(LVar2, 183) + EVT_IF_EQ(LVar2, MOVE_SPOOK) EVT_CALL(SetActorVar, -127, 1, 1) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_263) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) diff --git a/src/battle/area_kmr_part_3/actor/spiked_para_jr_troopa.c b/src/battle/area_kmr_part_3/actor/spiked_para_jr_troopa.c index f89541ac54..34c5b43a30 100644 --- a/src/battle/area_kmr_part_3/actor/spiked_para_jr_troopa.c +++ b/src/battle/area_kmr_part_3/actor/spiked_para_jr_troopa.c @@ -117,9 +117,9 @@ EvtScript N(80228084) = { EVT_RETURN EVT_END_IF EVT_CALL(GetBattleFlags, LVar2) - EVT_IF_FLAG(LVar2, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar2, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2) - EVT_IF_EQ(LVar2, 183) + EVT_IF_EQ(LVar2, MOVE_SPOOK) EVT_CALL(SetActorVar, -127, 2, 1) EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_263) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) diff --git a/src/battle/area_kpa/actor/bony_beetle.c b/src/battle/area_kpa/actor/bony_beetle.c index 6250104f5b..75f3a795a8 100644 --- a/src/battle/area_kpa/actor/bony_beetle.c +++ b/src/battle/area_kpa/actor/bony_beetle.c @@ -161,7 +161,7 @@ ActorBlueprint NAMESPACE = { EvtScript N(init) = { EVT_CALL(GetActorVar, ACTOR_SELF, 0, LVar0) - EVT_CALL(func_8027D75C, ACTOR_SELF, LVar1) + EVT_CALL(GetInstigatorValue, ACTOR_SELF, LVar1) EVT_IF_EQ(LVar0, 1) EVT_IF_EQ(LVar1, 1) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_STATE), N(STATE_SPIKY)) diff --git a/src/battle/area_kpa2/actor/bowser_intro.c b/src/battle/area_kpa2/actor/bowser_intro.c index 0420041797..6d9b3b8550 100644 --- a/src/battle/area_kpa2/actor/bowser_intro.c +++ b/src/battle/area_kpa2/actor/bowser_intro.c @@ -154,7 +154,7 @@ EvtScript N(init) = { EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_TURN_COUNTER), 0) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_PEACH_SPOKE), 0) EVT_CALL(SetActorVar, ACTOR_SELF, 14, 0) - EVT_CALL(func_8026E020, 1) + EVT_CALL(SetBattleMenuDisableFlags, BTL_MENU_DISABLED_JUMP) EVT_CALL(CreateNpc, 0, ANIM_ParadePeach_IdleRaisedArms) EVT_CALL(SetNpcYaw, 0, 90) EVT_CALL(SetNpcPos, 0, -130, 0, -12) diff --git a/src/battle/area_kpa2/actor/bowser_phase_2.c b/src/battle/area_kpa2/actor/bowser_phase_2.c index e27f2deee9..58a3e70bf6 100644 --- a/src/battle/area_kpa2/actor/bowser_phase_2.c +++ b/src/battle/area_kpa2/actor/bowser_phase_2.c @@ -352,7 +352,7 @@ EvtScript N(handleEvent) = { EVT_CALL(MoveBattleCamOver, 30) EVT_CALL(GetActorHP, ACTOR_SELF, GB_FinalBowserHP) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_DMG_APPLY, 1) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(func_8026F60C, 20) EVT_RETURN EVT_CASE_EQ(20) diff --git a/src/battle/area_kpa2/actor/bowser_phase_3.c b/src/battle/area_kpa2/actor/bowser_phase_3.c index fc71cd5abd..4b88c3b3c9 100644 --- a/src/battle/area_kpa2/actor/bowser_phase_3.c +++ b/src/battle/area_kpa2/actor/bowser_phase_3.c @@ -441,7 +441,7 @@ EvtScript N(handleEvent) = { EVT_EXEC_WAIT(N(onImmune)) EVT_CALL(SetAnimation, ACTOR_SELF, 1, ANIM_BattleBowser_Idle) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_DMG_APPLY, 1) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(func_8026F60C, 10) EVT_RETURN EVT_CASE_EQ(EVENT_PEACH_BEAM) @@ -639,7 +639,7 @@ EvtScript N(onDeath) = { EVT_END_IF EVT_CALL(ActorSpeak, MSG_CH8_00A9, ACTOR_SELF, 1, ANIM_BattleBowser_DefeatedTalk, ANIM_BattleBowser_DefeatedIdle) EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_DMG_APPLY, 1) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_DISABLE_CELEBRATION | BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(func_8026F60C, 20) EVT_RETURN EVT_END diff --git a/src/battle/area_omo/actor/spy_guy.c b/src/battle/area_omo/actor/spy_guy.c index 9cdb750cc0..9e98032d20 100644 --- a/src/battle/area_omo/actor/spy_guy.c +++ b/src/battle/area_omo/actor/spy_guy.c @@ -131,7 +131,7 @@ EvtScript N(init_802275D4) = { EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_PTR(N(handleEvent_80227ABC))) EVT_CALL(SetActorVar, ACTOR_SELF, 2, 1) EVT_CALL(SetActorVar, ACTOR_SELF, 3, 0) - EVT_CALL(func_8027D75C, ACTOR_SELF, LVar0) + EVT_CALL(GetInstigatorValue, ACTOR_SELF, LVar0) EVT_IF_NE(LVar0, 0) EVT_CALL(SetActorVar, ACTOR_SELF, 2, 0) EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_PTR(N(idleAnimations_8022744C))) diff --git a/src/battle/area_omo/stage/omo_04.c b/src/battle/area_omo/stage/omo_04.c index 25fbf301f2..37594c045a 100644 --- a/src/battle/area_omo/stage/omo_04.c +++ b/src/battle/area_omo/stage/omo_04.c @@ -42,8 +42,8 @@ Stage NAMESPACE = { .preBattle = &N(beforeBattle), .postBattle = &N(afterBattle), .foregroundModelList = N(foregroundModelList), - .specialFormationSize = 4, - .specialFormation = &N(fromation_slot_machine), + .stageEnemyCount = 4, + .stageFormation = &N(fromation_slot_machine), }; Vec3i N(slot_machine_pos1) = { -49, 56, -68 }; diff --git a/src/battle/area_omo2_1/actor/shy_squad.c b/src/battle/area_omo2_1/actor/shy_squad.c index 9d43d235bd..327c8ec8e7 100644 --- a/src/battle/area_omo2_1/actor/shy_squad.c +++ b/src/battle/area_omo2_1/actor/shy_squad.c @@ -901,7 +901,7 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_SPIKE_TAUNT) EVT_CASE_OR_EQ(EVENT_AIR_LIFT_FAILED) EVT_CALL(GetBattleFlags, LVar2) - EVT_IF_FLAG(LVar2, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar2, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2) EVT_IF_EQ(LVar2, MOVE_SPOOK) EVT_SET(LVar1, ANIM_ShySquadGuy_Anim01) diff --git a/src/battle/area_omo2_2/actor/stilt_guy.c b/src/battle/area_omo2_2/actor/stilt_guy.c index 5f56d93abb..8ffc8f030d 100644 --- a/src/battle/area_omo2_2/actor/stilt_guy.c +++ b/src/battle/area_omo2_2/actor/stilt_guy.c @@ -488,11 +488,11 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_SPIN_SMASH_HIT) EVT_CASE_OR_EQ(EVENT_SPIN_SMASH_LAUNCH_HIT) EVT_CALL(GetBattleFlags, LVar2) - EVT_IF_FLAG(LVar2, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar2, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2) - EVT_IF_EQ(LVar2, 183) + EVT_IF_EQ(LVar2, MOVE_SPOOK) EVT_SET(LVar0, 2) - EVT_SET(LVar1, 7340033) + EVT_SET(LVar1, ANIM_StiltGuy_Anim01) EVT_EXEC_WAIT(DoImmune) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_CALL(SetActorVar, ACTOR_SELF, 1, 0) @@ -599,7 +599,7 @@ EvtScript N(handleEvent) = { EvtScript N(check_fall_off) = { EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_IF_FLAG(LVar0, BS_FLAGS1_40 | BS_FLAGS1_200) EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) EVT_END_IF @@ -623,7 +623,7 @@ EvtScript N(check_fall_off) = { EvtScript N(check_fall_off_2) = { EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_IF_FLAG(LVarF, DAMAGE_TYPE_JUMP) EVT_IF_FLAG(LVar0, BS_FLAGS1_40 | BS_FLAGS1_200) EVT_CALL(SetActorVar, ACTOR_SELF, 1, 1) diff --git a/src/battle/area_omo2_3/actor/shy_stack.c b/src/battle/area_omo2_3/actor/shy_stack.c index 30fca5cd39..67c45d7ad4 100644 --- a/src/battle/area_omo2_3/actor/shy_stack.c +++ b/src/battle/area_omo2_3/actor/shy_stack.c @@ -817,9 +817,9 @@ EvtScript N(handleEvent) = { EVT_CASE_OR_EQ(EVENT_IMMUNE) EVT_CASE_OR_EQ(EVENT_SPIKE_TAUNT) EVT_CALL(GetBattleFlags, LVar2) - EVT_IF_FLAG(LVar2, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar2, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetMenuSelection, LVar0, LVar1, LVar2) - EVT_IF_EQ(LVar2, 183) + EVT_IF_EQ(LVar2, MOVE_SPOOK) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) EVT_RETURN EVT_END_IF diff --git a/src/battle/area_omo3/stage/omo_04.c b/src/battle/area_omo3/stage/omo_04.c index 800d2e3ca0..1f198e7654 100644 --- a/src/battle/area_omo3/stage/omo_04.c +++ b/src/battle/area_omo3/stage/omo_04.c @@ -42,8 +42,8 @@ Stage NAMESPACE = { .preBattle = &N(beforeBattle), .postBattle = &N(afterBattle), .foregroundModelList = N(foregroundModelList), - .specialFormationSize = 4, - .specialFormation = &N(fromation_slot_machine), + .stageEnemyCount = 4, + .stageFormation = &N(fromation_slot_machine), }; Vec3i N(slot_machine_pos1) = { -49, 56, -68 }; diff --git a/src/battle/area_trd_part_2/actor/fake_bowser.c b/src/battle/area_trd_part_2/actor/fake_bowser.c index 49615cc778..3a6e21d9db 100644 --- a/src/battle/area_trd_part_2/actor/fake_bowser.c +++ b/src/battle/area_trd_part_2/actor/fake_bowser.c @@ -2728,7 +2728,7 @@ EvtScript N(handleEvent_802242FC) = { EVT_SWITCH(LVar0) EVT_CASE_EQ(EVENT_HIT_COMBO) EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) EVT_BITWISE_OR_CONST(LVar0, 0x80) EVT_CALL(SetActorVar, ACTOR_ENEMY4, 0, LVar0) @@ -2752,7 +2752,7 @@ EvtScript N(handleEvent_802242FC) = { EVT_EXEC_WAIT(N(802235E0)) EVT_CASE_EQ(EVENT_HIT) EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) EVT_BITWISE_OR_CONST(LVar0, 0x80) EVT_CALL(SetActorVar, ACTOR_ENEMY4, 0, LVar0) @@ -2771,8 +2771,8 @@ EvtScript N(handleEvent_802242FC) = { EVT_CALL(SetActorVar, ACTOR_ENEMY4, 0, LVar0) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) - EVT_IF_FLAG(LVar0, 0x00000040) - EVT_IF_FLAG(LVar0, 0x00000080) + EVT_IF_FLAG(LVar0, 0x40) + EVT_IF_FLAG(LVar0, 0x80) EVT_EXEC_WAIT(N(80223718)) EVT_WAIT(20) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) @@ -2787,10 +2787,10 @@ EvtScript N(handleEvent_802242FC) = { EVT_EXEC_WAIT(N(802235E0)) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) - EVT_IF_FLAG(LVar0, 0x00000010) - EVT_IF_NOT_FLAG(LVar0, 0x00000020) + EVT_IF_FLAG(LVar0, 0x10) + EVT_IF_NOT_FLAG(LVar0, 0x20) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) - EVT_CALL(ActorSpeak, MSG_CH1_0109, LVar0, 1, -00001, -00001) + EVT_CALL(ActorSpeak, MSG_CH1_0109, LVar0, 1, -1, -1) EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) EVT_BITWISE_OR_CONST(LVar0, 0x20) EVT_CALL(SetActorVar, ACTOR_ENEMY4, 0, LVar0) @@ -2799,7 +2799,7 @@ EvtScript N(handleEvent_802242FC) = { EVT_END_IF EVT_CASE_EQ(EVENT_BURN_HIT) EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) EVT_BITWISE_OR_CONST(LVar0, 0x80) EVT_CALL(SetActorVar, ACTOR_ENEMY4, 0, LVar0) @@ -2818,8 +2818,8 @@ EvtScript N(handleEvent_802242FC) = { EVT_CALL(SetActorVar, ACTOR_ENEMY4, 0, LVar0) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) - EVT_IF_FLAG(LVar0, 0x00000040) - EVT_IF_FLAG(LVar0, 0x00000080) + EVT_IF_FLAG(LVar0, 0x40) + EVT_IF_FLAG(LVar0, 0x80) EVT_EXEC_WAIT(N(80223718)) EVT_WAIT(20) EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE) @@ -2834,10 +2834,10 @@ EvtScript N(handleEvent_802242FC) = { EVT_EXEC_WAIT(N(802235E0)) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) - EVT_IF_FLAG(LVar0, 0x00000010) - EVT_IF_NOT_FLAG(LVar0, 0x00000020) + EVT_IF_FLAG(LVar0, 0x10) + EVT_IF_NOT_FLAG(LVar0, 0x20) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) - EVT_CALL(ActorSpeak, MSG_CH1_0109, LVar0, 1, -00001, -00001) + EVT_CALL(ActorSpeak, MSG_CH1_0109, LVar0, 1, -1, -1) EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) EVT_BITWISE_OR_CONST(LVar0, 0x20) EVT_CALL(SetActorVar, ACTOR_ENEMY4, 0, LVar0) @@ -2858,7 +2858,7 @@ EvtScript N(handleEvent_802242FC) = { EVT_CALL(SetActorVar, ACTOR_ENEMY4, 0, LVar0) EVT_END_IF EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) - EVT_IF_FLAG(LVar0, 0x00000040) + EVT_IF_FLAG(LVar0, 0x40) EVT_IF_FLAG(LVar0, 0x00000080) EVT_EXEC_WAIT(N(80223718)) EVT_WAIT(20) @@ -2869,10 +2869,10 @@ EvtScript N(handleEvent_802242FC) = { EVT_SET(LVarA, 4) EVT_EXEC_WAIT(N(80223870)) EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) - EVT_IF_FLAG(LVar0, 0x00000010) - EVT_IF_NOT_FLAG(LVar0, 0x00000020) + EVT_IF_FLAG(LVar0, 0x10) + EVT_IF_NOT_FLAG(LVar0, 0x20) EVT_CALL(GetActorVar, ACTOR_SELF, 4, LVar0) - EVT_CALL(ActorSpeak, MSG_CH1_0109, LVar0, 1, -00001, -00001) + EVT_CALL(ActorSpeak, MSG_CH1_0109, LVar0, 1, -1, -1) EVT_CALL(GetActorVar, ACTOR_ENEMY4, 0, LVar0) EVT_BITWISE_OR_CONST(LVar0, 0x20) EVT_CALL(SetActorVar, ACTOR_ENEMY4, 0, LVar0) diff --git a/src/battle/area_trd_part_3/actor/eldstar.c b/src/battle/area_trd_part_3/actor/eldstar.c index cabdd2392d..b231460d25 100644 --- a/src/battle/area_trd_part_3/actor/eldstar.c +++ b/src/battle/area_trd_part_3/actor/eldstar.c @@ -137,8 +137,8 @@ ApiStatus func_80218130_4CF2E0(Evt* script, s32 isInitialCall) { ApiStatus func_80218158_4CF308(Evt* script, s32 isInitialCall) { BattleStatus* battleStatus = &gBattleStatus; - battleStatus->unk_4C[0] = 0; - battleStatus->unk_5C[0] = 0; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = 0; + battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] = 0; return ApiStatus_DONE2; } @@ -150,7 +150,7 @@ ApiStatus func_80218170_4CF320(Evt* script, s32 isInitialCall) { script->functionTemp[0] = 10; } - battleStatus->flags2 &= ~0x2; + battleStatus->flags2 &= ~BS_FLAGS2_2; if (script->functionTemp[0] != 0) { script->functionTemp[0]--; @@ -167,7 +167,7 @@ ApiStatus func_802181B4_4CF364(Evt* script, s32 isInitialCall) { script->functionTemp[0] = 10; } - battleStatus->flags2 &= ~0x4; + battleStatus->flags2 &= ~BS_FLAGS2_4; if (script->functionTemp[0] != 0) { script->functionTemp[0]--; @@ -202,7 +202,7 @@ EvtScript N(takeTurn_80218414) = { }; EvtScript N(80218424) = { - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_2000000, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_TUTORIAL_BATTLE, 1) EVT_CALL(func_80218158_4CF308) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MENU) EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_10002) @@ -214,7 +214,7 @@ EvtScript N(80218424) = { EVT_CALL(SetGoalPos, ACTOR_SELF, -110, 100, 0) EVT_CALL(FlyToGoal, ACTOR_SELF, 20, 0, 10) EVT_CALL(EnableActorBlur, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A) + EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_1002A) EVT_END_THREAD EVT_WAIT(10) EVT_CALL(func_802180C8_4CF278) @@ -227,15 +227,15 @@ EvtScript N(80218424) = { EVT_CALL(EnableActorBlur, ACTOR_SELF, 0) EVT_CALL(ActorSpeak, MSG_CH1_0115, ACTOR_SELF, 1, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle) EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A) + EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_1002A) EVT_CALL(func_802180C8_4CF278) EVT_WAIT(120) EVT_CALL(func_802180E8_4CF298) EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_10002) EVT_CALL(ActorSpeak, MSG_CH1_0116, ACTOR_SELF, 1, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle) EVT_WAIT(10) - EVT_CALL(func_8026E020, 256) - EVT_CALL(func_8026E038, 2) + EVT_CALL(SetBattleMenuDisableFlags, BTL_MENU_DISABLED_STAR_POWERS) + EVT_CALL(SetEnabledStarPowers, 1 << STAR_POWER_INDEX(MOVE_REFRESH)) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MOVE) EVT_SET(LVar0, 255) EVT_LOOP(10) @@ -266,7 +266,7 @@ EvtScript N(80218424) = { EVT_CALL(ActorSpeak, MSG_CH1_0117, ACTOR_SELF, 1, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle) EVT_WAIT(10) EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE) - EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A) + EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_1002A) EVT_CALL(func_802180C8_4CF278) EVT_WAIT(120) EVT_CALL(func_802180E8_4CF298) @@ -284,10 +284,10 @@ EvtScript N(80218424) = { EVT_CALL(SetGoalPos, ACTOR_SELF, -110, 100, 0) EVT_CALL(FlyToGoal, ACTOR_SELF, 20, 0, 10) EVT_CALL(EnableActorBlur, ACTOR_SELF, 0) - EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A) + EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_1002A) EVT_END_THREAD EVT_WAIT(10) - EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A) + EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_1002A) EVT_CALL(func_802180C8_4CF278) EVT_WAIT(120) EVT_CALL(func_802180E8_4CF298) @@ -301,8 +301,8 @@ EvtScript N(80218424) = { EVT_WAIT(10) EVT_CALL(ActorSpeak, MSG_CH1_011B, ACTOR_SELF, 1, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle) EVT_WAIT(10) - EVT_CALL(func_8026E020, 256) - EVT_CALL(func_8026E038, 1) + EVT_CALL(SetBattleMenuDisableFlags, BTL_MENU_DISABLED_STAR_POWERS) + EVT_CALL(SetEnabledStarPowers, 1 << STAR_POWER_INDEX(MOVE_FOCUS)) EVT_CALL(func_80218158_4CF308) EVT_CALL(WaitForState, BATTLE_STATE_PLAYER_MOVE) EVT_SET(LVar0, 255) @@ -334,7 +334,7 @@ EvtScript N(80218424) = { EVT_CALL(ActorSpeak, MSG_CH1_011C, ACTOR_SELF, 1, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle) EVT_WAIT(10) EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE) - EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, 0x01002A) + EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario_1002A) EVT_CALL(func_802180C8_4CF278) EVT_WAIT(120) EVT_CALL(func_802180E8_4CF298) diff --git a/src/battle/battle.c b/src/battle/battle.c index 078506f82f..38bdb5b010 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -6,7 +6,7 @@ #include "sprite.h" extern s32 D_800DC060; -extern StageListRow* D_800DC064; +extern StageListRow* gCurrentStagePtr; BattleArea gBattleAreas[] = { [BTL_AREA_KMR_PART_1] = { @@ -281,16 +281,16 @@ void reset_battle_status(void) { gBattleState = BATTLE_STATE_0; D_800DC4E0 = 1; gBattleSubState = BTL_SUBSTATE_INIT; - D_800DC4D0 = BATTLE_STATE_0; + gLastDrawBattleState = BATTLE_STATE_0; D_800DC4F0 = 0; D_800DC4D4 = 0; - D_800DC4FC = NULL; + gCurrentBattlePtr = NULL; D_800DC4F8 = 0; gCurrentBattleID = 0; - D_800DC064 = NULL; + gCurrentStagePtr = NULL; D_800DC060 = 0; - D_800DC4EC = 0; - D_800DC4F4 = NULL; + gCurrentStageID = 0; + gOverrideBattlePtr = NULL; } void ALT_reset_battle_status(void) { @@ -307,32 +307,32 @@ void load_battle_section(void) { dma_copy(battleArea->dmaStart, battleArea->dmaEnd, battleArea->dmaDest); - D_800DC4FC = &(*battleArea->battles)[battleIdx]; + gCurrentBattlePtr = &(*battleArea->battles)[battleIdx]; - if (D_800DC4EC < 0) { - D_800DC064 = NULL; + if (gCurrentStageID < 0) { + gCurrentStagePtr = NULL; } else { - D_800DC064 = &(*battleArea->stages)[D_800DC4EC]; + gCurrentStagePtr = &(*battleArea->stages)[gCurrentStageID]; } btl_set_state(BATTLE_STATE_NORMAL_START); - D_800DC4D0 = BATTLE_STATE_0; + gLastDrawBattleState = BATTLE_STATE_0; } void load_battle(s32 battleID) { gCurrentBattleID = battleID; set_game_mode(GAME_MODE_BATTLE); gBattleState = BATTLE_STATE_0; - D_800DC4D0 = BATTLE_STATE_0; + gLastDrawBattleState = BATTLE_STATE_0; gBattleSubState = BTL_SUBSTATE_INIT; } -void set_battle_stage(s32 arg0) { - D_800DC4EC = arg0; +void set_battle_stage(s32 stageID) { + gCurrentStageID = stageID; } void set_battle_formation(Battle* battle) { - D_800DC4F4 = battle; + gOverrideBattlePtr = battle; } void func_80072CEC(f32 arg0, f32 arg1, f32 arg2) { @@ -501,8 +501,8 @@ void load_demo_battle(u32 index) { evt_set_variable(NULL, GF_Tutorial_SwapTurnOrder, 1); gCurrentEncounter.unk_07 = 0; - gCurrentEncounter.unk_10 = 0; - set_battle_stage(-1); + gCurrentEncounter.instigatorValue = 0; + set_battle_stage(BTL_STAGE_DEFAULT); gGameStatusPtr->demoFlags |= 1; gOverrideFlags &= ~GLOBAL_OVERRIDES_8; load_battle(battleID); diff --git a/src/battle/battle.h b/src/battle/battle.h index 0bf54c1c82..db50cb66b8 100644 --- a/src/battle/battle.h +++ b/src/battle/battle.h @@ -55,225 +55,225 @@ enum BattleAreaIDs { }; typedef enum ActorType { - ACTOR_TYPE_RED_GOOMBA = 0x00, - ACTOR_TYPE_RED_PARAGOOMBA = 0x01, - ACTOR_TYPE_GLOOMBA = 0x02, - ACTOR_TYPE_PARAGLOOMBA = 0x03, - ACTOR_TYPE_SPIKED_GLOOMBA = 0x04, - ACTOR_TYPE_DARK_KOOPA = 0x05, - ACTOR_TYPE_DARK_PARATROOPA = 0x06, - ACTOR_TYPE_GOOMBA = 0x07, - ACTOR_TYPE_PARAGOOMBA = 0x08, - ACTOR_TYPE_SPIKED_GOOMBA = 0x09, - ACTOR_TYPE_FUZZY = 0x0A, - ACTOR_TYPE_KOOPA_TROOPA = 0x0B, - ACTOR_TYPE_PARATROOPA = 0x0C, - ACTOR_TYPE_BOB_OMB = 0x0D, - ACTOR_TYPE_BOB_OMB_DUP = 0x0E, - ACTOR_TYPE_BULLET_BILL = 0x0F, - ACTOR_TYPE_BILL_BLASTER = 0x10, - ACTOR_TYPE_CLEFT = 0x11, - ACTOR_TYPE_MONTY_MOLE = 0x12, - ACTOR_TYPE_BANDIT = 0x13, - ACTOR_TYPE_POKEY = 0x14, - ACTOR_TYPE_POKEY_MUMMY = 0x15, - ACTOR_TYPE_SWOOPER = 0x16, - ACTOR_TYPE_BUZZY_BEETLE = 0x17, - ACTOR_TYPE_STONE_CHOMP = 0x18, - ACTOR_TYPE_PIRANHA_PLANT = 0x19, - ACTOR_TYPE_FOREST_FUZZY = 0x1A, - ACTOR_TYPE_HYPER_GOOMBA = 0x1B, - ACTOR_TYPE_HYPER_PARAGOOMBA = 0x1C, - ACTOR_TYPE_HYPER_CLEFT = 0x1D, - ACTOR_TYPE_CLUBBA = 0x1E, - ACTOR_TYPE_SHY_GUY = 0x1F, - ACTOR_TYPE_GROOVE_GUY = 0x20, - ACTOR_TYPE_SKY_GUY = 0x21, - ACTOR_TYPE_MEDI_GUY = 0x22, - ACTOR_TYPE_PYRO_GUY = 0x23, - ACTOR_TYPE_SPY_GUY = 0x24, - ACTOR_TYPE_FUZZIPEDE = 0x25, - ACTOR_TYPE_HURT_PLANT = 0x26, - ACTOR_TYPE_M_BUSH = 0x27, - ACTOR_TYPE_AQUA_FUZZY = 0x28, - ACTOR_TYPE_JUNGLE_FUZZY = 0x29, - ACTOR_TYPE_SPEAR_GUY = 0x2A, - ACTOR_TYPE_LAVA_BUBBLE = 0x2B, - ACTOR_TYPE_SPIKE_TOP = 0x2C, - ACTOR_TYPE_PUTRID_PIRANHA = 0x2D, - ACTOR_TYPE_LAKITU = 0x2E, - ACTOR_TYPE_SPINY = 0x2F, - ACTOR_TYPE_MONTY_MOLE_BOSS = 0x30, - ACTOR_TYPE_BZZAP = 0x31, - ACTOR_TYPE_CRAZEE_DAYZEE = 0x32, - ACTOR_TYPE_AMAZY_DAYZEE = 0x33, - ACTOR_TYPE_RUFF_PUFF = 0x34, - ACTOR_TYPE_SPIKE = 0x35, - ACTOR_TYPE_GULPIT = 0x36, - ACTOR_TYPE_GULPIT_ROCKS = 0x37, - ACTOR_TYPE_WHITE_CLUBBA = 0x38, - ACTOR_TYPE_FROST_PIRANHA = 0x39, - ACTOR_TYPE_SWOOPULA = 0x3A, - ACTOR_TYPE_DUPLIGHOST = 0x3B, - ACTOR_TYPE_GHOST_GOOMBARIO = 0x3C, - ACTOR_TYPE_GHOST_KOOPER = 0x3D, - ACTOR_TYPE_GHOST_BOMBETTE = 0x3E, - ACTOR_TYPE_GHOST_PARAKARRY = 0x3F, - ACTOR_TYPE_GHOST_BOW = 0x40, - ACTOR_TYPE_GHOST_WATT = 0x41, - ACTOR_TYPE_GHOST_SUSHIE = 0x42, - ACTOR_TYPE_GHOST_LAKILESTER = 0x43, - ACTOR_TYPE_ALBINO_DINO = 0x44, - ACTOR_TYPE_EMBER = 0x45, - ACTOR_TYPE_BONY_BEETLE = 0x46, - ACTOR_TYPE_DRY_BONES = 0x47, - ACTOR_TYPE_DRY_BONES2 = 0x48, - ACTOR_TYPE_BOMBSHELL_BLASTER = 0x49, - ACTOR_TYPE_BOMBSHELL_BILL = 0x4A, - ACTOR_TYPE_HAMMER_BROS = 0x4B, - ACTOR_TYPE_KOOPATROL = 0x4C, - ACTOR_TYPE_MAGIKOOPA = 0x4D, - ACTOR_TYPE_FLYING_MAGIKOOPA = 0x4E, - ACTOR_TYPE_MAGICLONE = 0x4F, - ACTOR_TYPE_FLYING_MAGICLONE = 0x50, - ACTOR_TYPE_RED_MAGIKOOPA = 0x51, - ACTOR_TYPE_FLYING_RED_MAGIKOOPA = 0x52, - ACTOR_TYPE_GREEN_MAGIKOOPA = 0x53, - ACTOR_TYPE_FLYING_GREEN_MAGIKOOPA = 0x54, - ACTOR_TYPE_YELLOW_MAGIKOOPA = 0x55, - ACTOR_TYPE_FLYING_YELLOW_MAGIKOOPA = 0x56, - ACTOR_TYPE_GRAY_MAGIKOOPA = 0x57, - ACTOR_TYPE_FLYING_GRAY_MAGIKOOPA = 0x58, - ACTOR_TYPE_WHITE_MAGIKOOPA = 0x59, - ACTOR_TYPE_FLYING_WHITE_MAGIKOOPA = 0x5A, + ACTOR_TYPE_RED_GOOMBA = 0x00, + ACTOR_TYPE_RED_PARAGOOMBA = 0x01, + ACTOR_TYPE_GLOOMBA = 0x02, + ACTOR_TYPE_PARAGLOOMBA = 0x03, + ACTOR_TYPE_SPIKED_GLOOMBA = 0x04, + ACTOR_TYPE_DARK_KOOPA = 0x05, + ACTOR_TYPE_DARK_PARATROOPA = 0x06, + ACTOR_TYPE_GOOMBA = 0x07, + ACTOR_TYPE_PARAGOOMBA = 0x08, + ACTOR_TYPE_SPIKED_GOOMBA = 0x09, + ACTOR_TYPE_FUZZY = 0x0A, + ACTOR_TYPE_KOOPA_TROOPA = 0x0B, + ACTOR_TYPE_PARATROOPA = 0x0C, + ACTOR_TYPE_BOB_OMB = 0x0D, + ACTOR_TYPE_BOB_OMB_DUP = 0x0E, + ACTOR_TYPE_BULLET_BILL = 0x0F, + ACTOR_TYPE_BILL_BLASTER = 0x10, + ACTOR_TYPE_CLEFT = 0x11, + ACTOR_TYPE_MONTY_MOLE = 0x12, + ACTOR_TYPE_BANDIT = 0x13, + ACTOR_TYPE_POKEY = 0x14, + ACTOR_TYPE_POKEY_MUMMY = 0x15, + ACTOR_TYPE_SWOOPER = 0x16, + ACTOR_TYPE_BUZZY_BEETLE = 0x17, + ACTOR_TYPE_STONE_CHOMP = 0x18, + ACTOR_TYPE_PIRANHA_PLANT = 0x19, + ACTOR_TYPE_FOREST_FUZZY = 0x1A, + ACTOR_TYPE_HYPER_GOOMBA = 0x1B, + ACTOR_TYPE_HYPER_PARAGOOMBA = 0x1C, + ACTOR_TYPE_HYPER_CLEFT = 0x1D, + ACTOR_TYPE_CLUBBA = 0x1E, + ACTOR_TYPE_SHY_GUY = 0x1F, + ACTOR_TYPE_GROOVE_GUY = 0x20, + ACTOR_TYPE_SKY_GUY = 0x21, + ACTOR_TYPE_MEDI_GUY = 0x22, + ACTOR_TYPE_PYRO_GUY = 0x23, + ACTOR_TYPE_SPY_GUY = 0x24, + ACTOR_TYPE_FUZZIPEDE = 0x25, + ACTOR_TYPE_HURT_PLANT = 0x26, + ACTOR_TYPE_M_BUSH = 0x27, + ACTOR_TYPE_AQUA_FUZZY = 0x28, + ACTOR_TYPE_JUNGLE_FUZZY = 0x29, + ACTOR_TYPE_SPEAR_GUY = 0x2A, + ACTOR_TYPE_LAVA_BUBBLE = 0x2B, + ACTOR_TYPE_SPIKE_TOP = 0x2C, + ACTOR_TYPE_PUTRID_PIRANHA = 0x2D, + ACTOR_TYPE_LAKITU = 0x2E, + ACTOR_TYPE_SPINY = 0x2F, + ACTOR_TYPE_MONTY_MOLE_BOSS = 0x30, + ACTOR_TYPE_BZZAP = 0x31, + ACTOR_TYPE_CRAZEE_DAYZEE = 0x32, + ACTOR_TYPE_AMAZY_DAYZEE = 0x33, + ACTOR_TYPE_RUFF_PUFF = 0x34, + ACTOR_TYPE_SPIKE = 0x35, + ACTOR_TYPE_GULPIT = 0x36, + ACTOR_TYPE_GULPIT_ROCKS = 0x37, + ACTOR_TYPE_WHITE_CLUBBA = 0x38, + ACTOR_TYPE_FROST_PIRANHA = 0x39, + ACTOR_TYPE_SWOOPULA = 0x3A, + ACTOR_TYPE_DUPLIGHOST = 0x3B, + ACTOR_TYPE_GHOST_GOOMBARIO = 0x3C, + ACTOR_TYPE_GHOST_KOOPER = 0x3D, + ACTOR_TYPE_GHOST_BOMBETTE = 0x3E, + ACTOR_TYPE_GHOST_PARAKARRY = 0x3F, + ACTOR_TYPE_GHOST_BOW = 0x40, + ACTOR_TYPE_GHOST_WATT = 0x41, + ACTOR_TYPE_GHOST_SUSHIE = 0x42, + ACTOR_TYPE_GHOST_LAKILESTER = 0x43, + ACTOR_TYPE_ALBINO_DINO = 0x44, + ACTOR_TYPE_EMBER = 0x45, + ACTOR_TYPE_BONY_BEETLE = 0x46, + ACTOR_TYPE_DRY_BONES = 0x47, + ACTOR_TYPE_DRY_BONES2 = 0x48, + ACTOR_TYPE_BOMBSHELL_BLASTER = 0x49, + ACTOR_TYPE_BOMBSHELL_BILL = 0x4A, + ACTOR_TYPE_HAMMER_BROS = 0x4B, + ACTOR_TYPE_KOOPATROL = 0x4C, + ACTOR_TYPE_MAGIKOOPA = 0x4D, + ACTOR_TYPE_FLYING_MAGIKOOPA = 0x4E, + ACTOR_TYPE_MAGICLONE = 0x4F, + ACTOR_TYPE_FLYING_MAGICLONE = 0x50, + ACTOR_TYPE_RED_MAGIKOOPA = 0x51, + ACTOR_TYPE_FLYING_RED_MAGIKOOPA = 0x52, + ACTOR_TYPE_GREEN_MAGIKOOPA = 0x53, + ACTOR_TYPE_FLYING_GREEN_MAGIKOOPA = 0x54, + ACTOR_TYPE_YELLOW_MAGIKOOPA = 0x55, + ACTOR_TYPE_FLYING_YELLOW_MAGIKOOPA = 0x56, + ACTOR_TYPE_GRAY_MAGIKOOPA = 0x57, + ACTOR_TYPE_FLYING_GRAY_MAGIKOOPA = 0x58, + ACTOR_TYPE_WHITE_MAGIKOOPA = 0x59, + ACTOR_TYPE_FLYING_WHITE_MAGIKOOPA = 0x5A, - ACTOR_TYPE_UNUSED_5B = 0x5B, - ACTOR_TYPE_UNUSED_5C = 0x5C, - ACTOR_TYPE_UNUSED_5D = 0x5D, - ACTOR_TYPE_UNUSED_5E = 0x5E, - ACTOR_TYPE_UNUSED_5F = 0x5F, - ACTOR_TYPE_UNUSED_60 = 0x60, - ACTOR_TYPE_UNUSED_61 = 0x61, - ACTOR_TYPE_UNUSED_62 = 0x62, - ACTOR_TYPE_UNUSED_63 = 0x63, - ACTOR_TYPE_UNUSED_64 = 0x64, - ACTOR_TYPE_UNUSED_65 = 0x65, - ACTOR_TYPE_UNUSED_66 = 0x66, - ACTOR_TYPE_UNUSED_67 = 0x67, - ACTOR_TYPE_UNUSED_68 = 0x68, - ACTOR_TYPE_UNUSED_69 = 0x69, - ACTOR_TYPE_UNUSED_6A = 0x6A, + ACTOR_TYPE_UNUSED_5B = 0x5B, + ACTOR_TYPE_UNUSED_5C = 0x5C, + ACTOR_TYPE_UNUSED_5D = 0x5D, + ACTOR_TYPE_UNUSED_5E = 0x5E, + ACTOR_TYPE_UNUSED_5F = 0x5F, + ACTOR_TYPE_UNUSED_60 = 0x60, + ACTOR_TYPE_UNUSED_61 = 0x61, + ACTOR_TYPE_UNUSED_62 = 0x62, + ACTOR_TYPE_UNUSED_63 = 0x63, + ACTOR_TYPE_UNUSED_64 = 0x64, + ACTOR_TYPE_UNUSED_65 = 0x65, + ACTOR_TYPE_UNUSED_66 = 0x66, + ACTOR_TYPE_UNUSED_67 = 0x67, + ACTOR_TYPE_UNUSED_68 = 0x68, + ACTOR_TYPE_UNUSED_69 = 0x69, + ACTOR_TYPE_UNUSED_6A = 0x6A, - ACTOR_TYPE_MONTY_HOLE = 0x6B, + ACTOR_TYPE_MONTY_HOLE = 0x6B, - ACTOR_TYPE_UNUSED_6C = 0x6C, - ACTOR_TYPE_UNUSED_6D = 0x6D, + ACTOR_TYPE_UNUSED_6C = 0x6C, + ACTOR_TYPE_UNUSED_6D = 0x6D, - ACTOR_TYPE_PLAYER = 0x6E, - ACTOR_TYPE_GOOMBARIO = 0x6F, - ACTOR_TYPE_KOOPER = 0x70, - ACTOR_TYPE_BOMBETTE = 0x71, - ACTOR_TYPE_PARAKARRY = 0x72, - ACTOR_TYPE_BOW = 0x73, - ACTOR_TYPE_WATT = 0x74, - ACTOR_TYPE_SUSHIE = 0x75, - ACTOR_TYPE_LAKILESTER = 0x76, - ACTOR_TYPE_TWINK = 0x77, + ACTOR_TYPE_PLAYER = 0x6E, + ACTOR_TYPE_GOOMBARIO = 0x6F, + ACTOR_TYPE_KOOPER = 0x70, + ACTOR_TYPE_BOMBETTE = 0x71, + ACTOR_TYPE_PARAKARRY = 0x72, + ACTOR_TYPE_BOW = 0x73, + ACTOR_TYPE_WATT = 0x74, + ACTOR_TYPE_SUSHIE = 0x75, + ACTOR_TYPE_LAKILESTER = 0x76, + ACTOR_TYPE_TWINK = 0x77, - ACTOR_TYPE_UNUSED_78 = 0x78, - ACTOR_TYPE_UNUSED_79 = 0x79, + ACTOR_TYPE_UNUSED_78 = 0x78, + ACTOR_TYPE_UNUSED_79 = 0x79, - ACTOR_TYPE_THE_MASTER_1 = 0x7A, - ACTOR_TYPE_THE_MASTER_2 = 0x7B, - ACTOR_TYPE_THE_MASTER_3 = 0x7C, - ACTOR_TYPE_CHAN = 0x7D, - ACTOR_TYPE_LEE = 0x7E, - ACTOR_TYPE_LEE_GOOMBARIO = 0x7F, - ACTOR_TYPE_LEE_KOOPER = 0x80, - ACTOR_TYPE_LEE_BOMBETTE = 0x81, - ACTOR_TYPE_LEE_PARAKARRY = 0x82, - ACTOR_TYPE_LEE_BOW = 0x83, - ACTOR_TYPE_LEE_WATT = 0x84, - ACTOR_TYPE_LEE_SUSHIE = 0x85, - ACTOR_TYPE_LEE_LAKILESTER = 0x86, - ACTOR_TYPE_KAMMY_KOOPA = 0x87, - ACTOR_TYPE_JR_TROOPA1 = 0x88, - ACTOR_TYPE_JR_TROOPA2 = 0x89, - ACTOR_TYPE_JR_TROOPA3 = 0x8A, - ACTOR_TYPE_JR_TROOPA4 = 0x8B, - ACTOR_TYPE_JR_TROOPA5 = 0x8C, - ACTOR_TYPE_JR_TROOPA6 = 0x8D, - ACTOR_TYPE_JR_TROOPA_DUP1 = 0x8E, - ACTOR_TYPE_JR_TROOPA_DUP2 = 0x8F, - ACTOR_TYPE_BLUE_GOOMBA_BOSS = 0x90, - ACTOR_TYPE_RED_GOOMBA_BOSS = 0x91, - ACTOR_TYPE_GOOMBA_KING = 0x92, - ACTOR_TYPE_GOOMNUT_TREE = 0x93, - ACTOR_TYPE_GOOMBARIO_TUTOR1 = 0x94, - ACTOR_TYPE_MAGIKOOPA_BOSS = 0x95, - ACTOR_TYPE_FLYING_MAGIKOOPA_BOSS = 0x96, - ACTOR_TYPE_MAGIKOOPA_DUP1 = 0x97, - ACTOR_TYPE_MAGIKOOPA_DUP2 = 0x98, - ACTOR_TYPE_FAKE_BOWSER = 0x99, - ACTOR_TYPE_KOOPA_BROS = 0x9A, - ACTOR_TYPE_GREEN_NINJAKOOPA = 0x9B, - ACTOR_TYPE_RED_NINJAKOOPA = 0x9C, - ACTOR_TYPE_BLUE_NINJAKOOPA = 0x9D, - ACTOR_TYPE_YELLOW_NINJAKOOPA = 0x9E, - ACTOR_TYPE_ELDSTAR = 0x9F, - ACTOR_TYPE_BUZZAR = 0xA0, - ACTOR_TYPE_TUTANKOOPA = 0xA1, - ACTOR_TYPE_CHOMP = 0xA2, - ACTOR_TYPE_TUBBA_BLUBBA_INVINCIBLE = 0xA3, - ACTOR_TYPE_TUBBA_BLUBBA = 0xA4, - ACTOR_TYPE_TUBBA_HEART = 0xA5, - ACTOR_TYPE_STILT_GUY = 0xA6, - ACTOR_TYPE_SHY_STACK = 0xA7, - ACTOR_TYPE_SHY_SQUAD = 0xA8, - ACTOR_TYPE_GENERAL_GUY = 0xA9, - ACTOR_TYPE_TOY_TANK = 0xAA, - ACTOR_TYPE_LIGHT_BULB = 0xAB, - ACTOR_TYPE_SIGNAL_GUY = 0xAC, - ACTOR_TYPE_SHY_SQUAD_DUP = 0xAD, - ACTOR_TYPE_SHY_GUY_DUP = 0xAE, - ACTOR_TYPE_ANTI_GUY = 0xAF, - ACTOR_TYPE_ANTI_GUY_DUP = 0xB0, - ACTOR_TYPE_BIG_LANTERN_GHOST = 0xB1, - ACTOR_TYPE_GOOMBA_KING_DUP = 0xB2, - ACTOR_TYPE_LAVA_PIRANHA_PHASE_1 = 0xB3, - ACTOR_TYPE_LAVA_PIRANHA_PHASE_2 = 0xB4, - ACTOR_TYPE_LAVA_BUD_PHASE_1 = 0xB5, - ACTOR_TYPE_LAVA_BUD_PHASE_2 = 0xB6, - ACTOR_TYPE_PETIT_PIRANHA = 0xB7, - ACTOR_TYPE_PETIT_PIRANHA_BOMB = 0xB8, - ACTOR_TYPE_KENT_C_KOOPA = 0xB9, - ACTOR_TYPE_HUFF_N_PUFF = 0xBA, - ACTOR_TYPE_TUFF_PUFF = 0xBB, - ACTOR_TYPE_MONSTAR = 0xBC, - ACTOR_TYPE_CRYSTAL_KING = 0xBD, - ACTOR_TYPE_CRYSTAL_CLONE = 0xBE, - ACTOR_TYPE_CRYSTAL_BIT = 0xBF, - ACTOR_TYPE_INTRO_BOWSER = 0xC0, - ACTOR_TYPE_BOWSER_PHASE_1 = 0xC1, - ACTOR_TYPE_BOWSER_DUP1 = 0xC2, - ACTOR_TYPE_BOWSER_PHASE_2 = 0xC3, - ACTOR_TYPE_BOWSER_DUP2 = 0xC4, - ACTOR_TYPE_BOWSER_PHASE_3 = 0xC5, - ACTOR_TYPE_BOWSER_DUP3 = 0xC6, - ACTOR_TYPE_BLOOPER = 0xC7, - ACTOR_TYPE_ELECTRO_BLOOPER1 = 0xC8, - ACTOR_TYPE_ELECTRO_BLOOPER2 = 0xC9, - ACTOR_TYPE_SUPER_BLOOPER1 = 0xCA, - ACTOR_TYPE_SUPER_BLOOPER2 = 0xCB, - ACTOR_TYPE_BLOOPER_BABY = 0xCC, - ACTOR_TYPE_LAKILESTER_DUP = 0xCD, - ACTOR_TYPE_SLOT_MACHINE_START = 0xCE, - ACTOR_TYPE_SLOT_MACHINE_STOP = 0xCF, - ACTOR_TYPE_WHACKA = 0xD0, - ACTOR_TYPE_SLOT_MACHINE_START_DUP1 = 0xD1, - ACTOR_TYPE_SLOT_MACHINE_START_DUP2 = 0xD2, - ACTOR_TYPE_SLOT_MACHINE_START_DUP3 = 0xD3, - ACTOR_TYPE_COUNT = 0xD4, + ACTOR_TYPE_THE_MASTER_1 = 0x7A, + ACTOR_TYPE_THE_MASTER_2 = 0x7B, + ACTOR_TYPE_THE_MASTER_3 = 0x7C, + ACTOR_TYPE_CHAN = 0x7D, + ACTOR_TYPE_LEE = 0x7E, + ACTOR_TYPE_LEE_GOOMBARIO = 0x7F, + ACTOR_TYPE_LEE_KOOPER = 0x80, + ACTOR_TYPE_LEE_BOMBETTE = 0x81, + ACTOR_TYPE_LEE_PARAKARRY = 0x82, + ACTOR_TYPE_LEE_BOW = 0x83, + ACTOR_TYPE_LEE_WATT = 0x84, + ACTOR_TYPE_LEE_SUSHIE = 0x85, + ACTOR_TYPE_LEE_LAKILESTER = 0x86, + ACTOR_TYPE_KAMMY_KOOPA = 0x87, + ACTOR_TYPE_JR_TROOPA1 = 0x88, + ACTOR_TYPE_JR_TROOPA2 = 0x89, + ACTOR_TYPE_JR_TROOPA3 = 0x8A, + ACTOR_TYPE_JR_TROOPA4 = 0x8B, + ACTOR_TYPE_JR_TROOPA5 = 0x8C, + ACTOR_TYPE_JR_TROOPA6 = 0x8D, + ACTOR_TYPE_JR_TROOPA_DUP1 = 0x8E, + ACTOR_TYPE_JR_TROOPA_DUP2 = 0x8F, + ACTOR_TYPE_BLUE_GOOMBA_BOSS = 0x90, + ACTOR_TYPE_RED_GOOMBA_BOSS = 0x91, + ACTOR_TYPE_GOOMBA_KING = 0x92, + ACTOR_TYPE_GOOMNUT_TREE = 0x93, + ACTOR_TYPE_GOOMBARIO_TUTOR1 = 0x94, + ACTOR_TYPE_MAGIKOOPA_BOSS = 0x95, + ACTOR_TYPE_FLYING_MAGIKOOPA_BOSS = 0x96, + ACTOR_TYPE_MAGIKOOPA_DUP1 = 0x97, + ACTOR_TYPE_MAGIKOOPA_DUP2 = 0x98, + ACTOR_TYPE_FAKE_BOWSER = 0x99, + ACTOR_TYPE_KOOPA_BROS = 0x9A, + ACTOR_TYPE_GREEN_NINJAKOOPA = 0x9B, + ACTOR_TYPE_RED_NINJAKOOPA = 0x9C, + ACTOR_TYPE_BLUE_NINJAKOOPA = 0x9D, + ACTOR_TYPE_YELLOW_NINJAKOOPA = 0x9E, + ACTOR_TYPE_ELDSTAR = 0x9F, + ACTOR_TYPE_BUZZAR = 0xA0, + ACTOR_TYPE_TUTANKOOPA = 0xA1, + ACTOR_TYPE_CHOMP = 0xA2, + ACTOR_TYPE_TUBBA_BLUBBA_INVINCIBLE = 0xA3, + ACTOR_TYPE_TUBBA_BLUBBA = 0xA4, + ACTOR_TYPE_TUBBA_HEART = 0xA5, + ACTOR_TYPE_STILT_GUY = 0xA6, + ACTOR_TYPE_SHY_STACK = 0xA7, + ACTOR_TYPE_SHY_SQUAD = 0xA8, + ACTOR_TYPE_GENERAL_GUY = 0xA9, + ACTOR_TYPE_TOY_TANK = 0xAA, + ACTOR_TYPE_LIGHT_BULB = 0xAB, + ACTOR_TYPE_SIGNAL_GUY = 0xAC, + ACTOR_TYPE_SHY_SQUAD_DUP = 0xAD, + ACTOR_TYPE_SHY_GUY_DUP = 0xAE, + ACTOR_TYPE_ANTI_GUY = 0xAF, + ACTOR_TYPE_ANTI_GUY_DUP = 0xB0, + ACTOR_TYPE_BIG_LANTERN_GHOST = 0xB1, + ACTOR_TYPE_GOOMBA_KING_DUP = 0xB2, + ACTOR_TYPE_LAVA_PIRANHA_PHASE_1 = 0xB3, + ACTOR_TYPE_LAVA_PIRANHA_PHASE_2 = 0xB4, + ACTOR_TYPE_LAVA_BUD_PHASE_1 = 0xB5, + ACTOR_TYPE_LAVA_BUD_PHASE_2 = 0xB6, + ACTOR_TYPE_PETIT_PIRANHA = 0xB7, + ACTOR_TYPE_PETIT_PIRANHA_BOMB = 0xB8, + ACTOR_TYPE_KENT_C_KOOPA = 0xB9, + ACTOR_TYPE_HUFF_N_PUFF = 0xBA, + ACTOR_TYPE_TUFF_PUFF = 0xBB, + ACTOR_TYPE_MONSTAR = 0xBC, + ACTOR_TYPE_CRYSTAL_KING = 0xBD, + ACTOR_TYPE_CRYSTAL_CLONE = 0xBE, + ACTOR_TYPE_CRYSTAL_BIT = 0xBF, + ACTOR_TYPE_INTRO_BOWSER = 0xC0, + ACTOR_TYPE_BOWSER_PHASE_1 = 0xC1, + ACTOR_TYPE_BOWSER_DUP1 = 0xC2, + ACTOR_TYPE_BOWSER_PHASE_2 = 0xC3, + ACTOR_TYPE_BOWSER_DUP2 = 0xC4, + ACTOR_TYPE_BOWSER_PHASE_3 = 0xC5, + ACTOR_TYPE_BOWSER_DUP3 = 0xC6, + ACTOR_TYPE_BLOOPER = 0xC7, + ACTOR_TYPE_ELECTRO_BLOOPER1 = 0xC8, + ACTOR_TYPE_ELECTRO_BLOOPER2 = 0xC9, + ACTOR_TYPE_SUPER_BLOOPER1 = 0xCA, + ACTOR_TYPE_SUPER_BLOOPER2 = 0xCB, + ACTOR_TYPE_BLOOPER_BABY = 0xCC, + ACTOR_TYPE_LAKILESTER_DUP = 0xCD, + ACTOR_TYPE_SLOT_MACHINE_START = 0xCE, + ACTOR_TYPE_SLOT_MACHINE_STOP = 0xCF, + ACTOR_TYPE_WHACKA = 0xD0, + ACTOR_TYPE_SLOT_MACHINE_START_DUP1 = 0xD1, + ACTOR_TYPE_SLOT_MACHINE_START_DUP2 = 0xD2, + ACTOR_TYPE_SLOT_MACHINE_START_DUP3 = 0xD3, + ACTOR_TYPE_COUNT = 0xD4, } ActorType; extern s32 bActorNames[]; @@ -339,13 +339,13 @@ typedef struct Stage { /* 0x00 */ char* texture; /* 0x04 */ const char* shape; /* 0x08 */ const char* hit; - /* 0x0C */ EvtScript* preBattle; - /* 0x10 */ EvtScript* postBattle; + /* 0x0C */ EvtScript* preBattle; // sets BattleStatus::controlScript on battle start + /* 0x10 */ EvtScript* postBattle; // sets BattleStatus::controlScript on battle end /* 0x14 */ char* bg; /* 0x18 */ s32* foregroundModelList; - /* 0x1C */ s32 specialFormationSize; - /* 0x20 */ Formation* specialFormation; - /* 0x24 */ s32 unk_24; + /* 0x1C */ s32 stageEnemyCount; // number of enemies in the stageFormation + /* 0x20 */ Formation* stageFormation; // extra enemies native to this stage + /* 0x24 */ s32 stageEnemyChance; // chance for stageFormation enemies to spawn: N = 0 means always, N > 0 is 1/N chance } Stage; // size = 0x28 /// Zero-terminated. @@ -354,7 +354,7 @@ typedef struct Battle { /* 0x04 */ s32 formationSize; /* 0x08 */ Formation* formation; /* 0x0C */ Stage* stage; - /* 0x10 */ EvtScript* unk_10; + /* 0x10 */ EvtScript* onBattleStart; // sets BattleStatus::controlScript on battle start, overrides Stage::preBattle } Battle; // size = 0x14 typedef Battle BattleList[]; @@ -400,7 +400,7 @@ typedef struct ActorOffsets { /* 0x03 */ s8 shadow; } ActorOffsets; // size = 0x04 -extern BattleList* D_800DC4FC; +extern Battle* gCurrentBattlePtr; extern ActorOffsets bActorOffsets[ACTOR_TYPE_COUNT]; diff --git a/src/battle/common/actor/bandit.inc.c b/src/battle/common/actor/bandit.inc.c index 6790d75c8a..e1e21af49e 100644 --- a/src/battle/common/actor/bandit.inc.c +++ b/src/battle/common/actor/bandit.inc.c @@ -230,7 +230,7 @@ EvtScript N(dropCoin) = { EVT_CALL(PlaySoundAtActor, LVarA, SOUND_212) EVT_LOOP(0) EVT_CALL(GetBattleFlags, LVar1) - EVT_IF_FLAG(LVar1, BS_FLAGS1_80000) + EVT_IF_FLAG(LVar1, BS_FLAGS1_PARTNER_ACTING) EVT_BREAK_LOOP EVT_END_IF EVT_IF_NOT_FLAG(LVar1, BS_FLAGS1_100) @@ -494,7 +494,7 @@ EvtScript N(takeTurn) = { EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(10.0)) EVT_CALL(SetGoalPos, ACTOR_SELF, 300, 0, 0) EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE) - EVT_CALL(SetBattleFlagBits, BS_FLAGS1_ENEMY_FLED, 1) + EVT_CALL(SetBattleFlagBits, BS_FLAGS1_BATTLE_FLED, 1) EVT_CALL(func_8027D32C, ACTOR_SELF) EVT_CALL(RemoveActor, ACTOR_SELF) EVT_RETURN diff --git a/src/battle/common/actor/gray_magikoopa.inc.c b/src/battle/common/actor/gray_magikoopa.inc.c index 10b62f8b84..44fead4bbd 100644 --- a/src/battle/common/actor/gray_magikoopa.inc.c +++ b/src/battle/common/actor/gray_magikoopa.inc.c @@ -315,7 +315,7 @@ EvtScript N(handleEvent) = { EvtScript N(canBeKnockedOff) = { EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_IF_FLAG(LVar0, BS_FLAGS1_40 | BS_FLAGS1_200) EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) EVT_END_IF diff --git a/src/battle/common/actor/green_magikoopa.inc.c b/src/battle/common/actor/green_magikoopa.inc.c index 5342cc9f6f..3d7bb24a7b 100644 --- a/src/battle/common/actor/green_magikoopa.inc.c +++ b/src/battle/common/actor/green_magikoopa.inc.c @@ -317,7 +317,7 @@ EvtScript N(handleEvent) = { EvtScript N(canBeKnockedOff) = { EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_IF_FLAG(LVar0, BS_FLAGS1_40 | BS_FLAGS1_200) EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) EVT_END_IF diff --git a/src/battle/common/actor/magikoopa.inc.c b/src/battle/common/actor/magikoopa.inc.c index 5662d2b7dd..3b05f9f461 100644 --- a/src/battle/common/actor/magikoopa.inc.c +++ b/src/battle/common/actor/magikoopa.inc.c @@ -276,7 +276,7 @@ EvtScript N(idle) = { EvtScript N(canBeKnockedOff) = { EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_IF_FLAG(LVar0, BS_FLAGS1_200 | BS_FLAGS1_40) EVT_CALL(SetActorVar, ACTOR_SELF, N(VAR_CAN_FALL), 1) EVT_END_IF diff --git a/src/battle/common/actor/red_magikoopa.inc.c b/src/battle/common/actor/red_magikoopa.inc.c index 505b7326cf..593c4ba949 100644 --- a/src/battle/common/actor/red_magikoopa.inc.c +++ b/src/battle/common/actor/red_magikoopa.inc.c @@ -315,7 +315,7 @@ EvtScript N(handleEvent) = { EvtScript N(canBeKnockedOff) = { EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_IF_FLAG(LVar0, BS_FLAGS1_40 | BS_FLAGS1_200) EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) EVT_END_IF diff --git a/src/battle/common/actor/white_magikoopa.inc.c b/src/battle/common/actor/white_magikoopa.inc.c index a56a115e43..8b29afae3b 100644 --- a/src/battle/common/actor/white_magikoopa.inc.c +++ b/src/battle/common/actor/white_magikoopa.inc.c @@ -318,7 +318,7 @@ EvtScript N(handleEvent_80223E24) = { EvtScript N(canBeKnockedOff) = { EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_IF_FLAG(LVar0, BS_FLAGS1_40 | BS_FLAGS1_200) EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) EVT_END_IF diff --git a/src/battle/common/actor/yellow_magikoopa.inc.c b/src/battle/common/actor/yellow_magikoopa.inc.c index e8d847b2e9..07fde4f0f8 100644 --- a/src/battle/common/actor/yellow_magikoopa.inc.c +++ b/src/battle/common/actor/yellow_magikoopa.inc.c @@ -314,7 +314,7 @@ EvtScript N(handleEvent) = { EvtScript N(canBeKnockedOff) = { EVT_CALL(GetBattleFlags, LVar0) - EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_80000) + EVT_IF_NOT_FLAG(LVar0, BS_FLAGS1_PARTNER_ACTING) EVT_IF_FLAG(LVar0, BS_FLAGS1_40 | BS_FLAGS1_200) EVT_CALL(SetActorVar, ACTOR_SELF, 0, 1) EVT_END_IF diff --git a/src/battle/item/ItemRefund.inc.c b/src/battle/item/ItemRefund.inc.c index 0aa020c285..8758191615 100644 --- a/src/battle/item/ItemRefund.inc.c +++ b/src/battle/item/ItemRefund.inc.c @@ -7,7 +7,7 @@ static s32 itemIcon; ApiStatus N(GiveRefund)(Evt* script, s32 isInitialCall) { BattleStatus* battleStatus = &gBattleStatus; Actor* player = gBattleStatus.playerActor; - s32 sellValue = gItemTable[battleStatus->selectedItemID].sellValue; + s32 sellValue = gItemTable[battleStatus->moveArgument].sellValue; f32 posX; f32 posY = player->currentPos.y + player->size.y; f32 posZ; @@ -51,7 +51,7 @@ ApiStatus N(GiveRefund)(Evt* script, s32 isInitialCall) { ApiStatus N(GiveRefundCleanup)(Evt* script, s32 isInitialCall) { BattleStatus* battleStatus = &gBattleStatus; - s32 sellValue = gItemTable[battleStatus->selectedItemID].sellValue; + s32 sellValue = gItemTable[battleStatus->moveArgument].sellValue; if (player_team_is_ability_active(battleStatus->playerActor, ABILITY_REFUND) && sellValue > 0) { hud_element_free(itemIcon); diff --git a/src/battle/item/electro_pop.c b/src/battle/item/electro_pop.c index 6936980f1e..2b8009e8e4 100644 --- a/src/battle/item/electro_pop.c +++ b/src/battle/item/electro_pop.c @@ -8,7 +8,7 @@ ApiStatus N(func_802A123C_7307DC)(Evt* script, s32 isInitialCall) { Actor* player = battleStatus->playerActor; inflict_status(player, STATUS_STATIC, script->varTable[0]); - player->status = 0; + player->statusAfflicted = 0; return ApiStatus_DONE2; } diff --git a/src/battle/item/food.c b/src/battle/item/food.c index 12fdf9acdf..f214da1c2b 100644 --- a/src/battle/item/food.c +++ b/src/battle/item/food.c @@ -37,7 +37,7 @@ ApiStatus N(func_802A12EC_7333BC)(Evt* script, s32 isInitialCall) { partner->disableEffect->data.disableX->koDuration = partner->koDuration; } else { partner->koStatus = 0; - dispatch_event_partner(EVENT_RECOVER_PARTNER); + dispatch_event_partner(EVENT_RECOVER_FROM_KO); partner->disableEffect->data.disableX->koDuration = 0; } diff --git a/src/battle/item/life_shroom.c b/src/battle/item/life_shroom.c index a7ec3d18fa..0d2f073641 100644 --- a/src/battle/item/life_shroom.c +++ b/src/battle/item/life_shroom.c @@ -37,7 +37,7 @@ ApiStatus N(func_802A12EC_72E81C)(Evt* script, s32 isInitialCall) { partner->disableEffect->data.disableX->koDuration = partner->koDuration; } else { partner->koStatus = 0; - dispatch_event_partner(EVENT_RECOVER_PARTNER); + dispatch_event_partner(EVENT_RECOVER_FROM_KO); partner->disableEffect->data.disableX->koDuration = 0; } diff --git a/src/battle/item/mushroom.c b/src/battle/item/mushroom.c index 7445d5585c..46d9d43eed 100644 --- a/src/battle/item/mushroom.c +++ b/src/battle/item/mushroom.c @@ -37,7 +37,7 @@ ApiStatus N(func_802A12EC_715B3C)(Evt* script, s32 isInitialCall) { partner->disableEffect->data.disableX->koDuration = partner->koDuration; } else { partner->koStatus = 0; - dispatch_event_partner(EVENT_RECOVER_PARTNER); + dispatch_event_partner(EVENT_RECOVER_FROM_KO); partner->disableEffect->data.disableX->koDuration = 0; } diff --git a/src/battle/item/mystery.c b/src/battle/item/mystery.c index c5931cd619..7f66767057 100644 --- a/src/battle/item/mystery.c +++ b/src/battle/item/mystery.c @@ -149,8 +149,8 @@ s32 N(func_802A13E4_72C994)(Evt* script, s32 isInitialCall) { } var_v0_3 = i = D_802A25E8 / 26; // use of i required to match - battleStatus->selectedItemID = D_802A25FC[D_802A25E8 / 26]; - script->varTable[0] = battleStatus->selectedItemID; + battleStatus->moveArgument = D_802A25FC[D_802A25E8 / 26]; + script->varTable[0] = battleStatus->moveArgument; free_worker(D_802A25F8); for (i = 0; i < ARRAY_COUNT(D_802A25C8); i++) { hud_element_free(D_802A25C8[i]); diff --git a/src/battle/item/repel_gel.c b/src/battle/item/repel_gel.c index d9caf4a50a..805ac44c59 100644 --- a/src/battle/item/repel_gel.c +++ b/src/battle/item/repel_gel.c @@ -8,7 +8,7 @@ ApiStatus N(func_802A123C_72DDAC)(Evt* script, s32 isInitialCall) { ActorPart* part = player->partsTable; inflict_status(player, STATUS_TRANSPARENT, script->varTable[0]); - player->status = 0; + player->statusAfflicted = 0; part->flags |= ACTOR_PART_FLAG_100; return ApiStatus_DONE2; diff --git a/src/battle/item/stone_cap.c b/src/battle/item/stone_cap.c index 1fb579ad4b..ed28af8ad5 100644 --- a/src/battle/item/stone_cap.c +++ b/src/battle/item/stone_cap.c @@ -15,7 +15,7 @@ ApiStatus N(func_802A123C_7217DC)(Evt* script, s32 isInitialCall) { switch (script->functionTemp[0]) { case 0: inflict_status(player, STATUS_STONE, script->varTable[0]); - player->status = 0; + player->statusAfflicted = 0; script->functionTemp[1] = 3; script->functionTemp[0] = 1; break; diff --git a/src/battle/item/strange_cake.c b/src/battle/item/strange_cake.c index 4bdb114c40..7593e612b4 100644 --- a/src/battle/item/strange_cake.c +++ b/src/battle/item/strange_cake.c @@ -140,8 +140,8 @@ s32 N(func_802A13E4_7316E4)(Evt* script, s32 isInitialCall) { } var_v0_3 = i = D_802A2DF0 / 26; // use of i required to match - battleStatus->selectedItemID = N(D_802A2858_732B58)[var_v0_3]; - script->varTable[0] = battleStatus->selectedItemID; + battleStatus->moveArgument = N(D_802A2858_732B58)[var_v0_3]; + script->varTable[0] = battleStatus->moveArgument; free_worker(D_802A2E00); for (i = 0; i < ARRAY_COUNT(D_802A2DD8); i++) { hud_element_free(D_802A2DD8[i]); @@ -210,7 +210,7 @@ ApiStatus N(func_802A1AD8_731DD8)(Evt* script, s32 isInitialCall) { Actor* player = battleStatus->playerActor; inflict_status(player, STATUS_STATIC, 3); - player->status = 0; + player->statusAfflicted = 0; return ApiStatus_DONE2; } @@ -221,7 +221,7 @@ ApiStatus N(func_802A1B14_731E14)(Evt* script, s32 isInitialCall) { ActorPart* part = player->partsTable; inflict_status(player, STATUS_TRANSPARENT, 3); - player->status = 0; + player->statusAfflicted = 0; part->flags |= ACTOR_PART_FLAG_100; return ApiStatus_DONE2; @@ -232,7 +232,7 @@ ApiStatus N(func_802A1B68_731E68)(Evt* script, s32 isInitialCall) { Actor* player = battleStatus->playerActor; inflict_status(player, STATUS_SLEEP, 3); - player->status = 0; + player->statusAfflicted = 0; return ApiStatus_DONE2; } diff --git a/src/battle/item/super_soda.c b/src/battle/item/super_soda.c index 78b4e048d6..e2ba51339b 100644 --- a/src/battle/item/super_soda.c +++ b/src/battle/item/super_soda.c @@ -37,7 +37,7 @@ ApiStatus N(func_802A12EC_724FCC)(Evt* script, s32 isInitialCall) { partner->disableEffect->data.disableX->koDuration = partner->koDuration; } else { partner->koStatus = 0; - dispatch_event_partner(EVENT_RECOVER_PARTNER); + dispatch_event_partner(EVENT_RECOVER_FROM_KO); partner->disableEffect->data.disableX->koDuration = 0; } diff --git a/src/battle/item/volt_shroom.c b/src/battle/item/volt_shroom.c index 69c1b423c4..ff0ab757f9 100644 --- a/src/battle/item/volt_shroom.c +++ b/src/battle/item/volt_shroom.c @@ -7,7 +7,7 @@ ApiStatus N(func_802A123C_71AA2C)(Evt* script, s32 isInitialCall) { Actor* player = battleStatus->playerActor; inflict_status(player, STATUS_STATIC, script->varTable[0]); - player->status = 0; + player->statusAfflicted = 0; return ApiStatus_DONE2; } diff --git a/src/battle/partner/bombette.c b/src/battle/partner/bombette.c index 14516b54cc..0b6aa7b8e9 100644 --- a/src/battle/partner/bombette.c +++ b/src/battle/partner/bombette.c @@ -567,7 +567,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_33) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Hurt) EVT_EXEC_WAIT(DoPartnerHit) - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_SET_CONST(LVar0, 1) EVT_SET_CONST(LVar1, ANIM_BattleBombette_Idle) EVT_SET_CONST(LVar2, ANIM_BattleBombette_Run) diff --git a/src/battle/partner/bow.c b/src/battle/partner/bow.c index 90a3916939..a132a1c137 100644 --- a/src/battle/partner/bow.c +++ b/src/battle/partner/bow.c @@ -284,7 +284,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_33) EVT_SET_CONST(LVar1, ANIM_BattleBow_Hurt) EVT_EXEC_WAIT(DoPartnerHit) - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_SET_CONST(LVar0, 1) EVT_SET_CONST(LVar1, ANIM_BattleBow_Idle) EVT_SET_CONST(LVar2, ANIM_BattleBow_Run) diff --git a/src/battle/partner/goombario.c b/src/battle/partner/goombario.c index 81f714f755..f12a577f23 100644 --- a/src/battle/partner/goombario.c +++ b/src/battle/partner/goombario.c @@ -617,7 +617,7 @@ EvtScript N(handleEvent) = { EVT_CALL(N(StopCharge)) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_HurtStill) EVT_EXEC_WAIT(DoPartnerHit) - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_SET_CONST(LVar0, 1) EVT_SET_CONST(LVar1, ANIM_BattleGoombario_Idle) EVT_SET_CONST(LVar2, ANIM_BattleGoombario_Run) diff --git a/src/battle/partner/goompa.c b/src/battle/partner/goompa.c index e294966342..f3b68f7ee4 100644 --- a/src/battle/partner/goompa.c +++ b/src/battle/partner/goompa.c @@ -123,7 +123,7 @@ EvtScript N(handleEvent) = { EVT_SET_CONST(LVar1, ANIM_Goompa_Injured) EVT_EXEC_WAIT(DoNormalHit) EVT_CASE_EQ(EVENT_33) - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_SET_CONST(LVar0, 1) EVT_SET_CONST(LVar1, ANIM_Goompa_Idle) EVT_SET_CONST(LVar2, ANIM_Goompa_Run) diff --git a/src/battle/partner/kooper.c b/src/battle/partner/kooper.c index 43c55bf7c7..263dca5bea 100644 --- a/src/battle/partner/kooper.c +++ b/src/battle/partner/kooper.c @@ -317,7 +317,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_33) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Hurt) EVT_EXEC_WAIT(DoPartnerHit) - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_SET_CONST(LVar0, 1) EVT_SET_CONST(LVar1, ANIM_BattleKooper_Idle) EVT_SET_CONST(LVar2, ANIM_BattleKooper_Run) diff --git a/src/battle/partner/lakilester.c b/src/battle/partner/lakilester.c index 1e4325569e..cd71787534 100644 --- a/src/battle/partner/lakilester.c +++ b/src/battle/partner/lakilester.c @@ -241,7 +241,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_33) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Hurt) EVT_EXEC_WAIT(DoPartnerHit) - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_SET_CONST(LVar0, 1) EVT_SET_CONST(LVar1, ANIM_BattleLakilester_Walk) EVT_SET_CONST(LVar2, ANIM_BattleLakilester_Run) diff --git a/src/battle/partner/parakarry.c b/src/battle/partner/parakarry.c index 4335ef3788..2c635b89b5 100644 --- a/src/battle/partner/parakarry.c +++ b/src/battle/partner/parakarry.c @@ -753,7 +753,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_33) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_HurtStill) EVT_EXEC_WAIT(DoPartnerHit) - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_SET_CONST(LVar1, ANIM_BattleParakarry_Walk) EVT_SET_CONST(LVar2, ANIM_BattleParakarry_Run) EVT_SET(LVar3, 30) diff --git a/src/battle/partner/sushie.c b/src/battle/partner/sushie.c index a9417a33b1..8a83c36da3 100644 --- a/src/battle/partner/sushie.c +++ b/src/battle/partner/sushie.c @@ -523,7 +523,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_33) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Hurt) EVT_EXEC_WAIT(DoPartnerHit) - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_SET_CONST(LVar0, 1) EVT_SET_CONST(LVar1, ANIM_BattleSushie_Idle) EVT_SET_CONST(LVar2, ANIM_BattleSushie_Run) diff --git a/src/battle/partner/watt.c b/src/battle/partner/watt.c index fdb6bb4bbc..0fed4d889c 100644 --- a/src/battle/partner/watt.c +++ b/src/battle/partner/watt.c @@ -588,7 +588,7 @@ EvtScript N(handleEvent) = { EVT_CASE_EQ(EVENT_33) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Hurt) EVT_EXEC_WAIT(DoPartnerHit) - EVT_CASE_EQ(EVENT_RECOVER_PARTNER) + EVT_CASE_EQ(EVENT_RECOVER_FROM_KO) EVT_CALL(N(WattFXBounce)) EVT_SET_CONST(LVar0, 1) EVT_SET_CONST(LVar1, ANIM_BattleWatt_Idle) diff --git a/src/battle_cam.c b/src/battle_cam.c index c56befa14f..ccf105e13b 100644 --- a/src/battle_cam.c +++ b/src/battle_cam.c @@ -121,7 +121,7 @@ EvtScript CamPreset_A = { EVT_END }; -EvtScript D_80280EB8 = { +EvtScript EVS_OnBattleInit = { EVT_CALL(SetCamPerspective, 1, 6, 25, 16, 1024) EVT_CALL(SetCamViewport, 1, 12, 20, 296, 200) EVT_CALL(SetCamBGColor, 1, 0, 0, 0) diff --git a/src/encounter.c b/src/encounter.c index 27fad9679d..b2fd595b89 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -843,7 +843,7 @@ void update_encounters_neutral(void) { break; } sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, 0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); - enemy->encountered = 2; + enemy->encountered = ENCOUNTER_STATE_NEUTRAL; currentEncounter->currentEncounter = encounter; currentEncounter->currentEnemy = enemy; currentEncounter->firstStrikeType = FIRST_STRIKE_PLAYER; @@ -1160,7 +1160,7 @@ START_BATTLE: } enemy = currentEncounter->currentEnemy; if (enemy->interactBytecode != NULL) { - enemy->encountered = 5; + enemy->encountered = ENCOUNTER_TRIGGER_CONVERSATION; script = start_script(enemy->interactBytecode, EVT_PRIORITY_A, 0); enemy->interactScript = script; enemy->interactScriptID = script->id; @@ -1374,7 +1374,7 @@ void update_encounters_pre_battle(void) { currentEncounter->dizzyAttackDuration = 0; enemy = currentEncounter->currentEnemy; - currentEncounter->unk_10 = enemy->unk_B5; + currentEncounter->instigatorValue = enemy->instigatorValue; if (is_ability_active(ABILITY_DIZZY_ATTACK) && currentEncounter->hitType == ENCOUNTER_TRIGGER_SPIN) { currentEncounter->dizzyAttackStatus = 4; @@ -1938,7 +1938,7 @@ void update_encounters_post_battle(void) { } if (enemy->defeatBytecode != NULL) { - script = start_script(enemy->defeatBytecode, 0xA, 0); + script = start_script(enemy->defeatBytecode, EVT_PRIORITY_A, 0); enemy->defeatScript = script; enemy->defeatScriptID = script->id; script->owner1.enemy = enemy; @@ -2056,7 +2056,7 @@ void update_encounters_post_battle(void) { } if (enemy->defeatBytecode != NULL) { - script = start_script(enemy->defeatBytecode, 0xA, 0); + script = start_script(enemy->defeatBytecode, EVT_PRIORITY_A, 0); enemy->defeatScript = script; enemy->defeatScriptID = script->id; script->owner1.enemy = enemy; @@ -2486,7 +2486,7 @@ void create_encounters(void) { enemy->auxScriptID = 0; enemy->defeatScriptID = 0; enemy->unk_07 = 0; - enemy->unk_B5 = 0; + enemy->instigatorValue = 0; enemy->aiDetectFlags = npcData->aiDetectFlags; diff --git a/src/encounter_api.c b/src/encounter_api.c index cacfef434c..3a34506039 100644 --- a/src/encounter_api.c +++ b/src/encounter_api.c @@ -764,14 +764,14 @@ ApiStatus func_80045798(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus func_800457C4(Evt* script, s32 isInitialCall) { - Enemy* ownerActor = script->owner1.enemy; +ApiStatus SetOwnerInstigatorValue(Evt* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; - ownerActor->unk_B5 = evt_get_variable(script, *script->ptrReadPos); + enemy->instigatorValue = evt_get_variable(script, *script->ptrReadPos); return ApiStatus_DONE2; } -ApiStatus func_800457F8(Evt* script, s32 isInitialCall) { +ApiStatus SetBattleAsScripted(Evt* script, s32 isInitialCall) { gCurrentEncounter.scriptedBattle = TRUE; return ApiStatus_DONE2; } @@ -783,16 +783,16 @@ ApiStatus GetEncounterTriggerHitTier(Evt* script, s32 isInitialCall) { ApiStatus func_80045838(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; - s32 var1 = evt_get_variable(script, *args++); - s32 var2 = evt_get_variable(script, *args++); - s32 var3 = evt_get_variable(script, *args); - Npc* npc = resolve_npc(script, var1); + s32 npcID = evt_get_variable(script, *args++); + s32 soundID = evt_get_variable(script, *args++); + s32 upperSoundFLags = evt_get_variable(script, *args++); + Npc* npc = resolve_npc(script, npcID); if (npc == NULL) { return ApiStatus_DONE2; } - ai_enemy_play_sound(npc, var2, var3); + ai_enemy_play_sound(npc, soundID, upperSoundFLags); return ApiStatus_DONE2; } diff --git a/src/evt/fa4c0_len_3bf0.c b/src/evt/fa4c0_len_3bf0.c index c102ce30c7..7363f67dbd 100644 --- a/src/evt/fa4c0_len_3bf0.c +++ b/src/evt/fa4c0_len_3bf0.c @@ -46,7 +46,7 @@ ApiStatus PollMusicEvents(Evt* script, s32 isInitialCall) { kill_script_by_ID(RunningMusicEventIDs[musicEventID]); } if (newSource != NULL) { - Evt* newEvt = start_script(newSource, 1, 0); + Evt* newEvt = start_script(newSource, EVT_PRIORITY_1, 0); RunningMusicEvents[musicEventID] = newEvt; RunningMusicEventIDs[musicEventID] = newEvt->id; } diff --git a/src/hud_element.h b/src/hud_element.h index 74fe05ea29..7eef7ef788 100644 --- a/src/hud_element.h +++ b/src/hud_element.h @@ -8,6 +8,8 @@ typedef s32 HudScript[0]; +typedef s32 HudElemID; + enum { HUD_ELEMENT_OP_End, HUD_ELEMENT_OP_SetRGBA, @@ -126,9 +128,9 @@ typedef struct PopupMenu { /* 0x290 */ char unk_290[0x4]; /* 0x294 */ s32 descMsg[32]; /* 0x314 */ char unk_314[0x4]; - /* 0x318 */ s32 popupType; // C = keys - /* 0x31C */ s32 unk_31C; - /* 0x320 */ s32 unk_320; + /* 0x318 */ s32 popupType; + /* 0x31C */ s32 dipMode; + /* 0x320 */ s32 titleNumber; // used to display 2/3 with double/triple dip /* 0x324 */ s32 numEntries; /* 0x328 */ s32 initialPos; /* 0x32C */ s16 result; diff --git a/src/load_script.c b/src/load_script.c index eafab6536e..8b700fd53f 100644 --- a/src/load_script.c +++ b/src/load_script.c @@ -118,7 +118,7 @@ u16 D_80293E04[] = { ApiStatus LoadItemScript(Evt* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; BattleStatus* battleStatus = &gBattleStatus; - s16 itemID = battleStatus->selectedItemID; + s16 itemID = battleStatus->moveArgument; ItemData* item = &gItemTable[itemID]; s32 i = 0; s32* itemPtr; @@ -146,13 +146,13 @@ ApiStatus LoadItemScript(Evt* script, s32 isInitialCall) { itemPtr = &D_80293B80[0]; for (i = 0; *itemPtr != ITEM_NONE; i++, itemPtr++) { - if (*itemPtr == battleStatus->selectedItemID) { + if (*itemPtr == battleStatus->moveArgument) { break; } } if (*itemPtr == ITEM_NONE) { - if (item->typeFlags & 0x80) { + if (item->typeFlags & ITEM_TYPE_FLAG_FOOD_OR_DRINK) { i = 0; } else { i = 1; @@ -170,12 +170,12 @@ ApiStatus LoadItemScript(Evt* script, s32 isInitialCall) { ApiStatus LoadFreeItemScript(Evt* script, s32 isInitialCall) { BattleStatus* battleStatus = &gBattleStatus; Actor* actor = battleStatus->playerActor; - ItemData* item = &gItemTable[battleStatus->selectedItemID]; + ItemData* item = &gItemTable[battleStatus->moveArgument]; SelectableTarget* target; s32* itemPtr; s32 i; - battleStatus->currentTargetListFlags = item->targetFlags | 0x8000; + battleStatus->currentTargetListFlags = item->targetFlags | ITEM_TARGET_FLAG_8000; battleStatus->currentAttackElement = 0; player_create_target_list(actor); @@ -186,13 +186,13 @@ ApiStatus LoadFreeItemScript(Evt* script, s32 isInitialCall) { itemPtr = &D_80293B80[0]; for (i = 0; *itemPtr != ITEM_NONE; i++, itemPtr++) { - if (*itemPtr == battleStatus->selectedItemID){ + if (*itemPtr == battleStatus->moveArgument){ break; } } if (*itemPtr == ITEM_NONE) { - if (item->typeFlags & 0x80) { + if (item->typeFlags & ITEM_TYPE_FLAG_FOOD_OR_DRINK) { i = 0; } else { i = 1; diff --git a/src/main_loop.c b/src/main_loop.c index 0ad9d32737..e45ca2347f 100644 --- a/src/main_loop.c +++ b/src/main_loop.c @@ -23,14 +23,22 @@ GameStatus* gGameStatusPtr = &gGameStatus; s16 D_800741A0 = 0; s16 D_800741A2 = 0; s32 D_800741A4 = 0; -Mtx D_800741A8 = { - .m = { - { 0x00010000, 0x00000000, 0x00000001, 0x00000000 }, - { 0x00000000, 0x00010000, 0x00000000, 0x00000001 }, - { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, - { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + +Matrix4s MasterIdentityMtx = { + .whole = { + {1, 0, 0, 0}, + {0, 1, 0, 0}, + {0, 0, 1, 0}, + {0, 0, 0, 1} + }, + .frac = { + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0} } }; + s32 D_800741E8[2] = {0, 0}; // padding? u16 gMatrixListPos = 0; u16 D_800741F2 = 0; @@ -192,7 +200,7 @@ void gfx_draw_frame(void) { return; } - gSPMatrix(gMasterGfxPos++, &D_800741A8, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gMasterGfxPos++, &MasterIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); spr_render_init(); @@ -330,34 +338,34 @@ void load_engine_data(void) { /// 0: normal /// 1: NPCs move, can't be interacted with /// 2: NPCs don't move, no partner ability, can't interact, can't use exits -/// 3: NPCs don't more or animate (partner switch menu) +/// 3: NPCs don't more or animate /// 4: NPCs can move, animations don't update, can use exits void set_time_freeze_mode(s32 mode) { switch (mode) { - case 0: + case TIME_FREEZE_NORMAL: timeFreezeMode = mode; gOverrideFlags &= ~(GLOBAL_OVERRIDES_800 | GLOBAL_OVERRIDES_400 | GLOBAL_OVERRIDES_200 | GLOBAL_OVERRIDES_DISABLE_BATTLES); resume_all_group(EVT_GROUP_01 | EVT_GROUP_02); break; - case 1: + case TIME_FREEZE_PARTIAL: timeFreezeMode = mode; gOverrideFlags &= ~(GLOBAL_OVERRIDES_800 | GLOBAL_OVERRIDES_400 | GLOBAL_OVERRIDES_200); gOverrideFlags |= GLOBAL_OVERRIDES_DISABLE_BATTLES; suspend_all_group(EVT_GROUP_01); break; - case 2: + case TIME_FREEZE_FULL: timeFreezeMode = mode; gOverrideFlags &= ~(GLOBAL_OVERRIDES_400 | GLOBAL_OVERRIDES_800); gOverrideFlags |= GLOBAL_OVERRIDES_200 | GLOBAL_OVERRIDES_DISABLE_BATTLES; suspend_all_group(EVT_GROUP_02); break; - case 3: + case TIME_FREEZE_POPUP_MENU: timeFreezeMode = mode; gOverrideFlags &= ~GLOBAL_OVERRIDES_800; gOverrideFlags |= GLOBAL_OVERRIDES_400 | GLOBAL_OVERRIDES_200 | GLOBAL_OVERRIDES_DISABLE_BATTLES; suspend_all_group(EVT_GROUP_02); break; - case 4: + case TIME_FREEZE_EXIT: timeFreezeMode = mode; gOverrideFlags |= GLOBAL_OVERRIDES_800 | GLOBAL_OVERRIDES_400 | GLOBAL_OVERRIDES_200 | GLOBAL_OVERRIDES_DISABLE_BATTLES; break; diff --git a/src/move_table.inc.c b/src/move_table.inc.c index 5df85c9ab3..5c8eaa51e3 100644 --- a/src/move_table.inc.c +++ b/src/move_table.inc.c @@ -554,7 +554,7 @@ MoveData gMoveTable[] = { .fullDescMsg = 0, .shortDescMsg = 0, .flags = 0, - .category = MOVE_TYPE_TACTICS, + .category = MOVE_TYPE_SWITCH, .actionTip = MOVE_ACTION_TIP_NONE, .costFP = 0, .costBP = 0 @@ -564,7 +564,7 @@ MoveData gMoveTable[] = { .fullDescMsg = MSG_ItemFullDesc_QuickChange, .shortDescMsg = MSG_ItemShortDesc_QuickChange, .flags = 0, - .category = MOVE_TYPE_TACTICS, + .category = MOVE_TYPE_SWITCH, .actionTip = MOVE_ACTION_TIP_NONE, .costFP = 0, .costBP = 4 diff --git a/src/state_pause.c b/src/state_pause.c index 64ed913169..f7531de567 100644 --- a/src/state_pause.c +++ b/src/state_pause.c @@ -24,7 +24,7 @@ void state_init_pause(void) { D_800A0921 = 0; D_800A0922 = 0; disable_player_input(); - set_time_freeze_mode(TIME_FREEZE_PARTNER_MENU); + set_time_freeze_mode(TIME_FREEZE_POPUP_MENU); set_windows_visible(WINDOW_GROUP_PAUSE_MENU); } diff --git a/src/world/area_dro/dro_02/npc_merlee.c b/src/world/area_dro/dro_02/npc_merlee.c index 7cd567a0b3..4f92776976 100644 --- a/src/world/area_dro/dro_02/npc_merlee.c +++ b/src/world/area_dro/dro_02/npc_merlee.c @@ -96,10 +96,10 @@ API_CALLABLE(N(TryEnchantPlayer)) { playerData->merleeSpellType = MERLEE_SPELL_2; break; case 2: - playerData->merleeSpellType = MERLEE_SPELL_3; + playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST; break; case 3: - playerData->merleeSpellType = MERLEE_SPELL_4; + playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST; break; } evt_set_variable(script, outPrevented, FALSE); diff --git a/src/world/area_isk/isk_02/isk_02_5_npc.c b/src/world/area_isk/isk_02/isk_02_5_npc.c index 7164afd1dc..65d3beecb3 100644 --- a/src/world/area_isk/isk_02/isk_02_5_npc.c +++ b/src/world/area_isk/isk_02/isk_02_5_npc.c @@ -61,21 +61,21 @@ EvtScript N(EVS_NpcIdle_Pokey_03) = { EvtScript N(EVS_NpcInit_Pokey_01) = { EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Pokey_01))) - EVT_CALL(func_800457C4, 3) + EVT_CALL(SetOwnerInstigatorValue, 3) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_Pokey_02) = { EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Pokey_02))) - EVT_CALL(func_800457C4, 3) + EVT_CALL(SetOwnerInstigatorValue, 3) EVT_RETURN EVT_END }; EvtScript N(EVS_NpcInit_Pokey_03) = { EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Pokey_03))) - EVT_CALL(func_800457C4, 3) + EVT_CALL(SetOwnerInstigatorValue, 3) EVT_RETURN EVT_END }; diff --git a/src/world/area_isk/isk_07/isk_07_3_npc.c b/src/world/area_isk/isk_07/isk_07_3_npc.c index 236ccd5121..8e7638bfa2 100644 --- a/src/world/area_isk/isk_07/isk_07_3_npc.c +++ b/src/world/area_isk/isk_07/isk_07_3_npc.c @@ -145,7 +145,7 @@ EvtScript N(EVS_NpcInit_Pokey_01) = { EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Pokey_01))) EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Pokey_01))) EVT_CALL(InterpNpcYaw, NPC_SELF, 100, 0) - EVT_CALL(func_800457C4, 3) + EVT_CALL(SetOwnerInstigatorValue, 3) EVT_RETURN EVT_END }; @@ -156,7 +156,7 @@ EvtScript N(EVS_NpcInit_Pokey_02) = { EVT_END_IF EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Pokey_02))) EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Pokey_01))) - EVT_CALL(func_800457C4, 3) + EVT_CALL(SetOwnerInstigatorValue, 3) EVT_RETURN EVT_END }; @@ -167,7 +167,7 @@ EvtScript N(EVS_NpcInit_Pokey_03) = { EVT_END_IF EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Pokey_03))) EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Pokey_01))) - EVT_CALL(func_800457C4, 3) + EVT_CALL(SetOwnerInstigatorValue, 3) EVT_RETURN EVT_END }; diff --git a/src/world/area_jan/jan_04/B45730.c b/src/world/area_jan/jan_04/B45730.c index 1f51c426b9..fd65b02930 100644 --- a/src/world/area_jan/jan_04/B45730.c +++ b/src/world/area_jan/jan_04/B45730.c @@ -15,7 +15,7 @@ ApiStatus func_80240FC0_B45730(Evt* script, s32 isInitialCall) { Evt* newScript; D_8024625C_B4A9CC++; - newScript = start_script(rideScript, 0, EVT_FLAG_RUN_IMMEDIATELY); + newScript = start_script(rideScript, EVT_PRIORITY_0, EVT_FLAG_RUN_IMMEDIATELY); newScript->varTable[1] = playerStatus->position.x - 10.0f; newScript->varTable[2] = playerStatus->position.y; newScript->varTable[3] = playerStatus->position.z; diff --git a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c index a9e292006b..d7a1eb9523 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c +++ b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c @@ -32,6 +32,8 @@ API_CALLABLE(N(func_80242014_8B2084)) { #include "world/common/npc/GoombaFamily_Wander.inc.c" #include "world/common/npc/GoombaFamily.inc.c" +#include "world/common/enemy/complete/Kammy.h" + StationaryAISettings N(AISettings_Kammy) = { .playerSearchInterval = -1, .chaseRadius = 300.0f, @@ -1958,11 +1960,7 @@ StaticNpc N(NpcData_Kammy) = { .yaw = 90, .flags = ENEMY_FLAG_1 | ENEMY_FLAG_8 | ENEMY_FLAG_800, .init = &N(EVS_NpcInit_Kammy), - .drops = { - .dropFlags = NPC_DROP_FLAG_80, - .heartDrops = NO_DROPS, - .flowerDrops = NO_DROPS, - }, + .drops = NPC_NO_DROPS, .territory = { .wander = { .isFlying = TRUE, @@ -1975,24 +1973,7 @@ StaticNpc N(NpcData_Kammy) = { .detectSize = { 100 }, } }, - .animations = { - .idle = ANIM_WorldKammy_Anim01, - .walk = ANIM_WorldKammy_Anim02, - .run = ANIM_WorldKammy_Anim03, - .chase = ANIM_WorldKammy_Anim03, - .anim_4 = ANIM_WorldKammy_Anim01, - .anim_5 = ANIM_WorldKammy_Anim01, - .death = ANIM_WorldKammy_Anim00, - .hit = ANIM_WorldKammy_Anim00, - .anim_8 = ANIM_WorldKammy_Anim03, - .anim_9 = ANIM_WorldKammy_Anim03, - .anim_A = ANIM_WorldKammy_Anim03, - .anim_B = ANIM_WorldKammy_Anim03, - .anim_C = ANIM_WorldKammy_Anim03, - .anim_D = ANIM_WorldKammy_Anim03, - .anim_E = ANIM_WorldKammy_Anim03, - .anim_F = ANIM_WorldKammy_Anim03, - }, + .animations = KAMMY_ANIMS, .extraAnimations = N(ExtraAnims_Kammy), }; diff --git a/src/world/area_omo/omo.h b/src/world/area_omo/omo.h index 189af70101..b1547bdcc6 100644 --- a/src/world/area_omo/omo.h +++ b/src/world/area_omo/omo.h @@ -2,24 +2,48 @@ #define _WORLD_AREA_OMO_OMO_H_ enum { - AB_OMO_0 = AreaByte(0), - AB_OMO_1 = AreaByte(1), - AB_OMO_2 = AreaByte(2), - AB_OMO_3 = AreaByte(3), - AB_OMO_4 = AreaByte(4), - AB_OMO_5 = AreaByte(5), - AB_OMO_6 = AreaByte(6), - AB_OMO_7 = AreaByte(7), - AB_OMO_8 = AreaByte(8), - AB_OMO_9 = AreaByte(9), - AB_OMO_A = AreaByte(10), - AB_OMO_B = AreaByte(11), - AB_OMO_C = AreaByte(12), - AB_OMO_D = AreaByte(13), - AB_OMO_E = AreaByte(14), - AB_OMO_F = AreaByte(15), + AB_OMO_0 = AreaByte(0), + AB_OMO_1 = AreaByte(1), + AB_OMO_2 = AreaByte(2), + AB_OMO_3 = AreaByte(3), + AB_OMO_4 = AreaByte(4), + AB_OMO_5 = AreaByte(5), + AB_OMO_6 = AreaByte(6), + AB_OMO_7 = AreaByte(7), + AB_OMO_8 = AreaByte(8), + AB_OMO_9 = AreaByte(9), + AB_OMO_A = AreaByte(10), + AB_OMO_B = AreaByte(11), + AB_OMO_C = AreaByte(12), + AB_OMO_D = AreaByte(13), + AB_OMO_E = AreaByte(14), + AB_OMO_F = AreaByte(15), }; -#define AF_OMO(index) AreaFlag(index) +enum { + AF_OMO07_NpcPool0 = AreaFlag(7), + AF_OMO07_NpcPool1 = AreaFlag(8), + AF_OMO07_NpcPool2 = AreaFlag(9), + AF_OMO07_NpcPool3 = AreaFlag(10), + AF_OMO07_DoorOpening = AreaFlag(15), +}; + +extern MapSettings omo_01_settings; +extern MapSettings omo_02_settings; +extern MapSettings omo_03_settings; +extern MapSettings omo_04_settings; +extern MapSettings omo_05_settings; +extern MapSettings omo_06_settings; +extern MapSettings omo_07_settings; +extern MapSettings omo_08_settings; +extern MapSettings omo_09_settings; +extern MapSettings omo_10_settings; +extern MapSettings omo_11_settings; +extern MapSettings omo_12_settings; +extern MapSettings omo_13_settings; +extern MapSettings omo_14_settings; +extern MapSettings omo_15_settings; +extern MapSettings omo_16_settings; +extern MapSettings omo_17_settings; #endif diff --git a/src/world/area_omo/omo_02/D9D510.c b/src/world/area_omo/omo_02/D9D510.c index e05dd34a89..cfc1f21f19 100644 --- a/src/world/area_omo/omo_02/D9D510.c +++ b/src/world/area_omo/omo_02/D9D510.c @@ -61,6 +61,6 @@ INCLUDE_ASM(s32, "world/area_omo/omo_02/D9D510", func_8024043C_D9D90C); #include "world/common/enemy/ai/RangedAttackAI.inc.c" -#include "world/common/todo/SetNpcB5_3.inc.c" +#include "world/common/todo/SetInstigatorValue_3.inc.c" #include "world/common/todo/GetEncounterEnemyIsOwner.inc.c" diff --git a/src/world/area_omo/omo_04/DAD400.c b/src/world/area_omo/omo_04/DAD400.c deleted file mode 100644 index a03be3847f..0000000000 --- a/src/world/area_omo/omo_04/DAD400.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "omo_04.h" - -static char* N(exit_str_0) = "omo_03"; -static char* N(exit_str_1) = ""; - -#include "world/common/todo/StashVars.inc.c" - -#include "world/common/todo/GetItemName.inc.c" - -#include "world/common/todo/SomeItemEntityFunc.inc.c" - -#include "world/common/todo/IsItemBadge.inc.c" - -#include "world/common/todo/UnsetCamera0MoveFlag1.inc.c" - -#include "world/common/todo/SetCamera0MoveFlag1.inc.c" - -ApiStatus func_802402F4_DAD6F4(Evt* script, s32 isInitialCall) { - f32 playerVx = gPlayerStatus.currentSpeed * 5.0f * sin_deg(gPlayerStatus.targetYaw); - f32 playerVz = gPlayerStatus.currentSpeed * 5.0f * -cos_deg(gPlayerStatus.targetYaw); - script->varTable[0] = (gPlayerStatus.position.x + playerVx); - script->varTable[1] = (gPlayerStatus.position.z + playerVz); - - return ApiStatus_DONE2; -} - -#include "world/common/enemy/ai/FlyingAI.inc.c" - -#include "world/common/enemy/ai/ShyGuyWanderAI.inc.c" - -const s32 N(pad_8)[] = { 0, 0 }; -static char* N(exit_str_2) = "omo_04"; - -#include "world/common/todo/SetCamera0Flag1000.inc.c" - -#include "world/common/todo/UnsetCamera0Flag1000.inc.c" diff --git a/src/world/area_omo/omo_04/DAF240.c b/src/world/area_omo/omo_04/DAF240.c deleted file mode 100644 index ccd5210534..0000000000 --- a/src/world/area_omo/omo_04/DAF240.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "omo_04.h" - -#define KAMMY_NPC 2 -#include "world/common/util/GetKammyBroomEmitterPos.inc.c" diff --git a/src/world/area_omo/omo_04/omo_04.h b/src/world/area_omo/omo_04/omo_04.h index 0485479dbe..1c411bb00a 100644 --- a/src/world/area_omo/omo_04/omo_04.h +++ b/src/world/area_omo/omo_04/omo_04.h @@ -2,8 +2,42 @@ /// @brief Shy Guy's Toybox - BLU Block City #include "common.h" -#include "../omo.h" #include "message_ids.h" #include "map.h" +#include "../omo.h" +#include "mapfs/omo_04_shape.h" +#include "mapfs/omo_04_hit.h" + +#include "sprite/npc/WorldKammy.h" + +enum { + NPC_Goomba = 0, + NPC_Clubba = 1, + NPC_Kammy = 2, + NPC_ShyGuy = 3, + NPC_SkyGuy = 4, +}; + +enum { + MV_AmbushID = MapVar(10), // npcID or itemID depending on GB_OMO_PeachChoice1 + MV_FlightSoundsScriptID = MapVar(11), +}; + +enum { + MF_KammyFlying = MapFlag(10), +}; + #define NAMESPACE omo_04 + +extern EvtScript N(EVS_Main); +extern EvtScript N(EVS_SetupMusic); +extern EvtScript N(EVS_NpcIdle_Kammy); +extern EvtScript N(EVS_NpcAux_Kammy); +extern EvtScript N(EVS_SetupGizmos); +extern EvtScript N(EVS_Scene_KammySetAmbush); +extern EvtScript N(EVS_MakeEntities); +extern NpcGroupList N(KammySceneNPCs); +extern NpcGroupList N(GoombaAmbushNPCs); +extern NpcGroupList N(ClubbaAmbushNPCs); +extern NpcGroupList N(DefaultNPCs); diff --git a/src/world/area_omo/omo_04/omo_04_0_header.c b/src/world/area_omo/omo_04/omo_04_0_header.c new file mode 100644 index 0000000000..202bd7aa76 --- /dev/null +++ b/src/world/area_omo/omo_04/omo_04_0_header.c @@ -0,0 +1,13 @@ +#include "omo_04.h" + +EntryList N(Entrances) = { + [omo_04_ENTRY_0] { -965.0, 0.0, 0.0, 90.0 }, +}; + +MapSettings N(settings) = { + .main = &N(EVS_Main), + .entryList = &N(Entrances), + .entryCount = ENTRY_COUNT(N(Entrances)), + .background = &gBackgroundImage, + .tattle = { MSG_MapTattle_omo_04 }, +}; diff --git a/src/world/area_omo/omo_04/omo_04_1_music.c b/src/world/area_omo/omo_04/omo_04_1_music.c new file mode 100644 index 0000000000..10887d300e --- /dev/null +++ b/src/world/area_omo/omo_04/omo_04_1_music.c @@ -0,0 +1,11 @@ +#include "omo_04.h" + +EvtScript N(EVS_SetupMusic) = { + EVT_IF_EQ(GF_OMO04_SpawnedPeachChoice1, FALSE) + EVT_CALL(SetMusicTrack, 0, SONG_KAMMY_KOOPA_THEME, 0, 8) + EVT_ELSE + EVT_CALL(SetMusicTrack, 0, SONG_SHY_GUY_TOYBOX, 0, 8) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_04/omo_04_2_main.c b/src/world/area_omo/omo_04/omo_04_2_main.c new file mode 100644 index 0000000000..d2f5fe2fa8 --- /dev/null +++ b/src/world/area_omo/omo_04/omo_04_2_main.c @@ -0,0 +1,46 @@ +#include "omo_04.h" + +EvtScript N(EVS_ExitWalk_omo_03_1) = EVT_EXIT_WALK(60, omo_04_ENTRY_0, "omo_03", omo_03_ENTRY_1); + +MAP_RODATA_PAD(1, exits) + +EvtScript N(EVS_BindExitTriggers) = { + EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_omo_03_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili1, 1, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Main) = { + EVT_SET(GB_WorldLocation, LOCATION_SHY_GUYS_TOYBOX) + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_SETUP_CAMERA_DEFAULT() + EVT_IF_EQ(GF_OMO04_SpawnedPeachChoice1, FALSE) + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(KammySceneNPCs))) + EVT_ELSE + EVT_IF_EQ(GF_OMO04_Item_Mushroom, FALSE) + EVT_SWITCH(GB_OMO_PeachChoice1) + EVT_CASE_EQ(0) + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(GoombaAmbushNPCs))) + EVT_CASE_EQ(1) + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(ClubbaAmbushNPCs))) + EVT_CASE_EQ(2) + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(DefaultNPCs))) + EVT_CALL(MakeItemEntity, ITEM_MUSHROOM, 1100, 0, 0, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_Mushroom) + EVT_END_SWITCH + EVT_ELSE + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(DefaultNPCs))) + EVT_END_IF + EVT_END_IF + EVT_EXEC_WAIT(N(EVS_MakeEntities)) + EVT_EXEC_WAIT(N(EVS_SetupGizmos)) + EVT_EXEC_WAIT(N(EVS_SetupMusic)) + EVT_IF_EQ(GF_OMO04_SpawnedPeachChoice1, FALSE) + EVT_EXEC(N(EVS_Scene_KammySetAmbush)) + EVT_ELSE + EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers))) + EVT_EXEC(EnterWalk) + EVT_WAIT(1) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_04/omo_04_3_gizmos.c b/src/world/area_omo/omo_04/omo_04_3_gizmos.c new file mode 100644 index 0000000000..552cf5b3cd --- /dev/null +++ b/src/world/area_omo/omo_04/omo_04_3_gizmos.c @@ -0,0 +1,61 @@ +#include "omo_04.h" + +EvtScript N(EVS_Gizmos_Wheels) = { + EVT_LABEL(0) + EVT_CALL(MakeLerp, 0, -360, 100, EASING_LINEAR) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_ha1, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha2, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha3, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha4, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha5, LVar0, 0, 0, 1) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Gizmos_Shutters) = { + EVT_LABEL(0) + EVT_LABEL(0) + EVT_CALL(MakeLerp, 0, 160, 60, EASING_COS_IN_OUT) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_m1_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m1_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m2_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m2_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m3_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m3_2, LVar0, 0, 1, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(MakeLerp, 160, 0, 60, EASING_COS_IN_OUT) + EVT_LABEL(2) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_m1_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m1_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m2_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m2_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m3_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m3_2, LVar0, 0, 1, 0) + EVT_WAIT(2) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(2) + EVT_END_IF + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_SetupGizmos) = { + EVT_EXEC(N(EVS_Gizmos_Wheels)) + EVT_EXEC(N(EVS_Gizmos_Shutters)) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_04/omo_04_4_entity.c b/src/world/area_omo/omo_04/omo_04_4_entity.c new file mode 100644 index 0000000000..e00e21e6be --- /dev/null +++ b/src/world/area_omo/omo_04/omo_04_4_entity.c @@ -0,0 +1,160 @@ +#include "omo_04.h" +#include "entity.h" + +#include "world/common/atomic/Chest.inc.c" + +EvtScript N(EVS_OpenChest_StoreroomKey) = { + EVT_SET(LVarA, ITEM_STOREROOM_KEY) + EVT_SET(LVarB, ITEM_TYPE_KEY) + EVT_SET(GF_OMO04_Chest_StoreroomKey, TRUE) + EVT_EXEC_WAIT(N(EVS_Chest_GetItem)) + EVT_SET(GF_MAC04_StoreroomKeyStolen, TRUE) + EVT_SET(GB_StoryProgress, STORY_CH4_GOT_STOREROOM_KEY) + EVT_RETURN + EVT_END +}; + +#include "world/common/todo/UnsetCamera0MoveFlag1.inc.c" +#include "world/common/todo/SetCamera0MoveFlag1.inc.c" + +EvtScript N(EVS_TetherCamToPlayer) = { + EVT_LABEL(0) + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_CALL(SetCamTarget, CAM_DEFAULT, LVar0, LVar1, LVar2) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +Vec3i N(StarBoxLaunchTargets)[] = { + { -852, 0, -125 }, + { -887, 0, 98 }, + { -682, 80, -77 }, + { -542, 80, 62 }, + { -647, 80, 132 }, + { -507, 80, 132 }, + { 672, 105, 132 }, + { 927, 80, -87 }, +}; + +EvtScript N(EVS_StarBoxLaunch_Impl) = { + EVT_CALL(DisablePlayerInput, TRUE) + EVT_CALL(DisablePlayerPhysics, TRUE) + EVT_USE_BUF(EVT_PTR(N(StarBoxLaunchTargets))) + EVT_LOOP(LVar0) + EVT_BUF_READ3(LVar7, LVar8, LVar9) + EVT_END_LOOP + EVT_CALL(SetPlayerActionState, ACTION_STATE_IDLE) + EVT_WAIT(1) + EVT_CALL(SetPlayerActionState, ACTION_STATE_LAUNCH) + EVT_WAIT(1) + EVT_CALL(N(UnsetCamera0MoveFlag1)) + EVT_EXEC_GET_TID(N(EVS_TetherCamToPlayer), LVarA) + EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.7)) + EVT_CALL(PlayerJump, LVar7, LVar8, LVar9, 40) + EVT_KILL_THREAD(LVarA) + EVT_CALL(N(SetCamera0MoveFlag1)) + EVT_WAIT(1) + EVT_CALL(SetPlayerActionState, ACTION_STATE_IDLE) + EVT_CALL(DisablePlayerPhysics, FALSE) + EVT_CALL(DisablePlayerInput, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch1) = { + EVT_SET(LVar0, 1) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch2) = { + EVT_SET(LVar0, 2) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch3) = { + EVT_SET(LVar0, 3) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch4) = { + EVT_SET(LVar0, 4) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch5) = { + EVT_SET(LVar0, 5) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch6) = { + EVT_SET(LVar0, 6) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch7) = { + EVT_SET(LVar0, 7) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +API_CALLABLE(N(func_802402F4_DAD6F4)) { + f32 playerVx = gPlayerStatus.currentSpeed * 5.0f * sin_deg(gPlayerStatus.targetYaw); + f32 playerVz = gPlayerStatus.currentSpeed * 5.0f * -cos_deg(gPlayerStatus.targetYaw); + script->varTable[0] = (gPlayerStatus.position.x + playerVx); + script->varTable[1] = (gPlayerStatus.position.z + playerVz); + + return ApiStatus_DONE2; +} + +EvtScript N(EVS_MakeEntities) = { + EVT_CALL(MakeEntity, EVT_PTR(Entity_Chest), 1150, 0, 0, 0, 0, MAKE_ENTITY_END) + EVT_CALL(AssignChestFlag, GF_OMO04_Chest_StoreroomKey) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_OpenChest_StoreroomKey))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), -892, 0, -125, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch1))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), -847, 0, 98, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch2))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), -722, 0, -72, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch3))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), -647, 80, 62, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch4))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), -607, 0, 133, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch5))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), -467, 0, 133, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch6))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), 712, 0, 133, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch7))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_YellowBlock), 575, 60, 60, 0, ITEM_COIN, MAKE_ENTITY_END) + EVT_CALL(AssignBlockFlag, GF_OMO04_ItemBlock_CoinA) + EVT_CALL(MakeEntity, EVT_PTR(Entity_YellowBlock), 761, 60, -85, 0, ITEM_COIN, MAKE_ENTITY_END) + EVT_CALL(AssignBlockFlag, GF_OMO04_ItemBlock_CoinB) + EVT_CALL(MakeEntity, EVT_PTR(Entity_YellowBlock), 885, 140, -110, 0, ITEM_THUNDER_BOLT, MAKE_ENTITY_END) + EVT_CALL(AssignBlockFlag, GF_OMO04_ItemBlock_ThunderBolt) + EVT_CALL(MakeItemEntity, ITEM_COIN, -892, 110, -124, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_CoinA) + EVT_CALL(MakeItemEntity, ITEM_COIN, -892, 130, -124, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_CoinB) + EVT_CALL(MakeItemEntity, ITEM_COIN, -892, 150, -124, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_CoinC) + EVT_CALL(MakeItemEntity, ITEM_COIN, -637, 190, 62, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_CoinD) + EVT_CALL(MakeItemEntity, ITEM_COIN, -614, 210, 62, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_CoinE) + EVT_CALL(MakeItemEntity, ITEM_COIN, -594, 220, 62, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_CoinF) + EVT_CALL(MakeItemEntity, ITEM_COIN, -574, 210, 62, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_CoinG) + EVT_CALL(MakeItemEntity, ITEM_COIN, -554, 190, 62, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_CoinH) + EVT_CALL(MakeItemEntity, ITEM_STAR_PIECE, 120, 180, -80, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_StarPieceA) + EVT_CALL(MakeItemEntity, ITEM_STAR_PIECE, -90, 0, -125, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO04_Item_StarPieceB) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_04/omo_04_5_npc.c b/src/world/area_omo/omo_04/omo_04_5_npc.c new file mode 100644 index 0000000000..86c13acaae --- /dev/null +++ b/src/world/area_omo/omo_04/omo_04_5_npc.c @@ -0,0 +1,216 @@ +#include "omo_04.h" + +#include "world/common/enemy/complete/SkyGuy.inc.c" +#include "world/common/enemy/complete/ShyGuy_Wander.inc.c" + +#include "world/common/enemy/complete/Goomba.h" + +// level changed from 5 -> 14 +NpcSettings N(NpcSettings_Goomba) = { + .height = 23, + .radius = 22, + .level = 14, + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, + .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER, +}; + +#include "world/common/enemy/complete/Clubba.inc.c" + +#include "world/common/enemy/complete/Kammy.h" + +NpcSettings N(NpcSettings_Kammy) = { + .height = 34, + .radius = 24, + .level = 26, + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, +}; + +#include "world/common/todo/SetCamera0Flag1000.inc.c" +#include "world/common/todo/UnsetCamera0Flag1000.inc.c" + +EvtScript N(EVS_NpcIdle_Goomba) = { + EVT_LABEL(0) + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_IF_LT(LVar0, 1050) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(DisablePlayerInput, TRUE) + EVT_CALL(N(SetCamera0Flag1000)) + EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetCamProperties, CAM_DEFAULT, EVT_FLOAT(5.0), LVar0, LVar1, LVar2, 300, EVT_FLOAT(13.0), EVT_FLOAT(-9.5)) + EVT_IF_EQ(GB_OMO_PeachChoice1, 0) + EVT_CALL(SpeakToPlayer, NPC_Goomba, ANIM_Goomba_Run, ANIM_Goomba_Idle, 0, MSG_CH4_003A) + EVT_ELSE + EVT_CALL(SpeakToPlayer, NPC_Clubba, ANIM_WorldClubba_Anim05, ANIM_WorldClubba_Anim02, 0, MSG_CH4_003B) + EVT_END_IF + EVT_THREAD + EVT_CALL(N(UnsetCamera0Flag1000)) + EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0)) + EVT_END_THREAD + EVT_CALL(DisablePlayerInput, FALSE) + EVT_CALL(StartBossBattle, SONG_SPECIAL_BATTLE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcDefeat_Goomba) = { + EVT_CALL(GetBattleOutcome, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(OUTCOME_PLAYER_WON) + EVT_SET(GF_OMO04_Item_Mushroom, TRUE) + EVT_CALL(DoNpcDefeat) + EVT_CASE_EQ(OUTCOME_PLAYER_LOST) + EVT_CASE_EQ(OUTCOME_PLAYER_FLED) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcInit_Goomba) = { + EVT_IF_EQ(GB_OMO_PeachChoice1, 0) + EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Goomba))) + EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Goomba))) + EVT_ELSE + EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcInit_Clubba) = { + EVT_IF_EQ(GB_OMO_PeachChoice1, 1) + EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Goomba))) + EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Goomba))) + EVT_ELSE + EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcInit_Kammy) = { + EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Kammy))) + EVT_CALL(BindNpcAux, NPC_SELF, EVT_PTR(N(EVS_NpcAux_Kammy))) + EVT_RETURN + EVT_END +}; + +StaticNpc N(NpcData_Goomba) = { + .id = NPC_Goomba, + .settings = &N(NpcSettings_Goomba), + .pos = { 1100.0f, 0.0f, 0.0f }, + .yaw = 270, + .flags = ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800 | ENEMY_FLAG_40000 | ENEMY_FLAG_400000, + .init = &N(EVS_NpcInit_Goomba), + .drops = NPC_NO_DROPS, + .animations = GOOMBA_ANIMS, +}; + +StaticNpc N(NpcData_Clubba) = { + .id = NPC_Clubba, + .settings = &N(NpcSettings_Clubba), + .pos = { 1100.0f, 0.0f, 0.0f }, + .yaw = 270, + .flags = ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800 | ENEMY_FLAG_40000 | ENEMY_FLAG_400000, + .init = &N(EVS_NpcInit_Clubba), + .drops = NPC_NO_DROPS, + .animations = CLUBBA_ANIMS_ALT, +}; + +StaticNpc N(NpcData_ShyGuy) = { + .id = NPC_ShyGuy, + .settings = &N(NpcSettings_ShyGuy_Wander), + .pos = { -770.0f, 0.0f, 0.0f }, + .yaw = 270, + .flags = ENEMY_FLAG_800, + .drops = SHY_GUY_DROPS, + .territory = { + .wander = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .wanderShape = SHAPE_CYLINDER, + .centerPos = { -770, 0, 0 }, + .wanderSize = { 30 }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { -770, 0, 0 }, + .detectSize = { 200 }, + } + }, + .animations = PINK_SHY_GUY_ANIMS, + .aiDetectFlags = AI_DETECT_SIGHT, +}; + +StaticNpc N(NpcData_SkyGuy) = { + .id = NPC_SkyGuy, + .settings = &N(NpcSettings_SkyGuy), + .pos = { -170.0f, 60.0f, 30.0f }, + .yaw = 270, + .flags = ENEMY_FLAG_800, + .drops = SKY_GUY_DROPS, + .territory = { + .wander = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .wanderShape = SHAPE_CYLINDER, + .centerPos = { -170, 60, 30 }, + .wanderSize = { 30 }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { -170, 60, 30 }, + .detectSize = { 200 }, + } + }, + .animations = SKY_GUY_ANIMS, + .aiDetectFlags = AI_DETECT_SIGHT, +}; + +s32 N(ExtraAnims_Kammy)[] = { + ANIM_WorldKammy_Anim0E, + ANIM_WorldKammy_Anim0F, + ANIM_WorldKammy_Anim10, + ANIM_WorldKammy_Anim13, + ANIM_WorldKammy_Anim15, + ANIM_WorldKammy_Anim16, + -1 +}; + +StaticNpc N(NpcData_Kammy) = { + .id = NPC_Kammy, + .settings = &N(NpcSettings_Kammy), + .pos = { NPC_DISPOSE_LOCATION }, + .yaw = 90, + .flags = ENEMY_FLAG_4 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800, + .init = &N(EVS_NpcInit_Kammy), + .drops = NPC_NO_DROPS, + .animations = KAMMY_ANIMS, + .extraAnimations = N(ExtraAnims_Kammy), +}; + +NpcGroupList N(GoombaAmbushNPCs) = { + NPC_GROUP(N(NpcData_Goomba), BTL_OMO3_FORMATION_01, BTL_OMO3_STAGE_00), + NPC_GROUP(N(NpcData_ShyGuy), BTL_OMO_FORMATION_04, BTL_OMO_STAGE_00), + NPC_GROUP(N(NpcData_SkyGuy), BTL_OMO_FORMATION_0F, BTL_OMO_STAGE_00), + {} +}; + +NpcGroupList N(ClubbaAmbushNPCs) = { + NPC_GROUP(N(NpcData_Clubba), BTL_OMO3_FORMATION_03, BTL_OMO3_STAGE_00), + NPC_GROUP(N(NpcData_ShyGuy), BTL_OMO_FORMATION_04, BTL_OMO_STAGE_00), + NPC_GROUP(N(NpcData_SkyGuy), BTL_OMO_FORMATION_0F, BTL_OMO_STAGE_00), + {} +}; + +NpcGroupList N(DefaultNPCs) = { + NPC_GROUP(N(NpcData_ShyGuy), BTL_OMO_FORMATION_04, BTL_OMO_STAGE_00), + NPC_GROUP(N(NpcData_SkyGuy), BTL_OMO_FORMATION_0F, BTL_OMO_STAGE_00), + {} +}; + +NpcGroupList N(KammySceneNPCs) = { + NPC_GROUP(N(NpcData_Kammy)), + NPC_GROUP(N(NpcData_Goomba), BTL_OMO3_FORMATION_01, BTL_OMO3_STAGE_00), + NPC_GROUP(N(NpcData_Clubba), BTL_OMO3_FORMATION_03, BTL_OMO3_STAGE_00), + {} +}; diff --git a/src/world/area_omo/omo_04/omo_04_6_scenes.c b/src/world/area_omo/omo_04/omo_04_6_scenes.c new file mode 100644 index 0000000000..e0005d7cca --- /dev/null +++ b/src/world/area_omo/omo_04/omo_04_6_scenes.c @@ -0,0 +1,243 @@ +#include "omo_04.h" +#include "effects.h" + +s32 N(HoverOffsets)[] = { + 1, 2, 3, 2, 1, + -1, -2, -3, -2, -1, +}; + +EvtScript N(EVS_NpcIdle_Kammy) = { + EVT_CALL(SetSelfVar, 0, 0) + EVT_CALL(GetNpcPos, NPC_SELF, LVar6, LVar3, LVar4) + EVT_LOOP(0) + EVT_USE_BUF(EVT_PTR(N(HoverOffsets))) + EVT_LOOP(10) + EVT_CALL(GetNpcPos, NPC_SELF, LVar2, LVar3, LVar4) + EVT_CALL(GetSelfVar, 0, LVar5) + EVT_IF_EQ(LVar5, 0) + EVT_SWITCH(LVar6) + EVT_CASE_LT(LVar2) + EVT_CALL(SetNpcYaw, NPC_SELF, 90) + EVT_CASE_GT(LVar2) + EVT_CALL(SetNpcYaw, NPC_SELF, 270) + EVT_END_SWITCH + EVT_SET(LVar6, LVar2) + EVT_WAIT(1) + EVT_ELSE + EVT_BUF_READ1(LVar1) + EVT_ADD(LVar3, LVar1) + EVT_CALL(SetNpcPos, NPC_SELF, LVar2, LVar3, LVar4) + EVT_WAIT(3) + EVT_END_IF + EVT_END_LOOP + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +#define KAMMY_NPC NPC_Kammy +#include "world/common/util/GetKammyBroomEmitterPos.inc.c" + +EvtScript N(EVS_NpcAux_Kammy) = { + EVT_SET(MF_KammyFlying, FALSE) + EVT_CALL(GetNpcPos, NPC_Kammy, LVar6, LVar7, LVar8) + EVT_LOOP(0) + EVT_CALL(N(GetKammyBroomEmitterPos), MF_KammyFlying) + EVT_CALL(GetNpcPos, NPC_Kammy, LVar9, LVarA, LVarB) + EVT_SET(LVar3, LVar9) + EVT_SET(LVar4, LVarA) + EVT_SET(LVar5, LVarB) + EVT_SUBF(LVar3, LVar6) + EVT_SUBF(LVar4, LVar7) + EVT_SUBF(LVar5, LVar8) + EVT_SETF(LVar6, LVar9) + EVT_SETF(LVar7, LVarA) + EVT_SETF(LVar8, LVarB) + EVT_IF_NE(LVar3, 0) + EVT_IF_NE(LVar5, 0) + EVT_PLAY_EFFECT(EFFECT_PURPLE_RING, 0, LVar0, LVar1, LVar2, LVar3, LVar4, LVar5, EVT_FLOAT(1.0)) + EVT_END_IF + EVT_END_IF + EVT_WAIT(3) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +Vec3f N(FlightPath_Kammy1)[] = { + { 800.0, 140.0, -20.0 }, + { 1050.0, 120.0, -70.0 }, + { 1150.0, 95.0, -100.0 }, + { 1200.0, 77.0, -30.0 }, + { 1150.0, 62.0, 85.0 }, + { 1050.0, 50.0, 130.0 }, + { 800.0, 40.0, 50.0 }, + { 1000.0, 20.0, 0.0 }, +}; + +Vec3f N(FlightPath_Kammy2)[] = { + { 1000.0, 20.0, 0.0 }, + { 1010.0, 17.0, 0.0 }, + { 1020.0, 15.0, 0.0 }, +}; + +Vec3f N(FlightPath_Kammy3)[] = { + { 1020.0, 15.0, 0.0 }, + { 1080.0, 30.0, 30.0 }, + { 1160.0, 80.0, -40.0 }, + { 600.0, 150.0, 90.0 }, +}; + +EvtScript N(EVS_PlayKammyFlightSounds) = { + EVT_LOOP(0) + EVT_CALL(PlaySoundAtNpc, NPC_Kammy, SOUND_295, 0) + EVT_WAIT(4) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Scene_KammySetAmbush) = { + EVT_CALL(DisablePlayerInput, TRUE) + EVT_SET(GF_OMO04_SpawnedPeachChoice1, TRUE) + EVT_SET(AB_OMO_4, GB_OMO_PeachChoice1) + EVT_SWITCH(AB_OMO_4) + EVT_CASE_EQ(0) + EVT_SET(MV_AmbushID, NPC_Goomba) + EVT_CASE_EQ(1) + EVT_SET(MV_AmbushID, NPC_Clubba) + EVT_CASE_EQ(2) + EVT_SET(MV_AmbushID, ITEM_MUSHROOM) + EVT_END_SWITCH + EVT_CALL(SetNpcPos, NPC_Kammy, 800, 140, -20) + EVT_CALL(SetNpcYaw, NPC_Kammy, 270) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim15) + EVT_IF_NE(AB_OMO_4, 2) + EVT_CALL(SetNpcPos, MV_AmbushID, NPC_DISPOSE_LOCATION) + EVT_END_IF + EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 1100, 0, 0) + EVT_CALL(SetPanTarget, CAM_DEFAULT, 1100, 0, 0) + EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(500.0)) + EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(15.0), EVT_FLOAT(-7.5)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) + EVT_WAIT(60) + EVT_EXEC_GET_TID(N(EVS_PlayKammyFlightSounds), MV_FlightSoundsScriptID) + EVT_SET(MF_KammyFlying, TRUE) + EVT_THREAD + EVT_WAIT(100) + EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(350.0)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, 2) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_END_THREAD + EVT_CALL(LoadPath, 150, EVT_PTR(N(FlightPath_Kammy1)), ARRAY_COUNT(N(FlightPath_Kammy1)), EASING_LINEAR) + EVT_LOOP(0) + EVT_CALL(GetNextPathPos) + EVT_CALL(SetNpcPos, NPC_Kammy, LVar1, LVar2, LVar3) + EVT_WAIT(1) + EVT_IF_NE(LVar0, 1) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_SET(MF_KammyFlying, FALSE) + EVT_KILL_THREAD(MV_FlightSoundsScriptID) + EVT_CALL(PlaySoundAtNpc, NPC_Kammy, SOUND_32B, 0) + EVT_THREAD + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim10) + EVT_WAIT(1) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -5) + EVT_WAIT(1) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -10) + EVT_WAIT(1) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -15) + EVT_WAIT(1) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -10) + EVT_WAIT(1) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -15) + EVT_WAIT(1) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -10) + EVT_WAIT(1) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -15) + EVT_WAIT(1) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -10) + EVT_WAIT(1) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -15) + EVT_WAIT(3) + EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, 0) + EVT_END_THREAD + EVT_CALL(LoadPath, 10, EVT_PTR(N(FlightPath_Kammy2)), ARRAY_COUNT(N(FlightPath_Kammy2)), EASING_LINEAR) + EVT_LOOP(0) + EVT_CALL(GetNextPathPos) + EVT_CALL(SetNpcPos, NPC_Kammy, LVar1, LVar2, LVar3) + EVT_WAIT(1) + EVT_IF_NE(LVar0, 1) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_WAIT(15) + EVT_CALL(SetNpcVar, NPC_Kammy, 0, 1) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim13) + EVT_WAIT(45) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim0E) + EVT_CALL(GetNpcPos, NPC_Kammy, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 25) + EVT_ADD(LVar1, 38) + EVT_CALL(PlaySoundAt, SOUND_207A, 0, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_GATHER_ENERGY_PINK, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 100) + EVT_WAIT(100) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim0F) + EVT_ADD(LVar0, 55) + EVT_CALL(PlaySoundAt, SOUND_2098, 0, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_BIG_SMOKE_PUFF, LVar0, 0, 0, 1, 15, 3, 8) + EVT_WAIT(5) + EVT_IF_NE(AB_OMO_4, 2) + EVT_CALL(SetNpcPos, MV_AmbushID, LVar0, 0, 0) + EVT_ELSE + EVT_CALL(MakeItemEntity, MV_AmbushID, LVar0, 0, 0, ITEM_SPAWN_MODE_DECORATION, 0) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim13) + EVT_WAIT(45) + EVT_SWITCH(AB_OMO_4) + EVT_CASE_EQ(0) + EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 517, MSG_CH4_0036) + EVT_WAIT(30) + EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 517, MSG_CH4_0037) + EVT_CASE_EQ(1) + EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 517, MSG_CH4_0038) + EVT_WAIT(10) + EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 517, MSG_CH4_0039) + EVT_CASE_EQ(2) + EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 517, MSG_CH4_0034) + EVT_WAIT(30) + EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 517, MSG_CH4_0035) + EVT_END_SWITCH + EVT_CALL(SetNpcVar, NPC_Kammy, 0, 0) + EVT_WAIT(5) + EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(500.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_EXEC_GET_TID(N(EVS_PlayKammyFlightSounds), MV_FlightSoundsScriptID) + EVT_SET(MF_KammyFlying, TRUE) + EVT_THREAD + EVT_CALL(LoadPath, 130, EVT_PTR(N(FlightPath_Kammy3)), ARRAY_COUNT(N(FlightPath_Kammy3)), EASING_LINEAR) + EVT_LOOP(0) + EVT_CALL(GetNextPathPos) + EVT_CALL(SetNpcPos, NPC_Kammy, LVar1, LVar2, LVar3) + EVT_WAIT(1) + EVT_IF_NE(LVar0, 1) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_END_THREAD + EVT_WAIT(90) + EVT_IF_NE(AB_OMO_4, 2) + EVT_CALL(PlaySoundAtNpc, MV_AmbushID, SOUND_263, 0) + EVT_CALL(ShowEmote, MV_AmbushID, EMOTE_QUESTION, 0, 20, TRUE, 0, 0, 0, 0) + EVT_WAIT(5) + EVT_END_IF + EVT_CALL(GotoMap, EVT_PTR("omo_04"), omo_04_ENTRY_0) + EVT_WAIT(100) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_05/DB22C0.c b/src/world/area_omo/omo_05/DB22C0.c deleted file mode 100644 index 3a255b7695..0000000000 --- a/src/world/area_omo/omo_05/DB22C0.c +++ /dev/null @@ -1,91 +0,0 @@ -#include "omo_05.h" - -static char* N(exit_str_0) = "omo_17"; -static char* N(exit_str_1) = ""; - -#include "world/common/enemy/ai/ShyGuyWanderAI.inc.c" - -#include "world/common/enemy/ai/GrooveGuyAI.inc.c" - -#include "world/common/enemy/ai/FlyingAI.inc.c" - -#include "world/common/todo/GetNpcCollisionHeight.inc.c" - -#include "world/common/todo/AddPlayerHandsOffset.inc.c" - -INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80242178_DB4438); - -extern s32 N(ItemChoice_HasSelectedItem); -extern s32 N(ItemChoice_SelectedItemID); - -ApiStatus N(ItemChoice_SaveSelected)(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - - N(ItemChoice_SelectedItemID) = evt_get_variable(script, *args++); - N(ItemChoice_HasSelectedItem) = TRUE; - return ApiStatus_DONE2; -} - -BSS s32 D_80245650[92]; -BSS s32 D_802457C0[92]; - -ApiStatus func_80242204_DB44C4(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32* ptr = (s32*) evt_get_variable(script, *args++); - s32 i; - - if (ptr != NULL) { - for (i = 0; ptr[i] != 0; i++) { - D_80245650[i] = ptr[i]; - } - D_80245650[i] = 0; - } else { - for (i = 0; i < 91; i++) { - D_80245650[i] = i + 128; - D_80245650[91] = 0; - } - } - return ApiStatus_DONE2; -} - -ApiStatus func_802422A0_DB4560(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32 itemID = evt_get_variable(script, *args++); - ItemData* item = &gItemTable[itemID]; - - if (itemID == ITEM_CAKE || itemID == ITEM_STRANGE_CAKE || itemID == ITEM_SHROOM_CAKE) { - script->varTable[9] = 2; - } else if (item->typeFlags & ITEM_TYPE_FLAG_FOOD_OR_DRINK) { - script->varTable[9] = 1; - } else { - script->varTable[9] = 0; - } - return ApiStatus_DONE2; -} - -ApiStatus func_80242328_DB45E8(Evt* script, s32 isInitialCall) { - Camera* camera = &gCameras[CAM_DEFAULT]; - - if (isInitialCall) { - camera->flags |= CAMERA_FLAG_SHAKING; - script->functionTempF[0] = 0.0f; - } - script->functionTempF[0] += 10.0f; - guRotateF(camera->viewMtxShaking, script->functionTempF[0], 0.0f, 0.0f, -1.0f); - - if (script->functionTempF[0] >= 360.0) { - return ApiStatus_DONE2; - } - return ApiStatus_BLOCK; -} - -ApiStatus func_802423C8_DB4688(Evt* script, s32 isInitialCall) { - s32 i; - - for (i = 0; i < 91; i++) { - D_802457C0[i] = i + 128; - } - D_802457C0[i] = 0; - - return ApiStatus_DONE2; -} diff --git a/src/world/area_omo/omo_05/omo_05.h b/src/world/area_omo/omo_05/omo_05.h index 8e30f38a1b..5ae2b0ae7c 100644 --- a/src/world/area_omo/omo_05/omo_05.h +++ b/src/world/area_omo/omo_05/omo_05.h @@ -2,8 +2,27 @@ /// @brief Shy Guy's Toybox - PNK Gourmet Guy Crossing #include "common.h" -#include "../omo.h" #include "message_ids.h" #include "map.h" +#include "../omo.h" +#include "mapfs/omo_05_shape.h" +#include "mapfs/omo_05_hit.h" + +#include "sprite/npc/GourmetGuy.h" +#include "sprite/npc/GrooveGuy.h" + +enum { + NPC_GourmetGuy_01 = 0, + NPC_GourmetGuy_02 = 1, + NPC_GourmetGuy_03 = 2, + NPC_GrooveGuy = 3, +}; + #define NAMESPACE omo_05 + +extern EvtScript N(EVS_Main); +extern EvtScript N(EVS_SetupMusic); +extern EvtScript N(EVS_SetupGizmos); +extern EvtScript N(EVS_MakeEntities); +extern NpcGroupList N(DefaultNPCs); diff --git a/src/world/area_omo/omo_05/omo_05_0_header.c b/src/world/area_omo/omo_05/omo_05_0_header.c new file mode 100644 index 0000000000..cbc8800c07 --- /dev/null +++ b/src/world/area_omo/omo_05/omo_05_0_header.c @@ -0,0 +1,16 @@ +#include "omo_05.h" + +EntryList N(Entrances) = { + [omo_05_ENTRY_0] { 590.0, 0.0, 135.0, 270.0 }, + [omo_05_ENTRY_1] { 590.0, 10.0, -140.0, 270.0 }, + [omo_05_ENTRY_2] { -600.0, 10.0, 0.0, 90.0 }, + [omo_05_ENTRY_3] { 600.0, 10.0, 0.0, 270.0 }, +}; + +MapSettings N(settings) = { + .main = &N(EVS_Main), + .entryList = &N(Entrances), + .entryCount = ENTRY_COUNT(N(Entrances)), + .background = &gBackgroundImage, + .tattle = { MSG_MapTattle_omo_05 }, +}; diff --git a/src/world/area_omo/omo_05/omo_05_1_music.c b/src/world/area_omo/omo_05/omo_05_1_music.c new file mode 100644 index 0000000000..4806dca220 --- /dev/null +++ b/src/world/area_omo/omo_05/omo_05_1_music.c @@ -0,0 +1,7 @@ +#include "omo_05.h" + +EvtScript N(EVS_SetupMusic) = { + EVT_CALL(SetMusicTrack, 0, SONG_SHY_GUY_TOYBOX, 0, 8) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_05/omo_05_2_main.c b/src/world/area_omo/omo_05/omo_05_2_main.c new file mode 100644 index 0000000000..93b48d4ee8 --- /dev/null +++ b/src/world/area_omo/omo_05/omo_05_2_main.c @@ -0,0 +1,40 @@ +#include "omo_05.h" + +EvtScript N(EVS_ExitWalk_omo_17_0) = EVT_EXIT_WALK(60, omo_05_ENTRY_0, "omo_17", omo_17_ENTRY_0); +EvtScript N(EVS_ExitWalk_omo_17_1) = EVT_EXIT_WALK(60, omo_05_ENTRY_1, "omo_17", omo_17_ENTRY_1); + +MAP_RODATA_PAD(1, exits); + +EvtScript N(EVS_BindExitTriggers) = { + EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_omo_17_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili3, 1, 0) + EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_omo_17_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili4, 1, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Main) = { + EVT_SET(GB_WorldLocation, LOCATION_SHY_GUYS_TOYBOX) + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_SETUP_CAMERA_DEFAULT() + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(DefaultNPCs))) + EVT_EXEC_WAIT(N(EVS_MakeEntities)) + EVT_EXEC_WAIT(N(EVS_SetupGizmos)) + EVT_EXEC(N(EVS_SetupMusic)) + EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE) + EVT_CALL(SetGroupEnabled, MODEL_popo, 0) + EVT_IF_GE(GB_StoryProgress, STORY_CH4_GAVE_CAKE_TO_GOURMET_GUY) + EVT_CALL(RotateModel, MODEL_o331, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o332, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o333, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o328, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o329, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o330, 105, 0, 1, 0) + EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt1, COLLIDER_FLAGS_UPPER_MASK) + EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt2, COLLIDER_FLAGS_UPPER_MASK) + EVT_END_IF + EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers))) + EVT_EXEC(EnterWalk) + EVT_WAIT(1) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_05/omo_05_3_gizmos.c b/src/world/area_omo/omo_05/omo_05_3_gizmos.c new file mode 100644 index 0000000000..307930b483 --- /dev/null +++ b/src/world/area_omo/omo_05/omo_05_3_gizmos.c @@ -0,0 +1,85 @@ +#include "omo_05.h" + +EvtScript N(EVS_Gizmos_Wheels) = { + EVT_LABEL(0) + EVT_CALL(MakeLerp, 0, -360, 100, EASING_LINEAR) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_ha1, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha2, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha3, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha4, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha5, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha6, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha7, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha8, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha9, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha10, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha11, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha12, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_ha13, LVar0, 0, 0, 1) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Gizmos_Shutters) = { + EVT_LABEL(0) + EVT_LABEL(0) + EVT_CALL(MakeLerp, 0, 160, 60, EASING_COS_IN_OUT) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_m1_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m1_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m2_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m2_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m3_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m3_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m4_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m4_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m5_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m5_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m6_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m6_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m7_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m7_2, LVar0, 0, 1, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(MakeLerp, 160, 0, 60, EASING_COS_IN_OUT) + EVT_LABEL(2) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_m1_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m1_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m2_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m2_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m3_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m3_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m4_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m4_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m5_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m5_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m6_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m6_2, LVar0, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_m7_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m7_2, LVar0, 0, 1, 0) + EVT_WAIT(2) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(2) + EVT_END_IF + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_SetupGizmos) = { + EVT_EXEC(N(EVS_Gizmos_Wheels)) + EVT_EXEC(N(EVS_Gizmos_Shutters)) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_05/omo_05_4_npc.c b/src/world/area_omo/omo_05/omo_05_4_npc.c new file mode 100644 index 0000000000..51b41c3b04 --- /dev/null +++ b/src/world/area_omo/omo_05/omo_05_4_npc.c @@ -0,0 +1,519 @@ +#include "omo_05.h" + +#include "world/common/enemy/complete/ShyGuy_Wander.inc.c" +#include "world/common/enemy/complete/GrooveGuy.inc.c" +#include "world/common/enemy/complete/SkyGuy.inc.c" + +NpcSettings N(NpcSettings_GourmetGuy) = { + .height = 68, + .radius = 60, + .level = 99, +}; + +#include "world/common/complete/NormalItemChoice.inc.c" + +API_CALLABLE(N(JudgeFoodQuality)) { + Bytecode* args = script->ptrReadPos; + s32 itemID = evt_get_variable(script, *args++); + ItemData* item = &gItemTable[itemID]; + + if (itemID == ITEM_CAKE || itemID == ITEM_STRANGE_CAKE || itemID == ITEM_SHROOM_CAKE) { + script->varTable[9] = 2; + } else if (item->typeFlags & ITEM_TYPE_FLAG_FOOD_OR_DRINK) { + script->varTable[9] = 1; + } else { + script->varTable[9] = 0; + } + return ApiStatus_DONE2; +} + +API_CALLABLE(N(SpinCameraAround)) { + Camera* camera = &gCameras[CAM_DEFAULT]; + + if (isInitialCall) { + camera->flags |= CAMERA_FLAG_SHAKING; + script->functionTempF[0] = 0.0f; + } + script->functionTempF[0] += 10.0f; + guRotateF(camera->viewMtxShaking, script->functionTempF[0], 0.0f, 0.0f, -1.0f); + + if (script->functionTempF[0] >= 360.0) { + return ApiStatus_DONE2; + } + return ApiStatus_BLOCK; +} + +BSS s32 N(AllConsumables)[ITEM_NUM_CONSUMABLES + 1]; + +API_CALLABLE(N(MakeAllConsumablesItemList)) { + s32 i; + + for (i = 0; i < ITEM_NUM_CONSUMABLES; i++) { + N(AllConsumables)[i] = ITEM_FIRST_CONSUMABLE + i; + } + N(AllConsumables)[i] = ITEM_NONE; + + return ApiStatus_DONE2; +} + +EvtScript N(EVS_NpcInteract_GourmetGuy) = { + EVT_CALL(DisablePlayerInput, TRUE) + EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) + EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, 0, LVar2) + EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, 0, LVar2) + EVT_CALL(SetCamDistance, CAM_DEFAULT, 350) + EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.5), EVT_FLOAT(-10.0)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) + EVT_CALL(N(MakeAllConsumablesItemList)) + EVT_CALL(NpcFacePlayer, NPC_SELF, 1) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_Idle) + EVT_IF_EQ(GF_OMO01_Met_GourmetGuy, FALSE) + EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GourmetGuy_Talk, ANIM_GourmetGuy_Idle, 0, MSG_CH4_0040) + EVT_SET(GF_OMO01_Met_GourmetGuy, TRUE) + EVT_ELSE + EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GourmetGuy_Talk, ANIM_GourmetGuy_Idle, 0, MSG_CH4_0041) + EVT_END_IF + EVT_CHOOSE_CONSUMABLE_FROM(N(AllConsumables), -1) + EVT_IF_LE(LVar0, 0) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_SitIdle) + EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(8.0)) + EVT_CALL(DisablePlayerInput, FALSE) + EVT_RETURN + EVT_END_IF + EVT_SET(LVar8, LVar0) + EVT_CALL(N(JudgeFoodQuality), LVar0) + EVT_CALL(MakeItemEntity, LVar8, -255, 35, 110, ITEM_SPAWN_MODE_DECORATION, 0) + EVT_SET(LVar7, LVar0) + EVT_CALL(SetItemFlags, LVar7, 64, 1) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_Eat) + EVT_LOOP(6) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2095, 0) + EVT_END_LOOP + EVT_IF_NE(LVar9, 2) + EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(10.0)) + EVT_WAIT(10) + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2096, 0) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_SpitOut) + EVT_CALL(SetItemFlags, LVar7, 64, 0) + EVT_CALL(GetAngleToPlayer, NPC_SELF, LVar0) + EVT_IF_LT(LVar0, 180) + EVT_CALL(MakeLerp, 0, 100, 7, EASING_LINEAR) + EVT_LOOP(0) + EVT_CALL(UpdateLerp) + EVT_SETF(LVar2, EVT_FLOAT(-1.0)) + EVT_SETF(LVar3, EVT_FLOAT(-0.35)) + EVT_SETF(LVar4, EVT_FLOAT(0.0)) + EVT_MULF(LVar2, LVar0) + EVT_MULF(LVar3, LVar0) + EVT_MULF(LVar4, LVar0) + EVT_ADDF(LVar2, EVT_FLOAT(-270.0)) + EVT_ADDF(LVar3, EVT_FLOAT(35.0)) + EVT_ADDF(LVar4, EVT_FLOAT(110.0)) + EVT_CALL(SetItemPos, LVar7, LVar2, LVar3, LVar4) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 0) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_CALL(MakeLerp, 0, 100, 7, EASING_LINEAR) + EVT_LOOP(0) + EVT_CALL(UpdateLerp) + EVT_SETF(LVar2, EVT_FLOAT(-1.0)) + EVT_SETF(LVar3, EVT_FLOAT(0.35)) + EVT_SETF(LVar4, EVT_FLOAT(0.0)) + EVT_MULF(LVar2, LVar0) + EVT_MULF(LVar3, LVar0) + EVT_MULF(LVar4, LVar0) + EVT_ADDF(LVar2, EVT_FLOAT(-355.0)) + EVT_ADDF(LVar3, EVT_FLOAT(0.0)) + EVT_ADDF(LVar4, EVT_FLOAT(110.0)) + EVT_CALL(SetItemPos, LVar7, LVar2, LVar3, LVar4) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 0) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_ELSE + EVT_CALL(MakeLerp, 0, 100, 7, EASING_LINEAR) + EVT_LOOP(0) + EVT_CALL(UpdateLerp) + EVT_SETF(LVar2, EVT_FLOAT(1.0)) + EVT_SETF(LVar3, EVT_FLOAT(-0.35)) + EVT_SETF(LVar4, EVT_FLOAT(0.0)) + EVT_MULF(LVar2, LVar0) + EVT_MULF(LVar3, LVar0) + EVT_MULF(LVar4, LVar0) + EVT_ADDF(LVar2, EVT_FLOAT(-240.0)) + EVT_ADDF(LVar3, EVT_FLOAT(35.0)) + EVT_ADDF(LVar4, EVT_FLOAT(110.0)) + EVT_CALL(SetItemPos, LVar7, LVar2, LVar3, LVar4) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 0) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_CALL(MakeLerp, 0, 100, 7, EASING_LINEAR) + EVT_LOOP(0) + EVT_CALL(UpdateLerp) + EVT_SETF(LVar2, EVT_FLOAT(1.0)) + EVT_SETF(LVar3, EVT_FLOAT(0.35)) + EVT_SETF(LVar4, EVT_FLOAT(0.0)) + EVT_MULF(LVar2, LVar0) + EVT_MULF(LVar3, LVar0) + EVT_MULF(LVar4, LVar0) + EVT_ADDF(LVar2, EVT_FLOAT(-155.0)) + EVT_ADDF(LVar3, EVT_FLOAT(0.0)) + EVT_ADDF(LVar4, EVT_FLOAT(110.0)) + EVT_CALL(SetItemPos, LVar7, LVar2, LVar3, LVar4) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 0) + EVT_BREAK_LOOP + EVT_END_IF + EVT_END_LOOP + EVT_END_IF + EVT_END_IF + EVT_CALL(RemoveItemEntity, LVar7) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_Idle) + EVT_SWITCH(LVar9) + EVT_CASE_EQ(0) + EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GourmetGuy_Talk, ANIM_GourmetGuy_Idle, 0, MSG_CH4_0042) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_SitIdle) + EVT_CASE_EQ(1) + EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GourmetGuy_Talk, ANIM_GourmetGuy_Idle, 0, MSG_CH4_0043) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_SitIdle) + EVT_CASE_EQ(2) + EVT_THREAD + EVT_CALL(ShowMessageAtScreenPos, MSG_CH4_0044, 160, 40) + EVT_END_THREAD + EVT_CALL(DisablePartnerAI, 0) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_Surprise) + EVT_THREAD + EVT_CALL(SetNpcFlagBits, NPC_GourmetGuy_03, NPC_FLAG_2, FALSE) + EVT_CALL(GetNpcPos, NPC_GourmetGuy_03, LVar0, LVar1, LVar2) + EVT_CALL(SetNpcJumpscale, NPC_GourmetGuy_03, EVT_FLOAT(0.05)) + EVT_CALL(NpcJump0, NPC_GourmetGuy_03, LVar0, 2, LVar2, 8) + EVT_CALL(func_802CDE68, 2, 15) + EVT_SET(LVar3, 0) + EVT_LOOP(5) + EVT_ADD(LVar3, 50) + EVT_CALL(SetNpcRotation, NPC_GourmetGuy_03, 0, 0, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_ADD(LVar2, 20) + EVT_CALL(SetNpcJumpscale, NPC_GourmetGuy_03, EVT_FLOAT(0.2)) + EVT_CALL(NpcJump0, NPC_GourmetGuy_03, LVar0, -10, LVar2, 8) + EVT_WAIT(10) + EVT_CALL(RemoveNpc, NPC_GourmetGuy_03) + EVT_END_THREAD + EVT_THREAD + EVT_CALL(SetNpcFlagBits, NPC_GourmetGuy_02, NPC_FLAG_2, FALSE) + EVT_CALL(GetNpcPos, NPC_GourmetGuy_02, LVar0, LVar1, LVar2) + EVT_CALL(SetNpcJumpscale, NPC_GourmetGuy_02, EVT_FLOAT(0.05)) + EVT_CALL(NpcJump0, NPC_GourmetGuy_02, LVar0, 2, LVar2, 8) + EVT_CALL(func_802CDE68, 1, 15) + EVT_SET(LVar3, 0) + EVT_LOOP(5) + EVT_SUB(LVar3, 50) + EVT_CALL(SetNpcRotation, NPC_GourmetGuy_02, 0, 0, LVar3) + EVT_WAIT(1) + EVT_END_LOOP + EVT_ADD(LVar2, 20) + EVT_CALL(SetNpcJumpscale, NPC_GourmetGuy_02, EVT_FLOAT(0.2)) + EVT_CALL(NpcJump0, NPC_GourmetGuy_02, LVar0, -10, LVar2, 8) + EVT_WAIT(10) + EVT_CALL(RemoveNpc, NPC_GourmetGuy_02) + EVT_END_THREAD + EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -250, 25, -100) + EVT_CALL(SetPanTarget, CAM_DEFAULT, -250, 25, -100) + EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(420.0)) + EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(12.0), EVT_FLOAT(-1.5)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(25.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_381, 0) + EVT_WAIT(33) + EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(320.0)) + EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(13.0), EVT_FLOAT(-0.8)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(25.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_382, 0) + EVT_WAIT(33) + EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(250.0)) + EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(14.0), EVT_FLOAT(0.0)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(25.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_383, 0) + EVT_WAIT(18) + EVT_CALL(SetMusicTrack, 0, SONG_GOURMET_GUY_FREAKOUT, 0, 8) + EVT_WAIT(30) + EVT_CALL(SetMotionBlurParams, 0, 0, 0, 320, 240, 128, 10) + EVT_LOOP(7) + EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(320.0)) + EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(14.0), EVT_FLOAT(0.0)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(15.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) + EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(250.0)) + EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(14.0), EVT_FLOAT(0.0)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(15.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) + EVT_END_LOOP + EVT_CALL(RotateModel, MODEL_o331, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o332, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o333, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o328, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o329, 105, 0, 1, 0) + EVT_CALL(RotateModel, MODEL_o330, 105, 0, 1, 0) + EVT_WAIT(5) + EVT_CALL(N(SpinCameraAround)) + EVT_CALL(N(SpinCameraAround)) + EVT_CALL(N(SpinCameraAround)) + EVT_CALL(SetMotionBlurParams, 0, 0, 0, 320, 240, 0, 10) + EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -250, 0, 100) + EVT_CALL(SetPanTarget, CAM_DEFAULT, -250, 0, 100) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_CALL(SetSelfVar, 0, 1) + EVT_THREAD + EVT_LABEL(19) + EVT_CALL(PlayerFaceNpc, NPC_SELF, FALSE) + EVT_CALL(GetSelfVar, 0, LVar0) + EVT_IF_NE(LVar0, 0) + EVT_WAIT(1) + EVT_GOTO(19) + EVT_END_IF + EVT_END_THREAD + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_384, 0) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_Panic) + EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_100, TRUE) + EVT_CALL(SetNpcSpeed, NPC_SELF, EVT_FLOAT(20.0)) + EVT_CALL(NpcMoveTo, NPC_SELF, 0, 110, 0) + EVT_WAIT(20) + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_384, 0) + EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_UPSIDE_DOWN, TRUE) + EVT_CALL(SetNpcPos, NPC_SELF, 0, 145, 110) + EVT_CALL(NpcMoveTo, NPC_SELF, -500, 110, 0) + EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_UPSIDE_DOWN, FALSE) + EVT_WAIT(20) + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_384, 0) + EVT_CALL(SetNpcRotation, NPC_SELF, 0, 0, -45) + EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0) + EVT_CALL(MakeLerp, 0, 100, 30, EASING_LINEAR) + EVT_LABEL(10) + EVT_CALL(UpdateLerp) + EVT_SETF(LVar2, EVT_FLOAT(3.95)) + EVT_SETF(LVar3, EVT_FLOAT(-1.9)) + EVT_SETF(LVar4, EVT_FLOAT(0.0)) + EVT_MULF(LVar2, LVar0) + EVT_MULF(LVar3, LVar0) + EVT_MULF(LVar4, LVar0) + EVT_ADDF(LVar2, EVT_FLOAT(-445.0)) + EVT_ADDF(LVar3, EVT_FLOAT(130.0)) + EVT_ADDF(LVar4, EVT_FLOAT(230.0)) + EVT_CALL(SetNpcPos, NPC_SELF, LVar2, LVar3, LVar4) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(10) + EVT_END_IF + EVT_WAIT(20) + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_384, 0) + EVT_CALL(SetNpcRotation, NPC_SELF, 0, 0, 0) + EVT_CALL(SetNpcPos, NPC_SELF, -500, 0, 110) + EVT_CALL(NpcMoveTo, NPC_SELF, -250, 110, 0) + EVT_WAIT(20) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_TalkSurprise) + EVT_THREAD + EVT_WAIT(15) + EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(-2.5), EVT_FLOAT(-24.0)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.5)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_END_THREAD + EVT_THREAD + EVT_WAIT(15) + EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_385, 0) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_Leap) + EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FLOAT(0.001953125)) + EVT_CALL(NpcJump0, NPC_SELF, -250, 500, 110, 40) + EVT_CALL(SetSelfVar, 0, 2) + EVT_END_THREAD + EVT_CALL(ShowMessageAtScreenPos, MSG_CH4_0045, 160, 40) + EVT_LABEL(12) + EVT_CALL(GetSelfVar, 0, LVar0) + EVT_IF_NE(LVar0, 2) + EVT_WAIT(1) + EVT_GOTO(12) + EVT_END_IF + EVT_CALL(SetSelfVar, 0, 0) + EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) + EVT_CALL(MakeItemEntity, ITEM_COOKBOOK, LVar0, 400, LVar2, ITEM_SPAWN_MODE_FALL_NEVER_VANISH, GF_OMO05_Item_Cookbook) + EVT_WAIT(30) + EVT_CALL(EnablePartnerAI) + EVT_WAIT(20) + EVT_CALL(SetPlayerAnimation, ANIM_Mario_Thinking) + EVT_WAIT(1) + EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(90.0)) + EVT_WAIT(60) + EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002) + EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt1, COLLIDER_FLAGS_UPPER_MASK) + EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt2, COLLIDER_FLAGS_UPPER_MASK) + EVT_SET(GB_StoryProgress, STORY_CH4_GAVE_CAKE_TO_GOURMET_GUY) + EVT_END_SWITCH + EVT_EXEC(N(EVS_SetupMusic)) + EVT_CALL(DisablePlayerInput, FALSE) + EVT_IF_EQ(GB_StoryProgress, STORY_CH4_GAVE_CAKE_TO_GOURMET_GUY) + EVT_CALL(RemoveNpc, NPC_SELF) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcInit_GourmetGuy) = { + EVT_IF_GE(GB_StoryProgress, STORY_CH4_GAVE_CAKE_TO_GOURMET_GUY) + EVT_CALL(RemoveNpc, NPC_GourmetGuy_03) + EVT_CALL(RemoveNpc, NPC_GourmetGuy_02) + EVT_CALL(RemoveNpc, NPC_SELF) + EVT_ELSE + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GourmetGuy_SitIdle) + EVT_CALL(SetNpcAnimation, NPC_GourmetGuy_03, ANIM_GourmetGuy_Fork) + EVT_CALL(SetNpcFlagBits, NPC_GourmetGuy_03, NPC_FLAG_2, TRUE) + EVT_CALL(SetNpcPos, NPC_GourmetGuy_03, -285, 50, 90) + EVT_CALL(SetNpcAnimation, NPC_GourmetGuy_02, ANIM_GourmetGuy_Knife) + EVT_CALL(SetNpcFlagBits, NPC_GourmetGuy_02, NPC_FLAG_2, TRUE) + EVT_CALL(SetNpcPos, NPC_GourmetGuy_02, -210, 50, 90) + EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_GourmetGuy))) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +StaticNpc N(NpcData_GourmetGuy)[] = { + { + .id = NPC_GourmetGuy_01, + .settings = &N(NpcSettings_GourmetGuy), + .pos = { -250.0f, 10.0f, 85.0f }, + .yaw = 90, + .flags = ENEMY_FLAG_1 | ENEMY_FLAG_100 | ENEMY_FLAG_800 | ENEMY_FLAG_400000, + .init = &N(EVS_NpcInit_GourmetGuy), + .drops = { + .dropFlags = NPC_DROP_FLAG_80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + }, + .animations = { + .idle = ANIM_GourmetGuy_Idle, + .walk = ANIM_GourmetGuy_Idle, + .run = ANIM_GourmetGuy_Idle, + .chase = ANIM_GourmetGuy_Idle, + .anim_4 = ANIM_GourmetGuy_Idle, + .anim_5 = ANIM_GourmetGuy_Idle, + .death = ANIM_GourmetGuy_Idle, + .hit = ANIM_GourmetGuy_Idle, + .anim_8 = ANIM_GourmetGuy_Idle, + .anim_9 = ANIM_GourmetGuy_Idle, + .anim_A = ANIM_GourmetGuy_Idle, + .anim_B = ANIM_GourmetGuy_Idle, + .anim_C = ANIM_GourmetGuy_Idle, + .anim_D = ANIM_GourmetGuy_Idle, + .anim_E = ANIM_GourmetGuy_Idle, + .anim_F = ANIM_GourmetGuy_Idle, + }, + .tattle = MSG_NpcTattle_GourmetGuy, + }, + { + .id = NPC_GourmetGuy_02, + .settings = &N(NpcSettings_GourmetGuy), + .pos = { -250.0f, 10.0f, 85.0f }, + .yaw = 90, + .flags = ENEMY_FLAG_1 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_800, + .drops = { + .dropFlags = NPC_DROP_FLAG_80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + }, + .animations = { + .idle = ANIM_GourmetGuy_Idle, + .walk = ANIM_GourmetGuy_Idle, + .run = ANIM_GourmetGuy_Idle, + .chase = ANIM_GourmetGuy_Idle, + .anim_4 = ANIM_GourmetGuy_Idle, + .anim_5 = ANIM_GourmetGuy_Idle, + .death = ANIM_GourmetGuy_Idle, + .hit = ANIM_GourmetGuy_Idle, + .anim_8 = ANIM_GourmetGuy_Idle, + .anim_9 = ANIM_GourmetGuy_Idle, + .anim_A = ANIM_GourmetGuy_Idle, + .anim_B = ANIM_GourmetGuy_Idle, + .anim_C = ANIM_GourmetGuy_Idle, + .anim_D = ANIM_GourmetGuy_Idle, + .anim_E = ANIM_GourmetGuy_Idle, + .anim_F = ANIM_GourmetGuy_Idle, + }, + .tattle = MSG_NpcTattle_GourmetGuy, + }, + { + .id = NPC_GourmetGuy_03, + .settings = &N(NpcSettings_GourmetGuy), + .pos = { -250.0f, 10.0f, 85.0f }, + .yaw = 90, + .flags = ENEMY_FLAG_1 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_800, + .drops = { + .dropFlags = NPC_DROP_FLAG_80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + }, + .animations = { + .idle = ANIM_GourmetGuy_Idle, + .walk = ANIM_GourmetGuy_Idle, + .run = ANIM_GourmetGuy_Idle, + .chase = ANIM_GourmetGuy_Idle, + .anim_4 = ANIM_GourmetGuy_Idle, + .anim_5 = ANIM_GourmetGuy_Idle, + .death = ANIM_GourmetGuy_Idle, + .hit = ANIM_GourmetGuy_Idle, + .anim_8 = ANIM_GourmetGuy_Idle, + .anim_9 = ANIM_GourmetGuy_Idle, + .anim_A = ANIM_GourmetGuy_Idle, + .anim_B = ANIM_GourmetGuy_Idle, + .anim_C = ANIM_GourmetGuy_Idle, + .anim_D = ANIM_GourmetGuy_Idle, + .anim_E = ANIM_GourmetGuy_Idle, + .anim_F = ANIM_GourmetGuy_Idle, + }, + .tattle = MSG_NpcTattle_GourmetGuy, + }, +}; + +StaticNpc N(NpcData_GrooveGuy) = { + .id = NPC_GrooveGuy, + .settings = &N(NpcSettings_GrooveGuy), + .pos = { 320.0f, 10.0f, -145.0f }, + .yaw = 270, + .flags = ENEMY_FLAG_400 | ENEMY_FLAG_800, + .drops = GROOVE_GUY_DROPS, + .territory = { + .wander = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .wanderShape = SHAPE_CYLINDER, + .centerPos = { 320, 10, -145 }, + .wanderSize = { 30 }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { 320, 10, -145 }, + .detectSize = { 200 }, + } + }, + .animations = GROOVE_GUY_ANIMS, + .aiDetectFlags = AI_DETECT_SIGHT, +}; + +NpcGroupList N(DefaultNPCs) = { + NPC_GROUP(N(NpcData_GourmetGuy)), + NPC_GROUP(N(NpcData_GrooveGuy), BTL_OMO_FORMATION_2A, BTL_OMO_STAGE_06), + {} +}; diff --git a/src/world/area_omo/omo_05/omo_05_5_entity.c b/src/world/area_omo/omo_05/omo_05_5_entity.c new file mode 100644 index 0000000000..43b8aea44f --- /dev/null +++ b/src/world/area_omo/omo_05/omo_05_5_entity.c @@ -0,0 +1,20 @@ +#include "omo_05.h" +#include "entity.h" + +EvtScript N(EVS_MakeEntities) = { + EVT_CALL(MakeEntity, EVT_PTR(Entity_YellowBlock), 400, 70, -150, 0, ITEM_COIN, MAKE_ENTITY_END) + EVT_CALL(AssignBlockFlag, GF_OMO05_ItemBlock_CoinA) + EVT_CALL(MakeEntity, EVT_PTR(Entity_YellowBlock), 550, 70, -150, 0, ITEM_COIN, MAKE_ENTITY_END) + EVT_CALL(AssignBlockFlag, GF_OMO05_ItemBlock_CoinB) + EVT_IF_EQ(GF_OMO05_Item_Cookbook, FALSE) + EVT_IF_GT(GB_StoryProgress, STORY_CH4_GOT_TAYCE_TS_CAKE) + EVT_CALL(MakeItemEntity, ITEM_COOKBOOK, -250, 0, 120, ITEM_SPAWN_MODE_KEY, GF_OMO05_Item_Cookbook) + EVT_END_IF + EVT_END_IF + EVT_CALL(MakeEntity, EVT_PTR(Entity_HiddenYellowBlock), 475, 70, -150, 0, ITEM_DIZZY_DIAL, MAKE_ENTITY_END) + EVT_CALL(AssignBlockFlag, GF_OMO05_HiddenItem_DizzyDial) + EVT_CALL(MakeEntity, EVT_PTR(Entity_HiddenYellowBlock), -540, 70, -150, 0, ITEM_SUPER_SODA, MAKE_ENTITY_END) + EVT_CALL(AssignBlockFlag, GF_OMO05_HiddenItem_SuperSoda) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_07/DBD2B0.c b/src/world/area_omo/omo_07/DBD2B0.c deleted file mode 100644 index bc5a0a373a..0000000000 --- a/src/world/area_omo/omo_07/DBD2B0.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "omo_07.h" - -static char* N(exit_str_0) = "omo_06"; -static char* N(exit_str_1) = ""; - -#include "world/common/enemy/ai/ShyGuyWanderAI.inc.c" - -#include "world/common/enemy/ai/ShyGuyPatrolAI.inc.c" - -#include "world/common/enemy/ai/FlyingAI.inc.c" - -#include "world/common/todo/SetCamera0Flag1000.inc.c" - -#include "world/common/todo/UnsetCamera0Flag1000.inc.c" - -ApiStatus func_80242EA8_DC0158(Evt* script, s32 isInitialCall) { - Bytecode* args = script->ptrReadPos; - s32 temp_s1; - s32 t0; - s32 t1; - - temp_s1 = AreaFlag(7); - do { - t0 = evt_get_variable(script, *(args++)); - } while (0); // TODO required to match - t0 += temp_s1; - t1 = evt_get_variable(script, *args++); - - evt_set_variable(script, t0, t1); - return ApiStatus_DONE2; -} diff --git a/src/world/area_omo/omo_07/DC01D0.c b/src/world/area_omo/omo_07/DC01D0.c deleted file mode 100644 index 9447223651..0000000000 --- a/src/world/area_omo/omo_07/DC01D0.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "omo_07.h" - -static char* N(exit_str_2) = "omo_07"; - -#include "world/common/todo/StashVars.inc.c" - -#include "world/common/todo/GetItemName.inc.c" - -#include "world/common/todo/SomeItemEntityFunc.inc.c" - -#include "world/common/todo/IsItemBadge.inc.c" - -#include "world/common/todo/UnsetCamera0MoveFlag1.inc.c" - -#include "world/common/todo/SetCamera0MoveFlag1.inc.c" diff --git a/src/world/area_omo/omo_07/DC04D0.c b/src/world/area_omo/omo_07/DC04D0.c deleted file mode 100644 index c3965ba31b..0000000000 --- a/src/world/area_omo/omo_07/DC04D0.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "omo_07.h" - -#define KAMMY_NPC 7 -#include "world/common/util/GetKammyBroomEmitterPos.inc.c" diff --git a/src/world/area_omo/omo_07/omo_07.h b/src/world/area_omo/omo_07/omo_07.h index 85cb4ab45e..00680c11ef 100644 --- a/src/world/area_omo/omo_07/omo_07.h +++ b/src/world/area_omo/omo_07/omo_07.h @@ -2,8 +2,46 @@ /// @brief Shy Guy's Toybox - PNK Playhouse #include "common.h" -#include "../omo.h" #include "message_ids.h" #include "map.h" +#include "../omo.h" +#include "mapfs/omo_07_shape.h" +#include "mapfs/omo_07_hit.h" + +#include "sprite/npc/ShyGuy.h" +#include "sprite/npc/Fuzzy.h" +#include "sprite/npc/HammerBros.h" +#include "sprite/npc/SkyGuy.h" +#include "sprite/npc/WorldKammy.h" + +enum { + NPC_ShyGuy_01 = 1, + NPC_ShyGuy_02 = 2, + NPC_ShyGuy_03 = 3, + NPC_ShyGuy_04 = 4, // never appears + NPC_Fuzzy = 5, + NPC_HammerBros = 6, + NPC_Kammy = 7, + NPC_SkyGuy_01 = 8, + NPC_SkyGuy_02 = 9, +}; + +enum { + MV_SecretDoorAngle = MapVar(0), + MV_AmbushID = MapVar(10), // npcID or itemID depending on GB_OMO_PeachChoice1 +}; + #define NAMESPACE omo_07 + +extern EvtScript N(EVS_Main); +extern EvtScript N(EVS_SetupMusic); +extern EvtScript N(EVS_SetupGizmos); +extern EvtScript N(EVS_MakeEntities); +extern EvtScript N(EVS_SetupShyGuyPool); +extern EvtScript N(EVS_Scene_KammySetAmbush); +extern EvtScript N(EVS_NpcIdle_Kammy); +extern NpcGroupList N(KammySceneNPCs); +extern NpcGroupList N(FuzzyAmbushNPCs); +extern NpcGroupList N(HammerBrosAmbushNPCs); +extern NpcGroupList N(DefaultNPCs); diff --git a/src/world/area_omo/omo_07/omo_07_0_header.c b/src/world/area_omo/omo_07/omo_07_0_header.c new file mode 100644 index 0000000000..ea31525759 --- /dev/null +++ b/src/world/area_omo/omo_07/omo_07_0_header.c @@ -0,0 +1,13 @@ +#include "omo_07.h" + +EntryList N(Entrances) = { + [omo_07_ENTRY_0] { -960.0, 0.0, 73.0, 90.0 }, +}; + +MapSettings N(settings) = { + .main = &N(EVS_Main), + .entryList = &N(Entrances), + .entryCount = ENTRY_COUNT(N(Entrances)), + .background = &gBackgroundImage, + .tattle = { MSG_MapTattle_omo_07 }, +}; diff --git a/src/world/area_omo/omo_07/omo_07_1_music.c b/src/world/area_omo/omo_07/omo_07_1_music.c new file mode 100644 index 0000000000..1f4a155fb8 --- /dev/null +++ b/src/world/area_omo/omo_07/omo_07_1_music.c @@ -0,0 +1,11 @@ +#include "omo_07.h" + +EvtScript N(EVS_SetupMusic) = { + EVT_IF_EQ(GF_OMO07_SpawnedPeachChoice2, FALSE) + EVT_CALL(SetMusicTrack, 0, SONG_KAMMY_KOOPA_THEME, 0, 8) + EVT_ELSE + EVT_CALL(SetMusicTrack, 0, SONG_SHY_GUY_TOYBOX, 0, 8) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_07/omo_07_2_main.c b/src/world/area_omo/omo_07/omo_07_2_main.c new file mode 100644 index 0000000000..c88a9d5c1a --- /dev/null +++ b/src/world/area_omo/omo_07/omo_07_2_main.c @@ -0,0 +1,48 @@ +#include "omo_07.h" + +EvtScript N(EVS_ExitWalk_omo_06_4) = EVT_EXIT_WALK(60, omo_07_ENTRY_0, "omo_06", omo_06_ENTRY_4); + +MAP_RODATA_PAD(1, exits); + +EvtScript N(EVS_BindExitTriggers) = { + EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_omo_06_4)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili1, 1, 0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Main) = { + EVT_SET(GB_WorldLocation, LOCATION_SHY_GUYS_TOYBOX) + EVT_CALL(SetSpriteShading, SHADING_NONE) + EVT_SETUP_CAMERA_DEFAULT() + EVT_IF_EQ(GF_OMO07_SpawnedPeachChoice2, FALSE) + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(KammySceneNPCs))) + EVT_ELSE + EVT_IF_EQ(GF_OMO07_Item_ThunderRage, FALSE) + EVT_SWITCH(GB_OMO_PeachChoice2) + EVT_CASE_EQ(0) + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(FuzzyAmbushNPCs))) + EVT_CASE_EQ(1) + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(HammerBrosAmbushNPCs))) + EVT_CASE_EQ(2) + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(DefaultNPCs))) + EVT_CALL(MakeItemEntity, ITEM_THUNDER_RAGE, 1080, 0, 0, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_OMO07_Item_ThunderRage) + EVT_END_SWITCH + EVT_ELSE + EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(DefaultNPCs))) + EVT_END_IF + EVT_END_IF + EVT_EXEC_WAIT(N(EVS_MakeEntities)) + EVT_EXEC_WAIT(N(EVS_SetupGizmos)) + EVT_EXEC_WAIT(N(EVS_SetupMusic)) + EVT_EXEC(N(EVS_SetupShyGuyPool)) + EVT_IF_EQ(GF_OMO07_SpawnedPeachChoice2, FALSE) + EVT_EXEC(N(EVS_Scene_KammySetAmbush)) + EVT_WAIT(2) + EVT_ELSE + EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers))) + EVT_EXEC(EnterWalk) + EVT_WAIT(1) + EVT_END_IF + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_07/omo_07_3_gizmos.c b/src/world/area_omo/omo_07/omo_07_3_gizmos.c new file mode 100644 index 0000000000..f0a85670a8 --- /dev/null +++ b/src/world/area_omo/omo_07/omo_07_3_gizmos.c @@ -0,0 +1,49 @@ +#include "omo_07.h" + +EvtScript N(EVS_Gizmos_Shutters) = { + EVT_LABEL(0) + EVT_CALL(MakeLerp, 0, 160, 60, EASING_COS_IN_OUT) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_m1_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m1_2, LVar0, 0, 1, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(MakeLerp, 160, 0, 60, EASING_COS_IN_OUT) + EVT_LABEL(2) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_m1_1, LVar0, 0, -1, 0) + EVT_CALL(RotateModel, MODEL_m1_2, LVar0, 0, 1, 0) + EVT_WAIT(2) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(2) + EVT_END_IF + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Gizmos_Wheels) = { + EVT_LABEL(0) + EVT_CALL(MakeLerp, 0, -360, 100, EASING_LINEAR) + EVT_LABEL(1) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_hari1, LVar0, 0, 0, 1) + EVT_CALL(RotateModel, MODEL_hari2, LVar0, 0, 0, 1) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_SetupGizmos) = { + EVT_EXEC(N(EVS_Gizmos_Shutters)) + EVT_EXEC(N(EVS_Gizmos_Wheels)) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_07/omo_07_4_npc.c b/src/world/area_omo/omo_07/omo_07_4_npc.c new file mode 100644 index 0000000000..97211eb792 --- /dev/null +++ b/src/world/area_omo/omo_07/omo_07_4_npc.c @@ -0,0 +1,636 @@ +#include "omo_07.h" + +#include "world/common/enemy/complete/ShyGuy_Wander.inc.c" +#include "world/common/enemy/complete/ShyGuy_Patrol.inc.c" +#include "world/common/enemy/complete/SkyGuy.inc.c" + +NpcSettings N(NpcSettings_Fuzzy) = { + .height = 23, + .radius = 22, + .level = 14, + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, + .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER, +}; + +NpcSettings N(NpcSettings_HammerBros) = { + .height = 36, + .radius = 24, + .level = 27, +}; + +#include "world/common/enemy/complete/Kammy.h" + +NpcSettings N(NpcSettings_Kammy) = { + .height = 34, + .radius = 24, + .level = 26, + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, +}; + +#include "world/common/todo/SetCamera0Flag1000.inc.c" +#include "world/common/todo/UnsetCamera0Flag1000.inc.c" + +// an 'unlimited' number of shy guys walk along the path and emerge from the playhouse +// they are drawn from a pool of 4 NPCs, with their lifecycle tracked via these states +enum { + // Get/SetSelfVar + SHYGUY_VAR_STATE = 0, + SHYGUY_VAR_WAIT_TIME = 1, + // states + SHYGUY_STATE_FREE = 0, + SHYGUY_STATE_RUN_TO_DOOR = 1, + SHYGUY_STATE_WAIT_AT_DOOR = 2, + SHYGUY_STATE_OPEN_DOOR = 3, + SHYGUY_STATE_ACTIVE = 4, + SHYGUY_STATE_RECYCLE = 10, + SHYGUY_STATE_FORCE_RECYCLE = 11, // unused, recycles NPC immediately +}; + +API_CALLABLE(N(SetShyGuyPoolState)) { + Bytecode* args = script->ptrReadPos; + s32 base; + s32 npcID; + s32 value; + + base = AF_OMO07_NpcPool0; + do { + npcID = evt_get_variable(script, *(args++)); + } while (0); // TODO required to match + npcID += base; + value = evt_get_variable(script, *args++); + + evt_set_variable(script, npcID, value); + return ApiStatus_DONE2; +} + +EvtScript N(EVS_Push_SecretDoor) = { + EVT_IF_EQ(AF_OMO07_DoorOpening, TRUE) + EVT_RETURN + EVT_END_IF + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_IF_GT(LVar2, -50) + EVT_RETURN + EVT_END_IF + EVT_IF_GT(LVar0, 15) + EVT_IF_LT(LVar0, 35) + EVT_RETURN + EVT_END_IF + EVT_END_IF + EVT_CALL(DisablePlayerInput, TRUE) + EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt1, COLLIDER_FLAGS_UPPER_MASK) + EVT_SET(AF_OMO07_DoorOpening, TRUE) + EVT_CALL(PlaySoundAt, SOUND_1D9, 0, 25, 0, -55) + EVT_THREAD + EVT_IF_LT(LVar0, 25) + EVT_CALL(MakeLerp, 0, 180, 30, EASING_COS_IN_OUT) + EVT_LABEL(10) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_k, LVar0, 0, 1, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(10) + EVT_END_IF + EVT_ELSE + EVT_CALL(MakeLerp, 180, 0, 30, EASING_COS_IN_OUT) + EVT_LABEL(11) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_k, LVar0, 0, 1, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(11) + EVT_END_IF + EVT_END_IF + EVT_CALL(UpdateColliderTransform, COLLIDER_tt1) + EVT_END_THREAD + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_ADD(LVar2, 60) + EVT_WAIT(10) + EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0)) + EVT_CALL(PlayerMoveTo, LVar0, LVar2, 0) + EVT_SET(AF_OMO07_DoorOpening, FALSE) + EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_tt1, COLLIDER_FLAGS_UPPER_MASK) + EVT_CALL(DisablePlayerInput, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_SetupShyGuyPool) = { + EVT_CALL(ParentColliderToModel, COLLIDER_tt1, MODEL_k) + EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Push_SecretDoor)), TRIGGER_WALL_PUSH, COLLIDER_tt1, 1, 0) + EVT_SET(AF_OMO07_NpcPool0, FALSE) + EVT_SET(AF_OMO07_NpcPool1, FALSE) + EVT_SET(AF_OMO07_NpcPool2, FALSE) + EVT_SET(AF_OMO07_NpcPool3, FALSE) + EVT_LABEL(0) + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_WAIT(1) + EVT_IF_LT(LVar0, 400) + EVT_GOTO(0) + EVT_END_IF + EVT_LABEL(1) + EVT_SET(LVar4, -1) + EVT_IF_EQ(AF_OMO07_NpcPool3, FALSE) + EVT_SET(LVar4, NPC_ShyGuy_03) + EVT_END_IF + EVT_IF_EQ(AF_OMO07_NpcPool2, FALSE) + EVT_SET(LVar4, NPC_ShyGuy_02) + EVT_END_IF + EVT_IF_EQ(AF_OMO07_NpcPool1, FALSE) + EVT_SET(LVar4, NPC_ShyGuy_01) + EVT_END_IF + EVT_IF_EQ(LVar4, -1) + EVT_WAIT(1) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_EQ(AF_OMO07_NpcPool0, FALSE) + EVT_SET(AF_OMO07_NpcPool0, TRUE) + EVT_ELSE + EVT_WAIT(40) + EVT_END_IF + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_IF_LT(LVar2, -85) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_LT(LVar0, -50) + EVT_GOTO(1) + EVT_END_IF + EVT_IF_GT(LVar0, 600) + EVT_GOTO(1) + EVT_END_IF + EVT_CALL(N(SetShyGuyPoolState), LVar4, TRUE) + EVT_CALL(SetNpcVar, LVar4, SHYGUY_VAR_STATE, SHYGUY_STATE_RUN_TO_DOOR) + EVT_WAIT(1) + EVT_LABEL(2) + EVT_CALL(GetNpcVar, LVar4, SHYGUY_VAR_STATE, LVar3) + EVT_IF_EQ(LVar3, SHYGUY_STATE_RUN_TO_DOOR) + EVT_WAIT(1) + EVT_GOTO(2) + EVT_END_IF + EVT_GOTO(1) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcAI_ShyGuy) = { + EVT_LABEL(0) + EVT_CALL(GetSelfVar, SHYGUY_VAR_STATE, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(SHYGUY_STATE_FREE) + EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION) + EVT_CASE_EQ(SHYGUY_STATE_RUN_TO_DOOR) + EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_2, FALSE) + EVT_CALL(EnableNpcShadow, NPC_SELF, TRUE) + EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAG_1, 0) + EVT_CALL(SetNpcPos, NPC_SELF, 800, 0, 75) + EVT_CALL(SetNpcSpeed, NPC_SELF, EVT_FLOAT(4.0)) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_ShyGuy_Red_Anim03) + EVT_CALL(SetNpcSpeed, NPC_SELF, EVT_FLOAT(5.0)) + EVT_CALL(NpcMoveTo, NPC_SELF, 665, 75, 0) + EVT_CALL(SetNpcSpeed, NPC_SELF, EVT_FLOAT(4.0)) + EVT_CALL(NpcMoveTo, NPC_SELF, 635, -107, 0) + EVT_CALL(NpcMoveTo, NPC_SELF, 100, -107, 0) + EVT_CALL(NpcMoveTo, NPC_SELF, -10, -107, 0) + EVT_CALL(SetSelfVar, SHYGUY_VAR_STATE, SHYGUY_STATE_WAIT_AT_DOOR) + EVT_CALL(SetSelfVar, SHYGUY_VAR_WAIT_TIME, 0) + EVT_CASE_EQ(SHYGUY_STATE_WAIT_AT_DOOR) + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_IF_LT(LVar0, 130) + EVT_WAIT(40) + EVT_CALL(SetSelfVar, SHYGUY_VAR_STATE, SHYGUY_STATE_OPEN_DOOR) + EVT_END_IF + EVT_CALL(GetSelfVar, SHYGUY_VAR_WAIT_TIME, LVar0) + EVT_ADD(LVar0, 1) + EVT_CALL(SetSelfVar, SHYGUY_VAR_WAIT_TIME, LVar0) + EVT_IF_GT(LVar0, 180) + EVT_WAIT(40) + EVT_CALL(SetSelfVar, SHYGUY_VAR_STATE, SHYGUY_STATE_OPEN_DOOR) + EVT_CALL(SetSelfVar, SHYGUY_VAR_WAIT_TIME, 0) + EVT_END_IF + EVT_CASE_EQ(SHYGUY_STATE_OPEN_DOOR) + EVT_CALL(PlaySoundAt, SOUND_1D9, 0, 25, 0, -55) + EVT_THREAD + EVT_SET(AF_OMO07_DoorOpening, TRUE) + EVT_SET(LVar2, MV_SecretDoorAngle) + EVT_ADD(LVar2, 180) + EVT_CALL(MakeLerp, MV_SecretDoorAngle, LVar2, 30, EASING_COS_IN_OUT) + EVT_LABEL(10) + EVT_CALL(UpdateLerp) + EVT_CALL(RotateModel, MODEL_k, LVar0, 0, 1, 0) + EVT_CALL(UpdateColliderTransform, COLLIDER_tt1) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(10) + EVT_END_IF + EVT_SET(MV_SecretDoorAngle, LVar2) + EVT_MOD(MV_SecretDoorAngle, 360) + EVT_SET(AF_OMO07_DoorOpening, FALSE) + EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_40, FALSE) + EVT_END_THREAD + EVT_WAIT(10) + EVT_CALL(NpcMoveTo, NPC_SELF, -10, 50, 0) + EVT_CALL(GetSelfVar, SHYGUY_VAR_STATE, LVar0) + EVT_IF_EQ(LVar0, SHYGUY_STATE_OPEN_DOOR) + EVT_CALL(SetSelfVar, SHYGUY_VAR_STATE, SHYGUY_STATE_ACTIVE) + EVT_END_IF + EVT_CASE_EQ(SHYGUY_STATE_ACTIVE) + EVT_WAIT(1) + EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_ShyGuy_Patrol))) + EVT_WAIT(10) + EVT_CASE_EQ(SHYGUY_STATE_RECYCLE) + EVT_CALL(DisablePlayerInput, TRUE) + EVT_LOOP(30) + EVT_CALL(GetSelfNpcID, LVar0) + EVT_CALL(N(SetShyGuyPoolState), LVar0, FALSE) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION) + EVT_CALL(DisablePlayerInput, FALSE) + EVT_CALL(SetSelfVar, SHYGUY_VAR_STATE, SHYGUY_STATE_FREE) + EVT_CASE_EQ(SHYGUY_STATE_FORCE_RECYCLE) + EVT_CALL(GetSelfNpcID, LVar0) + EVT_CALL(N(SetShyGuyPoolState), LVar0, FALSE) + EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION) + EVT_CALL(SetSelfVar, SHYGUY_VAR_STATE, SHYGUY_STATE_FREE) + EVT_END_SWITCH + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcDefeat_ShyGuy) = { + EVT_CALL(GetBattleOutcome, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(OUTCOME_PLAYER_WON) + EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_40 | NPC_FLAG_100, TRUE) + EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAG_1, 1) + EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE) + EVT_CALL(SetSelfVar, SHYGUY_VAR_STATE, SHYGUY_STATE_RECYCLE) + EVT_WAIT(1) + EVT_CALL(SetSelfVar, SHYGUY_VAR_STATE, SHYGUY_STATE_RECYCLE) + EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_ShyGuy))) + EVT_CALL(DoNpcDefeat) + EVT_WAIT(1) + EVT_CASE_EQ(OUTCOME_PLAYER_LOST) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_ShyGuy_Red_Anim03) + EVT_CASE_EQ(OUTCOME_PLAYER_FLED) + EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_ShyGuy_Red_Anim03) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcInit_ShyGuy) = { + EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcAI_ShyGuy))) + EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_ShyGuy))) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcIdle_Fuzzy) = { + EVT_LABEL(0) + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_IF_LT(LVar0, 990) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_END_IF + EVT_CALL(DisablePlayerInput, TRUE) + EVT_CALL(N(SetCamera0Flag1000)) + EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2) + EVT_CALL(SetCamProperties, CAM_DEFAULT, EVT_FLOAT(5.0), LVar0, LVar1, LVar2, 300, EVT_FLOAT(13.0), EVT_FLOAT(-9.5)) + EVT_IF_EQ(GB_OMO_PeachChoice2, 0) + EVT_CALL(SpeakToPlayer, NPC_Fuzzy, ANIM_Fuzzy_Anim0B, ANIM_Fuzzy_Idle, 0, MSG_CH4_003C) + EVT_ELSE + EVT_CALL(SpeakToPlayer, NPC_HammerBros, ANIM_HammerBros_Anim0A, ANIM_HammerBros_Anim02, 0, MSG_CH4_003D) + EVT_END_IF + EVT_THREAD + EVT_CALL(N(UnsetCamera0Flag1000)) + EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0)) + EVT_END_THREAD + EVT_CALL(DisablePlayerInput, FALSE) + EVT_CALL(StartBossBattle, SONG_SPECIAL_BATTLE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcDefeat_Fuzzy) = { + EVT_CALL(GetBattleOutcome, LVar0) + EVT_SWITCH(LVar0) + EVT_CASE_EQ(OUTCOME_PLAYER_WON) + EVT_SET(GF_OMO07_Item_ThunderRage, TRUE) + EVT_CALL(DoNpcDefeat) + EVT_CASE_EQ(OUTCOME_PLAYER_LOST) + EVT_CASE_EQ(OUTCOME_PLAYER_FLED) + EVT_END_SWITCH + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcInit_Fuzzy) = { + EVT_IF_EQ(GB_OMO_PeachChoice2, 0) + EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Fuzzy))) + EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Fuzzy))) + EVT_ELSE + EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcInit_HammerBros) = { + EVT_IF_EQ(GB_OMO_PeachChoice2, 1) + EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Fuzzy))) + EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Fuzzy))) + EVT_ELSE + EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION) + EVT_END_IF + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcInit_Kammy) = { + EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Kammy))) + EVT_RETURN + EVT_END +}; + +StaticNpc N(NpcData_ShyGuy) = { + .id = NPC_ShyGuy_01, + .settings = &N(NpcSettings_ShyGuy_Patrol), + .pos = { NPC_DISPOSE_LOCATION }, + .yaw = 270, + .flags = ENEMY_FLAG_4 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800 | ENEMY_FLAG_200000, + .init = &N(EVS_NpcInit_ShyGuy), + .drops = SHY_GUY_NO_DROPS, + .territory = { + .patrol = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .numPoints = 6, + .points = { + { 30, 0, 50 }, + { 50, 0, 100 }, + { 100, 0, 100 }, + { 120, 0, 50 }, + { 100, 0, 0 }, + { 50, 0, 0 }, + }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { 75, 0, 50 }, + .detectSize = { 100 }, + } + }, + .animations = RED_SHY_GUY_ANIMS, +}; + +StaticNpc N(NpcData_ShyGuy_02) = { + .id = NPC_ShyGuy_02, + .settings = &N(NpcSettings_ShyGuy_Patrol), + .pos = { NPC_DISPOSE_LOCATION }, + .yaw = 270, + .flags = ENEMY_FLAG_4 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800 | ENEMY_FLAG_200000, + .init = &N(EVS_NpcInit_ShyGuy), + .drops = SHY_GUY_NO_DROPS, + .territory = { + .patrol = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .numPoints = 6, + .points = { + { 30, 0, 50 }, + { 50, 0, 100 }, + { 100, 0, 100 }, + { 120, 0, 50 }, + { 100, 0, 0 }, + { 50, 0, 0 }, + }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { 75, 0, 50 }, + .detectSize = { 100 }, + } + }, + .animations = RED_SHY_GUY_ANIMS, +}; + +StaticNpc N(NpcData_ShyGuy_03) = { + .id = NPC_ShyGuy_03, + .settings = &N(NpcSettings_ShyGuy_Patrol), + .pos = { NPC_DISPOSE_LOCATION }, + .yaw = 270, + .flags = ENEMY_FLAG_4 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800 | ENEMY_FLAG_200000, + .init = &N(EVS_NpcInit_ShyGuy), + .drops = SHY_GUY_NO_DROPS, + .territory = { + .patrol = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .numPoints = 6, + .points = { + { 30, 0, 50 }, + { 50, 0, 100 }, + { 100, 0, 100 }, + { 120, 0, 50 }, + { 100, 0, 0 }, + { 50, 0, 0 }, + }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { 75, 0, 50 }, + .detectSize = { 100 }, + } + }, + .animations = RED_SHY_GUY_ANIMS, +}; + +StaticNpc N(NpcData_ShyGuy_04) = { + .id = NPC_ShyGuy_04, + .settings = &N(NpcSettings_ShyGuy_Patrol), + .pos = { NPC_DISPOSE_LOCATION }, + .yaw = 270, + .flags = ENEMY_FLAG_4 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800 | ENEMY_FLAG_200000, + .init = &N(EVS_NpcInit_ShyGuy), + .drops = SHY_GUY_NO_DROPS, + .territory = { + .patrol = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .numPoints = 6, + .points = { + { 30, 0, 50 }, + { 50, 0, 100 }, + { 100, 0, 100 }, + { 120, 0, 50 }, + { 100, 0, 0 }, + { 50, 0, 0 }, + }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { 75, 0, 50 }, + .detectSize = { 100 }, + } + }, + .animations = RED_SHY_GUY_ANIMS, +}; + +StaticNpc N(NpcData_Fuzzy) = { + .id = NPC_Fuzzy, + .settings = &N(NpcSettings_Fuzzy), + .pos = { 1050.0f, 0.0f, 0.0f }, + .yaw = 270, + .flags = ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800 | ENEMY_FLAG_40000 | ENEMY_FLAG_400000, + .init = &N(EVS_NpcInit_Fuzzy), + .drops = NPC_NO_DROPS, + .animations = { + .idle = ANIM_Fuzzy_Walk, + .walk = ANIM_Fuzzy_Walk, + .run = ANIM_Fuzzy_Run, + .chase = ANIM_Fuzzy_Run, + .anim_4 = ANIM_Fuzzy_Idle, + .anim_5 = ANIM_Fuzzy_Idle, + .death = ANIM_Fuzzy_Hurt, + .hit = ANIM_Fuzzy_Hurt, + .anim_8 = ANIM_Fuzzy_Run, + .anim_9 = ANIM_Fuzzy_Run, + .anim_A = ANIM_Fuzzy_Run, + .anim_B = ANIM_Fuzzy_Run, + .anim_C = ANIM_Fuzzy_Run, + .anim_D = ANIM_Fuzzy_Run, + .anim_E = ANIM_Fuzzy_Run, + .anim_F = ANIM_Fuzzy_Run, + }, +}; + +StaticNpc N(NpcData_HammerBros) = { + .id = NPC_HammerBros, + .settings = &N(NpcSettings_HammerBros), + .pos = { 1050.0f, 0.0f, 0.0f }, + .yaw = 270, + .flags = ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800 | ENEMY_FLAG_40000 | ENEMY_FLAG_400000, + .init = &N(EVS_NpcInit_HammerBros), + .drops = NPC_NO_DROPS, + .animations = { + .idle = ANIM_HammerBros_Anim02, + .walk = ANIM_HammerBros_Anim04, + .run = ANIM_HammerBros_Anim07, + .chase = ANIM_HammerBros_Anim07, + .anim_4 = ANIM_HammerBros_Anim02, + .anim_5 = ANIM_HammerBros_Anim02, + .death = ANIM_HammerBros_Anim0E, + .hit = ANIM_HammerBros_Anim0E, + .anim_8 = ANIM_HammerBros_Anim18, + .anim_9 = ANIM_HammerBros_Anim19, + .anim_A = ANIM_HammerBros_Anim02, + .anim_B = ANIM_HammerBros_Anim02, + .anim_C = ANIM_HammerBros_Anim02, + .anim_D = ANIM_HammerBros_Anim02, + .anim_E = ANIM_HammerBros_Anim02, + .anim_F = ANIM_HammerBros_Anim02, + }, +}; + +StaticNpc N(NpcData_SkyGuy_01) = { + .id = NPC_SkyGuy_01, + .settings = &N(NpcSettings_SkyGuy), + .pos = { -650.0f, 140.0f, -105.0f }, + .yaw = 270, + .flags = ENEMY_FLAG_400 | ENEMY_FLAG_800, + .drops = SKY_GUY_DROPS, + .territory = { + .wander = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .wanderShape = SHAPE_CYLINDER, + .centerPos = { -650, 140, -105 }, + .wanderSize = { 30 }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { -650, 140, -105 }, + .detectSize = { 200 }, + } + }, + .animations = SKY_GUY_ANIMS, + .aiDetectFlags = AI_DETECT_SIGHT, +}; + +StaticNpc N(NpcData_SkyGuy_02) = { + .id = NPC_SkyGuy_02, + .settings = &N(NpcSettings_SkyGuy), + .pos = { -550.0f, 60.0f, 70.0f }, + .yaw = 270, + .flags = ENEMY_FLAG_400 | ENEMY_FLAG_800, + .drops = SKY_GUY_DROPS, + .territory = { + .wander = { + .isFlying = TRUE, + .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, + .wanderShape = SHAPE_CYLINDER, + .centerPos = { -550, 60, 70 }, + .wanderSize = { 30 }, + .detectShape = SHAPE_CYLINDER, + .detectPos = { -550, 60, 70 }, + .detectSize = { 200 }, + } + }, + .animations = SKY_GUY_ANIMS, + .aiDetectFlags = AI_DETECT_SIGHT, +}; + +s32 N(ExtraAnims_Kammy)[] = { + ANIM_WorldKammy_Anim0E, + ANIM_WorldKammy_Anim0F, + ANIM_WorldKammy_Anim10, + ANIM_WorldKammy_Anim13, + ANIM_WorldKammy_Anim15, + ANIM_WorldKammy_Anim16, + -1 +}; + +StaticNpc N(NpcData_Kammy) = { + .id = NPC_Kammy, + .settings = &N(NpcSettings_Kammy), + .pos = { NPC_DISPOSE_LOCATION }, + .yaw = 90, + .flags = ENEMY_FLAG_4 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800, + .init = &N(EVS_NpcInit_Kammy), + .drops = NPC_NO_DROPS, + .animations = KAMMY_ANIMS, + .extraAnimations = N(ExtraAnims_Kammy), +}; + +NpcGroupList N(FuzzyAmbushNPCs) = { + NPC_GROUP(N(NpcData_ShyGuy), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_ShyGuy_02), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_ShyGuy_03), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_ShyGuy_04), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_SkyGuy_01), BTL_OMO_FORMATION_14, BTL_OMO_STAGE_00), + NPC_GROUP(N(NpcData_SkyGuy_02), BTL_OMO_FORMATION_12, BTL_OMO_STAGE_00), + NPC_GROUP(N(NpcData_Fuzzy), BTL_OMO3_FORMATION_05, BTL_OMO3_STAGE_05), + {} +}; + +NpcGroupList N(HammerBrosAmbushNPCs) = { + NPC_GROUP(N(NpcData_ShyGuy), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_ShyGuy_02), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_ShyGuy_03), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_ShyGuy_04), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_SkyGuy_01), BTL_OMO_FORMATION_14, BTL_OMO_STAGE_00), + NPC_GROUP(N(NpcData_SkyGuy_02), BTL_OMO_FORMATION_12, BTL_OMO_STAGE_00), + NPC_GROUP(N(NpcData_HammerBros), BTL_OMO3_FORMATION_07, BTL_OMO3_STAGE_05), + {} +}; + +NpcGroupList N(DefaultNPCs) = { + NPC_GROUP(N(NpcData_ShyGuy), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_ShyGuy_02), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_ShyGuy_03), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_ShyGuy_04), BTL_OMO3_FORMATION_0A, BTL_OMO3_STAGE_01), + NPC_GROUP(N(NpcData_SkyGuy_01), BTL_OMO_FORMATION_14, BTL_OMO_STAGE_00), + NPC_GROUP(N(NpcData_SkyGuy_02), BTL_OMO_FORMATION_12, BTL_OMO_STAGE_00), + {} +}; + +NpcGroupList N(KammySceneNPCs) = { + NPC_GROUP(N(NpcData_Kammy)), + NPC_GROUP(N(NpcData_Fuzzy), BTL_OMO3_FORMATION_05, BTL_OMO3_STAGE_05), + NPC_GROUP(N(NpcData_HammerBros), BTL_OMO3_FORMATION_07, BTL_OMO3_STAGE_05), + {} +}; diff --git a/src/world/area_omo/omo_07/omo_07_5_entity.c b/src/world/area_omo/omo_07/omo_07_5_entity.c new file mode 100644 index 0000000000..8e096fefab --- /dev/null +++ b/src/world/area_omo/omo_07/omo_07_5_entity.c @@ -0,0 +1,108 @@ +#include "omo_07.h" +#include "entity.h" + +#include "world/common/atomic/Chest.inc.c" + +EvtScript N(EVS_OpenChest_FryingPan) = { + EVT_SET(LVarA, ITEM_FRYING_PAN) + EVT_SET(LVarB, ITEM_TYPE_KEY) + EVT_SET(GF_OMO07_Chest_FryingPan, TRUE) + EVT_SET(GB_StoryProgress, STORY_CH4_GOT_FRYING_PAN) + EVT_EXEC_WAIT(N(EVS_Chest_GetItem)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_OpenChest_DefendPlus) = EVT_OPEN_CHEST_BADGE(ITEM_DEFEND_PLUS_A, GF_OMO07_Chest_DefendPlusA); + +EvtScript N(EVS_OpenChest_IcePower) = EVT_OPEN_CHEST_BADGE(ITEM_ICE_POWER, GF_OMO07_Chest_IcePower); + +#include "world/common/todo/UnsetCamera0MoveFlag1.inc.c" +#include "world/common/todo/SetCamera0MoveFlag1.inc.c" + +EvtScript N(EVS_TetherCamToPlayer) = { + EVT_LABEL(0) + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_CALL(SetCamTarget, CAM_DEFAULT, LVar0, LVar1, LVar2) + EVT_WAIT(1) + EVT_GOTO(0) + EVT_RETURN + EVT_END +}; + +Vec3i N(StarBoxLaunchTargets)[] = { + { -337, 80, -55 }, + { -472, 0, 127 }, + { -192, 0, 127 }, +}; + +EvtScript N(EVS_StarBoxLaunch_Impl) = { + EVT_CALL(DisablePlayerInput, TRUE) + EVT_CALL(DisablePlayerPhysics, TRUE) + EVT_USE_BUF(EVT_PTR(N(StarBoxLaunchTargets))) + EVT_LOOP(LVar0) + EVT_BUF_READ3(LVar7, LVar8, LVar9) + EVT_END_LOOP + EVT_CALL(SetPlayerActionState, ACTION_STATE_JUMP) + EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2) + EVT_LOOP(4) + EVT_ADD(LVar1, 10) + EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2) + EVT_WAIT(1) + EVT_END_LOOP + EVT_CALL(N(UnsetCamera0MoveFlag1)) + EVT_EXEC_GET_TID(N(EVS_TetherCamToPlayer), LVarA) + EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.7)) + EVT_CALL(PlayerJump, LVar7, LVar8, LVar9, 40) + EVT_KILL_THREAD(LVarA) + EVT_WAIT(3) + EVT_CALL(SetPlayerActionState, ACTION_STATE_IDLE) + EVT_CALL(N(SetCamera0MoveFlag1)) + EVT_CALL(DisablePlayerPhysics, FALSE) + EVT_CALL(DisablePlayerInput, FALSE) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch1) = { + EVT_SET(LVar0, 1) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch2) = { + EVT_SET(LVar0, 2) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_StarBoxLaunch3) = { + EVT_SET(LVar0, 3) + EVT_EXEC_WAIT(N(EVS_StarBoxLaunch_Impl)) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_MakeEntities) = { + EVT_CALL(MakeEntity, EVT_PTR(Entity_Chest), 1130, 0, 0, 0, 0, MAKE_ENTITY_END) + EVT_CALL(AssignChestFlag, GF_OMO07_Chest_FryingPan) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_OpenChest_FryingPan))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_Chest), -910, 80, -100, 0, 0, MAKE_ENTITY_END) + EVT_CALL(AssignChestFlag, GF_OMO07_Chest_DefendPlusA) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_OpenChest_DefendPlus))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_Chest), 750, 0, -100, 0, 0, MAKE_ENTITY_END) + EVT_CALL(AssignChestFlag, GF_OMO07_Chest_IcePower) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_OpenChest_IcePower))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_YellowBlock), 650, 60, -30, 0, ITEM_COIN, MAKE_ENTITY_END) + EVT_CALL(AssignBlockFlag, GF_OMO07_ItemBlock_Coin) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), -330, 0, 127, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch1))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), -260, 0, 127, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch2))) + EVT_CALL(MakeEntity, EVT_PTR(Entity_StarBoxLauncher), -192, 80, -132, 0, MAKE_ENTITY_END) + EVT_CALL(AssignScript, EVT_PTR(N(EVS_StarBoxLaunch3))) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_07/omo_07_6_scenes.c b/src/world/area_omo/omo_07/omo_07_6_scenes.c new file mode 100644 index 0000000000..64b588d175 --- /dev/null +++ b/src/world/area_omo/omo_07/omo_07_6_scenes.c @@ -0,0 +1,118 @@ +#include "omo_07.h" +#include "effects.h" + +s32 N(HoverOffsets)[] = { + 1, 2 , 3, 2, 1, + -1, -2, -3, -2, -1, +}; + +EvtScript N(EVS_NpcIdle_Kammy) = { + EVT_CALL(SetSelfVar, 0, 0) + EVT_CALL(GetNpcPos, NPC_SELF, LVar6, LVar3, LVar4) + EVT_LOOP(0) + EVT_USE_BUF(EVT_PTR(N(HoverOffsets))) + EVT_LOOP(10) + EVT_CALL(GetNpcPos, NPC_SELF, LVar2, LVar3, LVar4) + EVT_CALL(GetSelfVar, 0, LVar5) + EVT_IF_EQ(LVar5, 0) + EVT_WAIT(1) + EVT_ELSE + EVT_BUF_READ1(LVar1) + EVT_ADD(LVar3, LVar1) + EVT_CALL(SetNpcPos, NPC_SELF, LVar2, LVar3, LVar4) + EVT_WAIT(3) + EVT_END_IF + EVT_END_LOOP + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +#define KAMMY_NPC NPC_Kammy +#include "world/common/util/GetKammyBroomEmitterPos.inc.c" + +EvtScript N(EVS_NpcAux_Kammy) = { + EVT_CALL(GetNpcPos, NPC_Kammy, LVar6, LVar7, LVar8) + EVT_LOOP(0) + EVT_CALL(N(GetKammyBroomEmitterPos)) + EVT_CALL(GetNpcPos, NPC_Kammy, LVar9, LVarA, LVarB) + EVT_SET(LVar3, LVar9) + EVT_SET(LVar4, LVarA) + EVT_SET(LVar5, LVarB) + EVT_SUBF(LVar3, LVar6) + EVT_SUBF(LVar4, LVar7) + EVT_SUBF(LVar5, LVar8) + EVT_SETF(LVar6, LVar9) + EVT_SETF(LVar7, LVarA) + EVT_SETF(LVar8, LVarB) + EVT_IF_NE(LVar3, 0) + EVT_IF_NE(LVar5, 0) + EVT_PLAY_EFFECT(EFFECT_PURPLE_RING, 0, LVar0, LVar1, LVar2, LVar3, LVar4, LVar5, EVT_FLOAT(1.0)) + EVT_END_IF + EVT_END_IF + EVT_WAIT(3) + EVT_END_LOOP + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_Scene_KammySetAmbush) = { + EVT_CALL(DisablePlayerInput, TRUE) + EVT_SET(GF_OMO07_SpawnedPeachChoice2, TRUE) + EVT_SET(AB_OMO_4, GB_OMO_PeachChoice2) + EVT_SWITCH(AB_OMO_4) + EVT_CASE_EQ(0) + EVT_SET(MV_AmbushID, NPC_Fuzzy) + EVT_CASE_EQ(1) + EVT_SET(MV_AmbushID, NPC_HammerBros) + EVT_CASE_EQ(2) + EVT_SET(MV_AmbushID, ITEM_THUNDER_RAGE) + EVT_END_SWITCH + EVT_CALL(SetNpcPos, NPC_Kammy, 1000, 15, 0) + EVT_CALL(SetNpcYaw, NPC_Kammy, 90) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim13) + EVT_IF_NE(AB_OMO_4, 2) + EVT_CALL(SetNpcPos, MV_AmbushID, NPC_DISPOSE_LOCATION) + EVT_END_IF + EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 1060, 0, 0) + EVT_CALL(SetPanTarget, CAM_DEFAULT, 1060, 0, 0) + EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(350.0)) + EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(15.0), EVT_FLOAT(-7.5)) + EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) + EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) + EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0)) + EVT_WAIT(5) + EVT_CALL(SetNpcVar, NPC_Kammy, 0, 1) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim13) + EVT_WAIT(25) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim0E) + EVT_CALL(GetNpcPos, NPC_Kammy, LVar0, LVar1, LVar2) + EVT_ADD(LVar0, 25) + EVT_ADD(LVar1, 38) + EVT_CALL(PlaySoundAt, SOUND_207A, 0, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_GATHER_ENERGY_PINK, 0, LVar0, LVar1, LVar2, EVT_FLOAT(1.0), 75) + EVT_WAIT(75) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim0F) + EVT_ADD(LVar0, 55) + EVT_CALL(PlaySoundAt, SOUND_2098, 0, LVar0, LVar1, LVar2) + EVT_PLAY_EFFECT(EFFECT_BIG_SMOKE_PUFF, LVar0, 0, 0, 1, 15, 3, 8) + EVT_WAIT(5) + EVT_IF_NE(AB_OMO_4, 2) + EVT_CALL(SetNpcPos, MV_AmbushID, LVar0, 0, 0) + EVT_ELSE + EVT_CALL(MakeItemEntity, MV_AmbushID, LVar0, 0, 0, ITEM_SPAWN_MODE_DECORATION, 0) + EVT_END_IF + EVT_WAIT(10) + EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim13) + EVT_CALL(SetNpcVar, NPC_Kammy, 0, 0) + EVT_WAIT(5) + EVT_IF_NE(AB_OMO_4, 2) + EVT_CALL(PlaySoundAtNpc, MV_AmbushID, SOUND_263, 0) + EVT_CALL(ShowEmote, MV_AmbushID, EMOTE_QUESTION, 0, 20, TRUE, 0, 0, 0, 0) + EVT_WAIT(5) + EVT_END_IF + EVT_CALL(GotoMap, EVT_PTR("omo_07"), omo_07_ENTRY_0) + EVT_WAIT(100) + EVT_RETURN + EVT_END +}; diff --git a/src/world/area_omo/omo_09/DCD6B0.c b/src/world/area_omo/omo_09/DCD6B0.c index e3bbae8caf..a1696b8a6e 100644 --- a/src/world/area_omo/omo_09/DCD6B0.c +++ b/src/world/area_omo/omo_09/DCD6B0.c @@ -6,12 +6,12 @@ #include "world/common/enemy/ai/RangedAttackAI.inc.c" -#include "world/common/todo/SetNpcB5_3.inc.c" +#include "world/common/todo/SetInstigatorValue_3.inc.c" #include "world/common/todo/GetEncounterEnemyIsOwner.inc.c" #define NAMESPACE dup_omo_09 -#include "world/common/todo/SetNpcB5_3.inc.c" +#include "world/common/todo/SetInstigatorValue_3.inc.c" #define NAMESPACE omo_09 #include "world/common/todo/SetCamera0Flag1000.inc.c" diff --git a/src/world/area_omo/omo_17/DEF400.c b/src/world/area_omo/omo_17/DEF400.c index 4825b56bd0..1cb45ad79b 100644 --- a/src/world/area_omo/omo_17/DEF400.c +++ b/src/world/area_omo/omo_17/DEF400.c @@ -8,6 +8,6 @@ #include "world/common/enemy/ai/RangedAttackAI.inc.c" -#include "world/common/todo/SetNpcB5_3.inc.c" +#include "world/common/todo/SetInstigatorValue_3.inc.c" #include "world/common/todo/GetEncounterEnemyIsOwner.inc.c" diff --git a/src/world/area_osr/osr_03/osr_03_2_npc.c b/src/world/area_osr/osr_03/osr_03_2_npc.c index f51d2b54ef..c61d7eedd7 100644 --- a/src/world/area_osr/osr_03/osr_03_2_npc.c +++ b/src/world/area_osr/osr_03/osr_03_2_npc.c @@ -1,5 +1,7 @@ #include "osr_03.h" +#include "world/common/enemy/complete/Kammy.h" + NpcSettings N(NpcSettings_Kammy) = { .height = 40, .radius = 30, @@ -33,29 +35,8 @@ StaticNpc N(NpcData_Kammy) = { .pos = { NPC_DISPOSE_LOCATION }, .yaw = 90, .flags = ENEMY_FLAG_1 | ENEMY_FLAG_4 | ENEMY_FLAG_8 | ENEMY_FLAG_100 | ENEMY_FLAG_400 | ENEMY_FLAG_800, - .drops = { - .dropFlags = NPC_DROP_FLAG_80, - .heartDrops = NO_DROPS, - .flowerDrops = NO_DROPS, - }, - .animations = { - .idle = ANIM_WorldKammy_Anim01, - .walk = ANIM_WorldKammy_Anim02, - .run = ANIM_WorldKammy_Anim03, - .chase = ANIM_WorldKammy_Anim03, - .anim_4 = ANIM_WorldKammy_Anim01, - .anim_5 = ANIM_WorldKammy_Anim01, - .death = ANIM_WorldKammy_Anim00, - .hit = ANIM_WorldKammy_Anim00, - .anim_8 = ANIM_WorldKammy_Anim03, - .anim_9 = ANIM_WorldKammy_Anim03, - .anim_A = ANIM_WorldKammy_Anim03, - .anim_B = ANIM_WorldKammy_Anim03, - .anim_C = ANIM_WorldKammy_Anim03, - .anim_D = ANIM_WorldKammy_Anim03, - .anim_E = ANIM_WorldKammy_Anim03, - .anim_F = ANIM_WorldKammy_Anim03, - }, + .drops = NPC_NO_DROPS, + .animations = KAMMY_ANIMS, .extraAnimations = N(ExtraAnims_Kammy), }; diff --git a/src/world/common/enemy/ai/FireBarAI.inc.c b/src/world/common/enemy/ai/FireBarAI.inc.c index 0068315886..db9be7d436 100644 --- a/src/world/common/enemy/ai/FireBarAI.inc.c +++ b/src/world/common/enemy/ai/FireBarAI.inc.c @@ -150,7 +150,7 @@ void N(FireBarAI_Callback)(FireBarData* data, s32 mode) { case FIRE_BAR_SPEED_UP: data->rotationRate *= 1.12f; if (data->soundIndex == 10) { - Evt* script = start_script(&N(EVS_FireBar_Defeated), 1, 0); + Evt* script = start_script(&N(EVS_FireBar_Defeated), EVT_PRIORITY_1, 0); script->varTable[0] = data->firstNpc; script->varTable[1] = data->npcCount; data->flags |= 2; diff --git a/src/world/common/enemy/ai/KoopaPatrolAI.inc.c b/src/world/common/enemy/ai/KoopaPatrolAI.inc.c index 2d2b411552..0b81a335d3 100644 --- a/src/world/common/enemy/ai/KoopaPatrolAI.inc.c +++ b/src/world/common/enemy/ai/KoopaPatrolAI.inc.c @@ -35,7 +35,7 @@ ApiStatus N(KoopaPatrolAI_Main)(Evt* script, s32 isInitialCall) { npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; npc->collisionHeight = enemy->varTable[6]; - enemy->unk_B5 = 0; + enemy->instigatorValue = 0; enemy->varTable[8] = 0; if (!enemy->territory->patrol.isFlying) { diff --git a/src/world/common/enemy/ai/TackleAI.inc.c b/src/world/common/enemy/ai/TackleAI.inc.c index abdd21144e..46353c6359 100644 --- a/src/world/common/enemy/ai/TackleAI.inc.c +++ b/src/world/common/enemy/ai/TackleAI.inc.c @@ -43,7 +43,7 @@ ApiStatus N(TackleAI_Main)(Evt* script, s32 isInitialCall) { if (isInitialCall) { enemy->varTable[6] = npc->collisionHeight; enemy->varTable[8] = 0; - enemy->unk_B5 = 0; + enemy->instigatorValue = 0; enemy->aiFlags |= ENEMY_AI_FLAG_8; } @@ -103,11 +103,11 @@ ApiStatus N(TackleAI_Main)(Evt* script, s32 isInitialCall) { if (rand_int(100) < 33) { if (enemy->varTable[8] != 0) { enemy->varTable[8] = 0; - enemy->unk_B5 = 0; + enemy->instigatorValue = 0; npc->currentAnim = ANIM_BonyBeetle_Anim2F; } else { enemy->varTable[8] = 1; - enemy->unk_B5 = 1; + enemy->instigatorValue = 1; npc->currentAnim = ANIM_BonyBeetle_Anim2E; } enemy->varTable[9] = 7; @@ -135,9 +135,9 @@ ApiStatus N(TackleAI_Main)(Evt* script, s32 isInitialCall) { if (enemy->varTable[7] == 6) { if (enemy->varTable[8] != 0) { - enemy->unk_B5 = 1; + enemy->instigatorValue = 1; } else { - enemy->unk_B5 = 0; + enemy->instigatorValue = 0; } if (enemy->varTable[8] != 0) { switch (npc->currentAnim) { diff --git a/src/world/common/enemy/complete/Clubba.h b/src/world/common/enemy/complete/Clubba.h index d25551f5ba..a32ce53d1c 100644 --- a/src/world/common/enemy/complete/Clubba.h +++ b/src/world/common/enemy/complete/Clubba.h @@ -34,6 +34,26 @@ .anim_F = ANIM_WorldClubba_Anim02, \ } +// used in omo_04, anim_C is different +#define CLUBBA_ANIMS_ALT \ +{ \ + .idle = ANIM_WorldClubba_Anim02, \ + .walk = ANIM_WorldClubba_Anim03, \ + .run = ANIM_WorldClubba_Anim04, \ + .chase = ANIM_WorldClubba_Anim04, \ + .anim_4 = ANIM_WorldClubba_Anim02, \ + .anim_5 = ANIM_WorldClubba_Anim02, \ + .death = ANIM_WorldClubba_Anim0C, \ + .hit = ANIM_WorldClubba_Anim0C, \ + .anim_8 = ANIM_WorldClubba_Anim11, \ + .anim_9 = ANIM_WorldClubba_Anim12, \ + .anim_A = ANIM_WorldClubba_Anim07, \ + .anim_B = ANIM_WorldClubba_Anim08, \ + .anim_C = ANIM_WorldClubba_Anim02, \ + .anim_D = ANIM_WorldClubba_Anim02, \ + .anim_E = ANIM_WorldClubba_Anim02, \ + .anim_F = ANIM_WorldClubba_Anim02, \ +} #define CLUBBA_MACE_HITBOX(npcID) \ { \ .id = npcID, \ diff --git a/src/world/common/enemy/complete/DryBones.inc.c b/src/world/common/enemy/complete/DryBones.inc.c index 8f7a2de2b2..08bf6cbd32 100644 --- a/src/world/common/enemy/complete/DryBones.inc.c +++ b/src/world/common/enemy/complete/DryBones.inc.c @@ -99,7 +99,7 @@ EvtScript N(EVS_NpcHit_ThrownBone) = { EVT_CALL(SetSelfVar, 0, 0) EVT_END_CASE_GROUP EVT_CASE_DEFAULT - EVT_CALL(func_800457F8) + EVT_CALL(SetBattleAsScripted) EVT_END_CASE_GROUP EVT_END_SWITCH EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_ThrownBone))) diff --git a/src/world/common/enemy/complete/Goomba.inc.c b/src/world/common/enemy/complete/Goomba.inc.c new file mode 100644 index 0000000000..7b1591443b --- /dev/null +++ b/src/world/common/enemy/complete/Goomba.inc.c @@ -0,0 +1,10 @@ +#include "Goomba.h" + +NpcSettings N(NpcSettings_Goomba) = { + .height = 23, + .radius = 22, + .level = 5, + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, + .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER, +}; diff --git a/src/world/common/enemy/complete/GrooveGuy.h b/src/world/common/enemy/complete/GrooveGuy.h new file mode 100644 index 0000000000..d1668b432d --- /dev/null +++ b/src/world/common/enemy/complete/GrooveGuy.h @@ -0,0 +1,39 @@ +#include "common.h" +#include "sprite/npc/GrooveGuy.h" + +#define GROOVE_GUY_DROPS \ +{ \ + .dropFlags = NPC_DROP_FLAG_80, \ + .itemDropChance = 5, \ + .itemDrops = { \ + { ITEM_FIRE_FLOWER, 2, 0 }, \ + { ITEM_THUNDER_RAGE, 2, 0 }, \ + { ITEM_THUNDER_BOLT, 2, 0 }, \ + { ITEM_DUSTY_HAMMER, 2, 0 }, \ + { ITEM_PEBBLE, 2, 0 }, \ + }, \ + .heartDrops = STANDARD_HEART_DROPS(3), \ + .flowerDrops = STANDARD_FLOWER_DROPS(2), \ + .minCoinBonus = 0, \ + .maxCoinBonus = 3, \ +} + +#define GROOVE_GUY_ANIMS \ +{ \ + .idle = ANIM_GrooveGuy_Anim01, \ + .walk = ANIM_GrooveGuy_Anim03, \ + .run = ANIM_GrooveGuy_Anim04, \ + .chase = ANIM_GrooveGuy_Anim03, \ + .anim_4 = ANIM_GrooveGuy_Anim01, \ + .anim_5 = ANIM_GrooveGuy_Anim01, \ + .death = ANIM_GrooveGuy_Anim08, \ + .hit = ANIM_GrooveGuy_Anim08, \ + .anim_8 = ANIM_GrooveGuy_Anim01, \ + .anim_9 = ANIM_GrooveGuy_Anim01, \ + .anim_A = ANIM_GrooveGuy_Anim01, \ + .anim_B = ANIM_GrooveGuy_Anim01, \ + .anim_C = ANIM_GrooveGuy_Anim01, \ + .anim_D = ANIM_GrooveGuy_Anim01, \ + .anim_E = ANIM_GrooveGuy_Anim01, \ + .anim_F = ANIM_GrooveGuy_Anim01, \ +} diff --git a/src/world/common/enemy/complete/GrooveGuy.inc.c b/src/world/common/enemy/complete/GrooveGuy.inc.c new file mode 100644 index 0000000000..5136222101 --- /dev/null +++ b/src/world/common/enemy/complete/GrooveGuy.inc.c @@ -0,0 +1,32 @@ +#include "GrooveGuy.h" + +#include "world/common/enemy/ai/GrooveGuyAI.inc.c" + +MobileAISettings N(AISettings_GrooveGuy) = { + .moveSpeed = 1.7f, + .moveTime = 80, + .waitTime = 1, + .alertRadius = 100.0f, + .playerSearchInterval = 4, + .chaseSpeed = 4.5f, + .chaseTurnRate = 20, + .chaseUpdateInterval = 1, + .chaseRadius = 140.0f, + .unk_AI_2C = 1, +}; + +EvtScript N(EVS_NpcAI_GrooveGuy) = { + EVT_CALL(N(GrooveGuyAI_Main), EVT_PTR(N(AISettings_GrooveGuy))) + EVT_RETURN + EVT_END +}; + +NpcSettings N(NpcSettings_GrooveGuy) = { + .height = 24, + .radius = 22, + .level = 15, + .ai = &N(EVS_NpcAI_GrooveGuy), + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, + .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER, +}; diff --git a/src/world/common/enemy/complete/HammerBros.inc.c b/src/world/common/enemy/complete/HammerBros.inc.c index 43f470782e..165f9b80f7 100644 --- a/src/world/common/enemy/complete/HammerBros.inc.c +++ b/src/world/common/enemy/complete/HammerBros.inc.c @@ -100,7 +100,7 @@ EvtScript N(EVS_NpcHit_HammerBros_Hammer) = { EVT_CALL(SetSelfVar, 0, 0) EVT_END_CASE_GROUP EVT_CASE_DEFAULT - EVT_CALL(func_800457F8) + EVT_CALL(SetBattleAsScripted) EVT_END_CASE_GROUP EVT_END_SWITCH EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_HammerBros_Hammer))) diff --git a/src/world/common/enemy/complete/Kammy.h b/src/world/common/enemy/complete/Kammy.h new file mode 100644 index 0000000000..f627ddfc4c --- /dev/null +++ b/src/world/common/enemy/complete/Kammy.h @@ -0,0 +1,22 @@ +#include "common.h" +#include "sprite/npc/WorldKammy.h" + +#define KAMMY_ANIMS \ +{ \ + .idle = ANIM_WorldKammy_Anim01, \ + .walk = ANIM_WorldKammy_Anim02, \ + .run = ANIM_WorldKammy_Anim03, \ + .chase = ANIM_WorldKammy_Anim03, \ + .anim_4 = ANIM_WorldKammy_Anim01, \ + .anim_5 = ANIM_WorldKammy_Anim01, \ + .death = ANIM_WorldKammy_Anim00, \ + .hit = ANIM_WorldKammy_Anim00, \ + .anim_8 = ANIM_WorldKammy_Anim03, \ + .anim_9 = ANIM_WorldKammy_Anim03, \ + .anim_A = ANIM_WorldKammy_Anim03, \ + .anim_B = ANIM_WorldKammy_Anim03, \ + .anim_C = ANIM_WorldKammy_Anim03, \ + .anim_D = ANIM_WorldKammy_Anim03, \ + .anim_E = ANIM_WorldKammy_Anim03, \ + .anim_F = ANIM_WorldKammy_Anim03, \ +} diff --git a/src/world/common/enemy/complete/MontyMole_StoneThrower.inc.c b/src/world/common/enemy/complete/MontyMole_StoneThrower.inc.c index c607fd4a60..87faf4fac9 100644 --- a/src/world/common/enemy/complete/MontyMole_StoneThrower.inc.c +++ b/src/world/common/enemy/complete/MontyMole_StoneThrower.inc.c @@ -102,7 +102,7 @@ EvtScript N(EVS_NpcHit_MontyMole_Stone) = { EVT_CALL(SetSelfVar, 0, 0) EVT_END_CASE_GROUP EVT_CASE_DEFAULT - EVT_CALL(func_800457F8) + EVT_CALL(SetBattleAsScripted) EVT_END_CASE_GROUP EVT_END_SWITCH EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_MontyMole_Stone))) diff --git a/src/world/common/enemy/complete/Pokey.inc.c b/src/world/common/enemy/complete/Pokey.inc.c index c23aee3ff0..b412103267 100644 --- a/src/world/common/enemy/complete/Pokey.inc.c +++ b/src/world/common/enemy/complete/Pokey.inc.c @@ -1,6 +1,6 @@ #include "Pokey.h" -#include "world/common/todo/SetNpcB5_3.inc.c" +#include "world/common/todo/SetInstigatorValue_3.inc.c" MobileAISettings N(AISettings_Pokey) = { .moveSpeed = 1.8f, @@ -16,7 +16,7 @@ MobileAISettings N(AISettings_Pokey) = { }; EvtScript N(EVS_NpcAI_Pokey) = { - EVT_CALL(N(SetNpcB5_3)) + EVT_CALL(N(SetInstigatorValue_3)) EVT_CALL(BasicAI_Main, EVT_PTR(N(AISettings_Pokey))) EVT_RETURN EVT_END diff --git a/src/world/common/enemy/complete/PokeyMummy.inc.c b/src/world/common/enemy/complete/PokeyMummy.inc.c index 2c1e93e2e5..c93e6ce35d 100644 --- a/src/world/common/enemy/complete/PokeyMummy.inc.c +++ b/src/world/common/enemy/complete/PokeyMummy.inc.c @@ -1,6 +1,6 @@ #include "PokeyMummy.h" -#include "world/common/todo/SetNpcB5_3.inc.c" +#include "world/common/todo/SetInstigatorValue_3.inc.c" MobileAISettings N(AISettings_PokeyMummy) = { .moveSpeed = 1.8f, @@ -16,7 +16,7 @@ MobileAISettings N(AISettings_PokeyMummy) = { }; EvtScript N(EVS_NpcAI_PokeyMummy) = { - EVT_CALL(N(SetNpcB5_3)) + EVT_CALL(N(SetInstigatorValue_3)) EVT_CALL(BasicAI_Main, EVT_PTR(N(AISettings_PokeyMummy))) EVT_RETURN EVT_END diff --git a/src/world/common/enemy/complete/ShyGuy.h b/src/world/common/enemy/complete/ShyGuy.h index 0e87e4bb6b..4496112a72 100644 --- a/src/world/common/enemy/complete/ShyGuy.h +++ b/src/world/common/enemy/complete/ShyGuy.h @@ -8,6 +8,25 @@ .flowerDrops = NO_DROPS, \ } +#define SHY_GUY_DROPS \ +{ \ + .dropFlags = NPC_DROP_FLAG_80, \ + .itemDropChance = 5, \ + .itemDrops = { \ + { ITEM_DIZZY_DIAL, 2, 0 }, \ + { ITEM_SUPER_SHROOM, 2, 0 }, \ + { ITEM_THUNDER_BOLT, 2, 0 }, \ + { ITEM_DRIED_SHROOM, 2, 0 }, \ + { ITEM_SLEEPY_SHEEP, 2, 0 }, \ + { ITEM_POW_BLOCK, 2, 0 }, \ + { ITEM_FRIGHT_JAR, 2, 0 }, \ + }, \ + .heartDrops = STANDARD_HEART_DROPS(2), \ + .flowerDrops = STANDARD_FLOWER_DROPS(2), \ + .minCoinBonus = 0, \ + .maxCoinBonus = 2, \ +} + #define RED_SHY_GUY_ANIMS \ { \ .idle = ANIM_ShyGuy_Red_Anim01, \ @@ -67,3 +86,43 @@ .anim_E = ANIM_ShyGuy_Green_Anim01, \ .anim_F = ANIM_ShyGuy_Green_Anim01, \ } + +#define PINK_SHY_GUY_ANIMS \ +{ \ + .idle = ANIM_ShyGuy_Pink_Anim01, \ + .walk = ANIM_ShyGuy_Pink_Anim02, \ + .run = ANIM_ShyGuy_Pink_Anim03, \ + .chase = ANIM_ShyGuy_Pink_Anim03, \ + .anim_4 = ANIM_ShyGuy_Pink_Anim01, \ + .anim_5 = ANIM_ShyGuy_Pink_Anim01, \ + .death = ANIM_ShyGuy_Pink_Anim0C, \ + .hit = ANIM_ShyGuy_Pink_Anim0C, \ + .anim_8 = ANIM_ShyGuy_Pink_Anim15, \ + .anim_9 = ANIM_ShyGuy_Pink_Anim12, \ + .anim_A = ANIM_ShyGuy_Pink_Anim11, \ + .anim_B = ANIM_ShyGuy_Pink_Anim10, \ + .anim_C = ANIM_ShyGuy_Pink_Anim05, \ + .anim_D = ANIM_ShyGuy_Pink_Anim01, \ + .anim_E = ANIM_ShyGuy_Pink_Anim01, \ + .anim_F = ANIM_ShyGuy_Pink_Anim01, \ +} + +#define YELLOW_SHY_GUY_ANIMS \ +{ \ + .idle = ANIM_ShyGuy_Yellow_Anim01, \ + .walk = ANIM_ShyGuy_Yellow_Anim02, \ + .run = ANIM_ShyGuy_Yellow_Anim03, \ + .chase = ANIM_ShyGuy_Yellow_Anim03, \ + .anim_4 = ANIM_ShyGuy_Yellow_Anim01, \ + .anim_5 = ANIM_ShyGuy_Yellow_Anim01, \ + .death = ANIM_ShyGuy_Yellow_Anim0C, \ + .hit = ANIM_ShyGuy_Yellow_Anim0C, \ + .anim_8 = ANIM_ShyGuy_Yellow_Anim15, \ + .anim_9 = ANIM_ShyGuy_Yellow_Anim12, \ + .anim_A = ANIM_ShyGuy_Yellow_Anim11, \ + .anim_B = ANIM_ShyGuy_Yellow_Anim10, \ + .anim_C = ANIM_ShyGuy_Yellow_Anim05, \ + .anim_D = ANIM_ShyGuy_Yellow_Anim01, \ + .anim_E = ANIM_ShyGuy_Yellow_Anim01, \ + .anim_F = ANIM_ShyGuy_Yellow_Anim01, \ +} diff --git a/src/world/common/enemy/complete/ShyGuy_Patrol.inc.c b/src/world/common/enemy/complete/ShyGuy_Patrol.inc.c new file mode 100644 index 0000000000..bd7c4fa98f --- /dev/null +++ b/src/world/common/enemy/complete/ShyGuy_Patrol.inc.c @@ -0,0 +1,49 @@ +#include "ShyGuy.h" + +#include "world/common/enemy/ai/ShyGuyPatrolAI.inc.c" + +MobileAISettings N(AISettings_ShyGuy_Patrol) = { + .moveSpeed = 2.0f, + .moveTime = 60, + .alertRadius = 100.0f, + .alertOffsetDist = 30.0f, + .playerSearchInterval = 4, + .chaseSpeed = 4.0f, + .chaseTurnRate = 6, + .chaseUpdateInterval = 1, + .chaseRadius = 160.0f, + .chaseOffsetDist = 50.0f, + .unk_AI_2C = 1, +}; + +EvtScript N(EVS_NpcAI_ShyGuy_Patrol) = { + EVT_CALL(N(ShyGuyPatrolAI_Main), EVT_PTR(N(AISettings_ShyGuy_Patrol))) + EVT_RETURN + EVT_END +}; + +EvtScript N(EVS_NpcAI_ShyGuy_Patrol_Passive) = { + EVT_CALL(N(PatrolNoAttackAI_Main), EVT_PTR(N(AISettings_ShyGuy_Patrol))) + EVT_RETURN + EVT_END +}; + +NpcSettings N(NpcSettings_ShyGuy_Patrol) = { + .height = 23, + .radius = 22, + .level = 14, + .ai = &N(EVS_NpcAI_ShyGuy_Patrol), + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, + .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER, +}; + +NpcSettings N(NpcSettings_ShyGuy_Patrol_Passive) = { + .height = 23, + .radius = 22, + .level = 14, + .ai = &N(EVS_NpcAI_ShyGuy_Patrol_Passive), + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, + .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER, +}; diff --git a/src/world/common/enemy/complete/ShyGuy_Wander.inc.c b/src/world/common/enemy/complete/ShyGuy_Wander.inc.c new file mode 100644 index 0000000000..71f4e1c744 --- /dev/null +++ b/src/world/common/enemy/complete/ShyGuy_Wander.inc.c @@ -0,0 +1,34 @@ +#include "ShyGuy.h" + +#include "world/common/enemy/ai/ShyGuyWanderAI.inc.c" + +MobileAISettings N(AISettings_ShyGuy_Wander) = { + .moveSpeed = 2.0f, + .moveTime = 60, + .waitTime = 15, + .alertRadius = 100.0f, + .alertOffsetDist = 30.0f, + .playerSearchInterval = 4, + .chaseSpeed = 4.0f, + .chaseTurnRate = 6, + .chaseUpdateInterval = 1, + .chaseRadius = 140.0f, + .chaseOffsetDist = 30.0f, + .unk_AI_2C = 1, +}; + +EvtScript N(EVS_NpcAI_ShyGuy_Wander) = { + EVT_CALL(N(ShyGuyWanderAI_Main), EVT_PTR(N(AISettings_ShyGuy_Wander))) + EVT_RETURN + EVT_END +}; + +NpcSettings N(NpcSettings_ShyGuy_Wander) = { + .height = 23, + .radius = 22, + .level = 14, + .ai = &N(EVS_NpcAI_ShyGuy_Wander), + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, + .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER, +}; diff --git a/src/world/common/enemy/complete/SkyGuy.h b/src/world/common/enemy/complete/SkyGuy.h new file mode 100644 index 0000000000..39b592f120 --- /dev/null +++ b/src/world/common/enemy/complete/SkyGuy.h @@ -0,0 +1,36 @@ +#include "common.h" +#include "sprite/npc/SkyGuy.h" + +#define SKY_GUY_DROPS \ +{ \ + .dropFlags = NPC_DROP_FLAG_80, \ + .itemDropChance = 5, \ + .itemDrops = { \ + { ITEM_MUSHROOM, 5, 0 }, \ + { ITEM_SUPER_SHROOM, 5, 0 }, \ + }, \ + .heartDrops = STANDARD_HEART_DROPS(2), \ + .flowerDrops = STANDARD_FLOWER_DROPS(2), \ + .minCoinBonus = 0, \ + .maxCoinBonus = 2, \ +} + +#define SKY_GUY_ANIMS \ +{ \ + .idle = ANIM_SkyGuy_Anim34, \ + .walk = ANIM_SkyGuy_Anim34, \ + .run = ANIM_SkyGuy_Anim38, \ + .chase = ANIM_SkyGuy_Anim38, \ + .anim_4 = ANIM_SkyGuy_Anim33, \ + .anim_5 = ANIM_SkyGuy_Anim33, \ + .death = ANIM_SkyGuy_Anim39, \ + .hit = ANIM_SkyGuy_Anim39, \ + .anim_8 = ANIM_SkyGuy_Anim38, \ + .anim_9 = ANIM_SkyGuy_Anim38, \ + .anim_A = ANIM_SkyGuy_Anim01, \ + .anim_B = ANIM_SkyGuy_Anim01, \ + .anim_C = ANIM_SkyGuy_Anim01, \ + .anim_D = ANIM_SkyGuy_Anim01, \ + .anim_E = ANIM_SkyGuy_Anim01, \ + .anim_F = ANIM_SkyGuy_Anim01, \ +} diff --git a/src/world/common/enemy/complete/SkyGuy.inc.c b/src/world/common/enemy/complete/SkyGuy.inc.c new file mode 100644 index 0000000000..3baee9f2d6 --- /dev/null +++ b/src/world/common/enemy/complete/SkyGuy.inc.c @@ -0,0 +1,37 @@ +#include "SkyGuy.h" + +#include "world/common/enemy/ai/FlyingAI.inc.c" +#include "world/common/enemy/ai/FlyingAI.data.inc.c" + +MobileAISettings N(AISettings_SkyGuy) = { + .moveSpeed = 1.8f, + .alertRadius = 120.0f, + .alertOffsetDist = 30.0f, + .playerSearchInterval = 3, + .chaseSpeed = 4.0f, + .chaseTurnRate = 60, + .chaseUpdateInterval = 3, + .chaseRadius = 150.0f, + .chaseOffsetDist = 30.0f, + .unk_AI_2C = 1, +}; + +EvtScript N(EVS_NpcAI_SkyGuy) = { + EVT_CALL(SetSelfVar, 0, 0) + EVT_CALL(SetSelfVar, 5, -650) + EVT_CALL(SetSelfVar, 6, 30) + EVT_CALL(SetSelfVar, 1, 600) + EVT_CALL(N(FlyingAI_Main), EVT_PTR(N(AISettings_SkyGuy))) + EVT_RETURN + EVT_END +}; + +NpcSettings N(NpcSettings_SkyGuy) = { + .height = 25, + .radius = 22, + .level = 14, + .ai = &N(EVS_NpcAI_SkyGuy), + .onHit = &EnemyNpcHit, + .onDefeat = &EnemyNpcDefeat, + .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER, +}; diff --git a/src/world/common/todo/SetInstigatorValue_3.inc.c b/src/world/common/todo/SetInstigatorValue_3.inc.c new file mode 100644 index 0000000000..4dcfa53268 --- /dev/null +++ b/src/world/common/todo/SetInstigatorValue_3.inc.c @@ -0,0 +1,7 @@ +#include "common.h" +#include "npc.h" + +API_CALLABLE(N(SetInstigatorValue_3)) { + script->owner1.enemy->instigatorValue = 3; + return ApiStatus_DONE2; +} diff --git a/src/world/common/todo/SetNpcB5_3.inc.c b/src/world/common/todo/SetNpcB5_3.inc.c deleted file mode 100644 index b46b8dd0e0..0000000000 --- a/src/world/common/todo/SetNpcB5_3.inc.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "common.h" -#include "npc.h" - -API_CALLABLE(N(SetNpcB5_3)) { - script->owner1.enemy->unk_B5 = 3; - return ApiStatus_DONE2; -} diff --git a/src/world/world.c b/src/world/world.c index cd95c1594c..e528e55326 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -779,14 +779,15 @@ MapConfig pra_maps[] = { }; /// Shy Guy's Toy Box +#include "area_omo/omo.h" MapConfig omo_maps[] = { { MAP_UNSPLIT(omo_01, 0x80240C40), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, { MAP_UNSPLIT(omo_02, 0x80242BD0), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, { MAP_UNSPLIT(omo_03, 0x80240900), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, - { MAP_UNSPLIT(omo_04, 0x80241F30), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, - { MAP_UNSPLIT(omo_05, 0x80242440), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, + { MAP(omo_04), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, + { MAP(omo_05), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, { MAP_UNSPLIT(omo_06, 0x80240B80), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, - { MAP_UNSPLIT(omo_07, 0x80243310), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, + { MAP(omo_07), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, { MAP_UNSPLIT(omo_08, 0x80240E10), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, { MAP_UNSPLIT(omo_09, 0x80243700), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, { MAP_UNSPLIT(omo_10, 0x802408B0), .bgName = "omo_bg", .songVariation = 1, .sfxReverb = 2 }, diff --git a/tools/disasm_script.py b/tools/disasm_script.py index 531e9fa930..e0e947b24c 100755 --- a/tools/disasm_script.py +++ b/tools/disasm_script.py @@ -405,7 +405,7 @@ replace_funcs = { "func_8027D32C" :{0:"ActorIDs"}, "func_8027D434" :{0:"ActorIDs"}, "func_8027D4C8" :{0:"ActorIDs"}, - "func_8027D75C" :{0:"ActorIDs"}, + "GetInstigatorValue" :{0:"ActorIDs"}, "func_802CFD30" :{0:"NpcIDs"}, "func_802CFE2C" :{0:"NpcIDs"}, "func_802D2520" :{0:"PlayerAnims"}, diff --git a/ver/us/asm/bss.s b/ver/us/asm/bss.s index 8a0fa70372..de9adffc2a 100644 --- a/ver/us/asm/bss.s +++ b/ver/us/asm/bss.s @@ -1045,7 +1045,7 @@ dlabel nuContDataMutexQ dlabel D_800DC060 .space 4 -dlabel D_800DC064 +dlabel gCurrentStagePtr .space 4 dlabel gBattleState @@ -1057,7 +1057,7 @@ dlabel D_800DC06C dlabel gBattleStatus .space 0x00000460 -dlabel D_800DC4D0 +dlabel gLastDrawBattleState .space 4 dlabel D_800DC4D4 @@ -1078,17 +1078,17 @@ dlabel gDefeatedBattleState dlabel gCurrentBattleID .space 4 -dlabel D_800DC4EC +dlabel gCurrentStageID .space 4 dlabel D_800DC4F0 .space 4 -dlabel D_800DC4F4 +dlabel gOverrideBattlePtr .space 4 dlabel D_800DC4F8 .space 4 -dlabel D_800DC4FC +dlabel gCurrentBattlePtr .space 4 diff --git a/ver/us/asm/data/world/area_omo/omo_02/DA1CD0.data.s b/ver/us/asm/data/world/area_omo/omo_02/DA1CD0.data.s index 1996128d00..0427a439e0 100644 --- a/ver/us/asm/data/world/area_omo/omo_02/DA1CD0.data.s +++ b/ver/us/asm/data/world/area_omo/omo_02/DA1CD0.data.s @@ -24,7 +24,7 @@ dlabel D_802449E8_DA1EB8 .word 0x3FC00000, 0x0000003C, 0x0000000F, 0x42B40000, 0x42480000, 0x00000003, 0x40733333, 0x00000008, 0x00000001, 0x430C0000, 0x42700000, 0x00000001 dlabel D_80244A18_DA1EE8 -.word 0x00000043, 0x00000001, omo_02_SetNpcB5_3, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x0000000C, 0x00000043, 0x00000003, SetSelfVar, 0x00000002, 0x00000005, 0x00000043, 0x00000003, SetSelfVar, 0x00000003, 0x00000002, 0x00000043, 0x00000002, omo_02_RangedAttackAI_Main, D_802449E8_DA1EB8, 0x00000002, 0x00000000, 0x00000001, 0x00000000 +.word 0x00000043, 0x00000001, omo_02_SetInstigatorValue_3, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x0000000C, 0x00000043, 0x00000003, SetSelfVar, 0x00000002, 0x00000005, 0x00000043, 0x00000003, SetSelfVar, 0x00000003, 0x00000002, 0x00000043, 0x00000002, omo_02_RangedAttackAI_Main, D_802449E8_DA1EB8, 0x00000002, 0x00000000, 0x00000001, 0x00000000 dlabel D_80244A94_DA1F64 .word 0x00000000, 0x00180016, 0x00000000, 0x00000000, D_80244A18_DA1EE8, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000F0000 @@ -39,7 +39,7 @@ dlabel D_80244B60_DA2030 .word 0x00000002, 0x00000000, 0x00000001, 0x00000000 dlabel D_80244B70_DA2040 -.word 0x00000043, 0x00000001, omo_02_GetEncounterEnemyIsOwner, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80244B60_DA2030, 0x00000043, 0x00000002, GetOwnerEncounterTrigger, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x0000001D, 0x00000001, 0x00000004, 0x0000001D, 0x00000001, 0x00000003, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000003, 0x00000043, 0x00000001, omo_02_ProjectileAI_Reflect, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000020, 0x00000000, 0x0000001D, 0x00000001, 0x00000002, 0x0000001D, 0x00000001, 0x00000006, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000004, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000007, 0x00000002, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000020, 0x00000000, 0x0000001C, 0x00000000, 0x00000043, 0x00000001, func_800457F8, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80244AF0_DA1FC0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 +.word 0x00000043, 0x00000001, omo_02_GetEncounterEnemyIsOwner, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80244B60_DA2030, 0x00000043, 0x00000002, GetOwnerEncounterTrigger, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x0000001D, 0x00000001, 0x00000004, 0x0000001D, 0x00000001, 0x00000003, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000003, 0x00000043, 0x00000001, omo_02_ProjectileAI_Reflect, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000020, 0x00000000, 0x0000001D, 0x00000001, 0x00000002, 0x0000001D, 0x00000001, 0x00000006, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000004, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000007, 0x00000002, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000020, 0x00000000, 0x0000001C, 0x00000000, 0x00000043, 0x00000001, SetBattleAsScripted, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80244AF0_DA1FC0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 dlabel D_80244D38_DA2208 .word 0x00000000, 0x00070007, 0x00000000, 0x00000000, D_80244AF0_DA1FC0, D_80244B70_DA2040, 0x00000000, D_80244918_DA1DE8, 0x00000000, 0x00000000, 0x00000008 diff --git a/ver/us/asm/data/world/area_omo/omo_04/DAF320.data.s b/ver/us/asm/data/world/area_omo/omo_04/DAF320.data.s deleted file mode 100644 index 5f7e0b7b08..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_04/DAF320.data.s +++ /dev/null @@ -1,6 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_80241F20_DAF320 -.word 0xC4714000, 0x00000000, 0x00000000, 0x42B40000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80242068, D_80241F20_DAF320, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, func_80200000, 0x001900DC, 0x0000000A, 0x00000002, 0xF8405FDE, 0x00000000, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000046, 0x00000000, 0x00000008, 0x00000012, 0x00000000, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000020, 0x00000000, 0x00000008, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_04/DAF3E0.data.s b/ver/us/asm/data/world/area_omo/omo_04/DAF3E0.data.s deleted file mode 100644 index c9a88524c8..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_04/DAF3E0.data.s +++ /dev/null @@ -1,162 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_80241FE0_DAF3E0 -.word 0x0000004D, 0x00000001, 0x0000001B, 0x00000043, 0x00000003, UseExitHeading, 0x0000003C, 0x00000000, 0x00000044, 0x00000001, ExitWalk, 0x00000043, 0x00000003, GotoMap, 0x80244CA0, 0x00000001, 0x00000008, 0x00000001, 0x00000064, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024203C_DAF43C -.word 0x00000047, 0x00000005, D_80241FE0_DAF3E0, 0x00080000, 0x00000000, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xF5DE0329, 0x00000010, 0x00000043, 0x00000002, SetSpriteShading, 0xFFFFFFFF, 0x00000043, 0x00000006, SetCamPerspective, 0x00000000, 0x00000003, 0x00000019, 0x00000010, 0x00001000, 0x00000043, 0x00000005, SetCamBGColor, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetCamEnabled, 0x00000000, 0x00000001, 0x0000000A, 0x00000002, 0xF8405FDE, 0x00000000, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, D_80243E30_DB1230, 0x00000012, 0x00000000, 0x0000000A, 0x00000002, 0xF8405FCE, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0258, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, D_80243DAC_DB11AC, 0x00000016, 0x00000001, 0x00000001, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, D_80243DDC_DB11DC, 0x00000016, 0x00000001, 0x00000002, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, D_80243E0C_DB120C, 0x00000043, 0x00000007, MakeItemEntity, 0x0000008A, 0x0000044C, 0x00000000, 0x00000000, 0x00000011, 0xF8405FCE, 0x00000023, 0x00000000, 0x00000012, 0x00000000, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, D_80243E0C_DB120C, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000046, 0x00000001, D_80242B1C_DAFF1C, 0x00000046, 0x00000001, D_80242608_DAFA08, 0x00000046, 0x00000001, 0x80241F70, 0x0000000A, 0x00000002, 0xF8405FDE, 0x00000000, 0x00000044, 0x00000001, D_80244288_DB1688, 0x00000012, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, D_8024203C_DAF43C, 0x00000044, 0x00000001, EnterWalk, 0x00000008, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242260_DAF660 -.word 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0xFFFFFE98, 0x00000064, 0x00000000, 0x00000003, 0x00000001, 0x00000001, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x00000074, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000076, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000078, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x0000007A, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x0000007C, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024238C_DAF78C -.word 0x00000003, 0x00000001, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x000000A0, 0x0000003C, 0x0000000A, 0x00000003, 0x00000001, 0x00000001, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x0000007F, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000081, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000083, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000085, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000087, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000089, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x000000A0, 0x00000000, 0x0000003C, 0x0000000A, 0x00000003, 0x00000001, 0x00000002, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x0000007F, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000081, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000083, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000085, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000087, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000089, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000002, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x00000002, 0x00000013, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242608_DAFA08 -.word 0x00000044, 0x00000001, D_80242260_DAF660, 0x00000044, 0x00000001, D_8024238C_DAF78C, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel omo_04_varStash -.word 0x00000000 - -dlabel D_80242634_DAFA34 -.word 0x0000004D, 0x00000001, 0x00000000, 0x00000043, 0x00000002, SetTimeFreezeMode, 0x00000002, 0x00000008, 0x00000001, 0x00000028, 0x00000043, 0x00000004, ShowGotItem, 0xFE363C80, 0x00000000, 0x00000000, 0x00000043, 0x00000002, SetTimeFreezeMode, 0x00000000, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024269C_DAFA9C -.word 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C8A, 0x0000000B, 0x00000002, 0xFE363C8A, 0x00000000, 0x00000046, 0x00000001, D_80242634_DAFA34, 0x00000013, 0x00000000, 0x00000014, 0x00000001, 0xFE363C8B, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000003, AddItem, 0xFE363C8A, 0xFE363C80, 0x00000016, 0x00000001, 0x00000001, 0x00000043, 0x00000002, AddKeyItem, 0xFE363C8A, 0x00000016, 0x00000001, 0x00000002, 0x00000043, 0x00000003, AddBadge, 0xFE363C8A, 0xFE363C80, 0x00000023, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024277C_DAFB7C -.word 0x00000024, 0x00000002, 0xFE363C8A, 0x00000020, 0x00000024, 0x00000002, 0xFE363C8B, 0x00000001, 0x00000024, 0x00000002, 0xF8405FDF, 0x00000001, 0x00000046, 0x00000001, D_8024269C_DAFA9C, 0x00000024, 0x00000002, 0xF8405CA2, 0x00000001, 0x00000024, 0x00000002, 0xF5DE0180, 0xFFFFFFF8, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802427E8_DAFBE8 -.word 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, SetCamTarget, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242850_DAFC50 -.word 0xFFFFFCAC, 0x00000000, 0xFFFFFF83, 0xFFFFFC89, 0x00000000, 0x00000062, 0xFFFFFD56, 0x00000050, 0xFFFFFFB3, 0xFFFFFDE2, 0x00000050, 0x0000003E, 0xFFFFFD79, 0x00000050, 0x00000084, 0xFFFFFE05, 0x00000050, 0x00000084, 0x000002A0, 0x00000069, 0x00000084, 0x0000039F, 0x00000050, 0xFFFFFFA9 - -dlabel D_802428B0_DAFCB0 -.word 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000001, 0x00000030, 0x00000001, D_80242850_DAFC50, 0x00000005, 0x00000001, 0xFE363C80, 0x00000033, 0x00000003, 0xFE363C87, 0xFE363C88, 0xFE363C89, 0x00000006, 0x00000000, 0x00000043, 0x00000002, SetPlayerActionState, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000002, SetPlayerActionState, 0x00000006, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000001, omo_04_UnsetCamera0MoveFlag1, 0x00000045, 0x00000002, D_802427E8_DAFBE8, 0xFE363C8A, 0x00000043, 0x00000002, SetPlayerJumpscale, 0xF24A7D4D, 0x00000043, 0x00000005, PlayerJump, 0xFE363C87, 0xFE363C88, 0xFE363C89, 0x00000028, 0x00000049, 0x00000001, 0xFE363C8A, 0x00000043, 0x00000001, omo_04_SetCamera0MoveFlag1, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000002, SetPlayerActionState, 0x00000000, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802429E8_DAFDE8 -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000001, 0x00000046, 0x00000001, D_802428B0_DAFCB0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242A14_DAFE14 -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000002, 0x00000046, 0x00000001, D_802428B0_DAFCB0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242A40_DAFE40 -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000003, 0x00000046, 0x00000001, D_802428B0_DAFCB0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242A6C_DAFE6C -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000004, 0x00000046, 0x00000001, D_802428B0_DAFCB0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242A98_DAFE98 -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000005, 0x00000046, 0x00000001, D_802428B0_DAFCB0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242AC4_DAFEC4 -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000006, 0x00000046, 0x00000001, D_802428B0_DAFCB0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242AF0_DAFEF0 -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000007, 0x00000046, 0x00000001, D_802428B0_DAFCB0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242B1C_DAFF1C -.word 0x00000043, 0x00000008, MakeEntity, Entity_Chest, 0x0000047E, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignChestFlag, 0xF8405FDF, 0x00000043, 0x00000002, AssignScript, D_8024277C_DAFB7C, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0xFFFFFC84, 0x00000000, 0xFFFFFF83, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_802429E8_DAFDE8, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0xFFFFFCB1, 0x00000000, 0x00000062, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_80242A14_DAFE14, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0xFFFFFD2E, 0x00000000, 0xFFFFFFB8, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_80242A40_DAFE40, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0xFFFFFD79, 0x00000050, 0x0000003E, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_80242A6C_DAFE6C, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0xFFFFFDA1, 0x00000000, 0x00000085, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_80242A98_DAFE98, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0xFFFFFE2D, 0x00000000, 0x00000085, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_80242AC4_DAFEC4, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0x000002C8, 0x00000000, 0x00000085, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_80242AF0_DAFEF0, 0x00000043, 0x00000008, MakeEntity, Entity_YellowBlock, 0x0000023F, 0x0000003C, 0x0000003C, 0x00000000, 0x00000157, 0x80000000, 0x00000043, 0x00000002, AssignBlockFlag, 0xF8405FE0, 0x00000043, 0x00000008, MakeEntity, Entity_YellowBlock, 0x000002F9, 0x0000003C, 0xFFFFFFAB, 0x00000000, 0x00000157, 0x80000000, 0x00000043, 0x00000002, AssignBlockFlag, 0xF8405FE1, 0x00000043, 0x00000008, MakeEntity, Entity_YellowBlock, 0x00000375, 0x0000008C, 0xFFFFFF92, 0x00000000, 0x00000084, 0x80000000, 0x00000043, 0x00000002, AssignBlockFlag, 0xF8405FE2, 0x00000043, 0x00000007, MakeItemEntity, 0x00000157, 0xFFFFFC84, 0x0000006E, 0xFFFFFF84, 0x00000011, 0xF8405FE3, 0x00000043, 0x00000007, MakeItemEntity, 0x00000157, 0xFFFFFC84, 0x00000082, 0xFFFFFF84, 0x00000011, 0xF8405FE4, 0x00000043, 0x00000007, MakeItemEntity, 0x00000157, 0xFFFFFC84, 0x00000096, 0xFFFFFF84, 0x00000011, 0xF8405FE5, 0x00000043, 0x00000007, MakeItemEntity, 0x00000157, 0xFFFFFD83, 0x000000BE, 0x0000003E, 0x00000011, 0xF8405FE6, 0x00000043, 0x00000007, MakeItemEntity, 0x00000157, 0xFFFFFD9A, 0x000000D2, 0x0000003E, 0x00000011, 0xF8405FE7, 0x00000043, 0x00000007, MakeItemEntity, 0x00000157, 0xFFFFFDAE, 0x000000DC, 0x0000003E, 0x00000011, 0xF8405FE8, 0x00000043, 0x00000007, MakeItemEntity, 0x00000157, 0xFFFFFDC2, 0x000000D2, 0x0000003E, 0x00000011, 0xF8405FE9, 0x00000043, 0x00000007, MakeItemEntity, 0x00000157, 0xFFFFFDD6, 0x000000BE, 0x0000003E, 0x00000011, 0xF8405FEA, 0x00000043, 0x00000007, MakeItemEntity, 0x0000015C, 0x00000078, 0x000000B4, 0xFFFFFFB0, 0x00000011, 0xF8405FEC, 0x00000043, 0x00000007, MakeItemEntity, 0x0000015C, 0xFFFFFFA6, 0x00000000, 0xFFFFFF83, 0x00000011, 0xF8405FED, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel omo_04_FlyingAI_JumpVels -.float 4.5, 3.5, 2.6, 2.0, 1.5, 20.0 - -dlabel D_80242F08_DB0308 -.word 0x3FE66666, 0x00000000, 0x00000000, 0x42F00000, 0x41F00000, 0x00000003, 0x40800000, 0x0000003C, 0x00000003, 0x43160000, 0x41F00000, 0x00000001 - -dlabel D_80242F38_DB0338 -.word 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000005, 0xFFFFFD76, 0x00000043, 0x00000003, SetSelfVar, 0x00000006, 0x0000001E, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x00000258, 0x00000043, 0x00000002, omo_04_FlyingAI_Main, D_80242F08_DB0308, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242FA8_DB03A8 -.word 0x00000000, 0x00190016, 0x00000000, 0x00000000, D_80242F38_DB0338, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001 - -dlabel D_80242FD4_DB03D4 -.word 0x40000000, 0x0000003C, 0x0000000F, 0x42C80000, 0x41F00000, 0x00000004, 0x40800000, 0x00000006, 0x00000001, 0x430C0000, 0x41F00000, 0x00000001 - -dlabel D_80243004_DB0404 -.word 0x00000043, 0x00000002, omo_04_ShyGuyWanderAI_Main, D_80242FD4_DB03D4, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80243024_DB0424 -.word 0x00000000, 0x00170016, 0x00000000, 0x00000000, D_80243004_DB0404, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001 - -dlabel D_80243050_DB0450 -.word 0x00000000, 0x00170016, 0x00000000, 0x00000000, 0x00000000, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001 - -dlabel D_8024307C_DB047C -.word 0x00000000, 0x00240022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000D0000 - -dlabel D_802430A8_DB04A8 -.word 0x00000000, 0x00220018, 0x00000000, 0x00000000, 0x00000000, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x001A0000 - -dlabel D_802430D4_DB04D4 -.word 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C80, 0x0000041A, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000043, 0x00000001, omo_04_SetCamera0Flag1000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000009, SetCamProperties, 0x00000000, 0xF24A8E80, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000012C, 0xF24AAE80, 0xF24A5480, 0x0000000A, 0x00000002, 0xF5DE0258, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000000, 0x00260003, 0x00260001, 0x00000000, 0x000F003A, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000001, 0x00390005, 0x00390002, 0x00000000, 0x000F003B, 0x00000013, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000001, omo_04_UnsetCamera0Flag1000, 0x00000043, 0x00000003, ResetCam, 0x00000000, 0xF24A8A80, 0x00000057, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000043, 0x00000002, StartBossBattle, 0x00000003, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024324C_DB064C -.word 0x00000043, 0x00000002, GetBattleOutcome, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xF8405FCE, 0x00000001, 0x00000043, 0x00000001, DoNpcDefeat, 0x00000016, 0x00000001, 0x00000001, 0x00000016, 0x00000001, 0x00000002, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802432C0_DB06C0 -.word 0x0000000A, 0x00000002, 0xF5DE0258, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, D_802430D4_DB04D4, 0x00000043, 0x00000003, BindNpcDefeat, 0xFFFFFFFF, D_8024324C_DB064C, 0x00000012, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80243334_DB0734 -.word 0x0000000A, 0x00000002, 0xF5DE0258, 0x00000001, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, D_802430D4_DB04D4, 0x00000043, 0x00000003, BindNpcDefeat, 0xFFFFFFFF, D_8024324C_DB064C, 0x00000012, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802433A8_DB07A8 -.word 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, D_80243E88_DB1288, 0x00000043, 0x00000003, BindNpcAux, 0xFFFFFFFF, D_80244000_DB1400, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802433E0_DB07E0 -.word 0x00000000, D_80243050_DB0450, 0x44898000, 0x00000000, 0x00000000, 0x00440F00, D_802432C0_DB06C0, 0x00000000, 0x00000000, 0x0000010E, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00260001, 0x00260002, 0x00260003, 0x00260003, 0x00260001, 0x00260001, 0x00260005, 0x00260005, 0x00260003, 0x00260003, 0x00260003, 0x00260003, 0x00260003, 0x00260003, 0x00260003, 0x00260003, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_802435D0_DB09D0 -.word 0x00000001, D_8024307C_DB047C, 0x44898000, 0x00000000, 0x00000000, 0x00440F00, D_80243334_DB0734, 0x00000000, 0x00000000, 0x0000010E, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00390002, 0x00390003, 0x00390004, 0x00390004, 0x00390002, 0x00390002, 0x0039000C, 0x0039000C, 0x00390011, 0x00390012, 0x00390007, 0x00390008, 0x00390002, 0x00390002, 0x00390002, 0x00390002, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_802437C0_DB0BC0 -.word 0x00000003, D_80243024_DB0424, 0xC4408000, 0x00000000, 0x00000000, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x0000010E, 0x8005009A, 0x00020000, 0x008C0002, 0x00000084, 0x00020000, 0x008D0002, 0x0000008F, 0x00020000, 0x00900002, 0x00000098, 0x00020000, 0x00000000, 0x00001999, 0x59980002, 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0xFFFFFCFE, 0x00000000, 0x00000000, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0xFFFFFCFE, 0x00000000, 0x00000000, 0x000000C8, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003B0301, 0x003B0302, 0x003B0303, 0x003B0303, 0x003B0301, 0x003B0301, 0x003B030C, 0x003B030C, 0x003B0315, 0x003B0312, 0x003B0311, 0x003B0310, 0x003B0305, 0x003B0301, 0x003B0301, 0x003B0301, 0x00000001, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_802439B0_DB0DB0 -.word 0x00000004, D_80242FA8_DB03A8, 0xC32A0000, 0x42700000, 0x41F00000, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x0000010E, 0x8005008A, 0x00050000, 0x008C0005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0xFFFFFF56, 0x0000003C, 0x0000001E, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0xFFFFFF56, 0x0000003C, 0x0000001E, 0x000000C8, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003D0034, 0x003D0034, 0x003D0038, 0x003D0038, 0x003D0033, 0x003D0033, 0x003D0039, 0x003D0039, 0x003D0038, 0x003D0038, 0x003D0001, 0x003D0001, 0x003D0001, 0x003D0001, 0x003D0001, 0x003D0001, 0x00000001, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_80243BA0_DB0FA0 -.word 0x0060000E, 0x0060000F, 0x00600010, 0x00600013, 0x00600015, 0x00600016, 0xFFFFFFFF - -dlabel D_80243BBC_DB0FBC -.word 0x00000002, D_802430A8_DB04A8, 0x00000000, 0xC47A0000, 0x00000000, 0x00000F04, D_802433A8_DB07A8, 0x00000000, 0x00000000, 0x0000005A, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00600001, 0x00600002, 0x00600003, 0x00600003, 0x00600001, 0x00600001, 0x00600000, 0x00600000, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00000000, 0x00000000, D_80243BA0_DB0FA0, 0x00000000 - -dlabel D_80243DAC_DB11AC -.word 0x00000001, D_802433E0_DB07E0, 0x12010001, 0x00000001, D_802437C0_DB0BC0, 0x10040001, 0x00000001, D_802439B0_DB0DB0, 0x100F0001, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_80243DDC_DB11DC -.word 0x00000001, D_802435D0_DB09D0, 0x12030001, 0x00000001, D_802437C0_DB0BC0, 0x10040001, 0x00000001, D_802439B0_DB0DB0, 0x100F0001, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_80243E0C_DB120C -.word 0x00000001, D_802437C0_DB0BC0, 0x10040001, 0x00000001, D_802439B0_DB0DB0, 0x100F0001, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_80243E30_DB1230 -.word 0x00000001, D_80243BBC_DB0FBC, 0x00000000, 0x00000001, D_802433E0_DB07E0, 0x12010001, 0x00000001, D_802435D0_DB09D0, 0x12030001, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_80243E60_DB1260 -.word 0x00000001, 0x00000002, 0x00000003, 0x00000002, 0x00000001, 0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFE, 0xFFFFFFFF - -dlabel D_80243E88_DB1288 -.word 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C86, 0xFE363C83, 0xFE363C84, 0x00000005, 0x00000001, 0x00000000, 0x00000030, 0x00000001, D_80243E60_DB1260, 0x00000005, 0x00000001, 0x0000000A, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000043, 0x00000003, GetSelfVar, 0x00000000, 0xFE363C85, 0x0000000A, 0x00000002, 0xFE363C85, 0x00000000, 0x00000014, 0x00000001, 0xFE363C86, 0x00000018, 0x00000001, 0xFE363C82, 0x00000043, 0x00000003, SetNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000019, 0x00000001, 0xFE363C82, 0x00000043, 0x00000003, SetNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000023, 0x00000000, 0x00000024, 0x00000002, 0xFE363C86, 0xFE363C82, 0x00000008, 0x00000001, 0x00000001, 0x00000012, 0x00000000, 0x00000031, 0x00000001, 0xFE363C81, 0x00000027, 0x00000002, 0xFE363C83, 0xFE363C81, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000008, 0x00000001, 0x00000003, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80244000_DB1400 -.word 0x00000024, 0x00000002, 0xFAA2B58A, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0x00000002, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000002, omo_04_GetKammyBroomEmitterPos, 0xFAA2B58A, 0x00000043, 0x00000005, GetNpcPos, 0x00000002, 0xFE363C89, 0xFE363C8A, 0xFE363C8B, 0x00000024, 0x00000002, 0xFE363C83, 0xFE363C89, 0x00000024, 0x00000002, 0xFE363C84, 0xFE363C8A, 0x00000024, 0x00000002, 0xFE363C85, 0xFE363C8B, 0x0000002D, 0x00000002, 0xFE363C83, 0xFE363C86, 0x0000002D, 0x00000002, 0xFE363C84, 0xFE363C87, 0x0000002D, 0x00000002, 0xFE363C85, 0xFE363C88, 0x00000026, 0x00000002, 0xFE363C86, 0xFE363C89, 0x00000026, 0x00000002, 0xFE363C87, 0xFE363C8A, 0x00000026, 0x00000002, 0xFE363C88, 0xFE363C8B, 0x0000000B, 0x00000002, 0xFE363C83, 0x00000000, 0x0000000B, 0x00000002, 0xFE363C85, 0x00000000, 0x00000043, 0x0000000F, PlayEffect, 0x0000001F, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0xF24A7E80, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x00000003, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024418C_DB158C -.word 0x44480000, 0x430C0000, 0xC1A00000, 0x44834000, 0x42F00000, 0xC28C0000, 0x448FC000, 0x42BE0000, 0xC2C80000, 0x44960000, 0x429A0000, 0xC1F00000, 0x448FC000, 0x42780000, 0x42AA0000, 0x44834000, 0x42480000, 0x43020000, 0x44480000, 0x42200000, 0x42480000, 0x447A0000, 0x41A00000, 0x00000000 - -dlabel D_802441EC_DB15EC -.word 0x447A0000, 0x41A00000, 0x00000000, 0x447C8000, 0x41880000, 0x00000000, 0x447F0000, 0x41700000, 0x00000000 - -dlabel D_80244210_DB1610 -.word 0x447F0000, 0x41700000, 0x00000000, 0x44870000, 0x41F00000, 0x41F00000, 0x44910000, 0x42A00000, 0xC2200000, 0x44160000, 0x43160000, 0x42B40000 - -dlabel D_80244240_DB1640 -.word 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000004, PlaySoundAtNpc, 0x00000002, 0x00000295, 0x00000000, 0x00000008, 0x00000001, 0x00000004, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80244288_DB1688 -.word 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000024, 0x00000002, 0xF8405FDE, 0x00000001, 0x00000024, 0x00000002, 0xF70F2E84, 0xF5DE0258, 0x00000014, 0x00000001, 0xF70F2E84, 0x00000016, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8A, 0x00000000, 0x00000016, 0x00000001, 0x00000001, 0x00000024, 0x00000002, 0xFD050F8A, 0x00000001, 0x00000016, 0x00000001, 0x00000002, 0x00000024, 0x00000002, 0xFD050F8A, 0x0000008A, 0x00000023, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0x00000002, 0x00000320, 0x0000008C, 0xFFFFFFEC, 0x00000043, 0x00000003, SetNpcYaw, 0x00000002, 0x0000010E, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000002, 0x00600015, 0x0000000B, 0x00000002, 0xF70F2E84, 0x00000002, 0x00000043, 0x00000005, SetNpcPos, 0xFD050F8A, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0x0000044C, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0x0000044C, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF2524A80, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AB680, 0xF24A5C80, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24BE280, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000008, 0x00000001, 0x0000003C, 0x00000045, 0x00000002, D_80244240_DB1640, 0xFD050F8B, 0x00000024, 0x00000002, 0xFAA2B58A, 0x00000001, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000064, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24FF280, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0x00000002, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000057, 0x00000000, 0x00000043, 0x00000005, LoadPath, 0x00000096, D_8024418C_DB158C, 0x00000008, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, GetNextPathPos, 0x00000043, 0x00000005, SetNpcPos, 0x00000002, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000001, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000024, 0x00000002, 0xFAA2B58A, 0x00000000, 0x00000049, 0x00000001, 0xFD050F8B, 0x00000043, 0x00000004, PlaySoundAtNpc, 0x00000002, 0x0000032B, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000002, 0x00600010, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFFB, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFF6, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFF1, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFF6, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFF1, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFF6, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFF1, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFF6, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFF1, 0x00000008, 0x00000001, 0x00000003, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, LoadPath, 0x0000000A, D_802441EC_DB15EC, 0x00000003, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, GetNextPathPos, 0x00000043, 0x00000005, SetNpcPos, 0x00000002, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000001, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, SetNpcVar, 0x00000002, 0x00000000, 0x00000001, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000002, 0x00600013, 0x00000008, 0x00000001, 0x0000002D, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000002, 0x0060000E, 0x00000043, 0x00000005, GetNpcPos, 0x00000002, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C80, 0x00000019, 0x00000027, 0x00000002, 0xFE363C81, 0x00000026, 0x00000043, 0x00000006, PlaySoundAt, 0x0000207A, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000013, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0xF24A7E80, 0x00000064, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000064, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000002, 0x0060000F, 0x00000027, 0x00000002, 0xFE363C80, 0x00000037, 0x00000043, 0x00000006, PlaySoundAt, 0x00002098, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000001, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x0000000F, 0x00000003, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x0000000B, 0x00000002, 0xF70F2E84, 0x00000002, 0x00000043, 0x00000005, SetNpcPos, 0xFD050F8A, 0xFE363C80, 0x00000000, 0x00000000, 0x00000012, 0x00000000, 0x00000043, 0x00000007, MakeItemEntity, 0xFD050F8A, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000002, 0x00600013, 0x00000008, 0x00000001, 0x0000002D, 0x00000014, 0x00000001, 0xF70F2E84, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000002, 0x00600016, 0x00600013, 0x00000205, 0x000F0036, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000002, 0x00600016, 0x00600013, 0x00000205, 0x000F0037, 0x00000016, 0x00000001, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000002, 0x00600016, 0x00600013, 0x00000205, 0x000F0038, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000002, 0x00600016, 0x00600013, 0x00000205, 0x000F0039, 0x00000016, 0x00000001, 0x00000002, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000002, 0x00600016, 0x00600013, 0x00000205, 0x000F0034, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000002, 0x00600016, 0x00600013, 0x00000205, 0x000F0035, 0x00000023, 0x00000000, 0x00000043, 0x00000004, SetNpcVar, 0x00000002, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF2524A80, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000045, 0x00000002, D_80244240_DB1640, 0xFD050F8B, 0x00000024, 0x00000002, 0xFAA2B58A, 0x00000001, 0x00000056, 0x00000000, 0x00000043, 0x00000005, LoadPath, 0x00000082, D_80244210_DB1610, 0x00000004, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, GetNextPathPos, 0x00000043, 0x00000005, SetNpcPos, 0x00000002, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000001, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000005A, 0x0000000B, 0x00000002, 0xF70F2E84, 0x00000002, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFD050F8A, 0x00000263, 0x00000000, 0x00000043, 0x0000000A, ShowEmote, 0xFD050F8A, 0x00000002, 0x00000000, 0x00000014, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000013, 0x00000000, 0x00000043, 0x00000003, GotoMap, 0x80244EB0, 0x00000000, 0x00000008, 0x00000001, 0x00000064, 0x00000002, 0x00000000, 0x00000001, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_05/DB46C0.data.s b/ver/us/asm/data/world/area_omo/omo_05/DB46C0.data.s deleted file mode 100644 index 8bde20c30f..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_05/DB46C0.data.s +++ /dev/null @@ -1,6 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_80242400_DB46C0 -.word 0x44138000, 0x00000000, 0x43070000, 0x43870000, 0x44138000, 0x41200000, 0xC30C0000, 0x43870000, 0xC4160000, 0x41200000, 0x00000000, 0x42B40000, 0x44160000, 0x41200000, 0x00000000, 0x43870000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x802425B0, D_80242400_DB46C0, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, func_80200000, 0x001900DD, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000020, 0x00000000, 0x00000008, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_05/DB4770.data.s b/ver/us/asm/data/world/area_omo/omo_05/DB4770.data.s deleted file mode 100644 index d29de6a355..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_05/DB4770.data.s +++ /dev/null @@ -1,75 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_802424B0_DB4770 -.word 0x0000004D, 0x00000001, 0x0000001B, 0x00000043, 0x00000003, UseExitHeading, 0x0000003C, 0x00000000, 0x00000044, 0x00000001, ExitWalk, 0x00000043, 0x00000003, GotoMap, 0x802452A0, 0x00000000, 0x00000008, 0x00000001, 0x00000064, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024250C_DB47CC -.word 0x0000004D, 0x00000001, 0x0000001B, 0x00000043, 0x00000003, UseExitHeading, 0x0000003C, 0x00000001, 0x00000044, 0x00000001, ExitWalk, 0x00000043, 0x00000003, GotoMap, 0x802452A0, 0x00000001, 0x00000008, 0x00000001, 0x00000064, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242568_DB4828 -.word 0x00000047, 0x00000005, D_802424B0_DB4770, 0x00080000, 0x0000000B, 0x00000001, 0x00000000, 0x00000047, 0x00000005, D_8024250C_DB47CC, 0x00080000, 0x0000000D, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xF5DE0329, 0x00000010, 0x00000043, 0x00000002, SetSpriteShading, 0xFFFFFFFF, 0x00000043, 0x00000006, SetCamPerspective, 0x00000000, 0x00000003, 0x00000019, 0x00000010, 0x00001000, 0x00000043, 0x00000005, SetCamBGColor, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetCamEnabled, 0x00000000, 0x00000001, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, D_80245124_DB73E4, 0x00000046, 0x00000001, 0x80245150, 0x00000046, 0x00000001, D_80242E68_DB5128, 0x00000044, 0x00000001, 0x80242480, 0x00000043, 0x00000003, SetCamLeadPlayer, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetGroupEnabled, 0x00000088, 0x00000000, 0x0000000F, 0x00000002, 0xF5DE0180, 0xFFFFFFFE, 0x00000043, 0x00000006, RotateModel, 0x0000002E, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000002F, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000030, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000032, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000033, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000034, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000000, 0x00000000, 0x7FFFFE00, 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000000, 0x00000001, 0x7FFFFE00, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, D_80242568_DB4828, 0x00000044, 0x00000001, EnterWalk, 0x00000008, 0x00000001, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802427C0_DB4A80 -.word 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0xFFFFFE98, 0x00000064, 0x00000000, 0x00000003, 0x00000001, 0x00000001, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x0000004E, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000050, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000052, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000054, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000056, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000058, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x0000005A, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x0000005C, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x0000005E, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000060, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000062, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000064, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000066, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802429EC_DB4CAC -.word 0x00000003, 0x00000001, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x000000A0, 0x0000003C, 0x0000000A, 0x00000003, 0x00000001, 0x00000001, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x00000011, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000013, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000015, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000017, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000019, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000001B, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000001D, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000001F, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000021, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000023, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000025, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000027, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000029, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000002B, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x000000A0, 0x00000000, 0x0000003C, 0x0000000A, 0x00000003, 0x00000001, 0x00000002, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x00000011, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000013, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000015, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000017, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000019, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000001B, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000001D, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000001F, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000021, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000023, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000025, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000027, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000029, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000002B, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000002, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x00000002, 0x00000013, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242E68_DB5128 -.word 0x00000044, 0x00000001, D_802427C0_DB4A80, 0x00000044, 0x00000001, D_802429EC_DB4CAC, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242E90_DB5150 -.word 0x40000000, 0x0000003C, 0x0000000F, 0x42C80000, 0x41F00000, 0x00000004, 0x40800000, 0x00000006, 0x00000001, 0x430C0000, 0x41F00000, 0x00000001 - -dlabel D_80242EC0_DB5180 -.word 0x00000043, 0x00000002, omo_05_ShyGuyWanderAI_Main, D_80242E90_DB5150, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00170016, 0x00000000, 0x00000000, D_80242EC0_DB5180, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001 - -dlabel D_80242F0C_DB51CC -.word 0x3FD9999A, 0x00000050, 0x00000001, 0x42C80000, 0x00000000, 0x00000004, 0x40900000, 0x00000014, 0x00000001, 0x430C0000, 0x00000000, 0x00000001 - -dlabel D_80242F3C_DB51FC -.word 0x00000043, 0x00000002, omo_05_GrooveGuyAI_Main, D_80242F0C_DB51CC, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80242F5C_DB521C -.word 0x00000000, 0x00180016, 0x00000000, 0x00000000, D_80242F3C_DB51FC, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000F0001 - -dlabel omo_05_FlyingAI_JumpVels -.float 4.5, 3.5, 2.6, 2.0, 1.5, 20.0 - -dlabel D_80242FA0_DB5260 -.word 0x3FE66666, 0x00000000, 0x00000000, 0x42F00000, 0x41F00000, 0x00000003, 0x40800000, 0x0000003C, 0x00000003, 0x43160000, 0x41F00000, 0x00000001 - -dlabel D_80242FD0_DB5290 -.word 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000005, 0xFFFFFD76, 0x00000043, 0x00000003, SetSelfVar, 0x00000006, 0x0000001E, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x00000258, 0x00000043, 0x00000002, omo_05_FlyingAI_Main, D_80242FA0_DB5260, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00190016, 0x00000000, 0x00000000, D_80242FD0_DB5290, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001 - -dlabel D_8024306C_DB532C -.word 0x00000000, 0x0044003C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00630000 - -dlabel omo_05_ItemChoice_HasSelectedItem -.word 0x00000000 - -dlabel omo_05_ItemChoice_SelectedItemID -.word 0x00000000 - -dlabel D_802430A0_DB5360 -.word 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, ShowConsumableChoicePopup, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, RemoveItemAt, 0xFE363C81, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, omo_05_AddPlayerHandsOffset, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000007, MakeItemEntity, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00060005, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000043, 0x00000002, RemoveItemEntity, 0xFE363C80, 0x00000023, 0x00000000, 0x00000043, 0x00000002, omo_05_ItemChoice_SaveSelected, 0xFE363C8A, 0x00000043, 0x00000001, CloseChoicePopup, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802431D4_DB5494 -.word 0x00000043, 0x00000002, func_80242204_DB44C4, 0xFE363C80, 0x0000004E, 0x00000006, D_802430A0_DB5360, 0x00000010, 0x00000000, D_80245650, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80242178_DB4438, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80243224_DB54E4 -.word 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C80, 0x00000000, 0xFE363C82, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFE363C80, 0x00000000, 0xFE363C82, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0x0000015E, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AC080, 0xF24A5280, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8A80, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000001, func_802423C8_DB4688, 0x00000043, 0x00000003, NpcFacePlayer, 0xFFFFFFFF, 0x00000001, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C10001, 0x0000000A, 0x00000002, 0xF8405FCB, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00C10004, 0x00C10001, 0x00000000, 0x000F0040, 0x00000024, 0x00000002, 0xF8405FCB, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00C10004, 0x00C10001, 0x00000000, 0x000F0041, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, func_802457C0_A2FA00, 0x00000024, 0x00000002, 0xFE363C81, 0xFFFFFFFF, 0x00000046, 0x00000001, D_802431D4_DB5494, 0x0000000E, 0x00000002, 0xFE363C80, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C1000D, 0x00000043, 0x00000003, ResetCam, 0x00000000, 0xF24A9A80, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFE363C88, 0xFE363C80, 0x00000043, 0x00000002, func_802422A0_DB4560, 0xFE363C80, 0x00000043, 0x00000007, MakeItemEntity, 0xFE363C88, 0xFFFFFF01, 0x00000023, 0x0000006E, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C87, 0xFE363C80, 0x00000043, 0x00000004, SetItemFlags, 0xFE363C87, 0x00000040, 0x00000001, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C10005, 0x00000005, 0x00000001, 0x00000006, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00002095, 0x00000000, 0x00000006, 0x00000000, 0x0000000B, 0x00000002, 0xFE363C89, 0x00000002, 0x00000043, 0x00000003, ResetCam, 0x00000000, 0xF24AA280, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00002096, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C10006, 0x00000043, 0x00000004, SetItemFlags, 0xFE363C87, 0x00000040, 0x00000000, 0x00000043, 0x00000003, GetAngleToPlayer, 0xFFFFFFFF, 0xFE363C80, 0x0000000C, 0x00000002, 0xFE363C80, 0x000000B4, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x00000064, 0x00000007, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, UpdateLerp, 0x00000026, 0x00000002, 0xFE363C82, 0xF24A7680, 0x00000026, 0x00000002, 0xFE363C83, 0xF24A791A, 0x00000026, 0x00000002, 0xFE363C84, 0xF24A7A80, 0x0000002E, 0x00000002, 0xFE363C82, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C83, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C84, 0xFE363C80, 0x0000002C, 0x00000002, 0xFE363C82, 0xF2464280, 0x0000002C, 0x00000002, 0xFE363C83, 0xF24B0680, 0x0000002C, 0x00000002, 0xFE363C84, 0xF24C3280, 0x00000043, 0x00000005, SetItemPos, 0xFE363C87, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x00000064, 0x00000007, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, UpdateLerp, 0x00000026, 0x00000002, 0xFE363C82, 0xF24A7680, 0x00000026, 0x00000002, 0xFE363C83, 0xF24A7BE7, 0x00000026, 0x00000002, 0xFE363C84, 0xF24A7A80, 0x0000002E, 0x00000002, 0xFE363C82, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C83, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C84, 0xFE363C80, 0x0000002C, 0x00000002, 0xFE363C82, 0xF244EE80, 0x0000002C, 0x00000002, 0xFE363C83, 0xF24A7A80, 0x0000002C, 0x00000002, 0xFE363C84, 0xF24C3280, 0x00000043, 0x00000005, SetItemPos, 0xFE363C87, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000012, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x00000064, 0x00000007, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, UpdateLerp, 0x00000026, 0x00000002, 0xFE363C82, 0xF24A7E80, 0x00000026, 0x00000002, 0xFE363C83, 0xF24A791A, 0x00000026, 0x00000002, 0xFE363C84, 0xF24A7A80, 0x0000002E, 0x00000002, 0xFE363C82, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C83, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C84, 0xFE363C80, 0x0000002C, 0x00000002, 0xFE363C82, 0xF246BA80, 0x0000002C, 0x00000002, 0xFE363C83, 0xF24B0680, 0x0000002C, 0x00000002, 0xFE363C84, 0xF24C3280, 0x00000043, 0x00000005, SetItemPos, 0xFE363C87, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x00000064, 0x00000007, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, UpdateLerp, 0x00000026, 0x00000002, 0xFE363C82, 0xF24A7E80, 0x00000026, 0x00000002, 0xFE363C83, 0xF24A7BE7, 0x00000026, 0x00000002, 0xFE363C84, 0xF24A7A80, 0x0000002E, 0x00000002, 0xFE363C82, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C83, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C84, 0xFE363C80, 0x0000002C, 0x00000002, 0xFE363C82, 0xF2480E80, 0x0000002C, 0x00000002, 0xFE363C83, 0xF24A7A80, 0x0000002C, 0x00000002, 0xFE363C84, 0xF24C3280, 0x00000043, 0x00000005, SetItemPos, 0xFE363C87, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, RemoveItemEntity, 0xFE363C87, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C10001, 0x00000014, 0x00000001, 0xFE363C89, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00C10004, 0x00C10001, 0x00000000, 0x000F0042, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C1000D, 0x00000016, 0x00000001, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00C10004, 0x00C10001, 0x00000000, 0x000F0043, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C1000D, 0x00000016, 0x00000001, 0x00000002, 0x00000056, 0x00000000, 0x00000043, 0x00000004, ShowMessageAtScreenPos, 0x000F0044, 0x000000A0, 0x00000028, 0x00000057, 0x00000000, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C10007, 0x00000056, 0x00000000, 0x00000043, 0x00000004, SetNpcFlagBits, 0x00000002, 0x00000002, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0x00000002, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetNpcJumpscale, 0x00000002, 0xF24A7AB4, 0x00000043, 0x00000006, NpcJump0, 0x00000002, 0xFE363C80, 0x00000002, 0xFE363C82, 0x00000008, 0x00000043, 0x00000003, func_802CDE68, 0x00000002, 0x0000000F, 0x00000024, 0x00000002, 0xFE363C83, 0x00000000, 0x00000005, 0x00000001, 0x00000005, 0x00000027, 0x00000002, 0xFE363C83, 0x00000032, 0x00000043, 0x00000005, SetNpcRotation, 0x00000002, 0x00000000, 0x00000000, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000027, 0x00000002, 0xFE363C82, 0x00000014, 0x00000043, 0x00000003, SetNpcJumpscale, 0x00000002, 0xF24A7B4D, 0x00000043, 0x00000006, NpcJump0, 0x00000002, 0xFE363C80, 0xFFFFFFF6, 0xFE363C82, 0x00000008, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, RemoveNpc, 0x00000002, 0x00000057, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000004, SetNpcFlagBits, 0x00000001, 0x00000002, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0x00000001, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetNpcJumpscale, 0x00000001, 0xF24A7AB4, 0x00000043, 0x00000006, NpcJump0, 0x00000001, 0xFE363C80, 0x00000002, 0xFE363C82, 0x00000008, 0x00000043, 0x00000003, func_802CDE68, 0x00000001, 0x0000000F, 0x00000024, 0x00000002, 0xFE363C83, 0x00000000, 0x00000005, 0x00000001, 0x00000005, 0x00000028, 0x00000002, 0xFE363C83, 0x00000032, 0x00000043, 0x00000005, SetNpcRotation, 0x00000001, 0x00000000, 0x00000000, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000027, 0x00000002, 0xFE363C82, 0x00000014, 0x00000043, 0x00000003, SetNpcJumpscale, 0x00000001, 0xF24A7B4D, 0x00000043, 0x00000006, NpcJump0, 0x00000001, 0xFE363C80, 0xFFFFFFF6, 0xFE363C82, 0x00000008, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, RemoveNpc, 0x00000001, 0x00000057, 0x00000000, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFFFFFF06, 0x00000019, 0xFFFFFF9C, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFFFFFF06, 0x00000019, 0xFFFFFF9C, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF2510A80, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AAA80, 0xF24A7480, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24ADE80, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000381, 0x00000000, 0x00000008, 0x00000001, 0x00000021, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24F7A80, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AAE80, 0xF24A774D, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24ADE80, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000382, 0x00000000, 0x00000008, 0x00000001, 0x00000021, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24E6280, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AB280, 0xF24A7A80, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24ADE80, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000383, 0x00000000, 0x00000008, 0x00000001, 0x00000012, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000072, 0x00000000, 0x00000008, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000008, SetMotionBlurParams, 0x00000000, 0x00000000, 0x00000000, 0x00000140, 0x000000F0, 0x00000080, 0x0000000A, 0x00000005, 0x00000001, 0x00000007, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24F7A80, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AB280, 0xF24A7A80, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24AB680, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24E6280, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AB280, 0xF24A7A80, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24AB680, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000006, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000002E, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x0000002F, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000030, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000032, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000033, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000034, 0x00000069, 0x00000000, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000001, func_80242328_DB45E8, 0x00000043, 0x00000001, func_80242328_DB45E8, 0x00000043, 0x00000001, func_80242328_DB45E8, 0x00000043, 0x00000008, SetMotionBlurParams, 0x00000000, 0x00000000, 0x00000000, 0x00000140, 0x000000F0, 0x00000000, 0x0000000A, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFFFFFF06, 0x00000000, 0x00000064, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFFFFFF06, 0x00000000, 0x00000064, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24BE280, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000001, 0x00000056, 0x00000000, 0x00000003, 0x00000001, 0x00000013, 0x00000043, 0x00000003, PlayerFaceNpc, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000003, GetSelfVar, 0x00000000, 0xFE363C80, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000013, 0x00000013, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000384, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C10003, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000100, 0x00000001, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24ACA80, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x00000000, 0x0000006E, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000384, 0x00000000, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000080, 0x00000001, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0x00000091, 0x0000006E, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFFFFFE0C, 0x0000006E, 0x00000000, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000080, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000384, 0x00000000, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0x00000000, 0xFFFFFFD3, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x00000064, 0x0000001E, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000043, 0x00000001, UpdateLerp, 0x00000026, 0x00000002, 0xFE363C82, 0xF24A8A4D, 0x00000026, 0x00000002, 0xFE363C83, 0xF24A72E7, 0x00000026, 0x00000002, 0xFE363C84, 0xF24A7A80, 0x0000002E, 0x00000002, 0xFE363C82, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C83, 0xFE363C80, 0x0000002E, 0x00000002, 0xFE363C84, 0xFE363C80, 0x0000002C, 0x00000002, 0xFE363C82, 0xF2438680, 0x0000002C, 0x00000002, 0xFE363C83, 0xF24C8280, 0x0000002C, 0x00000002, 0xFE363C84, 0xF24E1280, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000384, 0x00000000, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFFFFFE0C, 0x00000000, 0x0000006E, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFFFFFF06, 0x0000006E, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C10008, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24A7080, 0xF24A1A80, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8080, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000057, 0x00000000, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000385, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C1000B, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A7A82, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFF06, 0x000001F4, 0x0000006E, 0x00000028, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000002, 0x00000057, 0x00000000, 0x00000043, 0x00000004, ShowMessageAtScreenPos, 0x000F0045, 0x000000A0, 0x00000028, 0x00000003, 0x00000001, 0x0000000C, 0x00000043, 0x00000003, GetSelfVar, 0x00000000, 0xFE363C80, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000002, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000000C, 0x00000013, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000007, MakeItemEntity, 0x00000029, 0xFE363C80, 0x00000190, 0xFE363C82, 0x0000000D, 0xF8405FD2, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010021, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000003, ResetCam, 0x00000000, 0xF24BE280, 0x00000008, 0x00000001, 0x0000003C, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000000, 0x00000000, 0x7FFFFE00, 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000000, 0x00000001, 0x7FFFFE00, 0x00000024, 0x00000002, 0xF5DE0180, 0xFFFFFFFE, 0x00000023, 0x00000000, 0x00000044, 0x00000001, 0x80242480, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x0000000A, 0x00000002, 0xF5DE0180, 0xFFFFFFFE, 0x00000043, 0x00000002, RemoveNpc, 0xFFFFFFFF, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024484C_DB6B0C -.word 0x0000000F, 0x00000002, 0xF5DE0180, 0xFFFFFFFE, 0x00000043, 0x00000002, RemoveNpc, 0x00000002, 0x00000043, 0x00000002, RemoveNpc, 0x00000001, 0x00000043, 0x00000002, RemoveNpc, 0xFFFFFFFF, 0x00000012, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00C1000D, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000002, 0x00C1000A, 0x00000043, 0x00000004, SetNpcFlagBits, 0x00000002, 0x00000002, 0x00000001, 0x00000043, 0x00000005, SetNpcPos, 0x00000002, 0xFFFFFEE3, 0x00000032, 0x0000005A, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000001, 0x00C10009, 0x00000043, 0x00000004, SetNpcFlagBits, 0x00000001, 0x00000002, 0x00000001, 0x00000043, 0x00000005, SetNpcPos, 0x00000001, 0xFFFFFF2E, 0x00000032, 0x0000005A, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, D_80243224_DB54E4, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80244964_DB6C24 -.word 0x00000000, D_8024306C_DB532C, 0xC37A0000, 0x41200000, 0x42AA0000, 0x00400901, D_8024484C_DB6B0C, 0x00000000, 0x00000000, 0x0000005A, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00000000, 0x00000000, 0x00000000, 0x001A00B7, 0x00000001, D_8024306C_DB532C, 0xC37A0000, 0x41200000, 0x42AA0000, 0x00000B01, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00000000, 0x00000000, 0x00000000, 0x001A00B7, 0x00000002, D_8024306C_DB532C, 0xC37A0000, 0x41200000, 0x42AA0000, 0x00000B01, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00C10001, 0x00000000, 0x00000000, 0x00000000, 0x001A00B7 - -dlabel D_80244F34_DB71F4 -.word 0x00000003, D_80242F5C_DB521C, 0x43A00000, 0x41200000, 0xC3110000, 0x00000C00, 0x00000000, 0x00000000, 0x00000000, 0x0000010E, 0x80050080, 0x00020000, 0x00820002, 0x00000084, 0x00020000, 0x00860002, 0x00000085, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980003, 0x3FFF2666, 0x4CCC0003, 0x3FFF3FFF, 0x3FFF0003, 0x33326665, 0x33320003, 0x33327FFF, 0x26660003, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00030000, 0x00000140, 0x0000000A, 0xFFFFFF6F, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000140, 0x0000000A, 0xFFFFFF6F, 0x000000C8, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003C0001, 0x003C0003, 0x003C0004, 0x003C0003, 0x003C0001, 0x003C0001, 0x003C0008, 0x003C0008, 0x003C0001, 0x003C0001, 0x003C0001, 0x003C0001, 0x003C0001, 0x003C0001, 0x003C0001, 0x003C0001, 0x00000001, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_80245124_DB73E4 -.word 0x00000003, D_80244964_DB6C24, 0x00000000, 0x00000001, D_80244F34_DB71F4, 0x102A0007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_05/DB7410.data.s b/ver/us/asm/data/world/area_omo/omo_05/DB7410.data.s deleted file mode 100644 index fe5c4793d6..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_05/DB7410.data.s +++ /dev/null @@ -1,6 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_80245150_DB7410 -.word 0x00000043, 0x00000008, MakeEntity, Entity_YellowBlock, 0x00000190, 0x00000046, 0xFFFFFF6A, 0x00000000, 0x00000157, 0x80000000, 0x00000043, 0x00000002, AssignBlockFlag, 0xF8405FEE, 0x00000043, 0x00000008, MakeEntity, Entity_YellowBlock, 0x00000226, 0x00000046, 0xFFFFFF6A, 0x00000000, 0x00000157, 0x80000000, 0x00000043, 0x00000002, AssignBlockFlag, 0xF8405FEF, 0x0000000A, 0x00000002, 0xF8405FD2, 0x00000000, 0x0000000D, 0x00000002, 0xF5DE0180, 0xFFFFFFFD, 0x00000043, 0x00000007, MakeItemEntity, 0x00000029, 0xFFFFFF06, 0x00000000, 0x00000078, 0x00000000, 0xF8405FD2, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000008, MakeEntity, Entity_HiddenYellowBlock, 0x000001DB, 0x00000046, 0xFFFFFF6A, 0x00000000, 0x0000009A, 0x80000000, 0x00000043, 0x00000002, AssignBlockFlag, 0xF8405FF0, 0x00000043, 0x00000008, MakeEntity, Entity_HiddenYellowBlock, 0xFFFFFDE4, 0x00000046, 0xFFFFFF6A, 0x00000000, 0x0000009B, 0x80000000, 0x00000043, 0x00000002, AssignBlockFlag, 0xF8405FF1, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_07/DC05B0.data.s b/ver/us/asm/data/world/area_omo/omo_07/DC05B0.data.s deleted file mode 100644 index 6e5e39adde..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_07/DC05B0.data.s +++ /dev/null @@ -1,6 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_80243300_DC05B0 -.word 0xC4700000, 0x00000000, 0x42920000, 0x42B40000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80243448, D_80243300_DC05B0, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, func_80200000, 0x001900DF, 0x0000000A, 0x00000002, 0xF8405FF4, 0x00000000, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000046, 0x00000000, 0x00000008, 0x00000012, 0x00000000, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x00000020, 0x00000000, 0x00000008, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_07/DC0670.data.s b/ver/us/asm/data/world/area_omo/omo_07/DC0670.data.s deleted file mode 100644 index 3b1bbc423b..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_07/DC0670.data.s +++ /dev/null @@ -1,9 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_802433C0_DC0670 -.word 0x0000004D, 0x00000001, 0x0000001B, 0x00000043, 0x00000003, UseExitHeading, 0x0000003C, 0x00000000, 0x00000044, 0x00000001, ExitWalk, 0x00000043, 0x00000003, GotoMap, 0x80246BC0, 0x00000004, 0x00000008, 0x00000001, 0x00000064, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024341C_DC06CC -.word 0x00000047, 0x00000005, D_802433C0_DC0670, 0x00080000, 0x00000000, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xF5DE0329, 0x00000010, 0x00000043, 0x00000002, SetSpriteShading, 0xFFFFFFFF, 0x00000043, 0x00000006, SetCamPerspective, 0x00000000, 0x00000003, 0x00000019, 0x00000010, 0x00001000, 0x00000043, 0x00000005, SetCamBGColor, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetCamEnabled, 0x00000000, 0x00000001, 0x0000000A, 0x00000002, 0xF8405FF4, 0x00000000, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, 0x80245DCC, 0x00000012, 0x00000000, 0x0000000A, 0x00000002, 0xF8405FCF, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0259, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, 0x80245CB8, 0x00000016, 0x00000001, 0x00000001, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, 0x80245D18, 0x00000016, 0x00000001, 0x00000002, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, 0x80245D78, 0x00000043, 0x00000007, MakeItemEntity, 0x00000082, 0x00000438, 0x00000000, 0x00000000, 0x00000011, 0xF8405FCF, 0x00000023, 0x00000000, 0x00000012, 0x00000000, 0x00000043, 0x00000003, MakeNpcs, 0x00000001, 0x80245D78, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000046, 0x00000001, 0x802462C0, 0x00000046, 0x00000001, 0x8024389C, 0x00000046, 0x00000001, 0x80243350, 0x00000044, 0x00000001, 0x80243E50, 0x0000000A, 0x00000002, 0xF8405FF4, 0x00000000, 0x00000044, 0x00000001, 0x80246734, 0x00000008, 0x00000001, 0x00000002, 0x00000012, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, D_8024341C_DC06CC, 0x00000044, 0x00000001, EnterWalk, 0x00000008, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_07/DC0910.data.s b/ver/us/asm/data/world/area_omo/omo_07/DC0910.data.s deleted file mode 100644 index 8057ac0e02..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_07/DC0910.data.s +++ /dev/null @@ -1,9 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_80243660_DC0910 -.word 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x000000A0, 0x0000003C, 0x0000000A, 0x00000003, 0x00000001, 0x00000001, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x00000036, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000038, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x000000A0, 0x00000000, 0x0000003C, 0x0000000A, 0x00000003, 0x00000001, 0x00000002, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x00000036, 0xFE363C80, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, RotateModel, 0x00000038, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000002, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x00000002, 0x00000013, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802437D0_DC0A80 -.word 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0xFFFFFE98, 0x00000064, 0x00000000, 0x00000003, 0x00000001, 0x00000001, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x0000003B, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000006, RotateModel, 0x00000040, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000044, 0x00000001, D_80243660_DC0910, 0x00000044, 0x00000001, D_802437D0_DC0A80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_07/DC0B80.data.s b/ver/us/asm/data/world/area_omo/omo_07/DC0B80.data.s deleted file mode 100644 index c5a8c42a57..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_07/DC0B80.data.s +++ /dev/null @@ -1,99 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_802438D0_DC0B80 -.word 0x40000000, 0x0000003C, 0x0000000F, 0x42C80000, 0x41F00000, 0x00000004, 0x40800000, 0x00000006, 0x00000001, 0x430C0000, 0x41F00000, 0x00000001 - -dlabel D_80243900_DC0BB0 -.word 0x00000043, 0x00000002, omo_07_ShyGuyWanderAI_Main, D_802438D0_DC0B80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00170016, 0x00000000, 0x00000000, D_80243900_DC0BB0, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001 - -dlabel D_8024394C_DC0BFC -.word 0x40000000, 0x0000003C, 0x00000000, 0x42C80000, 0x41F00000, 0x00000004, 0x40800000, 0x00000006, 0x00000001, 0x43200000, 0x42480000, 0x00000001 - -dlabel D_8024397C_DC0C2C -.word 0x00000043, 0x00000002, omo_07_ShyGuyPatrolAI_Main, D_8024394C_DC0BFC, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024399C_DC0C4C -.word 0x00000043, 0x00000002, omo_07_PatrolNoAttackAI_Main, D_8024394C_DC0BFC, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802439BC_DC0C6C -.word 0x00000000, 0x00170016, 0x00000000, 0x00000000, D_8024397C_DC0C2C, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001, 0x00000000, 0x00170016, 0x00000000, 0x00000000, D_8024399C_DC0C4C, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001 - -dlabel omo_07_FlyingAI_JumpVels -.float 4.5, 3.5, 2.6, 2.0, 1.5, 20.0 - -dlabel D_80243A2C_DC0CDC -.word 0x3FE66666, 0x00000000, 0x00000000, 0x42F00000, 0x41F00000, 0x00000003, 0x40800000, 0x0000003C, 0x00000003, 0x43160000, 0x41F00000, 0x00000001 - -dlabel D_80243A5C_DC0D0C -.word 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000005, 0xFFFFFD76, 0x00000043, 0x00000003, SetSelfVar, 0x00000006, 0x0000001E, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x00000258, 0x00000043, 0x00000002, omo_07_FlyingAI_Main, D_80243A2C_DC0CDC, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80243ACC_DC0D7C -.word 0x00000000, 0x00190016, 0x00000000, 0x00000000, D_80243A5C_DC0D0C, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001 - -dlabel D_80243AF8_DC0DA8 -.word 0x00000000, 0x00170016, 0x00000000, 0x00000000, 0x00000000, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000E0001 - -dlabel D_80243B24_DC0DD4 -.word 0x00000000, 0x00240018, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x001B0000 - -dlabel D_80243B50_DC0E00 -.word 0x00000000, 0x00220018, 0x00000000, 0x00000000, 0x00000000, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x001A0000 - -dlabel D_80243B7C_DC0E2C -.word 0x0000000A, 0x00000002, 0xF971888F, 0x00000001, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000D, 0x00000002, 0xFE363C82, 0xFFFFFFCE, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x0000000D, 0x00000002, 0xFE363C80, 0x0000000F, 0x0000000C, 0x00000002, 0xFE363C80, 0x00000023, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000000, 0x00000015, 0x7FFFFE00, 0x00000024, 0x00000002, 0xF971888F, 0x00000001, 0x00000043, 0x00000006, PlaySoundAt, 0x000001D9, 0x00000000, 0x00000019, 0x00000000, 0xFFFFFFC9, 0x00000056, 0x00000000, 0x0000000C, 0x00000002, 0xFE363C80, 0x00000019, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x000000B4, 0x0000001E, 0x0000000A, 0x00000003, 0x00000001, 0x0000000A, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x0000005D, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000012, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x000000B4, 0x00000000, 0x0000001E, 0x0000000A, 0x00000003, 0x00000001, 0x0000000B, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x0000005D, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x0000000B, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, UpdateColliderTransform, 0x00000015, 0x00000057, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C82, 0x0000003C, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, SetPlayerSpeed, 0xF24A8680, 0x00000043, 0x00000004, PlayerMoveTo, 0xFE363C80, 0xFE363C82, 0x00000000, 0x00000024, 0x00000002, 0xF971888F, 0x00000000, 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000001, 0x00000015, 0x7FFFFE00, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, ParentColliderToModel, 0x00000015, 0x0000005D, 0x00000047, 0x00000005, D_80243B7C_DC0E2C, 0x00000040, 0x00000015, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xF9718887, 0x00000000, 0x00000024, 0x00000002, 0xF9718888, 0x00000000, 0x00000024, 0x00000002, 0xF9718889, 0x00000000, 0x00000024, 0x00000002, 0xF971888A, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000008, 0x00000001, 0x00000001, 0x0000000C, 0x00000002, 0xFE363C80, 0x00000190, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x00000001, 0x00000024, 0x00000002, 0xFE363C84, 0xFFFFFFFF, 0x0000000A, 0x00000002, 0xF971888A, 0x00000000, 0x00000024, 0x00000002, 0xFE363C84, 0x00000003, 0x00000013, 0x00000000, 0x0000000A, 0x00000002, 0xF9718889, 0x00000000, 0x00000024, 0x00000002, 0xFE363C84, 0x00000002, 0x00000013, 0x00000000, 0x0000000A, 0x00000002, 0xF9718888, 0x00000000, 0x00000024, 0x00000002, 0xFE363C84, 0x00000001, 0x00000013, 0x00000000, 0x0000000A, 0x00000002, 0xFE363C84, 0xFFFFFFFF, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x0000000A, 0x00000002, 0xF9718887, 0x00000000, 0x00000024, 0x00000002, 0xF9718887, 0x00000001, 0x00000012, 0x00000000, 0x00000008, 0x00000001, 0x00000028, 0x00000013, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C82, 0xFFFFFFAB, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x0000000C, 0x00000002, 0xFE363C80, 0xFFFFFFCE, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x0000000D, 0x00000002, 0xFE363C80, 0x00000258, 0x00000004, 0x00000001, 0x00000001, 0x00000013, 0x00000000, 0x00000043, 0x00000003, func_80242EA8_DC0158, 0xFE363C84, 0x00000001, 0x00000043, 0x00000004, SetNpcVar, 0xFE363C84, 0x00000000, 0x00000001, 0x00000008, 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000002, 0x00000043, 0x00000004, GetNpcVar, 0xFE363C84, 0x00000000, 0xFE363C83, 0x0000000A, 0x00000002, 0xFE363C83, 0x00000001, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000002, 0x00000013, 0x00000000, 0x00000004, 0x00000001, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80244140_DC13F0 -.word 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000003, GetSelfVar, 0x00000000, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000016, 0x00000001, 0x00000001, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000002, 0x00000000, 0x00000043, 0x00000003, EnableNpcShadow, 0xFFFFFFFF, 0x00000001, 0x00000043, 0x00000003, SetSelfEnemyFlagBits, 0x00000001, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000320, 0x00000000, 0x0000004B, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8A80, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x003B0003, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8E80, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x00000299, 0x0000004B, 0x00000000, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8A80, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x0000027B, 0xFFFFFF95, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x00000064, 0xFFFFFF95, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFFFFFFF6, 0xFFFFFF95, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000002, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0x00000002, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C80, 0x00000082, 0x00000008, 0x00000001, 0x00000028, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000003, 0x00000013, 0x00000000, 0x00000043, 0x00000003, GetSelfVar, 0x00000001, 0xFE363C80, 0x00000027, 0x00000002, 0xFE363C80, 0x00000001, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0xFE363C80, 0x0000000D, 0x00000002, 0xFE363C80, 0x000000B4, 0x00000008, 0x00000001, 0x00000028, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000003, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000016, 0x00000001, 0x00000003, 0x00000043, 0x00000006, PlaySoundAt, 0x000001D9, 0x00000000, 0x00000019, 0x00000000, 0xFFFFFFC9, 0x00000056, 0x00000000, 0x00000024, 0x00000002, 0xF971888F, 0x00000001, 0x00000024, 0x00000002, 0xFE363C82, 0xFD050F80, 0x00000027, 0x00000002, 0xFE363C82, 0x000000B4, 0x00000043, 0x00000005, MakeLerp, 0xFD050F80, 0xFE363C82, 0x0000001E, 0x0000000A, 0x00000003, 0x00000001, 0x0000000A, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000006, RotateModel, 0x0000005D, 0xFE363C80, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, UpdateColliderTransform, 0x00000015, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFD050F80, 0xFE363C82, 0x0000002B, 0x00000002, 0xFD050F80, 0x00000168, 0x00000024, 0x00000002, 0xF971888F, 0x00000000, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000040, 0x00000000, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFFFFFFF6, 0x00000032, 0x00000000, 0x00000043, 0x00000003, GetSelfVar, 0x00000000, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000003, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000004, 0x00000013, 0x00000000, 0x00000016, 0x00000001, 0x00000004, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_8024397C_DC0C2C, 0x00000008, 0x00000001, 0x0000000A, 0x00000016, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000005, 0x00000001, 0x0000001E, 0x00000043, 0x00000002, GetSelfNpcID, 0xFE363C80, 0x00000043, 0x00000003, func_80242EA8_DC0158, 0xFE363C80, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000016, 0x00000001, 0x0000000B, 0x00000043, 0x00000002, GetSelfNpcID, 0xFE363C80, 0x00000043, 0x00000003, func_80242EA8_DC0158, 0xFE363C80, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000023, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802446DC_DC198C -.word 0x00000043, 0x00000002, GetBattleOutcome, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000140, 0x00000001, 0x00000043, 0x00000003, SetSelfEnemyFlagBits, 0x00000001, 0x00000001, 0x00000043, 0x00000003, EnableNpcShadow, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x0000000A, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x0000000A, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80244140_DC13F0, 0x00000043, 0x00000001, DoNpcDefeat, 0x00000008, 0x00000001, 0x00000001, 0x00000016, 0x00000001, 0x00000001, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x003B0003, 0x00000016, 0x00000001, 0x00000002, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x003B0003, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802447FC_DC1AAC -.word 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, D_80244140_DC13F0, 0x00000043, 0x00000003, BindNpcDefeat, 0xFFFFFFFF, D_802446DC_DC198C, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80244834_DC1AE4 -.word 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C80, 0x000003DE, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000043, 0x00000001, omo_07_SetCamera0Flag1000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000009, SetCamProperties, 0x00000000, 0xF24A8E80, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000012C, 0xF24AAE80, 0xF24A5480, 0x0000000A, 0x00000002, 0xF5DE0259, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000005, 0x002B000B, 0x002B0001, 0x00000000, 0x000F003C, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000006, 0x005A000A, 0x005A0002, 0x00000000, 0x000F003D, 0x00000013, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000001, omo_07_UnsetCamera0Flag1000, 0x00000043, 0x00000003, ResetCam, 0x00000000, 0xF24A8A80, 0x00000057, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000043, 0x00000002, StartBossBattle, 0x00000003, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802449AC_DC1C5C -.word 0x00000043, 0x00000002, GetBattleOutcome, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xF8405FCF, 0x00000001, 0x00000043, 0x00000001, DoNpcDefeat, 0x00000016, 0x00000001, 0x00000001, 0x00000016, 0x00000001, 0x00000002, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80244A20_DC1CD0 -.word 0x0000000A, 0x00000002, 0xF5DE0259, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, D_80244834_DC1AE4, 0x00000043, 0x00000003, BindNpcDefeat, 0xFFFFFFFF, D_802449AC_DC1C5C, 0x00000012, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80244A94_DC1D44 -.word 0x0000000A, 0x00000002, 0xF5DE0259, 0x00000001, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, D_80244834_DC1AE4, 0x00000043, 0x00000003, BindNpcDefeat, 0xFFFFFFFF, D_802449AC_DC1C5C, 0x00000012, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80244B08_DC1DB8 -.word 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x802464A8, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80244B2C_DC1DDC -.word 0x00000001, D_802439BC_DC0C6C, 0x00000000, 0xC47A0000, 0x00000000, 0x00200F04, D_802447FC_DC1AAC, 0x00000000, 0x00000000, 0x0000010E, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0x0000001E, 0x00000000, 0x00000032, 0x00000032, 0x00000000, 0x00000064, 0x00000064, 0x00000000, 0x00000064, 0x00000078, 0x00000000, 0x00000032, 0x00000064, 0x00000000, 0x00000000, 0x00000032, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFF8001, 0x0000004B, 0x00000000, 0x00000032, 0x00000064, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003B0001, 0x003B0002, 0x003B0003, 0x003B0003, 0x003B0001, 0x003B0001, 0x003B000C, 0x003B000C, 0x003B0015, 0x003B0012, 0x003B0011, 0x003B0010, 0x003B0005, 0x003B0001, 0x003B0001, 0x003B0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_80244D1C_DC1FCC -.word 0x00000002, D_802439BC_DC0C6C, 0x00000000, 0xC47A0000, 0x00000000, 0x00200F04, D_802447FC_DC1AAC, 0x00000000, 0x00000000, 0x0000010E, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0x0000001E, 0x00000000, 0x00000032, 0x00000032, 0x00000000, 0x00000064, 0x00000064, 0x00000000, 0x00000064, 0x00000078, 0x00000000, 0x00000032, 0x00000064, 0x00000000, 0x00000000, 0x00000032, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFF8001, 0x0000004B, 0x00000000, 0x00000032, 0x00000064, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003B0001, 0x003B0002, 0x003B0003, 0x003B0003, 0x003B0001, 0x003B0001, 0x003B000C, 0x003B000C, 0x003B0015, 0x003B0012, 0x003B0011, 0x003B0010, 0x003B0005, 0x003B0001, 0x003B0001, 0x003B0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_80244F0C_DC21BC -.word 0x00000003, D_802439BC_DC0C6C, 0x00000000, 0xC47A0000, 0x00000000, 0x00200F04, D_802447FC_DC1AAC, 0x00000000, 0x00000000, 0x0000010E, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0x0000001E, 0x00000000, 0x00000032, 0x00000032, 0x00000000, 0x00000064, 0x00000064, 0x00000000, 0x00000064, 0x00000078, 0x00000000, 0x00000032, 0x00000064, 0x00000000, 0x00000000, 0x00000032, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFF8001, 0x0000004B, 0x00000000, 0x00000032, 0x00000064, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003B0001, 0x003B0002, 0x003B0003, 0x003B0003, 0x003B0001, 0x003B0001, 0x003B000C, 0x003B000C, 0x003B0015, 0x003B0012, 0x003B0011, 0x003B0010, 0x003B0005, 0x003B0001, 0x003B0001, 0x003B0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_802450FC_DC23AC -.word 0x00000004, D_802439BC_DC0C6C, 0x00000000, 0xC47A0000, 0x00000000, 0x00200F04, D_802447FC_DC1AAC, 0x00000000, 0x00000000, 0x0000010E, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0x0000001E, 0x00000000, 0x00000032, 0x00000032, 0x00000000, 0x00000064, 0x00000064, 0x00000000, 0x00000064, 0x00000078, 0x00000000, 0x00000032, 0x00000064, 0x00000000, 0x00000000, 0x00000032, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFF8001, 0x0000004B, 0x00000000, 0x00000032, 0x00000064, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003B0001, 0x003B0002, 0x003B0003, 0x003B0003, 0x003B0001, 0x003B0001, 0x003B000C, 0x003B000C, 0x003B0015, 0x003B0012, 0x003B0011, 0x003B0010, 0x003B0005, 0x003B0001, 0x003B0001, 0x003B0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_802452EC_DC259C -.word 0x00000005, D_80243AF8_DC0DA8, 0x44834000, 0x00000000, 0x00000000, 0x00440F00, D_80244A20_DC1CD0, 0x00000000, 0x00000000, 0x0000010E, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x002B0002, 0x002B0002, 0x002B0003, 0x002B0003, 0x002B0001, 0x002B0001, 0x002B0008, 0x002B0008, 0x002B0003, 0x002B0003, 0x002B0003, 0x002B0003, 0x002B0003, 0x002B0003, 0x002B0003, 0x002B0003, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_802454DC_DC278C -.word 0x00000006, D_80243B24_DC0DD4, 0x44834000, 0x00000000, 0x00000000, 0x00440F00, D_80244A94_DC1D44, 0x00000000, 0x00000000, 0x0000010E, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x005A0002, 0x005A0004, 0x005A0007, 0x005A0007, 0x005A0002, 0x005A0002, 0x005A000E, 0x005A000E, 0x005A0018, 0x005A0019, 0x005A0002, 0x005A0002, 0x005A0002, 0x005A0002, 0x005A0002, 0x005A0002, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_802456CC_DC297C -.word 0x00000008, D_80243ACC_DC0D7C, 0xC4228000, 0x430C0000, 0xC2D20000, 0x00000C00, 0x00000000, 0x00000000, 0x00000000, 0x0000010E, 0x8005008A, 0x00050000, 0x008C0005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0xFFFFFD76, 0x0000008C, 0xFFFFFF97, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0xFFFFFD76, 0x0000008C, 0xFFFFFF97, 0x000000C8, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003D0034, 0x003D0034, 0x003D0038, 0x003D0038, 0x003D0033, 0x003D0033, 0x003D0039, 0x003D0039, 0x003D0038, 0x003D0038, 0x003D0001, 0x003D0001, 0x003D0001, 0x003D0001, 0x003D0001, 0x003D0001, 0x00000001, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_802458BC_DC2B6C -.word 0x00000009, D_80243ACC_DC0D7C, 0xC4098000, 0x42700000, 0x428C0000, 0x00000C00, 0x00000000, 0x00000000, 0x00000000, 0x0000010E, 0x8005008A, 0x00050000, 0x008C0005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0xFFFFFDDA, 0x0000003C, 0x00000046, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0xFFFFFDDA, 0x0000003C, 0x00000046, 0x000000C8, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003D0034, 0x003D0034, 0x003D0038, 0x003D0038, 0x003D0033, 0x003D0033, 0x003D0039, 0x003D0039, 0x003D0038, 0x003D0038, 0x003D0001, 0x003D0001, 0x003D0001, 0x003D0001, 0x003D0001, 0x003D0001, 0x00000001, 0x00000000, 0x00000000, 0x00000000 - -dlabel D_80245AAC_DC2D5C -.word 0x0060000E, 0x0060000F, 0x00600010, 0x00600013, 0x00600015, 0x00600016, 0xFFFFFFFF - -dlabel D_80245AC8_DC2D78 -.word 0x00000007, D_80243B50_DC0E00, 0x00000000, 0xC47A0000, 0x00000000, 0x00000F04, D_80244B08_DC1DB8, 0x00000000, 0x00000000, 0x0000005A, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00600001, 0x00600002, 0x00600003, 0x00600003, 0x00600001, 0x00600001, 0x00600000, 0x00600000, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00600003, 0x00000000, 0x00000000, D_80245AAC_DC2D5C, 0x00000000, 0x00000001, D_80244B2C_DC1DDC, 0x120A0002, 0x00000001, D_80244D1C_DC1FCC, 0x120A0002, 0x00000001, D_80244F0C_DC21BC, 0x120A0002, 0x00000001, D_802450FC_DC23AC, 0x120A0002, 0x00000001, D_802456CC_DC297C, 0x10140001, 0x00000001, D_802458BC_DC2B6C, 0x10120001, 0x00000001, D_802452EC_DC259C, 0x12050006, 0x00000000, 0x00000000, 0x00000000, 0x00000001, D_80244B2C_DC1DDC, 0x120A0002, 0x00000001, D_80244D1C_DC1FCC, 0x120A0002, 0x00000001, D_80244F0C_DC21BC, 0x120A0002, 0x00000001, D_802450FC_DC23AC, 0x120A0002, 0x00000001, D_802456CC_DC297C, 0x10140001, 0x00000001, D_802458BC_DC2B6C, 0x10120001, 0x00000001, D_802454DC_DC278C, 0x12070006, 0x00000000, 0x00000000, 0x00000000, 0x00000001, D_80244B2C_DC1DDC, 0x120A0002, 0x00000001, D_80244D1C_DC1FCC, 0x120A0002, 0x00000001, D_80244F0C_DC21BC, 0x120A0002, 0x00000001, D_802450FC_DC23AC, 0x120A0002, 0x00000001, D_802456CC_DC297C, 0x10140001, 0x00000001, D_802458BC_DC2B6C, 0x10120001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, D_80245AC8_DC2D78, 0x00000000, 0x00000001, D_802452EC_DC259C, 0x12050006, 0x00000001, D_802454DC_DC278C, 0x12070006, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_07/DC30B0.data.s b/ver/us/asm/data/world/area_omo/omo_07/DC30B0.data.s deleted file mode 100644 index 3172a6ce65..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_07/DC30B0.data.s +++ /dev/null @@ -1,39 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel omo_07_varStash -.word 0x00000000 - -dlabel D_80245E04_DC30B4 -.word 0x0000004D, 0x00000001, 0x00000000, 0x00000043, 0x00000002, SetTimeFreezeMode, 0x00000002, 0x00000008, 0x00000001, 0x00000028, 0x00000043, 0x00000004, ShowGotItem, 0xFE363C80, 0x00000000, 0x00000000, 0x00000043, 0x00000002, SetTimeFreezeMode, 0x00000000, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80245E6C_DC311C -.word 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C8A, 0x0000000B, 0x00000002, 0xFE363C8A, 0x00000000, 0x00000046, 0x00000001, D_80245E04_DC30B4, 0x00000013, 0x00000000, 0x00000014, 0x00000001, 0xFE363C8B, 0x00000016, 0x00000001, 0x00000000, 0x00000043, 0x00000003, AddItem, 0xFE363C8A, 0xFE363C80, 0x00000016, 0x00000001, 0x00000001, 0x00000043, 0x00000002, AddKeyItem, 0xFE363C8A, 0x00000016, 0x00000001, 0x00000002, 0x00000043, 0x00000003, AddBadge, 0xFE363C8A, 0xFE363C80, 0x00000023, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80245F4C_DC31FC -.word 0x00000024, 0x00000002, 0xFE363C8A, 0x00000023, 0x00000024, 0x00000002, 0xFE363C8B, 0x00000001, 0x00000024, 0x00000002, 0xF8405FF6, 0x00000001, 0x00000024, 0x00000002, 0xF5DE0180, 0xFFFFFFFC, 0x00000046, 0x00000001, D_80245E6C_DC311C, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80245FA8_DC3258 -.word 0x00000024, 0x00000002, 0xFE363C8A, 0x000000FB, 0x00000024, 0x00000002, 0xFE363C8B, 0x00000002, 0x00000024, 0x00000002, 0xF8405FF7, 0x00000001, 0x00000046, 0x00000001, D_80245E6C_DC311C, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80245FF4_DC32A4 -.word 0x00000024, 0x00000002, 0xFE363C8A, 0x000000FA, 0x00000024, 0x00000002, 0xFE363C8B, 0x00000002, 0x00000024, 0x00000002, 0xF8405FF8, 0x00000001, 0x00000046, 0x00000001, D_80245E6C_DC311C, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80246040_DC32F0 -.word 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, SetCamTarget, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_802460A8_DC3358 -.word 0xFFFFFEAF, 0x00000050, 0xFFFFFFC9, 0xFFFFFE28, 0x00000000, 0x0000007F, 0xFFFFFF40, 0x00000000, 0x0000007F - -dlabel D_802460CC_DC337C -.word 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000001, 0x00000030, 0x00000001, D_802460A8_DC3358, 0x00000005, 0x00000001, 0xFE363C80, 0x00000033, 0x00000003, 0xFE363C87, 0xFE363C88, 0xFE363C89, 0x00000006, 0x00000000, 0x00000043, 0x00000002, SetPlayerActionState, 0x00000003, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000005, 0x00000001, 0x00000004, 0x00000027, 0x00000002, 0xFE363C81, 0x0000000A, 0x00000043, 0x00000004, SetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000043, 0x00000001, omo_07_UnsetCamera0MoveFlag1, 0x00000045, 0x00000002, D_80246040_DC32F0, 0xFE363C8A, 0x00000043, 0x00000002, SetPlayerJumpscale, 0xF24A7D4D, 0x00000043, 0x00000005, PlayerJump, 0xFE363C87, 0xFE363C88, 0xFE363C89, 0x00000028, 0x00000049, 0x00000001, 0xFE363C8A, 0x00000008, 0x00000001, 0x00000003, 0x00000043, 0x00000002, SetPlayerActionState, 0x00000000, 0x00000043, 0x00000001, omo_07_SetCamera0MoveFlag1, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_8024623C_DC34EC -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000001, 0x00000046, 0x00000001, D_802460CC_DC337C, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80246268_DC3518 -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000002, 0x00000046, 0x00000001, D_802460CC_DC337C, 0x00000002, 0x00000000, 0x00000001, 0x00000000 - -dlabel D_80246294_DC3544 -.word 0x00000024, 0x00000002, 0xFE363C80, 0x00000003, 0x00000046, 0x00000001, D_802460CC_DC337C, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000008, MakeEntity, Entity_Chest, 0x0000046A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignChestFlag, 0xF8405FF6, 0x00000043, 0x00000002, AssignScript, D_80245F4C_DC31FC, 0x00000043, 0x00000008, MakeEntity, Entity_Chest, 0xFFFFFC72, 0x00000050, 0xFFFFFF9C, 0x00000000, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignChestFlag, 0xF8405FF7, 0x00000043, 0x00000002, AssignScript, D_80245FA8_DC3258, 0x00000043, 0x00000008, MakeEntity, Entity_Chest, 0x000002EE, 0x00000000, 0xFFFFFF9C, 0x00000000, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignChestFlag, 0xF8405FF8, 0x00000043, 0x00000002, AssignScript, D_80245FF4_DC32A4, 0x00000043, 0x00000008, MakeEntity, Entity_YellowBlock, 0x0000028A, 0x0000003C, 0xFFFFFFE2, 0x00000000, 0x00000157, 0x80000000, 0x00000043, 0x00000002, AssignBlockFlag, 0xF8405FF5, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0xFFFFFEB6, 0x00000000, 0x0000007F, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_8024623C_DC34EC, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0xFFFFFEFC, 0x00000000, 0x0000007F, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_80246268_DC3518, 0x00000043, 0x00000007, MakeEntity, Entity_StarBoxLauncher, 0xFFFFFF40, 0x00000050, 0xFFFFFF7C, 0x00000000, 0x80000000, 0x00000043, 0x00000002, AssignScript, D_80246294_DC3544, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_07/DC3730.data.s b/ver/us/asm/data/world/area_omo/omo_07/DC3730.data.s deleted file mode 100644 index 66fabf48c7..0000000000 --- a/ver/us/asm/data/world/area_omo/omo_07/DC3730.data.s +++ /dev/null @@ -1,6 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_80246480_DC3730 -.word 0x00000001, 0x00000002, 0x00000003, 0x00000002, 0x00000001, 0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFE, 0xFFFFFFFF, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C86, 0xFE363C83, 0xFE363C84, 0x00000005, 0x00000001, 0x00000000, 0x00000030, 0x00000001, D_80246480_DC3730, 0x00000005, 0x00000001, 0x0000000A, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000043, 0x00000003, GetSelfVar, 0x00000000, 0xFE363C85, 0x0000000A, 0x00000002, 0xFE363C85, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000012, 0x00000000, 0x00000031, 0x00000001, 0xFE363C81, 0x00000027, 0x00000002, 0xFE363C83, 0xFE363C81, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000008, 0x00000001, 0x00000003, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0x00000007, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, omo_07_GetKammyBroomEmitterPos, 0x00000043, 0x00000005, GetNpcPos, 0x00000007, 0xFE363C89, 0xFE363C8A, 0xFE363C8B, 0x00000024, 0x00000002, 0xFE363C83, 0xFE363C89, 0x00000024, 0x00000002, 0xFE363C84, 0xFE363C8A, 0x00000024, 0x00000002, 0xFE363C85, 0xFE363C8B, 0x0000002D, 0x00000002, 0xFE363C83, 0xFE363C86, 0x0000002D, 0x00000002, 0xFE363C84, 0xFE363C87, 0x0000002D, 0x00000002, 0xFE363C85, 0xFE363C88, 0x00000026, 0x00000002, 0xFE363C86, 0xFE363C89, 0x00000026, 0x00000002, 0xFE363C87, 0xFE363C8A, 0x00000026, 0x00000002, 0xFE363C88, 0xFE363C8B, 0x0000000B, 0x00000002, 0xFE363C83, 0x00000000, 0x0000000B, 0x00000002, 0xFE363C85, 0x00000000, 0x00000043, 0x0000000F, PlayEffect, 0x0000001F, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0xF24A7E80, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x00000003, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000024, 0x00000002, 0xF8405FF4, 0x00000001, 0x00000024, 0x00000002, 0xF70F2E84, 0xF5DE0259, 0x00000014, 0x00000001, 0xF70F2E84, 0x00000016, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8A, 0x00000005, 0x00000016, 0x00000001, 0x00000001, 0x00000024, 0x00000002, 0xFD050F8A, 0x00000006, 0x00000016, 0x00000001, 0x00000002, 0x00000024, 0x00000002, 0xFD050F8A, 0x00000082, 0x00000023, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0x00000007, 0x000003E8, 0x0000000F, 0x00000000, 0x00000043, 0x00000003, SetNpcYaw, 0x00000007, 0x0000005A, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000007, 0x00600013, 0x0000000B, 0x00000002, 0xF70F2E84, 0x00000002, 0x00000043, 0x00000005, SetNpcPos, 0xFD050F8A, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0x00000424, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0x00000424, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24FF280, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AB680, 0xF24A5C80, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24BE280, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000004, SetNpcVar, 0x00000007, 0x00000000, 0x00000001, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000007, 0x00600013, 0x00000008, 0x00000001, 0x00000019, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000007, 0x0060000E, 0x00000043, 0x00000005, GetNpcPos, 0x00000007, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C80, 0x00000019, 0x00000027, 0x00000002, 0xFE363C81, 0x00000026, 0x00000043, 0x00000006, PlaySoundAt, 0x0000207A, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000013, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0xF24A7E80, 0x0000004B, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x0000004B, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000007, 0x0060000F, 0x00000027, 0x00000002, 0xFE363C80, 0x00000037, 0x00000043, 0x00000006, PlaySoundAt, 0x00002098, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000001, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x0000000F, 0x00000003, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x0000000B, 0x00000002, 0xF70F2E84, 0x00000002, 0x00000043, 0x00000005, SetNpcPos, 0xFD050F8A, 0xFE363C80, 0x00000000, 0x00000000, 0x00000012, 0x00000000, 0x00000043, 0x00000007, MakeItemEntity, 0xFD050F8A, 0xFE363C80, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000007, 0x00600013, 0x00000043, 0x00000004, SetNpcVar, 0x00000007, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x0000000B, 0x00000002, 0xF70F2E84, 0x00000002, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFD050F8A, 0x00000263, 0x00000000, 0x00000043, 0x0000000A, ShowEmote, 0xFD050F8A, 0x00000002, 0x00000000, 0x00000014, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000013, 0x00000000, 0x00000043, 0x00000003, GotoMap, 0x80247110, 0x00000000, 0x00000008, 0x00000001, 0x00000064, 0x00000002, 0x00000000, 0x00000001, 0x00000000 diff --git a/ver/us/asm/data/world/area_omo/omo_09/DD4150.data.s b/ver/us/asm/data/world/area_omo/omo_09/DD4150.data.s index bc42f89635..cce25cb32b 100644 --- a/ver/us/asm/data/world/area_omo/omo_09/DD4150.data.s +++ b/ver/us/asm/data/world/area_omo/omo_09/DD4150.data.s @@ -36,7 +36,7 @@ dlabel D_80247710_DD43E0 .word 0x3FC00000, 0x0000003C, 0x0000000F, 0x42B40000, 0x42480000, 0x00000003, 0x40733333, 0x00000008, 0x00000001, 0x430C0000, 0x42700000, 0x00000001 dlabel D_80247740_DD4410 -.word 0x00000043, 0x00000001, omo_09_SetNpcB5_3, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x0000000C, 0x00000043, 0x00000003, SetSelfVar, 0x00000002, 0x00000005, 0x00000043, 0x00000003, SetSelfVar, 0x00000003, 0x00000002, 0x00000043, 0x00000002, omo_09_RangedAttackAI_Main, D_80247710_DD43E0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 +.word 0x00000043, 0x00000001, omo_09_SetInstigatorValue_3, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x0000000C, 0x00000043, 0x00000003, SetSelfVar, 0x00000002, 0x00000005, 0x00000043, 0x00000003, SetSelfVar, 0x00000003, 0x00000002, 0x00000043, 0x00000002, omo_09_RangedAttackAI_Main, D_80247710_DD43E0, 0x00000002, 0x00000000, 0x00000001, 0x00000000 dlabel D_802477BC_DD448C .word 0x00000000, 0x00180016, 0x00000000, 0x00000000, D_80247740_DD4410, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000F0000 @@ -51,7 +51,7 @@ dlabel D_80247888_DD4558 .word 0x00000002, 0x00000000, 0x00000001, 0x00000000 dlabel D_80247898_DD4568 -.word 0x00000043, 0x00000001, omo_09_GetEncounterEnemyIsOwner, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80247888_DD4558, 0x00000043, 0x00000002, GetOwnerEncounterTrigger, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x0000001D, 0x00000001, 0x00000004, 0x0000001D, 0x00000001, 0x00000003, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000003, 0x00000043, 0x00000001, omo_09_ProjectileAI_Reflect, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000020, 0x00000000, 0x0000001D, 0x00000001, 0x00000002, 0x0000001D, 0x00000001, 0x00000006, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000004, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000007, 0x00000002, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000020, 0x00000000, 0x0000001C, 0x00000000, 0x00000043, 0x00000001, func_800457F8, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80247818_DD44E8, 0x00000002, 0x00000000, 0x00000001, 0x00000000 +.word 0x00000043, 0x00000001, omo_09_GetEncounterEnemyIsOwner, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80247888_DD4558, 0x00000043, 0x00000002, GetOwnerEncounterTrigger, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x0000001D, 0x00000001, 0x00000004, 0x0000001D, 0x00000001, 0x00000003, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000003, 0x00000043, 0x00000001, omo_09_ProjectileAI_Reflect, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000020, 0x00000000, 0x0000001D, 0x00000001, 0x00000002, 0x0000001D, 0x00000001, 0x00000006, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000004, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000007, 0x00000002, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000020, 0x00000000, 0x0000001C, 0x00000000, 0x00000043, 0x00000001, SetBattleAsScripted, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80247818_DD44E8, 0x00000002, 0x00000000, 0x00000001, 0x00000000 dlabel D_80247A60_DD4730 .word 0x00000000, 0x00070007, 0x00000000, 0x00000000, D_80247818_DD44E8, D_80247898_DD4568, 0x00000000, D_80247640_DD4310, 0x00000000, 0x00000000, 0x00000008 @@ -63,7 +63,7 @@ dlabel D_80247AB8_DD4788 .word 0x3FE66666, 0x00000032, 0x0000000A, 0x437A0000, 0x00000000, 0x00000002, 0x40600000, 0x0000002D, 0x00000006, 0x43960000, 0x00000000, 0x00000001 dlabel D_80247AE8_DD47B8 -.word 0x00000043, 0x00000001, dup_omo_09_SetNpcB5_3, 0x00000043, 0x00000002, BasicAI_Main, D_80247AB8_DD4788, 0x00000002, 0x00000000, 0x00000001, 0x00000000 +.word 0x00000043, 0x00000001, dup_omo_09_SetInstigatorValue_3, 0x00000043, 0x00000002, BasicAI_Main, D_80247AB8_DD4788, 0x00000002, 0x00000000, 0x00000001, 0x00000000 dlabel D_80247B14_DD47E4 .word 0x00000000, 0x0048000F, 0x00000000, 0x00000000, D_80247AE8_DD47B8, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x00090000 diff --git a/ver/us/asm/data/world/area_omo/omo_17/DF4EB0.data.s b/ver/us/asm/data/world/area_omo/omo_17/DF4EB0.data.s index 78b52a3fb0..8e3ba41fd8 100644 --- a/ver/us/asm/data/world/area_omo/omo_17/DF4EB0.data.s +++ b/ver/us/asm/data/world/area_omo/omo_17/DF4EB0.data.s @@ -36,7 +36,7 @@ dlabel D_80246338_DF51D8 .word 0x3FC00000, 0x0000003C, 0x0000000F, 0x42B40000, 0x42480000, 0x00000003, 0x40733333, 0x00000008, 0x00000001, 0x430C0000, 0x42700000, 0x00000001 dlabel D_80246368_DF5208 -.word 0x00000043, 0x00000001, omo_17_SetNpcB5_3, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x0000000C, 0x00000043, 0x00000003, SetSelfVar, 0x00000002, 0x00000005, 0x00000043, 0x00000003, SetSelfVar, 0x00000003, 0x00000002, 0x00000043, 0x00000002, omo_17_RangedAttackAI_Main, D_80246338_DF51D8, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00180016, 0x00000000, 0x00000000, D_80246368_DF5208, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000F0000 +.word 0x00000043, 0x00000001, omo_17_SetInstigatorValue_3, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x0000000C, 0x00000043, 0x00000003, SetSelfVar, 0x00000002, 0x00000005, 0x00000043, 0x00000003, SetSelfVar, 0x00000003, 0x00000002, 0x00000043, 0x00000002, omo_17_RangedAttackAI_Main, D_80246338_DF51D8, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00180016, 0x00000000, 0x00000000, D_80246368_DF5208, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000F0000 dlabel D_80246410_DF52B0 .word 0x41000000, 0x00000000, 0x00000000, 0x40800000, 0x3F000000, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 @@ -48,7 +48,7 @@ dlabel D_802464B0_DF5350 .word 0x00000002, 0x00000000, 0x00000001, 0x00000000 dlabel D_802464C0_DF5360 -.word 0x00000043, 0x00000001, omo_17_GetEncounterEnemyIsOwner, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_802464B0_DF5350, 0x00000043, 0x00000002, GetOwnerEncounterTrigger, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x0000001D, 0x00000001, 0x00000004, 0x0000001D, 0x00000001, 0x00000003, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000003, 0x00000043, 0x00000001, omo_17_ProjectileAI_Reflect, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000020, 0x00000000, 0x0000001D, 0x00000001, 0x00000002, 0x0000001D, 0x00000001, 0x00000006, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000004, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000007, 0x00000002, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000020, 0x00000000, 0x0000001C, 0x00000000, 0x00000043, 0x00000001, func_800457F8, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80246440_DF52E0, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00070007, 0x00000000, 0x00000000, D_80246440_DF52E0, D_802464C0_DF5360, 0x00000000, D_80246268_DF5108, 0x00000000, 0x00000000, 0x00000008 +.word 0x00000043, 0x00000001, omo_17_GetEncounterEnemyIsOwner, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_802464B0_DF5350, 0x00000043, 0x00000002, GetOwnerEncounterTrigger, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x0000001D, 0x00000001, 0x00000004, 0x0000001D, 0x00000001, 0x00000003, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000003, 0x00000043, 0x00000001, omo_17_ProjectileAI_Reflect, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000000, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000020, 0x00000000, 0x0000001D, 0x00000001, 0x00000002, 0x0000001D, 0x00000001, 0x00000006, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000004, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x0000000F, PlayEffect, 0x00000007, 0x00000002, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000000, 0x00000020, 0x00000000, 0x0000001C, 0x00000000, 0x00000043, 0x00000001, SetBattleAsScripted, 0x00000020, 0x00000000, 0x00000023, 0x00000000, 0x00000043, 0x00000003, BindNpcAI, 0xFFFFFFFF, D_80246440_DF52E0, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00070007, 0x00000000, 0x00000000, D_80246440_DF52E0, D_802464C0_DF5360, 0x00000000, D_80246268_DF5108, 0x00000000, 0x00000000, 0x00000008 dlabel D_802466B4_DF5554 .word 0x00000002, 0x00000000, 0x00000001, 0x00000000 diff --git a/ver/us/asm/nonmatchings/415D90/func_802A3C98.s b/ver/us/asm/nonmatchings/415D90/func_802A3C98.s index 8d9bece943..43ff39b65b 100644 --- a/ver/us/asm/nonmatchings/415D90/func_802A3C98.s +++ b/ver/us/asm/nonmatchings/415D90/func_802A3C98.s @@ -123,8 +123,8 @@ glabel func_802A3C98 /* 418BDC 802A3E4C 3C02ED00 */ lui $v0, 0xed00 /* 418BE0 802A3E50 00822025 */ or $a0, $a0, $v0 /* 418BE4 802A3E54 00641825 */ or $v1, $v1, $a0 -/* 418BE8 802A3E58 3C04802B */ lui $a0, %hi(battle_menu_moveOptionCount) -/* 418BEC 802A3E5C 8C84D4A4 */ lw $a0, %lo(battle_menu_moveOptionCount)($a0) +/* 418BE8 802A3E58 3C04802B */ lui $a0, %hi(BattleMenu_Moves_OptionCount) +/* 418BEC 802A3E5C 8C84D4A4 */ lw $a0, %lo(BattleMenu_Moves_OptionCount)($a0) /* 418BF0 802A3E60 46040002 */ mul.s $f0, $f0, $f4 /* 418BF4 802A3E64 00000000 */ nop /* 418BF8 802A3E68 ACE30000 */ sw $v1, ($a3) @@ -140,12 +140,12 @@ glabel func_802A3C98 /* 418C20 802A3E90 00431025 */ or $v0, $v0, $v1 /* 418C24 802A3E94 188000BC */ blez $a0, .L802A4188 /* 418C28 802A3E98 ACE20004 */ sw $v0, 4($a3) -/* 418C2C 802A3E9C 3C16802B */ lui $s6, %hi(battle_menu_moveOptionsEnabled) -/* 418C30 802A3EA0 26D6D510 */ addiu $s6, $s6, %lo(battle_menu_moveOptionsEnabled) +/* 418C2C 802A3E9C 3C16802B */ lui $s6, %hi(BattleMenu_Moves_OptionEnabled) +/* 418C30 802A3EA0 26D6D510 */ addiu $s6, $s6, %lo(BattleMenu_Moves_OptionEnabled) /* 418C34 802A3EA4 3C1E802B */ lui $fp, %hi(battle_menu_moveOptionDisplayCosts) /* 418C38 802A3EA8 27DED320 */ addiu $fp, $fp, %lo(battle_menu_moveOptionDisplayCosts) -/* 418C3C 802A3EAC 3C14802B */ lui $s4, %hi(battle_menu_moveOptionIndexMap) -/* 418C40 802A3EB0 2694D1F8 */ addiu $s4, $s4, %lo(battle_menu_moveOptionIndexMap) +/* 418C3C 802A3EAC 3C14802B */ lui $s4, %hi(BattleMenu_Moves_OptionIndexMap) +/* 418C40 802A3EB0 2694D1F8 */ addiu $s4, $s4, %lo(BattleMenu_Moves_OptionIndexMap) /* 418C44 802A3EB4 0260B82D */ daddu $s7, $s3, $zero .L802A3EB8: /* 418C48 802A3EB8 3C03802B */ lui $v1, %hi(battle_menu_moveScrollLine) @@ -164,8 +164,8 @@ glabel func_802A3C98 /* 418C7C 802A3EEC 00022080 */ sll $a0, $v0, 2 /* 418C80 802A3EF0 00961021 */ addu $v0, $a0, $s6 /* 418C84 802A3EF4 8C420000 */ lw $v0, ($v0) -/* 418C88 802A3EF8 3C08802B */ lui $t0, %hi(battle_menu_moveTextColor) -/* 418C8C 802A3EFC 8508D114 */ lh $t0, %lo(battle_menu_moveTextColor)($t0) +/* 418C88 802A3EF8 3C08802B */ lui $t0, %hi(BattleMenu_Moves_TextColor) +/* 418C8C 802A3EFC 8508D114 */ lh $t0, %lo(BattleMenu_Moves_TextColor)($t0) /* 418C90 802A3F00 58400001 */ blezl $v0, .L802A3F08 /* 418C94 802A3F04 2408000B */ addiu $t0, $zero, 0xb .L802A3F08: @@ -175,8 +175,8 @@ glabel func_802A3C98 /* 418CA4 802A3F14 8C820000 */ lw $v0, ($a0) /* 418CA8 802A3F18 04400009 */ bltz $v0, .L802A3F40 /* 418CAC 802A3F1C 02A0282D */ daddu $a1, $s5, $zero -/* 418CB0 802A3F20 3C07802B */ lui $a3, %hi(battle_menu_moveTextOpacity) -/* 418CB4 802A3F24 84E7D116 */ lh $a3, %lo(battle_menu_moveTextOpacity)($a3) +/* 418CB0 802A3F20 3C07802B */ lui $a3, %hi(BattleMenu_Moves_TextAlpha) +/* 418CB4 802A3F24 84E7D116 */ lh $a3, %lo(BattleMenu_Moves_TextAlpha)($a3) /* 418CB8 802A3F28 24020001 */ addiu $v0, $zero, 1 /* 418CBC 802A3F2C AFA80010 */ sw $t0, 0x10($sp) /* 418CC0 802A3F30 AFA20014 */ sw $v0, 0x14($sp) @@ -196,8 +196,8 @@ glabel func_802A3C98 /* 418CF4 802A3F64 5A400001 */ blezl $s2, .L802A3F6C /* 418CF8 802A3F68 24120001 */ addiu $s2, $zero, 1 .L802A3F6C: -/* 418CFC 802A3F6C 3C02802B */ lui $v0, %hi(battle_menu_hasSpiritsMenu) -/* 418D00 802A3F70 8C42D4A0 */ lw $v0, %lo(battle_menu_hasSpiritsMenu)($v0) +/* 418CFC 802A3F6C 3C02802B */ lui $v0, %hi(BattleMenu_UsingSpiritsSubmenu) +/* 418D00 802A3F70 8C42D4A0 */ lw $v0, %lo(BattleMenu_UsingSpiritsSubmenu)($v0) /* 418D04 802A3F74 14400015 */ bnez $v0, .L802A3FCC /* 418D08 802A3F78 00000000 */ nop /* 418D0C 802A3F7C 3C02802B */ lui $v0, %hi(battle_menu_moveCursorPos) @@ -272,18 +272,18 @@ glabel func_802A3C98 /* 418DF8 802A4068 8C420000 */ lw $v0, ($v0) /* 418DFC 802A406C 5040003E */ beql $v0, $zero, .L802A4168 /* 418E00 802A4070 2631000D */ addiu $s1, $s1, 0xd -/* 418E04 802A4074 3C02802B */ lui $v0, %hi(battle_menu_hasSpiritsMenu) -/* 418E08 802A4078 8C42D4A0 */ lw $v0, %lo(battle_menu_hasSpiritsMenu)($v0) -/* 418E0C 802A407C 3C10802B */ lui $s0, %hi(battle_menu_moveOptionCostUnitIconIDs) +/* 418E04 802A4074 3C02802B */ lui $v0, %hi(BattleMenu_UsingSpiritsSubmenu) +/* 418E08 802A4078 8C42D4A0 */ lw $v0, %lo(BattleMenu_UsingSpiritsSubmenu)($v0) +/* 418E0C 802A407C 3C10802B */ lui $s0, %hi(BattleMenu_Moves_OptionCostUnitIDs) /* 418E10 802A4080 02178021 */ addu $s0, $s0, $s7 -/* 418E14 802A4084 8E10D190 */ lw $s0, %lo(battle_menu_moveOptionCostUnitIconIDs)($s0) +/* 418E14 802A4084 8E10D190 */ lw $s0, %lo(BattleMenu_Moves_OptionCostUnitIDs)($s0) /* 418E18 802A4088 14400018 */ bnez $v0, .L802A40EC /* 418E1C 802A408C 0240202D */ daddu $a0, $s2, $zero /* 418E20 802A4090 26A5006C */ addiu $a1, $s5, 0x6c /* 418E24 802A4094 0220302D */ daddu $a2, $s1, $zero /* 418E28 802A4098 24070001 */ addiu $a3, $zero, 1 -/* 418E2C 802A409C 3C03802B */ lui $v1, %hi(battle_menu_moveTextOpacity) -/* 418E30 802A40A0 8463D116 */ lh $v1, %lo(battle_menu_moveTextOpacity)($v1) +/* 418E2C 802A409C 3C03802B */ lui $v1, %hi(BattleMenu_Moves_TextAlpha) +/* 418E30 802A40A0 8463D116 */ lh $v1, %lo(BattleMenu_Moves_TextAlpha)($v1) /* 418E34 802A40A4 24020003 */ addiu $v0, $zero, 3 /* 418E38 802A40A8 AFA80010 */ sw $t0, 0x10($sp) /* 418E3C 802A40AC AFA20018 */ sw $v0, 0x18($sp) @@ -307,8 +307,8 @@ glabel func_802A3C98 /* 418E7C 802A40EC 26A5005D */ addiu $a1, $s5, 0x5d /* 418E80 802A40F0 0220302D */ daddu $a2, $s1, $zero /* 418E84 802A40F4 24070001 */ addiu $a3, $zero, 1 -/* 418E88 802A40F8 3C03802B */ lui $v1, %hi(battle_menu_moveTextOpacity) -/* 418E8C 802A40FC 8463D116 */ lh $v1, %lo(battle_menu_moveTextOpacity)($v1) +/* 418E88 802A40F8 3C03802B */ lui $v1, %hi(BattleMenu_Moves_TextAlpha) +/* 418E8C 802A40FC 8463D116 */ lh $v1, %lo(BattleMenu_Moves_TextAlpha)($v1) /* 418E90 802A4100 24020003 */ addiu $v0, $zero, 3 /* 418E94 802A4104 AFA80010 */ sw $t0, 0x10($sp) /* 418E98 802A4108 AFA20018 */ sw $v0, 0x18($sp) @@ -330,8 +330,8 @@ glabel func_802A3C98 .L802A4144: /* 418ED4 802A4144 0C051261 */ jal hud_element_set_render_pos /* 418ED8 802A4148 26260007 */ addiu $a2, $s1, 7 -/* 418EDC 802A414C 3C05802B */ lui $a1, %hi(battle_menu_moveTextOpacity) -/* 418EE0 802A4150 84A5D116 */ lh $a1, %lo(battle_menu_moveTextOpacity)($a1) +/* 418EDC 802A414C 3C05802B */ lui $a1, %hi(BattleMenu_Moves_TextAlpha) +/* 418EE0 802A4150 84A5D116 */ lh $a1, %lo(BattleMenu_Moves_TextAlpha)($a1) /* 418EE4 802A4154 0C0513AC */ jal hud_element_set_alpha /* 418EE8 802A4158 0200202D */ daddu $a0, $s0, $zero /* 418EEC 802A415C 0C0511F8 */ jal hud_element_draw_without_clipping @@ -340,8 +340,8 @@ glabel func_802A3C98 .L802A4168: /* 418EF8 802A4168 26730001 */ addiu $s3, $s3, 1 /* 418EFC 802A416C 26940004 */ addiu $s4, $s4, 4 -/* 418F00 802A4170 3C02802B */ lui $v0, %hi(battle_menu_moveOptionCount) -/* 418F04 802A4174 8C42D4A4 */ lw $v0, %lo(battle_menu_moveOptionCount)($v0) +/* 418F00 802A4170 3C02802B */ lui $v0, %hi(BattleMenu_Moves_OptionCount) +/* 418F04 802A4174 8C42D4A4 */ lw $v0, %lo(BattleMenu_Moves_OptionCount)($v0) /* 418F08 802A4178 0262102A */ slt $v0, $s3, $v0 /* 418F0C 802A417C 1440FF4E */ bnez $v0, .L802A3EB8 /* 418F10 802A4180 26F70004 */ addiu $s7, $s7, 4 @@ -352,13 +352,13 @@ glabel func_802A3C98 /* 418F20 802A4190 8442D110 */ lh $v0, %lo(battle_menu_moveScrollOffset)($v0) /* 418F24 802A4194 25350018 */ addiu $s5, $t1, 0x18 /* 418F28 802A4198 8FA90050 */ lw $t1, 0x50($sp) -/* 418F2C 802A419C 3C03802B */ lui $v1, %hi(battle_menu_moveOptionCount) -/* 418F30 802A41A0 8C63D4A4 */ lw $v1, %lo(battle_menu_moveOptionCount)($v1) +/* 418F2C 802A419C 3C03802B */ lui $v1, %hi(BattleMenu_Moves_OptionCount) +/* 418F30 802A41A0 8C63D4A4 */ lw $v1, %lo(BattleMenu_Moves_OptionCount)($v1) /* 418F34 802A41A4 00491021 */ addu $v0, $v0, $t1 /* 418F38 802A41A8 18600022 */ blez $v1, .L802A4234 /* 418F3C 802A41AC 24510018 */ addiu $s1, $v0, 0x18 -/* 418F40 802A41B0 3C12802B */ lui $s2, %hi(battle_menu_moveOptionIconIDs) -/* 418F44 802A41B4 2652D128 */ addiu $s2, $s2, %lo(battle_menu_moveOptionIconIDs) +/* 418F40 802A41B0 3C12802B */ lui $s2, %hi(BattleMenu_Moves_OptionIDs) +/* 418F44 802A41B4 2652D128 */ addiu $s2, $s2, %lo(BattleMenu_Moves_OptionIDs) .L802A41B8: /* 418F48 802A41B8 3C03802B */ lui $v1, %hi(battle_menu_moveScrollLine) /* 418F4C 802A41BC 8063D10C */ lb $v1, %lo(battle_menu_moveScrollLine)($v1) @@ -380,16 +380,16 @@ glabel func_802A3C98 /* 418F88 802A41F8 2631000D */ addiu $s1, $s1, 0xd /* 418F8C 802A41FC 0C051261 */ jal hud_element_set_render_pos /* 418F90 802A4200 0200202D */ daddu $a0, $s0, $zero -/* 418F94 802A4204 3C05802B */ lui $a1, %hi(battle_menu_moveTextOpacity) -/* 418F98 802A4208 84A5D116 */ lh $a1, %lo(battle_menu_moveTextOpacity)($a1) +/* 418F94 802A4204 3C05802B */ lui $a1, %hi(BattleMenu_Moves_TextAlpha) +/* 418F98 802A4208 84A5D116 */ lh $a1, %lo(BattleMenu_Moves_TextAlpha)($a1) /* 418F9C 802A420C 0C0513AC */ jal hud_element_set_alpha /* 418FA0 802A4210 0200202D */ daddu $a0, $s0, $zero /* 418FA4 802A4214 0C0511F8 */ jal hud_element_draw_without_clipping /* 418FA8 802A4218 0200202D */ daddu $a0, $s0, $zero .L802A421C: /* 418FAC 802A421C 26730001 */ addiu $s3, $s3, 1 -/* 418FB0 802A4220 3C02802B */ lui $v0, %hi(battle_menu_moveOptionCount) -/* 418FB4 802A4224 8C42D4A4 */ lw $v0, %lo(battle_menu_moveOptionCount)($v0) +/* 418FB0 802A4220 3C02802B */ lui $v0, %hi(BattleMenu_Moves_OptionCount) +/* 418FB4 802A4224 8C42D4A4 */ lw $v0, %lo(BattleMenu_Moves_OptionCount)($v0) /* 418FB8 802A4228 0262102A */ slt $v0, $s3, $v0 /* 418FBC 802A422C 1440FFE2 */ bnez $v0, .L802A41B8 /* 418FC0 802A4230 26520004 */ addiu $s2, $s2, 4 @@ -421,8 +421,8 @@ glabel func_802A3C98 /* 419020 802A4290 02A0282D */ daddu $a1, $s5, $zero /* 419024 802A4294 00083400 */ sll $a2, $t0, 0x10 /* 419028 802A4298 00063403 */ sra $a2, $a2, 0x10 -/* 41902C 802A429C 3C10802B */ lui $s0, %hi(battle_menu_moveCursorIcon) -/* 419030 802A42A0 8E10D118 */ lw $s0, %lo(battle_menu_moveCursorIcon)($s0) +/* 41902C 802A429C 3C10802B */ lui $s0, %hi(BattleMenu_Moves_CursorID) +/* 419030 802A42A0 8E10D118 */ lw $s0, %lo(BattleMenu_Moves_CursorID)($s0) /* 419034 802A42A4 8FA90050 */ lw $t1, 0x50($sp) /* 419038 802A42A8 24C6001A */ addiu $a2, $a2, 0x1a /* 41903C 802A42AC 3C01802B */ lui $at, %hi(D_802AD112) @@ -430,8 +430,8 @@ glabel func_802A3C98 /* 419044 802A42B4 01263021 */ addu $a2, $t1, $a2 /* 419048 802A42B8 0C051261 */ jal hud_element_set_render_pos /* 41904C 802A42BC 0200202D */ daddu $a0, $s0, $zero -/* 419050 802A42C0 3C11802B */ lui $s1, %hi(battle_menu_moveTextOpacity) -/* 419054 802A42C4 2631D116 */ addiu $s1, $s1, %lo(battle_menu_moveTextOpacity) +/* 419050 802A42C0 3C11802B */ lui $s1, %hi(BattleMenu_Moves_TextAlpha) +/* 419054 802A42C4 2631D116 */ addiu $s1, $s1, %lo(BattleMenu_Moves_TextAlpha) /* 419058 802A42C8 86250000 */ lh $a1, ($s1) /* 41905C 802A42CC 0C0513AC */ jal hud_element_set_alpha /* 419060 802A42D0 0200202D */ daddu $a0, $s0, $zero @@ -442,8 +442,8 @@ glabel func_802A3C98 /* 419074 802A42E4 1840000E */ blez $v0, .L802A4320 /* 419078 802A42E8 00000000 */ nop /* 41907C 802A42EC 8FA9004C */ lw $t1, 0x4c($sp) -/* 419080 802A42F0 3C10802B */ lui $s0, %hi(battle_menu_moveUpArrowIcon) -/* 419084 802A42F4 8E10D11C */ lw $s0, %lo(battle_menu_moveUpArrowIcon)($s0) +/* 419080 802A42F0 3C10802B */ lui $s0, %hi(BattleMenu_Moves_UpArrowID) +/* 419084 802A42F4 8E10D11C */ lw $s0, %lo(BattleMenu_Moves_UpArrowID)($s0) /* 419088 802A42F8 25250048 */ addiu $a1, $t1, 0x48 /* 41908C 802A42FC 8FA90050 */ lw $t1, 0x50($sp) /* 419090 802A4300 0200202D */ daddu $a0, $s0, $zero @@ -457,14 +457,14 @@ glabel func_802A3C98 .L802A4320: /* 4190B0 802A4320 3C02802B */ lui $v0, %hi(D_802AD10D) /* 4190B4 802A4324 8042D10D */ lb $v0, %lo(D_802AD10D)($v0) -/* 4190B8 802A4328 3C03802B */ lui $v1, %hi(battle_menu_moveOptionCount) -/* 4190BC 802A432C 8C63D4A4 */ lw $v1, %lo(battle_menu_moveOptionCount)($v1) +/* 4190B8 802A4328 3C03802B */ lui $v1, %hi(BattleMenu_Moves_OptionCount) +/* 4190BC 802A432C 8C63D4A4 */ lw $v1, %lo(BattleMenu_Moves_OptionCount)($v1) /* 4190C0 802A4330 0043102A */ slt $v0, $v0, $v1 /* 4190C4 802A4334 1040000E */ beqz $v0, .L802A4370 /* 4190C8 802A4338 00000000 */ nop /* 4190CC 802A433C 8FA9004C */ lw $t1, 0x4c($sp) -/* 4190D0 802A4340 3C10802B */ lui $s0, %hi(battle_menu_moveDownArrowIcon) -/* 4190D4 802A4344 8E10D120 */ lw $s0, %lo(battle_menu_moveDownArrowIcon)($s0) +/* 4190D0 802A4340 3C10802B */ lui $s0, %hi(BattleMenu_Moves_DownArrowID) +/* 4190D4 802A4344 8E10D120 */ lw $s0, %lo(BattleMenu_Moves_DownArrowID)($s0) /* 4190D8 802A4348 25250048 */ addiu $a1, $t1, 0x48 /* 4190DC 802A434C 8FA90050 */ lw $t1, 0x50($sp) /* 4190E0 802A4350 0200202D */ daddu $a0, $s0, $zero @@ -481,8 +481,8 @@ glabel func_802A3C98 /* 419108 802A4378 2402FFFF */ addiu $v0, $zero, -1 /* 41910C 802A437C 1462000B */ bne $v1, $v0, .L802A43AC_41913C /* 419110 802A4380 00000000 */ nop -/* 419114 802A4384 3C02802B */ lui $v0, %hi(battle_menu_hasSpiritsMenu) -/* 419118 802A4388 8C42D4A0 */ lw $v0, %lo(battle_menu_hasSpiritsMenu)($v0) +/* 419114 802A4384 3C02802B */ lui $v0, %hi(BattleMenu_UsingSpiritsSubmenu) +/* 419118 802A4388 8C42D4A0 */ lw $v0, %lo(BattleMenu_UsingSpiritsSubmenu)($v0) /* 41911C 802A438C 14400005 */ bnez $v0, .L802A43A4 /* 419120 802A4390 00000000 */ nop /* 419124 802A4394 0C03A674 */ jal status_menu_stop_blinking_fp diff --git a/ver/us/asm/nonmatchings/415D90/func_802A5290.s b/ver/us/asm/nonmatchings/415D90/func_802A5290.s index bea3f8c273..e7a5790e69 100644 --- a/ver/us/asm/nonmatchings/415D90/func_802A5290.s +++ b/ver/us/asm/nonmatchings/415D90/func_802A5290.s @@ -9,8 +9,8 @@ dlabel jtbl_802ABAA8 .section .text glabel func_802A5290 -/* 41A020 802A5290 3C02802B */ lui $v0, %hi(D_802AD604) -/* 41A024 802A5294 9042D604 */ lbu $v0, %lo(D_802AD604)($v0) +/* 41A020 802A5290 3C02802B */ lui $v0, %hi(BattleSubmenuStratsState) +/* 41A024 802A5294 9042D604 */ lbu $v0, %lo(BattleSubmenuStratsState)($v0) /* 41A028 802A5298 27BDFFC0 */ addiu $sp, $sp, -0x40 /* 41A02C 802A529C AFB70034 */ sw $s7, 0x34($sp) /* 41A030 802A52A0 00A0B82D */ daddu $s7, $a1, $zero @@ -261,8 +261,8 @@ glabel func_802A5290 /* 41A3DC 802A564C 1840000C */ blez $v0, .L802A5680 /* 41A3E0 802A5650 26E50043 */ addiu $a1, $s7, 0x43 /* 41A3E4 802A5654 8FA90048 */ lw $t1, 0x48($sp) -/* 41A3E8 802A5658 3C10802B */ lui $s0, %hi(D_802AD61C) -/* 41A3EC 802A565C 8E10D61C */ lw $s0, %lo(D_802AD61C)($s0) +/* 41A3E8 802A5658 3C10802B */ lui $s0, %hi(GreenArrowUpID) +/* 41A3EC 802A565C 8E10D61C */ lw $s0, %lo(GreenArrowUpID)($s0) /* 41A3F0 802A5660 25260010 */ addiu $a2, $t1, 0x10 /* 41A3F4 802A5664 0C051261 */ jal hud_element_set_render_pos /* 41A3F8 802A5668 0200202D */ daddu $a0, $s0, $zero @@ -280,8 +280,8 @@ glabel func_802A5290 /* 41A424 802A5694 1040000C */ beqz $v0, .L802A56C8_41A458 /* 41A428 802A5698 26E50043 */ addiu $a1, $s7, 0x43 /* 41A42C 802A569C 8FA90048 */ lw $t1, 0x48($sp) -/* 41A430 802A56A0 3C10802B */ lui $s0, %hi(D_802AD620) -/* 41A434 802A56A4 8E10D620 */ lw $s0, %lo(D_802AD620)($s0) +/* 41A430 802A56A0 3C10802B */ lui $s0, %hi(GreenArrowDownID) +/* 41A434 802A56A4 8E10D620 */ lw $s0, %lo(GreenArrowDownID)($s0) /* 41A438 802A56A8 25260064 */ addiu $a2, $t1, 0x64 /* 41A43C 802A56AC 0C051261 */ jal hud_element_set_render_pos /* 41A440 802A56B0 0200202D */ daddu $a0, $s0, $zero diff --git a/ver/us/asm/nonmatchings/world/area_omo/omo_05/DB22C0/func_80242178_DB4438.s b/ver/us/asm/nonmatchings/world/area_omo/omo_05/DB22C0/func_80242178_DB4438.s deleted file mode 100644 index 0b17ccce62..0000000000 --- a/ver/us/asm/nonmatchings/world/area_omo/omo_05/DB22C0/func_80242178_DB4438.s +++ /dev/null @@ -1,28 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80242178_DB4438 -/* DB4438 80242178 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* DB443C 8024217C AFBF0010 */ sw $ra, 0x10($sp) -/* DB4440 80242180 10A00003 */ beqz $a1, .L80242190 -/* DB4444 80242184 8C86000C */ lw $a2, 0xc($a0) -/* DB4448 80242188 3C018024 */ lui $at, %hi(omo_05_ItemChoice_HasSelectedItem) -/* DB444C 8024218C AC203098 */ sw $zero, %lo(omo_05_ItemChoice_HasSelectedItem)($at) -.L80242190: -/* DB4450 80242190 3C038024 */ lui $v1, %hi(omo_05_ItemChoice_HasSelectedItem) -/* DB4454 80242194 24633098 */ addiu $v1, $v1, %lo(omo_05_ItemChoice_HasSelectedItem) -/* DB4458 80242198 8C620000 */ lw $v0, ($v1) -/* DB445C 8024219C 54400003 */ bnel $v0, $zero, .L802421AC -/* DB4460 802421A0 AC600000 */ sw $zero, ($v1) -/* DB4464 802421A4 08090870 */ j .L802421C0 -/* DB4468 802421A8 0000102D */ daddu $v0, $zero, $zero -.L802421AC: -/* DB446C 802421AC 8CC50000 */ lw $a1, ($a2) -/* DB4470 802421B0 3C068024 */ lui $a2, %hi(omo_05_ItemChoice_SelectedItemID) -/* DB4474 802421B4 0C0B2026 */ jal evt_set_variable -/* DB4478 802421B8 8CC6309C */ lw $a2, %lo(omo_05_ItemChoice_SelectedItemID)($a2) -/* DB447C 802421BC 24020002 */ addiu $v0, $zero, 2 -.L802421C0: -/* DB4480 802421C0 8FBF0010 */ lw $ra, 0x10($sp) -/* DB4484 802421C4 03E00008 */ jr $ra -/* DB4488 802421C8 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index abb8ecccd1..dd54143b24 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -14456,22 +14456,27 @@ segments: start: 0xDAD400 vram: 0x80240000 subsegments: - - [0xDAD400, c] - - [0xDAF240, c] - - [0xDAF320, data] - - [0xDAF3E0, data] - - [0xDB20A0] + - [0xDAD400, c, omo_04_0_header] + - [0xDAD400, c, omo_04_1_music] + - [0xDAD400, c, omo_04_2_main] + - [0xDAD400, c, omo_04_3_gizmos] + - [0xDAD400, c, omo_04_4_entity] + - [0xDAD7A0, c, omo_04_5_npc] + - [0xDAF240, c, omo_04_6_scenes] + - [0xDAF320] - name: omo_05 dir: world/area_omo/omo_05 type: code start: 0xDB22C0 vram: 0x80240000 subsegments: - - [0xDB22C0, c] - - [0xDB46C0, data] - - [0xDB4770, data] - - [0xDB7410, data] - - [0xDB7560] + - [0xDB22C0, c, omo_05_0_header] + - [0xDB22C0, c, omo_05_1_music] + - [0xDB22C0, c, omo_05_2_main] + - [0xDB22C0, c, omo_05_3_gizmos] + - [0xDB22C0, c, omo_05_4_npc] + - [0xDB46C0, c, omo_05_5_entity] + - [0xDB46C0] - name: omo_06 dir: world/area_omo/omo_06 type: code @@ -14491,16 +14496,14 @@ segments: start: 0xDBD2B0 vram: 0x80240000 subsegments: - - [0xDBD2B0, c] - - [0xDC01D0, c] - - [0xDC04D0, c] - - [0xDC05B0, data] - - [0xDC0670, data] - - [0xDC0910, data] - - [0xDC0B80, data] - - [0xDC30B0, data] - - [0xDC3730, data] - - [0xDC3E70] + - [0xDBD2B0, c, omo_07_0_header] + - [0xDBD2B0, c, omo_07_1_music] + - [0xDBD2B0, c, omo_07_2_main] + - [0xDBD2B0, c, omo_07_3_gizmos] + - [0xDBD2B0, c, omo_07_4_npc] + - [0xDC01D0, c, omo_07_5_entity] + - [0xDC04D0, c, omo_07_6_scenes] + - [0xDC05B0] - name: omo_08 dir: world/area_omo/omo_08 type: code diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index d869b9d2c7..df16cb4434 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -410,8 +410,8 @@ SetEnemyFlagBits = 0x80045688; // type:func rom:0x20A88 func_8004572C = 0x8004572C; // type:func rom:0x20B2C GetSelfAnimationFromTable = 0x80045734; // type:func rom:0x20B34 func_80045798 = 0x80045798; // type:func rom:0x20B98 -func_800457C4 = 0x800457C4; // type:func rom:0x20BC4 -func_800457F8 = 0x800457F8; // type:func rom:0x20BF8 +SetOwnerInstigatorValue = 0x800457C4; // type:func rom:0x20BC4 +SetBattleAsScripted = 0x800457F8; // type:func rom:0x20BF8 GetEncounterTriggerHitTier = 0x8004580C; // type:func rom:0x20C0C func_80045838 = 0x80045838; // type:func rom:0x20C38 func_800458CC = 0x800458CC; // type:func rom:0x20CCC @@ -1306,7 +1306,7 @@ gGameStatusPtr = 0x8007419C; // rom:0x4F59C D_800741A0 = 0x800741A0; // type:data rom:0x4F5A0 D_800741A2 = 0x800741A2; // type:data rom:0x4F5A2 D_800741A4 = 0x800741A4; // type:data rom:0x4F5A4 -D_800741A8 = 0x800741A8; // type:data rom:0x4F5A8 +MasterIdentityMtx = 0x800741A8; // type:data rom:0x4F5A8 gMatrixListPos = 0x800741F0; // rom:0x4F5F0 D_800741F2 = 0x800741F2; // type:data rom:0x4F5F2 gCurrentDisplayContextIndex = 0x800741F4; // rom:0x4F5F4 @@ -4158,7 +4158,7 @@ init_entity_models = 0x80120C58; // type:func rom:0xB7358 load_entity_model = 0x80120CE0; // type:func rom:0xB73E0 nuContDataMutexQ = 0x800DC040; // type:data rom:0xB7440 D_800DC060 = 0x800DC060; // type:data rom:0xB7460 -D_800DC064 = 0x800DC064; // type:data rom:0xB7464 +gCurrentStagePtr = 0x800DC064; // type:data rom:0xB7464 gBattleState = 0x800DC068; // rom:0xB7468 D_800DC06C = 0x800DC06C; // type:data rom:0xB746C gBattleStatus = 0x800DC070; // rom:0xB7470 size:0x460 @@ -4167,18 +4167,18 @@ exec_entity_model_commandlist = 0x80120F04; // type:func rom:0xB7604 step_entity_model_commandlist = 0x80120FB8; // type:func rom:0xB76B8 make_entity_model_mtx_flipZ = 0x80121140; // type:func rom:0xB7840 appendGfx_entity_model = 0x80121184; // type:func rom:0xB7884 -D_800DC4D0 = 0x800DC4D0; // type:data rom:0xB78D0 +gLastDrawBattleState = 0x800DC4D0; // type:data rom:0xB78D0 D_800DC4D4 = 0x800DC4D4; // type:data rom:0xB78D4 gDefeatedBattleSubstate = 0x800DC4D8; // type:data rom:0xB78D8 gBattleSubState = 0x800DC4DC; // type:data rom:0xB78DC D_800DC4E0 = 0x800DC4E0; // type:data rom:0xB78E0 gDefeatedBattleState = 0x800DC4E4; // type:data rom:0xB78E4 gCurrentBattleID = 0x800DC4E8; // type:data rom:0xB78E8 -D_800DC4EC = 0x800DC4EC; // type:data rom:0xB78EC +gCurrentStageID = 0x800DC4EC; // type:data rom:0xB78EC D_800DC4F0 = 0x800DC4F0; // type:data rom:0xB78F0 -D_800DC4F4 = 0x800DC4F4; // type:data rom:0xB78F4 +gOverrideBattlePtr = 0x800DC4F4; // type:data rom:0xB78F4 D_800DC4F8 = 0x800DC4F8; // type:data rom:0xB78F8 -D_800DC4FC = 0x800DC4FC; // type:data rom:0xB78FC +gCurrentBattlePtr = 0x800DC4FC; // type:data rom:0xB78FC D_8009A5A8 = 0x8009A5A8; // type:data rom:0xB7900 draw_entity_model_A = 0x80121CE8; // type:func rom:0xB83E8 draw_entity_model_B = 0x80121EB8; // type:func rom:0xB85B8 @@ -6797,7 +6797,7 @@ IsPartnerImmobile = 0x80260AD4; // type:func rom:0x18F3B4 activate_defend_command = 0x80260B04; // type:func rom:0x18F3E4 func_80260B70 = 0x80260B70; // type:func rom:0x18F450 ChoosePlayerCelebrationAnim = 0x80260BF4; // type:func rom:0x18F4D4 -func_80260DB8 = 0x80260DB8; // type:func rom:0x18F698 +SetFledBattleFlag = 0x80260DB8; // type:func rom:0x18F698 func_80260DD8 = 0x80260DD8; // type:func rom:0x18F6B8 func_80260E38 = 0x80260E38; // type:func rom:0x18F718 func_80260E5C = 0x80260E5C; // type:func rom:0x18F73C @@ -6808,7 +6808,7 @@ func_80261164 = 0x80261164; // type:func rom:0x18FA44 ConsumeLifeShroom = 0x802611E8; // type:func rom:0x18FAC8 RestorePreDefeatState = 0x8026127C; // type:func rom:0x18FB5C func_80261388 = 0x80261388; // type:func rom:0x18FC68 -func_802613A8 = 0x802613A8; // type:func rom:0x18FC88 +SetItemAsLifeShroom = 0x802613A8; // type:func rom:0x18FC88 PlayBattleMerleeGatherFX = 0x802613BC; // type:func rom:0x18FC9C PlayBattleMerleeOrbFX = 0x80261478; // type:func rom:0x18FD58 BattleMerleeFadeStageToBlack = 0x80261530; // type:func rom:0x18FE10 @@ -7059,8 +7059,8 @@ SetOwnerID = 0x8026DE28; // type:func rom:0x19C708 ActorExists = 0x8026DE5C; // type:func rom:0x19C73C func_8026DEF0 = 0x8026DEF0; // type:func rom:0x19C7D0 func_8026DF88 = 0x8026DF88; // type:func rom:0x19C868 -func_8026E020 = 0x8026E020; // type:func rom:0x19C900 -func_8026E038 = 0x8026E038; // type:func rom:0x19C918 +SetBattleMenuDisableFlags = 0x8026E020; // type:func rom:0x19C900 +SetEnabledStarPowers = 0x8026E038; // type:func rom:0x19C918 SetBattleInputMask = 0x8026E050; // type:func rom:0x19C930 SetBattleInputButtons = 0x8026E068; // type:func rom:0x19C948 CheckButtonPress = 0x8026E098; // type:func rom:0x19C978 @@ -7207,7 +7207,7 @@ func_8027D4C8 = 0x8027D4C8; // type:func rom:0x1ABDA8 EnableActorBlur = 0x8027D57C; // type:func rom:0x1ABE5C func_8027D628 = 0x8027D628; // type:func rom:0x1ABF08 AfflictActor = 0x8027D67C; // type:func rom:0x1ABF5C -func_8027D75C = 0x8027D75C; // type:func rom:0x1AC03C +GetInstigatorValue = 0x8027D75C; // type:func rom:0x1AC03C GetEncounterState = 0x8027D7C4; // type:func rom:0x1AC0A4 YieldTurn = 0x8027D7F0; // type:func rom:0x1AC0D0 SetActorSize = 0x8027D810; // type:func rom:0x1AC0F0 @@ -7248,7 +7248,7 @@ D_802809F6 = 0x802809F6; // type:data rom:0x1AF2D6 D_802809F8 = 0x802809F8; // type:data rom:0x1AF2D8 gTattleBgTextureYOffset = 0x802809FA; // type:data rom:0x1AF2DA bHPDigitHudScripts = 0x802809FC; // type:data rom:0x1AF2DC -D_80280A30 = 0x80280A30; // type:data rom:0x1AF310 +BattleScreenFadeAmt = 0x80280A30; // type:data rom:0x1AF310 BtlPutPartnerAway = 0x80280A34; // rom:0x1AF314 BtlBringPartnerOut = 0x80280B6C; // rom:0x1AF44C BattleCam_IsFrozen = 0x80280CE0; // type:data rom:0x1AF5C0 @@ -7267,7 +7267,7 @@ CamPreset_J = 0x80280E00; // type:data rom:0x1AF6E0 CamPreset_K = 0x80280E1C; // type:data rom:0x1AF6FC CamPreset_L = 0x80280E38; // type:data rom:0x1AF718 CamPreset_A = 0x80280E54; // type:data rom:0x1AF734 -D_80280EB8 = 0x80280EB8; // type:data rom:0x1AF798 +EVS_OnBattleInit = 0x80280EB8; // type:data rom:0x1AF798 D_80280FC0 = 0x80280FC0; // type:data rom:0x1AF8A0 bActorNames = 0x80281104; // type:data rom:0x1AF9E4 D_80281454 = 0x80281454; // type:data rom:0x1AFD34 @@ -9079,21 +9079,21 @@ fx_86_render = 0xE0128198; // type:func rom:0x414D38 fx_86_appendGfx = 0xE01281E0; // type:func rom:0x414D80 D_E0128480 = 0xE0128480; // type:data rom:0x415020 D_E01284B0 = 0xE01284B0; // type:data rom:0x415050 -func_802A1000 = 0x802A1000; // type:func rom:0x415D90 +btl_main_menu_init = 0x802A1000; // type:func rom:0x415D90 func_802A1030 = 0x802A1030; // type:func rom:0x415DC0 func_802A1050 = 0x802A1050; // type:func rom:0x415DE0 func_802A1078 = 0x802A1078; // type:func rom:0x415E08 func_802A1098 = 0x802A1098; // type:func rom:0x415E28 -func_802A10B8 = 0x802A10B8; // type:func rom:0x415E48 -func_802A11B0 = 0x802A11B0; // type:func rom:0x415F40 -btl_draw_menu_wheel = 0x802A1C54; // type:func rom:0x4169E4 +btl_main_menu_destroy = 0x802A10B8; // type:func rom:0x415E48 +btl_main_menu_update = 0x802A11B0; // type:func rom:0x415F40 +btl_main_menu_draw = 0x802A1C54; // type:func rom:0x4169E4 func_802A2684 = 0x802A2684; // type:func rom:0x417414 func_802A27D0 = 0x802A27D0; // type:func rom:0x417560 func_802A27E4 = 0x802A27E4; // type:func rom:0x417574 func_802A2910 = 0x802A2910; // type:func rom:0x4176A0 func_802A2AB8 = 0x802A2AB8; // type:func rom:0x417848 func_802A2C58 = 0x802A2C58; // type:func rom:0x4179E8 -func_802A2C84 = 0x802A2C84; // type:func rom:0x417A14 +btl_submenu_moves_update = 0x802A2C84; // type:func rom:0x417A14 func_802A3C98 = 0x802A3C98; // type:func rom:0x418A28 func_802A43DC = 0x802A43DC; // type:func rom:0x41916C func_802A4448 = 0x802A4448; // type:func rom:0x4191D8 @@ -9116,10 +9116,10 @@ btl_state_update_player_menu = 0x802A5988; // type:func rom:0x41A718 btl_state_draw_player_menu = 0x802A8180; // type:func rom:0x41CF10 btl_state_update_partner_menu = 0x802A81C8; // type:func rom:0x41CF58 btl_state_draw_partner_menu = 0x802A9AE8; // type:func rom:0x41E878 -func_802A9B30 = 0x802A9B30; // type:func rom:0x41E8C0 +btl_menu_show_switch_to_twink = 0x802A9B30; // type:func rom:0x41E8C0 btl_state_update_peach_menu = 0x802A9B44; // type:func rom:0x41E8D4 btl_state_draw_peach_menu = 0x802AA05C; // type:func rom:0x41EDEC -func_802AA0A4 = 0x802AA0A4; // type:func rom:0x41EE34 +btl_menu_show_switch_to_peach = 0x802AA0A4; // type:func rom:0x41EE34 btl_state_update_twink_menu = 0x802AA0B8; // type:func rom:0x41EE48 btl_state_draw_twink_menu = 0x802AA640; // type:func rom:0x41F3D0 btl_state_update_select_target = 0x802AA688; // type:func rom:0x41F418 @@ -9138,22 +9138,17 @@ battle_menu_DisabledPartnerHudScripts = 0x802AB438; // type:data rom:0x4201C8 battle_menu_StrategiesHudScript = 0x802AB478; // type:data rom:0x420208 battle_menu_DoNothingHudScripts = 0x802AB480; // type:data rom:0x420210 battle_menu_FleeHudScripts = 0x802AB488; // type:data rom:0x420218 -battle_menu_leftJustfiedMessagesA = 0x802AB490; // type:data rom:0x420220 -battle_menu_leftJustfiedMessagesB = 0x802AB4A4; // type:data rom:0x420234 -battle_menu_leftJustfiedMessagesC = 0x802AB4B4; // type:data rom:0x420244 -battle_menu_centeredMessagesA = 0x802AB4C0; // type:data rom:0x420250 -battle_menu_centeredMessagesB = 0x802AB4C8; // type:data rom:0x420258 -battle_menu_centeredMessagesC = 0x802AB4DC; // type:data rom:0x42026C -battle_menu_centeredMessagesD = 0x802AB4E0; // type:data rom:0x420270 +BattleMenu_LeftJustMessages = 0x802AB490; // type:data rom:0x420220 +BattleMenu_CenteredMessages = 0x802AB4C0; // type:data rom:0x420250 D_802AB4F0 = 0x802AB4F0; // type:data rom:0x420280 -battle_menu_partnerChooseMoveAnimations = 0x802AB520; // type:data rom:0x4202B0 -D_802AB558 = 0x802AB558; // type:data rom:0x4202E8 +BattleMenu_PartnerThinkAnims = 0x802AB520; // type:data rom:0x4202B0 +BattleMenu_PartnerIdleAnims = 0x802AB558; // type:data rom:0x4202E8 battle_menu_PartnerMoveHudScripts = 0x802AB590; // type:data rom:0x420320 battle_menu_PeachStarPowerHudScripts = 0x802AB720; // type:data rom:0x4204B0 D_802AB728 = 0x802AB728; // type:data rom:0x4204B8 battle_menu_TwinkStarPowerHudScripts = 0x802AB72C; // type:data rom:0x4204BC D_802AB734 = 0x802AB734; // type:data rom:0x4204C4 -D_802AB738 = 0x802AB738; // type:data rom:0x4204C8 +PartnerNameMessages = 0x802AB738; // type:data rom:0x4204C8 D_802AB7F0 = 0x802AB7F0; // type:data rom:0x420580 D_802AB7F8 = 0x802AB7F8; // type:data rom:0x420588 D_802AB800 = 0x802AB800; // type:data rom:0x420590 @@ -16659,7 +16654,7 @@ iwa_11_GetLargeWheelAngle = 0x80240208; // type:func rom:0x926BF8 iwa_11_GetSectionPosOffsets = 0x80240280; // type:func rom:0x926C70 D_80242148_928B38 = 0x80242148; // type:data rom:0x928B38 sbk_00_SpawnSunEffect = 0x80240000; // type:func rom:0x929270 -sbk_00_SetNpcB5_3 = 0x80240040; // type:func rom:0x9292B0 +sbk_00_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x9292B0 sbk_00_entryList = 0x80240060; // type:data rom:0x9292D0 sbk_00_settings = 0x802400A0; // type:data rom:0x929310 sbk_00_exitWalk_802400E0 = 0x802400E0; // type:data rom:0x929350 @@ -16674,7 +16669,7 @@ sbk_00_npcGroup_80240578 = 0x80240578; // type:data rom:0x9297E8 sbk_00_npcGroupList_80240768 = 0x80240768; // type:data rom:0x9299D8 sbk_00_makeEntities = 0x80240790; // type:data rom:0x929A00 sbk_01_SpawnSunEffect = 0x80240000; // type:func rom:0x929A90 -sbk_01_SetNpcB5_3 = 0x80240040; // type:func rom:0x929AD0 +sbk_01_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x929AD0 sbk_01_entryList = 0x80240060; // type:data rom:0x929AF0 sbk_01_settings = 0x802400A0; // type:data rom:0x929B30 sbk_01_exitWalk_802400E0 = 0x802400E0; // type:data rom:0x929B70 @@ -16707,11 +16702,11 @@ D_8024404C_92E2FC = 0x8024404C; // type:data rom:0x92E2FC D_80244050_92E300 = 0x80244050; // type:data rom:0x92E300 sbk_02_varStash = 0x802441D8; // type:data rom:0x92E488 sbk_03_SpawnSunEffect = 0x80240000; // type:func rom:0x92F8B0 -sbk_03_SetNpcB5_3 = 0x80240040; // type:func rom:0x92F8F0 +sbk_03_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x92F8F0 sbk_04_SpawnSunEffect = 0x80240000; // type:func rom:0x9304D0 -sbk_04_SetNpcB5_3 = 0x80240040; // type:func rom:0x930510 +sbk_04_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x930510 sbk_05_SpawnSunEffect = 0x80240000; // type:func rom:0x930CF0 -sbk_05_SetNpcB5_3 = 0x80240040; // type:func rom:0x930D30 +sbk_05_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x930D30 sbk_06_SpawnSunEffect = 0x80240000; // type:func rom:0x9325C0 sbk_06_Bandit_DropCoin = 0x80240040; // type:func rom:0x932600 sbk_06_foliage_setup_shear_mtx = 0x80240140; // type:func rom:0x932700 @@ -16719,15 +16714,15 @@ sbk_06_TransformFoliage = 0x802401B0; // type:func rom:0x932770 sbk_10_SpawnSunEffect = 0x80240000; // type:func rom:0x933C80 sbk_11_SpawnSunEffect = 0x80240000; // type:func rom:0x934040 sbk_11_Bandit_DropCoin = 0x80240040; // type:func rom:0x934080 -sbk_11_SetNpcB5_3 = 0x80240140; // type:func rom:0x934180 +sbk_11_SetInstigatorValue_3 = 0x80240140; // type:func rom:0x934180 sbk_12_SpawnSunEffect = 0x80240000; // type:func rom:0x934D40 -sbk_12_SetNpcB5_3 = 0x80240040; // type:func rom:0x934D80 +sbk_12_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x934D80 sbk_13_SpawnSunEffect = 0x80240000; // type:func rom:0x9357E0 sbk_13_Bandit_DropCoin = 0x80240040; // type:func rom:0x935820 -sbk_13_SetNpcB5_3 = 0x80240140; // type:func rom:0x935920 +sbk_13_SetInstigatorValue_3 = 0x80240140; // type:func rom:0x935920 sbk_14_SpawnSunEffect = 0x80240000; // type:func rom:0x9366E0 sbk_15_SpawnSunEffect = 0x80240000; // type:func rom:0x936CD0 -sbk_15_SetNpcB5_3 = 0x80240040; // type:func rom:0x936D10 +sbk_15_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x936D10 sbk_16_SpawnSunEffect = 0x80240000; // type:func rom:0x937570 sbk_16_foliage_setup_shear_mtx = 0x80240040; // type:func rom:0x9375B0 sbk_16_TransformFoliage = 0x802400B0; // type:func rom:0x937620 @@ -16736,7 +16731,7 @@ sbk_20_Bandit_DropCoin = 0x80240040; // type:func rom:0x9385D0 sbk_21_SpawnSunEffect = 0x80240000; // type:func rom:0x939560 sbk_22_SpawnSunEffect = 0x80240000; // type:func rom:0x939930 sbk_22_Bandit_DropCoin = 0x80240040; // type:func rom:0x939970 -sbk_22_SetNpcB5_3 = 0x80240140; // type:func rom:0x939A70 +sbk_22_SetInstigatorValue_3 = 0x80240140; // type:func rom:0x939A70 sbk_23_SpawnSunEffect = 0x80240000; // type:func rom:0x93A760 sbk_24_SpawnSunEffect = 0x80240000; // type:func rom:0x93AC30 sbk_24_Bandit_DropCoin = 0x80240040; // type:func rom:0x93AC70 @@ -16748,7 +16743,7 @@ sbk_25_foliage_setup_shear_mtx = 0x80240140; // type:func rom:0x93C3C0 sbk_25_TransformFoliage = 0x802401B0; // type:func rom:0x93C430 sbk_26_SpawnSunEffect = 0x80240000; // type:func rom:0x93DCD0 sbk_26_Bandit_DropCoin = 0x80240040; // type:func rom:0x93DD10 -sbk_26_SetNpcB5_3 = 0x80240140; // type:func rom:0x93DE10 +sbk_26_SetInstigatorValue_3 = 0x80240140; // type:func rom:0x93DE10 sbk_26_foliage_setup_shear_mtx = 0x80240160; // type:func rom:0x93DE30 sbk_26_TransformFoliage = 0x802401D0; // type:func rom:0x93DEA0 sbk_30_get_tattle = 0x80240000; // type:func rom:0x93F5B0 @@ -16789,7 +16784,7 @@ sbk_31_SpawnSunEffect = 0x80240000; // type:func rom:0x944000 sbk_31_Bandit_DropCoin = 0x80240040; // type:func rom:0x944040 sbk_32_SpawnSunEffect = 0x80240000; // type:func rom:0x944A60 sbk_32_Bandit_DropCoin = 0x80240040; // type:func rom:0x944AA0 -sbk_32_SetNpcB5_3 = 0x80240140; // type:func rom:0x944BA0 +sbk_32_SetInstigatorValue_3 = 0x80240140; // type:func rom:0x944BA0 sbk_33_SpawnSunEffect = 0x80240000; // type:func rom:0x9459D0 sbk_34_SpawnSunEffect = 0x80240000; // type:func rom:0x945ED0 sbk_34_StashVars = 0x80240040; // type:func rom:0x945F10 @@ -16823,23 +16818,23 @@ sbk_42_Bandit_DropCoin = 0x80240040; // type:func rom:0x94C550 sbk_43_SpawnSunEffect = 0x80240000; // type:func rom:0x94D170 sbk_44_SpawnSunEffect = 0x80240000; // type:func rom:0x94D5A0 sbk_44_Bandit_DropCoin = 0x80240040; // type:func rom:0x94D5E0 -sbk_44_SetNpcB5_3 = 0x80240140; // type:func rom:0x94D6E0 +sbk_44_SetInstigatorValue_3 = 0x80240140; // type:func rom:0x94D6E0 sbk_45_SpawnSunEffect = 0x80240000; // type:func rom:0x94E4A0 sbk_46_SpawnSunEffect = 0x80240000; // type:func rom:0x94E9A0 sbk_46_Bandit_DropCoin = 0x80240040; // type:func rom:0x94E9E0 -sbk_46_SetNpcB5_3 = 0x80240140; // type:func rom:0x94EAE0 +sbk_46_SetInstigatorValue_3 = 0x80240140; // type:func rom:0x94EAE0 sbk_46_foliage_setup_shear_mtx = 0x80240160; // type:func rom:0x94EB00 sbk_46_TransformFoliage = 0x802401D0; // type:func rom:0x94EB70 sbk_50_SpawnSunEffect = 0x80240000; // type:func rom:0x950610 sbk_51_SpawnSunEffect = 0x80240000; // type:func rom:0x950970 sbk_51_Bandit_DropCoin = 0x80240040; // type:func rom:0x9509B0 -sbk_51_SetNpcB5_3 = 0x80240140; // type:func rom:0x950AB0 +sbk_51_SetInstigatorValue_3 = 0x80240140; // type:func rom:0x950AB0 sbk_52_SpawnSunEffect = 0x80240000; // type:func rom:0x951670 sbk_53_SpawnSunEffect = 0x80240000; // type:func rom:0x951AE0 -sbk_53_SetNpcB5_3 = 0x80240040; // type:func rom:0x951B20 +sbk_53_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x951B20 sbk_54_SpawnSunEffect = 0x80240000; // type:func rom:0x952580 sbk_55_SpawnSunEffect = 0x80240000; // type:func rom:0x952A50 -sbk_55_SetNpcB5_3 = 0x80240040; // type:func rom:0x952A90 +sbk_55_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x952A90 sbk_55_foliage_setup_shear_mtx = 0x80240060; // type:func rom:0x952AB0 sbk_55_TransformFoliage = 0x802400D0; // type:func rom:0x952B20 sbk_56_SpawnSunEffect = 0x80240000; // type:func rom:0x953FC0 @@ -16870,12 +16865,12 @@ sbk_56_SuperBlock_PartnerIDs = 0x80241438; // type:data rom:0x9553F8 sbk_56_SuperBlock_UpgradeDescMessages = 0x80241448; // type:data rom:0x955408 sbk_56_SuperBlock_UpgradeOrbAngles = 0x80241488; // type:data rom:0x955448 sbk_60_SpawnSunEffect = 0x80240000; // type:func rom:0x9569F0 -sbk_60_SetNpcB5_3 = 0x80240040; // type:func rom:0x956A30 +sbk_60_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x956A30 sbk_61_SpawnSunEffect = 0x80240000; // type:func rom:0x956F90 sbk_62_SpawnSunEffect = 0x80240000; // type:func rom:0x957350 -sbk_62_SetNpcB5_3 = 0x80240040; // type:func rom:0x957390 +sbk_62_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x957390 sbk_63_SpawnSunEffect = 0x80240000; // type:func rom:0x957D70 -sbk_63_SetNpcB5_3 = 0x80240040; // type:func rom:0x957DB0 +sbk_63_SetInstigatorValue_3 = 0x80240040; // type:func rom:0x957DB0 sbk_64_SpawnSunEffect = 0x80240000; // type:func rom:0x958590 sbk_65_SpawnSunEffect = 0x80240000; // type:func rom:0x958950 sbk_66_SpawnSunEffect = 0x80240000; // type:func rom:0x958CB0 @@ -17314,7 +17309,7 @@ D_8024EF70_978130 = 0x8024EF70; // type:data rom:0x978130 D_8024EF78_978138 = 0x8024EF78; // type:data rom:0x978138 isk_02_RemovePadlock = 0x80240000; // type:func rom:0x978710 isk_02_AwaitPlayerMummyAmbush = 0x80240040; // type:func rom:0x978750 -isk_02_SetNpcB5_3 = 0x802400F0; // type:func rom:0x978800 +isk_02_SetInstigatorValue_3 = 0x802400F0; // type:func rom:0x978800 isk_04_RemovePadlock = 0x80240000; // type:func rom:0x97B630 isk_04_set_script_owner_npc_anim = 0x80240040; // type:func rom:0x97B670 isk_04_UnkDistFunc = 0x802400BC; // type:func rom:0x97B6EC @@ -17355,7 +17350,7 @@ D_8024264C_98011C = 0x8024264C; // type:data rom:0x98011C D_80242EB0_980980 = 0x80242EB0; // type:data rom:0x980980 D_80242F38_980A08 = 0x80242F38; // type:data rom:0x980A08 D_80242F40_980A10 = 0x80242F40; // type:data rom:0x980A10 -isk_07_SetNpcB5_3 = 0x80240000; // type:func rom:0x982440 +isk_07_SetInstigatorValue_3 = 0x80240000; // type:func rom:0x982440 isk_07_IsLastEnemy = 0x80240014; // type:func rom:0x982454 isk_07_RemovePadlock = 0x802400B0; // type:func rom:0x9824F0 isk_07_WaitForPlayerTouchingGround = 0x802400F0; // type:func rom:0x982530 @@ -24558,7 +24553,7 @@ omo_02_ProjectileHitbox_33 = 0x80241E60; // type:func rom:0xD9F330 omo_02_ProjectileAI_Main = 0x80241EA4; // type:func rom:0xD9F374 omo_02_ProjectileAI_Reflect = 0x802423E0; // type:func rom:0xD9F8B0 omo_02_RangedAttackAI_Main = 0x8024283C; // type:func rom:0xD9FD0C -omo_02_SetNpcB5_3 = 0x80242B5C; // type:func rom:0xDA002C +omo_02_SetInstigatorValue_3 = 0x80242B5C; // type:func rom:0xDA002C omo_02_GetEncounterEnemyIsOwner = 0x80242B70; // type:func rom:0xDA0040 D_802434F8_DA09C8 = 0x802434F8; // type:data rom:0xDA09C8 D_80243580_DA0A50 = 0x80243580; // type:data rom:0xDA0A50 @@ -24639,12 +24634,12 @@ omo_05_FlyingAI_Init = 0x80241C3C; // type:func rom:0xDB3EFC omo_05_FlyingAI_Main = 0x80241D60; // type:func rom:0xDB4020 omo_05_GetNpcCollisionHeight = 0x80241F4C; // type:func rom:0xDB420C omo_05_AddPlayerHandsOffset = 0x80241FA8; // type:func rom:0xDB4268 -func_80242178_DB4438 = 0x80242178; // type:func rom:0xDB4438 -func_802421CC_DB448C = 0x802421CC; // type:func rom:0xDB448C -func_80242204_DB44C4 = 0x80242204; // type:func rom:0xDB44C4 -func_802422A0_DB4560 = 0x802422A0; // type:func rom:0xDB4560 -func_80242328_DB45E8 = 0x80242328; // type:func rom:0xDB45E8 -func_802423C8_DB4688 = 0x802423C8; // type:func rom:0xDB4688 +omo_05_func_80242178_DB4438 = 0x80242178; // type:func rom:0xDB4438 +omo_05_func_802421CC_DB448C = 0x802421CC; // type:func rom:0xDB448C +omo_05_func_80242204_DB44C4 = 0x80242204; // type:func rom:0xDB44C4 +omo_05_func_802422A0_DB4560 = 0x802422A0; // type:func rom:0xDB4560 +omo_05_func_80242328_DB45E8 = 0x80242328; // type:func rom:0xDB45E8 +omo_05_MakeAllConsumablesItemList = 0x802423C8; // type:func rom:0xDB4688 omo_05_FlyingAI_JumpVels = 0x80242F88; // type:data rom:0xDB5248 omo_05_ItemChoice_HasSelectedItem = 0x80243098; // type:data rom:0xDB5358 omo_05_ItemChoice_SelectedItemID = 0x8024309C; // type:data rom:0xDB535C @@ -24706,7 +24701,7 @@ omo_07_FlyingAI_Init = 0x80242B60; // type:func rom:0xDBFE10 omo_07_FlyingAI_Main = 0x80242C84; // type:func rom:0xDBFF34 omo_07_SetCamera0Flag1000 = 0x80242E70; // type:func rom:0xDC0120 omo_07_UnsetCamera0Flag1000 = 0x80242E8C; // type:func rom:0xDC013C -func_80242EA8_DC0158 = 0x80242EA8; // type:func rom:0xDC0158 +omo_07_SetShyGuyPoolState = 0x80242EA8; // type:func rom:0xDC0158 omo_07_StashVars = 0x80242F20; // type:func rom:0xDC01D0 omo_07_GetItemName = 0x80242FD4; // type:func rom:0xDC0284 omo_07_SomeItemEntityFunc = 0x80243038; // type:func rom:0xDC02E8 @@ -24783,9 +24778,9 @@ omo_09_ProjectileHitbox_33 = 0x80242870; // type:func rom:0xDCF540 omo_09_ProjectileAI_Main = 0x802428B4; // type:func rom:0xDCF584 omo_09_ProjectileAI_Reflect = 0x80242DF0; // type:func rom:0xDCFAC0 omo_09_RangedAttackAI_Main = 0x8024324C; // type:func rom:0xDCFF1C -omo_09_SetNpcB5_3 = 0x8024356C; // type:func rom:0xDD023C +omo_09_SetInstigatorValue_3 = 0x8024356C; // type:func rom:0xDD023C omo_09_GetEncounterEnemyIsOwner = 0x80243580; // type:func rom:0xDD0250 -dup_omo_09_SetNpcB5_3 = 0x802435B8; // type:func rom:0xDD0288 +dup_omo_09_SetInstigatorValue_3 = 0x802435B8; // type:func rom:0xDD0288 omo_09_SetCamera0Flag1000 = 0x802435CC; // type:func rom:0xDD029C omo_09_UnsetCamera0Flag1000 = 0x802435E8; // type:func rom:0xDD02B8 omo_09_GetKammyBroomEmitterPos = 0x80243610; // type:func rom:0xDD02E0 @@ -24933,7 +24928,7 @@ omo_17_ProjectileHitbox_33 = 0x802429C4; // type:func rom:0xDF1864 omo_17_ProjectileAI_Main = 0x80242A08; // type:func rom:0xDF18A8 omo_17_ProjectileAI_Reflect = 0x80242F44; // type:func rom:0xDF1DE4 omo_17_RangedAttackAI_Main = 0x802433A0; // type:func rom:0xDF2240 -omo_17_SetNpcB5_3 = 0x802436C0; // type:func rom:0xDF2560 +omo_17_SetInstigatorValue_3 = 0x802436C0; // type:func rom:0xDF2560 omo_17_GetEncounterEnemyIsOwner = 0x802436D4; // type:func rom:0xDF2574 omo_17_FlyingAI_JumpVels = 0x80246184; // type:data rom:0xDF5024 D_80247610_DF64B0 = 0x80247610; // type:data rom:0xDF64B0 @@ -26795,15 +26790,15 @@ D_8029EFC0 = 0x8029EFC0; // type:data D_8029EFE8 = 0x8029EFE8; // type:data D_8029F010 = 0x8029F010; // type:data gTattleBgPalette = 0x8029F038; // type:data -D_8029F240 = 0x8029F240; // type:data +BattleEnemiesCreated = 0x8029F240; // type:data D_8029F244 = 0x8029F244; // type:data D_8029F248 = 0x8029F248; // type:data D_8029F24C = 0x8029F24C; // type:data -D_8029F250 = 0x8029F250; // type:data +RunAwayRewardStep = 0x8029F250; // type:data D_8029F254 = 0x8029F254; // type:data D_8029F258 = 0x8029F258; // type:data -D_8029F25C = 0x8029F25C; // type:data -D_8029F260 = 0x8029F260; // type:data +RunAwayRewardTotal = 0x8029F25C; // type:data +RunAwayRewardIncrement = 0x8029F260; // type:data D_8029F264 = 0x8029F264; // type:data BattleCam_PosX = 0x8029F270; // type:data BattleCam_PosY = 0x8029F274; // type:data @@ -26849,10 +26844,10 @@ gSpeakingActorTalkAnim = 0x8029FA6C; // gSpeakingActorIdleAnim = 0x8029FA70; // gSpeakingActor = 0x8029FA74; // gSpeakingActorPart = 0x8029FA78; // -LevelUpStatEmblemHEIDs = 0x8029FA80; // type:data -LevelUpStatTextHEIDs = 0x8029FA90; // type:data +LevelUpStatEmblemIDs = 0x8029FA80; // type:data +LevelUpStatTextIDs = 0x8029FA90; // type:data D_8029FAE8 = 0x8029FAE8; // type:data -LevelUpSelectTextHEID = 0x8029FB48; // type:data +LevelUpSelectTextID = 0x8029FB48; // type:data CelebrateSubstateTime = 0x8029FB4C; // type:data D_8029FB50 = 0x8029FB50; // type:data EndBattleRewardStep = 0x8029FB54; // type:data @@ -26960,13 +26955,13 @@ D_802ACFF0 = 0x802ACFF0; // type:data D_802ACFF4 = 0x802ACFF4; // type:data D_802ACFFC = 0x802ACFFC; // type:data D_802ACFFD = 0x802ACFFD; // type:data -D_802AD000 = 0x802AD000; // type:data +BattleMenuState = 0x802AD000; // type:data D_802AD001 = 0x802AD001; // type:data -D_802AD002 = 0x802AD002; // type:data -D_802AD003 = 0x802AD003; // type:data +BattleMenu_CurPos = 0x802AD002; // type:data +BattleMenu_PrevPos = 0x802AD003; // type:data D_802AD004 = 0x802AD004; // type:data D_802AD006 = 0x802AD006; // type:data -D_802AD008 = 0x802AD008; // type:data +BattleMenuAlpha = 0x802AD008; // type:data D_802AD00A = 0x802AD00A; // type:data D_802AD010 = 0x802AD010; // type:data D_802AD028 = 0x802AD028; // type:data @@ -26978,25 +26973,25 @@ D_802AD050 = 0x802AD050; // type:data D_802AD054 = 0x802AD054; // type:data D_802AD058 = 0x802AD058; // type:data D_802AD05C = 0x802AD05C; // type:data -D_802AD060 = 0x802AD060; // type:data -D_802AD064 = 0x802AD064; // type:data -D_802AD068 = 0x802AD068; // type:data -D_802AD069 = 0x802AD069; // type:data -D_802AD06A = 0x802AD06A; // type:data -D_802AD06B = 0x802AD06B; // type:data -D_802AD06C = 0x802AD06C; // type:data +BattleMenu_BasePosX = 0x802AD060; // type:data +BattleMenu_BasePosY = 0x802AD064; // type:data +BattleMenuDisableMsg = 0x802AD068; // type:data +BattleMenu_MinIdx = 0x802AD069; // type:data +BattleMenu_MaxIdx = 0x802AD06A; // type:data +BattleMenu_HomePos = 0x802AD06B; // type:data +BattleMenu_WheelAngle = 0x802AD06C; // type:data D_802AD070 = 0x802AD070; // type:data -main_battle_menu_JumpHudScripts = 0x802AD078; // type:data -battle_menu_messageIDs = 0x802AD090; // type:data +BattleMenu_HudScripts = 0x802AD078; // type:data +BattleMenu_TitleMessages = 0x802AD090; // type:data D_802AD0A8 = 0x802AD0A8; // type:data -main_menu_numOptions = 0x802AD0AC; // type:data +BattleMenu_NumOptions = 0x802AD0AC; // type:data D_802AD0B0 = 0x802AD0B0; // type:data battle_menu_submenuIDs = 0x802AD0B8; // type:data -battle_menu_isEnabled = 0x802AD0D0; // type:data +BattleMenu_OptionEnabled = 0x802AD0D0; // type:data battle_menu_isMessageDisabled = 0x802AD0E8; // type:data D_802AD0EB = 0x802AD0EB; // type:data D_802AD100 = 0x802AD100; // type:data -D_802AD104 = 0x802AD104; // type:data +BattleMenu_ShowSwapIcons = 0x802AD104; // type:data battle_menu_moveState = 0x802AD108; // type:data battle_menu_moveCursorPos = 0x802AD109; // type:data D_802AD10A = 0x802AD10A; // type:data @@ -27007,17 +27002,17 @@ D_802AD10E = 0x802AD10E; // type:data D_802AD10F = 0x802AD10F; // type:data battle_menu_moveScrollOffset = 0x802AD110; // type:data D_802AD112 = 0x802AD112; // type:data -battle_menu_moveTextColor = 0x802AD114; // type:data -battle_menu_moveTextOpacity = 0x802AD116; // type:data -battle_menu_moveCursorIcon = 0x802AD118; // type:data -battle_menu_moveUpArrowIcon = 0x802AD11C; // type:data -battle_menu_moveDownArrowIcon = 0x802AD120; // type:data -battle_menu_moveOptionIconIDs = 0x802AD128; // type:data -battle_menu_moveTitleIcon = 0x802AD188; // type:data -battle_menu_moveOptionCostUnitIconIDs = 0x802AD190; // type:data -battle_menu_moveX = 0x802AD1F0; // type:data -battle_menu_moveY = 0x802AD1F2; // type:data -battle_menu_moveOptionIndexMap = 0x802AD1F8; // type:data +BattleMenu_Moves_TextColor = 0x802AD114; // type:data +BattleMenu_Moves_TextAlpha = 0x802AD116; // type:data +BattleMenu_Moves_CursorID = 0x802AD118; // type:data +BattleMenu_Moves_UpArrowID = 0x802AD11C; // type:data +BattleMenu_Moves_DownArrowID = 0x802AD120; // type:data +BattleMenu_Moves_OptionIDs = 0x802AD128; // type:data +BattleMenu_Moves_TitleID = 0x802AD188; // type:data +BattleMenu_Moves_OptionCostUnitIDs = 0x802AD190; // type:data +BattleMenu_Moves_PosX = 0x802AD1F0; // type:data +BattleMenu_Moves_PosY = 0x802AD1F2; // type:data +BattleMenu_Moves_OptionIndexMap = 0x802AD1F8; // type:data D_802AD258 = 0x802AD258; // type:data battle_menu_moveOptionIconScripts = 0x802AD260; // type:data battle_menu_moveOptionNames = 0x802AD2C0; // type:data @@ -27025,17 +27020,17 @@ battle_menu_moveOptionDisplayCosts = 0x802AD320; // type:data battle_menu_moveOptionDisplayCostReductions = 0x802AD380; // type:data battle_menu_moveOptionDisplayCostReductionColors = 0x802AD3E0; // type:data battle_menu_moveOptionBPCosts = 0x802AD440; // type:data -battle_menu_hasSpiritsMenu = 0x802AD4A0; // type:data -battle_menu_moveOptionCount = 0x802AD4A4; // type:data +BattleMenu_UsingSpiritsSubmenu = 0x802AD4A0; // type:data +BattleMenu_Moves_OptionCount = 0x802AD4A4; // type:data D_802AD4A8 = 0x802AD4A8; // type:data -battle_menu_moveIndices = 0x802AD4B0; // type:data -battle_menu_moveOptionsEnabled = 0x802AD510; // type:data -battle_menu_moveOptionDescriptions = 0x802AD570; // type:data -battle_menu_moveOptionSortPriorities = 0x802AD5D0; // type:data -battle_menu_moveOptionCantUseTypes = 0x802AD5E8; // type:data +BattleMenu_Moves_OptionIndices = 0x802AD4B0; // type:data +BattleMenu_Moves_OptionEnabled = 0x802AD510; // type:data +BattleMenu_Moves_OptionDescMessages = 0x802AD570; // type:data +BattleMenu_Moves_OptionSortPriority = 0x802AD5D0; // type:data +BattleMenu_Moves_OptionCantUseMessages = 0x802AD5E8; // type:data battle_menu_moveOptionActive = 0x802AD600; // type:data D_802AD603 = 0x802AD603; // type:data -D_802AD604 = 0x802AD604; // type:data +BattleSubmenuStratsState = 0x802AD604; // type:data D_802AD605 = 0x802AD605; // type:data D_802AD606 = 0x802AD606; // type:data D_802AD607 = 0x802AD607; // type:data @@ -27049,8 +27044,8 @@ D_802AD610 = 0x802AD610; // type:data D_802AD612 = 0x802AD612; // type:data D_802AD614 = 0x802AD614; // type:data D_802AD618 = 0x802AD618; // type:data -D_802AD61C = 0x802AD61C; // type:data -D_802AD620 = 0x802AD620; // type:data +GreenArrowUpID = 0x802AD61C; // type:data +GreenArrowDownID = 0x802AD620; // type:data D_802AD624 = 0x802AD624; // type:data D_802AD628 = 0x802AD628; // type:data D_802AD63C = 0x802AD63C; // type:data