Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
peach_focus_alt.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3#include "sprite/player.h"
4
5#define NAMESPACE battle_move_peach_focus_alt
6
8
9API_CALLABLE(N(RestoreStarPower)) {
10 PlayerData* playerData = &gPlayerData;
11 PlayerData* playerData2 = &gPlayerData;
12
14 playerData->starPower += SP_PER_SEG * 4;
15 }
17 playerData->starPower += SP_PER_BAR;
18 }
19
20 playerData->starPower += SP_PER_SEG * 4;
21
22 if (playerData2->starPower >= playerData2->maxStarPower * SP_PER_BAR) {
23 playerData2->starPower = playerData2->maxStarPower * SP_PER_BAR;
24 }
25
26 return ApiStatus_DONE2;
27}
28
29EvtScript N(EVS_UsePower) = {
30 Call(UseBattleCamPreset, BTL_CAM_PLAYER_WISH)
31 Wait(10)
32 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Peach2_SpreadArms)
33 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
34 Add(LVar0, 16)
35 Call(SetActorSpeed, ACTOR_PLAYER, Float(4.0))
36 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
37 Call(PlayerRunToGoal, 0)
38 Wait(8)
39 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
40 Add(LVar1, 20)
41 Call(N(SpawnStarSparkleFX), LVar0, LVar1, LVar2)
43 Wait(20)
44 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Peach3_Pray)
45 Wait(10)
46 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
47 Add(LVar1, 20)
48 Call(N(SpawnWishSparkleFX), LVar0, LVar1, LVar2)
49 Wait(30)
50 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Peach2_Curious)
51 Call(N(RestoreStarPower))
52 Wait(10)
54 Wait(15)
55 Call(SetGoalToHome, ACTOR_PLAYER)
56 Call(SetActorSpeed, ACTOR_PLAYER, Float(8.0))
57 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Peach1_Run)
58 Call(PlayerRunToGoal, 0)
59 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Peach1_Idle)
60 Return
61 End
62};
Bytecode EvtScript[]
@ BTL_CAM_PLAYER_WISH
Definition enums.h:4891
@ ABILITY_DEEP_FOCUS
Definition enums.h:484
@ ABILITY_SUPER_FOCUS
Definition enums.h:485
@ ACTOR_PLAYER
Definition enums.h:2085
#define ApiStatus_DONE2
Definition evt.h:118
s32 is_ability_active(s32 arg0)
Definition inventory.c:1725
ApiStatus FadeBackgroundLighten(Evt *script, b32 isInitialCall)
ApiStatus FadeBackgroundDarken(Evt *script, b32 isInitialCall)
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define Float(DOUBLE)
Definition macros.h:51
#define LVar2
Definition macros.h:150
#define SP_PER_SEG
Definition macros.h:103
#define LVar1
Definition macros.h:149
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define SP_PER_BAR
Definition macros.h:102
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217
PlayerData gPlayerData
Definition 77480.c:40