Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
lakitu.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/Spiny.h"
4#include "sprite/npc/Lakitu.h"
5#include "effects.h"
6
7#define NAMESPACE A(lakitu)
8
9extern ActorBlueprint A(spiny);
10
11extern EvtScript N(EVS_Init);
12extern EvtScript N(EVS_Idle);
13extern EvtScript N(EVS_TakeTurn);
14extern EvtScript N(EVS_HandleEvent);
15
16enum N(ActorPartIDs) {
17 PRT_MAIN = 1,
18 PRT_SPINY_BALL = 2,
19 PRT_SPINY = 3,
20};
21
22enum N(ActorVars) {
23 AVAR_SummonCount = 0,
24};
25
26enum N(ActorParams) {
27 DMG_SPINY_TOSS = 3,
28};
29
30s32 N(DefaultAnims)[] = {
31 STATUS_KEY_NORMAL, ANIM_Lakitu_Anim01,
32 STATUS_KEY_STONE, ANIM_Lakitu_Anim00,
33 STATUS_KEY_SLEEP, ANIM_Lakitu_Anim08,
34 STATUS_KEY_POISON, ANIM_Lakitu_Anim01,
35 STATUS_KEY_STOP, ANIM_Lakitu_Anim00,
36 STATUS_KEY_STATIC, ANIM_Lakitu_Anim01,
37 STATUS_KEY_PARALYZE, ANIM_Lakitu_Anim00,
38 STATUS_KEY_DIZZY, ANIM_Lakitu_Anim09,
39 STATUS_KEY_FEAR, ANIM_Lakitu_Anim09,
41};
42
43s32 N(SpinyBallAnims)[] = {
44 STATUS_KEY_NORMAL, ANIM_Lakitu_Anim0B,
46};
47
48s32 N(SpinyAnims)[] = {
49 STATUS_KEY_NORMAL, ANIM_Spiny_Anim01,
51};
52
53s32 N(DefenseTable)[] = {
57};
58
59s32 N(StatusTable)[] = {
82};
83
84ActorPartBlueprint N(ActorParts)[] = {
85 {
87 .index = PRT_MAIN,
88 .posOffset = { 0, 0, 0 },
89 .targetOffset = { -5, 35 },
90 .opacity = 255,
91 .idleAnimations = N(DefaultAnims),
92 .defenseTable = N(DefenseTable),
93 .eventFlags = 0,
94 .elementImmunityFlags = 0,
95 .projectileTargetOffset = { 0, -13 },
96 },
97 {
99 .index = PRT_SPINY_BALL,
100 .posOffset = { 0, 0, 0 },
101 .targetOffset = { 0, 0 },
102 .opacity = 255,
103 .idleAnimations = N(SpinyBallAnims),
104 .defenseTable = N(DefenseTable),
105 .eventFlags = 0,
106 .elementImmunityFlags = 0,
107 .projectileTargetOffset = { 0, 0 },
108 },
109 {
111 .index = PRT_SPINY,
112 .posOffset = { 0, 0, 0 },
113 .targetOffset = { 0, 0 },
114 .opacity = 255,
115 .idleAnimations = N(SpinyAnims),
116 .defenseTable = N(DefenseTable),
117 .eventFlags = 0,
118 .elementImmunityFlags = 0,
119 .projectileTargetOffset = { 0, 0 },
120 },
121};
122
123ActorBlueprint NAMESPACE = {
124 .flags = ACTOR_FLAG_FLYING,
125 .type = ACTOR_TYPE_LAKITU,
126 .level = ACTOR_LEVEL_LAKITU,
127 .maxHP = 12,
128 .partCount = ARRAY_COUNT(N(ActorParts)),
129 .partsData = N(ActorParts),
130 .initScript = &N(EVS_Init),
131 .statusTable = N(StatusTable),
132 .escapeChance = 40,
133 .airLiftChance = 90,
134 .hurricaneChance = 90,
135 .spookChance = 50,
136 .upAndAwayChance = 95,
137 .spinSmashReq = 0,
138 .powerBounceChance = 85,
139 .coinReward = 2,
140 .size = { 32, 38 },
141 .healthBarOffset = { 0, 0 },
142 .statusIconOffset = { -11, 20 },
143 .statusTextOffset = { 10, 34 },
144};
145
146EvtScript N(EVS_Init) = {
147 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
148 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
149 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
150 Call(SetActorVar, ACTOR_SELF, AVAR_SummonCount, 0)
151 Return
152 End
153};
154
155EvtScript N(EVS_Idle) = {
156 Return
157 End
158};
159
160EvtScript N(EVS_ReturnHome) = {
161 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim03)
162 Call(SetGoalToHome, ACTOR_SELF)
163 Call(SetActorSpeed, ACTOR_SELF, Float(7.0))
164 Call(FlyToGoal, ACTOR_SELF, 0, 0, EASING_SIN_OUT)
165 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01)
166 Return
167 End
168};
169
170EvtScript N(EVS_HandleEvent) = {
171 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
172 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
173 Call(GetLastEvent, ACTOR_SELF, LVar0)
177 SetConst(LVar0, PRT_MAIN)
178 SetConst(LVar1, ANIM_Lakitu_Anim04)
182 SetConst(LVar0, PRT_MAIN)
183 SetConst(LVar1, ANIM_Lakitu_Anim05)
184 SetConst(LVar2, ANIM_Lakitu_Anim06)
187 SetConst(LVar0, PRT_MAIN)
188 SetConst(LVar1, ANIM_Lakitu_Anim05)
189 SetConst(LVar2, ANIM_Lakitu_Anim06)
191 SetConst(LVar0, PRT_MAIN)
192 SetConst(LVar1, ANIM_Lakitu_Anim06)
194 Return
196 SetConst(LVar0, PRT_MAIN)
197 SetConst(LVar1, ANIM_Lakitu_Anim04)
200 SetConst(LVar0, PRT_MAIN)
201 SetConst(LVar1, ANIM_Lakitu_Anim04)
203 SetConst(LVar0, PRT_MAIN)
204 SetConst(LVar1, ANIM_Lakitu_Anim04)
206 Return
208 SetConst(LVar0, PRT_MAIN)
209 SetConst(LVar1, ANIM_Lakitu_Anim04)
211 SetConst(LVar0, PRT_MAIN)
212 SetConst(LVar1, ANIM_Lakitu_Anim04)
214 ExecWait(N(EVS_ReturnHome))
216 SetConst(LVar0, PRT_MAIN)
217 SetConst(LVar1, ANIM_Lakitu_Anim04)
219 SetConst(LVar0, PRT_MAIN)
220 SetConst(LVar1, ANIM_Lakitu_Anim04)
222 Return
226 SetConst(LVar0, PRT_MAIN)
227 SetConst(LVar1, ANIM_Lakitu_Anim01)
231 SetConst(LVar0, PRT_MAIN)
232 SetConst(LVar1, ANIM_Lakitu_Anim04)
234 Wait(10)
235 SetConst(LVar0, PRT_MAIN)
236 SetConst(LVar1, ANIM_Lakitu_Anim04)
238 Return
240 Call(SetActorPos, ACTOR_SELF, 20, 0, 0)
241 Call(HPBarToCurrent, ACTOR_SELF)
243 ExecWait(N(EVS_ReturnHome))
244 Call(HPBarToHome, ACTOR_SELF)
246 SetConst(LVar0, PRT_MAIN)
247 SetConst(LVar1, ANIM_Lakitu_Anim01)
250 SetConst(LVar0, PRT_MAIN)
251 SetConst(LVar1, ANIM_Lakitu_Anim03)
252 SetConst(LVar2, ANIM_Lakitu_Anim04)
254 Return
256 SetConst(LVar0, PRT_MAIN)
257 SetConst(LVar1, ANIM_Lakitu_Anim04)
260 SetConst(LVar0, PRT_MAIN)
261 SetConst(LVar1, ANIM_Lakitu_Anim04)
263 Return
266 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
267 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
268 Return
269 End
270};
271
272EvtScript N(EVS_Attack_SpinyToss) = {
273 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
274 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
275 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
276 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
277 Call(BattleCamTargetActor, ACTOR_SELF)
278 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
279 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
280 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim03)
281 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
282 Call(SetGoalPos, ACTOR_SELF, -20, LVar1, LVar2)
283 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
284 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01)
285 Call(SetAnimation, ACTOR_SELF, PRT_SPINY_BALL, ANIM_Lakitu_Anim0B)
286 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim12)
287 Wait(20)
288 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim13)
289 Call(GetStatusFlags, ACTOR_SELF, LVarA)
291 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
292 Add(LVar0, -3)
293 Add(LVar1, 16)
294 Add(LVar2, 2)
295 PlayEffect(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, Float(0.4), 10, 0)
296 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
297 Add(LVar1, 12)
298 Add(LVar2, 0)
299 Call(SetPartPos, ACTOR_SELF, PRT_SPINY_BALL, LVar0, LVar1, LVar2)
300 Call(SetPartScale, ACTOR_SELF, PRT_SPINY_BALL, Float(0.4), Float(0.4), Float(0.4))
301 Else
302 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
303 Add(LVar0, -8)
304 Add(LVar1, 40)
305 Add(LVar2, 5)
306 PlayEffect(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, Float(1.0), 10, 0)
307 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
308 Add(LVar1, 30)
309 Add(LVar2, 2)
310 Call(SetPartPos, ACTOR_SELF, PRT_SPINY_BALL, LVar0, LVar1, LVar2)
311 Call(SetPartScale, ACTOR_SELF, PRT_SPINY_BALL, Float(1.0), Float(1.0), Float(1.0))
312 EndIf
313 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY_BALL, ACTOR_PART_FLAG_INVISIBLE, FALSE)
314 Wait(10)
315 Thread
316 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim15)
317 Wait(20)
318 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01)
320 Call(SetAnimation, ACTOR_SELF, PRT_SPINY_BALL, ANIM_Lakitu_Anim0C)
321 Call(PlaySoundAtPart, ACTOR_SELF, PRT_SPINY_BALL, SOUND_LAKITU_THROW_SPINY)
322 Call(SetPartSounds, ACTOR_SELF, PRT_SPINY_BALL, ACTOR_SOUND_JUMP, SOUND_NONE, SOUND_NONE)
323 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
327 Set(LVarA, LVar0)
328 Call(SetPartJumpGravity, ACTOR_SELF, PRT_SPINY_BALL, Float(1.0))
329 Call(SetGoalToTarget, ACTOR_SELF)
330 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
331 Sub(LVar0, 40)
332 Set(LVar1, 0)
333 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY_BALL, LVar0, 0, LVar2, 20, TRUE)
334 Sub(LVar0, 30)
336 Call(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
337 EndIf
338 Call(ResetAllActorSounds, ACTOR_SELF)
339 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY_BALL, LVar0, 0, LVar2, 10, TRUE)
340 Sub(LVar0, 20)
341 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY_BALL, LVar0, 0, LVar2, 5, TRUE)
342 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY_BALL, ACTOR_PART_FLAG_INVISIBLE, TRUE)
343 Wait(20)
344 Call(YieldTurn)
345 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
346 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
347 Call(SetActorYaw, ACTOR_SELF, 180)
348 ExecWait(N(EVS_ReturnHome))
349 Call(SetActorYaw, ACTOR_SELF, 0)
350 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
351 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
352 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
353 Return
356 Call(SetPartJumpGravity, ACTOR_SELF, PRT_SPINY_BALL, Float(1.0))
357 Call(SetGoalToTarget, ACTOR_SELF)
358 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
359 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY_BALL, LVar0, LVar1, LVar2, 20, TRUE)
360 Call(ResetAllActorSounds, ACTOR_SELF)
361 Wait(2)
362 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_SPINY_TOSS, BS_FLAGS1_TRIGGER_EVENTS)
366 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
367 Thread
368 Call(SetPartJumpGravity, ACTOR_SELF, PRT_SPINY_BALL, Float(1.0))
369 Call(SetGoalToTarget, ACTOR_SELF)
370 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
371 Sub(LVar0, 40)
372 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY_BALL, LVar0, 0, LVar2, 20, TRUE)
373 Sub(LVar0, 30)
374 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY_BALL, LVar0, 0, LVar2, 10, TRUE)
375 Sub(LVar0, 20)
376 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY_BALL, LVar0, 0, LVar2, 5, TRUE)
377 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY_BALL, ACTOR_PART_FLAG_INVISIBLE, TRUE)
379 Wait(20)
380 Call(YieldTurn)
381 ExecWait(N(EVS_ReturnHome))
384 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
385 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
386 Return
387 End
388};
389
390Vec3i N(SummonPos) = { NPC_DISPOSE_LOCATION };
391
392Formation N(SpinyFormation) = {
393 ACTOR_BY_POS(A(spiny), N(SummonPos), 100, 1),
394};
395
396EvtScript N(EVS_Move_SummonSpiny) = {
397 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
398 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
399 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
400 Call(UseBattleCamPreset, BTL_CAM_ACTOR)
401 Call(BattleCamTargetActor, ACTOR_SELF)
402 Call(SummonEnemy, Ref(N(SpinyFormation)), FALSE)
403 Call(CopyStatusEffects, ACTOR_SELF, LVar0)
404 Set(LVarB, LVar0)
405 Call(SetAnimation, ACTOR_SELF, PRT_SPINY_BALL, ANIM_Lakitu_Anim0B)
406 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim12)
407 Wait(20)
408 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim13)
409 Call(GetStatusFlags, ACTOR_SELF, LVar0)
411 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
412 Add(LVar0, -3)
413 Add(LVar1, 16)
414 Add(LVar2, 2)
415 PlayEffect(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, Float(0.4), 10, 0)
416 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
417 Add(LVar1, 12)
418 Add(LVar2, 0)
419 Call(SetPartPos, ACTOR_SELF, PRT_SPINY_BALL, LVar0, LVar1, LVar2)
420 Call(SetPartScale, ACTOR_SELF, PRT_SPINY_BALL, Float(0.4), Float(0.4), Float(0.4))
421 Call(SetPartScale, ACTOR_SELF, PRT_SPINY, Float(0.4), Float(0.4), Float(0.4))
422 Else
423 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
424 Add(LVar0, -8)
425 Add(LVar1, 40)
426 Add(LVar2, 5)
427 PlayEffect(EFFECT_ENERGY_IN_OUT, 0, LVar0, LVar1, LVar2, Float(1.0), 10, 0)
428 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
429 Add(LVar1, 30)
430 Add(LVar2, 2)
431 Call(SetPartPos, ACTOR_SELF, PRT_SPINY_BALL, LVar0, LVar1, LVar2)
432 Call(SetPartScale, ACTOR_SELF, PRT_SPINY_BALL, Float(1.0), Float(1.0), Float(1.0))
433 Call(SetPartScale, ACTOR_SELF, PRT_SPINY, Float(1.0), Float(1.0), Float(1.0))
434 EndIf
435 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY_BALL, ACTOR_PART_FLAG_INVISIBLE, FALSE)
436 Wait(10)
437 Thread
438 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim15)
439 Wait(20)
440 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Lakitu_Anim01)
442 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
443 Call(PlaySoundAtPart, ACTOR_SELF, PRT_SPINY_BALL, SOUND_LAKITU_THROW_SPINY)
444 Call(SetPartSounds, ACTOR_SELF, PRT_SPINY_BALL, ACTOR_SOUND_JUMP, SOUND_NONE, SOUND_NONE)
445 Call(SetAnimation, ACTOR_SELF, PRT_SPINY_BALL, ANIM_Lakitu_Anim0C)
446 Call(SetPartJumpGravity, ACTOR_SELF, PRT_SPINY_BALL, Float(1.6))
447 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
448 Sub(LVar0, 40)
449 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY_BALL, LVar0, 0, LVar2, 12, TRUE)
450 Call(SetPartPos, ACTOR_SELF, PRT_SPINY, LVar0, 0, LVar2)
451 Sub(LVar0, 30)
452 Thread
453 Call(SetPartRotationOffset, ACTOR_SELF, PRT_SPINY, 0, 16, 0)
454 Set(LVar0, 0)
455 Set(LVar1, 0)
456 Set(LFlag0, FALSE)
457 Loop(12)
458 Add(LVar0, 30)
459 Call(SetPartRotation, ACTOR_SELF, PRT_SPINY, 0, 0, LVar0)
460 Add(LVar1, 1)
461 IfGe(LVar1, 6)
462 IfEq(LFlag0, TRUE)
463 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY_BALL, ACTOR_PART_FLAG_INVISIBLE, FALSE)
464 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY, ACTOR_PART_FLAG_INVISIBLE, TRUE)
465 Set(LFlag0, FALSE)
466 Else
467 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY_BALL, ACTOR_PART_FLAG_INVISIBLE, TRUE)
468 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY, ACTOR_PART_FLAG_INVISIBLE, FALSE)
469 Set(LFlag0, TRUE)
470 EndIf
471 EndIf
472 Wait(1)
473 EndLoop
475 Thread
476 Call(SetPartJumpGravity, ACTOR_SELF, PRT_SPINY, Float(1.3))
477 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY, LVar0, 0, LVar2, 12, TRUE)
479 Wait(1)
480 Call(ResetAllActorSounds, ACTOR_SELF)
481 Call(SetPartJumpGravity, ACTOR_SELF, PRT_SPINY_BALL, Float(1.3))
482 Call(JumpPartTo, ACTOR_SELF, PRT_SPINY_BALL, LVar0, 0, LVar2, 12, TRUE)
483 PlayEffect(EFFECT_LANDING_DUST, 1, LVar0, 0, LVar2, 0, 0)
484 Call(GetPartOffset, ACTOR_SELF, PRT_SPINY_BALL, LVar0, LVar1, LVar2)
485 Call(SetActorPos, LVarB, LVar0, LVar1, LVar2)
486 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY_BALL, ACTOR_PART_FLAG_INVISIBLE, TRUE)
487 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPINY, ACTOR_PART_FLAG_INVISIBLE, TRUE)
488 Call(SetAnimation, LVarB, 1, ANIM_Spiny_Anim01)
489 Wait(20)
490 Call(SetAnimation, LVarB, 1, ANIM_Spiny_Anim04)
491 Call(SetGoalToIndex, LVarB, LVarA)
492 Call(GetGoalPos, LVarB, LVar0, LVar1, LVar2)
493 Call(GetActorPos, LVarB, LVar3, LVar4, LVar5)
495 Call(SetActorYaw, LVarB, 0)
496 Else
497 Call(SetActorYaw, LVarB, 180)
498 EndIf
499 Call(SetActorSpeed, LVarB, Float(4.0))
500 Call(RunToGoal, LVarB, 0, FALSE)
501 Call(SetAnimation, LVarB, 1, ANIM_Spiny_Anim01)
502 Call(SetActorYaw, LVarB, 0)
503 Call(GetActorPos, LVarB, LVar0, LVar1, LVar2)
504 Call(ForceHomePos, LVarB, LVar0, LVar1, LVar2)
505 Call(HPBarToHome, LVarB)
506 Call(GetActorVar, ACTOR_SELF, AVAR_SummonCount, LVar0)
507 Add(LVar0, 1)
508 Call(SetActorVar, ACTOR_SELF, AVAR_SummonCount, LVar0)
509 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
510 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
511 Return
512 End
513};
514
515EvtScript N(EVS_GetAvailableColumn) = {
516 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
517 Call(InitTargetIterator)
518 Label(0)
519 Call(GetOwnerTarget, LVar0, LVar5)
520 Call(GetIndexFromHome, LVar0, LVar5)
521 Mod(LVar5, 4)
523 CaseEq(0)
524 Set(LFlag1, TRUE)
525 CaseEq(1)
526 Set(LFlag2, TRUE)
527 CaseEq(2)
528 Set(LFlag3, TRUE)
529 CaseEq(3)
530 Set(LFlag4, TRUE)
532 Call(ChooseNextTarget, ITER_NEXT, LVar0)
534 Goto(0)
535 EndIf
536 IfEq(LFlag1, FALSE)
537 Set(LVarA, 0)
538 Return
539 EndIf
540 IfEq(LFlag2, FALSE)
541 Set(LVarA, 1)
542 Return
543 EndIf
544 IfEq(LFlag3, FALSE)
545 Set(LVarA, 2)
546 Return
547 EndIf
548 IfEq(LFlag4, FALSE)
549 Set(LVarA, 3)
550 Return
551 EndIf
552 Set(LVarA, -1)
553 Return
554 End
555};
556
557EvtScript N(EVS_CountActiveSummoners) = {
558 Set(LVar9, 0)
559 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
560 Call(InitTargetIterator)
561 Label(0)
562 Call(GetOwnerTarget, LVar0, LVar1)
563 Call(GetOriginalActorType, LVar0, LVar2)
565 CaseEq(ACTOR_TYPE_LAKITU)
566 Call(GetStatusFlags, LVar0, LVar3)
568 Call(GetActorVar, LVar0, AVAR_SummonCount, LVar3)
569 IfLt(LVar3, 3)
570 Add(LVar9, 1)
571 EndIf
572 EndIf
574 Call(ChooseNextTarget, ITER_NEXT, LVar0)
576 Goto(0)
577 EndIf
578 Return
579 End
580};
581
582EvtScript N(EVS_TakeTurn) = {
583 Call(GetActorVar, ACTOR_SELF, AVAR_SummonCount, LVar0)
584 IfGe(LVar0, 3)
585 ExecWait(N(EVS_Attack_SpinyToss))
586 Return
587 EndIf
588 ExecWait(N(EVS_GetAvailableColumn))
589 IfEq(LVarA, -1)
590 ExecWait(N(EVS_Attack_SpinyToss))
591 Return
592 EndIf
593 ExecWait(N(EVS_CountActiveSummoners))
595 CaseEq(1)
596 Call(RandInt, 1000, LVar0)
597 IfLt(LVar0, 500)
598 ExecWait(N(EVS_Move_SummonSpiny))
599 Return
600 EndIf
601 CaseEq(2)
602 Call(RandInt, 1000, LVar0)
603 IfLt(LVar0, 250)
604 ExecWait(N(EVS_Move_SummonSpiny))
605 Return
606 EndIf
607 CaseEq(3)
608 Call(RandInt, 1000, LVar0)
609 IfLt(LVar0, 150)
610 ExecWait(N(EVS_Move_SummonSpiny))
611 Return
612 EndIf
614 ExecWait(N(EVS_Attack_SpinyToss))
615 Return
616 End
617};
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ 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_MYSTERY
Definition enums.h:2119
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ 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
@ TARGET_FLAG_PRIMARY_ONLY
Definition enums.h:1863
@ TARGET_FLAG_2
Definition enums.h:1850
@ EASING_SIN_OUT
Definition enums.h:521
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ SOUND_LAKITU_THROW_SPINY
Definition enums.h:1496
@ SOUND_NONE
Definition enums.h:547
@ 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_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_BEGIN_FIRST_STRIKE
Definition enums.h:2173
@ EVENT_END_FIRST_STRIKE
Definition enums.h:2171
@ 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_AIR_LIFT_FAILED
Definition enums.h:2152
@ EVENT_BEGIN_AIR_LIFT
Definition enums.h:2175
@ EVENT_DEATH
Definition enums.h:2153
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ 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_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
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
EvtScript EVS_Enemy_Knockback
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_ShockHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
ApiStatus RandInt(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 Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define IfGe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR >= RVAR.
Definition macros.h:284
#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 Sub(VAR, INT_VALUE)
Definition macros.h:377
#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 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 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 LVar1
Definition macros.h:149
#define LFlag0
Definition macros.h:167
#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 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 NPC_DISPOSE_LOCATION
Definition macros.h:158
#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 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 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