Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
ghost_goombario.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/BattleGoombario.h"
4
5#define NAMESPACE A(goombario_clone)
6
7extern EvtScript N(EVS_Init);
8extern EvtScript N(EVS_Idle);
9extern EvtScript N(EVS_TakeTurn);
10extern EvtScript N(EVS_HandleEvent);
11
12s32 N(DefaultAnims)[] = {
13 STATUS_KEY_NORMAL, ANIM_BattleGoombario_Idle,
14 STATUS_KEY_STONE, ANIM_BattleGoombario_Still,
15 STATUS_KEY_SLEEP, ANIM_BattleGoombario_Still,
16 STATUS_KEY_POISON, ANIM_BattleGoombario_Idle,
17 STATUS_KEY_STOP, ANIM_BattleGoombario_Still,
18 STATUS_KEY_STATIC, ANIM_BattleGoombario_Idle,
19 STATUS_KEY_PARALYZE, ANIM_BattleGoombario_Still,
20 STATUS_KEY_DIZZY, ANIM_BattleGoombario_Injured,
21 STATUS_KEY_FEAR, ANIM_BattleGoombario_Injured,
23};
24
25s32 N(DefenseTable)[] = {
28};
29
30s32 N(StatusTable)[] = {
53};
54
55ActorPartBlueprint N(ActorParts)[] = {
56 {
58 .index = PRT_MAIN,
59 .posOffset = { 0, 0, 0 },
60 .targetOffset = { 0, 20 },
61 .opacity = 255,
62 .idleAnimations = N(DefaultAnims),
63 .defenseTable = N(DefenseTable),
64 .eventFlags = 0,
65 .elementImmunityFlags = 0,
66 .projectileTargetOffset = { -1, -9 },
67 },
68};
69
70ActorBlueprint NAMESPACE = {
71 .flags = 0,
72 .type = ACTOR_TYPE_GHOST_GOOMBARIO,
73 .level = ACTOR_LEVEL_GHOST_GOOMBARIO,
74 .maxHP = 15,
75 .partCount = ARRAY_COUNT(N(ActorParts)),
76 .partsData = N(ActorParts),
77 .initScript = &N(EVS_Init),
78 .statusTable = N(StatusTable),
79 .escapeChance = 50,
80 .airLiftChance = 80,
81 .hurricaneChance = 70,
82 .spookChance = 50,
83 .upAndAwayChance = 95,
84 .spinSmashReq = 0,
85 .powerBounceChance = 90,
86 .coinReward = 2,
87 .size = { 29, 26 },
88 .healthBarOffset = { 0, 0 },
89 .statusIconOffset = { -10, 20 },
90 .statusTextOffset = { 10, 20 },
91};
92
93EvtScript N(EVS_Init) = {
94 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
95 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
96 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
97 Return
98 End
99};
100
101EvtScript N(EVS_Idle) = {
102 Return
103 End
104};
105
106EvtScript N(EVS_HandleEvent) = {
107 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
108 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
109 Call(GetLastEvent, ACTOR_SELF, LVar0)
113 Call(GetLastElement, LVar1)
115 SetConst(LVar0, PRT_MAIN)
116 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
117 ExecWait(A(EVS_Duplighost_OnHitElectric))
118 Return
119 Else
120 SetConst(LVar0, PRT_MAIN)
121 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
123 EndIf
126 SetConst(LVar0, PRT_MAIN)
127 SetConst(LVar1, ANIM_BattleGoombario_BurnHurt1)
128 SetConst(LVar2, ANIM_BattleGoombario_BurnHurt2)
131 SetConst(LVar0, PRT_MAIN)
132 SetConst(LVar1, ANIM_BattleGoombario_BurnHurt1)
133 SetConst(LVar2, ANIM_BattleGoombario_BurnHurt2)
135 ExecWait(A(EVS_Duplighost_OnDeath))
136 Wait(10)
137 SetConst(LVar0, PRT_MAIN)
138 SetConst(LVar1, ANIM_BattleGoombario_BurnHurt2)
140 Return
142 SetConst(LVar0, PRT_MAIN)
143 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
146 ExecWait(A(EVS_Duplighost_OnDeath))
147 SetConst(LVar0, PRT_MAIN)
148 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
150 SetConst(LVar0, PRT_MAIN)
151 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
153 Return
155 SetConst(LVar0, PRT_MAIN)
156 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
157 ExecWait(A(EVS_Duplighost_OnShockHit))
158 Return
160 ExecWait(A(EVS_Duplighost_OnDeath))
161 SetConst(LVar0, PRT_MAIN)
162 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
163 Set(LVar2, 12)
164 ExecWait(A(EVS_Duplighost_OnShockDeath))
165 SetConst(LVar0, PRT_MAIN)
166 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
168 Return
172 SetConst(LVar0, PRT_MAIN)
173 SetConst(LVar1, ANIM_BattleGoombario_Idle)
177 ExecWait(A(EVS_Duplighost_OnDeath))
178 SetConst(LVar0, PRT_MAIN)
179 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
181 Wait(10)
182 SetConst(LVar0, PRT_MAIN)
183 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
185 Return
187 SetConst(LVar0, PRT_MAIN)
188 SetConst(LVar1, ANIM_BattleGoombario_Idle)
191 SetConst(LVar0, PRT_MAIN)
192 SetConst(LVar1, ANIM_BattleGoombario_Run)
193 SetConst(LVar2, ANIM_BattleGoombario_HurtStill)
195 Return
197 SetConst(LVar0, PRT_MAIN)
198 SetConst(LVar1, ANIM_BattleGoombario_Run)
201 SetConst(LVar0, PRT_MAIN)
202 SetConst(LVar1, ANIM_BattleGoombario_HurtStill)
204 Return
207 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
208 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
209 Return
210 End
211};
212
213#include "world/common/todo/UnkFunc62.inc.c"
215
216EvtScript N(EVS_HeadbonkFollowthrough) = {
217 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
218 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Idle)
219 Thread
220 Call(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0)
221 Set(LVar0, 180)
222 Loop(15)
223 Sub(LVar0, 60)
224 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
225 Wait(1)
226 EndLoop
227 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Fall)
228 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
229 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
231 Call(SetGoalToTarget, ACTOR_SELF)
232 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
233 Add(LVar0, 60)
234 Set(LVar1, 0)
235 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.0))
236 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
237 Call(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
238 Call(GetStatusFlags, ACTOR_SELF, LVarA)
240 SetF(LVar5, Float(7.2))
241 Else
242 Set(LVar5, 18)
243 EndIf
244 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
245 Call(SetActorDispOffset, ACTOR_SELF, 0, LVar5, 0)
246 Wait(1)
247 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
248 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
249 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Idle)
250 Add(LVar0, 20)
251 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
252 Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
253 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
254 Call(SetActorDispOffset, ACTOR_SELF, 0, LVar5, 0)
255 Wait(1)
256 Add(LVar0, 10)
257 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Idle)
258 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
259 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
260 Call(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE)
261 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
262 Call(SetActorDispOffset, ACTOR_SELF, 0, LVar5, 0)
263 Wait(1)
264 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
265 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Idle)
266 Wait(2)
267 Call(SetGoalToHome, ACTOR_SELF)
268 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
269 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Run)
270 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
271 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Idle)
272 Return
273 End
274};
275
276EvtScript N(EVS_ApproachPlayer) = {
277 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
278 Call(BattleCamTargetActor, ACTOR_SELF)
279 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
280 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
281 Call(SetGoalToTarget, ACTOR_SELF)
282 Call(AddGoalPos, ACTOR_SELF, 70, 0, 0)
283 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Run)
284 Call(SetActorSpeed, ACTOR_SELF, Float(5.0))
285 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
286 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Idle)
287 Return
288 End
289};
290
291// copied from goombario.c and used, but result is discarded
292EvtScript N(EVS_CalculateJumpTime) = {
293 Call(SetGoalToTarget, ACTOR_SELF)
294 Call(GetGoalPos, ACTOR_SELF, LVarB, LVarC, LVarD)
295 Call(GetActorPos, ACTOR_SELF, LVarC, LVarD, LVarE)
297 Sub(LVarB, LVarC)
298 Else
299 Sub(LVarC, LVarB)
300 Set(LVarB, LVarC)
301 EndIf
302 Sub(LVarB, 20)
303 DivF(LVarB, Float(10.588))
304 AddF(LVarB, 15)
305 Set(LVarA, LVarB)
306 Return
307 End
308};
309
310EvtScript N(EVS_Attack_Headbonk) = {
311 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
312 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
313 ExecWait(N(EVS_ApproachPlayer))
314 ExecWait(N(EVS_CalculateJumpTime))
315 Call(GetStatusFlags, ACTOR_SELF, LVarA)
317 SetF(LVar0, Float(7.2))
318 SetF(LVar1, Float(7.6))
319 SetF(LVar1, Float(3.6))
320 Else
321 Set(LVar0, 18)
322 Set(LVar1, 19)
323 Set(LVar2, 9)
324 EndIf
325 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
326 Call(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0)
327 Wait(5)
328 Call(SetActorDispOffset, ACTOR_SELF, 0, LVar1, 0)
329 Wait(1)
330 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk)
331 Call(SetActorDispOffset, ACTOR_SELF, 0, LVar2, 0)
332 Call(SetGoalToTarget, ACTOR_SELF)
333 Call(AddGoalPos, ACTOR_SELF, 0, 0, 5)
334 Call(SetJumpAnimations, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
335 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_NONE, 0)
336 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_GOOMBARIO_JUMP)
337 Call(N(UnkFunc62), LVarA, 0)
338 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
342 Set(LVarA, LVar0)
343 Call(SetJumpAnimations, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
344 Call(N(ActorJumpToPos))
345 Thread
346 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
349 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
350 EndIf
351 Wait(20)
352 Call(YieldTurn)
353 ExecWait(N(EVS_HeadbonkFollowthrough))
354 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
355 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
356 Return
360 Call(SetPartScale, ACTOR_SELF, PRT_MAIN, Float(1.1), Float(0.8), Float(1.0))
361 Wait(1)
362 Call(SetPartScale, ACTOR_SELF, PRT_MAIN, Float(1.3), Float(0.5), Float(1.0))
363 Wait(1)
364 Call(SetPartScale, ACTOR_SELF, PRT_MAIN, Float(1.0), Float(1.0), Float(1.0))
366 Wait(1)
367 Wait(2)
368 Call(GetActorVar, ACTOR_SELF, AVAR_Copy_PartnerLevel, LVar9)
371 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
373 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_INCLUDE_POWER_UPS)
375 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_INCLUDE_POWER_UPS)
377 Call(GetActorHP, ACTOR_PLAYER, LVar0)
378 IfEq(LVar0, 0)
379 Goto(100)
380 EndIf
381 Set(LVarA, 24)
382 Call(GetActorVar, ACTOR_SELF, AVAR_Copy_PartnerLevel, LVar9)
385 Thread
386 Wait(4)
387 Set(LVar0, 0)
388 Loop(6)
389 Add(LVar0, 30)
390 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
391 Wait(1)
392 EndLoop
394 Call(SetGoalToTarget, ACTOR_SELF)
395 Call(SetJumpAnimations, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
396 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_GOOMBARIO_HEADBONK)
397 Call(N(UnkFunc62), LVarA, 3)
399 Thread
400 Wait(4)
401 Set(LVar0, 0)
402 Loop(6)
403 Add(LVar0, 30)
404 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
405 Wait(1)
406 EndLoop
408 Call(SetGoalToTarget, ACTOR_SELF)
409 Call(EnableActorBlur, ACTOR_SELF, ACTOR_BLUR_ENABLE)
410 Call(SetJumpAnimations, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
411 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_GOOMBARIO_HEADBONK)
412 Call(N(UnkFunc62), LVarA, 3)
413 Call(EnableActorBlur, ACTOR_SELF, ACTOR_BLUR_DISABLE)
415 Thread
416 Wait(4)
417 Set(LVar0, 0)
418 Loop(6)
419 Add(LVar0, 30)
420 Call(SetActorRotation, ACTOR_SELF, 0, EVT_IGNORE_ARG, LVar0)
421 Wait(1)
422 EndLoop
423 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk)
425 Thread
426 Set(LVar0, 0)
427 Loop(LVarA)
428 Add(LVar0, 133)
430 Wait(1)
431 EndLoop
433 Call(SetGoalToTarget, ACTOR_SELF)
434 Call(EnableActorBlur, ACTOR_SELF, ACTOR_BLUR_ENABLE)
435 Call(SetJumpAnimations, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
436 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_GOOMBARIO_HEADBONK)
437 Call(N(UnkFunc62), LVarA, 3)
438 Call(EnableActorBlur, ACTOR_SELF, ACTOR_BLUR_DISABLE)
441 Call(SetPartScale, ACTOR_SELF, PRT_MAIN, Float(1.1), Float(0.8), Float(1.0))
442 Wait(1)
443 Call(SetPartScale, ACTOR_SELF, PRT_MAIN, Float(1.3), Float(0.5), Float(1.0))
444 Wait(1)
445 Call(SetPartScale, ACTOR_SELF, PRT_MAIN, Float(1.0), Float(1.0), Float(1.0))
447 Wait(1)
448 Wait(2)
449 Call(GetActorVar, ACTOR_SELF, AVAR_Copy_PartnerLevel, LVar9)
452 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 1, BS_FLAGS1_TRIGGER_EVENTS)
454 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 2, BS_FLAGS1_TRIGGER_EVENTS)
456 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, 3, BS_FLAGS1_TRIGGER_EVENTS)
458 Label(100)
462 Call(YieldTurn)
463 ExecWait(N(EVS_HeadbonkFollowthrough))
466 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
467 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
468 Return
469 End
470};
471
472API_CALLABLE(N(CalculateTattleCamBoomLength)) {
473 Actor* actor = get_actor(script->owner1.actorID);
474 Actor* targetActor = get_actor(actor->targetActorID);
475
476 if (!(targetActor->flags & ACTOR_FLAG_UPSIDE_DOWN)) {
477 script->varTable[1] += targetActor->size.y / 2;
478 script->varTable[1] += targetActor->size.y / 4;
479 } else {
480 script->varTable[1] -= targetActor->size.y / 2;
481 script->varTable[1] -= targetActor->size.y / 4;
482 }
483
484 script->varTable[3] = 126 + MAX(targetActor->size.x, targetActor->size.y);
485 return ApiStatus_DONE2;
486}
487
488API_CALLABLE(N(OpenTattleWindow)) {
489 Bytecode* args = script->ptrReadPos;
490
491 evt_set_variable(script, *args++, (s32) fx_tattle_window(0, 106.0f, 144.0f, 0, 1.0f, 0));
492 return ApiStatus_DONE2;
493}
494
495API_CALLABLE(N(HideTattleWindow)) {
496 Bytecode* args = script->ptrReadPos;
497 EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
498
500 return ApiStatus_DONE2;
501}
502
503API_CALLABLE(N(CloseTattleWindow)) {
504 Bytecode* args = script->ptrReadPos;
505 EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
506
507 effect->data.tattleWindow->pos.y = 144.0f;
509 return ApiStatus_DONE2;
510}
511
512EvtScript N(EVS_Move_Tattle) = {
513 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
514 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
515 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
516 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
517 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
518 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
519 Wait(10)
520 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
521 Call(SetGoalToTarget, ACTOR_SELF)
522 Call(SetBattleFlagBits, BS_FLAGS1_TATTLE_OPEN, TRUE)
523 Call(N(OpenTattleWindow), LVar5)
524 Wait(12)
525 Call(EnableBattleStatusBar, FALSE)
529 Call(SetCamViewport, CAM_TATTLE, 37, 95, 138, 99)
530 Call(SetGoalToTarget, ACTOR_SELF)
531 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
532 Sub(LVar0, 8)
533 Set(LVar1, 0)
534 Call(N(CalculateTattleCamBoomLength))
535 Wait(1)
537 Call(SetNoInterpCamParams, CAM_TATTLE, FALSE, LVar3, 100, 4)
538 Wait(2)
539 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_TATTLE_WINDOW_OPEN)
541 Wait(10)
542 Call(ActorSpeak, MSG_EnemyTattle_Mario, ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Talk, ANIM_BattleGoombario_Idle)
543 Call(N(CloseTattleWindow), LVar5)
544 Wait(12)
546 Wait(32)
547 Call(EnableBattleStatusBar, TRUE)
548 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
549 Call(SetBattleFlagBits, BS_FLAGS1_TATTLE_OPEN, FALSE)
550 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
551 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
552 Return
553 End
554};
555
556EvtScript N(EVS_TakeTurn) = {
557 Call(RandInt, 100, LVar0)
558 IfLt(LVar0, 10)
559 ExecWait(N(EVS_Move_Tattle))
560 Else
561 ExecWait(N(EVS_Attack_Headbonk))
562 EndIf
563 Return
564 End
565};
566
567Formation A(GoombarioCloneFormation) = {
568 ACTOR_BY_POS(NAMESPACE, A(DuplighostSummonPos), 0),
569};
s16 targetActorID
Vec2bu size
Bytecode EvtScript[]
struct TattleWindowFXData * tattleWindow
Definition effects.h:2572
EffectData data
Definition effects.h:2605
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ ACTOR_SOUND_JUMP
Definition enums.h:2036
@ BS_FLAGS1_TATTLE_OPEN
Definition enums.h:3567
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_NORMAL
Definition enums.h:2115
@ CAM_UPDATE_NO_INTERP
Definition enums.h:4761
@ 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
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ PARTNER_RANK_NORMAL
Definition enums.h:2018
@ PARTNER_RANK_SUPER
Definition enums.h:2019
@ PARTNER_RANK_ULTRA
Definition enums.h:2020
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ SOUND_GOOMBARIO_HEADBONK
Definition enums.h:993
@ SOUND_TATTLE_WINDOW_OPEN
Definition enums.h:994
@ SOUND_NONE
Definition enums.h:547
@ SOUND_GOOMBARIO_JUMP
Definition enums.h:1322
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_UPSIDE_DOWN
HP bar offset below actor (e.g. Swooper when upside-down).
Definition enums.h:3331
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4905
@ ACTOR_BLUR_ENABLE
Definition enums.h:6414
@ ACTOR_BLUR_DISABLE
Definition enums.h:6413
@ 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
@ CAM_TATTLE
Definition enums.h:1802
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_SHOCK
Definition enums.h:2856
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1847
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
ApiStatus SetCamEnabled(Evt *script, b32 isInitialCall)
ApiStatus SetCamViewport(Evt *script, b32 isInitialCall)
ApiStatus SetCamLookTarget(Evt *script, b32 isInitialCall)
ApiStatus RandInt(Evt *script, b32 isInitialCall)
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
ApiStatus SetNoInterpCamParams(Evt *script, b32 isInitialCall)
ApiStatus SetCamNoDraw(Evt *script, b32 isInitialCall)
ApiStatus SetCamPerspective(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 DivF(VAR, FLOAT_VALUE)
Definition macros.h:386
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define AddF(VAR, FLOAT_VALUE)
Definition macros.h:383
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#define EndChildThread
Marks the end of a child thread block.
Definition macros.h:563
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#define 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 NPC_DISPOSE_POS_Y
Definition macros.h:160
#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 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 SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
Definition macros.h:373
#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 EVT_IGNORE_ARG
Definition macros.h:46
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LVar9
Definition macros.h:157
#define A(sym)
Definition macros.h:36
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define ChildThread
Marks the start of a child thread block.
Definition macros.h:560
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar3
Definition macros.h:151
#define LVarE
Definition macros.h:162
#define LVar0
Definition macros.h:148
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:370
#define Return
Kills the current EVT thread.
Definition macros.h:217
#define ACTOR_BY_POS(_name, _pos, _priority, args...)
Definition battle.h:230
FormationRow Formation[]
Definition battle.h:167