papermario
Decompilation of Paper Mario
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
npc.h File Reference

Data Structures

struct  QuizRequirement
 
struct  NpcBlueprint
 
struct  MobileAISettings
 
struct  GuardAISettings
 
struct  FireBarAISettings
 
struct  FireBarData
 
struct  NpcSettings
 
struct  ItemDrop
 
struct  StatDrop
 Describes heart/flower drop chances after defeating an Npc in the overworld. More...
 
struct  EnemyDrops
 
struct  EnemyDropsFlat
 
struct  EnemyDetectVolume
 
struct  EnemyTerritoryWander
 
struct  EnemyTerritoryPatrol
 
union  EnemyTerritory
 
union  NpcInitialVars
 
struct  NpcData
 
struct  NpcGroup
 Zero-terminated. More...
 
struct  Enemy
 
struct  Encounter
 
struct  FieldStatus
 
struct  EncounterStatus
 
struct  NpcData.animations
 
union  Enemy.__unnamed53__
 

Macros

#define NPC_GROUP(args...)   VFUNC(NPC_GROUP, args)
 
#define NPC_GROUP1(npcs)   { sizeof(npcs) / sizeof(NpcData), (NpcData*) &npcs, 0, 0 }
 
#define NPC_GROUP2(npcs, battle)   { sizeof(npcs) / sizeof(NpcData), (NpcData*) &npcs, battle, 0 }
 
#define NPC_GROUP3(npcs, battle, stage)   { sizeof(npcs) / sizeof(NpcData), (NpcData*) &npcs, battle, stage + 1 }
 
#define NPC_GROUP_EXPLICIT_SIZE(args...)   VFUNC(NPC_GROUP_EXPLICIT_SIZE, args)
 
#define NPC_GROUP_EXPLICIT_SIZE3(npcs, start, count)   { count, (NpcData*) &npcs[start], 0, 0 }
 
#define NPC_GROUP_EXPLICIT_SIZE4(npcs, start, count, battle)   { count, (NpcData*) &npcs[start], battle, 0 }
 
#define NPC_GROUP_EXPLICIT_SIZE5(npcs, start, count, battle, stage)   { count, (NpcData*) &npcs[start], battle, stage + 1 }
 
#define NO_DROPS
 
#define STANDARD_HEART_DROPS(attempts)
 
#define GENEROUS_HEART_DROPS(attempts)
 
#define GENEROUS_WHEN_LOW_HEART_DROPS(attempts)
 
#define STANDARD_FLOWER_DROPS(attempts)
 
#define GENEROUS_WHEN_LOW_FLOWER_DROPS(attempts)
 
#define REDUCED_FLOWER_DROPS(attempts)
 
#define OVERRIDE_MOVEMENT_SPEED(speed)   ((s32)(speed * 32767))
 
#define NO_OVERRIDE_MOVEMENT_SPEED   OVERRIDE_MOVEMENT_SPEED(-1.0f)
 

Typedefs

typedef void(* FireBarCallback) (struct FireBarData *, s32)
 
typedef NpcGroup NpcGroupList[]
 
typedef void AIStateHandler(Evt *script, MobileAISettings *settings, EnemyDetectVolume *territory)
 

Enumerations

enum  TerritoryShape { SHAPE_CYLINDER , SHAPE_RECT }
 

Functions

b32 basic_ai_check_player_dist (EnemyDetectVolume *arg0, Enemy *arg1, f32 arg2, f32 arg3, s8 arg4)
 
void STUB_npc_callback (Npc *)
 The default Npc::onUpdate and Npc::onRender callback.
 
void mtx_ident_mirror_y (Matrix4f mtx)
 
void clear_npcs (void)
 
void init_npc_list (void)
 Points the current NPC list to the world or battle lists depending on game state.
 
void npc_iter_no_op (void)
 Iterates over the NPC list, doing absolutely nothing.
 
s32 create_npc_impl (NpcBlueprint *blueprint, AnimID *animList, s32 skipLoadingAnims)
 
s32 create_basic_npc (NpcBlueprint *blueprint)
 
s32 create_standard_npc (NpcBlueprint *blueprint, AnimID *animList)
 
s32 create_peach_npc (NpcBlueprint *blueprint)
 
void free_npc_by_index (s32 listIndex)
 
void free_npc (Npc *npc)
 
Npcget_npc_by_index (s32 listIndex)
 
void npc_do_world_collision (Npc *npc)
 
void npc_do_other_npc_collision (Npc *npc)
 
s32 npc_do_player_collision (Npc *npc)
 
void npc_try_apply_gravity (Npc *npc)
 
s32 npc_try_snap_to_ground (Npc *npc, f32 velocity)
 
void update_npcs (void)
 Updates all NPCs.
 
f32 npc_get_render_yaw (Npc *npc)
 
void appendGfx_npc (void *data)
 
void render_npcs (void)
 Renders all NPCs.
 
void npc_move_heading (Npc *npc, f32 speed, f32 yaw)
 
Npcget_npc_unsafe (s32 npcID)
 
Npcget_npc_safe (s32 npcID)
 
void enable_npc_shadow (Npc *npc)
 
void disable_npc_shadow (Npc *npc)
 
void update_npc_blur (Npc *npc)
 
void appendGfx_npc_blur (void *npc)
 
void npc_enable_collisions (void)
 
void npc_disable_collisions (void)
 
void func_8003B1A8 (void)
 
void npc_reload_all (void)
 
void set_npc_yaw (Npc *npc, f32 yaw)
 
void npc_set_palswap_mode_A (Npc *npc, s32 arg1)
 
void npc_set_palswap_mode_B (Npc *npc, s32 arg1)
 
void npc_revert_palswap_mode (Npc *npc)
 
void npc_set_palswap_1 (Npc *npc, s32 palIndexA, s32 palIndexB, s32 timeHoldA, s32 timeAB)
 
void npc_set_palswap_2 (Npc *npc, s32 timeHoldB, s32 timeBA, s32 palIndexC, s32 palIndexD)
 
void npc_draw_with_palswap (Npc *npc, s32 arg1, Matrix4f mtx)
 
void npc_render_without_adjusted_palettes (Npc *npc, s32 arg1, Matrix4f mtx)
 
s32 npc_render_with_watt_idle_palettes (Npc *, s32, Matrix4f mtx)
 
u16 npc_blend_palette_colors (u16 colorA, u16 colorB, s32 lerpAlpha)
 
s32 npc_render_with_single_pal_blending (Npc *, s32, s32, Matrix4f mtx)
 
s32 npc_render_with_double_pal_blending (Npc *, s32, Matrix4f mtx)
 
void npc_set_decoration (Npc *npc, s32 idx, s32 decorationType)
 
void npc_remove_decoration (Npc *npc, s32 idx)
 
s32 npc_update_decorations (Npc *npc)
 
void npc_remove_decoration_impl (Npc *npc, s32 idx)
 
void npc_reset_current_decoration (Npc *npc, s32 idx)
 
void npc_update_decoration_none (Npc *npc, s32 idx)
 
void npc_remove_decoration_none (Npc *npc, s32 idx)
 
void npc_update_decoration_bowser_aura (Npc *npc, s32 idx)
 
void npc_remove_decoration_bowser_aura (Npc *npc, s32 idx)
 
void npc_update_decoration_sweat (Npc *npc, s32 idx)
 
void npc_remove_decoration_sweat (Npc *npc, s32 idx)
 
void npc_update_decoration_seeing_stars (Npc *npc, s32 idx)
 
void npc_remove_decoration_seeing_stars (Npc *npc, s32 idx)
 
void npc_update_decoration_glow_in_front (Npc *npc, s32 idx)
 
void npc_remove_decoration_glow_in_front (Npc *npc, s32 idx)
 
void npc_update_decoration_glow_behind (Npc *npc, s32 idx)
 
void npc_remove_decoration_glow_behind (Npc *npc, s32 idx)
 
void npc_update_decoration_charged (Npc *npc, s32 idx)
 
void npc_remove_decoration_charged (Npc *npc, s32 idx)
 
void npc__reset_current_decoration (Npc *npc, s32 idx)
 
Npcnpc_find_closest (f32 x, f32 y, f32 z, f32 radius)
 Finds the closest NPC to a given point within a radius.
 
Npcnpc_find_closest_simple (f32 x, f32 y, f32 z, f32 radius)
 Finds the closest simple-hitbox NPC to a given point within a radius.
 
s32 npc_get_collider_below (Npc *npc)
 
void npc_imgfx_update (Npc *npc)
 
void npc_set_imgfx_params (Npc *npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6)
 
void spawn_surface_effects (Npc *npc, SurfaceInteractMode mode)
 
void spawn_default_surface_effects (Npc *npc, SurfaceInteractMode mode)
 
void spawn_flower_surface_effects (Npc *npc, SurfaceInteractMode mode)
 
void spawn_cloud_surface_effects (Npc *npc, SurfaceInteractMode mode)
 
void spawn_snow_surface_effects (Npc *npc, SurfaceInteractMode mode)
 
void spawn_hedge_surface_effects (Npc *npc, SurfaceInteractMode mode)
 
void spawn_water_surface_effects (Npc *npc, SurfaceInteractMode mode)
 
void COPY_set_defeated (s32 mapID, s32 encounterID)
 Duplicate of set_defeated().
 
void init_encounter_status (void)
 
void clear_encounter_status (void)
 
void func_8003E50C (void)
 
void func_8003E514 (s8 arg0)
 
void update_encounters (void)
 
void draw_encounter_ui (void)
 
void draw_first_strike_ui (void)
 
void npc_render_worker_do_nothing (void)
 
void make_npcs (s32 flags, s32 mapID, s32 *npcGroupList)
 
s32 kill_encounter (Enemy *enemy)
 
void kill_enemy (Enemy *enemy)
 
s32 bind_enemy_ai (Enemy *enemy, EvtScript *aiScriptBytecode)
 Binds the specified ai script to the specified enemy.
 
s32 bind_enemy_aux (Enemy *enemy, EvtScript *auxScriptBytecode)
 Binds the specified auxillary script to the specified enemy.
 
s32 bind_enemy_interact (Enemy *enemy, EvtScript *interactScriptBytecode)
 Binds the specified interact script to the specified enemy.
 
void bind_npc_ai (s32 npcID, EvtScript *npcAiBytecode)
 Binds the specified ai script to the npc matching the specified npcId.
 
void bind_npc_aux (s32 npcID, EvtScript *npcAuxBytecode)
 Binds the specified auxillary script to the npc matching the specified npcId.
 
void bind_npc_interact (s32 npcID, EvtScript *npcInteractBytecode)
 Binds the specified interact script to the npc matching the specified npcId.
 
Enemyget_enemy (s32 npcID)
 Looks for an enemy matching the specified npcID.
 
Enemyget_enemy_safe (s32 npcID)
 Same as get_enemy(), with the exception of always returning a value if an enemy is not found.
 
void set_npc_sprite (Npc *npc, s32 anim, AnimID *extraAnimList)
 

Variables

EncounterStatus gCurrentEncounter
 

Data Structure Documentation

◆ QuizRequirement

struct QuizRequirement
Data Fields
s32 numQuestionsUnlocked
s32 requiredStoryProgress

◆ MobileAISettings

struct MobileAISettings
Data Fields
f32 alertOffsetDist
f32 alertRadius
f32 chaseOffsetDist
f32 chaseRadius
f32 chaseSpeed
s32 chaseTurnRate
s32 chaseUpdateInterval
f32 moveSpeed
s32 moveTime
s32 playerSearchInterval
s32 unk_AI_2C
s32 waitTime

◆ GuardAISettings

struct GuardAISettings
Data Fields
f32 alertOffsetDist
f32 alertRadius
f32 chaseOffsetDist
f32 chaseRadius
f32 chaseSpeed
s32 chaseTurnRate
s32 chaseUpdateInterval
s32 playerSearchInterval
s32 unk_AI_20

◆ FireBarAISettings

struct FireBarAISettings
Data Fields
FireBarCallback callback
Vec3i centerPos
s32 firstNpc
s32 npcCount
s32 rotRate

◆ FireBarData

struct FireBarData
Data Fields
FireBarCallback callback
Vec3f centerPos
s32 firstNpc
s32 flags
f32 lastDeltaYaw
s32 npcCount
f32 rotRate
FireBarAISettings * settings
s32 soundIndex
f32 yaw

◆ NpcSettings

struct NpcSettings
Data Fields
s16 actionFlags
EvtScript * ai
EvtScript * aux
AnimID defaultAnim
s32 flags
s16 height
s16 level
EvtScript * onDefeat
EvtScript * onHit
EvtScript * onInteract
void * otherAI
s16 radius
s32 unk_24

◆ ItemDrop

struct ItemDrop
Data Fields
s16 flagIdx
s16 item
s16 weight

◆ StatDrop

struct StatDrop
Data Fields
s16 attempts Maximum number of hearts/flowers that can be dropped from this StatDrop.
s16 chancePerAttempt % chance for a single heart/flower to be dropped from each attempt.
s16 cutoff % of max HP/FP. If current HP/FP > cutoff, no hearts/flowers can be dropped.
s16 generalChance % chance for any hearts/flowers to be dropped at all from this StatDrop.

◆ EnemyDrops

struct EnemyDrops
Data Fields
u8 dropFlags
StatDrop flowerDrops[8]
StatDrop heartDrops[8]
u8 itemDropChance
ItemDrop itemDrops[8]
s16 maxCoinBonus
s16 minCoinBonus
char unk_DE[2]

◆ EnemyDropsFlat

struct EnemyDropsFlat
Data Fields
u8 dropFlags
s16 flowerDrops[8 *4]
s16 heartDrops[8 *4]
u8 itemDropChance
s16 itemDrops[8 *3]
s16 maxCoinBonus
s16 minCoinBonus
char unk_DE[2]

◆ EnemyDetectVolume

struct EnemyDetectVolume
Data Fields
s16 detectFlags
f32 halfHeight
s32 pointX
s32 pointZ
enum TerritoryShape shape
s32 sizeX
s32 sizeZ
s32 skipPlayerDetectChance

◆ EnemyTerritoryWander

struct EnemyTerritoryWander
Data Fields
Vec3i centerPos
Vec3i detectPos
enum TerritoryShape detectShape
VecXZi detectSize
b32 isFlying
s32 moveSpeedOverride
enum TerritoryShape wanderShape
VecXZi wanderSize

◆ EnemyTerritoryPatrol

struct EnemyTerritoryPatrol
Data Fields
Vec3i detectPos
enum TerritoryShape detectShape
VecXZi detectSize
b32 isFlying
s32 moveSpeedOverride
s32 numPoints
Vec3i points[10]

◆ EnemyTerritory

union EnemyTerritory
Data Fields
char PADDING[0xC0]
EnemyTerritoryPatrol patrol
EnemyTerritoryWander wander

◆ NpcInitialVars

union NpcInitialVars
Data Fields
s32 * array
s8 bytes[4]
s32 value

◆ NpcData

struct NpcData
Data Fields
u8 aiDetectFlags
u32 aiFlags
struct NpcData.animations animations
EnemyDrops drops
AnimID * extraAnimations
s32 flags
s32 id
EvtScript * init
NpcInitialVars initVar
s32 initVarCount
Vec3f pos
NpcSettings * settings
s32 tattle
EnemyTerritory territory
s8 unk__1E0
s8 unk__1E1
s8 unk__1E2
s32 yaw

◆ NpcGroup

struct NpcGroup
Data Fields
s16 battle
s32 npcCount
NpcData * npcs
s16 stage

◆ Enemy

struct Enemy
Data Fields
union Enemy.__unnamed53__ __unnamed__
EvtScript * aiBytecode
u8 aiDetectFlags
u32 aiFlags
struct Evt * aiScript
s32 aiScriptID
s8 aiSuspendTime
s32 * animList
EvtScript * auxBytecode
struct Evt * auxScript
s32 auxScriptID
EvtScript * defeatBytecode
struct Evt * defeatScript
s32 defeatScriptID
EnemyDrops * drops
s8 encountered
s8 encounterIndex
s32 flags
s8 hitboxIsActive
EvtScript * hitBytecode
struct Evt * hitScript
s32 hitScriptID
EvtScript * initBytecode
struct Evt * initScript
s32 initScriptID
s8 instigatorValue
EvtScript * interactBytecode
struct Evt * interactScript
s32 interactScriptID
s16 npcID
NpcSettings * npcSettings
s16 savedNpcYaw
u8 scriptGroup
s16 spawnPos[3]
u32 tattleMsg
EnemyTerritory * territory
Vec3s unk_10
char unk_16[2]
void * unk_64
char unk_68[4]
char unk_AD[3]
char unk_B6[2]
EvtScript * unk_B8
struct Evt * unk_BC
s32 unk_C0
s32 unk_C4
s32 unk_C8
s32 unk_DC
char unk_E2[6]

◆ Encounter

struct Encounter
Data Fields
s16 battle
s32 count
s16 encounterID
Enemy * enemy[16]
s16 stage
char unk_4C[2]

◆ FieldStatus

struct FieldStatus
Data Fields
s16 duration
char pad_01
s8 status

◆ EncounterStatus

struct EncounterStatus
Data Fields
s8 battleOutcome
s32 battleStartCountdown
s8 battleTriggerCooldown set to 15 after victory, 45 after fleeing
s16 coinsEarned
s8 curAreaIndex
Encounter * curEncounter
Enemy * curEnemy
u8 curEntryIndex
u8 curMapIndex
u8 damageTaken
s32 defeatFlags[60][12]
FieldStatus dizzyAttack
s8 dropWhackaBump
Encounter * encounterList[24]
s32 fadeOutAccel
s32 fadeOutAmount
s8 firstStrikeType
s32 flags
s8 forbidFleeing
s8 hasMerleeCoinBonus
s8 hitTier
s8 hitType
s8 instigatorValue
s8 mapID
s32 * npcGroupList
s8 numEncounters
s16 recentMaps[2]
s8 resetMapEncounterFlags
s8 scriptedBattle battle started by StartBattle but not by encounter
s32 songID
s32 substateDelay
char unk_07
s8 unk_08
char unk_0D
s32 unk_18
char unk_22[2]
FieldStatus unusedAttack1
FieldStatus unusedAttack2
FieldStatus unusedAttack3

◆ NpcData.animations

struct NpcData.animations
Data Fields
s32 anim_4
s32 anim_5
s32 anim_8
s32 anim_9
s32 anim_A
s32 anim_B
s32 anim_C
s32 anim_D
s32 anim_E
s32 anim_F
s32 chase
s32 death
s32 hit
s32 idle
s32 run
s32 walk

◆ Enemy.__unnamed53__

union Enemy.__unnamed53__
Data Fields
s32 varTable[16]
f32 varTableF[16]
void * varTablePtr[16]

Macro Definition Documentation

◆ GENEROUS_HEART_DROPS

#define GENEROUS_HEART_DROPS ( attempts)
Value:
{ \
{ F16(20), F16(80), attempts, F16(50) }, \
{ F16(30), F16(70), attempts, F16(50) }, \
{ F16(50), F16(60), attempts, F16(40) }, \
{ F16(80), F16(50), attempts, F16(40) }, \
{ F16(100), F16(40), attempts, F16(30) }, \
}
#define F16(f)
Fixed-point short literal.
Definition macros.h:182

◆ GENEROUS_WHEN_LOW_FLOWER_DROPS

#define GENEROUS_WHEN_LOW_FLOWER_DROPS ( attempts)
Value:
{ \
{ F16(20), F16(70), attempts, F16(50) }, \
{ F16(30), F16(60), attempts, F16(50) }, \
{ F16(50), F16(50), attempts, F16(40) }, \
{ F16(80), F16(40), attempts, F16(40) }, \
{ F16(100), F16(30), attempts, F16(40) }, \
}

◆ GENEROUS_WHEN_LOW_HEART_DROPS

#define GENEROUS_WHEN_LOW_HEART_DROPS ( attempts)
Value:
{ \
{ F16(20), F16(80), attempts, F16(60) }, \
{ F16(30), F16(70), attempts, F16(50) }, \
{ F16(50), F16(60), attempts, F16(50) }, \
{ F16(80), F16(50), attempts, F16(40) }, \
{ F16(100), F16(30), attempts, F16(30) }, \
}

◆ NO_DROPS

#define NO_DROPS
Value:
{ \
.dropFlags = NPC_DROP_FLAG_80, \
.heartDrops = { { F16(100), F16(0), 0, F16(0) } }, \
.flowerDrops = { { F16(100), F16(0), 0, F16(0) } }, \
}
@ NPC_DROP_FLAG_80
Definition enums.h:5089

◆ NO_OVERRIDE_MOVEMENT_SPEED

#define NO_OVERRIDE_MOVEMENT_SPEED   OVERRIDE_MOVEMENT_SPEED(-1.0f)

◆ NPC_GROUP

#define NPC_GROUP ( args...)    VFUNC(NPC_GROUP, args)

◆ NPC_GROUP1

#define NPC_GROUP1 ( npcs)    { sizeof(npcs) / sizeof(NpcData), (NpcData*) &npcs, 0, 0 }

◆ NPC_GROUP2

#define NPC_GROUP2 ( npcs,
battle )   { sizeof(npcs) / sizeof(NpcData), (NpcData*) &npcs, battle, 0 }

◆ NPC_GROUP3

#define NPC_GROUP3 ( npcs,
battle,
stage )   { sizeof(npcs) / sizeof(NpcData), (NpcData*) &npcs, battle, stage + 1 }

◆ NPC_GROUP_EXPLICIT_SIZE

#define NPC_GROUP_EXPLICIT_SIZE ( args...)    VFUNC(NPC_GROUP_EXPLICIT_SIZE, args)

◆ NPC_GROUP_EXPLICIT_SIZE3

#define NPC_GROUP_EXPLICIT_SIZE3 ( npcs,
start,
count )   { count, (NpcData*) &npcs[start], 0, 0 }

◆ NPC_GROUP_EXPLICIT_SIZE4

#define NPC_GROUP_EXPLICIT_SIZE4 ( npcs,
start,
count,
battle )   { count, (NpcData*) &npcs[start], battle, 0 }

◆ NPC_GROUP_EXPLICIT_SIZE5

#define NPC_GROUP_EXPLICIT_SIZE5 ( npcs,
start,
count,
battle,
stage )   { count, (NpcData*) &npcs[start], battle, stage + 1 }

◆ OVERRIDE_MOVEMENT_SPEED

#define OVERRIDE_MOVEMENT_SPEED ( speed)    ((s32)(speed * 32767))

◆ REDUCED_FLOWER_DROPS

#define REDUCED_FLOWER_DROPS ( attempts)
Value:
{ \
{ F16(20), F16(40), attempts, F16(40) }, \
{ F16(30), F16(40), attempts, F16(40) }, \
{ F16(50), F16(40), attempts, F16(40) }, \
{ F16(80), F16(40), attempts, F16(40) }, \
{ F16(100), F16(30), attempts, F16(40) }, \
}

◆ STANDARD_FLOWER_DROPS

#define STANDARD_FLOWER_DROPS ( attempts)
Value:
{ \
{ F16(20), F16(50), attempts, F16(40) }, \
{ F16(30), F16(40), attempts, F16(40) }, \
{ F16(50), F16(40), attempts, F16(40) }, \
{ F16(80), F16(40), attempts, F16(40) }, \
{ F16(100), F16(30), attempts, F16(40) }, \
}

◆ STANDARD_HEART_DROPS

#define STANDARD_HEART_DROPS ( attempts)
Value:
{ \
{ F16(20), F16(70), attempts, F16(50) }, \
{ F16(30), F16(60), attempts, F16(50) }, \
{ F16(50), F16(50), attempts, F16(40) }, \
{ F16(80), F16(40), attempts, F16(40) }, \
{ F16(100), F16(30), attempts, F16(30) }, \
}

Typedef Documentation

◆ AIStateHandler

typedef void AIStateHandler(Evt *script, MobileAISettings *settings, EnemyDetectVolume *territory)

◆ FireBarCallback

typedef void(* FireBarCallback) (struct FireBarData *, s32)

◆ NpcGroupList

typedef NpcGroup NpcGroupList[]

Enumeration Type Documentation

◆ TerritoryShape

Enumerator
SHAPE_CYLINDER 
SHAPE_RECT 

Function Documentation

◆ appendGfx_npc()

void appendGfx_npc ( void * data)

Referenced by render_npcs().

◆ appendGfx_npc_blur()

void appendGfx_npc_blur ( void * npc)

Referenced by render_npcs().

◆ basic_ai_check_player_dist()

◆ bind_enemy_ai()

s32 bind_enemy_ai ( Enemy * enemy,
EvtScript * aiScriptBytecode )

Binds the specified ai script to the specified enemy.

Parameters
enemypointer to the enemy to bind the script to
aiScriptBytecodepointer to the script to be bound.

Referenced by bind_npc_ai().

◆ bind_enemy_aux()

s32 bind_enemy_aux ( Enemy * enemy,
EvtScript * auxScriptBytecode )

Binds the specified auxillary script to the specified enemy.

Parameters
enemypointer to the enemy to bind the script to
auxScriptBytecodepointer to the script to be bound.

Referenced by bind_npc_aux().

◆ bind_enemy_interact()

s32 bind_enemy_interact ( Enemy * enemy,
EvtScript * interactScriptBytecode )

Binds the specified interact script to the specified enemy.

Parameters
enemypointer to the enemy to bind the script to
interactScriptBytecodepointer to the script to be bound.

Referenced by bind_npc_interact().

◆ bind_npc_ai()

void bind_npc_ai ( s32 npcID,
EvtScript * npcAiBytecode )

Binds the specified ai script to the npc matching the specified npcId.

Parameters
npcIDID of the desired npc
npcAiBytecodepointer to the script to be bound.

◆ bind_npc_aux()

void bind_npc_aux ( s32 npcID,
EvtScript * npcAuxBytecode )

Binds the specified auxillary script to the npc matching the specified npcId.

Parameters
npcIDID of the desired npc
npcAuxBytecodepointer to the script to be bound.

◆ bind_npc_interact()

void bind_npc_interact ( s32 npcID,
EvtScript * npcInteractBytecode )

Binds the specified interact script to the npc matching the specified npcId.

Parameters
npcIDID of the desired npc
npcInteractBytecodepointer to the script to be bound.

◆ clear_encounter_status()

void clear_encounter_status ( void )

◆ clear_npcs()

◆ COPY_set_defeated()

void COPY_set_defeated ( s32 mapID,
s32 encounterID )

Duplicate of set_defeated().

Referenced by kill_enemy().

◆ create_basic_npc()

s32 create_basic_npc ( NpcBlueprint * blueprint)

Referenced by create_partner_npc().

◆ create_npc_impl()

s32 create_npc_impl ( NpcBlueprint * blueprint,
AnimID * animList,
s32 skipLoadingAnims )

◆ create_peach_npc()

s32 create_peach_npc ( NpcBlueprint * blueprint)

Referenced by create_encounters().

◆ create_standard_npc()

s32 create_standard_npc ( NpcBlueprint * blueprint,
AnimID * animList )

◆ disable_npc_shadow()

◆ draw_encounter_ui()

void draw_encounter_ui ( void )

◆ draw_first_strike_ui()

void draw_first_strike_ui ( void )

Referenced by state_world_draw_aux_ui().

◆ enable_npc_shadow()

void enable_npc_shadow ( Npc * npc)

◆ free_npc()

void free_npc ( Npc * npc)

Referenced by kill_enemy().

◆ free_npc_by_index()

void free_npc_by_index ( s32 listIndex)

◆ func_8003B1A8()

◆ func_8003E50C()

void func_8003E50C ( void )

◆ func_8003E514()

void func_8003E514 ( s8 arg0)

◆ get_enemy()

Enemy * get_enemy ( s32 npcID)

Looks for an enemy matching the specified npcID.

Parameters
npcIDID of the npc bound to the desired enemy.
Returns
pointer to Enemy struct, if one is found. If one is not found, a panic occurs.

Referenced by ai_enemy_play_sound(), appendGfx_score_display(), FlyingMagikoopaAI_23(), LakituAI_GetAvailableSpiny(), MagikoopaAI_23(), MagikoopaAI_CanShootSpell(), MeleeHitbox_CanSeePlayer(), ProjectileHitbox_30(), ProjectileHitbox_32(), ProjectileHitbox_GetUsableProjectileID(), SentinelAI_DescendInit(), set_npc_animation(), and UnkNpcAIFunc48().

◆ get_enemy_safe()

Enemy * get_enemy_safe ( s32 npcID)

Same as get_enemy(), with the exception of always returning a value if an enemy is not found.

Parameters
npcIDID of the npc bound to the desired enemy.
Returns
pointer to Enemy struct, if one is found. Otherwise, NULL.

◆ get_npc_by_index()

◆ get_npc_safe()

◆ get_npc_unsafe()

Npc * get_npc_unsafe ( s32 npcID)

Referenced by ai_check_player_dist(), ai_suspend_for_time(), ai_try_set_state(), AvoidPlayerAI_Chase(), AvoidPlayerAI_ChaseInit(), AvoidPlayerAI_LosePlayer(), basic_ai_chase(), basic_ai_chase_init(), basic_ai_check_player_dist(), basic_ai_found_player_jump(), basic_ai_found_player_jump_init(), basic_ai_loiter(), basic_ai_loiter_init(), basic_ai_lose_player(), basic_ai_suspend(), basic_ai_wander(), basic_ai_wander_init(), BooPatrolAI_Loiter(), BooPatrolAI_Move(), can_dismount(), check_conversation_trigger(), CleftAI_Ambush(), CleftAI_CanSeePlayer(), CleftAI_Disguise(), CleftAI_DisguiseInit(), CleftAI_FindPlayer(), CleftAI_FindPlayerInit(), CleftAI_Hiding(), CleftAI_HidingInit(), CleftAI_LosePlayer(), CleftAI_PostDisguise(), CleftAI_PreAmbush(), CleftAI_ReturnHome(), CleftAI_RevUp(), CleftAI_RevUpInit(), CleftAI_Tackle(), ClubbaNappingAI_FallAsleep(), ClubbaNappingAI_Init(), ClubbaNappingAI_Loiter(), ClubbaNappingAI_LoiterInit(), ClubbaNappingAI_ReturnHome(), ClubbaNappingAI_ReturnHomeInit(), ClubbaNappingAI_Sleep(), ClubbaNappingAI_WakeUp(), draw_encounters_pre_battle(), FlyingAI_Chase(), FlyingAI_ChaseInit(), FlyingAI_Jump(), FlyingAI_JumpInit(), FlyingAI_Loiter(), FlyingAI_LoiterInit(), FlyingAI_LosePlayer(), FlyingAI_Wander(), FlyingAI_WanderInit(), FlyingMagikoopaAI_10(), FlyingMagikoopaAI_11(), FlyingMagikoopaAI_15(), FlyingMagikoopaAI_16(), FlyingMagikoopaAI_17(), FlyingMagikoopaAI_20(), FlyingMagikoopaAI_21(), FlyingMagikoopaAI_22(), FlyingMagikoopaAI_23(), FlyingMagikoopaAI_24(), FlyingMagikoopaAI_50(), FlyingNoAttackAI_12(), FlyingNoAttackAI_13(), FlyingNoAttackAI_20(), func_80048F0C(), func_80240198_BC7FF8(), func_8024022C_BC808C(), func_802409E8_BD4258(), func_80240A7C_BD42EC(), get_npc_pos(), GrooveGuyAI_02(), GrooveGuyAI_03(), GuardAI_Alert(), GuardAI_AlertInit(), GuardAI_Chase(), GuardAI_ChaseInit(), GuardAI_Idle(), GuardAI_IdleInit(), GuardAI_LosePlayer(), GuardAI_ReturnHome(), GuardAI_ReturnHomeInit(), HoppingAI_Chase(), HoppingAI_ChaseInit(), HoppingAI_Hop(), HoppingAI_HopInit(), HoppingAI_Loiter(), HoppingAI_LoiterInit(), HoppingAI_LosePlayer(), kill_enemy(), LakituAI_Loiter(), LakituAI_Wander(), MagikoopaAI_00(), MagikoopaAI_01(), MagikoopaAI_05(), MagikoopaAI_06(), MagikoopaAI_10(), MagikoopaAI_11(), MagikoopaAI_20(), MagikoopaAI_21(), MagikoopaAI_22(), MagikoopaAI_23(), MagikoopaAI_24(), MagikoopaAI_CanShootSpell(), MeleeHitbox_30(), MeleeHitbox_31(), MeleeHitbox_32(), MeleeHitbox_33(), MeleeHitbox_CanSeePlayer(), ParatroopaAI_Dive(), ParatroopaAI_Overshoot(), ParatroopaAI_Reset(), ParatroopaAI_Windup(), PatrolAI_Chase(), PatrolAI_ChaseInit(), PatrolAI_Jump(), PatrolAI_JumpInit(), PatrolAI_Loiter(), PatrolAI_LoiterInit(), PatrolAI_LosePlayer(), PatrolAI_Move(), PatrolAI_MoveInit(), PatrolAI_PostLoiter(), PatrolNoAttackAI_15(), PiranhaPlantAI_00(), PiranhaPlantAI_01(), PiranhaPlantAI_10(), PiranhaPlantAI_11(), PiranhaPlantAI_12(), PiranhaPlantAI_13(), PiranhaPlantAI_LosePlayer(), ProjectileHitbox_30(), ProjectileHitbox_31(), ProjectileHitbox_32(), ProjectileHitbox_33(), ProjectileHitbox_GetUsableProjectileID(), reset_outta_sight_alpha_on_menu_close(), SentinelAI_Chase(), SentinelAI_ChaseInit(), SentinelAI_Descend(), SentinelAI_DescendInit(), SentinelAI_GrabPlayer(), SentinelAI_LosePlayer(), SentinelAI_LosePlayerInit(), SentinelAI_PostLosePlayer(), SentinelAI_ReturnHome(), SentinelAI_ReturnHomeInit(), set_script_owner_npc_anim(), set_script_owner_npc_col_height(), ShyGuyPatrolAI_14(), ShyGuyPatrolAI_15(), ShyGuyPatrolAI_16(), ShyGuyPatrolAI_17(), ShyGuyWanderAI_14(), ShyGuyWanderAI_15(), ShyGuyWanderAI_16(), ShyGuyWanderAI_17(), spawn_drops(), SpearGuyAI_Loiter(), SpearGuyAI_LoiterInit(), StoneChompAI_ChaseInit(), StoneChompAI_HopInit(), sync_player_position(), UnkDistFunc(), UnkNpcAIFunc12(), UnkNpcAIFunc48(), update_encounters_neutral(), update_encounters_post_battle(), and update_player().

◆ init_encounter_status()

void init_encounter_status ( void )

◆ init_npc_list()

void init_npc_list ( void )

Points the current NPC list to the world or battle lists depending on game state.

Referenced by state_step_end_battle(), state_step_exit_language_select(), and state_step_unpause().

◆ kill_encounter()

s32 kill_encounter ( Enemy * enemy)

◆ kill_enemy()

void kill_enemy ( Enemy * enemy)

◆ make_npcs()

void make_npcs ( s32 flags,
s32 mapID,
s32 * npcGroupList )

◆ mtx_ident_mirror_y()

void mtx_ident_mirror_y ( Matrix4f mtx)

Referenced by appendGfx_npc().

◆ npc__reset_current_decoration()

void npc__reset_current_decoration ( Npc * npc,
s32 idx )

◆ npc_blend_palette_colors()

u16 npc_blend_palette_colors ( u16 colorA,
u16 colorB,
s32 lerpAlpha )

◆ npc_disable_collisions()

void npc_disable_collisions ( void )

◆ npc_do_other_npc_collision()

void npc_do_other_npc_collision ( Npc * npc)

Referenced by update_npcs().

◆ npc_do_player_collision()

s32 npc_do_player_collision ( Npc * npc)
Returns
TRUE if a collision occurred

Referenced by update_npcs().

◆ npc_do_world_collision()

void npc_do_world_collision ( Npc * npc)

◆ npc_draw_with_palswap()

void npc_draw_with_palswap ( Npc * npc,
s32 arg1,
Matrix4f mtx )

Referenced by appendGfx_npc().

◆ npc_enable_collisions()

void npc_enable_collisions ( void )

◆ npc_find_closest()

Npc * npc_find_closest ( f32 x,
f32 y,
f32 z,
f32 radius )

Finds the closest NPC to a given point within a radius.

Ignores Y position.

NPCs with NPC_FLAG_PARTNER set are ignored. See also npc_find_closest_simple(), which requires that NPC_FLAG_PARTNER be set.

Parameters
xX position
yY position (unused)
zZ position
radiusNo NPCs further than this distance will be considered
Returns
NULL if there are no NPCs within radius

Referenced by parasol_get_npc().

◆ npc_find_closest_simple()

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.

Ignores Y position.

Only NPCs with NPC_FLAG_PARTNER set are considered. See also npc_find_closest(), which requires that NPC_FLAG_PARTNER be unset.

Parameters
xX position
yY position (unused)
zZ position
radiusNo NPCs further than this distance will be considered
Returns
NULL if there are no NPCs within radius

Referenced by entity_Tweester_idle().

◆ npc_get_collider_below()

s32 npc_get_collider_below ( Npc * npc)

◆ npc_get_render_yaw()

f32 npc_get_render_yaw ( Npc * npc)

◆ npc_imgfx_update()

void npc_imgfx_update ( Npc * npc)

◆ npc_iter_no_op()

void npc_iter_no_op ( void )

Iterates over the NPC list, doing absolutely nothing.

Presumably did something once upon a time but got commented out.

Referenced by step_game_loop().

◆ npc_move_heading()

◆ npc_reload_all()

◆ npc_remove_decoration()

void npc_remove_decoration ( Npc * npc,
s32 idx )

Referenced by free_npc(), and free_npc_by_index().

◆ npc_remove_decoration_bowser_aura()

void npc_remove_decoration_bowser_aura ( Npc * npc,
s32 idx )

◆ npc_remove_decoration_charged()

void npc_remove_decoration_charged ( Npc * npc,
s32 idx )

◆ npc_remove_decoration_glow_behind()

void npc_remove_decoration_glow_behind ( Npc * npc,
s32 idx )

◆ npc_remove_decoration_glow_in_front()

void npc_remove_decoration_glow_in_front ( Npc * npc,
s32 idx )

◆ npc_remove_decoration_impl()

void npc_remove_decoration_impl ( Npc * npc,
s32 idx )

◆ npc_remove_decoration_none()

void npc_remove_decoration_none ( Npc * npc,
s32 idx )

◆ npc_remove_decoration_seeing_stars()

void npc_remove_decoration_seeing_stars ( Npc * npc,
s32 idx )

◆ npc_remove_decoration_sweat()

void npc_remove_decoration_sweat ( Npc * npc,
s32 idx )

◆ npc_render_with_double_pal_blending()

s32 npc_render_with_double_pal_blending ( Npc * npc,
s32 yaw,
Matrix4f mtx )
Bug
? should this be index 3?

Referenced by npc_draw_with_palswap().

◆ npc_render_with_single_pal_blending()

s32 npc_render_with_single_pal_blending ( Npc * npc,
s32 yaw,
s32 hasDifferentIntervals,
Matrix4f mtx )

Referenced by npc_draw_with_palswap().

◆ npc_render_with_watt_idle_palettes()

s32 npc_render_with_watt_idle_palettes ( Npc * npc,
s32 arg1,
Matrix4f mtx )

Referenced by npc_draw_with_palswap().

◆ npc_render_without_adjusted_palettes()

void npc_render_without_adjusted_palettes ( Npc * npc,
s32 arg1,
Matrix4f mtx )

Referenced by npc_draw_with_palswap().

◆ npc_render_worker_do_nothing()

void npc_render_worker_do_nothing ( void )

◆ npc_reset_current_decoration()

void npc_reset_current_decoration ( Npc * npc,
s32 idx )

Referenced by npc_reload_all().

◆ npc_revert_palswap_mode()

void npc_revert_palswap_mode ( Npc * npc)

◆ npc_set_decoration()

void npc_set_decoration ( Npc * npc,
s32 idx,
s32 decorationType )

◆ npc_set_imgfx_params()

void npc_set_imgfx_params ( Npc * npc,
s32 arg1,
s32 arg2,
s32 arg3,
s32 arg4,
s32 arg5,
s32 arg6 )

◆ npc_set_palswap_1()

void npc_set_palswap_1 ( Npc * npc,
s32 palIndexA,
s32 palIndexB,
s32 timeHoldA,
s32 timeAB )

◆ npc_set_palswap_2()

void npc_set_palswap_2 ( Npc * npc,
s32 timeHoldB,
s32 timeBA,
s32 palIndexC,
s32 palIndexD )

◆ npc_set_palswap_mode_A()

void npc_set_palswap_mode_A ( Npc * npc,
s32 arg1 )

◆ npc_set_palswap_mode_B()

void npc_set_palswap_mode_B ( Npc * npc,
s32 arg1 )

◆ npc_try_apply_gravity()

void npc_try_apply_gravity ( Npc * npc)

Referenced by update_npcs().

◆ npc_try_snap_to_ground()

s32 npc_try_snap_to_ground ( Npc * npc,
f32 velocity )

Referenced by partner_get_out(), and update_npcs().

◆ npc_update_decoration_bowser_aura()

void npc_update_decoration_bowser_aura ( Npc * npc,
s32 idx )

Referenced by npc_update_decorations().

◆ npc_update_decoration_charged()

void npc_update_decoration_charged ( Npc * npc,
s32 idx )

Referenced by npc_update_decorations().

◆ npc_update_decoration_glow_behind()

void npc_update_decoration_glow_behind ( Npc * npc,
s32 idx )

Referenced by npc_update_decorations().

◆ npc_update_decoration_glow_in_front()

void npc_update_decoration_glow_in_front ( Npc * npc,
s32 idx )

Referenced by npc_update_decorations().

◆ npc_update_decoration_none()

void npc_update_decoration_none ( Npc * npc,
s32 idx )

Referenced by npc_update_decorations().

◆ npc_update_decoration_seeing_stars()

void npc_update_decoration_seeing_stars ( Npc * npc,
s32 idx )

Referenced by npc_update_decorations().

◆ npc_update_decoration_sweat()

void npc_update_decoration_sweat ( Npc * npc,
s32 idx )

Referenced by npc_update_decorations().

◆ npc_update_decorations()

s32 npc_update_decorations ( Npc * npc)

Referenced by update_npcs().

◆ render_npcs()

void render_npcs ( void )

Renders all NPCs.

Referenced by render_frame().

◆ set_npc_sprite()

void set_npc_sprite ( Npc * npc,
s32 anim,
AnimID * extraAnimList )

◆ set_npc_yaw()

◆ spawn_cloud_surface_effects()

void spawn_cloud_surface_effects ( Npc * npc,
SurfaceInteractMode mode )

Referenced by spawn_surface_effects().

◆ spawn_default_surface_effects()

void spawn_default_surface_effects ( Npc * npc,
SurfaceInteractMode mode )

Referenced by spawn_surface_effects().

◆ spawn_flower_surface_effects()

void spawn_flower_surface_effects ( Npc * npc,
SurfaceInteractMode mode )

Referenced by spawn_surface_effects().

◆ spawn_hedge_surface_effects()

void spawn_hedge_surface_effects ( Npc * npc,
SurfaceInteractMode mode )

Referenced by spawn_surface_effects().

◆ spawn_snow_surface_effects()

void spawn_snow_surface_effects ( Npc * npc,
SurfaceInteractMode mode )

Referenced by spawn_surface_effects().

◆ spawn_surface_effects()

◆ spawn_water_surface_effects()

void spawn_water_surface_effects ( Npc * npc,
SurfaceInteractMode mode )

Referenced by spawn_surface_effects().

◆ STUB_npc_callback()

void STUB_npc_callback ( Npc * npc)

The default Npc::onUpdate and Npc::onRender callback.

Referenced by create_npc_impl().

◆ update_encounters()

◆ update_npc_blur()

void update_npc_blur ( Npc * npc)

Referenced by update_npcs().

◆ update_npcs()

Variable Documentation

◆ gCurrentEncounter