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

#include <monstorunit.hpp>

Public Member Functions

int GetCurrentMonsterIndex ()
 
int GetMonstorNum ()
 
void DrawMapSymbol (float *offset)
 
void SetKey ()
 
int CheckEventFlag2 ()
 
void ArrangementPos (CDungeonMap *map, int count, int model_no, int unused)
 
void AllBin2 ()
 
void PalletSet ()
 
void PalletStep ()
 
void SoundCheck ()
 
void DrawMonstor ()
 
void DrawMonstorCursor ()
 
void DrawShadowMonstor ()
 
void CheckViewLevel ()
 
int SelectAttachi ()
 
int CheckDmg ()
 
void MoveCheck (float *position, float *movement, int flat)
 
void MoveCheck2 ()
 
void MoveChecMonster ()
 
void Step (int pause)
 
void CleanViewMonstor (int back_floor)
 
int SetupBaseModel (int slot, int model_no, int texture_block, CDataAlloc2< 1 > *alloc)
 
int SetupViewMonstor (int model_no, float *position, int event_flag)
 

Public Attributes

CDataAlloc2< 1 > * script [16]
 
CFrame * collision
 
s32 back_dungeon
 
s32 model_count
 
s32 alive_count
 
s32 script_state [16]
 
s32 current_monster
 
s32 requested_event
 
s32 paused
 
s32 unk_09C
 
CMonstorChara base_chara [9]
 
MONSTOR_MODEL model [9]
 
char * script_data [9]
 
MONSTOR monster [16]
 
CMonstorChara chara [16]
 
CRunScript interpreter [16]
 
MONSTOR_EFFECT_STATE effect [16]
 
MONSTOR_EFFECT_STATE2 effect2 [16]
 
MONSTOR_EFFECT_STATE3 effect3 [16]
 
MONSTOR_SOUND sound [16]
 
MONSTOR_EVENT_STATE event [16]
 
MONSTOR_EVENT_STATE event2 [16]
 
union { 
 
   s16   event_flags [16][16] 
 
   MONSTOR_GUARD_WINDOW   guard [16] 
 
};  
 

Detailed Description

Runs the monsters of one dungeon floor.

Definition at line 294 of file monstorunit.hpp.

Member Function Documentation

◆ GetCurrentMonsterIndex()

int CMonstorUnit::GetCurrentMonsterIndex ( )
inline

Index of the monster whose behaviour is being evaluated.

Definition at line 327 of file monstorunit.hpp.

◆ GetMonstorNum()

int CMonstorUnit::GetMonstorNum ( )

Counts the monsters present on the floor.

Mangled name:
GetMonstorNum__12CMonstorUnitFv
Address:
0x1D7A40
Size:
0x5C

Definition at line 404 of file monstorunit.cpp.

◆ DrawMapSymbol()

void CMonstorUnit::DrawMapSymbol ( float *  offset)

Draws the monsters' symbols on the minimap.

Mangled name:
DrawMapSymbol__12CMonstorUnitFPf
Address:
0x1D7AA0
Size:
0x1D8
Return type:
Not recovered.

Definition at line 416 of file monstorunit.cpp.

◆ SetKey()

void CMonstorUnit::SetKey ( )

Gives the floor's key to one monster.

Mangled name:
SetKey__12CMonstorUnitFv
Address:
0x1D7C80
Size:
0x2A4
Return type:
Not recovered.

Definition at line 454 of file monstorunit.cpp.

◆ CheckEventFlag2()

int CMonstorUnit::CheckEventFlag2 ( )

Returns and clears the event a defeated monster raised, or -1.

Mangled name:
CheckEventFlag2__12CMonstorUnitFv
Address:
0x1D7F30
Size:
0x88

Definition at line 539 of file monstorunit.cpp.

◆ ArrangementPos()

void CMonstorUnit::ArrangementPos ( CDungeonMap *  map,
int  count,
int  model_no,
int  unused 
)

Places monsters on the floor, apart from the others.

Mangled name:
ArrangementPos__12CMonstorUnitFP11CDungeonMapiii
Address:
0x1D7FC0
Size:
0x398

Definition at line 550 of file monstorunit.cpp.

◆ AllBin2()

void CMonstorUnit::AllBin2 ( )

Starts a timed status on every monster of the floor.

Mangled name:
AllBin2__12CMonstorUnitFv
Address:
0x1D8360
Size:
0x4C

Definition at line 630 of file monstorunit.cpp.

◆ PalletSet()

void CMonstorUnit::PalletSet ( )

Applies the monster's palette to the ambient light before it draws.

Mangled name:
PalletSet__12CMonstorUnitFv
Address:
0x1D83B0
Size:
0x1C0

Definition at line 636 of file monstorunit.cpp.

◆ PalletStep()

void CMonstorUnit::PalletStep ( )

Advances the monster's palette fade and colour cycle.

Mangled name:
PalletStep__12CMonstorUnitFv
Address:
0x1D8570
Size:
0x418

Definition at line 658 of file monstorunit.cpp.

◆ SoundCheck()

void CMonstorUnit::SoundCheck ( )

Plays the monster's motion sounds that fall on the current frame.

Mangled name:
SoundCheck__12CMonstorUnitFv
Address:
0x1D8990
Size:
0x338

Definition at line 704 of file monstorunit.cpp.

◆ DrawMonstor()

void CMonstorUnit::DrawMonstor ( )

Steps and draws every monster in play.

Mangled name:
DrawMonstor__12CMonstorUnitFv
Address:
0x1D8CD0
Size:
0x534
Return type:
Not recovered.

Definition at line 739 of file monstorunit.cpp.

◆ DrawMonstorCursor()

void CMonstorUnit::DrawMonstorCursor ( )

Draws the cursor over monsters that the view limit put on hold.

Mangled name:
DrawMonstorCursor__12CMonstorUnitFv
Address:
0x1D9210
Size:
0xE0
Return type:
Not recovered.

Definition at line 815 of file monstorunit.cpp.

◆ DrawShadowMonstor()

void CMonstorUnit::DrawShadowMonstor ( )

Draws the shadows of the monsters in play.

Mangled name:
DrawShadowMonstor__12CMonstorUnitFv
Address:
0x1D9800
Size:
0x19C
Return type:
Not recovered.

Definition at line 919 of file monstorunit.cpp.

◆ CheckViewLevel()

void CMonstorUnit::CheckViewLevel ( )

Wakes monsters near the player, and limits how many are active at once.

Mangled name:
CheckViewLevel__12CMonstorUnitFv
Address:
0x1D99A0
Size:
0x3BC

Definition at line 940 of file monstorunit.cpp.

◆ SelectAttachi()

int CMonstorUnit::SelectAttachi ( )

Chooses the attachment a defeated monster drops, or -1.

Mangled name:
SelectAttachi__12CMonstorUnitFv
Address:
0x1D9D60
Size:
0x1B0

Definition at line 1022 of file monstorunit.cpp.

◆ CheckDmg()

int CMonstorUnit::CheckDmg ( )

Applies the hits a monster gives and takes this step.

See also
MonsterDamageResult.
Mangled name:
CheckDmg__12CMonstorUnitFv
Address:
0x1D9F10
Size:
0x2904

Definition at line 1060 of file monstorunit.cpp.

◆ MoveCheck()

void CMonstorUnit::MoveCheck ( float *  position,
float *  movement,
int  flat 
)

Stops the player's movement where it would run into a monster.

Mangled name:
MoveCheck__12CMonstorUnitFPfPfi
Address:
0x1DC820
Size:
0x5A8
Return type:
Not recovered.

Definition at line 1631 of file monstorunit.cpp.

◆ MoveCheck2()

void CMonstorUnit::MoveCheck2 ( )

Stops the monster's movement where it would run into the player.

Mangled name:
MoveCheck2__12CMonstorUnitFv
Address:
0x1DCDD0
Size:
0x36C

Definition at line 1759 of file monstorunit.cpp.

◆ MoveChecMonster()

void CMonstorUnit::MoveChecMonster ( )

Stops the monster's movement where it would run into another monster.

Mangled name:
MoveChecMonster__12CMonstorUnitFv
Address:
0x1DD140
Size:
0x3FC

Definition at line 1802 of file monstorunit.cpp.

◆ Step()

void CMonstorUnit::Step ( int  pause)

Runs every monster's script, movement, damage and rewards for one frame.

Mangled name:
Step__12CMonstorUnitFi
Address:
0x1DD540
Size:
0x24A4

Definition at line 1854 of file monstorunit.cpp.

◆ CleanViewMonstor()

void CMonstorUnit::CleanViewMonstor ( int  back_floor)

Clears every monster and effect on the floor.

Mangled name:
CleanViewMonstor__12CMonstorUnitFi
Address:
0x1DF9F0
Size:
0x4A0

Definition at line 2279 of file monstorunit.cpp.

◆ SetupBaseModel()

int CMonstorUnit::SetupBaseModel ( int  slot,
int  model_no,
int  texture_block,
CDataAlloc2< 1 > *  alloc 
)

Loads the models one monster needs, and says how many it took.

Mangled name:
SetupBaseModel__12CMonstorUnitFiiiP14CDataAlloc2_1_
Address:
0x1DFE90
Size:
0x414
Return type:
Not recovered.

Definition at line 2372 of file monstorunit.cpp.

◆ SetupViewMonstor()

int CMonstorUnit::SetupViewMonstor ( int  model_no,
float *  position,
int  event_flag 
)

Puts a loaded monster model on the floor at a position.

Mangled name:
SetupViewMonstor__12CMonstorUnitFiPfi
Address:
0x1E02B0
Size:
0x138C

Definition at line 2435 of file monstorunit.cpp.

Member Data Documentation

◆ script

CDataAlloc2<1>* CMonstorUnit::script[16]

Script working memory for each monster on the floor.

Definition at line 296 of file monstorunit.hpp.

◆ collision

CFrame* CMonstorUnit::collision

Collision model that every monster on the floor shares.

Definition at line 297 of file monstorunit.hpp.

◆ back_dungeon

s32 CMonstorUnit::back_dungeon

Nonzero on the back dungeon, where monsters stay angry, give double experience and carry no key.

Definition at line 298 of file monstorunit.hpp.

◆ model_count

s32 CMonstorUnit::model_count

Kinds of monster loaded for the floor.

Definition at line 299 of file monstorunit.hpp.

◆ alive_count

s32 CMonstorUnit::alive_count

Monsters alive on the floor.

Definition at line 300 of file monstorunit.hpp.

◆ script_state

s32 CMonstorUnit::script_state[16]

1 while each monster's script is running.

Definition at line 301 of file monstorunit.hpp.

◆ current_monster

s32 CMonstorUnit::current_monster

Index of the monster being stepped or drawn.

Definition at line 302 of file monstorunit.hpp.

◆ requested_event

s32 CMonstorUnit::requested_event

Event a monster's script asked to run, or -1.

Definition at line 303 of file monstorunit.hpp.

◆ paused

s32 CMonstorUnit::paused

Nonzero while the monsters are paused; their motions restart when play resumes.

Definition at line 304 of file monstorunit.hpp.

◆ unk_09C

s32 CMonstorUnit::unk_09C

Definition at line 305 of file monstorunit.hpp.

◆ base_chara

CMonstorChara CMonstorUnit::base_chara[9]

Characters loaded for each kind of monster on the floor.

Definition at line 306 of file monstorunit.hpp.

◆ model

MONSTOR_MODEL CMonstorUnit::model[9]

Parameters of each kind of monster on the floor.

Definition at line 307 of file monstorunit.hpp.

◆ script_data

char* CMonstorUnit::script_data[9]

Script of each kind of monster on the floor.

Definition at line 308 of file monstorunit.hpp.

◆ monster

MONSTOR CMonstorUnit::monster[16]

What each monster of the floor is doing.

Definition at line 309 of file monstorunit.hpp.

◆ chara

CMonstorChara CMonstorUnit::chara[16]

The characters each monster draws with.

Definition at line 310 of file monstorunit.hpp.

◆ interpreter

CRunScript CMonstorUnit::interpreter[16]

Script interpreter of each monster.

Definition at line 311 of file monstorunit.hpp.

◆ effect

MONSTOR_EFFECT_STATE CMonstorUnit::effect[16]

Hits each monster can take.

Definition at line 312 of file monstorunit.hpp.

◆ effect2

MONSTOR_EFFECT_STATE2 CMonstorUnit::effect2[16]

Hits each monster gives.

Definition at line 313 of file monstorunit.hpp.

◆ effect3

MONSTOR_EFFECT_STATE3 CMonstorUnit::effect3[16]

Spheres that block the player around each monster.

Definition at line 314 of file monstorunit.hpp.

◆ sound

MONSTOR_SOUND CMonstorUnit::sound[16]

Sounds each monster plays.

Definition at line 315 of file monstorunit.hpp.

◆ event

MONSTOR_EVENT_STATE CMonstorUnit::event[16]

First projectile each monster fires.

Definition at line 316 of file monstorunit.hpp.

◆ event2

MONSTOR_EVENT_STATE CMonstorUnit::event2[16]

Second projectile each monster fires.

Definition at line 317 of file monstorunit.hpp.

◆ event_flags

s16 CMonstorUnit::event_flags[16][16]

Guard windows of each monster, as the words set-up clears.

Definition at line 320 of file monstorunit.hpp.

◆ guard

MONSTOR_GUARD_WINDOW CMonstorUnit::guard[16]

Guard windows of each monster.

Definition at line 321 of file monstorunit.hpp.