diff options
| author | soruh <33131839+soruh@users.noreply.github.com> | 2025-03-28 01:56:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-27 17:56:51 -0700 |
| commit | 4679b6e17f19e07fcdc0fcc90d2ec1806959cd64 (patch) | |
| tree | ee25d837ba9a9859c58e66b46bd94e45469c8daf /include/d | |
| parent | 57289d0a6504f4a00a5f5a7fd67dc5c41f603c7e (diff) | |
d_a_cow Equivalent (#2353)
* decompile d_a_cow
* rescope enums to daCow_c class
* apply suggestions by TakaRikka
* fix JUT_ASSERT
Diffstat (limited to 'include/d')
| -rw-r--r-- | include/d/actor/d_a_cow.h | 259 | ||||
| -rw-r--r-- | include/d/actor/d_a_npc_aru.h | 7 | ||||
| -rw-r--r-- | include/d/actor/d_a_player.h | 3 | ||||
| -rw-r--r-- | include/d/d_com_inf_actor.h | 8 | ||||
| -rw-r--r-- | include/d/d_particle_copoly.h | 7 | ||||
| -rw-r--r-- | include/d/d_timer.h | 1 |
6 files changed, 234 insertions, 51 deletions
diff --git a/include/d/actor/d_a_cow.h b/include/d/actor/d_a_cow.h index 5b18486124..a950b2cd02 100644 --- a/include/d/actor/d_a_cow.h +++ b/include/d/actor/d_a_cow.h @@ -1,11 +1,16 @@ #ifndef D_A_COW_H #define D_A_COW_H -#include "f_op/f_op_actor_mng.h" +#include "d/d_bg_s_acch.h" +#include "d/d_cc_d.h" +#include "d/d_particle_copoly.h" +#include "d/d_path.h" + +#define N_COW_COLLIDERS 3 /** * @ingroup actors-unsorted - * @class daCow_c + * @class c * @brief Ordon Goat * * @details @@ -13,51 +18,137 @@ */ class daCow_c : public fopAc_ac_c { public: - /* 806585CC */ void calcRunAnime(int); + enum Crazy { + Crazy_Wait = 0, + Crazy_Dash = 1, + Crazy_BeforeCatch = 2, + Crazy_Catch = 3, + Crazy_Throw = 4, + Crazy_Attack = 5, + Crazy_Away = 6, + Crazy_End = 7, + Crazy_Back = 8, + }; + + enum Mode { + Mode_0 = 0, + Mode_1 = 1, + Mode_2 = 2, + Mode_3 = 3, + }; + + enum Action { + Action_Wait = 0, + Action_NadeNade = 1, + Action_Cry = 2, + Action_3 = 3, + Action_4 = 4, + Action_5 = 5, + Action_6 = 6, + Action_Running = 7, + }; + + enum Animation { + Animation_5 = 5, + Animation_6 = 6, + Animation_7 = 7, + Animation_8 = 8, + Animation_Eat = 9, + Animation_10 = 10, + Animation_11 = 11, + Animation_12 = 12, + Animation_13 = 13, + Animation_14 = 14, + Animation_Moo = 15, + Animation_16 = 16, + Animation_17 = 17, + Animation_18 = 18, + Animation_Run = 19, + Animation_CrazyDash = 20, + Animation_Shake = 21, + Animation_22 = 22, + Animation_23 = 23, + Animation_24 = 24, + Animation_Walk = 25, + Animation_Wait = 26, + Animation_27 = 27, + Animation_28 = 28, + }; + + enum RunType { + RunType_None = 0, + RunType_Walk = 1, + RunType_Run = 2, + }; + + enum Execute { + Execute_0 = 0, + Execute_1 = 1, + Execute_2 = 2, + Execute_3 = 3, + Execute_4 = 4, + Execute_5 = 5, + Execute_6 = 6, + }; + + enum Flag { + Flag_CrazyBeforeCatch = 1 << 0, + Flag_CrazyCatch = 1 << 1, + Flag_CrazyDash = 1 << 2, + Flag_CrazyThrowLeft = 1 << 3, + Flag_CrazyThrowRight = 1 << 4, + Flag_CrazyReady = 1 << 5, + Flag_CrazyGo = 1 << 6, + Flag_Naderu = 1 << 7, + Flag_NaderuFinish = 1 << 8, + Flag_CrazyReadyDrawOn = 1 << 9, + }; + + /* 806585CC */ int calcRunAnime(int); /* 80658730 */ void setBck(int, u8, f32, f32); - /* 806587D4 */ void checkBck(int); + /* 806587D4 */ u8 checkBck(int); /* 80658830 */ void setEffect(); - /* 80658AA4 */ void isChaseCowGame(); + /* 80658AA4 */ bool isChaseCowGame(); /* 80658B10 */ void setCarryStatus(); /* 80658C18 */ void setActetcStatus(); - /* 80658C78 */ void checkNadeNadeFinish(); - /* 80658CA4 */ void checkNadeNade(); + /* 80658C78 */ bool checkNadeNadeFinish(); + /* 80658CA4 */ bool checkNadeNade(); /* 80658CD0 */ void setSeSnort(); /* 80658D3C */ void setRushVibration(int); - /* 80658DB8 */ void checkThrow(); + /* 80658DB8 */ bool checkThrow(); /* 80658E98 */ void setBodyAngle(s16); /* 80658F94 */ void setBodyAngle2(s16); - /* 806590E8 */ void checkProcess(void (daCow_c::*)()); - /* 80659114 */ void setProcess(void (daCow_c::*)(), int); + /* 806590E8 */ BOOL checkProcess(void (daCow_c::*)()); + /* 80659114 */ bool setProcess(void (daCow_c::*)(), int); /* 806591BC */ void damage_check(); /* 8065945C */ void setEnterCow20(); /* 80659540 */ void setEnterCow10(); /* 80659630 */ void setGroundAngle(); - /* 80659970 */ void checkRun(); - /* 806599C0 */ void checkNearCowRun(); + /* 80659970 */ bool checkRun(); + /* 806599C0 */ bool checkNearCowRun(); /* 80659ADC */ void action_wait(); /* 8065A0E8 */ void action_eat(); /* 8065A594 */ void action_moo(); /* 8065A8A4 */ void action_shake(); - /* 8065ACC8 */ void checkNearWolf(); - /* 8065AD2C */ void checkPlayerWait(); - /* 8065ADB0 */ void checkPlayerSurprise(); - /* 8065AE88 */ void checkPlayerPos(); + /* 8065ACC8 */ bool checkNearWolf(); + /* 8065AD2C */ bool checkPlayerWait(); + /* 8065ADB0 */ bool checkPlayerSurprise(); + /* 8065AE88 */ bool checkPlayerPos(); /* 8065B034 */ void checkBeforeBg(); - /* 8065B760 */ void checkOutOfGate(cXyz); - /* 8065B8A8 */ void getCowshedAngle(); - /* 8065B8D8 */ void getCowshedDist(); - /* 8065BA30 */ void checkCowIn(f32, f32); - /* 8065BB34 */ void checkCowInOwn(int); + /* 8065B760 */ int checkOutOfGate(cXyz); + /* 8065B8A8 */ s16 getCowshedAngle(); + /* 8065B8D8 */ double getCowshedDist(); + /* 8065BA30 */ int checkCowIn(f32, f32); + /* 8065BB34 */ bool checkCowInOwn(int); /* 8065BC68 */ void action_run(); - /* 8065C32C */ void checkCurringPen(); + /* 8065C32C */ bool checkCurringPen(); /* 8065C508 */ void setCowInCage(); /* 8065C680 */ void setEnterCount(); /* 8065C70C */ void action_enter(); /* 8065CFBC */ bool isAngry(); - /* 8065D03C */ void isGuardFad(); + /* 8065D03C */ bool isGuardFad(); /* 8065D0B8 */ void setAngryHit(); - /* 8065D17C */ void checkBeforeBgAngry(s16); + /* 8065D17C */ bool checkBeforeBgAngry(s16); /* 8065D230 */ void setRedTev(); /* 8065D29C */ void setAngryTurn(); /* 8065D2F0 */ void action_angry(); @@ -80,38 +171,114 @@ public: /* 8065FE50 */ void action_crazy(); /* 8066010C */ void executeCrazyBack2(); /* 80660544 */ void action_thrown(); - /* 806607B8 */ void checkWolfBusters(); + /* 806607B8 */ bool checkWolfBusters(); /* 806608F0 */ void action_wolf(); /* 806612DC */ void action_damage(); /* 806613EC */ void action(); /* 80661580 */ void setMtx(); /* 806615EC */ void setAttnPos(); /* 80661720 */ void setCollisions(); - /* 80661940 */ void Execute(); - /* 80661AF0 */ void CreateHeap(); - /* 80661D24 */ void createHeapCallBack(fopAc_ac_c*); - /* 80661D44 */ void initialize(); - /* 80662228 */ void create(); - /* 80662710 */ void ctrlJoint(J3DJoint*, J3DModel*); - /* 80662920 */ void ctrlJointCallBack(J3DJoint*, int); - /* 8066296C */ void Draw(); - /* 80662BE4 */ void Delete(); - /* 80662D70 */ void getShapeAngle(); - - void setNaderu() { field_0x568 |= 0x80; } - void setNaderuFinish() { field_0x568 |= 0x100; } - void setCrazyDash() { field_0x568 |= 4; } - void setCrazyBeforeCatch() { field_0x568 |= 1; } - void setCrazyCatch() { field_0x568 |= 2; } - void setCrazyThrowLeft() { field_0x568 |= 8; } - void setCrazyThrowRight() { field_0x568 |= 0x10; } + /* 80661940 */ int Execute(); + /* 80661AF0 */ int CreateHeap(); + /* 80661D24 */ static int createHeapCallBack(fopAc_ac_c*); + /* 80661D44 */ u8 initialize(); + /* 80662228 */ int create(); + /* 80662710 */ int ctrlJoint(J3DJoint*, J3DModel*); + /* 80662920 */ static int ctrlJointCallBack(J3DJoint*, int); + /* 8066296C */ int Draw(); + /* 80662BE4 */ int Delete(); + // /* 80662D70 */ csXyz getShapeAngle(); + csXyz getShapeAngle() { return mSavedAngle; } + + void setCowP(daCow_c* cow) { mCowP = cow; } + daCow_c* getCowP() { return mCowP; } + + // cLib_onBit<u16>(mFlags, (mask)) + void setCrazyBeforeCatch() { mFlags |= Flag_CrazyBeforeCatch; } + void setCrazyCatch() { mFlags |= Flag_CrazyCatch; } + void setCrazyDash() { mFlags |= Flag_CrazyDash; } + void setCrazyThrowLeft() { mFlags |= Flag_CrazyThrowLeft; } + void setCrazyThrowRight() { mFlags |= Flag_CrazyThrowRight; } + void setCrazyReady() { mFlags |= Flag_CrazyReady; } + void setCrazyGo() { mFlags |= Flag_CrazyGo; } + void setNaderu() { mFlags |= Flag_Naderu; } + void setNaderuFinish() { mFlags |= Flag_NaderuFinish; } + void setCrazyReadyDrawOn() { mFlags |= Flag_CrazyReadyDrawOn; } + + bool getCowIn() { return mCowIn; } + int getNoNearCheckTimer() const { return mNoNearCheckTimer; } private: - /* 0x568 */ u16 field_0x568; - /* 0x56A */ u8 field_0x56a[0xD40 - 0x56A]; + /* 0x568 */ u16 mFlags; + /* 0x56c */ request_of_phase_process_class mPhase; + /* 0x574 */ mDoExt_McaMorfSO* mpMorf; + /* 0x578 */ mDoExt_btpAnm* mpBtp; + /* 0x57c */ Z2Creature mSound; + /* 0x60c */ dBgS_ObjAcch mAcch; + /* 0x7e4 */ dCcD_Stts mCcStts; + /* 0x820 */ dBgS_AcchCir mAcchCir; + /* 0x860 */ dCcD_Sph mSph[N_COW_COLLIDERS]; + /* 0xc08 */ daCow_c* mCowP; + /* 0xc0c */ dPath* mPath; + /* 0xc10 */ s8 mPointIndex; + /* 0xc14 */ cXyz mJointPos; + /* 0xc20 */ cXyz mTarget; + /* 0xc2c */ csXyz mGroundTransform; + /* 0xc32 */ csXyz mSavedAngle; + /* 0xc38 */ csXyz mJoint1Offset; + /* 0xc3e */ csXyz mJoint8Offset; + /* 0xc44 */ f32 mGroundHeight; + /* 0xc48 */ void (daCow_c::*mProcess)(); + /* 0xc54 */ int mTimer6; + /* 0xc58 */ int mIdleTimer; + /* 0xc5c */ u16 mMode; + /* 0xc5e */ s8 mRunType; + /* 0xc5f */ u8 mPrm0; + /* 0xc60 */ u8 mExecute; + /* 0xc61 */ u8 mAction; + /* 0xc62 */ u8 mJointIndex; + /* 0xc63 */ bool mIsCrazy; + /* 0xc64 */ u32 mShadowKey; + /* 0xc68 */ u8 mCounter1; + /* 0xc69 */ u8 mISpeed; + /* 0xc6c */ f32 mBoostSpeed; + /* 0xc70 */ s16 mBoostAngle; + /* 0xc72 */ s16 mTargetAngle; + /* 0xc74 */ s16 mTurningSpeed; + /* 0xc76 */ s16 mThrowIntensity; + /* 0xc78 */ f32 mAttentionDistance; + /* 0xc7c */ f32 mSpeed; + /* 0xc80 */ int mInvulnerabilityTimer; + /* 0xc84 */ int mDealDamageTimer; + /* 0xc88 */ int mWaitTimer; + /* 0xc8c */ int mTakenDamageCounter; + /* 0xc90 */ int mTimer1; + /* 0xc94 */ int mForgetCowPTimer; + /* 0xc98 */ int mTimer10; + /* 0xc9c */ u8 mAnimationInterval; + /* 0xc9d */ u8 mOutOfGate; + /* 0xc9e */ u8 mWillGetAngry; + /* 0xc9f */ u8 mCrazy; + /* 0xca0 */ bool mReadyToDash; + /* 0xca1 */ u8 mRunDuration; + /* 0xca2 */ u8 mIntersectedPlanes; + /* 0xca3 */ u8 mRunTimer; + /* 0xca4 */ u8 mNoNearCheckTimer; + /* 0xca5 */ u8 mCowIn; + /* 0xca6 */ bool mDrawOff; + /* 0xca7 */ u8 _unused; + /* 0xca8 */ bool mNadeNade; + /* 0xca9 */ bool mEnterTimerDone; + /* 0xcaa */ u8 mDoAnim6; + /* 0xcac */ f32 mRedTev; + /* 0xcb0 */ f32 mTargetRedTev; + /* 0xcb4 */ u8 mChangeRedTev; + /* 0xcb5 */ u8 mShouldSetEffect; + /* 0xcb8 */ dPaPoT_c mParticle; + /* 0xd38 */ u32 mSmokeKey; + /* 0xd3c */ u32 mSmokeKey2; }; STATIC_ASSERT(sizeof(daCow_c) == 0xd40); - #endif /* D_A_COW_H */ diff --git a/include/d/actor/d_a_npc_aru.h b/include/d/actor/d_a_npc_aru.h index ed99254f68..cc9ef0d045 100644 --- a/include/d/actor/d_a_npc_aru.h +++ b/include/d/actor/d_a_npc_aru.h @@ -74,11 +74,15 @@ public: /* 809575F4 */ s32 getFootLJointNo(); /* 809575FC */ s32 getFootRJointNo(); + void setLastIn() { mLastGoatIn = true; } + static void* mCutNameList[7]; static u8 mCutList[84]; private: - /* 0x568 */ u8 field_0x568[0xfd8 - 0x568]; + /* 0x568 */ u8 field_0x568[0xfce - 0x568]; + /* 0xfce */ bool mLastGoatIn; + /* 0xfcf */ u8 field_0xfce[0xfd8 - 0xfcf]; }; STATIC_ASSERT(sizeof(daNpc_Aru_c) == 0xfd8); @@ -90,5 +94,4 @@ public: static u8 const m[160]; }; - #endif /* D_A_NPC_ARU_H */ diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index bf844b0b00..ebd38a7d1f 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -558,7 +558,7 @@ public: RFLG0_FRONT_ROLL_CRASH = 0x2000, RFLG0_ENEMY_ATTN_LOCK = 0x1000, RFLG0_UNK_400 = 0x400, - RFLG0_UNK_200 = 0x200, + RFLG0_COW_GAME_LEASH = 0x200, RFLG0_UNK_100 = 0x100, RFLG0_UNK_80 = 0x80, RFLG0_UNK_40 = 0x40, @@ -1106,6 +1106,7 @@ public: onNoResetFlg3(FLG3_UNK_200000); } + BOOL checkCowGameLash() const { return checkResetFlg0(RFLG0_COW_GAME_LEASH); } BOOL checkClimbEndHang() { return checkResetFlg0(RFLG0_UNK_40000); } void onForceHorseGetOff() { diff --git a/include/d/d_com_inf_actor.h b/include/d/d_com_inf_actor.h index a0bf089d54..da5e5fc62f 100644 --- a/include/d/d_com_inf_actor.h +++ b/include/d/d_com_inf_actor.h @@ -5,7 +5,7 @@ class fopAc_ac_c; class dComIfGoat_info_c { public: - /* 0x0 */ fopAc_ac_c* field_0x0; + /* 0x0 */ fopAc_ac_c* mThrowActor; }; class dComIfAc_info_c { @@ -22,7 +22,11 @@ inline bool dComIfA_PauseCheck() { } inline fopAc_ac_c* dComIfGoat_GetThrow() { - return g_dComIfGoat_gameInfo.field_0x0; + return g_dComIfGoat_gameInfo.mThrowActor; +} + +inline void dComIfGoat_SetThrow(fopAc_ac_c* actor) { + g_dComIfGoat_gameInfo.mThrowActor = actor; } #endif /* D_COM_D_COM_INF_ACTOR_H */ diff --git a/include/d/d_particle_copoly.h b/include/d/d_particle_copoly.h index a34d485aa3..78331cb4ce 100644 --- a/include/d/d_particle_copoly.h +++ b/include/d/d_particle_copoly.h @@ -56,6 +56,13 @@ public: typedef u8 (dPaPoT_c::*effTypeFunc)(int) const; typedef JPABaseEmitter* (dPaPoT_c::*emitterFunc)(int, int); + u8 getTypeTwo(int param_0, int param_1) const { + return (this->*m_typeTwoData[param_0])(param_1); + } + JPABaseEmitter* getEmitterTwo(int param_0, int param_1, int param_2) { + return (this->*m_emitterTwoData[param_0])(param_1, param_2); + } + static effTypeFunc m_typeTwoData[]; static emitterFunc m_emitterTwoData[]; diff --git a/include/d/d_timer.h b/include/d/d_timer.h index a6a991168e..17742833af 100644 --- a/include/d/d_timer.h +++ b/include/d/d_timer.h @@ -11,6 +11,7 @@ class JKRExpHeap; s32 dTimer_createStockTimer(); s32 dTimer_createTimer(s32 i_mode, u32 i_limitMs, u8 i_type, u8 param_3, f32 param_4, f32 param_5, f32 param_6, f32 param_7); +u32 dTimer_createGetIn2D(s32 param_0, cXyz i_pos); int dTimer_getRestTimeMs(); u8 dTimer_isStart(); u8 dTimer_isReadyFlag(); |
