14 return (
Npc*) npcIdOrPtr;
111 Bytecode* args = script->ptrReadPos;
126 Bytecode* ptrReadPos = script->ptrReadPos;
144 Bytecode* ptrReadPos = script->ptrReadPos;
160 Bytecode* ptrReadPos = script->ptrReadPos;
174 Bytecode* ptrReadPos = script->ptrReadPos;
188 Bytecode* ptrReadPos = script->ptrReadPos;
202 Bytecode* ptrReadPos = script->ptrReadPos;
216 Bytecode* ptrReadPos = script->ptrReadPos;
230 Bytecode* args = script->ptrReadPos;
236 script->functionTemp[0] = 0;
239 if (script->functionTemp[0] == 0) {
250 script->functionTempPtr[1] = npc;
264 script->functionTemp[0] = 1;
267 npc = script->functionTempPtr[1];
280 if (moveSpeed < 1.0) {
284 if (dist <= moveSpeed) {
292 f32* yaw = &script->functionTempF[2];
296 script->functionTemp[0] = 0;
299 if (script->functionTemp[0] == 0) {
313 script->functionTempPtr[1] = npc;
338 script->functionTemp[0] =1;
341 npc = script->functionTempPtr[1];
353 npc->
flags &= ~NPC_FLAG_JUMPING;
369 Bytecode* args = script->ptrReadPos;
370 f32* outX = (f32*)&script->varTable[3];
371 f32* outY = (f32*)&script->varTable[4];
372 f32* outZ = (f32*)&script->varTable[5];
383 script->functionTempPtr[1] = npc;
398 if (script->varTable[6] == 0) {
399 script->varTable[6] = (dist / npc->
moveSpeed);
401 npc->
moveSpeed = dist / script->varTable[6];
405 npc = script->functionTempPtr[1];
411 if (npc->
duration >= script->varTable[6]) {
427 if (script->functionTemp[2] == 0) {
430 if (script->functionTemp[2] < 0) {
431 yDelta = -yDelta * -script->functionTemp[2];
433 if (script->functionTemp[2] > 0) {
434 yDelta *= script->functionTemp[2];
436 npc->
pos.
y += yDelta;
441 Bytecode* ptrReadPos = script->ptrReadPos;
455 Bytecode* ptrReadPos = script->ptrReadPos;
469 Bytecode* args = script->ptrReadPos;
470 f32* initialYaw = &script->functionTempF[1];
471 f32* deltaYaw = &script->functionTempF[2];
472 s32* turnTime = &script->functionTemp[3];
483 *initialYaw = npc->
yaw;
485 script->functionTempPtr[0] = npc;
488 if (*turnTime == 0) {
489 npc->
yaw += *deltaYaw;
495 if (*deltaYaw < -180.0f) {
498 if (*deltaYaw > 180.0f) {
503 npc = script->functionTempPtr[0];
506 npc->
yaw = *initialYaw + ((*deltaYaw * npc->
duration) / *turnTime);
511 npc->
yaw += *deltaYaw;
517 Bytecode* args = script->ptrReadPos;
518 f32* initialYaw = &script->functionTempF[1];
519 f32* deltaYaw = &script->functionTempF[2];
520 s32* turnTime = &script->functionTemp[3];
531 *initialYaw = npc->
yaw;
533 script->functionTempPtr[0] = npc;
537 if (*deltaYaw < -180.0f) {
540 if (*deltaYaw > 180.0f) {
545 npc = script->functionTempPtr[0];
548 npc->
yaw = *initialYaw + ((*deltaYaw * npc->
duration) / *turnTime);
553 npc->
yaw += *deltaYaw;
558 Bytecode* args = script->ptrReadPos;
559 f32* initialYaw = &script->functionTempF[1];
560 f32* deltaYaw = &script->functionTempF[2];
561 s32* turnTime = &script->functionTemp[3];
570 if (targetNpc == NULL) {
575 if (turningNpc == NULL) {
579 *initialYaw = turningNpc->
yaw;
580 *deltaYaw =
atan2(turningNpc->
pos.
x, turningNpc->
pos.
z, targetNpc->
pos.
x, targetNpc->
pos.
z) - *initialYaw;
581 script->functionTempPtr[0] = turningNpc;
585 if (*deltaYaw < -180.0f) {
588 if (*deltaYaw > 180.0f) {
593 turningNpc = script->functionTempPtr[0];
596 turningNpc->
yaw = *initialYaw + ((*deltaYaw * turningNpc->
duration) / *turnTime);
601 turningNpc->
yaw += *deltaYaw;
606 Bytecode* args = script->ptrReadPos;
626 Bytecode* args = script->ptrReadPos;
644 Bytecode* args = script->ptrReadPos;
658 Bytecode* args = script->ptrReadPos;
672 Bytecode* ptrReadPos = script->ptrReadPos;
690 Bytecode* ptrReadPos = script->ptrReadPos;
708 Bytecode* ptrReadPos = script->ptrReadPos;
734 Bytecode* ptrReadPos = script->ptrReadPos;
751 Bytecode* ptrReadPos = script->ptrReadPos;
772 Bytecode* ptrReadPos = script->ptrReadPos;
784 Bytecode* args = script->ptrReadPos;
824 playerY = playerStatus->
pos.
y;
827 npc->
pos.
x = playerX = playerStatus->
pos.
x;
829 playerZ = playerStatus->
pos.
z;
832 npc->
pos.
z = playerZ;
835 npc->
yaw =
atan2(playerX, playerZ, targetX, targetZ);
856 if (duration > 10.0f) {
859 npc->
scale.
x = (10.0f - duration) / 10.0f;
890 partner->
flags &= ~NPC_FLAG_GRAVITY;
891 partner->
flags &= ~NPC_FLAG_FLYING;
892 targetX = playerStatus->
pos.
x;
894 partnerX = partner->
pos.
x;
897 partnerY = partner->
pos.
y;
898 targetZ = playerStatus->
pos.
z;
900 partnerZ = partner->
pos.
z;
904 partner->
yaw =
atan2(partnerX, partnerZ, targetX, targetZ);
912 partnerY = targetY - partnerY;
923 if (partner->
jumpVel <= 0.0f) {
933 partner->
scale.
x = scale / 10.0f;
955 Bytecode outVar = *script->ptrReadPos;
962 Bytecode outVar = *script->ptrReadPos;
969 Bytecode* args = script->ptrReadPos;
987 Bytecode* args = script->ptrReadPos;
1001 Bytecode* args = script->ptrReadPos;
1015 Bytecode* args = script->ptrReadPos;
1032 Bytecode* args = script->ptrReadPos;
1054 Bytecode* ptrReadPos = script->ptrReadPos;
1069 Bytecode* ptrReadPos = script->ptrReadPos;
1084 Bytecode* ptrReadPos = script->ptrReadPos;
union Evt::@9 owner2
Initially -1.
#define sfx_play_sound_at_position
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
s32 evt_get_variable(Evt *script, Bytecode var)
f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration)
void disable_npc_blur(Npc *npc)
void partner_clear_player_tracking(Npc *partner)
void enable_npc_blur(Npc *npc)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
s32 partner_is_flying(void)
void enable_partner_ai(void)
f32 evt_get_float_variable(Evt *script, Bytecode var)
s32 create_basic_npc(NpcBlueprint *blueprint)
void npc_surface_spawn_fx(Npc *npc, SurfaceInteractMode mode)
Enemy * get_enemy(s32 npcID)
Looks for an enemy matching the specified npcID.
void npc_set_palswap_1(Npc *npc, s32 palIndexA, s32 palIndexB, s32 timeHoldA, s32 timeAB)
void enable_npc_shadow(Npc *npc)
void disable_npc_shadow(Npc *npc)
void free_npc_by_index(s32 listIndex)
void npc_set_imgfx_params(Npc *npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6)
void npc_set_decoration(Npc *npc, s32 idx, s32 decorationType)
Npc * get_npc_unsafe(s32 npcID)
void npc_set_palswap_2(Npc *npc, s32 timeHoldB, s32 timeBA, s32 palIndexC, s32 palIndexD)
void npc_set_palswap_mode_A(Npc *npc, s32 arg1)
Npc * get_npc_by_index(s32 listIndex)
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
void set_npc_yaw(Npc *npc, f32 yaw)
void set_npc_sprite(Npc *npc, s32 anim, AnimID *extraAnimList)
Npc * get_npc_safe(s32 npcID)
void set_npc_animation(Npc *npc, u32 animID)
ApiStatus _npc_jump_to(Evt *script, s32 isInitialCall, s32 snapYaw)
Npc * resolve_npc(Evt *script, s32 npcIdOrPtr)
s32 partner_can_use_ability(void)
ApiStatus SetNpcPaletteSwapping(Evt *script, b32 isInitialCall)
ApiStatus PlaySoundAtNpc(Evt *script, b32 isInitialCall)
ApiStatus SetNpcRotationPivot(Evt *script, b32 isInitialCall)
ApiStatus DeleteNpc(Evt *script, b32 isInitialCall)
ApiStatus PartnerIsFlying(Evt *script, b32 isInitialCall)
ApiStatus DisablePartnerAI(Evt *script, b32 isInitialCall)
ApiStatus ClearPartnerMoveHistory(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPaletteSwapMode(Evt *script, b32 isInitialCall)
ApiStatus GetNpcAnimation(Evt *script, b32 isInitialCall)
ApiStatus SetNpcImgFXFlags(Evt *script, b32 isInitialCall)
ApiStatus PartnerCanUseAbility(Evt *script, b32 isInitialCall)
ApiStatus EnableNpcShadow(Evt *script, b32 isInitialCall)
ApiStatus GetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus SetNpcDecoration(Evt *script, b32 isInitialCall)
ApiStatus SetNpcImgFXParams(Evt *script, b32 isInitialCall)
ApiStatus SetNpcSpeed(Evt *script, b32 isInitialCall)
ApiStatus NpcSetHomePosToCurrent(Evt *script, b32 isInitialCall)
ApiStatus GetCurrentPartnerID(Evt *script, b32 isInitialCall)
ApiStatus SetNpcAnimation(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPaletteSwapLower(Evt *script, b32 isInitialCall)
ApiStatus SetNpcScale(Evt *script, b32 isInitialCall)
ApiStatus SetNpcRenderMode(Evt *script, b32 isInitialCall)
ApiStatus EnablePartnerAI(Evt *script, b32 isInitialCall)
ApiStatus NpcFaceNpc(Evt *script, b32 isInitialCall)
ApiStatus GetNpcYaw(Evt *script, b32 isInitialCall)
ApiStatus SetNpcRotation(Evt *script, b32 isInitialCall)
ApiStatus BringPartnerOut(Evt *script, b32 isInitialCall)
ApiStatus CreateNpc(Evt *script, b32 isInitialCall)
ApiStatus InterpNpcYaw(Evt *script, b32 isInitialCall)
ApiStatus NpcJump1(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus NpcJump0(Evt *script, b32 isInitialCall)
ApiStatus NpcFacePlayer(Evt *script, b32 isInitialCall)
ApiStatus SetNpcJumpscale(Evt *script, b32 isInitialCall)
ApiStatus PutPartnerAway(Evt *script, b32 isInitialCall)
ApiStatus SetNpcAnimationSpeed(Evt *script, b32 isInitialCall)
ApiStatus SetNpcCollisionChannel(Evt *script, b32 isInitialCall)
ApiStatus SetNpcSprite(Evt *script, b32 isInitialCall)
ApiStatus SetNpcYaw(Evt *script, b32 isInitialCall)
ApiStatus GetPartnerPos(Evt *script, b32 isInitialCall)
ApiStatus GetNpcPointer(Evt *script, b32 isInitialCall)
ApiStatus NpcMoveTo(Evt *script, b32 isInitialCall)
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
ApiStatus func_802CF56C(Evt *script, b32 isInitialCall)
ApiStatus EnableNpcBlur(Evt *script, b32 isInitialCall)
ApiStatus SetNpcCollisionSize(Evt *script, b32 isInitialCall)
ApiStatus NpcFlyTo(Evt *script, b32 isInitialCall)
ApiStatus func_802CF54C(Evt *script, b32 isInitialCall)
void(* onRender)(struct Npc *)
void(* onUpdate)(struct Npc *)
PartnerAnimations gPartnerAnimations[12]
PlayerStatus gPlayerStatus