Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
repel_gel.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3#include "effects.h"
4#include "sprite/player.h"
5
6#define NAMESPACE battle_item_repel_gel
7
9
10API_CALLABLE(N(func_802A123C_72DDAC)) {
11 BattleStatus* battleStatus = &gBattleStatus;
12 Actor* player = battleStatus->playerActor;
13 ActorPart* part = player->partsTable;
14
15 inflict_status(player, STATUS_KEY_TRANSPARENT, script->varTable[0]);
16 player->statusAfflicted = 0;
18
19 return ApiStatus_DONE2;
20}
21
23
24EvtScript N(EVS_UseItem) = {
25 SetConst(LVarA, ITEM_REPEL_GEL)
26 ExecWait(N(UseItemWithEffect))
27 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_REPEL_GEL_APPLY)
28 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_ApplyCream)
29 Wait(45)
30 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
31 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
32 Add(LVar1, 20)
33 PlayEffect(EFFECT_RADIAL_SHIMMER, 3, LVar0, LVar1, LVar2, Float(1.0), 30, 0)
34 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_REPEL_GEL_VANISH)
35 Call(GetItemPower, ITEM_REPEL_GEL, LVar0, LVar1)
36 Call(N(func_802A123C_72DDAC))
37 Wait(20)
38 Call(ShowMessageBox, BTL_MSG_PLAYER_TRANSPARENT, 60)
39 Call(WaitForMessageBoxDone)
40 ExecWait(N(PlayerGoHome))
41 Return
42 End
43};
44
struct ActorPart * partsTable
Bytecode EvtScript[]
s8 statusAfflicted
@ BTL_MSG_PLAYER_TRANSPARENT
Definition enums.h:4075
@ STATUS_KEY_TRANSPARENT
Definition enums.h:2210
@ SOUND_REPEL_GEL_VANISH
Definition enums.h:1190
@ SOUND_REPEL_GEL_APPLY
Definition enums.h:1189
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PART_FLAG_TRANSPARENT
Definition enums.h:3357
#define ApiStatus_DONE2
Definition evt.h:118
s32 inflict_status(Actor *, s32, s32)
Definition 190B20.c:2084
ApiStatus GetItemPower(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 ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define PlayEffect(args...)
Definition macros.h:807
#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 SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:370
#define Return
Kills the current EVT thread.
Definition macros.h:217
struct Actor * playerActor
BattleStatus gBattleStatus
Definition battle.c:11