7#include "sprite/npc/WorldWatt.h"
13static NpcList* gCurrentNpcListPtr;
14static b8 gNpcPlayerCollisionsEnabled;
16#define PAL_ANIM_END 0xFF
64 gCurrentNpcListPtr = &gWorldNpcList;
66 gCurrentNpcListPtr = &gBattleNpcList;
70 (*gCurrentNpcListPtr)[i] = NULL;
74 gNpcPlayerCollisionsEnabled = TRUE;
79 gCurrentNpcListPtr = &gWorldNpcList;
81 gCurrentNpcListPtr = &gBattleNpcList;
85 gNpcPlayerCollisionsEnabled = TRUE;
94 if ((*gCurrentNpcListPtr)[i] == NULL) {
100 (*gCurrentNpcListPtr)[i] = npc =
heap_malloc(
sizeof(*npc));
112 npc->
blur.any = NULL;
206 listIndex &= ~BATTLE_NPC_ID_BIT;
208 npc = (*gCurrentNpcListPtr)[listIndex];
211 if (npc->
blur.any != NULL) {
213 npc->
blur.any = NULL;
230 heap_free((*gCurrentNpcListPtr)[listIndex]);
231 (*gCurrentNpcListPtr)[listIndex] = NULL;
240 if (npc->
blur.any != NULL) {
242 npc->
blur.any = NULL;
262 if ((*gCurrentNpcListPtr)[i] == npc) {
267 (*gCurrentNpcListPtr)[i] = NULL;
272 return (*gCurrentNpcListPtr)[listIndex & ~BATTLE_NPC_ID_BIT];
293 npc->
flags &= ~NPC_FLAG_WORLD_COLLISION_DIRTY;
330 npc->
flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
348 npc->
flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
362 npc->
flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
376 npc->
flags &= ~NPC_FLAG_COLLDING_WITH_WORLD;
384 f32 thisX, thisY, thisZ;
394 npc->
flags &= ~NPC_FLAG_COLLIDING_WITH_NPC;
402 if (otherNpc != NULL && npc != otherNpc) {
407 otherX = otherNpc->
pos.
x;
408 xDiff = otherX - thisX;
409 otherZ = otherNpc->
pos.
z;
410 zDiff = otherZ - thisZ;
414 if (!(thisBuf + otherBuf <= dist)) {
426 dist = (thisBuf + otherBuf) - dist;
428 zDiff = -dist *
cos_rad(angle);
429 thisX += xDiff * 0.1f;
430 thisZ += zDiff * 0.1f;
445 f32 playerX, playerZ;
448 f32 dist, colDist, distToNpc;
449 f32 npcColRadius, playerColRadius;
460 if (!gNpcPlayerCollisionsEnabled) {
472 playerX = playerStatus->
pos.
x;
473 playerZ = playerStatus->
pos.
z;
481 deltaX = playerX - npcX;
482 deltaZ = playerZ - npcZ;
484 distToNpc =
sqrtf(
SQ(deltaX) +
SQ(deltaZ));
485 colDist = npcColRadius + playerColRadius;
486 if (colDist < distToNpc) {
495 deltaX = playerX - npcX;
496 deltaZ = playerZ - npcZ;
499 yaw =
atan2(playerX, playerZ, npcX, npcZ);
502 dist = colDist - dist;
508 playerStatus->
pos.
x -= deltaX;
509 playerStatus->
pos.
z -= deltaZ;
513 playerStatus->
pos.
x -= deltaX * 0.5f;
514 playerStatus->
pos.
z -= deltaZ * 0.5f;
520 playerStatus->
pos.
x -= deltaX * 0.4f;
521 playerStatus->
pos.
z -= deltaZ * 0.4f;
524 if (
fabsf(dist) < 45.0f) {
525 playerStatus->
pos.
x -= deltaX;
526 playerStatus->
pos.
z -= deltaZ;
528 playerStatus->
pos.
x -= deltaX * 0.5f;
529 playerStatus->
pos.
z -= deltaZ * 0.5f;
542 f32 x, y, z, testLength;
551 npc->
flags &= ~NPC_FLAG_GROUNDED;
570 if (hitID && length <= testLength) {
576 npc->
flags &= ~NPC_FLAG_GROUNDED;
582 f32 x, y, z, testLength;
591 npc->
flags &= ~NPC_FLAG_GROUNDED;
595 length = testLength =
fabsf(velocity) + 16;
606 if (hitID != 0 && length <= testLength) {
613 npc->
flags &= ~NPC_FLAG_GROUNDED;
620 f32 hitYaw, hitPitch, hitLength;
622 playerStatus->
animFlags &= ~PA_FLAG_NPC_COLLIDED;
627 Npc* npc = (*gCurrentNpcListPtr)[i];
630 if (npc->
flags != 0) {
662 npc->
flags &= ~NPC_FLAG_JUMPING;
681 entityModel->
flags &= ~ENTITY_MODEL_FLAG_REFLECT;
704 shadow->
rot.
x = hitYaw;
706 shadow->
rot.
z = hitPitch;
708 npc->
flags &= ~NPC_FLAG_DIRTY_SHADOW;
753 cameraYaw = camera->
curYaw;
756 if (camRelativeYaw < -5.0f && camRelativeYaw > -175.0f) {
758 camRelativeYaw = 0.0f;
759 }
else if (camRelativeYaw > 5.0f && camRelativeYaw < 175.0f) {
761 camRelativeYaw = 180.0f;
825 if (npc->
rot.
y != 0.0f) {
830 if (npc->
rot.
x != 0.0f) {
835 if (npc->
rot.
z != 0.0f) {
875 if ((npc->
rot.
y != 0.0f) || (npc->
rot.
x != 0.0f) || (npc->
rot.
z != 0.0f)) {
907 if (npc->
rot.
y != 0.0f || npc->
rot.
x != 0.0f || npc->
rot.
z != 0.0f) {
943 Npc* npc = (*gCurrentNpcListPtr)[i];
949 if (!(s < 0.01) || !(s > -0.01)) {
950 renderDist = ((z * 5000.0f) / s) + 5000.0f;
951 if (renderDist < 0.0f) {
953 }
else if (renderDist > 10000.0f) {
954 renderDist = 10000.0f;
957 renderTaskPtr->
dist = -renderDist;
975 renderTaskPtr->
dist = -renderDist;
991 npc->
pos.
x += speed * sin;
992 npc->
pos.
z += -speed * cos;
1000 npc = (*gCurrentNpcListPtr)[i];
1001 if (npc != NULL && npc->
flags != 0 && npc->
npcID == npcID) {
1015 npc = (*gCurrentNpcListPtr)[i];
1016 if (npc != NULL && npc->
flags != 0 && npc->
npcID == npcID) {
1032 shadow->
flags &= ~ENTITY_FLAG_HIDDEN;
1043 npc->
flags &= ~NPC_FLAG_HAS_SHADOW;
1044 npc->
flags &= ~NPC_FLAG_DIRTY_SHADOW;
1075 npc->
blur.motion = motionBlur;
1076 ASSERT(motionBlur != NULL);
1078 motionBlur->
index = 0;
1090 npc->
flags &= ~NPC_FLAG_MOTION_BLUR;
1093 npc->
blur.motion = NULL;
1099 s32 index = motionBlur->
index;
1101 motionBlur->
posX[index] = npc->
pos.
x;
1102 motionBlur->
posY[index] = npc->
pos.
y;
1103 motionBlur->
posZ[index] = npc->
pos.
z;
1110 motionBlur->
index = index;
1125 blur = npc->
blur.motion;
1126 bufPos = blur->
index;
1136 if (bufPos == blur->
index) {
1141 if (strideIdx < 3) {
1153 x = blur->
posX[bufPos];
1154 y = blur->
posY[bufPos];
1155 z = blur->
posZ[bufPos];
1160 if (npc->
rot.
y != 0.0f) {
1164 if (npc->
rot.
x != 0.0f) {
1168 if (npc->
rot.
z != 0.0f) {
1198 gNpcPlayerCollisionsEnabled = TRUE;
1202 gNpcPlayerCollisionsEnabled = FALSE;
1213 Npc* npc = (*gCurrentNpcListPtr)[i];
1376 if (brightness == 255) {
1385 switch(brightness) {
1478 if (color2 != NULL) {
1480 *color1++ = *color2++;
1485 if (!hasDifferentIntervals) {
1525 if (blendAlpha == 255) {
1559 if (blendAlpha == 255) {
1574 if (blendAlpha < 255) {
1614 if (color2 != NULL) {
1616 *color1++ = *color2++;
1664 if (blendAlpha == 255) {
1709 if (blendAlpha == 255) {
1724 if (blendAlpha < 255) {
1933 #define RGBA_BUF_SIZE 20
1959 color = (rbuf[i] << 24) | (gbuf[i] << 16) | (bbuf[i] << 8) | alpha;
1963 #undef RGBA_BUF_SIZE
1970 Npc* closestNpc = NULL;
1971 f32 closestDist = radius;
1972 f32 maxDist = radius;
1975 for (i = 0; i <
ARRAY_COUNT(*gCurrentNpcListPtr); i++) {
1976 Npc* npc = (*gCurrentNpcListPtr)[i];
1982 if (distance <= maxDist) {
1983 if (distance < closestDist) {
1984 closestDist = distance;
1996 Npc* closestNpc = NULL;
1997 f32 closestDist = radius;
1998 f32 maxDist = radius;
2001 for (i = 0; i <
ARRAY_COUNT(*gCurrentNpcListPtr); i++) {
2002 Npc* npc = (*gCurrentNpcListPtr)[i];
2008 if (distance <= maxDist) {
2009 if (distance < closestDist) {
2010 closestDist = distance;
2030 for (i = 0; i <
ARRAY_COUNT(*gCurrentNpcListPtr); i++) {
2031 npc = (*gCurrentNpcListPtr)[i];
2036 if (npc->
flags == 0) {
2045 if (npc->
pos.
y < y) {
2051 if (idx == var_v1) {
2058 if (idx == var_v1) {
2078 y = npc->
pos.
y + 13.0f;
2103 switch (imgfxType) {
2174 s32 encounterIdx = encounterID / 32;
2178 flag = encounterID % 32;
2179 encounterShift = flag;
2180 flag = currentEncounter->
defeatFlags[mapID][encounterIdx];
2181 currentEncounter->
defeatFlags[mapID][encounterIdx] = flag | (1 << encounterShift);
2203 currentEncounter->
hitType = 0;
2206 currentEncounter->
unk_08 = 0;
2249 currentEncounter->
hitType = 0;
2255 currentEncounter->
unk_08 = 0;
2337 currentEncounter->
mapID = mapID;
2354 if (npcGroupList != NULL) {
2365 for (i = 0; i < encounter->
count; i++) {
2367 if (currentEnemy != NULL) {
2369 encounter->
enemy[i] = NULL;
2380 for (i = 0; i < encounter->
count; i++) {
2382 if (currentEnemy == enemy) {
2413 if (enemy->
npcID != (s16) DX_DEBUG_DUMMY_ID) {
2420 if (enemy->
unk_64 != NULL) {
2425 if (encounter->
enemy[j] == enemy) {
2426 encounter->
enemy[j] = NULL;
2451 aiScript->
owner1.enemy = enemy;
2465 auxScript->
owner1.enemy = enemy;
2470 Evt* interactScript;
2479 interactScript->
owner1.enemy = enemy;
2488 for (i = 0; i < currentEncounterStatus->
numEncounters; i++) {
2490 if (currentEncounter != NULL) {
2491 for (j = 0; j < currentEncounter->
count; j++) {
2492 Enemy* currentEnemy = currentEncounter->
enemy[j];
2493 if ((currentEnemy != NULL) && (currentEnemy->
npcID == npcID)) {
2507 for (i = 0; i < currentEncounterStatus->
numEncounters; i++) {
2509 if (currentEncounter != NULL) {
2510 for (j = 0; j < currentEncounter->
count; j++) {
2511 Enemy* currentEnemy = currentEncounter->
enemy[j];
2512 if ((currentEnemy != NULL) && (currentEnemy->
npcID == npcID)) {
2526 for (i = 0; i < currentEncounterStatus->
numEncounters; i++) {
2528 if (currentEncounter != NULL) {
2529 for (j = 0; j < currentEncounter->
count; j++) {
2530 Enemy* currentEnemy = currentEncounter->
enemy[j];
2531 if ((currentEnemy != NULL) && (currentEnemy->
npcID == npcID)) {
2545 for (i = 0; i < currentEncounterStatus->
numEncounters; i++) {
2547 if (currentEncounter != NULL) {
2548 for (j = 0; j < currentEncounter->
count; j++) {
2549 Enemy* currentEnemy = currentEncounter->
enemy[j];
2550 if ((currentEnemy != NULL) && (currentEnemy->
npcID == npcID)) {
2551 return currentEnemy;
2564 for (i = 0; i < currentEncounterStatus->
numEncounters; i++) {
2567 if (currentEncounter != NULL) {
2568 for (j = 0; j < currentEncounter->
count; j++) {
2569 Enemy* currentEnemy = currentEncounter->
enemy[j];
2570 if ((currentEnemy != NULL) && (currentEnemy->
npcID == npcID)) {
2571 return currentEnemy;
#define MAX_NPC_DECORATIONS
union Evt::@8 owner1
Initially -1.
s8 index
Current blur ring buffer index.
Ring buffer of an NPC's position over the past 20 frames.
#define queue_render_task
#define npc_raycast_down_sides
#define mdl_get_shroud_tint_params
struct StarsOrbitingFXData * starsOrbiting
struct EnergyOrbWaveFXData * energyOrbWave
#define ASSERT(condition)
EntityModel * get_entity_model(s32 idx)
@ ENTITY_MODEL_FLAG_REFLECT
@ IMGFX_COLOR_BUF_SET_MODULATE
@ NPC_DECORATION_WHITE_GLOW_BEHIND
@ NPC_DECORATION_BOWSER_AURA
@ NPC_DECORATION_WHITE_GLOW_FRONT
@ NPC_DECORATION_SEEING_STARS
@ NPC_PAL_ADJUST_BLEND_DOUBLE_PALETTES
@ NPC_PAL_ADJUST_BLEND_PALETTES_UNIFORM_INTERVALS
@ NPC_PAL_ADJUST_BLEND_PALETTES_VARYING_INTERVALS
@ NPC_PAL_ADJUST_WATT_IDLE
@ ENEMY_FLAG_ENABLE_HIT_SCRIPT
@ COLLIDER_FLAG_IGNORE_PLAYER
@ COLLIDER_FLAG_IGNORE_SHELL
@ COLLISION_IGNORE_ENTITIES
@ COLLIDER_FLAG_IGNORE_NPC
@ RENDER_MODE_SURFACE_XLU_LAYER2
@ RENDER_MODE_SURFACE_XLU_LAYER1
@ ENCOUNTER_STATE_POST_BATTLE
@ ENCOUNTER_STATE_CONVERSATION
@ ENCOUNTER_STATE_NEUTRAL
@ ENCOUNTER_STATE_PRE_BATTLE
@ GLOBAL_OVERRIDES_PREV_400
@ GLOBAL_OVERRIDES_PREV_800
@ ENCOUNTER_SUBSTATE_CREATE_INIT
@ NPC_FLAG_IGNORE_ENTITY_COLLISION
@ NPC_FLAG_WORLD_COLLISION_DIRTY
@ NPC_FLAG_TOUCHES_GROUND
@ NPC_FLAG_IGNORE_WORLD_COLLISION
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
@ NPC_FLAG_COLLDING_FORWARD_WITH_WORLD
@ NPC_FLAG_FLIP_INSTANTLY
@ NPC_FLAG_COLLIDING_WITH_NPC
@ NPC_FLAG_NO_SHADOW_RAYCAST
@ NPC_FLAG_IGNORE_CAMERA_FOR_YAW
@ NPC_FLAG_COLLDING_WITH_WORLD
@ NPC_FLAG_DONT_UPDATE_SHADOW_Y
@ NPC_FLAG_NO_ANIMS_LOADED
void create_encounters(void)
void update_encounters_conversation(void)
s32 create_worker_world(WorldArgs, WorldArgs)
b32 entity_raycast_down(f32 *, f32 *, f32 *, f32 *, f32 *, f32 *)
Mostly used for shadows.
Entity * get_entity_by_index(s32 index)
void update_encounters_neutral(void)
b32 npc_raycast_down_around(s32, f32 *, f32 *, f32 *, f32 *, f32, f32)
void show_first_strike_message(void)
void update_encounters_post_battle(void)
s32 npc_test_move_complex_with_slipping(s32, f32 *, f32 *, f32 *, f32, f32, f32, f32)
Shadow * get_shadow_by_index(s32 index)
void init_encounters_ui(void)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
void update_encounters_pre_battle(void)
b32 npc_test_move_simple_with_slipping(s32, f32 *, f32 *, f32 *, f32, f32, f32, f32)
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
b32 npc_test_move_taller_with_slipping(s32, f32 *, f32 *, f32 *, f32, f32, f32, f32)
void draw_encounters_pre_battle(void)
void kill_script_by_ID(s32 id)
s32 create_shadow_type(s32 type, f32 x, f32 y, f32 z)
void draw_merlee_messages(void)
void draw_encounters_conversation(void)
void update_merlee_messages(void)
void draw_encounters_neutral(void)
void draw_encounters_post_battle(void)
void set_npc_shadow_scale(Shadow *shadow, f32 height, f32 npcRadius)
f32 get_clamped_angle_diff(f32, f32)
void * heap_malloc(s32 size)
void npc_render_without_adjusted_palettes(Npc *npc, s32 arg1, Matrix4f mtx)
void STUB_npc_callback(Npc *npc)
The default Npc::onUpdate and Npc::onRender callback.
s32 npc_try_snap_to_ground(Npc *npc, f32 velocity)
void npc_update_decoration_charged(Npc *npc, s32 idx)
s32 create_basic_npc(NpcBlueprint *blueprint)
void npc_update_decoration_seeing_stars(Npc *npc, s32 idx)
void npc_remove_decoration_glow_in_front(Npc *npc, s32 idx)
void npc_imgfx_update(Npc *npc)
s32 npc_render_with_single_pal_blending(Npc *npc, s32 yaw, b32 hasDifferentIntervals, Matrix4f mtx)
void disable_npc_blur(Npc *npc)
s32 create_npc_impl(NpcBlueprint *blueprint, AnimID *animList, s32 isPeachNpc)
s32 bind_enemy_ai(Enemy *enemy, EvtScript *aiScriptBytecode)
Binds the specified ai script to the specified enemy.
void npc_reload_all(void)
s32 bind_enemy_aux(Enemy *enemy, EvtScript *auxScriptBytecode)
Binds the specified auxillary script to the specified enemy.
s32 npc_render_with_watt_idle_palettes(Npc *npc, s32 arg1, Matrix4f mtx)
void appendGfx_npc_blur(void *data)
Enemy * get_enemy_safe(s32 npcID)
Same as get_enemy(), with the exception of always returning a value if an enemy is not found.
s32 npc_find_standing_on_entity(s32 entityIndex)
void npc_set_imgfx_params(Npc *npc, s32 imgfxType, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6)
void npc_remove_decoration_sweat(Npc *npc, s32 idx)
void kill_enemy(Enemy *enemy)
Enemy * get_enemy(s32 npcID)
Looks for an enemy matching the specified npcID.
void npc_do_other_npc_collision(Npc *npc)
void bind_npc_ai(s32 npcID, EvtScript *npcAiBytecode)
Binds the specified ai script to the npc matching the specified npcId.
void npc_disable_collisions(void)
void npc_set_palswap_1(Npc *npc, s32 palIndexA, s32 palIndexB, s32 timeHoldA, s32 timeAB)
u8 wWattIdlePalettesAnim[]
void enable_npc_shadow(Npc *npc)
void npc_remove_decoration_bowser_aura(Npc *npc, s32 idx)
s32 npc_render_with_double_pal_blending(Npc *npc, s32 yaw, Matrix4f mtx)
s32 create_peach_npc(NpcBlueprint *blueprint)
void npc_try_apply_gravity(Npc *npc)
void update_encounters(void)
Npc * npc_find_closest_simple(f32 x, f32 y, f32 z, f32 radius)
Finds the closest simple-hitbox NPC to a given point within a radius.
void enable_npc_blur(Npc *npc)
s32 create_standard_npc(NpcBlueprint *blueprint, AnimID *animList)
void init_npc_list(void)
Points the current NPC list to the world or battle lists depending on game state.
void disable_npc_shadow(Npc *npc)
void npc_draw_with_palswap(Npc *npc, s32 yaw, Matrix4f mtx)
void free_npc_by_index(s32 listIndex)
void func_8003E514(s8 arg0)
void npc_revert_palswap_mode(Npc *npc)
void make_npcs(s32 flags, s32 mapID, s32 *npcGroupList)
void npc_set_decoration(Npc *npc, s32 idx, s32 decorationType)
void render_npcs(void)
Renders all NPCs.
void npc_set_palswap_mode_A(Npc *npc, s32 mode)
Npc * get_npc_unsafe(s32 npcID)
void npc_set_palswap_2(Npc *npc, s32 timeHoldB, s32 timeBA, s32 palIndexC, s32 palIndexD)
void npc_enable_collisions(void)
void npc_render_worker_do_nothing(void)
void npc_remove_decoration_none(Npc *npc, s32 idx)
void npc_update_decoration_glow_in_front(Npc *npc, s32 idx)
Npc * npc_find_closest(f32 x, f32 y, f32 z, f32 radius)
Finds the closest NPC to a given point within a radius.
void npc_reset_current_decoration(Npc *npc, s32 idx)
s32 npc_update_decorations(Npc *npc)
void mtx_ident_mirror_y(Matrix4f mtx)
void npc_do_world_collision(Npc *npc)
void bind_npc_aux(s32 npcID, EvtScript *npcAuxBytecode)
Binds the specified auxillary script to the npc matching the specified npcId.
void update_npcs(void)
Updates all NPCs.
void npc_set_palswap_mode_B(Npc *npc, s32 mode)
s32 kill_encounter(Enemy *enemy)
void bind_npc_interact(s32 npcID, EvtScript *npcInteractBytecode)
Binds the specified interact script to the npc matching the specified npcId.
Npc * get_npc_by_index(s32 listIndex)
void clear_encounter_status(void)
void draw_first_strike_ui(void)
void npc_remove_decoration(Npc *npc, s32 idx)
void npc_update_decoration_bowser_aura(Npc *npc, s32 idx)
void npc_remove_decoration_glow_behind(Npc *npc, s32 idx)
f32 npc_get_render_yaw(Npc *npc)
s32 npc_do_player_collision(Npc *npc)
void npc_remove_decoration_charged(Npc *npc, s32 idx)
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
void update_npc_blur(Npc *npc)
void appendGfx_npc(void *data)
void COPY_set_defeated(s32 mapID, s32 encounterID)
Duplicate of set_defeated().
u16 npc_blend_palette_colors(u16 colorA, u16 colorB, s32 lerpAlpha)
void draw_encounter_ui(void)
void set_npc_yaw(Npc *npc, f32 yaw)
s32 npc_get_collider_below(Npc *npc)
void set_npc_sprite(Npc *npc, s32 anim, AnimID *extraAnimList)
void init_encounter_status(void)
void npc_update_decoration_glow_behind(Npc *npc, s32 idx)
void npc_update_decoration_sweat(Npc *npc, s32 idx)
void npc_remove_decoration_seeing_stars(Npc *npc, s32 idx)
s32 bind_enemy_interact(Enemy *enemy, EvtScript *interactScriptBytecode)
Binds the specified interact script to the specified enemy.
void npc_update_decoration_none(Npc *npc, s32 idx)
Npc * get_npc_safe(s32 npcID)
s8 resetMapEncounterFlags
struct Evt * interactScript
s8 scriptedBattle
battle started by StartBattle but not by encounter
Encounter * encounterList[24]
s8 battleTriggerCooldown
set to 15 after victory, 45 after fleeing
struct Evt * defeatScript
EvtScript * interactBytecode
EncounterStatus gCurrentEncounter
EvtScript * defeatBytecode
#define UNPACK_PAL_B(color)
#define UNPACK_PAL_R(color)
#define SPRITE_WORLD_SCALE_D
#define UNPACK_PAL_A(color)
#define COLLISION_WITH_ENTITY_BIT
#define UNPACK_PAL_G(color)
#define PACK_PAL_RGBA(r, g, b, a)
#define BATTLE_NPC_ID_BIT
s32 spr_draw_npc_sprite(s32 spriteInstanceID, s32 yaw, s32 arg2, PAL_PTR *paletteList, Matrix4f mtx)
s32 spr_update_sprite(s32 spriteInstanceID, s32 animID, f32 timeScale)
s32 spr_free_sprite(s32 spriteInstanceID)
s32 spr_get_notify_value(s32 spriteIndex)
void set_npc_imgfx_all(s32 spriteIdx, ImgFXType imgfxType, s32 imgfxArg1, s32 imgfxArg2, s32 imgfxArg3, s32 imgfxArg4, s32 imgfxArg5)
s32 spr_get_npc_color_variations(s32 npcSpriteID)
PAL_PTR * spr_get_npc_palettes(s32 npcSpriteID)
s32 func_802DDEC4(s32 spriteIdx)
s32 spr_load_npc_sprite(s32 animID, u32 *extraAnimList)
s32 spr_draw_player_sprite(s32 spriteInstanceID, s32 yaw, s32 alphaIn, PAL_PTR *paletteList, Matrix4f mtx)
s32 spr_update_player_sprite(s32 spriteInstanceID, s32 animID, f32 timeScale)
@ DRAW_SPRITE_OVERRIDE_YAW
@ DRAW_SPRITE_OVERRIDE_ALPHA
@ DRAW_SPRITE_OVERRIDE_PALETTES
@ SPRITE_ID_TAIL_ALLOCATE
void(* onRender)(struct Npc *)
void(* onUpdate)(struct Npc *)
struct EffectInstance * decorations[2]
void(* onUpdate)(struct Npc *)
Run before anything else for this NPC in update_npcs()
u8 hideAlpha
Used when hiding NPCs; Multiplied with Npc::alpha.
f32 screenSpaceOffset2D[2]
u16 ** originalPalettesList
u16 * adjustedPalettes[16]
s16 turnAroundYawAdjustment
s16 decorationGlowPhase[2]
s8 decorationInitialized[2]
void(* onRender)(struct Npc *)
Run after the display list for this NPC is built.
u16 copiedPalettes[16][16]
void(* appendGfx)(void *)
PartnerStatus gPartnerStatus
GameStatus * gGameStatusPtr
s32 NpcHitQueryColliderID
PlayerStatus gPlayerStatus
b32 EncounterStateChanged