From 68f07e4bb1a80091dcef6907b77122e2d974bc63 Mon Sep 17 00:00:00 2001 From: JCog <42006114+JCog@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:35:00 -0500 Subject: [PATCH] format --- src/fp/warps/bosses.c | 25 +++++++------------------ src/pm64.h | 35 ++++++++++++++--------------------- 2 files changed, 21 insertions(+), 39 deletions(-) diff --git a/src/fp/warps/bosses.c b/src/fp/warps/bosses.c index f3a6f5c5..3aa5bde5 100644 --- a/src/fp/warps/bosses.c +++ b/src/fp/warps/bosses.c @@ -95,14 +95,8 @@ static BattlePage pageDojo = { }; // clang-format on -static BattlePage *pageList[] = { - &pageBowser, - &pageChapterBosses, - &pageJrTroopa, - &pageMinorBosses, - &pageOptionalBosses, - &pageDojo, -}; +static BattlePage *pageList[] = {&pageBowser, &pageChapterBosses, &pageJrTroopa, + &pageMinorBosses, &pageOptionalBosses, &pageDojo}; pm_Npc bossesDummyNpc = {0}; @@ -110,12 +104,7 @@ static pm_Enemy dummyEnemy = { .npcID = BOSSES_DUMMY_ID, }; -static pm_Encounter dummyEncounter = { - .enemy[0] = &dummyEnemy, - .count = 0, - .battle = 0, - .stage = 0 -}; +static pm_Encounter dummyEncounter = {.enemy[0] = &dummyEnemy, .count = 0, .battle = 0, .stage = 0}; static s8 warpCountdown = 0; static bool leavingBattle = FALSE; @@ -137,7 +126,7 @@ static void bossWarp() { es->scriptedBattle = TRUE; es->songID = info.songId; - pm_gEncounterState = 3; // ENCOUNTER_STATE_PRE_BATTLE + pm_gEncounterState = 3; // ENCOUNTER_STATE_PRE_BATTLE pm_gEncounterSubState = 0; // ENCOUNTER_SUBSTATE_PRE_BATTLE_INIT warpCountdown = 31; // may want to try and clear speech bubbles, but it doesn't seem to crash, so not worried for now @@ -154,7 +143,7 @@ static void bossWarpProc(struct MenuItem *item, void *data) { // isBattle is also true when paused, so checking game mode if (pm_gGameStatus.isBattle && pm_gameMode != 10 && pm_gameMode != 11) { // end battle cleanly so next fight can start fresh - pm_gBattleState = 32; // BATTLE_STATE_END_BATTLE + pm_gBattleState = 32; // BATTLE_STATE_END_BATTLE pm_gBattleSubState = 2; // BTL_SUBSTATE_END_BATTLE_EXEC_STAGE_SCRIPT pm_bgm_pop_battle_song(); leavingBattle = TRUE; @@ -180,7 +169,7 @@ void battleUpdateWarps() { // delay countdown until unpaused warpCountdown--; } - } else if (warpCountdown > 0){ + } else if (warpCountdown > 0) { warpCountdown--; } } @@ -205,7 +194,7 @@ void createBossesMenu(struct Menu *menu) { for (u8 battleIdx = 0; battleIdx < battlePage->battleCount; battleIdx++) { s32 data = pageIdx << 8; data |= battleIdx; - menuAddButton(page, 0, yTab++, battlePage->battles[battleIdx].name, bossWarpProc, (void*)data); + menuAddButton(page, 0, yTab++, battlePage->battles[battleIdx].name, bossWarpProc, (void *)data); } if (pageIdx == 0) { yTab++; diff --git a/src/pm64.h b/src/pm64.h index 20d7b84a..de1466ff 100644 --- a/src/pm64.h +++ b/src/pm64.h @@ -829,11 +829,11 @@ typedef struct pm_Enemy { /* 0x00 */ s32 flags; /* 0x04 */ s8 encounterIndex; /* 0x05 */ s8 encountered; - /* 0x06 */ u8 scriptGroup; /* scripts launched for this npc controller will be assigned this group */ + /* 0x06 */ u8 scriptGroup; /* scripts launched for this npc controller will be assigned this group */ /* 0x07 */ s8 hitboxIsActive; // when set, contact will trigger a first strike /* 0x08 */ s16 npcID; /* 0x0A */ s16 spawnPos[3]; - /* 0x10 */ Vec3s unk_10; //TODO hitbox pos? + /* 0x10 */ Vec3s unk_10; // TODO hitbox pos? /* 0x16 */ char unk_16[2]; /* 0x18 */ void *npcSettings; /* 0x1C */ void *initBytecode; @@ -857,19 +857,19 @@ typedef struct pm_Enemy { /* 0x64 */ void *unk_64; /* 0x68 */ char unk_68[4]; /* 0x6C */ union { - /* */ s32 varTable[16]; - /* */ f32 varTableF[16]; - /* */ void *varTablePtr[16]; + /* */ s32 varTable[16]; + /* */ f32 varTableF[16]; + /* */ void *varTablePtr[16]; /* */ }; /* 0xAC */ u8 aiDetectFlags; // detect player flags: 1 = require line of sight | 2 = adjust hitbox for moving player /* 0xAD */ char unk_AD[3]; /* 0xB0 */ u32 aiFlags; /* 0xB4 */ s8 aiSuspendTime; - /* 0xB5 */ s8 instigatorValue; // value is passed to first actor in formation if a battle is triggered with this enemy + /* 0xB5 */ s8 instigatorValue; // value passed to first actor in formation if battle triggered with this enemy /* 0xB6 */ char unk_B6[2]; - /* 0xB8 */ void *unk_B8; // some bytecode + /* 0xB8 */ void *unk_B8; // some bytecode /* 0xBC */ struct pm_Evt *unk_BC; // some script - /* 0xC0 */ s32 unk_C0; // some script ID + /* 0xC0 */ s32 unk_C0; // some script ID /* 0xC4 */ s32 unk_C4; /* 0xC8 */ s32 unk_C8; /* 0xCC */ s32 *animList; @@ -896,17 +896,17 @@ typedef struct pm_FieldStatus { /* 0x02 */ s16 duration; } pm_FieldStatus; -typedef struct pm_EncounterStatus{ +typedef struct pm_EncounterStatus { /* 0x000 */ s32 flags; /* 0x004 */ s8 firstStrikeType; /* 0 = none, 1 = player, 2 = enemy */ - /* 0x005 */ s8 hitType; /* 1 = none/enemy, 2 = jump */ - /* 0x006 */ s8 hitTier; /* 0 = normal, 1 = super, 2 = ultra */ + /* 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 */ + /* 0x009 */ s8 battleOutcome; /* 0 = won, 1 = lost */ /* 0x00A */ s8 battleTriggerCooldown; ///< set to 15 after victory, 45 after fleeing - /* 0x00B */ bool hasMerleeCoinBonus; /* triple coins when TRUE */ - /* 0x00C */ u8 damageTaken; /* valid after battle */ + /* 0x00B */ bool hasMerleeCoinBonus; /* triple coins when TRUE */ + /* 0x00C */ u8 damageTaken; /* valid after battle */ /* 0x00D */ char unk_0D; /* 0x00E */ s16 coinsEarned; /* valid after battle */ /* 0x010 */ s8 instigatorValue; @@ -1268,13 +1268,6 @@ typedef struct Npc { /* 0x336 */ char unk_336[10]; } pm_Npc; // size = 0x340 -typedef struct pm_NpcBlueprint { - /* 0x00 */ s32 flags; - /* 0x04 */ s32 initialAnim; - /* 0x08 */ void (*onUpdate)(pm_Npc*); - /* 0x0C */ void (*onRender)(pm_Npc*); -} pm_NpcBlueprint; // size = 0x10 - typedef struct Action { /* 0x00 */ void (*update)(void); /* 0x04 */ void *dmaStart;