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
16
extern
EvtScript
battle_move_focus_EVS_UsePower
;
17
extern
EvtScript
battle_move_refresh_EVS_UsePower
;
18
extern
EvtScript
battle_move_lullaby_EVS_UsePower
;
19
extern
EvtScript
battle_move_star_storm_EVS_UsePower
;
20
extern
EvtScript
battle_move_chill_out_EVS_UsePower
;
21
extern
EvtScript
battle_move_smooch_EVS_UsePower
;
22
extern
EvtScript
battle_move_time_out_EVS_UsePower
;
23
extern
EvtScript
battle_move_up_and_away_EVS_UsePower
;
24
extern
EvtScript
battle_move_star_beam_EVS_UsePower
;
25
extern
EvtScript
battle_move_peach_beam_EVS_UsePower
;
26
extern
EvtScript
battle_move_peach_focus_EVS_UsePower
;
27
extern
EvtScript
battle_move_peach_focus_alt_EVS_UsePower
;
28
29
BattleMoveEntry
StarPowersTable
[] = {
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
44
s32
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,
50
[
PARTNER_WISH_ANIM_IDLE
] 0,
51
},
52
[
PARTNER_GOOMBARIO
] {
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
},
59
[
PARTNER_KOOPER
] {
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
},
66
[
PARTNER_BOMBETTE
] {
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
},
73
[
PARTNER_PARAKARRY
] {
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
},
80
[
PARTNER_GOOMPA
] {
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
},
90
[
PARTNER_SUSHIE
] {
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
},
97
[
PARTNER_LAKILESTER
] {
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
113
API_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
}
MoveData::costFP
s8 costFP
Definition
common_structs.h:1019
EvtScript
Bytecode EvtScript[]
Definition
common_structs.h:14
PlayerData::starPower
s16 starPower
Definition
common_structs.h:341
PlayerData
Definition
common_structs.h:308
PartnerWishAnims
PartnerWishAnims
Definition
enums.h:3393
PARTNER_WISH_ANIM_IDLE
@ PARTNER_WISH_ANIM_IDLE
Definition
enums.h:3398
PARTNER_WISH_ANIM_PRAY
@ PARTNER_WISH_ANIM_PRAY
Definition
enums.h:3395
PARTNER_WISH_ANIM_UNUSED
@ PARTNER_WISH_ANIM_UNUSED
Definition
enums.h:3396
PARTNER_WISH_ANIM_WALK
@ PARTNER_WISH_ANIM_WALK
Definition
enums.h:3394
PARTNER_WISH_ANIM_RETURN
@ PARTNER_WISH_ANIM_RETURN
Definition
enums.h:3397
PARTNER_NONE
@ PARTNER_NONE
Definition
enums.h:2885
PARTNER_BOMBETTE
@ PARTNER_BOMBETTE
Definition
enums.h:2888
PARTNER_LAKILESTER
@ PARTNER_LAKILESTER
Definition
enums.h:2893
PARTNER_WATT
@ PARTNER_WATT
Definition
enums.h:2891
PARTNER_BOW
@ PARTNER_BOW
Definition
enums.h:2894
PARTNER_SUSHIE
@ PARTNER_SUSHIE
Definition
enums.h:2892
PARTNER_PARAKARRY
@ PARTNER_PARAKARRY
Definition
enums.h:2889
PARTNER_GOOMPA
@ PARTNER_GOOMPA
Definition
enums.h:2890
PARTNER_KOOPER
@ PARTNER_KOOPER
Definition
enums.h:2887
PARTNER_GOOMBARIO
@ PARTNER_GOOMBARIO
Definition
enums.h:2886
ApiStatus_DONE2
#define ApiStatus_DONE2
Definition
evt.h:118
dma_copy
u32 dma_copy(Addr romStart, Addr romEnd, void *vramDest)
Definition
43F0.c:444
SP_PER_BAR
#define SP_PER_BAR
Definition
macros.h:102
battle.h
BTL_MOVE
#define BTL_MOVE(name, script)
Definition
battle.h:114
BattleMoveEntry
Definition
battle.h:107
BattleStatus
Definition
common_structs.h:856
BattleStatus::moveArgument
s16 moveArgument
Definition
common_structs.h:939
BattleStatus::selectedMoveID
s16 selectedMoveID
Definition
common_structs.h:940
battle_move_peach_focus_EVS_UsePower
EvtScript battle_move_peach_focus_EVS_UsePower
battle_move_time_out_EVS_UsePower
EvtScript battle_move_time_out_EVS_UsePower
StarPowersTable
BattleMoveEntry StarPowersTable[]
Definition
use_star_powers.c:29
battle_move_refresh_EVS_UsePower
EvtScript battle_move_refresh_EVS_UsePower
battle_move_lullaby_EVS_UsePower
EvtScript battle_move_lullaby_EVS_UsePower
battle_move_peach_focus_alt_EVS_UsePower
EvtScript battle_move_peach_focus_alt_EVS_UsePower
battle_move_star_storm_EVS_UsePower
EvtScript battle_move_star_storm_EVS_UsePower
battle_move_up_and_away_EVS_UsePower
EvtScript battle_move_up_and_away_EVS_UsePower
battle_move_peach_beam_EVS_UsePower
EvtScript battle_move_peach_beam_EVS_UsePower
battle_move_chill_out_EVS_UsePower
EvtScript battle_move_chill_out_EVS_UsePower
battle_move_focus_EVS_UsePower
EvtScript battle_move_focus_EVS_UsePower
battle_move_star_beam_EVS_UsePower
EvtScript battle_move_star_beam_EVS_UsePower
battle_move_smooch_EVS_UsePower
EvtScript battle_move_smooch_EVS_UsePower
gPlayerData
PlayerData gPlayerData
Definition
77480.c:40
gBattleStatus
BattleStatus gBattleStatus
Definition
battle.c:11
gMoveTable
MoveData gMoveTable[]
src
battle
use_star_powers.c
Generated by
1.10.0