Skip to content

Commit 0fb8332

Browse files
authored
Merge pull request #106 from JCog/spin-trainer
Spin Trainer
2 parents 53eb2f5 + ea36e6a commit 0fb8332

17 files changed

Lines changed: 609 additions & 77 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ venv/
99
*.bin
1010
.ninja_*
1111
build.ninja
12+
CMakeLists.txt
1213
romc

lib/libpm-jp.a

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pm_gPopupState = 0x8010D800;
3030
pm_gPartnerStatus = 0x8010ED70;
3131
pm_gUiStatus = 0x8010F118;
3232
pm_gPlayerStatus = 0x8010F188;
33+
pm_gPlayerSpinState = 0x8010F410;
34+
pm_gPlayerData = 0x8010F450;
3335
pm_gHudElementSizes = 0x8015406C;
3436
pm_MusicCurrentVolume = 0x8015EA66;
3537
pm_gActionCommandStatus = 0x8029FED0;

lib/libpm-us.a

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pm_gPopupState = 0x8010D640;
3030
pm_gPartnerStatus = 0x8010EBB0;
3131
pm_gUiStatus = 0x8010EF58;
3232
pm_gPlayerStatus = 0x8010EFC8;
33+
pm_gPlayerSpinState = 0x8010F250;
34+
pm_gPlayerData = 0x8010F290;
3335
pm_gHudElementSizes = 0x8014EFCC;
3436
pm_MusicCurrentVolume = 0x80159AE6;
3537
pm_gActionCommandStatus = 0x8029FBE0;

src/enums.h

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,65 @@
11
#ifndef ENUMS_H
22
#define ENUMS_H
33

4+
enum Abilities {
5+
ABILITY_DODGE_MASTER = 0x00000000,
6+
ABILITY_UNUSED = 0x00000001,
7+
ABILITY_SPIKE_SHIELD = 0x00000002,
8+
ABILITY_FIRST_ATTACK = 0x00000003,
9+
ABILITY_HP_PLUS = 0x00000004,
10+
ABILITY_DOUBLE_DIP = 0x00000005,
11+
ABILITY_MYSTERY_SCROLL = 0x00000006,
12+
ABILITY_FIRE_SHIELD = 0x00000007,
13+
ABILITY_PRETTY_LUCKY = 0x00000008,
14+
ABILITY_HP_DRAIN = 0x00000009,
15+
ABILITY_ALL_OR_NOTHING = 0x0000000A,
16+
ABILITY_SLOW_GO = 0x0000000B,
17+
ABILITY_FP_PLUS = 0x0000000C,
18+
ABILITY_ICE_POWER = 0x0000000D,
19+
ABILITY_FEELING_FINE = 0x0000000E,
20+
ABILITY_ATTACK_FX = 0x0000000F,
21+
ABILITY_MONEY_MONEY = 0x00000010,
22+
ABILITY_CHILL_OUT = 0x00000011,
23+
ABILITY_HAPPY_HEART = 0x00000012,
24+
ABILITY_ZAP_TAP = 0x00000013,
25+
ABILITY_MEGA_RUSH = 0x00000014,
26+
ABILITY_BERSERKER = 0x00000015,
27+
ABILITY_RIGHT_ON = 0x00000016,
28+
ABILITY_RUNAWAY_PAY = 0x00000017,
29+
ABILITY_FLOWER_SAVER = 0x00000018,
30+
ABILITY_PAY_OFF = 0x00000019,
31+
ABILITY_QUICK_CHANGE = 0x0000001A,
32+
ABILITY_DEFEND_PLUS = 0x0000001B,
33+
ABILITY_POWER_PLUS = 0x0000001C,
34+
ABILITY_REFUND = 0x0000001D,
35+
ABILITY_POWER_RUSH = 0x0000001E,
36+
ABILITY_CRAZY_HEART = 0x0000001F,
37+
ABILITY_LAST_STAND = 0x00000020,
38+
ABILITY_CLOSE_CALL = 0x00000021,
39+
ABILITY_P_UP_D_DOWN = 0x00000022,
40+
ABILITY_LUCKY_DAY = 0x00000023,
41+
ABILITY_MEGA_HP_DRAIN = 0x00000024,
42+
ABILITY_P_DOWN_D_UP = 0x00000025,
43+
ABILITY_FLOWER_FANATIC = 0x00000026,
44+
ABILITY_SPEEDY_SPIN = 0x00000027,
45+
ABILITY_SPIN_ATTACK = 0x00000028,
46+
ABILITY_I_SPY = 0x00000029,
47+
ABILITY_BUMP_ATTACK = 0x0000002A,
48+
ABILITY_HEART_FINDER = 0x0000002B,
49+
ABILITY_FLOWER_FINDER = 0x0000002C,
50+
ABILITY_DIZZY_ATTACK = 0x0000002D,
51+
ABILITY_FINAL_GOOMPA = 0x0000002E,
52+
ABILITY_FINAL_BOBOMB = 0x0000002F,
53+
ABILITY_DEEP_FOCUS = 0x00000030,
54+
ABILITY_SUPER_FOCUS = 0x00000031,
55+
ABILITY_KAIDEN = 0x00000032,
56+
ABILITY_DAMAGE_DODGE = 0x00000033,
57+
ABILITY_HAPPY_FLOWER = 0x00000034,
58+
ABILITY_GROUP_FOCUS = 0x00000035,
59+
ABILITY_PEEKABOO = 0x00000036,
60+
ABILITY_HEALTHY_HEALTHY = 0x00000037,
61+
};
62+
463
enum ActionStates {
564
ACTION_STATE_IDLE,
665
ACTION_STATE_WALK,
@@ -881,4 +940,51 @@ enum PlayerStatusFlags {
881940
PS_FLAG_ACTION_STATE_CHANGED = 0x80000000,
882941
};
883942

943+
enum PlayerStatusAnimFlags {
944+
/* Whether Mario is in the process of using Watt (but isn't necessarily holding them yet) */
945+
PA_FLAG_USING_WATT = 0x00000001,
946+
/* Whether Watt is actually in Mario's hands at the moment */
947+
PA_FLAG_WATT_IN_HANDS = 0x00000002,
948+
PA_FLAG_INTERRUPT_USE_PARTNER =
949+
0x00000004, ///< forces actions with bow, parakarry, watt, and lakilester to end (sushie not tested)
950+
PA_FLAG_FORCE_USE_PARTNER = 0x00000008, ///< triggers partner use when set
951+
PA_FLAG_INTERACT_PROMPT_AVAILABLE = 0x00000010, ///< ! prompt
952+
PA_FLAG_SPEECH_PROMPT_AVAILABLE = 0x00000020, ///< (...) prompt
953+
PA_FLAG_PULSE_STONE_VISIBLE = 0x00000040, ///< The pulse stone icon is being shown
954+
PA_FLAG_USING_PULSE_STONE = 0x00000080,
955+
PA_FLAG_ISPY_VISIBLE = 0x00000100, ///< The I Spy icon is being shown
956+
PA_FLAG_RAISED_ARMS = 0x00000200, ///< Sets action state to ACTION_STATE_RAISE_ARMS on idle
957+
PA_FLAG_SHIVERING = 0x00000400,
958+
PA_FLAG_OPENED_HIDDEN_PANEL = 0x00000800,
959+
PA_FLAG_USING_PEACH_PHYSICS = 0x00001000,
960+
PA_FLAG_INVISIBLE = 0x00002000,
961+
PA_FLAG_8BIT_MARIO = 0x00004000,
962+
PA_FLAG_NPC_COLLIDED = 0x00008000,
963+
PA_FLAG_SPINNING = 0x00010000,
964+
/* Began an encounter by spinning into an enemy with the Dizzy Attack badge on */
965+
PA_FLAG_DIZZY_ATTACK_ENCOUNTER = 0x00020000,
966+
PA_FLAG_INTERRUPT_SPIN = 0x00040000,
967+
/* When Mario is in a transition to a new map, either through a loading zone or pipe */
968+
PA_FLAG_CHANGING_MAP = 0x00100000,
969+
/* Occurs after PA_FLAG_FORCE_USE_PARTNER. Some partners - namely Bow and Lakilester, unset this immediately.
970+
Not sure why - seems like it might contribute to being unable to *stop* using your partner during a cutscene. */
971+
PA_FLAG_PARTNER_USAGE_FORCED = 0x00200000,
972+
PA_FLAG_RIDING_PARTNER = 0x00400000,
973+
PA_FLAG_ABORT_PUSHING_BLOCK = 0x00800000,
974+
/* Changes how Mario is rendered. Seems to be intended to make Mario's depth render properly when using Bow behind a
975+
* switch (two translucent objects on top of eachother), but it doesn't actually work. */
976+
PA_FLAG_MAP_HAS_SWITCH = 0x01000000,
977+
/* Usually, if Mario falls for too long, he eventually gets reset to his last safe position. This prevents that.
978+
* Used by some scripts. */
979+
PA_FLAG_NO_OOB_RESPAWN = 0x10000000,
980+
/* This allows dismounting from Lakilester, even if in a precarious situation (like over spikes, lava, or water). */
981+
PA_FLAG_DISMOUNTING_ALLOWED = 0x20000000,
982+
/* This flag is set when partner usage was interrupted by a script, and it prevents menu sounds (like the error
983+
* sound) from playing for script-initiated player actions */
984+
PA_FLAG_FORCED_PARTNER_ABILITY_END = 0x40000000,
985+
/* This one's really weird. Seems to have something to do with the direction Mario is facing, but I'm not sure what
986+
* it's actually supposed to be achieving. */
987+
PA_FLAG_80000000 = 0x80000000,
988+
};
989+
884990
#endif

src/fp.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,26 +299,26 @@ void fpDrawTimer(struct GfxFont *font, s32 cellWidth, s32 cellHeight, u8 menuAlp
299299
void fpUpdateCheats(void) {
300300
pm_gGameStatus.debugEnemyContact = settings->cheatEnemyContact;
301301
if (CHEAT_ACTIVE(CHEAT_HP)) {
302-
pm_gPlayerStatus.playerData.curHP = pm_gPlayerStatus.playerData.curMaxHP;
302+
pm_gPlayerData.curHP = pm_gPlayerData.curMaxHP;
303303
}
304304
if (CHEAT_ACTIVE(CHEAT_FP)) {
305-
pm_gPlayerStatus.playerData.curFP = pm_gPlayerStatus.playerData.curMaxFP;
305+
pm_gPlayerData.curFP = pm_gPlayerData.curMaxFP;
306306
}
307307
if (CHEAT_ACTIVE(CHEAT_ATTACK)) {
308308
pm_gBattleStatus.merleeAttackBoost = 127;
309309
}
310310
if (CHEAT_ACTIVE(CHEAT_COINS)) {
311-
pm_gPlayerStatus.playerData.coins = 999;
311+
pm_gPlayerData.coins = 999;
312312
}
313313
if (CHEAT_ACTIVE(CHEAT_STAR_POWER)) {
314-
pm_gPlayerStatus.playerData.starPowerFullBars = pm_gPlayerStatus.playerData.maxStarPower;
315-
pm_gPlayerStatus.playerData.starPowerPartialBars = 0;
314+
pm_gPlayerData.starPowerFullBars = pm_gPlayerData.maxStarPower;
315+
pm_gPlayerData.starPowerPartialBars = 0;
316316
}
317317
if (CHEAT_ACTIVE(CHEAT_STAR_PIECES)) {
318-
pm_gPlayerStatus.playerData.starPieces = 160;
318+
pm_gPlayerData.starPieces = 160;
319319
}
320320
if (CHEAT_ACTIVE(CHEAT_PERIL)) {
321-
pm_gPlayerStatus.playerData.curHP = 1;
321+
pm_gPlayerData.curHP = 1;
322322
}
323323
if (CHEAT_ACTIVE(CHEAT_AUTO_MASH)) {
324324
if (pm_gGameStatus.isBattle == 1) {
@@ -559,6 +559,10 @@ void fpDraw(void) {
559559
trainerDrawPinned(settings->trainerX, settings->trainerY, font, cellWidth, cellHeight, 0xC0C0C0, menuAlpha);
560560
}
561561

562+
if (fp.spinTrainerMoving || (settings->trainerSpinBarEnabled && !fp.menuActive && pm_gGameStatus.isBattle == 0)) {
563+
trainerDrawSpinBar(settings->trainerSpinX, settings->trainerSpinY, font, 0xC0C0C0, menuAlpha);
564+
}
565+
562566
if (!fp.versionShown) {
563567
fpDrawVersion(font, cellWidth, cellHeight, menuAlpha);
564568
}

src/fp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ typedef struct {
4242
s32 cpuCounterFreq;
4343
bool timerMoving;
4444
bool trainerMoving;
45+
bool spinTrainerMoving;
4546
bool menuActive;
4647
struct LogEntry log[SETTINGS_LOG_MAX];
4748
Vec3f savedPos;

src/fp/player/fp_player.c

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ static struct GfxTexture **getItemTextureList(void) {
5050
}
5151

5252
static s32 maxHpProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
53-
s8 *curMaxHP = &pm_gPlayerStatus.playerData.curMaxHP;
54-
s8 *hardMaxHP = &pm_gPlayerStatus.playerData.hardMaxHP;
53+
s8 *curMaxHP = &pm_gPlayerData.curMaxHP;
54+
s8 *hardMaxHP = &pm_gPlayerData.hardMaxHP;
5555
if (reason == MENU_CALLBACK_THINK_INACTIVE) {
5656
if (menuIntinputGet(item) != *curMaxHP) {
5757
menuIntinputSet(item, *curMaxHP);
@@ -69,8 +69,8 @@ static s32 maxHpProc(struct MenuItem *item, enum MenuCallbackReason reason, void
6969
}
7070

7171
static s32 maxFpProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
72-
s8 *curMaxFP = &pm_gPlayerStatus.playerData.curMaxFP;
73-
s8 *hardMaxFP = &pm_gPlayerStatus.playerData.hardMaxFP;
72+
s8 *curMaxFP = &pm_gPlayerData.curMaxFP;
73+
s8 *hardMaxFP = &pm_gPlayerData.hardMaxFP;
7474
if (reason == MENU_CALLBACK_THINK_INACTIVE) {
7575
if (menuIntinputGet(item) != *curMaxFP) {
7676
menuIntinputSet(item, *curMaxFP);
@@ -89,16 +89,16 @@ static s32 maxFpProc(struct MenuItem *item, enum MenuCallbackReason reason, void
8989

9090
static s32 currentPartnerProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
9191
if (reason == MENU_CALLBACK_THINK_INACTIVE) {
92-
menuOptionSet(item, partnerOrder[pm_gPlayerStatus.playerData.currentPartner]);
92+
menuOptionSet(item, partnerOrder[pm_gPlayerData.currentPartner]);
9393
} else if (reason == MENU_CALLBACK_DEACTIVATE) {
94-
pm_gPlayerStatus.playerData.currentPartner = partnerOrder[menuOptionGet(item)];
94+
pm_gPlayerData.currentPartner = partnerOrder[menuOptionGet(item)];
9595
}
9696
return 0;
9797
}
9898

9999
static s32 bootsProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
100100
u32 trackedLevel = (u32)data;
101-
s8 *bootsUpgrade = &pm_gPlayerStatus.playerData.bootsLevel;
101+
s8 *bootsUpgrade = &pm_gPlayerData.bootsLevel;
102102
if (reason == MENU_CALLBACK_SWITCH_ON) {
103103
*bootsUpgrade = trackedLevel;
104104
} else if (reason == MENU_CALLBACK_THINK) {
@@ -109,7 +109,7 @@ static s32 bootsProc(struct MenuItem *item, enum MenuCallbackReason reason, void
109109

110110
static s32 hammerProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
111111
u32 trackedLevel = (u32)data;
112-
s8 *hammerUpgrade = &pm_gPlayerStatus.playerData.hammerLevel;
112+
s8 *hammerUpgrade = &pm_gPlayerData.hammerLevel;
113113
if (reason == MENU_CALLBACK_SWITCH_ON) {
114114
*hammerUpgrade = trackedLevel;
115115
} else if (reason == MENU_CALLBACK_SWITCH_OFF) {
@@ -149,8 +149,8 @@ static s32 ultraRankProc(struct MenuItem *item, enum MenuCallbackReason reason,
149149
}
150150

151151
static s32 starSpiritSwitchProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
152-
s8 *ssSaved = &pm_gPlayerStatus.playerData.maxStarPower;
153-
s16 *starPower = &pm_gPlayerStatus.playerData.starPower;
152+
s8 *ssSaved = &pm_gPlayerData.maxStarPower;
153+
s16 *starPower = &pm_gPlayerData.starPower;
154154
s32 ssIndex = (u32)data;
155155
if (reason == MENU_CALLBACK_SWITCH_ON) {
156156
*ssSaved = ssIndex;
@@ -252,7 +252,7 @@ static void createStatsMenu(struct Menu *menu) {
252252
s32 hpX = 1;
253253
s32 hpY = 2;
254254
menuAddStaticIcon(menu, hpX, hpY, texHeart, 0, 0xFFFFFF, 1.0f);
255-
item = menuAddIntinput(menu, hpX + 2, hpY, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.curHP);
255+
item = menuAddIntinput(menu, hpX + 2, hpY, 10, 2, menuByteModProc, &pm_gPlayerData.curHP);
256256
item->tooltip = strHp;
257257
menuAddStatic(menu, hpX + 4, hpY, "/", 0xC0C0C0);
258258
item = menuAddIntinput(menu, hpX + 5, hpY, 10, 2, maxHpProc, NULL);
@@ -261,7 +261,7 @@ static void createStatsMenu(struct Menu *menu) {
261261
s32 fpX = 1;
262262
s32 fpY = 4;
263263
menuAddStaticIcon(menu, fpX, fpY, texFlower, 0, 0xFFFFFF, 1.0f);
264-
item = menuAddIntinput(menu, fpX + 2, fpY, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.curFP);
264+
item = menuAddIntinput(menu, fpX + 2, fpY, 10, 2, menuByteModProc, &pm_gPlayerData.curFP);
265265
item->tooltip = strFp;
266266
menuAddStatic(menu, fpX + 4, fpY, "/", 0xC0C0C0);
267267
item = menuAddIntinput(menu, fpX + 5, fpY, 10, 2, maxFpProc, NULL);
@@ -270,40 +270,37 @@ static void createStatsMenu(struct Menu *menu) {
270270
s32 bpX = 1;
271271
s32 bpY = 6;
272272
menuAddStaticIcon(menu, bpX, bpY, texBpIcon, 0, 0xFFFFFF, 1.0f);
273-
item = menuAddIntinput(menu, bpX + 2, bpY, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.maxBP);
273+
item = menuAddIntinput(menu, bpX + 2, bpY, 10, 2, menuByteModProc, &pm_gPlayerData.maxBP);
274274
item->tooltip = strBp;
275275

276276
s32 coinX = 10;
277277
s32 coinY = 2;
278278
menuAddStaticIcon(menu, coinX, coinY, texCoin, 0, 0xFFFFFF, 1.0f);
279-
item = menuAddIntinput(menu, coinX + 2, coinY, 10, 3, menuHalfwordModProc, &pm_gPlayerStatus.playerData.coins);
279+
item = menuAddIntinput(menu, coinX + 2, coinY, 10, 3, menuHalfwordModProc, &pm_gPlayerData.coins);
280280
item->tooltip = strCoins;
281281

282282
s32 starPieceX = 10;
283283
s32 starPieceY = 4;
284284
menuAddStaticIcon(menu, starPieceX, starPieceY, texStarPiece, 0, 0xFFFFFF, 1.0f);
285-
item = menuAddIntinput(menu, starPieceX + 2, starPieceY, 10, 3, menuByteModProc,
286-
&pm_gPlayerStatus.playerData.starPieces);
285+
item = menuAddIntinput(menu, starPieceX + 2, starPieceY, 10, 3, menuByteModProc, &pm_gPlayerData.starPieces);
287286
item->tooltip = strStarPieces;
288287

289288
s32 levelX = 17;
290289
s32 levelY = 2;
291290
menuAddStaticIcon(menu, levelX, levelY, texMarioHead, 0, 0xFFFFFF, 1.0f);
292-
item = menuAddIntinput(menu, levelX + 2, levelY, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.level);
291+
item = menuAddIntinput(menu, levelX + 2, levelY, 10, 2, menuByteModProc, &pm_gPlayerData.level);
293292
item->tooltip = strLevel;
294293

295294
s32 starPointX = 17;
296295
s32 starPointY = 4;
297296
menuAddStaticIcon(menu, starPointX, starPointY, texStarPoint, 0, 0xFFFFFF, 1.0f);
298-
item = menuAddIntinput(menu, starPointX + 2, starPointY, 10, 2, menuByteModProc,
299-
&pm_gPlayerStatus.playerData.starPoints);
297+
item = menuAddIntinput(menu, starPointX + 2, starPointY, 10, 2, menuByteModProc, &pm_gPlayerData.starPoints);
300298
item->tooltip = strStarPoints;
301299

302300
s32 actionCommandX = 23;
303301
s32 actionCommandY = 2;
304-
item =
305-
menuAddSwitch(menu, actionCommandX, actionCommandY, texLuckyStar, 0, 0, 0xFFFFFF, texLuckyStar, 0, 1, 0xFFFFFF,
306-
0.7f, FALSE, menuByteSwitchToggleProc, &pm_gPlayerStatus.playerData.hasActionCommands);
302+
item = menuAddSwitch(menu, actionCommandX, actionCommandY, texLuckyStar, 0, 0, 0xFFFFFF, texLuckyStar, 0, 1,
303+
0xFFFFFF, 0.7f, FALSE, menuByteSwitchToggleProc, &pm_gPlayerData.hasActionCommands);
307304
item->tooltip = strActionCommands;
308305
}
309306

@@ -348,19 +345,17 @@ static void createPartyMenu(struct Menu *menu) {
348345

349346
partners[i] = menuAddSwitch(menu, partnerX, partnerY, texPartner, i + 1, 0, 0xFFFFFF, texPartner, i + 1, 1,
350347
0xFFFFFF, scale, FALSE, menuByteSwitchToggleProc,
351-
&pm_gPlayerStatus.playerData.partners[partnerOrder[i + 1]].enabled);
348+
&pm_gPlayerData.partners[partnerOrder[i + 1]].enabled);
352349
partners[i]->tooltip = strPartnerNames[i];
353350

354351
// super tex
355-
superRanks[i] =
356-
menuAddSwitch(menu, partnerX + 2, partnerY, texRank, 0, 0, 0xFFFFFF, texRank, 0, 1, 0xFFFFFF, scale, FALSE,
357-
superRankProc, &pm_gPlayerStatus.playerData.partners[partnerOrder[i + 1]]);
352+
superRanks[i] = menuAddSwitch(menu, partnerX + 2, partnerY, texRank, 0, 0, 0xFFFFFF, texRank, 0, 1, 0xFFFFFF,
353+
scale, FALSE, superRankProc, &pm_gPlayerData.partners[partnerOrder[i + 1]]);
358354
superRanks[i]->tooltip = strSuperRank;
359355

360356
// ultra tex
361-
ultraRanks[i] =
362-
menuAddSwitch(menu, partnerX + 3, partnerY, texRank, 0, 0, 0xFFFFFF, texRank, 0, 1, 0xFFFFFF, scale, FALSE,
363-
ultraRankProc, &pm_gPlayerStatus.playerData.partners[partnerOrder[i + 1]]);
357+
ultraRanks[i] = menuAddSwitch(menu, partnerX + 3, partnerY, texRank, 0, 0, 0xFFFFFF, texRank, 0, 1, 0xFFFFFF,
358+
scale, FALSE, ultraRankProc, &pm_gPlayerData.partners[partnerOrder[i + 1]]);
364359
ultraRanks[i]->tooltip = strUltraRank;
365360
}
366361
menuItemAddChainLink(activeItem, partners[0], MENU_NAVIGATE_DOWN);
@@ -399,7 +394,7 @@ static void createStarSpiritMenu(struct Menu *menu) {
399394
s8 beamPalettes[] = {1, 0, 0};
400395
u32 beamColors[] = {0xFFFFFF, 0xFFFFFF, 0xFFFFFF};
401396
struct MenuItem *item = menuAddCycle(menu, ssX, ssY, 3, beamTextures, beamTiles, beamPalettes, beamColors, scale,
402-
FALSE, menuByteCycleProc, &pm_gPlayerStatus.playerData.starBeamLevel);
397+
FALSE, menuByteCycleProc, &pm_gPlayerData.starBeamLevel);
403398
item->tooltip = strStarPeachBeam;
404399
menuItemCreateChain(starSpirits, 8, MENU_NAVIGATE_RIGHT, FALSE, FALSE);
405400
menuItemCreateChain(starSpirits, 8, MENU_NAVIGATE_LEFT, FALSE, TRUE);
@@ -438,13 +433,13 @@ static void createMerleeMenu(struct Menu *menu) {
438433
"+3 DEF\0"
439434
"EXP x2\0"
440435
"Coins x2\0",
441-
menuByteOptionmodProc, &pm_gPlayerStatus.playerData.merleeSpellType);
436+
menuByteOptionmodProc, &pm_gPlayerData.merleeSpellType);
442437

443438
menuAddStatic(menu, 0, yValue, "casts remaining", 0xC0C0C0);
444-
menuAddIntinput(menu, 16, yValue++, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.merleeCastsRemaining);
439+
menuAddIntinput(menu, 16, yValue++, 10, 2, menuByteModProc, &pm_gPlayerData.merleeCastsRemaining);
445440

446441
menuAddStatic(menu, 0, yValue, "turns remaining", 0xC0C0C0);
447-
menuAddIntinput(menu, 16, yValue++, 10, 3, menuHalfwordModProc, &pm_gPlayerStatus.playerData.merleeTurnCount);
442+
menuAddIntinput(menu, 16, yValue++, 10, 3, menuHalfwordModProc, &pm_gPlayerData.merleeTurnCount);
448443
}
449444

450445
struct Menu *createPlayerMenu(void) {

src/fp/player/items.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ static s16 *itemSlotToUpdate;
442442

443443
static s32 badgeProcSwitch(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
444444
u32 badgeId = (u32)data;
445-
s16 *badgeList = pm_gPlayerStatus.playerData.badges;
445+
s16 *badgeList = pm_gPlayerData.badges;
446446
if (reason == MENU_CALLBACK_SWITCH_ON) {
447447
for (u16 i = 0; i < 128; i++) {
448448
if (badgeList[i] == 0) {
@@ -457,8 +457,8 @@ static s32 badgeProcSwitch(struct MenuItem *item, enum MenuCallbackReason reason
457457
}
458458
}
459459
for (u16 i = 0; i < 64; i++) {
460-
if (pm_gPlayerStatus.playerData.equippedBadges[i] == badgeId) {
461-
pm_gPlayerStatus.playerData.equippedBadges[i] = 0;
460+
if (pm_gPlayerData.equippedBadges[i] == badgeId) {
461+
pm_gPlayerData.equippedBadges[i] = 0;
462462
}
463463
}
464464
} else if (reason == MENU_CALLBACK_THINK) {

0 commit comments

Comments
 (0)