Misc decomp 53 (#703)

* some btl_state work

* msg_draw_speech_bubble

* cleaners

* btl_state_stuff

* btl_state_update_next_enemy wip

* btl_state stuff

* disable_x fx + cleanup

* wip

* fxstuff

* path funcs & cleanup

* clean

* model_api funcs

* two action commands

* action_cmd progress

* UnkFunc001

* air raid func

* cleanup, data migration, goodies

* remove data file

* git subrepo pull --force tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "a847090eac"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "a847090eac"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* fix build

* more cleanup

* clean

* PR comments
This commit is contained in:
Ethan Roseman 2022-05-05 10:08:16 -04:00 committed by GitHub
parent 8a170a33ac
commit 179998098c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
305 changed files with 7141 additions and 8252 deletions

1
.gitignore vendored
View File

@ -10,6 +10,7 @@ venv/
ctx.c
expected/
.vscode/launch.json
.vscode/*.log
/tools/star-rod
/tools/to_rename.txt
/ver/current

View File

@ -262,10 +262,10 @@ typedef struct PlayerData {
/* 0x29E */ s16 enemyFirstStrikes;
/* 0x2A0 */ u16 powerBounces;
/* 0x2A2 */ u16 battlesCount;
/* 0x2A4 */ s16 battlesWon;
/* 0x2A4 */ u16 battlesWon;
/* 0x2A6 */ s16 unk_2A6;
/* 0x2A8 */ s16 battlesFled;
/* 0x2AA */ s16 trainingsDone;
/* 0x2AA */ u16 trainingsDone;
/* 0x2AC */ s32 walkingStepsTaken;
/* 0x2B0 */ s32 runningStepsTaken;
/* 0x2B4 */ u32 totalCoinsEarned;
@ -928,7 +928,8 @@ typedef struct BattleStatus {
/* 0x049 */ char unk_49[3];
/* 0x04C */ s8 unk_4C[16];
/* 0x05C */ s8 unk_5C[16];
/* 0x06C */ char unk_6C[0x4];
/* 0x06C */ s16 unk_6C;
/* 0x06E */ s16 unk_6E;
/* 0x070 */ s16 menuDisableFlags; /* 1 = jump, 2 = hammer, 4 = items */
/* 0x072 */ char unk_72[2];
/* 0x074 */ s32 unk_74;
@ -949,7 +950,7 @@ typedef struct BattleStatus {
/* 0x089 */ s8 hpDrainCount;
/* 0x08A */ s8 nextMerleeSpellType;
/* 0x08B */ s8 hustleTurns; /* numTurns from hustle drink, normally 0 */
/* 0x08C */ char unk_8C;
/* 0x08C */ s8 unk_8C;
/* 0x08D */ s8 unk_8D;
/* 0x08E */ s8 initialEnemyCount; /* used for SP award bonus */
/* 0x08F */ char unk_8F[1];
@ -1219,7 +1220,7 @@ typedef struct ItemEntity {
/* 0x28 */ u32* savedReadPos;
/* 0x2C */ char unk_2C[2];
/* 0x2E */ u8 unkCounter;
/* 0x2F */ u8 unk_2F;
/* 0x2F */ u8 alpha;
/* 0x30 */ f32 scale;
/* 0x34 */ Vec3s unk_34;
/* 0x3A */ char unk_3A[2];
@ -1577,9 +1578,9 @@ typedef struct SelectableTarget {
/* 0x0C */ s16 unk_0C;
/* 0x0E */ s16 unk_0E;
/* 0x10 */ s8 unk_10;
/* 0x11 */ u8 homeCol; /* from xpos --> 0-3 */
/* 0x12 */ u8 homeRow; /* from ypos --> 0-3 */
/* 0x13 */ u8 layer; /* from zpos? --> 0-1 */
/* 0x11 */ s8 homeCol; /* from xpos --> 0-3 */
/* 0x12 */ s8 homeRow; /* from ypos --> 0-3 */
/* 0x13 */ s8 layer; /* from zpos? --> 0-1 */
} SelectableTarget; // size = 0x14
typedef struct ActorPartMovement {
@ -1779,15 +1780,6 @@ typedef struct DecorationTable {
/* 0x8C6 */ DecorationUnk unk_8C6[2];
} DecorationTable; // size = 0x8E8
typedef struct Encounter {
/* 0x00 */ s32 count;
/* 0x04 */ struct Enemy* enemy[16];
/* 0x44 */ s16 battle;
/* 0x46 */ s16 stage;
/* 0x48 */ s16 encounterID;
/* 0x4A */ char unk_4C[0x12];
} Encounter; // size = 0x5C
typedef struct PlayerPathElement {
/* 0x00 */ s8 isJumping;
/* 0x03 */ char unk_01[3];
@ -1884,7 +1876,7 @@ typedef struct Actor {
/* 0x120 */ s16 flyTime;
/* 0x122 */ s16 flyArcAmplitude;
/* 0x124 */ char unk_124[16];
/* 0x134 */ s8 unk_134;
/* 0x134 */ u8 unk_134;
/* 0x135 */ u8 footStepCounter;
/* 0x136 */ u8 actorType;
/* 0x137 */ char unk_137;
@ -1964,7 +1956,7 @@ typedef struct Actor {
/* 0x223 */ s8 chillOutAmount; /* attack reduction */
/* 0x224 */ s8 chillOutTurns;
/* 0x225 */ char unk_225[3];
/* 0x228 */ struct EffectInstance* unk_228;
/* 0x228 */ struct EffectInstance* icePillarEffect;
/* 0x22C */ struct SelectableTarget targetData[24];
/* 0x40C */ s8 targetListLength;
/* 0x40D */ s8 targetIndexList[24]; /* into targetData */
@ -1981,7 +1973,7 @@ typedef struct Actor {
/* 0x434 */ s16 renderMode; /* initially 0xD, set to 0x22 if any part is transparent */
/* 0x436 */ s16 hudElementDataIndex;
/* 0x438 */ s32 unk_438[2]; /* ??? see FUN_80253974 */
/* 0x440 */ struct EffectInstance* debuffIcon; // TODO: figure out the type of data field of debuffIcon
/* 0x440 */ struct EffectInstance* debuffEffect;
} Actor; // size = 0x444
typedef struct BackgroundHeader {
@ -2046,7 +2038,7 @@ typedef struct PlayerStatus {
/* 0x0BC */ u16 unk_BC;
/* 0x0BE */ s8 renderMode;
/* 0x0BF */ s8 unk_BF;
/* 0x0C0 */ s16 decorationList;
/* 0x0C0 */ s16 timeInAir;
/* 0x0C2 */ s16 unk_C2;
/* 0x0C4 */ char unk_C4;
/* 0x0C5 */ s8 unk_C5;
@ -2071,49 +2063,6 @@ typedef struct PlayerStatus {
/* 0x281 */ char unk_281[7];
} PlayerStatus; // size = 0x288
typedef struct EncounterStatus {
/* 0x000 */ s32 flags;
/* 0x004 */ s8 eFirstStrike; /* 0 = none, 1 = player, 2 = enemy */
/* 0x005 */ s8 hitType; /* 1 = none/enemy, 2 = jump */
/* 0x006 */ s8 hitTier; /* 0 = normal, 1 = super, 2 = ultra */
/* 0x007 */ char unk_07;
/* 0x008 */ s8 unk_08;
/* 0x009 */ s8 battleOutcome; /* 0 = won, 1 = lost */
/* 0x00A */ s8 unk_0A;
/* 0x00B */ s8 merleeCoinBonus; /* triple coins when != 0 */
/* 0x00C */ u8 damageTaken; /* valid after battle */
/* 0x00D */ char unk_0D;
/* 0x00E */ s16 coinsEarned; /* valid after battle */
/* 0x010 */ char unk_10;
/* 0x011 */ u8 allowFleeing;
/* 0x012 */ s8 unk_12;
/* 0x013 */ u8 dropWhackaBump;
/* 0x014 */ s32 songID;
/* 0x018 */ s32 unk_18;
/* 0x01C */ s8 numEncounters; /* number of encounters for current map (in list) */
/* 0x01D */ s8 currentAreaIndex;
/* 0x01E */ u8 currentMapIndex;
/* 0x01F */ u8 currentEntryIndex;
/* 0x020 */ s8 mapID;
/* 0x021 */ s8 resetMapEncounterFlags;
/* 0x021 */ char unk_22[2];
/* 0x024 */ s32* npcGroupList;
/* 0x028 */ struct Encounter* encounterList[24];
/* 0x088 */ struct Encounter* currentEncounter;
/* 0x08C */ struct Enemy* currentEnemy;
/* 0x090 */ s32 fadeOutAmount;
/* 0x094 */ s32 unk_94;
/* 0x098 */ s32 fadeOutAccel;
/* 0x09C */ s32 battleStartCountdown;
/* 0x0A0 */ s8 unk_A0;
/* 0x0A1 */ char unk_A1[0x1];
/* 0x0A2 */ s16 unk_A2;
/* 0x0A4 */ char unk_A4[0xC];
/* 0x0B0 */ s32 defeatFlags[60][12];
/* 0xFB0 */ s16 recentMaps[2];
/* 0xFB4 */ char unk_FB4[4];
} EncounterStatus; // size = 0xFB8
typedef struct SaveDataHeader {
/* 0x0000 */ char magicString[16]; /* "Mario Story 006" string */
/* 0x0010 */ s8 pad[0x20]; /* always zero */
@ -2162,9 +2111,9 @@ typedef struct SaveData {
/* 0x1304 */ char unk_1304[0x7C];
} SaveData; // size = 0x1380
typedef struct {
typedef struct Path {
/* 0x00 */ s32 numVectors;
/* 0x04 */ s32 unk_04;
/* 0x04 */ f32* unk_04;
/* 0x08 */ Vec3f* staticVectorList;
/* 0x0C */ Vec3f* vectors;
/* 0x10 */ s32 timeElapsed;

View File

@ -602,6 +602,25 @@ typedef struct FireFlowerFXData {
/* 0x40 */ Vec3i unk_40;
} FireFlowerFXData; // size = 0x4C
typedef struct DisableXFXData {
/* 0x00 */ s32 type;
/* 0x04 */ s32 unk_04;
/* 0x08 */ Vec3f pos;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ s32 alpha;
/* 0x28 */ s32 unk_28;
/* 0x2C */ s32 unk_2C;
/* 0x30 */ f32 unk_30;
/* 0x34 */ f32 scale;
/* 0x38 */ s32 unk_38;
/* 0x3C */ s32 unk_3C;
/* 0x40 */ f32 unk_40;
/* 0x44 */ s32 unk_44;
} DisableXFXData; // size = 0x48
typedef struct FireBreathFXData {
/* 0x00 */ s32 type;
/* 0x04 */ s32 numChildren;
@ -783,7 +802,7 @@ typedef struct EffectDataQuizStage {
typedef struct EffectDataQuizVannaT {
/* 0x00 */ char unk_00[0x4];
/* 0x04 */ Vec3f position;
/* 0x10 */ s32 vanishTimer;
/* 0x10 */ s32 vanishTimer;
/* 0x14 */ s32 lifetime;
/* 0x18 */ s32 fadeInAmt; // 0 = all-black, FF = fully-visible
/* 0x1C */ s32 anim;

View File

@ -93,7 +93,7 @@ FX_MAIN(fx_3D_main);
void blast_main(s32, f32, f32, f32, f32, s32);
EffectInstance* fire_flower_main(s32, f32, f32, f32, s32);
FX_MAIN(recover_main);
FX_MAIN(disable_x_main);
EffectInstance* disable_x_main(s32, f32, f32, f32, s32);
FX_MAIN(bombette_breaking_main);
FX_MAIN(firework_main);
FX_MAIN(confetti_main);

View File

@ -2600,6 +2600,7 @@ enum BattleStatusFlags2 {
BS_FLAGS2_400 = 0x00000400,
BS_FLAGS2_800 = 0x00000800,
BS_FLAGS2_NO_TARGET_AVAILABLE = 0x00001000,
BS_FLAGS2_10000 = 0x00010000,
BS_FLAGS2_1000000 = 0x01000000,
BS_FLAGS2_2000000 = 0x02000000,
BS_FLAGS2_4000000 = 0x04000000,
@ -2660,13 +2661,42 @@ enum BattleStates2 {
BATTLE_STATE2_PLAYER_DEFEATED = 0x0000000A,
BATTLE_STATE2_UNK_B = 0x0000000B,
BATTLE_STATE2_UNK_C = 0x0000000C,
BATTLE_STATE2_UNK_D = 0x0000000D,
BATTLE_STATE2_UNK_E = 0x0000000E,
BATTLE_STATE2_UNK_F = 0x0000000F,
BATTLE_STATE2_UNK_10 = 0x00000010,
BATTLE_STATE2_UNK_14 = 0x00000014,
BATTLE_STATE2_UNK_15 = 0x00000015,
BATTLE_STATE2_UNK_16 = 0x00000016,
BATTLE_STATE2_UNK_17 = 0x00000017,
BATTLE_STATE2_UNK_18 = 0x00000018,
BATTLE_STATE2_UNK_1E = 0x0000001E,
BATTLE_STATE2_UNK_1F = 0x0000001F,
BATTLE_STATE2_UNK_20 = 0x00000020,
BATTLE_STATE2_UNK_21 = 0x00000021,
BATTLE_STATE2_UNK_22 = 0x00000022,
BATTLE_STATE2_UNK_28 = 0x00000028,
BATTLE_STATE2_UNK_29 = 0x00000029,
BATTLE_STATE2_UNK_2A = 0x0000002A,
BATTLE_STATE2_UNK_2B = 0x0000002B,
BATTLE_STATE2_UNK_2C = 0x0000002C,
BATTLE_STATE2_UNK_33 = 0x00000033,
BATTLE_STATE2_UNK_34 = 0x00000034,
BATTLE_STATE2_UNK_35 = 0x00000035,
BATTLE_STATE2_UNK_36 = 0x00000036,
BATTLE_STATE2_UNK_3D = 0x0000003D,
BATTLE_STATE2_UNK_3E = 0x0000003E,
BATTLE_STATE2_UNK_3F = 0x0000003F,
BATTLE_STATE2_UNK_40 = 0x00000040,
BATTLE_STATE2_UNK_41 = 0x00000041,
BATTLE_STATE2_UNK_46 = 0x00000046,
BATTLE_STATE2_UNK_64 = 0x00000064,
BATTLE_STATE2_UNK_C8 = 0x000000C8,
BATTLE_STATE2_UNK_C9 = 0x000000C9,
BATTLE_STATE2_UNK_CA = 0x000000CA,
BATTLE_STATE2_UNK_CB = 0x000000CB,
BATTLE_STATE2_UNK_CC = 0x000000CC,
BATTLE_STATE2_UNK_CD = 0x000000CD,
};
enum DebuffTypes {

View File

@ -388,7 +388,7 @@ s32 is_point_within_region(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 c
PlayerData* get_player_data(void);
s32 npc_raycast_down_around(s32, f32*, f32*, f32*, f32*, f32, f32);
s32 npc_raycast_down_sides(s32, f32*, f32*, f32*, f32*);
s32 npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth);
s32 npc_raycast_up(s32, f32*, f32*, f32*, f32*);
s32 player_raycast_up_corners(PlayerStatus*, f32*, f32*, f32*, f32*, f32);
s32 player_raycast_below_cam_relative(PlayerStatus* playerStatus, f32* outX, f32* outY, f32* outZ, f32* outLength,
@ -412,6 +412,10 @@ void partner_clear_player_tracking(Npc* partner);
void set_background_color_blend(u8 r, u8 g, u8 b, u8 a);
void partner_set_tether_distance(f32);
void btl_delete_player_actor(Actor* player);
void kill_all_scripts(void);
s32 does_script_exist(s32 id);
s32 does_script_exist_by_ref(Evt* script);
Evt* start_script(EvtScript* source, s32 priority, s32 initialState);
@ -476,6 +480,8 @@ s32 check_input_hammer(void);
Npc* resolve_npc(Evt* script, s32 npcIdOrPtr);
void enable_npc_blur(Npc* npc);
void disable_npc_blur(Npc* npc);
void enable_partner_blur(void);
void disable_partner_blur(void);
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by);
f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz);
@ -560,6 +566,7 @@ void load_partner_actor(void);
void dispatch_event_partner(s32);
void dispatch_event_player(s32);
s32 btl_are_all_enemies_defeated(void);
s32 btl_check_enemies_defeated(void);
s32 btl_check_player_defeated(void);
void btl_show_battle_message(s32, s32);
void btl_update_ko_status(void);
@ -789,6 +796,7 @@ s32 get_defense(Actor* actor, s32* defenseTable, s32 elementFlags);
void func_8024EDC0(void);
void remove_all_effects(void);
void update_effects(void);
void update_cameras(void);
void clear_render_tasks(void);

View File

@ -157,6 +157,8 @@ void update_model_animator(s32);
void update_model_animator_with_transform(s32 animatorID, Mtx* mtx);
void set_mdl_custom_gfx_set(Model*, s32, u32);
s32 step_model_animator(ModelAnimator* animator);
AnimatorNode* get_animator_node_for_tree_index(ModelAnimator* animator, s32 treeIndex);
AnimatorNode* get_animator_node_with_id(ModelAnimator* animator, s32 id);
void animator_update_model_transforms(ModelAnimator* animator, Mtx* rootTransform);
void render_animated_model(s32 animatorID, Mtx* rootTransform);
void animator_node_update_model_transform(ModelAnimator* animator, f32 (*flipMtx)[4], AnimatorNode* node,

View File

@ -243,7 +243,7 @@ typedef struct Enemy {
/* 0x0A */ s16 spawnPos[3];
/* 0x10 */ Vec3s unk_10;
/* 0x16 */ char unk_16[2];
/* 0x18 */ struct NpcSettings* npcSettings;
/* 0x18 */ NpcSettings* npcSettings;
/* 0x1C */ EvtScript* initBytecode;
/* 0x20 */ EvtScript* interactBytecode;
/* 0x24 */ EvtScript* aiBytecode;
@ -287,6 +287,60 @@ typedef struct Enemy {
/* 0xDC */ char unk_DC[20];
} Enemy; // size = 0xF0
typedef struct Encounter {
/* 0x00 */ s32 count;
/* 0x04 */ Enemy* enemy[16];
/* 0x44 */ s16 battle;
/* 0x46 */ s16 stage;
/* 0x48 */ s16 encounterID;
/* 0x4A */ char unk_4C[0x12];
} Encounter; // size = 0x5C
typedef struct EncounterStatus {
/* 0x000 */ s32 flags;
/* 0x004 */ s8 eFirstStrike; /* 0 = none, 1 = player, 2 = enemy */
/* 0x005 */ s8 hitType; /* 1 = none/enemy, 2 = jump */
/* 0x006 */ s8 hitTier; /* 0 = normal, 1 = super, 2 = ultra */
/* 0x007 */ char unk_07;
/* 0x008 */ s8 unk_08;
/* 0x009 */ s8 battleOutcome; /* 0 = won, 1 = lost */
/* 0x00A */ s8 unk_0A;
/* 0x00B */ s8 merleeCoinBonus; /* triple coins when != 0 */
/* 0x00C */ u8 damageTaken; /* valid after battle */
/* 0x00D */ char unk_0D;
/* 0x00E */ s16 coinsEarned; /* valid after battle */
/* 0x010 */ char unk_10;
/* 0x011 */ u8 allowFleeing;
/* 0x012 */ s8 unk_12;
/* 0x013 */ u8 dropWhackaBump;
/* 0x014 */ s32 songID;
/* 0x018 */ s32 unk_18;
/* 0x01C */ s8 numEncounters; /* number of encounters for current map (in list) */
/* 0x01D */ s8 currentAreaIndex;
/* 0x01E */ u8 currentMapIndex;
/* 0x01F */ u8 currentEntryIndex;
/* 0x020 */ s8 mapID;
/* 0x021 */ s8 resetMapEncounterFlags;
/* 0x021 */ char unk_22[2];
/* 0x024 */ s32* npcGroupList;
/* 0x028 */ Encounter* encounterList[24];
/* 0x088 */ Encounter* currentEncounter;
/* 0x08C */ Enemy* currentEnemy;
/* 0x090 */ s32 fadeOutAmount;
/* 0x094 */ s32 unk_94;
/* 0x098 */ s32 fadeOutAccel;
/* 0x09C */ s32 battleStartCountdown;
/* 0x0A0 */ s8 unk_A0;
/* 0x0A1 */ char unk_A1[0x1];
/* 0x0A2 */ s16 unk_A2;
/* 0x0A4 */ char unk_A4[0xC];
/* 0x0B0 */ s32 defeatFlags[60][12];
/* 0xFB0 */ s16 recentMaps[2];
/* 0xFB4 */ char unk_FB4[4];
} EncounterStatus; // size = 0xFB8
extern EncounterStatus gCurrentEncounter;
s32 basic_ai_check_player_dist(EnemyDetectVolume* arg0, Enemy* arg1, f32 arg2, f32 arg3, s8 arg4);
/// The default Npc::onUpdate and Npc::onRender callback.

View File

@ -210,7 +210,7 @@ extern ALBankFile* nuAuSndBank_ptr;
extern ALSndId* nuAuSndId;
extern ALSynConfig nuAuSynConfig;
extern ALSeqpConfig nuAuSeqpConfig;
extern ALSndpConfig nuAnSndpConfig;
extern ALSndpConfig nuAuSndpConfig;
extern u8 nuAuTaskStop;
extern u8 nuAuPreNMI;
extern NUAuPreNMIFunc nuAuPreNMIFunc;
@ -239,9 +239,6 @@ extern u32 nuAuDebAcmdLenMax; /* Maximum length of the audio command list */
extern s16 nuAuFrameSampleSize; /* Number of samples created at one time */
extern s16 nuAuExtraSampleSize; /* Number of extra samples */
extern ALSynConfig nuAuSynConfig;
extern ALSeqpConfig nuAuSeqpConfig;
extern ALSndpConfig nuAuSndpConfig;
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/

View File

@ -78,7 +78,6 @@ extern CollisionData gCollisionData;
extern s8 D_800A0900;
extern f32 GravityParamsStartFall[];
extern s16 D_800F7B80;
extern EncounterStatus gCurrentEncounter;
extern u8* D_801512F0;
extern s16 D_80151308;
extern s32 gEntityHideMode;

View File

@ -6,3 +6,4 @@ colorama
ninja_syntax
msgpack
pylibyaml
tqdm

File diff suppressed because it is too large Load Diff

View File

@ -1024,7 +1024,7 @@ void btl_delete_actor(Actor* actor) {
delete_shadow(actor->shadow.id);
remove_all_status_icons(actor->hudElementDataIndex);
remove_effect(actor->debuffIcon); // ???
remove_effect(actor->debuffEffect);
if (actor->unk_200 != NULL) {
actor->unk_200[3][9] = 0;
@ -1067,7 +1067,7 @@ void btl_delete_player_actor(Actor* player) {
delete_shadow(player->shadow.id);
remove_all_status_icons(player->hudElementDataIndex);
remove_effect(player->debuffIcon); // ???
remove_effect(player->debuffEffect);
if (player->unk_200 != NULL) {
player->unk_200[3][9] = 0;

View File

@ -2064,8 +2064,8 @@ void load_player_actor(void) {
player->shadow.id = create_shadow_type(0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
player->shadowScale = player->size.x / 24.0;
player->hudElementDataIndex = create_status_icon_set();
player->debuffIcon = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0);
player->unk_228 = NULL;
player->debuffEffect = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0);
player->icePillarEffect = NULL;
if (is_ability_active(ABILITY_ZAP_TAP)) {
player->staticStatus = STATUS_STATIC;
@ -2318,8 +2318,8 @@ void load_partner_actor(void) {
partnerActor->shadow.id = create_shadow_type(0, partnerActor->currentPos.x, partnerActor->currentPos.y, partnerActor->currentPos.z);
partnerActor->shadowScale = partnerActor->size.x / 24.0;
partnerActor->hudElementDataIndex = create_status_icon_set();
partnerActor->debuffIcon = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0);
partnerActor->unk_228 = NULL;
partnerActor->debuffEffect = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0);
partnerActor->icePillarEffect = NULL;
takeTurnScript = start_script(partnerActor->takeTurnScriptSource, EVT_PRIORITY_A, 0);
partnerActor->takeTurnID = takeTurnScript->id;
@ -2589,8 +2589,8 @@ Actor* create_actor(Formation formation) {
takeTurnScript->owner1.enemyID = actor->enemyIndex | 0x200;
actor->shadow.id = create_shadow_type(0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
actor->shadowScale = actor->size.x / 24.0;
actor->debuffIcon = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0);
actor->unk_228 = NULL;
actor->debuffEffect = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0);
actor->icePillarEffect = NULL;
actor->hudElementDataIndex = create_status_icon_set();
return actor;
}
@ -2754,7 +2754,7 @@ s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) {
if (target->debuff != statusTypeKey) {
target->status = statusTypeKey;
}
((s32*)target->debuffIcon->data)[15] = 0;
((DisableXFXData*)target->debuffEffect->data)->unk_3C = 0;
target->debuff = statusTypeKey;
target->debuffDuration = duration;
if ((s8)duration > 9) {
@ -2764,11 +2764,11 @@ s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) {
switch (statusTypeKey) {
case STATUS_FROZEN:
if (target->actorID != ACTOR_PARTNER) {
effect = target->unk_228;
effect = target->icePillarEffect;
if (effect != NULL) {
effect->flags |= EFFECT_INSTANCE_FLAGS_10;
}
target->unk_228 = fx_ice_pillar(0, target->currentPos.x, target->currentPos.y,
target->icePillarEffect = fx_ice_pillar(0, target->currentPos.x, target->currentPos.y,
target->currentPos.z, 1.0f, 0);
create_status_debuff(target->hudElementDataIndex, STATUS_FROZEN);
}
@ -3502,7 +3502,7 @@ void btl_update_ko_status(void) {
player->koDuration = player->debuffDuration;
if (player->koDuration > 0) {
player->koStatus = STATUS_DAZE;
((s32*)player->debuffIcon->data)[15] = player->koDuration;
((DisableXFXData*)player->debuffEffect->data)->unk_3C = player->koDuration;
if (koDuration == 0) {
sfx_play_sound(SOUND_2107);
@ -3517,7 +3517,7 @@ void btl_update_ko_status(void) {
if (partner->koDuration > 0) {
partner->koStatus = STATUS_DAZE;
((s32*)partner->debuffIcon->data)[15] = partner->koDuration;
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = partner->koDuration;
}
}
@ -3528,7 +3528,7 @@ void btl_update_ko_status(void) {
enemy->koDuration = enemy->debuffDuration;
if (enemy->koDuration > 0) {
enemy->koStatus = STATUS_DAZE;
((s32*)enemy->debuffIcon->data)[15] = enemy->koDuration;
((DisableXFXData*)enemy->debuffEffect->data)->unk_3C = enemy->koDuration;
}
}
}

View File

@ -1997,7 +1997,7 @@ ApiStatus ClearStatusEffects(Evt* script, s32 isInitialCall) {
actor->koStatus = 0;
actor->koDuration = 0;
((s32*)actor->debuffIcon->data)[15] = 0;
((DisableXFXData*)actor->debuffEffect->data)->unk_3C = 0;
actor->attackBoost = 0;
actor->defenseBoost = 0;
actor->isGlowing = 0;

View File

@ -5,6 +5,7 @@
#include "hud_element.h"
extern s32 D_80077C40;
extern EnemyDrops D_80077EB8;
extern s8 D_8009A654;
extern s16 D_8009A668;

View File

@ -1,6 +1,8 @@
#include "common.h"
#include "hud_element.h"
extern s32 D_8008FA78;
extern HudScript HudScript_YellowArrow[];
extern HudScript HudScript_MenuFlee[];
@ -83,7 +85,9 @@ extern HudScript HudScript_MoveBlueOrbDisabled[];
extern HudScript HudScript_MoveGreenOrbDisabled[];
extern HudScript HudScript_MoveRedOrbDisabled[];
extern u8 D_802AD000;
extern s32 D_802ACC60;
extern s32 D_802ACC6C;
extern s8 D_802AD000;
extern u8 D_802AD001;
extern s16 D_802AD006;
extern s16 D_802AD008;
@ -99,6 +103,16 @@ extern s32 D_802AD054;
extern s32 D_802AD058;
extern s8 D_802AD068;
extern s32 main_menu_numOptions;
extern s32 D_802AD0A8;
extern s32 D_802AD0B0;
extern s32 D_802AD0BB[];
extern s32 D_802AD100;
extern s32 D_802AD104;
extern s32 battle_menu_isEnabled;
extern s32 battle_menu_isMessageDisabled;
extern s32 battle_menu_messageIDs[];
extern s32 battle_menu_submenuIDs;
extern HudScript* main_battle_menu_JumpHudScripts;
extern s8 D_802AD10A;
extern s8 D_802AD10D;
extern s8 D_802AD10E;
@ -149,7 +163,7 @@ extern s32 D_802AD690[];
extern s32 D_802AD6C0[];
extern s32 D_802AD6D4;
s16 D_802AB340[] = { 0x001C, 0x0028 };
s16 D_802AB340[] = { 28, 40 };
s16 D_802AB344[] = { 0, -2 };
@ -169,22 +183,28 @@ HudScript* battle_menu_ItemHudScripts[] = { HudScript_MenuItem, HudScript_MenuIt
HudScript* battle_menu_StarPowerHudScripts[] = { HudScript_MenuStarPower, HudScript_MenuStarPowerDisabled };
HudScript* battle_menu_StarPowerMovesHudScripts[] = { HudScript_MenuStarPower, HudScript_MenuStarPowerDisabled, HudScript_Eldstar, HudScript_EldstarDisabled,
HudScript* battle_menu_StarPowerMovesHudScripts[] = {
HudScript_MenuStarPower, HudScript_MenuStarPowerDisabled, HudScript_Eldstar, HudScript_EldstarDisabled,
HudScript_Mamar, HudScript_MamarDisabled, HudScript_Skolar, HudScript_SkolarDisabled,
HudScript_Muskular, HudScript_MuskularDisabled, HudScript_Misstar, HudScript_MisstarDisabled,
HudScript_Klevar, HudScript_KlevarDisabled, HudScript_Kalmar, HudScript_KalmarDisabled,
HudScript_StarBeam, HudScript_StarBeamDisabled, HudScript_PeachBeam, HudScript_PeachBeamDisabled,
HudScript_MenuStarPower, HudScript_MenuStarPowerDisabled, HudScript_MenuStarPower, HudScript_MenuStarPowerDisabled };
HudScript_MenuStarPower, HudScript_MenuStarPowerDisabled, HudScript_MenuStarPower, HudScript_MenuStarPowerDisabled
};
HudScript* battle_menu_PartnerHudScripts[] = { HudScript_Partner0, HudScript_Goombario, HudScript_Kooper, HudScript_Bombette,
HudScript* battle_menu_PartnerHudScripts[] = {
HudScript_Partner0, HudScript_Goombario, HudScript_Kooper, HudScript_Bombette,
HudScript_Parakarry, HudScript_Partner0, HudScript_Watt, HudScript_Sushie,
HudScript_Lakilester, HudScript_Bow, HudScript_PartnerA, HudScript_PartnerA,
HudScript_PartnerA, HudScript_PartnerA, HudScript_PartnerA, HudScript_PartnerA };
HudScript_PartnerA, HudScript_PartnerA, HudScript_PartnerA, HudScript_PartnerA
};
HudScript* battle_menu_DisabledPartnerHudScripts[] = { HudScript_Partner0Disabled, HudScript_GoombarioDisabled, HudScript_KooperDisabled, HudScript_BombetteDisabled,
HudScript* battle_menu_DisabledPartnerHudScripts[] = {
HudScript_Partner0Disabled, HudScript_GoombarioDisabled, HudScript_KooperDisabled, HudScript_BombetteDisabled,
HudScript_ParakarryDisabled, HudScript_Partner0Disabled, HudScript_WattDisabled, HudScript_SushieDisabled,
HudScript_LakilesterDisabled, HudScript_BowDisabled, HudScript_PartnerADisabled, HudScript_PartnerADisabled,
HudScript_PartnerADisabled, HudScript_PartnerADisabled, HudScript_PartnerADisabled, HudScript_PartnerADisabled };
HudScript_PartnerADisabled, HudScript_PartnerADisabled, HudScript_PartnerADisabled, HudScript_PartnerADisabled
};
HudScript* battle_menu_StrategiesHudScript[] = { HudScript_MenuStrategies };
@ -219,9 +239,15 @@ s32 D_802AB4F0[] = { 0x2, 0x1, 0x4, 0x6, 0x3, 0x5, 0x1A, 0x3, 0x34, 0x39, 0x31,
// s8 D_802AB513
s32 D_802AB520[] = { 0x00000000, 0x00090012, 0x000A001A, 0x000B001C, 0x000C0017, 0x009D0001, 0x000E000B, 0x000F0012, 0x00100003, 0x000D0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 };
s32 D_802AB520[] = {
0x00000000, 0x00090012, 0x000A001A, 0x000B001C, 0x000C0017, 0x009D0001, 0x000E000B, 0x000F0012, 0x00100003,
0x000D0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
};
s32 D_802AB558[] = { 0x00000000, 0x00090002, 0x000A0005, 0x000B0006, 0x000C0002, 0x009D0002, 0x000E0002, 0x000F0002, 0x00100002, 0x000D0002, 0x00000000, 0x00000000, 0x00000000, 0x00000000 };
s32 D_802AB558[] = {
0x00000000, 0x00090002, 0x000A0005, 0x000B0006, 0x000C0002, 0x009D0002, 0x000E0002, 0x000F0002, 0x00100002,
0x000D0002, 0x00000000, 0x00000000, 0x00000000, 0x00000000
};
HudScript* battle_menu_PartnerMoveHudScripts[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@ -245,7 +271,10 @@ HudScript* battle_menu_TwinkStarPowerHudScripts[] = { HudScript_MenuStarPower, H
// Dash
s32 D_802AB734[] = { 0x001D0057 };
s32 D_802AB738[] = { 0x00000000, 0x001D0007, 0x001D0008, 0x001D0009, 0x001D000A, 0x001D000B, 0x001D000C, 0x001D000D, 0x001D000E, 0x001D000F, 0x001D0010, 0x001D0011, 0x001D0012, 0x00000000 };
s32 D_802AB738[] = {
0x00000000, 0x001D0007, 0x001D0008, 0x001D0009, 0x001D000A, 0x001D000B, 0x001D000C, 0x001D000D, 0x001D000E,
0x001D000F, 0x001D0010, 0x001D0011, 0x001D0012, 0x00000000
};
void func_802A1000(void) {
D_802AD006 = 255;
@ -296,10 +325,212 @@ void func_802A10B8(void) {
hud_element_free(D_802AD058);
}
s32 func_802A11B0(void);
INCLUDE_ASM(s32, "415D90", func_802A11B0);
void btl_draw_menu_wheel(void);
// various issues
#ifdef NON_MATCHING
extern s8 D_802AD002;
extern s8 D_802AD004;
extern s16 D_802AD00A;
extern s32 D_802AD060;
extern s32 D_802AD064;
extern s8 D_802AD06B;
extern f32 D_802AD06C;
extern f32 D_802AD070;
void btl_draw_menu_wheel(void) {
s32 id;
s32 opacity;
f32 temp_f24;
f32 theta;
s32 cond;
f32 x;
f32 y;
f32 scale;
s32 i;
s32 new_var;
switch (D_802AD000) {
case 1:
func_80144218(-1);
id = D_802AD048;
hud_element_set_transform_rotation(id, 0.0f, 0.0f, 0.0f);
hud_element_set_alpha(id, (D_802AD006 * 254) / 255);
hud_element_set_render_pos(id, 3940 - D_802AD00A, D_802AD00A + 212);
func_80144238(id);
id = D_802AD044;
hud_element_set_alpha(id, (D_802AD006 * 254) / 255);
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;
func_80144218(-1);
temp_f24 = (D_802AD100 - D_802AD002) * 28;
cond = FALSE;
if (D_802AD06C > temp_f24) {
D_802AD06C -= D_802AD070;
if (D_802AD06C < temp_f24) {
D_802AD06C = temp_f24;
cond = TRUE;
}
} else if (D_802AD06C < temp_f24) {
D_802AD06C += D_802AD070;
if (D_802AD06C > temp_f24) {
D_802AD06C = temp_f24;
cond = TRUE;
}
} else {
cond = TRUE;
}
if (!cond) {
D_802AD070 = (D_802AD070 * (D_802AD070 + 1.0) * (D_802AD070 + 1.0));
} else {
D_802AD004 = 0;
D_802AD070 = 0.3f;
}
theta = D_802AD06C;
for (i = 0; i < main_menu_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;
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);
if (theta == 56.0f && cond == TRUE) {
hud_element_set_scale(id, 1.6f);
} else {
hud_element_set_scale(id, 1.0f);
}
func_80144238(id);
if (i == D_802AD06B + D_802AD002) {
x = 0.0f;
y = 0.0f;
add_vec2D_polar(&x, &y, 87.0f, 56.0f);
x = D_802AD060 + x;
y = D_802AD064 + y;
id = D_802AD040;
hud_element_set_transform_pos(id, x, -y, 0.0f);
hud_element_set_render_pos(id, 0, 0);
hud_element_set_alpha(id, (opacity * 180) / 255);
hud_element_set_scale(id, 1.2f);
if (!cond) {
hud_element_set_flags(id, 2);
} else {
hud_element_clear_flags(id, 2);
}
func_80144238(id);
}
}
scale = (fabsf(fabsf((D_802AD06C - ((D_802AD100 - D_802AD002) * 28)) * (45.0 / 28.0)) - 22.5) / 22.5) + 0.01;
if (cond) {
scale = 1.0f;
}
id = D_802AD04C;
hud_element_set_transform_rotation_pivot(id, 0, 0);
hud_element_set_transform_rotation(id, 0.0f, 0.0f, -43.0f);
hud_element_set_scale(id, scale);
hud_element_set_transform_scale(id, 1.0f, 1.8f, 1.0f);
hud_element_set_alpha(id, (opacity * 200) / 255);
hud_element_set_render_pos(id, 79, 176);
func_80144238(id);
id = D_802AD048;
scale = (D_802AD06C - ((D_802AD100 - D_802AD002) * 28)) * (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);
hud_element_set_alpha(id, (opacity * 254) / 255);
hud_element_set_render_pos(id, 40 - D_802AD00A, D_802AD00A + 212);
func_80144238(id);
id = D_802AD044;
hud_element_set_alpha(id, (opacity * 254) / 255);
hud_element_set_render_pos(id, 40 - D_802AD00A, D_802AD00A + 212);
hud_element_set_scale(id, 1.0f);
func_80144238(id);
theta = D_802AD06C;
for (i = 0; i < main_menu_numOptions; i++, theta += 28.0f) {
s32 l;
s32 t;
s32 new_var;
x = 0.0f;
y = 0.0f;
add_vec2D_polar(&x, &y, 87.0f, theta);
x = D_802AD060 + x;
l = x;
y = D_802AD064 + y;
t = 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) {
hud_element_set_alpha(id, opacity);
}
hud_element_draw_clipped(id);
}
if (cond) {
s32 msgX;
s32 msgY;
msgX = D_802AD060 + 20;
msgY = D_802AD064;
msgY -= 34;
btl_draw_prim_quad(0, 0, 0, 0, D_802AD060 + 46, msgY, 48, 16);
draw_msg(battle_menu_messageIDs[D_802AD002 + D_802AD06B], msgX, msgY, opacity, 0x35, 0);
}
if ((gBattleStatus.flags1 & 0x02000000) || (gBattleStatus.flags2 & 0x40)) {
D_802AD104 = 0;
}
if (D_802AD104 != 0) {
id = D_802AD05C;
hud_element_set_alpha(id, (opacity * 200) / 255);
hud_element_draw_clipped(id);
id = D_802AD050;
hud_element_set_alpha(id, opacity);
hud_element_draw_clipped(id);
id = D_802AD054;
hud_element_set_alpha(id, opacity);
hud_element_draw_clipped(id);
id = D_802AD058;
hud_element_set_alpha(id, opacity);
hud_element_draw_clipped(id);
}
break;
}
}
#else
INCLUDE_ASM(s32, "415D90", btl_draw_menu_wheel);
#endif
// Very similar to func_802A45D8 - maybe can be used to reduce fake matches there
void func_802A2684(void) {
@ -857,122 +1088,116 @@ s32 func_802A58D0(void) {
INCLUDE_ASM(s32, "415D90", btl_state_update_player_menu);
//requires above to be decomped
#ifdef NON_EQUIVALENT
void btl_state_draw_player_menu(void) {
switch (gBattleState2) {
case 1:
case BATTLE_STATE2_UNK_1:
btl_draw_menu_wheel();
break;
case 2:
case 3:
case 4:
case 5:
case 10:
case 11:
case 12:
case 13:
case 14:
case 20:
case 21:
case 22:
case 23:
case 24:
case 30:
case 31:
case 32:
case 33:
case 34:
case 40:
case 41:
case 42:
case 43:
case 44:
case 51:
case 52:
case 53:
case 54:
case 61:
case 62:
case 63:
case 64:
case 65:
case 200:
case 201:
case BATTLE_STATE2_UNK_2:
case BATTLE_STATE2_UNK_3:
case BATTLE_STATE2_UNK_4:
case BATTLE_STATE2_UNK_5:
case BATTLE_STATE2_PLAYER_DEFEATED:
case BATTLE_STATE2_UNK_B:
case BATTLE_STATE2_UNK_C:
case BATTLE_STATE2_UNK_D:
case BATTLE_STATE2_UNK_14:
case BATTLE_STATE2_UNK_15:
case BATTLE_STATE2_UNK_16:
case BATTLE_STATE2_UNK_17:
case BATTLE_STATE2_UNK_18:
case BATTLE_STATE2_UNK_1E:
case BATTLE_STATE2_UNK_1F:
case BATTLE_STATE2_UNK_20:
case BATTLE_STATE2_UNK_21:
case BATTLE_STATE2_UNK_22:
case BATTLE_STATE2_UNK_28:
case BATTLE_STATE2_UNK_29:
case BATTLE_STATE2_UNK_2A:
case BATTLE_STATE2_UNK_2B:
case BATTLE_STATE2_UNK_2C:
case BATTLE_STATE2_UNK_3D:
case BATTLE_STATE2_UNK_3E:
case BATTLE_STATE2_UNK_3F:
btl_draw_menu_wheel();
break;
case 202:
case BATTLE_STATE2_UNK_40:
case BATTLE_STATE2_UNK_41:
case BATTLE_STATE2_UNK_C8:
case BATTLE_STATE2_UNK_C9:
btl_draw_menu_wheel();
break;
case 203:
case BATTLE_STATE2_UNK_CA:
btl_draw_menu_wheel();
break;
case 204:
case BATTLE_STATE2_UNK_CB:
btl_draw_menu_wheel();
break;
case 205:
case BATTLE_STATE2_UNK_CC:
btl_draw_menu_wheel();
break;
case BATTLE_STATE2_UNK_CD:
btl_draw_menu_wheel();
break;
}
}
#else
INCLUDE_ASM(s32, "415D90", btl_state_draw_player_menu);
#endif
static const f32 padding = 0.0f;
INCLUDE_ASM(s32, "415D90", btl_state_update_partner_menu);
void btl_state_draw_partner_menu(void) {
switch (gBattleState2) {
case 2:
case BATTLE_STATE2_UNK_2:
btl_draw_menu_wheel();
break;
case 3:
case 4:
case 5:
case 6:
case 10:
case 11:
case 12:
case 13:
case 14:
case 20:
case 21:
case 22:
case 23:
case 24:
case 30:
case 31:
case 32:
case 33:
case 34:
case 40:
case 41:
case 42:
case 43:
case 44:
case 51:
case 52:
case 53:
case 54:
case 61:
case 62:
case 63:
case 64:
case 65:
case 200:
case 201:
case BATTLE_STATE2_UNK_3:
case BATTLE_STATE2_UNK_4:
case BATTLE_STATE2_UNK_5:
case BATTLE_STATE2_UNK_6:
case BATTLE_STATE2_PLAYER_DEFEATED:
case BATTLE_STATE2_UNK_B:
case BATTLE_STATE2_UNK_C:
case BATTLE_STATE2_UNK_D:
case BATTLE_STATE2_UNK_E:
case BATTLE_STATE2_UNK_14:
case BATTLE_STATE2_UNK_15:
case BATTLE_STATE2_UNK_16:
case BATTLE_STATE2_UNK_17:
case BATTLE_STATE2_UNK_18:
case BATTLE_STATE2_UNK_1E:
case BATTLE_STATE2_UNK_1F:
case BATTLE_STATE2_UNK_20:
case BATTLE_STATE2_UNK_21:
case BATTLE_STATE2_UNK_22:
case BATTLE_STATE2_UNK_28:
case BATTLE_STATE2_UNK_29:
case BATTLE_STATE2_UNK_2A:
case BATTLE_STATE2_UNK_2B:
case BATTLE_STATE2_UNK_2C:
case BATTLE_STATE2_UNK_33:
case BATTLE_STATE2_UNK_34:
case BATTLE_STATE2_UNK_35:
case BATTLE_STATE2_UNK_36:
case BATTLE_STATE2_UNK_3D:
case BATTLE_STATE2_UNK_3E:
case BATTLE_STATE2_UNK_3F:
case BATTLE_STATE2_UNK_40:
case BATTLE_STATE2_UNK_41:
case BATTLE_STATE2_UNK_C8:
case BATTLE_STATE2_UNK_C9:
btl_draw_menu_wheel();
break;
case 202:
case BATTLE_STATE2_UNK_CA:
btl_draw_menu_wheel();
break;
case 203:
case BATTLE_STATE2_UNK_CB:
btl_draw_menu_wheel();
break;
case 204:
case BATTLE_STATE2_UNK_CC:
btl_draw_menu_wheel();
break;
case 205:
case BATTLE_STATE2_UNK_CD:
btl_draw_menu_wheel();
break;
}
@ -982,38 +1207,179 @@ s32 func_802A9B30(void) {
return (gBattleStatus.flags2 & BS_FLAGS2_4) <= 0;
}
INCLUDE_ASM(s32, "415D90", btl_state_update_peach_menu);
// Needs the above jtbl to be decompiled and then this will work
// Ordering shenanigans
#ifdef NON_MATCHING
void btl_state_draw_peach_menu(void) {
void btl_state_update_peach_menu(void) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* player = battleStatus->playerActor;
Actor* partner = battleStatus->partnerActor;
s32 temp_s0_2;
s32 phi_v0;
switch (gBattleState2) {
case 0:
func_8024E40C(2);
btl_cam_move(0xA);
if (!(gBattleStatus.flags1 & 0x100000)) {
gBattleState2 = 0xB;
break;
}
player->state.currentPos.x = player->homePos.x;
player->state.currentPos.z = player->homePos.z;
gBattleState2 = 0xA;
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 10:
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;
partner->currentPos.x += (player->state.currentPos.x - partner->currentPos.x) / player->state.moveTime;
partner->currentPos.z += (player->state.currentPos.z - partner->currentPos.z) / player->state.moveTime;
}
player->currentPos.z -= sin_rad(player->state.angle * TAU / 360.0f) * 16.0f;
player->yaw = clamp_angle(-player->state.angle);
partner->currentPos.z += sin_rad(player->state.angle * TAU / 360.0f) * 16.0f;
partner->yaw = clamp_angle(-player->state.angle);
player->state.angle += 90.0f;
if (player->state.moveTime != 0) {
player->state.moveTime--;
break;
}
player->currentPos.x = player->state.goalPos.x;
player->currentPos.z = player->state.goalPos.z;
partner->currentPos.x = player->state.currentPos.x;
partner->currentPos.z = player->state.currentPos.z;
player->homePos.x = player->currentPos.x;
player->homePos.z = player->currentPos.z;
partner->homePos.x = partner->currentPos.x;
partner->homePos.z = partner->currentPos.z;
gBattleStatus.flags1 &= ~0x100000;
case 11:
gBattleStatus.flags1 |= 2;
player->flags &= ~0x4000000;
player->flags |= 0x08000000;
if (partner != NULL) {
partner->flags |= 0x4000000;
partner->flags |= 0x08000000;
}
battleStatus->selectedMoveID = 0;
battle_menu_submenuIDs = 8;
battle_menu_isEnabled = TRUE;
battle_menu_isMessageDisabled = 0;
main_battle_menu_JumpHudScripts = battle_menu_PeachStarPowerHudScripts[0];
battle_menu_messageIDs = D_802AB728[0];
if (!(battleStatus->menuDisableFlags & 0x100)) {
battle_menu_isEnabled = FALSE;
battle_menu_isMessageDisabled = 0x48;
main_battle_menu_JumpHudScripts = battle_menu_PeachStarPowerHudScripts[1];
}
if (func_802A9B30()) {
D_802AD104 = 1;
phi_v0 = 2 - 0;
main_menu_numOptions = 1;
} else {
D_802AD104 = 0;
phi_v0 = 2 - 0;
main_menu_numOptions = 1;
}
D_802AD0A8 = 0;
D_802AD0B0 = 0;
D_802AD100 = phi_v0;
func_802A1000();
D_802ACC60 = 8;
gBattleState2 = 1;
break;
case 1:
btl_draw_menu_wheel();
set_animation(0, 0, 0xC0009);
temp_s0_2 = func_802A11B0();
if (D_802ACC60 != 0) {
D_802ACC60--;
break;
}
if (temp_s0_2 != 0) {
set_animation(0, 0, 0xA0002);
battleStatus->currentSubmenu = D_802AD0BB[temp_s0_2 - 1];
func_802A1030();
D_802ACC60 = 8;
D_802ACC6C = 4;
gBattleState2 = 2;
}
break;
case 2:
btl_draw_menu_wheel();
break;
case 3:
btl_draw_menu_wheel();
if (func_802A11B0() != 0) {
battleStatus->unk_6C = 4;
battleStatus->unk_6E = 5;
battleStatus->moveCategory = 8;
battleStatus->selectedMoveID = 0x81;
battleStatus->selectedItemID = 0xA;
battleStatus->currentTargetListFlags = D_8008FA78;
btl_set_state(0x11);
}
break;
case 4:
btl_draw_menu_wheel();
func_802A1050();
gBattleState2 = 1;
btl_state_update_peach_menu();
btl_state_update_peach_menu();
break;
case 5:
btl_draw_menu_wheel();
func_802A10B8();
break;
case 6:
case 7:
case 8:
btl_show_variable_battle_message(0x50, 60, 0);
D_802AD607 = 1;
gBattleState2 = 9;
break;
case 9:
if (!btl_is_popup_displayed()) {
D_802AD607 = 0;
D_802ACC60 = 0;
gBattleState2 = 1;
}
break;
}
}
#else
INCLUDE_ASM(s32, "415D90", btl_state_draw_peach_menu);
INCLUDE_ASM(s32, "415D90", btl_state_update_peach_menu);
#endif
void btl_state_draw_peach_menu(void) {
switch (gBattleState2) {
case BATTLE_STATE2_UNK_1:
btl_draw_menu_wheel();
break;
case BATTLE_STATE2_UNK_2:
btl_draw_menu_wheel();
break;