DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
CNPCharacter Class Reference

#include <npcharacter.hpp>

Inheritance diagram for CNPCharacter:
CCharacter CObject

Public Member Functions

virtual void Step ()
 
virtual void ShadowStep ()
 
void PlaySeq ()
 
void ClearSeq ()
 
int SetSeq (float *destination, float speed)
 
int SetWait (int frames)
 
int CheckSeq ()
 
NP_SEQUENCE * GetNextSeq ()
 
NP_SEQUENCE * GetNowSeq ()
 
void NextSeq ()
 
virtual void Draw ()
 
virtual void DrawShadow ()
 
int CheckDraw ()
 
virtual int PickUpPoly (float *position, CCPoly *polygons)
 
virtual void Initialize ()
 
 CNPCharacter ()
 
- Public Member Functions inherited from CCharacter
 CCharacter ()
 
void SetMotion (int no, int mode, float speed=-1.0f)
 
void SetMotionSpeed (float speed)
 
void ClearPointLight ()
 
int SetPointLight (float *pos, float inner_range, float outer_range, float red, float green, float blue, float alpha)
 
void InitializeTexAnime (CTexAnimeData *data, int count)
 
void ClearTexAnime ()
 
void TextureAnime (int step)
 
void TexAnimeOn (int no)
 
void TexAnimeOff (int no)
 
int SetFootSound (float left_frame, float right_frame, int motion_no)
 
void SetFootSoundID (int id)
 
void FootSoundEnable (int on)
 
void EventEnable (int on)
 
void SetEvent (float frame, int kind, int no, int motion_no)
 
void ClearEvent (int motion_no)
 
void SetMotionCamera (CCamera *camera)
 
tagMOTION_TYPE * GetMotionParam (int motion_no, int *out_index, int *out_start, int *out_end, int *out_set)
 
MOTION_INFO * GetMotionInfo (int motion_no)
 
float GetNowTime ()
 
virtual void ClothStep (int step)
 
virtual void ClothFloor (int floor)
 
virtual void StopCloth (int unused)
 
virtual void GetPosition (float *out_position)
 
virtual void SetPosition (float x, float y, float z)
 
virtual void GetWorldPosition (float *out_position)
 
virtual void SetPosition (float *position)
 
virtual void SetPosition (CVector3_f_ position)
 
virtual void SetRotation (float x, float y, float z)
 
virtual void SetRotation (float *rotation)
 
virtual void SetRotation (CVector3_f_ rotation)
 
virtual void SetScale (float x, float y, float z)
 
virtual void SetScale (float *scale)
 
virtual void LoadPackData (unsigned int *pack, char *name, CDataAlloc2< 1 > *model_alloc, CDataAlloc2< 1 > *texture_alloc)
 
virtual void LoadPackData (unsigned int *pack, char *name, CDataAlloc2< 1 > *model_alloc, CDataAlloc2< 1 > *motion_alloc, CDataAlloc2< 1 > *texture_alloc)
 
virtual void LoadPackData2 (unsigned int *pack, char *name, CDataAlloc2< 1 > *alloc, int texture_block_no, CDataAlloc2< 1 > *image_alloc, int visual_type)
 
virtual void LoadPackData3 (unsigned int *pack, char *name, CDataAlloc2< 1 > *alloc, int texture_block_no, CDataAlloc2< 1 > *image_alloc, int keep_textures, int visual_type)
 
void DeleteExtendTexture (int block_no)
 
void DeleteExtendMotion ()
 
- Public Member Functions inherited from CObject
CObject & operator= (const CObject &source)
 
float GetDistance (CObject &other)
 
void GetDir (CObject &other, float *out_direction)
 
virtual void SetMass (float mass)
 
virtual void SetVelocity (CVector3_f_ velocity)
 
virtual void SetAcceleration (CVector3_f_ acceleration)
 
virtual void SetGravity (CVector3_f_ gravity)
 
virtual void SetMoment (CVector3_f_ moment)
 
virtual void SetRotVelocity (CVector3_f_ rot_velocity)
 
virtual void SetRotAcceleration (CVector3_f_ rot_acceleration)
 
virtual float GetMass ()
 
virtual void GetPosition (CVector3_f_ *out_position)
 
virtual void GetVelocity (CVector3_f_ *out_velocity)
 
virtual void GetAcceleration (CVector3_f_ *out_acceleration)
 
virtual void GetGravity (CVector3_f_ *out_gravity)
 
virtual void GetMoment (CVector3_f_ *out_moment)
 
virtual void GetRotation (float *out_rotation)
 
virtual void GetRotation (CVector3_f_ *out_rotation)
 
virtual void GetRotVelocity (CVector3_f_ *out_rot_velocity)
 
virtual void GetRotAcceleration (CVector3_f_ *out_rot_acceleration)
 
virtual CVector3_f_ * GetVelocity ()
 
virtual CVector3_f_ * GetAcceleration ()
 
virtual CVector3_f_ * GetGravity ()
 
virtual CVector3_f_ * GetMoment ()
 
virtual CVector3_f_ * GetRotation ()
 
virtual CVector3_f_ * GetRotVelocity ()
 
virtual CVector3_f_ * GetRotAcceleration ()
 
virtual void GetScale (float *out_scale)
 
 CObject (float mass=1.0f)
 
void Initialize (float mass)
 

Public Attributes

int sequence_enabled
 
int read_index
 
int write_index
 
u8 unk_11BC [4]
 
NP_SEQUENCE sequences [8]
 
s32 map_parts_no
 
s32 villager_id
 
char resource_name [0x20]
 
s32 talk_target
 
s32 initialized
 
s32 draw_enabled
 
s32 near_camera
 
int step_hidden
 
s32 event_status
 
s32 unk_1480
 
int alpha_step
 
s32 alpha_step_override
 
s32 texture_block
 
s32 recurring_talk_event
 
u8 unk_1494 [0xC]
 
- Public Attributes inherited from CCharacter
float body_width
 
float body_height
 
float body_depth
 
CFrame * frame
 
CFrame * shadow_frame
 
u_int * images [4]
 
char * config
 
s32 config_size
 
CTextureAnime tex_anime
 
tagFRAME_INF * frame_info
 
tagFRAME_INF * shadow_frame_info
 
tagMOTION_TYPE motion_type
 
tagMOTION_TYPE shadow_motion_type
 
s32 motion_start [CHARA_MOTION_MAX]
 
s32 motion_end [CHARA_MOTION_MAX]
 
MotionParam motion_storage [CHARA_MOTION_MAX]
 
MotionParam shadow_motion_storage [CHARA_MOTION_MAX]
 
tagMOTION_TYPE * motion [CHARA_MOTION_MAX]
 
tagMOTION_TYPE * shadow_motion [CHARA_MOTION_MAX]
 
float motion_speed
 
s32 motion_flags
 
s32 motion_no
 
float unk_C6C
 
s32 motion_state
 
CCloth ** cloth
 
CCloth * cloth_buf [8]
 
s32 wind
 
s32 fade_out
 
s32 ground_ambient_no
 
sceVu0FVECTOR ground_ambient [2]
 
sceVu0FVECTOR ambient_tint
 
sceVu0FVECTOR ambient_offset
 
float fade [4]
 
CFakePointLight point_light [CHARA_POINT_LIGHT_MAX]
 
CHARA_FOOT_SOUND foot_sound [CHARA_FOOT_SOUND_MAX]
 
s32 foot_sound_id
 
s32 foot_sound_enable
 
s32 foot_sound_wait
 
s32 event_enable
 
CHARA_EVENT event [CHARA_EVENT_MAX]
 
CHARA_UNK_1068 unk_1068 [16]
 
- Public Attributes inherited from CObject
float mass
 
float unk_004 [3]
 
float pos [4]
 
CVector3_f_ velocity
 
CVector3_f_ acceleration
 
CVector3_f_ gravity
 
CVector3_f_ moment
 
CVector3_f_ rotation
 
CVector3_f_ rot_velocity
 
CVector3_f_ rot_acceleration
 
float scale [4]
 

Additional Inherited Members

- Static Public Attributes inherited from CCharacter
static s32 MotionStopFlag
 

Detailed Description

Controls a non-player character and its queued movement actions.

Definition at line 36 of file npcharacter.hpp.

Constructor & Destructor Documentation

◆ CNPCharacter()

CNPCharacter::CNPCharacter ( )

Constructs a non-player character.

Mangled name:
__ct__12CNPCharacterFv
Address:
0x156A70
Size:
0xEC

Definition at line 294 of file npcharacter.cpp.

Member Function Documentation

◆ Step()

void CNPCharacter::Step ( )
virtual

Advances the character, its fade, and its movement sequence.

Mangled name:
Step__12CNPCharacterFv
Address:
0x155FB0
Size:
0x134

Reimplemented from CCharacter.

Definition at line 9 of file npcharacter.cpp.

◆ ShadowStep()

void CNPCharacter::ShadowStep ( )
virtual

Advances the shadow while the NPC is visible.

Mangled name:
ShadowStep__12CNPCharacterFv
Address:
0x1560F0
Size:
0x4C

Reimplemented from CCharacter.

Definition at line 44 of file npcharacter.cpp.

◆ PlaySeq()

void CNPCharacter::PlaySeq ( )

Advances the current movement or wait action.

Mangled name:
PlaySeq__12CNPCharacterFv
Address:
0x156140
Size:
0x210

Definition at line 54 of file npcharacter.cpp.

◆ ClearSeq()

void CNPCharacter::ClearSeq ( )

Clears the action ring and enables sequence playback.

Mangled name:
ClearSeq__12CNPCharacterFv
Address:
0x156350
Size:
0x48

Definition at line 102 of file npcharacter.cpp.

◆ SetSeq()

int CNPCharacter::SetSeq ( float *  destination,
float  speed 
)

Queues movement to a destination at the specified speed.

Mangled name:
SetSeq__12CNPCharacterFPff
Address:
0x1563A0
Size:
0x6C

Definition at line 112 of file npcharacter.cpp.

◆ SetWait()

int CNPCharacter::SetWait ( int  frames)

Queues a wait lasting the specified frame count.

Mangled name:
SetWait__12CNPCharacterFi
Address:
0x156410
Size:
0x3C

Definition at line 122 of file npcharacter.cpp.

◆ CheckSeq()

int CNPCharacter::CheckSeq ( )

Reports whether the action ring contains pending entries.

Mangled name:
CheckSeq__12CNPCharacterFv
Address:
0x156450
Size:
0x18

Definition at line 129 of file npcharacter.cpp.

◆ GetNextSeq()

NP_SEQUENCE * CNPCharacter::GetNextSeq ( )

Returns the next writable action record and advances the write index.

Mangled name:
GetNextSeq__12CNPCharacterFv
Address:
0x156470
Size:
0x3C

Definition at line 133 of file npcharacter.cpp.

◆ GetNowSeq()

NP_SEQUENCE * CNPCharacter::GetNowSeq ( )

Returns the current action record.

Mangled name:
GetNowSeq__12CNPCharacterFv
Address:
0x1564B0
Size:
0x20

Definition at line 144 of file npcharacter.cpp.

◆ NextSeq()

void CNPCharacter::NextSeq ( )

Releases the current action and advances the read index.

Mangled name:
NextSeq__12CNPCharacterFv
Address:
0x1564D0
Size:
0x64

Definition at line 148 of file npcharacter.cpp.

◆ Draw()

void CNPCharacter::Draw ( )
virtual

Draws the NPC with its ambient colour and alpha overrides.

Mangled name:
Draw__12CNPCharacterFv
Address:
0x156540
Size:
0xD8

Reimplemented from CCharacter.

Definition at line 160 of file npcharacter.cpp.

◆ DrawShadow()

void CNPCharacter::DrawShadow ( )
virtual

Draws the shadow while the NPC is visible.

Mangled name:
DrawShadow__12CNPCharacterFv
Address:
0x156620
Size:
0x4C

Reimplemented from CCharacter.

Definition at line 181 of file npcharacter.cpp.

◆ CheckDraw()

int CNPCharacter::CheckDraw ( )

Reports whether the enabled NPC has a model and positive alpha.

Mangled name:
CheckDraw__12CNPCharacterFv
Address:
0x156670
Size:
0x58

Definition at line 191 of file npcharacter.cpp.

◆ PickUpPoly()

int CNPCharacter::PickUpPoly ( float *  position,
CCPoly *  polygons 
)
virtual

Builds collision polygons for the NPC when enabled.

Mangled name:
PickUpPoly__12CNPCharacterFPfP6CCPoly
Address:
0x1566D0
Size:
0x38

Reimplemented from CCharacter.

Definition at line 203 of file npcharacter.cpp.

◆ Initialize()

void CNPCharacter::Initialize ( )
virtual

Initializes the NPC state and clears queued actions.

Mangled name:
Initialize__12CNPCharacterFv
Address:
0x1569E0
Size:
0x8C

Reimplemented from CCharacter.

Definition at line 271 of file npcharacter.cpp.

Member Data Documentation

◆ sequence_enabled

int CNPCharacter::sequence_enabled

Enables advancement of queued actions.

Definition at line 38 of file npcharacter.hpp.

◆ read_index

int CNPCharacter::read_index

Index of the current action.

Definition at line 39 of file npcharacter.hpp.

◆ write_index

int CNPCharacter::write_index

Index of the next record to fill.

Definition at line 40 of file npcharacter.hpp.

◆ unk_11BC

u8 CNPCharacter::unk_11BC[4]

Definition at line 41 of file npcharacter.hpp.

◆ sequences

NP_SEQUENCE CNPCharacter::sequences[8]

Circular storage for movement and wait actions.

Definition at line 42 of file npcharacter.hpp.

◆ map_parts_no

s32 CNPCharacter::map_parts_no

Edited-map part associated with the villager, or a negative value.

Definition at line 43 of file npcharacter.hpp.

◆ villager_id

s32 CNPCharacter::villager_id

Villager-table identifier represented by this event NPC.

Definition at line 44 of file npcharacter.hpp.

◆ resource_name

char CNPCharacter::resource_name[0x20]

Resource name of the model loaded for the villager.

Definition at line 45 of file npcharacter.hpp.

◆ talk_target

s32 CNPCharacter::talk_target

Whether the player stands close enough and faces the villager to talk to it.

Definition at line 46 of file npcharacter.hpp.

◆ initialized

s32 CNPCharacter::initialized

Whether the villager model has been initialized for use.

Definition at line 47 of file npcharacter.hpp.

◆ draw_enabled

s32 CNPCharacter::draw_enabled

Whether the villager model participates in drawing and movement.

Definition at line 48 of file npcharacter.hpp.

◆ near_camera

s32 CNPCharacter::near_camera

Whether proximity to the camera requests this villager's full update.

Definition at line 49 of file npcharacter.hpp.

◆ step_hidden

int CNPCharacter::step_hidden

Steps the character while it is not visible.

Definition at line 50 of file npcharacter.hpp.

◆ event_status

s32 CNPCharacter::event_status

Status value exposed to an event script for the talking NPC.

Definition at line 51 of file npcharacter.hpp.

◆ unk_1480

s32 CNPCharacter::unk_1480

Definition at line 52 of file npcharacter.hpp.

◆ alpha_step

int CNPCharacter::alpha_step

Default alpha change per frame.

Definition at line 53 of file npcharacter.hpp.

◆ alpha_step_override

s32 CNPCharacter::alpha_step_override

Alpha change for the next step only, replacing alpha_step, or -1.

Definition at line 54 of file npcharacter.hpp.

◆ texture_block

s32 CNPCharacter::texture_block

Texture block the model's textures and texture animations live in.

Definition at line 55 of file npcharacter.hpp.

◆ recurring_talk_event

s32 CNPCharacter::recurring_talk_event

Event number used for repeated conversations with this villager.

Definition at line 56 of file npcharacter.hpp.

◆ unk_1494

u8 CNPCharacter::unk_1494[0xC]

Definition at line 57 of file npcharacter.hpp.