Skip to content

Commit 5ec7e42

Browse files
Pheenohpheenohpheenoh
authored
d_a_npc_kn work (#2274)
* checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * fixups * check * fixes 2 * fixes 3 * fixes 4 * fixes 5 --------- Co-authored-by: pheenoh <pheenoh@macmini.local> Co-authored-by: pheenoh <pheenoh@macmini.lan>
1 parent 1a7b145 commit 5ec7e42

21 files changed

+7783
-4691
lines changed

config/GZ2E01/rels/d_a_e_yk/symbols.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ __destroy_global_chain = .text:0x00000094; // type:function size:0x58 scope:glob
66
__ct__12daE_YK_HIO_cFv = .text:0x000000EC; // type:function size:0x44 scope:global
77
yk_disappear__FP10e_yk_class = .text:0x00000130; // type:function size:0x174 scope:global
88
anm_init__FP10e_yk_classifUcf = .text:0x000002A4; // type:function size:0xAC scope:global
9-
daE_YK_Draw__FP10e_yk_class = .text:0x00000350; // type:function size:0xA8 scope:global
10-
shot_b_sub__FPvPv = .text:0x000003F8; // type:function size:0x78 scope:global
9+
daE_YK_Draw__FP10e_yk_class = .text:0x00000350; // type:function size:0xA8 scope:local
10+
shot_b_sub__FPvPv = .text:0x000003F8; // type:function size:0x78 scope:local
1111
other_bg_check__FP10e_yk_classP10fopAc_ac_c = .text:0x00000470; // type:function size:0xD8 scope:global
1212
pl_check__FP10e_yk_classfs = .text:0x00000548; // type:function size:0xB0 scope:global
1313
damage_check__FP10e_yk_class = .text:0x000005F8; // type:function size:0x230 scope:global
@@ -23,12 +23,12 @@ e_yk_path_fly__FP10e_yk_class = .text:0x000018B0; // type:function size:0x318 sc
2323
e_yk_chance__FP10e_yk_class = .text:0x00001BC8; // type:function size:0x1F8 scope:global
2424
e_yk_wolfbite__FP10e_yk_class = .text:0x00001DC0; // type:function size:0x240 scope:global
2525
e_yk_wind__FP10e_yk_class = .text:0x00002000; // type:function size:0x1A4 scope:global
26-
action__FP10e_yk_class = .text:0x000021A4; // type:function size:0x294 scope:global
27-
daE_YK_Execute__FP10e_yk_class = .text:0x00002438; // type:function size:0x514 scope:global
28-
daE_YK_IsDelete__FP10e_yk_class = .text:0x0000294C; // type:function size:0x8 scope:global
29-
daE_YK_Delete__FP10e_yk_class = .text:0x00002954; // type:function size:0x68 scope:global
30-
useHeapInit__FP10fopAc_ac_c = .text:0x000029BC; // type:function size:0xF8 scope:global
31-
daE_YK_Create__FP10fopAc_ac_c = .text:0x00002AB4; // type:function size:0x3D8 scope:global
26+
action__FP10e_yk_class = .text:0x000021A4; // type:function size:0x294 scope:local
27+
daE_YK_Execute__FP10e_yk_class = .text:0x00002438; // type:function size:0x514 scope:local
28+
daE_YK_IsDelete__FP10e_yk_class = .text:0x0000294C; // type:function size:0x8 scope:local
29+
daE_YK_Delete__FP10e_yk_class = .text:0x00002954; // type:function size:0x68 scope:local
30+
useHeapInit__FP10fopAc_ac_c = .text:0x000029BC; // type:function size:0xF8 scope:local
31+
daE_YK_Create__FP10fopAc_ac_c = .text:0x00002AB4; // type:function size:0x3D8 scope:local
3232
__dt__8cM3dGSphFv = .text:0x00002E8C; // type:function size:0x48 scope:global
3333
__dt__8cM3dGAabFv = .text:0x00002ED4; // type:function size:0x48 scope:global
3434
__dt__10dCcD_GSttsFv = .text:0x00002F1C; // type:function size:0x5C scope:global
@@ -91,7 +91,7 @@ _dtors = .dtors:0x00000000; // type:label scope:global
9191
@5031 = .rodata:0x000000C0; // type:object size:0x8 scope:local
9292
@stringBase0 = .rodata:0x000000C8; // type:object size:0xA scope:local data:string_table
9393
...data.0 = .data:0x00000000; // type:label scope:local
94-
cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global
94+
cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:local
9595
@1787 = .data:0x0000000C; // type:object size:0x4 scope:local
9696
lbl_252_data_10 = .data:0x00000010; // type:object size:0x10
9797
e_prim$3820 = .data:0x00000020; // type:object size:0x8 scope:local
@@ -101,7 +101,7 @@ eff_id$3829 = .data:0x00000030; // type:object size:0x6 scope:local
101101
e_name$4766 = .data:0x00000074; // type:object size:0x4 scope:local
102102
e_idx$4767 = .data:0x00000078; // type:object size:0x8 scope:local
103103
cc_sph_src$4930 = .data:0x00000080; // type:object size:0x40 scope:local
104-
l_daE_YK_Method = .data:0x000000C0; // type:object size:0x20 scope:global
104+
l_daE_YK_Method = .data:0x000000C0; // type:object size:0x20 scope:local
105105
g_profile_E_YK = .data:0x000000E0; // type:object size:0x30 scope:global
106106
__vt__12dBgS_AcchCir = .data:0x00000110; // type:object size:0xC scope:global
107107
__vt__10cCcD_GStts = .data:0x0000011C; // type:object size:0xC scope:global
@@ -111,7 +111,7 @@ __vt__8cM3dGAab = .data:0x00000140; // type:object size:0xC scope:global
111111
__vt__12dBgS_ObjAcch = .data:0x0000014C; // type:object size:0x24 scope:global
112112
__vt__12daE_YK_HIO_c = .data:0x00000170; // type:object size:0xC scope:global
113113
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
114-
lbl_252_bss_8 = .bss:0x00000008; // type:object size:0x1 data:byte
114+
lbl_252_bss_8 = .bss:0x00000008; // type:object size:0x1 scope:local data:byte
115115
@3957 = .bss:0x0000000C; // type:object size:0xC scope:local
116-
l_HIO = .bss:0x00000018; // type:object size:0x1C scope:global data:byte
116+
l_HIO = .bss:0x00000018; // type:object size:0x1C scope:local data:byte
117117
check_index$4191 = .bss:0x00000034; // type:object size:0xFF scope:local data:byte

include/SSystem/SComponent/c_cc_d.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class fopAc_ac_c;
1313

1414
enum CcG_Tg_HitMark {
1515
CcG_Tg_UNK_MARK_0 = 0,
16+
CcG_Tg_UNK_MARK_1 = 1,
1617
CcG_Tg_UNK_MARK_2 = 2,
1718
CcG_Tg_UNK_MARK_3 = 3,
1819
CcG_Tg_UNK_MARK_6 = 6,

include/d/actor/d_a_e_mk_bo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @ingroup actors-enemies
77
* @class e_mk_bo_class
8-
* @brief Ook?
8+
* @brief Ook's Boomerang
99
*
1010
* @details
1111
*

include/d/actor/d_a_e_yk.h

Lines changed: 60 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,34 @@
2222
*
2323
*/
2424
enum daE_YK_Action {
25-
ACT_ROOF, /**< Keese is on roof. */
26-
ACT_FIGHT_FLY, /**< Keese is transitioning from flying to aggro. */
27-
ACT_FIGHT, /**< Keese is aggroed. */
28-
ACT_ATTACK, /**< Keese is attacking. */
29-
ACT_RETURN, /**< Keese is returning to roof. */
30-
ACT_FLY, /**< Keese is flying around. */
31-
ACT_PATH_FLY, /**< Unconfirmed: Keese is flying along its path. */
32-
ACT_CHANCE = 10, /**< Keese is stunned/fell down. */
33-
ACT_WOLFBITE = 13, /**< Keese is being bitten by wolf. */
34-
ACT_WIND /**< Keese is in the gale boomerang. */
25+
ACT_ROOF, /**< Keese hangs from roof, enters combat if player gets close. */
26+
ACT_FIGHT_FLY, /**< Keese flies directly towards player to initiate combat. */
27+
ACT_FIGHT, /**< Keese circles around player at a distance, preparing to attack. */
28+
ACT_ATTACK, /**< Keese charges directly at player to deal damage. */
29+
ACT_RETURN, /**< Keese returns to its home position on the roof. */
30+
ACT_FLY, /**< Keese flies randomly around its home position. */
31+
ACT_PATH_FLY, /**< Keese follows predefined path points in the room. */
32+
ACT_CHANCE = 10, /**< Keese is stunned from shield attack, falls and bounces on ground. */
33+
ACT_WOLFBITE = 13, /**< Keese is caught in wolf Link's mouth, can be thrown. */
34+
ACT_WIND /**< Keese is caught in Gale Boomerang's wind, spins around it. */
3535
};
3636

3737
/**
38-
* @brief Shadow Keese Host Input Output class
38+
* @class daE_YK_HIO_c
39+
* @brief Shadow Keese Host Input Output class.
3940
*
4041
*/
4142
class daE_YK_HIO_c {
4243
public:
4344
/* 8080482C */ daE_YK_HIO_c();
4445
/* 808077E0 */ virtual ~daE_YK_HIO_c() {}
4546

46-
/* 0x00 */ // vtable
47-
/* 0x04 */ s8 field_0x04; // padding after this
48-
/* 0x08 */ f32 field_0x08;
49-
/* 0x0C */ f32 field_0x0c;
50-
/* 0x10 */ f32 field_0x10;
51-
/* 0x14 */ f32 field_0x14;
52-
/* 0x18 */ f32 field_0x18;
47+
/* 0x04 */ s8 field_0x04; ///< @brief Initialized to -1, appears unused.
48+
/* 0x08 */ f32 mModelScale; ///< @brief Base model scale factor (default: 1.0).
49+
/* 0x0C */ f32 mFlySpeed; ///< @brief Base flying speed (default: 15.0).
50+
/* 0x10 */ f32 mAttackRange; ///< @brief Distance threshold for entering attack state (default: 250.0).
51+
/* 0x14 */ f32 mCruiseSpeed; ///< @brief Speed when flying normally (default: 15.0).
52+
/* 0x18 */ f32 mChargeSpeed; ///< @brief Speed when charging at player (default: 40.0).
5353
};
5454

5555
/**
@@ -62,49 +62,48 @@ class daE_YK_HIO_c {
6262
*/
6363
class e_yk_class : public fopEn_enemy_c {
6464
public:
65-
/* 0x5AC */ request_of_phase_process_class mPhase; ///< @brief Actor phase process class.
66-
/* 0x5B4 */ u8 mParam1; ///< @brief Actor parameter. Used to determine default action?
67-
/* 0x5B5 */ u8 mPlayerTriggerBase; ///< @brief Actor parameter. Used to determine mPlayerTrigger value. @see mPlayerTrigeer
68-
/* 0x5B6 */ u8 field_0x5b6; ///< @brief ???
69-
/* 0x5B7 */ u8 mPathIdx; ///< @brief Path index. Used to lookup/set mpPath based on the room.
70-
/* 0x5B8 */ u8 field_0x5b8; ///< @brief ???
71-
/* 0x5B9 */ s8 mPathPntIdx; ///< @brief Path point index. Tracks the index of the points along the actor's path.
72-
/* 0x5BA */ s8 field_0x5ba; ///< @brief ???
73-
/* 0x5BB */ u8 field_0x5bb; ///< @brief ???
74-
/* 0x5BC */ dPath* mpPath; ///< @brief Flight path. Flight path for the actor to follow?
75-
/* 0x5C0 */ mDoExt_McaMorfSO* mpMorfSO; ///< @brief MorfSO pointer. Tracks the last resource loaded.
76-
/* 0x5C4 */ Z2CreatureEnemy mCreature; ///< @brief Z2 Audio class. Used for playing actor noises.
77-
/* 0x668 */ int mResIdx; ///< @brief Resource index. Tracks the index of the last resource loaded.
78-
/* 0x66C */ s16 field_0x66c; ///< @brief ???
79-
/* 0x66E */ s16 mAction; ///< @brief Current action. Tracks the current action of the actor. @see daE_YK_Action
80-
/* 0x670 */ s16 mActionPhase; ///< @brief Current action phase. Tracks the phase of the current action of the actor. @see daE_YK_Action
81-
/* 0x674 */ cXyz mPathPntPos; ///< @brief Path point position. Tracks the position of the point the actor is along a path.
82-
/* 0x680 */ s16 mAngleFromPlayer; ///< @brief Angle from player. Tracks the current actor angle from player.
83-
/* 0x684 */ f32 mDistanceXZFromPlayer; ///< @brief Distance from player. Tracks the current distance the actor is from the player.
84-
/* 0x688 */ f32 mPlayerTrigger; ///< @brief Trigger distance from player. Tracks how close to the actor the player has to be before it will begin to attack the player.
85-
/* 0x68C */ f32 field_0x68c; ///< @brief ???
86-
/* 0x690 */ f32 field_0x690; ///< @brief ???
87-
/* 0x694 */ f32 field_0x694; ///< @brief ???
88-
/* 0x698 */ s16 field_0x698; ///< @brief ???
89-
/* 0x69A */ csXyz field_0x69a; ///< @brief ???
90-
/* 0x6A0 */ s8 field_0x6a0; ///< @brief ???
91-
/* 0x6A1 */ u8 field_0x6a1; ///< @brief ???
92-
/* 0x6A2 */ s16 field_0x6a2[4]; ///< @brief ???
93-
/* 0x6AA */ s16 field_0x6aa; ///< @brief ???
94-
/* 0x6AC */ s16 field_0x6ac[6]; ///< @brief ???
95-
/* 0x6B8 */ cXyz mBoomrangPosOffset; ///< @brief Boomerang position offset. Tracks the offset position when the actor is caught in the gale boomerang.
96-
/* 0x6C4 */ s16 mBoomrangXRotOffset; ///< @brief Boomerang rotation offset. Tracks the offset x rotation when the actor is caught in the gale boomerang.
97-
/* 0x6C8 */ dBgS_AcchCir field_0x6c8; ///< @brief ???
98-
/* 0x708 */ dBgS_ObjAcch field_0x708; ///< @brief ???
99-
/* 0x8E0 */ dCcD_Stts mCollisionStatus; ///< @brief Collision status.
100-
/* 0x91C */ dCcD_Sph mCollisionSphere; ///< @brief Collision sphere.
101-
/* 0xA54 */ dCcU_AtInfo mAtColliderInfo; ///< @brief Attack collider info. Used when actor gets hit.
102-
/* 0xA78 */ u32 field_0xa78; ///< @brief ???
103-
/* 0xA7C */ u32 field_0xa7c; ///< @brief ???
104-
/* 0xA80 */ u32 field_0xa80; ///< @brief ???
105-
/* 0xA84 */ u32 mParticleEmitterIds[2]; ///< @brief ???
106-
/* 0xA8C */ u8 field_0xa8c; ///< @brief ???
65+
/* 0x5AC */ request_of_phase_process_class mPhase; ///< @brief Resource loading phase handler.
66+
/* 0x5B4 */ u8 mBehaviorMode; ///< @brief Controls default behavior (0: return to roof, 1: free flying).
67+
/* 0x5B5 */ u8 mPlayerTriggerBase; ///< @brief Base value used to calculate player detection range (multiplied by 100).
68+
/* 0x5B6 */ u8 field_0x5b6; ///< @brief Appears unused.
69+
/* 0x5B7 */ u8 mPathIdx; ///< @brief Path index for room path lookup.
70+
/* 0x5B8 */ u8 mPathActive; ///< @brief Flag indicating if path following is active (pathIdx + 1).
71+
/* 0x5B9 */ s8 mPathPntIdx; ///< @brief Current index in path point array.
72+
/* 0x5BA */ s8 mPathDirection; ///< @brief Direction to traverse path (1: forward, -1: backward).
73+
/* 0x5BC */ dPath* mpPath; ///< @brief Pointer to current flight path data.
74+
/* 0x5C0 */ mDoExt_McaMorfSO* mpMorfSO; ///< @brief Model and animation handler.
75+
/* 0x5C4 */ Z2CreatureEnemy mCreature; ///< @brief Sound effect and voice handler.
76+
/* 0x668 */ s32 mResIdx; ///< @brief Current animation resource index.
77+
/* 0x66C */ s16 mFrameCounter; ///< @brief Increments each frame, used for periodic events.
78+
/* 0x66E */ s16 mAction; ///< @brief Current action state. @see daE_YK_Action
79+
/* 0x670 */ s16 mActionPhase; ///< @brief Sub-phase within current action.
80+
/* 0x674 */ cXyz mPathPntPos; ///< @brief Target position (path point or player).
81+
/* 0x680 */ s16 mAngleFromPlayer; ///< @brief Angle between keese and player in XZ plane.
82+
/* 0x684 */ f32 mDistanceXZFromPlayer; ///< @brief XZ distance between keese and player.
83+
/* 0x688 */ f32 mPlayerTrigger; ///< @brief Distance threshold for player detection.
84+
/* 0x68C */ f32 mMoveInterpolation; ///< @brief Movement interpolation factor (0.0-1.0).
85+
/* 0x690 */ f32 mTurnSpeed; ///< @brief Angular velocity for turning.
86+
/* 0x694 */ f32 mKnockbackSpeed; ///< @brief Speed when knocked back from damage.
87+
/* 0x698 */ s16 mKnockbackAngle; ///< @brief Direction angle when knocked back.
88+
/* 0x69A */ csXyz mStunRotation; ///< @brief Rotation angles during stun animation.
89+
/* 0x6A0 */ s8 mDeathFlag; ///< @brief Set to 1 when keese is dying.
90+
/* 0x6A2 */ s16 mActionTimers[4]; ///< @brief Timers for various action states (movement, attack, etc).
91+
/* 0x6AA */ s16 mInvulnerabilityTimer; ///< @brief Frames of damage invulnerability remaining.
92+
/* 0x6AC */ s16 field_0x6ac[6]; ///< @brief Reserved/unused timer array.
93+
/* 0x6B8 */ cXyz mBoomrangPosOffset; ///< @brief Position offset when caught in Gale Boomerang.
94+
/* 0x6C4 */ s16 mBoomrangXRotOffset; ///< @brief Rotation offset when caught in Gale Boomerang.
95+
/* 0x6C8 */ dBgS_AcchCir mWallCollisionCircle; ///< @brief Circular collision volume for wall detection and response.
96+
/* 0x708 */ dBgS_ObjAcch mActorCollisionHandler; ///< @brief Handles all collision types (ground/wall/roof/water) for this actor.
97+
/* 0x8E0 */ dCcD_Stts mCollisionStatus; ///< @brief Collision state tracking.
98+
/* 0x91C */ dCcD_Sph mCollisionSphere; ///< @brief Spherical collision shape.
99+
/* 0xA54 */ dCcU_AtInfo mAtColliderInfo; ///< @brief Attack collision processor.
100+
/* 0xA78 */ u32 mSmokeEffectId; ///< @brief ID for smoke particle effect.
101+
/* 0xA7C */ u32 mSmokeEffectParams; ///< @brief Parameters for smoke effect.
102+
/* 0xA80 */ u32 mShadowParticleId; ///< @brief ID for shadow trail particle effect.
103+
/* 0xA84 */ u32 mWingParticleIds[2]; ///< @brief IDs for wing particle effects.
104+
/* 0xA8C */ u8 mIsFirstSpawn; ///< @brief Set to 1 if this is the first keese spawned in room.
107105
};
108-
// size: 0xA90
106+
107+
STATIC_ASSERT(sizeof(e_yk_class) == 0xA90);
109108

110109
#endif /* D_A_E_YK_H */

include/d/actor/d_a_npc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class daNpcT_MatAnm_c : public J3DMaterialAnm {
4848

4949
public:
5050
daNpcT_MatAnm_c() { initialize(); }
51+
5152
/* 80145764 */ void initialize();
5253
/* 8014D24C */ virtual ~daNpcT_MatAnm_c() {}
5354
/* 80145788 */ virtual void calc(J3DMaterial*) const;
@@ -754,6 +755,7 @@ void daNpcT_offTmpBit(u32 i_idx);
754755
void daNpcT_onTmpBit(u32 i_idx);
755756
BOOL daNpcT_chkTmpBit(u32 i_idx);
756757
void daNpcT_onEvtBit(u32 i_idx);
758+
BOOL daNpcT_chkTmpBit(u32 i_idx);
757759
BOOL daNpcT_getPlayerInfoFromPlayerList(int param_0, int i_roomNo, cXyz* o_spawnPos,
758760
csXyz* o_angle);
759761

@@ -1193,7 +1195,7 @@ class daNpcF_MatAnm_c : public J3DMaterialAnm {
11931195
/* 0x0FC */ f32 mNowOffsetX;
11941196
/* 0x100 */ f32 mNowOffsetY;
11951197
/* 0x104 */ u8 mEyeMoveFlag;
1196-
/* 0x105 */ u8 field_0x105;
1198+
/* 0x105 */ u8 mMorfFrm;
11971199

11981200
public:
11991201
daNpcF_MatAnm_c() { initialize(); }

include/d/actor/d_a_npc_gwolf.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ class daNpc_GWolf_c : public fopAc_ac_c {
6767
static u8 mEvtCutList[60];
6868

6969
private:
70+
// /* 0xB48 */ Z2Creature mCreature;
71+
// /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm;
72+
// /* 0xBDC */ daNpcF_Lookat_c mLookAt;
73+
// /* 0xC78 */ daNpcF_ActorMngr_c mActorMng[2];
74+
// /* 0xC88 */ u8 field_0xc88[4];
75+
// /* 0xC8C */ dCcD_Cyl mCyl;
76+
// /* 0xDC8 */ u8 field_0xdc8[0xE1C - 0xdc8];
7077
/* 0x568 */ u8 field_0xb48[0xE1C - 0x568];
7178
/* 0xE1C */ u8 field_0xe1c;
7279
};

0 commit comments

Comments
 (0)