Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
Quizmo.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "message_ids.h"
3#include "effects.h"
4#include "model.h"
5#include "sprite/npc/ChuckQuizmo.h"
6#include "sprite/player.h"
7
8#ifndef CHUCK_QUIZMO_NPC_ID
9 #error CHUCK_QUIZMO_NPC_ID must be defined for Quizmo.inc.c
10#endif
11
12#define QUIZMO_ANIMS \
13{ \
14 .idle = ANIM_ChuckQuizmo_Idle, \
15 .walk = ANIM_ChuckQuizmo_Walk, \
16 .run = ANIM_ChuckQuizmo_Run, \
17 .chase = ANIM_ChuckQuizmo_Run, \
18 .anim_4 = ANIM_ChuckQuizmo_Idle, \
19 .anim_5 = ANIM_ChuckQuizmo_Idle, \
20 .death = ANIM_ChuckQuizmo_Still, \
21 .hit = ANIM_ChuckQuizmo_Still, \
22 .anim_8 = ANIM_ChuckQuizmo_Run, \
23 .anim_9 = ANIM_ChuckQuizmo_Run, \
24 .anim_A = ANIM_ChuckQuizmo_Run, \
25 .anim_B = ANIM_ChuckQuizmo_Run, \
26 .anim_C = ANIM_ChuckQuizmo_Run, \
27 .anim_D = ANIM_ChuckQuizmo_Run, \
28 .anim_E = ANIM_ChuckQuizmo_Run, \
29 .anim_F = ANIM_ChuckQuizmo_Run, \
30}
31
32extern s16 MessagePlural;
33extern s16 MessageSingular;
34
35#if VERSION_PAL
36extern u8 MessagePlural_de[];
37#endif
38
39BSS s32 N(Quizmo_Worker);
40BSS s32 N(Quizmo_ScriptArray)[5];
41BSS EffectInstance* N(Quizmo_StageEffect);
42BSS EffectInstance* N(Quizmo_AudienceEffect);
43BSS EffectInstance* N(Quizmo_VannaTEffect);
44
45enum {
51};
52
53enum {
59};
60
62
63// values for Quizmo npc init vars
64enum {
72};
73
74enum {
75 // area_kmr
78 // area_mac
81 QUIZ_MAP_MAC_02 = 2, // unused
82 QUIZ_MAP_MAC_03 = 3, // unused
86 // area_nok
90 // area_dro
94 // area_jan
98 // area_sam
103 // area_hos
106};
107
108u8 N(Quizmo_Answers)[64] = {
109 2, 1, 1, 2, 2, 0, 2, 0,
110 2, 1, 0, 2, 1, 1, 0, 2,
111 0, 2, 1, 0, 0, 2, 1, 0,
112 2, 1, 1, 2, 2, 1, 1, 1,
113 0, 2, 2, 2, 2, 0, 1, 1,
114 2, 1, 2, 1, 2, 0, 0, 1,
115 1, 0, 1, 2, 1, 0, 2, 2,
116 1, 2, 0, 2, 2, 1, 1, 1,
117};
118
119QuizRequirement N(Quizmo_Requirements)[] = {
128 { STORY_EPILOGUE, 64 },
129 { 0, 64 }, // end of list
130};
131
132API_CALLABLE(N(Quizmo_HideEntities)) {
134 return ApiStatus_DONE2;
135}
136
137API_CALLABLE(N(Quizmo_ShowEntities)) {
139 return ApiStatus_DONE2;
140}
141
142API_CALLABLE(N(Quizmo_ShouldAppear)) {
143 Enemy* enemy = script->owner1.enemy;
144 u16 hasLocation = evt_get_variable(script, GF_Quizmo_HasLocation);
145 u16 changedLocation = evt_get_variable(script, GF_Quizmo_ChangedLocation);
146 u16 locTown = evt_get_variable(script, GB_ChuckQuizmo_Town);
147 u16 locMap = evt_get_variable(script, GB_ChuckQuizmo_Map);
148 s32 var;
149 s32 i;
150
151 s32 test2;
152 u16 curTown1 = (enemy->varTable[0] & 0xFF0000) >> 16;
153 u16 curTown2 = (enemy->varTable[0] & 0xFF0000) >> 16;
154 u16 numMaps = (enemy->varTable[0] & 0xFF00) >> 8;
155 u16 curMap = (enemy->varTable[0] & 0xFF) >> 0;
156 s32 progress;
157 s32 numAnswered;
158
159 if (curTown1 != locTown) {
160 changedLocation = FALSE;
161 hasLocation = FALSE;
162 }
163
164 if (!hasLocation) {
165 if (rand_int(100) < 30) {
166 locMap = rand_int(numMaps - 1);
167 locTown = curTown1;
168 evt_set_variable(script, GB_ChuckQuizmo_Town, locTown);
169 evt_set_variable(script, GB_ChuckQuizmo_Map, locMap);
170 hasLocation = TRUE;
171 }
172 }
173
174 evt_set_variable(script, GF_Quizmo_HasLocation, hasLocation);
175 evt_set_variable(script, GF_Quizmo_ChangedLocation, changedLocation);
176 numAnswered = evt_get_variable(NULL, GB_CompletedQuizzes);
177 progress = evt_get_variable(NULL, GB_StoryProgress);
178
179 // vanilla bug? never checks the final requirement in the list
180 for (i = 0; i < 8; i++) {
181 if (progress < N(Quizmo_Requirements)[i].requiredStoryProgress) {
182 break;
183 }
184 }
185
186 //TODO clean this up
187 progress = numAnswered < N(Quizmo_Requirements)[i].numQuestionsUnlocked;
188 test2 = var = progress;
189
190 if ((((curTown2 == locTown) && (curMap == locMap) && (changedLocation == 0) && test2)) ||
191 (gGameStatusPtr->debugQuizmo && var)) {
192 script->varTable[0] = TRUE;
193 } else {
194 kill_enemy(enemy);
195 script->varTable[0] = FALSE;
196 }
197
198 return ApiStatus_DONE2;
199}
200
201void N(Quizmo_NPC_OnRender)(Npc* npc);
202
203API_CALLABLE(N(Quizmo_RenderInit)) {
204 Npc* npc = get_npc_unsafe(script->owner2.npcID);
205
207 npc->blur.quizmo = heap_malloc(sizeof(*npc->blur.quizmo));
208 npc->blur.quizmo->flags = 0;
209
210 return ApiStatus_DONE1;
211}
212
213API_CALLABLE(N(Quizmo_NPC_Aux_Impl)) {
214 // does nothing, probably a default/template function for NPCs
215 get_npc_unsafe(script->owner2.npcID);
216 return ApiStatus_BLOCK;
217}
218
220 Camera* camera = &gCameras[gCurrentCamID];
221
222 if (npc->blur.quizmo->flags & 1) {
223 clamp_angle(-camera->curYaw);
224 }
225}
226
227API_CALLABLE(N(Quizmo_HideWorld)) {
228 if (isInitialCall) {
229 s32 i;
230
233 mdl_set_shroud_tint_params(0, 0, 0, 0);
234
235 for (i = 0; i < MAX_NPCS; i++) {
236 Npc* npc = get_npc_by_index(i);
237 if (npc != NULL && npc->flags != 0) {
238 if (npc->npcID != NPC_PARTNER && npc->npcID != CHUCK_QUIZMO_NPC_ID) {
239 npc->flags |= NPC_FLAG_HIDING;
240 }
241 }
242 }
243
244 for (i = 0; i < MAX_ITEM_ENTITIES; i++) {
245 ItemEntity* itemEntity = get_item_entity(i);
246 if (itemEntity != NULL && itemEntity->flags & ITEM_ENTITY_FLAG_10) {
247 itemEntity->flags |= ITEM_ENTITY_FLAG_HIDING;
248 }
249 }
250
251 script->functionTemp[0] = 0;
252 }
253
254 script->functionTemp[0] += 8;
255 if (script->functionTemp[0] > 255) {
256 script->functionTemp[0] = 255;
257 }
258
259 mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]);
260
261 if (script->functionTemp[0] == 255) {
262 return ApiStatus_DONE2;
263 } else {
264 return ApiStatus_BLOCK;
265 }
266}
267
268API_CALLABLE(N(Quizmo_FadeInWorld)) {
269 s32 i;
270
271 if (isInitialCall) {
272 mdl_set_shroud_tint_params(0, 0, 0, 255);
273 script->functionTemp[0] = 255;
274 script->functionTemp[1] = 0;
275 }
276
277 script->functionTemp[0] -= 8;
278 if (script->functionTemp[0] < 0) {
279 script->functionTemp[0] = 0;
280 }
281
282 mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]);
283 if (script->functionTemp[0] == 0 && script->functionTemp[1] == 0) {
284 script->functionTemp[1] = 1;
285 } else if (script->functionTemp[1] == 1) {
288
289 for (i = 0; i < MAX_NPCS; i++) {
290 Npc* npc = get_npc_by_index(i);
291 if (npc != NULL && npc->flags != 0) {
292 if (npc->npcID != NPC_PARTNER && npc->npcID != CHUCK_QUIZMO_NPC_ID) {
293 npc->flags &= ~NPC_FLAG_HIDING;
294 }
295 }
296 }
297
298 for (i = 0; i < MAX_ITEM_ENTITIES; i++) {
299 ItemEntity* entity = get_item_entity(i);
300 if (entity != NULL && entity->flags & ITEM_ENTITY_FLAG_10) {
301 entity->flags &= ~ITEM_ENTITY_FLAG_HIDING;
302 }
303 }
304
305 return ApiStatus_DONE2;
306 }
307
308 return ApiStatus_BLOCK;
309}
310
311API_CALLABLE(N(Quizmo_UpdateRecords)) {
312 u16 quizzesAnswered = gPlayerData.quizzesAnswered;
313
314 if (quizzesAnswered < 999) {
316 }
317
318 if (script->varTable[0] == N(Quizmo_Answers)[evt_get_variable(NULL, GB_CompletedQuizzes)]) {
319 script->varTable[0] = 1;
321 } else {
322 script->varTable[0] = 0;
323 }
324
325 return ApiStatus_DONE2;
326}
327
328API_CALLABLE(N(Quizmo_CreateStage)) {
329 QuizmoStageFXData* stageData;
330
331 if (isInitialCall) {
332 N(Quizmo_StageEffect) = fx_quizmo_stage(0,
336 N(Quizmo_AudienceEffect) = fx_quizmo_audience(0,
340 N(Quizmo_VannaTEffect) = fx_quizmo_assistant(0,
344 1.0f, 0);
345
346 stageData = N(Quizmo_StageEffect)->data.quizmoStage;
347 stageData->microphoneRaiseAmt = 0;
348 stageData->leftWallRaiseAmt = 0;
349 stageData->rightWallRaiseAmt = 0;
350 stageData->podiumRaiseAmt = 0;
351 stageData->rearWallRaiseAmt = 0;
352 }
353
354 stageData = N(Quizmo_StageEffect)->data.quizmoStage;
355
356 stageData->leftWallRaiseAmt += 10;
357 stageData->podiumRaiseAmt += 10;
358 stageData->rightWallRaiseAmt += 10;
359 stageData->microphoneRaiseAmt += 10;
360 stageData->rearWallRaiseAmt += 10;
361 if (stageData->microphoneRaiseAmt >= 255) {
362 stageData->microphoneRaiseAmt = 255;
363 return ApiStatus_DONE2;
364 }
365
366 return ApiStatus_BLOCK;
367}
368
369API_CALLABLE(N(Quizmo_DestroyEffects)) {
370 QuizmoStageFXData* stageData;
371
372 if (isInitialCall) {
373 N(Quizmo_AudienceEffect)->flags |= FX_INSTANCE_FLAG_DISMISS;
374 N(Quizmo_VannaTEffect)->flags |= FX_INSTANCE_FLAG_DISMISS;
375 }
376
377 stageData = N(Quizmo_StageEffect)->data.quizmoStage;
378 stageData->microphoneRaiseAmt -= 10;
379 stageData->leftWallRaiseAmt -= 10;
380 stageData->rightWallRaiseAmt -= 10;
381 stageData->podiumRaiseAmt -= 10;
382 stageData->rearWallRaiseAmt -= 10;
383
384 if (stageData->microphoneRaiseAmt <= 0) {
385 stageData->microphoneRaiseAmt = 0;
386 remove_effect(N(Quizmo_StageEffect));
387 free_worker(N(Quizmo_Worker));
388 return ApiStatus_DONE2;
389 }
390
391 return ApiStatus_BLOCK;
392}
393
394API_CALLABLE(N(Quizmo_SetStageLightsDelay)) {
395 N(Quizmo_StageEffect)->data.quizmoStage->lightScrollDelay = evt_get_variable(script, *script->ptrReadPos);
396 return ApiStatus_DONE2;
397}
398
399API_CALLABLE(N(Quizmo_UnkStageEffectMode)) {
400 s32 var = evt_get_variable(script, *script->ptrReadPos);
401 QuizmoStageFXData* stageData = N(Quizmo_StageEffect)->data.quizmoStage;
402
403 switch (var) {
404 case 0:
405 stageData->unkEffectMode = 0xC0;
406 break;
407 case 1:
408 stageData->unkEffectMode = 0x80;
409 break;
410 case 2:
411 stageData->unkEffectMode = 0x40;
412 break;
413 default:
414 stageData->unkEffectMode = 0;
415 break;
416 }
417
418 return ApiStatus_DONE2;
419}
420
421API_CALLABLE(N(Quizmo_SetVannaAnim_Idle)) {
422 N(Quizmo_VannaTEffect)->data.quizmoAssistant->anim = 0;
423 return ApiStatus_DONE2;
424}
425
426API_CALLABLE(N(Quizmo_SetVannaAnim_Clap)) {
427 N(Quizmo_VannaTEffect)->data.quizmoAssistant->anim = 1;
428 return ApiStatus_DONE2;
429}
430
431API_CALLABLE(N(Quizmo_SetVannaAnim_Wave)) {
432 N(Quizmo_VannaTEffect)->data.quizmoAssistant->anim = 2;
433 return ApiStatus_DONE2;
434}
435
436API_CALLABLE(N(Quizmo_ShouldQuizmoLeave)) {
438 return ApiStatus_DONE2;
439}
440
441API_CALLABLE(N(Quizmo_SetCamVfov)) {
442 Bytecode* args = script->ptrReadPos;
443 s32 cameraID = evt_get_variable(script, *args++);
444
445 gCameras[cameraID].vfov = evt_get_float_variable(script, *args++);
446 return ApiStatus_DONE2;
447}
448
449API_CALLABLE(N(Quizmo_GetCamVfov)) {
450 Bytecode* args = script->ptrReadPos;
451 s32 cameraID = evt_get_variable(script, *args++);
452
453 evt_set_variable(script, *args++, FLOAT_TO_FIXED(gCameras[cameraID].vfov));
454 return ApiStatus_DONE2;
455}
456
457API_CALLABLE(N(Quizmo_AddViewRelativeOffset)) {
458 Bytecode* args = script->ptrReadPos;
459 s32 x = evt_get_variable(script, *args++);
460 s32 y = evt_get_variable(script, *args++);
461 s32 z = evt_get_variable(script, *args++);
462 Bytecode ourVarX = *args++;
463 Bytecode outVarZ = *args++;
464
465 s32 cameraYaw = gCameras[gCurrentCameraID].curYaw;
466 s32 outX = evt_get_variable(script, QUIZ_ARRAY_ORIGIN_X) - (z * cos_deg(cameraYaw));
467 s32 outZ = evt_get_variable(script, QUIZ_ARRAY_ORIGIN_Z) - (z * sin_deg(cameraYaw));
468
469 outX -= x;
470 outZ -= y;
471
472 evt_set_variable(script, ourVarX, outX);
473 evt_set_variable(script, outVarZ, outZ);
474
475 return ApiStatus_DONE2;
476}
477
478API_CALLABLE(N(Quizmo_SpinPlayer)) {
479 PlayerStatus* playerStatus = &gPlayerStatus;
480
481 if (isInitialCall) {
482 script->functionTemp[0] = 60;
483 }
484
485 playerStatus->targetYaw += 30.0f;
486 if (playerStatus->targetYaw >= 360.0f) {
487 playerStatus->targetYaw -= 360.0f;
488 }
489
490 script->functionTemp[0]--;
491
492 if (script->functionTemp[0] < 0) {
493 return ApiStatus_DONE2;
494 } else {
495 return ApiStatus_BLOCK;
496 }
497}
498
499API_CALLABLE(N(Quizmo_SpinPartner)) {
500 Npc* partner = get_npc_unsafe(NPC_PARTNER);
501
502 if (isInitialCall) {
503 script->functionTemp[0] = 60;
504 }
505
506 partner->yaw += 30.0f;
507 if (partner->yaw >= 360.0f) {
508 partner->yaw -= 360.0f;
509 }
510
511 script->functionTemp[0]--;
512
513 if (script->functionTemp[0] < 0) {
514 return ApiStatus_DONE2;
515 } else {
516 return ApiStatus_BLOCK;
517 }
518}
519
520API_CALLABLE(N(Quizmo_UpdatePartnerPosition)) {
522 f32* x = (f32*) &script->functionTemp[1];
523 f32* y = (f32*) &script->functionTemp[2];
524 f32* z = (f32*) &script->functionTemp[3];
525
526 if (isInitialCall) {
527 *x = evt_get_float_variable(script, LVar0) / 60.0f;
528 *y = evt_get_float_variable(script, LVar5) / 60.0f;
529 *z = evt_get_float_variable(script, LVar1) / 60.0f;
530 script->functionTemp[0] = 60;
531 }
532
533 npc->pos.x += *x;
534 npc->pos.y += *y;
535 npc->pos.z += *z;
536 script->functionTemp[0]--;
537
538 if (script->functionTemp[0] == 0) {
539 return ApiStatus_DONE2;
540 } else {
541 return ApiStatus_BLOCK;
542 }
543}
544
546 s32 result = evt_get_variable(NULL, N(Quizmo_ScriptArray[QUIZ_ARRAY_INDEX_ANSWER_RESULT]));
547
548 if (result == 1) {
549 fx_quizmo_answer(0, 0, 0, 0);
550 } else if (result == 2) {
551 fx_quizmo_answer(1, 0, 0, 0);
552 }
553}
554
555API_CALLABLE(N(Quizmo_CreateWorker)) {
556 N(Quizmo_Worker) = create_worker_frontUI(NULL, N(Quizmo_CreateReactionEffect));
557 return ApiStatus_DONE2;
558}
559
560EvtScript N(EVS_Quizmo_Exit) = {
561 Call(N(Quizmo_ShouldQuizmoLeave))
562 IfLe(LVar0, 1)
564 Add(LVar1, 300)
566 Call(SetNpcAnimation, NPC_SELF, ANIM_ChuckQuizmo_Vanish)
567 Wait(40)
569 EndIf
570 Return
571 End
572};
573
574EvtScript N(EVS_Quizmo_SetQuizCamera) = {
575 Call(N(Quizmo_GetCamVfov), 0, QUIZ_ARRAY_SAVED_FOV)
576 Call(N(Quizmo_SetCamVfov), 0, 25) //TODO
581 Call(SetCamType, 0, LVar1, 0)
583 IfGt(LVar0, 0)
584 SetF(LVar0, 370)
585 Else
586 SetF(LVar0, -370)
587 EndIf
590 SetF(LVar0, Float(13.0))
591 SetF(LVar1, Float(-10.0))
593 Call(PanToTarget, 0, 0, TRUE)
595 Return
596 End
597};
598
599EvtScript N(EVS_Quizmo_OtherCamScript) = {
600 Call(GetNpcPos, CHUCK_QUIZMO_NPC_ID, LVar0, LVar1, LVar2)
601 Add(LVar1, 30)
604 IfGt(LVar0, 0)
605 SetF(LVar0, 17)
606 Else
607 SetF(LVar0, -17)
608 EndIf
610 Call(SetCamSpeed, 0, Float(90.0))
611 Call(WaitForCam, 0, Float(1.0))
612 Call(SetCamSpeed, 0, 1)
613 Return
614 End
615};
616
617EvtScript N(EVS_Quizmo_ResetCamera) = {
618 Call(N(Quizmo_SetCamVfov), 0, QUIZ_ARRAY_SAVED_FOV)
619 Call(PanToTarget, 0, 0, FALSE)
620 Return
621 End
622};
623
624EvtScript N(EVS_Quizmo_MovePlayerToPodium) = {
625 Wait(20)
626 Call(N(Quizmo_AddViewRelativeOffset), QUIZ_ARRAY_ORIGIN_X, QUIZ_ARRAY_ORIGIN_Z, 83, LVar0, LVar1)
627 Thread
628 SetF(LVar2, 0)
629 Loop(60)
634 DivF(LVar3, 60)
635 DivF(LVar4, 60)
639 AddF(LVar2, 1)
640 Wait(1)
641 EndLoop
648 Call(N(Quizmo_SpinPlayer))
650 Call(SetPlayerAnimation, ANIM_Mario1_Idle)
651 Return
652 End
653};
654
655EvtScript N(EVS_Quizmo_MovePartnerToPodium) = {
657 Call(N(Quizmo_AddViewRelativeOffset), LVarA, LVarC, 108, LVar0, LVar1)
660 Thread
661 Call(N(Quizmo_UpdatePartnerPosition))
670 Call(N(Quizmo_SpinPartner))
673 Return
674 End
675};
676
677EvtScript N(EVS_Quizmo_MoveQuizmoToMicrophone) = {
678 Call(GetNpcPos, CHUCK_QUIZMO_NPC_ID, LVarA, LVarB, LVarC)
679 Call(N(Quizmo_AddViewRelativeOffset), LVarA, LVarC, -70, LVar0, LVar1)
680 Thread
681 SetF(LVar2, 0)
682 Loop(60)
687 DivF(LVar3, 60)
688 DivF(LVar4, 60)
691 Call(SetNpcPos, CHUCK_QUIZMO_NPC_ID, LVar3, QUIZ_ARRAY_ORIGIN_Y, LVar4)
692 AddF(LVar2, 1)
693 Wait(1)
694 EndLoop
696 Wait(60)
697 Call(NpcFacePlayer, CHUCK_QUIZMO_NPC_ID, 0)
698 Call(SetNpcAnimation, CHUCK_QUIZMO_NPC_ID, ANIM_ChuckQuizmo_Idle)
699 Return
700 End
701};
702
703EvtScript N(EVS_Quizmo_SetCharacterPositons) = {
704 Exec(N(EVS_Quizmo_MovePlayerToPodium))
705 Exec(N(EVS_Quizmo_MovePartnerToPodium))
706 ExecWait(N(EVS_Quizmo_MoveQuizmoToMicrophone))
707 Return
708 End
709};
710
711EvtScript N(EVS_Quizmo_PlayerThinking) = {
712 Loop(0)
713 Call(SetPlayerAnimation, ANIM_Mario1_Question)
714 Wait(20)
715 EndLoop
716 Return
717 End
718};
719
720EvtScript N(EVS_Quizmo_PlayerHitBuzzer) = {
721 Call(SetPlayerAnimation, ANIM_Mario1_Throw)
722 Wait(15)
723 Call(SetPlayerAnimation, ANIM_Mario1_Idle)
724 Return
725 End
726};
727
728EvtScript N(EVS_Quizmo_PlayerReaction_RightAnswer) = {
729 Loop(0)
730 Call(SetPlayerAnimation, ANIM_Mario1_Idle)
731 Wait(1)
732 Call(SetPlayerAnimation, ANIM_Mario1_BeforeJump)
733 Wait(2)
734 Call(SetPlayerAnimation, ANIM_Mario1_Jump)
736 Add(LVar1, 3)
738 Wait(1)
739 Add(LVar1, 2)
741 Wait(1)
742 Add(LVar1, 1)
744 Wait(1)
745 Add(LVar1, 1)
747 Wait(1)
748 Add(LVar1, 0)
750 Wait(1)
751 Add(LVar1, 0)
753 Wait(1)
754 Add(LVar1, 0)
756 Wait(1)
757 Add(LVar1, 0)
759 Wait(1)
760 Call(SetPlayerAnimation, ANIM_Mario1_Fall)
762 Add(LVar1, 0)
764 Wait(1)
765 Add(LVar1, 0)
767 Wait(1)
768 Add(LVar1, 0)
770 Wait(1)
771 Add(LVar1, -1)
773 Wait(1)
774 Add(LVar1, -1)
776 Wait(1)
777 Add(LVar1, -2)
779 Wait(1)
780 Add(LVar1, -3)
782 Wait(1)
783 Call(SetPlayerAnimation, ANIM_Mario1_Land)
784 Wait(2)
785 Wait(1)
786 Call(SetPlayerAnimation, ANIM_Mario1_BeforeJump)
787 Wait(2)
788 Call(SetPlayerAnimation, ANIM_Mario1_Jump)
790 Add(LVar1, 3)
792 Wait(1)
793 Add(LVar1, 2)
795 Wait(1)
796 Add(LVar1, 1)
798 Wait(1)
799 Add(LVar1, 1)
801 Wait(1)
802 Add(LVar1, 0)
804 Wait(1)
805 Add(LVar1, 0)
807 Wait(1)
808 Add(LVar1, 0)
810 Wait(1)
811 Add(LVar1, 0)
813 Wait(1)
814 Call(SetPlayerAnimation, ANIM_Mario1_Fall)
816 Add(LVar1, 0)
818 Wait(1)
819 Add(LVar1, 0)
821 Wait(1)
822 Add(LVar1, 0)
824 Wait(1)
825 Add(LVar1, -1)
827 Wait(1)
828 Add(LVar1, -1)
830 Wait(1)
831 Add(LVar1, -2)
833 Wait(1)
834 Add(LVar1, -3)
836 Wait(1)
837 Call(SetPlayerAnimation, ANIM_Mario1_Land)
838 Wait(2)
839 Wait(1)
840 Call(SetPlayerAnimation, ANIM_Mario1_BeforeJump)
841 Wait(2)
842 Call(SetPlayerAnimation, ANIM_Mario1_Jump)
844 Add(LVar1, 3)
846 Wait(1)
847 Add(LVar1, 2)
849 Wait(1)
850 Add(LVar1, 1)
852 Wait(1)
853 Add(LVar1, 1)
855 Wait(1)
856 Add(LVar1, 0)
858 Wait(1)
859 Add(LVar1, 0)
861 Wait(1)
862 Add(LVar1, 0)
864 Wait(1)
865 Add(LVar1, 0)
867 Wait(1)
868 Call(SetPlayerAnimation, ANIM_Mario1_Fall)
870 Add(LVar1, 0)
872 Wait(1)
873 Add(LVar1, 0)
875 Wait(1)
876 Add(LVar1, 0)
878 Wait(1)
879 Add(LVar1, -1)
881 Wait(1)
882 Add(LVar1, -1)
884 Wait(1)
885 Add(LVar1, -2)
887 Wait(1)
888 Add(LVar1, -3)
890 Wait(1)
891 Call(SetPlayerAnimation, ANIM_Mario1_Land)
892 Wait(2)
893 EndLoop
894 Call(SetPlayerAnimation, ANIM_Mario1_Idle)
896 Wait(1)
897 Return
898 End
899};
900
901EvtScript N(EVS_Quizmo_PlayerReaction_WrongAnswer) = {
902 Call(SetPlayerAnimation, ANIM_Mario1_VacantStare)
903 Loop(0)
904 Wait(1)
905 EndLoop
906 Return
907 End
908};
909
910EvtScript N(EVS_Quizmo_ReturnPlayerToOriginalPos) = {
911 Thread
912 Call(N(Quizmo_AddViewRelativeOffset), QUIZ_ARRAY_ORIGIN_X, QUIZ_ARRAY_ORIGIN_Z, 25, LVar0, LVar1)
922 Return
923 End
924};
925
926EvtScript N(EVS_Quizmo_RightAnswer) = {
927 ExecGetTID(N(EVS_Quizmo_PlayerReaction_RightAnswer), LVar1)
928 Wait(60)
930 Loop(5)
932 Add(LVar1, -1)
934 Wait(2)
935 EndLoop
936 Wait(20)
937 ExecWait(N(EVS_Quizmo_ReturnPlayerToOriginalPos))
938 Return
939 End
940};
941
942EvtScript N(EVS_Quizmo_WrongAnswer) = {
943 ExecGetTID(N(EVS_Quizmo_PlayerReaction_WrongAnswer), LVar1)
944 Wait(60)
945 Loop(5)
947 Add(LVar1, -1)
949 Wait(2)
950 EndLoop
951 Wait(20)
953 ExecWait(N(EVS_Quizmo_ReturnPlayerToOriginalPos))
954 Return
955 End
956};
957
958EvtScript N(EVS_Quizmo_QuizMain) = {
960 Set(LVar0, 0)
961 Return
962 EndIf
966 Call(SpeakToPlayer, NPC_SELF, ANIM_ChuckQuizmo_Talk, ANIM_ChuckQuizmo_Idle, 0, MSG_MGM_000A)
967 Else
969 Call(SpeakToPlayer, NPC_SELF, ANIM_ChuckQuizmo_Talk, ANIM_ChuckQuizmo_Idle, 0, MSG_MGM_0009)
970 Else
971 Call(SpeakToPlayer, NPC_SELF, ANIM_ChuckQuizmo_Talk, ANIM_ChuckQuizmo_Idle, 0, MSG_MGM_0008)
973 EndIf
974 EndIf
975 Call(ShowChoice, MSG_Choice_000D)
976 IfEq(LVar0, 1)
977 Call(ContinueSpeech, -1, ANIM_ChuckQuizmo_Talk, ANIM_ChuckQuizmo_Idle, 0, MSG_MGM_000C)
978 ExecWait(N(EVS_Quizmo_Exit))
979 Set(LVar0, 0)
980 Return
981 EndIf
983 Call(N(Quizmo_HideEntities))
984 Call(N(Quizmo_HideWorld))
985 Exec(N(EVS_Quizmo_SetQuizCamera))
988 Call(SetNpcFlagBits, CHUCK_QUIZMO_NPC_ID, NPC_FLAG_GRAVITY, FALSE)
990 Call(SetNpcFlagBits, CHUCK_QUIZMO_NPC_ID, NPC_FLAG_IGNORE_PLAYER_COLLISION, TRUE)
992 ExecGetTID(N(EVS_Quizmo_SetCharacterPositons), LVar1)
993 Call(ContinueSpeech, -1, ANIM_ChuckQuizmo_Talk, ANIM_ChuckQuizmo_Idle, 0, MSG_MGM_000B)
995 Loop(0)
997 IfEq(LVar0, 0)
999 EndIf
1000 Wait(1)
1001 EndLoop
1002 Call(N(Quizmo_CreateStage))
1003 Loop(5)
1005 Add(LVar1, 1)
1007 Wait(2)
1008 EndLoop
1009 Set(LVar0, MSG_QuizQuestion_01)
1011 Call(SpeakToPlayer, NPC_SELF, ANIM_ChuckQuizmo_OpenHat, ANIM_ChuckQuizmo_CloseHat, 0, LVar0)
1012 Call(SetPlayerAnimation, ANIM_Mario1_Question)
1013 Set(LVar0, MSG_QuizChoice_01)
1019 Exec(N(EVS_Quizmo_PlayerHitBuzzer))
1020 Wait(15)
1022 Call(N(Quizmo_UnkStageEffectMode), LVar0)
1024 Call(N(Quizmo_CreateWorker))
1025 Wait(40)
1026 Call(N(Quizmo_UpdateRecords))
1027 Thread
1028 Wait(110)
1031 EndThread
1032 IfEq(LVar0, 1)
1033 Call(SetNpcAnimation, CHUCK_QUIZMO_NPC_ID, ANIM_ChuckQuizmo_OpenCorrect)
1035 Thread
1036 Call(N(Quizmo_SetStageLightsDelay), 1)
1037 Wait(6)
1038 Wait(6)
1039 Wait(6)
1040 Call(N(Quizmo_SetStageLightsDelay), 2)
1041 EndThread
1042 Thread
1044 Wait(6)
1046 Wait(6)
1048 Wait(6)
1050 EndThread
1052 Call(N(Quizmo_SetVannaAnim_Clap))
1053 Thread
1054 Wait(15)
1056 Add(LVar1, 50)
1057 Call(N(Quizmo_AddViewRelativeOffset), 0, 0, 83, LVar0, LVar2)
1058 PlayEffect(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2)
1059 PlayEffect(EFFECT_CONFETTI, 4, LVar0, LVar1, LVar2, 1, 60)
1060 Wait(15)
1061 Add(LVar1, -3)
1062 Call(N(Quizmo_AddViewRelativeOffset), 0, 0, 58, LVar0, LVar2)
1063 PlayEffect(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2)
1064 PlayEffect(EFFECT_CONFETTI, 4, LVar0, LVar1, LVar2, 1, 60)
1065 Wait(15)
1066 Add(LVar1, 30)
1067 Call(N(Quizmo_AddViewRelativeOffset), 0, 0, 93, LVar0, LVar2)
1068 PlayEffect(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2)
1069 PlayEffect(EFFECT_CONFETTI, 4, LVar0, LVar1, LVar2, 1, 60)
1070 Wait(15)
1071 EndThread
1072 Wait(20)
1073 ExecGetTID(N(EVS_Quizmo_RightAnswer), LVar1)
1076 Call(ContinueSpeech, -1, -1, -1, 0, MSG_MGM_0010)
1077 Call(SetNpcAnimation, CHUCK_QUIZMO_NPC_ID, ANIM_ChuckQuizmo_CloseHat)
1078 Loop(0)
1080 IfEq(LVar0, 0)
1081 BreakLoop
1082 EndIf
1083 Wait(1)
1084 EndLoop
1085 Call(SetNpcAnimation, CHUCK_QUIZMO_NPC_ID, ANIM_ChuckQuizmo_OpenHat)
1086 Set(LVar0, ITEM_STAR_PIECE)
1087 Set(LVar1, 3)
1088 ExecWait(N(GiveItemReward))
1090 Call(N(Quizmo_SetStageLightsDelay), 15)
1091 Call(N(Quizmo_SetVannaAnim_Idle))
1093 Call(SpeakToPlayer, NPC_SELF, ANIM_ChuckQuizmo_Talk, ANIM_ChuckQuizmo_Idle, 0, MSG_MGM_0011)
1094 Else
1095 Call(ContinueSpeech, -1, -1, -1, 0, MSG_MGM_000E)
1096 Call(SetNpcAnimation, CHUCK_QUIZMO_NPC_ID, ANIM_ChuckQuizmo_CloseHat)
1097 Loop(0)
1099 IfEq(LVar0, 0)
1100 BreakLoop
1101 EndIf
1102 Wait(1)
1103 EndLoop
1104 Call(SetNpcAnimation, CHUCK_QUIZMO_NPC_ID, ANIM_ChuckQuizmo_OpenHat)
1105 Set(LVar0, ITEM_STAR_PIECE)
1106 Set(LVar1, 1)
1107 ExecWait(N(GiveItemReward))
1109 Call(N(Quizmo_SetStageLightsDelay), 15)
1110 Call(N(Quizmo_SetVannaAnim_Idle))
1112#if VERSION_US || VERSION_IQUE
1115 Else
1117 EndIf
1118#elif VERSION_PAL
1121 Else
1122 Call(GetLanguage, LVar0)
1124 Call(SetMessageText, Ref(MessagePlural_de), 1)
1125 Else
1127 EndIf
1128 EndIf
1129#endif
1130 Call(SpeakToPlayer, NPC_SELF, ANIM_ChuckQuizmo_Talk, ANIM_ChuckQuizmo_Idle, 0, MSG_MGM_000F)
1131 EndIf
1132 Set(LVar0, 1)
1133 Else
1134 Call(SetNpcAnimation, CHUCK_QUIZMO_NPC_ID, ANIM_ChuckQuizmo_OpenWrong)
1138 ExecGetTID(N(EVS_Quizmo_WrongAnswer), LVar1)
1140 PlayEffect(EFFECT_WINDY_LEAVES, 0, LVar2, LVar3, LVar4)
1141 Call(ContinueSpeech, -1, -1, -1, 0, MSG_MGM_000D)
1142 Call(SetNpcAnimation, CHUCK_QUIZMO_NPC_ID, ANIM_ChuckQuizmo_CloseWrong)
1143 Loop(0)
1145 IfEq(LVar0, 0)
1146 BreakLoop
1147 EndIf
1148 Wait(1)
1149 EndLoop
1150 Set(LVar0, 0)
1151 EndIf
1152 Call(N(Quizmo_UnkStageEffectMode), -1)
1154 Thread
1155 Wait(30)
1157 EndThread
1158 Thread
1159 Wait(45)
1161 EndThread
1162 Call(N(Quizmo_SetVannaAnim_Wave))
1163 Call(N(Quizmo_DestroyEffects))
1164 ExecWait(N(EVS_Quizmo_Exit))
1165 Exec(N(EVS_Quizmo_ResetCamera))
1166 Call(N(Quizmo_FadeInWorld))
1167 Call(N(Quizmo_ShowEntities))
1169 Return
1170 End
1171};
1172
1173EvtScript N(EVS_Quizmo_NPC_OtherAI) = {
1174 Call(N(Quizmo_ShouldAppear))
1175 IfEq(LVar0, 0)
1176 Return
1177 EndIf
1179 Call(SetNpcSprite, -1, ANIM_ChuckQuizmo_Idle)
1180 Call(N(Quizmo_RenderInit))
1181 Return
1182 End
1183};
1184
1185EvtScript N(EVS_Quizmo_NPC_Interact) = {
1186 UseArray(Ref(N(Quizmo_ScriptArray)))
1190 ExecWait(N(EVS_Quizmo_QuizMain))
1193 Return
1194 End
1195};
1196
1197EvtScript N(EVS_Quizmo_NPC_Aux) = {
1198 Call(N(Quizmo_NPC_Aux_Impl))
1199 Return
1200 End
1201};
1202
1203MobileAISettings N(Quizmo_MobileAISettings) = {
1204 .moveSpeed = 0.7f,
1205 .moveTime = 30,
1206 .waitTime = 20,
1207 .playerSearchInterval = -1,
1208 .unk_AI_2C = 1,
1209};
1210
1211EvtScript N(EVS_Quizmo_Npc_AI) = {
1212 Call(BasicAI_Main, Ref(N(Quizmo_MobileAISettings)))
1213 Return
1214 End
1215};
1216
1217// primary quizmo NpcSettings
1218NpcSettings N(NpcSettings_ChuckQuizmo) = {
1219 .defaultAnim = ANIM_ChuckQuizmo_Idle,
1220 .height = 35,
1221 .radius = 28,
1222 .otherAI = &N(EVS_Quizmo_NPC_OtherAI),
1223 .onInteract = &N(EVS_Quizmo_NPC_Interact),
1224 .aux = &N(EVS_Quizmo_NPC_Aux),
1225 .flags = BASE_PASSIVE_FLAGS,
1226 .level = ACTOR_LEVEL_NONE,
1227};
1228
1229// alternate (unused?) variant of quizmo with AI and ENEMY_FLAG_IGNORE_WORLD_COLLISION unset
1230NpcSettings N(Quizmo_AltNpcSettings) = {
1231 .defaultAnim = ANIM_ChuckQuizmo_Idle,
1232 .height = 35,
1233 .radius = 28,
1234 .otherAI = &N(EVS_Quizmo_NPC_OtherAI),
1235 .onInteract = &N(EVS_Quizmo_NPC_Interact),
1236 .ai = &N(EVS_Quizmo_Npc_AI),
1237 .aux = &N(EVS_Quizmo_NPC_Aux),
1239 .level = ACTOR_LEVEL_NONE,
1240 .actionFlags = 16,
1241};
@ QUIZ_ARRAY_INDEX_ORIGIN_Z
Definition Quizmo.inc.c:57
@ QUIZ_ARRAY_INDEX_ORIGIN_Y
Definition Quizmo.inc.c:56
@ QUIZ_ARRAY_INDEX_ORIGIN_X
Definition Quizmo.inc.c:55
@ QUIZ_ARRAY_INDEX_ANSWER_RESULT
Definition Quizmo.inc.c:58
@ QUIZ_ARRAY_INDEX_SAVED_FOV
Definition Quizmo.inc.c:54
void N Quizmo_CreateReactionEffect(void)
Definition Quizmo.inc.c:545
void N Quizmo_NPC_OnRender(Npc *npc)
Definition Quizmo.inc.c:219
@ QUIZ_MAP_KMR_02
Definition Quizmo.inc.c:76
@ QUIZ_COUNT_HOS
Definition Quizmo.inc.c:105
@ QUIZ_MAP_JAN_02
Definition Quizmo.inc.c:95
@ QUIZ_MAP_HOS_03
Definition Quizmo.inc.c:104
@ QUIZ_COUNT_DRO
Definition Quizmo.inc.c:93
@ QUIZ_MAP_DRO_02
Definition Quizmo.inc.c:92
@ QUIZ_MAP_NOK_01
Definition Quizmo.inc.c:87
@ QUIZ_MAP_SAM_02
Definition Quizmo.inc.c:100
@ QUIZ_MAP_JAN_03
Definition Quizmo.inc.c:96
@ QUIZ_MAP_MAC_05
Definition Quizmo.inc.c:84
@ QUIZ_COUNT_JAN
Definition Quizmo.inc.c:97
@ QUIZ_MAP_MAC_00
Definition Quizmo.inc.c:79
@ QUIZ_MAP_MAC_03
Definition Quizmo.inc.c:82
@ QUIZ_COUNT_NOK
Definition Quizmo.inc.c:89
@ QUIZ_MAP_MAC_04
Definition Quizmo.inc.c:83
@ QUIZ_COUNT_KMR
Definition Quizmo.inc.c:77
@ QUIZ_MAP_SAM_01
Definition Quizmo.inc.c:99
@ QUIZ_COUNT_SAM
Definition Quizmo.inc.c:102
@ QUIZ_MAP_SAM_11
Definition Quizmo.inc.c:101
@ QUIZ_MAP_DRO_01
Definition Quizmo.inc.c:91
@ QUIZ_COUNT_MAC
Definition Quizmo.inc.c:85
@ QUIZ_MAP_NOK_02
Definition Quizmo.inc.c:88
@ QUIZ_MAP_MAC_02
Definition Quizmo.inc.c:81
@ QUIZ_MAP_MAC_01
Definition Quizmo.inc.c:80
s16 MessageSingular
Definition msg.c:48
@ QUIZ_AREA_JAN
Definition Quizmo.inc.c:69
@ QUIZ_AREA_MAC
Definition Quizmo.inc.c:66
@ QUIZ_AREA_HOS
Definition Quizmo.inc.c:71
@ QUIZ_AREA_KMR
Definition Quizmo.inc.c:65
@ QUIZ_AREA_DRO
Definition Quizmo.inc.c:68
@ QUIZ_AREA_NOK
Definition Quizmo.inc.c:67
@ QUIZ_AREA_SAM
Definition Quizmo.inc.c:70
s16 MessagePlural
Definition msg.c:42
@ QUIZ_ARRAY_ORIGIN_Y
Definition Quizmo.inc.c:48
@ QUIZ_ARRAY_ORIGIN_Z
Definition Quizmo.inc.c:49
@ QUIZ_ARRAY_ANSWER_RESULT
Definition Quizmo.inc.c:50
@ QUIZ_ARRAY_SAVED_FOV
Definition Quizmo.inc.c:46
@ QUIZ_ARRAY_ORIGIN_X
Definition Quizmo.inc.c:47
Bytecode EvtScript[]
#define sin_deg
#define remove_effect
#define rand_int
#define clamp_angle
#define cos_deg
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
@ ENV_TINT_SHROUD
Definition enums.h:4387
@ ENV_TINT_NONE
Definition enums.h:4385
@ STORY_CH0_KAMMY_RETURNED_TO_BOWSER
Definition enums.h:30
@ STORY_CH2_BEGAN_PEACH_MISSION
Definition enums.h:84
@ STORY_CH1_BEGAN_PEACH_MISSION
Definition enums.h:62
@ STORY_CH7_BEGAN_PEACH_MISSION
Definition enums.h:226
@ STORY_CH3_BEGAN_PEACH_MISSION
Definition enums.h:124
@ STORY_CH6_BEGAN_PEACH_MISSION
Definition enums.h:196
@ STORY_CH4_BEGAN_PEACH_MISSION
Definition enums.h:144
@ STORY_EPILOGUE
Definition enums.h:234
@ STORY_CH5_STAR_SPRIT_DEPARTED
Definition enums.h:177
@ PARTNER_ANIM_IDLE
Definition enums.h:3419
@ PARTNER_ANIM_WALK
Definition enums.h:3415
@ LANGUAGE_DE
Definition enums.h:6401
@ ENTITY_HIDE_MODE_1
Definition enums.h:2661
@ ENTITY_HIDE_MODE_0
Definition enums.h:2660
@ ITEM_ENTITY_FLAG_10
Definition enums.h:2699
@ ITEM_ENTITY_FLAG_HIDING
Definition enums.h:2721
@ PS_FLAG_MOVEMENT_LOCKED
Definition enums.h:3069
@ ENEMY_FLAG_FLYING
Definition enums.h:4532
@ ENEMY_FLAG_IGNORE_ENTITY_COLLISION
Definition enums.h:4531
@ ENEMY_FLAG_PASSIVE
Definition enums.h:4521
@ NPC_SELF
Definition enums.h:2526
@ NPC_PARTNER
Definition enums.h:2528
@ SOUND_LRAW_QUIZ_TICKING
Definition enums.h:657
@ SOUND_AUDIENCE_BOO
Definition enums.h:654
@ SOUND_QUIZ_BUZZER
Definition enums.h:656
@ SOUND_QUIZMO_VANISH
Definition enums.h:658
@ SOUND_APPROVE
Definition enums.h:932
@ SOUND_AUDIENCE_CHEER
Definition enums.h:653
@ SOUND_LRAW_AUDIENCE_MURMUR
Definition enums.h:652
@ SOUND_MENU_ERROR
Definition enums.h:933
#define BASE_PASSIVE_FLAGS
Definition enums.h:4555
@ CAM_DEFAULT
Definition enums.h:1800
@ NPC_FLAG_FLYING
Definition enums.h:3001
@ NPC_FLAG_HAS_NO_SPRITE
Definition enums.h:3022
@ NPC_FLAG_IGNORE_WORLD_COLLISION
Definition enums.h:3004
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
Definition enums.h:3006
@ NPC_FLAG_GRAVITY
Definition enums.h:3007
@ NPC_FLAG_HIDING
Definition enums.h:3021
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_DONE1
Definition evt.h:117
#define ApiStatus_BLOCK
Definition evt.h:116
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
ItemEntity * get_item_entity(s32 itemEntityIndex)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1847
void mdl_set_all_tint_type(s32)
Definition model.c:4521
void free_worker(s32)
Definition worker.c:176
f32 evt_get_float_variable(Evt *script, Bytecode var)
Definition evt.c:1930
s32 create_worker_frontUI(void(*updateFunc)(void), void(*drawFunc)(void))
Definition worker.c:63
void * heap_malloc(s32 size)
Definition heap.c:34
void mdl_set_shroud_tint_params(u8 r, u8 g, u8 b, u8 a)
Definition model.c:3906
#define ContinueSpeech(ARGS...)
Definition msg_api.h:14
#define SpeakToPlayer(ARGS...)
Definition msg_api.h:6
void kill_enemy(Enemy *enemy)
Definition npc.c:2374
Npc * get_npc_unsafe(s32 npcID)
Definition npc.c:995
Npc * get_npc_by_index(s32 listIndex)
Definition npc.c:271
Definition npc.h:294
@ GB_ChuckQuizmo_Map
doesnt correspond to mapID
@ GB_ChuckQuizmo_Town
0-6, doesnt correspond to areaID
@ GB_CompletedQuizzes
@ GB_StoryProgress
@ GF_Quizmo_TakingQuiz
@ GF_Quizmo_ChangedLocation
@ GF_Quizmo_HasLocation
@ GF_Met_ChuckQuizmo
ApiStatus PlaySound(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerPos(Evt *script, b32 isInitialCall)
Sets the player position.
ApiStatus DisablePartnerAI(Evt *script, b32 isInitialCall)
ApiStatus SetCamPitch(Evt *script, b32 isInitialCall)
ApiStatus AddStarPieces(Evt *script, b32 isInitialCall)
ApiStatus GetCamPitch(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerAnimation(Evt *script, b32 isInitialCall)
ApiStatus PanToTarget(Evt *script, b32 isInitialCall)
ApiStatus SetCamType(Evt *script, b32 isInitialCall)
ApiStatus GetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus SetMessageText(Evt *script, b32 isInitialCall)
ApiStatus SetNpcAnimation(Evt *script, b32 isInitialCall)
ApiStatus StopSound(Evt *script, b32 isInitialCall)
ApiStatus FacePlayerTowardPoint(Evt *script, b32 isInitialCall)
ApiStatus EnablePartnerAI(Evt *script, b32 isInitialCall)
ApiStatus ShowChoice(Evt *script, b32 isInitialCall)
ApiStatus GetCamType(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus NpcFacePlayer(Evt *script, b32 isInitialCall)
ApiStatus SetNpcJumpscale(Evt *script, b32 isInitialCall)
ApiStatus SetCamDistance(Evt *script, b32 isInitialCall)
ApiStatus PlayerMoveTo(Evt *script, b32 isInitialCall)
ApiStatus WaitForCam(Evt *script, b32 isInitialCall)
ApiStatus SetNpcSprite(Evt *script, b32 isInitialCall)
ApiStatus GetCamDistance(Evt *script, b32 isInitialCall)
ApiStatus SetCamLeadPlayer(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerPhysics(Evt *script, b32 isInitialCall)
Disables player physics if disable is TRUE, enables it if FALSE.
ApiStatus NpcMoveTo(Evt *script, b32 isInitialCall)
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerFlagBits(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerPos(Evt *script, b32 isInitialCall)
ApiStatus UseSettingsFrom(Evt *script, b32 isInitialCall)
ApiStatus SetPanTarget(Evt *script, b32 isInitialCall)
ApiStatus SetCamSpeed(Evt *script, b32 isInitialCall)
ApiStatus SetMessageValue(Evt *script, b32 isInitialCall)
ApiStatus CloseChoice(Evt *script, b32 isInitialCall)
#define ArrayVar(INDEX)
User Word.
Definition macros.h:122
#define FLOAT_TO_FIXED(x)
Progammatically converts f32 --> Float.
Definition macros.h:57
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#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 MAX_ITEM_ENTITIES
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define AddF(VAR, FLOAT_VALUE)
Definition macros.h:383
#define 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 BSS
Definition macros.h:7
#define LVarC
Definition macros.h:160
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#define Float(DOUBLE)
Definition macros.h:51
#define IsThreadRunning(TID, OUTVAR)
Sets OUTVAR to TRUE/FALSE depending on whether a thread with the given ID exists (i....
Definition macros.h:540
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar5
Definition macros.h:153
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define IfLe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR > RVAR.
Definition macros.h:281
#define BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#define KillThread(TID)
Kills a thread by its thread ID.
Definition macros.h:510
#define UseArray(INT_PTR)
Loads an s32 array pointer into the current thread for use with ArrayVar(INDEX).
Definition macros.h:425
#define SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
Definition macros.h:373
#define LVar2
Definition macros.h:150
#define MulF(VAR, FLOAT_VALUE)
Definition macros.h:385
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define ExecGetTID(EVT_SOURCE, OUTVAR)
Identical to Exec, but the newly-launched thread ID is stored in OUTVAR.
Definition macros.h:460
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define NPC_DISPOSE_LOCATION
Definition macros.h:158
#define MAX_NPCS
Definition macros.h:91
#define SubF(VAR, FLOAT_VALUE)
Definition macros.h:384
#define PlayEffect(args...)
Definition macros.h:807
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define 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 LVar0
Definition macros.h:148
#define Exec(EVT_SOURCE)
Launches a new thread.
Definition macros.h:455
#define Return
Kills the current EVT thread.
Definition macros.h:217
s32 flags
Vec3f pos
union Npc::@0 blur
void(* onRender)(struct Npc *)
Run after the display list for this NPC is built.
s32 gEntityHideMode
Definition entity.c:37
GameStatus * gGameStatusPtr
Definition main_loop.c:32
Camera gCameras[4]
Definition cam_main.c:17
PlayerData gPlayerData
Definition 77480.c:40
u8 * gBackgroundTintModePtr
Definition model.c:105
PlayerStatus gPlayerStatus
Definition 77480.c:39
s32 gCurrentCameraID
Definition cam_math.c:4
s16 gCurrentCamID
Definition cam_main.c:13