Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
ghost_watt.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/BattleWatt.h"
4#include "effects.h"
5
6#define NAMESPACE A(watt_clone)
7
8extern EvtScript N(EVS_Init);
9extern EvtScript N(EVS_Idle);
10extern EvtScript N(EVS_TakeTurn);
11extern EvtScript N(EVS_HandleEvent);
12
13s32 N(DefaultAnims)[] = {
14 STATUS_KEY_NORMAL, ANIM_BattleWatt_Idle,
15 STATUS_KEY_STONE, ANIM_BattleWatt_Still,
16 STATUS_KEY_SLEEP, ANIM_BattleWatt_Still,
17 STATUS_KEY_POISON, ANIM_BattleWatt_Idle,
18 STATUS_KEY_STOP, ANIM_BattleWatt_Still,
19 STATUS_KEY_STATIC, ANIM_BattleWatt_Idle,
20 STATUS_KEY_PARALYZE, ANIM_BattleWatt_Still,
21 STATUS_KEY_DIZZY, ANIM_BattleWatt_Injured,
22 STATUS_KEY_FEAR, ANIM_BattleWatt_Injured,
24};
25
26s32 N(DefenseTable)[] = {
28 ELEMENT_SHOCK, 99,
30};
31
32s32 N(StatusTable)[] = {
55};
56
57ActorPartBlueprint N(ActorParts)[] = {
58 {
60 .index = PRT_MAIN,
61 .posOffset = { 0, 0, 0 },
62 .targetOffset = { -1, 20 },
63 .opacity = 255,
64 .idleAnimations = N(DefaultAnims),
65 .defenseTable = N(DefenseTable),
66 .eventFlags = ACTOR_EVENT_FLAG_ELECTRIFIED,
67 .elementImmunityFlags = 0,
68 .projectileTargetOffset = { 0, -8 },
69 },
70 {
72 .index = PRT_TARGET,
73 .posOffset = { 0, 50, 0 },
74 .targetOffset = { -1, -30 },
75 .opacity = 255,
76 .idleAnimations = NULL,
77 .defenseTable = N(DefenseTable),
78 .eventFlags = ACTOR_EVENT_FLAG_ELECTRIFIED,
79 .elementImmunityFlags = 0,
80 .projectileTargetOffset = { 0, -8 },
81 },
82};
83
84ActorBlueprint NAMESPACE = {
85 .flags = ACTOR_FLAG_FLYING,
86 .type = ACTOR_TYPE_GHOST_WATT,
87 .level = ACTOR_LEVEL_GHOST_WATT,
88 .maxHP = 15,
89 .partCount = ARRAY_COUNT(N(ActorParts)),
90 .partsData = N(ActorParts),
91 .initScript = &N(EVS_Init),
92 .statusTable = N(StatusTable),
93 .escapeChance = 50,
94 .airLiftChance = 80,
95 .hurricaneChance = 70,
96 .spookChance = 50,
97 .upAndAwayChance = 95,
98 .spinSmashReq = 0,
99 .powerBounceChance = 90,
100 .coinReward = 2,
101 .size = { 34, 28 },
102 .healthBarOffset = { 0, 0 },
103 .statusIconOffset = { -10, 20 },
104 .statusTextOffset = { 10, 20 },
105};
106
107EvtScript N(EVS_Init) = {
108 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
109 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
110 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
111 Return
112 End
113};
114
115API_CALLABLE(N(WattFXUpdate)) {
116 Actor* actor = get_actor(script->owner1.enemyID);
117 ActorState* state = &actor->state;
118 WattEffectData* wattEffectData;
119 f32 x, y, z;
120
121 if (isInitialCall) {
122 wattEffectData = heap_malloc(sizeof(*wattEffectData));
123 actor->state.varTablePtr[2] = wattEffectData;
124 wattEffectData->isBouncing = TRUE;
125 wattEffectData->bouncePhase = 0;
126 wattEffectData->isActive = TRUE;
127 wattEffectData->currentEffectIndex = 0;
128 wattEffectData->effect1 = fx_static_status(0, actor->curPos.x, actor->curPos.y, actor->curPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0);
129 wattEffectData->effect2 = fx_static_status(1, actor->curPos.x, NPC_DISPOSE_POS_Y, actor->curPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0);
130 wattEffectData->initialized = TRUE;
131 wattEffectData->debuff = actor->debuff;
132 }
133
134 wattEffectData = state->varTablePtr[2];
135 if (wattEffectData->initialized) {
136 if (wattEffectData->isBouncing && actor->debuff != STATUS_KEY_STOP) {
137 wattEffectData->bouncePhase += 15;
138 wattEffectData->bouncePhase = clamp_angle(wattEffectData->bouncePhase);
139 }
140 actor->verticalRenderOffset = sin_rad(DEG_TO_RAD(wattEffectData->bouncePhase)) * 3.0f;
141
142 x = actor->curPos.x + actor->headOffset.x;
143 y = actor->curPos.y + actor->headOffset.y + actor->verticalRenderOffset + (actor->debuff != STATUS_KEY_SHRINK ? 12.0 : 4.800000000000001); // 4.8 doesn't match
144 z = actor->curPos.z + actor->headOffset.z;
145 if (wattEffectData->isActive) {
146 switch (wattEffectData->currentEffectIndex) {
147 case 0:
148 if (wattEffectData->effect1 == NULL) {
149 wattEffectData->effect1 = fx_static_status(0, x, y, z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0);
150 }
151
152 if (wattEffectData->effect2 != NULL) {
153 wattEffectData->effect2->flags |= FX_INSTANCE_FLAG_DISMISS;
154 wattEffectData->effect2 = NULL;
155 }
156 wattEffectData->effect1->data.staticStatus->pos.x = x;
157 wattEffectData->effect1->data.staticStatus->pos.y = y;
158 wattEffectData->effect1->data.staticStatus->pos.z = z;
159 break;
160 case 1:
161 if (wattEffectData->effect1 != NULL) {
162 wattEffectData->effect1->flags |= FX_INSTANCE_FLAG_DISMISS;
163 wattEffectData->effect1 = NULL;
164 }
165 if (wattEffectData->effect2 == NULL) {
166 wattEffectData->effect2 = fx_static_status(1, x, y, z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0);
167
168 }
169 wattEffectData->effect2->data.staticStatus->pos.x = x;
170 wattEffectData->effect2->data.staticStatus->pos.y = y;
171 wattEffectData->effect2->data.staticStatus->pos.z = z;
172 break;
173 }
174 } else {
175 if (wattEffectData->effect1 != NULL) {
176 wattEffectData->effect1->flags |= FX_INSTANCE_FLAG_DISMISS;
177 wattEffectData->effect1 = NULL;
178 }
179 if (wattEffectData->effect2 != NULL) {
180 wattEffectData->effect2->flags |= FX_INSTANCE_FLAG_DISMISS;
181 wattEffectData->effect2 = NULL;
182 }
183 }
184 if (wattEffectData->debuff != actor->debuff && wattEffectData->isActive) {
185 if (wattEffectData->effect1 != NULL) {
186 wattEffectData->effect1->flags |= FX_INSTANCE_FLAG_DISMISS;
187 wattEffectData->effect1 = NULL;
188 }
189 if (wattEffectData->effect2 != NULL) {
190 wattEffectData->effect2->flags |= FX_INSTANCE_FLAG_DISMISS;
191 wattEffectData->effect2 = NULL;
192 }
193 }
194 wattEffectData->debuff = actor->debuff;
195 return ApiStatus_BLOCK;
196 }
197 return ApiStatus_DONE2;
198}
199
200EvtScript N(EVS_Idle) = {
201 SetPriority(99)
202 Call(N(WattFXUpdate))
203 Return
204 End
205};
206
207API_CALLABLE(N(WattFXRemove)) {
208 WattEffectData* wattEffectData = get_actor(script->owner1.enemyID)->state.varTablePtr[2];
209
210 wattEffectData->initialized = FALSE;
211
212 if (wattEffectData->effect1 != NULL) {
213 wattEffectData->effect1->flags |= FX_INSTANCE_FLAG_DISMISS;
214 }
215
216 if (wattEffectData->effect2 != NULL) {
217 wattEffectData->effect2->flags |= FX_INSTANCE_FLAG_DISMISS;
218 }
219
220 return ApiStatus_DONE2;
221}
222
223API_CALLABLE(N(WattFXSetBouncing)) {
224 Bytecode* args = script->ptrReadPos;
225 WattEffectData* wattEffectData = get_actor(script->owner1.enemyID)->state.varTablePtr[2];
226
227 wattEffectData->isBouncing = evt_get_variable(script, *args++);
228 return ApiStatus_DONE2;
229}
230
231API_CALLABLE(N(WattFXSetActive)) {
232 Bytecode* args = script->ptrReadPos;
233 WattEffectData* wattEffectData = get_actor(script->owner1.enemyID)->state.varTablePtr[2];
234
235 wattEffectData->isActive = evt_get_variable(script, *args++);
236 return ApiStatus_DONE2;
237}
238
239API_CALLABLE(N(WattFXSetEffect)) {
240 Bytecode* args = script->ptrReadPos;
241 WattEffectData* wattEffectData = get_actor(script->owner1.enemyID)->state.varTablePtr[2];
242
243 wattEffectData->currentEffectIndex = evt_get_variable(script, *args++);
244 return ApiStatus_DONE2;
245}
246
247EvtScript N(EVS_HandleEvent) = {
248 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
249 Call(N(WattFXSetBouncing), 0)
250 Call(N(WattFXSetActive), 1)
251 Call(N(WattFXSetEffect), 0)
252 Call(GetLastEvent, ACTOR_SELF, LVar0)
256 SetConst(LVar0, PRT_MAIN)
257 SetConst(LVar1, ANIM_BattleWatt_Hurt)
261 SetConst(LVar0, PRT_MAIN)
262 SetConst(LVar1, ANIM_BattleWatt_BurnHurt)
263 SetConst(LVar2, ANIM_BattleWatt_BurnStill)
266 SetConst(LVar0, PRT_MAIN)
267 SetConst(LVar1, ANIM_BattleWatt_BurnHurt)
268 SetConst(LVar2, ANIM_BattleWatt_BurnStill)
270 Call(N(WattFXRemove))
271 ExecWait(A(EVS_Duplighost_OnDeath))
272 SetConst(LVar0, PRT_MAIN)
273 SetConst(LVar1, ANIM_BattleWatt_BurnStill)
275 Return
277 SetConst(LVar0, PRT_MAIN)
278 SetConst(LVar1, ANIM_BattleWatt_Hurt)
281 Call(N(WattFXRemove))
282 ExecWait(A(EVS_Duplighost_OnDeath))
283 SetConst(LVar0, PRT_MAIN)
284 SetConst(LVar1, ANIM_BattleWatt_Hurt)
286 SetConst(LVar0, PRT_MAIN)
287 SetConst(LVar1, ANIM_BattleWatt_Hurt)
289 Return
293 SetConst(LVar0, PRT_MAIN)
294 SetConst(LVar1, ANIM_BattleWatt_Idle)
298 Call(N(WattFXRemove))
299 ExecWait(A(EVS_Duplighost_OnDeath))
300 SetConst(LVar0, PRT_MAIN)
301 SetConst(LVar1, ANIM_BattleWatt_Hurt)
303 Wait(10)
304 SetConst(LVar0, PRT_MAIN)
305 SetConst(LVar1, ANIM_BattleWatt_Hurt)
307 Return
309 SetConst(LVar0, PRT_MAIN)
310 SetConst(LVar1, ANIM_BattleWatt_Idle)
313 SetConst(LVar0, PRT_MAIN)
314 SetConst(LVar1, ANIM_BattleWatt_Run)
315 SetConst(LVar2, ANIM_BattleWatt_Hurt)
317 Return
319 SetConst(LVar0, PRT_MAIN)
320 SetConst(LVar1, ANIM_BattleWatt_Run)
323 SetConst(LVar0, PRT_MAIN)
324 SetConst(LVar1, ANIM_BattleWatt_Hurt)
326 Return
329 Call(N(WattFXSetBouncing), 1)
330 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
331 Return
332 End
333};
334
335#include "common/UnkBackgroundFunc3.inc.c"
336
338
339EvtScript N(EVS_TakeTurn) = {
340 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
341 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
342 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
343 Call(SetBattleCamTarget, LVar0, LVar1, LVar2)
344 Call(SetBattleCamDist, 350)
345 Call(SetBattleCamOffsetY, 40)
346 Call(MoveBattleCamOver, 80)
347 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
348 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
349 Call(SetGoalToTarget, ACTOR_SELF)
350 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_Run)
351 Call(N(WattFXSetEffect), 1)
352 Call(AddGoalPos, ACTOR_SELF, 15, -10, 5)
353 Call(FlyToGoal, ACTOR_SELF, 30, 0, EASING_COS_IN_OUT)
354 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_Idle)
355 Call(N(WattFXSetEffect), 0)
356 Wait(5)
357 Call(N(WattFXSetBouncing), 0)
358 Call(AddGoalPos, ACTOR_SELF, 25, 20, 0)
359 Call(FlyToGoal, ACTOR_SELF, 15, -20, EASING_COS_IN_OUT)
360 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_Strain)
361 Call(SetGoalToTarget, ACTOR_SELF)
362 Call(FlyToGoal, ACTOR_SELF, 5, 0, EASING_COS_IN_OUT)
363 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
367 Set(LVarA, LVar0)
368 Thread
369 Wait(5)
370 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_Idle)
372 Call(SetGoalToTarget, ACTOR_SELF)
373 Call(AddGoalPos, ACTOR_SELF, -40, 10, 0)
374 Call(FlyToGoal, ACTOR_SELF, 10, -20, EASING_QUADRATIC_OUT)
376 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
377 EndIf
378 Call(N(WattFXSetActive), 1)
379 Call(N(WattFXSetBouncing), 1)
380 Wait(20)
381 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
382 Call(YieldTurn)
383 Call(SetGoalToHome, ACTOR_SELF)
384 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_Run)
385 Call(FlyToGoal, ACTOR_SELF, 30, 0, EASING_COS_IN_OUT)
386 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_Idle)
387 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
388 Return
391 Call(N(WattFXSetActive), 0)
392 Set(LVarA, 40)
393 Call(AddBattleCamDist, -75)
394 Call(MoveBattleCamOver, LVarA)
395 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_NONE, BTL_CAM_XADJ_NONE, TRUE)
396 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_WATT_CHARGE)
397 Call(GetStatusFlags, ACTOR_SELF, LVar0)
399 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
400 Add(LVar1, 4)
401 PlayEffect(EFFECT_RADIAL_SHIMMER, 8, LVar0, LVar1, LVar2, Float(0.52), LVarA, 0)
402 Else
403 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
404 Add(LVar1, 12)
405 PlayEffect(EFFECT_RADIAL_SHIMMER, 8, LVar0, LVar1, LVar2, Float(1.3), LVarA, 0)
406 EndIf
407 Call(N(UnkBackgroundFunc3))
408 Set(LVar9, 0)
409 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_StrainBigger)
410 Loop(LVarA)
411 Add(LVar9, 3)
412 IfGt(LVar9, 200)
413 Set(LVar9, 200)
414 EndIf
415 Call(N(SetBackgroundAlpha), LVar9)
416 Wait(1)
417 EndLoop
418 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_Idle)
419 Call(SetActorPaletteEffect, ACTOR_SELF, PRT_MAIN, ACTOR_PAL_ADJUST_WATT_IDLE)
420 Call(AddBattleCamDist, 75)
421 Call(MoveBattleCamOver, 5)
422 Thread
423 Wait(2)
424 Call(N(SetBackgroundAlpha), 0)
426 Call(GetActorVar, ACTOR_SELF, AVAR_Copy_PartnerLevel, LVar9)
429 Wait(2)
430#if VERSION_JP
432#else
434#endif
436 Wait(2)
437#if VERSION_JP
439#else
441#endif
443 Wait(2)
444#if VERSION_JP
446#else
448#endif
453 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
454 Call(N(WattFXSetActive), 1)
455 Call(N(WattFXSetBouncing), 1)
456 Call(AddGoalPos, ACTOR_SELF, 25, 10, 0)
457 Call(FlyToGoal, ACTOR_SELF, 15, -10, EASING_COS_IN_OUT)
458 Wait(15)
459 Call(YieldTurn)
460 Call(SetGoalToHome, ACTOR_SELF)
461 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_Run)
462 Call(FlyToGoal, ACTOR_SELF, 30, 0, EASING_COS_IN_OUT)
463 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleWatt_Idle)
466 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
467 Return
468 End
469};
470
471Formation A(WattCloneFormation) = {
472 ACTOR_BY_POS(NAMESPACE, A(DuplighostSummonPos), 0),
473};
s8 verticalRenderOffset
Vec3s headOffset
ActorState state
Vec3f curPos
Bytecode EvtScript[]
#define clamp_angle
EffectInstance * effect2
Definition effects.h:2617
s32 currentEffectIndex
Definition effects.h:2615
struct StaticStatusFXData * staticStatus
Definition effects.h:2579
EffectData data
Definition effects.h:2605
EffectInstance * effect1
Definition effects.h:2616
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ BTL_CAM_XADJ_NONE
Definition enums.h:4899
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_SHOCK
Definition enums.h:2125
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ACTOR_PAL_ADJUST_WATT_IDLE
Definition enums.h:2248
@ ACTOR_EVENT_FLAG_ELECTRIFIED
Player takes shock damage upon contact.
Definition enums.h:3375
@ STATUS_KEY_PARALYZE
Definition enums.h:2201
@ STATUS_TURN_MOD_DEFAULT
Definition enums.h:2227
@ STATUS_TURN_MOD_PARALYZE
Definition enums.h:2234
@ STATUS_KEY_FROZEN
Definition enums.h:2203
@ STATUS_TURN_MOD_SLEEP
Definition enums.h:2228
@ STATUS_TURN_MOD_DIZZY
Definition enums.h:2232
@ STATUS_KEY_STATIC
Definition enums.h:2207
@ STATUS_END
Definition enums.h:2196
@ STATUS_TURN_MOD_POISON
Definition enums.h:2233
@ STATUS_KEY_FEAR
Definition enums.h:2199
@ STATUS_TURN_MOD_STOP
Definition enums.h:2237
@ STATUS_KEY_SLEEP
Definition enums.h:2202
@ STATUS_KEY_STONE
Definition enums.h:2208
@ STATUS_KEY_STOP
Definition enums.h:2204
@ STATUS_TURN_MOD_FROZEN
Definition enums.h:2230
@ STATUS_KEY_SHRINK
Definition enums.h:2206
@ STATUS_KEY_DIZZY
Definition enums.h:2200
@ STATUS_KEY_POISON
Definition enums.h:2205
@ STATUS_TURN_MOD_STATIC
Definition enums.h:2229
@ STATUS_TURN_MOD_FEAR
Definition enums.h:2231
@ STATUS_KEY_NORMAL
Definition enums.h:2197
@ STATUS_TURN_MOD_SHRINK
Definition enums.h:2235
@ STATUS_KEY_DEFAULT
Definition enums.h:2198
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1952
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_LUCKY
Definition enums.h:1955
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_REPOSITION
Definition enums.h:4841
@ SUPPRESS_EVENT_ALL
Definition enums.h:2907
@ EASING_COS_IN_OUT
Definition enums.h:520
@ EASING_QUADRATIC_OUT
Definition enums.h:514
@ PARTNER_RANK_NORMAL
Definition enums.h:2018
@ PARTNER_RANK_SUPER
Definition enums.h:2019
@ PARTNER_RANK_ULTRA
Definition enums.h:2020
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ SOUND_WATT_CHARGE
Definition enums.h:1000
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
Definition enums.h:3329
@ BTL_CAM_YADJ_NONE
Definition enums.h:4906
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4905
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_SCARE_AWAY
Definition enums.h:2174
@ EVENT_BURN_HIT
Definition enums.h:2136
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_BURN_DEATH
Definition enums.h:2157
@ EVENT_ZERO_DAMAGE
Definition enums.h:2144
@ EVENT_SPIN_SMASH_HIT
Definition enums.h:2133
@ EVENT_SPIN_SMASH_DEATH
Definition enums.h:2154
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_AIR_LIFT_FAILED
Definition enums.h:2152
@ EVENT_BEGIN_AIR_LIFT
Definition enums.h:2175
@ EVENT_DEATH
Definition enums.h:2153
@ EVENT_RECOVER_STATUS
Definition enums.h:2167
@ EVENT_BLOW_AWAY
Definition enums.h:2143
@ ACTOR_PART_FLAG_PRIMARY_TARGET
Definition enums.h:3362
@ ACTOR_PART_FLAG_SKIP_MOVEMENT_ALLOC
Definition enums.h:3366
@ ACTOR_PART_FLAG_NO_TARGET
Cannot be targeted.
Definition enums.h:3360
@ ACTOR_PART_FLAG_INVISIBLE
Definition enums.h:3350
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
@ DAMAGE_TYPE_SHOCK
Definition enums.h:2856
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_BLOCK
Definition evt.h:116
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
f32 sin_rad(f32 x)
Definition 43F0.c:713
void * heap_malloc(s32 size)
Definition heap.c:34
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#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 CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#define SetPriority(PRIORITY)
Sets the current thread's priority. Higher-priority threads execute before lower-priority threads on ...
Definition macros.h:513
#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 EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define NPC_DISPOSE_POS_Y
Definition macros.h:160
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#define Float(DOUBLE)
Definition macros.h:51
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:341
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:337
#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 IfFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is set on LVAR,...
Definition macros.h:288
#define LVar2
Definition macros.h:150
#define DEG_TO_RAD(deg)
Definition macros.h:134
#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 A(sym)
Definition macros.h:36
#define PlayEffect(args...)
Definition macros.h:807
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#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 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
#define ACTOR_BY_POS(_name, _pos, _priority, args...)
Definition battle.h:230
FormationRow Formation[]
Definition battle.h:167