Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
lava_bubble.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/LavaBubble.h"
4
5#define NAMESPACE A(lava_bubble)
6
7extern s32 N(DefaultAnims)[];
8extern s32 N(ProjectileAnims)[];
9extern EvtScript N(EVS_Init);
10extern EvtScript N(EVS_TakeTurn);
11extern EvtScript N(EVS_Idle);
12extern EvtScript N(EVS_HandleEvent);
13
14enum N(ActorPartIDs) {
15 PRT_MAIN = 1,
16 PRT_FIRE_1 = 2,
17 PRT_FIRE_2 = 3,
18 PRT_FIRE_3 = 4,
19 PRT_FIRE_4 = 5,
20};
21
22enum N(ActorVars) {
23 AVAR_IN_NoTackle = 0,
24 AVAR_CanTackle = 0,
25 AVAR_Generation = 1,
26 AVAR_PauseIdle = 2,
27};
28
29enum N(ActorParams) {
30 DMG_TACKLE = 4,
31 DMG_SHOOT_PLAYER = 4,
32 DMG_SHOOT_PARTNER = 2,
33};
34
35s32 N(DefenseTable)[] = {
37 ELEMENT_WATER, -2,
38 ELEMENT_ICE, -2,
39 ELEMENT_FIRE, 99,
40 ELEMENT_BLAST, -1,
42};
43
44s32 N(StatusTable)[] = {
51 STATUS_KEY_FEAR, 100,
67};
68
69ActorPartBlueprint N(ActorParts)[] = {
70 {
72 .index = PRT_MAIN,
73 .posOffset = { 0, 0, 0 },
74 .targetOffset = { -2, 25 },
75 .opacity = 255,
76 .idleAnimations = N(DefaultAnims),
77 .defenseTable = N(DefenseTable),
78 .eventFlags = ACTOR_EVENT_FLAG_FIREY,
79 .elementImmunityFlags = ELEMENT_FIRE,
80 .projectileTargetOffset = { -3, -10 },
81 },
82 {
84 .index = PRT_FIRE_1,
85 .posOffset = { 0, 0, 0 },
86 .targetOffset = { 0, 24 },
87 .opacity = 255,
88 .idleAnimations = N(ProjectileAnims),
89 .defenseTable = N(DefenseTable),
90 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
91 .elementImmunityFlags = 0,
92 .projectileTargetOffset = { -1, -10 },
93 },
94 {
96 .index = PRT_FIRE_2,
97 .posOffset = { 0, 0, 0 },
98 .targetOffset = { 0, 24 },
99 .opacity = 255,
100 .idleAnimations = N(ProjectileAnims),
101 .defenseTable = N(DefenseTable),
102 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
103 .elementImmunityFlags = 0,
104 .projectileTargetOffset = { -1, -10 },
105 },
106 {
108 .index = PRT_FIRE_3,
109 .posOffset = { 0, 0, 0 },
110 .targetOffset = { 0, 24 },
111 .opacity = 255,
112 .idleAnimations = N(ProjectileAnims),
113 .defenseTable = N(DefenseTable),
114 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
115 .elementImmunityFlags = 0,
116 .projectileTargetOffset = { -1, -10 },
117 },
118 {
120 .index = PRT_FIRE_4,
121 .posOffset = { 0, 0, 0 },
122 .targetOffset = { 0, 24 },
123 .opacity = 255,
124 .idleAnimations = N(ProjectileAnims),
125 .defenseTable = N(DefenseTable),
126 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
127 .elementImmunityFlags = 0,
128 .projectileTargetOffset = { -1, -10 },
129 },
130};
131
132ActorBlueprint NAMESPACE = {
133 .flags = ACTOR_FLAG_FLYING,
134 .type = ACTOR_TYPE_LAVA_BUBBLE,
135 .level = ACTOR_LEVEL_LAVA_BUBBLE,
136 .maxHP = 9,
137 .partCount = ARRAY_COUNT(N(ActorParts)),
138 .partsData = N(ActorParts),
139 .initScript = &N(EVS_Init),
140 .statusTable = N(StatusTable),
141 .escapeChance = 50,
142 .airLiftChance = 90,
143 .hurricaneChance = 85,
144 .spookChance = 50,
145 .upAndAwayChance = 95,
146 .spinSmashReq = 0,
147 .powerBounceChance = 80,
148 .coinReward = 1,
149 .size = { 33, 32 },
150 .healthBarOffset = { 0, 0 },
151 .statusIconOffset = { -10, 20 },
152 .statusTextOffset = { 10, 20 },
153};
154
155s32 N(DefaultAnims)[] = {
156 STATUS_KEY_NORMAL, ANIM_LavaBubble_Anim01,
157 STATUS_KEY_STONE, ANIM_LavaBubble_Anim00,
158 STATUS_KEY_SLEEP, ANIM_LavaBubble_Anim01,
159 STATUS_KEY_POISON, ANIM_LavaBubble_Anim01,
160 STATUS_KEY_STOP, ANIM_LavaBubble_Anim00,
161 STATUS_KEY_STATIC, ANIM_LavaBubble_Anim01,
162 STATUS_KEY_PARALYZE, ANIM_LavaBubble_Anim00,
163 STATUS_KEY_DIZZY, ANIM_LavaBubble_Anim0A,
164 STATUS_KEY_FEAR, ANIM_LavaBubble_Anim0A,
166};
167
168s32 N(ProjectileAnims)[] = {
169 STATUS_KEY_NORMAL, ANIM_LavaBubble_Anim01,
171};
172
173EvtScript N(EVS_Init) = {
174 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
175 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
176 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
177 Call(GetActorVar, ACTOR_SELF, AVAR_IN_NoTackle, LVar0)
179 CaseEq(0)
180 Call(SetActorVar, ACTOR_SELF, AVAR_CanTackle, TRUE)
181 CaseEq(1)
182 Call(SetActorVar, ACTOR_SELF, AVAR_CanTackle, FALSE)
184 Call(SetPartScale, ACTOR_SELF, PRT_FIRE_1, Float(0.5), Float(0.5), Float(0.5))
185 Call(SetPartScale, ACTOR_SELF, PRT_FIRE_2, Float(0.5), Float(0.5), Float(0.5))
186 Call(SetPartScale, ACTOR_SELF, PRT_FIRE_3, Float(0.5), Float(0.5), Float(0.5))
187 Call(SetPartScale, ACTOR_SELF, PRT_FIRE_4, Float(0.5), Float(0.5), Float(0.5))
188 Call(SetActorVar, ACTOR_SELF, AVAR_Generation, 0)
189 Call(SetActorVar, ACTOR_SELF, AVAR_PauseIdle, FALSE)
190 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
191 Add(LVar1, 5)
192 Call(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2)
193 Call(HPBarToHome, ACTOR_SELF)
194 Return
195 End
196};
197
198EvtScript N(EVS_Idle) = {
199 Label(0)
200 Call(MakeLerp, 0, 10, 25, EASING_COS_IN_OUT)
201 Label(1)
203 Call(GetHomePos, ACTOR_SELF, LVar2, LVar3, LVar4)
204 Add(LVar0, LVar3)
205 Call(SetActorPos, ACTOR_SELF, LVar2, LVar0, LVar4)
206 IfEq(LVar1, 1)
207 Label(11)
208 Wait(1)
209 Call(GetStatusFlags, ACTOR_SELF, LVar0)
211 Goto(11)
212 EndIf
213 Call(GetActorVar, ACTOR_SELF, AVAR_PauseIdle, LVar0)
214 IfEq(LVar0, 1)
215 Goto(11)
216 EndIf
217 Goto(1)
218 EndIf
219 Call(MakeLerp, 10, 0, 25, EASING_COS_IN_OUT)
220 Label(2)
222 Call(GetHomePos, ACTOR_SELF, LVar2, LVar3, LVar4)
223 Add(LVar0, LVar3)
224 Call(SetActorPos, ACTOR_SELF, LVar2, LVar0, LVar4)
225 IfEq(LVar1, 1)
226 Label(22)
227 Wait(1)
228 Call(GetStatusFlags, ACTOR_SELF, LVar0)
230 Goto(22)
231 EndIf
232 Call(GetActorVar, ACTOR_SELF, AVAR_PauseIdle, LVar0)
233 IfEq(LVar0, 1)
234 Goto(22)
235 EndIf
236 Goto(2)
237 EndIf
238 Goto(0)
239 Return
240 End
241};
242
243#include "common/PlayLavaBubbleFlightSound.inc.c"
244
245EvtScript N(EVS_Ember_FlyHome) = {
246 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03)
247 Call(SetGoalToHome, ACTOR_SELF)
248 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
249 Thread
250 Call(N(PlayLavaBubbleFlightSound))
252 Call(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT)
253 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim01)
254 Return
255 End
256};
257
258EvtScript N(EVS_HandleEvent) = {
259 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
260 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
261 Call(GetLastEvent, ACTOR_SELF, LVar0)
265 SetConst(LVar0, PRT_MAIN)
266 SetConst(LVar1, ANIM_LavaBubble_Anim07)
270 SetConst(LVar0, PRT_MAIN)
271 SetConst(LVar1, ANIM_LavaBubble_Anim08)
272 SetConst(LVar2, ANIM_LavaBubble_Anim09)
275 SetConst(LVar0, PRT_MAIN)
276 SetConst(LVar1, ANIM_LavaBubble_Anim08)
277 SetConst(LVar2, ANIM_LavaBubble_Anim09)
279 SetConst(LVar0, PRT_MAIN)
280 SetConst(LVar1, ANIM_LavaBubble_Anim09)
282 Return
284 SetConst(LVar0, PRT_MAIN)
285 SetConst(LVar1, ANIM_LavaBubble_Anim07)
288 SetConst(LVar0, PRT_MAIN)
289 SetConst(LVar1, ANIM_LavaBubble_Anim07)
291 SetConst(LVar0, PRT_MAIN)
292 SetConst(LVar1, ANIM_LavaBubble_Anim07)
294 Return
297 SetConst(LVar0, PRT_MAIN)
298 SetConst(LVar1, ANIM_LavaBubble_Anim07)
300 SetConst(LVar0, PRT_MAIN)
301 SetConst(LVar1, ANIM_LavaBubble_Anim07)
303 ExecWait(N(EVS_Ember_FlyHome))
306 SetConst(LVar0, PRT_MAIN)
307 SetConst(LVar1, ANIM_LavaBubble_Anim07)
309 SetConst(LVar0, PRT_MAIN)
310 SetConst(LVar1, ANIM_LavaBubble_Anim07)
312 Return
317 SetConst(LVar0, PRT_MAIN)
318 SetConst(LVar1, ANIM_LavaBubble_Anim01)
322 SetConst(LVar0, PRT_MAIN)
323 SetConst(LVar1, ANIM_LavaBubble_Anim07)
325 SetConst(LVar0, PRT_MAIN)
326 SetConst(LVar1, ANIM_LavaBubble_Anim07)
328 Return
330 Call(SetActorPos, ACTOR_SELF, 20, 0, 0)
331 Call(HPBarToCurrent, ACTOR_SELF)
333 ExecWait(N(EVS_Ember_FlyHome))
334 Call(HPBarToHome, ACTOR_SELF)
336 SetConst(LVar0, PRT_MAIN)
337 SetConst(LVar1, ANIM_LavaBubble_Anim01)
340 SetConst(LVar0, PRT_MAIN)
341 SetConst(LVar1, ANIM_LavaBubble_Anim03)
342 SetConst(LVar2, ANIM_LavaBubble_Anim07)
344 Return
346 SetConst(LVar0, PRT_MAIN)
347 SetConst(LVar1, ANIM_LavaBubble_Anim03)
350 SetConst(LVar0, PRT_MAIN)
351 SetConst(LVar1, ANIM_LavaBubble_Anim03)
353 Return
357 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
358 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
359 Return
360 End
361};
362
363EvtScript N(EVS_Attack_Tackle) = {
364 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
365 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
366 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
367 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
368 Call(BattleCamTargetActor, ACTOR_SELF)
369 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
370 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03)
371 Call(SetGoalToTarget, ACTOR_SELF)
372 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
373 Add(LVar0, 30)
374 Set(LVar1, 5)
375 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
376 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
377 Thread
378 Call(N(PlayLavaBubbleFlightSound))
380 Call(FlyToGoal, ACTOR_SELF, 0, 0, EASING_SIN_OUT)
381 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim01)
382 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
386 Set(LVarA, LVar0)
387 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04)
388 Call(SetGoalToTarget, ACTOR_SELF)
389 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
390 Sub(LVar0, 20)
391 Set(LVar1, 0)
392 Add(LVar2, 1)
393 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.0))
394 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
395 Call(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
397 Call(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
398 EndIf
399 Sub(LVar0, 30)
400 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
401 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
402 Sub(LVar0, 20)
403 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
404 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
405 Sub(LVar0, 10)
406 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
407 Call(JumpToGoal, ACTOR_SELF, 3, FALSE, TRUE, FALSE)
408 Wait(14)
409 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
410 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
411 Call(SetActorYaw, ACTOR_SELF, 180)
412 ExecWait(N(EVS_Ember_FlyHome))
413 Call(SetActorYaw, ACTOR_SELF, 0)
414 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
415 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_RESTART)
416 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
417 Return
420 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04)
421 Call(SetGoalToTarget, ACTOR_SELF)
422 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
423 Add(LVar2, 1)
424 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.6))
425 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
426 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
427 Wait(2)
428 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE, 0, 0, DMG_TACKLE, BS_FLAGS1_TRIGGER_EVENTS)
432 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
433 Set(LVar0, PRT_MAIN)
434 Set(LVar1, ANIM_LavaBubble_Anim04)
436 Wait(5)
437 ExecWait(N(EVS_Ember_FlyHome))
440 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_RESTART)
441 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
442 Return
443 End
444};
445
446// (in) LVar3 posX
447// (in) LVar4 posY
448// (in) LVar5 posZ
449EvtScript N(EVS_ShootFire_Impl) = {
450 Set(LVar6, 2)
451 Loop(4)
452 Thread
453 Call(GetStatusFlags, ACTOR_SELF, LVarA)
455 Call(SetPartScale, ACTOR_SELF, LVar6, Float(0.2), Float(0.2), Float(0.2))
456 Else
457 Call(SetPartScale, ACTOR_SELF, LVar6, Float(0.5), Float(0.5), Float(0.5))
458 EndIf
459 Call(SetPartPos, ACTOR_SELF, LVar6, LVar0, LVar1, LVar2)
460 Call(SetPartFlagBits, ACTOR_SELF, LVar6, ACTOR_PART_FLAG_INVISIBLE, FALSE)
461 Call(SetPartMoveSpeed, ACTOR_SELF, LVar6, Float(8.0))
462 Call(SetPartJumpGravity, ACTOR_SELF, LVar6, Float(0.01))
464 Call(JumpPartTo, ACTOR_SELF, LVar6, LVar3, LVar4, LVar5, 0, FALSE)
465 Call(SetPartFlagBits, ACTOR_SELF, LVar6, ACTOR_PART_FLAG_INVISIBLE, TRUE)
467 Wait(3)
468 Add(LVar6, 1)
469 EndLoop
470 Return
471 End
472};
473
474// Shoot fireballs at a target and wait before yielding.
475// (in) LVar3 posX
476// (in) LVar4 posY
477// (in) LVar5 posZ
478EvtScript N(EVS_ShootFire) = {
479 Exec(N(EVS_ShootFire_Impl))
480 Call(GetDistanceToGoal, ACTOR_SELF, LVar0)
481 DivF(LVar0, Float(8.0))
482 Add(LVar0, 1)
483 Wait(LVar0)
484 Return
485 End
486};
487
488EvtScript N(EVS_Attack_ShootPartner) = {
489 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
490 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
491 Call(SetTargetActor, ACTOR_SELF, ACTOR_PARTNER)
492 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
493 Call(BattleCamTargetActor, ACTOR_SELF)
494 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
495 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
496 Call(GetActorVar, ACTOR_SELF, AVAR_CanTackle, LVarA)
497 IfEq(LVarA, TRUE)
498 Add(LVar0, 100)
499 Set(LVar1, 5)
500 Else
501 Add(LVar0, 30)
502 Set(LVar1, 50)
503 EndIf
504 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
505 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03)
506 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
507 Thread
508 Call(N(PlayLavaBubbleFlightSound))
510 Call(FlyToGoal, ACTOR_SELF, 0, -4, EASING_SIN_OUT)
511 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim01)
512 Wait(10)
513 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim05)
514 Wait(30)
515 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
519 Set(LVarA, LVar0)
520 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim06)
521 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
522 Sub(LVar0, 5)
523 Add(LVar1, 4)
524 Add(LVar2, 2)
525 Call(SetGoalToTarget, ACTOR_SELF)
526 Call(GetGoalPos, ACTOR_SELF, LVar3, LVar4, LVar5)
527 Sub(LVar3, 100)
528 Add(LVar5, 2)
529 ExecWait(N(EVS_ShootFire))
531 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
532 EndIf
533 Wait(20)
534 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
535 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
536 Call(SetActorYaw, ACTOR_SELF, 180)
537 ExecWait(N(EVS_Ember_FlyHome))
538 Wait(20)
539 Call(SetActorYaw, ACTOR_SELF, 0)
540 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
541 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
542 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
543 Return
546 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim06)
547 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
548 Sub(LVar0, 5)
549 Add(LVar1, 4)
550 Add(LVar2, 2)
551 Call(SetGoalToTarget, ACTOR_SELF)
552 Call(GetGoalPos, ACTOR_SELF, LVar3, LVar4, LVar5)
553 Sub(LVar4, 6)
554 Add(LVar5, 2)
555 ExecWait(N(EVS_ShootFire))
556 Wait(2)
557 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE | DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_SHOOT_PARTNER, BS_FLAGS1_TRIGGER_EVENTS)
558 Wait(20)
562 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
563 ExecWait(N(EVS_Ember_FlyHome))
566 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
567 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
568 Return
569 End
570};
571
572EvtScript N(EVS_Attack_ShootPlayer) = {
573 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
574 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
575 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
576 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
577 Call(BattleCamTargetActor, ACTOR_SELF)
578 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
579 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim03)
580 Call(SetGoalToTarget, ACTOR_SELF)
581 Call(AddGoalPos, ACTOR_SELF, 30, 0, 0)
582 Call(SetActorSpeed, ACTOR_SELF, Float(5.0))
583 Thread
584 Call(N(PlayLavaBubbleFlightSound))
586 Call(FlyToGoal, ACTOR_SELF, 0, -4, EASING_SIN_OUT)
587 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
591 Set(LVarA, LVar0)
592 Wait(10)
593 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_NONE, 0)
594 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_EMBER_JUMP)
595 Call(SetActorSpeed, ACTOR_SELF, Float(5.0))
596 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
597 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04)
598 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
599 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
600 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
601 Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP)
602 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_ACTOR_HOP)
603 Call(SetGoalToTarget, ACTOR_SELF)
604 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
605 Sub(LVar0, 30)
606 Add(LVar2, 2)
607 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
608 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
609 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04)
610 Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT)
612 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
613 EndIf
614 Wait(30)
615 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
616 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
617 Call(SetActorYaw, ACTOR_SELF, 180)
618 ExecWait(N(EVS_Ember_FlyHome))
619 Call(SetActorYaw, ACTOR_SELF, 0)
620 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
621 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_RESTART)
622 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
623 Return
626 Wait(5)
627 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_NONE, 0)
628 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_EMBER_JUMP)
629 Call(SetActorSpeed, ACTOR_SELF, Float(5.0))
630 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
631 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_LavaBubble_Anim04)
632 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
633 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
634 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
635 Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP)
636 Set(LVarA, LVar0)
637 Set(LVarB, LVar1)
638 Set(LVarC, LVar2)
639 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_ACTOR_HOP)
640 Call(SetGoalToTarget, ACTOR_SELF)
641 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
642 Add(LVar2, 2)
643 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
644 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
645 Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_QUADRATIC_OUT)
646 Wait(2)
647 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_FIRE, 0, 0, DMG_SHOOT_PLAYER, BS_FLAGS1_TRIGGER_EVENTS)
651 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
652 Call(SetGoalPos, ACTOR_SELF, LVarA, LVarB, LVarC)
653 Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR)
654 Wait(20)
655 ExecWait(N(EVS_Ember_FlyHome))
658 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_RESTART)
659 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
660 Return
661 End
662};
663
664EvtScript N(EVS_TakeTurn) = {
665 Call(GetBattlePhase, LVar0)
667 Call(GetActorVar, ACTOR_SELF, AVAR_CanTackle, LVar0)
669 CaseEq(1)
670 ExecWait(N(EVS_Attack_Tackle))
671 CaseEq(0)
672 ExecWait(N(EVS_Attack_ShootPlayer))
674 Return
675 EndIf
676 Call(GetActorVar, ACTOR_SELF, AVAR_CanTackle, LVar0)
678 CaseEq(1)
679 Call(GetStatusFlags, ACTOR_PARTNER, LVar0)
681 ExecWait(N(EVS_Attack_Tackle))
682 Else
683 Call(RandInt, 1000, LVar0)
684 IfLe(LVar0, 300)
685 ExecWait(N(EVS_Attack_ShootPartner))
686 Else
687 ExecWait(N(EVS_Attack_Tackle))
688 EndIf
689 EndIf
690 CaseEq(0)
691 Call(GetStatusFlags, ACTOR_PARTNER, LVar0)
693 ExecWait(N(EVS_Attack_ShootPlayer))
694 Else
695 Call(RandInt, 1000, LVar0)
696 IfLe(LVar0, 300)
697 ExecWait(N(EVS_Attack_ShootPartner))
698 Else
699 ExecWait(N(EVS_Attack_ShootPlayer))
700 EndIf
701 EndIf
703 Return
704 End
705};
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_FIRE
Definition enums.h:2116
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_BLAST
Definition enums.h:2124
@ ELEMENT_ICE
Definition enums.h:2118
@ ELEMENT_WATER
Definition enums.h:2117
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ACTOR_EVENT_FLAGS_NONE
Definition enums.h:3370
@ ACTOR_EVENT_FLAG_FIREY
Player takes burn damage upon contact.
Definition enums.h:3371
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ PHASE_FIRST_STRIKE
Definition enums.h:2059
@ STATUS_KEY_PARALYZE
Definition enums.h:2201
@ STATUS_TURN_MOD_DEFAULT
Definition enums.h:2227
@ STATUS_TURN_MOD_PARALYZE
Definition enums.h:2234
@ STATUS_KEY_FROZEN
Definition enums.h:2203
@ STATUS_TURN_MOD_SLEEP
Definition enums.h:2228
@ STATUS_TURN_MOD_DIZZY
Definition enums.h:2232
@ STATUS_KEY_STATIC
Definition enums.h:2207
@ STATUS_END
Definition enums.h:2196
@ STATUS_TURN_MOD_POISON
Definition enums.h:2233
@ STATUS_KEY_FEAR
Definition enums.h:2199
@ STATUS_TURN_MOD_STOP
Definition enums.h:2237
@ STATUS_KEY_SLEEP
Definition enums.h:2202
@ STATUS_KEY_STONE
Definition enums.h:2208
@ STATUS_KEY_STOP
Definition enums.h:2204
@ STATUS_TURN_MOD_FROZEN
Definition enums.h:2230
@ STATUS_KEY_SHRINK
Definition enums.h:2206
@ STATUS_KEY_DIZZY
Definition enums.h:2200
@ STATUS_KEY_POISON
Definition enums.h:2205
@ STATUS_TURN_MOD_STATIC
Definition enums.h:2229
@ STATUS_TURN_MOD_FEAR
Definition enums.h:2231
@ STATUS_KEY_NORMAL
Definition enums.h:2197
@ STATUS_TURN_MOD_SHRINK
Definition enums.h:2235
@ STATUS_KEY_DEFAULT
Definition enums.h:2198
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1952
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_LUCKY
Definition enums.h:1955
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4885
@ SOUND_ID_TRIGGER_CHANGE_SOUND
Definition enums.h:532
@ EASING_SIN_OUT
Definition enums.h:521
@ EASING_COS_IN_OUT
Definition enums.h:520
@ EASING_QUADRATIC_OUT
Definition enums.h:514
@ EASING_LINEAR
Definition enums.h:510
@ IDLE_SCRIPT_RESTART
Definition enums.h:6409
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ STATUS_FLAG_KO
Definition enums.h:2823
@ SOUND_EMBER_JUMP
Definition enums.h:1041
@ SOUND_NONE
Definition enums.h:547
@ SOUND_ACTOR_HOP
Definition enums.h:1073
@ SOUND_EMBER_FLY
Definition enums.h:1163
@ SOUND_EMBER_SPIT
Definition enums.h:1042
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PARTNER
Definition enums.h:2086
@ 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_UP_AND_AWAY
Definition enums.h:2176
@ 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_BURN_TAUNT
Definition enums.h:2149
@ 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_FIRE
Definition enums.h:2852
@ 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 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 LVar6
Definition macros.h:154
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define DivF(VAR, FLOAT_VALUE)
Definition macros.h:386
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define 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 End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define LVarC
Definition macros.h:160
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define Float(DOUBLE)
Definition macros.h:51
#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 IfLe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR > RVAR.
Definition macros.h:281
#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 LVarA
Definition macros.h:158
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define 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 Exec(EVT_SOURCE)
Launches a new thread.
Definition macros.h:455
#define Return
Kills the current EVT thread.
Definition macros.h:217