Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
insecticide_herb.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3#include "effects.h"
4#include "entity.h"
5#include "ld_addrs.h"
6#include "sprite/player.h"
7#include "include_asset.h"
8
9#define NAMESPACE battle_item_insecticide_herb
10
12
13API_CALLABLE(N(func_802A123C_72A98C)) {
15 Actor* enemy = get_actor(script->owner1.enemyID);
17
18 script->varTable[9] = target->actorType == 49;
19
20 return ApiStatus_DONE2;
21}
22
23API_CALLABLE(N(func_802A1280_72A9D0)) {
24 Actor* enemy = get_actor(script->owner1.enemyID);
26
30
31 return ApiStatus_DONE2;
32}
33
34API_CALLABLE(N(func_802A12E0_72AA30)) {
35 Bytecode* args = script->ptrReadPos;
36 f32 a = evt_get_variable(script, *args++);
37 f32 b = evt_get_variable(script, *args++);
38 f32 c = evt_get_variable(script, *args++);
39 EffectInstance* effect;
40
41 a += rand_int(20) - 10;
42 b += rand_int(10) - 5;
43
44 effect = fx_cold_breath(0, a, b, c, 1.0f, 30);
45
46 effect->data.coldBreath->primCol.r = 244;
47 effect->data.coldBreath->primCol.g = 244;
48 effect->data.coldBreath->primCol.b = 220;
49 effect->data.coldBreath->envCol.r = 210;
50 effect->data.coldBreath->envCol.g = 210;
51 effect->data.coldBreath->envCol.b = 190;
52
53 return ApiStatus_DONE2;
54}
55
57
58static s32 _pad = 0; // XXX
59
60#include "battle/move/item/insecticide_herb.png.h"
61INCLUDE_IMG("battle/move/item/insecticide_herb.png", battle_item_insecticide_herb_png);
62INCLUDE_PAL("battle/move/item/insecticide_herb.pal", battle_item_insecticide_herb_pal);
63
64Vtx N(model)[] = {
65 { .v = { .ob = {-16, -16, 0}, FALSE, .tc = {0, 0}, .cn = {0, 0, 0, 255} } },
66 { .v = { .ob = {15, -16, 0}, FALSE, .tc = {1024, 0}, .cn = {0, 0, 0, 255} } },
67 { .v = { .ob = {15, 15, 0}, FALSE, .tc = {1024, 1024}, .cn = {0, 0, 0, 255} } },
68 { .v = { .ob = {-16, 15, 0}, FALSE, .tc = {0, 1024}, .cn = {0, 0, 0, 255} } },
69};
70
71Gfx N(displayList)[] = {
73 gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
87 gsSP1Triangle(0, 1, 2, 0),
88 gsSP1Triangle(0, 2, 3, 0),
91};
92
94
102 Wait(3)
104 SetF(LVar0, Float(1.0))
108 Set(LVar3, 20)
109 Set(LVar4, 42)
110 Set(LVar5, 5)
112 Add(LVar0, LVar3)
113 Add(LVar1, LVar4)
114 Add(LVar2, LVar5)
119 Thread
120 Set(LVar0, 0)
121 Loop(18)
122 Add(LVar0, -60)
124 Wait(1)
125 EndLoop
128 Add(LVar2, 5)
131 Sub(LVar0, 10)
133 Add(LVar0, 20)
135 Thread
137 Wait(3)
139 Wait(3)
146 IfEq(LVar9, 0)
148 Else
152 EndIf
154 Return
155 End
156};
BSS s32 PopupMenu_SelectedIndex
ActorState state
s16 targetActorID
Bytecode EvtScript[]
#define sfx_play_sound_at_position
#define rand_int
EffectInstanceDataPtr data
Definition effects.h:2605
Color4i primCol
Definition effects.h:1990
struct ColdBreathFXData * coldBreath
Definition effects.h:2575
s32 EntityModelScript[]
Definition entity.h:7
#define STANDARD_ENTITY_MODEL_SCRIPT(gfx, renderMode)
Definition entity.h:56
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ BTL_CAM_VIEW_ENEMIES
Definition enums.h:4824
@ SOUND_DAMAGE_STARS
Definition enums.h:950
@ SOUND_THROW
Definition enums.h:1311
@ RENDER_MODE_ALPHATEST
Definition enums.h:3276
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
@ EVENT_SCARE_AWAY
Definition enums.h:2174
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1689
void dispatch_event_actor(Actor *, s32)
Definition 1A5830.c:103
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
#define INCLUDE_PAL(FILENAME, SYMBOLNAME)
#define INCLUDE_IMG(FILENAME, SYMBOLNAME)
ApiStatus PlaySound(Evt *script, b32 isInitialCall)
ApiStatus CreateVirtualEntity(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityPosition(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityJumpGravity(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityScale(Evt *script, b32 isInitialCall)
ApiStatus DeleteVirtualEntity(Evt *script, b32 isInitialCall)
ApiStatus VirtualEntityJumpTo(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityRotation(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#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 EndLoop
Marks the end of a loop.
Definition macros.h:248
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define Float(DOUBLE)
Definition macros.h:51
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar5
Definition macros.h:153
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#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 LVar9
Definition macros.h:157
#define PlayEffect(args...)
Definition macros.h:807
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar4
Definition macros.h:152
#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
BattleStatus gBattleStatus
Definition battle.c:11