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
14extern EvtScript N(EVS_Idle);
16extern EvtScript N(EVS_TakeTurn);
17extern EvtScript N(EVS_Init);
19extern EvtScript N(EVS_Celebrate);
20extern EvtScript N(EVS_RunAway);
26
27static EffectInstance* sEffect;
28
29enum N(ActorPartIDs) {
30 PRT_MAIN = 1,
31};
32
33API_CALLABLE(N(SetSquirtAngle)) {
36
37 set_goal_pos_to_part(&partner->state, 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)) {
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)) {
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) {
168 battleStatus->waterBlockAmount = 1;
169 battleStatus->buffEffect->data.partnerBuff->unk_0C[FX_BUFF_DATA_WATER_BLOCK].turnsLeft = battleStatus->waterBlockTurnsLeft;
170 }
171
172 return ApiStatus_DONE2;
173}
174
175API_CALLABLE(N(PlaySquirtFX)) {
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)) {
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)) {
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)[] = {
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
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) = {
474 Return
475 End
476};
477
478EvtScript N(EVS_Idle) = {
479 Return
480 End
481};
482
505 Set(LVar2, 20)
511 Set(LVar2, 20)
524 Set(LVar2, 20)
533 Set(LVar3, 0)
541 Wait(10)
546 Return
547 End
548};
549
562 Return
563 End
564};
565
568 Wait(36)
570 Return
571 End
572};
573
578 Return
579 End
580};
581
591 Return
592 End
593};
594
596 Return
597 End
598};
599
608 Return
625 Return
626 End
627};
628
634 Sub(LVar0, 60)
635 Set(LVar1, 0)
639 Sub(LVar0, 30)
642 Sub(LVar0, 20)
645 Sub(LVar0, 10)
648 Wait(15)
654 Return
655 End
656};
657
663 Sub(LVar0, 15)
664 Set(LVar1, 0)
668 Sub(LVar0, 5)
672 Wait(15)
678 Return
679 End
680};
681
689 Return
690 End
691};
692
700 Return
701 End
702};
703
706 Add(LVar0, 40)
713 Return
714 End
715};
716
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
740 Loop(30)
741 Wait(1)
743 IfNe(LVar0, 0)
745 EndIf
746 EndLoop
751 Set(LVar0, 30)
752 Loop(60)
753 Wait(1)
754 Sub(LVar0, 1)
755 IfEq(LVar0, 0)
757 EndIf
759 IfEq(LVar0, 0)
761 EndIf
762 EndLoop
763 Thread
769 Thread
771 Set(LVar0, 0)
772 Loop(10)
773 Add(LVar0, 36)
775 Wait(1)
776 EndLoop
779 Thread
781 IfGt(LVar0, 0)
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))
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))
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
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))
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))
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
860 IfGt(LVar0, 0)
861 Thread
863 Wait(10)
868 Else
869 Thread
871 Wait(10)
876 EndIf
883 Set(LVarE, 1)
884 Set(LVarF, 3)
886 Set(LVarE, 2)
887 Set(LVarF, 4)
889 Set(LVarE, 3)
890 Set(LVarF, 5)
894 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
898 Call(AddGoalPos, ACTOR_PARTNER, 15, 0, 0)
900 Call(AddGoalPos, ACTOR_PARTNER, 10, 0, 0)
902 Wait(10)
907 Return
908 EndIf
909 Thread
910 Wait(3)
911 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
915 CaseGt(0)
933 Return
934 End
935};
936
943 Call(SetupMashMeter, 3, 40, 75, 100, 0, 0)
945 Call(SetupMashMeter, 4, 35, 60, 80, 100, 0)
947 Call(SetupMashMeter, 5, 20, 40, 60, 80, 100)
953 Thread
955 Wait(5)
967 Loop(90 * DT)
969 IfEq(LVar0, 0)
972 SubF(LVar1, Float(1.0))
973 DivF(LVar1, 4)
975 Else
977 DivF(LVar0, 100)
978 SetF(LVar1, Float(1.0))
980 EndIf
983 Wait(1)
984 EndLoop
991 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
993 Add(LVar0, 10)
994 Add(LVar1, 11)
998 Wait(20)
1000 Return
1001 EndIf
1003 Thread
1005 EndThread
1007 Add(LVar0, 10)
1008 Add(LVar1, 11)
1011 Wait(10)
1014 Switch(LVar0)
1015 CaseGt(0)
1021 EndSwitch
1022 Switch(LVar0)
1031 EndSwitch
1032 Return
1033 End
1034};
1035
1040 Call(SetBattleCamTarget, -95, 26, 10)
1044 Wait(10)
1048 Add(LVar0, 30)
1054 Set(LVar0, 0)
1055 Loop(4)
1056 Add(LVar0, 45)
1058 Wait(1)
1059 EndLoop
1060 Wait(4)
1063 Wait(110)
1065 IfEq(LVar0, 0)
1066 Set(LVarA, LVar0)
1067 Goto(10)
1068 EndIf
1071 Call(SetBattleCamTarget, -95, 27, 10)
1075 Thread
1077 Call(N(PlaySquirtFX))
1078 Wait(65)
1080 EndThread
1081 Wait(45)
1083 Add(LVar1, 83)
1084 PlayEffect(EFFECT_WATERFALL, 0, LVar0, LVar1, LVar2, Float(1.0), 50, 0)
1086 Thread
1087 Wait(20)
1089 Add(LVar1, 100)
1091 Wait(5)
1092 Sub(LVar1, 20)
1094 Wait(5)
1095 Sub(LVar1, 20)
1097 Wait(5)
1098 Sub(LVar1, 20)
1100 Wait(5)
1101 Sub(LVar1, 20)
1103 EndThread
1104 Wait(40)
1107 Wait(30)
1110 Set(LVarA, LVar0)
1112 Add(LVar0, 15)
1113 Add(LVar1, 35)
1114 Add(LVarF, 6)
1116 Wait(4)
1120 Label(10)
1125 Set(LVar1, 180)
1126 Loop(4)
1127 Sub(LVar1, 45)
1129 EndLoop
1131 IfEq(LVarA, 0)
1132 Else
1134 EndIf
1136 Return
1137 End
1138};
1139
1144 Call(SetupMashMeter, 5, 20, 30, 60, 80, 100)
1147 Call(SetBattleCamTarget, -65, 53, 10)
1157 Call(AddGoalPos, ACTOR_PARTNER, 30, 40, 0)
1163 Thread
1164 Wait(54)
1165 Loop(8)
1167 Wait(1)
1169 Wait(1)
1170 EndLoop
1171 Loop(7)
1173 Wait(1)
1175 Wait(1)
1176 EndLoop
1177 Loop(8)
1179 Wait(1)
1181 Wait(1)
1182 EndLoop
1184 EndThread
1185 Loop(100)
1188 Wait(1)
1189 EndLoop
1192 Wait(10)
1195 Call(SetActorPos, ACTOR_PARTNER, -220, 0, 0)
1197 Wait(15)
1201 Set(LVarE, LVar0)
1202 Set(LVarF, LVar0)
1204 Loop(0)
1208 Goto(10)
1209 EndIf
1210 Switch(LVarE)
1211 CaseGe(6)
1215 EndSwitch
1216 Wait(5)
1217 Label(10)
1220 BreakLoop
1221 EndIf
1222 EndLoop
1225 Call(AddGoalPos, ACTOR_PARTNER, 0, 150, 0)
1236 Return
1237 End
1238};
BSS s32 PopupMenu_SelectedIndex
@ AC_DIFFICULTY_3
Definition action_cmd.h:45
Vec3f curPos
Bytecode EvtScript[]
Vec3f scale
#define sfx_play_sound_at_position
#define remove_effect
#define rand_int
#define clamp_angle
#define atan2
@ FX_BUFF_DATA_WATER_BLOCK
Definition effects.h:2318
EffectInstanceDataPtr data
Definition effects.h:2605
@ FX_WATER_BLOCK_CREATE
Definition effects.h:1539
struct WaterFountainFXData * waterFountain
Definition effects.h:2556
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
@ ACTION_COMMAND_SMASH
Definition enums.h:3474
@ ACTION_COMMAND_THREE_CHANCES
Definition enums.h:3494
@ 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:3575
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3570
@ BS_FLAGS1_4000
Definition enums.h:3582
@ BTL_MSG_WATER_BLOCK_BEGIN
Definition enums.h:4095
@ 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:4234
@ 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:4825
@ BTL_CAM_DEFAULT
Definition enums.h:4823
@ BTL_CAM_PARTNER_MIDAIR
Definition enums.h:4873
@ BTL_CAM_REPOSITION
Definition enums.h:4840
@ BTL_CAM_ACTOR_CLOSE
Definition enums.h:4834
@ BTL_CAM_VIEW_ENEMIES
Definition enums.h:4824
@ BTL_CAM_PARTNER_CLOSE_UP
Definition enums.h:4880
@ BTL_CAM_PARTNER_MISTAKE
Definition enums.h:4872
@ 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:6413
@ ACTOR_BLUR_DISABLE
Definition enums.h:6412
@ 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:1929
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
Definition 43F0.c:684
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:526
#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 Actor * partnerActor
@ ACV_THREE_CHANCES_WATER_BLOCK
BattleStatus gBattleStatus
Definition battle.c:11