Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
sushie.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"
9#include "sprite/npc/BattleSushie.h"
10
11#define NAMESPACE battle_partner_sushie
12
13extern EvtScript N(EVS_HandleEvent);
14extern EvtScript N(EVS_Idle);
15extern EvtScript N(EVS_HandlePhase);
16extern EvtScript N(EVS_TakeTurn);
17extern EvtScript N(EVS_Init);
18extern EvtScript N(EVS_ExecuteAction);
19extern EvtScript N(EVS_Celebrate);
20extern EvtScript N(EVS_RunAway);
22extern EvtScript N(EVS_Move_BellyFlop);
23extern EvtScript N(EVS_Move_Squirt);
24extern EvtScript N(EVS_Move_WaterBlock);
25extern EvtScript N(EVS_Move_TidalWave);
26
27static EffectInstance* sEffect;
28
29enum N(ActorPartIDs) {
30 PRT_MAIN = 1,
31};
32
33API_CALLABLE(N(SetSquirtAngle)) {
34 ActorPart* targetPart;
36
37 set_goal_pos_to_part(&partner->state, partner->targetActorID, partner->targetPartID);
38 targetPart = get_actor_part(get_actor(partner->targetActorID), partner->targetPartID);
39
40 partner->state.goalPos.x += targetPart->projectileTargetOffset.x;
41 partner->state.goalPos.y += targetPart->projectileTargetOffset.y;
42 partner->state.goalPos.z = partner->state.goalPos.z; // required to match
43
44 partner->state.curPos.x = partner->curPos.x + 8.0f;
45 partner->state.curPos.y = partner->curPos.y + 16.0f;
46 partner->state.curPos.z = partner->curPos.z;
47
48 partner->state.angle = atan2(
49 partner->state.curPos.x, partner->state.curPos.y,
50 partner->state.goalPos.x, partner->state.goalPos.y
51 );
52
53 partner->rot.z = (partner->state.angle - 90.0f) * 0.25f;
54
55 if (partner->rot.z < 0.0f) {
56 partner->rot.z = 0.0f;
57 }
58
59 return ApiStatus_DONE2;
60}
61
62API_CALLABLE(N(GetSquirtDamage)) {
64 s32 actionCmdResult = script->varTable[0];
65 s32 damage = 0;
66
67 script->varTable[0] = 0;
68
69 switch (partner->actorBlueprint->level) {
71 if (actionCmdResult <= 40) {
72 damage = 3;
73 } else if (actionCmdResult <= 75) {
74 damage = 4;
75 } else {
76 damage = 5;
77 script->varTable[0] = 1;
78 }
79 break;
81 if (actionCmdResult <= 35) {
82 damage = 3;
83 } else if (actionCmdResult <= 60) {
84 damage = 4;
85 } else if (actionCmdResult <= 80) {
86 damage = 5;
87 } else {
88 damage = 6;
89 script->varTable[0] = 1;
90 }
91 break;
93 if (actionCmdResult <= 20) {
94 damage = 3;
95 } else if (actionCmdResult <= 30) {
96 damage = 4;
97 } else if (actionCmdResult <= 60) {
98 damage = 5;
99 } else if (actionCmdResult <= 80) {
100 damage = 6;
101 } else {
102 damage = 7;
103 script->varTable[0] = 1;
104 }
105 break;
106 }
107
108 script->varTable[15] = damage;
109 return ApiStatus_DONE2;
110}
111
112API_CALLABLE(N(InflateSushie)) {
113 BattleStatus* battleStatus = &gBattleStatus;
114 Actor* partnerActor = battleStatus->partnerActor;
115 f32 xScale;
116 f32 yScale;
117 f32 zScale;
118
119 if (isInitialCall) {
120 script->functionTemp[0] = 0;
121 script->functionTemp[1] = 6;
122 }
123
124 xScale = partnerActor->scale.x;
125 yScale = partnerActor->scale.y;
126 zScale = partnerActor->scale.z;
127 partnerActor->scale.x = xScale + ((1.0 - xScale) / 3.0);
128 partnerActor->scale.y = yScale + ((1.0 - yScale) / 3.0);
129 partnerActor->scale.z = zScale + ((1.0 - zScale) / 3.0);
130
131 if (script->functionTemp[1] != 0) {
132 script->functionTemp[1]--;
133 return ApiStatus_BLOCK;
134 }
135
136 partnerActor->scale.x = 1.0f;
137 partnerActor->scale.y = 1.0f;
138 partnerActor->scale.z = 1.0f;
139 return ApiStatus_DONE2;
140}
141
142API_CALLABLE(N(GetSquirtTargetPos)) {
143 f32 posX = script->varTable[0];
144 f32 posY = script->varTable[1];
145
146 add_vec2D_polar(&posX, &posY, 300.0f, atan2(posX, posY, script->varTable[3], script->varTable[4]));
147
148 script->varTable[3] = posX;
149 script->varTable[4] = posY;
150
151 return ApiStatus_DONE2;
152}
153
154API_CALLABLE(N(ApplyWaterBlock)) {
155 BattleStatus* battleStatus = &gBattleStatus;
156 s32 var = script->varTable[0];
157
158 if (var > 0) {
159 script->varTable[0] = 1;
160 } else {
161 script->varTable[0] = 0;
162 }
163
164 script->varTable[15] = 0;
165 script->varTable[10] = var;
166 if (battleStatus->waterBlockTurnsLeft < var) {
167 battleStatus->waterBlockTurnsLeft = var;
168 battleStatus->waterBlockAmount = 1;
170 }
171
172 return ApiStatus_DONE2;
173}
174
175API_CALLABLE(N(PlaySquirtFX)) {
176 BattleStatus* battleStatus = &gBattleStatus;
177 Actor* partnerActor = battleStatus->partnerActor;
178 Actor* playerActor = battleStatus->playerActor;
179
180 sEffect = fx_squirt(1, partnerActor->curPos.x - 5.5, partnerActor->curPos.y + 15.5, partnerActor->curPos.z + 5, playerActor->curPos.x, playerActor->curPos.y, playerActor->curPos.z, (rand_int(10) * 0.1) + 1, 30);
181
182 return ApiStatus_DONE2;
183}
184
185API_CALLABLE(N(PlayWaterBlockFX)) {
186 BattleStatus* battleStatus = &gBattleStatus;
187 Bytecode* args = script->ptrReadPos;
188 f32 posX = evt_get_float_variable(script, *args++);
189 f32 posY = evt_get_float_variable(script, *args++);
190 f32 posZ = evt_get_float_variable(script, *args++);
191 EffectInstance* effect = battleStatus->waterBlockEffect;
192
193 if (effect != NULL) {
194 remove_effect(effect);
195 }
196
197 battleStatus->waterBlockEffect = fx_water_block(FX_WATER_BLOCK_CREATE, posX, posY, posZ, 1.5f, 0);
198
199 return ApiStatus_DONE2;
200}
201
202API_CALLABLE(N(ProcessTidalWave)) {
204 ActorState* state = &partner->state;
205 f32 x, y;
206
207 if (isInitialCall) {
208 script->functionTemp[0] = 0;
209 }
210
211 switch (script->functionTemp[0]) {
212 case 0:
213 state->curPos.x = partner->curPos.x;
214 state->curPos.y = partner->curPos.y;
215 state->curPos.z = partner->curPos.z;
216 state->angle = 315.0f;
217 state->bounceDivisor = 0.0f;
218 state->moveTime = 90;
219 state->speed = 32.0f;
220 script->functionTemp[1] = 0;
221 script->functionTemp[2] = 0;
222 sEffect = fx_water_fountain(1, state->curPos.x, state->curPos.y, state->curPos.z, 1.0f, 0);
223 sEffect->data.waterFountain->unk_38 = state->angle;
224 sEffect->data.waterFountain->unk_3C = partner->scale.x;
225 sEffect->data.waterFountain->unk_40 = partner->scale.x;
226 script->functionTemp[0] = 1;
227 break;
228 case 1:
229 add_vec2D_polar(&state->curPos.x, &state->curPos.y, state->speed, state->angle);
230 if (state->curPos.x < -160.0f) {
231 if (script->functionTemp[1] != 0) {
232 script->functionTemp[0] = 2;
233 break;
234 }
235 if (state->angle >= 270.0f && state->angle < 360.0f) {
236 state->angle = 90.0f + (90.0f - clamp_angle(state->angle + 180.0f));
237 state->bounceDivisor = rand_int(4) - 2;
238 }
239 if (state->angle >= 180.0f && state->angle < 270.0f) {
240 state->angle = 90.0f - (clamp_angle(state->angle + 180.0f) - 90.0f);
241 state->bounceDivisor = rand_int(4) - 2;
242 }
243 }
244
245 if (state->curPos.x > 160.0f) {
246 if (script->functionTemp[1] != 0) {
247 script->functionTemp[0] = 2;
248 break;
249 }
250
251 do {
252 if (state->angle >= 0.0f && state->angle < 90.0f) {
253 state->angle = 270.0f + (270.0f - clamp_angle(state->angle + 180.0f));
254 state->bounceDivisor = rand_int(4) - 2;
255 } else if (state->angle >= 90.0f && state->angle < 180.0f) {
256 state->angle = 270.0f - (clamp_angle(state->angle + 180.0f) - 270.0f);
257 state->bounceDivisor = rand_int(4) - 2;
258 }
259 } while (0); // TODO macro?
260
261 if (script->functionTemp[2] != 0) {
263 } else {
265 }
266 script->functionTemp[2] = 1 - script->functionTemp[2];
267 }
268
269 if (state->curPos.y < 0.0f) {
270 if (script->functionTemp[1] != 0) {
271 script->functionTemp[0] = 2;
272 break;
273 }
274
275 do {
276 if (state->angle >= 270.0f && state->angle < 360.0f) {
277 state->angle = 180.0f + (180.0f - clamp_angle(state->angle + 180.0f));
278 state->bounceDivisor = rand_int(4) - 2;
279 } else if (state->angle >= 0.0f && state->angle < 90.0f) {
280 state->angle = 180.0f - (clamp_angle(state->angle + 180.0f) - 180.0f);
281 state->bounceDivisor = rand_int(4) - 2;
282 }
283 } while (0); // TODO macro?
284
285 if (script->functionTemp[2] != 0) {
287 } else {
289 }
290 script->functionTemp[2] = 1 - script->functionTemp[2];
291 }
292
293 if (state->curPos.y > 130.0f) {
294 if (script->functionTemp[1] != 0) {
295 script->functionTemp[0] = 2;
296 break;
297 }
298
299 do {
300 if (state->angle >= 90.0f && state->angle < 180.0f) {
301 state->angle = 360.0f + (360.0f - clamp_angle(state->angle + 180.0f));
302 state->bounceDivisor = rand_int(4) - 2;
303 } else if (state->angle >= 180.0f && state->angle < 270.0f) {
304 state->angle = 360.0f - (clamp_angle(state->angle + 180.0f) - 360.0f);
305 state->bounceDivisor = rand_int(4) - 2;
306 }
307 } while (0); // TODO macro?
308
309 if (script->functionTemp[2] != 0) {
311 } else {
313 }
314 script->functionTemp[2] = 1 - script->functionTemp[2];
315 }
316
317 state->angle = clamp_angle(state->angle + (state->bounceDivisor * 0.5));
318 partner->rot.z = clamp_angle(state->angle - 315.0f);
319 partner->scale.z = partner->scale.y = partner->scale.x = partner->scale.x - 0.06;
320 if (partner->scale.x < 1.0) {
321 partner->scale.x = 1.0f;
322 partner->scale.y = 1.0f;
323 partner->scale.z = 1.0f;
324 }
325 x = 0.0f;
326 y = 0.0f;
327 add_vec2D_polar(&x, &y, partner->scale.x * -15.0f, state->angle);
328 sEffect->data.waterFountain->pos.x = state->curPos.x + x;
329 sEffect->data.waterFountain->pos.y = state->curPos.y + y;
330 sEffect->data.waterFountain->pos.z = state->curPos.z + 5.0f;
331 sEffect->data.waterFountain->unk_38 = state->angle;
332 sEffect->data.waterFountain->unk_3C = partner->scale.x;
333 sEffect->data.waterFountain->unk_40 = partner->scale.x;
334 if (state->moveTime == 70) {
336 fx_underwater(0, -50.0f, 20.0f, 0.0f, 1.0f, 120);
337 }
338
339 if (state->moveTime != 0) {
340 state->moveTime--;
341 } else {
342 script->functionTemp[1] = 1;
343 }
344 break;
345 }
346
347 switch (script->functionTemp[0]) {
348 case 2:
349 state->moveTime = 5;
350 script->functionTemp[0] = 3;
351 case 3:
352 add_vec2D_polar(&state->curPos.x, &state->curPos.y, state->speed, state->angle);
353 sEffect->data.waterFountain->pos.x = state->curPos.x;
354 sEffect->data.waterFountain->pos.y = state->curPos.y;
355 sEffect->data.waterFountain->pos.z = state->curPos.z;
356 sEffect->data.waterFountain->unk_38 = state->angle;
357 sEffect->data.waterFountain->unk_3C = partner->scale.x;
358 sEffect->data.waterFountain->unk_40 = partner->scale.x;
359 if (state->moveTime == 0) {
360 partner->rot.z = 0.0f;
362 return ApiStatus_DONE2;
363 }
364 state->moveTime--;
365 default:
366 partner->curPos.x = state->curPos.x;
367 partner->curPos.y = state->curPos.y;
368 partner->curPos.z = state->curPos.z;
369 fx_water_splash(3, partner->curPos.x, partner->curPos.y, partner->curPos.z, 1.0f, 10);
370 break;
371 }
372 return ApiStatus_BLOCK;
373}
374
375API_CALLABLE(N(SetScaleTidalWaveCharge)) {
376 BattleStatus* battleStatus = &gBattleStatus;
377 Actor* partnerActor = battleStatus->partnerActor;
378 f32 var = script->varTable[0] * 3.0 / 100.0 + 1.0;
379 f32 xScale = partnerActor->scale.x;
380 f32 yScale = partnerActor->scale.y;
381 f32 zScale = partnerActor->scale.z;
382
383 partnerActor->scale.x = xScale + ((var - xScale) / 3);
384 partnerActor->scale.y = yScale + ((var - yScale) / 3);
385 partnerActor->scale.z = zScale + ((var - zScale) / 3);
386
387 return ApiStatus_DONE2;
388}
389
390s32 N(DefaultAnims)[] = {
391 STATUS_KEY_NORMAL, ANIM_BattleSushie_Walk,
392 STATUS_KEY_STONE, ANIM_BattleSushie_Still,
393 STATUS_KEY_SLEEP, ANIM_BattleSushie_Pray,
394 STATUS_KEY_POISON, ANIM_BattleSushie_Still,
395 STATUS_KEY_STOP, ANIM_BattleSushie_Still,
396 STATUS_KEY_DAZE, ANIM_BattleSushie_Injured,
397 STATUS_KEY_INACTIVE, ANIM_BattleSushie_Still,
399};
400
401s32 N(DefenseTable)[] = {
404};
405
406s32 N(StatusTable)[] = {
409 STATUS_KEY_SLEEP, 100,
412 STATUS_KEY_DIZZY, 100,
413 STATUS_KEY_FEAR, 100,
417 STATUS_KEY_STOP, 100,
429};
430
431ActorPartBlueprint N(ActorParts)[] = {
432 {
433 .flags = 0,
434 .index = PRT_MAIN,
435 .posOffset = { 0, 0, 0 },
436 .targetOffset = { 12, 17 },
437 .opacity = 255,
438 .idleAnimations = N(DefaultAnims),
439 .defenseTable = N(DefenseTable),
440 .eventFlags = 0,
441 .elementImmunityFlags = 0,
442 .projectileTargetOffset = { 0, 0 },
443 },
444};
445
446ActorBlueprint NAMESPACE = {
447 .flags = 0,
448 .type = ACTOR_TYPE_SUSHIE,
449 .level = ACTOR_LEVEL_SUSHIE,
450 .maxHP = 99,
451 .partCount = ARRAY_COUNT(N(ActorParts)),
452 .partsData = N(ActorParts),
453 .initScript = &N(EVS_Init),
454 .statusTable = N(StatusTable),
455 .escapeChance = 0,
456 .airLiftChance = 0,
457 .hurricaneChance = 0,
458 .spookChance = 0,
459 .upAndAwayChance = 0,
460 .spinSmashReq = 4,
461 .powerBounceChance = 80,
462 .coinReward = 0,
463 .size = { 37, 26 },
464 .healthBarOffset = { 0, 0 },
465 .statusIconOffset = { -10, 20 },
466 .statusTextOffset = { 10, 20 },
467};
468
469EvtScript N(EVS_Init) = {
470 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
471 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
472 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
473 Call(BindHandlePhase, ACTOR_SELF, Ref(N(EVS_HandlePhase)))
474 Return
475 End
476};
477
478EvtScript N(EVS_Idle) = {
479 Return
480 End
481};
482
483EvtScript N(EVS_HandleEvent) = {
484 Call(UseIdleAnimation, ACTOR_PARTNER, FALSE)
485 Call(CloseActionCommandInfo)
486 Call(GetLastEvent, ACTOR_PARTNER, LVar0)
490 SetConst(LVar1, ANIM_BattleSushie_Hurt)
491 SetConst(LVar2, ANIM_BattleSushie_Hurt)
493 SetConst(LVar1, ANIM_BattleSushie_Hurt)
498 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_NO_DAMGE)
499 SetConst(LVar0, PRT_MAIN)
500 SetConst(LVar1, ANIM_BattleSushie_Hurt)
504 SetConst(LVar1, ANIM_BattleSushie_Hurt)
505 Set(LVar2, 20)
507 SetConst(LVar1, ANIM_BattleSushie_Hurt)
510 SetConst(LVar1, ANIM_BattleSushie_BurnHurt)
511 Set(LVar2, 20)
512 SetConst(LVar3, ANIM_BattleSushie_BurnStill)
514 SetConst(LVar1, ANIM_BattleSushie_Hurt)
517 SetConst(LVar1, ANIM_BattleSushie_BurnHurt)
518 SetConst(LVar2, ANIM_BattleSushie_BurnStill)
520 SetConst(LVar1, ANIM_BattleSushie_Hurt)
523 SetConst(LVar1, ANIM_BattleSushie_Hurt)
524 Set(LVar2, 20)
527 SetConst(LVar1, ANIM_BattleSushie_Hurt)
530 SetConst(LVar0, PRT_MAIN)
531 SetConst(LVar1, ANIM_BattleSushie_Idle)
532 SetConst(LVar2, ANIM_BattleSushie_Run)
533 Set(LVar3, 0)
537 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_NO_DAMGE)
538 SetConst(LVar0, PRT_MAIN)
539 SetConst(LVar1, ANIM_BattleSushie_Block)
541 Wait(10)
545 Call(UseIdleAnimation, ACTOR_PARTNER, TRUE)
546 Return
547 End
548};
549
550EvtScript N(EVS_TakeTurn) = {
551 Call(GetBattlePhase, LVar0)
554 ExecWait(N(EVS_ExecuteAction))
556 ExecWait(N(EVS_Celebrate))
558 ExecWait(N(EVS_RunAway))
562 Return
563 End
564};
565
566EvtScript N(EVS_Celebrate) = {
567 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Celebrate)
568 Wait(36)
569 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
570 Return
571 End
572};
573
574EvtScript N(EVS_RunAway) = {
575 SetConst(LVar0, PRT_MAIN)
576 SetConst(LVar1, ANIM_BattleSushie_Run)
578 Return
579 End
580};
581
583 Call(UseIdleAnimation, ACTOR_PARTNER, FALSE)
584 Call(SetGoalToHome, ACTOR_PARTNER)
585 Call(SetActorSpeed, ACTOR_PARTNER, Float(6.0))
586 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Run)
587 Call(SetActorYaw, ACTOR_PARTNER, 0)
588 Call(RunToGoal, ACTOR_PARTNER, 0)
589 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
590 Call(UseIdleAnimation, ACTOR_PARTNER, TRUE)
591 Return
592 End
593};
594
595EvtScript N(EVS_HandlePhase) = {
596 Return
597 End
598};
599
600EvtScript N(EVS_ExecuteAction) = {
601 Call(ShowActionHud, TRUE)
602 Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
603 Call(GetMenuSelection, LVar0, LVar1, LVar2)
606 Call(LoadStarPowerScript)
608 Return
610 Call(GetMenuSelection, LVar0, LVar1, LVar2)
612 CaseEq(MOVE_BELLY_FLOP1)
613 ExecWait(N(EVS_Move_BellyFlop))
614 CaseEq(MOVE_BELLY_FLOP2)
615 ExecWait(N(EVS_Move_BellyFlop))
616 CaseEq(MOVE_BELLY_FLOP3)
617 ExecWait(N(EVS_Move_BellyFlop))
618 CaseEq(MOVE_SQUIRT)
619 ExecWait(N(EVS_Move_Squirt))
620 CaseEq(MOVE_WATER_BLOCK)
621 ExecWait(N(EVS_Move_WaterBlock))
622 CaseEq(MOVE_TIDAL_WAVE)
623 ExecWait(N(EVS_Move_TidalWave))
625 Return
626 End
627};
628
629EvtScript N(EVS_ReturnHome_BellyFlop_Success) = {
630 Call(PartnerYieldTurn)
631 Call(UseBattleCamPreset, BTL_CAM_RETURN_HOME)
632 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Fall)
633 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
634 Sub(LVar0, 60)
635 Set(LVar1, 0)
636 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.4))
637 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
638 Call(JumpToGoal, ACTOR_PARTNER, 20, FALSE, TRUE, FALSE)
639 Sub(LVar0, 30)
640 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
641 Call(JumpToGoal, ACTOR_PARTNER, 8, FALSE, TRUE, FALSE)
642 Sub(LVar0, 20)
643 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
644 Call(JumpToGoal, ACTOR_PARTNER, 6, FALSE, TRUE, FALSE)
645 Sub(LVar0, 10)
646 Call(JumpToGoal, ACTOR_PARTNER, 4, FALSE, TRUE, FALSE)
647 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
648 Wait(15)
649 Call(SetGoalToHome, ACTOR_PARTNER)
650 Call(SetActorSpeed, ACTOR_PARTNER, Float(6.0))
651 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Run)
652 Call(RunToGoal, ACTOR_PARTNER, 0)
653 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
654 Return
655 End
656};
657
658EvtScript N(EVS_ReturnHome_BellyFlop_Miss) = {
659 Call(PartnerYieldTurn)
660 Call(UseBattleCamPreset, BTL_CAM_PARTNER_MISTAKE)
661 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Fall)
662 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
663 Sub(LVar0, 15)
664 Set(LVar1, 0)
665 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(0.4))
666 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
667 Call(JumpToGoal, ACTOR_PARTNER, 8, FALSE, TRUE, FALSE)
668 Sub(LVar0, 5)
669 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
670 Call(JumpToGoal, ACTOR_PARTNER, 4, FALSE, TRUE, FALSE)
671 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
672 Wait(15)
673 Call(SetGoalToHome, ACTOR_PARTNER)
674 Call(SetActorSpeed, ACTOR_PARTNER, Float(6.0))
675 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Run)
676 Call(RunToGoal, ACTOR_PARTNER, 0)
677 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
678 Return
679 End
680};
681
682EvtScript N(EVS_ReturnHome_Squirt_Success) = {
683 Call(PartnerYieldTurn)
684 Call(UseBattleCamPreset, BTL_CAM_RETURN_HOME)
685 Call(SetGoalToHome, ACTOR_PARTNER)
686 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Run)
687 Call(FlyToGoal, ACTOR_PARTNER, 30, 0, EASING_COS_IN_OUT)
688 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
689 Return
690 End
691};
692
693EvtScript N(EVS_ReturnHome_Squirt_Miss) = {
694 Call(PartnerYieldTurn)
695 Call(UseBattleCamPreset, BTL_CAM_PARTNER_MISTAKE)
696 Call(SetGoalToHome, ACTOR_PARTNER)
697 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Run)
698 Call(FlyToGoal, ACTOR_PARTNER, 30, 0, EASING_COS_IN_OUT)
699 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
700 Return
701 End
702};
703
704EvtScript N(runToTarget) = {
705 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
706 Add(LVar0, 40)
707 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
708 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
709 Call(SetActorSpeed, ACTOR_PARTNER, Float(4.0))
710 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Run)
711 Call(RunToGoal, ACTOR_PARTNER, 0)
712 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
713 Return
714 End
715};
716
717EvtScript N(getJumpTime) = {
718 Call(SetGoalToTarget, ACTOR_PARTNER)
719 Call(GetGoalPos, ACTOR_PARTNER, LVarB, LVarC, LVarD)
720 Call(GetActorPos, ACTOR_PARTNER, LVarC, LVarD, LVarE)
722 Sub(LVarB, LVarC)
723 Else
724 Sub(LVarC, LVarB)
725 Set(LVarB, LVarC)
726 EndIf
727 Sub(LVarB, 20)
728 DivF(LVarB, Float(10.588))
729 AddF(LVarB, 15)
730 Set(LVarA, LVarB)
731 Return
732 End
733};
734
735EvtScript N(EVS_Move_BellyFlop) = {
736 Call(LoadActionCommand, ACTION_COMMAND_SMASH)
737 Call(action_command_hammer_init)
738 ExecWait(N(runToTarget))
739 ExecWait(N(getJumpTime))
740 Loop(30)
741 Wait(1)
742 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
743 IfNe(LVar0, 0)
745 EndIf
746 EndLoop
747 Call(action_command_hammer_start, 0, 57, 3)
748 Call(SetActionQuality, 0)
749 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Tense1)
750 Call(UseBattleCamPreset, BTL_CAM_PARTNER_CLOSE_UP)
751 Set(LVar0, 30)
752 Loop(60)
753 Wait(1)
754 Sub(LVar0, 1)
755 IfEq(LVar0, 0)
756 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Tense2)
757 EndIf
758 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
759 IfEq(LVar0, 0)
761 EndIf
762 EndLoop
763 Thread
764 Call(GetPartnerActionSuccess, LVar0)
765 Call(UseBattleCamPreset, BTL_CAM_PARTNER_MIDAIR)
766 Call(MoveBattleCamOver, 20)
768 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Jump)
769 Thread
770 Call(SetActorRotationOffset, ACTOR_PARTNER, 0, 12, 0)
771 Set(LVar0, 0)
772 Loop(10)
773 Add(LVar0, 36)
774 Call(SetActorRotation, ACTOR_PARTNER, 0, 0, LVar0)
775 Wait(1)
776 EndLoop
777 Call(SetActorRotation, ACTOR_PARTNER, 0, 0, 20)
779 Thread
780 Call(GetPartnerActionSuccess, LVar0)
781 IfGt(LVar0, 0)
782 Call(GetMenuSelection, LVar0, LVar1, LVar2)
784 CaseEq(MOVE_BELLY_FLOP1)
785 Wait(13)
786 Call(SetActorScale, ACTOR_PARTNER, Float(1.1), Float(1.1), Float(1.0))
787 Wait(1)
788 Call(SetActorScale, ACTOR_PARTNER, Float(1.1), Float(1.1), Float(1.0))
789 Wait(1)
790 Call(SetActorScale, ACTOR_PARTNER, Float(1.2), Float(1.2), Float(1.0))
791 Wait(1)
792 Call(SetActorScale, ACTOR_PARTNER, Float(1.2), Float(1.2), Float(1.0))
793 Wait(1)
794 Call(SetActorScale, ACTOR_PARTNER, Float(1.3), Float(1.3), Float(1.0))
795 CaseEq(MOVE_BELLY_FLOP2)
796 Wait(13)
797 Call(SetActorScale, ACTOR_PARTNER, Float(1.15), Float(1.15), Float(1.0))
798 Wait(1)
799 Call(SetActorScale, ACTOR_PARTNER, Float(1.2), Float(1.2), Float(1.0))
800 Wait(1)
801 Call(SetActorScale, ACTOR_PARTNER, Float(1.35), Float(1.35), Float(1.0))
802 Wait(1)
803 Call(SetActorScale, ACTOR_PARTNER, Float(1.4), Float(1.4), Float(1.0))
804 Wait(1)
805 Call(SetActorScale, ACTOR_PARTNER, Float(1.55), Float(1.55), Float(1.0))
806 CaseEq(MOVE_BELLY_FLOP3)
807 Wait(13)
808 Call(SetActorScale, ACTOR_PARTNER, Float(1.2), Float(1.2), Float(1.0))
809 Wait(1)
810 Call(SetActorScale, ACTOR_PARTNER, Float(1.3), Float(1.3), Float(1.0))
811 Wait(1)
812 Call(SetActorScale, ACTOR_PARTNER, Float(1.5), Float(1.5), Float(1.0))
813 Wait(1)
814 Call(SetActorScale, ACTOR_PARTNER, Float(1.6), Float(1.6), Float(1.0))
815 Wait(1)
816 Call(SetActorScale, ACTOR_PARTNER, Float(1.8), Float(1.8), Float(1.0))
818 Else
819 Call(GetMenuSelection, LVar0, LVar1, LVar2)
821 CaseEq(MOVE_BELLY_FLOP1)
822 Wait(13)
823 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
824 Wait(1)
825 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
826 Wait(1)
827 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
828 Wait(1)
829 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
830 Wait(1)
831 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
832 CaseEq(MOVE_BELLY_FLOP2)
833 Wait(13)
834 Call(SetActorScale, ACTOR_PARTNER, Float(1.05), Float(1.05), Float(1.0))
835 Wait(1)
836 Call(SetActorScale, ACTOR_PARTNER, Float(1.1), Float(1.1), Float(1.0))
837 Wait(1)
838 Call(SetActorScale, ACTOR_PARTNER, Float(1.15), Float(1.15), Float(1.0))
839 Wait(1)
840 Call(SetActorScale, ACTOR_PARTNER, Float(1.2), Float(1.2), Float(1.0))
841 Wait(1)
842 Call(SetActorScale, ACTOR_PARTNER, Float(1.25), Float(1.25), Float(1.0))
843 CaseEq(MOVE_BELLY_FLOP3)
844 Wait(13)
845 Call(SetActorScale, ACTOR_PARTNER, Float(1.1), Float(1.1), Float(1.0))
846 Wait(1)
847 Call(SetActorScale, ACTOR_PARTNER, Float(1.2), Float(1.2), Float(1.0))
848 Wait(1)
849 Call(SetActorScale, ACTOR_PARTNER, Float(1.3), Float(1.3), Float(1.0))
850 Wait(1)
851 Call(SetActorScale, ACTOR_PARTNER, Float(1.4), Float(1.4), Float(1.0))
852 Wait(1)
853 Call(SetActorScale, ACTOR_PARTNER, Float(1.5), Float(1.5), Float(1.0))
855 EndIf
857 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_SUSHIE_BELLY_FLOP)
858 Call(SetGoalToTarget, ACTOR_PARTNER)
859 Call(GetPartnerActionSuccess, LVar0)
860 IfGt(LVar0, 0)
861 Thread
862 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Jump)
863 Wait(10)
864 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Fall)
866 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.6))
867 Call(JumpToGoal, ACTOR_PARTNER, 20, FALSE, TRUE, FALSE)
868 Else
869 Thread
870 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Jump)
871 Wait(10)
872 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Fall)
874 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
875 Call(JumpToGoal, ACTOR_PARTNER, 20, FALSE, TRUE, FALSE)
876 EndIf
877 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Land)
878 Call(SetActorRotation, ACTOR_PARTNER, 0, 0, 0)
879 Call(SetActorRotationOffset, ACTOR_PARTNER, 0, 0, 0)
880 Call(GetMenuSelection, LVar0, LVar1, LVar2)
882 CaseEq(MOVE_BELLY_FLOP1)
883 Set(LVarE, 1)
884 Set(LVarF, 3)
885 CaseEq(MOVE_BELLY_FLOP2)
886 Set(LVarE, 2)
887 Set(LVarF, 4)
888 CaseEq(MOVE_BELLY_FLOP3)
889 Set(LVarE, 3)
890 Set(LVarF, 5)
894 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
895 Call(LandJump, ACTOR_PARTNER)
896 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
897 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
898 Call(AddGoalPos, ACTOR_PARTNER, 15, 0, 0)
899 Call(JumpToGoal, ACTOR_PARTNER, 20, FALSE, TRUE, FALSE)
900 Call(AddGoalPos, ACTOR_PARTNER, 10, 0, 0)
901 Call(JumpToGoal, ACTOR_PARTNER, 10, FALSE, TRUE, FALSE)
902 Wait(10)
903 Call(SetGoalToHome, ACTOR_PARTNER)
904 Call(SetActorSpeed, ACTOR_PARTNER, Float(6.0))
905 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Run)
906 Call(RunToGoal, ACTOR_PARTNER, 0)
907 Return
908 EndIf
909 Thread
910 Wait(3)
911 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
913 Call(GetPartnerActionSuccess, LVar0)
915 CaseGt(0)
923 Call(UseBattleCamPreset, BTL_CAM_PARTNER_MISTAKE)
924 ExecWait(N(EVS_ReturnHome_BellyFlop_Miss))
928 Call(UseBattleCamPreset, BTL_CAM_VIEW_ENEMIES)
929 Call(MoveBattleCamOver, 8)
930 ExecWait(N(EVS_ReturnHome_BellyFlop_Success))
933 Return
934 End
935};
936
937EvtScript N(EVS_Move_Squirt) = {
938 Call(LoadActionCommand, ACTION_COMMAND_SQUIRT)
939 Call(action_command_squirt_init)
940 Call(GetActorLevel, ACTOR_PARTNER, LVar0)
942 CaseEq(0)
943 Call(SetupMashMeter, 3, 40, 75, 100, 0, 0)
944 CaseEq(1)
945 Call(SetupMashMeter, 4, 35, 60, 80, 100, 0)
946 CaseEq(2)
947 Call(SetupMashMeter, 5, 20, 40, 60, 80, 100)
949 Call(UseBattleCamPreset, BTL_CAM_ACTOR_CLOSE)
950 Call(BattleCamTargetActor, ACTOR_SELF)
951 Call(MoveBattleCamOver, 40)
952 Call(InitTargetIterator)
953 Thread
954 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Jump)
955 Wait(5)
956 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Fall)
958 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
959 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
960 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
961 Call(JumpToGoal, ACTOR_PARTNER, 10, FALSE, TRUE, FALSE)
962 Call(N(SetSquirtAngle))
963 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Inhale)
964 Call(AddBattleCamDist, -80)
965 Call(MoveBattleCamOver, 90 * DT)
966 Call(action_command_squirt_start, 0, 87 * DT, 3)
967 Loop(90 * DT)
968 Call(GetActionQuality, LVar0)
969 IfEq(LVar0, 0)
970 Call(GetActorScale, ACTOR_SELF, LVar0, LVar1, LVar2)
972 SubF(LVar1, Float(1.0))
973 DivF(LVar1, 4)
975 Else
977 DivF(LVar0, 100)
978 SetF(LVar1, Float(1.0))
980 EndIf
981 Call(SetActorScale, ACTOR_SELF, LVar0, LVar0, Float(1.0))
983 Wait(1)
984 EndLoop
985 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_SUSHIE_SQUIRT)
986 Call(UseBattleCamPreset, BTL_CAM_VIEW_ENEMIES)
987 Call(MoveBattleCamOver, 10)
990 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Squirt)
991 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
992 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
993 Add(LVar0, 10)
994 Add(LVar1, 11)
995 Call(GetGoalPos, ACTOR_PARTNER, LVar3, LVar4, LVar5)
996 Call(N(GetSquirtTargetPos))
997 PlayEffect(EFFECT_SQUIRT, 0, LVar0, LVar1, LVar2, LVar3, LVar4, LVar5, LVarE, 10, 0)
998 Wait(20)
999 ExecWait(N(EVS_ReturnHome_Squirt_Miss))
1000 Return
1001 EndIf
1002 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Squirt)
1003 Thread
1004 Call(N(InflateSushie))
1005 EndThread
1006 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
1007 Add(LVar0, 10)
1008 Add(LVar1, 11)
1009 Call(GetGoalPos, ACTOR_PARTNER, LVar3, LVar4, LVar5)
1010 PlayEffect(EFFECT_SQUIRT, 0, LVar0, LVar1, LVar2, LVar3, LVar4, LVar5, LVarE, 10, 0)
1011 Wait(10)
1012 Call(GetActionQuality, LVar0)
1013 Call(N(GetSquirtDamage))
1014 Switch(LVar0)
1015 CaseGt(0)
1017 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_HIT_RATTLE)
1020 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_HIT_RATTLE)
1021 EndSwitch
1022 Switch(LVar0)
1025 ExecWait(N(EVS_ReturnHome_Squirt_Miss))
1029 ExecWait(N(EVS_ReturnHome_Squirt_Success))
1031 EndSwitch
1032 Return
1033 End
1034};
1035
1036EvtScript N(EVS_Move_WaterBlock) = {
1037 Call(UseIdleAnimation, ACTOR_PARTNER, FALSE)
1038 Call(InitTargetIterator)
1039 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
1040 Call(SetBattleCamTarget, -95, 26, 10)
1041 Call(SetBattleCamOffsetY, 11)
1042 Call(SetBattleCamDist, 238)
1043 Call(MoveBattleCamOver, 30)
1044 Wait(10)
1045 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Inhale)
1046 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
1047 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
1048 Add(LVar0, 30)
1049 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
1050 Call(JumpToGoal, ACTOR_PARTNER, 10, FALSE, TRUE, FALSE)
1051 Call(LoadActionCommand, ACTION_COMMAND_WATER_BLOCK)
1052 Call(action_command_water_block_init, 0)
1053 Call(SetActionHudPrepareTime, 0)
1054 Set(LVar0, 0)
1055 Loop(4)
1056 Add(LVar0, 45)
1057 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
1058 Wait(1)
1059 EndLoop
1060 Wait(4)
1061 Call(action_command_water_block_start, 0, 100, 3)
1062 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_HoldWater)
1063 Wait(110)
1064 Call(GetPartnerActionSuccess, LVar0)
1065 IfEq(LVar0, 0)
1066 Set(LVarA, LVar0)
1067 Goto(10)
1068 EndIf
1069 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_SpitArc)
1070 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
1071 Call(SetBattleCamTarget, -95, 27, 10)
1072 Call(SetBattleCamOffsetY, 11)
1073 Call(SetBattleCamDist, 277)
1074 Call(MoveBattleCamOver, 10)
1075 Thread
1076 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_SUSHIE_FOUNTAIN)
1077 Call(N(PlaySquirtFX))
1078 Wait(65)
1079 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Celebrate)
1080 EndThread
1081 Wait(45)
1082 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1083 Add(LVar1, 83)
1084 PlayEffect(EFFECT_WATERFALL, 0, LVar0, LVar1, LVar2, Float(1.0), 50, 0)
1085 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_CREATE_WATER_BLOCK)
1086 Thread
1087 Wait(20)
1088 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1089 Add(LVar1, 100)
1090 PlayEffect(EFFECT_SPARKLES, 4, LVar0, LVar1, LVar2, 50, 0)
1091 Wait(5)
1092 Sub(LVar1, 20)
1093 PlayEffect(EFFECT_SPARKLES, 4, LVar0, LVar1, LVar2, 50, 0)
1094 Wait(5)
1095 Sub(LVar1, 20)
1096 PlayEffect(EFFECT_SPARKLES, 4, LVar0, LVar1, LVar2, 50, 0)
1097 Wait(5)
1098 Sub(LVar1, 20)
1099 PlayEffect(EFFECT_SPARKLES, 4, LVar0, LVar1, LVar2, 50, 0)
1100 Wait(5)
1101 Sub(LVar1, 20)
1102 PlayEffect(EFFECT_SPARKLES, 4, LVar0, LVar1, LVar2, 50, 0)
1103 EndThread
1104 Wait(40)
1105 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1106 Call(N(PlayWaterBlockFX), LVar0, LVar1, LVar2)
1107 Wait(30)
1108 Call(GetPartnerActionSuccess, LVar0)
1109 Call(N(ApplyWaterBlock))
1110 Set(LVarA, LVar0)
1111 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
1112 Add(LVar0, 15)
1113 Add(LVar1, 35)
1114 Add(LVarF, 6)
1115 PlayEffect(EFFECT_STAT_CHANGE, LVarF, LVar0, LVar1, LVar2, Float(1.5), 60, 0)
1116 Wait(4)
1117 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1118 Call(MoveBattleCamOver, 20)
1119 Call(PartnerYieldTurn)
1120 Label(10)
1121 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
1122 Call(SetGoalToHome, ACTOR_PARTNER)
1123 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Run)
1124 Call(JumpToGoal, ACTOR_PARTNER, 10, FALSE, TRUE, FALSE)
1125 Set(LVar1, 180)
1126 Loop(4)
1127 Sub(LVar1, 45)
1128 Call(SetActorYaw, ACTOR_PARTNER, LVar1)
1129 EndLoop
1130 Call(SetActorYaw, ACTOR_PARTNER, 0)
1131 IfEq(LVarA, 0)
1132 Else
1133 Call(ShowVariableMessageBox, BTL_MSG_WATER_BLOCK_BEGIN, 60, LVarA)
1134 EndIf
1135 Call(WaitForMessageBoxDone)
1136 Return
1137 End
1138};
1139
1140EvtScript N(EVS_Move_TidalWave) = {
1141 Call(UseIdleAnimation, ACTOR_PARTNER, FALSE)
1142 Call(LoadActionCommand, ACTION_COMMAND_TIDAL_WAVE)
1143 Call(action_command_tidal_wave_init)
1144 Call(SetupMashMeter, 5, 20, 30, 60, 80, 100)
1145 Call(InitTargetIterator)
1146 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
1147 Call(SetBattleCamTarget, -65, 53, 10)
1148 Call(SetBattleCamOffsetY, 16)
1149 Call(SetBattleCamDist, 214)
1150 Call(MoveBattleCamOver, 20)
1151 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Run)
1152 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(0.5))
1153 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
1154 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
1155 Call(JumpToGoal, ACTOR_PARTNER, 5, FALSE, TRUE, FALSE)
1156 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
1157 Call(AddGoalPos, ACTOR_PARTNER, 30, 40, 0)
1158 Call(JumpToGoal, ACTOR_PARTNER, 15, FALSE, TRUE, FALSE)
1159 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
1160 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_HoldWater)
1161 Call(action_command_tidal_wave_start, 0, 100, 3)
1162 Call(SetActorRotationOffset, ACTOR_PARTNER, 0, 12, 0)
1163 Thread
1164 Wait(54)
1165 Loop(8)
1166 Call(SetActorDispOffset, ACTOR_PARTNER, 0, 0, 0)
1167 Wait(1)
1168 Call(SetActorDispOffset, ACTOR_PARTNER, -1, 0, 0)
1169 Wait(1)
1170 EndLoop
1171 Loop(7)
1172 Call(SetActorDispOffset, ACTOR_PARTNER, 1, 0, 0)
1173 Wait(1)
1174 Call(SetActorDispOffset, ACTOR_PARTNER, -1, 0, 0)
1175 Wait(1)
1176 EndLoop
1177 Loop(8)
1178 Call(SetActorDispOffset, ACTOR_PARTNER, 1, 0, 0)
1179 Wait(1)
1180 Call(SetActorDispOffset, ACTOR_PARTNER, -2, 0, 0)
1181 Wait(1)
1182 EndLoop
1183 Call(SetActorDispOffset, ACTOR_PARTNER, 0, 0, 0)
1184 EndThread
1185 Loop(100)
1186 Call(GetActionQuality, LVar0)
1187 Call(N(SetScaleTidalWaveCharge))
1188 Wait(1)
1189 EndLoop
1190 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1191 Call(MoveBattleCamOver, 5)
1192 Wait(10)
1193 Call(EnableActorBlur, ACTOR_PARTNER, ACTOR_BLUR_ENABLE)
1194 Call(N(ProcessTidalWave))
1195 Call(SetActorPos, ACTOR_PARTNER, -220, 0, 0)
1196 Call(EnableActorBlur, ACTOR_PARTNER, ACTOR_BLUR_DISABLE)
1197 Wait(15)
1198 Call(UseBattleCamPreset, BTL_CAM_VIEW_ENEMIES)
1199 Call(MoveBattleCamOver, 20)
1200 Call(GetActionSuccessCopy, LVar0)
1201 Set(LVarE, LVar0)
1202 Set(LVarF, LVar0)
1203 Call(InitTargetIterator)
1204 Loop(0)
1205 Call(SetGoalToTarget, ACTOR_SELF)
1208 Goto(10)
1209 EndIf
1210 Switch(LVarE)
1211 CaseGe(6)
1215 EndSwitch
1216 Wait(5)
1217 Label(10)
1218 Call(ChooseNextTarget, ITER_NEXT, LVar0)
1220 BreakLoop
1221 EndIf
1222 EndLoop
1223 Call(PartnerYieldTurn)
1224 Call(SetGoalToHome, ACTOR_PARTNER)
1225 Call(AddGoalPos, ACTOR_PARTNER, 0, 150, 0)
1226 Call(GetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
1227 Call(SetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
1228 Call(SetActorRotationOffset, ACTOR_PARTNER, 0, 0, 0)
1229 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(1.0))
1230 Call(SetGoalToHome, ACTOR_PARTNER)
1231 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleSushie_Idle)
1232 Call(JumpToGoal, ACTOR_PARTNER, 40, FALSE, TRUE, FALSE)
1233 Call(SetActorJumpGravity, ACTOR_PARTNER, Float(0.7))
1234 Call(JumpToGoal, ACTOR_PARTNER, 20, FALSE, TRUE, FALSE)
1235 Call(JumpToGoal, ACTOR_PARTNER, 10, FALSE, TRUE, FALSE)
1236 Return
1237 End
1238};
struct ActorBlueprint * actorBlueprint
Vec2b projectileTargetOffset
ActorState state
s16 targetActorID
Vec3f curPos
Bytecode EvtScript[]
Vec3f scale
#define sfx_play_sound_at_position
#define remove_effect
#define rand_int
#define clamp_angle
#define atan2
s16 turnsLeft
Definition effects.h:2326
struct WaterFountainFXData * waterFountain
Definition effects.h:2556
struct PartnerBuffFXData * partnerBuff
Definition effects.h:2591
@ FX_WATER_BLOCK_CREATE
Definition effects.h:1539
BuffData unk_0C[3]
Definition effects.h:2336
@ FX_BUFF_DATA_WATER_BLOCK
Definition effects.h:2318
EffectData data
Definition effects.h:2605
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
@ ACTION_COMMAND_WATER_BLOCK
Definition enums.h:3494
@ ACTION_COMMAND_SMASH
Definition enums.h:3474
@ ACTION_COMMAND_SQUIRT
Definition enums.h:3487
@ ACTION_COMMAND_TIDAL_WAVE
Definition enums.h:3495
@ BUTTON_STICK_LEFT
Definition enums.h:2793
@ 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_WATER_BLOCK_BEGIN
Definition enums.h:4096
@ 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
@ PHASE_RUN_AWAY_START
Definition enums.h:2060
@ PHASE_EXECUTE_ACTION
Definition enums.h:2058
@ PHASE_CELEBRATE
Definition enums.h:2062
@ PHASE_RUN_AWAY_FAIL
Definition enums.h:2064
@ BTL_MENU_TYPE_STAR_POWERS
Definition enums.h:4235
@ 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_KEY_INACTIVE
Definition enums.h:2214
@ 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_DAZE
Definition enums.h:2209
@ STATUS_KEY_DEFAULT
Definition enums.h:2198
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1952
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_NICE_NO_DAMAGE
Definition enums.h:1953
@ HIT_RESULT_NICE
Definition enums.h:1951
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_RETURN_HOME
Definition enums.h:4826
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_PARTNER_MIDAIR
Definition enums.h:4874
@ BTL_CAM_REPOSITION
Definition enums.h:4841
@ BTL_CAM_ACTOR_CLOSE
Definition enums.h:4835
@ BTL_CAM_VIEW_ENEMIES
Definition enums.h:4825
@ BTL_CAM_PARTNER_CLOSE_UP
Definition enums.h:4881
@ BTL_CAM_PARTNER_MISTAKE
Definition enums.h:4873
@ SUPPRESS_EVENT_EXPLODE_CONTACT
Definition enums.h:2901
@ SUPPRESS_EVENT_FLAG_200
Definition enums.h:2906
@ SUPPRESS_EVENT_SPIKY_FRONT
Definition enums.h:2902
@ SUPPRESS_EVENT_BURN_CONTACT
Definition enums.h:2904
@ EASING_COS_IN_OUT
Definition enums.h:520
@ PARTNER_RANK_NORMAL
Definition enums.h:2018
@ PARTNER_RANK_SUPER
Definition enums.h:2019
@ PARTNER_RANK_ULTRA
Definition enums.h:2020
@ SOUND_SUSHIE_BELLY_FLOP
Definition enums.h:1357
@ SOUND_TIDAL_WAVE_LEAP_B
Definition enums.h:1018
@ SOUND_NO_DAMGE
Definition enums.h:1433
@ SOUND_SUSHIE_SQUIRT
Definition enums.h:1013
@ SOUND_TIDAL_WAVE_WATER
Definition enums.h:1019
@ SOUND_CREATE_WATER_BLOCK
Definition enums.h:1358
@ SOUND_TIDAL_WAVE_LEAP_A
Definition enums.h:1017
@ SOUND_SUSHIE_FOUNTAIN
Definition enums.h:1014
@ SOUND_HIT_RATTLE
Definition enums.h:749
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PARTNER
Definition enums.h:2086
@ ACTOR_SELF
Definition enums.h:2084
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
@ ACTOR_BLUR_ENABLE
Definition enums.h:6414
@ ACTOR_BLUR_DISABLE
Definition enums.h:6413
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_33
Definition enums.h:2169
@ EVENT_BURN_HIT
Definition enums.h:2136
@ EVENT_SPIKE_CONTACT
Definition enums.h:2163
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_ZERO_DAMAGE
Definition enums.h:2144
@ EVENT_BLOCK
Definition enums.h:2147
@ EVENT_18
Definition enums.h:2145
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_RECOVER_FROM_KO
Definition enums.h:2170
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ EVENT_BURN_CONTACT
Definition enums.h:2164
@ DAMAGE_TYPE_JUMP
Definition enums.h:2858
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
@ DAMAGE_TYPE_MULTIPLE_POPUPS
Definition enums.h:2879
@ DAMAGE_TYPE_WATER
Definition enums.h:2853
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_BLOCK
Definition evt.h:116
ActorPart * get_actor_part(Actor *actor, s32 partID)
Definition 190B20.c:1191
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
void set_goal_pos_to_part(ActorState *state, s32 actorID, s32 partID)
Definition actor_api.c:44
f32 evt_get_float_variable(Evt *script, Bytecode var)
Definition evt.c:1930
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
Definition 43F0.c:685
EvtScript EVS_Partner_Hit
EvtScript EVS_Partner_Recover
EvtScript EVS_Partner_BurnContact
EvtScript EVS_Partner_Drop
EvtScript EVS_Partner_NoDamageHit
EvtScript EVS_Partner_ShockHit
EvtScript EVS_Partner_BurnHit
EvtScript EVS_RunAwayFail
EvtScript EVS_Partner_SpikeContact
EvtScript EVS_Partner_RunAway
#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 Sub(VAR, INT_VALUE)
Definition macros.h:377
#define LVarF
Definition macros.h:163
#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 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 CaseGe(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:334
#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 IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#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 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 SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
Definition macros.h:373
#define LVar2
Definition macros.h:150
#define DT
Definition macros.h:522
#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 SubF(VAR, FLOAT_VALUE)
Definition macros.h:384
#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 CaseGt(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:328
#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 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
struct EffectInstance * waterBlockEffect
struct Actor * partnerActor
struct Actor * playerActor
struct EffectInstance * buffEffect
BattleStatus gBattleStatus
Definition battle.c:11