Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
volt_shroom.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_volt_shroom
7
9
10API_CALLABLE(N(func_802A123C_71AA2C)) {
11 BattleStatus* battleStatus = &gBattleStatus;
12 Actor* player = battleStatus->playerActor;
13
14 inflict_status(player, STATUS_KEY_STATIC, script->varTable[0]);
15 player->statusAfflicted = 0;
16 return ApiStatus_DONE2;
17}
18
20
21EvtScript N(EVS_UseItem) = {
22 SetConst(LVarA, ITEM_VOLT_SHROOM)
23 ExecWait(N(UseItemWithEffect))
24 ExecWait(N(EatItem))
25 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
26 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
27 Set(LVar3, 20)
28 Call(MultiplyByActorScale, LVar3)
30 SetF(LVar3, Float(1.0))
31 Call(MultiplyByActorScale, LVar3)
32 PlayEffect(EFFECT_SNAKING_STATIC, 0, LVar0, LVar1, LVar2, LVar3, 30, 0)
34 Call(GetItemPower, ITEM_VOLT_SHROOM, LVar0, LVar1)
35 Call(N(func_802A123C_71AA2C))
36 Wait(20)
37 Call(ShowMessageBox, BTL_MSG_PLAYER_CHARGED, 60)
38 Call(WaitForMessageBoxDone)
39 ExecWait(N(PlayerGoHome))
40 Return
41 End
42};
Bytecode EvtScript[]
s8 statusAfflicted
@ BTL_MSG_PLAYER_CHARGED
Definition enums.h:4074
@ STATUS_KEY_STATIC
Definition enums.h:2207
@ SOUND_VOLT_SHROOM_APPLY
Definition enums.h:1193
@ ACTOR_PLAYER
Definition enums.h:2085
#define ApiStatus_DONE2
Definition evt.h:118
s32 inflict_status(Actor *, s32, s32)
Definition 190B20.c:2084
ApiStatus PlaySound(Evt *script, b32 isInitialCall)
ApiStatus GetItemPower(Evt *script, b32 isInitialCall)
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#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 SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
Definition macros.h:373
#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 LVar3
Definition macros.h:151
#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