Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
jungle_fuzzy.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/player.h"
6#include "sprite/npc/Fuzzy.h"
8
9#define NAMESPACE A(jungle_fuzzy)
10
11extern s32 N(DefaultAnims)[];
12extern EvtScript N(EVS_Init);
13extern EvtScript N(EVS_Idle);
14extern EvtScript N(EVS_TakeTurn);
15extern EvtScript N(EVS_HandleEvent);
16extern Formation N(SummonFormation);
17
18enum N(ActorPartIDs) {
19 PRT_MAIN = 1,
20};
21
22enum N(ActorVars) {
23 AVAR_Generation = 0,
24};
25
26enum N(ActorParams) {
27 DMG_LEECH = 2,
28};
29
30s32 N(DefenseTable)[] = {
32 ELEMENT_FIRE, 0,
34};
35
36s32 N(StatusTable)[] = {
59};
60
61ActorPartBlueprint N(ActorParts)[] = {
62 {
64 .index = PRT_MAIN,
65 .posOffset = { 0, 0, 0 },
66 .targetOffset = { 0, 20 },
67 .opacity = 255,
68 .idleAnimations = N(DefaultAnims),
69 .defenseTable = N(DefenseTable),
70 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
71 .elementImmunityFlags = 0,
72 .projectileTargetOffset = { 0, -10 },
73 },
74};
75
76ActorBlueprint NAMESPACE = {
77 .flags = 0,
78 .type = ACTOR_TYPE_JUNGLE_FUZZY,
79 .level = ACTOR_LEVEL_JUNGLE_FUZZY,
80 .maxHP = 7,
81 .partCount = ARRAY_COUNT(N(ActorParts)),
82 .partsData = N(ActorParts),
83 .initScript = &N(EVS_Init),
84 .statusTable = N(StatusTable),
85 .escapeChance = 30,
86 .airLiftChance = 85,
87 .hurricaneChance = 80,
88 .spookChance = 75,
89 .upAndAwayChance = 95,
90 .spinSmashReq = 0,
91 .powerBounceChance = 100,
92 .coinReward = 1,
93 .size = { 33, 28 },
94 .healthBarOffset = { 0, 0 },
95 .statusIconOffset = { -10, 20 },
96 .statusTextOffset = { 10, 20 },
97};
98
99s32 N(DefaultAnims)[] = {
100 STATUS_KEY_NORMAL, ANIM_Fuzzy_Jungle_Idle,
101 STATUS_KEY_STONE, ANIM_Fuzzy_Jungle_Still,
102 STATUS_KEY_SLEEP, ANIM_Fuzzy_Jungle_Sleep,
103 STATUS_KEY_POISON, ANIM_Fuzzy_Jungle_Idle,
104 STATUS_KEY_STOP, ANIM_Fuzzy_Jungle_Still,
105 STATUS_KEY_STATIC, ANIM_Fuzzy_Jungle_Idle,
106 STATUS_KEY_PARALYZE, ANIM_Fuzzy_Jungle_Still,
107 STATUS_KEY_DIZZY, ANIM_Fuzzy_Jungle_Stunned,
108 STATUS_KEY_FEAR, ANIM_Fuzzy_Jungle_Stunned,
110};
111
112EvtScript N(EVS_Init) = {
113 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
114 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
115 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
116 Call(SetActorVar, ACTOR_SELF, AVAR_Generation, 0)
117 Return
118 End
119};
120
121EvtScript N(EVS_Idle) = {
122 Return
123 End
124};
125
126EvtScript N(EVS_HandleEvent) = {
127 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
128 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
129 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
130 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
131 Call(GetLastEvent, ACTOR_SELF, LVar0)
135 Call(GetLastElement, LVar0)
137 SetConst(LVar0, PRT_MAIN)
138 SetConst(LVar1, ANIM_Fuzzy_Jungle_HurtShock)
139 Else
140 SetConst(LVar0, PRT_MAIN)
141 SetConst(LVar1, ANIM_Fuzzy_Jungle_Hurt)
142 EndIf
146 SetConst(LVar0, PRT_MAIN)
147 SetConst(LVar1, ANIM_Fuzzy_Jungle_Burn)
148 SetConst(LVar2, ANIM_Fuzzy_Jungle_BurnStill)
151 SetConst(LVar0, PRT_MAIN)
152 SetConst(LVar1, ANIM_Fuzzy_Jungle_Burn)
153 SetConst(LVar2, ANIM_Fuzzy_Jungle_BurnStill)
155 SetConst(LVar0, PRT_MAIN)
156 SetConst(LVar1, ANIM_Fuzzy_Jungle_BurnStill)
158 Return
160 SetConst(LVar0, PRT_MAIN)
161 SetConst(LVar1, ANIM_Fuzzy_Jungle_Hurt)
164 SetConst(LVar0, PRT_MAIN)
165 SetConst(LVar1, ANIM_Fuzzy_Jungle_Hurt)
167 SetConst(LVar0, PRT_MAIN)
168 SetConst(LVar1, ANIM_Fuzzy_Jungle_Hurt)
170 Return
172 Call(func_80269470)
173 SetConst(LVar0, PRT_MAIN)
174 SetConst(LVar1, ANIM_Fuzzy_Jungle_HurtShock)
176 SetConst(LVar0, PRT_MAIN)
177 SetConst(LVar1, ANIM_Fuzzy_Jungle_HurtShock)
179 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
180 SetConst(LVar0, PRT_MAIN)
181 SetConst(LVar1, ANIM_Fuzzy_Jungle_Run)
183 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.6))
184 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
186 Call(func_80269470)
187 SetConst(LVar0, PRT_MAIN)
188 SetConst(LVar1, ANIM_Fuzzy_Jungle_HurtShock)
190 SetConst(LVar0, PRT_MAIN)
191 SetConst(LVar1, ANIM_Fuzzy_Jungle_HurtShock)
193 Return
196 SetConst(LVar0, PRT_MAIN)
197 SetConst(LVar1, ANIM_Fuzzy_Jungle_Idle)
201 Call(GetLastElement, LVar0)
203 SetConst(LVar0, PRT_MAIN)
204 SetConst(LVar1, ANIM_Fuzzy_Jungle_HurtShock)
206 Wait(10)
207 SetConst(LVar0, PRT_MAIN)
208 SetConst(LVar1, ANIM_Fuzzy_Jungle_HurtShock)
210 Else
211 SetConst(LVar0, PRT_MAIN)
212 SetConst(LVar1, ANIM_Fuzzy_Jungle_Hurt)
214 Wait(10)
215 SetConst(LVar0, PRT_MAIN)
216 SetConst(LVar1, ANIM_Fuzzy_Jungle_Hurt)
218 EndIf
219 Return
221 SetConst(LVar0, PRT_MAIN)
222 SetConst(LVar1, ANIM_Fuzzy_Jungle_Idle)
225 SetConst(LVar0, PRT_MAIN)
226 SetConst(LVar1, ANIM_Fuzzy_Jungle_Run)
227 SetConst(LVar2, ANIM_Fuzzy_Jungle_Anim09)
229 Return
231 SetConst(LVar0, PRT_MAIN)
232 SetConst(LVar1, ANIM_Fuzzy_Jungle_Run)
235 SetConst(LVar0, PRT_MAIN)
236 SetConst(LVar1, ANIM_Fuzzy_Jungle_Run)
238 Return
240 SetConst(LVar0, PRT_MAIN)
241 SetConst(LVar1, ANIM_Fuzzy_Jungle_Idle)
245 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
246 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
247 Return
248 End
249};
250
251EvtScript N(EVS_Move_Divide) = {
252 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
253 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
254 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
255 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
256 Call(SetBattleCamTarget, LVar0, LVar1, LVar2)
257 Call(SetBattleCamDist, 330)
258 Call(SetBattleCamOffsetY, 30)
259 Call(MoveBattleCamOver, 20)
260 Wait(20)
261 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
262 Call(UseBattleCamPreset, BTL_CAM_INTERRUPT)
263 Thread
264 Wait(30)
265 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_FUZZY_RUMBLE)
266 Wait(30)
267 Loop(4)
268 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_FUZZY_SHAKE)
269 Wait(11)
270 EndLoop
271 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_FUZZY_DIVIDE)
273 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Anim0D)
274 Wait(130)
275 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Walk)
276 Call(SummonEnemy, Ref(N(SummonFormation)), FALSE)
277 Call(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3)
278 Call(SetActorPos, LVar0, LVar1, LVar2, LVar3)
279 Call(SetGoalToIndex, LVar0, LVarA)
280 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
281 Call(MoveBattleCamOver, 20)
282 Thread
283 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Walk)
284 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.4))
285 Call(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar3)
286 Call(SetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3)
287 Call(JumpToGoal, ACTOR_SELF, 14, FALSE, TRUE, FALSE)
289 Wait(1)
290 Call(SetAnimation, LVar0, 1, ANIM_Fuzzy_Jungle_Walk)
291 Call(SetActorJumpGravity, LVar0, Float(1.4))
292 Call(JumpToGoal, LVar0, 14, FALSE, TRUE, FALSE)
293 Call(GetActorPos, LVar0, LVar1, LVar2, LVar3)
294 Call(ForceHomePos, LVar0, LVar1, LVar2, LVar3)
295 Call(HPBarToHome, LVar0)
296 Call(SetAnimation, LVar0, 1, ANIM_Fuzzy_Jungle_Idle)
297 Call(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar1)
299 CaseEq(0)
300 Call(SetActorVar, LVar0, AVAR_Generation, 1)
301 CaseEq(1)
302 Call(SetActorVar, LVar0, AVAR_Generation, 2)
304 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
305 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
306 Return
307 End
308};
309
310#include "common/SpawnEnemyDrainFX.inc.c"
311
312EvtScript N(EVS_Attack_Leech) = {
313 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
314 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
315 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
316 Call(BattleCamTargetActor, ACTOR_SELF)
317 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
318 Call(GetBattlePhase, LVar0)
320 Call(SetGoalToTarget, ACTOR_SELF)
321 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
322 Add(LVar0, 50)
323 Set(LVar1, 0)
324 Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
325 Goto(100)
326 EndIf
327 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
328 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Run)
329 Call(SetGoalToTarget, ACTOR_SELF)
330 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
331 Add(LVar0, 50)
332 Set(LVar1, 0)
333 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
334 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
336 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle)
337 Label(100)
338 Call(SetActorDispOffset, ACTOR_SELF, 0, 10, 0)
339 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Leech)
340 Call(SetActorDispOffset, ACTOR_SELF, 0, 9, 0)
341 Wait(1)
342 Call(SetActorDispOffset, ACTOR_SELF, 0, 8, 0)
343 Wait(5)
348 Set(LVarA, LVar0)
349 Call(SetGoalToTarget, ACTOR_SELF)
350 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
351 Sub(LVar0, 5)
352 Set(LVar1, 0)
353 Sub(LVar2, 5)
354 Call(SetActorJumpGravity, ACTOR_SELF, Float(3.0))
355 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump)
356 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
357 Call(JumpToGoal, ACTOR_SELF, 11, FALSE, TRUE, FALSE)
358 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
359 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Anim09)
360 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
361 Sub(LVar0, 20)
362 Call(SetActorJumpGravity, ACTOR_SELF, Float(3.0))
363 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
364 Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
365 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
366 Sub(LVar0, 15)
367 Call(SetActorJumpGravity, ACTOR_SELF, Float(3.0))
368 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
369 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
370 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
371 Wait(4)
372 Wait(5)
374 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
375 EndIf
376 Wait(5)
377 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
378 Call(YieldTurn)
379 Call(SetActorYaw, ACTOR_SELF, 180)
380 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
381 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Run)
382 Call(SetGoalToHome, ACTOR_SELF)
383 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
384 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
385 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
387 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
388 Call(SetActorYaw, ACTOR_SELF, 0)
389 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
390 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
391 Return
394 Call(GetStatusFlags, ACTOR_SELF, LVar0)
396 Set(LFlag0, FALSE)
397 Else
398 Set(LFlag0, TRUE)
399 EndIf
401 Call(SetGoalToTarget, ACTOR_SELF)
402 Call(AddGoalPos, ACTOR_SELF, -3, -12, -15)
403 Call(SetActorJumpGravity, ACTOR_SELF, Float(3.0))
404 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump)
405 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
406 IfEq(LFlag0, TRUE)
408 Return
409 EndIf
410 Call(GetStatusFlags, ACTOR_PLAYER, LVar1)
412 Wait(10)
413 Loop(2)
414 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
415 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Bite)
416 Wait(21)
417 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Still)
418 Call(SetActorRotation, ACTOR_SELF, 0, 0, 330)
419 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
420 Call(SetActorDispOffset, ACTOR_SELF, -3, -2, 0)
421 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
422 Wait(1)
423 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
424 Wait(1)
425 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
426 Wait(1)
427 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
428 Wait(1)
429 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
430 Wait(2)
431 Call(SetActorScale, ACTOR_SELF, Float(0.6), Float(1.6), Float(1.0))
432 Wait(10)
433 Wait(2)
434 Call(EnemyDamageTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, DMG_LEECH, BS_FLAGS1_NICE_HIT)
435 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
436 Call(SetActorDispOffset, ACTOR_SELF, 0, 8, 0)
437 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
438 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump)
439 Wait(30)
440 EndLoop
441 Else
442 Call(ShowMessageBox, BTL_MSG_ACTION_TIP_MASH_BUTTON, 32767)
443 Call(ShowActionHud, TRUE)
444 Call(LoadActionCommand, ACTION_COMMAND_STOP_LEECH)
445 Call(action_command_stop_leech_init)
446 Call(SetupMashMeter, 1, 23, 0, 0, 0, 0)
447 Wait(10)
448 Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
449 Call(action_command_stop_leech_start, 0, 32767, 3)
450 Set(LVarD, 0)
451 Loop(5)
452 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
453 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Leeching)
454 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
455 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Bite)
456 Set(LFlag0, FALSE)
457 Loop(21)
458 Call(GetActionSuccessCopy, LVar1)
459 IfEq(LVar1, 1)
460 Set(LFlag0, TRUE)
462 EndIf
463 Wait(1)
464 EndLoop
465 IfEq(LFlag0, TRUE)
466 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
468 EndIf
469 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Still)
470 Call(SetActorRotation, ACTOR_SELF, 0, 0, 330)
471 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
472 Call(SetActorDispOffset, ACTOR_SELF, -3, -2, 0)
473 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
474 Set(LFlag0, FALSE)
475 Loop(1)
476 Call(GetActionSuccessCopy, LVar1)
477 IfEq(LVar1, 1)
478 Set(LFlag0, TRUE)
480 EndIf
481 Wait(1)
482 EndLoop
483 IfEq(LFlag0, TRUE)
484 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
486 EndIf
487 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
488 Set(LFlag0, FALSE)
489 Loop(1)
490 Call(GetActionSuccessCopy, LVar1)
491 IfEq(LVar1, 1)
492 Set(LFlag0, TRUE)
494 EndIf
495 Wait(1)
496 EndLoop
497 IfEq(LFlag0, TRUE)
498 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
500 EndIf
501 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
502 Set(LFlag0, FALSE)
503 Loop(1)
504 Call(GetActionSuccessCopy, LVar1)
505 IfEq(LVar1, 1)
506 Set(LFlag0, TRUE)
508 EndIf
509 Wait(1)
510 EndLoop
511 IfEq(LFlag0, TRUE)
512 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
514 EndIf
515 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
516 Set(LFlag0, FALSE)
517 Loop(1)
518 Call(GetActionSuccessCopy, LVar1)
519 IfEq(LVar1, 1)
520 Set(LFlag0, TRUE)
522 EndIf
523 Wait(1)
524 EndLoop
525 IfEq(LFlag0, TRUE)
526 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
528 EndIf
529 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
530 Set(LFlag0, FALSE)
531 Loop(2)
532 Call(GetActionSuccessCopy, LVar1)
533 IfEq(LVar1, 1)
534 Set(LFlag0, TRUE)
536 EndIf
537 Wait(1)
538 EndLoop
539 IfEq(LFlag0, TRUE)
540 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
542 EndIf
543 Call(SetActorScale, ACTOR_SELF, Float(0.6), Float(1.6), Float(1.0))
544 Set(LFlag0, FALSE)
545 Loop(10)
546 Call(GetActionSuccessCopy, LVar1)
547 IfEq(LVar1, 1)
548 Set(LFlag0, TRUE)
550 EndIf
551 Wait(1)
552 EndLoop
553 IfEq(LFlag0, TRUE)
554 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
556 EndIf
557 Set(LFlag0, FALSE)
558 Loop(2)
559 Call(GetActionSuccessCopy, LVar1)
560 IfEq(LVar1, 1)
561 Set(LFlag0, TRUE)
563 EndIf
564 Wait(1)
565 EndLoop
566 IfEq(LFlag0, TRUE)
567 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
569 EndIf
570 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
572 Call(GetLastDamage, ACTOR_PLAYER, LVar3)
573 IfNe(LVar3, 0)
574 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_RECOVER_HEART)
575 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HEART_BOUNCE)
576 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
577 Add(LVar1, 10)
578 Call(N(SpawnDrainHealthStartFX), LVar0, LVar1, LVar2, LVar3)
579 Thread
580 Wait(15)
581 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_STAR_BOUNCE_A)
582 Call(N(SpawnDrainHealthContinueFX), LVar0, LVar1, LVar2, LVar3)
584 Add(LVar0, 20)
585 Add(LVar1, 20)
586 PlayEffect(EFFECT_RECOVER, 0, LVar0, LVar1, LVar2, LVar3, 0)
587 Call(GetActorHP, ACTOR_SELF, LVar0)
588 Add(LVar0, LVar3)
589 Call(SetEnemyHP, ACTOR_SELF, LVar0)
590 Else
591 Add(LVarD, 1)
592 IfGt(LVarD, 1)
593 Call(func_80269470)
595 EndIf
596 EndIf
597 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
598 Call(SetActorDispOffset, ACTOR_SELF, 0, 8, 0)
599 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
600 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump)
601 Call(GetPlayerHP, LVar1)
602 IfEq(LVar1, 0)
603 Call(func_80269470)
605 EndIf
606 Set(LFlag0, FALSE)
607 Loop(35)
608 Call(GetActionSuccessCopy, LVar1)
609 IfEq(LVar1, 1)
610 Set(LFlag0, TRUE)
612 EndIf
613 Wait(1)
614 EndLoop
615 IfEq(LFlag0, TRUE)
617 EndIf
618 EndLoop
619 Call(func_80269470)
620 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
621 Call(SetActorDispOffset, ACTOR_SELF, 0, 8, 0)
622 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
623 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Jump)
624 EndIf
625 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
626 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle)
627 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
628 Thread
629 Call(SetActorScale, ACTOR_SELF, Float(1.6), Float(0.6), Float(1.0))
630 Call(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0)
631 Wait(1)
632 Call(SetActorRotation, ACTOR_SELF, 0, 0, 330)
633 Wait(1)
634 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
635 Call(SetActorRotation, ACTOR_SELF, 0, 0, 300)
636 Wait(1)
637 Call(SetActorRotation, ACTOR_SELF, 0, 0, 270)
638 Wait(1)
639 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(0.7), Float(1.0))
640 Call(SetActorRotation, ACTOR_SELF, 0, 0, 240)
641 Wait(1)
642 Call(SetActorRotation, ACTOR_SELF, 0, 0, 210)
643 Wait(1)
644 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
645 Call(SetActorRotation, ACTOR_SELF, 0, 0, 180)
646 Wait(2)
647 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(0.7), Float(1.0))
648 Wait(2)
649 Call(SetActorScale, ACTOR_SELF, Float(1.2), Float(0.5), Float(1.0))
651 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
652 Add(LVar0, 40)
653 Set(LVar1, 0)
654 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
655 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
656 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
657 Call(SetActorScale, ACTOR_SELF, Float(1.4), Float(0.2), Float(1.0))
658 Wait(1)
659 Thread
660 Wait(1)
661 Call(SetActorScale, ACTOR_SELF, Float(1.2), Float(0.5), Float(1.0))
662 Call(SetActorRotation, ACTOR_SELF, 0, 0, 150)
663 Wait(1)
664 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
665 Call(SetActorRotation, ACTOR_SELF, 0, 0, 120)
666 Wait(1)
667 Call(SetActorRotation, ACTOR_SELF, 0, 0, 90)
668 Wait(1)
669 Call(SetActorRotation, ACTOR_SELF, 0, 0, 60)
670 Wait(1)
671 Call(SetActorRotation, ACTOR_SELF, 0, 0, 30)
672 Wait(1)
673 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
674 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
676 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
677 Add(LVar0, 30)
678 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
679 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
680 Wait(5)
681 Call(YieldTurn)
682 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
683 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Run)
684 Call(SetGoalToHome, ACTOR_SELF)
685 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
686 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
687 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
689 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle)
690 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
691 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
692 Return
693 End
694};
695
696EvtScript N(EVS_GetAvailableColumn) = {
697 Set(LFlag1, FALSE)
698 Set(LFlag2, FALSE)
699 Set(LFlag3, FALSE)
700 Set(LFlag4, FALSE)
701 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
702 Call(InitTargetIterator)
703 Label(0)
704 Call(GetOwnerTarget, LVar0, LVar5)
705 Call(GetIndexFromHome, LVar0, LVar5)
706 Mod(LVar5, 4)
708 CaseEq(0)
709 Set(LFlag1, TRUE)
710 CaseEq(1)
711 Set(LFlag2, TRUE)
712 CaseEq(2)
713 Set(LFlag3, TRUE)
714 CaseEq(3)
715 Set(LFlag4, TRUE)
717 Call(ChooseNextTarget, ITER_NEXT, LVar0)
719 Goto(0)
720 EndIf
721 Set(LVarA, -1)
722 Set(LVarB, -1)
723 Call(GetIndexFromHome, ACTOR_SELF, LVar0)
725 CaseEq(0)
726 IfEq(LFlag2, FALSE)
727 Set(LVarA, 1)
728 EndIf
729 CaseEq(1)
730 IfEq(LFlag1, FALSE)
731 Set(LVarA, 0)
732 EndIf
733 IfEq(LFlag3, FALSE)
734 IfEq(LVarA, -1)
735 Set(LVarA, 2)
736 Else
737 Set(LVarB, 2)
738 EndIf
739 EndIf
740 CaseEq(2)
741 IfEq(LFlag2, FALSE)
742 Set(LVarA, 1)
743 EndIf
744 IfEq(LFlag4, FALSE)
745 IfEq(LVarA, -1)
746 Set(LVarA, 3)
747 Else
748 Set(LVarB, 3)
749 EndIf
750 EndIf
751 CaseEq(3)
752 IfEq(LFlag3, FALSE)
753 Set(LVarA, 2)
754 EndIf
756 IfNe(LVarB, -1)
757 Call(RandInt, 1000, LVar0)
758 IfLt(LVar0, 500)
759 Set(LVarA, LVarB)
760 EndIf
761 EndIf
762 Return
763 End
764};
765
766EvtScript N(EVS_CountActiveSummoners) = {
767 Set(LVar9, 0)
768 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
769 Call(InitTargetIterator)
770 Label(0)
771 Call(GetOwnerTarget, LVar0, LVar1)
772 Call(GetOriginalActorType, LVar0, LVar2)
774 CaseOrEq(ACTOR_TYPE_FOREST_FUZZY)
775 CaseOrEq(ACTOR_TYPE_JUNGLE_FUZZY)
776 Call(GetStatusFlags, LVar0, LVar3)
778 Call(GetActorVar, LVar0, AVAR_Generation, LVar3)
779 IfNe(LVar3, 2)
780 Add(LVar9, 1)
781 EndIf
782 EndIf
784 CaseEq(ACTOR_TYPE_SPEAR_GUY)
785 Call(GetStatusFlags, LVar0, LVar3)
788 IfLt(LVar3, 2)
789 Add(LVar9, 1)
790 EndIf
791 EndIf
793 Call(ChooseNextTarget, ITER_NEXT, LVar0)
795 Goto(0)
796 EndIf
797 Return
798 End
799};
800
801EvtScript N(EVS_TakeTurn) = {
802 Call(GetBattlePhase, LVar0)
804 ExecWait(N(EVS_Attack_Leech))
805 Return
806 EndIf
807 Call(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar0)
808 IfEq(LVar0, 2)
809 ExecWait(N(EVS_Attack_Leech))
810 Return
811 EndIf
812 ExecWait(N(EVS_GetAvailableColumn))
813 IfEq(LVarA, -1)
814 ExecWait(N(EVS_Attack_Leech))
815 Return
816 EndIf
817 ExecWait(N(EVS_CountActiveSummoners))
819 CaseEq(1)
820 Call(RandInt, 1000, LVar0)
821 IfLt(LVar0, 400)
822 ExecWait(N(EVS_Move_Divide))
823 Return
824 EndIf
825 CaseEq(2)
826 Call(RandInt, 1000, LVar0)
827 IfLt(LVar0, 150)
828 ExecWait(N(EVS_Move_Divide))
829 Return
830 EndIf
831 CaseEq(3)
832 Call(RandInt, 1000, LVar0)
833 IfLt(LVar0, 70)
834 ExecWait(N(EVS_Move_Divide))
835 Return
836 EndIf
838 ExecWait(N(EVS_Attack_Leech))
839 Return
840 End
841};
842
843Vec3i N(SummonPos) = { NPC_DISPOSE_LOCATION };
844
845Formation N(SummonFormation) = {
846 ACTOR_BY_POS(NAMESPACE, N(SummonPos), 0),
847};
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ ACTION_COMMAND_STOP_LEECH
Definition enums.h:3478
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3576
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ BS_FLAGS1_4000
Definition enums.h:3583
@ BTL_MSG_ACTION_TIP_MASH_BUTTON
Definition enums.h:4108
@ ELEMENT_FIRE
Definition enums.h:2116
@ 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_FLAGS_NONE
Definition enums.h:3370
@ 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_HIT_STATIC
Definition enums.h:1957
@ 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_REPOSITION
Definition enums.h:4841
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4885
@ TARGET_FLAG_PRIMARY_ONLY
Definition enums.h:1863
@ TARGET_FLAG_2
Definition enums.h:1850
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ STATUS_FLAG_STATIC
Definition enums.h:2813
@ STATUS_FLAG_STONE
Definition enums.h:2820
@ SOUND_STAR_BOUNCE_A
Definition enums.h:975
@ SOUND_RECOVER_HEART
Definition enums.h:1406
@ SOUND_FUZZY_SHAKE
Definition enums.h:1408
@ SOUND_LEECH
Definition enums.h:1288
@ SOUND_FUZZY_RUMBLE
Definition enums.h:1407
@ SOUND_FUZZY_DIVIDE
Definition enums.h:1409
@ SOUND_HEART_BOUNCE
Definition enums.h:925
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ 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_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
@ DAMAGE_TYPE_UNBLOCKABLE
Definition enums.h:2875
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
@ DAMAGE_TYPE_SHOCK
Definition enums.h:2856
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
EvtScript EVS_Enemy_Knockback
EvtScript EVS_Enemy_HopToPos
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_ShockHit
EvtScript EVS_Enemy_HopHome
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 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 IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#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 BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#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 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 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 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_SpearGuy_Generation
Definition battle.h:101
FormationRow Formation[]
Definition battle.h:167