Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
use_star_powers.c
Go to the documentation of this file.
1#include "common.h"
2#include "ld_addrs.h"
3#include "battle.h"
4#include "sprite/player.h"
5
6#include "sprite/npc/WorldGoombario.h"
7#include "sprite/npc/BattleGoombario.h"
8#include "sprite/npc/BattleKooper.h"
9#include "sprite/npc/BattleBombette.h"
10#include "sprite/npc/BattleParakarry.h"
11#include "sprite/npc/BattleWatt.h"
12#include "sprite/npc/BattleSushie.h"
13#include "sprite/npc/BattleLakilester.h"
14#include "sprite/npc/BattleBow.h"
15
28
30 BTL_MOVE(focus, EVS_UsePower),
31 BTL_MOVE(refresh, EVS_UsePower),
32 BTL_MOVE(lullaby, EVS_UsePower),
33 BTL_MOVE(star_storm, EVS_UsePower),
34 BTL_MOVE(chill_out, EVS_UsePower),
35 BTL_MOVE(smooch, EVS_UsePower),
36 BTL_MOVE(time_out, EVS_UsePower),
37 BTL_MOVE(up_and_away, EVS_UsePower),
38 BTL_MOVE(star_beam, EVS_UsePower),
39 BTL_MOVE(peach_beam, EVS_UsePower),
40 BTL_MOVE(peach_focus, EVS_UsePower),
41 BTL_MOVE(peach_focus_alt, EVS_UsePower),
42};
43
44s32 PartnerWishAnims[][5] = {
45 [PARTNER_NONE] {
46 [PARTNER_WISH_ANIM_WALK] ANIM_Mario1_UsePower,
47 [PARTNER_WISH_ANIM_PRAY] ANIM_Mario1_Pray,
48 [PARTNER_WISH_ANIM_UNUSED] ANIM_Mario1_LookUp,
49 [PARTNER_WISH_ANIM_RETURN] ANIM_Mario1_Run,
51 },
53 [PARTNER_WISH_ANIM_WALK] ANIM_BattleGoombario_Run,
54 [PARTNER_WISH_ANIM_PRAY] ANIM_BattleGoombario_CloseEyes,
55 [PARTNER_WISH_ANIM_UNUSED] ANIM_BattleGoombario_CloseEyes,
56 [PARTNER_WISH_ANIM_RETURN] ANIM_BattleGoombario_Run,
57 [PARTNER_WISH_ANIM_IDLE] ANIM_BattleGoombario_Idle,
58 },
60 [PARTNER_WISH_ANIM_WALK] ANIM_BattleKooper_Run,
61 [PARTNER_WISH_ANIM_PRAY] ANIM_BattleKooper_Pray,
62 [PARTNER_WISH_ANIM_UNUSED] ANIM_BattleKooper_Pray,
63 [PARTNER_WISH_ANIM_RETURN] ANIM_BattleKooper_Run,
64 [PARTNER_WISH_ANIM_IDLE] ANIM_BattleKooper_Idle,
65 },
67 [PARTNER_WISH_ANIM_WALK] ANIM_BattleBombette_Run,
68 [PARTNER_WISH_ANIM_PRAY] ANIM_BattleBombette_Sleep,
69 [PARTNER_WISH_ANIM_UNUSED] ANIM_BattleBombette_Sleep,
70 [PARTNER_WISH_ANIM_RETURN] ANIM_BattleBombette_Run,
71 [PARTNER_WISH_ANIM_IDLE] ANIM_BattleBombette_Idle,
72 },
74 [PARTNER_WISH_ANIM_WALK] ANIM_BattleParakarry_Run,
75 [PARTNER_WISH_ANIM_PRAY] ANIM_BattleParakarry_Pray,
76 [PARTNER_WISH_ANIM_UNUSED] ANIM_BattleParakarry_Pray,
77 [PARTNER_WISH_ANIM_RETURN] ANIM_BattleParakarry_Run,
78 [PARTNER_WISH_ANIM_IDLE] ANIM_BattleParakarry_Idle,
79 },
81 // no data
82 },
83 [PARTNER_WATT] {
84 [PARTNER_WISH_ANIM_WALK] ANIM_BattleWatt_Run,
85 [PARTNER_WISH_ANIM_PRAY] ANIM_BattleWatt_Sleep,
86 [PARTNER_WISH_ANIM_UNUSED] ANIM_BattleWatt_Sleep,
87 [PARTNER_WISH_ANIM_RETURN] ANIM_BattleWatt_Run,
88 [PARTNER_WISH_ANIM_IDLE] ANIM_BattleWatt_Idle,
89 },
91 [PARTNER_WISH_ANIM_WALK] ANIM_BattleSushie_Run,
92 [PARTNER_WISH_ANIM_PRAY] ANIM_BattleSushie_Pray,
93 [PARTNER_WISH_ANIM_UNUSED] ANIM_BattleSushie_Pray,
94 [PARTNER_WISH_ANIM_RETURN] ANIM_BattleSushie_Run,
95 [PARTNER_WISH_ANIM_IDLE] ANIM_BattleSushie_Idle,
96 },
98 [PARTNER_WISH_ANIM_WALK] ANIM_BattleLakilester_Run,
99 [PARTNER_WISH_ANIM_PRAY] ANIM_BattleLakilester_Pray,
100 [PARTNER_WISH_ANIM_UNUSED] ANIM_BattleLakilester_Pray,
101 [PARTNER_WISH_ANIM_RETURN] ANIM_BattleLakilester_Run,
102 [PARTNER_WISH_ANIM_IDLE] ANIM_BattleLakilester_Idle,
103 },
104 [PARTNER_BOW] {
105 [PARTNER_WISH_ANIM_WALK] ANIM_BattleBow_Run,
106 [PARTNER_WISH_ANIM_PRAY] ANIM_BattleBow_Pray,
107 [PARTNER_WISH_ANIM_UNUSED] ANIM_BattleBow_Pray,
108 [PARTNER_WISH_ANIM_RETURN] ANIM_BattleBow_Run,
109 [PARTNER_WISH_ANIM_IDLE] ANIM_BattleBow_Idle,
110 },
111};
112
113API_CALLABLE(LoadStarPowerScript) {
114 BattleStatus* battleStatus = &gBattleStatus;
115 PlayerData* playerData = &gPlayerData;
116 s16 starPowerIdx;
117
118 playerData->starPower -= gMoveTable[battleStatus->selectedMoveID].costFP * SP_PER_BAR;
119 starPowerIdx = battleStatus->moveArgument;
120 dma_copy((&StarPowersTable[starPowerIdx])->romStart,
121 (&StarPowersTable[starPowerIdx])->romEnd,
122 (&StarPowersTable[starPowerIdx])->vramStart);
123 script->varTable[0] = (s32) (&StarPowersTable[starPowerIdx])->mainScript;
124 return ApiStatus_DONE2;
125}
Bytecode EvtScript[]
PartnerWishAnims
Definition enums.h:3393
@ PARTNER_WISH_ANIM_IDLE
Definition enums.h:3398
@ PARTNER_WISH_ANIM_PRAY
Definition enums.h:3395
@ PARTNER_WISH_ANIM_UNUSED
Definition enums.h:3396
@ PARTNER_WISH_ANIM_WALK
Definition enums.h:3394
@ PARTNER_WISH_ANIM_RETURN
Definition enums.h:3397
@ PARTNER_NONE
Definition enums.h:2885
@ PARTNER_BOMBETTE
Definition enums.h:2888
@ PARTNER_LAKILESTER
Definition enums.h:2893
@ PARTNER_WATT
Definition enums.h:2891
@ PARTNER_BOW
Definition enums.h:2894
@ PARTNER_SUSHIE
Definition enums.h:2892
@ PARTNER_PARAKARRY
Definition enums.h:2889
@ PARTNER_GOOMPA
Definition enums.h:2890
@ PARTNER_KOOPER
Definition enums.h:2887
@ PARTNER_GOOMBARIO
Definition enums.h:2886
#define ApiStatus_DONE2
Definition evt.h:118
u32 dma_copy(Addr romStart, Addr romEnd, void *vramDest)
Definition 43F0.c:444
#define SP_PER_BAR
Definition macros.h:102
#define BTL_MOVE(name, script)
Definition battle.h:114
EvtScript battle_move_peach_focus_EVS_UsePower
EvtScript battle_move_time_out_EVS_UsePower
BattleMoveEntry StarPowersTable[]
EvtScript battle_move_refresh_EVS_UsePower
EvtScript battle_move_lullaby_EVS_UsePower
EvtScript battle_move_peach_focus_alt_EVS_UsePower
EvtScript battle_move_star_storm_EVS_UsePower
EvtScript battle_move_up_and_away_EVS_UsePower
EvtScript battle_move_peach_beam_EVS_UsePower
EvtScript battle_move_chill_out_EVS_UsePower
EvtScript battle_move_focus_EVS_UsePower
EvtScript battle_move_star_beam_EVS_UsePower
EvtScript battle_move_smooch_EVS_UsePower
PlayerData gPlayerData
Definition 77480.c:40
BattleStatus gBattleStatus
Definition battle.c:11
MoveData gMoveTable[]