DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
monstorunit.hpp
1#pragma once
2
3#include "common.h"
4
5#include <libvu0.h>
6
7#include "bt_shot_effect.hpp"
8#include "character.hpp"
9#include "dataalloc_fwd.hpp"
10#include "runscript.hpp"
11
15// clang-format off
16enum MonsterDamageResult {
17 MONSTER_DMG_NONE = 0,
18 MONSTER_DMG_HIT = 1,
19 MONSTER_DMG_KILLED = 2,
20};
21
22// clang-format on
23
27// clang-format off
28enum MonsterKind {
29 MONSTER_KIND_NORMAL = 0,
30 MONSTER_KIND_NO_LOCK_ON = 2,
31 MONSTER_KIND_MIMIC_SMALL = 3,
32 MONSTER_KIND_MIMIC_LARGE = 4,
33};
34
35// clang-format on
36
42// clang-format off
43enum MonsterFamily {
44 MONSTER_FAMILY_DINO = 0,
45 MONSTER_FAMILY_UNDEAD = 1,
46 MONSTER_FAMILY_SEA = 2,
47 MONSTER_FAMILY_STONE = 3,
48 MONSTER_FAMILY_PLANT = 4,
49 MONSTER_FAMILY_BEAST = 5,
50 MONSTER_FAMILY_SKY = 6,
51 MONSTER_FAMILY_METAL = 7,
52 MONSTER_FAMILY_MIMIC = 8,
53 MONSTER_FAMILY_MAGE = 9,
54};
55
56// clang-format on
57
58class CDungeonMap;
59
63struct MONSTOR {
64 s32 state;
72 s32 max_hp;
73 s32 hp;
76 s32 money;
79 s16 kind;
80 s16 name_no;
85 u8 unk_054[0x0C];
86 sceVu0FVECTOR movement;
87 sceVu0FVECTOR turn_target;
89 float turn_speed;
90 s32 falls;
91 u8 unk_08C[4];
92 s16 defense;
94 s16 unk_094;
95 u8 unk_096[2];
97 u8 unk_09C[4];
99 u8 unk_0A2[2];
104 s32 exp;
106 u8 unk_0B6[2];
108 float ground_y;
122 u8 unk_0E2[2];
131 u8 unk_0FA[2];
133 sceVu0FVECTOR lockon_position;
138 u8 unk_11E[2];
142 u8 unk_12C[0x04];
143 sceVu0FVECTOR palette_target;
144 sceVu0FVECTOR palette_color;
145 sceVu0FVECTOR palette_override;
150 sceVu0FVECTOR knockback_direction;
151 sceVu0FVECTOR knockback;
152};
153
154STATIC_ASSERT(sizeof(MONSTOR) == 0x190);
155
159typedef CCharacter CMonstorChara[3];
160
161STATIC_ASSERT(sizeof(CMonstorChara) == 0x3510);
162
167 float start[16];
168 float end[16];
169 s32 id[16];
170 s32 cooldown[16];
175};
176
177STATIC_ASSERT(sizeof(MONSTOR_SOUND) == 0x110);
178
183 char model_name[4][16];
184 char script_name[16];
185 s32 max_hp;
191 s16 shot_effect[2];
192 s16 exp;
193 u8 unk_06E[2];
194 s32 money;
196 s16 kind;
197 u8 unk_07A[2];
199 u8 unk_07E[2];
206 u8 unk_096[2];
208};
209
210STATIC_ASSERT(sizeof(MONSTOR_MODEL) == 0x9C);
211
216 sceVu0FVECTOR position[16];
218 float radius[16];
219 float motion_start[16];
220 float motion_end[16];
221 s32 timer[16];
222 s32 body_parameter[16][5];
223 s32 parameter[16][6];
226 u8 unk_508[8];
227};
228
229STATIC_ASSERT(sizeof(MONSTOR_EFFECT_STATE) == 0x510);
230
235 sceVu0FVECTOR position[16];
237 float radius[16];
238 s32 damage[16];
239 s32 kind[16];
240 float angle[16];
241 s32 flags[16];
242 float motion_start[16];
243 float motion_end[16];
244 s32 active[16];
246 u8 unk_344[0xC];
247};
248
249STATIC_ASSERT(sizeof(MONSTOR_EFFECT_STATE2) == 0x350);
250
255 sceVu0FVECTOR position[12];
257 float radius[12];
258 s32 timer[12];
259 s32 count;
260 u8 unk_154[0x0C];
261};
262
263STATIC_ASSERT(sizeof(MONSTOR_EFFECT_STATE3) == 0x160);
264
269 sceVu0FVECTOR local_position;
270 sceVu0FVECTOR position;
272 s32 timer;
274 u8 unk_02C[4];
275};
276
277STATIC_ASSERT(sizeof(MONSTOR_EVENT_STATE) == 0x30);
278
283 s16 active[3];
284 u8 unk_006[2];
285 float motion_start[3];
286 float motion_end[3];
287};
288
289STATIC_ASSERT(sizeof(MONSTOR_GUARD_WINDOW) == 0x20);
290
295public:
301 s32 script_state[16];
304 s32 paused;
305 s32 unk_09C;
306 CMonstorChara base_chara[9];
308 char *script_data[9];
310 CMonstorChara chara[16];
319 union {
320 s16 event_flags[16][16];
322 };
323
328
336 int GetMonstorNum();
337
346 void DrawMapSymbol(float *offset);
347
356 void SetKey();
357
365 int CheckEventFlag2();
366
374 void ArrangementPos(CDungeonMap *map, int count, int model_no, int unused);
375
383 void AllBin2();
384
392 void PalletSet();
393
401 void PalletStep();
402
410 void SoundCheck();
411
420 void DrawMonstor();
421
430 void DrawMonstorCursor();
431
440 void DrawShadowMonstor();
441
449 void CheckViewLevel();
450
458 int SelectAttachi();
459
467 int CheckDmg();
468
477 void MoveCheck(float *position, float *movement, int flat);
478
486 void MoveCheck2();
487
495 void MoveChecMonster();
496
504 void Step(int pause);
505
513 void CleanViewMonstor(int back_floor);
514
523 int SetupBaseModel(int slot, int model_no, int texture_block, CDataAlloc2<1> *alloc);
524
532 int SetupViewMonstor(int model_no, float *position, int event_flag);
533};
534
535STATIC_ASSERT(sizeof(CMonstorUnit) == 0x60750);
536
540struct BEE_STATE {
541 s32 row;
542 float phase;
543};
544
545STATIC_ASSERT(sizeof(BEE_STATE) == 8);
546
548extern BEE_STATE BeeTbl[800];
549
551extern "C" int maxFloorTbl__3[7];
552
554extern "C" CTexAnimeData MonsterTexAnim[320];
555
560 s32 unk_00;
562 s32 unk_08;
563};
564
570 s32 unk_6C;
571};
572
573STATIC_ASSERT(sizeof(BT_ENEMY_LAYOUT) == 0x0C);
574STATIC_ASSERT(sizeof(BT_ENEMY_FLOOR) == 0x70);
575
583void InitBee(CFrame *frame, int count);
584
586extern "C" MONSTOR_MODEL MonstorTable[167];
587
589extern "C" BT_SHOT_EFFECT *BtEntryEffectTbl[35];
590
592extern "C" BT_ENEMY_FLOOR *BtEnemyLayoutList[];
593
595extern "C" BT_ENEMY_FLOOR *BtUraEnemyLayoutList[];
void DrawMapSymbol(float *offset)
MONSTOR_MODEL model[9]
MONSTOR_EVENT_STATE event2[16]
s32 script_state[16]
void DrawMonstorCursor()
int GetCurrentMonsterIndex()
MONSTOR_EFFECT_STATE effect[16]
char * script_data[9]
void CheckViewLevel()
s16 event_flags[16][16]
void DrawShadowMonstor()
CFrame * collision
MONSTOR_EFFECT_STATE2 effect2[16]
MONSTOR_GUARD_WINDOW guard[16]
int SetupBaseModel(int slot, int model_no, int texture_block, CDataAlloc2< 1 > *alloc)
CRunScript interpreter[16]
CDataAlloc2< 1 > * script[16]
void ArrangementPos(CDungeonMap *map, int count, int model_no, int unused)
CMonstorChara chara[16]
int CheckEventFlag2()
MONSTOR_SOUND sound[16]
void Step(int pause)
void CleanViewMonstor(int back_floor)
int SetupViewMonstor(int model_no, float *position, int event_flag)
CMonstorChara base_chara[9]
void MoveChecMonster()
MONSTOR monster[16]
void MoveCheck(float *position, float *movement, int flat)
MONSTOR_EFFECT_STATE3 effect3[16]
BT_ENEMY_LAYOUT monster[9]
sceVu0FVECTOR position[16]
sceVu0FVECTOR position[12]
sceVu0FVECTOR position[16]
sceVu0FVECTOR local_position
sceVu0FVECTOR position
char model_name[4][16]
char script_name[16]
s16 effect_parameter[6]
s16 attachment_weight[5]
float start[16]
s16 attachment_weight[5]
s16 event_flag2_pending
float palette_step
s32 invincible_timer
s16 shadow_visible
s32 last_hit_id
CCPoly * collision_poly
s16 shadow_enabled
s32 hit_element
sceVu0FVECTOR palette_target
s16 attachment_count
s16 attachment_kind
float requested_motion_speed
float palette_alpha_step
float lockon_scale_y
s32 invincible_blocked
s16 drop_item
sceVu0FVECTOR lockon_position
s16 lockon_enabled
s32 slow_timer
s32 poison_timer
float player_distance
s32 palette_delay
sceVu0FVECTOR knockback
float body_radius
s32 collision_poly_count
CFrame * lockon_frame
float turn_speed
sceVu0FVECTOR palette_override
sceVu0FVECTOR movement
sceVu0FVECTOR knockback_direction
float shadow_length
float lockon_scale_x
float clip_distance
s32 last_attacker
s32 stolen_money
s16 item_damage_rate
float movement_speed
s16 motion_reset_pending
s32 last_hit_damage
s16 shot_effect2
s32 stop_timer
s16 status_chance
float lock_range
s32 base_model
float ground_y
float collision_radius
s32 palette_override_pending
sceVu0FVECTOR turn_target
float palette_blend
s16 drops_items
s16 requested_motion
s32 anger_timer
s16 event_flag2
float palette_alpha
s32 collision_off_timer
sceVu0FVECTOR palette_color
float ground_distance
s16 requested_motion_flags
s16 shot_effect
s32 money_chance
s32 palette_cycles