Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d_a_npc_kn work #2274

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions config/GZ2E01/rels/d_a_e_yk/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ __destroy_global_chain = .text:0x00000094; // type:function size:0x58 scope:glob
__ct__12daE_YK_HIO_cFv = .text:0x000000EC; // type:function size:0x44 scope:global
yk_disappear__FP10e_yk_class = .text:0x00000130; // type:function size:0x174 scope:global
anm_init__FP10e_yk_classifUcf = .text:0x000002A4; // type:function size:0xAC scope:global
daE_YK_Draw__FP10e_yk_class = .text:0x00000350; // type:function size:0xA8 scope:global
shot_b_sub__FPvPv = .text:0x000003F8; // type:function size:0x78 scope:global
daE_YK_Draw__FP10e_yk_class = .text:0x00000350; // type:function size:0xA8 scope:local
shot_b_sub__FPvPv = .text:0x000003F8; // type:function size:0x78 scope:local
other_bg_check__FP10e_yk_classP10fopAc_ac_c = .text:0x00000470; // type:function size:0xD8 scope:global
pl_check__FP10e_yk_classfs = .text:0x00000548; // type:function size:0xB0 scope:global
damage_check__FP10e_yk_class = .text:0x000005F8; // type:function size:0x230 scope:global
Expand All @@ -23,12 +23,12 @@ e_yk_path_fly__FP10e_yk_class = .text:0x000018B0; // type:function size:0x318 sc
e_yk_chance__FP10e_yk_class = .text:0x00001BC8; // type:function size:0x1F8 scope:global
e_yk_wolfbite__FP10e_yk_class = .text:0x00001DC0; // type:function size:0x240 scope:global
e_yk_wind__FP10e_yk_class = .text:0x00002000; // type:function size:0x1A4 scope:global
action__FP10e_yk_class = .text:0x000021A4; // type:function size:0x294 scope:global
daE_YK_Execute__FP10e_yk_class = .text:0x00002438; // type:function size:0x514 scope:global
daE_YK_IsDelete__FP10e_yk_class = .text:0x0000294C; // type:function size:0x8 scope:global
daE_YK_Delete__FP10e_yk_class = .text:0x00002954; // type:function size:0x68 scope:global
useHeapInit__FP10fopAc_ac_c = .text:0x000029BC; // type:function size:0xF8 scope:global
daE_YK_Create__FP10fopAc_ac_c = .text:0x00002AB4; // type:function size:0x3D8 scope:global
action__FP10e_yk_class = .text:0x000021A4; // type:function size:0x294 scope:local
daE_YK_Execute__FP10e_yk_class = .text:0x00002438; // type:function size:0x514 scope:local
daE_YK_IsDelete__FP10e_yk_class = .text:0x0000294C; // type:function size:0x8 scope:local
daE_YK_Delete__FP10e_yk_class = .text:0x00002954; // type:function size:0x68 scope:local
useHeapInit__FP10fopAc_ac_c = .text:0x000029BC; // type:function size:0xF8 scope:local
daE_YK_Create__FP10fopAc_ac_c = .text:0x00002AB4; // type:function size:0x3D8 scope:local
__dt__8cM3dGSphFv = .text:0x00002E8C; // type:function size:0x48 scope:global
__dt__8cM3dGAabFv = .text:0x00002ED4; // type:function size:0x48 scope:global
__dt__10dCcD_GSttsFv = .text:0x00002F1C; // type:function size:0x5C scope:global
Expand Down Expand Up @@ -91,7 +91,7 @@ _dtors = .dtors:0x00000000; // type:label scope:global
@5031 = .rodata:0x000000C0; // type:object size:0x8 scope:local
@stringBase0 = .rodata:0x000000C8; // type:object size:0xA scope:local data:string_table
...data.0 = .data:0x00000000; // type:label scope:local
cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global
cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:local
@1787 = .data:0x0000000C; // type:object size:0x4 scope:local
e_prim$3820 = .data:0x00000020; // type:object size:0x8 scope:local
e_env$3821 = .data:0x00000028; // type:object size:0x8 scope:local
Expand All @@ -100,7 +100,7 @@ eff_id$3829 = .data:0x00000030; // type:object size:0x6 scope:local
e_name$4766 = .data:0x00000074; // type:object size:0x4 scope:local
e_idx$4767 = .data:0x00000078; // type:object size:0x8 scope:local
cc_sph_src$4930 = .data:0x00000080; // type:object size:0x40 scope:local
l_daE_YK_Method = .data:0x000000C0; // type:object size:0x20 scope:global
l_daE_YK_Method = .data:0x000000C0; // type:object size:0x20 scope:local
g_profile_E_YK = .data:0x000000E0; // type:object size:0x30 scope:global
__vt__12dBgS_AcchCir = .data:0x00000110; // type:object size:0xC scope:global
__vt__10cCcD_GStts = .data:0x0000011C; // type:object size:0xC scope:global
Expand All @@ -110,7 +110,7 @@ __vt__8cM3dGAab = .data:0x00000140; // type:object size:0xC scope:global
__vt__12dBgS_ObjAcch = .data:0x0000014C; // type:object size:0x24 scope:global
__vt__12daE_YK_HIO_c = .data:0x00000170; // type:object size:0xC scope:global
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
lbl_252_bss_8 = .bss:0x00000008; // type:object size:0x1 data:byte
lbl_252_bss_8 = .bss:0x00000008; // type:object size:0x1 scope:local data:byte
@3957 = .bss:0x0000000C; // type:object size:0xC scope:local
l_HIO = .bss:0x00000018; // type:object size:0x1C scope:global data:byte
l_HIO = .bss:0x00000018; // type:object size:0x1C scope:local data:byte
check_index$4191 = .bss:0x00000034; // type:object size:0xFF scope:local data:byte
1 change: 1 addition & 0 deletions include/SSystem/SComponent/c_cc_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class fopAc_ac_c;

enum CcG_Tg_HitMark {
CcG_Tg_UNK_MARK_0 = 0,
CcG_Tg_UNK_MARK_1 = 1,
CcG_Tg_UNK_MARK_2 = 2,
CcG_Tg_UNK_MARK_3 = 3,
CcG_Tg_UNK_MARK_6 = 6,
Expand Down
121 changes: 60 additions & 61 deletions include/d/actor/d_a_e_yk.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,34 @@
*
*/
enum daE_YK_Action {
ACT_ROOF, /**< Keese is on roof. */
ACT_FIGHT_FLY, /**< Keese is transitioning from flying to aggro. */
ACT_FIGHT, /**< Keese is aggroed. */
ACT_ATTACK, /**< Keese is attacking. */
ACT_RETURN, /**< Keese is returning to roof. */
ACT_FLY, /**< Keese is flying around. */
ACT_PATH_FLY, /**< Unconfirmed: Keese is flying along its path. */
ACT_CHANCE = 10, /**< Keese is stunned/fell down. */
ACT_WOLFBITE = 13, /**< Keese is being bitten by wolf. */
ACT_WIND /**< Keese is in the gale boomerang. */
ACT_ROOF, /**< Keese hangs from roof, enters combat if player gets close. */
ACT_FIGHT_FLY, /**< Keese flies directly towards player to initiate combat. */
ACT_FIGHT, /**< Keese circles around player at a distance, preparing to attack. */
ACT_ATTACK, /**< Keese charges directly at player to deal damage. */
ACT_RETURN, /**< Keese returns to its home position on the roof. */
ACT_FLY, /**< Keese flies randomly around its home position. */
ACT_PATH_FLY, /**< Keese follows predefined path points in the room. */
ACT_CHANCE = 10, /**< Keese is stunned from shield attack, falls and bounces on ground. */
ACT_WOLFBITE = 13, /**< Keese is caught in wolf Link's mouth, can be thrown. */
ACT_WIND /**< Keese is caught in Gale Boomerang's wind, spins around it. */
};

/**
* @brief Shadow Keese Host Input Output class
* @class daE_YK_HIO_c
* @brief Shadow Keese Host Input Output class.
*
*/
class daE_YK_HIO_c {
public:
/* 8080482C */ daE_YK_HIO_c();
/* 808077E0 */ virtual ~daE_YK_HIO_c() {}

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

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

STATIC_ASSERT(sizeof(e_yk_class) == 0xA90);

#endif /* D_A_E_YK_H */
20 changes: 15 additions & 5 deletions include/d/actor/d_a_npc.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ class daNpcT_MatAnm_c : public J3DMaterialAnm {
private:
/* 0x0F4 */ mutable f32 field_0xF4;
/* 0x0F8 */ mutable f32 field_0xF8;
/* 0x0FC */ f32 mTranslationX;
/* 0x100 */ f32 mTranslationY;
/* 0x104 */ u8 field_0x104;
/* 0x105 */ u8 field_0x105;
/* 0x0FC */ f32 mNowOffsetX;
/* 0x100 */ f32 mNowOffsetY;
/* 0x104 */ u8 mEyeMoveFlag;
/* 0x105 */ u8 mMorfFrm;

public:
daNpcT_MatAnm_c() { initialize(); }
void setNowOffsetX(f32 i_offset) { mNowOffsetX = i_offset; }
void setNowOffsetY(f32 i_offset) { mNowOffsetY = i_offset; }
void setMorfFrm(u8 i_form) { mMorfFrm = i_form; }
void onEyeMoveFlag() { mEyeMoveFlag = 1; }
void offEyeMoveFlag() { mEyeMoveFlag = 0; }

/* 80145764 */ void initialize();
/* 80145788 */ virtual void calc(J3DMaterial*) const;
/* 8014D24C */ ~daNpcT_MatAnm_c();
Expand Down Expand Up @@ -174,6 +180,9 @@ class daNpcT_JntAnm_c {
void clrDirectFlag() { mDirectFlag = 0; }
int getMode() { return mMode; }

s16 getEyeAngleY() { return mEyeAngle.y; }
s16 getEyeAngleX() { return mEyeAngle.x; }

int setMode(int mode, int param_2) {
if (mode >= 0 && (param_2 != 0 || mode != mMode)) {
mActrMngr.remove();
Expand Down Expand Up @@ -589,6 +598,7 @@ void daNpcT_offTmpBit(u32 i_idx);
void daNpcT_onTmpBit(u32 i_idx);
BOOL daNpcT_chkTmpBit(u32 i_idx);
void daNpcT_onEvtBit(u32 i_idx);
BOOL daNpcT_chkTmpBit(u32 i_idx);

struct daBaseNpc_matAnm_c {
/* 8014D884 */ void calc(J3DMaterial*) const;
Expand Down Expand Up @@ -1023,7 +1033,7 @@ class daNpcF_MatAnm_c : public J3DMaterialAnm {
/* 0x0FC */ f32 mNowOffsetX;
/* 0x100 */ f32 mNowOffsetY;
/* 0x104 */ u8 mEyeMoveFlag;
/* 0x105 */ u8 field_0x105;
/* 0x105 */ u8 mMorfFrm;

public:
daNpcF_MatAnm_c() { initialize(); }
Expand Down
10 changes: 8 additions & 2 deletions include/d/actor/d_a_npc_gwolf.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @details
*
*/
class daNpc_GWolf_c : public fopAc_ac_c {
class daNpc_GWolf_c : public daNpcF_c {
public:
/* 809F30AC */ daNpc_GWolf_c();
/* 809F34C0 */ void create();
Expand Down Expand Up @@ -67,7 +67,13 @@ class daNpc_GWolf_c : public fopAc_ac_c {
static u8 mEvtCutList[60];

private:
/* 0x568 */ u8 field_0xb48[0xE1C - 0x568];
/* 0xB48 */ Z2Creature mCreature;
/* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm;
/* 0xBDC */ daNpcF_Lookat_c mLookAt;
/* 0xC78 */ daNpcF_ActorMngr_c mActorMng[2];
/* 0xC88 */ u8 field_0xc88[4];
/* 0xC8C */ dCcD_Cyl mCyl;
/* 0xDC8 */ u8 field_0xdc8[0xE1C - 0xdc8];
/* 0xE1C */ u8 field_0xe1c;
};

Expand Down
Loading
Loading