Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
kooper.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"
5#include "sprite/npc/BattleKooper.h"
9
10#define NAMESPACE battle_partner_kooper
11
12extern EvtScript N(EVS_Init);
13extern EvtScript N(EVS_TakeTurn);
14extern EvtScript N(EVS_Idle);
17extern EvtScript N(firstStrike);
19extern EvtScript N(EVS_Celebrate);
20extern EvtScript N(runAway);
21extern EvtScript N(runAwayFail);
22extern EvtScript N(shellToss);
23extern EvtScript N(powerShell);
24extern EvtScript N(dizzyShell);
25extern EvtScript N(fireShell);
27
28enum N(ActorPartIDs) {
29 PRT_MAIN = 1,
30 PRT_ZERO = 0,
31};
32
33enum N(ActorVars) {
34 AVAR_Unk_0 = 0,
35 AVAR_Unk_1 = 1,
36};
37
38enum N(ActorParams) {
39 DMG_UNK = 0,
40};
41
42API_CALLABLE(N(SlowDown)) {
44 Actor* partnerActor = battleStatus->partnerActor;
45 ActorState* partnerActorMovement = &partnerActor->state;
46
47 if (isInitialCall) {
48 partnerActor->state.curPos.x = partnerActor->curPos.x;
49 partnerActor->state.curPos.y = partnerActor->curPos.y;
50 partnerActor->state.curPos.z = partnerActor->curPos.z;
51 }
52
53 add_xz_vec3f(&partnerActorMovement->curPos, partnerActor->state.speed, partnerActor->state.angle);
54
55 if (partnerActor->state.speed < 4.0f) {
56 play_movement_dust_effects(0, partnerActor->state.curPos.x, partnerActor->state.curPos.y,
57 partnerActor->state.curPos.z, partnerActor->state.angle);
58 } else {
59 play_movement_dust_effects(1, partnerActor->state.curPos.x, partnerActor->state.curPos.y,
60 partnerActor->state.curPos.z, partnerActor->state.angle);
61 }
62
63 partnerActorMovement->speed = partnerActorMovement->speed / 1.5;
64
65 partnerActor->curPos.x = partnerActorMovement->curPos.x;
66 partnerActor->curPos.y = partnerActorMovement->curPos.y;
67 partnerActor->curPos.z = partnerActorMovement->curPos.z;
68
69 if (partnerActorMovement->speed < 1.0) {
70 return ApiStatus_DONE2;
71 }
72
73 return ApiStatus_BLOCK;
74}
75
76API_CALLABLE(N(SetTargetsYaw)) {
81 f32 x;
82 f32 targetX;
83 s32 i;
84
85 if (isInitialCall) {
86 script->functionTemp[0] = 0;
87 actor->selectedTargetIndex = 0;
88 }
89
90 if (script->functionTemp[0] == 0) {
91 for (i = 0; i < actor->targetListLength; i++) {
92 x = actor->curPos.x;
93 target = &actor->targetData[actor->targetIndexList[i]];
94 targetX = target->truePos.x;
95 targetActor = get_actor(target->actorID);
96
97 if (targetActor != NULL) {
99
100 if (targetActor->transparentStatus == 0) {
101 if (!(targetActorPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY)) {
102 if (x > targetX) {
103 targetActor->yaw += 33;
104 } else {
105 targetActor->yaw = 0;
106 }
107
109 }
110 }
111 }
112 }
113
114 if (actor->state.varTable[0] != 0) {
115 for (i = 0; i < actor->targetListLength; i++) {
116 target = &actor->targetData[actor->targetIndexList[i]];
117 targetActor = get_actor(target->actorID);
118 if (targetActor) {
119 targetActor->yaw = 0.0f;
120 }
121 }
122 return ApiStatus_DONE2;
123 }
124 }
125 return ApiStatus_BLOCK;
126}
127
128API_CALLABLE(N(AverageTargetDizzyChance)) {
130 Actor* partnerActor = battleStatus->partnerActor;
134 s32 chanceTotal = 0;
135 s32 nTargets = 0;
136 s32 i;
137
138 for (i = 0; i < partnerActor->targetListLength; i++) {
139 targetActor = get_actor(partnerActor->targetData[i].actorID);
142
143 if (targetActor->transparentStatus == STATUS_KEY_TRANSPARENT) {
145 }
146
147 if (targetActorPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY) {
149 }
150
153 nTargets++;
154 }
155 }
156
157 if (nTargets > 0) {
158 script->varTable[0] = chanceTotal / nTargets;
159 } else {
160 script->varTable[0] = 0;
161 }
162
163 return ApiStatus_DONE2;
164}
165
166API_CALLABLE(N(GetFireShellSpeedAndDamage)) {
167 s32 mashResult = script->varTable[0];
168 s32 damage;
169 s32 speedRating;
170
171 if (mashResult <= 35) {
172 damage = 1;
173 speedRating = 0;
174 } else if (mashResult <= 60) {
175 damage = 3;
176 speedRating = 1;
177 } else if (mashResult <= 80) {
178 damage = 4;
179 speedRating = 2;
180 } else if (mashResult < 100) {
181 damage = 5;
182 speedRating = 3;
183 } else {
184 damage = 6;
185 speedRating = 4;
186 }
187
188 script->varTable[14] = speedRating;
189 script->varTable[15] = damage;
190
191 return ApiStatus_DONE2;
192}
193
194s32 N(DefaultAnims)[] = {
203};
204
205s32 N(DefenseTable)[] = {
208};
209
210s32 N(StatusTable)[] = {
213 STATUS_KEY_SLEEP, 100,
216 STATUS_KEY_DIZZY, 100,
217 STATUS_KEY_FEAR, 100,
221 STATUS_KEY_STOP, 100,
233};
234
236 {
237 .flags = 0,
238 .index = PRT_MAIN,
239 .posOffset = { 0, 0, 0 },
240 .targetOffset = { 8, 27 },
241 .opacity = 255,
242 .idleAnimations = N(DefaultAnims),
243 .defenseTable = N(DefenseTable),
244 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
245 .elementImmunityFlags = 0,
246 .projectileTargetOffset = { 0, 0 },
247 },
248};
249
250ActorBlueprint NAMESPACE = {
251 .flags = 0,
252 .type = ACTOR_TYPE_KOOPER,
253 .level = ACTOR_LEVEL_KOOPER,
254 .maxHP = 99,
255 .partCount = ARRAY_COUNT(N(ActorParts)),
256 .partsData = N(ActorParts),
257 .initScript = &N(EVS_Init),
258 .statusTable = N(StatusTable),
259 .escapeChance = 0,
260 .airLiftChance = 0,
261 .hurricaneChance = 0,
262 .spookChance = 0,
263 .upAndAwayChance = 0,
264 .spinSmashReq = 4,
265 .powerBounceChance = 80,
266 .coinReward = 0,
267 .size = { 32, 38 },
268 .healthBarOffset = { 0, 0 },
269 .statusIconOffset = { -10, 30 },
270 .statusTextOffset = { 10, 30 },
271};
272
273EvtScript N(EVS_Init) = {
278 Return
279 End
280};
281
282EvtScript N(EVS_Idle) = {
283 Return
284 End
285};
286
309 Set(LVar2, 16)
315 Set(LVar2, 16)
329 Set(LVar2, 16)
338 Set(LVar3, 0)
346 Wait(10)
352 Return
353 End
354};
355
366 ExecWait(N(runAway))
370 Return
371 End
372};
373
380 Return
381 End
382};
383
384EvtScript N(runAway) = {
388 Return
389 End
390};
391
401 Return
402 End
403};
404
406 Return
407 End
408};
409
418 Return
424 Set(LVarF, 2)
425 Set(LVarE, 1)
429 Set(LVarF, 3)
430 Set(LVarE, 2)
434 Set(LVarF, 5)
435 Set(LVarE, 3)
445 ExecWait(N(fireShell))
447 Return
448 End
449};
450
464 Return
465 End
466};
467
470 Thread
472 Wait(30)
477 Sub(LVar0, 60)
478 Set(LVar1, 0)
482 Sub(LVar0, 30)
485 Sub(LVar0, 20)
488 Sub(LVar0, 10)
491 Wait(4)
497 Return
498 End
499};
500
506 Sub(LVar0, 30)
507 Set(LVar1, 0)
511 Sub(LVar0, 20)
514 Sub(LVar0, 10)
517 Sub(LVar0, 10)
520 Wait(4)
526 Return
527 End
528};
529
535 Sub(LVarB, LVarC)
536 Else
537 Sub(LVarC, LVarB)
538 Set(LVarB, LVarC)
539 EndIf
541 IfLt(LVarB, 0)
542 Set(LVarB, 0)
543 EndIf
544 Return
545 End
546};
547
548EvtScript N(shellToss) = {
553 Add(LVar0, 30)
561 Wait(15)
563 Loop(30)
564 Wait(1)
568 EndIf
569 EndLoop
575 Set(LVar9, 0)
576 Set(LVar1, 0)
577 Loop(50 * DT)
578 Wait(1)
580 CaseLt(20 * DT)
582 CaseEq(20 * DT)
584 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
585 CaseLt(30 * DT)
587 CaseEq(30 * DT)
589 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
590 CaseLt(40 * DT)
592 CaseEq(40 * DT)
594 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
595 CaseLt(50 * DT)
597 CaseEq(50 * DT)
599 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
601 Add(LVar9, 1)
603 IfNe(LVar0, 0)
604 IfNe(LVar1, TRUE)
605 Set(LVar1, 1)
606 EndIf
607 EndIf
611 EndIf
612 EndLoop
613 Label(0)
614 Wait(1)
615 SetF(LVarA, Float(8.0))
617 CaseLt(20 * DT)
618 SetF(LVarA, Float(10.0))
620 CaseLt(30 * DT)
621 SetF(LVarA, Float(12.0))
623 CaseLt(40 * DT)
624 SetF(LVarA, Float(14.0))
626 CaseLt(50 * DT)
627 SetF(LVarA, Float(16.0))
630 Add(LVar9, 1)
632 IfEq(LVar0, 0)
633 Goto(0)
634 EndIf
646 Thread
647 Call(N(SlowDown))
650 Wait(4)
653 Set(LVar0, 0)
654 Loop(2)
655 Add(LVar0, -30)
657 Wait(1)
658 EndLoop
659 Wait(5)
661 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 16, 4, 0, 10, 0)
662 Loop(5)
663 Add(LVar0, 12)
665 Wait(1)
666 EndLoop
669 Wait(2)
671 Wait(2)
673 Wait(10)
675 Wait(10)
680 Return
681 EndIf
685 CaseGt(0)
701 Return
702 End
703};
704
710 CaseEq(0)
711 Set(LVarE, 1)
712 Set(LVarF, 2)
713 CaseEq(1)
714 Set(LVarE, 1)
715 Set(LVarF, 3)
716 CaseEq(2)
717 Set(LVarE, 1)
718 Set(LVarF, 4)
722 Add(LVar0, 30)
730 Wait(15)
732 Loop(30)
733 Wait(1)
737 EndIf
738 EndLoop
744 Set(LVar9, 0)
745 Set(LVar1, 0)
746 Loop(50)
747 Wait(1)
749 CaseLt(20)
751 CaseEq(20)
753 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
754 CaseLt(30)
756 CaseEq(30)
758 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
759 CaseLt(40)
761 CaseEq(40)
763 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
764 CaseLt(50)
766 CaseEq(50)
768 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
770 Add(LVar9, 1)
772 IfNe(LVar0, 0)
773 IfNe(LVar1, TRUE)
775 Set(LVar1, 1)
776 EndIf
777 EndIf
781 EndIf
782 EndLoop
783 Label(0)
784 Wait(1)
785 Set(LVarA, Float(8.0))
787 CaseLt(20)
788 Set(LVarA, Float(10.0))
790 CaseLt(30)
791 Set(LVarA, Float(12.0))
793 CaseLt(40)
794 Set(LVarA, Float(14.0))
796 CaseLt(50)
797 Set(LVarA, Float(16.0))
800 Add(LVar9, 1)
802 IfEq(LVar0, 0)
803 Goto(0)
804 EndIf
809 Set(LVarB, 260)
811 Thread
814 Add(LVar0, 260)
823 Label(10)
824 Wait(1)
829 Goto(10)
830 EndIf
832 IfEq(LVar0, 6)
833 Goto(12)
834 EndIf
838 CaseGt(0)
843 EndIf
844 Set(LFlag0, TRUE)
847 CaseGt(0)
853 Label(12)
856 Goto(10)
857 EndIf
861 CaseGt(0)
866 EndIf
867 Label(11)
869 IfEq(LVar0, 0)
870 Wait(1)
871 Goto(11)
872 EndIf
875 CaseGt(0)
880 Return
881 End
882};
883
887 Call(SetupMashMeter, 1, 100, 0, 0, 0, 0)
890 Add(LVar0, 30)
898 Wait(15)
902 Set(LVarD, 75 * DT)
903 Set(LVarA, LVarD)
904 Add(LVarA, -3)
910 Set(LVar9, 0)
911 Set(LVarA, Float(8.0))
915 Set(LVar9, 1)
916 Loop(LVarD)
917 Wait(1)
920 CaseLt(20 * DT)
921 Set(LVarA, Float(10.0))
923 CaseLt(40 * DT)
924 Set(LVarA, Float(12.0))
926 CaseLt(60 * DT)
927 Set(LVarA, Float(14.0))
930 Set(LVarA, Float(16.0))
934 CaseEq(10 * DT)
936 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
937 CaseEq(20 * DT)
939 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
940 CaseEq(40 * DT)
942 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
943 CaseEq(60 * DT)
945 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 32, 4, 0, 10, 0)
947 EndLoop
951 Set(LVarB, 300)
953 Thread
957 Add(LVar0, 350)
964 Wait(20)
965 Call(SetActorPos, ACTOR_PARTNER, -200, 0, 0)
967 Call(AddGoalPos, ACTOR_PARTNER, 40, 0, 0)
973 Thread
978 Label(10)
979 Wait(1)
984 Goto(10)
985 EndIf
988 Goto(12)
989 EndIf
993 CaseGt(99)
998 EndIf
999 Set(LFlag0, TRUE)
1002 Switch(LVar0)
1003 CaseGt(0)
1004 IfEq(LVar9, 1)
1005 IfEq(LVarF, 100)
1008 Else
1010 EndIf
1011 Else
1013 EndIf
1015 IfEq(LVar9, 1)
1017 Else
1019 EndIf
1020 EndSwitch
1022 Label(12)
1025 Goto(10)
1026 EndIf
1027 IfEq(LFlag0, FALSE)
1029 Switch(LVar0)
1030 CaseGt(99)
1034 EndSwitch
1035 EndIf
1036 Label(11)
1038 IfEq(LVar0, 0)
1039 Wait(1)
1040 Goto(11)
1041 EndIf
1042 Wait(15)
1045 Wait(15)
1052 Return
1053 End
1054};
1055
1056EvtScript N(fireShell) = {
1059 Call(SetupMashMeter, 5, 35, 60, 80, 99, 100)
1062 Add(LVar0, 30)
1070 Wait(15)
1074 Set(LVarD, 75 * DT)
1075 Set(LVarC, LVarD)
1076 Add(LVarC, -3)
1079 Set(LVarA, Float(8.0))
1084 Wait(1)
1085 Call(ModifyActorDecoration, ACTOR_PARTNER, -1, 0, 10, 10, 255, 0)
1092 Set(LVar8, 30)
1093 Set(LVar9, 30)
1094 Loop(LVarD)
1095 Wait(1)
1097 Switch(LVar0)
1098 CaseGe(80 * DT)
1100 Set(LVar9, 80 * DT)
1102 IfNe(LVar6, LVar7)
1104 Call(SetActorPaletteSwapParams, ACTOR_PARTNER, -1, LVar6, LVar7, 1, 10, 1000, 10, 0, 0)
1105 Set(LVar6, LVar7)
1106 EndIf
1107 CaseGe(60 * DT)
1109 Set(LVar9, 60 * DT)
1111 IfNe(LVar6, LVar7)
1113 Call(SetActorPaletteSwapParams, ACTOR_PARTNER, -1, LVar6, LVar7, 1, 10, 1000, 10, 0, 0)
1114 Set(LVar6, LVar7)
1115 EndIf
1116 CaseGe(40 * DT)
1118 Set(LVar9, 40 * DT)
1120 IfNe(LVar6, LVar7)
1122 Call(SetActorPaletteSwapParams, ACTOR_PARTNER, -1, LVar6, LVar7, 1, 10, 1000, 10, 0, 0)
1123 Set(LVar6, LVar7)
1124 EndIf
1125 CaseGe(20 * DT)
1127 Set(LVar9, 35 * DT)
1129 IfNe(LVar6, LVar7)
1131 Call(SetActorPaletteSwapParams, ACTOR_PARTNER, -1, LVar6, LVar7, 1, 10, 1000, 10, 0, 0)
1132 Set(LVar6, LVar7)
1133 EndIf
1136 Set(LVar9, 30 * DT)
1138 IfNe(LVar6, LVar7)
1140 Call(SetActorPaletteSwapParams, ACTOR_PARTNER, -1, LVar6, LVar7, 1, 10, 1000, 10, 0, 0)
1141 Set(LVar6, LVar7)
1142 EndIf
1143 EndSwitch
1144 IfLt(LVar8, LVar9)
1145 Add(LVar8, 1)
1146 EndIf
1147 IfGt(LVar8, LVar9)
1148 Sub(LVar8, 1)
1149 EndIf
1151 Switch(LVarD)
1152 CaseEq(10 * DT)
1154 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar3, LVar4, LVar5, 32, 4, 0, 10, 0)
1155 CaseEq(20 * DT)
1157 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar3, LVar4, LVar5, 32, 4, 0, 10, 0)
1158 CaseEq(40 * DT)
1160 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar3, LVar4, LVar5, 32, 4, 0, 10, 0)
1161 CaseEq(60 * DT)
1163 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar3, LVar4, LVar5, 32, 4, 0, 10, 0)
1164 EndSwitch
1165 EndLoop
1168 Switch(LVarE)
1169 CaseOrEq(0)
1170 CaseOrEq(1)
1173 SetF(LVarA, Float(10.0))
1175 CaseOrEq(2)
1176 CaseOrEq(3)
1179 SetF(LVarA, Float(10.0))
1181 CaseEq(4)
1184 SetF(LVarA, Float(16.0))
1185 EndSwitch
1186 Set(LVarB, 350)
1187 DivF(LVarB, LVarA)
1188 Thread
1190 Wait(1)
1191 Switch(LVarE)
1192 CaseOrEq(0)
1193 CaseOrEq(1)
1194 Call(ModifyActorDecoration, ACTOR_PARTNER, -1, 1, 50, 0, 0, 0)
1196 CaseOrEq(2)
1197 CaseOrEq(3)
1198 Call(ModifyActorDecoration, ACTOR_PARTNER, -1, 1, 100, 0, 0, 0)
1200 CaseEq(4)
1201 Call(ModifyActorDecoration, ACTOR_PARTNER, -1, 1, 300, 0, 0, 0)
1202 EndSwitch
1205 Add(LVar0, 350)
1211 Wait(20)
1214 Call(SetActorPos, ACTOR_PARTNER, -200, 0, 0)
1216 Call(AddGoalPos, ACTOR_PARTNER, 40, 0, 0)
1221 EndThread
1223 Set(LFlag0, FALSE)
1224 Label(10)
1225 Wait(1)
1229 IfGt(LVar0, LVar3)
1230 Goto(10)
1231 EndIf
1233 IfEq(LVar0, 6)
1234 Goto(12)
1235 EndIf
1236 IfEq(LFlag0, FALSE)
1238 Switch(LVar0)
1239 CaseGt(99)
1243 EndSwitch
1244 EndIf
1245 Set(LFlag0, TRUE)
1248 Switch(LVar0)
1249 CaseGt(99)
1253 EndSwitch
1255 Label(12)
1258 Goto(10)
1259 EndIf
1260 IfEq(LFlag0, FALSE)
1262 Switch(LVar0)
1263 CaseGt(99)
1267 EndSwitch
1268 EndIf
1269 Label(11)
1271 IfEq(LVar0, 0)
1272 Wait(1)
1273 Goto(11)
1274 EndIf
1275 Wait(15)
1278 Wait(15)
1285 Return
1286 End
1287};
1288
1291 Add(LVar0, 60)
1303 Thread
1304 Call(N(SlowDown))
1306 EndThread
1307 Wait(4)
1310 Set(LVar0, 0)
1311 Loop(2)
1312 Add(LVar0, -30)
1314 Wait(1)
1315 EndLoop
1316 Wait(5)
1318 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar4, LVar5, LVar6, 16, 4, 0, 10, 0)
1319 Loop(5)
1320 Add(LVar0, 12)
1322 Wait(1)
1323 EndLoop
1326 Wait(2)
1328 Wait(2)
1330 Wait(10)
1332 Wait(10)
1337 Return
1338 EndIf
1339 Set(LVarF, 1)
1341 Switch(LVar2)
1343 Set(LVarF, 1)
1345 Set(LVarF, 2)
1347 Set(LVarF, 3)
1348 EndSwitch
1351 Switch(LVar2)
1358 EndSwitch
1361 Sub(LVar0, 40)
1362 Set(LVar1, 0)
1366 Sub(LVar0, 30)
1369 Sub(LVar0, 20)
1372 Sub(LVar0, 10)
1375 Wait(15)
1384 Return
1385 End
1386};
BSS s32 PopupMenu_SelectedIndex
@ AC_DIFFICULTY_3
Definition action_cmd.h:45
s8 selectedTargetIndex
ActorState state
struct SelectableTarget targetData[24]
Vec3f curPos
s8 targetIndexList[24]
Bytecode EvtScript[]
s8 targetListLength
#define clamp_angle
@ ACTION_COMMAND_SMASH
Definition enums.h:3474
@ ACTION_COMMAND_FIRE_SHELL
Definition enums.h:3481
@ ACTION_COMMAND_DIZZY_SHELL
Definition enums.h:3480
@ BUTTON_STICK_LEFT
Definition enums.h:2793
@ ACTOR_SOUND_WALK
Definition enums.h:2034
@ 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
@ 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
@ ACTOR_PAL_ADJUST_BLEND_PALETTES_VARYING_INTERVALS
Definition enums.h:2253
@ ACTOR_EVENT_FLAGS_NONE
Definition enums.h:3370
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
Definition enums.h:3374
@ ACTOR_DECORATION_GREY_SMOKE_TRAIL
Definition enums.h:2048
@ ACTOR_DECORATION_RED_FLAMES
Definition enums.h:2047
@ ACTOR_DECORATION_WHIRLWIND
Definition enums.h:2050
@ ACTOR_DECORATION_FIRE_SMOKE_TRAIL
Definition enums.h:2049
@ 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
@ PHASE_FIRST_STRIKE
Definition enums.h:2059
@ BTL_MENU_TYPE_STAR_POWERS
Definition enums.h:4234
#define SUPPRESS_EVENTS_KOOPER_DAMAGE
Definition enums.h:2923
@ 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_DEFAULT
Definition enums.h:4823
@ 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
@ EASING_QUARTIC_OUT
Definition enums.h:516
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6407
@ STATUS_FLAG_DIZZY
Definition enums.h:2818
@ DMG_SRC_DIZZY_SHELL
Definition enums.h:1996
@ DMG_SRC_POWER_SHELL
Definition enums.h:1995
@ DMG_SRC_FIRE_SHELL
Definition enums.h:1997
@ DMG_SRC_SHELL_TOSS
Definition enums.h:1994
@ SOUND_NO_DAMGE
Definition enums.h:1433
@ SOUND_NONE
Definition enums.h:547
@ SOUND_PARAKARRY_AIR_RAID_1
Definition enums.h:1319
@ SOUND_DIZZY_SHELL_LAUNCH
Definition enums.h:1007
@ SOUND_ROARING_FIRE
Definition enums.h:1005
@ SOUND_PARAKARRY_AIR_RAID_2
Definition enums.h:1320
@ SOUND_KOOPER_SHELL_SPINUP
Definition enums.h:1321
@ SOUND_FIRE_SHELL_LAUNCH
Definition enums.h:1006
@ SOUND_DIZZY_SHELL
Definition enums.h:1346
#define SUPPRESS_EVENTS_KOOPER_TEST
Definition enums.h:2918
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PARTNER
Definition enums.h:2086
@ ACTOR_SELF
Definition enums.h:2084
@ 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_STATUS_ALWAYS_HITS
Definition enums.h:2880
@ DAMAGE_TYPE_FIRE
Definition enums.h:2852
@ DAMAGE_TYPE_MULTIPLE_POPUPS
Definition enums.h:2879
#define ApiStatus_DONE2
Definition evt.h:118
#define ApiStatus_BLOCK
Definition evt.h:116
void add_xz_vec3f(Vec3f *vector, f32 speed, f32 angleDeg)
Definition 190B20.c:1139
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
void play_movement_dust_effects(s32 var0, f32 xPos, f32 yPos, f32 zPos, f32 angleDeg)
Definition 190B20.c:1166
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_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 LVar6
Definition macros.h:154
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define DivF(VAR, FLOAT_VALUE)
Definition macros.h:386
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#define 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 IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
Definition macros.h:275
#define Float(DOUBLE)
Definition macros.h:51
#define 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 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 LVar7
Definition macros.h:155
#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 LVar8
Definition macros.h:156
#define LVar2
Definition macros.h:150
#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 LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LVar9
Definition macros.h:157
#define 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 CaseLt(RVAR)
Marks the start of a switch case that executes only if LVAR < RVAR. It also marks the end of any prev...
Definition macros.h:325
#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
BattleStatus gBattleStatus
Definition battle.c:11