Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
watt.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/BattleWatt.h"
10#include "sprite/player.h"
11
12#define NAMESPACE battle_partner_watt
13
14extern EvtScript N(EVS_Init);
15extern EvtScript N(EVS_Idle);
18extern EvtScript N(EVS_TakeTurn);
20extern EvtScript N(EVS_Celebrate);
21extern EvtScript N(EVS_RunAway);
27
28extern EffectInstance* N(radialShimmer);
29extern s32 D_8023B948_707438[];
30
31static EffectInstance* N(bulbGlow);
32static EffectInstance* N(thunderboltRing);
33
34// surprisingly this can't be replaced by 'static WattEffectData sWattEffectData;'
35static s32 sWattEffectData_initialized;
36static s32 sWattEffectData_isBouncing;
37static s32 sWattEffectData_bouncePhase;
38static s32 sWattEffectData_isActive;
39static s32 sWattEffectData_currentEffectIndex;
40static EffectInstance* sWattEffectData_effect1;
41static EffectInstance* sWattEffectData_effect2;
42
43enum N(ActorPartIDs) {
44 PRT_MAIN = 1,
45 PRT_2 = 2,
46};
47
48API_CALLABLE(N(WattFXUpdate)) {
50 f32 x, y, z;
51
52 if (isInitialCall) {
53 sWattEffectData_isBouncing = TRUE;
54 sWattEffectData_bouncePhase = 0;
55 sWattEffectData_isActive = TRUE;
56 sWattEffectData_currentEffectIndex = 0;
57 sWattEffectData_effect1 = fx_static_status(0, partner->curPos.x, partner->curPos.y, partner->curPos.z, 1.0f, 5, 0);
58 sWattEffectData_effect2 = fx_static_status(1, partner->curPos.x, NPC_DISPOSE_POS_Y, partner->curPos.z, 1.0f, 5, 0);
59 sWattEffectData_initialized = TRUE;
60 }
61
62 if (!sWattEffectData_initialized) {
63 return ApiStatus_DONE2;
64 }
65
66 if (sWattEffectData_isBouncing) {
67 sWattEffectData_bouncePhase += 15;
68 sWattEffectData_bouncePhase = clamp_angle(sWattEffectData_bouncePhase);
69 }
70
71 partner->verticalRenderOffset = sin_rad(DEG_TO_RAD(sWattEffectData_bouncePhase)) * 3.0f;
72 x = partner->curPos.x + partner->headOffset.x;
73 y = partner->curPos.y + partner->headOffset.y + partner->verticalRenderOffset + 12.0f;
74 z = partner->curPos.z + partner->headOffset.z;
77 }
78
79 if (sWattEffectData_isActive) {
80 switch (sWattEffectData_currentEffectIndex) {
81 case 0:
82 if (sWattEffectData_effect1 == NULL) {
83 sWattEffectData_effect1 = fx_static_status(0, x, y, z, 1.0f, 5, 0);
84 }
85 if (sWattEffectData_effect2 != NULL) {
86 sWattEffectData_effect2->flags |= FX_INSTANCE_FLAG_DISMISS;
87 sWattEffectData_effect2 = NULL;
88 }
89 sWattEffectData_effect1->data.staticStatus->pos.x = x;
90 sWattEffectData_effect1->data.staticStatus->pos.y = y;
91 sWattEffectData_effect1->data.staticStatus->pos.z = z;
92 break;
93 case 1:
94 if (sWattEffectData_effect1 != NULL) {
95 sWattEffectData_effect1->flags |= FX_INSTANCE_FLAG_DISMISS;
96 sWattEffectData_effect1 = NULL;
97 }
98 if (sWattEffectData_effect2 == NULL) {
99 sWattEffectData_effect2 = fx_static_status(1, x, y, z, 1.0f, 5, 0);
100 }
101 sWattEffectData_effect2->data.staticStatus->pos.x = x;
102 sWattEffectData_effect2->data.staticStatus->pos.y = y;
103 sWattEffectData_effect2->data.staticStatus->pos.z = z;
104 break;
105 }
106 } else {
107 if (sWattEffectData_effect1 != NULL) {
108 sWattEffectData_effect1->flags |= FX_INSTANCE_FLAG_DISMISS;
109 sWattEffectData_effect1 = NULL;
110 }
111 if (sWattEffectData_effect2 != NULL) {
112 sWattEffectData_effect2->flags |= FX_INSTANCE_FLAG_DISMISS;
113 sWattEffectData_effect2 = NULL;
114 }
115 }
116
117 return ApiStatus_BLOCK;
118}
119
120API_CALLABLE(N(WattFXRemove)) {
121 sWattEffectData_initialized = FALSE;
122 if (sWattEffectData_effect1 != NULL) {
123 remove_effect(sWattEffectData_effect1);
124 }
125 if (sWattEffectData_effect2 != NULL) {
126 remove_effect(sWattEffectData_effect2);
127 }
128
129 return ApiStatus_DONE2;
130}
131
132API_CALLABLE(N(WattFXBounce)) {
133 sWattEffectData_isBouncing = 1;
134 return ApiStatus_DONE2;
135}
136
137API_CALLABLE(N(WattFXDisableBounce)) {
138 sWattEffectData_isBouncing = 0;
139 return ApiStatus_DONE2;
140}
141
142API_CALLABLE(N(WattFXEnable)) {
143 sWattEffectData_isActive = 1;
144 return ApiStatus_DONE2;
145}
146
147API_CALLABLE(N(WattFXDisable)) {
148 sWattEffectData_isActive = 0;
149 return ApiStatus_DONE2;
150}
151
152API_CALLABLE(N(WattFXSetEffect)) {
153 sWattEffectData_currentEffectIndex = evt_get_variable(script, *script->ptrReadPos);
154 return ApiStatus_DONE2;
155}
156
158
160
161API_CALLABLE(N(ElectroDashFX)) {
162 Bytecode* args = script->ptrReadPos;
163 s32 x = evt_get_variable(script, *args++);
164 s32 y = evt_get_variable(script, *args++);
165 s32 z = evt_get_variable(script, *args++);
166
167 N(radialShimmer) = fx_radial_shimmer(8, x, y, z, 1.3f, 55);
168
169 return ApiStatus_DONE2;
170}
171
172API_CALLABLE(N(ElectroDashFXDisable)) {
173 EffectInstance* effect = N(radialShimmer);
174
175 if (effect != NULL) {
177 }
178 N(radialShimmer) = NULL;
179
180 return ApiStatus_DONE2;
181}
182
183API_CALLABLE(N(PowerShockFX)) {
184 Bytecode* args = script->ptrReadPos;
185 s32 x = evt_get_variable(script, *args++);
186 s32 y = evt_get_variable(script, *args++);
187 s32 z = evt_get_variable(script, *args++);
189
190 N(thunderboltRing) = fx_thunderbolt_ring(0, x, y, z, 1.0f, 10);
191 data = N(thunderboltRing)->data.thunderboltRing;
192 data->unk_30 = 3;
193
194 return ApiStatus_DONE2;
195}
196
197API_CALLABLE(N(PowerShockDischargeFX)) {
198 Bytecode* args = script->ptrReadPos;
200 f32 x = partner->curPos.x + partner->headOffset.x;
201 f32 y = partner->curPos.y + partner->headOffset.y + partner->verticalRenderOffset + 12.0f;
202 f32 z = partner->curPos.z + partner->headOffset.z;
203
204 if (isInitialCall) {
205 script->functionTemp[0] = evt_get_variable(script, *args++);
206 fx_bulb_glow(0, x, y, z, 1.0f, &N(bulbGlow));
207 }
208
209 script->functionTemp[0]--;
210 if (script->functionTemp[0] == 0) {
211 N(bulbGlow)->data.bulbGlow->timeLeft = 5;
212 return ApiStatus_DONE2;
213 }
214
215 return ApiStatus_BLOCK;
216}
217
218API_CALLABLE(N(TargetParalyzeChance)) {
220 Actor* partnerActor = battleStatus->partnerActor;
221 Actor* targetActor = get_actor(partnerActor->targetActorID);
223 s32 statusChance = lookup_status_chance(targetActor->statusTable, STATUS_KEY_PARALYZE);
224
225 if (targetActor->transparentStatus == STATUS_KEY_TRANSPARENT) {
226 statusChance = 0;
227 }
228 if (targetActorPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY) {
229 statusChance = 0;
230 }
231
232 script->varTable[0] = statusChance;
233
234 return ApiStatus_DONE2;
235}
236
237API_CALLABLE(N(TurboChargeUnwindWatt)) {
238 Bytecode* args = script->ptrReadPos;
242 f32 theta;
246 f32 angle;
247 f32 deltaX;
248 f32 deltaY;
249
250 if (isInitialCall) {
251 script->functionTemp[0] = 0;
252 }
253
254 switch (script->functionTemp[0]) {
255 case 0:
256 script->functionTemp[2] = evt_get_variable(script, *args++);
257 partner->state.dist = dist2D(player->curPos.x, player->curPos.y, partner->curPos.x, partner->curPos.y);
258
259 partner->state.goalPos.x = player->curPos.x;
260 partner->state.goalPos.y = player->curPos.y + 36.0f;
261 partner->state.goalPos.z = player->curPos.z;
262
263 partner->state.curPos.x = partner->curPos.x;
264 partner->state.curPos.y = partner->curPos.y;
265 partner->state.curPos.z = partner->curPos.z;
266
267 partner->state.angle = 90.0f;
268 partner->state.vel = 5.0f;
269 partner->state.acceleration = 0.5f;
270 partner->state.moveTime = 90;
271 script->functionTemp[1] = 10;
272 script->functionTemp[0] = 1;
273 break;
274 case 1:
275 theta = DEG_TO_RAD(partner->state.angle);
278 partner->state.vel += partner->state.acceleration;
279 angle = partner->state.angle;
280 angle += partner->state.vel;
281 deltaX = partner->state.dist * sinTheta;
282 deltaY = -partner->state.dist * cosTheta;
283 partner->state.curPos.x = partner->state.goalPos.x + deltaX;
284 partner->state.curPos.y = partner->state.goalPos.y + deltaY;
285 partner->state.angle = angle;
286 partner->state.angle = clamp_angle(angle);
287
288 partner->state.moveTime--;
289 if (partner->state.moveTime == 0) {
290 script->functionTemp[0] = 2;
291 }
292 break;
293 case 2:
294 theta = DEG_TO_RAD(partner->state.angle);
297 distance = partner->state.dist;
298 angle = partner->state.angle;
299 angle += partner->state.vel;
300 deltaX = partner->state.dist * sinTheta;
301 deltaY = -partner->state.dist * cosTheta;
302 partner->state.curPos.x = partner->state.goalPos.x + deltaX;
303 partner->state.curPos.y = partner->state.goalPos.y + deltaY;
304 partner->state.angle = angle;
305 partner->state.angle = clamp_angle(angle);
306 if (partner->state.angle < 45.0f) {
307 script->functionTemp[0] = 3;
308 break;
309 }
310 case 3:
311 player->yaw = 0.0f;
312 partner->yaw = 0.0f;
313 return ApiStatus_DONE2;
314 }
315
316 if (partnerState->angle > 180.0f) {
317 partner->yaw = 0.0f;
318 } else {
319 partner->yaw = 180.0f;
320 }
321
322 partner->curPos.x = partnerState->curPos.x;
323 partner->curPos.y = partnerState->curPos.y;
324 partner->curPos.z = partnerState->curPos.z;
325 if (script->functionTemp[2] == 0) {
326 player->yaw += script->functionTemp[1];
327 script->functionTemp[1]++;
328 }
329 return ApiStatus_BLOCK;
330}
331
332API_CALLABLE(N(TurboChargeFX)) {
333 Bytecode* args = script->ptrReadPos;
334 s32 x = evt_get_variable(script, *args++);
335 s32 y = evt_get_variable(script, *args++);
336 s32 z = evt_get_variable(script, *args++);
338
339 N(thunderboltRing) = fx_thunderbolt_ring(0, x, y, z, 1.0f, 60);
340 data = N(thunderboltRing)->data.thunderboltRing;
341 data->unk_30 = 2;
342
343 return ApiStatus_DONE2;
344}
345
346API_CALLABLE(N(ApplyTurboCharge)) {
348 s32 actionCommandResult = script->varTable[0];
349
350 if (actionCommandResult > 0) {
351 script->varTable[0] = 1;
352 } else {
353 script->varTable[0] = 0;
354 }
355
356 script->varTable[15] = 0;
357 script->varTable[10] = actionCommandResult;
358 if (battleStatus->turboChargeTurnsLeft < actionCommandResult) {
360 battleStatus->turboChargeAmount = 1;
361 battleStatus->buffEffect->data.partnerBuff->unk_0C[FX_BUFF_DATA_TURBO_CHARGE].turnsLeft = battleStatus->turboChargeTurnsLeft;
362 }
363
366 }
367
368 return ApiStatus_DONE2;
369}
370
371API_CALLABLE(N(MegaShockFX)) {
372 Bytecode* args = script->ptrReadPos;
373 s32 x;
374 s32 y;
375 s32 z;
376
377 if (isInitialCall) {
378 script->functionTemp[0] = 0;
379 }
380
381 switch (script->functionTemp[0]) {
382 case 0:
383 script->functionTemp[1] = evt_get_variable(script, *args++);
384 x = evt_get_variable(script, *args++);
385 y = evt_get_variable(script, *args++);
386 z = evt_get_variable(script, *args++);
387 script->functionTemp[2] = 20;
388 script->functionTemp[3] = 10;
389 N(thunderboltRing) = fx_thunderbolt_ring(0, x, y, z, 1.0f, script->functionTemp[2] + 10);
390 N(thunderboltRing)->data.thunderboltRing->unk_30 = 3;
391 script->functionTemp[1] = D_8023B948_707438[script->functionTemp[1] / 16];
392 script->functionTemp[0] = 1;
393 break;
394 case 1:
395 N(thunderboltRing)->data.thunderboltRing->unk_30 =
396 ((script->functionTemp[3] * 3) + (script->functionTemp[1] * (10 - script->functionTemp[3]))) / 10;
397 if (script->functionTemp[3] != 0) {
398 script->functionTemp[3]--;
399 }
400 if (script->functionTemp[2] == 0) {
401 N(thunderboltRing)->flags |= FX_INSTANCE_FLAG_DISMISS;
402 return ApiStatus_DONE2;
403 }
404 script->functionTemp[2]--;
405 break;
406 }
407 return ApiStatus_BLOCK;
408}
409
410API_CALLABLE(N(AverageTargetParalyzeChance)) {
412 Actor* partnerActor = battleStatus->partnerActor;
416 s32 chanceTotal = 0;
417 s32 nTargets = 0;
418 s32 i;
419
420 for (i = 0; i < partnerActor->targetListLength; i++) {
421 targetActor = get_actor(partnerActor->targetData[i].actorID);
424
425 if (targetActor->transparentStatus == STATUS_KEY_TRANSPARENT) {
427 }
428
429 if (targetActorPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY) {
431 }
432
435 nTargets++;
436 }
437 }
438
439 if (nTargets > 0) {
440 script->varTable[0] = chanceTotal / nTargets;
441 } else {
442 script->varTable[0] = 0;
443 }
444
445 return ApiStatus_DONE2;
446}
447
448s32 N(DefaultAnims)[] = {
457};
458
459s32 N(DefenseTable)[] = {
461 ELEMENT_SHOCK, 99,
463};
464
465s32 N(StatusTable)[] = {
468 STATUS_KEY_SLEEP, 100,
471 STATUS_KEY_DIZZY, 100,
472 STATUS_KEY_FEAR, 100,
476 STATUS_KEY_STOP, 100,
488};
489
491 {
493 .index = PRT_MAIN,
494 .posOffset = { 0, 0, 0 },
495 .targetOffset = { 10, 22 },
496 .opacity = 255,
497 .idleAnimations = N(DefaultAnims),
498 .defenseTable = N(DefenseTable),
499 .eventFlags = ACTOR_EVENT_FLAG_ELECTRIFIED,
500 .elementImmunityFlags = 0,
501 .projectileTargetOffset = { 0, 0 },
502 },
503};
504
505ActorBlueprint NAMESPACE = {
506 .flags = ACTOR_FLAG_FLYING,
507 .type = ACTOR_TYPE_WATT,
508 .level = ACTOR_LEVEL_WATT,
509 .maxHP = 99,
510 .partCount = ARRAY_COUNT(N(ActorParts)),
511 .partsData = N(ActorParts),
512 .initScript = &N(EVS_Init),
513 .statusTable = N(StatusTable),
514 .escapeChance = 0,
515 .airLiftChance = 0,
516 .hurricaneChance = 0,
517 .spookChance = 0,
518 .upAndAwayChance = 0,
519 .spinSmashReq = 4,
520 .powerBounceChance = 80,
521 .coinReward = 0,
522 .size = { 34, 28 },
523 .healthBarOffset = { 0, 0 },
524 .statusIconOffset = { -10, 20 },
525 .statusTextOffset = { 10, 20 },
526};
527
528EvtScript N(EVS_Init) = {
533 Return
534 End
535};
536
537EvtScript N(EVS_Idle) = {
538 SetPriority(99)
540 Return
541 End
542};
543
549 Call(N(WattFXSetEffect), 0)
570 SetConst(LVar2, 12)
577 Set(LVar2, 12)
591 Set(LVar2, 12)
601 Set(LVar3, 20)
612 Wait(10)
621 Return
622 End
623};
624
637 Return
638 End
639};
640
643 Call(N(WattFXSetEffect), 1)
649 Return
650 End
651};
652
655 Call(N(WattFXSetEffect), 1)
659 Return
660 End
661};
662
665 Call(N(WattFXSetEffect), 1)
674 Call(N(WattFXSetEffect), 0)
675 Return
676 End
677};
678
680 Return
681 End
682};
683
692 Return
709 Return
710 End
711};
712
719 Return
720 End
721};
722
729 Return
730 End
731};
732
733EffectInstance* N(radialShimmer) = NULL;
734
738 Return
739 End
740};
741
742EvtScript N(charge) = {
747 Add(LVar1, 12)
750 Set(LVar9, 0)
752 Loop(55)
753 Add(LVar9, 30)
754 IfGt(LVar9, 200)
755 Set(LVar9, 200)
756 EndIf
758 Wait(1)
759 EndLoop
761 Return
762 End
763};
764
766 Loop(30)
767 Wait(1)
768 EndLoop
769 Return
770 End
771};
772
776 Call(SetupMashMeter, 1, 100, 0, 0, 0, 0)
777 Wait(10)
781 Call(AddGoalPos, ACTOR_PARTNER, -20, 0, 0)
783 Loop(60)
785 IfNe(LVar0, 0)
786 Set(LFlag2, TRUE)
788 EndIf
789 Wait(1)
790 EndLoop
796 Loop(20)
798 IfEq(LVar0, 0)
799 Set(LFlag0, TRUE)
801 EndIf
802 Wait(1)
803 EndLoop
806 Goto(10)
807 EndIf
811 Loop(55)
813 IfEq(LVar0, 0)
814 Set(LFlag0, TRUE)
816 EndIf
817 Wait(1)
818 EndLoop
821 Goto(10)
822 EndIf
825 Loop(30)
827 IfEq(LVar0, 0)
828 Set(LFlag0, TRUE)
830 EndIf
831 Wait(1)
832 EndLoop
835 Goto(10)
836 EndIf
837 EndIf
838 Else
841 Loop(20)
843 IfNe(LVar0, 0)
846 Set(LFlag2, TRUE)
847 EndIf
848 EndIf
850 IfEq(LVar0, 0)
851 Set(LFlag0, TRUE)
853 EndIf
854 EndIf
855 Wait(1)
856 EndLoop
859 Goto(10)
860 EndIf
864 Loop(55)
866 IfNe(LVar0, 0)
869 Set(LFlag2, TRUE)
870 EndIf
871 EndIf
873 IfEq(LVar0, 0)
874 Set(LFlag0, TRUE)
876 EndIf
877 EndIf
878 Wait(1)
879 EndLoop
882 Goto(10)
883 EndIf
886 Loop(30)
888 IfEq(LVar0, 0)
889 Set(LFlag0, TRUE)
891 EndIf
892 Wait(1)
893 EndLoop
896 Goto(10)
897 EndIf
898 EndIf
899 EndIf
900 Label(10)
901 Wait(2)
909 Call(AddGoalPos, ACTOR_PARTNER, -5, 0, 0)
911 Thread
912 Wait(2)
917 Thread
918 Wait(5)
922 Call(AddGoalPos, ACTOR_PARTNER, 40, 10, 0)
924 Wait(20)
929 Return
930 EndIf
936 Set(LVarE, 1)
937 Set(LVarF, 3)
939 Set(LVarE, 1)
940 Set(LVarF, 4)
942 Set(LVarE, 1)
943 Set(LVarF, 5)
947 CaseGt(0)
963 Return
964 End
965};
966
970 Call(SetupMashMeter, 1, 100, 0, 0, 0, 0)
976 Set(LFlagF, TRUE)
977 EndIf
983 Call(N(WattFXSetEffect), 1)
984 Call(AddGoalPos, ACTOR_PARTNER, -15, -10, 0)
994 Add(LVar1, 15)
995 Add(LVar2, 5)
998 Set(LVar9, 0)
1001 Thread
1002 Loop(75 * DT)
1003 Add(LVar9, 3)
1005 Wait(1)
1006 EndLoop
1007 EndThread
1008 Wait(75 * DT)
1011 Thread
1012 SetF(LVar0, Float(1.0))
1013 Loop(3)
1014 AddF(LVar0, Float(0.4))
1016 Wait(1)
1017 EndLoop
1019 Add(LVar1, 8)
1021 EndThread
1023 Add(LVar1, 20)
1024 Add(LVar2, 5)
1029 Thread
1031 EndThread
1032 Loop(3)
1034 Wait(1)
1035 Call(N(SetBackgroundAlpha), 200)
1036 Wait(1)
1037 EndLoop
1039 Wait(10)
1040 Call(N(WattFXEnable))
1041 Call(N(WattFXSetEffect), 0)
1042 Thread
1044 SetF(LVar0, Float(2.2))
1045 Loop(12)
1046 SubF(LVar0, Float(0.1))
1048 Wait(1)
1049 EndLoop
1052 EndThread
1055 Wait(15)
1057 Return
1058 EndIf
1061 Switch(LVar0)
1062 CaseGt(0)
1066 EndSwitch
1068 IfNe(LFlagF, TRUE)
1069 Call(AddGoalPos, ACTOR_PARTNER, -25, 10, 0)
1071 Else
1072 Call(AddGoalPos, ACTOR_PARTNER, -25, -10, 0)
1074 EndIf
1075 Wait(30)
1076 Switch(LVar0)
1085 EndSwitch
1086 Return
1087 End
1088};
1089
1097 Wait(5)
1099 Call(SetBattleCamTarget, -125, 42, 0)
1104 Wait(1)
1106 Wait(1)
1108 Wait(1)
1110 Wait(1)
1112 Wait(1)
1114 Wait(10)
1117 Call(MoveBattleCamOver, 100 * DT)
1119 Thread
1127 Wait(10)
1129 EndThread
1130 Wait(30)
1133 Add(LVar1, 42)
1135 Wait(59)
1138 Thread
1145 Call(PlayerHopToGoal, 20, 0, 0)
1147 Wait(4)
1149 EndThread
1150 Wait(30)
1156 Set(LVarE, LVarF)
1157 IfGt(LVarA, 0)
1159 Add(LVar0, 15)
1160 Add(LVar1, 35)
1161 Add(LVarF, 0)
1163 Wait(4)
1164 EndIf
1165 IfEq(LVar0, 0)
1166 Else
1168 EndIf
1171 Return
1172 End
1173};
1174
1180 Wait(5)
1182 Call(SetBattleCamTarget, -125, 42, 0)
1187 Wait(1)
1189 Wait(1)
1191 Wait(1)
1193 Wait(1)
1195 Wait(1)
1197 Wait(10)
1199 Call(AddBattleCamDist, -100)
1200 Call(MoveBattleCamOver, 100 * DT)
1202 Thread
1210 Wait(10)
1212 EndThread
1213 Wait(30)
1216 Add(LVar1, 42)
1218 Wait(59)
1221 Wait(30)
1227 Set(LVarE, LVarF)
1228 IfGt(LVarA, 0)
1230 Add(LVar0, 15)
1231 Add(LVar1, 35)
1232 Add(LVarF, 0)
1234 Wait(4)
1235 EndIf
1236 IfEq(LVar0, 0)
1237 Else
1239 EndIf
1242 Return
1243 End
1244};
1245
1250 Else
1252 EndIf
1253 Return
1254 End
1255};
1256
1257s32 D_8023B948_707438[] = { 3, 3, 4, 7, 10, 13, 16, 16, 16, 16 };
1258
1262 Call(SetupMashMeter, 1, 100, 0, 0, 0, 0)
1265 Call(SetBattleCamTarget, -54, 63, 10)
1270 Add(LVar0, 40)
1271 Add(LVar1, 30)
1277 Set(LVar9, 0)
1278 Thread
1279 Loop(75 * DT)
1280 Add(LVar9, 3)
1282 Wait(1)
1283 EndLoop
1284 EndThread
1288 Add(LVar1, 15)
1289 Add(LVar2, 5)
1292 Add(LVar1, 12)
1294 Call(AddBattleCamDist, -100)
1301 Wait(90 * DT)
1303 Thread
1304 Set(LVar9, 60)
1305 Loop(20)
1306 Sub(LVar9, 3)
1308 Wait(1)
1309 EndLoop
1310 EndThread
1313 Thread
1315 Add(LVar1, 12)
1318 Wait(10)
1321 EndThread
1322 Thread
1324 Wait(5)
1326 Wait(30)
1328 EndThread
1329 Thread
1331 Call(SetBattleCamTarget, 6, 63, 10)
1333 Wait(4)
1334 Set(LVar0, 6)
1335 Loop(30)
1336 Add(LVar0, 1)
1337 Call(SetBattleCamTarget, LVar0, 63, 10)
1338 Wait(1)
1339 EndLoop
1340 EndThread
1341 Thread
1343 EndThread
1346 Add(LVar2, 12)
1348 Loop(0)
1353 Goto(11)
1354 EndIf
1355 IfEq(LVarF, 100)
1357 Else
1359 EndIf
1360 Label(11)
1363 BreakLoop
1364 EndIf
1365 Wait(5)
1366 EndLoop
1367 Call(N(WattFXEnable))
1369 Wait(30)
1371 Switch(LVar0)
1372 CaseGt(99)
1376 EndSwitch
1377 Return
1378 End
1379};
BSS s32 PopupMenu_SelectedIndex
@ AC_DIFFICULTY_3
Definition action_cmd.h:45
s32 D_8023B948_707438[]
Definition watt.c:1257
@ ACV_SLAM_WATT
Definition body_slam.h:22
struct SelectableTarget targetData[24]
s16 targetActorID
Vec3f curPos
Bytecode EvtScript[]
s8 targetListLength
#define remove_effect
#define clamp_angle
@ FX_BUFF_DATA_TURBO_CHARGE
Definition effects.h:2320
@ FX_SHOCK_OVERLAY_MEGA_SHOCK
Definition effects.h:1265
EffectInstanceDataPtr data
Definition effects.h:2605
struct StaticStatusFXData * staticStatus
Definition effects.h:2579
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
@ BTL_CAM_XADJ_NONE
Definition enums.h:4898
@ ACTION_COMMAND_MEGA_SHOCK
Definition enums.h:3489
@ ACTION_COMMAND_THREE_CHANCES
Definition enums.h:3494
@ ACTION_COMMAND_BODY_SLAM
Definition enums.h:3484
@ ACTION_COMMAND_POWER_SHOCK
Definition enums.h:3488
@ BUTTON_A
Definition enums.h:2790
@ 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_TURBO_CHARGE_BEGIN
Definition enums.h:4099
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_SHOCK
Definition enums.h:2125
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ ACTOR_PAL_ADJUST_WATT_IDLE
Definition enums.h:2248
@ ACTOR_PAL_ADJUST_WATT_ATTACK
Definition enums.h:2249
@ ACTOR_EVENT_FLAG_ELECTRIFIED
Player takes shock damage upon contact.
Definition enums.h:3375
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
Definition enums.h:3374
@ 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
@ BS_FLAGS2_OVERRIDE_INACTIVE_PARTNER
Definition enums.h:3607
@ BS_FLAGS2_STORED_TURBO_CHARGE_TURN
Definition enums.h:3610
@ BS_FLAGS2_PLAYER_TURN_USED
Definition enums.h:3604
@ BS_FLAGS2_PARTNER_TURN_USED
Definition enums.h:3605
@ 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_TRANSPARENT
Definition enums.h:2210
@ 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_CLOSER_PARTNER_APPROACH
Definition enums.h:4869
@ BTL_CAM_DEFAULT
Definition enums.h:4823
@ BTL_CAM_REPOSITION
Definition enums.h:4840
@ BTL_CAM_PARTNER_MISTAKE
Definition enums.h:4872
@ BTL_CAM_PARTNER_APPROACH
Definition enums.h:4868
@ SUPPRESS_EVENT_SPIKY_TOP
Definition enums.h:2900
@ SUPPRESS_EVENT_ALT_SPIKY
Definition enums.h:2905
@ SUPPRESS_EVENT_SHOCK_CONTACT
Definition enums.h:2903
@ SUPPRESS_EVENT_SPIKY_FRONT
Definition enums.h:2902
@ SUPPRESS_EVENT_BURN_CONTACT
Definition enums.h:2904
@ EASING_CUBIC_OUT
Definition enums.h:515
@ EASING_COS_IN_OUT
Definition enums.h:520
@ EASING_QUADRATIC_OUT
Definition enums.h:514
@ EASING_LINEAR
Definition enums.h:510
@ STATUS_FLAG_PARALYZE
Definition enums.h:2816
@ DMG_SRC_ELECTRO_DASH
Definition enums.h:2007
@ SOUND_WATT_MEGA_DISCHARGE
Definition enums.h:1003
@ SOUND_WATT_POWER_SHOCK
Definition enums.h:1001
@ SOUND_WATT_MEGA_CHARGE_WAVE
Definition enums.h:1345
@ SOUND_NO_DAMGE
Definition enums.h:1433
@ SOUND_GROW
Definition enums.h:1435
@ SOUND_WATT_CHARGE
Definition enums.h:1000
@ SOUND_WATT_TURBO_CHARGE
Definition enums.h:1002
@ SOUND_LONG_PLAYER_JUMP
Definition enums.h:782
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PARTNER
Definition enums.h:2086
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
Definition enums.h:3329
@ ACTOR_FLAG_NO_INACTIVE_ANIM
Definition enums.h:3345
@ ACTOR_FLAG_UPSIDE_DOWN
HP bar offset below actor (e.g. Swooper when upside-down).
Definition enums.h:3331
@ BTL_CAM_YADJ_NONE
Definition enums.h:4905
@ 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_PUT_PARTNER_AWAY
Definition enums.h:2177
@ EVENT_BLOCK
Definition enums.h:2147
@ EVENT_REVIVE
Definition enums.h:2180
@ EVENT_18
Definition enums.h:2145
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_RECOVER_FROM_KO
Definition enums.h:2170
@ EVENT_LIFE_SHROOM_PROC
Definition enums.h:2179
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ EVENT_BURN_CONTACT
Definition enums.h:2164
@ ACTOR_PART_FLAG_PRIMARY_TARGET
Definition enums.h:3362
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
Definition enums.h:2880
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
@ DAMAGE_TYPE_SHOCK
Definition enums.h:2856
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
@ DAMAGE_TYPE_MULTIPLE_POPUPS
Definition enums.h:2879
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_BLOCK
Definition evt.h:116
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1689
f32 cos_rad(f32 x)
Definition 43F0.c:716
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
Definition 43F0.c:669
ActorPart * get_actor_part(Actor *actor, s32 partID)
Definition 190B20.c:1191
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
s32 lookup_status_chance(s32 *, s32)
Definition 190B20.c:2046
f32 sin_rad(f32 x)
Definition 43F0.c:712
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_Partner_Celebrate
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 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 SetPriority(PRIORITY)
Sets the current thread's priority. Higher-priority threads execute before lower-priority threads on ...
Definition macros.h:513
#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 Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define NPC_DISPOSE_POS_Y
Definition macros.h:164
#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 DMG_STATUS_ALWAYS(typeFlag, duration)
Definition macros.h:229
#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 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 KillThread(TID)
Kills a thread by its thread ID.
Definition macros.h:510
#define SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
Definition macros.h:373
#define LFlagF
Definition macros.h:182
#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 DEG_TO_RAD(deg)
Definition macros.h:138
#define DT
Definition macros.h:526
#define LVar1
Definition macros.h:149
#define LFlag0
Definition macros.h:167
#define LVarA
Definition macros.h:158
#define ExecGetTID(EVT_SOURCE, OUTVAR)
Identical to Exec, but the newly-launched thread ID is stored in OUTVAR.
Definition macros.h:460
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LFlag2
Definition macros.h:169
#define LVar9
Definition macros.h:157
#define 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 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
struct Actor * playerActor
@ ACV_THREE_CHANCES_TURBO_CHARGE
BattleStatus gBattleStatus
Definition battle.c:11