Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
camera.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3
4// lerp from a to b as alpha goes from 1.0 to 0.0
5#define LERP(a, b, alpha) ((a) * (alpha) + (b) * (1.0f-(alpha)))
6
7#define QUADRATIC_SINE_INTERP(alpha) (1.0f - sin_rad(sin_rad((1.0f - alpha) * PI_S / 2) * PI_S / 2))
8#define CUBIC_SINE_INTERP(alpha) (1.0f - sin_rad(sin_rad(sin_rad((1.0f - alpha) * PI_S / 2) * PI_S / 2) * PI_S / 2))
9
10static f32 BattleCam_PosX;
11static f32 BattleCam_PosY;
12static f32 BattleCam_PosZ;
13static s16 BattleCam_SubjectActor;
14static s16 BattleCam_SubjectActorPart;
15static s16 BattleCam_BoomLength;
16static s16 BattleCam_BoomYaw;
17static s16 BattleCam_BoomPitch;
18static s16 BattleCam_BoomOffsetY;
19static f32 BattleCam_InitialBoomLength;
20static f32 BattleCam_InitialBoomYaw;
21static f32 BattleCam_InitialBoomPitch;
22static f32 BattleCam_InitialBoomOffsetY;
23static b8 BattleCam_DoneMoving;
24static s16 BattleCam_MoveTimeLeft;
25static s16 BattleCam_MoveTimeTotal;
26static s8 BattleCam_AdjustTargetXMode;
27static s8 BattleCam_AdjustTargetYMode;
28static b8 BattleCam_SetImmediately;
29static b8 BattleCam_UseLinearInterp;
30static b8 BattleCam_ClampPosX;
31static s8 BattleCam_ExtraOffsetX;
32static f32 BattleCam_InitialPosX;
33static f32 BattleCam_InitialPosY;
34static f32 BattleCam_InitialPosZ;
35static EvtScript* BattleCam_ControlScript;
36
39
49
50f32 clamp_edge_pos_x(f32 x) {
51 if (BattleCam_ClampPosX) {
52 f32 upperBound = (500.0f - BattleCam_InitialBoomLength) * 0.4 + 30.0;
53 f32 lowerBound = -upperBound;
54
55 if (x < lowerBound) {
56 x += (lowerBound - x) / 2;
57 }
58 if (x > upperBound) {
59 x += (upperBound - x) / 2;
60 }
61 }
62 return x;
63}
64
66 s32 actorClass = BattleCam_SubjectActor & ACTOR_CLASS_MASK;
67 s32 actorID = BattleCam_SubjectActor & 0xFF;
68 ActorPart* part = NULL;
69 Actor* actor;
70 Actor* targetActor;
71 f32 deltaY;
72
73 switch (actorClass) {
76 break;
79 break;
81 actor = gBattleStatus.enemyActors[actorID];
82 if (usePart && actor != NULL) {
83 part = get_actor_part(actor, BattleCam_SubjectActorPart);
84 }
85 break;
86 default:
87 return FALSE;
88 }
89
90 if (actor == NULL) {
91 return FALSE;
92 }
93
94 if (part != NULL) {
95 subjects->actorPos.x = part->absolutePos.x;
96 subjects->actorPos.y = part->absolutePos.y + part->size.y / 2 + part->size.y / 4;
97 subjects->actorPos.z = part->absolutePos.z;
98
99 subjects->actorSize.x = part->size.x;
100 subjects->actorSize.y = part->size.y;
101 } else {
102 subjects->actorPos.x = actor->curPos.x;
103 subjects->actorPos.y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4;
104 subjects->actorPos.z = actor->curPos.z;
105
106 subjects->actorSize.x = actor->size.x;
107 subjects->actorSize.y = actor->size.y;
108 }
109 subjects->actorSizeAvg = (subjects->actorSize.x + subjects->actorSize.y) / 2;
110
111 targetActor = get_actor(actor->targetActorID);
112 if (targetActor == NULL) {
113 return FALSE;
114 }
115
116 subjects->targetPos.x = targetActor->curPos.x;
117 subjects->targetPos.y = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4;
118 subjects->targetPos.z = targetActor->curPos.z;
119
120 subjects->targetSize.x = targetActor->size.x;
121 subjects->targetSize.y = targetActor->size.y;
122 subjects->targetSizeAvg = (subjects->targetSize.x + subjects->targetSize.y) / 2;
123
124 subjects->avgPos.x = (subjects->actorPos.x + subjects->targetPos.x) / 2;
125 subjects->avgPos.z = (subjects->actorPos.z + subjects->targetPos.z) / 2;
126 deltaY = subjects->actorPos.y - subjects->targetPos.y;
127
128 switch (actorClass) {
130 switch (BattleCam_AdjustTargetYMode) {
132 // final position is weighted 75% actor and 25% target:
133 // = a - (a - t) / 4
134 // = (4a - a + t) / 4
135 // = (3a + t) / 4
136 subjects->avgPos.y = subjects->actorPos.y - deltaY / 4;
137 break;
139 subjects->avgPos.y = subjects->targetPos.y;
140 break;
142 subjects->avgPos.y = subjects->actorPos.y;
143 break;
144 case BTL_CAM_YADJ_AVG:
145 // final position is weighted 66% actor and 33% target:
146 // = t + (a - t) / 2 + (a - t) / 6
147 // = (6t + 3a - 3t + a - t) / 6
148 // = (2t + 4a) / 6
149 subjects->avgPos.y = subjects->targetPos.y + deltaY / 2 + deltaY / 6;
150 break;
151 }
152 break;
154 switch (BattleCam_AdjustTargetYMode) {
156 subjects->avgPos.y = subjects->targetPos.y;
157 break;
159 subjects->avgPos.y = subjects->actorPos.y;
160 break;
161 case BTL_CAM_YADJ_AVG:
162 // same math as ACTOR_CLASS_PLAYER
163 subjects->avgPos.y = subjects->targetPos.y + deltaY / 2 + deltaY / 6;
164 break;
165 }
166 break;
168 switch (BattleCam_AdjustTargetYMode) {
170 subjects->avgPos.y = subjects->actorPos.y;
171 break;
173 subjects->avgPos.y = subjects->targetPos.y;
174 break;
176 subjects->avgPos.y = subjects->actorPos.y;
177 break;
178 case BTL_CAM_YADJ_AVG:
179 // same math as ACTOR_CLASS_PLAYER
180 subjects->avgPos.y = subjects->targetPos.y + deltaY / 2 + deltaY / 6;
181 break;
182 }
183 break;
184 default:
185 return FALSE;
186 }
187
188 return TRUE;
189}
190
191API_CALLABLE(BattleCam_Update_Interrupt) {
192 BattleCam_DoneMoving = TRUE;
193 return ApiStatus_BLOCK;
194}
195
206API_CALLABLE(BattleCam_Update_FocusMidpointA) {
207 Camera* camera = &gCameras[CAM_BATTLE];
208 CamSubjects subjects;
209 Vec3f prevPos;
210 f32 alpha;
211 f32 targetBoomLength;
212
213 if (!get_cam_subject_properties(&subjects, FALSE)) {
214 return ApiStatus_BLOCK;
215 }
216
217 subjects.avgPos.x = clamp_edge_pos_x(subjects.avgPos.x);
218
219 if (isInitialCall) {
220 BattleCam_BoomLength += MAX(0, subjects.actorSize.x - 24.0);
221 BattleCam_BoomLength += MAX(0, subjects.actorSize.y - 24.0);
222
223 if (BattleCam_SetImmediately) {
224 camera->lookAt_obj_target.x = subjects.avgPos.x;
225 camera->lookAt_obj_target.y = subjects.avgPos.y;
226 camera->lookAt_obj_target.z = subjects.avgPos.z;
227
228 camera->params.basic.dist = BattleCam_BoomLength;
229 camera->params.basic.pitch = BattleCam_BoomPitch;
230 camera->params.basic.yaw = BattleCam_BoomYaw;
231 camera->params.basic.offsetY = BattleCam_BoomOffsetY * 256;
232 }
233
234 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
235 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
236 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
237
238 BattleCam_InitialBoomLength = camera->params.basic.dist;
239 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
240 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
241 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
242
243 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
244 }
245
246 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
247 if (!BattleCam_UseLinearInterp) {
248 alpha = CUBIC_SINE_INTERP(alpha);
249 }
250
251 prevPos.x = camera->lookAt_obj_target.x;
252 prevPos.y = camera->lookAt_obj_target.y;
253 prevPos.z = camera->lookAt_obj_target.z;
254
255 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, subjects.avgPos.x, alpha);
256 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, subjects.avgPos.y, alpha);
257 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, subjects.avgPos.z, alpha);
258
259 targetBoomLength = BattleCam_BoomLength;
260 targetBoomLength += dist2D(camera->lookAt_obj_target.x, camera->lookAt_obj_target.z, subjects.avgPos.x, subjects.avgPos.z);
261 //NOTE division by 8 here is only difference between this and BattleCam_Update_FocusMidpointB
262 targetBoomLength += (subjects.actorSizeAvg + subjects.targetSizeAvg) / 8;
263 targetBoomLength -= 64.0f;
264 targetBoomLength += 0.5f * dist3D(prevPos.z, prevPos.y, prevPos.z, subjects.targetPos.x, subjects.targetPos.y, subjects.targetPos.z);
265
266 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, targetBoomLength, alpha);
267 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
268 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
269 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
270
271 if (BattleCam_MoveTimeLeft == 0) {
272 BattleCam_DoneMoving = TRUE;
273 } else {
274 BattleCam_MoveTimeLeft--;
275 }
276
277 return ApiStatus_BLOCK;
278}
279
290API_CALLABLE(BattleCam_Update_FocusMidpointB) {
291 Camera* camera = &gCameras[CAM_BATTLE];
292 CamSubjects subjects;
293 Vec3f prevPos;
294 f32 alpha;
295 f32 targetBoomLength;
296
297 if (!get_cam_subject_properties(&subjects, FALSE)) {
298 return ApiStatus_BLOCK;
299 }
300
301 subjects.avgPos.x = clamp_edge_pos_x(subjects.avgPos.x);
302
303 if (isInitialCall) {
304 BattleCam_BoomLength += MAX(0, subjects.actorSize.x - 24.0);
305 BattleCam_BoomLength += MAX(0, subjects.actorSize.y - 24.0);
306
307 if (BattleCam_SetImmediately) {
308 camera->lookAt_obj_target.x = subjects.avgPos.x;
309 camera->lookAt_obj_target.y = subjects.avgPos.y;
310 camera->lookAt_obj_target.z = subjects.avgPos.z;
311
312 camera->params.basic.dist = BattleCam_BoomLength;
313 camera->params.basic.pitch = BattleCam_BoomPitch;
314 camera->params.basic.yaw = BattleCam_BoomYaw;
315 camera->params.basic.offsetY = BattleCam_BoomOffsetY * 256;
316 }
317
318 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
319 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
320 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
321
322 BattleCam_InitialBoomLength = camera->params.basic.dist;
323 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
324 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
325 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
326
327 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
328 }
329
330 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
331 if (!BattleCam_UseLinearInterp) {
332 alpha = CUBIC_SINE_INTERP(alpha);
333 }
334
335 prevPos.x = camera->lookAt_obj_target.x;
336 prevPos.y = camera->lookAt_obj_target.y;
337 prevPos.z = camera->lookAt_obj_target.z;
338
339 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, subjects.avgPos.x, alpha);
340 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, subjects.avgPos.y, alpha);
341 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, subjects.avgPos.z, alpha);
342
343 targetBoomLength = BattleCam_BoomLength;
344 targetBoomLength += dist2D(camera->lookAt_obj_target.x, camera->lookAt_obj_target.z, subjects.avgPos.x, subjects.avgPos.z);
345 targetBoomLength += subjects.actorSizeAvg - 32.0f;
346 targetBoomLength += subjects.targetSizeAvg - 32.0f;
347 targetBoomLength += 0.5f * dist3D(prevPos.z, prevPos.y, prevPos.z, subjects.targetPos.x, subjects.targetPos.y, subjects.targetPos.z);
348
349 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, targetBoomLength, alpha);
350 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
351 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
352 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
353
354 if (BattleCam_MoveTimeLeft == 0) {
355 BattleCam_DoneMoving = TRUE;
356 } else {
357 BattleCam_MoveTimeLeft--;
358 }
359
360 return ApiStatus_BLOCK;
361}
362
373API_CALLABLE(BattleCam_Update_FocusActorPart) {
374 Camera* camera = &gCameras[CAM_BATTLE];
375 CamSubjects subjects;
376 f32 alpha;
377
378 if (!get_cam_subject_properties(&subjects, TRUE)) {
379 return ApiStatus_BLOCK;
380 }
381
382 subjects.avgPos.x = clamp_edge_pos_x(subjects.avgPos.x);
383
384 if (isInitialCall) {
385 BattleCam_BoomLength += MAX(0, subjects.actorSize.x - 24.0);
386 BattleCam_BoomLength += MAX(0, subjects.actorSize.y - 24.0);
387
388 if (BattleCam_SetImmediately) {
389 camera->lookAt_obj_target.x = subjects.avgPos.x;
390 camera->lookAt_obj_target.y = subjects.avgPos.y;
391 camera->lookAt_obj_target.z = subjects.avgPos.z;
392
393 camera->params.basic.dist = BattleCam_BoomLength;
394 camera->params.basic.pitch = BattleCam_BoomPitch;
395 camera->params.basic.yaw = BattleCam_BoomYaw;
396 camera->params.basic.offsetY = BattleCam_BoomOffsetY * 256;
397 }
398
399 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
400 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
401 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
402
403 BattleCam_InitialBoomLength = camera->params.basic.dist;
404 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
405 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
406 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
407
408 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
409 }
410
411 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
412 if (!BattleCam_UseLinearInterp) {
413 alpha = CUBIC_SINE_INTERP(alpha);
414 }
415
416 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, subjects.avgPos.x, alpha);
417 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, subjects.avgPos.y, alpha);
418 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, subjects.avgPos.z, alpha);
419
420 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, BattleCam_BoomLength, alpha);
421 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
422 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
423 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
424
425 if (BattleCam_MoveTimeLeft == 0) {
426 BattleCam_DoneMoving = TRUE;
427 } else {
428 BattleCam_MoveTimeLeft--;
429 }
430
431 return ApiStatus_BLOCK;
432}
433
441API_CALLABLE(BattleCam_Update_FocusActor) {
442 Camera* camera = &gCameras[CAM_BATTLE];
443 Actor* actor;
444 f32 actorX, actorY, actorZ;
445 f32 actorSize;
446 f32 alpha;
447 f32 targetBoomLength;
448 s32 actorClass = BattleCam_SubjectActor & ACTOR_CLASS_MASK;
449 s32 actorID = BattleCam_SubjectActor & 0xFF;
450
451 switch (actorClass) {
454 if (actor == NULL) {
456 return ApiStatus_BLOCK;
457 }
458 actorX = actor->curPos.x;
459 actorY = actor->curPos.y + gPlayerStatus.colliderHeight / 2;
460 actorZ = actor->curPos.z;
461
462 actorSize = (actor->size.x + actor->size.y) / 2;
463 break;
466 if (actor == NULL) {
468 return ApiStatus_BLOCK;
469 }
470 actorX = actor->curPos.x;
471 actorY = actor->curPos.y + actor->size.y / 2;
472 actorZ = actor->curPos.z;
473
474 actorSize = (actor->size.x + actor->size.y) / 2;
475 break;
477 actor = gBattleStatus.enemyActors[actorID];
478 if (actor == NULL) {
480 return ApiStatus_BLOCK;
481 }
482 actorX = actor->curPos.x;
483 actorY = actor->curPos.y + actor->size.y / 2;
484 actorZ = actor->curPos.z;
485
486 actorSize = (actor->size.x + actor->size.y) / 2;
487 break;
488 default:
489 return ApiStatus_DONE2;
490 }
491
492 actorX = clamp_edge_pos_x(actorX);
493
494 if (isInitialCall) {
495 BattleCam_BoomLength += MAX(0, actor->size.x - 24.0);
496 BattleCam_BoomLength += MAX(0, actor->size.y - 24.0);
497
498 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
499 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
500 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
501
502 BattleCam_InitialBoomLength = camera->params.basic.dist;
503 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
504 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
505 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
506
507 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
508 }
509
510 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
511 if (!BattleCam_UseLinearInterp) {
512 alpha = CUBIC_SINE_INTERP(alpha);
513 }
514
515 if (BattleCam_AdjustTargetXMode != BTL_CAM_XADJ_NONE) {
516 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, actorX + BattleCam_ExtraOffsetX, alpha);
517 }
518 if (BattleCam_AdjustTargetYMode != BTL_CAM_YADJ_NONE) {
519 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, actorY, alpha);
520 }
521 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, actorZ, alpha);
522
523 targetBoomLength = BattleCam_BoomLength;
524 targetBoomLength += actorSize - 32.0f;
525
526 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, targetBoomLength, alpha);
527 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
528 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
529 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
530
531 if (BattleCam_MoveTimeLeft == 0) {
532 BattleCam_DoneMoving = TRUE;
533 } else {
534 BattleCam_MoveTimeLeft--;
535 }
536
537 return ApiStatus_BLOCK;
538}
539
547API_CALLABLE(BattleCam_Update_FocusGoal) {
548 Camera* camera = &gCameras[CAM_BATTLE];
549 s32 actorClass = BattleCam_SubjectActor & ACTOR_CLASS_MASK;
550 s32 actorID = BattleCam_SubjectActor & 0xFF;
551 Actor* actor;
552 f32 goalX, goalY, goalZ;
553 f32 actorX, actorY;
554 f32 actorSizeAvg;
555 f32 targetBoomLength;
556 f32 alpha;
557
558 switch (actorClass) {
561 if (actor == NULL) {
562 return ApiStatus_BLOCK;
563 }
564 goalX = actor->state.goalPos.x;
565 goalY = actor->state.goalPos.y;
566 goalZ = actor->state.goalPos.z;
567 actorX = actor->curPos.x;
568 actorY = actor->curPos.y + gPlayerStatus.colliderHeight / 2;
569 actorSizeAvg = (actor->size.y + actor->size.x) / 2;
570 break;
573 if (actor == NULL) {
574 return ApiStatus_BLOCK;
575 }
576 goalX = actor->state.goalPos.x;
577 goalY = actor->state.goalPos.y;
578 goalZ = actor->state.goalPos.z;
579 actorX = actor->curPos.x;
580 actorY = actor->curPos.y + actor->size.y / 2;
581 actorSizeAvg = (actor->size.y + actor->size.x) / 2;
582 break;
584 actor = gBattleStatus.enemyActors[actorID];
585 if (actor == NULL) {
586 return ApiStatus_BLOCK;
587 }
588 goalX = actor->state.goalPos.x;
589 goalY = actor->state.goalPos.y;
590 goalZ = actor->state.goalPos.z;
591 actorX = actor->curPos.x;
592 actorY = actor->curPos.y + actor->size.y / 2;
593 actorSizeAvg = (actor->size.y + actor->size.x) / 2;
594 break;
595 default:
596 return ApiStatus_DONE2;
597 }
598
599 if (BattleCam_AdjustTargetYMode != BTL_CAM_YADJ_NONE) {
600 f32 delta = actorY - goalY;
601 goalY += delta / 2 + delta / 6.0f;
602 }
603
604 if (BattleCam_AdjustTargetXMode != BTL_CAM_XADJ_NONE) {
605 goalX = (actorX + goalX) / 2;
606 if (goalX > 75.0f) {
607 goalX -= fabsf(75.0f - goalX);
608 }
609 }
610
611 goalX = clamp_edge_pos_x(goalX);
612
613 if (isInitialCall) {
614 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
615 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
616 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
617
618 BattleCam_InitialBoomLength = camera->params.basic.dist;
619 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
620 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
621 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
622
623 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
624 }
625
626 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
627 if (!BattleCam_UseLinearInterp) {
628 alpha = CUBIC_SINE_INTERP(alpha);
629 }
630
631 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, goalX, alpha);
632 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, goalY, alpha);
633 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, goalZ, alpha);
634
635 targetBoomLength = BattleCam_BoomLength;
636 targetBoomLength += actorSizeAvg - 32.0f;
637
638 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, targetBoomLength, alpha);
639 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
640 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
641 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
642
643 if (BattleCam_MoveTimeLeft == 0) {
644 BattleCam_DoneMoving = TRUE;
645 } else {
646 BattleCam_MoveTimeLeft--;
647 }
648
649 return ApiStatus_BLOCK;
650}
651
660API_CALLABLE(BattleCam_Update_SimpleLerp_Unskippable) {
661 Camera* camera = &gCameras[CAM_BATTLE];
662 f32 alpha;
663
664 if (isInitialCall) {
665 BattleCam_InitialBoomLength = camera->params.basic.dist;
666 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
667 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
668 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
669 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
670 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
671 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
672
673 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
674 }
675
676 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
677 if (!BattleCam_UseLinearInterp) {
678 alpha = CUBIC_SINE_INTERP(alpha);
679 }
680
681 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, BattleCam_PosX, alpha);
682 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, BattleCam_PosY, alpha);
683 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, BattleCam_PosZ, alpha);
684
685 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, BattleCam_BoomLength, alpha);
686 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
687 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
688 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
689
690 if (BattleCam_MoveTimeLeft == 0) {
691 BattleCam_DoneMoving = TRUE;
692 } else {
693 BattleCam_MoveTimeLeft--;
694 }
695
696 return ApiStatus_BLOCK;
697}
698
705API_CALLABLE(BattleCam_Update_ResetToNeutral_Skippable) {
706 Camera* camera = &gCameras[CAM_BATTLE];
707 f32 alpha;
708
709 if (isInitialCall) {
710 BattleCam_PosX = 0.0f;
711 BattleCam_PosY = 60.0f;
712 BattleCam_PosZ = 0.0f;
713
714 BattleCam_BoomYaw = 0;
715 BattleCam_BoomOffsetY = 0;
716
717 if (BattleCam_SetImmediately) {
718 camera->lookAt_obj_target.x = BattleCam_PosX;
719 camera->lookAt_obj_target.y = BattleCam_PosY;
720 camera->lookAt_obj_target.z = BattleCam_PosZ;
721
722 camera->params.basic.dist = BattleCam_BoomLength;
723 camera->params.basic.pitch = BattleCam_BoomPitch;
724 camera->params.basic.yaw = BattleCam_BoomYaw;
725 camera->params.basic.offsetY = BattleCam_BoomOffsetY;
726 }
727
728 BattleCam_InitialBoomLength = camera->params.basic.dist;
729 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
730 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
731 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
732 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
733 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
734 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
735
736 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
737 }
738
739 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
740 if (!BattleCam_UseLinearInterp) {
741 alpha = QUADRATIC_SINE_INTERP(alpha);
742 }
743
744 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, BattleCam_PosX, alpha);
745 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, BattleCam_PosY, alpha);
746 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, BattleCam_PosZ, alpha);
747
748 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, BattleCam_BoomLength, alpha);
749 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
750 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
751 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
752
753 if (BattleCam_MoveTimeLeft == 0) {
754 BattleCam_DoneMoving = TRUE;
755 } else {
756 BattleCam_MoveTimeLeft--;
757 }
758
759 return ApiStatus_BLOCK;
760}
761
768API_CALLABLE(BattleCam_Update_ViewAllEnemies) {
769 Camera* camera = &gCameras[CAM_BATTLE];
770 f32 alpha;
771
772 if (isInitialCall) {
773 BattleCam_PosX = 35.0f;
774 BattleCam_PosY = 60.0f;
775 BattleCam_PosZ = 0.0f;
776
777 BattleCam_BoomYaw = 0;
778
779 BattleCam_InitialBoomLength = camera->params.basic.dist;
780 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
781 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
782 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
783 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
784 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
785 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
786
787 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
788 }
789
790 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
791 if (!BattleCam_UseLinearInterp) {
792 alpha = CUBIC_SINE_INTERP(alpha);
793 }
794
795 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, BattleCam_PosX, alpha);
796 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, BattleCam_PosY, alpha);
797 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, BattleCam_PosZ, alpha);
798
799 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, BattleCam_BoomLength, alpha);
800 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
801 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
802 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
803
804 if (BattleCam_MoveTimeLeft == 0) {
805 BattleCam_DoneMoving = TRUE;
806 } else {
807 BattleCam_MoveTimeLeft--;
808 }
809
810 return ApiStatus_BLOCK;
811}
812
820API_CALLABLE(BattleCam_Update_ViewAllEnemies_MaintainY) {
821 Camera* camera = &gCameras[CAM_BATTLE];
822 f32 alpha;
823
824 if (isInitialCall) {
825 BattleCam_PosX = 35.0f;
826 BattleCam_PosY = MAX(camera->lookAt_obj_target.y, 60.0f);
827 BattleCam_PosZ = 0.0f;
828
829 BattleCam_BoomYaw = 0;
830 BattleCam_InitialBoomLength = camera->params.basic.dist;
831 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
832 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
833 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
834 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
835 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
836 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
837
838 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
839 }
840
841 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
842 if (!BattleCam_UseLinearInterp) {
843 alpha = CUBIC_SINE_INTERP(alpha);
844 }
845
846 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, BattleCam_PosX, alpha);
847 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, BattleCam_PosY, alpha);
848 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, BattleCam_PosZ, alpha);
849
850 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, BattleCam_BoomLength, alpha);
851 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
852 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
853 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
854
855 if (BattleCam_MoveTimeLeft == 0) {
856 BattleCam_DoneMoving = TRUE;
857 } else {
858 BattleCam_MoveTimeLeft--;
859 }
860
861 return ApiStatus_BLOCK;
862}
863
873API_CALLABLE(BattleCam_Update_SimpleLerp_Skippable) {
874 Camera* camera = &gCameras[CAM_BATTLE];
875 f32 alpha;
876
877 if (isInitialCall) {
878 if (BattleCam_SetImmediately) {
879 BattleCam_PosX = camera->lookAt_obj_target.x;
880 BattleCam_PosY = camera->lookAt_obj_target.y;
881 BattleCam_PosZ = camera->lookAt_obj_target.z;
882 }
883 BattleCam_InitialBoomLength = camera->params.basic.dist;
884 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
885 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
886 BattleCam_InitialBoomOffsetY = camera->params.basic.offsetY / 256;
887 BattleCam_InitialPosX = camera->lookAt_obj_target.x;
888 BattleCam_InitialPosY = camera->lookAt_obj_target.y;
889 BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
890
891 BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
892 }
893
894 alpha = (f32) BattleCam_MoveTimeLeft / BattleCam_MoveTimeTotal;
895 if (!BattleCam_UseLinearInterp) {
896 alpha = CUBIC_SINE_INTERP(alpha);
897 }
898
899 camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, BattleCam_PosX, alpha);
900 camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, BattleCam_PosY, alpha);
901 camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, BattleCam_PosZ, alpha);
902
903 camera->params.basic.dist = LERP(BattleCam_InitialBoomLength, BattleCam_BoomLength, alpha);
904 camera->params.basic.yaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
905 camera->params.basic.pitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);
906 camera->params.basic.offsetY = LERP(BattleCam_InitialBoomOffsetY, BattleCam_BoomOffsetY, alpha) * 256.0f;
907
908 if (BattleCam_MoveTimeLeft == 0) {
909 BattleCam_DoneMoving = TRUE;
910 } else {
911 BattleCam_MoveTimeLeft--;
912 }
913
914 return ApiStatus_BLOCK;
915}
916
919API_CALLABLE(BattleCam_Update_FollowActorY) {
920 Camera* camera = &gCameras[CAM_BATTLE];
921 s32 screenX, screenY, screenZ;
922 f32 delta;
923 f32 actorY;
924 s32 actorID;
925 s32 actorClass;
926
927 if (isInitialCall) {
928 BattleCam_PosX = camera->lookAt_obj_target.x;
929 BattleCam_PosY = camera->lookAt_obj_target.y;
930 BattleCam_PosZ = camera->lookAt_obj_target.z;
931 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
932 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
933 }
934
935 actorClass = BattleCam_SubjectActor & ACTOR_CLASS_MASK;
936 actorID = BattleCam_SubjectActor & 0xFF;
937
938 switch (actorClass) {
940 if (gBattleStatus.playerActor == NULL) {
941 return ApiStatus_BLOCK;
942 }
944 break;
946 if (gBattleStatus.partnerActor == NULL) {
947 return ApiStatus_BLOCK;
948 }
950 break;
952 if (gBattleStatus.enemyActors[actorID] == NULL) {
953 return ApiStatus_BLOCK;
954 }
955 actorY = gBattleStatus.enemyActors[actorID]->curPos.y;
956 break;
957 }
958
959 get_screen_coords(CAM_BATTLE, BattleCam_PosX, actorY, BattleCam_PosZ, &screenX, &screenY, &screenZ);
960
961 if (screenY < 100) {
962 actorY += 25.0f;
963 }
964
965 if (actorY < BattleCam_PosY) {
966 actorY = BattleCam_PosY;
967 }
968
969 delta = actorY - camera->lookAt_obj_target.y;
970 if (fabsf(delta) < 0.01) {
971 camera->lookAt_obj_target.y = actorY;
972 } else {
973 camera->lookAt_obj_target.y += delta / 5.0f;
974 }
975
976 return ApiStatus_BLOCK;
977}
978
981API_CALLABLE(BattleCam_Update_FollowActorPos) {
982 Camera* camera = &gCameras[CAM_BATTLE];
983 s32 actorClass = BattleCam_SubjectActor & ACTOR_CLASS_MASK;
984 s32 actorID = BattleCam_SubjectActor & 0xFF;
985 f32 actorX, actorY, actorZ;
986 s32 screenX, screenY, screenZ;
987 f32 delta;
988
989 switch (actorClass) {
991 if (gBattleStatus.playerActor == NULL) {
992 return ApiStatus_BLOCK;
993 }
997 break;
999 if (gBattleStatus.partnerActor == NULL) {
1000 return ApiStatus_BLOCK;
1001 }
1005 break;
1006 case ACTOR_CLASS_ENEMY:
1007 if (gBattleStatus.enemyActors[actorID] == NULL) {
1008 return ApiStatus_BLOCK;
1009 }
1010 actorX = gBattleStatus.enemyActors[actorID]->curPos.x;
1011 actorY = gBattleStatus.enemyActors[actorID]->curPos.y;
1012 actorZ = gBattleStatus.enemyActors[actorID]->curPos.z;
1013 break;
1014 }
1015
1016 if (isInitialCall) {
1017 BattleCam_PosX = camera->lookAt_obj_target.x;
1018 BattleCam_PosY = camera->lookAt_obj_target.y;
1019 BattleCam_PosZ = camera->lookAt_obj_target.z;
1020 BattleCam_InitialBoomYaw = camera->params.basic.yaw;
1021 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
1022 }
1023
1024 get_screen_coords(CAM_BATTLE, actorX, actorY, actorZ, &screenX, &screenY, &screenZ);
1025
1026 if (screenY < 100) {
1027 actorY += 25.0f;
1028 }
1029 if (actorY < BattleCam_PosY) {
1030 actorY = BattleCam_PosY;
1031 }
1032
1033 if (screenX < 100) {
1034 actorX -= 25.0f;
1035 }
1036 if (actorX < BattleCam_PosX) {
1037 actorX = BattleCam_PosX;
1038 }
1039 if (screenX > 220) {
1040 actorX += 25.0f;
1041 }
1042
1043 delta = actorX - camera->lookAt_obj_target.x;
1044 if (fabsf(delta) < 0.01) {
1045 camera->lookAt_obj_target.x = actorX;
1046 } else {
1047 camera->lookAt_obj_target.x += delta / 5.0f;
1048 }
1049
1050 delta = actorY - camera->lookAt_obj_target.y;
1051 if (fabsf(delta) < 0.01) {
1052 camera->lookAt_obj_target.y = actorY;
1053 } else {
1054 camera->lookAt_obj_target.y += delta / 5.0f;
1055 }
1056
1057 delta = actorZ - camera->lookAt_obj_target.z;
1058 if (fabsf(delta) < 0.01) {
1059 camera->lookAt_obj_target.z = actorZ;
1060 } else {
1061 camera->lookAt_obj_target.z += delta / 5.0f;
1062 }
1063
1064 return ApiStatus_BLOCK;
1065}
1066
1067API_CALLABLE(BattleCam_Init) {
1068 Camera* camera = &gCameras[CAM_BATTLE];
1069 camera->params.basic.yaw = 0;
1070 camera->params.basic.offsetY = 0;
1071
1072 BattleCam_BoomPitch = 8;
1073 BattleCam_BoomYaw = 0;
1074 BattleCam_BoomOffsetY = 0;
1075
1076 BattleCam_IsFrozen = FALSE;
1077
1078 BattleCam_InitialBoomLength = camera->params.basic.dist;
1079 BattleCam_InitialBoomPitch = camera->params.basic.pitch;
1080 BattleCam_InitialBoomOffsetY = BattleCam_InitialBoomYaw = 0.0f;
1081 return ApiStatus_DONE2;
1082}
1083
1085 Call(BattleCam_Update_Interrupt)
1086 Return
1087 End
1088};
1089
1091 Call(BattleCam_Update_FocusMidpointA)
1092 Return
1093 End
1094};
1095
1097 Call(BattleCam_Update_FocusMidpointB)
1098 Return
1099 End
1100};
1101
1103 Call(BattleCam_Update_FocusActorPart)
1104 Return
1105 End
1106};
1107
1109 Call(BattleCam_Update_FocusActor)
1110 Return
1111 End
1112};
1113
1115 Call(BattleCam_Update_FocusGoal)
1116 Return
1117 End
1118};
1119
1121 Call(BattleCam_Update_SimpleLerp_Unskippable)
1122 Return
1123 End
1124};
1125
1127 Call(BattleCam_Update_ResetToNeutral_Skippable)
1128 Return
1129 End
1130};
1131
1133 Call(BattleCam_Update_ViewAllEnemies)
1134 Return
1135 End
1136};
1137
1139 Call(BattleCam_Update_ViewAllEnemies_MaintainY)
1140 Return
1141 End
1142};
1143
1145 Call(BattleCam_Update_SimpleLerp_Skippable)
1146 Return
1147 End
1148};
1149
1151 Call(BattleCam_Update_FollowActorY)
1152 Return
1153 End
1154};
1155
1157 Call(BattleCam_Update_FollowActorPos)
1158 Return
1159 End
1160};
1161
1163 Call(ForceBattleCamTarget, 0, 15, 0)
1164 Call(SetBattleCamParam, CAM_PARAM_BOOM_LENGTH, 550)
1165 Call(SetBattleCamParam, CAM_PARAM_FOV_SCALE, 100)
1166 Call(SetBattleCamParam, CAM_PARAM_BOOM_PITCH, 8)
1167 Return
1168 End
1169};
1170
1173 Call(SetCamViewport, CAM_BATTLE, 12, 20, 296, 200)
1174 Call(SetCamBGColor, CAM_BATTLE, 0, 0, 0)
1176 Wait(1)
1179 Call(SetNoInterpCamParams, CAM_BATTLE, FALSE, 240, 100, 8)
1180 Call(SetCamLookTarget, CAM_BATTLE, -75, 35, 0)
1181 Call(BattleCamTargetActor, 0)
1182 Call(BattleCam_Init)
1183 Return
1184 End
1185};
1186
1188 EvtScript* preset = NULL;
1189 Evt* newScript;
1190
1191 if (BattleCam_IsFrozen) {
1192 return;
1193 }
1194
1195 BattleCam_ClampPosX = TRUE;
1196 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1197 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1198 BattleCam_UseLinearInterp = FALSE;
1199 BattleCam_ExtraOffsetX = 0;
1200
1201 switch (id) {
1202 case BTL_CAM_RESET:
1203 preset = &EVS_BattleCam_Reset;
1204 break;
1205 case BTL_CAM_INTERRUPT:
1206 preset = &EVS_BattleCam_Interrupt;
1207 break;
1208 case BTL_CAM_DEFAULT:
1209 if (BattleCam_CurrentPresetID == id) {
1210 return;
1211 }
1212 BattleCam_BoomLength = 500;
1213 BattleCam_MoveTimeLeft = 30;
1215 break;
1217 if (BattleCam_CurrentPresetID == id) {
1218 return;
1219 }
1220 BattleCam_BoomLength = 480;
1221 BattleCam_BoomOffsetY = 0;
1222 BattleCam_MoveTimeLeft = 20;
1223 preset = &EVS_BattleCam_ViewEnemies;
1224 break;
1226 if (BattleCam_CurrentPresetID == id) {
1227 return;
1228 }
1229 BattleCam_BoomLength = 500;
1230 BattleCam_BoomOffsetY = 0;
1231 BattleCam_MoveTimeLeft = 10;
1233 break;
1235 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1236 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1237 BattleCam_BoomLength = 300;
1238 BattleCam_MoveTimeLeft = 20;
1240 break;
1241 case BTL_CAM_ACTOR_PART:
1242 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1243 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1244 BattleCam_BoomLength = 300;
1245 BattleCam_MoveTimeLeft = 20;
1247 break;
1249 BattleCam_BoomLength = 300;
1250 BattleCam_MoveTimeLeft = 20;
1251 preset = &EVS_BattleCam_FocusGoal;
1252 break;
1254 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1255 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1256 BattleCam_BoomLength = 300;
1257 BattleCam_MoveTimeLeft = 20;
1258 preset = &EVS_BattleCam_FocusActor;
1259 break;
1261 if (BattleCam_ControlScript == &EVS_BattleCam_ResetNeutral) {
1262 return;
1263 }
1264 BattleCam_BoomLength = 500;
1265 BattleCam_MoveTimeLeft = 120;
1267 break;
1269 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1270 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1271 BattleCam_BoomLength = 200;
1272 BattleCam_BoomPitch = 8;
1273 BattleCam_BoomYaw = 0;
1274 BattleCam_BoomOffsetY = 15;
1275 BattleCam_MoveTimeLeft = 20;
1277 break;
1279 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1280 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1281 BattleCam_BoomLength = 300;
1282 BattleCam_BoomPitch = 8;
1283 BattleCam_BoomYaw = 0;
1284 BattleCam_BoomOffsetY = 16;
1285 BattleCam_MoveTimeLeft = 20;
1287 break;
1289 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1290 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1291 BattleCam_BoomLength = 400;
1292 BattleCam_BoomPitch = 8;
1293 BattleCam_BoomYaw = 0;
1294 BattleCam_BoomOffsetY = 30;
1295 BattleCam_MoveTimeLeft = 20;
1297 break;
1299 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1300 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1301 BattleCam_BoomLength = 200;
1302 BattleCam_BoomPitch = 8;
1303 BattleCam_BoomYaw = 0;
1304 BattleCam_BoomOffsetY = 15;
1305 BattleCam_MoveTimeLeft = 20;
1306 preset = &EVS_BattleCam_FocusActor;
1307 break;
1308 case BTL_CAM_ACTOR:
1309 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1310 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1311 BattleCam_BoomLength = 300;
1312 BattleCam_BoomPitch = 8;
1313 BattleCam_BoomYaw = 0;
1314 BattleCam_BoomOffsetY = 16;
1315 BattleCam_MoveTimeLeft = 20;
1316 preset = &EVS_BattleCam_FocusActor;
1317 break;
1318 case BTL_CAM_ACTOR_FAR:
1319 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1320 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1321 BattleCam_BoomLength = 400;
1322 BattleCam_BoomPitch = 8;
1323 BattleCam_BoomYaw = 0;
1324 BattleCam_BoomOffsetY = 30;
1325 BattleCam_MoveTimeLeft = 20;
1326 preset = &EVS_BattleCam_FocusActor;
1327 break;
1329 BattleCam_BoomLength = 267;
1330 BattleCam_BoomPitch = 8;
1331 BattleCam_BoomYaw = 0;
1332 BattleCam_BoomOffsetY = 23;
1333 BattleCam_MoveTimeLeft = 20;
1334 preset = &EVS_BattleCam_FocusGoal;
1335 break;
1336 case BTL_CAM_ACTOR_GOAL:
1337 BattleCam_BoomLength = 300;
1338 BattleCam_BoomPitch = 8;
1339 BattleCam_BoomYaw = 0;
1340 BattleCam_BoomOffsetY = 8;
1341 BattleCam_MoveTimeLeft = 20;
1342 preset = &EVS_BattleCam_FocusGoal;
1343 break;
1345 BattleCam_BoomLength = 400;
1346 BattleCam_BoomPitch = 8;
1347 BattleCam_BoomYaw = 0;
1348 BattleCam_BoomOffsetY = 0;
1349 BattleCam_MoveTimeLeft = 20;
1350 preset = &EVS_BattleCam_FocusGoal;
1351 break;
1352 case BTL_CAM_REPOSITION:
1353 BattleCam_MoveTimeLeft = 20;
1355 break;
1357 BattleCam_BoomOffsetY = 0;
1358 BattleCam_MoveTimeLeft = 20;
1360 break;
1362 BattleCam_BoomOffsetY = 0;
1363 BattleCam_MoveTimeLeft = 20;
1365 break;
1367 BattleCam_SubjectActor = ACTOR_PLAYER;
1368 BattleCam_BoomLength = 266;
1369 BattleCam_BoomPitch = 8;
1370 BattleCam_BoomYaw = 0;
1371 BattleCam_BoomOffsetY = 40;
1372 btl_cam_set_target_pos(-80.0f, 0.0f, 0.0f);
1373 BattleCam_MoveTimeLeft = 20;
1375 break;
1377 BattleCam_SubjectActor = ACTOR_PLAYER;
1378 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1379 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1380 BattleCam_BoomLength = 250;
1381 BattleCam_BoomPitch = 8;
1382 BattleCam_BoomYaw = 0;
1383 BattleCam_BoomOffsetY = 14;
1384 BattleCam_ClampPosX = FALSE;
1385 BattleCam_IsFrozen = TRUE;
1386 BattleCam_MoveTimeLeft = 20;
1387 preset = &EVS_BattleCam_FocusActor;
1388 break;
1389 case BTL_CAM_VICTORY:
1390 BattleCam_SubjectActor = ACTOR_PLAYER;
1391 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1392 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1393 BattleCam_BoomLength = 255;
1394 BattleCam_BoomPitch = 8;
1395 BattleCam_BoomYaw = 0;
1396 BattleCam_BoomOffsetY = 29;
1397 btl_cam_set_target_pos(-95.0f, 18.0f, 10.0f);
1398 BattleCam_MoveTimeLeft = 20;
1400 break;
1402 BattleCam_SubjectActor = ACTOR_PLAYER;
1403 BattleCam_BoomLength = 230;
1404 BattleCam_BoomPitch = 8;
1405 BattleCam_BoomYaw = 0;
1406 BattleCam_BoomOffsetY = 0;
1407 BattleCam_MoveTimeLeft = 20;
1409 break;
1411 BattleCam_SubjectActor = ACTOR_PLAYER;
1412 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1413 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1414 BattleCam_BoomLength = 310;
1415 BattleCam_BoomPitch = 8;
1416 BattleCam_BoomYaw = 0;
1417 BattleCam_BoomOffsetY = 16;
1418 BattleCam_ClampPosX = FALSE;
1419 BattleCam_MoveTimeLeft = 30;
1421 break;
1423 BattleCam_SubjectActor = ACTOR_PLAYER;
1424 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1425 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1426 BattleCam_BoomLength = 320;
1427 BattleCam_BoomPitch = 8;
1428 BattleCam_BoomYaw = 0;
1429 BattleCam_BoomOffsetY = 0;
1430 BattleCam_ClampPosX = FALSE;
1431 BattleCam_MoveTimeLeft = 5;
1433 break;
1435 BattleCam_SubjectActor = ACTOR_PLAYER;
1436 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1437 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1438 BattleCam_BoomLength = 340;
1439 BattleCam_BoomPitch = 8;
1440 BattleCam_BoomYaw = 0;
1441 BattleCam_BoomOffsetY = 0;
1442 BattleCam_ClampPosX = FALSE;
1443 BattleCam_MoveTimeLeft = 5;
1445 break;
1448 BattleCam_SubjectActor = ACTOR_PLAYER;
1449 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1450 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1451 BattleCam_BoomLength = 300;
1452 BattleCam_BoomPitch = 8;
1453 BattleCam_BoomYaw = 0;
1454 BattleCam_BoomOffsetY = -32;
1455 BattleCam_ExtraOffsetX = 20;
1456 BattleCam_MoveTimeLeft = 15;
1457 preset = &EVS_BattleCam_FocusActor;
1458 break;
1460 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1461 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1462 BattleCam_PosX = -65.0f;
1463 BattleCam_PosY = 30.0f;
1464 BattleCam_PosZ = 0.0f;
1465 BattleCam_BoomLength = 300;
1466 BattleCam_BoomPitch = 8;
1467 BattleCam_BoomYaw = 0;
1468 BattleCam_BoomOffsetY = 10;
1469 BattleCam_MoveTimeLeft = 10;
1471 break;
1473 BattleCam_SubjectActor = ACTOR_PLAYER;
1474 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1475 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1476 BattleCam_BoomLength = 220;
1477 BattleCam_BoomPitch = 8;
1478 BattleCam_BoomYaw = 0;
1479 BattleCam_BoomOffsetY = 24;
1480 BattleCam_ClampPosX = FALSE;
1481 BattleCam_MoveTimeLeft = 30;
1482 preset = &EVS_BattleCam_FocusActor;
1483 break;
1485 BattleCam_SubjectActor = ACTOR_PLAYER;
1486 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1487 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1488 BattleCam_BoomLength = 280;
1489 BattleCam_BoomPitch = 8;
1490 BattleCam_BoomYaw = 0;
1491 BattleCam_BoomOffsetY = -4;
1492 BattleCam_ClampPosX = FALSE;
1493 BattleCam_MoveTimeLeft = 30;
1495 break;
1497 BattleCam_SubjectActor = ACTOR_PLAYER;
1498 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1499 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1500 BattleCam_BoomLength = 380;
1501 BattleCam_BoomPitch = 8;
1502 BattleCam_BoomYaw = 0;
1503 BattleCam_BoomOffsetY = 0;
1504 BattleCam_ClampPosX = FALSE;
1505 BattleCam_UseLinearInterp = TRUE;
1506 BattleCam_MoveTimeLeft = 60;
1508 break;
1510 BattleCam_SubjectActor = ACTOR_PLAYER;
1511 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1512 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1513 BattleCam_BoomLength = 300;
1514 BattleCam_BoomPitch = 8;
1515 BattleCam_BoomYaw = 0;
1516 BattleCam_BoomOffsetY = 0;
1517 BattleCam_ClampPosX = FALSE;
1518 BattleCam_UseLinearInterp = TRUE;
1519 BattleCam_MoveTimeLeft = 60;
1521 break;
1524 BattleCam_SubjectActor = ACTOR_PLAYER;
1525 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1526 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1527 BattleCam_BoomLength = 320;
1528 BattleCam_BoomPitch = 8;
1529 BattleCam_BoomYaw = 0;
1530 BattleCam_BoomOffsetY = -4;
1531 BattleCam_ClampPosX = FALSE;
1532 BattleCam_MoveTimeLeft = 30;
1534 break;
1536 BattleCam_SubjectActor = ACTOR_PLAYER;
1537 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1538 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1539 BattleCam_BoomLength = 320;
1540 BattleCam_BoomPitch = 8;
1541 BattleCam_BoomYaw = 0;
1542 BattleCam_BoomOffsetY = 0;
1543 BattleCam_ClampPosX = FALSE;
1544 BattleCam_MoveTimeLeft = 30;
1546 break;
1548 BattleCam_SubjectActor = ACTOR_PLAYER;
1549 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1550 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1551 BattleCam_BoomLength = 360;
1552 BattleCam_BoomPitch = 8;
1553 BattleCam_BoomYaw = 0;
1554 BattleCam_BoomOffsetY = -4;
1555 BattleCam_ClampPosX = FALSE;
1556 BattleCam_MoveTimeLeft = 20;
1558 break;
1561 BattleCam_BoomLength = 200;
1562 BattleCam_MoveTimeTotal = 7;
1563 BattleCam_DoneMoving = FALSE;
1564 BattleCam_ClampPosX = FALSE;
1565 BattleCam_MoveTimeLeft = 7;
1566 preset = BattleCam_ControlScript;
1567 break;
1569 BattleCam_SubjectActor = ACTOR_PLAYER;
1570 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1571 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_SLIGHT;
1572 BattleCam_BoomLength = 214;
1573 BattleCam_BoomPitch = 8;
1574 BattleCam_BoomYaw = 0;
1575 BattleCam_BoomOffsetY = 16;
1576 BattleCam_ClampPosX = FALSE;
1577 BattleCam_MoveTimeLeft = 20;
1579 break;
1581 BattleCam_SubjectActor = ACTOR_PLAYER;
1582 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1583 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1584 BattleCam_BoomLength = 300;
1585 BattleCam_BoomPitch = 8;
1586 BattleCam_BoomYaw = 0;
1587 BattleCam_BoomOffsetY = 16;
1588 BattleCam_ClampPosX = FALSE;
1589 BattleCam_MoveTimeLeft = 8;
1591 break;
1593 BattleCam_SubjectActor = ACTOR_PLAYER;
1594 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1595 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1596 BattleCam_PosX = 60.0f;
1597 BattleCam_PosY = 40.0f;
1598 BattleCam_PosZ = 0.0f;
1599 BattleCam_BoomLength = 430;
1600 BattleCam_BoomPitch = 8;
1601 BattleCam_BoomYaw = 0;
1602 BattleCam_BoomOffsetY = 16;
1603 BattleCam_MoveTimeLeft = 10;
1605 break;
1607 BattleCam_SubjectActor = ACTOR_PLAYER;
1608 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1609 BattleCam_PosX = 60.0f;
1610 BattleCam_PosY = 40.0f;
1611 BattleCam_PosZ = 0.0f;
1612 BattleCam_BoomLength = 460;
1613 BattleCam_BoomPitch = 8;
1614 BattleCam_BoomYaw = 0;
1615 BattleCam_BoomOffsetY = 27;
1616 BattleCam_MoveTimeLeft = 10;
1618 break;
1620 BattleCam_BoomLength = 390;
1621 BattleCam_BoomPitch = 8;
1622 BattleCam_BoomYaw = 0;
1623 BattleCam_BoomOffsetY = 45;
1624 btl_cam_set_target_pos(-70.0f, 0.0f, 0.0f);
1625 BattleCam_ClampPosX = FALSE;
1626 BattleCam_MoveTimeLeft = 10;
1628 break;
1630 BattleCam_BoomLength = 500;
1631 BattleCam_BoomPitch = 8;
1632 BattleCam_BoomYaw = 0;
1633 BattleCam_BoomOffsetY = 45;
1634 btl_cam_set_target_pos(0.0f, 0.0f, 0.0f);
1635 BattleCam_ClampPosX = FALSE;
1636 BattleCam_MoveTimeLeft = 40;
1638 break;
1641 BattleCam_BoomLength = 300;
1642 BattleCam_BoomPitch = 8;
1643 BattleCam_BoomYaw = 0;
1644 BattleCam_BoomOffsetY = 45;
1645 btl_cam_set_target_pos(-50.0f, 0.0f, 0.0f);
1646 BattleCam_ClampPosX = FALSE;
1647 BattleCam_MoveTimeLeft = 20;
1649 break;
1651 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1652 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1653 BattleCam_PosX = -75.0f;
1654 BattleCam_PosY = 150.0f;
1655 BattleCam_PosZ = 0.0f;
1656 BattleCam_BoomLength = 166;
1657 BattleCam_BoomPitch = 8;
1658 BattleCam_BoomYaw = 0;
1659 BattleCam_BoomOffsetY = 17;
1660 BattleCam_MoveTimeLeft = 1;
1662 break;
1664 BattleCam_SubjectActor = ACTOR_PARTNER;
1665 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1666 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1667 BattleCam_BoomLength = 310;
1668 BattleCam_BoomPitch = 8;
1669 BattleCam_BoomYaw = 0;
1670 BattleCam_BoomOffsetY = 16;
1671 BattleCam_ClampPosX = FALSE;
1672 BattleCam_MoveTimeLeft = 30;
1674 break;
1676 BattleCam_SubjectActor = ACTOR_PARTNER;
1677 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1678 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1679 BattleCam_BoomLength = 250;
1680 BattleCam_BoomPitch = 8;
1681 BattleCam_BoomYaw = 0;
1682 BattleCam_BoomOffsetY = 16;
1683 BattleCam_ClampPosX = FALSE;
1684 BattleCam_UseLinearInterp = TRUE;
1685 BattleCam_MoveTimeLeft = 120;
1687 break;
1689 BattleCam_SubjectActor = ACTOR_PARTNER;
1690 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1691 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1692 BattleCam_BoomLength = 300;
1693 BattleCam_BoomPitch = 8;
1694 BattleCam_BoomYaw = 0;
1695 BattleCam_BoomOffsetY = 16;
1696 BattleCam_ClampPosX = FALSE;
1697 BattleCam_UseLinearInterp = TRUE;
1698 BattleCam_MoveTimeLeft = 120;
1699 preset = &EVS_BattleCam_FocusActor;
1700 break;
1702 BattleCam_SubjectActor = ACTOR_PARTNER;
1703 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1704 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1705 BattleCam_BoomLength = 320;
1706 BattleCam_BoomPitch = 8;
1707 BattleCam_BoomYaw = 0;
1708 BattleCam_BoomOffsetY = 0;
1709 BattleCam_ClampPosX = FALSE;
1710 BattleCam_MoveTimeLeft = 5;
1712 break;
1715 BattleCam_BoomLength = 500;
1716 BattleCam_BoomOffsetY = 0;
1717 BattleCam_MoveTimeLeft = 50;
1718 preset = &EVS_BattleCam_ViewEnemies;
1719 break;
1721 BattleCam_SubjectActor = ACTOR_PARTNER;
1722 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1723 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1724 BattleCam_BoomLength = 280;
1725 BattleCam_BoomPitch = 8;
1726 BattleCam_BoomYaw = 0;
1727 BattleCam_BoomOffsetY = -4;
1728 BattleCam_ClampPosX = FALSE;
1729 BattleCam_MoveTimeLeft = 30;
1731 break;
1733 BattleCam_SubjectActor = ACTOR_PARTNER;
1734 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1735 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1736 BattleCam_BoomLength = 380;
1737 BattleCam_BoomPitch = 8;
1738 BattleCam_BoomYaw = 0;
1739 BattleCam_BoomOffsetY = 0;
1740 BattleCam_ClampPosX = FALSE;
1741 BattleCam_UseLinearInterp = TRUE;
1742 BattleCam_MoveTimeLeft = 60;
1744 break;
1746 BattleCam_SubjectActor = ACTOR_PARTNER;
1747 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1748 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1749 BattleCam_BoomLength = 220;
1750 BattleCam_BoomPitch = 8;
1751 BattleCam_BoomYaw = 0;
1752 BattleCam_BoomOffsetY = 24;
1753 BattleCam_ClampPosX = FALSE;
1754 BattleCam_MoveTimeLeft = 30;
1755 preset = &EVS_BattleCam_FocusActor;
1756 break;
1758 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1759 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1760 BattleCam_PosX = -95.0f;
1761 BattleCam_PosY = 22.0f;
1762 BattleCam_PosZ = 0.0f;
1763 BattleCam_BoomLength = 210;
1764 BattleCam_BoomPitch = 8;
1765 BattleCam_BoomYaw = 0;
1766 BattleCam_BoomOffsetY = 10;
1767 BattleCam_MoveTimeLeft = 20;
1769 break;
1771 BattleCam_SubjectActor = ACTOR_PARTNER;
1772 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1773 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1774 BattleCam_BoomLength = 320;
1775 BattleCam_BoomPitch = 8;
1776 BattleCam_BoomYaw = 0;
1777 BattleCam_BoomOffsetY = -4;
1778 BattleCam_MoveTimeLeft = 30;
1780 break;
1782 BattleCam_SubjectActor = ACTOR_PARTNER;
1783 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1784 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1785 BattleCam_BoomLength = 320;
1786 BattleCam_BoomPitch = 8;
1787 BattleCam_BoomYaw = 0;
1788 BattleCam_BoomOffsetY = 0;
1789 BattleCam_MoveTimeLeft = 30;
1791 break;
1793 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1794 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1795 BattleCam_PosX = 25.0f;
1796 BattleCam_PosY = 60.0f;
1797 BattleCam_PosZ = 0.0f;
1798 BattleCam_BoomLength = 400;
1799 BattleCam_BoomPitch = 8;
1800 BattleCam_BoomYaw = 0;
1801 BattleCam_BoomOffsetY = 10;
1802 BattleCam_MoveTimeLeft = 30;
1804 break;
1806 BattleCam_SubjectActor = ACTOR_PARTNER;
1807 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1808 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1809 BattleCam_BoomLength = 200;
1810 BattleCam_BoomPitch = 8;
1811 BattleCam_BoomYaw = 0;
1812 BattleCam_BoomOffsetY = 11;
1813 BattleCam_ClampPosX = FALSE;
1814 BattleCam_UseLinearInterp = TRUE;
1815 BattleCam_MoveTimeLeft = 60;
1816 preset = &EVS_BattleCam_FocusActor;
1817 break;
1819 BattleCam_SubjectActor = ACTOR_PARTNER;
1820 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1821 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1822 BattleCam_BoomLength = 300;
1823 BattleCam_BoomPitch = 8;
1824 BattleCam_BoomYaw = 0;
1825 BattleCam_BoomOffsetY = 16;
1826 BattleCam_MoveTimeLeft = 8;
1827 preset = &EVS_BattleCam_FocusActor;
1828 break;
1831 BattleCam_SubjectActor = ACTOR_PARTNER;
1832 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1833 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1834 BattleCam_BoomLength = 300;
1835 BattleCam_BoomPitch = 8;
1836 BattleCam_BoomYaw = 0;
1837 BattleCam_BoomOffsetY = -32;
1838 BattleCam_ExtraOffsetX = 20;
1839 BattleCam_MoveTimeLeft = 15;
1840 preset = &EVS_BattleCam_FocusActor;
1841 break;
1843 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1844 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1845 BattleCam_BoomLength = 400;
1846 BattleCam_BoomPitch = 8;
1847 BattleCam_BoomYaw = 0;
1848 BattleCam_BoomOffsetY = 27;
1849 BattleCam_MoveTimeLeft = 20;
1851 break;
1853 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1854 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1855 BattleCam_BoomLength = 358;
1856 BattleCam_BoomPitch = 8;
1857 BattleCam_BoomYaw = 0;
1858 BattleCam_BoomOffsetY = 16;
1859 BattleCam_MoveTimeLeft = 10;
1861 break;
1863 BattleCam_BoomLength = 500;
1864 BattleCam_MoveTimeLeft = 50;
1866 break;
1867 case BTL_CAM_ENEMY_DIVE:
1868 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1869 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1870 BattleCam_BoomLength = 267;
1871 BattleCam_BoomPitch = 8;
1872 BattleCam_BoomYaw = 0;
1873 BattleCam_BoomOffsetY = 16;
1874 BattleCam_MoveTimeLeft = 20;
1876 break;
1878 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1879 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1880 BattleCam_BoomLength = 214;
1881 BattleCam_BoomPitch = 8;
1882 BattleCam_BoomYaw = 0;
1883 BattleCam_BoomOffsetY = 16;
1884 BattleCam_MoveTimeLeft = 20;
1886 break;
1888 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1889 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1890 BattleCam_BoomLength = 300;
1891 BattleCam_BoomPitch = 8;
1892 BattleCam_BoomOffsetY = 16;
1893 BattleCam_BoomYaw = 0;
1894 BattleCam_MoveTimeLeft = 4;
1896 break;
1897 }
1898
1900
1901 if (gBattleStatus.camMovementScript != NULL) {
1903 }
1904
1905 BattleCam_ControlScript = preset;
1907 gBattleStatus.camMovementScript = newScript;
1909 BattleCam_DoneMoving = FALSE;
1910}
1911
1913 if (!BattleCam_IsFrozen) {
1914 BattleCam_SetImmediately = TRUE;
1916 }
1917}
1918
1919void btl_cam_use_preset(s32 preset) {
1920 if (!BattleCam_IsFrozen) {
1921 BattleCam_SetImmediately = FALSE;
1923 }
1924}
1925
1926void btl_cam_target_actor(s32 actorID) {
1927 if (!BattleCam_IsFrozen) {
1928 BattleCam_SubjectActor = actorID;
1929 }
1930}
1931
1932void btl_cam_target_actor_part(s32 actorID, s32 actorPartIndex) {
1933 if (!BattleCam_IsFrozen) {
1934 BattleCam_SubjectActor = actorID;
1935 BattleCam_SubjectActorPart = actorPartIndex;
1936 }
1937}
1938
1939void btl_cam_set_params(b16 skipRecalc, s16 boomLength, s16 vfovScale, s16 boomPitch, s32 boomYaw, s32 boomZOffset, s32 zoomPercent) {
1940 Camera* camera = &gCameras[CAM_BATTLE];
1941
1942 if (!BattleCam_IsFrozen) {
1943 camera->params.basic.skipRecalc = skipRecalc;
1944 camera->params.basic.dist = boomLength;
1945 camera->params.basic.fovScale = vfovScale;
1946 camera->params.basic.pitch = boomPitch;
1947 camera->params.basic.yaw = boomYaw;
1948 camera->params.basic.offsetY = boomZOffset * 256;
1949 camera->params.basic.zoomPercent = zoomPercent;
1950 }
1951}
1952
1953void btl_cam_move(s16 moveTime) {
1954 if (!BattleCam_IsFrozen) {
1955 BattleCam_MoveTimeLeft = moveTime;
1956 if (gBattleStatus.camMovementScript != NULL) {
1958 }
1959 }
1960}
1961
1962void btl_cam_set_target_pos(f32 x, f32 y, f32 z) {
1963 if (!BattleCam_IsFrozen) {
1964 BattleCam_PosX = x;
1965 BattleCam_PosY = y;
1966 BattleCam_PosZ = z;
1967 }
1968}
1969
1970void btl_cam_set_pos(f32 x, f32 y, f32 z) {
1971 Camera* camera = &gCameras[CAM_BATTLE];
1972
1973 if (!BattleCam_IsFrozen) {
1974 camera->lookAt_obj_target.x = x;
1975 camera->lookAt_obj_target.y = y;
1976 camera->lookAt_obj_target.z = z;
1977 }
1978}
1979
1981 return BattleCam_DoneMoving;
1982}
1983
1984void btl_cam_set_zoom(s16 zoom) {
1985 if (!BattleCam_IsFrozen) {
1986 BattleCam_BoomLength = zoom;
1987 }
1988}
1989
1990void btl_cam_add_zoom(s32 zoom) {
1991 if (!BattleCam_IsFrozen) {
1992 BattleCam_BoomLength += zoom;
1993 }
1994}
1995
1996void btl_cam_set_zoffset(s16 zOffset) {
1997 if (!BattleCam_IsFrozen) {
1998 BattleCam_BoomOffsetY = zOffset;
1999 }
2000}
2001
2003 BattleCam_IsFrozen = FALSE;
2004}
2005
2007 BattleCam_ClampPosX = FALSE;
2008}
2009
2010API_CALLABLE(UseBattleCamPreset) {
2011 Bytecode* args = script->ptrReadPos;
2012 s32 preset;
2013
2014 if (BattleCam_IsFrozen) {
2015 return ApiStatus_DONE2;
2016 }
2017
2018 preset = evt_get_variable(script, *args++);
2019 BattleCam_SetImmediately = FALSE;
2021
2022 return ApiStatus_DONE2;
2023}
2024
2025API_CALLABLE(UseBattleCamPresetImmediately) {
2026 Bytecode* args = script->ptrReadPos;
2027 s32 preset;
2028
2029 if (BattleCam_IsFrozen) {
2030 return ApiStatus_DONE2;
2031 }
2032
2033 preset = evt_get_variable(script, *args++);
2034 BattleCam_SetImmediately = TRUE;
2036
2037 return ApiStatus_DONE2;
2038}
2039
2040API_CALLABLE(UseBattleCamPresetWait) {
2041 Bytecode* args = script->ptrReadPos;
2042
2043 if (BattleCam_IsFrozen) {
2044 return ApiStatus_DONE2;
2045 }
2046
2047 if (isInitialCall) {
2048 s32 preset = evt_get_variable(script, *args++);
2049 btl_cam_use_preset(preset);
2050 return ApiStatus_BLOCK;
2051 }
2052
2053 if (btl_cam_is_moving_done()) {
2054 return ApiStatus_DONE2;
2055 } else {
2056 return ApiStatus_BLOCK;
2057 }
2058}
2059
2060API_CALLABLE(SetBattleCamParam) {
2061 Camera* camera = &gCameras[CAM_BATTLE];
2062 Bytecode* args = script->ptrReadPos;
2063 s32 mode;
2064 s32 val;
2065
2066 if (BattleCam_IsFrozen) {
2067 return ApiStatus_DONE2;
2068 }
2069
2070 mode = evt_get_variable(script, *args++);
2071 val = evt_get_variable(script, *args++);
2072
2073 switch (mode) {
2075 camera->params.basic.skipRecalc = val;
2076 break;
2078 camera->params.basic.dist = val;
2079 break;
2081 camera->params.basic.fovScale = val;
2082 break;
2084 camera->params.basic.pitch = val;
2085 break;
2086 case CAM_PARAM_BOOM_YAW:
2087 camera->params.basic.yaw = val;
2088 break;
2090 camera->params.basic.offsetY = val * 256;
2091 break;
2093 camera->params.basic.zoomPercent = val;
2094 break;
2095 }
2096 return ApiStatus_DONE2;
2097}
2098
2099API_CALLABLE(SetBattleCamParams) {
2100 Bytecode* args = script->ptrReadPos;
2101 Camera* camera = &gCameras[CAM_BATTLE];
2102
2103 if (BattleCam_IsFrozen) {
2104 return ApiStatus_DONE2;
2105 }
2106
2107 camera->params.basic.skipRecalc = evt_get_variable(script, *args++);
2108 camera->params.basic.dist = evt_get_variable(script, *args++);
2109 camera->params.basic.fovScale = evt_get_variable(script, *args++);
2110 camera->params.basic.pitch = evt_get_variable(script, *args++);
2111 camera->params.basic.yaw = evt_get_variable(script, *args++);
2112 camera->params.basic.offsetY = evt_get_variable(script, *args++) * 256;
2113 camera->params.basic.zoomPercent = evt_get_variable(script, *args++);
2114
2115 return ApiStatus_DONE2;
2116}
2117
2118API_CALLABLE(SetBattleCamTarget) {
2119 Bytecode* args = script->ptrReadPos;
2120
2121 if (BattleCam_IsFrozen) {
2122 return ApiStatus_DONE2;
2123 }
2124
2125 BattleCam_PosX = evt_get_variable(script, *args++);
2126 BattleCam_PosY = evt_get_variable(script, *args++);
2127 BattleCam_PosZ = evt_get_variable(script, *args++);
2128 return ApiStatus_DONE2;
2129}
2130
2131API_CALLABLE(ForceBattleCamTarget) {
2132 Bytecode* args = script->ptrReadPos;
2133 Camera* camera = &gCameras[CAM_BATTLE];
2134
2135 if (BattleCam_IsFrozen) {
2136 return ApiStatus_DONE2;
2137 }
2138
2139 camera->lookAt_obj_target.x = evt_get_variable(script, *args++);
2140 camera->lookAt_obj_target.y = evt_get_variable(script, *args++);
2141 camera->lookAt_obj_target.z = evt_get_variable(script, *args++);
2142
2143 return ApiStatus_DONE2;
2144}
2145
2146API_CALLABLE(SetBattleCamOffsetY) {
2147 Bytecode* args = script->ptrReadPos;
2148
2149 if (BattleCam_IsFrozen) {
2150 return ApiStatus_DONE2;
2151 }
2152
2153 BattleCam_BoomOffsetY = evt_get_variable(script, *args++);
2154 return ApiStatus_DONE2;
2155}
2156
2157API_CALLABLE(AddBattleCamOffsetY) {
2158 Bytecode* args = script->ptrReadPos;
2159
2160 if (BattleCam_IsFrozen) {
2161 return ApiStatus_DONE2;
2162 }
2163
2164 BattleCam_BoomOffsetY += evt_get_variable(script, *args++);
2165 return ApiStatus_DONE2;
2166}
2167
2168API_CALLABLE(SetBattleCamYaw) {
2169 Bytecode* args = script->ptrReadPos;
2170
2171 if (BattleCam_IsFrozen) {
2172 return ApiStatus_DONE2;
2173 }
2174
2175 BattleCam_BoomYaw = evt_get_variable(script, *args++);
2176 return ApiStatus_DONE2;
2177}
2178
2179API_CALLABLE(BattleCamTargetActor) {
2180 Bytecode* args = script->ptrReadPos;
2181 s32 actorID;
2182
2183 if (BattleCam_IsFrozen) {
2184 return ApiStatus_DONE2;
2185 }
2186
2187 actorID = evt_get_variable(script, *args++);
2188
2189 if (actorID == ACTOR_SELF) {
2190 actorID = script->owner1.actorID;
2191 }
2192
2193 btl_cam_target_actor(actorID);
2194
2195 return ApiStatus_DONE2;
2196}
2197
2198API_CALLABLE(BattleCamTargetActorPart) {
2199 Bytecode* args = script->ptrReadPos;
2200 s32 actorID;
2201
2202 if (BattleCam_IsFrozen) {
2203 return ApiStatus_DONE2;
2204 }
2205
2206 actorID = evt_get_variable(script, *args++);
2207
2208 if (actorID == ACTOR_SELF) {
2209 actorID = script->owner1.actorID;
2210 }
2211
2212 btl_cam_target_actor_part(actorID, evt_get_variable(script, *args++));
2213
2214 return ApiStatus_DONE2;
2215}
2216
2217API_CALLABLE(MoveBattleCamOver) {
2218 Bytecode* args = script->ptrReadPos;
2219
2220 if (BattleCam_IsFrozen) {
2221 return ApiStatus_DONE2;
2222 }
2223
2224 BattleCam_MoveTimeLeft = evt_get_variable(script, *args++);
2226
2227 if (gBattleStatus.camMovementScript != NULL) {
2229 }
2230
2231 return ApiStatus_DONE2;
2232}
2233
2234API_CALLABLE(SetBattleCamDist) {
2235 Bytecode* args = script->ptrReadPos;
2236
2237 if (BattleCam_IsFrozen) {
2238 return ApiStatus_DONE2;
2239 }
2240
2241 BattleCam_BoomLength = evt_get_variable(script, *args++);
2242 return ApiStatus_DONE2;
2243}
2244
2245API_CALLABLE(AddBattleCamDist) {
2246 Bytecode* args = script->ptrReadPos;
2247
2248 if (BattleCam_IsFrozen) {
2249 return ApiStatus_DONE2;
2250 }
2251
2252 BattleCam_BoomLength += evt_get_variable(script, *args++);
2253 return ApiStatus_DONE2;
2254}
2255
2256API_CALLABLE(SetBattleCamTargetingModes) {
2257 Bytecode* args = script->ptrReadPos;
2258
2259 if (BattleCam_IsFrozen) {
2260 return ApiStatus_DONE2;
2261 }
2262
2263 BattleCam_AdjustTargetYMode = evt_get_variable(script, *args++);
2264 BattleCam_AdjustTargetXMode = evt_get_variable(script, *args++);
2265 BattleCam_UseLinearInterp = evt_get_variable(script, *args++);
2266 return ApiStatus_DONE2;
2267}
2268
2269API_CALLABLE(FreezeBattleCam) {
2270 BattleCam_IsFrozen = evt_get_variable(script, *script->ptrReadPos);
2271 return ApiStatus_DONE2;
2272}
2273
2274API_CALLABLE(DisableBattleCamClampX) {
2275 BattleCam_ClampPosX = FALSE;
2276 return ApiStatus_DONE2;
2277}
#define LERP(a, b, alpha)
Definition camera.c:5
void btl_cam_set_zoom(s16 zoom)
Definition camera.c:1984
Vec2f targetSize
Definition camera.c:45
EvtScript EVS_BattleCam_FocusActorPart
Definition camera.c:1102
EvtScript EVS_BattleCam_FocusActor
Definition camera.c:1108
void btl_cam_set_pos(f32 x, f32 y, f32 z)
Definition camera.c:1970
#define CUBIC_SINE_INTERP(alpha)
Definition camera.c:8
void btl_cam_set_params(b16 skipRecalc, s16 boomLength, s16 vfovScale, s16 boomPitch, s32 boomYaw, s32 boomZOffset, s32 zoomPercent)
Definition camera.c:1939
void btl_cam_use_preset_impl(s32 id)
Definition camera.c:1187
Vec3f avgPos
Definition camera.c:47
#define QUADRATIC_SINE_INTERP(alpha)
Definition camera.c:7
EvtScript EVS_BattleCam_Interrupt
Definition camera.c:1084
EvtScript EVS_BattleCam_SimpleLerp_Unskippable
Definition camera.c:1120
EvtScript EVS_BattleCam_Reset
Definition camera.c:1162
EvtScript EVS_BattleCam_FocusMidpointA
Definition camera.c:1090
s32 BattleCam_CurrentPresetID
Definition camera.c:38
void btl_cam_target_actor_part(s32 actorID, s32 actorPartIndex)
Definition camera.c:1932
void btl_cam_add_zoom(s32 zoom)
Definition camera.c:1990
EvtScript EVS_BattleCam_SimpleLerp_Skippable
Definition camera.c:1144
Vec2f actorSize
Definition camera.c:42
s8 BattleCam_IsFrozen
Definition camera.c:37
void btl_cam_disable_clamp_x(void)
Definition camera.c:2006
EvtScript EVS_BattleCam_ResetNeutral
Definition camera.c:1126
Vec3f targetPos
Definition camera.c:44
void btl_cam_set_target_pos(f32 x, f32 y, f32 z)
Definition camera.c:1962
EvtScript EVS_BattleCam_FocusMidpointB
Definition camera.c:1096
void btl_cam_move(s16 moveTime)
Definition camera.c:1953
s32 btl_cam_is_moving_done(void)
Definition camera.c:1980
EvtScript EVS_BattleCam_ViewEnemies
Definition camera.c:1132
EvtScript EVS_BattleCam_FollowActorY
Definition camera.c:1150
f32 targetSizeAvg
Definition camera.c:46
void btl_cam_target_actor(s32 actorID)
Definition camera.c:1926
EvtScript EVS_OnBattleInit
Definition camera.c:1171
Vec3f actorPos
Definition camera.c:41
void btl_cam_set_zoffset(s16 zOffset)
Definition camera.c:1996
EvtScript EVS_BattleCam_ViewEnemies_MaintainY
Definition camera.c:1138
void btl_cam_use_preset_immediately(s32 preset)
Definition camera.c:1912
void btl_cam_unfreeze(void)
Definition camera.c:2002
EvtScript EVS_BattleCam_FollowActorPos
Definition camera.c:1156
f32 clamp_edge_pos_x(f32 x)
Definition camera.c:50
b32 get_cam_subject_properties(CamSubjects *subjects, b32 usePart)
Definition camera.c:65
f32 actorSizeAvg
Definition camera.c:43
void btl_cam_use_preset(s32 preset)
Definition camera.c:1919
EvtScript EVS_BattleCam_FocusGoal
Definition camera.c:1114
ActorState state
s16 targetActorID
s32 b32
Vec2bu size
s16 b16
Vec3f curPos
Bytecode EvtScript[]
s8 b8
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ BTL_CAM_XADJ_NONE
Definition enums.h:4899
@ ACTOR_CLASS_ENEMY
Definition enums.h:2079
@ ACTOR_CLASS_PLAYER
Definition enums.h:2077
@ ACTOR_CLASS_PARTNER
Definition enums.h:2078
@ ACTOR_CLASS_MASK
Definition enums.h:2080
@ CAM_UPDATE_NO_INTERP
Definition enums.h:4761
@ BTL_CAM_ACTOR_PART
Definition enums.h:4828
@ BTL_CAM_GOOMBARIO_BONK_FOLLOWUP_2
Definition enums.h:4875
@ BTL_CAM_MIDPOINT_FAR
Definition enums.h:4834
@ BTL_CAM_MIDPOINT_NORMAL
Definition enums.h:4833
@ BTL_CAM_ACTOR_TARGET_MIDPOINT
Definition enums.h:4827
@ BTL_CAM_MIDPOINT_CLOSE
Definition enums.h:4832
@ BTL_CAM_GOOMBARIO_BONK_FOLLOWUP_1
Definition enums.h:4872
@ BTL_CAM_PLAYER_HAMMER_QUAKE
Definition enums.h:4868
@ BTL_CAM_RETURN_HOME
Definition enums.h:4826
@ BTL_CAM_PRESET_UNUSED_2A
Definition enums.h:4864
@ BTL_CAM_CLOSER_PARTNER_APPROACH
Definition enums.h:4870
@ BTL_CAM_PARTNER_INJURED
Definition enums.h:4876
@ BTL_CAM_PRESET_UNUSED_46
Definition enums.h:4892
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_PLAYER_PRE_ULTRA_JUMP_FINISH
Definition enums.h:4850
@ BTL_CAM_INTERRUPT
Definition enums.h:4823
@ BTL_CAM_PRESET_UNUSED_3C
Definition enums.h:4882
@ BTL_CAM_ACTOR_GOAL
Definition enums.h:4839
@ BTL_CAM_PLAYER_FLEE
Definition enums.h:4847
@ BTL_CAM_VICTORY
Definition enums.h:4845
@ BTL_CAM_ACTOR_SIMPLE
Definition enums.h:4830
@ BTL_CAM_PLAYER_MISTAKE
Definition enums.h:4851
@ BTL_CAM_PARTNER_MIDAIR
Definition enums.h:4874
@ BTL_CAM_ACTOR_GOAL_SIMPLE
Definition enums.h:4829
@ BTL_CAM_PLAYER_ENTRY
Definition enums.h:4844
@ BTL_CAM_PLAYER_PRE_JUMP_FINISH
Definition enums.h:4849
@ BTL_CAM_PRESET_UNUSED_2D
Definition enums.h:4867
@ BTL_CAM_PLAYER_AIM_HAMMER
Definition enums.h:4865
@ BTL_CAM_PLAYER_HIT_HAZARD
Definition enums.h:4853
@ BTL_CAM_PRESET_UNUSED_43
Definition enums.h:4889
@ BTL_CAM_PRESET_UNUSED_48
Definition enums.h:4894
@ BTL_CAM_ACTOR
Definition enums.h:4836
@ BTL_CAM_REPOSITION
Definition enums.h:4841
@ BTL_CAM_ACTOR_GOAL_FAR
Definition enums.h:4840
@ BTL_CAM_ACTOR_CLOSE
Definition enums.h:4835
@ BTL_CAM_ACTOR_FAR
Definition enums.h:4837
@ BTL_CAM_PRESET_UNUSED_39
Definition enums.h:4879
@ BTL_CAM_ACTOR_GOAL_NEAR
Definition enums.h:4838
@ BTL_CAM_PLAYER_JUMP_FINISH_CLOSE
Definition enums.h:4858
@ BTL_CAM_PRESET_UNUSED_3A
Definition enums.h:4880
@ BTL_CAM_PLAYER_WISH
Definition enums.h:4891
@ BTL_CAM_PLAYER_MULTIBOUNCE
Definition enums.h:4862
@ BTL_CAM_PLAYER_SUPER_JUMP_MIDAIR
Definition enums.h:4859
@ BTL_CAM_PRESET_UNUSED_40
Definition enums.h:4886
@ BTL_CAM_PARTNER_GOOMPA
Definition enums.h:4877
@ BTL_CAM_STAR_SPIRIT
Definition enums.h:4895
@ BTL_CAM_ENEMY_DIVE
Definition enums.h:4888
@ BTL_CAM_PLAYER_HAMMER_STRIKE
Definition enums.h:4866
@ BTL_CAM_FOLLOW_ACTOR_Y
Definition enums.h:4842
@ BTL_CAM_PLAYER_UNUSED_ULTRA_JUMP
Definition enums.h:4861
@ BTL_CAM_PRESET_UNUSED_38
Definition enums.h:4878
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4885
@ BTL_CAM_PRESET_UNUSED_44
Definition enums.h:4890
@ BTL_CAM_VIEW_ENEMIES
Definition enums.h:4825
@ BTL_CAM_PARTNER_HIT_SPIKE
Definition enums.h:4883
@ BTL_CAM_FOLLOW_ACTOR_POS
Definition enums.h:4843
@ BTL_CAM_PLAYER_JUMP_FINISH
Definition enums.h:4857
@ BTL_CAM_PARTNER_CLOSE_UP
Definition enums.h:4881
@ BTL_CAM_PRESET_UNUSED_31
Definition enums.h:4871
@ BTL_CAM_PLAYER_JUMP_MIDAIR
Definition enums.h:4856
@ BTL_CAM_PARTNER_HIT_HAZARD
Definition enums.h:4884
@ BTL_CAM_PRESET_UNUSED_47
Definition enums.h:4893
@ BTL_CAM_SLOWER_DEFAULT
Definition enums.h:4887
@ BTL_CAM_PLAYER_HIT_SPIKE
Definition enums.h:4852
@ BTL_CAM_PLAYER_CHARGE_UP
Definition enums.h:4854
@ BTL_CAM_PLAYER_ULTRA_JUMP_MIDAIR
Definition enums.h:4860
@ BTL_CAM_RESET
Definition enums.h:4822
@ BTL_CAM_PLAYER_ATTACK_APPROACH
Definition enums.h:4848
@ BTL_CAM_PLAYER_DIES
Definition enums.h:4846
@ BTL_CAM_PLAYER_STATUS_AFFLICTED
Definition enums.h:4855
@ BTL_CAM_SLOW_DEFAULT
Definition enums.h:4831
@ BTL_CAM_PARTNER_MISTAKE
Definition enums.h:4873
@ BTL_CAM_PRESET_UNUSED_29
Definition enums.h:4863
@ BTL_CAM_PARTNER_APPROACH
Definition enums.h:4869
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PARTNER
Definition enums.h:2086
@ ACTOR_SELF
Definition enums.h:2084
@ CAM_PARAM_ZOOM_PERCENT
Definition enums.h:1820
@ CAM_PARAM_BOOM_PITCH
Definition enums.h:1817
@ CAM_PARAM_SKIP_RECALC
Definition enums.h:1814
@ CAM_PARAM_BOOM_Y_OFFSET
Definition enums.h:1819
@ CAM_PARAM_BOOM_LENGTH
Definition enums.h:1815
@ CAM_PARAM_FOV_SCALE
Definition enums.h:1816
@ CAM_PARAM_BOOM_YAW
Definition enums.h:1818
@ BTL_CAM_YADJ_SLIGHT
Definition enums.h:4904
@ BTL_CAM_YADJ_AVG
Definition enums.h:4907
@ BTL_CAM_YADJ_NONE
Definition enums.h:4906
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4905
@ CAM_BATTLE
Definition enums.h:1801
@ EVT_PRIORITY_A
Definition evt.h:153
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_BLOCK
Definition evt.h:116
@ EVT_FLAG_RUN_IMMEDIATELY
don't wait for next update_scripts call
Definition evt.h:161
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
f32 fabsf(f32 f)
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
Definition cam_main.c:410
f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz)
Definition 43F0.c:677
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
Definition 43F0.c:670
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
ActorPart * get_actor_part(Actor *actor, s32 partID)
Definition 190B20.c:1191
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
void kill_script_by_ID(s32 id)
Evt * restart_script(Evt *script)
ApiStatus SetCamEnabled(Evt *script, b32 isInitialCall)
ApiStatus SetCamViewport(Evt *script, b32 isInitialCall)
ApiStatus InitVirtualEntityList(Evt *script, b32 isInitialCall)
ApiStatus InitAnimatedModels(Evt *script, b32 isInitialCall)
ApiStatus SetCamLookTarget(Evt *script, b32 isInitialCall)
ApiStatus SetCamBGColor(Evt *script, b32 isInitialCall)
ApiStatus SetNoInterpCamParams(Evt *script, b32 isInitialCall)
ApiStatus SetCamPerspective(Evt *script, b32 isInitialCall)
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Return
Kills the current EVT thread.
Definition macros.h:217
struct Evt * camMovementScript
struct Actor * partnerActor
struct Actor * playerActor
struct Actor * enemyActors[24]
Vec3f lookAt_obj_target
union Camera::@17 params
Camera gCameras[4]
Definition cam_main.c:17
BattleStatus gBattleStatus
Definition battle.c:11
PlayerStatus gPlayerStatus
Definition 77480.c:39