Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
spear_guy.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/ShyGuy.h"
6#include "sprite/npc/SpearGuy.h"
7
8#define NAMESPACE A(spear_guy)
9
10extern s32 N(ShyGuyAnims)[];
11
12extern EvtScript N(EVS_Init);
13extern EvtScript N(EVS_Idle);
14extern EvtScript N(EVS_TakeTurn);
15extern EvtScript N(EVS_HandleEvent);
16extern EvtScript N(EVS_HandlePhase);
17extern Formation N(ForwardSpearFormation);
18extern Formation N(UpwardSpearFormation);
19
20extern EvtScript N(EVS_ShyGuy_Init);
21extern EvtScript N(EVS_ShyGuy_Idle);
22extern EvtScript N(EVS_ShyGuy_TakeTurn);
23extern EvtScript N(EVS_ShyGuy_HandleEvent);
24
25enum N(ActorPartIDs) {
26 PRT_SHY_GUY = 1,
27 PRT_SPEAR_GUY = 2,
28 PRT_SPEAR = 3,
29 PRT_GRASS_SKIRT = 4,
30};
31
32enum N(ActorVars) {
33 AVAR_State = 0,
34 AVAL_State_SpearForward = 0,
35 AVAL_State_SpearUpward = 1,
36 AVAL_State_ShyGuy = 2,
37 AVAR_Generation = 1,
38};
39
40enum N(ActorParams) {
41 DMG_STAB = 3,
42 DMG_THROW = 3,
43 DMG_TACKLE = 2,
44 DMG_VAULT = 3,
45};
46
47s32 N(SpearForwardAnims)[] = {
48 STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim04,
49 STATUS_KEY_STONE, ANIM_SpearGuy_Anim02,
50 STATUS_KEY_SLEEP, ANIM_SpearGuy_Anim0D,
51 STATUS_KEY_POISON, ANIM_SpearGuy_Anim0F,
52 STATUS_KEY_STOP, ANIM_SpearGuy_Anim02,
53 STATUS_KEY_STATIC, ANIM_SpearGuy_Anim04,
54 STATUS_KEY_PARALYZE, ANIM_SpearGuy_Anim02,
55 STATUS_KEY_DIZZY, ANIM_SpearGuy_Anim0F,
56 STATUS_KEY_FEAR, ANIM_SpearGuy_Anim0F,
58};
59
60s32 N(SpearUpwardAnims)[] = {
61 STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim03,
62 STATUS_KEY_STONE, ANIM_SpearGuy_Anim0D,
63 STATUS_KEY_SLEEP, ANIM_SpearGuy_Anim0D,
64 STATUS_KEY_POISON, ANIM_SpearGuy_Anim0F,
65 STATUS_KEY_STOP, ANIM_SpearGuy_Anim01,
66 STATUS_KEY_STATIC, ANIM_SpearGuy_Anim03,
67 STATUS_KEY_PARALYZE, ANIM_SpearGuy_Anim01,
68 STATUS_KEY_DIZZY, ANIM_SpearGuy_Anim0F,
69 STATUS_KEY_FEAR, ANIM_SpearGuy_Anim0F,
71};
72
73s32 N(SpearAnims)[] = {
74 STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim14,
76};
77
78s32 N(GrassSkirtAnims)[] = {
79 STATUS_KEY_NORMAL, ANIM_SpearGuy_Anim19,
81};
82
83s32 N(SpearGuyDefense)[] = {
85 ELEMENT_FIRE, 0,
87};
88
89s32 N(ShyGuyDefense)[] = {
93};
94
95s32 N(SpearGuyStatusTable)[] = {
102 STATUS_KEY_FEAR, 100,
106 STATUS_KEY_STOP, 80,
118};
119
120s32 N(ShyGuyStatusTable)[] = {
127 STATUS_KEY_FEAR, 100,
131 STATUS_KEY_STOP, 90,
143};
144
145ActorPartBlueprint N(ActorParts)[] = {
146 {
148 .index = PRT_SPEAR_GUY,
149 .posOffset = { 0, 0, 0 },
150 .targetOffset = { 0, 22 },
151 .opacity = 255,
152 .idleAnimations = N(SpearForwardAnims),
153 .defenseTable = N(SpearGuyDefense),
154 .eventFlags = ACTOR_EVENT_FLAG_SPIKY_FRONT,
155 .elementImmunityFlags = 0,
156 .projectileTargetOffset = { -3, -8 },
157 },
158 {
160 .index = PRT_SHY_GUY,
161 .posOffset = { 0, 0, 0 },
162 .targetOffset = { 0, 24 },
163 .opacity = 255,
164 .idleAnimations = N(ShyGuyAnims),
165 .defenseTable = N(ShyGuyDefense),
166 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
167 .elementImmunityFlags = 0,
168 .projectileTargetOffset = { -1, -10 },
169 },
170 {
172 .index = PRT_SPEAR,
173 .posOffset = { 0, 0, 0 },
174 .targetOffset = { 0, 0 },
175 .opacity = 255,
176 .idleAnimations = N(SpearAnims),
177 .defenseTable = N(ShyGuyDefense),
178 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
179 .elementImmunityFlags = 0,
180 .projectileTargetOffset = { 0, 0 },
181 },
182 {
184 .index = PRT_GRASS_SKIRT,
185 .posOffset = { 0, 0, 0 },
186 .targetOffset = { 0, 0 },
187 .opacity = 255,
188 .idleAnimations = N(GrassSkirtAnims),
189 .defenseTable = N(ShyGuyDefense),
190 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
191 .elementImmunityFlags = 0,
192 .projectileTargetOffset = { 0, 0 },
193 },
194};
195
196ActorBlueprint NAMESPACE = {
197 .flags = 0,
198 .type = ACTOR_TYPE_SPEAR_GUY,
199 .level = ACTOR_LEVEL_SPEAR_GUY,
200 .maxHP = 7,
201 .partCount = ARRAY_COUNT(N(ActorParts)),
202 .partsData = N(ActorParts),
203 .initScript = &N(EVS_Init),
204 .statusTable = N(SpearGuyStatusTable),
205 .escapeChance = 50,
206 .airLiftChance = 85,
207 .hurricaneChance = 80,
208 .spookChance = 70,
209 .upAndAwayChance = 95,
210 .spinSmashReq = 0,
211 .powerBounceChance = 85,
212 .coinReward = 2,
213 .size = { 24, 24 },
214 .healthBarOffset = { 0, 0 },
215 .statusIconOffset = { -10, 20 },
216 .statusTextOffset = { 10, 20 },
217};
218
219EvtScript N(EVS_UpdateSpearStance) = {
221 CaseEq(AVAL_State_ShyGuy)
222 // do nothing
223 CaseEq(AVAL_State_SpearForward)
224 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_SpearForward)
225 Call(SetIdleAnimations, ACTOR_SELF, PRT_SPEAR_GUY, Ref(N(SpearForwardAnims)))
226 Call(SetPartEventFlags, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_FRONT)
227 CaseEq(AVAL_State_SpearUpward)
228 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_SpearUpward)
229 Call(SetIdleAnimations, ACTOR_SELF, PRT_SPEAR_GUY, Ref(N(SpearUpwardAnims)))
230 Call(SetPartEventFlags, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_TOP)
232 Return
233 End
234};
235
236EvtScript N(EVS_Init) = {
237 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
239 CaseEq(AVAL_State_SpearForward)
240 ExecWait(N(EVS_UpdateSpearStance))
241 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim04)
242 CaseEq(AVAL_State_SpearUpward)
243 ExecWait(N(EVS_UpdateSpearStance))
244 Call(SetPartEventFlags, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_TOP)
245 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim03)
247 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
248 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
249 Call(BindHandlePhase, ACTOR_SELF, Ref(N(EVS_HandlePhase)))
250 Call(SetActorVar, ACTOR_SELF, AVAR_Generation, 0)
251 Call(GetEncounterTrigger, LVar0)
256 Call(SetPartEventBits, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_FRONT, FALSE)
257 Call(SetIdleAnimations, ACTOR_SELF, PRT_SPEAR_GUY, Ref(N(SpearUpwardAnims)))
258 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim03)
261 Return
262 End
263};
264
265EvtScript N(EVS_HandlePhase) = {
266 Call(BindHandlePhase, ACTOR_SELF, NULL)
267 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
268 Return
269 End
270};
271
272EvtScript N(EVS_SelectAnim) = {
273 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVarA)
274 IfEq(LVarA, AVAL_State_SpearForward)
275 Call(GetStatusFlags, ACTOR_SELF, LVarB)
277 Else
278 Set(LVar1, LVar2)
279 EndIf
280 EndIf
281 Return
282 End
283};
284
285EvtScript N(EVS_Idle) = {
286 Label(0)
287 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
289 CaseEq(AVAL_State_SpearForward)
290 Call(GetStatusFlags, ACTOR_SELF, LVar0)
292 Call(SetIdleAnimations, ACTOR_SELF, PRT_SPEAR_GUY, Ref(N(SpearUpwardAnims)))
293 Call(SetPartEventBits, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE)
294 Call(SetPartEventBits, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_FRONT, FALSE)
295 Else
296 Call(SetIdleAnimations, ACTOR_SELF, PRT_SPEAR_GUY, Ref(N(SpearForwardAnims)))
297 Call(SetPartEventBits, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE)
298 Call(SetPartEventBits, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_FRONT, TRUE)
299 EndIf
300 CaseEq(AVAL_State_SpearUpward)
301 Call(SetIdleAnimations, ACTOR_SELF, PRT_SPEAR_GUY, Ref(N(SpearUpwardAnims)))
302 Call(SetPartEventBits, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE)
303 Call(SetPartEventBits, ACTOR_SELF, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_FRONT, FALSE)
305 Wait(1)
306 Goto(0)
307 Return
308 End
309};
310
311EvtScript N(EVS_ReturnHome) = {
312 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
313 SetConst(LVar0, PRT_SPEAR_GUY)
314 SetConst(LVar1, ANIM_SpearGuy_Anim06)
316 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
318 CaseEq(AVAL_State_SpearForward)
319 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim04)
320 CaseEq(AVAL_State_SpearUpward)
321 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim03)
323 Return
324 End
325};
326
327EvtScript N(EVS_HandleEvent) = {
328 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
329 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
330 Call(GetLastEvent, ACTOR_SELF, LVar0)
334 SetConst(LVar0, PRT_SPEAR_GUY)
335 SetConst(LVar1, ANIM_SpearGuy_Anim07)
336 SetConst(LVar2, ANIM_SpearGuy_Anim08)
337 ExecWait(N(EVS_SelectAnim))
341 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
342 IfEq(LVar0, AVAL_State_SpearForward)
343 Call(GetStatusFlags, ACTOR_SELF, LVarB)
345 SetConst(LVar0, PRT_SPEAR_GUY)
346 SetConst(LVar1, ANIM_SpearGuy_Anim0A)
347 SetConst(LVar2, ANIM_SpearGuy_Anim0C)
348 Else
349 SetConst(LVar0, PRT_SPEAR_GUY)
350 SetConst(LVar1, ANIM_SpearGuy_Anim0B)
351 SetConst(LVar2, -1)
352 EndIf
353 Else
354 SetConst(LVar0, PRT_SPEAR_GUY)
355 SetConst(LVar1, ANIM_SpearGuy_Anim0A)
356 SetConst(LVar2, ANIM_SpearGuy_Anim0C)
357 EndIf
360 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
361 IfEq(LVar0, AVAL_State_SpearForward)
362 Call(GetStatusFlags, ACTOR_SELF, LVarB)
364 SetConst(LVar0, PRT_SPEAR_GUY)
365 SetConst(LVar1, ANIM_SpearGuy_Anim0A)
366 SetConst(LVar2, ANIM_SpearGuy_Anim0C)
368 SetConst(LVar0, PRT_SPEAR_GUY)
369 SetConst(LVar1, ANIM_SpearGuy_Anim0C)
371 Else
372 SetConst(LVar0, PRT_SPEAR_GUY)
373 SetConst(LVar1, ANIM_SpearGuy_Anim0B)
374 SetConst(LVar2, -1)
376 SetConst(LVar0, PRT_SPEAR_GUY)
377 SetConst(LVar1, ANIM_SpearGuy_Anim0B)
379 EndIf
380 Else
381 SetConst(LVar0, PRT_SPEAR_GUY)
382 SetConst(LVar1, ANIM_SpearGuy_Anim0A)
383 SetConst(LVar2, ANIM_SpearGuy_Anim0C)
385 SetConst(LVar0, PRT_SPEAR_GUY)
386 SetConst(LVar1, ANIM_SpearGuy_Anim0C)
388 EndIf
389 Return
391 SetConst(LVar0, PRT_SPEAR_GUY)
392 SetConst(LVar1, ANIM_SpearGuy_Anim07)
393 SetConst(LVar2, ANIM_SpearGuy_Anim08)
394 ExecWait(N(EVS_SelectAnim))
397 SetConst(LVar0, PRT_SPEAR_GUY)
398 SetConst(LVar1, ANIM_SpearGuy_Anim07)
399 SetConst(LVar2, ANIM_SpearGuy_Anim08)
400 ExecWait(N(EVS_SelectAnim))
402 SetConst(LVar0, PRT_SPEAR_GUY)
403 SetConst(LVar1, ANIM_SpearGuy_Anim09)
404 SetConst(LVar2, ANIM_SpearGuy_Anim08)
405 ExecWait(N(EVS_SelectAnim))
407 Return
409 SetConst(LVar0, PRT_SPEAR_GUY)
410 SetConst(LVar1, ANIM_SpearGuy_Anim07)
411 SetConst(LVar2, ANIM_SpearGuy_Anim08)
412 ExecWait(N(EVS_SelectAnim))
414 SetConst(LVar0, PRT_SPEAR_GUY)
415 SetConst(LVar1, ANIM_SpearGuy_Anim07)
416 SetConst(LVar2, ANIM_SpearGuy_Anim08)
417 ExecWait(N(EVS_SelectAnim))
419 ExecWait(N(EVS_ReturnHome))
421 SetConst(LVar0, PRT_SPEAR_GUY)
422 SetConst(LVar1, ANIM_SpearGuy_Anim07)
424 SetConst(LVar0, PRT_SPEAR_GUY)
425 SetConst(LVar1, ANIM_SpearGuy_Anim09)
427 Return
431 SetConst(LVar0, PRT_SPEAR_GUY)
432 SetConst(LVar1, ANIM_SpearGuy_Anim03)
433 SetConst(LVar2, ANIM_SpearGuy_Anim04)
434 ExecWait(N(EVS_SelectAnim))
438 SetConst(LVar0, PRT_SPEAR_GUY)
439 SetConst(LVar1, ANIM_SpearGuy_Anim07)
440 SetConst(LVar2, ANIM_SpearGuy_Anim08)
441 ExecWait(N(EVS_SelectAnim))
443 Wait(10)
444 SetConst(LVar0, PRT_SPEAR_GUY)
445 SetConst(LVar1, ANIM_SpearGuy_Anim09)
446 SetConst(LVar2, ANIM_SpearGuy_Anim08)
447 ExecWait(N(EVS_SelectAnim))
449 Return
451 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
453 CaseEq(AVAL_State_SpearForward)
454 SetConst(LVar0, PRT_SPEAR_GUY)
455 SetConst(LVar1, ANIM_SpearGuy_Anim04)
457 CaseEq(AVAL_State_SpearUpward)
458 SetConst(LVar0, PRT_SPEAR_GUY)
459 SetConst(LVar1, ANIM_SpearGuy_Anim03)
463 SetConst(LVar0, PRT_SPEAR_GUY)
464 SetConst(LVar1, ANIM_SpearGuy_Anim06)
465 SetConst(LVar2, ANIM_SpearGuy_Anim07)
467 Return
469 SetConst(LVar0, PRT_SPEAR_GUY)
470 SetConst(LVar1, ANIM_SpearGuy_Anim04)
473 SetConst(LVar0, PRT_SPEAR_GUY)
474 SetConst(LVar1, ANIM_SpearGuy_Anim04)
476 Return
478 Wait(10)
479 Set(LFlag0, FALSE)
480 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
481 Call(GetStatusFlags, ACTOR_SELF, LVar3)
482 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVarA)
484 CaseEq(AVAL_State_SpearForward)
486 Add(LVar0, -11)
487 Add(LVar1, 3)
488 Set(LFlag0, TRUE)
489 EndIf
491 Add(LVar0, -4)
492 Add(LVar1, 36)
493 Set(LFlag0, TRUE)
494 EndIf
496 Add(LVar0, -8)
497 Add(LVar1, 36)
498 Set(LFlag0, TRUE)
499 EndIf
500 IfEq(LFlag0, FALSE)
501 Add(LVar0, -28)
502 Add(LVar1, 8)
503 EndIf
504 CaseEq(AVAL_State_SpearUpward)
506 Add(LVar0, -4)
507 Add(LVar1, 15)
508 Set(LFlag0, TRUE)
509 EndIf
511 Add(LVar0, -4)
512 Add(LVar1, 36)
513 Set(LFlag0, TRUE)
514 EndIf
516 Add(LVar0, -8)
517 Add(LVar1, 36)
518 Set(LFlag0, TRUE)
519 EndIf
520 IfEq(LFlag0, FALSE)
521 Add(LVar0, -10)
522 Add(LVar1, 38)
523 EndIf
525 PlayEffect(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 20, 0)
526 Wait(20)
529 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
530 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
531 Return
532 End
533};
534
535EvtScript N(EVS_Attack_SpearStab) = {
536 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
537 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
538 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
539 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
540 Call(BattleCamTargetActor, ACTOR_SELF)
541 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
542 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim06)
543 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
544 Call(SetGoalToTarget, ACTOR_SELF)
545 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
546 Call(GetStatusFlags, ACTOR_SELF, LVarA)
548 Add(LVar0, 10)
549 Else
550 Add(LVar0, 25)
551 EndIf
552 Set(LVar1, 0)
553 Add(LVar2, 1)
554 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
555 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
556 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim04)
557 Wait(5)
558 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim1A)
559 Wait(15)
560 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
564 Set(LVarA, LVar0)
565 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_STAB)
566 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim1B)
567 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.5))
568 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
569 Sub(LVar0, 30)
570 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
571 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
573 Call(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
574 EndIf
575 Sub(LVar0, 20)
576 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
577 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
578 Wait(15)
579 Wait(20)
580 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
581 Call(SetActorYaw, ACTOR_SELF, 180)
582 Call(AddActorDecoration, ACTOR_SELF, PRT_SPEAR_GUY, 0, ACTOR_DECORATION_SWEAT)
583 ExecWait(N(EVS_ReturnHome))
584 Call(RemoveActorDecoration, ACTOR_SELF, PRT_SPEAR_GUY, 0)
585 Call(SetActorYaw, ACTOR_SELF, 0)
586 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
587 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
588 Return
591 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_STAB)
592 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim1B)
593 Wait(5)
594 Wait(2)
595 Call(SetGoalToTarget, ACTOR_SELF)
596 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_STAB, BS_FLAGS1_TRIGGER_EVENTS)
600 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
601 Wait(20)
602 ExecWait(N(EVS_ReturnHome))
605 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
606 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
607 Return
608 End
609};
610
611EvtScript N(EVS_Move_SummonBackup) = {
612 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
613 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
614 Call(UseBattleCamPreset, BTL_CAM_ACTOR)
615 Call(BattleCamTargetActor, ACTOR_SELF)
616 Call(MoveBattleCamOver, 15)
617 Wait(15)
618 Call(UseBattleCamPreset, BTL_CAM_INTERRUPT)
619 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim05)
620 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
621 Thread
622 Wait(5)
623 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_GUY_DANCE_1)
624 Wait(15)
625 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_GUY_DANCE_2)
627 Call(SetActorYaw, ACTOR_SELF, 0)
628 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
629 Sub(LVar0, 10)
630 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim05)
631 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
632 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
633 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim10)
634 Wait(25)
635 Thread
636 Wait(5)
637 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_GUY_DANCE_1)
638 Wait(15)
639 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_GUY_DANCE_2)
641 Call(SetActorYaw, ACTOR_SELF, 180)
642 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
643 Add(LVar0, 20)
644 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim05)
645 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
646 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
647 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim10)
648 Wait(30)
649 Call(SetActorYaw, ACTOR_SELF, 0)
650 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
651 Sub(LVar0, 10)
652 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim05)
653 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
654 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
655 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
656 Add(LVar1, 15)
657 PlayEffect(EFFECT_SPARKLES, 0, LVar0, LVar1, LVar2, 30, 0)
658 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_RECOVER_HEART)
659 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim0E)
660 Wait(20)
661 Call(GetOriginalActorType, ACTOR_SELF, LVar0)
662 Call(CreateHomeTargetList, TARGET_FLAG_GROUND | TARGET_FLAG_PRIMARY_ONLY)
663 Call(InitTargetIterator)
664 Label(0)
665 Call(GetOwnerTarget, LVar1, LVar2)
666 Call(GetOriginalActorType, LVar1, LVar2)
668 Call(SetAnimation, LVar1, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim04)
669 Call(GetIndexFromHome, LVar1, LVar3)
671 Call(GetActorVar, LVar1, AVAR_State, LVar4)
672 IfEq(LVar4, AVAL_State_SpearForward)
673 Call(SetActorVar, LVar1, AVAR_State, AVAL_State_SpearUpward)
674 Call(SetIdleAnimations, LVar1, PRT_SPEAR_GUY, Ref(N(SpearUpwardAnims)))
675 Call(SetPartEventFlags, LVar1, PRT_SPEAR_GUY, ACTOR_EVENT_FLAG_SPIKY_TOP)
676 Call(SetAnimation, LVar1, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim03)
677 EndIf
678 EndIf
679 EndIf
680 Call(ChooseNextTarget, ITER_NEXT, LVar1)
682 Goto(0)
683 EndIf
684 Set(LFlag0, FALSE)
685 Call(CreateHomeTargetList, TARGET_FLAG_GROUND | TARGET_FLAG_PRIMARY_ONLY)
686 Call(InitTargetIterator)
687 Label(1)
688 Call(GetOwnerTarget, LVar0, LVar1)
689 Call(GetIndexFromHome, LVar0, LVar1)
691 Set(LFlag0, TRUE)
692 EndIf
693 Call(ChooseNextTarget, ITER_NEXT, LVar0)
695 Goto(1)
696 EndIf
697 IfEq(LFlag0, FALSE)
698 Call(SummonEnemy, Ref(N(ForwardSpearFormation)), FALSE)
699 Else
700 Call(SummonEnemy, Ref(N(UpwardSpearFormation)), FALSE)
701 EndIf
702 Set(LVarB, LVar0)
703 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
704 Call(SetAnimation, LVarB, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim10)
705 Call(SetGoalToIndex, LVarB, LVarA)
706 Call(GetGoalPos, LVarB, LVar0, LVar1, LVar2)
707 Add(LVar0, 220)
708 Call(SetActorPos, LVarB, LVar0, 0, 0)
710 Thread
711 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_GUY_DANCE_1)
712 Wait(15)
713 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_GUY_DANCE_1)
714 Wait(15)
715 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_GUY_DANCE_2)
716 Wait(15)
717 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SPEAR_GUY_DANCE_2)
718 Wait(15)
720 Call(SetActorSpeed, LVarB, Float(4.0))
721 Call(RunToGoal, LVarB, 0, FALSE)
722 Call(ResetAllActorSounds, ACTOR_SELF)
723 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_RECOVER_HEART)
724 Call(GetActorPos, LVarB, LVar0, LVar1, LVar2)
725 Add(LVar1, 15)
726 PlayEffect(EFFECT_SPARKLES, 0, LVar0, LVar1, LVar2, 30, 0)
727 Call(SetAnimation, LVarB, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim0E)
728 Wait(20)
729 IfEq(LFlag0, FALSE)
730 Call(SetAnimation, LVarB, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim04)
731 Else
732 Call(SetAnimation, LVarB, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim03)
733 EndIf
734 Call(GetActorPos, LVarB, LVar0, LVar1, LVar2)
735 Call(ForceHomePos, LVarB, LVar0, LVar1, LVar2)
736 Call(HPBarToHome, LVarB)
737 Call(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar0)
739 CaseEq(0)
740 Call(SetActorVar, LVarB, AVAR_Generation, 1)
741 CaseEq(1)
742 Call(SetActorVar, LVarB, AVAR_Generation, 2)
744 Call(SetActorVar, ACTOR_SELF, AVAR_Generation, 3)
745 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
746 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
747 Return
748 End
749};
750
751Vec3i N(SummonPos) = { NPC_DISPOSE_LOCATION };
752
753Formation N(ForwardSpearFormation) = {
754 ACTOR_BY_POS(NAMESPACE, N(SummonPos), 100, AVAL_State_SpearForward),
755};
756
757Formation N(UpwardSpearFormation) = {
758 ACTOR_BY_POS(NAMESPACE, N(SummonPos), 100, AVAL_State_SpearUpward),
759};
760
761EvtScript N(EVS_BecomeShyGuy) = {
762 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_ShyGuy)
763 Wait(10)
764 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
765 Call(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2)
766 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim13)
767 Wait(5)
768 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim18)
769 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
770 Sub(LVar0, 10)
771 Add(LVar1, 15)
772 Sub(LVar2, 1)
773 Call(SetPartPos, ACTOR_SELF, PRT_GRASS_SKIRT, LVar0, LVar1, LVar2)
774 Call(SetPartFlagBits, ACTOR_SELF, PRT_GRASS_SKIRT, ACTOR_PART_FLAG_INVISIBLE, FALSE)
775 Call(SetPartJumpGravity, ACTOR_SELF, PRT_GRASS_SKIRT, Float(0.5))
776 Add(LVar0, 50)
777 Sub(LVar2, 30)
778 Thread
779 Loop(15)
780 Call(SetPartRotation, ACTOR_SELF, PRT_GRASS_SKIRT, 0, 0, 10)
781 Wait(1)
782 Call(SetPartRotation, ACTOR_SELF, PRT_GRASS_SKIRT, 0, 0, -10)
783 Wait(1)
784 EndLoop
786 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_RECOVER_HEART)
787 Thread
788 Loop(10)
789 Call(GetPartOffset, ACTOR_SELF, PRT_GRASS_SKIRT, LVar0, LVar1, LVar2)
790 PlayEffect(EFFECT_SPARKLES, 3, LVar0, LVar1, LVar2, 5, 0)
791 Wait(3)
792 EndLoop
794 Call(PlaySoundAtPart, ACTOR_SELF, PRT_GRASS_SKIRT, SOUND_SPEAR_GUY_RIP_SKIRT)
795 Call(SetPartSounds, ACTOR_SELF, PRT_GRASS_SKIRT, ACTOR_SOUND_JUMP, SOUND_NONE, SOUND_NONE)
796 Call(JumpPartTo, ACTOR_SELF, PRT_GRASS_SKIRT, LVar0, 0, LVar2, 30, TRUE)
797 Wait(5)
802 ExecWait(N(EVS_ShyGuy_Init))
803 Call(SetActorType, ACTOR_SELF, ACTOR_TYPE_SHY_GUY)
804 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE)
805 Call(SetStatusTable, ACTOR_SELF, Ref(N(ShyGuyStatusTable)))
806 Call(HPBarToHome, ACTOR_SELF)
807 Call(ResetAllActorSounds, ACTOR_SELF)
808 Return
809 End
810};
811
812EvtScript N(EVS_Attack_ThrowSpear) = {
813 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
814 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
815 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
816 Call(SetActorYaw, ACTOR_SELF, 180)
817 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim06)
818 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
819 Add(LVar0, 200)
820 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
821 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
822 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
823 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim15)
824 Call(SetActorYaw, ACTOR_SELF, 0)
825 Sub(LVar0, 100)
826 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
827 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
828 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
829 Sub(LVar0, 70)
830 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
831 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
832 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
833 Call(GetStatusFlags, ACTOR_SELF, LVar0)
835 Call(SetPartScale, ACTOR_SELF, PRT_SPEAR, Float(0.4), Float(0.4), Float(0.4))
836 Call(SetPartScale, ACTOR_SELF, PRT_GRASS_SKIRT, Float(0.4), Float(0.4), Float(0.4))
837 Else
838 Call(SetPartScale, ACTOR_SELF, PRT_SPEAR, Float(1.0), Float(1.0), Float(1.0))
839 Call(SetPartScale, ACTOR_SELF, PRT_GRASS_SKIRT, Float(1.0), Float(1.0), Float(1.0))
840 EndIf
841 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
845 Set(LVarA, LVar0)
846 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim11)
847 Wait(5)
848 Thread
849 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim17)
850 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.5))
851 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
852 Sub(LVar0, 20)
853 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
854 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
855 Sub(LVar0, 10)
856 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
857 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
858 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim12)
860 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
861 Call(SetPartPos, ACTOR_SELF, PRT_SPEAR, LVar0, 20, LVar2)
862 Call(SetPartRotation, ACTOR_SELF, PRT_SPEAR, 0, 0, -30)
863 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPEAR, ACTOR_PART_FLAG_INVISIBLE, FALSE)
864 Thread
865 Call(MakeLerp, -30, 45, 20, EASING_LINEAR)
866 Label(0)
868 Call(SetPartRotation, ACTOR_SELF, PRT_SPEAR, 0, 0, LVar0)
869 Wait(1)
870 IfEq(LVar1, 1)
871 Goto(0)
872 EndIf
874 Call(PlaySoundAtPart, ACTOR_SELF, PRT_SPEAR, SOUND_SPEAR_THROW)
875 Call(SetPartSounds, ACTOR_SELF, PRT_SPEAR, ACTOR_SOUND_JUMP, SOUND_NONE, SOUND_NONE)
876 Call(SetGoalToTarget, ACTOR_SELF)
877 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
878 Sub(LVar0, 20)
879 Set(LVar1, 10)
880 Add(LVar2, 2)
881 Call(SetPartJumpGravity, ACTOR_SELF, PRT_SPEAR, Float(0.7))
882 Call(JumpPartTo, ACTOR_SELF, PRT_SPEAR, LVar0, LVar1, LVar2, 20, TRUE)
883 Wait(10)
884 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPEAR, ACTOR_PART_FLAG_INVISIBLE, TRUE)
886 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
887 EndIf
888 Call(AddActorDecoration, ACTOR_SELF, PRT_SPEAR_GUY, 0, ACTOR_DECORATION_SWEAT)
889 Wait(30)
890 Call(RemoveActorDecoration, ACTOR_SELF, PRT_SPEAR_GUY, 0)
891 Wait(10)
892 ExecWait(N(EVS_BecomeShyGuy))
893 Call(YieldTurn)
894 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
895 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
896 Return
899 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim11)
900 Wait(5)
901 Thread
902 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim17)
903 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.5))
904 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
905 Sub(LVar0, 20)
906 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
907 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
908 Sub(LVar0, 10)
909 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
910 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
911 Call(SetAnimation, ACTOR_SELF, PRT_SPEAR_GUY, ANIM_SpearGuy_Anim12)
913 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
914 Call(SetPartPos, ACTOR_SELF, PRT_SPEAR, LVar0, 20, LVar2)
915 Call(SetPartRotation, ACTOR_SELF, PRT_SPEAR, 0, 0, -30)
916 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPEAR, ACTOR_PART_FLAG_INVISIBLE, FALSE)
917 Thread
918 Call(MakeLerp, -30, 45, 20, EASING_LINEAR)
919 Label(0)
921 Call(SetPartRotation, ACTOR_SELF, PRT_SPEAR, 0, 0, LVar0)
922 Wait(1)
923 IfEq(LVar1, 1)
924 Goto(0)
925 EndIf
927 Call(PlaySoundAtPart, ACTOR_SELF, PRT_SPEAR, SOUND_SPEAR_THROW)
928 Call(SetPartSounds, ACTOR_SELF, PRT_SPEAR, ACTOR_SOUND_JUMP, SOUND_NONE, SOUND_NONE)
929 Call(SetGoalToTarget, ACTOR_SELF)
930 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
931 Sub(LVar2, 2)
932 Call(SetPartJumpGravity, ACTOR_SELF, PRT_SPEAR, Float(0.7))
933 Call(JumpPartTo, ACTOR_SELF, PRT_SPEAR, LVar0, LVar1, LVar2, 20, TRUE)
934 Wait(2)
935 Call(SetGoalToTarget, ACTOR_SELF)
936 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_THROW, BS_FLAGS1_TRIGGER_EVENTS)
937 Wait(3)
938 Call(SetPartFlagBits, ACTOR_SELF, PRT_SPEAR, ACTOR_PART_FLAG_INVISIBLE, TRUE)
939 Wait(20)
940 ExecWait(N(EVS_BecomeShyGuy))
946 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
947 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
948 Return
949 End
950};
951
952EvtScript N(EVS_GetAvailableColumn) = {
953 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
954 Call(InitTargetIterator)
955 Label(0)
956 Call(GetOwnerTarget, LVar0, LVar5)
957 Call(GetIndexFromHome, LVar0, LVar5)
958 Mod(LVar5, 4)
960 CaseEq(0)
961 Set(LFlag1, TRUE)
962 CaseEq(1)
963 Set(LFlag2, TRUE)
964 CaseEq(2)
965 Set(LFlag3, TRUE)
966 CaseEq(3)
967 Set(LFlag4, TRUE)
969 Call(ChooseNextTarget, ITER_NEXT, LVar0)
971 Goto(0)
972 EndIf
973 IfEq(LFlag1, FALSE)
974 Set(LVarA, 0)
975 Return
976 EndIf
977 IfEq(LFlag2, FALSE)
978 Set(LVarA, 1)
979 Return
980 EndIf
981 IfEq(LFlag3, FALSE)
982 Set(LVarA, 2)
983 Return
984 EndIf
985 IfEq(LFlag4, FALSE)
986 Set(LVarA, 3)
987 Return
988 EndIf
989 Set(LVarA, -1)
990 Return
991 End
992};
993
994EvtScript N(EVS_CountActiveSummoners) = {
995 Set(LVar9, 0)
996 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
997 Call(InitTargetIterator)
998 Label(0)
999 Call(GetOwnerTarget, LVar0, LVar1)
1000 Call(GetOriginalActorType, LVar0, LVar2)
1001 Switch(LVar2)
1002 CaseEq(ACTOR_TYPE_JUNGLE_FUZZY)
1003 Call(GetStatusFlags, LVar0, LVar3)
1006 IfNe(LVar3, 2)
1007 Add(LVar9, 1)
1008 EndIf
1009 EndIf
1010 CaseEq(ACTOR_TYPE_SPEAR_GUY)
1011 Call(GetStatusFlags, LVar0, LVar3)
1013 Call(GetActorVar, LVar0, AVAR_Generation, LVar3)
1014 IfLt(LVar3, 2)
1015 Add(LVar9, 1)
1016 EndIf
1017 EndIf
1018 EndSwitch
1019 Call(ChooseNextTarget, ITER_NEXT, LVar0)
1021 Goto(0)
1022 EndIf
1023 Return
1024 End
1025};
1026
1027EvtScript N(EVS_SwitchSpearStance) = {
1028 Call(GetIndexFromHome, ACTOR_SELF, LVarA)
1029 Set(LFlag0, FALSE)
1030 Call(CreateHomeTargetList, TARGET_FLAG_GROUND | TARGET_FLAG_PRIMARY_ONLY)
1031 Call(InitTargetIterator)
1032 Label(0)
1033 Call(GetOwnerTarget, LVar0, LVar1)
1034 Call(GetIndexFromHome, LVar0, LVar1)
1035 IfLt(LVar1, LVarA)
1036 Set(LFlag0, TRUE)
1037 EndIf
1038 Call(ChooseNextTarget, ITER_NEXT, LVar0)
1040 Goto(0)
1041 EndIf
1042 IfEq(LFlag0, TRUE)
1043 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1044 IfEq(LVar0, AVAL_State_SpearForward)
1045 Set(LVar0, AVAL_State_SpearUpward)
1046 ExecWait(N(EVS_UpdateSpearStance))
1047 EndIf
1048 Else
1049 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1050 IfEq(LVar0, AVAL_State_SpearUpward)
1051 Set(LVar0, AVAL_State_SpearForward)
1052 ExecWait(N(EVS_UpdateSpearStance))
1053 EndIf
1054 EndIf
1055 Return
1056 End
1057};
1058
1059EvtScript N(EVS_TakeTurn) = {
1060 Call(GetBattlePhase, LVar0)
1062 ExecWait(N(EVS_Attack_SpearStab))
1063 ExecWait(N(EVS_SwitchSpearStance))
1064 Return
1065 EndIf
1066 Call(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar0)
1067 Switch(LVar0)
1068 CaseOrEq(0)
1069 CaseOrEq(1)
1070 ExecWait(N(EVS_GetAvailableColumn))
1071 IfEq(LVarA, -1)
1072 ExecWait(N(EVS_Attack_SpearStab))
1073 ExecWait(N(EVS_SwitchSpearStance))
1074 Return
1075 EndIf
1076 ExecWait(N(EVS_CountActiveSummoners))
1077 Switch(LVar9)
1078 CaseEq(1)
1079 Call(RandInt, 1000, LVar0)
1080 IfLt(LVar0, 300)
1081 ExecWait(N(EVS_Move_SummonBackup))
1082 Return
1083 EndIf
1084 CaseEq(2)
1085 Call(RandInt, 1000, LVar0)
1086 IfLt(LVar0, 150)
1087 ExecWait(N(EVS_Move_SummonBackup))
1088 Return
1089 EndIf
1090 CaseEq(3)
1091 Call(RandInt, 1000, LVar0)
1092 IfLt(LVar0, 100)
1093 ExecWait(N(EVS_Move_SummonBackup))
1094 Return
1095 EndIf
1096 EndSwitch
1097 ExecWait(N(EVS_Attack_SpearStab))
1098 ExecWait(N(EVS_SwitchSpearStance))
1100 CaseEq(2)
1101 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
1102 Call(GetTargetListLength, LVar0)
1103 IfEq(LVar0, 1)
1104 ExecWait(N(EVS_Attack_ThrowSpear))
1105 Return
1106 EndIf
1107 ExecWait(N(EVS_Attack_SpearStab))
1108 ExecWait(N(EVS_SwitchSpearStance))
1109 CaseEq(3)
1110 ExecWait(N(EVS_Attack_ThrowSpear))
1111 EndSwitch
1112 Return
1113 End
1114};
1115
1116s32 N(ShyGuyAnims)[] = {
1117 STATUS_KEY_NORMAL, ANIM_ShyGuy_Red_Anim01,
1118 STATUS_KEY_STONE, ANIM_ShyGuy_Red_Anim00,
1119 STATUS_KEY_SLEEP, ANIM_ShyGuy_Red_Anim12,
1120 STATUS_KEY_POISON, ANIM_ShyGuy_Red_Anim01,
1121 STATUS_KEY_STOP, ANIM_ShyGuy_Red_Anim00,
1122 STATUS_KEY_STATIC, ANIM_ShyGuy_Red_Anim01,
1123 STATUS_KEY_PARALYZE, ANIM_ShyGuy_Red_Anim00,
1124 STATUS_KEY_DIZZY, ANIM_ShyGuy_Red_Anim13,
1125 STATUS_KEY_FEAR, ANIM_ShyGuy_Red_Anim13,
1126 STATUS_END,
1127};
1128
1129EvtScript N(EVS_ShyGuy_Init) = {
1130 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_ShyGuy_TakeTurn)))
1131 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_ShyGuy_Idle)))
1132 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_ShyGuy_HandleEvent)))
1133 Return
1134 End
1135};
1136
1138
1139EvtScript N(EVS_ShyGuy_Idle) = {
1140 Label(0)
1141 Call(GetStatusFlags, ACTOR_SELF, LVar0)
1143 Call(SetTargetOffset, ACTOR_SELF, PRT_SHY_GUY, -4, 14)
1144 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_SHY_GUY, 0, 0)
1145 Call(N(SetAbsoluteStatusOffsets), -10, 13, 10, 13)
1146 Else
1147 Call(SetTargetOffset, ACTOR_SELF, PRT_SHY_GUY, 0, 24)
1148 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_SHY_GUY, -1, -10)
1149 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
1150 EndIf
1151 Wait(1)
1152 Goto(0)
1153 Return
1154 End
1155};
1156
1157EvtScript N(EVS_ShyGuy_ReturnHome) = {
1158 Call(ResetAllActorSounds, ACTOR_SELF)
1159 SetConst(LVar0, PRT_SHY_GUY)
1160 SetConst(LVar1, ANIM_ShyGuy_Red_Anim03)
1162 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim01)
1163 Return
1164 End
1165};
1166
1167EvtScript N(EVS_ShyGuy_HandleEvent) = {
1168 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
1169 Call(GetLastEvent, ACTOR_SELF, LVar0)
1170 Switch(LVar0)
1173 SetConst(LVar0, PRT_SHY_GUY)
1174 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1178 SetConst(LVar0, PRT_SHY_GUY)
1179 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0D)
1180 SetConst(LVar2, ANIM_ShyGuy_Red_Anim0E)
1183 SetConst(LVar0, PRT_SHY_GUY)
1184 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0D)
1185 SetConst(LVar2, ANIM_ShyGuy_Red_Anim0E)
1187 SetConst(LVar0, PRT_SHY_GUY)
1188 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0E)
1190 Return
1192 SetConst(LVar0, PRT_SHY_GUY)
1193 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1196 SetConst(LVar0, PRT_SHY_GUY)
1197 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1199 SetConst(LVar0, PRT_SHY_GUY)
1200 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1202 Return
1204 SetConst(LVar0, PRT_SHY_GUY)
1205 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1207 SetConst(LVar0, PRT_SHY_GUY)
1208 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1210 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
1211 ExecWait(N(EVS_ShyGuy_ReturnHome))
1213 SetConst(LVar0, PRT_SHY_GUY)
1214 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1216 SetConst(LVar0, PRT_SHY_GUY)
1217 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1219 Return
1223 SetConst(LVar0, PRT_SHY_GUY)
1224 SetConst(LVar1, ANIM_ShyGuy_Red_Anim01)
1228 SetConst(LVar0, PRT_SHY_GUY)
1229 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1231 Wait(10)
1232 SetConst(LVar0, PRT_SHY_GUY)
1233 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1235 Return
1237 SetConst(LVar0, PRT_SHY_GUY)
1238 SetConst(LVar1, ANIM_ShyGuy_Red_Anim01)
1241 SetConst(LVar0, PRT_SHY_GUY)
1242 SetConst(LVar1, ANIM_ShyGuy_Red_Anim03)
1243 SetConst(LVar2, ANIM_ShyGuy_Red_Anim14)
1245 Return
1247 SetConst(LVar0, PRT_SHY_GUY)
1248 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1251 SetConst(LVar0, PRT_SHY_GUY)
1252 SetConst(LVar1, ANIM_ShyGuy_Red_Anim0C)
1254 Return
1256 EndSwitch
1257 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1258 Return
1259 End
1260};
1261
1262EvtScript N(EVS_Attack_Tackle) = {
1263 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
1264 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
1265 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
1266 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
1267 Call(BattleCamTargetActor, ACTOR_SELF)
1268 Call(MoveBattleCamOver, 20)
1269 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
1270 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim03)
1271 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
1272 Call(SetGoalToTarget, ACTOR_SELF)
1273 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1274 Add(LVar0, 50)
1275 Set(LVar1, 0)
1276 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1277 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1278 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
1279 Switch(LVar0)
1282 Set(LVarA, LVar0)
1283 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_ACTOR_HOP, 0)
1285 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0)
1286 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1287 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim04)
1288 Call(SetGoalToTarget, ACTOR_SELF)
1289 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1290 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim05)
1291 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1292 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.5))
1293 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1294 Sub(LVar0, 30)
1295 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1296 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
1298 Call(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
1299 EndIf
1300 Call(ResetAllActorSounds, ACTOR_SELF)
1301 Sub(LVar0, 20)
1302 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1303 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
1304 Wait(15)
1305 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1306 Call(SetActorYaw, ACTOR_SELF, 180)
1307 Call(AddActorDecoration, ACTOR_SELF, PRT_SHY_GUY, 0, ACTOR_DECORATION_SWEAT)
1308 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
1309 SetConst(LVar0, PRT_SHY_GUY)
1310 SetConst(LVar1, ANIM_ShyGuy_Red_Anim04)
1312 Call(RemoveActorDecoration, ACTOR_SELF, PRT_SHY_GUY, 0)
1313 Call(SetActorYaw, ACTOR_SELF, 0)
1314 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim01)
1315 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1316 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1317 Return
1319 EndSwitch
1320 Thread
1321 Wait(3)
1322 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_ACTOR_HOP)
1323 EndThread
1325 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0)
1326 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1327 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim04)
1328 Call(SetGoalToTarget, ACTOR_SELF)
1329 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1330 Add(LVar0, 10)
1331 Set(LVar1, 0)
1332 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1333 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1334 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim05)
1335 Wait(2)
1336 Call(SetGoalToTarget, ACTOR_SELF)
1337 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_TACKLE, BS_FLAGS1_TRIGGER_EVENTS)
1338 Call(ResetAllActorSounds, ACTOR_SELF)
1339 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1340 Call(MoveBattleCamOver, 15)
1341 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1342 Add(LVar0, 30)
1343 Set(LVar1, 0)
1344 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
1345 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1346 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
1347 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim01)
1348 Wait(8)
1349 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1350 ExecWait(N(EVS_ShyGuy_ReturnHome))
1351 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1352 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1353 Return
1354 End
1355};
1356
1357EvtScript N(EVS_Attack_Vault) = {
1358 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
1359 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
1360 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
1361 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
1362 Call(BattleCamTargetActor, ACTOR_SELF)
1363 Call(MoveBattleCamOver, 20)
1364 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
1365 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_TIMING_BAR_GO)
1366 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim09)
1367 Wait(20)
1368 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim03)
1369 Call(SetActorSpeed, ACTOR_SELF, Float(3.0))
1370 Call(SetGoalToTarget, ACTOR_SELF)
1371 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1372 Add(LVar0, 80)
1373 Set(LVar1, 0)
1374 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1375 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1377 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0)
1378 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim04)
1379 Call(SetActorSpeed, ACTOR_SELF, Float(5.0))
1380 Sub(LVar0, 40)
1381 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1382 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1383 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
1384 Switch(LVar0)
1387 Set(LVarA, LVar0)
1388 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1389 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim09)
1390 Thread
1391 Wait(12)
1392 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim0A)
1393 EndThread
1394 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
1395 Call(SetGoalToTarget, ACTOR_SELF)
1396 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1397 Sub(LVar0, 10)
1398 Set(LVar1, 0)
1399 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1400 Call(JumpToGoal, ACTOR_SELF, 24, FALSE, TRUE, FALSE)
1402 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
1403 EndIf
1404 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim05)
1405 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1406 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.5))
1407 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1408 Sub(LVar0, 30)
1409 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1410 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
1411 Sub(LVar0, 20)
1412 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1413 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
1414 Wait(15)
1415 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1416 Call(MoveBattleCamOver, 15)
1417 Call(SetActorYaw, ACTOR_SELF, 180)
1418 Call(AddActorDecoration, ACTOR_SELF, PRT_SHY_GUY, 0, ACTOR_DECORATION_SWEAT)
1419 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1420 SetConst(LVar0, PRT_SHY_GUY)
1421 SetConst(LVar1, ANIM_ShyGuy_Red_Anim04)
1423 Call(RemoveActorDecoration, ACTOR_SELF, PRT_SHY_GUY, 0)
1424 Call(SetActorYaw, ACTOR_SELF, 0)
1425 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim01)
1426 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1427 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1428 Return
1430 EndSwitch
1431 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1432 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim09)
1433 Thread
1434 Wait(9)
1435 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim0A)
1436 EndThread
1437 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
1438 Call(SetGoalToTarget, ACTOR_SELF)
1439 Call(JumpToGoal, ACTOR_SELF, 18, FALSE, TRUE, FALSE)
1440 Wait(2)
1441 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_VAULT, BS_FLAGS1_TRIGGER_EVENTS)
1442 Switch(LVar0)
1445 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1446 Call(MoveBattleCamOver, 15)
1447 Thread
1448 Call(SetActorRotationOffset, ACTOR_SELF, 0, 14, 0)
1449 Set(LVar3, 0)
1450 Loop(20)
1451 Sub(LVar3, 30)
1452 IfLt(LVar3, 0)
1453 Add(LVar3, 360)
1454 EndIf
1455 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar3)
1456 Wait(1)
1457 EndLoop
1458 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
1459 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
1460 EndThread
1461 Call(GetBattleFlags, LVar0)
1463 Goto(1)
1464 EndIf
1465 Call(GetLastDamage, ACTOR_PLAYER, LVar0)
1466 IfEq(LVar0, 0)
1467 Goto(1)
1468 EndIf
1469 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1470 Add(LVar0, 40)
1471 Set(LVar1, 0)
1472 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
1473 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1474 Call(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
1475 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LRAW_CHEERING)
1477 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim09)
1478 Wait(10)
1479 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim07)
1480 Wait(15)
1481 Goto(2)
1482 Label(1)
1483 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1484 Add(LVar0, 40)
1485 Set(LVar1, 0)
1486 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
1487 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1488 Call(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
1489 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_ACTOR_COLLAPSE)
1490 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim10)
1491 Wait(10)
1492 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_DISAPPOINTED)
1493 Call(AddActorDecoration, ACTOR_SELF, PRT_SHY_GUY, 0, ACTOR_DECORATION_SWEAT)
1494 Call(RandInt, 100, LVar0)
1495 IfLt(LVar0, 50)
1496 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim11)
1497 Else
1498 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim13)
1499 EndIf
1500 Wait(25)
1501 Call(RemoveActorDecoration, ACTOR_SELF, PRT_SHY_GUY, 0)
1502 Call(SetActorYaw, ACTOR_SELF, 180)
1503 Label(2)
1504 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1505 SetConst(LVar0, PRT_SHY_GUY)
1506 SetConst(LVar1, ANIM_ShyGuy_Red_Anim04)
1508 Call(SetActorYaw, ACTOR_SELF, 0)
1509 Call(SetAnimation, ACTOR_SELF, PRT_SHY_GUY, ANIM_ShyGuy_Red_Anim01)
1511 EndSwitch
1512 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1513 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1514 Return
1515 End
1516};
1517
1518EvtScript N(EVS_ShyGuy_TakeTurn) = {
1519 Call(RandInt, 1, LVar0)
1520 IfEq(LVar0, 0)
1521 ExecWait(N(EVS_Attack_Tackle))
1522 Else
1523 ExecWait(N(EVS_Attack_Vault))
1524 EndIf
1525 Return
1526 End
1527};
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_WALK_INCREMENT
Definition enums.h:2038
@ ACTOR_SOUND_JUMP
Definition enums.h:2036
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ BS_FLAGS1_ATK_BLOCKED
Definition enums.h:3600
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ ELEMENT_FIRE
Definition enums.h:2116
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_SHOCK
Definition enums.h:2125
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ ACTOR_EVENT_FLAG_SPIKY_FRONT
Player takes spike damage from hammer attacks.
Definition enums.h:3384
@ ACTOR_EVENT_FLAGS_NONE
Definition enums.h:3370
@ 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
@ ENCOUNTER_TRIGGER_JUMP
Definition enums.h:269
@ ENCOUNTER_TRIGGER_HAMMER
Definition enums.h:271
@ ENCOUNTER_TRIGGER_PARTNER
Definition enums.h:273
@ 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_INTERRUPT
Definition enums.h:4823
@ 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_GROUND
Definition enums.h:1851
@ TARGET_FLAG_2
Definition enums.h:1850
@ SOUND_ID_TRIGGER_CHANGE_SOUND
Definition enums.h:532
@ EASING_LINEAR
Definition enums.h:510
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ STATUS_FLAG_FEAR
Definition enums.h:2815
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ STATUS_FLAG_DIZZY
Definition enums.h:2818
@ STATUS_FLAG_SLEEP
Definition enums.h:2812
@ SOUND_SPEAR_GUY_DANCE_1
Definition enums.h:1084
@ SOUND_LRAW_CHEERING
Definition enums.h:1151
@ SOUND_NONE
Definition enums.h:547
@ SOUND_TIMING_BAR_GO
Definition enums.h:953
@ SOUND_RECOVER_HEART
Definition enums.h:1406
@ SOUND_ACTOR_HOP
Definition enums.h:1073
@ SOUND_ACTOR_COLLAPSE
Definition enums.h:1514
@ SOUND_SPEAR_GUY_DANCE_2
Definition enums.h:1085
@ SOUND_SPEAR_THROW
Definition enums.h:1097
@ SOUND_SPEAR_GUY_RIP_SKIRT
Definition enums.h:1086
@ SOUND_ACTOR_STEP_A
Definition enums.h:1474
@ SOUND_ACTOR_STEP_B
Definition enums.h:1250
@ SOUND_DISAPPOINTED
Definition enums.h:1482
@ SOUND_SPEAR_STAB
Definition enums.h:1096
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_TYPE_CHANGED
Indicates actors type has changed, triggers recheck for if HP bar should be shown based on tattle sta...
Definition enums.h:3332
@ 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_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_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_NO_SHADOW
Definition enums.h:3352
@ 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_DAMAGE_IMMUNE
electrified Plays extra hurt SFX?
Definition enums.h:3358
@ 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_ReturnHome
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 UpdateLerp(Evt *script, b32 isInitialCall)
ApiStatus RandInt(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 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 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 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
@ AVAR_JungleFuzzy_Generation
Definition battle.h:102
FormationRow Formation[]
Definition battle.h:167