Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
pokey.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3#include "battle/battle.h"
4#include "script_api/battle.h"
5#include "sprite/npc/Pokey.h"
6
7#define NAMESPACE A(pokey)
8
9// while these parts seem set up to manage Pokeys changing size, its actually all handled via animations
10// and the PRT_BODY* are always invisible
11enum N(ActorPartIDs) {
12 PRT_MAIN = 1, // top part of a 4-part Pokey
13 PRT_BODY3 = 2, // bottom part of a 4-part Pokey
14 PRT_BODY2 = 3,
15 PRT_BODY1 = 4,
16 PRT_SINGLE = 5, // single-part Pokey
17 PRT_PROJECTILE = 6, // part which is thrown
18};
19
20enum N(ActorVars) {
21 AVAR_IN_CantSummon = 1,
22 AVAR_PartsThrown = 0,
23 AVAR_Anim_Immune = 1,
24 AVAR_Anim_Run = 2,
25 AVAR_Anim_Hit = 3,
26 AVAR_Anim_Windup = 4,
27 AVAR_Anim_Throw = 5,
28 AVAR_Anim_BurnHurt = 6,
29 AVAR_Anim_BurnStill = 7,
30 AVAR_CantSummon = 9,
31 AVAR_Generation = 10, // Pokeys from the initial formation are generation 0, their summons are generation 1, and so on. generation 2 cannot summon.
32
33 AVAL_Generation_First = 0,
34 AVAL_Generation_Second = 1,
35 AVAL_Generation_Last = 2,
36};
37
38enum N(ActorParams) {
39 DMG_SMASH_LARGE = 2,
40 DMG_SMASH_MEDIUM = 2,
41 DMG_SMASH_SMALL = 2,
42 DMG_THROW_PART = 2, // throw a body part at the player
43 DMG_LEAP = 2, // jump onto the player, used when no more parts can be thrown
44};
45
46extern s32 N(FourPartAnims)[];
47extern s32 N(ThrownPartAnims)[];
48extern EvtScript N(EVS_Init);
49extern EvtScript N(EVS_Idle);
50extern EvtScript N(EVS_HandleEvent);
51extern EvtScript N(EVS_TakeTurn);
52extern EvtScript N(EVS_FindValidSummonPosition);
53extern EvtScript N(EVS_SummonBackup);
54extern EvtScript N(EVS_Attack_SinglePartLeap);
55extern EvtScript N(EVS_Pokey_SpinSmashHit);
56extern EvtScript N(EVS_DecrementSize);
57extern EvtScript N(EVS_KnockPartAway);
58extern EvtScript N(EVS_Pokey_Hit);
59extern EvtScript N(EVS_Pokey_ScareAway);
60
61s32 N(DefenseTable)[] = {
64};
65
66s32 N(StatusTable)[] = {
77 STATUS_KEY_STOP, 100,
89};
90
91ActorPartBlueprint N(ActorParts)[] = {
92 {
94 .index = PRT_MAIN,
95 .posOffset = { 0, 0, 0 },
96 .targetOffset = { 0, 20 },
97 .opacity = 255,
98 .idleAnimations = N(FourPartAnims),
99 .defenseTable = N(DefenseTable),
101 .elementImmunityFlags = 0,
102 .projectileTargetOffset = { 0, 0 },
103 },
104 {
106 .index = PRT_BODY3,
107 .posOffset = { 0, 0, 0 },
108 .targetOffset = { 0, 72 },
109 .opacity = 255,
110 .idleAnimations = NULL,
111 .defenseTable = N(DefenseTable),
113 .elementImmunityFlags = 0,
114 .projectileTargetOffset = { 0, -8 },
115 },
116 {
118 .index = PRT_BODY2,
119 .posOffset = { 0, 0, 0 },
120 .targetOffset = { 0, 54 },
121 .opacity = 255,
122 .idleAnimations = NULL,
123 .defenseTable = N(DefenseTable),
125 .elementImmunityFlags = 0,
126 .projectileTargetOffset = { 0, -8 },
127 },
128 {
130 .index = PRT_BODY1,
131 .posOffset = { 0, 0, 0 },
132 .targetOffset = { 0, 36 },
133 .opacity = 255,
134 .idleAnimations = NULL,
135 .defenseTable = N(DefenseTable),
137 .elementImmunityFlags = 0,
138 .projectileTargetOffset = { 0, -8 },
139 },
140 {
142 .index = PRT_SINGLE,
143 .posOffset = { 0, 0, 0 },
144 .targetOffset = { 0, 16 },
145 .opacity = 255,
146 .idleAnimations = NULL,
147 .defenseTable = N(DefenseTable),
149 .elementImmunityFlags = 0,
150 .projectileTargetOffset = { 0, -8 },
151 },
152 {
154 .index = PRT_PROJECTILE,
155 .posOffset = { 0, 0, 0 },
156 .targetOffset = { 0, 0 },
157 .opacity = 255,
158 .idleAnimations = N(ThrownPartAnims),
159 .defenseTable = N(DefenseTable),
161 .elementImmunityFlags = 0,
162 .projectileTargetOffset = { 0, 0 },
163 },
164};
165
166ActorBlueprint NAMESPACE = {
167 .flags = 0,
168 .type = ACTOR_TYPE_POKEY,
169 .level = ACTOR_LEVEL_POKEY,
170 .maxHP = 4,
171 .partCount = ARRAY_COUNT(N(ActorParts)),
172 .partsData = N(ActorParts),
173 .initScript = &N(EVS_Init),
174 .statusTable = N(StatusTable),
175 .escapeChance = 70,
176 .airLiftChance = 90,
177 .hurricaneChance = 85,
178 .spookChance = 70,
179 .upAndAwayChance = 95,
180 .spinSmashReq = 0,
181 .powerBounceChance = 100,
182 .coinReward = 1,
183 .size = { 24, 80 },
184 .healthBarOffset = { 0, 0 },
185 .statusIconOffset = { -15, 75 },
186 .statusTextOffset = { 10, 65 },
187};
188
189s32 N(FourPartAnims)[] = {
190 STATUS_KEY_NORMAL, ANIM_Pokey_Idle4,
191 STATUS_KEY_STONE, ANIM_Pokey_Still4,
192 STATUS_KEY_SLEEP, ANIM_Pokey_Sleep4,
193 STATUS_KEY_STOP, ANIM_Pokey_Still4,
194 STATUS_KEY_PARALYZE, ANIM_Pokey_Still4,
195 STATUS_KEY_DIZZY, ANIM_Pokey_Dizzy4,
196 STATUS_KEY_FEAR, ANIM_Pokey_Dizzy4,
198};
199
200s32 N(ThreePartAnims)[] = {
201 STATUS_KEY_NORMAL, ANIM_Pokey_Idle3,
202 STATUS_KEY_STONE, ANIM_Pokey_Still3,
203 STATUS_KEY_SLEEP, ANIM_Pokey_Sleep3,
204 STATUS_KEY_STOP, ANIM_Pokey_Still3,
205 STATUS_KEY_PARALYZE, ANIM_Pokey_Still3,
206 STATUS_KEY_DIZZY, ANIM_Pokey_Dizzy3,
207 STATUS_KEY_FEAR, ANIM_Pokey_Dizzy3,
209};
210
211s32 N(TwoPartAnims)[] = {
212 STATUS_KEY_NORMAL, ANIM_Pokey_Idle2,
213 STATUS_KEY_STONE, ANIM_Pokey_Still2,
214 STATUS_KEY_SLEEP, ANIM_Pokey_Sleep2,
215 STATUS_KEY_STOP, ANIM_Pokey_Still2,
216 STATUS_KEY_PARALYZE, ANIM_Pokey_Still2,
217 STATUS_KEY_DIZZY, ANIM_Pokey_Dizzy2,
218 STATUS_KEY_FEAR, ANIM_Pokey_Dizzy2,
220};
221
222s32 N(OnePartAnims)[] = {
223 STATUS_KEY_NORMAL, ANIM_Pokey_Idle1,
224 STATUS_KEY_STONE, ANIM_Pokey_Still1,
225 STATUS_KEY_SLEEP, ANIM_Pokey_Sleep1,
226 STATUS_KEY_STOP, ANIM_Pokey_Still1,
227 STATUS_KEY_PARALYZE, ANIM_Pokey_Still1,
228 STATUS_KEY_DIZZY, ANIM_Pokey_Dizzy1,
229 STATUS_KEY_FEAR, ANIM_Pokey_Dizzy1,
231};
232
233s32 N(ThrownPartAnims)[] = {
234 STATUS_KEY_NORMAL, ANIM_Pokey_Projectile,
236};
237
238EvtScript N(EVS_Init) = {
239 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
240 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
241 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
242 Call(SetActorVar, ACTOR_SELF, AVAR_Generation, AVAL_Generation_First)
243 // copy input var from Formation
244 Call(GetActorVar, ACTOR_SELF, AVAR_IN_CantSummon, LVar0)
245 Call(SetActorVar, ACTOR_SELF, AVAR_CantSummon, LVar0)
246 Call(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, 0)
247 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Immune, ANIM_Pokey_Idle4)
248 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Run, ANIM_Pokey_Run4)
249 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Hit, ANIM_Pokey_Hurt4)
250 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Windup, ANIM_Pokey_Windup3)
251 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Throw, ANIM_Pokey_Throw3)
252 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, ANIM_Pokey_BurnHurt4)
253 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, ANIM_Pokey_BurnStill4)
254 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
255 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
256 Return
257 End
258};
259
260EvtScript N(EVS_Idle) = {
261 Return
262 End
263};
264
265EvtScript N(EVS_HandleEvent) = {
266 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
267 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
268 Call(GetLastEvent, ACTOR_SELF, LVar0)
271 SetConst(LVar0, PRT_MAIN)
272 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
275 Call(GetStatusFlags, ACTOR_SELF, LVar0)
277 SetConst(LVar0, PRT_MAIN)
278 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
280 Else
281 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA)
282 IfEq(LVarA, 3)
283 SetConst(LVar0, PRT_MAIN)
284 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
286 Else
287 Call(GetDamageSource, LVar0)
292 ExecWait(N(EVS_Pokey_Hit))
295 SetConst(LVar0, PRT_MAIN)
296 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
299 EndIf
300 EndIf
302 Call(GetStatusFlags, ACTOR_SELF, LVar0)
304 SetConst(LVar0, PRT_MAIN)
305 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
307 Wait(10)
308 Else
309 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA)
310 IfEq(LVarA, 3)
311 SetConst(LVar0, PRT_MAIN)
312 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
314 Wait(10)
315 Else
316 Call(GetDamageSource, LVar0)
321 ExecWait(N(EVS_Pokey_Hit))
324 SetConst(LVar0, PRT_MAIN)
325 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
327 Wait(10)
329 EndIf
330 EndIf
331 SetConst(LVar0, PRT_MAIN)
332 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
334 Return
336 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, LVar1)
337 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar2)
338 SetConst(LVar0, PRT_MAIN)
339 Call(GetStatusFlags, ACTOR_SELF, LVar3)
342 Else
343 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA)
344 IfEq(LVarA, 3)
346 Else
347 Call(GetDamageSource, LVarA)
352 ExecWait(N(EVS_Pokey_Hit))
357 EndIf
358 EndIf
360 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, LVar1)
361 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar2)
362 SetConst(LVar0, PRT_MAIN)
363 Call(GetStatusFlags, ACTOR_SELF, LVar3)
366 Else
367 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA)
368 IfEq(LVarA, 3)
370 Else
371 Call(GetDamageSource, LVarA)
376 ExecWait(N(EVS_Pokey_Hit))
381 EndIf
382 EndIf
383 SetConst(LVar0, PRT_MAIN)
384 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar1)
386 Return
388 ExecWait(N(EVS_Pokey_SpinSmashHit))
390 ExecWait(N(EVS_Pokey_SpinSmashHit))
391 SetConst(LVar0, PRT_MAIN)
392 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
394 Return
396 Call(GetStatusFlags, ACTOR_SELF, LVar3)
398 SetConst(LVar0, PRT_MAIN)
399 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
401 Else
402 ExecWait(N(EVS_Pokey_Hit))
403 EndIf
405 Call(GetStatusFlags, ACTOR_SELF, LVar3)
407 SetConst(LVar0, PRT_MAIN)
408 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
410 Else
411 ExecWait(N(EVS_Pokey_Hit))
412 EndIf
413 SetConst(LVar0, PRT_MAIN)
414 SetConst(LVar1, -1)
416 Return
418 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
419 SetConst(LVar0, PRT_MAIN)
420 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
422 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Run, LVar1)
423 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1)
424 Call(SetGoalToHome, ACTOR_SELF)
425 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
426 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
427 Call(SetActorJumpGravity, ACTOR_SELF, Float(2.0))
430 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
431 SetConst(LVar0, PRT_MAIN)
432 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
434 SetConst(LVar0, PRT_MAIN)
435 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
437 Return
440 SetConst(LVar0, PRT_MAIN)
441 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Immune, LVar1)
445 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0)
447 CaseEq(0)
448 Set(LVar0, 0)
449 Set(LVar1, 77)
450 SetConst(LVar2, ANIM_Pokey_Dizzy4)
451 CaseEq(1)
452 Set(LVar0, 0)
453 Set(LVar1, 59)
454 SetConst(LVar2, ANIM_Pokey_Dizzy3)
455 CaseEq(2)
456 Set(LVar0, 0)
457 Set(LVar1, 41)
458 SetConst(LVar2, ANIM_Pokey_Dizzy2)
459 CaseEq(3)
460 Set(LVar0, 0)
461 Set(LVar1, 23)
462 SetConst(LVar2, ANIM_Pokey_Dizzy1)
464 Call(GetStatusFlags, ACTOR_SELF, LVar3)
466 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar2)
467 EndIf
468 Call(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5)
469 Call(GetStatusFlags, ACTOR_SELF, LVar6)
471 MulF(LVar0, Float(0.4))
472 MulF(LVar1, Float(0.4))
473 EndIf
476 PlayEffect(EFFECT_LENS_FLARE, 0, LVar3, LVar4, LVar5, 20, 0)
477 Wait(30)
479 SetConst(LVar0, PRT_MAIN)
480 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Immune, LVar1)
483 ExecWait(N(EVS_Pokey_ScareAway))
484 Return
487 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
488 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
489 Return
490 End
491};
492
493EvtScript N(EVS_Attack_GroundSmash) = {
494 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
495 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
496 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
497 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
498 Call(BattleCamTargetActor, ACTOR_SELF)
499 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
500 Call(SetGoalToTarget, ACTOR_SELF)
501 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0)
503 CaseEq(0)
504 Call(GetStatusFlags, ACTOR_SELF, LVar0)
506 Call(AddGoalPos, ACTOR_SELF, 60, 0, 0)
507 Else
508 Call(AddGoalPos, ACTOR_SELF, 24, 0, 0)
509 EndIf
510 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run4)
511 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
512 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
513 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4)
514 CaseEq(1)
515 Call(GetStatusFlags, ACTOR_SELF, LVar0)
517 Call(AddGoalPos, ACTOR_SELF, 40, 0, 0)
518 Else
519 Call(AddGoalPos, ACTOR_SELF, 16, 0, 0)
520 EndIf
521 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run3)
522 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
523 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
524 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle3)
525 CaseEq(2)
526 Call(GetStatusFlags, ACTOR_SELF, LVar0)
528 Call(AddGoalPos, ACTOR_SELF, 20, 0, 0)
529 Else
530 Call(AddGoalPos, ACTOR_SELF, 8, 0, 0)
531 EndIf
532 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run2)
533 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
534 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
535 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle2)
537 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_POKEY_SWAY)
538 Call(MakeLerp, 0, -40, 20, EASING_COS_IN_OUT)
539 Label(0)
541 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
542 Wait(1)
543 IfEq(LVar1, 1)
544 Goto(0)
545 EndIf
547 Wait(3)
548 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_POKEY_SMASH)
550 Call(MakeLerp, -40, 90, 5, EASING_QUADRATIC_IN)
551 Label(3)
553 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
554 Wait(1)
555 IfEq(LVar1, 1)
556 Goto(3)
557 EndIf
558 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 0, BS_FLAGS1_TRIGGER_EVENTS)
562 Set(LVarA, LVar0)
563 Call(MakeLerp, 90, 0, 5, EASING_LINEAR)
564 Label(4)
566 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
567 Wait(1)
568 IfEq(LVar1, 1)
569 Goto(4)
570 EndIf
572 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
573 EndIf
574 Call(YieldTurn)
575 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
576 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
577 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0)
579 CaseEq(0)
580 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run4)
581 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
582 Call(SetGoalToHome, ACTOR_SELF)
583 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
584 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4)
585 CaseEq(1)
586 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run3)
587 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
588 Call(SetGoalToHome, ACTOR_SELF)
589 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
590 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle3)
591 CaseEq(2)
592 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run2)
593 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
594 Call(SetGoalToHome, ACTOR_SELF)
595 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
596 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle2)
598 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
599 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
600 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
601 Return
603 // damage *could* depend on size of the Pokey, but all DMG values are the same, so it doesn't
604 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0)
606 CaseEq(0)
607 Set(LVar1, DMG_SMASH_LARGE)
608 CaseEq(1)
609 Set(LVar1, DMG_SMASH_MEDIUM)
611 Set(LVar1, DMG_SMASH_SMALL)
613 Call(SetGoalToTarget, ACTOR_SELF)
614 Wait(2)
619 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
620 Call(MakeLerp, 90, 0, 10, EASING_LINEAR)
621 Label(5)
623 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
624 Wait(1)
625 IfEq(LVar1, 1)
626 Goto(5)
627 EndIf
628 Call(YieldTurn)
629 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0)
631 CaseEq(0)
632 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run4)
633 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
634 Call(SetGoalToHome, ACTOR_SELF)
635 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
636 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4)
637 CaseEq(1)
638 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run3)
639 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
640 Call(SetGoalToHome, ACTOR_SELF)
641 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
642 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle3)
643 CaseEq(2)
644 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run2)
645 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
646 Call(SetGoalToHome, ACTOR_SELF)
647 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
648 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle2)
652 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
653 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
654 Return
655 End
656};
657
658// (out) LVar9 : number of Pokey actors that aren't disabled, haven't thrown parts, and aren't last-generation
659EvtScript N(EVS_CountSummonerPokeys) = {
660 Set(LVar9, 0)
661 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
662 Call(InitTargetIterator)
663 Label(0)
664 Call(GetOwnerTarget, LVar0, LVar1)
665 Call(GetOriginalActorType, LVar0, LVar2)
667 CaseEq(ACTOR_TYPE_POKEY)
668 Call(GetStatusFlags, LVar0, LVar3)
670 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar3)
671 IfEq(LVar3, 0)
672 Call(GetActorVar, LVar0, AVAR_Generation, LVar3)
673 IfNe(LVar3, AVAL_Generation_Last)
674 Add(LVar9, 1)
675 EndIf
676 EndIf
677 EndIf
679 Call(ChooseNextTarget, ITER_NEXT, LVar0)
681 Goto(0)
682 EndIf
683 Return
684 End
685};
686
687EvtScript N(EVS_TakeTurn) = {
688 #define LBL_NO_SUMMON 123
689 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA)
690 IfEq(LVarA, 3)
691 ExecWait(N(EVS_Attack_SinglePartLeap))
692 Return
693 EndIf
694 Call(GetActorVar, ACTOR_SELF, AVAR_CantSummon, LVar0)
695 IfEq(LVar0, 0)
696 Call(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar0)
697 IfEq(LVar0, AVAL_Generation_Last)
699 EndIf
700 ExecWait(N(EVS_FindValidSummonPosition))
701 IfEq(LVarE, -1)
703 EndIf
704 ExecWait(N(EVS_CountSummonerPokeys))
706 CaseEq(1)
707 Call(RandInt, 1000, LVar0)
708 IfLt(LVar0, 400)
709 ExecWait(N(EVS_SummonBackup))
710 Return
711 EndIf
712 CaseEq(2)
713 Call(RandInt, 1000, LVar0)
714 IfLt(LVar0, 200)
715 ExecWait(N(EVS_SummonBackup))
716 Return
717 EndIf
718 CaseEq(3)
719 Call(RandInt, 1000, LVar0)
720 IfLt(LVar0, 100)
721 ExecWait(N(EVS_SummonBackup))
722 Return
723 EndIf
725 EndIf
726 // try other moves
728 Call(RandInt, 1000, LVar0)
729 IfLt(LVar0, 500)
730 ExecWait(N(EVS_Attack_GroundSmash))
731 Return
732 EndIf
733 // throw a body part
734 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
735 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
736 Call(GetBattlePhase, LVar0)
738 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
739 Call(MoveBattleCamOver, 1)
740 EndIf
741 Call(SetPartSounds, ACTOR_SELF, PRT_PROJECTILE, ACTOR_SOUND_JUMP, SOUND_NONE, SOUND_NONE)
742 Call(GetStatusFlags, ACTOR_SELF, LVar0)
744 Call(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, Float(1.0), Float(1.0), Float(1.0))
745 Else
746 Call(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, Float(0.4), Float(0.4), Float(1.0))
747 EndIf
749 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, FALSE)
750 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
751 Call(SetPartPos, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2)
752 Call(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, Float(2.2))
753 Call(SetAnimation, ACTOR_SELF, PRT_PROJECTILE, ANIM_Pokey_Projectile)
754 Call(GetStatusFlags, ACTOR_SELF, LVar5)
755 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA)
757 CaseEq(0)
759 Add(LVar1, 38)
760 Else
761 Add(LVar1, 15)
762 Call(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, Float(1.2))
763 EndIf
764 Call(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 15, TRUE)
765 CaseEq(1)
767 Add(LVar1, 20)
768 Else
769 Add(LVar1, 8)
770 Call(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, Float(1.2))
771 EndIf
772 Call(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 15, TRUE)
773 CaseEq(2)
775 Add(LVar1, 8)
776 Else
777 Add(LVar1, 3)
778 Call(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, Float(1.2))
779 EndIf
780 Call(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 15, TRUE)
781 CaseEq(3)
784 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_POKEY_SWAY)
785 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Windup, LVar1)
786 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1)
787 Wait(12)
788 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Throw, LVar1)
789 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1)
790 Wait(1)
791 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_POKEY_THROW)
792 Wait(3)
793 ExecWait(N(EVS_DecrementSize))
794 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
795 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, DMG_THROW_PART, BS_FLAGS1_TRIGGER_EVENTS)
801 Wait(5)
802 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
804 EndIf
805 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
806 Call(SetGoalToTarget, ACTOR_SELF)
807 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
808 Sub(LVar0, 80)
809 Sub(LVar1, 5)
810 Call(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, Float(20.0))
811 Call(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, Float(0.1))
812 Call(SetAnimation, ACTOR_SELF, PRT_PROJECTILE, ANIM_Pokey_Projectile)
813 Call(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, TRUE)
814 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE)
815 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Run, LVar1)
816 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1)
817 Return
820 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
821 Call(SetGoalToTarget, ACTOR_SELF)
822 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
823 Call(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, Float(20.0))
824 Call(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, Float(0.1))
825 Call(SetAnimation, ACTOR_SELF, PRT_PROJECTILE, ANIM_Pokey_Projectile)
826 Call(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, TRUE)
828 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Run, LVar1)
829 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1)
833 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
834 Sub(LVar0, 55)
835 Set(LVar1, 0)
836 Call(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, Float(6.0))
837 Call(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, Float(0.1))
838 Call(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR)
839 Call(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, Float(4.0))
840 Sub(LVar0, 24)
841 Call(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR)
842 Call(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, Float(3.0))
843 Sub(LVar0, 20)
844 Call(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, 20, EASING_LINEAR)
845 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE)
848 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
849 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
850 Return
851 End
852};
853
854EvtScript N(EVS_FindValidSummonPosition) = {
855 Set(LVarE, -1)
856 Call(GetStatusFlags, ACTOR_SELF, LVar0)
858 Return
859 EndIf
860 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar0)
861 IfNe(LVar0, 0)
862 Return
863 EndIf
864 // check if each column is occupied
865 Set(LFlag1, FALSE)
866 Set(LFlag2, FALSE)
867 Set(LFlag3, FALSE)
868 Set(LFlag4, FALSE)
869 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
870 Call(InitTargetIterator)
871 Label(0)
872 Call(GetOwnerTarget, LVar0, LVar5)
873 Call(GetIndexFromHome, LVar0, LVar5)
874 Mod(LVar5, 4)
876 CaseEq(0)
877 Set(LFlag1, TRUE)
878 CaseEq(1)
879 Set(LFlag2, TRUE)
880 CaseEq(2)
881 Set(LFlag3, TRUE)
882 CaseEq(3)
883 Set(LFlag4, TRUE)
885 Call(ChooseNextTarget, ITER_NEXT, LVar0)
887 Goto(0)
888 EndIf
889 // only summon if space in front of the Pokey is available, and never if Pokey is in front position
890 Call(GetIndexFromHome, ACTOR_SELF, LVar1)
893 Return // can't summon if Pokey is in front
895 IfEq(LFlag1, FALSE)
897 EndIf
899 IfEq(LFlag2, FALSE)
901 EndIf
903 IfEq(LFlag3, FALSE)
905 EndIf
907 Return
908 End
909};
910
911Vec3i N(SummonPos) = { 400, -100, 0 };
912
913Formation N(SummonFormation) = {
914 ACTOR_BY_POS(NAMESPACE, N(SummonPos), 100),
915};
916
917EvtScript N(EVS_SummonBackup) = {
918 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
919 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
920 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
921 Call(UseBattleCamPreset, BTL_CAM_ACTOR)
922 Call(BattleCamTargetActor, ACTOR_SELF)
923 Call(MoveBattleCamOver, 30)
924 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4)
925 // lean back slightly
926 Call(MakeLerp, 0, -20, 20, EASING_COS_IN_OUT)
927 Label(0)
929 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
930 Wait(1)
931 IfEq(LVar1, 1)
932 Goto(0)
933 EndIf
935 Wait(8)
936 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_POKEY_LEAN_FORWARD)
938 // lean forward
939 Call(MakeLerp, -20, 30, 20, EASING_COS_IN_OUT)
940 Label(1)
942 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
943 Wait(1)
944 IfEq(LVar1, 1)
945 Goto(1)
946 EndIf
948 Wait(6)
949 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_POKEY_LEAN_BACK)
951 // lean back
952 Call(MakeLerp, 30, -40, 20, EASING_COS_IN_OUT)
953 Label(2)
955 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
956 Wait(1)
957 IfEq(LVar1, 1)
958 Goto(2)
959 EndIf
961 Wait(4)
962 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_POKEY_REACH_DOWN)
964 // smash into ground
965 Call(MakeLerp, -40, 90, 10, EASING_COS_IN_OUT)
966 Label(3)
968 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
969 Wait(1)
970 IfEq(LVar1, 1)
971 Goto(3)
972 EndIf
973 Wait(20)
974 // create new Pokey actor
976 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
977 Thread
978 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.0))
980 Call(SummonEnemy, Ref(N(SummonFormation)), FALSE)
981 Set(LVarB, LVar0)
982 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
983 Sub(LVar0, 40)
984 Sub(LVar1, 80)
985 Call(SetActorPos, LVarB, LVar0, LVar1, LVar2)
987 PlayEffect(EFFECT_SHOCKWAVE, 2, LVar0, 0, LVar2, 0)
988 Call(UseIdleAnimation, LVarB, FALSE)
989 Call(SetAnimation, LVarB, 1, ANIM_Pokey_Hurt4)
990 Call(GetActorPos, LVarB, LVar0, LVar1, LVar2)
991 Call(SetActorJumpGravity, LVarB, Float(1.2))
992 Call(SetGoalPos, LVarB, LVar0, 0, LVar2)
993 Call(JumpToGoal, LVarB, 20, FALSE, TRUE, FALSE)
994 Wait(20)
995 Call(GetActorPos, LVarB, LVar0, LVar1, LVar2)
996 Call(SetAnimation, LVarB, 1, ANIM_Pokey_Idle4)
997 Call(SetHomePos, LVarB, LVar0, LVar1, LVar2)
998 Call(HPBarToHome, LVarB)
999 Call(UseIdleAnimation, LVarB, TRUE)
1001 // set generation of child to parent generation + 1
1002 Call(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar1)
1003 Switch(LVar1)
1004 CaseEq(AVAL_Generation_First)
1005 Call(SetActorVar, LVarB, AVAR_Generation, AVAL_Generation_Second)
1006 CaseEq(AVAL_Generation_Second)
1007 Call(SetActorVar, LVarB, AVAR_Generation, AVAL_Generation_Last)
1008 EndSwitch
1009 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1010 Call(MoveBattleCamOver, 20)
1011 Set(LVarA, LVar0)
1012 // pull back and overshoot
1013 Call(MakeLerp, 90, -30, 7, EASING_QUADRATIC_OUT)
1014 Label(4)
1016 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
1017 Wait(1)
1018 IfEq(LVar1, 1)
1019 Goto(4)
1020 EndIf
1021 Wait(20)
1022 // correct overshoot
1023 Call(MakeLerp, -30, 0, 10, EASING_COS_IN_OUT)
1024 Label(5)
1026 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
1027 Wait(1)
1028 IfEq(LVar1, 1)
1029 Goto(5)
1030 EndIf
1031 Wait(20)
1032 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle4)
1033 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1034 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1035 Return
1036 End
1037};
1038
1039EvtScript N(EVS_Attack_SinglePartLeap) = {
1040 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
1041 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
1044 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
1045 Call(BattleCamTargetActor, ACTOR_SELF)
1046 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
1047 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
1048 Call(SetGoalToTarget, ACTOR_SELF)
1049 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1050 Add(LVar0, 50)
1051 Set(LVar1, 0)
1052 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
1053 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run1)
1054 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
1055 Call(SetActorJumpGravity, ACTOR_SELF, Float(2.0))
1057 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1)
1058 Wait(4)
1059 Call(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
1060 Wait(1)
1061 Call(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
1062 Wait(4)
1063 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
1064 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run1)
1065 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, DMG_LEAP, BS_FLAGS1_INCLUDE_POWER_UPS)
1066 Switch(LVar0)
1069 Set(LVarA, LVar0)
1070 Call(SetGoalToTarget, ACTOR_SELF)
1071 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1072 Sub(LVar0, 5)
1073 Set(LVar1, 10)
1074 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1075 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.1))
1077 Wait(2)
1078 Set(LVar0, 0)
1079 Loop(5)
1080 Add(LVar0, 30)
1081 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
1082 Wait(1)
1083 EndLoop
1085 Call(JumpToGoal, ACTOR_SELF, 22, FALSE, TRUE, FALSE)
1087 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
1088 EndIf
1089 Call(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0)
1091 Wait(2)
1092 Set(LVar0, 180)
1093 Loop(6)
1094 Add(LVar0, 30)
1095 IfEq(LVar0, 360)
1096 Set(LVar0, 0)
1097 EndIf
1098 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
1099 Wait(1)
1100 EndLoop
1101 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
1103 Call(SetActorJumpGravity, ACTOR_SELF, Float(2.0))
1104 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1105 Sub(LVar0, 30)
1106 Set(LVar1, 0)
1107 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1108 Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
1109 Wait(15)
1110 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1111 Call(YieldTurn)
1112 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
1113 Call(SetGoalToHome, ACTOR_SELF)
1114 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1115 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
1116 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run1)
1117 Call(SetActorJumpGravity, ACTOR_SELF, Float(2.0))
1119 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
1120 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1)
1121 Return
1123 EndSwitch
1124 Call(SetGoalToTarget, ACTOR_SELF)
1125 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.1))
1127 Wait(2)
1128 Set(LVar0, 0)
1129 Loop(5)
1130 Add(LVar0, 30)
1131 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
1132 Wait(1)
1133 EndLoop
1135 Call(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE)
1136 Wait(2)
1137 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, DMG_STATUS_KEY(STATUS_FLAG_POISON, 3, 0), DMG_LEAP, BS_FLAGS1_TRIGGER_EVENTS)
1138 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1)
1139 Switch(LVar0)
1142 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1143 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
1144 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
1145 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1146 Add(LVar0, 40)
1147 Set(LVar1, 0)
1148 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
1149 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1150 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
1151 Add(LVar0, 30)
1152 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1153 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
1154 Add(LVar0, 20)
1155 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1156 Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
1157 Sub(LVar0, 10)
1158 Call(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE)
1159 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1)
1160 Call(SetGoalToHome, ACTOR_SELF)
1161 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1162 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
1163 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Run1)
1164 Call(SetActorJumpGravity, ACTOR_SELF, Float(2.0))
1166 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Pokey_Idle1)
1167 EndSwitch
1168 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1169 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1170 Return
1171 End
1172};
1173
1174EvtScript N(EVS_Pokey_SpinSmashHit) = {
1175 Call(GetStatusFlags, ACTOR_SELF, LVarA)
1177 SetConst(LVar0, PRT_MAIN)
1178 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
1180 Return
1181 EndIf
1182 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA)
1183 Switch(LVarA)
1184 CaseEq(0)
1185 ExecWait(N(EVS_KnockPartAway))
1186 CaseEq(1)
1187 ExecWait(N(EVS_KnockPartAway))
1188 CaseEq(2)
1189 ExecWait(N(EVS_KnockPartAway))
1190 CaseEq(3)
1191 SetConst(LVar0, PRT_MAIN)
1192 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
1194 EndSwitch
1195 Return
1196 End
1197};
1198
1199#include "common/battle/SetAbsoluteStatusOffsets.inc.c"
1200
1201// set actor vars for new size one unit smaller than previous
1202EvtScript N(EVS_DecrementSize) = {
1203 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA)
1204 Switch(LVarA)
1205 CaseEq(0)
1206 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Immune, ANIM_Pokey_Idle3)
1207 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Run, ANIM_Pokey_Run3)
1208 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Hit, ANIM_Pokey_Hurt3)
1209 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Windup, ANIM_Pokey_Windup2)
1210 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Throw, ANIM_Pokey_Throw2)
1211 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, ANIM_Pokey_BurnHurt3)
1212 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, ANIM_Pokey_BurnStill3)
1213 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ThreePartAnims)))
1214 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY3, ACTOR_PART_FLAG_PRIMARY_TARGET, FALSE)
1215 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY3, ACTOR_PART_FLAG_NO_TARGET, TRUE)
1216 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY2, ACTOR_PART_FLAG_NO_TARGET, FALSE)
1217 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY2, ACTOR_PART_FLAG_PRIMARY_TARGET, TRUE)
1218 Call(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, 1)
1219 Call(SetActorSize, ACTOR_SELF, 62, EVT_IGNORE_ARG)
1220 Call(SetPartSize, ACTOR_SELF, PRT_MAIN, 62, EVT_IGNORE_ARG)
1221 Call(N(SetAbsoluteStatusOffsets), -15, 55, 10, 45)
1222 CaseEq(1)
1223 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Immune, ANIM_Pokey_Idle2)
1224 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Run, ANIM_Pokey_Run2)
1225 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Hit, ANIM_Pokey_Hurt2)
1226 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Windup, ANIM_Pokey_Windup1)
1227 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Throw, ANIM_Pokey_Throw1)
1228 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, ANIM_Pokey_BurnHurt2)
1229 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, ANIM_Pokey_BurnStill2)
1230 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(TwoPartAnims)))
1231 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY2, ACTOR_PART_FLAG_PRIMARY_TARGET, FALSE)
1232 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY2, ACTOR_PART_FLAG_NO_TARGET, TRUE)
1233 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY1, ACTOR_PART_FLAG_NO_TARGET, FALSE)
1234 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY1, ACTOR_PART_FLAG_PRIMARY_TARGET, TRUE)
1235 Call(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, 2)
1236 Call(SetActorSize, ACTOR_SELF, 44, EVT_IGNORE_ARG)
1237 Call(SetPartSize, ACTOR_SELF, PRT_MAIN, 44, EVT_IGNORE_ARG)
1238 Call(N(SetAbsoluteStatusOffsets), -15, 35, 10, 25)
1239 CaseEq(2)
1240 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Immune, ANIM_Pokey_Idle1)
1241 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Run, ANIM_Pokey_Run1)
1242 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_Hit, ANIM_Pokey_Hurt1)
1243 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, ANIM_Pokey_BurnHurt1)
1244 Call(SetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, ANIM_Pokey_BurnStill1)
1245 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(OnePartAnims)))
1246 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY1, ACTOR_PART_FLAG_PRIMARY_TARGET, FALSE)
1247 Call(SetPartFlagBits, ACTOR_SELF, PRT_BODY1, ACTOR_PART_FLAG_NO_TARGET, TRUE)
1248 Call(SetPartFlagBits, ACTOR_SELF, PRT_SINGLE, ACTOR_PART_FLAG_NO_TARGET, FALSE)
1249 Call(SetPartFlagBits, ACTOR_SELF, PRT_SINGLE, ACTOR_PART_FLAG_PRIMARY_TARGET, TRUE)
1250 Call(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, 3)
1251 Call(SetActorSize, ACTOR_SELF, 26, EVT_IGNORE_ARG)
1252 Call(SetPartSize, ACTOR_SELF, PRT_MAIN, 26, EVT_IGNORE_ARG)
1253 Call(N(SetAbsoluteStatusOffsets), -15, 15, 10, 5)
1254 EndSwitch
1255 Return
1256 End
1257};
1258
1259EvtScript N(EVS_HitReactionBounce) = {
1260 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1261 Add(LVar1, 18)
1262 Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1263 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1264 Set(LVar3, LVar1)
1265 Wait(2)
1266 Sub(LVar3, 1)
1267 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1268 Wait(3)
1269 Sub(LVar3, 2)
1270 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1271 Wait(2)
1272 Sub(LVar3, 3)
1273 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1274 Wait(1)
1275 Sub(LVar3, 5)
1276 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1277 Wait(1)
1278 Sub(LVar3, 7)
1279 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1280 Wait(1)
1281 Add(LVar3, 2)
1282 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1283 Wait(1)
1284 Add(LVar3, 3)
1285 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1286 Wait(1)
1287 Add(LVar3, 3)
1288 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1289 Wait(1)
1290 Sub(LVar3, 3)
1291 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1292 Wait(1)
1293 Sub(LVar3, 3)
1294 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1295 Wait(1)
1296 Sub(LVar3, 2)
1297 Call(SetActorPos, ACTOR_SELF, LVar0, LVar3, LVar2)
1298 Return
1299 End
1300};
1301
1302EvtScript N(EVS_KnockPartAway) = {
1303 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1304 Call(SetPartPos, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2)
1305 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, FALSE)
1306 Call(GetStatusFlags, ACTOR_SELF, LVar0)
1308 Call(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, Float(1.0), Float(1.0), Float(1.0))
1309 Else
1310 Call(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, Float(0.4), Float(0.4), Float(1.0))
1311 EndIf
1312 ExecWait(N(EVS_DecrementSize))
1313 SetConst(LVar0, PRT_MAIN)
1314 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
1315 Call(SetAnimation, ACTOR_SELF, LVar0, LVar1)
1317 Wait(4)
1318 ExecWait(N(EVS_HitReactionBounce))
1321 Call(InitTargetIterator)
1322 Label(0)
1323 Call(GetOwnerID, LVar1)
1324 Call(GetOwnerTarget, LVar0, LVar9)
1325 IfNe(LVar1, LVar0)
1326 Call(ChooseNextTarget, ITER_NEXT, LVar0)
1327 Goto(0)
1328 EndIf
1329 Label(1)
1330 Add(LVarF, 1)
1331 Call(ChooseNextTarget, ITER_NEXT, LVar0)
1333 Goto(10)
1334 EndIf
1335 Call(GetOwnerTarget, LVar0, LVar9)
1336 Call(GetActorFlags, LVar0, LVar1)
1338 Goto(1)
1339 EndIf
1340 Call(GetOwnerID, LVar0)
1341 Call(GetOwnerTarget, LVar0, LVar1)
1342 Call(SetGoalToTarget, ACTOR_SELF)
1343 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1344 Set(LVar1, 0)
1345 Call(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, Float(0.1))
1346 Call(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, Float(7.0))
1347 Call(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 0, TRUE)
1349 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.0))
1351 Call(SetGoalToTarget, ACTOR_SELF)
1352 Call(GetOwnerTarget, LVar0, LVar1)
1353 Call(DispatchDamageEvent, LVar0, 1, EVENT_SPIN_SMASH_LAUNCH_HIT)
1354 Goto(1)
1355 Label(10)
1356 Call(UseBattleCamPreset, BTL_CAM_VIEW_ENEMIES)
1357 Call(SetPartJumpGravity, ACTOR_SELF, PRT_PROJECTILE, Float(0.1))
1358 Call(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, Float(6.0))
1359 Call(JumpPartTo, ACTOR_SELF, PRT_PROJECTILE, 296, 0, 0, 0, TRUE)
1360 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_NO_TARGET, TRUE)
1361 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE)
1362 Return
1363 End
1364};
1365
1366EvtScript N(EVS_Pokey_Hit) = {
1367 Call(GetStatusFlags, ACTOR_SELF, LVar0)
1369 Call(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, Float(1.0), Float(1.0), Float(1.0))
1370 Else
1371 Call(SetPartScale, ACTOR_SELF, PRT_PROJECTILE, Float(0.4), Float(0.4), Float(1.0))
1372 EndIf
1373 ExecWait(N(EVS_DecrementSize))
1374 SetConst(LVar0, PRT_MAIN)
1375 Call(GetLastEvent, ACTOR_SELF, LVar1)
1376 Switch(LVar1)
1379 Call(SetAnimation, ACTOR_SELF, PRT_PROJECTILE, ANIM_Pokey_BurnedProjectile)
1380 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnHurt, LVar1)
1383 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
1384 EndSwitch
1385 Call(SetAnimation, ACTOR_SELF, LVar0, LVar1)
1387 Wait(4)
1388 ExecWait(N(EVS_HitReactionBounce))
1390 Call(GetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVarA)
1391 IfNe(LVarA, 3)
1392 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1393 Call(SetPartPos, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2)
1394 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, FALSE)
1395 Call(SetPartMoveSpeed, ACTOR_SELF, PRT_PROJECTILE, Float(6.0))
1396 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1397 Add(LVar0, 30)
1398 Set(LVar1, 0)
1399 Call(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 10, 18, EASING_LINEAR)
1400 Add(LVar0, 20)
1401 Call(FlyPartTo, ACTOR_SELF, PRT_PROJECTILE, LVar0, LVar1, LVar2, 8, 10, EASING_LINEAR)
1402 Loop(20)
1403 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE)
1404 Wait(1)
1405 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, FALSE)
1406 Wait(1)
1407 EndLoop
1408 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_NO_TARGET, TRUE)
1409 Call(SetPartFlagBits, ACTOR_SELF, PRT_PROJECTILE, ACTOR_PART_FLAG_INVISIBLE, TRUE)
1410 Else
1411 Wait(30)
1412 EndIf
1413 Call(GetLastEvent, ACTOR_SELF, LVar0)
1414 Switch(LVar0)
1416 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar1)
1417 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1)
1418 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1419 Call(GetActorSize, ACTOR_SELF, LVar3, LVar4)
1420 Div(LVar3, 2)
1421 Add(LVar1, LVar3)
1422 Add(LVar2, 5)
1423 DivF(LVar3, Float(10.0))
1424 PlayEffect(EFFECT_SMOKE_BURST, 0, LVar0, LVar1, LVar2, LVar3, 10, 0)
1426 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_BurnStill, LVar1)
1427 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, LVar1)
1428 Wait(10)
1430 EndSwitch
1431 Return
1432 End
1433};
1434
1435EvtScript N(EVS_Pokey_ScareAway) = {
1436 SetConst(LVar0, PRT_MAIN)
1437 Call(GetActorVar, ACTOR_SELF, AVAR_Anim_Hit, LVar1)
1438 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1439 Call(GetActorFlags, ACTOR_SELF, LVar9)
1440 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.05))
1441 Call(GetActorPos, ACTOR_SELF, LVarA, LVarB, LVarC)
1442 Set(LVarD, LVarB)
1443 Add(LVarD, 40)
1444 Call(SetGoalPos, ACTOR_SELF, LVarA, LVarD, LVarC)
1445 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
1446 Call(SetAnimation, ACTOR_SELF, LVar0, LVar1)
1447 Wait(20)
1448 Call(SetGoalPos, ACTOR_SELF, LVarA, LVarB, LVarC)
1449 Call(FallToGoal, ACTOR_SELF, 10)
1450 Wait(20)
1451 Call(SetActorYaw, ACTOR_SELF, 180)
1452 Wait(5)
1453 Call(SetActorVar, ACTOR_SELF, AVAR_PartsThrown, LVar2)
1454 Switch(LVar2)
1455 CaseEq(0)
1456 Set(LVar2, 96)
1457 Set(LVar6, 4)
1458 CaseEq(1)
1459 Set(LVar2, 72)
1460 Set(LVar6, 3)
1461 CaseEq(2)
1462 Set(LVar2, 48)
1463 Set(LVar6, 2)
1465 Set(LVar2, 24)
1466 Set(LVar6, 1)
1467 EndSwitch
1469 Call(GetActorPos, ACTOR_SELF, LVarA, LVarB, LVarC)
1470 Loop(LVar6)
1471 PlayEffect(EFFECT_SHOCKWAVE, 2, LVarA, 0, LVarC, 0)
1472 Wait(10)
1473 EndLoop
1475 Call(SetActorSpeed, ACTOR_SELF, Float(2.0))
1476 Call(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5)
1477 Sub(LVar4, LVar2)
1478 Call(SetGoalPos, ACTOR_SELF, LVar3, LVar4, LVar5)
1479 Call(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR)
1480 Wait(8)
1481 Call(HideHealthBar, ACTOR_SELF)
1482 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
1483 Call(RemoveActor, ACTOR_SELF)
1484 Return
1485 End
1486};
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ ACTOR_SOUND_WALK
Definition enums.h:2034
@ ACTOR_SOUND_JUMP
Definition enums.h:2036
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ ACTOR_EVENT_FLAG_ALT_SPIKY
Additional spiky quality associated with Pokeys and Spinies.
Definition enums.h:3388
@ ACTOR_EVENT_FLAG_SPIKY_TOP
Player takes spike damage from jump attacks.
Definition enums.h:3373
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ PHASE_FIRST_STRIKE
Definition enums.h:2059
@ 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_ACTOR
Definition enums.h:4836
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4885
@ BTL_CAM_VIEW_ENEMIES
Definition enums.h:4825
@ TARGET_FLAG_PRIMARY_ONLY
Definition enums.h:1863
@ TARGET_FLAG_ALLOW_TARGET_ONLY
Definition enums.h:1864
@ TARGET_FLAG_GROUND
Definition enums.h:1851
@ TARGET_FLAG_2
Definition enums.h:1850
@ EASING_QUADRATIC_IN
Definition enums.h:511
@ EASING_COS_IN_OUT
Definition enums.h:520
@ EASING_QUADRATIC_OUT
Definition enums.h:514
@ EASING_LINEAR
Definition enums.h:510
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ STATUS_FLAG_SLEEP
Definition enums.h:2812
@ STATUS_FLAG_POISON
Definition enums.h:2817
@ DMG_SRC_POWER_SHELL
Definition enums.h:1995
@ DMG_SRC_FIRE_SHELL
Definition enums.h:1997
@ DMG_SRC_SHELL_TOSS
Definition enums.h:1994
@ SOUND_POKEY_REACH_DOWN
Definition enums.h:1072
@ SOUND_POKEY_LEAN_FORWARD
Definition enums.h:1148
@ SOUND_NONE
Definition enums.h:547
@ SOUND_POKEY_EMERGE_FROM_GROUND
Definition enums.h:1150
@ SOUND_POKEY_THROW
Definition enums.h:1040
@ SOUND_POKEY_SWAY
Definition enums.h:1146
@ SOUND_POKEY_STEP
Definition enums.h:1070
@ SOUND_POKEY_LEAN_BACK
Definition enums.h:1149
@ SOUND_POKEY_SMASH
Definition enums.h:1071
@ BTL_RUMBLE_PLAYER_HEAVY
Definition enums.h:4261
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_TARGET_ONLY
Battle ends even if undefeated. No turn.
Definition enums.h:3334
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4905
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_SPIN_SMASH_LAUNCH_HIT
Definition enums.h:2138
@ 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_SHOCK_DEATH
Definition enums.h:2159
@ EVENT_SPIN_SMASH_HIT
Definition enums.h:2133
@ EVENT_SPIN_SMASH_DEATH
Definition enums.h:2154
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_SPIKE_TAUNT
Definition enums.h:2148
@ EVENT_DEATH
Definition enums.h:2153
@ EVENT_SPIN_SMASH_LAUNCH_DEATH
Definition enums.h:2158
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ EVENT_RECOVER_STATUS
Definition enums.h:2167
@ ACTOR_PART_FLAG_PRIMARY_TARGET
Definition enums.h:3362
@ ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION
Definition enums.h:3361
@ ACTOR_PART_FLAG_NO_TARGET
Cannot be targeted.
Definition enums.h:3360
@ ACTOR_PART_FLAG_INVISIBLE
Definition enums.h:3350
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
EvtScript EVS_Enemy_HopToPos
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_ShockHit
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
#define LBL_NO_SUMMON
ApiStatus UpdateLerp(Evt *script, b32 isInitialCall)
ApiStatus RandInt(Evt *script, b32 isInitialCall)
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
ApiStatus MakeLerp(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 Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define LVar6
Definition macros.h:154
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define DivF(VAR, FLOAT_VALUE)
Definition macros.h:386
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define AddF(VAR, FLOAT_VALUE)
Definition macros.h:383
#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 EndChildThread
Marks the end of a child thread block.
Definition macros.h:563
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#define LVarF
Definition macros.h:163
#define LFlag4
Definition macros.h:171
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Mod(VAR, INT_VALUE)
Definition macros.h:380
#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 Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define LVarC
Definition macros.h:160
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
Definition macros.h:275
#define Float(DOUBLE)
Definition macros.h:51
#define LFlag1
Definition macros.h:168
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#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 LVar5
Definition macros.h:153
#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 LVarB
Definition macros.h:159
#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 Div(VAR, INT_VALUE)
Definition macros.h:379
#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 MulF(VAR, FLOAT_VALUE)
Definition macros.h:385
#define DMG_STATUS_KEY(typeFlag, duration, chance)
Definition macros.h:224
#define EVT_IGNORE_ARG
Definition macros.h:46
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define IfNotFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is unset on LVAR,...
Definition macros.h:292
#define LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LFlag2
Definition macros.h:169
#define LVar9
Definition macros.h:157
#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 ChildThread
Marks the start of a child thread block.
Definition macros.h:560
#define LFlag3
Definition macros.h:170
#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 LVarE
Definition macros.h:162
#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
@ BTL_POS_GROUND_B
Definition battle.h:62
@ BTL_POS_GROUND_D
Definition battle.h:64
@ BTL_POS_GROUND_A
Definition battle.h:61
@ BTL_POS_GROUND_C
Definition battle.h:63
FormationRow Formation[]
Definition battle.h:167