diff --git a/config/GZ2E01/rels/d_a_obj_lv4digsand/symbols.txt b/config/GZ2E01/rels/d_a_obj_lv4digsand/symbols.txt index f94229cc9c6..0dcf5c7a9d5 100644 --- a/config/GZ2E01/rels/d_a_obj_lv4digsand/symbols.txt +++ b/config/GZ2E01/rels/d_a_obj_lv4digsand/symbols.txt @@ -17,15 +17,15 @@ mode_init_end__16daObjL4DigSand_cFv = .text:0x0000060C; // type:function size:0x mode_end__16daObjL4DigSand_cFv = .text:0x00000660; // type:function size:0x4 scope:global Draw__16daObjL4DigSand_cFv = .text:0x00000664; // type:function size:0xA4 scope:global Delete__16daObjL4DigSand_cFv = .text:0x00000708; // type:function size:0x34 scope:global -daObjL4DigSand_create1st__FP16daObjL4DigSand_c = .text:0x0000073C; // type:function size:0x12C scope:global +daObjL4DigSand_create1st__FP16daObjL4DigSand_c = .text:0x0000073C; // type:function size:0x12C scope:local __dt__8cM3dGCylFv = .text:0x00000868; // type:function size:0x48 scope:global __dt__8cM3dGAabFv = .text:0x000008B0; // type:function size:0x48 scope:global __dt__10dCcD_GSttsFv = .text:0x000008F8; // type:function size:0x5C scope:global __dt__12dBgS_AcchCirFv = .text:0x00000954; // type:function size:0x70 scope:global __dt__12dBgS_ObjAcchFv = .text:0x000009C4; // type:function size:0x70 scope:global -daObjL4DigSand_MoveBGDelete__FP16daObjL4DigSand_c = .text:0x00000A34; // type:function size:0x20 scope:global -daObjL4DigSand_MoveBGExecute__FP16daObjL4DigSand_c = .text:0x00000A54; // type:function size:0x20 scope:global -daObjL4DigSand_MoveBGDraw__FP16daObjL4DigSand_c = .text:0x00000A74; // type:function size:0x2C scope:global +daObjL4DigSand_MoveBGDelete__FP16daObjL4DigSand_c = .text:0x00000A34; // type:function size:0x20 scope:local +daObjL4DigSand_MoveBGExecute__FP16daObjL4DigSand_c = .text:0x00000A54; // type:function size:0x20 scope:local +daObjL4DigSand_MoveBGDraw__FP16daObjL4DigSand_c = .text:0x00000A74; // type:function size:0x2C scope:local __dt__10cCcD_GSttsFv = .text:0x00000AA0; // type:function size:0x48 scope:global cLib_calcTimer__FPUc = .text:0x00000AE8; // type:function size:0x1C scope:global @20@__dt__14dBgS_ObjGndChkFv = .text:0x00000B04; // type:function size:0x8 scope:local @@ -42,14 +42,14 @@ _dtors = .dtors:0x00000000; // type:label scope:global @3767 = .rodata:0x0000000C; // type:object size:0x4 scope:local @stringBase0 = .rodata:0x00000010; // type:object size:0x8 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 -l_arcName = .data:0x00000020; // type:object size:0x4 scope:global data:4byte +l_arcName = .data:0x00000020; // type:object size:0x4 scope:local data:4byte @3715 = .data:0x00000024; // type:object size:0xC scope:local @3716 = .data:0x00000030; // type:object size:0xC scope:local @3717 = .data:0x0000003C; // type:object size:0xC scope:local l_func$3714 = .data:0x00000048; // type:object size:0x24 scope:local -daObjL4DigSand_METHODS = .data:0x0000006C; // type:object size:0x20 scope:global +daObjL4DigSand_METHODS = .data:0x0000006C; // type:object size:0x20 scope:local g_profile_Obj_Lv4DigSand = .data:0x0000008C; // type:object size:0x30 scope:global __vt__12dBgS_AcchCir = .data:0x000000BC; // type:object size:0xC scope:global __vt__10cCcD_GStts = .data:0x000000C8; // type:object size:0xC scope:global @@ -59,4 +59,4 @@ __vt__8cM3dGAab = .data:0x000000EC; // type:object size:0xC scope:global __vt__12dBgS_ObjAcch = .data:0x000000F8; // type:object size:0x24 scope:global __vt__14dBgS_ObjGndChk = .data:0x0000011C; // type:object size:0x30 scope:global __vt__16daObjL4DigSand_c = .data:0x0000014C; // type:object size:0x28 scope:global -lbl_533_bss_0 = .bss:0x00000000; // type:object size:0x1 data:byte +lbl_533_bss_0 = .bss:0x00000000; // type:object size:0x1 scope:local data:byte diff --git a/configure.py b/configure.py index 7f5b63599a8..61940128fb9 100644 --- a/configure.py +++ b/configure.py @@ -1888,7 +1888,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_obj_lv4SlideWall"), ActorRel(NonMatching, "d_a_obj_lv4bridge"), ActorRel(NonMatching, "d_a_obj_lv4chandelier"), - ActorRel(NonMatching, "d_a_obj_lv4digsand"), + ActorRel(Matching, "d_a_obj_lv4digsand"), ActorRel(Matching, "d_a_obj_lv4floor"), ActorRel(Matching, "d_a_obj_lv4gear"), ActorRel(NonMatching, "d_a_obj_lv4prelvtr"), diff --git a/include/d/actor/d_a_alink.h b/include/d/actor/d_a_alink.h index 07d580fa2d8..92ab3d82bc9 100644 --- a/include/d/actor/d_a_alink.h +++ b/include/d/actor/d_a_alink.h @@ -674,6 +674,7 @@ public: FTANM_UNK_7B = 0x7B, FTANM_UNK_7C = 0x7C, FTANM_UNK_8A = 0x8A, + FTANM_UNK_8B = 0x8B, FTANM_UNK_8D = 0x8D, FTANM_UNK_8E = 0x8E, FTANM_UNK_8F = 0x8F, @@ -682,6 +683,7 @@ public: FTANM_UNK_95 = 0x95, FTANM_UNK_96 = 0x96, FTANM_UNK_97 = 0x97, + FTANM_UNK_99 = 0x99, FTANM_UNK_9A = 0x9A, FTANM_UNK_9B = 0x9B, FTANM_UNK_9C = 0x9C, @@ -1309,7 +1311,7 @@ public: /* 800A39B8 */ void handBgCheck(); /* 800A3C8C */ JKRHeap* setItemHeap(); /* 800A3CE4 */ void setIdxMask(u16*, u16*); - /* 800A3D0C */ void* getAnimeResource(daPy_anmHeap_c*, u16, u32); + /* 800A3D0C */ J3DAnmTransform* getAnimeResource(daPy_anmHeap_c*, u16, u32); /* 800A3D7C */ J3DModel* initModel(J3DModelData*, u32, u32); /* 800A3E30 */ J3DModel* initModel(u16, u32); /* 800A3E98 */ J3DModel* initModelEnv(u16, u32); @@ -2001,7 +2003,7 @@ public: /* 800E7460 */ int procPickUp(); /* 800E75EC */ int procPickPutInit(int); /* 800E76E0 */ int procPickPut(); - /* 800E7894 */ void checkSetChainPullAnime(s16); + /* 800E7894 */ BOOL checkSetChainPullAnime(s16); /* 800E794C */ s16 getChainStickAngleY(s16) const; /* 800E7994 */ u8 checkChainEmphasys(); /* 800E79F8 */ BOOL searchFmChainPos(); @@ -2361,8 +2363,8 @@ public: /* 80102B1C */ int checkSwimAction(int); /* 80103058 */ int checkSwimUpAction(); /* 801032C8 */ void swimOutAfter(int); - /* 80103398 */ bool checkSwimFall(); - /* 801033CC */ void checkSwimOutAction(); + /* 80103398 */ BOOL checkSwimFall(); + /* 801033CC */ int checkSwimOutAction(); /* 80103698 */ void setSwimMoveAnime(); /* 80103EE0 */ bool checkSwimButtonAccept(); /* 80103F08 */ bool checkUpSwimButtonAccept(); @@ -2743,12 +2745,12 @@ public: /* 80128F5C */ void setWolfAtnMoveDirection(); /* 80129114 */ void setBlendWolfAtnMoveAnime(f32); /* 8012933C */ void setBlendWolfAtnBackMoveAnime(f32); - /* 8012948C */ void setDoubleAnimeWolf(f32, f32, f32, daAlink_c::daAlink_WANM, + /* 8012948C */ int setDoubleAnimeWolf(f32, f32, f32, daAlink_c::daAlink_WANM, daAlink_c::daAlink_WANM, int, f32); /* 80129678 */ void setSingleAnimeWolfBase(daAlink_c::daAlink_WANM); /* 801296A8 */ void setSingleAnimeWolfBaseMorf(daAlink_c::daAlink_WANM, f32); /* 801296D8 */ void setSingleAnimeWolfBaseSpeed(daAlink_c::daAlink_WANM, f32, f32); - /* 80129704 */ void setSingleAnimeWolf(daAlink_c::daAlink_WANM, f32, f32, s16, f32); + /* 80129704 */ int setSingleAnimeWolf(daAlink_c::daAlink_WANM, f32, f32, s16, f32); /* 80129848 */ void setSingleAnimeWolfParam(daAlink_c::daAlink_WANM, daAlinkHIO_anm_c const*); /* 8012987C */ int checkWolfLandAction(int); /* 80129958 */ BOOL checkMidnaUseAbility() const; @@ -2758,7 +2760,7 @@ public: /* 8012A02C */ BOOL wolfSideBgCheck(s16); /* 8012A228 */ BOOL checkWolfAttackReverse(int); /* 8012A330 */ int checkWolfBarrierHitReverse(); - /* 8012A41C */ bool checkWolfBarrierWallHit(cBgS_PolyInfo&); + /* 8012A41C */ BOOL checkWolfBarrierWallHit(cBgS_PolyInfo&); /* 8012A498 */ void wolfBgCheck(); /* 8012ACCC */ void changeWolfBlendRate(int); /* 8012AD1C */ void setWolfFootMatrix(); @@ -3572,7 +3574,7 @@ public: /* 0x02154 */ J3DAnmTexPattern* field_0x2154; /* 0x02158 */ J3DAnmTextureSRTKey* mpFaceBtk; /* 0x0215C */ daPy_frameCtrl_c* field_0x215c; - /* 0x02160 */ s8* field_0x2160; + /* 0x02160 */ u16* field_0x2160; /* 0x02164 */ mDoExt_bckAnm field_0x2164; /* 0x02180 */ daAlink_matAnm_c* field_0x2180[2]; /* 0x02188 */ dEyeHL_c mEyeHL1; @@ -3750,16 +3752,20 @@ public: union { s16 field_0x300a; s16 mBoardSwordChargeTime; + s16 mDigActorName; } /* 0x0300A */ mProcVar1; union { s16 field_0x300c; s16 mPuzzleAimAngle; + s16 mDigType; } /* 0x0300C */ mProcVar2; union { s16 field_0x300e; + s16 mDigChangeArea; } /* 0x0300E */ mProcVar3; union { s16 field_0x3010; + s16 mDigExitID; } /* 0x03010 */ mProcVar4; union { s16 field_0x3012; diff --git a/include/d/actor/d_a_e_s1.h b/include/d/actor/d_a_e_s1.h index 9ba691e6649..f20e9ed4fb5 100644 --- a/include/d/actor/d_a_e_s1.h +++ b/include/d/actor/d_a_e_s1.h @@ -1,6 +1,20 @@ #ifndef D_A_E_S1_H #define D_A_E_S1_H + #include "f_op/f_op_actor_mng.h" +#include "Z2AudioLib/Z2Creature.h" +#include "d/d_jnt_col.h" +#include "d/d_bg_s_acch.h" +#include "d/d_cc_d.h" +#include "d/d_cc_uty.h" + +struct dPath; + +struct s1_ke_s { + /* 0x000 */ cXyz field_0x0[16]; + /* 0x0C0 */ cXyz field_0xc0[16]; + /* 0x180 */ cXyz field_0x180; +}; /** * @ingroup actors-enemies @@ -11,22 +25,83 @@ * */ class e_s1_class : public fopEn_enemy_c { -private: - /* 0x5ac */ u8 field_0x5ac[0x3084 - 0x5ac]; +public: + /* 0x05AC */ request_of_phase_process_class mPhase; + /* 0x05B4 */ u8 mRoofSpawn; + /* 0x05B5 */ u8 mPrm1; + /* 0x05B6 */ u8 mGroupID; + /* 0x05B7 */ u8 mSwBit; + /* 0x05B8 */ u8 field_0x5B8[0x05BC - 0x05B8]; + /* 0x05BC */ dPath* mpPath; + /* 0x05C0 */ s8 mCurrentPathPointNo; + /* 0x05C1 */ s8 mPathDirection; + /* 0x05C4 */ cXyz mPathTargetPos; + /* 0x05D0 */ s16 mTargetAngle; + /* 0x05D4 */ mDoExt_McaMorfSO* mpMorf; + /* 0x05D8 */ int mAnm; + /* 0x05DC */ u8 field_0x5DC[0x05E0 - 0x05DC]; + /* 0x05E0 */ Z2CreatureEnemy mSound; + /* 0x0684 */ dJntCol_c mJntCol; + /* 0x0694 */ s16 mCounter; + /* 0x0696 */ s16 mAction; + /* 0x0698 */ s16 mMode; + /* 0x069A */ s8 mDrawShadow; + /* 0x069C */ u32 mShadowKey; + /* 0x06A0 */ s16 mTimers[4]; + /* 0x06A8 */ s16 mHitInvincibilityTimer; + /* 0x06AA */ s16 field_0x6aa; + /* 0x06AC */ f32 field_0x6ac; + /* 0x06B0 */ s16 field_0x6b0; + /* 0x06B2 */ s16 field_0x6b2; + /* 0x06B4 */ u8 field_0x6B4[0x06B6 - 0x06B4]; + /* 0x06B6 */ s16 field_0x6b6; + /* 0x06B8 */ s8 mIsSlowAttack; + /* 0x06B9 */ s8 field_0x6b9; + /* 0x06BA */ s8 field_0x6ba; + /* 0x06BB */ s8 field_0x6bb; + /* 0x06BC */ dBgS_AcchCir mAcchCir; + /* 0x06FC */ dBgS_ObjAcch mAcch; + /* 0x08D4 */ dCcD_Stts mCcStts; + /* 0x0910 */ dCcD_Sph mCcSph[3]; + /* 0x0CB8 */ dCcD_Sph mCcAtSph; + /* 0x0DF0 */ dCcU_AtInfo mAtInfo; + /* 0x0E14 */ s1_ke_s mKe[22]; + /* 0x301C */ mDoExt_3DlineMat0_c mLineMat; + /* 0x3038 */ s16 mDemoMode; + /* 0x303A */ s16 mDemoTimer; + /* 0x303C */ cXyz mDemoCamEye; + /* 0x3048 */ cXyz mDemoCamCenter; + /* 0x3054 */ f32 field_0x3054; + /* 0x3058 */ f32 field_0x3058; + /* 0x305C */ f32 mDemoCamBank; + /* 0x3060 */ f32 field_0x3060; + /* 0x3064 */ f32 mSearchRange; + /* 0x3068 */ f32 field_0x3068; + /* 0x306C */ s8 field_0x306c; + /* 0x306D */ u8 field_0x306D[0x307C - 0x306D]; + /* 0x307C */ u32 mBodyEffEmtrID; + /* 0x3080 */ u8 mInitHIO; }; STATIC_ASSERT(sizeof(e_s1_class) == 0x3084); class daE_S1_HIO_c { +public: /* 8077AB8C */ daE_S1_HIO_c(); - /* 80780840 */ ~daE_S1_HIO_c(); + /* 80780840 */ virtual ~daE_S1_HIO_c() {} + + /* 0x04 */ s8 field_0x4; + /* 0x08 */ f32 mBaseSize; + /* 0x0C */ f32 mMoveSpeed; + /* 0x10 */ u8 field_0x10[0x14 - 0x10]; + /* 0x14 */ f32 mDashSpeed; + /* 0x18 */ f32 field_0x18; + /* 0x1C */ s16 mFallSEWaitTime; + /* 0x1E */ s16 mAllDeadWaitTime; + /* 0x20 */ f32 mReactionDist; + /* 0x24 */ f32 mReactionAngle; + /* 0x28 */ s16 mReactionTime; + /* 0x2A */ u8 mInvincible; }; -struct s1_ke_s { - /* 807803F4 */ ~s1_ke_s(); - /* 80780470 */ s1_ke_s(); -}; - - - #endif /* D_A_E_S1_H */ diff --git a/include/d/actor/d_a_midna.h b/include/d/actor/d_a_midna.h index 8919fc302a2..d79b08645b9 100644 --- a/include/d/actor/d_a_midna.h +++ b/include/d/actor/d_a_midna.h @@ -32,6 +32,7 @@ public: FLG0_UNK_8000000 = 0x8000000, FLG0_NPC_NEAR = 0x100000, FLG0_NPC_FAR = 0x40000, + FLG0_UNK_20000 = 0x20000, FLG0_NO_INPUT = 0x4000, FLG0_NO_DRAW = 0x2000, FLG0_UNK_400 = 0x400, @@ -118,6 +119,11 @@ public: BOOL checkWolfNoPos() const { return checkStateFlg0(FLG0_UNK_800); } int checkMetamorphoseEnable() { return (this->*mpFunc)(); } int checkShadowModelDrawDemoForce() const { return checkStateFlg1(FLG1_SHADOW_MODEL_DRAW_DEMO_FORCE); } + + void setForceNeckAimPos(const cXyz& i_pos) { + onStateFlg0(FLG0_UNK_20000); + field_0x9c4 = i_pos; + } void onTagWaitPosWarp(const cXyz* param_0) { field_0x9ac = *param_0; diff --git a/include/d/actor/d_a_npc_moi.h b/include/d/actor/d_a_npc_moi.h index 79e84884ee6..e0ed85d64a8 100644 --- a/include/d/actor/d_a_npc_moi.h +++ b/include/d/actor/d_a_npc_moi.h @@ -83,8 +83,12 @@ public: static void* mCutNameList[5]; static u8 mCutList[60]; + bool chkSFight() { return field_0x166b == 1; } + private: - /* 0x568 */ u8 field_0x568[0x1674 - 0x568]; + /* 0x0568 */ u8 field_0x568[0x166B - 0x568]; + /* 0x166B */ u8 field_0x166b; + /* 0x166C */ u8 field_0x166c[0x1674 - 0x166C]; }; STATIC_ASSERT(sizeof(daNpc_Moi_c) == 0x1674); diff --git a/include/d/actor/d_a_npc_tk.h b/include/d/actor/d_a_npc_tk.h index 303f1ef80cf..1453c37b82d 100644 --- a/include/d/actor/d_a_npc_tk.h +++ b/include/d/actor/d_a_npc_tk.h @@ -73,6 +73,7 @@ public: void setEventWolf() { mFlags |= 0x80; } void setEvent() { mFlags |= 0x8; } void setAway() { mFlags |= 2; } + void setAttack() { mFlags |= 1; } void setHawkPath(u8 i_pathNo) { if (i_pathNo != 0xFF) { diff --git a/include/d/actor/d_a_obj_digholl.h b/include/d/actor/d_a_obj_digholl.h index 03ba8a9a955..a11fb269bfb 100644 --- a/include/d/actor/d_a_obj_digholl.h +++ b/include/d/actor/d_a_obj_digholl.h @@ -18,6 +18,9 @@ public: /* 80BDC7D8 */ int execute(); /* 80BDCB0C */ int draw(); + void onDigStart() { field_0x568 = 1; } + s16 getSceneNum() const { return field_0x56c; } + private: /* 0x568 */ u8 field_0x568; /* 0x569 */ u8 field_0x569; diff --git a/include/d/actor/d_a_obj_digplace.h b/include/d/actor/d_a_obj_digplace.h index 2635ad9d5cf..5144ebcbc59 100644 --- a/include/d/actor/d_a_obj_digplace.h +++ b/include/d/actor/d_a_obj_digplace.h @@ -32,6 +32,8 @@ public: u8 getSceneNum() { return (fopAcM_GetParam(this) >> 0xC) & 0xFF; } int getItemNum() { return getSceneNum(); } + u8 getType() const { return mType; } + void onDigFlg() { mDigFlg = true; } }; STATIC_ASSERT(sizeof(daObjDigpl_c) == 0x5C0); diff --git a/include/d/actor/d_a_obj_digsnow.h b/include/d/actor/d_a_obj_digsnow.h index c8dcd59afef..a2b24eca214 100644 --- a/include/d/actor/d_a_obj_digsnow.h +++ b/include/d/actor/d_a_obj_digsnow.h @@ -47,8 +47,8 @@ public: /* 80BDD2B8 */ virtual int Delete(); u8 getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } - void startDig() { mAction = ACTION_DIG_e; } - void endDig() { mAction = ACTION_END_e; } + void startDig() { mMode = ACTION_DIG_e; } + void endDig() { mMode = ACTION_END_e; } private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; diff --git a/include/d/actor/d_a_obj_lv4digsand.h b/include/d/actor/d_a_obj_lv4digsand.h index 138e1ae829d..3d3c274a40e 100644 --- a/include/d/actor/d_a_obj_lv4digsand.h +++ b/include/d/actor/d_a_obj_lv4digsand.h @@ -2,6 +2,9 @@ #define D_A_OBJ_LV4DIGSAND_H #include "f_op/f_op_actor_mng.h" +#include "d/d_bg_s_movebg_actor.h" +#include "d/d_bg_s_acch.h" +#include "d/d_cc_d.h" /** * @ingroup actors-objects @@ -11,14 +14,11 @@ * @details * */ -class daObjL4DigSand_c : public fopAc_ac_c { +class daObjL4DigSand_c : public dBgS_MoveBgActor { public: /* 80C66B18 */ void initBaseMtx(); /* 80C66B54 */ void setBaseMtx(); - /* 80C66BC8 */ void Create(); - /* 80C66C24 */ void CreateHeap(); - /* 80C66C94 */ void create1st(); - /* 80C66D40 */ void Execute(f32 (**)[3][4]); + /* 80C66C94 */ int create1st(); /* 80C66DD0 */ void action(); /* 80C66E74 */ void mode_init_wait(); /* 80C66E80 */ void mode_wait(); @@ -26,11 +26,27 @@ public: /* 80C66FFC */ void mode_dig(); /* 80C670AC */ void mode_init_end(); /* 80C67100 */ void mode_end(); - /* 80C67104 */ void Draw(); - /* 80C671A8 */ void Delete(); -private: - /* 0x568 */ u8 field_0x568[0x944 - 0x568]; + /* 80C66C24 */ virtual int CreateHeap(); + /* 80C66BC8 */ virtual int Create(); + /* 80C66D40 */ virtual int Execute(f32 (**)[3][4]); + /* 80C67104 */ virtual int Draw(); + /* 80C671A8 */ virtual int Delete(); + + u8 getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } + void startDig() { field_0x941 = 1; } + void endDig() { field_0x941 = 2; } + + /* 0x5A0 */ request_of_phase_process_class mPhase; + /* 0x5A8 */ J3DModel* mpModel; + /* 0x5AC */ dBgS_ObjAcch mAcch; + /* 0x784 */ dBgS_AcchCir mAcchCir; + /* 0x7C4 */ dCcD_Stts mCcStts; + /* 0x800 */ dCcD_Cyl mCcCyl; + /* 0x93C */ f32 mGroundY; + /* 0x940 */ u8 mMode; + /* 0x941 */ u8 field_0x941; + /* 0x942 */ u8 mTimer; }; STATIC_ASSERT(sizeof(daObjL4DigSand_c) == 0x944); diff --git a/include/d/actor/d_a_obj_sekizoa.h b/include/d/actor/d_a_obj_sekizoa.h index eedeb47177f..c7f2b02d8a4 100644 --- a/include/d/actor/d_a_obj_sekizoa.h +++ b/include/d/actor/d_a_obj_sekizoa.h @@ -53,7 +53,6 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int, daNpcT_evtData_c const*, char**); /* 80CD5B84 */ void chkGoal(); - /* 801312C8 */ void setWolfHowling(); /* 80CD5B7C */ s32 getBackboneJointNo(); /* 80CD5B74 */ s32 getHeadJointNo(); @@ -72,6 +71,17 @@ public: /* 80CD05D0 */ void drawGhost(); /* 80CD06BC */ bool afterSetMotionAnm(int, int, f32, int); + void setWolfHowling() { + if (field_0x10c8 != 0) { + fopAc_ac_c* actor_p = field_0x10e4.getActorP(); + JUT_ASSERT(0x1A3, 0 != actor_p); + + ((daObj_Sekizoa_c*)actor_p)->setWolfHowling(); + } else { + field_0x1173 = 1; + } + } + u8 getType() { int prm = fopAcM_GetParam(this) >> 0x1C; @@ -116,6 +126,14 @@ public: static void* mCutNameList[9]; static u8 mCutList[108]; + + /* 0x0E40 */ u8 field_0xe40[0x10C8 - 0xE40]; + /* 0x10C8 */ u8 field_0x10c8; + /* 0x10C9 */ u8 field_0x10c9[0x10E4 - 0x10C9]; + /* 0x10E4 */ daNpcT_ActorMngr_c field_0x10e4; + /* 0x10EC */ u8 field_0x10ec[0x1173 - 0x10ec]; + /* 0x1173 */ u8 field_0x1173; + /* 0x1174 */ u8 field_0x1174[0x1180 - 0x1174]; }; #endif /* D_A_OBJ_SEKIZOA_H */ diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index cd2f7642c8f..ded02632cac 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -387,6 +387,7 @@ public: ERFLG1_UNK_20000000 = 0x20000000, ERFLG1_UNK_10000000 = 0x10000000, ERFLG1_UNK_4000000 = 0x4000000, + ERFLG1_UNK_2000000 = 0x2000000, ERFLG1_UNK_1000000 = 0x1000000, ERFLG1_UNK_200000 = 0x200000, ERFLG1_UNK_100000 = 0x100000, @@ -420,12 +421,14 @@ public: }; enum daPy_RFLG0 { + RFLG0_WOLF_BARK = 0x80000000, RFLG0_UNK_40000000 = 0x40000000, RFLG0_UNK_20000000 = 0x20000000, RFLG0_UNK_10000000 = 0x10000000, RFLG0_UNK_8000000 = 0x8000000, RFLG0_UNK_4000000 = 0x4000000, RFLG0_GRAB_PUT_START = 0x400000, + RFLG0_WOLF_GROWL = 0x200000, RFLG0_UNK_80000 = 0x80000, RFLG0_UNK_40000 = 0x40000, RFLG0_UNK_20000 = 0x20000, @@ -869,6 +872,10 @@ public: u32 checkMagneBootsOn() const { return checkNoResetFlg0(FLG0_MAGNE_BOOTS_ON); } BOOL checkFastSwordCut() const { return checkNoResetFlg0(FLG0_UNK_80000); } u32 checkMidnaRide() const { return checkNoResetFlg0(FLG0_MIDNA_RIDE); } + BOOL checkWolfGrowl() const { return checkResetFlg0(RFLG0_WOLF_GROWL); } + BOOL checkWolfThreat() const { return checkWolfGrowl(); } + BOOL checkWolfBark() const { return checkResetFlg0(RFLG0_WOLF_BARK); } + void onPlayerNoDraw() { onNoResetFlg0(FLG0_PLAYER_NO_DRAW); } void offPlayerNoDraw() { offNoResetFlg0(FLG0_PLAYER_NO_DRAW); } void onPushPullKeep() { onNoResetFlg0(FLG0_PUSH_PULL_KEEP); } @@ -879,6 +886,8 @@ public: void onForceGameOver() { onNoResetFlg2(FLG2_FORCE_GAMEOVER); } void onForceWolfChange() { onEndResetFlg0(ERFLG0_UNK_2); } void onDoPutEmphasys() { onEndResetFlg1(ERFLG1_UNK_10000000); } + void onNsScream() { onEndResetFlg1(ERFLG1_UNK_1); } + void onNsScreamAnm() { onEndResetFlg1(daPy_ERFLG1(ERFLG1_UNK_1 | ERFLG1_UNK_2)); } u32 checkBoarSingleBattle() const { return checkNoResetFlg2(FLG2_BOAR_SINGLE_BATTLE); } u32 checkWolfDashAutoJump() const { return checkNoResetFlg2(FLG2_WOLF_DASH_AUTO_JUMP); } diff --git a/include/d/actor/d_a_tag_wljump.h b/include/d/actor/d_a_tag_wljump.h index 87fe27b6b23..bcdd00520de 100644 --- a/include/d/actor/d_a_tag_wljump.h +++ b/include/d/actor/d_a_tag_wljump.h @@ -21,10 +21,14 @@ public: } } + f32 getLandArea() const { return mLandArea; } + void onNextCheckFlg() { mNextCheckFlg = true; } + s16 getNotSlideFlg() const { return shape_angle.z; } + /* 0x568 */ s8 field_0x568; - /* 0x568 */ s8 field_0x569; - /* 0x568 */ u8 field_0x56a; - /* 0x568 */ u8 field_0x56b; + /* 0x569 */ s8 field_0x569; + /* 0x56A */ u8 field_0x56a; + /* 0x56B */ u8 mNextCheckFlg; /* 0x56C */ u8 field_0x56c[4]; /* 0x570 */ u8 field_0x570; /* 0x571 */ u8 field_0x571; @@ -34,7 +38,7 @@ public: /* 0x574 */ u16 field_0x576; /* 0x578 */ dMsgFlow_c mMsgFlow; /* 0x5C4 */ dPath* field_0x5c4; - /* 0x5C8 */ f32 field_0x5c8; + /* 0x5C8 */ f32 mLandArea; }; #endif /* D_A_TAG_WLJUMP_H */ diff --git a/include/d/d_camera.h b/include/d/d_camera.h index b8dd28ac646..0248f650993 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -391,6 +391,10 @@ public: i_info->field_0x1e = param_1; } + void EventFlag(int i_flag) { + mEventData.field_0x24 = i_flag; + } + static engine_fn engine_tbl[]; /* 0x000 */ camera_class* field_0x0; diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index 07feb9b429e..eff858ece61 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -271,12 +271,14 @@ public: void onWolfDownPullEndFlg() { mFlags |= 0x20; } void onWolfNoLock() { mFlags |= 0x200; } void onDownFlg() { mFlags |= 1; } + void onHeadLockFlg() { mFlags |= 0x80; } void offWolfBiteDamage() { mFlags &= ~0x40; } void offCutDownHitFlg() { mFlags &= ~0x2; } void offWolfDownPullFlg() { mFlags &= ~0x10; } void offDownFlg() { mFlags &= ~0x17; } void offWolfNoLock() { mFlags &= ~0x200; } + void offHeadLockFlg() { mFlags &= ~0x80; } void setMidnaBindMode(u8 i_bindMode) { mMidnaBindMode = i_bindMode; } void setMidnaBindID(u8 i_idx, u32 i_bindID) { mMidnaBindID[i_idx] = i_bindID; } @@ -285,6 +287,7 @@ public: void setThrowModeThrowRight() { mThrowMode |= 0x10; } void setThrowModeThrowLeft() { mThrowMode |= 8; } void setDownPos(const cXyz* i_pos) { mDownPos = *i_pos; } + void setHeadLockPos(const cXyz* i_pos) { mHeadLockPos = *i_pos; } /* 0x568 */ cXyz mDownPos; /* 0x574 */ cXyz mHeadLockPos; diff --git a/include/f_op/f_op_actor_enemy.h b/include/f_op/f_op_actor_enemy.h new file mode 100644 index 00000000000..d8cf625ff65 --- /dev/null +++ b/include/f_op/f_op_actor_enemy.h @@ -0,0 +1,86 @@ +#ifndef F_OP_ACTOR_ENEMY_H_ +#define F_OP_ACTOR_ENEMY_H_ + +#include "SSystem/SComponent/c_math.h" +#include "Z2AudioLib/Z2Creature.h" +#include "d/actor/d_a_midna.h" +#include "d/actor/d_a_player.h" +#include "d/d_com_inf_game.h" +#include "d/d_s_play.h" + +// NONMATCHING ? +static int setMidnaBindEffect(fopEn_enemy_c* i_actorP, Z2CreatureEnemy* i_creatureP, cXyz* i_effPos, + cXyz* i_effSize) { + static GXColor e_prim[] = { + {0xFF, 0x78, 0x00, 0x00}, + {0xFF, 0x64, 0x78, 0x00}, + }; + static GXColor e_env[] = { + {0x5A, 0x2D, 0x2D, 0x00}, + {0x3C, 0x1E, 0x1E, 0x00}, + }; + + daPy_py_c* player = daPy_getPlayerActorClass(); + fopAc_ac_c* a_this = (fopAc_ac_c*)i_actorP; + + if (player->getMidnaActor() && player->checkWolfLock(a_this)) { + cXyz sp48; + + BOOL darkworld_check; + if (dKy_darkworld_check()) { + darkworld_check = 1; + } else { + darkworld_check = 0; + } + + if (i_actorP->getMidnaBindMode() == 0) { + i_actorP->setMidnaBindMode(1); + + csXyz sp68; + MTXCopy(player->getMidnaActor()->getMtxHairTop(), mDoMtx_stack_c::get()); + + cXyz sp54(nREG_F(8) + 100.0f, nREG_F(9), nREG_F(10)); + mDoMtx_stack_c::multVec(&sp54, &sp48); + + cXyz sp60 = sp48 - *i_effPos; + + sp68.y = cM_atan2s(sp60.x, sp60.z); + sp68.x = -cM_atan2s(sp60.y, JMAFastSqrt(sp60.x * sp60.x + sp60.z * sp60.z)); + sp68.z = 0; + + s32 room_no = fopAcM_GetRoomNo(a_this); + JPABaseEmitter* emitter = dComIfGp_particle_set( + 0x29B, i_effPos, &a_this->tevStr, &sp68, i_effSize, 0xFF, NULL, room_no, + &e_prim[darkworld_check], &e_env[darkworld_check], NULL); + + if (emitter != NULL) { + emitter->setGlobalParticleHeightScale((JREG_F(7) + 0.01f) * sp60.abs()); + } + + room_no = fopAcM_GetRoomNo(a_this); + dComIfGp_particle_set(0x29C, i_effPos, &a_this->tevStr, &a_this->shape_angle, i_effSize, + 0xFF, NULL, room_no, &e_prim[darkworld_check], + &e_env[darkworld_check], NULL); + + i_creatureP->startCreatureSound(Z2SE_MIDNA_BIND_LOCK_ON, 0, -1); + } + + for (int i = 0; i < 3; i++) { + static u16 eff_id[] = {0x29D, 0x29E, 0x29F}; + + u32* bind_id = i_actorP->getMidnaBindID(i); + *bind_id = dComIfGp_particle_set(*bind_id, eff_id[i], i_effPos, &a_this->tevStr, + &a_this->shape_angle, i_effSize, 0xFF, NULL, + fopAcM_GetRoomNo(a_this), &e_prim[darkworld_check], + &e_env[darkworld_check], NULL); + } + + i_creatureP->startCreatureSound(Z2SE_MIDNA_BIND_LOCK_SUS, 0, -1); + return 1; + } + + i_actorP->setMidnaBindMode(0); + return 0; +} + +#endif diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index fcf43fa269c..b3c9bc286e7 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -116,6 +116,7 @@ public: static bool getTriPla(cM3dGPla* i_plane) { return dComIfG_Bgsp().GetTriPla(mGndCheck, i_plane); } static int getRoomId() { return dComIfG_Bgsp().GetRoomId(mGndCheck); } static int getPolyColor() { return dComIfG_Bgsp().GetPolyColor(mGndCheck); } + static int getPolyAtt0() { return dComIfG_Bgsp().GetPolyAtt0(mGndCheck); } static dBgS_ObjGndChk* getGroundCheck() { return &mGndCheck; } static f32 getGroundY() { return mGroundY; } }; @@ -607,7 +608,7 @@ s32 fopAcM_createWarpHole(const cXyz*, const csXyz*, int, u8, u8, u8); fopAc_ac_c* fopAcM_myRoomSearchEnemy(s8 roomNo); -s32 fopAcM_createDisappear(const fopAc_ac_c*, const cXyz*, u8, u8, u8); +s32 fopAcM_createDisappear(const fopAc_ac_c* i_actor, const cXyz* i_pos, u8 i_size, u8 i_type, u8 i_enemyID); void fopAcM_setCarryNow(fopAc_ac_c*, int); void fopAcM_cancelCarryNow(fopAc_ac_c*); s32 fopAcM_otoCheck(const fopAc_ac_c*, f32); @@ -728,76 +729,4 @@ inline bool fopAcM_CheckFoodStatus(const fopAc_ac_c* actor, fopAcM_FOOD status) return actor->field_0x567 == status; } -/* static inline int setMidnaBindEffect(fopEn_enemy_c* i_actorP, Z2CreatureEnemy* i_creatureP, cXyz* param_2, - cXyz* param_3) { - static GXColor e_prim[] = { - {0xFF, 0x78, 0x00, 0x00}, - {0xFF, 0x64, 0x78, 0x00}, - }; - static GXColor e_env[] = { - {0x5A, 0x2D, 0x2D, 0x00}, - {0x3C, 0x1E, 0x1E, 0x00}, - }; - - daPy_py_c* player = daPy_getPlayerActorClass(); - fopAc_ac_c* a_this = (fopAc_ac_c*)i_actorP; - - if (player->getMidnaActor() && player->checkWolfLock(a_this)) { - cXyz sp48; - - BOOL darkworld_check; - if (dKy_darkworld_check()) { - darkworld_check = 1; - } else { - darkworld_check = 0; - } - - if (i_actorP->getMidnaBindMode() == 0) { - i_actorP->setMidnaBindMode(1); - - csXyz sp68; - MTXCopy(player->getMidnaActor()->getMtxHairTop(), mDoMtx_stack_c::get()); - - cXyz sp54(nREG_F(8) + 100.0f, nREG_F(9), nREG_F(10)); - mDoMtx_stack_c::multVec(&sp54, &sp48); - - cXyz sp60 = sp48 - *param_2; - - sp68.y = cM_atan2s(sp60.x, sp60.z); - sp68.x = -cM_atan2s(sp60.y, JMAFastSqrt(sp60.x * sp60.x + sp60.z * sp60.z)); - sp68.z = 0; - - JPABaseEmitter* emitter = dComIfGp_particle_set( - 0x29B, param_2, &a_this->tevStr, &sp68, param_3, 0xFF, NULL, fopAcM_GetRoomNo(a_this), - &e_prim[darkworld_check], &e_env[darkworld_check], NULL); - - if (emitter != NULL) { - emitter->setGlobalParticleHeightScale((JREG_F(7) + 0.01f) * sp60.abs()); - } - - dComIfGp_particle_set(0x29C, param_2, &a_this->tevStr, &a_this->shape_angle, - param_3, 0xFF, NULL, fopAcM_GetRoomNo(a_this), &e_prim[darkworld_check], - &e_env[darkworld_check], NULL); - - i_creatureP->startCreatureSound(Z2SE_MIDNA_BIND_LOCK_ON, 0, -1); - } - - for (int i = 0; i < 3; i++) { - static u16 eff_id[] = {0x29D, 0x29E, 0x29F}; - - u32* bind_id = i_actorP->getMidnaBindID(i); - *bind_id = dComIfGp_particle_set(*bind_id, eff_id[i], param_2, &a_this->tevStr, - &a_this->shape_angle, param_3, 0xFF, NULL, fopAcM_GetRoomNo(a_this), - &e_prim[darkworld_check], &e_env[darkworld_check], NULL); - - } - - i_creatureP->startCreatureSound(Z2SE_MIDNA_BIND_LOCK_SUS, 0, -1); - return 1; - } - - i_actorP->setMidnaBindMode(0); - return 0; -} */ - #endif diff --git a/include/global.h b/include/global.h index cc16a8a5047..a2617285db2 100644 --- a/include/global.h +++ b/include/global.h @@ -43,4 +43,19 @@ inline BOOL checkEqual(s32 a, s32 b) { // hack to make strings with no references compile properly #define DEAD_STRING(s) OSReport(s) +#define UNK_BSS(name) \ + static u8 lit_##name[1 + 3 /* padding */]; + +#define UNK_REL_DATA \ + static u8 cNullVec__6Z2Calc[12] = { \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + }; \ + static u32 lit_1787[1 + 4 /* padding */] = { \ + 0x02000201, \ + 0x40080000, \ + 0x00000000, \ + 0x3FE00000, \ + 0x00000000, \ + }; + #endif diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 1f4fb6e50c6..23a5b2b613c 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -420,6 +420,7 @@ public: u16 getOldFrameStartJoint() { return mOldFrameStartJoint; } u16 getOldFrameEndJoint() { return mOldFrameEndJoint; } Quaternion* getOldFrameQuaternion(int i_no) { return &mOldFrameQuaternion[i_no]; } + f32 getOldFrameMorfCounter() { return mOldFrameMorfCounter; } private: /* 0x00 */ bool mOldFrameFlg; diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h index 38e4772be35..98930d6e96f 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath.h @@ -3,9 +3,9 @@ namespace std { -/* float fabs(float num) { +inline float fabs(float num) { return ::fabsf(num); -} */ +} inline float fabsf(float num) { return ::fabsf(num); @@ -20,4 +20,4 @@ inline float abs(float x) { } } // namespace std -#endif \ No newline at end of file +#endif diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index 5f58b66dc89..dd7005164f1 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -551,13 +551,13 @@ SECTION_SDATA2 static u8 bFootJoint[4] = { }; /* 804531D8-804531E0 0017D8 0008+00 1/1 0/0 0/0 .sdata2 snowID$53110 */ -SECTION_SDATA2 static u8 snowID[8] = { - 0x88, 0x4D, 0x88, 0x4E, 0x88, 0x51, 0x88, 0x52, +SECTION_SDATA2 static u16 snowID[] = { + 0x884D, 0x884E, 0x8851, 0x8852, }; /* 804531E0-804531E8 0017E0 0008+00 1/1 0/0 0/0 .sdata2 smokeID$53111 */ -SECTION_SDATA2 static u8 smokeID[8] = { - 0x83, 0xA0, 0x83, 0xA1, 0x83, 0xA4, 0x83, 0xA5, +SECTION_SDATA2 static u16 smokeID[] = { + 0x83A0, 0x83A1, 0x83A4, 0x83A5, }; /* 804531E8-804531F0 0017E8 0008+00 1/1 0/0 0/0 .sdata2 waterColor$53845 */ @@ -884,13 +884,13 @@ SECTION_RODATA static Vec const l_ironBallCenterVec = { COMPILER_STRIP_GATE(0x8038FB50, &l_ironBallCenterVec); /* 8038FB5C-8038FBBC 01C1BC 0060+00 1/2 0/0 0/0 .rodata l_wolfFootOnFrame */ -SECTION_RODATA static u8 const l_wolfFootOnFrame[96] = { - 0x00, 0x00, 0x00, 0x00, 0x41, 0x80, 0x00, 0x00, 0x41, 0x98, 0x00, 0x00, 0x40, 0xC0, 0x00, 0x00, - 0x41, 0x20, 0x00, 0x00, 0x41, 0x40, 0x00, 0x00, 0x40, 0xE0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x41, 0xA0, 0x00, 0x00, 0x41, 0xD8, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, - 0x41, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xC0, 0x00, 0x00, 0x41, 0x30, 0x00, 0x00, - 0x41, 0xC0, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x41, 0x40, 0x00, 0x00, 0x41, 0xD0, 0x00, 0x00, - 0x42, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x30, 0x00, 0x00, 0x42, 0x68, 0x00, 0x00, +SECTION_RODATA static f32 const l_wolfFootOnFrame[6][4] = { + {0.0f, 16.0f, 19.0f, 6.0f}, + {10.0f, 12.0f, 7.0f, 3.0f}, + {0.0f, 20.0f, 27.0f, 8.0f}, + {17.0f, 0.0f, 24.0f, 11.0f}, + {24.0f, 32.0f, 12.0f, 26.0f}, + {56.0f, 0.0f, 44.0f, 58.0f}, }; COMPILER_STRIP_GATE(0x8038FB5C, &l_wolfFootOnFrame); @@ -2427,7 +2427,7 @@ void daAlink_c::setIdxMask(u16* o_arcNo, u16* o_resID) { /* 800A3D0C-800A3D7C 09E64C 0070+00 5/5 0/0 0/0 .text * getAnimeResource__9daAlink_cFP14daPy_anmHeap_cUsUl */ -void* daAlink_c::getAnimeResource(daPy_anmHeap_c* p_anmHeap, u16 i_anmID, u32 buf_size) { +J3DAnmTransform* daAlink_c::getAnimeResource(daPy_anmHeap_c* p_anmHeap, u16 i_anmID, u32 buf_size) { u16 arcNo; u16 resID = i_anmID; @@ -2437,10 +2437,10 @@ void* daAlink_c::getAnimeResource(daPy_anmHeap_c* p_anmHeap, u16 i_anmID, u32 bu setIdxMask(&arcNo, &resID); if (arcNo == 0xFFFF) { - return p_anmHeap->loadDataIdx(resID); + return (J3DAnmTransform*)p_anmHeap->loadDataIdx(resID); } - return p_anmHeap->loadDataDemoRID(resID, arcNo); + return (J3DAnmTransform*)p_anmHeap->loadDataDemoRID(resID, arcNo); } /* 800A3D7C-800A3E30 09E6BC 00B4+00 16/16 0/0 0/0 .text initModel__9daAlink_cFP12J3DModelDataUlUl diff --git a/src/d/actor/d_a_alink_demo.inc b/src/d/actor/d_a_alink_demo.inc index df2d12467b4..e3b170e2194 100644 --- a/src/d/actor/d_a_alink_demo.inc +++ b/src/d/actor/d_a_alink_demo.inc @@ -1228,6 +1228,7 @@ BOOL daAlink_c::checkDeadHP() { /* 80118D7C-80118FF8 1136BC 027C+00 3/3 0/0 0/0 .text checkDeadAction__9daAlink_cFi */ BOOL daAlink_c::checkDeadAction(int param_0) { // NONMATCHING + return 0; } /* 80118FF8-801190A4 113938 00AC+00 1/1 0/0 0/0 .text @@ -1360,6 +1361,7 @@ static u8 dummy[20]; static int daAlink_c_getDemoIDData(dDemo_actor_c* param_0, int* param_1, int* param_2, int* param_3, u16* param_4, int* param_5, int* param_6) { // NONMATCHING + return 0; } /* 801195C0-801195F8 113F00 0038+00 7/0 0/0 0/0 .text procDemoCommon__9daAlink_cFv */ diff --git a/src/d/actor/d_a_alink_grab.inc b/src/d/actor/d_a_alink_grab.inc index 77906374160..a28be3bf71a 100644 --- a/src/d/actor/d_a_alink_grab.inc +++ b/src/d/actor/d_a_alink_grab.inc @@ -441,7 +441,9 @@ int daAlink_c::procPickPut() { } /* 800E7894-800E794C 0E21D4 00B8+00 2/2 0/0 0/0 .text checkSetChainPullAnime__9daAlink_cFs */ -void daAlink_c::checkSetChainPullAnime(s16 param_0){// NONMATCHING +BOOL daAlink_c::checkSetChainPullAnime(s16 param_0) { + // NONMATCHING + return 0; } /* 800E794C-800E7994 0E228C 0048+00 3/3 0/0 0/0 .text getChainStickAngleY__9daAlink_cCFs diff --git a/src/d/actor/d_a_alink_swim.inc b/src/d/actor/d_a_alink_swim.inc index 651b8d7f994..4c9c0053b69 100644 --- a/src/d/actor/d_a_alink_swim.inc +++ b/src/d/actor/d_a_alink_swim.inc @@ -129,7 +129,6 @@ void daAlink_c::setWaterInAnmRate(daPy_frameCtrl_c* i_frameCtrl, f32 i_rate) { } /* 80101D70-801023E4 0FC6B0 0674+00 2/2 0/0 0/0 .text swimBgCheck__9daAlink_cFf */ -// NONMATCHING void daAlink_c::swimBgCheck(f32 param_0) { offNoResetFlg1(FLG1_UNK_20000000); @@ -140,17 +139,19 @@ void daAlink_c::swimBgCheck(f32 param_0) { cXyz start_pos(current.pos); cXyz end_pos; - s16 uvar1; + s16 var_r29; if (getZoraSwim()) { - uvar1 = field_0x3080; + var_r29 = field_0x3080; } else { - uvar1 = mProcVar2.field_0x300c; + var_r29 = mProcVar2.field_0x300c; start_pos.y += daAlinkHIO_wlWallHang_c0::m.field_0x78; } - end_pos.set(start_pos.x + (param_0 * cM_scos(uvar1)) * cM_ssin(shape_angle.y), - start_pos.y - param_0 * cM_ssin(uvar1), - start_pos.z + (param_0 * cM_scos(uvar1)) * cM_scos(shape_angle.y)); + f32 var_f28 = param_0 * cM_scos(var_r29); + + end_pos.set(start_pos.x + (var_f28 * cM_ssin(shape_angle.y)), + start_pos.y - param_0 * cM_ssin(var_r29), + start_pos.z + (var_f28 * cM_scos(shape_angle.y))); if (!commonLineCheck(&start_pos, &end_pos)) { return; @@ -162,15 +163,15 @@ void daAlink_c::swimBgCheck(f32 param_0) { if (cBgW_CheckBWall(tri.mNormal.y) && (mProcID != PROC_METAMORPHOSE || dComIfG_Bgsp().GetWallCode(mLinkLinChk) != 7)) { - cXyz tmp2 = end_pos - mLinkLinChk.i_GetCross(); - f32 absxz = tmp2.absXZ(); + cXyz sp14 = end_pos - mLinkLinChk.i_GetCross(); + f32 temp_f1 = sp14.absXZ(); - s16 svar8 = tmp2.atan2sX_Z(); - s16 svar9 = cM_atan2s(-tri.mNormal.x, -tri.mNormal.z); - f32 cos = cM_scos(svar8 - svar9); + s16 var_r28 = sp14.atan2sX_Z(); + f32 var_f26 = cM_scos(var_r28 - cM_atan2s(-tri.mNormal.x, -tri.mNormal.z)); + f32 var_f29 = -temp_f1 * var_f26; - f32 fvar14 = -absxz * cos * tri.mNormal.x; - f32 fvar15 = -absxz * cos * tri.mNormal.z; + f32 var_f31 = var_f29 * tri.mNormal.x; + f32 var_f30 = var_f29 * tri.mNormal.z; if (mProcID == PROC_METAMORPHOSE || (getZoraSwim() && cLib_distanceAngleS(cM_atan2s(tri.mNormal.y, tri.mNormal.absXZ()), @@ -179,37 +180,158 @@ void daAlink_c::swimBgCheck(f32 param_0) { onNoResetFlg1(FLG1_UNK_20000000); } - start_pos.x -= fvar14; - start_pos.z -= fvar15; - end_pos.x -= fvar14; - end_pos.z -= fvar15; + start_pos.x -= var_f31; + start_pos.z -= var_f30; + end_pos.x -= var_f31; + end_pos.z -= var_f30; if (commonLineCheck(&start_pos, &end_pos)) { dComIfG_Bgsp().GetTriPla(mLinkLinChk, &tri); if (cBgW_CheckBWall(tri.mNormal.y)) { - tmp2 = end_pos - mLinkLinChk.i_GetCross(); - f32 absxz2 = tmp2.absXZ(); + sp14 = end_pos - mLinkLinChk.i_GetCross(); + temp_f1 = sp14.absXZ(); - s16 svar8_2 = tmp2.atan2sX_Z(); - s16 svar9_2 = cM_atan2s(-tri.mNormal.x, -tri.mNormal.z); - f32 cos_2 = cM_scos(svar8_2 - svar9_2); + var_r28 = sp14.atan2sX_Z(); + var_f26 = cM_scos(var_r28 - cM_atan2s(-tri.mNormal.x, -tri.mNormal.z)); + var_f29 = -temp_f1 * var_f26; - fvar14 += -absxz2 * cos_2 * tri.mNormal.x; - fvar15 += -absxz2 * cos_2 * tri.mNormal.z; + var_f31 += var_f29 * tri.mNormal.x; + var_f30 += var_f29 * tri.mNormal.z; } } - current.pos.x -= fvar14; - current.pos.z -= fvar15; - field_0x3092 = cM_atan2s(-fvar14, -fvar15); + current.pos.x -= var_f31; + current.pos.z -= var_f30; + field_0x3092 = cM_atan2s(-var_f31, -var_f30); } } /* 801023E4-801029C8 0FCD24 05E4+00 3/3 0/0 0/0 .text setSpeedAndAngleSwim__9daAlink_cFv */ void daAlink_c::setSpeedAndAngleSwim() { - // NONMATCHING + if (!checkBootsOrArmorHeavy() && dComIfGp_getDoStatus() == 0 && (!checkHookshotAnime() || (checkHookshotItem(mEquipItem) && (mItemMode == 0 || mItemMode == 1)))) { + if (checkZoraWearAbility()) { + if (checkNoResetFlg0(FLG0_SWIM_UP)) { + if (field_0x2fcd == 0) { + setDoStatus(0x41); + } + } else { + setDoStatus(0x4C); + } + } else if (!checkNoResetFlg0(FLG0_SWIM_UP)) { + setDoStatus(0x97); + } else if (mProcID == PROC_SWIM_MOVE && checkUnderMove0BckNoArc(ANM_SWIM_A) && field_0x30d0 == 0 && field_0x30d2 == 0) { + setDoStatus(9); + } + } + + f32 var_f31; + f32 var_f30; + if (mProcID == PROC_SWIM_HOOKSHOT_MOVE && !checkHookshotWait()) { + var_f30 = 0.0f; + } else if (checkZoraSwimMove()) { + s16 temp_r29 = shape_angle.y; + + if (mTargetedActor != NULL && current.pos.abs2XZ(mTargetedActor->eyePos) > 22500.0f) { + setShapeAngleToAtnActor(0); + } else if (checkInputOnR()) { + s16 var_r28; + if (checkEventRun()) { + var_r28 = field_0x2fe2; + } else { + var_r28 = shape_angle.y + (16384.0f * cM_ssin(mStickAngle)); + } + + cLib_addCalcAngleS(&shape_angle.y, var_r28, daAlinkHIO_swim_c0::m.mUnderwaterTurnRate, daAlinkHIO_swim_c0::m.mUnderwaterTurnMax, daAlinkHIO_swim_c0::m.mUnderwaterTurnMin); + } + + current.angle.y = shape_angle.y; + var_f30 = 3.0f * cM_scos((shape_angle.y - temp_r29)); + } else if (!checkAttentionLock()) { + if (checkInputOnR()) { + s16 temp_r29_2 = shape_angle.y; + if (checkNoResetFlg0(FLG0_SWIM_UP)) { + cLib_addCalcAngleS(&shape_angle.y, field_0x2fe2, daAlinkHIO_swim_c0::m.mTurnRate, daAlinkHIO_swim_c0::m.mTurnMax, daAlinkHIO_swim_c0::m.mTurnMin); + } else { + cLib_addCalcAngleS(&shape_angle.y, field_0x2fe2, daAlinkHIO_swim_c0::m.mUnderwaterTurnRate, daAlinkHIO_swim_c0::m.mUnderwaterTurnMax, daAlinkHIO_swim_c0::m.mUnderwaterTurnMin); + } + + f32 var_f29; + if (checkUnderMove0BckNoArc(ANM_SWIM_DASH)) { + var_f29 = 1.0f; + } else { + var_f29 = field_0x33a8; + } + + var_f30 = 3.0f * var_f29 * cM_scos((shape_angle.y - temp_r29_2)); + cLib_addCalcAngleS(¤t.angle.y, shape_angle.y, 2, 0x2000, 0x1000); + } else { + var_f30 = 0.0f; + } + + if (checkZeroSpeedF()) { + current.angle.y = shape_angle.y; + } + } else { + setShapeAngleToAtnActor(0); + + if (checkInputOnR()) { + if (getDirectionFromCurrentAngle() == DIR_BACKWARD) { + current.angle.y += 0x8000; + mNormalSpeed *= -1.0f; + } + + if (checkZeroSpeedF()) { + current.angle.y = field_0x2fe2; + } + + s16 temp_r29_3 = current.angle.y; + if (checkNoResetFlg0(FLG0_SWIM_UP)) { + cLib_addCalcAngleS(¤t.angle.y, field_0x2fe2, daAlinkHIO_swim_c0::m.mTurnRate, daAlinkHIO_swim_c0::m.mTurnMax, daAlinkHIO_swim_c0::m.mTurnMin); + } else { + cLib_addCalcAngleS(¤t.angle.y, field_0x2fe2, daAlinkHIO_swim_c0::m.mUnderwaterTurnRate, daAlinkHIO_swim_c0::m.mUnderwaterTurnMax, daAlinkHIO_swim_c0::m.mUnderwaterTurnMin); + } + + var_f30 = daAlinkHIO_swim_c0::m.mAcceleration * field_0x33a8 * cM_scos((s16)(current.angle.y - temp_r29_3)); + } else { + var_f30 = 0.0f; + } + } + + f32 var_f28; + if (daAlinkHIO_swim_c0::m.mMaxForwardSpeed < mNormalSpeed && !checkZoraWearAbility()) { + var_f28 = daAlinkHIO_swim_c0::m.mDDeceleration; + } else { + var_f28 = daAlinkHIO_swim_c0::m.mDeceleration; + } + + setNormalSpeedF(var_f30, var_f28); + + if (dComIfGp_checkPlayerStatus0(0, 0x10)) { + mNormalSpeed = 0.0f; + } + + if (checkSwimNeckUpDown()) { + s16 sp14; + if (speed.y >= 0.0f) { + var_f31 = -speed.y / daAlinkHIO_swim_c0::m.mMaxFloatUpSpeed; + if (var_f31 < -1.0f) { + var_f31 = -1.0f; + } + sp14 = 6144.0f * var_f31; + } else { + var_f31 = speed.y / maxFallSpeed; + if (var_f31 > 1.0f) { + var_f31 = 1.0f; + } + sp14 = 8192.0f * var_f31; + } + + cLib_addCalcAngleS(&field_0x30a0, sp14, 5, 0x1000, 0x400); + } else { + field_0x30a0 = 0; + } } /* 801029C8-80102B1C 0FD308 0154+00 3/3 0/0 0/0 .text checkNextActionSwim__9daAlink_cFv @@ -249,13 +371,211 @@ int daAlink_c::checkNextActionSwim() { /* 80102B1C-80103058 0FD45C 053C+00 3/3 0/0 0/0 .text checkSwimAction__9daAlink_cFi */ int daAlink_c::checkSwimAction(int param_0) { - // NONMATCHING + f32 var_f31; + if (checkWolf()) { + if (getMoveBGActorName(mLinkAcch.m_gnd, NULL) == PROC_Obj_ITA) { + var_f31 = 200.0f; + } else { + var_f31 = daAlinkHIO_wlSwim_c0::m.field_0x48; + } + } else { + var_f31 = daAlinkHIO_swim_c0::m.mInitHeight; + } + + if (checkNoResetFlg0(FLG0_UNK_80) && !checkNoResetFlg0(FLG0_UNDERWATER) && !checkModeFlg(0x40000) && mProcID != PROC_MAGNE_BOOTS_FLY && ((mProcID != PROC_WOLF_LOCK_ATTACK && mProcID != PROC_WOLF_LOCK_ATTACK_TURN) || mProcVar5.field_0x3012 == 0) && mDemo.getDemoMode() != 0x11) { + f32 var_f28; + f32 var_f29; + f32 var_f30; + + if (checkWolf()) { + if (checkWolfDashMode()) { + var_f29 = daAlinkHIO_wlSwim_c0::m.field_0x50; + } else { + var_f29 = daAlinkHIO_wlSwim_c0::m.field_0x80; + } + + var_f28 = daAlinkHIO_wlSwim_c0::m.field_0x58; + } else { + var_f29 = getSwimFrontMaxSpeed(); + var_f28 = getSwimMaxFallSpeed(); + } + + if (dComIfGp_checkPlayerStatus1(0, 0x10000)) { + var_f30 = mLeftFootPos.y; + } else if (dComIfGp_checkPlayerStatus1(0, 0x2000000)) { + var_f30 = (-65.0f + current.pos.y) - var_f31; + } else { + var_f30 = current.pos.y; + } + + if (mWaterY - var_f30 > var_f31 || (param_0 != 0 && mWaterY >= var_f30 && mWaterY - mLinkAcch.GetGroundH() > var_f31)) { + cXyz sp14; + offNoResetFlg0(FLG0_SWIM_UP); + mZ2Link.setInWater(true); + + field_0x594 = var_f29; + + if (!param_0) { + mNormalSpeed *= 0.75f; + } + + if (mNormalSpeed >= field_0x594) { + mNormalSpeed = field_0x594; + } + + swimDeleteItem(); + + if (checkEquipAnime()) { + resetUpperAnime(UPPER_2, 3.0f); + } + + field_0x3080 = 0; + + if (param_0) { + if (current.pos.y - mWaterY > -5.0f) { + onNoResetFlg0(FLG0_SWIM_UP); + mZ2Link.setInWater(false); + return 0; + } + return 1; + } + + if (checkModeFlg(2) && !checkPossibleWaterInMode()) { + dComIfGp_getVibration().StartShock(2, 1, cXyz(0.0f, 1.0f, 0.0f)); + current.pos.y = var_f30 + var_f31; + + speed.y = 0.75f * field_0x3528.y; + if (speed.y < var_f28) { + speed.y = var_f28; + } else if (speed.y > 0.0f) { + speed.y = 0.0f; + } + + if (checkWolf()) { + if (checkNoResetFlg2(FLG2_UNK_8)) { + daAlink_WANM var_r29; + if (cM_rnd() < 0.5f) { + var_r29 = WANM_FLING_LEFT; + onNoResetFlg2(FLG2_WOLF_ENEMY_LEFT_THROW); + } else { + var_r29 = WANM_FLING_RIGHT; + offNoResetFlg2(FLG2_WOLF_ENEMY_LEFT_THROW); + } + setWolfEnemyThrowUpperAnime(var_r29, 0.0f); + } + + return procWolfSwimWaitInit(1); + } + + if (mProcID == PROC_DIVE_JUMP) { + seStartOnlyReverb(Z2SE_AL_JUMP_DIVE_WATER); + + if (checkZoraWearAbility()) { + field_0x3000 = 30; + } + return procSwimMoveInit(); + } + + return procSwimWaitInit(1); + } + + if (checkBootsOrArmorHeavy() || checkPossibleWaterInMode()) { + onNoResetFlg0(FLG0_UNDERWATER); + return 0; + } + + if (checkWolf()) { + return procWolfSwimUpInit(); + } + + return procSwimUpInit(); + } + } else if (!checkNoResetFlg0(FLG0_SWIM_UP) && !checkBootsOrArmorHeavy() && !checkPossibleWaterInMode() && !checkModeFlg(0x40000)) { + if (checkNoResetFlg0(FLG0_UNK_80) && mWaterY - current.pos.y > var_f31) { + if (checkWolf()) { + return procWolfSwimWaitInit(0); + } + + return procSwimWaitInit(0); + } + + swimOutAfter(0); + + if (checkWolf()) { + return procWolfWaitInit(); + } + + return procWaitInit(); + } else if (checkModeFlg(0x40000) && mProcID != PROC_CAUGHT && mProcID != PROC_DEAD) { + return checkSwimOutAction(); + } + return 0; } /* 80103058-801032C8 0FD998 0270+00 7/7 0/0 0/0 .text checkSwimUpAction__9daAlink_cFv */ int daAlink_c::checkSwimUpAction() { - // NONMATCHING + if (checkNoResetFlg0(FLG0_SWIM_UP)) { + if (!checkHookshotAnime()) { + return checkSubjectAction(); + } + return 0; + } + + if (!getZoraSwim()) { + if (checkWolf()) { + field_0x3480 = daAlinkHIO_wlSwim_c0::m.field_0x48; + } else { + cLib_addCalc(&field_0x3480, daAlinkHIO_swim_c0::m.mInitHeight, 0.5f, 15.0f, 1.0f); + } + } else { + field_0x3480 = 65.0f; + } + + f32 var_f31; + if (checkWolf()) { + var_f31 = daAlinkHIO_wlSwim_c0::m.field_0x4C; + } else { + var_f31 = daAlinkHIO_swim_c0::m.mResurfaceHeight; + } + + if (!checkBootsOrArmorHeavy() && !checkNoResetFlg0(FLG0_SWIM_UP)) { + if (speed.y >= 0.0f && mWaterY - current.pos.y < var_f31) { + if (checkWolf()) { + return procWolfSwimUpInit(); + } else { + return procSwimUpInit(); + } + } + } + + if (current.pos.y - field_0x3480 < mLinkAcch.GetGroundH()) { + if (!checkBootsOrArmorHeavy()) { + current.pos.y = field_0x3480 + mLinkAcch.GetGroundH(); + field_0x3798.y = current.pos.y; + mProcVar3.field_0x300e = getGroundAngle(&mLinkAcch.m_gnd, shape_angle.y); + mProcVar4.field_0x3010 = 2; + + if (speed.y < -1.0f) { + speed.y = -1.0f; + } + } else { + current.pos.y = mLinkAcch.GetGroundH(); + mLinkAcch.SetGroundHit(); + onNoResetFlg0(FLG0_UNDERWATER); + procLandInit(0.0f); + field_0x2f99 = 0x90; + return 1; + } + } else if (mLinkAcch.ChkRoofHit()) { + mProcVar3.field_0x300e = getRoofAngle(&mLinkAcch.m_roof, shape_angle.y); + mProcVar4.field_0x3010 = 2; + + if (speed.y > 1.0f) { + speed.y = 1.0f; + } + } + return 0; } @@ -282,7 +602,7 @@ void daAlink_c::swimOutAfter(int param_0) { } /* 80103398-801033CC 0FDCD8 0034+00 1/1 0/0 0/0 .text checkSwimFall__9daAlink_cFv */ -bool daAlink_c::checkSwimFall() { +BOOL daAlink_c::checkSwimFall() { if (!checkNoResetFlg0(FLG0_UNK_80) || current.pos.y > mWaterY + l_autoUpHeight) { return true; } @@ -291,13 +611,271 @@ bool daAlink_c::checkSwimFall() { } /* 801033CC-80103698 0FDD0C 02CC+00 1/1 0/0 0/0 .text checkSwimOutAction__9daAlink_cFv */ -void daAlink_c::checkSwimOutAction() { - // NONMATCHING +int daAlink_c::checkSwimOutAction() { + f32 var_f31; + if (checkWolf()) { + var_f31 = daAlinkHIO_wlSwim_c0::m.field_0x48; + } else { + var_f31 = daAlinkHIO_swim_c0::m.mInitHeight; + } + + if (checkSwimFall()) { + swimOutAfter(1); + + cXyz sp8(field_0x3594.x + (mNormalSpeed * cM_ssin(current.angle.y)), 0.0f, field_0x3594.z + (mNormalSpeed * cM_scos(current.angle.y))); + mNormalSpeed = sp8.absXZ(); + current.angle.y = sp8.atan2sX_Z(); + + if (checkWolf()) { + if (mNormalSpeed > daAlinkHIO_wlAutoJump_c0::m.field_0x74) { + mNormalSpeed = daAlinkHIO_wlAutoJump_c0::m.field_0x74; + } + return procWolfFallInit(2, daAlinkHIO_wlAutoJump_c0::m.field_0x54); + } else { + if (mNormalSpeed > daAlinkHIO_autoJump_c0::m.mMaxJumpSpeed) { + mNormalSpeed = daAlinkHIO_autoJump_c0::m.mMaxJumpSpeed; + } + return procFallInit(2, daAlinkHIO_autoJump_c0::m.mFallInterpolation); + } + } + + if (!checkNoResetFlg0(FLG0_UNK_80) || mWaterY - mLinkAcch.GetGroundH() <= var_f31 - 5.0f) { + current.pos.y = mWaterY; + swimOutAfter(1); + return commonCheckNextAction(0); + } + + if (checkMagicArmorHeavy() && checkNoResetFlg0(FLG0_SWIM_UP)) { + offNoResetFlg0(FLG0_SWIM_UP); + mZ2Link.setInWater(true); + } + + return 0; } /* 80103698-80103EE0 0FDFD8 0848+00 4/4 0/0 0/0 .text setSwimMoveAnime__9daAlink_cFv */ void daAlink_c::setSwimMoveAnime() { - // NONMATCHING + daPy_frameCtrl_c* temp_r28 = &mUnderFrameCtrl[0]; + daPy_frameCtrl_c* temp_r27 = &mUpperFrameCtrl[2]; + + f32 var_f31; + f32 temp_f25 = temp_r28->getEnd(); + f32 var_f26 = temp_r28->getFrame() * temp_f25; + + if (field_0x3000 != 0 && !checkHookshotAnime()) { + field_0x2f98 = 4; + } else if (checkHookshotAnime() || (checkAttentionLock() && !getZoraSwim())) { + field_0x3000 = 0; + if (checkInputOnR()) { + field_0x2f98 = getDirectionFromShapeAngle(); + } else if (field_0x2f98 >= 4 || mNormalSpeed < 3.0f) { + field_0x2f98 = 0; + } + } else if (checkInputOnR() || field_0x2f98 >= 4 || mNormalSpeed < 3.0f) { + field_0x2f98 = 0; + } + + daAlink_ANM var_r29; + BOOL var_r26 = 1; + BOOL var_r25 = 0; + + if (field_0x2f98 == 4) { + f32 temp_f29 = daAlinkHIO_swim_c0::m.mMaxUnderwaterSpeed + daAlinkHIO_swim_c0::m.mUnderwaterButtonSpeed; + + field_0x3478 = daAlinkHIO_swim_c0::m.mUnderwaterMinAnmSpeed; + field_0x347c = daAlinkHIO_swim_c0::m.mUnderwaterMaxAnmSpeed; + + if (field_0x594 < daAlinkHIO_swim_c0::m.mMaxUnderwaterSpeed) { + field_0x594 = daAlinkHIO_swim_c0::m.mMaxUnderwaterSpeed; + } else if (doTrigger()) { + field_0x594 += 0.75f; + if (field_0x594 > temp_f29) { + field_0x594 = temp_f29; + } + + if (!checkSwimMoveHandAnime() && !checkZoraSwimDamageAnime()) { + f32 var_f28; + if (field_0x2060->getOldFrameMorfCounter() > 5.0f) { + var_f28 = -1.0f; + } else { + var_f28 = 3.0f; + } + + setUpperAnime(0x23F, UPPER_2, 1.0f, 0.0f, 0x28, var_f28); + mProcVar5.field_0x3012 = 0; + var_r25 = 1; + } else if (temp_r27->getFrame() > 25.0f) { + mProcVar5.field_0x3012 = 1; + } + } else if (!checkSwimMoveHandAnime()) { + cLib_chaseF(&field_0x594, daAlinkHIO_swim_c0::m.mMaxUnderwaterSpeed, 0.4f); + } + + var_f31 = 1.0f / daAlinkHIO_swim_c0::m.mMaxUnderwaterSpeed; + + if (checkZoraWearAbility() && (field_0x3198 == ANM_SWIM_DIVE || (field_0x3198 == ANM_SWIM_ZORA_START && !checkAnmEnd(temp_r28)))) { + var_r29 = ANM_SWIM_ZORA_START; + } else { + var_r29 = ANM_SWIM_C; + + if (field_0x3198 == ANM_SWIM_ZORA_START) { + var_r26 = 0; + if (mProcVar4.field_0x3010 == 1) { + mProcVar4.field_0x3010 = 0; + } + } + } + } else if (field_0x2f98 == 0) { + if (checkSwimDashMode() && checkUnderMove0BckNoArc(ANM_SWIM_DASH) && !checkAnmEnd(temp_r28)) { + var_r29 = ANM_SWIM_DASH; + } else if (mNormalSpeed < 3.0f || checkHookshotAnime()) { + var_r29 = ANM_SWIM_WAIT; + field_0x30d0 = 0; + } else { + var_r29 = ANM_SWIM_A; + } + + if (checkSwimDashMode()) { + field_0x3478 = daAlinkHIO_swim_c0::m.mDMinAnmSpeed; + field_0x347c = daAlinkHIO_swim_c0::m.mDMaxAnmSpeed; + field_0x594 = daAlinkHIO_swim_c0::m.mDMaxSpeed; + } else { + field_0x3478 = daAlinkHIO_swim_c0::m.mForwardMinAnmSpeed; + field_0x347c = daAlinkHIO_swim_c0::m.mForwardMaxAnmSpeed; + field_0x594 = getSwimFrontMaxSpeed(); + } + + var_f31 = 1.0f / field_0x594; + } else if (field_0x2f98 == 1) { + var_r29 = ANM_ATN_SWIM_BACK; + field_0x3478 = daAlinkHIO_swim_c0::m.mBackwardMinAnmSpeed; + field_0x347c = daAlinkHIO_swim_c0::m.mBackwardMaxAnmSpeed; + + if (checkZoraWearAbility()) { + field_0x594 = 10.0f; + } else { + field_0x594 = daAlinkHIO_swim_c0::m.mMaxBackwardSpeed; + } + + var_f31 = 1.0f / field_0x594; + } else { + if (field_0x2f98 == 2) { + var_r29 = ANM_ATN_SWIM_LEFT; + } else { + var_r29 = ANM_ATN_SWIM_RIGHT; + } + + field_0x3478 = daAlinkHIO_swim_c0::m.mStrafeMinAnmSpeed; + field_0x347c = daAlinkHIO_swim_c0::m.mStrafeMaxAnmSpeed; + + if (checkZoraWearAbility()) { + field_0x594 = 12.0f; + } else { + field_0x594 = daAlinkHIO_swim_c0::m.mMaxStrafeSpeed; + } + + var_f31 = 1.0f / field_0x594; + } + + field_0x347c -= field_0x3478; + + if (field_0x2f98 != 0) { + field_0x30d0 = 0; + } + + if (checkBootsOrArmorHeavy()) { + var_r29 = ANM_SWIM_WAIT; + field_0x594 = daAlinkHIO_swim_c0::m.mUnderwaterMaxSinkSpeed; + if (mEquipItem != NO_ITEM && !checkHookshotAnime()) { + setDoStatus(4); + } + } + + if (var_r29 != field_0x3198) { + if (field_0x3198 == ANM_SWIM_ZORA_START) { + speed.y = 0.0f; + } + + field_0x3198 = var_r29; + + if (checkUnderMove0BckNoArc(ANM_SWIM_DASH)) { + field_0x30d2 = daAlinkHIO_swim_c0::m.field_0x5e; + } + + if (var_r29 == ANM_SWIM_WAIT) { + setSingleAnimeBaseSpeed(ANM_SWIM_WAIT, daAlinkHIO_swim_c0::m.mWaitAnmSpeed, daAlinkHIO_swim_c0::m.mWaitInterpolation); + } else { + f32 var_f27; + if (var_r26 != 0) { + var_f27 = daAlinkHIO_swim_c0::m.mMoveInterpolation; + } else { + var_f27 = 0.0f; + } + setSingleAnimeBaseMorf(var_r29, var_f27); + } + } + + if (var_r29 != ANM_SWIM_WAIT && var_r29 != ANM_SWIM_DASH) { + f32 temp_f30 = var_f31 * fabsf(mNormalSpeed); + if (temp_f30 > 1.0f && field_0x2f98 == 4) { + temp_r28->setRate(daAlinkHIO_swim_c0::m.mUnderwaterMaxAnmSpeed + ((temp_f30 - 1.0f) * daAlinkHIO_swim_c0::m.mUnderwaterButtonAnmSpeed)); + } else { + temp_r28->setRate(field_0x3478 + (field_0x347c * temp_f30)); + } + } + + if (checkSwimMoveHandAnime()) { + if (temp_r27->checkPass(17.0f)) { + seStartOnlyReverb(Z2SE_AL_WATER_STROKE_L); + } + + if (var_r29 == ANM_SWIM_C) { + temp_r27->setRate(temp_r28->getRate()); + + if (var_r25 == 0 && temp_r27->checkPass(0.0f)) { + if (mProcVar5.field_0x3012 != 0) { + mProcVar5.field_0x3012 = 0; + } else { + resetUpperAnime(UPPER_2, 3.0f); + } + } + } else { + resetUpperAnime(UPPER_2, -1.0f); + } + } + + maxFallSpeed = getSwimMaxFallSpeed(); + + if (var_r29 == ANM_SWIM_C || var_r29 == ANM_SWIM_ZORA_START) { + if (!checkZoraWearAbility()) { + if (field_0x3080 != -0x3800) { + setOldRootQuaternion(0x4000, 0, 0); + } + field_0x3080 = -0x3800; + } else if (mProcVar4.field_0x3010 == 1) { + cLib_addCalcAngleS(&field_0x3080, mProcVar3.field_0x300e, 5, 0x1000, 0x100); + } else if (mProcVar4.field_0x3010 == 2) { + cLib_addCalcAngleS(&field_0x3080, mProcVar3.field_0x300e, 5, 0x1000, 0x100); + mProcVar4.field_0x3010 = 0; + } else { + s16 var_r24; + if (checkInputOnR() && !checkEventRun()) { + var_r24 = 13653.0f * cM_scos(mStickAngle); + } else { + var_r24 = 0; + } + + cLib_addCalcAngleS(&field_0x3080, var_r24, 5, 0x200, 0x80); + } + } else if (field_0x3080 != 0) { + setOldRootQuaternion(field_0x3080, 0, 0); + field_0x3080 = 0; + mProcVar4.field_0x3010 = 0; + + if (!checkZoraWearAbility()) { + mNormalSpeed = 0.0f; + } + } } /* 80103EE0-80103F08 0FE820 0028+00 5/5 0/0 0/0 .text checkSwimButtonAccept__9daAlink_cFv @@ -580,7 +1158,7 @@ int daAlink_c::procSwimMove() { onNoResetFlg1(FLG1_DASH_MODE); field_0x30d0 = daAlinkHIO_swim_c0::m.field_0x5c; setSingleAnimeParam(ANM_SWIM_DASH, &daAlinkHIO_swim_c0::m.mDashAnm); - field_0x3198 = 0xC6; + field_0x3198 = ANM_SWIM_DASH; } else if (!checkZoraSwimMove() && (!checkUpSwimButtonAccept() || !doButton()) && mNormalSpeed < daAlinkHIO_swim_c0::m.mForwardMinSpeed) { @@ -836,7 +1414,7 @@ int daAlink_c::procSwimHookshotMove() { /* 8010519C-80105728 0FFADC 058C+00 1/1 0/0 0/0 .text * procSwimDamageInit__9daAlink_cFP12dCcD_GObjInf */ -// NONMATCHING - instruction block order issue +// NONMATCHING - cLib_minMaxLimit regalloc issue int daAlink_c::procSwimDamageInit(dCcD_GObjInf* param_0) { seStartOnlyReverb(Z2SE_AL_DAMAGE_NORMAL); dComIfGp_getVibration().StartShock(2, 31, cXyz(0.0f, 1.0f, 0.0f)); @@ -909,7 +1487,7 @@ int daAlink_c::procSwimDamageInit(dCcD_GObjInf* param_0) { } mNormalSpeed = 0.0f; - field_0x347c = 3.141593f / (mUnderFrameCtrl->getEnd() - mUnderFrameCtrl->getStart()); + field_0x347c = M_PI / (mUnderFrameCtrl->getEnd() - mUnderFrameCtrl->getStart()); field_0x3480 = daAlinkHIO_swim_c0::m.mInitHeight; current.angle.y = shape_angle.y; diff --git a/src/d/actor/d_a_alink_whistle.inc b/src/d/actor/d_a_alink_whistle.inc index 798d00ff954..3009a8a3532 100644 --- a/src/d/actor/d_a_alink_whistle.inc +++ b/src/d/actor/d_a_alink_whistle.inc @@ -6,6 +6,7 @@ #include "d/actor/d_a_alink.h" #include "d/d_com_inf_game.h" #include "d/d_procname.h" +#include "d/actor/d_a_horse.h" #include "d/actor/d_a_npc_tk.h" #include "d/actor/d_a_obj_yobikusa.h" @@ -229,9 +230,9 @@ int daAlink_c::procGrassWhistleWait() { mProcVar5.field_0x3012 = 1; return 1; } - - setGrassCancelStatus(0); } + + setGrassCancelStatus(0); } else if (checkAnmEnd(&mUpperFrameCtrl[2])) { setGrassCancelStatus(0x12); setDoStatus(0x2C); @@ -296,8 +297,29 @@ int daAlink_c::procCoHorseCallWaitInit(int param_0) { /* 801120C8-801121B4 10CA08 00EC+00 1/0 0/0 0/0 .text procCoHorseCallWait__9daAlink_cFv */ int daAlink_c::procCoHorseCallWait() { - // NONMATCHING - return 0; + setGrassCancelStatus(0); + + mProcVar4.field_0x3010--; + if (mProcVar4.field_0x3010 > 2 && dComIfGp_getHorseActor() != NULL) { + cLib_addCalcAngleS(&shape_angle.y, fopAcM_searchActorAngleY(this, dComIfGp_getHorseActor()), 2, 0x2000, 0x800); + current.angle.y = shape_angle.y; + } + + if (mProcVar4.field_0x3010 == 60) { + dCam_getBody()->EventFlag(2); + } else if (mProcVar4.field_0x3010 == 15) { + dCam_getBody()->EventFlag(3); + } else if (mProcVar4.field_0x3010 == 0) { + resetSpecialEvent(); + + if (checkWolf()) { + procWolfWaitInit(); + } else { + procWaitInit(); + } + } + + return 1; } /* 801121B4-80112220 10CAF4 006C+00 1/0 0/0 0/0 .text procHawkCatchInit__9daAlink_cFv */ @@ -343,6 +365,35 @@ int daAlink_c::procHawkSubjectInit() { /* 80112304-8011243C 10CC44 0138+00 1/0 0/0 0/0 .text procHawkSubject__9daAlink_cFv */ int daAlink_c::procHawkSubject() { - // NONMATCHING - return 0; + if (mProcVar2.field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { + mProcVar2.field_0x300c--; + if (mProcVar2.field_0x300c == 0) { + checkWaitAction(); + } + } + } else if (checkEventRun()) { + dComIfGp_evmng_cutEnd(field_0x3184); + } else { + fopAc_ac_c* temp_r29 = field_0x280c.getActor(); + setGrassCancelStatus(0x12); + setDoStatus(0x31); + + if (doTrigger()) { + mProcVar2.field_0x300c = 2; + if (temp_r29 != NULL) { + ((daNPC_TK_c*)temp_r29)->setAttack(); + field_0x280c.clearData(); + } + } else if (grassCancelTrigger()) { + return checkWaitAction(); + } else if (setBodyAngleToCamera()) { + cXyz sp8; + checkSightLine(10000.0f, &sp8); + mSight.setPos(&sp8); + mSight.onDrawFlg(); + } + } + + return 1; } diff --git a/src/d/actor/d_a_alink_wolf.inc b/src/d/actor/d_a_alink_wolf.inc index 0ebcf330565..1ac02273a9d 100644 --- a/src/d/actor/d_a_alink_wolf.inc +++ b/src/d/actor/d_a_alink_wolf.inc @@ -5,16 +5,14 @@ #include "JSystem/J3DGraphBase/J3DMaterial.h" #include "d/actor/d_a_alink.h" -#include "d/d_com_inf_game.h" -#include "d/d_msg_object.h" -#include "f_op/f_op_kankyo_mng.h" -#include "m_Do/m_Do_controller_pad.h" -#include "d/actor/d_a_horse.h" -#include "d/actor/d_a_kago.h" #include "d/actor/d_a_e_pm.h" #include "d/actor/d_a_e_yc.h" +#include "d/actor/d_a_e_ymb.h" +#include "d/actor/d_a_horse.h" +#include "d/actor/d_a_kago.h" #include "d/actor/d_a_kytag03.h" #include "d/actor/d_a_npc_gwolf.h" +#include "d/actor/d_a_npc_moi.h" #include "d/actor/d_a_npc_tk.h" #include "d/actor/d_a_obj_crope.h" #include "d/actor/d_a_obj_smw_stone.h" @@ -24,7 +22,14 @@ #include "d/actor/d_a_tag_howl.h" #include "d/actor/d_a_tag_wara_howl.h" #include "d/actor/d_a_tag_wljump.h" -#include "d/actor/d_a_e_ymb.h" +#include "d/actor/d_a_obj_lv4digsand.h" +#include "d/actor/d_a_obj_digplace.h" +#include "d/actor/d_a_obj_digsnow.h" +#include "d/actor/d_a_obj_digholl.h" +#include "d/d_com_inf_game.h" +#include "d/d_msg_object.h" +#include "f_op/f_op_kankyo_mng.h" +#include "m_Do/m_Do_controller_pad.h" /* 80126740-80126928 121080 01E8+00 2/2 0/0 0/0 .text changeCommon__9daAlink_cFv */ void daAlink_c::changeCommon() { @@ -102,31 +107,25 @@ void daAlink_c::changeCommon() { field_0x2fc3 = 10; } - /* 80126928-80126F3C 121268 0614+00 2/2 0/0 0/0 .text changeWolf__9daAlink_cFv */ // NONMATCHING - small regalloc, equivalent? void daAlink_c::changeWolf() { JKRHeap* current_heap = mAnmHeap3.setAnimeHeap(); - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 14); - mpLinkModel = initModel(modelData, 0x80000, 0x20200); + mpLinkModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 14), 0x80000, 0x20200); J3DModelData* chainModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 15); for (u16 i = 0; i < 4; i++) { mpWlChainModels[i] = initModel(chainModelData, 0x80000, 0); } - J3DModelData* midnaModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 10); - mpWlMidnaModel = initModel(midnaModelData, 0, 0x1020200); - - J3DModelData* midnaMaskModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 7); - mpWlMidnaMaskModel = initModel(midnaMaskModelData, 0x80000, 0x1000000); - - J3DModelData* midnaHandModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 6); - mpWlMidnaHandModel = initModel(midnaHandModelData, 0x80000, 0x1000000); - - J3DModelData* midnaHairModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 11); - mpWlMidnaHairModel = initModel(midnaHairModelData, 0, 0x1000000); + mpWlMidnaModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 10), 0, 0x1020200); + mpWlMidnaMaskModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 7), 0x80000, 0x1000000); + mpWlMidnaHandModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 6), 0x80000, 0x1000000); + mpWlMidnaHairModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_wArcName, 11), 0, 0x1000000); mpDMidnaBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_wArcName, 18); mpDMidnaBrk->searchUpdateMaterialID(mpWlMidnaModel->getModelData()); @@ -254,49 +253,31 @@ void daAlink_c::changeLink(int param_0) { offNoResetFlg2(FLG2_UNK_200000); onNoResetFlg2(FLG2_UNK_80000); - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("alSumou", 0x31); - mpLinkModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); - - J3DModelData* headModelData = (J3DModelData*)dComIfG_getObjectRes("alSumou", 0x33); - mpLinkHatModel = initModel(headModelData, 0); - - J3DModelData* handModelData = (J3DModelData*)dComIfG_getObjectRes("alSumou", 0x32); - mpLinkHandModel = initModel(handModelData, 0); + mpLinkModel = mDoExt_J3DModel__create((J3DModelData*)dComIfG_getObjectRes("alSumou", 0x31), + 0x80000, 0x11000084); + mpLinkHatModel = initModel((J3DModelData*)dComIfG_getObjectRes("alSumou", 0x33), 0); + mpLinkHandModel = initModel((J3DModelData*)dComIfG_getObjectRes("alSumou", 0x32), 0); } else if (checkCasualWearFlg()) { onNoResetFlg2(FLG2_UNK_100000); - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl.bmd"); - mpLinkModel = initModel(modelData, 0); - - J3DModelData* headModelData = - (J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl_head.bmd"); - mpLinkHatModel = initModel(headModelData, 0); - - J3DModelData* handModelData = - (J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl_hands.bmd"); - mpLinkHandModel = initModel(handModelData, 0); + mpLinkModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl.bmd"), 0); + mpLinkHatModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl_head.bmd"), 0); + mpLinkHandModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl_hands.bmd"), 0); } else if (checkZoraWearFlg()) { - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_zArcName, "zl.bmd"); - mpLinkModel = initModel(modelData, 0); - - J3DModelData* headModelData = - (J3DModelData*)dComIfG_getObjectRes(l_zArcName, "zl_head.bmd"); - mpLinkHatModel = initModel(headModelData, 0); - - J3DModelData* handModelData = - (J3DModelData*)dComIfG_getObjectRes(l_zArcName, "al_hands.bmd"); - mpLinkHandModel = initModel(handModelData, 0); + mpLinkModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_zArcName, "zl.bmd"), 0); + mpLinkHatModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_zArcName, "zl_head.bmd"), 0); + mpLinkHandModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_zArcName, "al_hands.bmd"), 0); } else if (checkMagicArmorWearFlg()) { - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_mArcName, "ml.bmd"); - mpLinkModel = initModel(modelData, 0x1000000); - - J3DModelData* headModelData = - (J3DModelData*)dComIfG_getObjectRes(l_mArcName, "ml_head.bmd"); - mpLinkHatModel = initModel(headModelData, 0x1000000); - - J3DModelData* handModelData = - (J3DModelData*)dComIfG_getObjectRes(l_mArcName, "al_hands.bmd"); - mpLinkHandModel = initModel(handModelData, 0); + mpLinkModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_mArcName, "ml.bmd"), 0x1000000); + mpLinkHatModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_mArcName, "ml_head.bmd"), 0x1000000); + mpLinkHandModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_mArcName, "al_hands.bmd"), 0); if (dComIfGs_getRupee() != 0) { setMagicArmorBrk(1); @@ -307,24 +288,19 @@ void daAlink_c::changeLink(int param_0) { mMagicArmorBodyBrk->setFrame(mMagicArmorBodyBrk->getFrameMax()); mMagicArmorHeadBrk->setFrame(mMagicArmorHeadBrk->getFrameMax()); } else { - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al.bmd"); - mpLinkModel = initModel(modelData, 0); - - J3DModelData* headModelData = - (J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al_head.bmd"); - mpLinkHatModel = initModel(headModelData, 0); - - J3DModelData* handModelData = - (J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al_hands.bmd"); - mpLinkHandModel = initModel(handModelData, 0); + mpLinkModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al.bmd"), 0); + mpLinkHatModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al_head.bmd"), 0); + mpLinkHandModel = + initModel((J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al_hands.bmd"), 0); } if (checkNoResetFlg2(FLG2_UNK_200000) || !checkZoraWearFlg()) { - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(mArcName, "al_face.bmd"); - mpLinkFaceModel = initModel(modelData, 0x20200); + mpLinkFaceModel = + initModel((J3DModelData*)dComIfG_getObjectRes(mArcName, "al_face.bmd"), 0x20200); } else { - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(mArcName, "zl_face.bmd"); - mpLinkFaceModel = initModel(modelData, 0x20200); + mpLinkFaceModel = + initModel((J3DModelData*)dComIfG_getObjectRes(mArcName, "zl_face.bmd"), 0x20200); } J3DModelData* bootsModelData = (J3DModelData*)dComIfG_getObjectRes(mArcName, "al_bootsH.bmd"); @@ -579,8 +555,31 @@ BOOL daAlink_c::checkWolfSideStep() const { } /* 80127E08-80127F20 122748 0118+00 1/1 0/0 0/0 .text setWolfTailAngle__9daAlink_cFv */ +// NONMATCHING - cLib_minMaxLimit regalloc void daAlink_c::setWolfTailAngle() { - // NONMATCHING + s16* var_r30 = field_0x3094; + s16* var_r29 = field_0x309a; + + s16 var_r27 = (s16)(shape_angle.y - field_0x2fe6); + + for (int i = 0; i < 3; i++) { + if (checkEndResetFlg0(ERFLG0_UNK_800000)) { + *var_r30 = 0; + *var_r29 = 0; + } else { + *var_r30 -= var_r27; + s16 sp38 = *var_r30; + + cLib_addCalcAngleS(var_r30, 0, 5, 500, 50); + *var_r30 = cLib_minMaxLimit((s16)(*var_r30 + *var_r29), -0x1000, 0x1000); + + var_r27 = (s16)(*var_r30 - sp38); + *var_r29 = var_r27 * 0.5f; + } + + var_r30++; + var_r29++; + } } /* 80127F20-80127F50 122860 0030+00 5/5 0/0 0/0 .text checkWolfSlowDash__9daAlink_cFv */ @@ -722,21 +721,104 @@ void daAlink_c::setSpeedAndAngleWolf() { setNormalSpeedF(var_f31, var_f29); } - /* 80128478-80128798 122DB8 0320+00 2/2 0/0 0/0 .text setSpeedAndAngleWolfAtn__9daAlink_cFv */ void daAlink_c::setSpeedAndAngleWolfAtn() { - // NONMATCHING + f32 var_f31; + f32 var_f30; + f32 var_f29; + if (field_0x2f98 == 1) { + var_f30 = daAlinkHIO_wlAtnMove_c0::m.field_0x30; + var_f29 = daAlinkHIO_wlAtnMove_c0::m.field_0x34; + } else { + var_f30 = daAlinkHIO_wlAtnMove_c0::m.field_0x1C; + var_f29 = daAlinkHIO_wlAtnMove_c0::m.field_0x20; + } + + s16 var_r29; + if (checkFmChainGrabAnime()) { + var_r29 = 1000; + } else { + var_r29 = daAlinkHIO_wlAtnMove_c0::m.field_0x0; + } + + s16 var_r27; + if (checkUnderMove0BckNoArcWolf(WANM_CHAIN_PULL_END)) { + var_r27 = getChainStickAngleY(field_0x2fe4); + } else { + var_r27 = field_0x2fe2; + } + + if (checkInputOnR()) { + if (getDirectionFromCurrentAngle() == DIR_BACKWARD && + (field_0x2f98 == 0 || field_0x2f98 == 1)) + { + current.angle.y += 0x8000; + mNormalSpeed *= -1.0f; + + if (checkWolfAtnMoveBack((s16)(current.angle.y - shape_angle.y))) { + field_0x2f98 = 1; + } else { + field_0x2f98 = 0; + } + } + + s16 temp_r28 = current.angle.y; + cLib_addCalcAngleS(¤t.angle.y, var_r27, daAlinkHIO_wlAtnMove_c0::m.field_0x4, var_r29, + daAlinkHIO_wlAtnMove_c0::m.field_0x2); + + if (wolfSideBgCheck(temp_r28)) { + current.angle.y = temp_r28; + onEndResetFlg1(ERFLG1_UNK_200000); + } + + var_f31 = var_f30 * field_0x33a8 * cM_scos((s16)(current.angle.y - temp_r28)); + } else { + if (checkZeroSpeedF()) { + if (!setShapeAngleToAtnActor(0) && !checkEventRun() && !checkInputOnR() && + (mProcID == PROC_WOLF_WAIT || mProcID == PROC_WOLF_ROLL_ATTACK_MOVE || + mProcID == PROC_WOLF_ATN_AC_MOVE)) + { + cLib_addCalcAngleS(&shape_angle.y, field_0x2fe4, 2, 0x2000, 0x800); + } + + if (field_0x2f98 == 1) { + current.angle.y = shape_angle.y + 0x8000; + } else { + current.angle.y = shape_angle.y; + } + } + + var_f31 = 0.0f; + } + + if (!checkWolfShapeReverse()) { + s16 var_r26; + if (field_0x2f98 == 1 || (checkEndResetFlg1(ERFLG1_UNK_200000) && + cLib_distanceAngleS(shape_angle.y, current.angle.y) > 0x4000)) + { + var_r26 = current.angle.y + 0x8000; + } else { + var_r26 = current.angle.y; + } + + cLib_addCalcAngleS(&shape_angle.y, var_r26, daAlinkHIO_wlAtnMove_c0::m.field_0x4, + var_r29 * 2, daAlinkHIO_wlAtnMove_c0::m.field_0x2 * 2); + } + + setNormalSpeedF(var_f31, var_f29); } /* 80128798-8012880C 1230D8 0074+00 4/4 0/0 0/0 .text checkWolfAtnWait__9daAlink_cFv */ BOOL daAlink_c::checkWolfAtnWait() { - // NONMATCHING -} + if ((checkEnemyGroup(mTargetedActor) || mDemo.getDemoMode() == 0x17) || + (mTargetedActor != NULL && fopAcM_GetName(mTargetedActor) == PROC_NPC_MOI && + ((daNpc_Moi_c*)mTargetedActor)->chkSFight())) + { + return true; + } -/* void daAlink_c::checkWolfAtnWait() { - return checkEnemyGroup(mTargetedActor) && mDemo.getDemoMode() == 0x17 || mTargetedActor != NULL -|| fopAcM_GetName(mTargetedActor) == 0x262 || -} */ + return false; +} /* 8012880C-80128844 12314C 0038+00 27/27 0/0 0/0 .text * checkUnderMove0BckNoArcWolf__9daAlink_cCFQ29daAlink_c12daAlink_WANM */ @@ -747,38 +829,417 @@ BOOL daAlink_c::checkUnderMove0BckNoArcWolf(daAlink_c::daAlink_WANM anm_id) cons /* 80128844-80128F0C 123184 06C8+00 11/11 0/0 0/0 .text setBlendWolfMoveAnime__9daAlink_cFf */ void daAlink_c::setBlendWolfMoveAnime(f32 param_0) { - // NONMATCHING + f32 sp8; + if (field_0x3174 == 8) { + sp8 = 1.0f; + } else { + sp8 = cM_scos(field_0x2ff0); + } + + f32 var_f31; + f32 temp_f30 = fabsf(mNormalSpeed * sp8) / field_0x594; + + daPy_frameCtrl_c* sp38 = &mUnderFrameCtrl[0]; + daPy_frameCtrl_c* temp_r28 = &mUnderFrameCtrl[1]; + + f32 sp34, sp30, sp2C, sp28, sp24, sp20, sp1C, sp18, sp14, sp10; + if (checkWolfDashMode()) { + sp20 = daAlinkHIO_wlMove_c0::m.field_0x88; + sp14 = daAlinkHIO_wlMove_c0::m.field_0x98; + sp1C = daAlinkHIO_wlMove_c0::m.field_0x84; + sp18 = daAlinkHIO_wlMove_c0::m.field_0x8C; + sp34 = daAlinkHIO_wlMove_c0::m.field_0x70; + sp30 = daAlinkHIO_wlMove_c0::m.field_0x74; + sp2C = daAlinkHIO_wlMove_c0::m.field_0x78; + sp28 = daAlinkHIO_wlMove_c0::m.field_0x7C; + sp24 = daAlinkHIO_wlSlide_c0::m.field_0x64; + sp10 = daAlinkHIO_wlMove_c0::m.field_0x9C; + } else { + sp20 = daAlinkHIO_wlMoveNoP_c0::m.field_0x28; + sp14 = daAlinkHIO_wlMoveNoP_c0::m.field_0x30; + sp1C = daAlinkHIO_wlMoveNoP_c0::m.field_0x24; + sp18 = daAlinkHIO_wlMoveNoP_c0::m.field_0x2C; + sp34 = daAlinkHIO_wlMoveNoP_c0::m.field_0x14; + sp30 = daAlinkHIO_wlMoveNoP_c0::m.field_0x18; + sp2C = daAlinkHIO_wlMoveNoP_c0::m.field_0x1C; + sp28 = daAlinkHIO_wlMoveNoP_c0::m.field_0x20; + sp24 = daAlinkHIO_wlSlide_c0::m.field_0x6C; + sp10 = daAlinkHIO_wlMoveNoP_c0::m.field_0x34; + } + + if (temp_f30 < sp20 || checkAttentionState() || checkHeavyStateOn(1, 1) || checkSlope()) { + field_0x2fc1 = 0; + + if ((temp_f30 < sp20 || checkAttentionState() || checkHeavyStateOn(1, 1)) && + field_0x30d0 != 0) + { + field_0x30d0 = 0; + offNoResetFlg1(FLG1_DASH_MODE); + } + + if (checkNoResetFlg1(FLG1_UNK_800000)) { + offNoResetFlg1(FLG1_UNK_800000); + param_0 = sp14; + } + + int var_r29 = 1; + daAlink_WANM var_r27 = WANM_WAIT; + daAlink_WANM var_r26; + daAlink_WANM var_r25; + if (checkHeavyStateOn(1, 1)) { + var_r26 = WANM_ATN_LOCK_WALK_FRONT; + var_r25 = WANM_ATN_LOCK_WALK_FRONT; + sp30 = 1.2f; + sp2C = 1.2f; + } else { + var_r25 = WANM_WALK_B; + var_r26 = WANM_WALK_A; + } + + if (temp_f30 < sp1C) { + if (checkModeFlg(1)) { + var_r29 = 2; + + s16 temp_r0 = shape_angle.y - field_0x2fe6; + if (abs(temp_r0) > 0 && !checkAttentionState()) { + var_f31 = 0.64999998f + (0.001f * abs(temp_r0)); + if (var_f31 > 1.0f) { + var_f31 = 1.0f; + } + var_f31 = 1.0f - var_f31; + + setDoubleAnimeWolf(var_f31, sp30, sp34, var_r26, WANM_WAIT, 2, param_0); + return; + } + + if (checkAttentionState()) { + var_r27 = WANM_ATN; + sp34 = daAlinkHIO_wlMove_c0::m.field_0xB8; + } else if (checkWindSpeedOnXZ() && !checkEventRun()) { + var_r27 = WANM_WAIT_WIND; + sp34 = 1.0f; + } + } + + if (checkSlope()) { + var_r26 = WANM_WALK_SLOPE; + var_r27 = WANM_WAIT; + sp30 = sp24; + field_0x2fc1 = 2; + } + + var_f31 = temp_f30 / sp1C; + setDoubleAnimeWolf(var_f31, sp34, sp30, var_r27, var_r26, var_r29, param_0); + } else if (checkSlope()) { + field_0x2fc1 = 2; + setDoubleAnimeWolf(1.0f, sp24, sp24, WANM_WALK_SLOPE, WANM_WALK_SLOPE, 1, param_0); + field_0x2fc1 = 2; + } else { + var_f31 = (temp_f30 - sp1C) / (sp20 - sp1C); + if (var_f31 > 1.0f) { + var_f31 = 1.0f; + } + setDoubleAnimeWolf(var_f31, sp30, sp2C, var_r26, var_r25, 1, param_0); + } + + if (!checkBarkAnime() && var_r29 != 1) { + checkAttentionState(); + } + return; + } + + if (!checkNoResetFlg1(FLG1_UNK_800000)) { + onNoResetFlg1(FLG1_UNK_800000); + param_0 = sp14; + } + + field_0x2fc1 = 1; + + if (temp_f30 < sp18) { + var_f31 = sp10 + (((1.0f - sp10) * (temp_f30 - sp20)) / (sp18 - sp20)); + setDoubleAnimeWolf(var_f31, sp34, sp28, WANM_WAIT, WANM_DASH_A, 1, param_0); + } else { + if (!checkWolfDashMode()) { + setDoubleAnimeWolf(1.0f, sp28, sp28, WANM_DASH_A, WANM_DASH_A, 1, param_0); + } else { + var_f31 = (temp_f30 - sp18) / (daAlinkHIO_wlMove_c0::m.field_0x90 - sp18); + if (var_f31 > 1.0f) { + var_f31 = 1.0f; + } + + f32 spC; + if (checkNoResetFlg1(FLG1_DASH_MODE)) { + if (checkWolfSlowDash() != 0) { + spC = daAlinkHIO_wlMove_c0::m.field_0xE8; + } else if (field_0x2fc7 == 2) { + spC = daAlinkHIO_wlMove_c0::m.field_0xF8; + } else { + spC = daAlinkHIO_wlMove_c0::m.field_0xCC; + } + } else { + spC = daAlinkHIO_wlMove_c0::m.field_0x80; + } + + setDoubleAnimeWolf(var_f31, sp28, spC, WANM_DASH_A, WANM_DASH_B, 1, param_0); + } + + if (temp_r28->checkPass(l_wolfFootOnFrame[1][0])) { + field_0x2f9d = 8; + } else if (temp_r28->checkPass(l_wolfFootOnFrame[1][1])) { + field_0x2f9d = 0x10; + } else if (temp_r28->checkPass(l_wolfFootOnFrame[1][2])) { + field_0x2f9d = 0x20; + } else if (temp_r28->checkPass(l_wolfFootOnFrame[1][3])) { + field_0x2f9d = 0x40; + } + + if (checkWindSpeedOnAngle()) { + onEndResetFlg0(ERFLG0_UNK_2000); + if (checkNoSetUpperAnime()) { + setUpperAnimeBase(0x2B7); + } + } + } + + if (!checkBarkAnime() && temp_r28->checkPass(11.0f)) { + voiceStart(Z2SE_WL_V_BREATH_RUN); + } } /* 80128F0C-80128F5C 12384C 0050+00 2/2 0/0 0/0 .text checkWolfAtnMoveBack__9daAlink_cFs */ BOOL daAlink_c::checkWolfAtnMoveBack(s16 param_0) { f32 cos = cM_scos(param_0); - return (field_0x2f98 != 1 && cos < -0.3826834261417389f) || (field_0x2f98 == 1 && cos < -0.1736481785774231f); + return (field_0x2f98 != 1 && cos < -0.3826834261417389f) || + (field_0x2f98 == 1 && cos < -0.1736481785774231f); } /* 80128F5C-80129114 12389C 01B8+00 5/5 0/0 0/0 .text setWolfAtnMoveDirection__9daAlink_cFv */ void daAlink_c::setWolfAtnMoveDirection() { - // NONMATCHING + if (!checkAttentionState() && mProcID != PROC_WOLF_ROLL_ATTACK_MOVE) { + field_0x2f98 = 0; + return; + } + + s16 var_r29; + if (checkUnderMove0BckNoArcWolf(WANM_CHAIN_PULL_END)) { + var_r29 = getChainStickAngleY(field_0x2fe4); + } else { + var_r29 = field_0x2fe2; + } + + if ((mProcID == PROC_WOLF_ATN_AC_MOVE || mProcID == PROC_WOLF_ROLL_ATTACK_MOVE) && + checkModeFlg(1) && checkZeroSpeedF()) + { + if (checkInputOnR()) { + s16 temp_r28 = current.angle.y; + current.angle.y = var_r29; + + if (wolfSideBgCheck(temp_r28)) { + current.angle.y = temp_r28; + onEndResetFlg1(ERFLG1_UNK_200000); + } + } else { + current.angle.y = shape_angle.y; + } + } + + if (mTargetedActor != NULL) { + field_0x2fe4 = cLib_targetAngleY(¤t.pos, &mTargetedActor->eyePos); + } + + s16 temp_r27 = var_r29 - field_0x2fe4; + if (mDemo.getDemoMode() == 23) { + field_0x2f98 = 0; + } else if (checkInputOnR()) { + if (checkWolfAtnMoveBack(temp_r27)) { + field_0x2f98 = 1; + } else { + field_0x2f98 = getDirectionFromAngle(temp_r27); + } + } else if (mProcID != PROC_WOLF_ROLL_ATTACK_MOVE) { + if (field_0x2f98 == 1) { + current.angle.y += 0x8000; + mNormalSpeed *= -1.0f; + } + + field_0x2f98 = 0; + } } /* 80129114-8012933C 123A54 0228+00 2/2 0/0 0/0 .text setBlendWolfAtnMoveAnime__9daAlink_cFf */ void daAlink_c::setBlendWolfAtnMoveAnime(f32 param_0) { - // NONMATCHING + if (checkSetChainPullAnime(field_0x2fe4)) { + daAlink_WANM var_r29; + if (checkEndResetFlg1(ERFLG1_UNK_2000000)) { + var_r29 = WANM_CHAIN_PULL_END; + } else { + var_r29 = WANM_CHAIN_PULL; + } + + if (!checkUnderMove0BckNoArcWolf(var_r29)) { + f32 var_f29; + if (checkChainBlockPushPull()) { + var_f29 = 0.7f; + } else { + var_f29 = 1.0f; + } + + setSingleAnimeWolfBaseSpeed(var_r29, var_f29, 3.0f); + } + } else if (field_0x2f98 == 1) { + setBlendWolfAtnBackMoveAnime(param_0); + } else { + field_0x2fc1 = 0; + + s16 var_r28; + if (field_0x3174 == 8 || !mLinkAcch.i_ChkGroundHit()) { + var_r28 = 0; + } else { + var_r28 = getGroundAngle(&mLinkAcch.m_gnd, current.angle.y); + } + + f32 var_f31 = fabsf((mNormalSpeed * cM_scos(var_r28)) / field_0x594); + f32 var_f30; + if (var_f31 < daAlinkHIO_wlAtnMove_c0::m.field_0x10) { + var_f30 = var_f31 / daAlinkHIO_wlAtnMove_c0::m.field_0x10; + int var_r27; + if (checkModeFlg(1)) { + var_r27 = 2; + } else { + var_r27 = 3; + } + + daAlink_WANM var_r26; + f32 var_f28; + if (checkWolfAtnWait()) { + var_r26 = WANM_ATN; + var_f28 = daAlinkHIO_wlMove_c0::m.field_0xB8; + } else { + var_r26 = WANM_WAIT; + var_f28 = daAlinkHIO_wlMoveNoP_c0::m.field_0x14; + } + + setDoubleAnimeWolf(var_f30, var_f28, daAlinkHIO_wlAtnMove_c0::m.field_0x8, var_r26, + WANM_ATN_LOCK_WALK_FRONT, var_r27, param_0); + } else if (var_f31 < daAlinkHIO_wlAtnMove_c0::m.field_0x14) { + var_f30 = + (var_f31 - daAlinkHIO_wlAtnMove_c0::m.field_0x10) / + (daAlinkHIO_wlAtnMove_c0::m.field_0x14 - daAlinkHIO_wlAtnMove_c0::m.field_0x10); + setDoubleAnimeWolf(var_f30, daAlinkHIO_wlAtnMove_c0::m.field_0x8, + daAlinkHIO_wlAtnMove_c0::m.field_0xC, WANM_ATN_LOCK_WALK_FRONT, + WANM_ATN_LOCK_RUN, 3, param_0); + } else { + setDoubleAnimeWolf(1.0f, daAlinkHIO_wlAtnMove_c0::m.field_0xC, + daAlinkHIO_wlAtnMove_c0::m.field_0xC, WANM_ATN_LOCK_RUN, + WANM_ATN_LOCK_RUN, 3, param_0); + } + } } /* 8012933C-8012948C 123C7C 0150+00 1/1 0/0 0/0 .text setBlendWolfAtnBackMoveAnime__9daAlink_cFf */ void daAlink_c::setBlendWolfAtnBackMoveAnime(f32 param_0) { - // NONMATCHING + field_0x594 = daAlinkHIO_wlAtnMove_c0::m.field_0x2C; + + f32 var_f28; + if (field_0x3174 == 8) { + var_f28 = 1.0f; + } else { + var_f28 = cM_scos(field_0x2ff0); + } + + f32 temp_f31 = fabsf(mNormalSpeed * var_f28) / field_0x594; + f32 var_f30; + + field_0x2fc1 = 3; + + if (temp_f31 < daAlinkHIO_wlAtnMove_c0::m.field_0x28) { + f32 temp_f29 = temp_f31 / daAlinkHIO_wlAtnMove_c0::m.field_0x28; + + int var_r29; + if (checkModeFlg(1)) { + var_r29 = 2; + } else { + var_r29 = 3; + } + + daAlink_WANM var_r28; + if (checkWolfAtnWait()) { + var_r28 = WANM_ATN; + var_f30 = daAlinkHIO_wlMove_c0::m.field_0xB8; + } else { + var_r28 = WANM_WAIT; + var_f30 = daAlinkHIO_wlMoveNoP_c0::m.field_0x14; + } + + setDoubleAnimeWolf(temp_f29, var_f30, daAlinkHIO_wlAtnMove_c0::m.field_0x24, var_r28, + WANM_ATN_LOCK_WALK_BACK, var_r29, param_0); + } else { + setDoubleAnimeWolf(1.0f, daAlinkHIO_wlAtnMove_c0::m.field_0x24, + daAlinkHIO_wlAtnMove_c0::m.field_0x24, WANM_ATN_LOCK_WALK_BACK, + WANM_ATN_LOCK_WALK_BACK, 3, param_0); + } } /* 8012948C-80129678 123DCC 01EC+00 3/3 0/0 0/0 .text * setDoubleAnimeWolf__9daAlink_cFfffQ29daAlink_c12daAlink_WANMQ29daAlink_c12daAlink_WANMif */ -void daAlink_c::setDoubleAnimeWolf(f32 param_0, f32 param_1, f32 param_2, - daAlink_c::daAlink_WANM param_3, - daAlink_c::daAlink_WANM param_4, int param_5, f32 param_6) { - // NONMATCHING +int daAlink_c::setDoubleAnimeWolf(f32 param_0, f32 param_1, f32 param_2, + daAlink_c::daAlink_WANM param_3, daAlink_c::daAlink_WANM param_4, + int param_5, f32 param_6) { + if (!checkWolf()) { + // "Is Adult Link but setting Wolf animation\n" + OS_REPORT("リンクなのに狼アニメ設定\n"); + JUT_ASSERT(0x82B, 0); + } + + J3DAnmTransform* var_r25 = getNowAnmPackUnder(UNDER_0); + J3DAnmTransform* var_r29 = getAnimeResource(&mUnderAnmHeap[0], m_wlAnmDataTable[param_3].field_0x0, 0x2C00); + int var_r30; + if (var_r29 == NULL) { + var_r29 = getNowAnmPackUnder(UNDER_0); + var_r30 = 0; + } else { + var_r30 = 1; + } + + J3DAnmTransform* var_r28 = getAnimeResource(&mUnderAnmHeap[1], m_wlAnmDataTable[param_4].field_0x0, 0x2C00); + if (!var_r28) { + var_r28 = getNowAnmPackUnder(UNDER_1); + } else { + var_r30 |= 1; + } + + if (var_r30 != 0 && param_6 < 0.0f) { + param_6 = daAlinkHIO_wlMove_c0::m.field_0x94; + } + + commonDoubleAnime(var_r29, NULL, var_r28, NULL, param_0, param_1, param_2, param_5); + + if (param_6 >= 0.0f) { + field_0x2060->initOldFrameMorf(param_6, 0, 40); + } + + setFaceBasicTexture(FTANM_UNK_8B); + + if (checkWolfLieCode()) { + field_0x2f9b = 2; + } else { + field_0x2f9b = m_wlAnmDataTable[param_3].field_0x2; + } + + daAlink_WANM var_r27; + if (checkModeFlg(1)) { + field_0x215c = &mUnderFrameCtrl[0]; + var_r27 = param_3; + } else { + field_0x215c = &mUnderFrameCtrl[1]; + var_r27 = param_4; + } + + field_0x2160 = (u16*)&m_wlAnmDataTable[var_r27].field_0x4; + field_0x2fd8 = m_wlAnmDataTable[var_r27].field_0x3; + return 1; } /* 80129678-801296A8 123FB8 0030+00 35/35 0/0 0/0 .text @@ -802,9 +1263,37 @@ void daAlink_c::setSingleAnimeWolfBaseSpeed(daAlink_c::daAlink_WANM i_anmID, f32 /* 80129704-80129848 124044 0144+00 29/29 0/0 0/0 .text * setSingleAnimeWolf__9daAlink_cFQ29daAlink_c12daAlink_WANMffsf */ -void daAlink_c::setSingleAnimeWolf(daAlink_c::daAlink_WANM i_anmID, f32 i_speed, f32 i_start, - s16 i_endFrame, f32 i_morf) { - // NONMATCHING +int daAlink_c::setSingleAnimeWolf(daAlink_c::daAlink_WANM i_anmID, f32 i_speed, f32 i_start, + s16 i_endFrame, f32 i_morf) { + if (!checkWolf()) { + // "Is Adult Link but setting Wolf animation\n" + OS_REPORT("リンクなのに狼アニメ設定\n"); + JUT_ASSERT(0x82B, 0); + } + + J3DAnmTransform* var_r30 = getAnimeResource(&mUnderAnmHeap[0], m_wlAnmDataTable[i_anmID].field_0x0, 0x10800); + if (var_r30 == NULL) { + var_r30 = getNowAnmPackUnder(UNDER_0); + } + + commonSingleAnime(var_r30, NULL, i_speed, i_start, i_endFrame); + + if (i_morf >= 0.0f) { + field_0x2060->initOldFrameMorf(i_morf, 0, 40); + } + + setFaceBasicTexture(FTANM_UNK_8B); + + if (checkWolfLieCode()) { + field_0x2f9b = 2; + } else { + field_0x2f9b = m_wlAnmDataTable[i_anmID].field_0x2; + } + + field_0x215c = mUnderFrameCtrl; + field_0x2160 = (u16*)&m_wlAnmDataTable[i_anmID].field_0x4; + field_0x2fd8 = m_wlAnmDataTable[i_anmID].field_0x3; + return 1; } /* 80129848-8012987C 124188 0034+00 53/53 0/0 0/0 .text @@ -996,7 +1485,8 @@ int daAlink_c::checkNextActionWolf(int param_0) { } else { var_r30 = checkWaitAction(); } - } else if (checkInputOnR() && mGndPolySpecialCode != dBgW_SPCODE_ICE && abs(field_0x3180) < 0x5000 && + } else if (checkInputOnR() && mGndPolySpecialCode != dBgW_SPCODE_ICE && + abs(field_0x3180) < 0x5000 && cLib_distanceAngleS(field_0x2fe2, current.angle.y) > 0x7000 && ((checkWolfDashMode() && speedF / field_0x594 > daAlinkHIO_wlMove_c0::m.field_0xA0) || @@ -1012,7 +1502,6 @@ int daAlink_c::checkNextActionWolf(int param_0) { return var_r30; } - /* 8012A02C-8012A228 12496C 01FC+00 3/3 0/0 0/0 .text wolfSideBgCheck__9daAlink_cFs */ BOOL daAlink_c::wolfSideBgCheck(s16 param_0) { s16 var_r31 = current.angle.y - param_0; @@ -1059,7 +1548,6 @@ BOOL daAlink_c::wolfSideBgCheck(s16 param_0) { return false; } - /* 8012A228-8012A330 124B68 0108+00 4/4 0/0 0/0 .text checkWolfAttackReverse__9daAlink_cFi */ BOOL daAlink_c::checkWolfAttackReverse(int param_0) { if (mProcID != PROC_WOLF_LOCK_ATTACK && checkAtShieldHit(mAtCyl)) { @@ -1109,7 +1597,7 @@ int daAlink_c::checkWolfBarrierHitReverse() { /* 8012A41C-8012A498 124D5C 007C+00 2/2 0/0 0/0 .text * checkWolfBarrierWallHit__9daAlink_cFR13cBgS_PolyInfo */ -bool daAlink_c::checkWolfBarrierWallHit(cBgS_PolyInfo& i_poly) { +BOOL daAlink_c::checkWolfBarrierWallHit(cBgS_PolyInfo& i_poly) { if (field_0x3100 != 0 || checkZeroSpeedF()) { return false; } @@ -1123,8 +1611,199 @@ bool daAlink_c::checkWolfBarrierWallHit(cBgS_PolyInfo& i_poly) { } /* 8012A498-8012ACCC 124DD8 0834+00 1/1 0/0 0/0 .text wolfBgCheck__9daAlink_cFv */ +// NONMATCHING - regalloc void daAlink_c::wolfBgCheck() { - // NONMATCHING + offNoResetFlg3(daPy_FLG3(FLG3_UNK_800000 | FLG3_UNK_400)); + + if (checkModeFlg(0x224000) || mProcID == PROC_WOLF_TAG_JUMP || mProcID == PROC_LARGE_DAMAGE) { + offNoResetFlg1(FLG1_UNK_20000000); + return; + } + + cXyz sp38; + cXyz sp2C; + cXyz sp20; + cXyz sp14; + cXyz sp8; + + int var_r24 = 0; + f32 temp_f27 = cM_ssin(shape_angle.y); + f32 temp_f26 = cM_scos(shape_angle.y); + + f32 var_f29; + f32 var_f28; + if (checkModeFlg(2)) { + var_f29 = 0.0f; + var_f28 = 1.0f; + } else { + var_f29 = cM_ssin(shape_angle.x); + var_f28 = cM_scos(shape_angle.x); + } + + int var_r26; + if (checkModeFlg(0x40000)) { + var_r26 = 0; + } else { + var_r26 = 2; + } + + cM3dGPla sp44; + + for (int i = 0; i < 2; i++) { + sp38.set(current.pos.x, current.pos.y + mAcchCir[2].GetWallH(), current.pos.z); + + if (mLinkAcch.ChkGroundHit()) { + sp38.y -= speed.y; + } + + f32 var_f31; + if (i == 0) { + var_f31 = -50.0f; + } else { + var_f31 = 90.0f; + } + + f32 temp_f30 = var_f31 * var_f28; + + sp2C.set(current.pos.x + (temp_f30 * temp_f27), sp38.y - (var_f31 * var_f29), current.pos.z + (temp_f30 * temp_f26)); + + int var_r28 = getCrawlMoveVec(&sp38, &sp2C, &sp20, var_r26, 0, &field_0x2fca); + if (var_r28) { + if (dComIfG_Bgsp().GetPolyAttackThrough(mLinkLinChk)) { + onNoResetFlg3(FLG3_UNK_400); + } + + if (checkWolfBarrierWallHit(mLinkLinChk)) { + setWolfBarrierHitEffect(mLinkLinChk); + } else { + onNoResetFlg3(FLG3_UNK_800000); + dComIfG_Bgsp().GetTriPla(mLinkLinChk, &sp44); + field_0x378c = mLinkLinChk.i_GetCross(); + } + } + + sp38.y -= mAcchCir[2].GetWallH() - mAcchCir[0].GetWallH(); + sp2C.y -= mAcchCir[2].GetWallH() - mAcchCir[0].GetWallH(); + + int var_r25 = getCrawlMoveVec(&sp38, &sp2C, &sp14, var_r26, 0, &field_0x2fca); + if (var_r25) { + if (dComIfG_Bgsp().GetPolyAttackThrough(mLinkLinChk)) { + onNoResetFlg3(FLG3_UNK_400); + } + + if (checkWolfBarrierWallHit(mLinkLinChk)) { + setWolfBarrierHitEffect(mLinkLinChk); + } else { + onNoResetFlg3(FLG3_UNK_800000); + dComIfG_Bgsp().GetTriPla(mLinkLinChk, &sp44); + field_0x378c = mLinkLinChk.i_GetCross(); + } + } + + if (var_r28 != 0 || var_r25 != 0) { + onNoResetFlg1(FLG1_UNK_20000000); + + if (var_r28 != 0 && var_r25 != 0) { + if (sp20.abs2() > sp14.abs2()) { + sp8 = sp20; + } else { + sp8 = sp14; + } + } else if (var_r28 != 0) { + sp8 = sp20; + } else { + sp8 = sp14; + } + + sp38 -= sp8; + sp2C -= sp8; + + var_r28 = getCrawlMoveVec(&sp38, &sp2C, &sp20, var_r26, 0, NULL); + + sp38.y += mAcchCir[2].GetWallH() - mAcchCir[0].GetWallH(); + sp2C.y += mAcchCir[2].GetWallH() - mAcchCir[0].GetWallH(); + + var_r25 = getCrawlMoveVec(&sp38, &sp2C, &sp14, var_r26, 0, NULL); + + if (var_r28 != 0 || var_r25 != 0) { + if (var_r28 != 0 && var_r25 != 0) { + if (sp20.abs2() > sp14.abs2()) { + sp8 += sp20; + } else { + sp8 += sp14; + } + } else if (var_r28 != 0) { + sp8 += sp20; + } else { + sp8 += sp14; + } + } + + current.pos -= sp8; + + field_0x3092 = cM_atan2s(-sp8.x, -sp8.z); + + if (checkNoResetFlg3(FLG3_UNK_800000)) { + field_0x3166.set(cM_atan2s(sp44.mNormal.y, sp44.mNormal.absXZ()), cM_atan2s(-sp44.mNormal.x, -sp44.mNormal.z), 0); + } + + var_r24++; + } + } + + if (var_r24 == 0 && checkNoResetFlg1(FLG1_UNK_20000000)) { + int i = 0; + for (; i < 2; i++) { + sp38.set(current.pos.x, current.pos.y + mAcchCir[2].GetWallH(), current.pos.z); + if (mLinkAcch.i_ChkGroundHit()) { + sp38.y -= speed.y; + } + + f32 var_f31_2; + if (i == 0) { + var_f31_2 = -60.0f; + } else { + var_f31_2 = 100.0f; + } + + f32 temp_f30_2 = var_f31_2 * var_f28; + sp2C.set(current.pos.x + (temp_f30_2 * temp_f27), sp38.y - (var_f31_2 * var_f29), current.pos.z + (temp_f30_2 * temp_f26)); + + if (getCrawlMoveVec(&sp38, &sp2C, &sp20, var_r26, 0, NULL)) { + break; + } + + sp38.y -= mAcchCir[2].GetWallH() - mAcchCir[0].GetWallH(); + sp2C.y -= mAcchCir[2].GetWallH() - mAcchCir[0].GetWallH(); + + if (getCrawlMoveVec(&sp38, &sp2C, &sp14, var_r26, 0, NULL)) { + break; + } + } + + if (i == 2) { + offNoResetFlg1(FLG1_UNK_20000000); + } + } + + if (var_r24 == 2) { + if (field_0x2fa6 == 0 && !checkEndResetFlg1(ERFLG1_UNK_200000)) { + s16 var_r27 = field_0x3092 - shape_angle.y; + if (var_r27 <= 0) { + var_r27 += 0x4000; + } else { + var_r27 -= 0x4000; + } + + field_0x2fe6 += var_r27; + current.angle.y += var_r27; + shape_angle.y += var_r27; + } + + field_0x2fa6 = 3; + } else if (field_0x2fa6 != 0) { + field_0x2fa6--; + } } /* 8012ACCC-8012AD1C 12560C 0050+00 1/1 0/0 0/0 .text changeWolfBlendRate__9daAlink_cFi @@ -1158,11 +1837,13 @@ void daAlink_c::wolfFootBgCheck() { /* 8012BFA8-8012C1F4 1268E8 024C+00 6/6 0/0 0/0 .text checkWolfWaitSlipPolygon__9daAlink_cFv */ BOOL daAlink_c::checkWolfWaitSlipPolygon() { // NONMATCHING + return 0; } /* 8012C1F4-8012C308 126B34 0114+00 2/2 0/0 0/0 .text setWolfWaitSlip__9daAlink_cFv */ f32 daAlink_c::setWolfWaitSlip() { // NONMATCHING + return 0.0f; } /* 8012C308-8012C30C 126C48 0004+00 4/4 0/0 0/0 .text checkWolfAtnDoCharge__9daAlink_cFv @@ -1175,20 +1856,22 @@ void daAlink_c::setWolfChainPos() { } /* 8012CB0C-8012CBE4 12744C 00D8+00 1/1 0/0 0/0 .text setWolfAnmVoice__9daAlink_cFv */ -// NONMATCHING - wrong block order void daAlink_c::setWolfAnmVoice() { - s8* var_r30 = field_0x2160; + s8* var_r29 = (s8*)field_0x2160; if (field_0x2fd8 >= 12 || field_0x215c == NULL) { return; } for (int i = 0; i < 4; i++) { - f32 temp_f31 = *var_r30; - if (*var_r30 != -1 && field_0x215c->checkPass(temp_f31)) { + if (*var_r29 == -1) { + return; + } + + if (field_0x215c->checkPass(*var_r29)) { voiceStart(label[field_0x2fd8]); } - var_r30++; + var_r29++; } } @@ -1229,7 +1912,6 @@ int daAlink_c::procWolfServiceWaitInit(int param_0) { return 1; } - /* 8012CD28-8012CF68 127668 0240+00 1/0 0/0 0/0 .text procWolfServiceWait__9daAlink_cFv */ int daAlink_c::procWolfServiceWait() { @@ -1349,7 +2031,6 @@ int daAlink_c::procWolfWait() { return 1; } - /* 8012D380-8012D3E4 127CC0 0064+00 2/2 0/0 0/0 .text procWolfMoveInit__9daAlink_cFv */ int daAlink_c::procWolfMoveInit() { if (!commonProcInitNotSameProc(PROC_WOLF_MOVE)) { @@ -1489,7 +2170,6 @@ int daAlink_c::procWolfDash() { return 1; } - /* 8012D8C0-8012DA5C 128200 019C+00 2/2 0/0 0/0 .text procWolfDashReverseInit__9daAlink_cFi */ int daAlink_c::procWolfDashReverseInit(int param_0) { commonProcInit(PROC_WOLF_DASH_REVERSE); @@ -1523,7 +2203,6 @@ int daAlink_c::procWolfDashReverseInit(int param_0) { return 1; } - /* 8012DA5C-8012DBA8 12839C 014C+00 1/0 0/0 0/0 .text procWolfDashReverse__9daAlink_cFv */ int daAlink_c::procWolfDashReverse() { @@ -1979,7 +2658,6 @@ int daAlink_c::procWolfHowl() { return 1; } - /* 8012E9C8-8012EB94 129308 01CC+00 2/2 0/0 0/0 .text procWolfAutoJumpInit__9daAlink_cFi */ int daAlink_c::procWolfAutoJumpInit(int param_0) { @@ -2083,7 +2761,6 @@ int daAlink_c::procWolfAutoJump() { return 1; } - /* 8012EDD0-8012EFB8 129710 01E8+00 12/12 0/0 0/0 .text procWolfFallInit__9daAlink_cFif */ int daAlink_c::procWolfFallInit(int param_0, f32 i_morf) { @@ -2137,7 +2814,6 @@ int daAlink_c::procWolfFallInit(int param_0, f32 i_morf) { return 1; } - /* 8012EFB8-8012F138 1298F8 0180+00 1/0 0/0 0/0 .text procWolfFall__9daAlink_cFv */ int daAlink_c::procWolfFall() { if (mProcVar5.field_0x3012 == 0) { @@ -2179,7 +2855,6 @@ int daAlink_c::procWolfFall() { return 1; } - /* 8012F138-8012F1F0 129A78 00B8+00 2/2 0/0 0/0 .text procWolfLandInit__9daAlink_cFv */ int daAlink_c::procWolfLandInit() { commonProcInit(PROC_WOLF_LAND); @@ -2197,7 +2872,6 @@ int daAlink_c::procWolfLandInit() { return 1; } - /* 8012F1F0-8012F278 129B30 0088+00 1/0 0/0 0/0 .text procWolfLand__9daAlink_cFv */ int daAlink_c::procWolfLand() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; @@ -2275,7 +2949,6 @@ int daAlink_c::procWolfStepMoveInit() { return 1; } - /* 8012F500-8012F634 129E40 0134+00 1/0 0/0 0/0 .text procWolfStepMove__9daAlink_cFv */ int daAlink_c::procWolfStepMove() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; @@ -2307,7 +2980,6 @@ int daAlink_c::procWolfStepMove() { return 1; } - /* 8012F634-8012F6EC 129F74 00B8+00 1/1 0/0 0/0 .text procWolfSlipInit__9daAlink_cFv */ int daAlink_c::procWolfSlipInit() { commonProcInit(PROC_WOLF_SLIP); @@ -2362,7 +3034,6 @@ int daAlink_c::procWolfSlip() { return 1; } - /* 8012F840-8012F9C0 12A180 0180+00 2/2 0/0 0/0 .text procWolfSlipTurnInit__9daAlink_cFi */ int daAlink_c::procWolfSlipTurnInit(int param_0) { @@ -2399,7 +3070,6 @@ int daAlink_c::procWolfSlipTurnInit(int param_0) { return 1; } - /* 8012F9C0-8012FB18 12A300 0158+00 1/0 0/0 0/0 .text procWolfSlipTurn__9daAlink_cFv */ int daAlink_c::procWolfSlipTurn() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; @@ -2429,7 +3099,6 @@ int daAlink_c::procWolfSlipTurn() { return 1; } - /* 8012FB18-8012FBB4 12A458 009C+00 1/1 0/0 0/0 .text procWolfSlipTurnLandInit__9daAlink_cFv */ int daAlink_c::procWolfSlipTurnLandInit() { commonProcInit(PROC_WOLF_SLIP_TURN_LAND); @@ -2481,7 +3150,6 @@ int daAlink_c::procWolfSlideReadyInit(s16 i_angle, int param_1) { return 1; } - /* 8012FD2C-8012FE80 12A66C 0154+00 1/0 0/0 0/0 .text procWolfSlideReady__9daAlink_cFv */ int daAlink_c::procWolfSlideReady() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; @@ -2514,7 +3182,6 @@ int daAlink_c::procWolfSlideReady() { return 1; } - /* 8012FE80-8012FFA4 12A7C0 0124+00 2/2 0/0 0/0 .text procWolfSlideInit__9daAlink_cFsi */ int daAlink_c::procWolfSlideInit(s16 i_angle, int param_1) { if (cLib_distanceAngleS(i_angle, shape_angle.y) < 0x3800 && !param_1) { @@ -2539,7 +3206,6 @@ int daAlink_c::procWolfSlideInit(s16 i_angle, int param_1) { return 1; } - /* 8012FFA4-801300D4 12A8E4 0130+00 1/0 0/0 0/0 .text procWolfSlide__9daAlink_cFv */ int daAlink_c::procWolfSlide() { cM3dGPla slide_poly; @@ -2565,7 +3231,6 @@ int daAlink_c::procWolfSlide() { return 1; } - /* 801300D4-80130138 12AA14 0064+00 1/1 0/0 0/0 .text procWolfSlideLandInit__9daAlink_cFv */ int daAlink_c::procWolfSlideLandInit() { @@ -2661,7 +3326,6 @@ int daAlink_c::procWolfWaitSlip() { return 1; } - /* 80130440-801304D4 12AD80 0094+00 2/2 0/0 0/0 .text procWolfSlopeStartInit__9daAlink_cFi */ int daAlink_c::procWolfSlopeStartInit(int param_0) { commonProcInit(PROC_WOLF_SLOPE_START); @@ -2720,7 +3384,6 @@ static void* daAlink_searchWolfHowl(fopAc_ac_c* i_actor, void* i_data) { return NULL; } - /* 80130654-80130700 12AF94 00AC+00 1/1 0/0 0/0 .text setWolfHowlNotHappen__9daAlink_cFi */ void daAlink_c::setWolfHowlNotHappen(int param_0) { @@ -2875,7 +3538,6 @@ int daAlink_c::procWolfHowlDemoInit() { return 1; } - /* 80130BC4-801312C8 12B504 0704+00 1/0 0/0 0/0 .text procWolfHowlDemo__9daAlink_cFv */ int daAlink_c::procWolfHowlDemo() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; @@ -3067,13 +3729,6 @@ int daAlink_c::procWolfHowlDemo() { return 1; } - -/* 801312C8-80131408 12BC08 0140+00 1/1 0/0 0/0 .text setWolfHowling__15daObj_Sekizoa_cFv - */ -void daObj_Sekizoa_c::setWolfHowling() { - // NONMATCHING -} - /* 80131408-80131450 12BD48 0048+00 1/0 0/0 0/0 .text checkWolfRope__9daAlink_cFv */ BOOL daAlink_c::checkWolfRope() { return checkModeFlg(0x20000) && field_0x280c.getActor() != NULL && @@ -3112,7 +3767,6 @@ fopAc_ac_c* daAlink_c::checkWolfRopeHit(dCcD_GObjInf* i_collider, cXyz const* pa return NULL; } - /* 80131628-801316A4 12BF68 007C+00 2/2 0/0 0/0 .text checkWolfRopeJumpHang__9daAlink_cFv */ int daAlink_c::checkWolfRopeJumpHang() { @@ -3142,7 +3796,6 @@ f32 daAlink_c::getWolfRopeMoveSpeed() { return daAlinkHIO_wlRope_c0::m.field_0x24 * frameCtrl->getRate() * cM_fsin(0.2327106f * frame); } - /* 80131718-801319F0 12C058 02D8+00 6/6 0/0 0/0 .text setWolfRopePosY__9daAlink_cFv */ // NONMATCHING int daAlink_c::setWolfRopePosY() { @@ -3152,33 +3805,33 @@ int daAlink_c::setWolfRopePosY() { cXyz* temp_r26 = temp_r3->getRopeVec(); f32 temp_f30 = temp_r3->getStartRate(¤t.pos); - if (mProcID == PROC_WOLF_ROPE_MOVE && (temp_r3->getStartRate(&mLeftHandPos) < 0.0f || - temp_r3->getStartRate(&mLeftHandPos) > 1.0f || - temp_r3->getStartRate(&mRightHandPos) < 0.0f || - temp_r3->getStartRate(&mRightHandPos) > 1.0f || - temp_r3->getStartRate(&mLeftFootPos) < 0.0f || - temp_r3->getStartRate(&mLeftFootPos) > 1.0f || - temp_r3->getStartRate(&mRightFootPos) < 0.0f || - temp_r3->getStartRate(&mRightFootPos) > 1.0f)) + f32 var_f31; + if (mProcID == PROC_WOLF_ROPE_MOVE && + ((var_f31 = temp_r3->getStartRate(&mLeftHandPos), var_f31 < 0.0f || var_f31 > 1.0f) || + (var_f31 = temp_r3->getStartRate(&mRightHandPos), var_f31 < 0.0f || var_f31 > 1.0f) || + (var_f31 = temp_r3->getStartRate(&mLeftFootPos), var_f31 < 0.0f || var_f31 > 1.0f) || + (var_f31 = temp_r3->getStartRate(&mRightFootPos), var_f31 < 0.0f || var_f31 > 1.0f))) { if (temp_r28->abs2XZ(current.pos) > temp_r27->abs2XZ(current.pos)) { current.pos.y = temp_r27->y; } else { current.pos.y = temp_r28->y; } + temp_r3->onOutFlg(); return 1; - } else { - if (temp_f30 < 0.0f) { - current.pos.y = temp_r28->y; - } else if (temp_f30 > 1.0f) { - current.pos.y = temp_r27->y; - } else { - current.pos.y = ((temp_r28->y + (temp_f30 * temp_r26->y)) - 40.0f) - - (10.0f * cM_fsin(M_PI * temp_f30)); - } - return 0; } + + if (temp_f30 < 0.0f) { + current.pos.y = temp_r28->y; + } else if (temp_f30 > 1.0f) { + current.pos.y = temp_r27->y; + } else { + current.pos.y = ((temp_r28->y + (temp_f30 * temp_r26->y)) - 40.0f) - + (10.0f * cM_fsin(M_PI * temp_f30)); + } + + return 0; } /* 801319F0-80131A6C 12C330 007C+00 5/5 0/0 0/0 .text initWolfRopeShapeAngle__9daAlink_cFv */ @@ -3210,7 +3863,6 @@ void daAlink_c::wolfRopeSwingInc(f32 param_0) { mDoAud_seStart(Z2SE_FN_ROPE_CREAK_ADD, ¤t.pos, var_r6, mVoiceReverbIntensity); } - /* 80131AFC-80131C00 12C43C 0104+00 8/8 0/0 0/0 .text setWolfRopeOffsetY__9daAlink_cFi */ void daAlink_c::setWolfRopeOffsetY(int param_0) { if (param_0) { @@ -3234,7 +3886,6 @@ void daAlink_c::setWolfRopeOffsetY(int param_0) { } } - /* 80131C00-80131C74 12C540 0074+00 2/2 0/0 0/0 .text getDirectionRopeMove__9daAlink_cCFv */ int daAlink_c::getDirectionRopeMove() const { @@ -3288,7 +3939,6 @@ int daAlink_c::procWolfRopeMoveInit(int param_0, int param_1) { return 1; } - /* 80131DA0-80132738 12C6E0 0998+00 1/0 0/0 0/0 .text procWolfRopeMove__9daAlink_cFv */ int daAlink_c::procWolfRopeMove() { // NONMATCHING @@ -3351,7 +4001,6 @@ int daAlink_c::procWolfRopeHangInit(int param_0) { return 1; } - /* 80132914-80132D68 12D254 0454+00 1/0 0/0 0/0 .text procWolfRopeHang__9daAlink_cFv */ int daAlink_c::procWolfRopeHang() { // NONMATCHING @@ -3379,7 +4028,6 @@ int daAlink_c::procWolfRopeTurnInit() { return 1; } - /* 80132E88-80133054 12D7C8 01CC+00 1/0 0/0 0/0 .text procWolfRopeTurn__9daAlink_cFv */ int daAlink_c::procWolfRopeTurn() { // NONMATCHING @@ -3416,7 +4064,6 @@ int daAlink_c::procWolfRopeStaggerInit(int param_0) { return 1; } - /* 80133164-8013384C 12DAA4 06E8+00 1/0 0/0 0/0 .text procWolfRopeStagger__9daAlink_cFv */ int daAlink_c::procWolfRopeStagger() { @@ -3430,8 +4077,7 @@ int daAlink_c::procWolfRopeSubjectivityInit() { commonProcInit(PROC_WOLF_ROPE_SUBJECTIVITY); if (!checkUnderMove0BckNoArcWolf(WANM_ROPE_WALK)) { - setSingleAnimeWolfBaseSpeed(WANM_ROPE_WALK, 0.0f, - daAlinkHIO_wlRope_c0::m.field_0x20); + setSingleAnimeWolfBaseSpeed(WANM_ROPE_WALK, 0.0f, daAlinkHIO_wlRope_c0::m.field_0x20); } mProcVar2.field_0x300c = initWolfRopeShapeAngle(); @@ -3480,7 +4126,6 @@ int daAlink_c::getWolfTagJumpTime() const { return time; } - /* 80133EF0-80134000 12E830 0110+00 3/3 1/1 1/1 .text checkMidnaLockJumpPoint__9daAlink_cCFv */ const cXyz* daAlink_c::checkMidnaLockJumpPoint() const { if ((!mLinkAcch.i_ChkGroundHit() && mProcID != PROC_WOLF_TAG_JUMP) || checkMidnaUseAbility() || @@ -3515,14 +4160,162 @@ const cXyz* daAlink_c::checkMidnaLockJumpPoint() const { /* 80134000-80134838 12E940 0838+00 4/4 0/0 0/0 .text * procWolfTagJumpInit__9daAlink_cFP10fopAc_ac_c */ int daAlink_c::procWolfTagJumpInit(fopAc_ac_c* param_0) { - // NONMATCHING - return 0; + commonProcInit(PROC_WOLF_TAG_JUMP); + + field_0x3480 = daAlinkHIO_wlPoint_c0::m.field_0x68; + field_0x3198 = 0; + + if (param_0 == NULL) { + field_0x37c8.set(current.pos.x + (300.0f * cM_ssin(shape_angle.y)), current.pos.y + 200.0f, current.pos.z + (300.0f * cM_scos(shape_angle.y))); + field_0x3480 = 30.0f; + field_0x280c.clearData(); + mProcVar1.field_0x300a = 0; + field_0x3198 = 1; + } else { + field_0x37c8 = *((daTagWljump_c*)param_0)->getLockPos(); + + cXyz sp14 = field_0x37c8 - current.pos; + f32 temp_f31 = ((daTagWljump_c*)param_0)->getLandArea() / sp14.absXZ(); + + field_0x37c8.x -= sp14.x * temp_f31; + field_0x37c8.z -= sp14.z * temp_f31; + + field_0x280c.setData(param_0); + ((daTagWljump_c*)param_0)->onNextCheckFlg(); + mProcVar1.field_0x300a = ((daTagWljump_c*)param_0)->getNotSlideFlg(); + } + + setSingleAnimeWolf(WANM_JUMP_ATTACK_START, daAlinkHIO_wlAutoJump_c0::m.field_0x60, daAlinkHIO_wlAutoJump_c0::m.field_0x00.mStartFrame, daAlinkHIO_wlAutoJump_c0::m.field_0x00.mEndFrame, daAlinkHIO_wlAutoJump_c0::m.field_0x00.mInterpolation); + field_0x3588 = l_wolfBaseAnime; + + cXyz sp8 = field_0x37c8 - current.pos; + f32 temp_f30 = 1.0f / sp8.abs(); + + shape_angle.y = sp8.atan2sX_Z(); + current.angle.y = shape_angle.y; + field_0x2fe4 = shape_angle.y; + mNormalSpeed = temp_f30 * (field_0x3480 * sp8.absXZ()); + + mProcVar0.field_0x3008 = (sp8.absXZ() / mNormalSpeed) - 1.0f; + if (mProcVar0.field_0x3008 < 1) { + mProcVar0.field_0x3008 = 1; + } + + if (fabsf(sp8.y) < 50.0f) { + setSpecialGravity(-(120.0f + (2.0f * (60.0f - sp8.y)) + (4.0f * JMAFastSqrt(60.0f * (60.0f - sp8.y)))) / (mProcVar0.field_0x3008 * mProcVar0.field_0x3008), maxFallSpeed, 0); + speed.y = JMAFastSqrt(-120.0f * gravity); + mProcVar3.field_0x300e = 0; + } else if (sp8.y > 0.0f) { + setSpecialGravity((-2.0f * sp8.y) / (mProcVar0.field_0x3008 * mProcVar0.field_0x3008), maxFallSpeed, 0); + speed.y = -gravity * mProcVar0.field_0x3008; + mProcVar3.field_0x300e = 1; + } else { + speed.y = 0.0f; + setSpecialGravity((2.0f * sp8.y) / (mProcVar0.field_0x3008 * mProcVar0.field_0x3008), maxFallSpeed, 0); + mProcVar3.field_0x300e = 1; + } + + mProcVar2.field_0x300c = cM_atan2s(-speed.y, mNormalSpeed) >> 1; + field_0x3478 = speed.y; + mProcVar4.field_0x3010 = 0; + offNoResetFlg0(FLG0_UNK_40000); + voiceStart(Z2SE_WL_V_LOCK_JUMP); + mProcVar5.field_0x3012 = 0; + return 1; } /* 80134838-80134DB8 12F178 0580+00 1/0 0/0 0/0 .text procWolfTagJump__9daAlink_cFv */ int daAlink_c::procWolfTagJump() { - // NONMATCHING - return 0; + daTagWljump_c* temp_r29 = (daTagWljump_c*)field_0x280c.getActor(); + daPy_frameCtrl_c* temp_r28 = &mUnderFrameCtrl[0]; + + mProcVar0.field_0x3008--; + + if (mProcVar0.field_0x3008 < 0) { + if (temp_r29 == NULL || temp_r29->getLockPos() == NULL || mProcVar0.field_0x3008 < -daAlinkHIO_wlPoint_c0::m.field_0x50.mEndFrame) { + procWolfWaitInit(); + } else { + if (field_0x3198 == 0) { + onResetFlg0(RFLG0_UNK_20000); + } + + field_0x3738 = *temp_r29->getLockPos(); + setDoStatus(0x93); + + cLib_addCalcAngleS(&shape_angle.y, cLib_targetAngleY(¤t.pos, &field_0x3738), 2, 0x2000, 0x800); + current.angle.y = shape_angle.y; + + if (doTrigger()) { + mProcVar5.field_0x3012 = 1; + } + + if (mProcVar5.field_0x3012 && (checkModeFlg(0x100) || checkAnmEnd(temp_r28) || temp_r28->getFrame() > daAlinkHIO_wlPoint_c0::m.field_0x28.mCheckFrame)) { + procWolfTagJumpInit(temp_r29); + } else if (checkAnmEnd(temp_r28)) { + onModeFlg(0x100); + setSingleAnimeWolfBaseSpeed(WANM_WAIT_B, daAlinkHIO_wlPoint_c0::m.field_0x50.mSpeed, daAlinkHIO_wlPoint_c0::m.field_0x50.mStartFrame); + } + } + + return 1; + } + + field_0x2f99 = 4; + + if (mProcVar3.field_0x300e != 0) { + speed.y = field_0x3478 + gravity; + field_0x3478 = speed.y; + } + + mProcVar2.field_0x300c = cM_atan2s(-speed.y, mNormalSpeed) >> 1; + + if (checkUnderMove0BckNoArcWolf(WANM_JUMP_ATTACK_START) && checkAnmEnd(temp_r28)) { + field_0x2f99 = 0xC; + setSingleAnimeWolfBaseSpeed(WANM_JUMP_ATTACK, 0.0f, daAlinkHIO_wlAutoJump_c0::m.field_0x28.mInterpolation); + } + + if (mProcVar0.field_0x3008 == 0) { + cXyz sp14 = field_0x37c8 - current.pos; + if (sp14.absXZ() < (31.0f + field_0x3480)) { + if (field_0x3198 == 0) { + current.pos = field_0x37c8; + } + + if (temp_r29 != NULL) { + if (temp_r29->getLockPos() != NULL) { + onResetFlg0(RFLG0_UNK_20000); + field_0x3738 = *temp_r29->getLockPos(); + + if (mProcVar1.field_0x300a != 0) { + field_0x2f99 = 0x50; + setSingleAnimeWolfParam(WANM_JUMP_B_END, &daAlinkHIO_wlPoint_c0::m.field_0x28); + + mNormalSpeed = 0.0f; + speed = cXyz::Zero; + setSpecialGravity(0.0f, maxFallSpeed, 0); + + field_0x2f9d = 4; + setFootEffectProcType(4); + dComIfGp_getVibration().StartShock(2, 0xF, cXyz(0.0f, 1.0f, 0.0f)); + } else { + procWolfTagJumpLandInit(temp_r29); + } + } else { + procWolfTagJumpLandInit(NULL); + } + } else if (field_0x3198 != 0) { + procWolfFallInit(2, daAlinkHIO_wlAutoJump_c0::m.field_0x54); + } else { + current.pos.x -= 50.0f * cM_ssin(shape_angle.y); + current.pos.z -= 50.0f * cM_scos(shape_angle.y); + procWolfTagJumpLandInit(NULL); + } + } else { + procWolfFallInit(2, daAlinkHIO_wlAutoJump_c0::m.field_0x54); + } + } + + return 1; } /* 80134DB8-80134EBC 12F6F8 0104+00 1/1 0/0 0/0 .text @@ -3552,7 +4345,6 @@ int daAlink_c::procWolfTagJumpLandInit(fopAc_ac_c* param_0) { return 1; } - /* 80134EBC-80135050 12F7FC 0194+00 1/0 0/0 0/0 .text procWolfTagJumpLand__9daAlink_cFv */ int daAlink_c::procWolfTagJumpLand() { @@ -3593,7 +4385,6 @@ int daAlink_c::procWolfTagJumpLand() { return 1; } - /* 80135050-801350A4 12F990 0054+00 1/1 0/0 0/0 .text daAlink_searchGiant__FP10fopAc_ac_cPv */ static fopAc_ac_c* daAlink_searchGiant(fopAc_ac_c* i_actor, void* i_data) { cXyz* gnd_chk_pos = static_cast(i_data); @@ -3698,7 +4489,6 @@ int daAlink_c::procWolfGiantPuzzle() { return 1; } - /* 80135458-801354C8 12FD98 0070+00 2/2 0/0 0/0 .text setWolfHangGroundY__9daAlink_cFv */ void daAlink_c::setWolfHangGroundY() { cXyz pos; @@ -3738,7 +4528,6 @@ int daAlink_c::changeWolfHangEndProc() { return 0; } - /* 801355EC-80135668 12FF2C 007C+00 2/2 0/0 0/0 .text procWolfHangReadyInit__9daAlink_cFv */ int daAlink_c::procWolfHangReadyInit() { @@ -3833,7 +4622,6 @@ int daAlink_c::procWolfHangWallCatch() { return 1; } - /* 80135CD8-80135F00 130618 0228+00 1/1 0/0 0/0 .text * procWolfHangFallStartInit__9daAlink_cFP8cM3dGPla */ int daAlink_c::procWolfHangFallStartInit(cM3dGPla* param_0) { @@ -3886,7 +4674,6 @@ int daAlink_c::procWolfHangFallStartInit(cM3dGPla* param_0) { return 1; } - /* 80135F00-80136064 130840 0164+00 1/0 0/0 0/0 .text procWolfHangFallStart__9daAlink_cFv */ int daAlink_c::procWolfHangFallStart() { @@ -3919,7 +4706,6 @@ int daAlink_c::procWolfHangFallStart() { return 1; } - /* 80136064-801360EC 1309A4 0088+00 1/1 0/0 0/0 .text setWolfHeadDamage__9daAlink_cFv */ void daAlink_c::setWolfHeadDamage() { setUpperAnimeParam(0x2A7, UPPER_2, &daAlinkHIO_wlDamage_c0::m.field_0x0); @@ -4027,7 +4813,6 @@ int daAlink_c::procWolfLandDamageInit(int param_0) { return 1; } - /* 80136DE4-80136EC4 131724 00E0+00 1/0 0/0 0/0 .text procWolfLandDamage__9daAlink_cFv */ int daAlink_c::procWolfLandDamage() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; @@ -4061,7 +4846,6 @@ void daAlink_c::setWolfScreamWaitAnime() { dComIfGp_getVibration().StartQuake(5, 1, cXyz(0.0f, 1.0f, 0.0f)); } - /* 80136F54-80136FF8 131894 00A4+00 1/1 0/0 0/0 .text procWolfScreamWaitInit__9daAlink_cFv */ int daAlink_c::procWolfScreamWaitInit() { commonProcInit(PROC_WOLF_SCREAM_WAIT); @@ -4134,7 +4918,6 @@ f32 daAlink_c::getWolfLieMoveSpeed() { cM_fsin(var_f1 * 0.2094395f); } - /* 801371A0-801371FC 131AE0 005C+00 0/0 0/0 2/2 .text checkMidnaDisappearMode__9daAlink_cCFv */ BOOL daAlink_c::checkMidnaDisappearMode() const { return mProcID == PROC_WOLF_DIG_THROUGH || @@ -4160,7 +4943,6 @@ BOOL daAlink_c::checkWolfLieContinue(int param_0) { return false; } - /* 801372B4-80137330 131BF4 007C+00 3/3 0/0 0/0 .text checkNextActionWolfFromLie__9daAlink_cFv */ int daAlink_c::checkNextActionWolfFromLie() { if (checkNextActionWolf(0)) { @@ -4223,7 +5005,6 @@ int daAlink_c::procWolfLieStartInit(int param_0) { return 1; } - /* 8013753C-80137634 131E7C 00F8+00 1/0 0/0 0/0 .text procWolfLieStart__9daAlink_cFv */ int daAlink_c::procWolfLieStart() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; @@ -4254,9 +5035,13 @@ int daAlink_c::procWolfLieStart() { */ // NONMATCHING - regalloc int daAlink_c::procWolfLieMoveInit(int param_0) { - BOOL var_r30 = mProcID == PROC_TALK; - BOOL var_r29 = checkUnderMove0BckNoArcWolf(WANM_CROUCH_WALK) == FALSE; - BOOL var_r28 = dComIfGp_checkPlayerStatus0(0, 0x2000); + BOOL var_r28; + BOOL var_r29; + BOOL var_r30; + + var_r30 = mProcID == PROC_TALK; + var_r29 = checkUnderMove0BckNoArcWolf(WANM_CROUCH_WALK) == FALSE; + var_r28 = dComIfGp_checkPlayerStatus0(0, 0x2000) != 0 ? TRUE : FALSE; if (!commonProcInitNotSameProc(PROC_WOLF_LIE_MOVE)) { return 0; @@ -4312,9 +5097,8 @@ int daAlink_c::procWolfLieMove() { /* 80137C90-80137D4C 1325D0 00BC+00 1/1 0/0 0/0 .text procWolfLieAutoMoveInit__9daAlink_cFiP4cXyz */ -// NONMATCHING - regalloc int daAlink_c::procWolfLieAutoMoveInit(int param_0, cXyz* param_1) { - BOOL var_r30 = dComIfGp_checkPlayerStatus0(0, 0x2000); + BOOL var_r30 = dComIfGp_checkPlayerStatus0(0, 0x2000) != 0 ? TRUE : FALSE; commonProcInit(PROC_WOLF_LIE_AUTO_MOVE); field_0x37c8 = *param_1; @@ -4385,7 +5169,6 @@ void daAlink_c::setSpeedAndAngleSwimWolf() { } } - /* 80138188-801381F8 132AC8 0070+00 2/2 0/0 0/0 .text getWolfSwimMoveAnmSpeed__9daAlink_cFv */ f32 daAlink_c::getWolfSwimMoveAnmSpeed() { f32 anm_speed = fabsf(mNormalSpeed) / field_0x594; @@ -4406,7 +5189,6 @@ f32 daAlink_c::getWolfSwimMoveAnmSpeed() { return anm_speed; } - /* 801381F8-801383D8 132B38 01E0+00 2/2 0/0 0/0 .text decideDoStatusSwimWolf__9daAlink_cFv */ int daAlink_c::decideDoStatusSwimWolf() { setTalkStatus(); @@ -4450,7 +5232,6 @@ int daAlink_c::decideDoStatusSwimWolf() { return 0; } - /* 801383D8-80138484 132D18 00AC+00 2/2 0/0 0/0 .text procWolfSwimUpInit__9daAlink_cFv */ int daAlink_c::procWolfSwimUpInit() { commonProcInit(PROC_WOLF_SWIM_UP); @@ -4524,7 +5305,6 @@ int daAlink_c::procWolfSwimWaitInit(int param_0) { return 1; } - /* 80138644-8013871C 132F84 00D8+00 1/0 0/0 0/0 .text procWolfSwimWait__9daAlink_cFv */ int daAlink_c::procWolfSwimWait() { if (mDemo.getDemoMode() == 6 || mDemo.getDemoMode() == 8) { @@ -4787,9 +5567,7 @@ void daAlink_c::resetWolfBallGrab() { } } - /* 80139048-8013911C 133988 00D4+00 1/1 0/0 0/0 .text checkWolfLockData__9daAlink_cFv */ -// NONMATCHING void daAlink_c::checkWolfLockData() { for (int i = 0; i < 10; i++) { mWolfLockAcKeep[i].setActor(); @@ -4797,15 +5575,14 @@ void daAlink_c::checkWolfLockData() { for (int i = 0; i < mWolfLockNum; i++) { if (mWolfLockAcKeep[i].getActor() == NULL) { - int var_r29 = i; - - for (; var_r29 < mWolfLockNum - 1; var_r29++) { - mWolfLockAcKeep[i].setData(mWolfLockAcKeep[i + 1].getActor()); + int var_r29; + for (var_r29 = i; var_r29 < mWolfLockNum - 1; var_r29++) { + mWolfLockAcKeep[var_r29].setData(mWolfLockAcKeep[var_r29 + 1].getActor()); } mWolfLockAcKeep[var_r29].clearData(); - mWolfLockNum--; i--; + mWolfLockNum--; } } } @@ -4968,7 +5745,6 @@ BOOL daAlink_c::setWolfEnemyHangBitePos(fopEn_enemy_c* i_enemy) { return 0; } - /* ############################################################################################## */ /* 804256EC-804256F8 05240C 000C+00 0/1 0/0 0/0 .bss @50952 */ #pragma push @@ -4990,7 +5766,6 @@ void daAlink_c::setWolfBiteDamage(fopEn_enemy_c* i_enemy) { dComIfGp_getVibration().StartShock(3, 31, cXyz(0.0f, 1.0f, 0.0f)); } - /* 801397A4-801398A8 1340E4 0104+00 1/1 0/0 0/0 .text checkWolfLockAttackChargeState__9daAlink_cFv */ BOOL daAlink_c::checkWolfLockAttackChargeState() { @@ -5155,7 +5930,6 @@ int daAlink_c::procWolfRollAttackMove() { return 1; } - /* 80139DE0-8013A4F8 134720 0718+00 5/5 0/0 0/0 .text procWolfJumpAttackInit__9daAlink_cFi */ int daAlink_c::procWolfJumpAttackInit(int param_0) { // NONMATCHING @@ -5244,7 +6018,6 @@ int daAlink_c::procWolfJumpAttack() { return 1; } - /* 8013A7EC-8013A8A0 13512C 00B4+00 2/2 0/0 0/0 .text procWolfJumpAttackKickInit__9daAlink_cFv */ int daAlink_c::procWolfJumpAttackKickInit() { commonProcInit(PROC_WOLF_JUMP_AT_KICK); @@ -5361,7 +6134,6 @@ int daAlink_c::procWolfJumpAttackSlideLand() { return 1; } - /* 8013AC44-8013ACF4 135584 00B0+00 1/1 0/0 0/0 .text * procWolfJumpAttackNormalLandInit__9daAlink_cFi */ int daAlink_c::procWolfJumpAttackNormalLandInit(int param_0) { @@ -5547,7 +6319,6 @@ int daAlink_c::procWolfWaitAttack() { return 1; } - /* 8013B2A0-8013B424 135BE0 0184+00 5/5 0/0 0/0 .text procWolfRollAttackInit__9daAlink_cFii */ int daAlink_c::procWolfRollAttackInit(int param_0, int param_1) { commonProcInit(PROC_WOLF_ROLL_ATTACK); @@ -5591,7 +6362,6 @@ int daAlink_c::procWolfRollAttackInit(int param_0, int param_1) { return 1; } - /* 8013B424-8013B528 135D64 0104+00 1/0 0/0 0/0 .text procWolfRollAttack__9daAlink_cFv */ int daAlink_c::procWolfRollAttack() { if (checkWolfGroundSpecialMode()) { @@ -5619,7 +6389,6 @@ int daAlink_c::procWolfRollAttack() { return 1; } - /* 8013B528-8013B808 135E68 02E0+00 1/1 0/0 0/0 .text procWolfDownAttackInit__9daAlink_cFv */ int daAlink_c::procWolfDownAttackInit() { commonProcInit(PROC_WOLF_DOWN_ATTACK); @@ -5661,7 +6430,6 @@ int daAlink_c::procWolfDownAttackInit() { return 1; } - /* 8013B808-8013B964 136148 015C+00 1/0 0/0 0/0 .text procWolfDownAttack__9daAlink_cFv */ int daAlink_c::procWolfDownAttack() { if (mLinkAcch.ChkGroundHit() && speed.y <= 0.0f) { @@ -5687,7 +6455,6 @@ int daAlink_c::procWolfDownAttack() { return 1; } - /* 8013B964-8013BA44 1362A4 00E0+00 1/1 0/0 0/0 .text * procWolfDownAtLandInit__9daAlink_cFP13fopEn_enemy_c */ int daAlink_c::procWolfDownAtLandInit(fopEn_enemy_c* i_enemy) { @@ -5706,7 +6473,6 @@ int daAlink_c::procWolfDownAtLandInit(fopEn_enemy_c* i_enemy) { return 1; } - /* 8013BA44-8013BC94 136384 0250+00 1/0 0/0 0/0 .text procWolfDownAtLand__9daAlink_cFv */ int daAlink_c::procWolfDownAtLand() { if (checkWolfGroundSpecialMode()) { @@ -5745,7 +6511,6 @@ int daAlink_c::procWolfDownAtLand() { return 1; } - /* 8013BC94-8013BD54 1365D4 00C0+00 1/1 0/0 0/0 .text procWolfDownAtMissLandInit__9daAlink_cFv */ int daAlink_c::procWolfDownAtMissLandInit() { commonProcInit(PROC_WOLF_DOWN_AT_MISS_LAND); @@ -5761,7 +6526,6 @@ int daAlink_c::procWolfDownAtMissLandInit() { return 1; } - /* 8013BD54-8013BE24 136694 00D0+00 1/0 0/0 0/0 .text procWolfDownAtMissLand__9daAlink_cFv */ int daAlink_c::procWolfDownAtMissLand() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; @@ -5785,7 +6549,6 @@ int daAlink_c::procWolfDownAtMissLand() { } /* 8013BE24-8013C3E4 136764 05C0+00 2/2 0/0 0/0 .text procWolfLockAttackInit__9daAlink_cFi */ -// NONMATCHING - wrong float regist + float literals int daAlink_c::procWolfLockAttackInit(int param_0) { commonProcInit(PROC_WOLF_LOCK_ATTACK); setSingleAnimeWolfParam(WANM_ATTACK_A_START, &daAlinkHIO_wlAtLock_c0::m.field_0x0); @@ -5794,7 +6557,8 @@ int daAlink_c::procWolfLockAttackInit(int param_0) { mProcVar5.field_0x3012 = 1; if (param_0 == 0) { - mProcVar1.field_0x300a = static_cast(mWolfLockAcKeep[0].getActor())->getMaxLockAttack(); + mProcVar1.field_0x300a = + static_cast(mWolfLockAcKeep[0].getActor())->getMaxLockAttack(); } mProcVar1.field_0x300a--; @@ -5808,49 +6572,52 @@ int daAlink_c::procWolfLockAttackInit(int param_0) { mWolfLockAcKeep[0].clearData(); mProcVar5.field_0x3012 = 0; } - - shape_angle.y = cLib_targetAngleY(¤t.pos,&field_0x37c8); + + shape_angle.y = cLib_targetAngleY(¤t.pos, &field_0x37c8); current.angle.y = shape_angle.y; + cXyz l_eyePosDelta = field_0x37c8 - eyePos; if (l_eyePosDelta.y < 10.0f) { l_eyePosDelta.y = 10.0f; - } else { - if (l_eyePosDelta.y > daAlinkHIO_wlAtLock_c0::m.field_0x4C) - l_eyePosDelta.y = daAlinkHIO_wlAtLock_c0::m.field_0x4C; + } else if (l_eyePosDelta.y > daAlinkHIO_wlAtLock_c0::m.field_0x4C) { + l_eyePosDelta.y = daAlinkHIO_wlAtLock_c0::m.field_0x4C; } - f32 tmp_f = l_eyePosDelta.absXZ(); - - if (tmp_f > daAlinkHIO_wlAtLock_c0::m.field_0x50) { - f32 tmp = daAlinkHIO_wlAtLock_c0::m.field_0x50 / tmp_f; - l_eyePosDelta.x *= tmp; - l_eyePosDelta.z *= tmp; + f32 var_f30 = l_eyePosDelta.absXZ(); + if (var_f30 > daAlinkHIO_wlAtLock_c0::m.field_0x50) { + var_f30 = daAlinkHIO_wlAtLock_c0::m.field_0x50 / var_f30; + l_eyePosDelta.x *= var_f30; + l_eyePosDelta.z *= var_f30; } - f32 abs = l_eyePosDelta.abs() / daAlinkHIO_wlAtLock_c0::m.field_0x28.mCheckFrame; - - if (abs < 1.0f) - abs = 1.0f; - - f32 check_frame = daAlinkHIO_wlAtLock_c0::m.field_0x28.mCheckFrame / abs; - mNormalSpeed = check_frame * l_eyePosDelta.absXZ(); - setSpecialGravity((l_eyePosDelta.y * -2.0f) / (abs * abs), maxFallSpeed, 0); - speed.y = -gravity * abs; - mProcVar0.field_0x3008 = abs; - setCylAtParam(0x8000000,dCcG_At_Spl_UNK_0,1,4,6,daAlinkHIO_wlAtLock_c0::m.field_0x40,daAlinkHIO_wlAtLock_c0::m.field_0x44); + f32 var_f29 = l_eyePosDelta.abs(); + f32 var_f31 = var_f29 / daAlinkHIO_wlAtLock_c0::m.field_0x28.mCheckFrame; + if (var_f31 < 1.0f) + var_f31 = 1.0f; + + f32 var_f28 = daAlinkHIO_wlAtLock_c0::m.field_0x28.mCheckFrame / var_f29; + mNormalSpeed = var_f28 * l_eyePosDelta.absXZ(); + setSpecialGravity((l_eyePosDelta.y * -2.0f) / (var_f31 * var_f31), maxFallSpeed, 0); + speed.y = -gravity * var_f31; + mProcVar0.field_0x3008 = var_f31; + + setCylAtParam(0x8000000, dCcG_At_Spl_UNK_0, 1, 4, 6, daAlinkHIO_wlAtLock_c0::m.field_0x40, + daAlinkHIO_wlAtLock_c0::m.field_0x44); field_0x3438 = daAlinkHIO_wlAtLock_c0::m.field_0x3C; + setCutType(CUT_TYPE_WOLF_LOCK); voiceStart(Z2SE_WL_V_ATTACK_THRUST); - dComIfGp_setPlayerStatus1(0,0x1000000); - dComIfGp_particle_set(0x247,¤t.pos,¤t.angle,0); + + dComIfGp_setPlayerStatus1(0, 0x1000000); + dComIfGp_particle_set(0x247, ¤t.pos, ¤t.angle, 0); return 1; } /* 8013C3E4-8013C630 136D24 024C+00 1/0 0/0 0/0 .text procWolfLockAttack__9daAlink_cFv */ int daAlink_c::procWolfLockAttack() { BOOL var_r29 = false; - + // check if any field_0x850 clylinders collided with at shields for (int i = 0; i < 3; i++) { if (checkAtShieldHit(field_0x850[i])) { @@ -5859,7 +6626,6 @@ int daAlink_c::procWolfLockAttack() { } } - // early return checks for colliding with at shields or if the actor hit is not freezard if (var_r29 || (checkAtShieldHit(mAtCyl) && (mAtCyl.GetAtHitAc() == NULL || fopAcM_GetName(mAtCyl.GetAtHitAc()) != PROC_E_FB))) @@ -5909,7 +6675,6 @@ int daAlink_c::procWolfLockAttack() { return 1; } - /* 8013C630-8013C7A4 136F70 0174+00 1/1 0/0 0/0 .text procWolfLockAttackTurnInit__9daAlink_cFi */ int daAlink_c::procWolfLockAttackTurnInit(int param_0) { commonProcInit(PROC_WOLF_LOCK_ATTACK_TURN); @@ -5945,7 +6710,6 @@ int daAlink_c::procWolfLockAttackTurnInit(int param_0) { return 1; } - /* 8013C7A4-8013C8C8 1370E4 0124+00 1/0 0/0 0/0 .text procWolfLockAttackTurn__9daAlink_cFv */ int daAlink_c::procWolfLockAttackTurn() { field_0x2f99 = 4; @@ -5980,7 +6744,6 @@ int daAlink_c::procWolfLockAttackTurn() { return 1; } - /* 8013C8C8-8013C9EC 137208 0124+00 1/1 0/0 0/0 .text procWolfAttackReverseInit__9daAlink_cFv */ int daAlink_c::procWolfAttackReverseInit() { commonProcInit(PROC_WOLF_ATTACK_REVERSE); @@ -6000,7 +6763,6 @@ int daAlink_c::procWolfAttackReverseInit() { return 1; } - /* 8013C9EC-8013CB48 13732C 015C+00 1/0 0/0 0/0 .text procWolfAttackReverse__9daAlink_cFv */ int daAlink_c::procWolfAttackReverse() { @@ -6021,9 +6783,7 @@ int daAlink_c::procWolfAttackReverse() { } else if (frameCtrl_p->getFrame() > daAlinkHIO_wlAttack_c0::m.mLandAnm.mCheckFrame) { checkNextActionWolf(1); } - } else if ((mLinkAcch.ChkGroundHit() || checkEndResetFlg2(ERFLG2_UNK_100)) && - checkModeFlg(2)) - { + } else if ((mLinkAcch.ChkGroundHit() || checkEndResetFlg2(ERFLG2_UNK_100)) && checkModeFlg(2)) { if (checkWolfLandAction(0)) { return 1; } @@ -6039,7 +6799,6 @@ int daAlink_c::procWolfAttackReverse() { return 1; } - /* 8013CB48-8013CC5C 137488 0114+00 2/2 0/0 0/0 .text procWolfEnemyThrowInit__9daAlink_cFi */ int daAlink_c::procWolfEnemyThrowInit(int param_0) { commonProcInit(PROC_WOLF_ENEMY_THROW); @@ -6071,7 +6830,6 @@ int daAlink_c::procWolfEnemyThrowInit(int param_0) { return 1; } - /* 8013CC5C-8013CCF4 13759C 0098+00 1/0 0/0 0/0 .text procWolfEnemyThrow__9daAlink_cFv */ int daAlink_c::procWolfEnemyThrow() { if (checkWolfGroundSpecialMode()) { @@ -6196,7 +6954,6 @@ int daAlink_c::procWolfEnemyHangBite() { return 1; } - /* 8013D0D4-8013D3FC 137A14 0328+00 1/1 0/0 0/0 .text procWolfGrabUpInit__9daAlink_cFv */ int daAlink_c::procWolfGrabUpInit() { if (fopAcM_checkCarryNow(field_0x27f4)) { @@ -6251,7 +7008,6 @@ int daAlink_c::procWolfGrabUpInit() { return 1; } - /* 8013D3FC-8013D588 137D3C 018C+00 1/0 0/0 0/0 .text procWolfGrabUp__9daAlink_cFv */ int daAlink_c::procWolfGrabUp() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; @@ -6287,7 +7043,6 @@ int daAlink_c::procWolfGrabUp() { return 1; } - /* 8013D588-8013D65C 137EC8 00D4+00 2/2 0/0 0/0 .text procWolfGrabPutInit__9daAlink_cFv */ int daAlink_c::procWolfGrabPutInit() { @@ -6355,7 +7110,6 @@ int daAlink_c::procWolfGrabPut() { return 1; } - /* 8013D818-8013D86C 138158 0054+00 1/1 0/0 0/0 .text procWolfGrabThrowInit__9daAlink_cFv */ int daAlink_c::procWolfGrabThrowInit() { @@ -6423,7 +7177,6 @@ int daAlink_c::procWolfPushInit() { return 1; } - /* 8013DA8C-8013DB58 1383CC 00CC+00 1/0 0/0 0/0 .text procWolfPush__9daAlink_cFv */ int daAlink_c::procWolfPush() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; @@ -6432,8 +7185,7 @@ int daAlink_c::procWolfPush() { if (frameCtrl->checkAnmEnd()) { if (mProcVar2.field_0x300c != 0) { - setSingleAnimeWolf(WANM_PUSH_LIGHT, 1.0f, 0.0f, - mProcVar3.field_0x300e, 3.0f); + setSingleAnimeWolf(WANM_PUSH_LIGHT, 1.0f, 0.0f, mProcVar3.field_0x300e, 3.0f); mUnderFrameCtrl[0].setAttribute(0); mProcVar2.field_0x300c = 0; } else { @@ -6533,7 +7285,6 @@ int daAlink_c::procWolfCargoCarry() { return 1; } - /* 8013DDF8-8013DE70 138738 0078+00 1/1 0/0 0/0 .text procWolfChainUpInit__9daAlink_cFv */ int daAlink_c::procWolfChainUpInit() { @@ -6563,8 +7314,7 @@ int daAlink_c::procWolfChainUp() { fopAc_ac_c* old_actor = field_0x2844.getActor(); procWolfWaitInit(); - setUpperAnimeBaseSpeed(m_wlAnmDataTable[WANM_CHAIN_PULL].field_0x0, 0.0f, - 3.0f); + setUpperAnimeBaseSpeed(m_wlAnmDataTable[WANM_CHAIN_PULL].field_0x0, 0.0f, 3.0f); if (old_actor != NULL) { field_0x2fa3 = old_2fa3; @@ -6673,7 +7423,6 @@ int daAlink_c::procWolfGanonCatch() { return 1; } - /* 8013E240-8013E2A8 138B80 0068+00 1/1 0/0 0/0 .text procWolfChainReadyInit__9daAlink_cFv */ int daAlink_c::procWolfChainReadyInit() { commonProcInit(PROC_WOLF_CHAIN_READY); @@ -6706,8 +7455,8 @@ int daAlink_c::procWolfChainReady() { mProcVar2.field_0x300c = angle >> 1; mNormalSpeed = dist_xz * 40.0f / dist + 1.0f; mProcVar0.field_0x3008 = dist_xz / mNormalSpeed + 1.0f; - speed.y = (vec1.y - gravity * 0.5f * mProcVar0.field_0x3008 * mProcVar0.field_0x3008) - / mProcVar0.field_0x3008; + speed.y = (vec1.y - gravity * 0.5f * mProcVar0.field_0x3008 * mProcVar0.field_0x3008) / + mProcVar0.field_0x3008; } else { mProcVar0.field_0x3008--; if (chain->getJumpAimPos().abs2(field_0x34e0) < 10000.0f) { @@ -6719,7 +7468,6 @@ int daAlink_c::procWolfChainReady() { return 1; } - /* 8013E6C0-8013E80C 139000 014C+00 1/1 0/0 0/0 .text procWolfChainWaitInit__9daAlink_cFv */ int daAlink_c::procWolfChainWaitInit() { @@ -6741,17 +7489,13 @@ int daAlink_c::procWolfChainWaitInit() { } else { mNormalSpeed *= 0.5f; } - field_0x37c8.set( - mNormalSpeed * cM_ssin(shape_angle.y), - 0.0f, - mNormalSpeed * cM_scos(shape_angle.y) - ); + field_0x37c8.set(mNormalSpeed * cM_ssin(shape_angle.y), 0.0f, + mNormalSpeed * cM_scos(shape_angle.y)); mNormalSpeed = 0.0f; voiceStart(Z2SE_WL_V_BITE_HANG); return 1; } - /* 8013E80C-8013ED44 13914C 0538+00 1/0 0/0 0/0 .text procWolfChainWait__9daAlink_cFv */ int daAlink_c::procWolfChainWait() { daObjWchain_c* chain = static_cast(field_0x280c.getActor()); @@ -6778,9 +7522,9 @@ int daAlink_c::procWolfChainWait() { if (mProcVar0.field_0x3008 < 0) { field_0x3478 = chain->getDownOffset(); } else { - field_0x3478 = (chain->getSwitchOffset() + chain->getLastOffset() * 0.5f) - + (mProcVar0.field_0x3008 * 0.5f * 0.05f + 0.5f) - * chain->getLastOffset() * cM_scos(mProcVar0.field_0x3008 * 0x3000); + field_0x3478 = (chain->getSwitchOffset() + chain->getLastOffset() * 0.5f) + + (mProcVar0.field_0x3008 * 0.5f * 0.05f + 0.5f) * chain->getLastOffset() * + cM_scos(mProcVar0.field_0x3008 * 0x3000); if (mProcVar0.field_0x3008 == 0) { chain->onEndFlg(); } @@ -6832,23 +7576,289 @@ int daAlink_c::procWolfChainWait() { return 1; } - /* 8013ED44-8013F1F0 139684 04AC+00 1/1 0/0 0/0 .text procWolfDigInit__9daAlink_cFv */ int daAlink_c::procWolfDigInit() { - // NONMATCHING - return 0; + BOOL var_r28 = 1; + + if (checkEndResetFlg1(ERFLG1_UNK_100000) && field_0x27f4 != NULL && fopAcM_GetName(field_0x27f4) == PROC_Obj_Digpl) { + int type = ((daObjDigpl_c*)field_0x27f4)->getType(); + if (type == 0 || type == 2 || type == 3) { + var_r28 = 0; + } + } + + if (!checkEndResetFlg1(ERFLG1_UNK_100000)) { + var_r28 = 0; + } + + if (var_r28) { + if (!dComIfGp_event_compulsory(this, NULL, 0xFFFF)) { + return 0; + } + mDemo.setSpecialDemoType(); + } + + commonProcInit(PROC_WOLF_DIG); + + mFallVoiceInit = var_r28; + + if (field_0x27f4 != NULL) { + mProcVar1.mDigActorName = fopAcM_GetName(field_0x27f4); + } else { + mProcVar1.mDigActorName = PROC_ALINK; + } + + fopAc_ac_c* var_r29; + if (checkEndResetFlg1(ERFLG1_UNK_100000) && mProcVar1.mDigActorName != PROC_Obj_Lv4DigSand && mProcVar1.mDigActorName != PROC_Obj_DigSnow) { + var_r29 = field_0x27f4; + } else { + var_r29 = NULL; + } + + mProcVar5.field_0x3012 = 0; + mProcVar4.mDigExitID = 0; + + if (var_r29 != NULL) { + if (fopAcM_GetName(var_r29) == PROC_Obj_Digpl) { + mProcVar2.mDigType = ((daObjDigpl_c*)var_r29)->getType(); + mProcVar4.mDigExitID = ((daObjDigpl_c*)var_r29)->getSceneNum(); + field_0x280c.setData(var_r29); + mProcVar5.field_0x3012 = 1; + } else { + field_0x280c.clearData(); + mProcVar2.mDigType = 3; + } + + s16 var_r27 = fopAcM_searchActorAngleY(this, var_r29); + if (abs((s16)(var_r27 - shape_angle.y)) > 0x4000) { + var_r27 += 0x8000; + } + + shape_angle.y = var_r27; + current.angle.y = shape_angle.y; + current.pos.x = var_r29->current.pos.x - (50.0f * cM_ssin(shape_angle.y)); + current.pos.z = var_r29->current.pos.z - (50.0f * cM_scos(shape_angle.y)); + field_0x37c8 = var_r29->current.pos; + } else { + mProcVar2.mDigType = 4; + + if (checkEndResetFlg1(ERFLG1_UNK_100000)) { + if (mProcVar1.mDigActorName == PROC_Obj_DigSnow) { + ((daObjDigSnow_c* )field_0x27f4)->startDig(); + } else if (mProcVar1.mDigActorName == PROC_Obj_Lv4DigSand) { + ((daObjL4DigSand_c*)field_0x27f4)->startDig(); + } + field_0x280c.setData(field_0x27f4); + } else { + field_0x280c.clearData(); + } + + field_0x37c8.set(current.pos.x + (50.0f * cM_ssin(shape_angle.y)), current.pos.y, current.pos.z + (50.0f * cM_scos(shape_angle.y))); + } + + s16 var_r26; + if (mProcVar2.mDigType == 0 || mProcVar2.mDigType == 2 || mProcVar2.mDigType == 3) { + var_r26 = 59; + field_0x3478 = 51.0f; + } else if (mProcVar2.mDigType == 1) { + var_r26 = 33; + field_0x3478 = 100.0f; + dCam_getBody()->SetTrimTypeForce(3); + } else { + var_r26 = daAlinkHIO_wlChain_c0::m.field_0x14.mEndFrame; + field_0x3478 = 66.0f; + } + + f32 var_f31; + if (checkEndResetFlg1(ERFLG1_UNK_100000)) { + var_f31 = 0.0f; + } else { + var_f31 = 29.0f; + var_r26 = 59; + } + + setSingleAnimeWolf(WANM_DIG, daAlinkHIO_wlChain_c0::m.field_0x14.mSpeed, var_f31, var_r26, daAlinkHIO_wlChain_c0::m.field_0x14.mInterpolation); + mNormalSpeed = 0.0f; + field_0x3588 = l_wolfBaseAnime; + mProcVar3.mDigChangeArea = false; + + cXyz sp8(field_0x37c8.x, 10.0f + field_0x37c8.y, field_0x37c8.z); + mLinkGndChk.SetPos(&sp8); + + f32 temp_f1 = dComIfG_Bgsp().GroundCross(&mLinkGndChk); + if (field_0x37c8.y - temp_f1 < l_autoUpHeight) { + mPolyInfo2.SetPolyInfo(mLinkGndChk); + field_0x37c8.y = temp_f1; + } else { + mPolyInfo2.SetPolyInfo(mLinkAcch.m_gnd); + } + + field_0x37d4 = field_0x37c8; + if (fopAcM_wt_c::waterCheck(&field_0x37c8) && fopAcM_wt_c::getPolyAtt0() != 6 && fopAcM_wt_c::getWaterY() > field_0x37c8.y) { + field_0x37d4.y = fopAcM_wt_c::getWaterY(); + field_0x3198 = 7; + mPolyInfo2.SetPolyInfo(*fopAcM_wt_c::getWaterCheck()); + } else { + field_0x3198 = dComIfG_Bgsp().GetPolyAtt0(mPolyInfo2); + } + + field_0x32cc = 0; + mProcVar0.field_0x3008 = 0; + return 1; } /* 8013F1F0-8013F4A8 139B30 02B8+00 1/0 0/0 0/0 .text procWolfDig__9daAlink_cFv */ int daAlink_c::procWolfDig() { - // NONMATCHING - return 0; + daPy_frameCtrl_c* frame_ctrl = &mUnderFrameCtrl[0]; + + fopAc_ac_c* dig_actor; + if (mProcVar5.field_0x3012 != 0) { + dig_actor = field_0x280c.getActor(); + } else { + dig_actor = NULL; + } + + if (mProcVar2.mDigType == 1) { + dCam_getBody()->SetTrimTypeForce(3); + } + + field_0x2f99 = 4; + onEndResetFlg1(ERFLG1_WOLF_EYE_KEEP); + + cXyz sp14(field_0x37c8); + dComIfG_Bgsp().MoveBgCrrPos(mLinkAcch.m_gnd, mLinkAcch.i_ChkGroundHit(), &field_0x37c8, NULL, NULL, false, false); + field_0x37d4 += field_0x37c8 - sp14; + + if (mProcVar3.mDigChangeArea) { + if (frame_ctrl->getFrame() >= 25.0f) { + onSceneChangeArea(mProcVar4.mDigExitID, 0xFF, NULL); + + if (dig_actor != NULL) { + ((daObjDigpl_c*)dig_actor)->onDigFlg(); + field_0x280c.clearData(); + } + } + + setWolfDigEffect(); + } else if (checkAnmEnd(frame_ctrl)) { + if (mProcVar2.mDigType == 1) { + setSingleAnimeWolfParam(WANM_DIG_IN, &daAlinkHIO_wlChain_c0::m.field_0x28); + mProcVar3.mDigChangeArea = true; + setWolfDigEffect(); + } else { + if (field_0x280c.getActor() != NULL) { + if (mProcVar1.mDigActorName == PROC_Obj_DigSnow) { + ((daObjDigSnow_c*)field_0x280c.getActor())->endDig(); + } else if (mProcVar1.mDigActorName == PROC_Obj_Lv4DigSand) { + ((daObjL4DigSand_c*)field_0x280c.getActor())->endDig(); + } + } + + if (checkEventRun() && mFallVoiceInit != 0) { + resetSpecialEvent(); + } else { + procWolfWaitInit(); + } + } + } else { + if (frame_ctrl->checkPass(field_0x3478) && dig_actor != NULL) { + ((daObjDigpl_c*)dig_actor)->onDigFlg(); + field_0x280c.clearData(); + } + + if (frame_ctrl->getFrame() >= 11.0f) { + if (frame_ctrl->getFrame() <= 41.0f) { + if (mProcVar0.field_0x3008 == 0) { + mProcVar0.field_0x3008 = 1; + seStartOnlyReverb(Z2SE_WOLF_DIG_HOLE); + } + + setWolfDigEffect(); + + if (checkMidnaRide()) { + getMidnaActor()->setForceNeckAimPos(field_0x37c8); + } + } + } + } + + return 1; } /* 8013F4A8-8013F7C4 139DE8 031C+00 2/2 0/0 0/0 .text procWolfDigThroughInit__9daAlink_cFi */ int daAlink_c::procWolfDigThroughInit(int param_0) { - // NONMATCHING - return 0; + if (param_0 != 0) { + mDemo.setSpecialDemoType(); + } else if (!dComIfGp_event_compulsory(this, NULL, 0xFFFF)) { + return 0; + } else { + mDemo.setSpecialDemoType(); + } + + commonProcInit(PROC_WOLF_DIG_THROUGH); + + int var_r27 = field_0x2fbb; + + if (param_0 == 0) { + if (fopAcM_seenActorAngleY(field_0x27f4, this) <= 0x4000) { + shape_angle.y = field_0x27f4->shape_angle.y + 0x8000; + } else { + shape_angle.y = field_0x27f4->shape_angle.y; + } + + current.angle.y = shape_angle.y; + current.pos.x = field_0x27f4->current.pos.x; + current.pos.z = field_0x27f4->current.pos.z; + + ((daObjDigholl_c*)field_0x27f4)->onDigStart(); + + mProcVar4.field_0x3010 = ((daObjDigholl_c*)field_0x27f4)->getSceneNum(); + if (mProcVar4.field_0x3010 >= 0) { + field_0x3198 = 1; + } else { + field_0x3198 = 3; + } + + dCam_getBody()->StartEventCamera(0x1E, fopAcM_GetID(this), "Type", 1, &field_0x3198, 0); + + cXyz sp8(current.pos.x, 30.0f + field_0x27f4->current.pos.y, current.pos.z); + if (fopAcM_gc_c::gndCheck(&sp8)) { + var_r27 = fopAcM_gc_c::getPolyAtt0(); + } + } else { + field_0x3198 = -1; + mProcVar4.field_0x3010 = -1; + current.pos.x -= 30.0f * cM_ssin(shape_angle.y); + current.pos.z -= 30.0f * cM_scos(shape_angle.y); + } + + mProcVar5.field_0x3012 = param_0; + + u16* var_r29; + if (var_r27 == 13) { + var_r29 = snowID; + } else { + var_r29 = smokeID; + } + + for (int i = 0; i < 4; i++) { + dComIfGp_particle_set(*var_r29, ¤t.pos, &shape_angle, NULL); + var_r29++; + } + + seStartOnlyReverb(Z2SE_WOLF_DIG_HOLE_THROUGH); + setSingleAnimeWolfBase(WANM_DIG_UNDER); + setFaceBasicTexture(FTANM_UNK_99); + + mNormalSpeed = 0.0f; + speed.y = 0.0f; + setSpecialGravity(0.0f, maxFallSpeed, 0); + + field_0x3588 = l_wolfBaseAnime; + field_0x2f99 = 4; + field_0x34d4 = l_wolfBaseAnime; + mProcVar3.field_0x300e = 0; + return 1; } /* 8013F7C4-8013F90C 13A104 0148+00 1/0 0/0 0/0 .text procWolfDigThrough__9daAlink_cFv */ @@ -6888,7 +7898,6 @@ int daAlink_c::procWolfDigThrough() { return 1; } - /* 8013F90C-8013FA14 13A24C 0108+00 1/1 0/0 0/0 .text setSmellSave__9daAlink_cFv */ void daAlink_c::setSmellSave() { if (dComIfGs_getCollectSmell() == SMELL_MEDICINE) { @@ -6965,7 +7974,6 @@ int daAlink_c::procWolfGetSmellInit() { return 1; } - /* 8013FC24-8013FF28 13A564 0304+00 1/0 0/0 0/0 .text procWolfGetSmell__9daAlink_cFv */ int daAlink_c::procWolfGetSmell() { kytag03_class* kytag3_p = (kytag03_class*)field_0x280c.getActor(); diff --git a/src/d/actor/d_a_e_s1.cpp b/src/d/actor/d_a_e_s1.cpp index c1480727bfb..1f92b24fe33 100644 --- a/src/d/actor/d_a_e_s1.cpp +++ b/src/d/actor/d_a_e_s1.cpp @@ -1,1895 +1,2315 @@ /** * @file d_a_e_s1.cpp - * -*/ + * + */ #include "d/actor/d_a_e_s1.h" -#include "d/d_cc_d.h" -#include "dol2asm.h" -#include "d/d_camera.h" +#include "SSystem/SComponent/c_math.h" +#include "Z2AudioLib/Z2Instances.h" +#include "d/actor/d_a_player.h" +#include "d/d_com_inf_game.h" +#include "d/d_path.h" +#include "d/d_s_play.h" +UNK_REL_DATA +#include "f_op/f_op_actor_enemy.h" +#define ANM_ATTACK 5 +#define ANM_ATTACK_02 6 +#define ANM_DAMAGED 7 +#define ANM_DASH_01 8 +#define ANM_DASH_02 9 +#define ANM_DEAD_02 10 +#define ANM_DEAD_03 11 +#define ANM_DEAD_04 12 +#define ANM_DEADWAIT_02 13 +#define ANM_DEADWAIT_03 14 +#define ANM_DEADWAIT_04 15 +#define ANM_DEADWAKE_02 16 +#define ANM_DEADWAKE_03 17 +#define ANM_DEADWAKE_04 18 +#define ANM_DOWN 19 +#define ANM_HANGED 20 +#define ANM_HANG_DAMAGE 21 +#define ANM_HANG_BRUSH 22 +#define ANM_HANG_BRUSH2 23 +#define ANM_HANG_WAIT 24 +#define ANM_SHOUT 25 +#define ANM_SHRINK 26 +#define ANM_SHRINK_DOWN 27 +#define ANM_STICK 28 +#define ANM_WAIT_01 29 +#define ANM_WAIT_02 30 +#define ANM_WALK 31 -// -// Forward References: -// - -extern "C" void __ct__12daE_S1_HIO_cFv(); -extern "C" static void anm_init__FP10e_s1_classifUcf(); -extern "C" static void daE_S1_Draw__FP10e_s1_class(); -extern "C" static void pl_check__FP10e_s1_classf(); -extern "C" static void pl_at_check__FP10e_s1_classf(); -extern "C" static void path_check__FP10e_s1_class(); -extern "C" static void path_check2__FP10e_s1_class(); -extern "C" static void s_last_sub__FPvPv(); -extern "C" static void damage_check__FP10e_s1_class(); -extern "C" static void e_s1_wait__FP10e_s1_class(); -extern "C" static void e_s1_roof__FP10e_s1_class(); -extern "C" static void e_s1_fight_run__FP10e_s1_class(); -extern "C" static void e_s1_fight__FP10e_s1_class(); -extern "C" static void e_s1_bibiri__FP10e_s1_class(); -extern "C" static void e_s1_damage__FP10e_s1_class(); -extern "C" static void e_s1_path__FP10e_s1_class(); -extern "C" static void s_down_sub__FPvPv(); -extern "C" static void s_fail_sub__FPvPv(); -extern "C" static void all_fail_check__FP10e_s1_class(); -extern "C" static void s_allfail_sub__FPvPv(); -extern "C" static void all_fail__FP10e_s1_class(); -extern "C" static void s_allwakeup_sub__FPvPv(); -extern "C" static void s_posrevise_sub__FPvPv(); -extern "C" static void e_s1_failwait__FP10e_s1_class(); -extern "C" static void e_s1_fail__FP10e_s1_class(); -extern "C" static void e_s1_shout__FP10e_s1_class(); -extern "C" static void e_s1_warpappear__FP10e_s1_class(); -extern "C" static void ke_control__FP10e_s1_classP7s1_ke_sif(); -extern "C" static void ke_move__FP10e_s1_classP19mDoExt_3DlineMat0_cP7s1_ke_sif(); -extern "C" static void e_s1_wolfbite__FP10e_s1_class(); -extern "C" static void action__FP10e_s1_class(); -extern "C" static void ke_set__FP10e_s1_class(); -extern "C" static void demo_camera__FP10e_s1_class(); -extern "C" static void anm_se_set__FP10e_s1_class(); -extern "C" static void body_eff_set__FP10e_s1_class(); -extern "C" static void daE_S1_Execute__FP10e_s1_class(); -extern "C" static bool daE_S1_IsDelete__FP10e_s1_class(); -extern "C" static void daE_S1_Delete__FP10e_s1_class(); -extern "C" static void useHeapInit__FP10fopAc_ac_c(); -extern "C" static void daE_S1_Create__FP10fopAc_ac_c(); -extern "C" void __dt__7s1_ke_sFv(); -extern "C" void __ct__7s1_ke_sFv(); -extern "C" void __ct__4cXyzFv(); -extern "C" void __dt__8cM3dGSphFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__8dCcD_SphFv(); -extern "C" void __ct__8dCcD_SphFv(); -extern "C" void __dt__10dCcD_GSttsFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" void __dt__12dBgS_AcchCirFv(); -extern "C" void __dt__10cCcD_GSttsFv(); -extern "C" void __dt__12daE_S1_HIO_cFv(); -extern "C" void __sinit_d_a_e_s1_cpp(); -extern "C" static void func_80780950(); -extern "C" static void func_80780958(); -extern "C" static void setMidnaBindEffect__FP13fopEn_enemy_cP15Z2CreatureEnemyP4cXyzP4cXyz(); -extern "C" void __dt__4cXyzFv(); -extern "C" extern char const* const d_a_e_s1__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_XrotS__FPA4_fs(); -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void mDoMtx_ZrotM__FPA4_fs(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void -__ct__16mDoExt_McaMorfSOFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiP10Z2CreatureUlUl(); -extern "C" void setAnm__16mDoExt_McaMorfSOFP15J3DAnmTransformiffff(); -extern "C" void play__16mDoExt_McaMorfSOFUlSc(); -extern "C" void entryDL__16mDoExt_McaMorfSOFv(); -extern "C" void modelCalc__16mDoExt_McaMorfSOFv(); -extern "C" void stopZelAnime__16mDoExt_McaMorfSOFv(); -extern "C" void init__19mDoExt_3DlineMat0_cFUsUsi(); -extern "C" void update__19mDoExt_3DlineMat0_cFiR8_GXColorP12dKy_tevstr_c(); -extern "C" void setMat__26mDoExt_3DlineMatSortPacketFP18mDoExt_3DlineMat_c(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void fopAc_IsActor__FPv(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_SetMin__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_SetMax__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistanceXZ__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_orderPotentialEvent__FP10fopAc_ac_cUsUsUs(); -extern "C" void fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc(); -extern "C" void fopAcM_otherBgCheck__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fpcEx_Search__FPFPvPv_PvPv(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfGp_getReverb__Fi(); -extern "C" void -dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj(); -extern "C" void isEventBit__11dSv_event_cCFUs(); -extern "C" void onSwitch__10dSv_info_cFii(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void __ct__9dJntCol_cFv(); -extern "C" void init__9dJntCol_cFP10fopAc_ac_cPC13dJntColData_cP8J3DModeli(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void reset__14dEvt_control_cFv(); -extern "C" void getEmitter__Q213dPa_control_c7level_cFUl(); -extern "C" void -set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void -set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void dPath_GetRoomPath__Fii(); -extern "C" void StartShock__12dVibration_cFii4cXyz(); -extern "C" void LineCross__4cBgSFP11cBgS_LinChk(); -extern "C" void GroundCross__4cBgSFP11cBgS_GndChk(); -extern "C" void __ct__12dBgS_AcchCirFv(); -extern "C" void SetWall__12dBgS_AcchCirFff(); -extern "C" void __dt__9dBgS_AcchFv(); -extern "C" void __ct__9dBgS_AcchFv(); -extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz(); -extern "C" void CrrPos__9dBgS_AcchFR4dBgS(); -extern "C" void __ct__11dBgS_GndChkFv(); -extern "C" void __dt__11dBgS_GndChkFv(); -extern "C" void __ct__11dBgS_LinChkFv(); -extern "C" void __dt__11dBgS_LinChkFv(); -extern "C" void Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void Move__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void __dt__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph(); -extern "C" void StartCAt__8dCcD_SphFR4cXyz(); -extern "C" void MoveCAt__8dCcD_SphFR4cXyz(); -extern "C" void at_power_check__FP11dCcU_AtInfo(); -extern "C" void cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo(); -extern "C" void Start__9dCamera_cFv(); -extern "C" void Stop__9dCamera_cFv(); -extern "C" void SetTrimSize__9dCamera_cFl(); -extern "C" void Set__9dCamera_cF4cXyz4cXyzfs(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void dKy_darkworld_check__Fv(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __pl__4cXyzCFRC3Vec(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void __ml__4cXyzCFf(); -extern "C" void cM_atan2s__Fff(); -extern "C" void cM_rndF__Ff(); -extern "C" void cM_rndFX__Ff(); -extern "C" void cM_initRnd2__Fiii(); -extern "C" void cM_rndF2__Ff(); -extern "C" void SetPos__11cBgS_GndChkFPC3Vec(); -extern "C" void SetPos__11cBgS_GndChkFPC4cXyz(); -extern "C" void __dt__13cBgS_PolyInfoFv(); -extern "C" void __dt__8cM3dGCirFv(); -extern "C" void SetC__8cM3dGSphFRC4cXyz(); -extern "C" void SetR__8cM3dGSphFf(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void cLib_addCalc0__FPfff(); -extern "C" void cLib_addCalcAngleS2__FPssss(); -extern "C" void MtxPosition__FP4cXyzP4cXyz(); -extern "C" void MtxPush__Fv(); -extern "C" void MtxPull__Fv(); -extern "C" void func_802807E0(); -extern "C" void __ct__15Z2CreatureEnemyFv(); -extern "C" void init__15Z2CreatureEnemyFP3VecP3VecUcUc(); -extern "C" void setLinkSearch__15Z2CreatureEnemyFb(); -extern "C" void setEnemyName__15Z2CreatureEnemyFPCc(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void checkPass__12J3DFrameCtrlFf(); -extern "C" void __destroy_arr(); -extern "C" void __construct_array(); -extern "C" void _savegpr_19(); -extern "C" void _savegpr_23(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_19(); -extern "C" void _restgpr_23(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__19mDoExt_3DlineMat0_c[5]; -extern "C" u8 saveBitLabels__16dSv_event_flag_c[1644 + 4 /* padding */]; -extern "C" extern void* __vt__8dCcD_Sph[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_SphAttr[25]; -extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; -extern "C" extern void* __vt__9cCcD_Stts[8]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" u8 m_midnaActor__9daPy_py_c[4]; -extern "C" void __register_global_object(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80780DC4-80780DC8 000000 0004+00 25/25 0/0 0/0 .rodata @3903 */ -SECTION_RODATA static f32 const lit_3903 = 100.0f; -COMPILER_STRIP_GATE(0x80780DC4, &lit_3903); - -/* 80780DC8-80780DCC 000004 0004+00 3/21 0/0 0/0 .rodata @3904 */ -SECTION_RODATA static u8 const lit_3904[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80780DC8, &lit_3904); - -/* 80780DCC-80780DD4 000008 0004+04 3/21 0/0 0/0 .rodata @3905 */ -SECTION_RODATA static f32 const lit_3905[1 + 1 /* padding */] = { - 1.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x80780DCC, &lit_3905); - -/* 80780DD4-80780DDC 000010 0008+00 0/1 0/0 0/0 .rodata @3906 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3906[8] = { - 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80780DD4, &lit_3906); -#pragma pop - -/* 80780DDC-80780DE4 000018 0008+00 0/1 0/0 0/0 .rodata @3907 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3907[8] = { - 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80780DDC, &lit_3907); -#pragma pop - -/* 80780DE4-80780DEC 000020 0008+00 0/1 0/0 0/0 .rodata @3908 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3908[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80780DE4, &lit_3908); -#pragma pop - -/* 80780DEC-80780DF0 000028 0004+00 0/1 0/0 0/0 .rodata @3909 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3909 = 1.0f / 100.0f; -COMPILER_STRIP_GATE(0x80780DEC, &lit_3909); -#pragma pop - -/* 80780DF0-80780DF4 00002C 0004+00 0/2 0/0 0/0 .rodata @3924 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3924 = 13.0f / 10.0f; -COMPILER_STRIP_GATE(0x80780DF0, &lit_3924); -#pragma pop - -/* 80780DF4-80780DF8 000030 0004+00 0/3 0/0 0/0 .rodata @3925 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3925 = 4.0f; -COMPILER_STRIP_GATE(0x80780DF4, &lit_3925); -#pragma pop - -/* 80780DF8-80780DFC 000034 0004+00 1/5 0/0 0/0 .rodata @3926 */ -SECTION_RODATA static f32 const lit_3926 = 20.0f; -COMPILER_STRIP_GATE(0x80780DF8, &lit_3926); - -/* 80780DFC-80780E00 000038 0004+00 0/4 0/0 0/0 .rodata @3927 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3927 = 300.0f; -COMPILER_STRIP_GATE(0x80780DFC, &lit_3927); -#pragma pop - -/* 80780E00-80780E04 00003C 0004+00 0/1 0/0 0/0 .rodata @3928 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3928 = 700.0f; -COMPILER_STRIP_GATE(0x80780E00, &lit_3928); -#pragma pop - -/* 80780E04-80780E08 000040 0004+00 0/1 0/0 0/0 .rodata @3929 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3929 = 90.0f; -COMPILER_STRIP_GATE(0x80780E04, &lit_3929); -#pragma pop - -/* 80780FA8-80780FB4 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 80780FB4-80780FC8 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ -#pragma push -#pragma force_active on -SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { - 0x02000201, - /* padding */ - 0x40080000, - 0x00000000, - 0x3FE00000, - 0x00000000, -}; -#pragma pop - -/* 80780FC8-80780FD0 000020 0008+00 0/1 0/0 0/0 .data e_prim$3782 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 e_prim[8] = { - 0xFF, 0x78, 0x00, 0x00, 0xFF, 0x64, 0x78, 0x00, -}; -#pragma pop - -/* 80780FD0-80780FD8 000028 0008+00 0/1 0/0 0/0 .data e_env$3783 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 e_env[8] = { - 0x5A, 0x2D, 0x2D, 0x00, 0x3C, 0x1E, 0x1E, 0x00, -}; -#pragma pop - -/* 80780FD8-80780FE0 000030 0006+02 0/1 0/0 0/0 .data eff_id$3791 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 eff_id[6 + 2 /* padding */] = { - 0x02, - 0x9D, - 0x02, - 0x9E, - 0x02, - 0x9F, - /* padding */ - 0x00, - 0x00, -}; -#pragma pop - -/* 80780FE0-80780FE4 000038 0004+00 1/1 0/0 0/0 .data s_ya */ -SECTION_DATA static u8 s_ya[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; - -/* 80780FE4-80781060 -00001 007C+00 1/1 0/0 0/0 .data @4986 */ -SECTION_DATA static void* lit_4986[31] = { - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x6C), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x144), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x1CC), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x210), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x2D4), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x398), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x3E8), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x42C), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x500), - (void*)(((char*)e_s1_fail__FP10e_s1_class) + 0x464), -}; - -/* 80781060-807810B4 -00001 0054+00 1/1 0/0 0/0 .data @5100 */ -SECTION_DATA static void* lit_5100[21] = { - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x4C), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x68), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x88), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x94), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x168), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x18C), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1F0), - (void*)(((char*)e_s1_warpappear__FP10e_s1_class) + 0x1E0), -}; - -/* 807810B4-80781108 -00001 0054+00 1/1 0/0 0/0 .data @5377 */ -SECTION_DATA static void* lit_5377[21] = { - (void*)(((char*)action__FP10e_s1_class) + 0x7C), - (void*)(((char*)action__FP10e_s1_class) + 0x8C), - (void*)(((char*)action__FP10e_s1_class) + 0x98), - (void*)(((char*)action__FP10e_s1_class) + 0xAC), - (void*)(((char*)action__FP10e_s1_class) + 0xC0), - (void*)(((char*)action__FP10e_s1_class) + 0xCC), - (void*)(((char*)action__FP10e_s1_class) + 0x148), - (void*)(((char*)action__FP10e_s1_class) + 0xD8), - (void*)(((char*)action__FP10e_s1_class) + 0xE4), - (void*)(((char*)action__FP10e_s1_class) + 0xF0), - (void*)(((char*)action__FP10e_s1_class) + 0x120), - (void*)(((char*)action__FP10e_s1_class) + 0x108), - (void*)(((char*)action__FP10e_s1_class) + 0x148), - (void*)(((char*)action__FP10e_s1_class) + 0x148), - (void*)(((char*)action__FP10e_s1_class) + 0x148), - (void*)(((char*)action__FP10e_s1_class) + 0x148), - (void*)(((char*)action__FP10e_s1_class) + 0x148), - (void*)(((char*)action__FP10e_s1_class) + 0x148), - (void*)(((char*)action__FP10e_s1_class) + 0x148), - (void*)(((char*)action__FP10e_s1_class) + 0x148), - (void*)(((char*)action__FP10e_s1_class) + 0x138), -}; - -/* 80781108-80781134 000160 002C+00 1/1 0/0 0/0 .data ke_za$5382 */ -SECTION_DATA static u8 ke_za[44] = { - 0xFC, 0xE0, 0xFE, 0x70, 0x00, 0x00, 0x01, 0x90, 0x03, 0x20, 0xFC, 0xE0, 0xFE, 0x70, 0x00, - 0x00, 0x01, 0x90, 0x03, 0x20, 0xFC, 0xE0, 0xFE, 0x70, 0x00, 0x00, 0x01, 0x90, 0x03, 0x20, - 0x04, 0xB0, 0xFC, 0xE0, 0xFE, 0x70, 0x00, 0x00, 0x01, 0x90, 0x03, 0x20, 0x04, 0xB0, -}; - -/* 80781134-8078116C -00001 0038+00 1/1 0/0 0/0 .data @5617 */ -SECTION_DATA static void* lit_5617[14] = { - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x420), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x68), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0xDC), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x420), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x420), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x420), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x420), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x420), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x420), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x420), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x210), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x2AC), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x30C), - (void*)(((char*)demo_camera__FP10e_s1_class) + 0x3B8), -}; - -/* 8078116C-80781178 0001C4 000C+00 1/0 0/0 0/0 .data jv_offset */ -SECTION_DATA static u8 jv_offset[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 80781178-807811E4 -00001 006C+00 1/1 0/0 0/0 .data jc_data */ -SECTION_DATA static void* jc_data[27] = { - (void*)0x00010001, (void*)0x41F00000, (void*)&jv_offset, (void*)0x00010002, (void*)0x41F00000, - (void*)&jv_offset, (void*)0x00010003, (void*)0x41C80000, (void*)&jv_offset, (void*)0x00010007, - (void*)0x41700000, (void*)&jv_offset, (void*)0x00010008, (void*)0x41200000, (void*)&jv_offset, - (void*)0x0001000E, (void*)0x41700000, (void*)&jv_offset, (void*)0x0001000F, (void*)0x41200000, - (void*)&jv_offset, (void*)0x00010015, (void*)0x41200000, (void*)&jv_offset, (void*)0x00010018, - (void*)0x41200000, (void*)&jv_offset, -}; - -/* 807811E4-80781224 00023C 0040+00 1/1 0/0 0/0 .data cc_sph_src$6084 */ -static dCcD_SrcSph cc_sph_src = { - { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph - } // mSphAttr -}; - -/* 80781224-80781264 00027C 0040+00 1/1 0/0 0/0 .data at_sph_src$6085 */ -static dCcD_SrcSph at_sph_src = { - { - {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0x0, 0x0}, 0x0}}, // mObj - {dCcD_SE_HARD_BODY, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 35.0f} // mSph - } // mSphAttr -}; - -/* 80781264-80781284 -00001 0020+00 1/0 0/0 0/0 .data l_daE_S1_Method */ -static actor_method_class l_daE_S1_Method = { - (process_method_func)daE_S1_Create__FP10fopAc_ac_c, - (process_method_func)daE_S1_Delete__FP10e_s1_class, - (process_method_func)daE_S1_Execute__FP10e_s1_class, - (process_method_func)daE_S1_IsDelete__FP10e_s1_class, - (process_method_func)daE_S1_Draw__FP10e_s1_class, -}; - -/* 80781284-807812B4 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_S1 */ -extern actor_process_profile_definition g_profile_E_S1 = { - fpcLy_CURRENT_e, // mLayerID - 7, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_E_S1, // mProcName - &g_fpcLf_Method.mBase, // sub_method - sizeof(e_s1_class), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 121, // mPriority - &l_daE_S1_Method, // sub_method - 0x00040000, // mStatus - fopAc_ENEMY_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType -}; - -/* 807812B4-807812C0 00030C 000C+00 1/1 0/0 0/0 .data __vt__12dBgS_AcchCir */ -SECTION_DATA extern void* __vt__12dBgS_AcchCir[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_AcchCirFv, -}; - -/* 807812C0-807812CC 000318 000C+00 2/2 0/0 0/0 .data __vt__10cCcD_GStts */ -SECTION_DATA extern void* __vt__10cCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10cCcD_GSttsFv, -}; - -/* 807812CC-807812D8 000324 000C+00 1/1 0/0 0/0 .data __vt__10dCcD_GStts */ -SECTION_DATA extern void* __vt__10dCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10dCcD_GSttsFv, -}; - -/* 807812D8-807812EC 000330 0014+00 1/1 0/0 0/0 .data __vt__18mDoExt_3DlineMat_c */ -SECTION_DATA extern void* __vt__18mDoExt_3DlineMat_c[5] = { - (void*)NULL /* RTTI */, (void*)NULL, (void*)NULL, (void*)NULL, (void*)NULL, -}; - -/* 807812EC-807812F8 000344 000C+00 4/4 0/0 0/0 .data __vt__8cM3dGSph */ -SECTION_DATA extern void* __vt__8cM3dGSph[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGSphFv, -}; - -/* 807812F8-80781304 000350 000C+00 4/4 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 80781304-80781328 00035C 0024+00 2/2 0/0 0/0 .data __vt__12dBgS_ObjAcch */ -SECTION_DATA extern void* __vt__12dBgS_ObjAcch[9] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_ObjAcchFv, - (void*)NULL, - (void*)NULL, - (void*)func_80780958, - (void*)NULL, - (void*)NULL, - (void*)func_80780950, -}; - -/* 80781328-80781334 000380 000C+00 2/2 0/0 0/0 .data __vt__12daE_S1_HIO_c */ -SECTION_DATA extern void* __vt__12daE_S1_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12daE_S1_HIO_cFv, +enum daE_S1_ACTION { + ACT_WAIT, + ACT_ROOF, + ACT_FIGHT_RUN, + ACT_FIGHT, + ACT_BIBIRI, + ACT_DAMAGE, + ACT_INVINCIBLE, // does not exist anymore + ACT_PATH, + ACT_WOLFBITE, + ACT_FAIL_WAIT, + ACT_FAIL, + ACT_SHOUT, + ACT_WARP_APPEAR = 20, }; /* 8077AB8C-8077ABF8 0000EC 006C+00 1/1 0/0 0/0 .text __ct__12daE_S1_HIO_cFv */ daE_S1_HIO_c::daE_S1_HIO_c() { - // NONMATCHING + field_0x4 = -1; + mBaseSize = 1.3f; + mMoveSpeed = 4.0f; + mDashSpeed = 20.0f; + field_0x18 = 300.0f; + mFallSEWaitTime = 20; + mAllDeadWaitTime = 100; + mReactionDist = 700.0f; + mReactionAngle = 90.0f; + mReactionTime = 20; + mInvincible = 0; } -/* ############################################################################################## */ -/* 80780E08-80780E0C 000044 0004+00 1/1 0/0 0/0 .rodata @3943 */ -SECTION_RODATA static f32 const lit_3943 = -1.0f; -COMPILER_STRIP_GATE(0x80780E08, &lit_3943); - -/* 80780F74-80780F74 0001B0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80780F74 = "E_S2"; -#pragma pop - /* 8077ABF8-8077ACA4 000158 00AC+00 12/12 0/0 0/0 .text anm_init__FP10e_s1_classifUcf */ -static void anm_init(e_s1_class* param_0, int param_1, f32 param_2, u8 param_3, f32 param_4) { - // NONMATCHING +static void anm_init(e_s1_class* i_this, int i_resNo, f32 i_morf, u8 i_attr, f32 i_speed) { + J3DAnmTransform* pbck = (J3DAnmTransform*)dComIfG_getObjectRes("E_S2", i_resNo); + i_this->mpMorf->setAnm(pbck, i_attr, i_morf, i_speed, 0.0f, -1.0f); + i_this->mAnm = i_resNo; } -/* ############################################################################################## */ -/* 80780E0C-80780E10 000048 0004+00 0/1 0/0 0/0 .rodata @3989 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3989 = 1300.0f; -COMPILER_STRIP_GATE(0x80780E0C, &lit_3989); -#pragma pop - /* 8077ACA4-8077AE38 000204 0194+00 1/0 0/0 0/0 .text daE_S1_Draw__FP10e_s1_class */ -static void daE_S1_Draw(e_s1_class* param_0) { - // NONMATCHING +static int daE_S1_Draw(e_s1_class* i_this) { + if (i_this->field_0x306c != 0) { + return 1; + } + + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + J3DModel* model = i_this->mpMorf->getModel(); + + g_env_light.settingTevStruct(2, &a_this->current.pos, &a_this->tevStr); + g_env_light.setLightTevColorType_MAJI(model, &a_this->tevStr); + + dComIfGd_setListDark(); + i_this->mpMorf->entryDL(); + + if (i_this->mDrawShadow) { + cXyz pos; + pos.set(a_this->current.pos.x, a_this->current.pos.y + 100.0f, a_this->current.pos.z); + + i_this->mShadowKey = dComIfGd_setShadow( + i_this->mShadowKey, 1, model, &pos, BREG_F(19) + 1300.0f, 0.0f, + a_this->current.pos.y, i_this->mAcch.GetGroundH(), i_this->mAcch.m_gnd, &i_this->tevStr, + 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); + } + + GXColor line_color; + line_color.r = JREG_S(0) + 5; + line_color.g = JREG_S(1) + 10; + line_color.b = JREG_S(2) + 10; + line_color.a = 0xFF; + + i_this->mLineMat.update(16, line_color, &i_this->tevStr); + dComIfGd_set3DlineMatDark(&i_this->mLineMat); + + dComIfGd_setList(); + return 1; } /* 8077AE38-8077AEFC 000398 00C4+00 3/3 0/0 0/0 .text pl_check__FP10e_s1_classf */ -static void pl_check(e_s1_class* param_0, f32 param_1) { - // NONMATCHING +static BOOL pl_check(e_s1_class* i_this, f32 i_check_range) { + fopAc_ac_c* player = dComIfGp_getPlayer(0); + f32 x_dist = player->current.pos.x - i_this->home.pos.x; + f32 z_dist = player->current.pos.z - i_this->home.pos.z; + + if (JMAFastSqrt(x_dist * x_dist + z_dist * z_dist) < i_check_range) { + s16 angle_dist = i_this->shape_angle.y - fopAcM_searchPlayerAngleY(i_this); + if (angle_dist < 0x7000 && angle_dist > -0x7000 && + !fopAcM_otherBgCheck(i_this, dComIfGp_getPlayer(0))) + { + return true; + } + } + + return false; } /* 8077AEFC-8077AF40 00045C 0044+00 4/4 0/0 0/0 .text pl_at_check__FP10e_s1_classf */ -static void pl_at_check(e_s1_class* param_0, f32 param_1) { - // NONMATCHING +static BOOL pl_at_check(e_s1_class* i_this, f32 i_check_range) { + return fopAcM_searchPlayerDistance(i_this) < i_check_range; } -/* ############################################################################################## */ -/* 80780E10-80780E14 00004C 0004+00 2/9 0/0 0/0 .rodata @4096 */ -SECTION_RODATA static f32 const lit_4096 = 10.0f; -COMPILER_STRIP_GATE(0x80780E10, &lit_4096); +UNK_BSS(1109) +UNK_BSS(1107) +UNK_BSS(1105) +UNK_BSS(1104) +UNK_BSS(1099) +UNK_BSS(1097) +UNK_BSS(1095) +UNK_BSS(1094) +UNK_BSS(1057) +UNK_BSS(1055) +UNK_BSS(1053) +UNK_BSS(1052) +UNK_BSS(1014) +UNK_BSS(1012) +UNK_BSS(1010) -/* 80780E14-80780E18 000050 0004+00 0/9 0/0 0/0 .rodata @4097 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4097 = 50.0f; -COMPILER_STRIP_GATE(0x80780E14, &lit_4097); -#pragma pop - -/* 80780E18-80780E1C 000054 0004+00 0/3 0/0 0/0 .rodata @4098 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4098 = 0.5f; -COMPILER_STRIP_GATE(0x80780E18, &lit_4098); -#pragma pop - -/* 80781340-80781344 000008 0001+03 3/3 0/0 0/0 .bss @1109 */ -static u8 lit_1109[1 + 3 /* padding */]; - -/* 80781344-80781348 00000C 0001+03 0/0 0/0 0/0 .bss @1107 */ -#pragma push -#pragma force_active on -static u8 lit_1107[1 + 3 /* padding */]; -#pragma pop - -/* 80781348-8078134C 000010 0001+03 0/0 0/0 0/0 .bss @1105 */ -#pragma push -#pragma force_active on -static u8 lit_1105[1 + 3 /* padding */]; -#pragma pop - -/* 8078134C-80781350 000014 0001+03 0/0 0/0 0/0 .bss @1104 */ -#pragma push -#pragma force_active on -static u8 lit_1104[1 + 3 /* padding */]; -#pragma pop - -/* 80781350-80781354 000018 0001+03 0/0 0/0 0/0 .bss @1099 */ -#pragma push -#pragma force_active on -static u8 lit_1099[1 + 3 /* padding */]; -#pragma pop - -/* 80781354-80781358 00001C 0001+03 0/0 0/0 0/0 .bss @1097 */ -#pragma push -#pragma force_active on -static u8 lit_1097[1 + 3 /* padding */]; -#pragma pop - -/* 80781358-8078135C 000020 0001+03 0/0 0/0 0/0 .bss @1095 */ -#pragma push -#pragma force_active on -static u8 lit_1095[1 + 3 /* padding */]; -#pragma pop - -/* 8078135C-80781360 000024 0001+03 0/0 0/0 0/0 .bss @1094 */ -#pragma push -#pragma force_active on -static u8 lit_1094[1 + 3 /* padding */]; -#pragma pop - -/* 80781360-80781364 000028 0001+03 0/0 0/0 0/0 .bss @1057 */ -#pragma push -#pragma force_active on -static u8 lit_1057[1 + 3 /* padding */]; -#pragma pop - -/* 80781364-80781368 00002C 0001+03 0/0 0/0 0/0 .bss @1055 */ -#pragma push -#pragma force_active on -static u8 lit_1055[1 + 3 /* padding */]; -#pragma pop - -/* 80781368-8078136C 000030 0001+03 0/0 0/0 0/0 .bss @1053 */ -#pragma push -#pragma force_active on -static u8 lit_1053[1 + 3 /* padding */]; -#pragma pop - -/* 8078136C-80781370 000034 0001+03 0/0 0/0 0/0 .bss @1052 */ -#pragma push -#pragma force_active on -static u8 lit_1052[1 + 3 /* padding */]; -#pragma pop - -/* 80781370-80781374 000038 0001+03 0/0 0/0 0/0 .bss @1014 */ -#pragma push -#pragma force_active on -static u8 lit_1014[1 + 3 /* padding */]; -#pragma pop - -/* 80781374-80781378 00003C 0001+03 0/0 0/0 0/0 .bss @1012 */ -#pragma push -#pragma force_active on -static u8 lit_1012[1 + 3 /* padding */]; -#pragma pop - -/* 80781378-8078137C 000040 0001+03 0/0 0/0 0/0 .bss @1010 */ -#pragma push -#pragma force_active on -static u8 lit_1010[1 + 3 /* padding */]; -#pragma pop - -/* 8078137C-80781380 -00001 0004+00 2/4 0/0 0/0 .bss None */ -/* 8078137C 0001+00 data_8078137C @1009 */ -/* 8078137D 0001+00 data_8078137D None */ -/* 8078137E 0002+00 data_8078137E None */ -static u8 struct_8078137C[4]; - -/* 80781380-8078138C 000048 000C+00 0/1 0/0 0/0 .bss @3919 */ -#pragma push -#pragma force_active on -static u8 lit_3919[12]; -#pragma pop +static u8 data_8078137c; +static u8 l_no_fail; // when enabled, enemy will never revive after defeated +static u8 l_initHIO; /* 8078138C-807813B8 000054 002C+00 8/11 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[44]; - -/* 807813B8-807814B8 000080 00FF+01 1/1 0/0 0/0 .bss check_index$4023 */ -static u8 check_index[255 + 1 /* padding */]; +static daE_S1_HIO_c l_HIO; /* 8077AF40-8077B1A8 0004A0 0268+00 1/1 0/0 0/0 .text path_check__FP10e_s1_class */ -static void path_check(e_s1_class* param_0) { - // NONMATCHING -} +static BOOL path_check(e_s1_class* i_this) { + static u8 check_index[255]; + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + dBgS_LinChk linchk; + cXyz start_pos; + cXyz end_pos; + + start_pos = a_this->current.pos; + start_pos.y += WREG_F(0) + 10.0f; + + dStage_dPnt_c* point = i_this->mpPath->m_points; + for (int i = 0; i < i_this->mpPath->m_num; i++, point++) { + if (i < 255) { + end_pos.x = point->m_position.x; + end_pos.y = point->m_position.y + 10.0f; + end_pos.z = point->m_position.z; + linchk.Set(&start_pos, &end_pos, a_this); + + if (!dComIfG_Bgsp().LineCross(&linchk)) { + check_index[i] = 1; + } else { + check_index[i] = 0; + } + } + } + + f32 x_dist; + f32 y_dist; + f32 z_dist; + f32 range = 100.0f; + u8 found = false; + + for (int i = 0; i < 100; i++) { + point = i_this->mpPath->m_points; + for (int j = 0; j < i_this->mpPath->m_num; j++, point++) { + if (j < 255 && check_index[j]) { + x_dist = a_this->current.pos.x - point->m_position.x; + y_dist = a_this->current.pos.y - point->m_position.y; + z_dist = a_this->current.pos.z - point->m_position.z; + + if (JMAFastSqrt((z_dist * z_dist) + ((x_dist * x_dist) + (y_dist * y_dist))) < + range) + { + i_this->mCurrentPathPointNo = j - i_this->mPathDirection; + + if (i_this->mCurrentPathPointNo >= (i_this->mpPath->m_num & 0xFF)) { + i_this->mCurrentPathPointNo = i_this->mpPath->m_num; + } else if (i_this->mCurrentPathPointNo < 0) { + i_this->mCurrentPathPointNo = 0; + } + + found = true; + break; + } + } + } + + if (found) { + break; + } + + range += 50.0f; + } + + if (!found) { + return false; + } + + if (cM_rndF(1.0f) < 0.5f) { + i_this->mPathDirection = 1; + } else { + i_this->mPathDirection = -1; + } -/* 8077B1A8-8077B274 000708 00CC+00 1/1 0/0 0/0 .text path_check2__FP10e_s1_class */ -static void path_check2(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 807814B8-807814BC 000180 0004+00 1/2 0/0 0/0 .bss same_id */ -static u8 same_id[4]; - -/* 807814BC-807814C0 000184 0004+00 1/2 0/0 0/0 .bss fail_id */ -static u8 fail_id[4]; - -/* 8077B274-8077B318 0007D4 00A4+00 1/1 0/0 0/0 .text s_last_sub__FPvPv */ -static void s_last_sub(void* param_0, void* param_1) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E1C-80780E20 000058 0004+00 1/6 0/0 0/0 .rodata @4353 */ -SECTION_RODATA static f32 const lit_4353 = 30.0f; -COMPILER_STRIP_GATE(0x80780E1C, &lit_4353); - -/* 80780E20-80780E24 00005C 0004+00 0/1 0/0 0/0 .rodata @4354 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4354 = 65.0f; -COMPILER_STRIP_GATE(0x80780E20, &lit_4354); -#pragma pop - -/* 80780E24-80780E28 000060 0004+00 0/2 0/0 0/0 .rodata @4355 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4355 = 60.0f; -COMPILER_STRIP_GATE(0x80780E24, &lit_4355); -#pragma pop - -/* 8077B318-8077B928 000878 0610+00 1/1 0/0 0/0 .text damage_check__FP10e_s1_class */ -static void damage_check(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E28-80780E2C 000064 0004+00 0/3 0/0 0/0 .rodata @4428 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4428 = 15.0f; -COMPILER_STRIP_GATE(0x80780E28, &lit_4428); -#pragma pop - -/* 8077B928-8077BC8C 000E88 0364+00 1/1 0/0 0/0 .text e_s1_wait__FP10e_s1_class */ -static void e_s1_wait(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E2C-80780E34 000068 0008+00 0/2 0/0 0/0 .rodata @4475 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4475[8] = { - 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80780E2C, &lit_4475); -#pragma pop - -/* 8077BC8C-8077BEAC 0011EC 0220+00 1/1 0/0 0/0 .text e_s1_roof__FP10e_s1_class */ -static void e_s1_roof(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E34-80780E38 000070 0004+00 0/8 0/0 0/0 .rodata @4501 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4501 = 3.0f; -COMPILER_STRIP_GATE(0x80780E34, &lit_4501); -#pragma pop - -/* 80780E38-80780E3C 000074 0004+00 0/1 0/0 0/0 .rodata @4502 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4502 = 0x3EAA7EFA; -COMPILER_STRIP_GATE(0x80780E38, &lit_4502); -#pragma pop - -/* 80780E3C-80780E44 000078 0008+00 0/4 0/0 0/0 .rodata @4505 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4505[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80780E3C, &lit_4505); -#pragma pop - -/* 8077BEAC-8077BFFC 00140C 0150+00 1/1 0/0 0/0 .text e_s1_fight_run__FP10e_s1_class */ -static void e_s1_fight_run(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E44-80780E48 000080 0004+00 0/3 0/0 0/0 .rodata @4568 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4568 = 0x3EAAA64C; -COMPILER_STRIP_GATE(0x80780E44, &lit_4568); -#pragma pop - -/* 8077BFFC-8077C2F8 00155C 02FC+00 1/1 0/0 0/0 .text e_s1_fight__FP10e_s1_class */ -static void e_s1_fight(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E48-80780E4C 000084 0004+00 0/4 0/0 0/0 .rodata @4603 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4603 = 5.0f; -COMPILER_STRIP_GATE(0x80780E48, &lit_4603); -#pragma pop - -/* 80780E4C-80780E50 000088 0004+00 0/3 0/0 0/0 .rodata @4604 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4604 = 1.0f / 10.0f; -COMPILER_STRIP_GATE(0x80780E4C, &lit_4604); -#pragma pop - -/* 8077C2F8-8077C52C 001858 0234+00 1/1 0/0 0/0 .text e_s1_bibiri__FP10e_s1_class */ -static void e_s1_bibiri(e_s1_class* param_0) { - // NONMATCHING -} - -/* 8077C52C-8077C5FC 001A8C 00D0+00 1/1 0/0 0/0 .text e_s1_damage__FP10e_s1_class */ -static void e_s1_damage(e_s1_class* param_0) { - // NONMATCHING -} - -/* 8077C5FC-8077C894 001B5C 0298+00 1/1 0/0 0/0 .text e_s1_path__FP10e_s1_class */ -static void e_s1_path(e_s1_class* param_0) { - // NONMATCHING -} - -/* 8077C894-8077C938 001DF4 00A4+00 1/1 0/0 0/0 .text s_down_sub__FPvPv */ -static void s_down_sub(void* param_0, void* param_1) { - // NONMATCHING -} - -/* 8077C938-8077C9D8 001E98 00A0+00 1/1 0/0 0/0 .text s_fail_sub__FPvPv */ -static void s_fail_sub(void* param_0, void* param_1) { - // NONMATCHING -} - -/* 8077C9D8-8077CA0C 001F38 0034+00 2/2 0/0 0/0 .text all_fail_check__FP10e_s1_class */ -static void all_fail_check(e_s1_class* param_0) { - // NONMATCHING -} - -/* 8077CA0C-8077CAA4 001F6C 0098+00 1/1 0/0 0/0 .text s_allfail_sub__FPvPv */ -static void s_allfail_sub(void* param_0, void* param_1) { - // NONMATCHING -} - -/* 8077CAA4-8077CAD0 002004 002C+00 1/1 0/0 0/0 .text all_fail__FP10e_s1_class */ -static void all_fail(e_s1_class* param_0) { - // NONMATCHING -} - -/* 8077CAD0-8077CB68 002030 0098+00 1/1 0/0 0/0 .text s_allwakeup_sub__FPvPv */ -static void s_allwakeup_sub(void* param_0, void* param_1) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 807814C0-807814C4 000188 0004+00 2/2 0/0 0/0 .bss s_check */ -static u8 s_check[4]; - -/* 807814C4-807814D0 00018C 000C+00 0/1 0/0 0/0 .bss @4755 */ -#pragma push -#pragma force_active on -static u8 lit_4755[12]; -#pragma pop - -/* 807814D0-807814DC 000198 000C+00 0/1 0/0 0/0 .bss @4756 */ -#pragma push -#pragma force_active on -static u8 lit_4756[12]; -#pragma pop - -/* 807814DC-807814F4 0001A4 0018+00 1/2 0/0 0/0 .bss s_p */ -static u8 s_p[24]; - -/* 8077CB68-8077CC54 0020C8 00EC+00 1/1 0/0 0/0 .text s_posrevise_sub__FPvPv */ -static void s_posrevise_sub(void* param_0, void* param_1) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E50-80780E54 00008C 0004+00 0/3 0/0 0/0 .rodata @4840 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4840 = 2.0f; -COMPILER_STRIP_GATE(0x80780E50, &lit_4840); -#pragma pop - -/* 80780E54-80780E58 000090 0004+00 0/1 0/0 0/0 .rodata @4841 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4841 = 9.0f; -COMPILER_STRIP_GATE(0x80780E54, &lit_4841); -#pragma pop - -/* 8077CC54-8077CF30 0021B4 02DC+00 1/1 0/0 0/0 .text e_s1_failwait__FP10e_s1_class */ -static void e_s1_failwait(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780F74-80780F74 0001B0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80780F79 = "D_MN08"; -#pragma pop - -/* 8077CF30-8077D448 002490 0518+00 2/1 0/0 0/0 .text e_s1_fail__FP10e_s1_class */ -static void e_s1_fail(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E58-80780E5C 000094 0004+00 0/0 0/0 0/0 .rodata @4985 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4985 = 25.0f; -COMPILER_STRIP_GATE(0x80780E58, &lit_4985); -#pragma pop - -/* 80780E5C-80780E60 000098 0004+00 0/1 0/0 0/0 .rodata @5043 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5043 = -16000.0f; -COMPILER_STRIP_GATE(0x80780E5C, &lit_5043); -#pragma pop - -/* 80780E60-80780E64 00009C 0004+00 0/1 0/0 0/0 .rodata @5044 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5044 = -1000.0f; -COMPILER_STRIP_GATE(0x80780E60, &lit_5044); -#pragma pop - -/* 80780F74-80780F74 0001B0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80780F80 = "F_SP108"; -#pragma pop - -/* 8077D448-8077D6A0 0029A8 0258+00 1/1 0/0 0/0 .text e_s1_shout__FP10e_s1_class */ -static void e_s1_shout(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E64-80780E68 0000A0 0004+00 0/3 0/0 0/0 .rodata @5099 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5099 = 50000.0f; -COMPILER_STRIP_GATE(0x80780E64, &lit_5099); -#pragma pop - -/* 8077D6A0-8077D8A8 002C00 0208+00 2/1 0/0 0/0 .text e_s1_warpappear__FP10e_s1_class */ -static void e_s1_warpappear(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E68-80780E6C 0000A4 0004+00 0/1 0/0 0/0 .rodata @5149 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5149 = 65536.0f; -COMPILER_STRIP_GATE(0x80780E68, &lit_5149); -#pragma pop - -/* 80780E6C-80780E70 0000A8 0004+00 0/1 0/0 0/0 .rodata @5150 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5150 = -12.0f; -COMPILER_STRIP_GATE(0x80780E6C, &lit_5150); -#pragma pop - -/* 80780E70-80780E74 0000AC 0004+00 0/1 0/0 0/0 .rodata @5151 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5151 = 4.0f / 5.0f; -COMPILER_STRIP_GATE(0x80780E70, &lit_5151); -#pragma pop - -/* 8077D8A8-8077DBB8 002E08 0310+00 1/1 0/0 0/0 .text ke_control__FP10e_s1_classP7s1_ke_sif */ -static void ke_control(e_s1_class* param_0, s1_ke_s* param_1, int param_2, f32 param_3) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E74-80780E78 0000B0 0004+00 0/1 0/0 0/0 .rodata @5175 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5175 = 3.0f / 5.0f; -COMPILER_STRIP_GATE(0x80780E74, &lit_5175); -#pragma pop - -/* 80780E78-80780E7C 0000B4 0004+00 0/1 0/0 0/0 .rodata @5176 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5176 = 3.5f; -COMPILER_STRIP_GATE(0x80780E78, &lit_5176); -#pragma pop - -/* 80780E7C-80780E80 0000B8 0004+00 0/1 0/0 0/0 .rodata @5177 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5177 = 9.0f / 5.0f; -COMPILER_STRIP_GATE(0x80780E7C, &lit_5177); -#pragma pop - -/* 8077DBB8-8077DC90 003118 00D8+00 1/1 0/0 0/0 .text - * ke_move__FP10e_s1_classP19mDoExt_3DlineMat0_cP7s1_ke_sif */ -static void ke_move(e_s1_class* param_0, mDoExt_3DlineMat0_c* param_1, s1_ke_s* param_2, - int param_3, f32 param_4) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E80-80780E84 0000BC 0004+00 0/1 0/0 0/0 .rodata @5247 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5247 = 250.0f; -COMPILER_STRIP_GATE(0x80780E80, &lit_5247); -#pragma pop - -/* 8077DC90-8077E070 0031F0 03E0+00 1/1 0/0 0/0 .text e_s1_wolfbite__FP10e_s1_class */ -static void e_s1_wolfbite(e_s1_class* param_0) { - // NONMATCHING -} - -/* 8077E070-8077E618 0035D0 05A8+00 2/1 0/0 0/0 .text action__FP10e_s1_class */ -static void action(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780E84-80780E88 0000C0 0004+00 0/0 0/0 0/0 .rodata @5373 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5373 = 0x43360A3D; -COMPILER_STRIP_GATE(0x80780E84, &lit_5373); -#pragma pop - -/* 80780E88-80780E8C 0000C4 0004+00 0/1 0/0 0/0 .rodata @5374 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5374 = 40.0f; -COMPILER_STRIP_GATE(0x80780E88, &lit_5374); -#pragma pop - -/* 80780E8C-80780E90 0000C8 0004+00 0/0 0/0 0/0 .rodata @5375 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5375 = -120.0f; -COMPILER_STRIP_GATE(0x80780E8C, &lit_5375); -#pragma pop - -/* 80780E90-80780E94 0000CC 0004+00 0/1 0/0 0/0 .rodata @5376 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5376 = 7.0f; -COMPILER_STRIP_GATE(0x80780E90, &lit_5376); -#pragma pop - -/* 80780E94-80780E98 0000D0 0004+00 0/1 0/0 0/0 .rodata @5430 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5430 = 2000.0f; -COMPILER_STRIP_GATE(0x80780E94, &lit_5430); -#pragma pop - -/* 80780E98-80780E9C 0000D4 0004+00 0/1 0/0 0/0 .rodata @5431 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5431 = 7.5f; -COMPILER_STRIP_GATE(0x80780E98, &lit_5431); -#pragma pop - -/* 80780E9C-80780EA0 0000D8 0004+00 0/1 0/0 0/0 .rodata @5432 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5432 = 2.25f; -COMPILER_STRIP_GATE(0x80780E9C, &lit_5432); -#pragma pop - -/* 80780EA0-80780EA4 0000DC 0004+00 0/2 0/0 0/0 .rodata @5433 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5433 = 8.0f; -COMPILER_STRIP_GATE(0x80780EA0, &lit_5433); -#pragma pop - -/* 80780EA4-80780EA8 0000E0 0004+00 0/2 0/0 0/0 .rodata @5434 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5434 = 35.0f; -COMPILER_STRIP_GATE(0x80780EA4, &lit_5434); -#pragma pop - -/* 8077E618-8077E870 003B78 0258+00 1/1 0/0 0/0 .text ke_set__FP10e_s1_class */ -static void ke_set(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780EA8-80780EAC 0000E4 0004+00 0/1 0/0 0/0 .rodata @5588 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5588 = 55.0f; -COMPILER_STRIP_GATE(0x80780EA8, &lit_5588); -#pragma pop - -/* 80780EAC-80780EB0 0000E8 0004+00 0/1 0/0 0/0 .rodata @5589 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5589 = 1200.0f; -COMPILER_STRIP_GATE(0x80780EAC, &lit_5589); -#pragma pop - -/* 80780EB0-80780EB4 0000EC 0004+00 0/1 0/0 0/0 .rodata @5590 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5590 = 270.0f; -COMPILER_STRIP_GATE(0x80780EB0, &lit_5590); -#pragma pop - -/* 80780EB4-80780EB8 0000F0 0004+00 0/1 0/0 0/0 .rodata @5591 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5591 = 750.0f; -COMPILER_STRIP_GATE(0x80780EB4, &lit_5591); -#pragma pop - -/* 80780EB8-80780EBC 0000F4 0004+00 0/1 0/0 0/0 .rodata @5592 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5592 = 850.0f; -COMPILER_STRIP_GATE(0x80780EB8, &lit_5592); -#pragma pop - -/* 80780EBC-80780EC0 0000F8 0004+00 0/1 0/0 0/0 .rodata @5593 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5593 = 1.0f / 20.0f; -COMPILER_STRIP_GATE(0x80780EBC, &lit_5593); -#pragma pop - -/* 80780EC0-80780EC4 0000FC 0004+00 0/1 0/0 0/0 .rodata @5594 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5594 = 0x3BA3D70A; -COMPILER_STRIP_GATE(0x80780EC0, &lit_5594); -#pragma pop - -/* 8077E870-8077EE10 003DD0 05A0+00 2/1 0/0 0/0 .text demo_camera__FP10e_s1_class */ -static void demo_camera(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780EC4-80780EC8 000100 0004+00 0/0 0/0 0/0 .rodata @5595 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5595 = -16046.0f; -COMPILER_STRIP_GATE(0x80780EC4, &lit_5595); -#pragma pop - -/* 80780EC8-80780ECC 000104 0004+00 0/0 0/0 0/0 .rodata @5596 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5596 = 177.0f; -COMPILER_STRIP_GATE(0x80780EC8, &lit_5596); -#pragma pop - -/* 80780ECC-80780ED0 000108 0004+00 0/0 0/0 0/0 .rodata @5597 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5597 = -955.0f; -COMPILER_STRIP_GATE(0x80780ECC, &lit_5597); -#pragma pop - -/* 80780ED0-80780ED4 00010C 0004+00 0/0 0/0 0/0 .rodata @5598 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5598 = -16174.0f; -COMPILER_STRIP_GATE(0x80780ED0, &lit_5598); -#pragma pop - -/* 80780ED4-80780ED8 000110 0004+00 0/0 0/0 0/0 .rodata @5599 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5599 = 331.0f; -COMPILER_STRIP_GATE(0x80780ED4, &lit_5599); -#pragma pop - -/* 80780ED8-80780EDC 000114 0004+00 0/0 0/0 0/0 .rodata @5600 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5600 = -731.0f; -COMPILER_STRIP_GATE(0x80780ED8, &lit_5600); -#pragma pop - -/* 80780EDC-80780EE0 000118 0004+00 0/0 0/0 0/0 .rodata @5601 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5601 = -15400.0f; -COMPILER_STRIP_GATE(0x80780EDC, &lit_5601); -#pragma pop - -/* 80780EE0-80780EE4 00011C 0004+00 0/0 0/0 0/0 .rodata @5602 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5602 = 400.0f; -COMPILER_STRIP_GATE(0x80780EE0, &lit_5602); -#pragma pop - -/* 80780EE4-80780EE8 000120 0004+00 0/0 0/0 0/0 .rodata @5603 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5603 = 0x4234999A; -COMPILER_STRIP_GATE(0x80780EE4, &lit_5603); -#pragma pop - -/* 80780EE8-80780EEC 000124 0004+00 0/0 0/0 0/0 .rodata @5604 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5604 = -40.0f; -COMPILER_STRIP_GATE(0x80780EE8, &lit_5604); -#pragma pop - -/* 80780EEC-80780EF0 000128 0004+00 0/0 0/0 0/0 .rodata @5605 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5605 = -39.0f; -COMPILER_STRIP_GATE(0x80780EEC, &lit_5605); -#pragma pop - -/* 80780EF0-80780EF4 00012C 0004+00 0/0 0/0 0/0 .rodata @5606 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5606 = -68.0f; -COMPILER_STRIP_GATE(0x80780EF0, &lit_5606); -#pragma pop - -/* 80780EF4-80780EF8 000130 0004+00 0/0 0/0 0/0 .rodata @5607 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5607 = 218.0f; -COMPILER_STRIP_GATE(0x80780EF4, &lit_5607); -#pragma pop - -/* 80780EF8-80780EFC 000134 0004+00 0/0 0/0 0/0 .rodata @5608 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5608 = -3.0f; -COMPILER_STRIP_GATE(0x80780EF8, &lit_5608); -#pragma pop - -/* 80780EFC-80780F00 000138 0004+00 0/0 0/0 0/0 .rodata @5609 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5609 = 78.0f; -COMPILER_STRIP_GATE(0x80780EFC, &lit_5609); -#pragma pop - -/* 80780F00-80780F04 00013C 0004+00 0/0 0/0 0/0 .rodata @5610 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5610 = 42.0f; -COMPILER_STRIP_GATE(0x80780F00, &lit_5610); -#pragma pop - -/* 80780F04-80780F08 000140 0004+00 0/0 0/0 0/0 .rodata @5611 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5611 = -16232.0f; -COMPILER_STRIP_GATE(0x80780F04, &lit_5611); -#pragma pop - -/* 80780F08-80780F0C 000144 0004+00 0/0 0/0 0/0 .rodata @5612 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5612 = 0x42366666; -COMPILER_STRIP_GATE(0x80780F08, &lit_5612); -#pragma pop - -/* 80780F0C-80780F10 000148 0004+00 0/0 0/0 0/0 .rodata @5613 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5613 = 234.0f; -COMPILER_STRIP_GATE(0x80780F0C, &lit_5613); -#pragma pop - -/* 80780F10-80780F14 00014C 0004+00 0/0 0/0 0/0 .rodata @5614 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5614 = -16140.0f; -COMPILER_STRIP_GATE(0x80780F10, &lit_5614); -#pragma pop - -/* 80780F14-80780F18 000150 0004+00 0/0 0/0 0/0 .rodata @5615 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5615 = 88.0f / 5.0f; -COMPILER_STRIP_GATE(0x80780F14, &lit_5615); -#pragma pop - -/* 80780F18-80780F1C 000154 0004+00 0/0 0/0 0/0 .rodata @5616 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5616 = 518.0f; -COMPILER_STRIP_GATE(0x80780F18, &lit_5616); -#pragma pop - -/* 80780F1C-80780F20 000158 0004+00 0/1 0/0 0/0 .rodata @5717 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5717 = 27.0f; -COMPILER_STRIP_GATE(0x80780F1C, &lit_5717); -#pragma pop - -/* 80780F20-80780F24 00015C 0004+00 0/1 0/0 0/0 .rodata @5718 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5718 = 57.0f; -COMPILER_STRIP_GATE(0x80780F20, &lit_5718); -#pragma pop - -/* 80780F24-80780F28 000160 0004+00 0/1 0/0 0/0 .rodata @5719 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5719 = 6.0f; -COMPILER_STRIP_GATE(0x80780F24, &lit_5719); -#pragma pop - -/* 80780F28-80780F2C 000164 0004+00 0/1 0/0 0/0 .rodata @5720 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5720 = 14.0f; -COMPILER_STRIP_GATE(0x80780F28, &lit_5720); -#pragma pop - -/* 80780F2C-80780F30 000168 0004+00 0/2 0/0 0/0 .rodata @5721 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5721 = 45.0f; -COMPILER_STRIP_GATE(0x80780F2C, &lit_5721); -#pragma pop - -/* 8077EE10-8077F250 004370 0440+00 1/1 0/0 0/0 .text anm_se_set__FP10e_s1_class */ -static void anm_se_set(e_s1_class* param_0) { - // NONMATCHING -} - -/* 8077F250-8077F314 0047B0 00C4+00 1/1 0/0 0/0 .text body_eff_set__FP10e_s1_class */ -static void body_eff_set(e_s1_class* param_0) { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780F30-80780F34 00016C 0004+00 0/1 0/0 0/0 .rodata @5995 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5995 = -27035.0f; -COMPILER_STRIP_GATE(0x80780F30, &lit_5995); -#pragma pop - -/* 80780F34-80780F38 000170 0004+00 0/1 0/0 0/0 .rodata @5996 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5996 = -35400.0f; -COMPILER_STRIP_GATE(0x80780F34, &lit_5996); -#pragma pop - -/* 80780F38-80780F3C 000174 0004+00 0/1 0/0 0/0 .rodata @5997 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5997 = -28750.0f; -COMPILER_STRIP_GATE(0x80780F38, &lit_5997); -#pragma pop - -/* 80780F3C-80780F40 000178 0004+00 0/1 0/0 0/0 .rodata @5998 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5998 = 35330.0f; -COMPILER_STRIP_GATE(0x80780F3C, &lit_5998); -#pragma pop - -/* 80780F40-80780F44 00017C 0004+00 0/1 0/0 0/0 .rodata @5999 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5999 = 34270.0f; -COMPILER_STRIP_GATE(0x80780F40, &lit_5999); -#pragma pop - -/* 80780F44-80780F48 000180 0004+00 0/1 0/0 0/0 .rodata @6000 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6000 = -1000000000.0f; -COMPILER_STRIP_GATE(0x80780F44, &lit_6000); -#pragma pop - -/* 80780F48-80780F4C 000184 0004+00 0/1 0/0 0/0 .rodata @6001 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6001 = 75.0f; -COMPILER_STRIP_GATE(0x80780F48, &lit_6001); -#pragma pop - -/* 80780F4C-80780F50 000188 0004+00 0/1 0/0 0/0 .rodata @6002 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6002 = 22340.0f; -COMPILER_STRIP_GATE(0x80780F4C, &lit_6002); -#pragma pop - -/* 80780F50-80780F54 00018C 0004+00 0/1 0/0 0/0 .rodata @6003 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6003 = 20000.0f; -COMPILER_STRIP_GATE(0x80780F50, &lit_6003); -#pragma pop - -/* 80780F54-80780F58 000190 0004+00 0/1 0/0 0/0 .rodata @6004 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6004 = 130.0f; -COMPILER_STRIP_GATE(0x80780F54, &lit_6004); -#pragma pop - -/* 80780F74-80780F74 0001B0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80780F88 = "F_SP121"; -#pragma pop - -/* 8077F314-8077FC88 004874 0974+00 2/1 0/0 0/0 .text daE_S1_Execute__FP10e_s1_class */ -static void daE_S1_Execute(e_s1_class* param_0) { - // NONMATCHING -} - -/* 8077FC88-8077FC90 0051E8 0008+00 1/0 0/0 0/0 .text daE_S1_IsDelete__FP10e_s1_class */ -static bool daE_S1_IsDelete(e_s1_class* param_0) { return true; } -/* 8077FC90-8077FCF8 0051F0 0068+00 1/0 0/0 0/0 .text daE_S1_Delete__FP10e_s1_class */ -static void daE_S1_Delete(e_s1_class* param_0) { - // NONMATCHING +/* 8077B1A8-8077B274 000708 00CC+00 1/1 0/0 0/0 .text path_check2__FP10e_s1_class */ +static void path_check2(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + dBgS_LinChk linchk; + cXyz start_pos; + cXyz end_pos; + + start_pos = a_this->current.pos; + start_pos.y += WREG_F(2) + 20.0f; + + end_pos = i_this->mPathTargetPos; + end_pos.y += WREG_F(3) + 10.0f; + + linchk.Set(&start_pos, &end_pos, a_this); + if (dComIfG_Bgsp().LineCross(&linchk)) { + i_this->mAction = ACT_PATH; + i_this->mMode = 0; + } } +/* 807814B8-807814BC 000180 0004+00 1/2 0/0 0/0 .bss same_id */ +static int same_id; + +/* 807814BC-807814C0 000184 0004+00 1/2 0/0 0/0 .bss fail_id */ +static int fail_id; + +/* 8077B274-8077B318 0007D4 00A4+00 1/1 0/0 0/0 .text s_last_sub__FPvPv */ +static void* s_last_sub(void* i_actor, void* i_data) { + fopAc_ac_c* a_actor = (fopAc_ac_c*)i_actor; + fopAc_ac_c* a_data = (fopAc_ac_c*)i_data; + + if (fopAcM_IsActor(a_actor) && fopAcM_GetName(a_actor) == PROC_E_S1) { + e_s1_class* e_data = (e_s1_class*)a_data; + e_s1_class* e_actor = (e_s1_class*)a_actor; + + if (e_actor != e_data && e_actor->mGroupID == e_data->mGroupID) { + same_id++; + + if (e_actor->mAction == ACT_FAIL || e_actor->mAction == ACT_FAIL_WAIT) { + fail_id++; + } + } + } + + return NULL; +} + +/* 8077B318-8077B928 000878 0610+00 1/1 0/0 0/0 .text damage_check__FP10e_s1_class */ +static void damage_check(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + if (i_this->mHitInvincibilityTimer == 0) { + i_this->mCcStts.Move(); + + for (int i = 0; i <= 2; i++) { + if (l_HIO.mInvincible) { + i_this->mCcSph[i].OnTgShield(); + } else { + i_this->mCcSph[i].OffTgShield(); + } + + if (i_this->mCcSph[i].ChkTgHit()) { + i_this->mHitInvincibilityTimer = 6; + i_this->mAtInfo.mpCollider = i_this->mCcSph[i].GetTgHitObj(); + + if (player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_LEFT && player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_RIGHT && + i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_WOLF_ATTACK)) + { + if (!player->onWolfEnemyHangBite(a_this)) { + return; + } + + OS_REPORT("S1 PL BITE HANG \n"); + i_this->mAction = ACT_WOLFBITE; + i_this->mMode = 0; + i_this->mHitInvincibilityTimer = 1000; + i_this->mSound.startCollisionSE(Z2SE_HIT_WOLFBITE, 0x1F); + return; + } + + at_power_check(&i_this->mAtInfo); + OS_REPORT("E_S1 HIT POW %d\n", i_this->mAtInfo.mAttackPower); + + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_SHIELD_ATTACK)) { + i_this->mTimers[3] = 30; + } else { + i_this->mTimers[3] = 0; + } + + if (l_HIO.mInvincible) { + i_this->mAction = ACT_INVINCIBLE; + + if (i_this->mAtInfo.mAttackPower < 20) { + i_this->mTimers[0] = 15; + i_this->field_0x6ac = TREG_F(0) + 30.0f; + } else { + i_this->mTimers[0] = 25; + i_this->field_0x6ac = TREG_F(1) + 65.0f; + } + } else { + if (i_this->mAtInfo.mAttackPower >= 60 && daPy_py_c::i_checkNowWolf()) { + i_this->mAtInfo.field_0x18 = 36; + } else { + i_this->mAtInfo.field_0x18 = 0; + } + + cc_at_check(a_this, &i_this->mAtInfo); + + if (i_this->mAtInfo.mpCollider->ChkAtType( + AT_TYPE_MIDNA_LOCK | AT_TYPE_10000000 | AT_TYPE_WOLF_CUT_TURN | + AT_TYPE_WOLF_ATTACK)) + { + i_this->mHitInvincibilityTimer = 20; + } else { + i_this->mHitInvincibilityTimer = 10; + } + + if (i_this->mAtInfo.mAttackPower < 20) { + i_this->field_0x6ac = TREG_F(0) + 20.0f; + } else if (i_this->mAtInfo.mAttackPower >= 60 && daPy_py_c::i_checkNowWolf()) { + i_this->field_0x6ac = 0.0f; + a_this->health = 0; + + cXyz offset; + cXyz pos; + + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(2), *calc_mtx); + + offset.set(0.0f, 0.0f, 0.0f); + MtxPosition(&offset, &pos); + + cXyz size(l_HIO.mBaseSize, l_HIO.mBaseSize, l_HIO.mBaseSize); + csXyz angle(player->shape_angle); + angle.y -= 0x8000; + + dComIfGp_particle_set(0x8248, &pos, &angle, &size); + dComIfGp_particle_set(0x8249, &pos, &angle, &size); + dComIfGp_particle_set(0x824A, &a_this->current.pos, &angle, &size); + } else { + i_this->field_0x6ac = TREG_F(1) + 60.0f; + } + + if (!l_no_fail) { + if (i_this->mAtInfo.mAttackPower >= 60 && daPy_py_c::i_checkNowWolf()) { + i_this->mAction = ACT_FAIL_WAIT; + i_this->mHitInvincibilityTimer = 10; + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_DEATH, -1); + } else if (a_this->health <= 0) { + if (i_this->mAtInfo.mHitBit & 0x880) { + OS_REPORT("////////// S1 TURN CUT FAIL ..\n"); + i_this->mAction = ACT_FAIL_WAIT; + i_this->mHitInvincibilityTimer = 10; + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_DEATH, -1); + } else { + fail_id = 0; + same_id = 0; + + fpcM_Search(s_last_sub, a_this); + + OS_REPORT("////////// SAME ID %d\n", same_id); + OS_REPORT("////////// FAIL ID %d\n", fail_id); + + if (i_this->mGroupID == 0xFF || same_id != fail_id) { + i_this->mAction = ACT_FAIL_WAIT; + i_this->mHitInvincibilityTimer = 10; + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_DEATH, -1); + } + } + } else { + i_this->mAction = ACT_DAMAGE; + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_DAMAGE, -1); + } + } else if (a_this->health <= 0) { + i_this->mAction = ACT_FAIL; + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_DEATH, -1); + } else { + i_this->mAction = ACT_DAMAGE; + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_DAMAGE, -1); + } + } + + i_this->mMode = 0; + a_this->speedF = 0.0f; + i_this->field_0x6b0 = fopAcM_searchPlayerAngleY(a_this); + i_this->mDrawShadow = true; + break; + } + } + + for (int i = 0; i < 3; i++) { + if (a_this->health <= 1) { + i_this->mCcSph[i].SetTgHitMark(CcG_Tg_UNK_MARK_3); + } + } + } +} + +/* 8077B928-8077BC8C 000E88 0364+00 1/1 0/0 0/0 .text e_s1_wait__FP10e_s1_class */ +static void e_s1_wait(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz dist_from_home; + cXyz random_home; + + f32 target_speed = 0.0f; + s16 angle_step = 0; + int anm_frame = i_this->mpMorf->getFrame(); + + dist_from_home = a_this->home.pos - a_this->current.pos; + + f32 var_f30 = JMAFastSqrt(dist_from_home.x * dist_from_home.x + dist_from_home.z * dist_from_home.z); + + switch (i_this->mMode) { + case 0: + if (i_this->mTimers[0] == 0) { + if (i_this->mpPath != NULL && path_check(i_this)) { + i_this->mAction = ACT_PATH; + i_this->mMode = 0; + } else { + random_home.x = a_this->home.pos.x + cM_rndFX(300.0f); + random_home.y = a_this->home.pos.y; + random_home.z = a_this->home.pos.z + cM_rndFX(300.0f); + + dist_from_home = random_home - a_this->current.pos; + + s16 var_r27 = cM_atan2s(dist_from_home.x, dist_from_home.z) - a_this->current.angle.y; + if (var_r27 > 0x3000) { + var_r27 = 0x3000; + } else if (var_r27 < -0x3000) { + var_r27 = -0x3000; + } + + i_this->mTargetAngle = a_this->current.angle.y + var_r27; + i_this->mTimers[0] = cM_rndF(100.0f) + 100.0f; + i_this->mMode = 1; + anm_init(i_this, ANM_WALK, 15.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + } + break; + case 1: + angle_step = 0x100; + if (i_this->mTimers[0] == 0 || var_f30 > i_this->field_0x3068) { + i_this->mMode = 0; + i_this->mTimers[0] = cM_rndF(100.0f) + 100.0f; + anm_init(i_this, ANM_WAIT_02, 15.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + break; + case 2: + i_this->mMode = 3; + anm_init(i_this, ANM_WALK, 15.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + /* fallthrough */ + case 3: + angle_step = 0x100; + + dist_from_home.x = a_this->home.pos.x - a_this->current.pos.x; + dist_from_home.z = a_this->home.pos.z - a_this->current.pos.z; + i_this->mTargetAngle = cM_atan2s(dist_from_home.x, dist_from_home.z); + + if (JMAFastSqrt(dist_from_home.x * dist_from_home.x + dist_from_home.z * dist_from_home.z) < i_this->field_0x3068 - 50.0f) { + i_this->mMode = 1; + } + break; + } + + if (i_this->mAnm == ANM_WALK && ((anm_frame >= 0 && anm_frame <= 18) || (anm_frame >= 27 && anm_frame <= 45))) { + target_speed = l_HIO.mMoveSpeed; + } + + cLib_addCalc2(&a_this->speedF, target_speed, 1.0f, 1.0f); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetAngle, 8, angle_step); + + if (i_this->mTimers[2] == 0 && pl_check(i_this, i_this->mSearchRange)) { + i_this->mAction = ACT_FIGHT_RUN; + i_this->mMode = 0; + } +} + +/* 8077BC8C-8077BEAC 0011EC 0220+00 1/1 0/0 0/0 .text e_s1_roof__FP10e_s1_class */ +static void e_s1_roof(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + s8 roof_wait = false; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_STICK, 1.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + i_this->mMode = 1; + /* fallthrough */ + case 1: + roof_wait = true; + if (i_this->mSwBit != 0xFF) { + s32 room_no = dComIfGp_roomControl_getStayNo(); + if (dComIfGs_isSwitch(i_this->mSwBit, room_no)) { + i_this->mMode = 2; + } + } else if (fopAcM_searchPlayerDistanceXZ(a_this) < i_this->mPrm1 * 100.0f) { + i_this->mMode = 2; + } + break; + case 2: + i_this->mSound.startCreatureSound(Z2SE_EN_NS_FALLTREE, 0, -1); + i_this->mMode = 3; + i_this->mTimers[0] = l_HIO.mFallSEWaitTime; + /* fallthrough */ + case 3: + if (i_this->mTimers[0] == 0) { + i_this->mDrawShadow = true; + + if (i_this->mAcch.i_ChkGroundHit()) { + anm_init(i_this, ANM_DOWN, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mMode = 4; + i_this->mSound.startCreatureSound(Z2SE_EN_NS_DOSA, 0, -1); + } + } else { + roof_wait = true; + } + break; + case 4: + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_WAIT; + i_this->mMode = 0; + } + break; + } + + if (roof_wait) { + a_this->speed.y = 0.0f; + a_this->current.pos.y = a_this->home.pos.y; + } +} + +/* 8077BEAC-8077BFFC 00140C 0150+00 1/1 0/0 0/0 .text e_s1_fight_run__FP10e_s1_class */ +static void e_s1_fight_run(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz sp14; + cXyz sp8; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_DASH_01, 3.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + i_this->mpMorf->setFrame(cM_rndF(10.0f)); + i_this->mMode = 1; + /* fallthrough */ + case 1: + cLib_addCalcAngleS2(&a_this->current.angle.y, fopAcM_searchPlayerAngleY(a_this), 4, 0x1000); + cLib_addCalc2(&a_this->speedF, l_HIO.mDashSpeed, 1.0f, l_HIO.mDashSpeed * 0.333f); + break; + } + + if (!pl_check(i_this, i_this->mSearchRange + 50.0f)) { + i_this->mAction = ACT_WAIT; + i_this->mMode = 2; + } else if (pl_at_check(i_this, l_HIO.field_0x18)) { + i_this->mAction = ACT_FIGHT; + i_this->mMode = 0; + } +} + +/* 8077BFFC-8077C2F8 00155C 02FC+00 1/1 0/0 0/0 .text e_s1_fight__FP10e_s1_class */ +static void e_s1_fight(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz sp28; + cXyz sp1C; + + int anm_frame = i_this->mpMorf->getFrame(); + f32 target_speed = 0.0f; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_WAIT_01, 10.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + i_this->mTimers[0] = 30.0f + cM_rndF(30.0f); + i_this->mMode = 1; + break; + case 1: + if (i_this->mTimers[0] == 0) { + if (cM_rndF(1.0f) < 0.3333f) { + anm_init(i_this, ANM_ATTACK, 3.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_ATTACK, -1); + i_this->mIsSlowAttack = 0; + } else { + anm_init(i_this, ANM_ATTACK_02, 3.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_ATTACK2, -1); + i_this->mIsSlowAttack = 1; + } + + i_this->mMode = 2; + } + break; + case 2: + if (i_this->mIsSlowAttack == 0 && anm_frame >= 21 && anm_frame <= 30) { + i_this->field_0x6b9 = 1; + + if (anm_frame == 21) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_UDEHURI, 0, -1); + } + + if (anm_frame == 25) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_HAND_L, 0, -1); + } + } else if (i_this->mIsSlowAttack == 1 && anm_frame >= 25 && anm_frame <= 33) { + i_this->field_0x6b9 = 1; + + if (anm_frame == 25) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_UDEHURI, 0, -1); + } + } + + if (i_this->mpMorf->isStop()) { + if (!pl_at_check(i_this, l_HIO.field_0x18 + 10.0f)) { + i_this->mAction = ACT_FIGHT_RUN; + } + + i_this->mMode = 0; + } + break; + } + + cLib_addCalcAngleS2(&a_this->current.angle.y, fopAcM_searchPlayerAngleY(a_this), 4, 0x800); + cLib_addCalc2(&a_this->speedF, target_speed, 1.0f, 10.0f); +} + +/* 8077C2F8-8077C52C 001858 0234+00 1/1 0/0 0/0 .text e_s1_bibiri__FP10e_s1_class */ +static void e_s1_bibiri(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_SHRINK, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f + cM_rndFX(0.1f)); + i_this->mpMorf->setFrame(cM_rndF(15.0f)); + i_this->mTimers[0] = l_HIO.mReactionTime + cM_rndF(10.0f); + i_this->mMode = 1; + /* fallthrough */ + case 1: + if (pl_at_check(i_this, 10.0f + l_HIO.mReactionDist)) { + if (daPy_getPlayerActorClass()->checkWolfThreat()) { + i_this->mTimers[0] = l_HIO.mReactionTime + cM_rndF(10.0f); + } + } + + if (i_this->mTimers[0] == 0) { + anm_init(i_this, ANM_SHRINK_DOWN, 3.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mMode = 2; + } + break; + case 2: + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_WAIT; + i_this->mMode = 2; + } + break; + } + + cLib_addCalc0(&a_this->speedF, 1.0f, 3.0f); + cLib_addCalcAngleS2(&a_this->current.angle.y, fopAcM_searchPlayerAngleY(a_this), 4, 0x1000); +} + +/* 8077C52C-8077C5FC 001A8C 00D0+00 1/1 0/0 0/0 .text e_s1_damage__FP10e_s1_class */ +static void e_s1_damage(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz sp14; + cXyz sp8; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_DAMAGED, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mMode = 1; + break; + case 1: + if (i_this->mTimers[3] != 0) { + i_this->onHeadLockFlg(); + } + + if (i_this->mpMorf->isStop()) { + i_this->field_0x6ac = 0.0f; + i_this->mAction = ACT_FIGHT_RUN; + i_this->mMode = 0; + } + break; + } +} + +/* 8077C5FC-8077C894 001B5C 0298+00 1/1 0/0 0/0 .text e_s1_path__FP10e_s1_class */ +static void e_s1_path(e_s1_class* i_this) { + cXyz sp14; + cXyz sp8; + f32 target_speed = 0.0f; + int anm_frame = i_this->mpMorf->getFrame(); + + switch (i_this->mMode) { + case 0: + i_this->mMode = 1; + anm_init(i_this, ANM_WALK, 10.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + /* fallthrough */ + case 1: + i_this->mCurrentPathPointNo += i_this->mPathDirection; + + if (i_this->mCurrentPathPointNo >= (i_this->mpPath->m_num & 0xFF)) { + if (dPath_ChkClose(i_this->mpPath)) { + i_this->mCurrentPathPointNo = 0; + } else { + i_this->mPathDirection = -1; + i_this->mCurrentPathPointNo = (i_this->mpPath->m_num - 2); + } + } else if (i_this->mCurrentPathPointNo < 0) { + i_this->mPathDirection = 1; + i_this->mCurrentPathPointNo = 1; + } + + { + dStage_dPnt_c* point = &i_this->mpPath->m_points[i_this->mCurrentPathPointNo]; + i_this->mPathTargetPos.x = point->m_position.x; + i_this->mPathTargetPos.y = point->m_position.y; + i_this->mPathTargetPos.z = point->m_position.z; + } + i_this->mMode = 2; + /* fallthrough */ + case 2: + if ((anm_frame >= 12 && anm_frame <= 27) || (anm_frame >= 54 && anm_frame <= 86)) { + target_speed = l_HIO.mMoveSpeed; + } + + sp14.x = i_this->mPathTargetPos.x - i_this->current.pos.x; + sp14.z = i_this->mPathTargetPos.z - i_this->current.pos.z; + i_this->mTargetAngle = cM_atan2s(sp14.x, sp14.z); + + if (JMAFastSqrt((sp14.x * sp14.x) + (sp14.z * sp14.z)) < 4.0f * l_HIO.mMoveSpeed) { + i_this->mMode = 3; + i_this->mTimers[0] = 50.0f + cM_rndF(100.0f); + anm_init(i_this, ANM_WAIT_02, 10.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + + path_check2(i_this); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngle, 8, 0x200); + break; + case 3: + if (i_this->mTimers[0] == 0) { + i_this->mMode = 0; + } + break; + } + + cLib_addCalc2(&i_this->speedF, target_speed, 1.0f, 1.0f); + + if (pl_check(i_this, i_this->mSearchRange)) { + i_this->mAction = ACT_FIGHT_RUN; + i_this->mMode = 0; + } +} + +/* 8077C894-8077C938 001DF4 00A4+00 1/1 0/0 0/0 .text s_down_sub__FPvPv */ +static void* s_down_sub(void* i_actor, void* i_data) { + fopAc_ac_c* a_actor = (fopAc_ac_c*)i_actor; + fopAc_ac_c* a_data = (fopAc_ac_c*)i_data; + + if (fopAcM_IsActor(a_actor) && fopAcM_GetName(a_actor) == PROC_E_S1) { + e_s1_class* e_data = (e_s1_class*)a_data; + e_s1_class* e_actor = (e_s1_class*)a_actor; + + if (e_actor == e_data) { + return NULL; + } + + if (e_actor->mAction == ACT_FAIL && e_actor->mMode == 10 && e_actor->mTimers[1] == 0) { + return NULL; + } + + if (e_actor->mGroupID == e_data->mGroupID) { + return i_actor; + } + } + + return NULL; +} + +/* 8077C938-8077C9D8 001E98 00A0+00 1/1 0/0 0/0 .text s_fail_sub__FPvPv */ +static void* s_fail_sub(void* i_actor, void* i_data) { + fopAc_ac_c* a_actor = (fopAc_ac_c*)i_actor; + fopAc_ac_c* a_data = (fopAc_ac_c*)i_data; + + if (fopAcM_IsActor(a_actor) && fopAcM_GetName(a_actor) == PROC_E_S1) { + e_s1_class* e_data = (e_s1_class*)a_data; + e_s1_class* e_actor = (e_s1_class*)a_actor; + + if (e_actor == e_data) { + return NULL; + } + + if (e_actor->mAction == ACT_FAIL && e_actor->mMode <= 10) { + return NULL; + } + + if (e_actor->mGroupID != e_data->mGroupID) { + return NULL; + } + + return i_actor; + } + + return NULL; +} + +/* 8077C9D8-8077CA0C 001F38 0034+00 2/2 0/0 0/0 .text all_fail_check__FP10e_s1_class */ +static BOOL all_fail_check(e_s1_class* i_this) { + return fpcM_Search(s_fail_sub, i_this) == NULL ? TRUE : FALSE; +} + +/* 8077CA0C-8077CAA4 001F6C 0098+00 1/1 0/0 0/0 .text s_allfail_sub__FPvPv */ +static void* s_allfail_sub(void* i_actor, void* i_data) { + fopAc_ac_c* a_actor = (fopAc_ac_c*)i_actor; + fopAc_ac_c* a_data = (fopAc_ac_c*)i_data; + + if (fopAcM_IsActor(a_actor) && fopAcM_GetName(a_actor) == PROC_E_S1) { + e_s1_class* e_data = (e_s1_class*)a_data; + e_s1_class* e_actor = (e_s1_class*)a_actor; + + if (e_actor->mGroupID == e_data->mGroupID) { + e_actor->mAction = ACT_FAIL; + e_actor->mMode = 11; + e_actor->mTimers[0] = cM_rndF(10.0f) + 30.0f; + } + } + + return NULL; +} + +/* 8077CAA4-8077CAD0 002004 002C+00 1/1 0/0 0/0 .text all_fail__FP10e_s1_class */ +static void all_fail(e_s1_class* i_this) { + fpcM_Search(s_allfail_sub, i_this); +} + +/* 8077CAD0-8077CB68 002030 0098+00 1/1 0/0 0/0 .text s_allwakeup_sub__FPvPv */ +static void* s_allwakeup_sub(void* i_actor, void* i_data) { + fopAc_ac_c* a_actor = (fopAc_ac_c*)i_actor; + fopAc_ac_c* a_data = (fopAc_ac_c*)i_data; + + if (fopAcM_IsActor(a_actor) && fopAcM_GetName(a_actor) == PROC_E_S1) { + e_s1_class* e_data = (e_s1_class*)a_data; + e_s1_class* e_actor = (e_s1_class*)a_actor; + + if (e_actor != e_data && e_actor->mGroupID == e_data->mGroupID) { + e_actor->mMode = 12; + + if (dComIfGp_event_runCheck()) { + e_actor->mTimers[0] = 50; + } else { + e_actor->mTimers[0] = 0; + } + } + } + + return NULL; +} + +/* 807814C0-807814C4 000188 0004+00 2/2 0/0 0/0 .bss s_check */ +static int s_check; + +/* 807814DC-807814F4 0001A4 0018+00 1/2 0/0 0/0 .bss s_p */ +static cXyz s_p[2] = { + cXyz(-16500.0f, 0.0f, -100.0f), + cXyz(-16300.0f, 0.0f, -400.0f), +}; + +/* 80780FE0-80780FE4 000038 0004+00 1/1 0/0 0/0 .data s_ya */ +static s16 s_ya[2] = {0, 0}; + +/* 8077CB68-8077CC54 0020C8 00EC+00 1/1 0/0 0/0 .text s_posrevise_sub__FPvPv */ +static void* s_posrevise_sub(void* i_actor, void* i_data) { + fopAc_ac_c* a_actor = (fopAc_ac_c*)i_actor; + fopAc_ac_c* a_data = (fopAc_ac_c*)i_data; + + if (fopAcM_IsActor(a_actor) && fopAcM_GetName(a_actor) == PROC_E_S1) { + e_s1_class* e_data = (e_s1_class*)a_data; + e_s1_class* e_actor = (e_s1_class*)a_actor; + + if (e_actor != e_data && s_check <= 1) { + e_actor->current.pos = s_p[s_check]; + e_actor->old.pos = s_p[s_check]; + e_actor->current.angle.y = s_ya[s_check]; + e_actor->shape_angle.y = s_ya[s_check]; + + s_check++; + } + } + + return NULL; +} + +/* 8077CC54-8077CF30 0021B4 02DC+00 1/1 0/0 0/0 .text e_s1_failwait__FP10e_s1_class */ +static void e_s1_failwait(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + i_this->mHitInvincibilityTimer = 20; + + switch (i_this->mMode) { + case 0: + if (cM_rndF(1.0f) < 0.3333f) { + anm_init(i_this, ANM_DEAD_02, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else if (cM_rndF(1.0f) < 0.5f) { + anm_init(i_this, ANM_DEAD_03, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else { + anm_init(i_this, ANM_DEAD_04, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } + + i_this->mMode = 1; + break; + case 1: + if (i_this->mpMorf->checkFrame(9.0f)) { + i_this->mMode = 2; + + if (i_this->mAnm == ANM_DEAD_02) { + anm_init(i_this, ANM_DEADWAIT_02, 2.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } else if (i_this->mAnm == ANM_DEAD_03) { + anm_init(i_this, ANM_DEADWAIT_03, 2.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } else { + anm_init(i_this, ANM_DEADWAIT_04, 2.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + } + break; + case 2: + // TODO: try to fix checkNowWolf here + if (i_this->mAtInfo.mAttackPower >= 60 && ((daPy_py_c*)dComIfGp_getLinkPlayer())->checkWolf()) + { + if (daPy_getPlayerActorClass()->getCutType() != daPy_py_c::CUT_TYPE_WOLF_LOCK) { + i_this->mMode = 3; + i_this->mTimers[0] = (fopAcM_GetID(i_this) & 7); + } + } else { + i_this->mMode = 3; + i_this->mTimers[0] = 0; + } + break; + case 3: + if (i_this->mTimers[0] == 0) { + i_this->mAction = ACT_FAIL; + i_this->mMode = 1; + + if (dStage_stagInfo_GetSTType(dComIfGp_getStage()->getStagInfo()) == ST_FIELD && + all_fail_check(i_this)) + { + if (!dComIfGp_event_runCheck()) { + i_this->mDemoMode = 1; + anm_init(i_this, ANM_DEAD_02, 2.0f, 0, 1.0f); + } + } else if (i_this->mAnm == ANM_DEADWAIT_02) { + anm_init(i_this, ANM_DEAD_02, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else if (i_this->mAnm == ANM_DEADWAIT_03) { + anm_init(i_this, ANM_DEAD_03, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else { + anm_init(i_this, ANM_DEAD_04, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } + + i_this->mpMorf->setFrame(10.0f); + } + break; + } +} + +/* 8077CF30-8077D448 002490 0518+00 2/1 0/0 0/0 .text e_s1_fail__FP10e_s1_class */ +static void e_s1_fail(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + i_this->mHitInvincibilityTimer = 20; + stage_stag_info_class* staginfo = dComIfGp_getStage()->getStagInfo(); + + switch (i_this->mMode) { + case 0: + if (cM_rndF(1.0f) < 0.3333f) { + anm_init(i_this, ANM_DEAD_02, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else if (cM_rndF(1.0f) < 0.5f) { + anm_init(i_this, ANM_DEAD_03, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else { + anm_init(i_this, ANM_DEAD_04, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } + + if (dStage_stagInfo_GetSTType(staginfo) == ST_FIELD) { + i_this->mMode = 1; + + if (all_fail_check(i_this) && !dComIfGp_event_runCheck()) { + i_this->mDemoMode = 1; + anm_init(i_this, ANM_DEAD_02, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } + } else { + i_this->mMode = 30; + } + break; + case 1: + if (i_this->mpMorf->checkFrame(25.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_DOSA, 0, -1); + } + + if (i_this->mpMorf->isStop()) { + i_this->mMode = 10; + i_this->mTimers[1] = 0; + } + break; + case 10: + if (all_fail_check(i_this)) { + i_this->mTimers[0] = cM_rndF(10.0f) + 30.0f; + i_this->mMode = 11; + + all_fail(i_this); + } + break; + case 11: + if (i_this->mTimers[0] == 0) { + cXyz offset; + cXyz pos; + + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(2), *calc_mtx); + + offset.set(0.0f, 0.0f, 0.0f); + MtxPosition(&offset, &pos); + + if (i_this->mDemoMode != 0) { + i_this->mMode = 20; + } else { + fopAcM_delete(a_this); + fopAcM_createDisappear(a_this, &pos, 12, 1, 49); + } + + if (strcmp(dComIfGp_getStartStageName(), "D_MN08") == 0 && i_this->mSwBit != 0xFF) + { + dComIfGs_onSwitch(i_this->mSwBit, fopAcM_GetRoomNo(a_this)); + } + } + break; + case 12: + if (i_this->mTimers[0] == 0) { + if (i_this->mAnm == ANM_DEAD_02) { + anm_init(i_this, ANM_DEADWAKE_02, 3.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else if (i_this->mAnm == ANM_DEAD_03) { + anm_init(i_this, ANM_DEADWAKE_03, 3.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else { + anm_init(i_this, ANM_DEADWAKE_04, 3.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } + + a_this->health = 50; + + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_AWAKE, -1); + + if (dComIfGp_event_runCheck()) { + i_this->mMode = 13; + } else { + i_this->mMode = 15; + } + } + break; + case 13: + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_WAIT; + i_this->mMode = 1; + i_this->mTimers[0] = 0; + i_this->mTimers[2] = 40; + } + break; + case 15: + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_WAIT; + i_this->mMode = 2; + } + break; + case 20: + if (i_this->mDemoTimer == TREG_S(0) + 80) { + cXyz sp50; + cXyz sp5C; + + i_this->mMode = 21; + i_this->field_0x306c = 1; + fopAcM_createDisappear(a_this, &a_this->eyePos, 12, 2, 49); + } + break; + case 30: + if (i_this->mpMorf->checkFrame(25.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_DOSA, 0, -1); + } + + if (i_this->mpMorf->isStop()) { + i_this->mMode = 11; + i_this->mTimers[0] = cM_rndF(10.0f) + 30.0f; + } + break; + } +} + +/* 8077D448-8077D6A0 0029A8 0258+00 1/1 0/0 0/0 .text e_s1_shout__FP10e_s1_class */ +static void e_s1_shout(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + i_this->mHitInvincibilityTimer = 10; + + switch (i_this->mMode) { + case 0: + a_this->health = 50; + anm_init(i_this, ANM_SHOUT, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + + i_this->mMode = 1; + i_this->mTimers[0] = KREG_S(6) + 10; + i_this->mTimers[1] = KREG_S(6) + 40; + + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_SHOUT, -1); + + if (strcmp(dComIfGp_getStartStageName(), "F_SP108") == 0 && + !dComIfGs_isSwitch(14, fopAcM_GetRoomNo(a_this))) + { + i_this->mDemoMode = 10; + a_this->current.pos.set(-16000.0f, 0.0f, -1000.0f); + a_this->shape_angle.y = 0; + a_this->current.angle.y = 0; + + s_check = 0; + fpcM_Search(s_posrevise_sub, i_this); + } + break; + case 1: + if (i_this->mDemoMode != 0) { + dComIfGp_getVibration().StartShock(8, 0x1F, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mTimers[0] > KREG_S(7) + 5) { + daPy_getPlayerActorClass()->onNsScream(); + } else { + daPy_getPlayerActorClass()->onNsScreamAnm(); + } + + if (i_this->mTimers[1] == 1) { + fpcM_Search(s_allwakeup_sub, i_this); + } + + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_WAIT; + + if (dComIfGp_event_runCheck()) { + i_this->mTimers[2] = 150; + i_this->mTimers[0] = 0; + i_this->mMode = 1; + } else { + i_this->mMode = 2; + } + } + break; + } + + cLib_addCalc0(&i_this->speedF, 1.0f, 3.0f); +} + +/* 8077D6A0-8077D8A8 002C00 0208+00 2/1 0/0 0/0 .text e_s1_warpappear__FP10e_s1_class */ +static void e_s1_warpappear(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + i_this->mHitInvincibilityTimer = 20; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_DOWN, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 0.0f); + i_this->mMode = 1; + /* fallthrough */ + case 1: + a_this->current.pos.y = a_this->home.pos.y + 50000.0f; + a_this->speedF = 0.0f; + a_this->speed.y = 0.0f; + break; + case 2: + i_this->mTimers[0] = 10; + break; + case 10: + if (i_this->mTimers[0] != 0) { + break; + } + + if (!i_this->mAcch.i_ChkGroundHit()) { + break; + } + + a_this->current = a_this->home; + a_this->old = a_this->current; + a_this->speedF = 0.0f; + + i_this->mMode = 11; + i_this->mSound.startCreatureSound(Z2SE_EN_NS_DOSA, 0, -1); + /* fallthrough */ + case 11: + i_this->mMode = 12; + anm_init(i_this, ANM_DOWN, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + break; + case 12: + if (i_this->mpMorf->isStop()) { + anm_init(i_this, ANM_WAIT_02, 15.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + i_this->mMode = 13; + } + break; + case 20: + i_this->mAction = ACT_WAIT; + i_this->mMode = 2; + break; + } +} + +/* 8077D8A8-8077DBB8 002E08 0310+00 1/1 0/0 0/0 .text ke_control__FP10e_s1_classP7s1_ke_sif */ +static void ke_control(e_s1_class* i_this, s1_ke_s* i_ke, int i_no, f32 i_posZ) { + cXyz sp4C; + cXyz sp40; + int i; + + cXyz* var_r31 = &i_ke->field_0x0[1]; + cXyz* var_r30 = &i_ke->field_0xc0[1]; + + sp4C.x = 0.0f; + sp4C.y = 0.0f; + sp4C.z = i_posZ; + + cXyz sp34; + f32 sp28 = -12.0f + JREG_F(0); + s16 sp14 = cM_rndF2(65536.0f); + + f32 temp_f26 = 3.0f + JREG_F(8); + f32 sp2C; + f32 var_f29; + f32 temp_f25 = JREG_F(5) + (3.0f + i_this->mAcch.GetGroundH()); + f32 temp_f27 = 0.8f + JREG_F(17); + + for (i = 1; i < 16; i++, var_r31++, var_r30++) { + f32 sp24 = temp_f26 * cM_ssin((s16)(sp14 + (i * 7000))); + f32 sp20 = temp_f26 * cM_ssin((s16)(sp14 + 10000 + (i * 6000))); + f32 temp_f28 = (16 - i) * 0.1f; + + sp34.x = var_r30->x + (sp24 + (i_ke->field_0x180.x * temp_f28)); + sp34.y = var_r30->y + (i_ke->field_0x180.y * temp_f28); + sp34.z = var_r30->z + (sp20 + (i_ke->field_0x180.z * temp_f28)); + + sp2C = sp34.x + (var_r31->x - var_r31[-1].x); + + f32 temp_f31; + f32 temp_f30 = sp34.z + (var_r31->z - var_r31[-1].z); + + var_f29 = sp28 + (var_r31->y + sp34.y); + if (var_f29 < temp_f25) { + var_f29 = temp_f25; + } + + temp_f31 = var_f29 - var_r31[-1].y; + s16 sp18 = (s16)-cM_atan2s(temp_f31, temp_f30); + s16 sp16 = (s16)cM_atan2s(sp2C, JMAFastSqrt((temp_f31 * temp_f31) + (temp_f30 * temp_f30))); + + cMtx_XrotS(*calc_mtx, sp18); + cMtx_YrotM(*calc_mtx, sp16); + MtxPosition(&sp4C, &sp40); + *var_r30 = *var_r31; + + var_r31->x = var_r31[-1].x + sp40.x; + var_r31->y = var_r31[-1].y + sp40.y; + var_r31->z = var_r31[-1].z + sp40.z; + + var_r30->x = temp_f27 * (var_r31->x - var_r30->x); + var_r30->y = temp_f27 * (var_r31->y - var_r30->y); + var_r30->z = temp_f27 * (var_r31->z - var_r30->z); + } +} + +/* 8077DBB8-8077DC90 003118 00D8+00 1/1 0/0 0/0 .text + * ke_move__FP10e_s1_classP19mDoExt_3DlineMat0_cP7s1_ke_sif */ +static void ke_move(e_s1_class* i_this, mDoExt_3DlineMat0_c* i_line, s1_ke_s* i_ke, int i_no, + f32 i_posZ) { + ke_control(i_this, i_ke, i_no, i_posZ); + + cXyz* ppos = i_line->getPos(i_no); + f32* psize = i_line->getSize(i_no); + + for (int i = 0; i < 16; i++, ppos++, psize++) { + *ppos = i_ke->field_0x0[i]; + + if (i == JREG_S(7) + 14) { + *psize = (JREG_S(8) + 6) * 0.1f; + } else if (i < 5) { + *psize = 3.5f; + } else { + *psize = cM_rndF2(1.0f) + 1.8f; + } + } +} + +/* 8077DC90-8077E070 0031F0 03E0+00 1/1 0/0 0/0 .text e_s1_wolfbite__FP10e_s1_class */ +static void e_s1_wolfbite(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + fopEn_enemy_c* e_this = (fopEn_enemy_c*)a_this; + i_this->mHitInvincibilityTimer = 10; + + cLib_addCalc0(&a_this->speedF, 1.0f, 2.0f); + i_this->mAcchCir.SetWall(50.0f, 250.0f + nREG_F(11)); + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_HANGED, 3.0f, 0, 1.0f); + i_this->mMode = 1; + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_HANGED, -1); + a_this->health -= 5; + i_this->field_0x6bb = 0; + break; + case 1: + if (i_this->mpMorf->isStop()) { + anm_init(i_this, ANM_HANG_WAIT, 3.0f, 2, 1.0f); + i_this->mMode = 2; + } + break; + case 2: + if (i_this->mAnm == ANM_HANG_DAMAGE && i_this->mpMorf->isStop()) { + anm_init(i_this, ANM_HANG_WAIT, 3.0f, 2, 1.0f); + } + + if (a_this->health <= 0 || e_this->checkWolfBiteDamage()) { + e_this->offWolfBiteDamage(); + anm_init(i_this, ANM_HANG_DAMAGE, 2.0f, 0, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_HANGEDAMAGE, -1); + a_this->health -= 5; + + if (i_this->health <= 0) { + player->offWolfEnemyHangBite(); + if (i_this->mGroupID == 0xFF) { + i_this->mAction = ACT_FAIL; + } else { + i_this->mAction = ACT_FAIL_WAIT; + } + + i_this->mMode = 0; + i_this->mHitInvincibilityTimer = 10; + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_DEATH, -1); + i_this->mSound.startCollisionSE(Z2SE_HIT_WOLFBITE, 0x20); + return; + } + + i_this->field_0x6bb++; + if (i_this->field_0x6bb >= 5) { + player->offWolfEnemyHangBite(); + anm_init(i_this, ANM_HANG_BRUSH2, 1.0f, 0, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_HANGEDBRUSH2, -1); + i_this->mMode = 3; + } + + i_this->mSound.startCollisionSE(Z2SE_HIT_WOLFBITE, 0x1E); + } + + if (!player->checkWolfEnemyBiteAllOwn(a_this)) { + anm_init(i_this, ANM_HANG_BRUSH, 3.0f, 0, 1.0f); + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_HANGEDBRUSH, -1); + i_this->mMode = 3; + } + break; + case 3: + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_FIGHT_RUN; + i_this->mMode = 0; + } + break; + } +} + +/* 8077E070-8077E618 0035D0 05A8+00 2/1 0/0 0/0 .text action__FP10e_s1_class */ +static void action(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz mae; + cXyz ato; + + damage_check(i_this); + i_this->mAcchCir.SetWall(50.0f, 100.0f); + + s8 on_attention = true; + s8 can_bibiri = false; + s8 cc_move = true; + s8 can_shout = true; + s8 fail_pos_correct = false; + s8 on_search_sound = false; + + i_this->offHeadLockFlg(); + + switch (i_this->mAction) { + case ACT_WAIT: + e_s1_wait(i_this); + can_bibiri = true; + break; + case ACT_ROOF: + e_s1_roof(i_this); + break; + case ACT_FIGHT_RUN: + e_s1_fight_run(i_this); + can_bibiri = true; + on_search_sound = true; + break; + case ACT_FIGHT: + e_s1_fight(i_this); + can_bibiri = true; + on_search_sound = true; + break; + case ACT_BIBIRI: + e_s1_bibiri(i_this); + break; + case ACT_DAMAGE: + e_s1_damage(i_this); + break; + case ACT_PATH: + e_s1_path(i_this); + break; + case ACT_WOLFBITE: + e_s1_wolfbite(i_this); + break; + case ACT_FAIL_WAIT: + e_s1_failwait(i_this); + on_attention = false; + can_shout = false; + fail_pos_correct = true; + break; + case ACT_SHOUT: + e_s1_shout(i_this); + can_shout = false; + on_attention = false; + on_search_sound = true; + break; + case ACT_FAIL: + e_s1_fail(i_this); + on_attention = false; + can_shout = false; + fail_pos_correct = true; + break; + case ACT_WARP_APPEAR: + e_s1_warpappear(i_this); + on_attention = false; + cc_move = false; + break; + } + + if (on_search_sound) { + i_this->mSound.setLinkSearch(true); + } else { + i_this->mSound.setLinkSearch(false); + } + + if (fail_pos_correct) { + dBgS_LinChk linchk; + cXyz offset; + cXyz start_pos; + cXyz end_pos; + + start_pos = a_this->current.pos; + start_pos.y += 30.0f; + + J3DModel* model = i_this->mpMorf->getModel(); + MTXCopy(model->getAnmMtx(4), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&end_pos); + end_pos.y += 30.0f; + + linchk.Set(&start_pos, &end_pos, a_this); + + if (dComIfG_Bgsp().LineCross(&linchk)) { + offset = start_pos - end_pos; + mDoMtx_stack_c::YrotS(cM_atan2s(offset.x, offset.z)); + + offset.x = 0.0f; + offset.y = 0.0f; + offset.z = 50.0f; + mDoMtx_stack_c::multVec(&offset, &ato); + a_this->current.pos += ato; + } + } + + if (!l_no_fail && can_shout && i_this->field_0x6aa == 0 && i_this->mGroupID != 0xFF && fpcM_Search(s_down_sub, i_this) == NULL) { + i_this->mAction = ACT_SHOUT; + i_this->mMode = 0; + + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + player->offWolfEnemyHangBite(); + } + + if (on_attention) { + fopAcM_OnStatus(a_this, 0); + i_this->attention_info.flags = 4; + } else { + fopAcM_OffStatus(a_this, 0); + i_this->attention_info.flags = 0; + } + + if (can_bibiri && (daPy_getPlayerActorClass()->checkWolfBark() || daPy_getPlayerActorClass()->checkWolfThreat()) && pl_at_check(i_this, l_HIO.mReactionDist)) { + fopAc_ac_c* player = dComIfGp_getPlayer(0); + s16 angle_to_player = player->shape_angle.y - (fopAcM_searchPlayerAngleY(a_this) + 0x8000); + s16 bibiri_angle = 182.04f * l_HIO.mReactionAngle; + + if (angle_to_player < bibiri_angle && angle_to_player > (s16)-bibiri_angle) { + i_this->mAction = ACT_BIBIRI; + i_this->mMode = 0; + + i_this->field_0x6ac = 40.0f + JREG_F(11); + i_this->field_0x6b0 = fopAcM_searchPlayerAngleY(a_this); + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_HIRUMU, -1); + } + } + + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 4, 0x2000); + cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 4, 0x1000); + cLib_addCalcAngleS2(&a_this->shape_angle.z, a_this->current.angle.z, 4, 0x1000); + + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + mae.x = 0.0f; + mae.y = 0.0f; + mae.z = a_this->speedF * l_HIO.mBaseSize; + MtxPosition(&mae, &ato); + + a_this->speed.x = ato.x; + a_this->speed.z = ato.z; + a_this->current.pos += a_this->speed; + + a_this->speed.y += a_this->gravity; + if (a_this->speed.y < -120.0f) { + a_this->speed.y = -120.0f; + } + + if (i_this->field_0x6ac > 0.01f) { + mae.x = 0.0f; + mae.y = 0.0f; + mae.z = -i_this->field_0x6ac; + cMtx_YrotS(*calc_mtx, i_this->field_0x6b0); + MtxPosition(&mae, &ato); + + a_this->current.pos += ato; + cLib_addCalc0(&i_this->field_0x6ac, 1.0f, 7.0f + TREG_F(12)); + } + + if (cc_move) { + cXyz* ccmove = i_this->mCcStts.GetCCMoveP(); + if (ccmove != NULL) { + a_this->current.pos.x += ccmove->x; + a_this->current.pos.y += ccmove->y; + a_this->current.pos.z += ccmove->z; + } + } +} + +/* 8077E618-8077E870 003B78 0258+00 1/1 0/0 0/0 .text ke_set__FP10e_s1_class */ +static void ke_set(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz mae; + cXyz spC; + + cM_initRnd2(12, 123, (fopAcM_GetID(a_this) * 2) + 50); + + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(4), *calc_mtx); + + for (int i = 0; i < 22; i++) { + MtxPush(); + cMtx_YrotM(*calc_mtx, (ZREG_S(0) + 0x4000)); + cMtx_XrotM(*calc_mtx, (ZREG_S(1) + (int)cM_rndF2(2000.0f) + 3000)); + + static s16 ke_za[] = { + 0xFCE0, 0xFE70, 0x0000, 0x0190, 0x0320, 0xFCE0, 0xFE70, + 0x0000, 0x0190, 0x0320, 0xFCE0, 0xFE70, 0x0000, 0x0190, + 0x0320, 0x04B0, 0xFCE0, 0xFE70, 0x0000, 0x0190, 0x0320, + 0x04B0, + }; + + f32 z_pos; + f32 x_offset; + f32 z_offset; + if (i < 10) { + cMtx_ZrotM(*calc_mtx, (ZREG_S(2) + 5) * ke_za[i]); + + z_pos = cM_rndF2(2.25f) + 7.5f; + x_offset = cM_rndF2(10.0f) - 5.0f; + z_offset = cM_rndF2(20.0f) - 10.0f; + } else { + cMtx_ZrotM(*calc_mtx, ((ZREG_S(2) + 5) * ke_za[i]) + 0x8000); + + z_pos = cM_rndF2(3.0f) + 8.0f; + x_offset = cM_rndF2(20.0f) - 10.0f; + z_offset = cM_rndF2(30.0f) - 15.0f; + } + + mae.set(x_offset, 15.0f + ZREG_F(1), z_offset + ZREG_F(2)); + MtxPosition(&mae, &i_this->mKe[i].field_0x0[0]); + + mae.set(x_offset, 20.0f + (15.0f + ZREG_F(1)) + ZREG_F(4), z_offset + ZREG_F(2)); + MtxPosition(&mae, &i_this->mKe[i].field_0x180); + + i_this->mKe[i].field_0x180 -= i_this->mKe[i].field_0x0[0]; + ke_move(i_this, &i_this->mLineMat, &i_this->mKe[i], i, z_pos); + + MtxPull(); + } +} + +/* 8077E870-8077EE10 003DD0 05A0+00 2/1 0/0 0/0 .text demo_camera__FP10e_s1_class */ +static void demo_camera(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + camera_class* spC = dComIfGp_getCamera(0); + + cXyz spC4; + cXyz spD0; + cXyz spDC; + cXyz spE8; + + s8 sp8 = true; + + switch (i_this->mDemoMode) { + case 1: + if (!a_this->eventInfo.i_checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + + i_this->mDemoMode = 2; + i_this->mDemoTimer = 0; + i_this->mDemoCamBank = 55.0f; + i_this->field_0x3054 = 300.0; + i_this->field_0x3058 = 1200.0f; + i_this->field_0x3060 = 0.0f; + + camera->mCamera.SetTrimSize(3); + /* fallthrough */ + case 2: + mDoMtx_stack_c::YrotS(a_this->shape_angle.y); + spC4.x = TREG_F(2); + spC4.y = i_this->field_0x3054; + spC4.z = i_this->field_0x3058; + mDoMtx_stack_c::multVec(&spC4, &i_this->mDemoCamEye); + i_this->mDemoCamEye += a_this->current.pos; + + cLib_addCalc2(&i_this->field_0x3054, 30.0f, 0.1f, i_this->field_0x3060 * 270.0f); + cLib_addCalc2(&i_this->field_0x3058, 750.0f, 0.1f, i_this->field_0x3060 * 850.0f); + cLib_addCalc2(&i_this->field_0x3060, 0.05f, 1.0f, 0.005f); + + i_this->mDemoCamCenter = a_this->eyePos; + i_this->mDemoCamCenter.y += 50.0f; + + if (i_this->mDemoTimer == 137) { + if (!dComIfGs_isSwitch(i_this->mSwBit, fopAcM_GetRoomNo(a_this))) { + dComIfGs_onSwitch(i_this->mSwBit, fopAcM_GetRoomNo(a_this)); + OS_REPORT("S! BITSW %d\n", i_this->mSwBit); + OS_REPORT("S! BITSW %d\n", dComIfGs_isSwitch(i_this->mSwBit, fopAcM_GetRoomNo(a_this))); + } + + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + fopAcM_delete(a_this); + } + break; + case 10: + if (!a_this->eventInfo.i_checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + + i_this->mDemoMode = 11; + i_this->mDemoTimer = 0; + i_this->mDemoCamBank = 60.0f; + + i_this->mDemoCamCenter.set(-16046.0f, 177.0f, -955.0f); + i_this->mDemoCamEye.set(-16174.0f, 331.0f, -731.0f); + + camera->mCamera.SetTrimSize(3); + player->changeOriginalDemo(); + /* fallthrough */ + case 11: + sp8 = false; + spC4.set(-15400.0f, 0.0f, 400.0f); + daPy_getPlayerActorClass()->setPlayerPosAndAngle(&spC4, 0, 0); + + if (i_this->mDemoTimer != 60) { + break; + } + + i_this->mDemoMode = 12; + i_this->mDemoTimer = 0; + i_this->mDemoCamBank = 45.15f; + /* fallthrough */ + case 12: + sp8 = false; + + i_this->mDemoCamCenter.set(-40.0f, -39.0f, -68.0f); + i_this->mDemoCamCenter += player->attention_info.position; + + i_this->mDemoCamEye.set(218.0f, -3.0f, 78.0f); + i_this->mDemoCamEye += player->attention_info.position; + + if (i_this->mDemoTimer == 45) { + i_this->mDemoMode = 13; + i_this->mDemoTimer = 0; + i_this->mDemoCamBank = 42.0f; + + i_this->mDemoCamCenter.set(-16232.0f, 45.6f, 234.0f); + i_this->mDemoCamEye.set(-16140.0f, 17.6f, 518.0f); + } + break; + case 13: + sp8 = false; + + if (i_this->mDemoTimer == 110) { + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + + daPy_getPlayerActorClass()->cancelOriginalDemo(); + dComIfGs_onSwitch(14, fopAcM_GetRoomNo(a_this)); + i_this->mDemoMode = 0; + } + break; + } + + if (i_this->mDemoMode != 0) { + cXyz center; + cXyz eye; + + center = i_this->mDemoCamCenter; + eye = i_this->mDemoCamEye; + + if (sp8) { + dBgS_LinChk linchk; + linchk.Set(&i_this->mDemoCamCenter, &i_this->mDemoCamEye, a_this); + + if (dComIfG_Bgsp().LineCross(&linchk)) { + eye = linchk.i_GetCross() + ((center - eye) * 0.1f); + + f32 dist_x = eye.x - center.x; + f32 dist_z = eye.z - center.z; + eye.y += i_this->field_0x3058 - JMAFastSqrt(dist_x * dist_x + dist_z * dist_z); + } + } + + camera->mCamera.Set(center, eye, i_this->mDemoCamBank, 0); + i_this->mDemoTimer++; + } +} + +/* 8077EE10-8077F250 004370 0440+00 1/1 0/0 0/0 .text anm_se_set__FP10e_s1_class */ +static void anm_se_set(e_s1_class* i_this) { + if (i_this->mAnm == ANM_WALK) { + if (i_this->mpMorf->checkFrame(27.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_FN_L, 0, -1); + } else if (i_this->mpMorf->checkFrame(57.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_FN_R, 0, -1); + } + } else if (i_this->mAnm == ANM_DASH_01) { + if (i_this->mpMorf->checkFrame(1.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_HAND_R, 0, -1); + } else if (i_this->mpMorf->checkFrame(3.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_FN_R, 0, -1); + } else if (i_this->mpMorf->checkFrame(4.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_HAND_L, 0, -1); + } else if (i_this->mpMorf->checkFrame(7.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_FN_L, 0, -1); + } + } else if (i_this->mAnm == ANM_DASH_02) { + if (i_this->mpMorf->checkFrame(1.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_HAND_R, 0, -1); + } else if (i_this->mpMorf->checkFrame(6.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_FN_R, 0, -1); + } else if (i_this->mpMorf->checkFrame(8.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_HAND_L, 0, -1); + } else if (i_this->mpMorf->checkFrame(14.0f)) { + i_this->mSound.startCreatureSound(Z2SE_EN_NS_FN_L, 0, -1); + } + } else if (i_this->mAnm == ANM_WAIT_01) { + if (i_this->mpMorf->checkFrame(0.0f)) { + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_WAIT, -1); + } else if (i_this->mpMorf->checkFrame(45.0f)) { + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_WAIT, -1); + } + } else if (i_this->mAnm == ANM_WAIT_02) { + if (i_this->mpMorf->checkFrame(0.0f)) { + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_SEARCH, -1); + } else if (i_this->mpMorf->checkFrame(45.0f)) { + i_this->mSound.startCreatureVoice(Z2SE_EN_NS_V_SEARCH, -1); + } + } +} + +/* 8077F250-8077F314 0047B0 00C4+00 1/1 0/0 0/0 .text body_eff_set__FP10e_s1_class */ +static void body_eff_set(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + J3DModel* model = i_this->mpMorf->getModel(); + + i_this->mBodyEffEmtrID = dComIfGp_particle_set(i_this->mBodyEffEmtrID, 0x387, &a_this->current.pos, NULL, NULL); + + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->mBodyEffEmtrID); + if (emitter != NULL) { + emitter->setGlobalRTMatrix(model->getAnmMtx(2)); + } +} + +/* 8077F314-8077FC88 004874 0974+00 2/1 0/0 0/0 .text daE_S1_Execute__FP10e_s1_class */ +static int daE_S1_Execute(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + cXyz spE0; + cXyz spD4; + + i_this->mCounter++; + + for (int i = 0; i < 4; i++) { + if (i_this->mTimers[i] != 0) { + i_this->mTimers[i]--; + } + } + + if (i_this->mHitInvincibilityTimer != 0) { + i_this->mHitInvincibilityTimer--; + } + + if (i_this->field_0x6aa != 0) { + i_this->field_0x6aa--; + } + + action(i_this); + + if (strcmp(dComIfGp_getStartStageName(), "F_SP121") == 0 && i_this->mPrm1 == 0xFE) { + if (a_this->current.pos.z <= -27035.0f) { + if (a_this->current.pos.z >= -35400.0f && a_this->current.pos.y < 0.0f) { + if (a_this->current.pos.z > -28750.0f) { + a_this->current.pos.z = -28750.0f; + } + + if (a_this->current.pos.x > 35330.0f) { + a_this->current.pos.x = 35330.0f; + } else if (a_this->current.pos.x < 34270.0f) { + a_this->current.pos.x = 34270.0f; + } + } + } + } + + i_this->mAcch.CrrPos(dComIfG_Bgsp()); + + s16 spC = 0; + s16 spA = 0; + + if (i_this->mAction == ACT_FAIL) { + Vec spC8; + cXyz spBC; + cXyz spB0; + dBgS_GndChk gndchk; + f32 temp_f30 = 75.0f; + + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(1), *calc_mtx); + spE0.set(0.0f, 0.0f, 0.0f); + MtxPosition(&spE0, &spBC); + + spBC.y += 100.0f; + spBC.y += 100.0f; + gndchk.SetPos(&spBC); + + spBC.y = dComIfG_Bgsp().GroundCross(&gndchk); + if (-1000000000.0f != spBC.y) { + spC8.x = spBC.x; + spC8.y = spBC.y + 100.0f; + spC8.z = spBC.z + temp_f30; + gndchk.SetPos(&spC8); + + spC8.y = dComIfG_Bgsp().GroundCross(&gndchk); + if (-1000000000.0f != spC8.y) { + spA = -cM_atan2s(spC8.y - spBC.y, spC8.z - spBC.z); + if (spA > 0x3000 || spA < -0x3000) { + spA = 0; + } + } + + spC8.x = spBC.x + temp_f30; + spC8.y = spBC.y + 100.0f; + spC8.z = spBC.z; + gndchk.SetPos(&spC8); + + spC8.y = dComIfG_Bgsp().GroundCross(&gndchk); + if (-1000000000.0f != spC8.y) { + spC = (s16)cM_atan2s(spC8.y - spBC.y, spC8.x - spBC.x); + if (spC > 0x3000 || spC < -0x3000) { + spC = 0; + } + } + } + + dBgS_LinChk linchk; + cXyz spA4; + cXyz sp98; + cXyz sp8C; + + sp98 = a_this->current.pos; + sp98.y += 50.0f + JREG_F(5); + + J3DModel* model = i_this->mpMorf->getModel(); + spA4.set(0.0f, 0.0f, 0.0f); + MTXCopy(model->getAnmMtx(4), *calc_mtx); + + MtxPosition(&spA4, &sp8C); + sp8C.y += 50.0f + JREG_F(6); + + linchk.Set(&sp98, &sp8C, a_this); + + if (dComIfG_Bgsp().LineCross(&linchk)) { + spA4 = sp98 - sp8C; + cMtx_YrotS(*calc_mtx, cM_atan2s(spA4.x, spA4.z)); + + spA4.x = 0.0f; + spA4.y = 0.0f; + spA4.z = 50.0f + TREG_F(11); + MtxPosition(&spA4, &spD4); + a_this->current.pos += spD4; + } + } + + cLib_addCalcAngleS2(&i_this->field_0x6b2, spA, 1, 0x400); + cLib_addCalcAngleS2(&i_this->field_0x6b6, spC, 1, 0x400); + + mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y, a_this->current.pos.z); + mDoMtx_stack_c::XrotM(i_this->field_0x6b2); + mDoMtx_stack_c::ZrotM(i_this->field_0x6b6); + mDoMtx_stack_c::YrotM(a_this->shape_angle.y); + mDoMtx_stack_c::XrotM(a_this->shape_angle.x); + mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); + mDoMtx_stack_c::scaleM(l_HIO.mBaseSize * a_this->scale.x, l_HIO.mBaseSize * a_this->scale.x, l_HIO.mBaseSize * a_this->scale.x); + + J3DModel* model = i_this->mpMorf->getModel(); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(a_this))); + i_this->mpMorf->modelCalc(); + + anm_se_set(i_this); + body_eff_set(i_this); + ke_set(i_this); + + MTXCopy(model->getAnmMtx(4), *calc_mtx); + spE0.set(20.0f + KREG_F(0), KREG_F(1), KREG_F(2)); + MtxPosition(&spE0, &a_this->eyePos); + + a_this->attention_info.position = a_this->eyePos; + a_this->attention_info.position.y += 35.0f; + + cXyz sp80(0.0f, 0.0f, 0.0f); + if (i_this->mHitInvincibilityTimer != 0) { + sp80.x = 22340.0f; + } + + i_this->mCcSph[0].SetC(a_this->eyePos + sp80); + i_this->mCcSph[0].SetR(35.0f * l_HIO.mBaseSize); + dComIfG_Ccsp()->Set(&i_this->mCcSph[0]); + + spE0.set(0.0f, 0.0f, 0.0f); + MTXCopy(model->getAnmMtx(3), *calc_mtx); + MtxPosition(&spE0, &spD4); + + i_this->mCcSph[1].SetC(spD4 + sp80); + i_this->mCcSph[1].SetR(60.0f * l_HIO.mBaseSize); + + MTXCopy(model->getAnmMtx(2), *calc_mtx); + MtxPosition(&spE0, &spD4); + + i_this->mCcSph[2].SetC(spD4 + sp80); + i_this->mCcSph[2].SetR(50.0f * l_HIO.mBaseSize); + + dComIfG_Ccsp()->Set(&i_this->mCcSph[1]); + dComIfG_Ccsp()->Set(&i_this->mCcSph[2]); + + if (i_this->field_0x6b9 != 0) { + if (i_this->field_0x6b9 == 1) { + MTXCopy(model->getAnmMtx(0xF), *calc_mtx); + } else if (i_this->field_0x6b9 == 2) { + MTXCopy(model->getAnmMtx(8), *calc_mtx); + } else if (i_this->field_0x6b9 == 3) { + MTXCopy(model->getAnmMtx(4), *calc_mtx); + } + + spE0.set(0.0f, 0.0f, 0.0f); + MtxPosition(&spE0, &spD4); + + i_this->field_0x6b9 = 0; + + if (i_this->field_0x6ba == 0) { + i_this->field_0x6ba = 1; + i_this->mCcAtSph.StartCAt(spD4); + } else { + i_this->mCcAtSph.MoveCAt(spD4); + } + } else { + spD4.set(20000.0f, 50000.0f, 20000.0f); + i_this->mCcAtSph.SetC(spD4); + i_this->field_0x6ba = 0; + } + + i_this->mCcAtSph.SetR(40.0f * l_HIO.mBaseSize); + dComIfG_Ccsp()->Set(&i_this->mCcAtSph); + + demo_camera(i_this); + + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(2), *calc_mtx); + spE0.set(0.0f, 0.0f, 0.0f); + MtxPosition(&spE0, &spD4); + + cXyz eff_size(1.3f, 1.3f, 1.3f); + setMidnaBindEffect(i_this, &i_this->mSound, &spD4, &eff_size); + + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(2), mDoMtx_stack_c::get()); + + mDoMtx_stack_c::multVecZero(&spD4); + spE0 = player->current.pos - spD4; + + s16 sp8 = cM_atan2s(spE0.x, spE0.z); + cXyz downpos; + cMtx_YrotS(*calc_mtx, sp8); + + spE0.x = 0.0f; + spE0.y = 45.0f + NREG_F(18); + spE0.z = (60.0f + BREG_F(12)) - 30.0f; + MtxPosition(&spE0, &downpos); + downpos += spD4; + i_this->setDownPos(&downpos); + + cXyz lockpos(a_this->eyePos); + lockpos.y += NREG_F(7) + 130.0f; + i_this->setHeadLockPos(&lockpos); + a_this->attention_info.flags |= 0x200000; + return 1; +} + +/* 8077FC88-8077FC90 0051E8 0008+00 1/0 0/0 0/0 .text daE_S1_IsDelete__FP10e_s1_class */ +static int daE_S1_IsDelete(e_s1_class* i_this) { + return 1; +} + +/* 8077FC90-8077FCF8 0051F0 0068+00 1/0 0/0 0/0 .text daE_S1_Delete__FP10e_s1_class */ +static int daE_S1_Delete(e_s1_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + dComIfG_resDelete(&i_this->mPhase, "E_S2"); + + if (i_this->mInitHIO) { + l_initHIO = false; + } + + if (a_this->heap != NULL) { + i_this->mpMorf->stopZelAnime(); + } + + return 1; +} + +/* 8078116C-80781178 0001C4 000C+00 1/0 0/0 0/0 .data jv_offset */ +static Vec jv_offset = {0.0f, 0.0f, 0.0f}; + +/* 80781178-807811E4 -00001 006C+00 1/1 0/0 0/0 .data jc_data */ +static dJntColData_c jc_data[] = { + {0, 1, 1, 30.0f, &jv_offset}, + {0, 1, 2, 30.0f, &jv_offset}, + {0, 1, 3, 25.0f, &jv_offset}, + {0, 1, 7, 15.0f, &jv_offset}, + {0, 1, 8, 10.0f, &jv_offset}, + {0, 1, 14, 15.0f, &jv_offset}, + {0, 1, 15, 10.0f, &jv_offset}, + {0, 1, 21, 10.0f, &jv_offset}, + {0, 1, 24, 10.0f, &jv_offset}, +}; + /* 8077FCF8-8077FE38 005258 0140+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ -static void useHeapInit(fopAc_ac_c* param_0) { - // NONMATCHING +static int useHeapInit(fopAc_ac_c* i_this) { + e_s1_class* a_this = (e_s1_class*)i_this; + + a_this->mpMorf = new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("E_S2", 0x22), NULL, NULL, (J3DAnmTransform*)dComIfG_getObjectRes("E_S2", 0x1D), 0, 1.0f, 0, -1, &a_this->mSound, 0x80000, 0x11000084); + if (a_this->mpMorf == NULL || a_this->mpMorf->getModel() == NULL) { + return 0; + } + + if (!a_this->mLineMat.init(0x16, 0x10, 1)) { + return 0; + } + + if (!a_this->mJntCol.init(i_this, jc_data, a_this->mpMorf->getModel(), 9)) { + return 0; + } + + return 1; } -/* ############################################################################################## */ -/* 80780F58-80780F5C 000194 0004+00 0/1 0/0 0/0 .rodata @6234 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6234 = -200.0f; -COMPILER_STRIP_GATE(0x80780F58, &lit_6234); -#pragma pop - -/* 80780F5C-80780F60 000198 0004+00 0/1 0/0 0/0 .rodata @6235 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6235 = 200.0f; -COMPILER_STRIP_GATE(0x80780F5C, &lit_6235); -#pragma pop - -/* 80780F60-80780F64 00019C 0004+00 0/1 0/0 0/0 .rodata @6236 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6236 = -7.0f; -COMPILER_STRIP_GATE(0x80780F60, &lit_6236); -#pragma pop - -/* 80780F74-80780F74 0001B0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80780F90 = "D_MN08B"; -SECTION_DEAD static char const* const stringBase_80780F98 = "D_MN08C"; -SECTION_DEAD static char const* const stringBase_80780FA0 = "E_s1"; -#pragma pop - /* 8077FE38-807803F4 005398 05BC+00 1/0 0/0 0/0 .text daE_S1_Create__FP10fopAc_ac_c */ -static void daE_S1_Create(fopAc_ac_c* param_0) { - // NONMATCHING +static int daE_S1_Create(fopAc_ac_c* i_this) { + e_s1_class* a_this = (e_s1_class*)i_this; + fopAcM_SetupActor(a_this, e_s1_class); + + int phase_state = dComIfG_resLoad(&a_this->mPhase, "E_S2"); + if (phase_state == cPhs_COMPLEATE_e) { + OS_REPORT("E_S1 PARAM %x\n", fopAcM_GetParam(i_this)); + OS_REPORT("E_S1 AZ %x\n", i_this->current.angle.z); + l_no_fail = false; + + if ((strcmp(dComIfGp_getStartStageName(), "D_MN08") == 0 || + strcmp(dComIfGp_getStartStageName(), "D_MN08B") == 0 || + strcmp(dComIfGp_getStartStageName(), "D_MN08C") == 0)) + { + if ((s8)fopAcM_GetRoomNo(i_this) == 51 || (s8)fopAcM_GetRoomNo(i_this) == 9 || + (s8)fopAcM_GetRoomNo(i_this) == 52) + { + l_no_fail = true; + } + } + + a_this->mRoofSpawn = fopAcM_GetParam(i_this) & 0xF; + if (a_this->mRoofSpawn == 0xF) { + a_this->mRoofSpawn = 0; + } + + a_this->mGroupID = (fopAcM_GetParam(i_this) & 0xF0) >> 4; + if (a_this->mGroupID == 0xF) { + a_this->mGroupID = 0xFF; + } + + a_this->mPrm1 = (fopAcM_GetParam(i_this) & 0xFF00) >> 8; + if (a_this->mPrm1 == 0xFF) { + if (a_this->mRoofSpawn) { + a_this->mPrm1 = 3; + } else { + a_this->mPrm1 = 20; + } + } + + a_this->mSearchRange = a_this->mPrm1 * 100.0f; + a_this->field_0x3068 = (i_this->current.angle.z & 0xFF) * 100.0f; + + if (a_this->field_0x3068 == 0.0f) { + a_this->field_0x3068 = 300.0f; + } + + i_this->current.angle.z = i_this->shape_angle.z = 0; + + int i; + + u8 path_no = (fopAcM_GetParam(i_this) & 0xFF0000) >> 0x10; + a_this->mSwBit = (fopAcM_GetParam(i_this) & 0xFF000000) >> 0x18; + + if (a_this->mSwBit != 0xFF) { + if (dComIfGs_isSwitch(a_this->mSwBit, (s8)fopAcM_GetRoomNo(i_this))) { + // "After E_S1 defeated, so don't re-set\n" + OS_REPORT("E_S1 やられ後なので再セットしません\n"); + return cPhs_ERROR_e; + } + } + + OS_REPORT("E_S1//////////////E_S1 SET 1 !!\n"); + + if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x8EA0)) { + OS_REPORT("//////////////E_S1 SET NON !!\n"); + return cPhs_ERROR_e; + } + + OS_REPORT("//////////////E_S1 SET 2 !!\n"); + + if (path_no != 0xFF) { + a_this->mpPath = dPath_GetRoomPath(path_no, (s8)fopAcM_GetRoomNo(i_this)); + + OS_REPORT("//////////////E_S1 PPD %x!!\n", a_this->mpPath); + if (a_this->mpPath == NULL) { + OS_REPORT("......NONONONONONO PATH !!!!\n"); + return cPhs_ERROR_e; + } + } + + if (!l_initHIO) { + a_this->mInitHIO = true; + l_initHIO = true; + l_HIO.field_0x4 = -1; + } + + fopAcM_OnStatus(i_this, 0x100); + i_this->attention_info.flags = 4; + + if (!a_this->mRoofSpawn) { + a_this->mAction = ACT_WAIT; + a_this->mDrawShadow = true; + } else { + a_this->mAction = ACT_ROOF; + } + + fopAcM_SetMtx(i_this, a_this->mpMorf->getModel()->getBaseTRMtx()); + fopAcM_SetMin(i_this, -200.0f, -200.0f, -200.0f); + fopAcM_SetMax(i_this, 200.0f, 200.0f, 200.0f); + + OS_REPORT("//////////////E_S1 POS %d,%d,%d \n", (int)i_this->home.pos.x, (int)i_this->home.pos.y, (int)i_this->home.pos.z); + a_this->mAcch.Set(fopAcM_GetPosition_p(i_this), fopAcM_GetOldPosition_p(i_this), i_this, 1, + &a_this->mAcchCir, fopAcM_GetSpeed_p(i_this), NULL, NULL); + a_this->mAcchCir.SetWall(50.0f, 100.0f); + + i_this->field_0x560 = i_this->health = 50; + + a_this->mCcStts.Init(0xFA, 0, i_this); + + static dCcD_SrcSph cc_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph + } // mSphAttr + }; + + static dCcD_SrcSph at_sph_src = { + { + {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0x0, 0x0}, 0x0}}, // mObj + {dCcD_SE_HARD_BODY, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 35.0f} // mSph + } // mSphAttr + }; + + for (i = 0; i <= 2; i++) { + a_this->mCcSph[i].Set(cc_sph_src); + a_this->mCcSph[i].SetStts(&a_this->mCcStts); + } + + a_this->mCcAtSph.Set(at_sph_src); + a_this->mCcAtSph.SetStts(&a_this->mCcStts); + + a_this->mSound.init(&i_this->current.pos, &i_this->eyePos, 3, 1); + a_this->mSound.setEnemyName("E_s1"); + a_this->mAtInfo.mpSound = &a_this->mSound; + + a_this->field_0x6aa = 30; + + if (!dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[83]) && + strcmp(dComIfGp_getStartStageName(), "F_SP121") == 0 && a_this->mPrm1 == 0xFE) + { + i_this->current.pos.y += 50000.0f; + i_this->current.pos.x += 50000.0f; + } + + daE_S1_Execute(a_this); + i_this->gravity = -7.0f; + } + + return phase_state; } -/* 807803F4-80780470 005954 007C+00 1/1 0/0 0/0 .text __dt__7s1_ke_sFv */ -s1_ke_s::~s1_ke_s() { - // NONMATCHING -} +/* 80781264-80781284 -00001 0020+00 1/0 0/0 0/0 .data l_daE_S1_Method */ +static actor_method_class l_daE_S1_Method = { + (process_method_func)daE_S1_Create, (process_method_func)daE_S1_Delete, + (process_method_func)daE_S1_Execute, (process_method_func)daE_S1_IsDelete, + (process_method_func)daE_S1_Draw, +}; -/* 80780470-807804D8 0059D0 0068+00 1/1 0/0 0/0 .text __ct__7s1_ke_sFv */ -s1_ke_s::s1_ke_s() { - // NONMATCHING -} +/* 80781284-807812B4 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_S1 */ +extern actor_process_profile_definition g_profile_E_S1 = { + fpcLy_CURRENT_e, // mLayerID + 7, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_E_S1, // mProcName + &g_fpcLf_Method.mBase, // sub_method + sizeof(e_s1_class), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 121, // mPriority + &l_daE_S1_Method, // sub_method + 0x00040000, // mStatus + fopAc_ENEMY_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; -/* 807804D8-807804DC 005A38 0004+00 1/1 0/0 0/0 .text __ct__4cXyzFv */ -// cXyz::cXyz() { -extern "C" void __ct__4cXyzFv() { - /* empty function */ -} - -/* 807804DC-80780524 005A3C 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -// cM3dGSph::~cM3dGSph() { -extern "C" void __dt__8cM3dGSphFv() { - // NONMATCHING -} - -/* 80780524-8078056C 005A84 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 8078056C-80780638 005ACC 00CC+00 1/1 0/0 0/0 .text __dt__8dCcD_SphFv */ -// dCcD_Sph::~dCcD_Sph() { -extern "C" void __dt__8dCcD_SphFv() { - // NONMATCHING -} - -/* 80780638-807806BC 005B98 0084+00 1/1 0/0 0/0 .text __ct__8dCcD_SphFv */ -// dCcD_Sph::dCcD_Sph() { -extern "C" void __ct__8dCcD_SphFv() { - // NONMATCHING -} - -/* 807806BC-80780718 005C1C 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING -} - -/* 80780718-80780788 005C78 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -// dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" void __dt__12dBgS_ObjAcchFv() { - // NONMATCHING -} - -/* 80780788-807807F8 005CE8 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */ -// dBgS_AcchCir::~dBgS_AcchCir() { -extern "C" void __dt__12dBgS_AcchCirFv() { - // NONMATCHING -} - -/* 807807F8-80780840 005D58 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} - -/* 80780840-80780888 005DA0 0048+00 2/1 0/0 0/0 .text __dt__12daE_S1_HIO_cFv */ -daE_S1_HIO_c::~daE_S1_HIO_c() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80780F64-80780F68 0001A0 0004+00 0/1 0/0 0/0 .rodata @6362 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6362 = -16500.0f; -COMPILER_STRIP_GATE(0x80780F64, &lit_6362); -#pragma pop - -/* 80780F68-80780F6C 0001A4 0004+00 0/1 0/0 0/0 .rodata @6363 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6363 = -100.0f; -COMPILER_STRIP_GATE(0x80780F68, &lit_6363); -#pragma pop - -/* 80780F6C-80780F70 0001A8 0004+00 0/1 0/0 0/0 .rodata @6364 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6364 = -16300.0f; -COMPILER_STRIP_GATE(0x80780F6C, &lit_6364); -#pragma pop - -/* 80780F70-80780F74 0001AC 0004+00 0/1 0/0 0/0 .rodata @6365 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6365 = -400.0f; -COMPILER_STRIP_GATE(0x80780F70, &lit_6365); -#pragma pop - -/* 80780888-80780950 005DE8 00C8+00 0/0 1/0 0/0 .text __sinit_d_a_e_s1_cpp */ -void __sinit_d_a_e_s1_cpp() { - // NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80780888, __sinit_d_a_e_s1_cpp); -#pragma pop - -/* 80780950-80780958 005EB0 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_80780950() { - // NONMATCHING -} - -/* 80780958-80780960 005EB8 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_80780958() { - // NONMATCHING -} - -/* 80780960-80780D74 005EC0 0414+00 1/1 0/0 0/0 .text - * setMidnaBindEffect__FP13fopEn_enemy_cP15Z2CreatureEnemyP4cXyzP4cXyz */ -static void setMidnaBindEffect(fopEn_enemy_c* param_0, Z2CreatureEnemy* param_1, cXyz* param_2, - cXyz* param_3) { - // NONMATCHING -} - -/* 80780D74-80780DB0 0062D4 003C+00 3/3 0/0 0/0 .text __dt__4cXyzFv */ -// cXyz::~cXyz() { -extern "C" void __dt__4cXyzFv() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 807814F4-807814F8 0001BC 0004+00 0/0 0/0 0/0 .bss - * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ -#pragma push -#pragma force_active on -static u8 data_807814F4[4]; -#pragma pop - -/* 807814F8-807814FC 0001C0 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14JASAudioThread> */ -#pragma push -#pragma force_active on -static u8 data_807814F8[4]; -#pragma pop - -/* 807814FC-80781500 0001C4 0004+00 0/0 0/0 0/0 .bss sInstance__27JASGlobalInstance<7Z2SeMgr> */ -#pragma push -#pragma force_active on -static u8 data_807814FC[4]; -#pragma pop - -/* 80781500-80781504 0001C8 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8Z2SeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_80781500[4]; -#pragma pop - -/* 80781504-80781508 0001CC 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SceneMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80781504[4]; -#pragma pop - -/* 80781508-8078150C 0001D0 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2StatusMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80781508[4]; -#pragma pop - -/* 8078150C-80781510 0001D4 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2DebugSys> - */ -#pragma push -#pragma force_active on -static u8 data_8078150C[4]; -#pragma pop - -/* 80781510-80781514 0001D8 0004+00 0/0 0/0 0/0 .bss - * sInstance__36JASGlobalInstance<15JAISoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_80781510[4]; -#pragma pop - -/* 80781514-80781518 0001DC 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14Z2SoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_80781514[4]; -#pragma pop - -/* 80781518-8078151C 0001E0 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12Z2SpeechMgr2> */ -#pragma push -#pragma force_active on -static u8 data_80781518[4]; -#pragma pop - -/* 8078151C-80781520 0001E4 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8JAISeMgr> */ -#pragma push -#pragma force_active on -static u8 data_8078151C[4]; -#pragma pop - -/* 80781520-80781524 0001E8 0004+00 0/0 0/0 0/0 .bss sInstance__29JASGlobalInstance<9JAISeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_80781520[4]; -#pragma pop - -/* 80781524-80781528 0001EC 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAIStreamMgr> */ -#pragma push -#pragma force_active on -static u8 data_80781524[4]; -#pragma pop - -/* 80781528-8078152C 0001F0 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SoundMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80781528[4]; -#pragma pop - -/* 8078152C-80781530 0001F4 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAISoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_8078152C[4]; -#pragma pop - -/* 80781530-80781534 0001F8 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13JAUSoundTable> */ -#pragma push -#pragma force_active on -static u8 data_80781530[4]; -#pragma pop - -/* 80781534-80781538 0001FC 0004+00 0/0 0/0 0/0 .bss - * sInstance__38JASGlobalInstance<17JAUSoundNameTable> */ -#pragma push -#pragma force_active on -static u8 data_80781534[4]; -#pragma pop - -/* 80781538-8078153C 000200 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAUSoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_80781538[4]; -#pragma pop - -/* 8078153C-80781540 000204 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SoundInfo> - */ -#pragma push -#pragma force_active on -static u8 data_8078153C[4]; -#pragma pop - -/* 80781540-80781544 000208 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2SoundObjMgr> */ -#pragma push -#pragma force_active on -static u8 data_80781540[4]; -#pragma pop - -/* 80781544-80781548 00020C 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2Audience> - */ -#pragma push -#pragma force_active on -static u8 data_80781544[4]; -#pragma pop - -/* 80781548-8078154C 000210 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2FxLineMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80781548[4]; -#pragma pop - -/* 8078154C-80781550 000214 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2EnvSeMgr> - */ -#pragma push -#pragma force_active on -static u8 data_8078154C[4]; -#pragma pop - -/* 80781550-80781554 000218 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SpeechMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80781550[4]; -#pragma pop - -/* 80781554-80781558 00021C 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ -#pragma push -#pragma force_active on -static u8 data_80781554[4]; -#pragma pop - -/* 80780F74-80780F74 0001B0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ \ No newline at end of file +AUDIO_INSTANCES; diff --git a/src/d/actor/d_a_obj_digsnow.cpp b/src/d/actor/d_a_obj_digsnow.cpp index 5b5e81debf8..6d69dd2eb9f 100644 --- a/src/d/actor/d_a_obj_digsnow.cpp +++ b/src/d/actor/d_a_obj_digsnow.cpp @@ -4,13 +4,9 @@ // #include "d/actor/d_a_obj_digsnow.h" - #include "d/actor/d_a_player.h" #include "d/d_com_inf_game.h" - -// -// Declarations: -// +#include /* 80BDCC58-80BDCC94 000078 003C+00 1/1 0/0 0/0 .text initBaseMtx__14daObjDigSnow_cFv */ void daObjDigSnow_c::initBaseMtx() { @@ -62,8 +58,9 @@ static char* l_arcName = "Y_horiyuk"; /* 80BDCD64-80BDCDD4 000184 0070+00 1/0 0/0 0/0 .text CreateHeap__14daObjDigSnow_cFv */ int daObjDigSnow_c::CreateHeap() { - J3DModelData* model_data = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); - mpModel = mDoExt_J3DModel__create(model_data, 0x80000, 0x11000084); + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); + JUT_ASSERT(0x9F, modelData != 0); + mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); if (mpModel == NULL) { return FALSE; @@ -74,28 +71,25 @@ int daObjDigSnow_c::CreateHeap() { /* 80BDCDD4-80BDCE84 0001F4 00B0+00 1/1 0/0 0/0 .text create1st__14daObjDigSnow_cFv */ int daObjDigSnow_c::create1st() { - cPhs__Step step; - if (dComIfGs_isSwitch(getSwNo(), fopAcM_GetHomeRoomNo(this))) { return cPhs_ERROR_e; - } else { - step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, l_arcName); - if (step == cPhs_COMPLEATE_e) { - step = - (cPhs__Step)MoveBGCreate(l_arcName, 7, dBgS_MoveBGProc_TypicalRotY, 0x1000, NULL); - if (step == cPhs_ERROR_e) { - return step; - } + } + + cPhs__Step phase_state = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, l_arcName); + if (phase_state == cPhs_COMPLEATE_e) { + phase_state = (cPhs__Step)MoveBGCreate(l_arcName, 7, dBgS_MoveBGProc_TypicalRotY, 0x1000, NULL); + if (phase_state == cPhs_ERROR_e) { + return phase_state; } } - return step; + return phase_state; } /* 80BDCE84-80BDCF00 0002A4 007C+00 1/0 0/0 0/0 .text Execute__14daObjDigSnow_cFPPA3_A4_f */ int daObjDigSnow_c::Execute(Mtx** i_mtx) { - if (dComIfGp_getLinkPlayer()->checkWolf()) { + if (daPy_py_c::i_checkNowWolf()) { attention_info.flags = 0x80; } else { attention_info.flags = 0; @@ -145,14 +139,20 @@ void daObjDigSnow_c::mode_init_dig() { f32 gnd_height = dComIfG_Bgsp().GroundCross(&obj_gnd_chk); if (gnd_height != -1000000000.0f) { mGroundHeight = gnd_height; + } else { +#ifdef DEBUG + // "No BG under digsnow!" + OS_REPORT_ERROR("掘る雪の下にBGがありません!"); + fopAcM_delete(this); +#endif } - startDig(); + mAction = 1; } /* 80BDD124-80BDD1BC 000544 0098+00 1/0 0/0 0/0 .text mode_dig__14daObjDigSnow_cFv */ void daObjDigSnow_c::mode_dig() { - f32 step = fabsf(((current.pos.y - mGroundHeight) + 10.0f) / 35.0f); + f32 step = std::fabs(((current.pos.y - mGroundHeight) + 10.0f) / 35.0f); if (step < 1.0f) { step = 1.0f; } @@ -167,13 +167,12 @@ void daObjDigSnow_c::mode_dig() { void daObjDigSnow_c::mode_init_end() { dComIfGs_onSwitch(getSwNo(), fopAcM_GetHomeRoomNo(this)); fopAcM_delete(this); - endDig(); + + mAction = 2; } /* 80BDD210-80BDD214 000630 0004+00 1/0 0/0 0/0 .text mode_end__14daObjDigSnow_cFv */ -void daObjDigSnow_c::mode_end() { - /* empty function */ -} +void daObjDigSnow_c::mode_end() {} /* 80BDD214-80BDD2B8 000634 00A4+00 1/0 0/0 0/0 .text Draw__14daObjDigSnow_cFv */ int daObjDigSnow_c::Draw() { @@ -197,7 +196,6 @@ int daObjDigSnow_c::Delete() { */ static int daObjDigSnow_create1st(daObjDigSnow_c* i_this) { fopAcM_SetupActor(i_this, daObjDigSnow_c); - return i_this->create1st(); } @@ -241,4 +239,4 @@ extern actor_process_profile_definition g_profile_Obj_DigSnow = { 0x44100, // mStatus fopAc_ACTOR_e, // mActorType fopAc_CULLBOX_CUSTOM_e, // cullType -}; \ No newline at end of file +}; diff --git a/src/d/actor/d_a_obj_lv4digsand.cpp b/src/d/actor/d_a_obj_lv4digsand.cpp index afdaeeb5e07..72f47e9f42e 100644 --- a/src/d/actor/d_a_obj_lv4digsand.cpp +++ b/src/d/actor/d_a_obj_lv4digsand.cpp @@ -1,139 +1,49 @@ /** * @file d_a_obj_lv4digsand.cpp - * -*/ + * Arbiter's Grounds Dig Sand + */ #include "d/actor/d_a_obj_lv4digsand.h" -#include "dol2asm.h" - - -// -// Forward References: -// - -extern "C" void initBaseMtx__16daObjL4DigSand_cFv(); -extern "C" void setBaseMtx__16daObjL4DigSand_cFv(); -extern "C" void Create__16daObjL4DigSand_cFv(); -extern "C" void CreateHeap__16daObjL4DigSand_cFv(); -extern "C" void create1st__16daObjL4DigSand_cFv(); -extern "C" void Execute__16daObjL4DigSand_cFPPA3_A4_f(); -extern "C" void action__16daObjL4DigSand_cFv(); -extern "C" void mode_init_wait__16daObjL4DigSand_cFv(); -extern "C" void mode_wait__16daObjL4DigSand_cFv(); -extern "C" void mode_init_dig__16daObjL4DigSand_cFv(); -extern "C" void __dt__14dBgS_ObjGndChkFv(); -extern "C" void mode_dig__16daObjL4DigSand_cFv(); -extern "C" void mode_init_end__16daObjL4DigSand_cFv(); -extern "C" void mode_end__16daObjL4DigSand_cFv(); -extern "C" void Draw__16daObjL4DigSand_cFv(); -extern "C" void Delete__16daObjL4DigSand_cFv(); -extern "C" static void daObjL4DigSand_create1st__FP16daObjL4DigSand_c(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__10dCcD_GSttsFv(); -extern "C" void __dt__12dBgS_AcchCirFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" static void daObjL4DigSand_MoveBGDelete__FP16daObjL4DigSand_c(); -extern "C" static void daObjL4DigSand_MoveBGExecute__FP16daObjL4DigSand_c(); -extern "C" static void daObjL4DigSand_MoveBGDraw__FP16daObjL4DigSand_c(); -extern "C" void __dt__10cCcD_GSttsFv(); -extern "C" void func_80C67588(void* _this, u8*); -extern "C" static void func_80C675A4(); -extern "C" static void func_80C675AC(); -extern "C" static void func_80C675B4(); -extern "C" static void func_80C675BC(); -extern "C" static void func_80C675C4(); -extern "C" extern char const* const d_a_obj_lv4digsand__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_setCullSizeBox2__FP10fopAc_ac_cP12J3DModelData(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void onSwitch__10dSv_info_cFii(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void GroundCross__4cBgSFP11cBgS_GndChk(); -extern "C" void __ct__12dBgS_AcchCirFv(); -extern "C" void __dt__9dBgS_AcchFv(); -extern "C" void __ct__9dBgS_AcchFv(); -extern "C" void __ct__11dBgS_GndChkFv(); -extern "C" void __dt__11dBgS_GndChkFv(); -extern "C" void __ct__16dBgS_MoveBgActorFv(); -extern "C" bool IsDelete__16dBgS_MoveBgActorFv(); -extern "C" bool ToFore__16dBgS_MoveBgActorFv(); -extern "C" bool ToBack__16dBgS_MoveBgActorFv(); -extern "C" void -MoveBGCreate__16dBgS_MoveBgActorFPCciPFP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz_vUlPA3_A4_f(); -extern "C" void MoveBGDelete__16dBgS_MoveBgActorFv(); -extern "C" void MoveBGExecute__16dBgS_MoveBgActorFv(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void checkItemGet__FUci(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void SetPos__11cBgS_GndChkFPC4cXyz(); -extern "C" void __dt__13cBgS_PolyInfoFv(); -extern "C" void __dt__8cM3dGCirFv(); -extern "C" void cLib_chaseF__FPfff(); -extern "C" void __dl__FPv(); -extern "C" void __ptmf_scall(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__8dCcD_Cyl[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_CylAttr[25]; -extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; -extern "C" extern void* __vt__9cCcD_Stts[8]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" extern u8 data_80C67760[4]; - -// -// Declarations: -// +#include "d/d_com_inf_game.h" +#include "d/actor/d_a_player.h" +#include "d/d_item.h" +#include /* 80C66B18-80C66B54 000078 003C+00 1/1 0/0 0/0 .text initBaseMtx__16daObjL4DigSand_cFv */ void daObjL4DigSand_c::initBaseMtx() { - // NONMATCHING + mpModel->setBaseScale(scale); + setBaseMtx(); } /* 80C66B54-80C66BC8 0000B4 0074+00 2/2 0/0 0/0 .text setBaseMtx__16daObjL4DigSand_cFv */ void daObjL4DigSand_c::setBaseMtx() { - // NONMATCHING + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::YrotM(shape_angle.y); + mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); + MTXCopy(mDoMtx_stack_c::get(), mBgMtx); } /* 80C66BC8-80C66C24 000128 005C+00 1/0 0/0 0/0 .text Create__16daObjL4DigSand_cFv */ -void daObjL4DigSand_c::Create() { - // NONMATCHING +int daObjL4DigSand_c::Create() { + initBaseMtx(); + fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); + fopAcM_setCullSizeBox2(this, mpModel->getModelData()); + + attention_info.distances[fopAc_attn_ETC_e] = 31; + mode_init_wait(); + return 1; } -/* ############################################################################################## */ -/* 80C675E4-80C675E4 000010 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80C675E4 = "P_DSand"; -#pragma pop - /* 80C675EC-80C675F8 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { +static u8 cNullVec__6Z2Calc[12] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* 80C675F8-80C6760C 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ #pragma push #pragma force_active on -SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { +static u32 lit_1787[1 + 4 /* padding */] = { 0x02000201, /* padding */ 0x40080000, @@ -144,91 +54,173 @@ SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { #pragma pop /* 80C6760C-80C67610 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */ -SECTION_DATA static void* l_arcName = (void*)&d_a_obj_lv4digsand__stringBase0; +static char* l_arcName = "P_DSand"; /* 80C66C24-80C66C94 000184 0070+00 1/0 0/0 0/0 .text CreateHeap__16daObjL4DigSand_cFv */ -void daObjL4DigSand_c::CreateHeap() { - // NONMATCHING +int daObjL4DigSand_c::CreateHeap() { + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); + JUT_ASSERT(0x9B, modelData != 0); + + mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (mpModel == NULL) { + return 0; + } + + return 1; } /* 80C66C94-80C66D40 0001F4 00AC+00 1/1 0/0 0/0 .text create1st__16daObjL4DigSand_cFv */ -void daObjL4DigSand_c::create1st() { - // NONMATCHING +int daObjL4DigSand_c::create1st() { + if (fopAcM_isSwitch(this, getSwNo())) { + return cPhs_ERROR_e; + } + + int phase_state = dComIfG_resLoad(&mPhase, l_arcName); + if (phase_state == cPhs_COMPLEATE_e) { + phase_state = MoveBGCreate(l_arcName, 7, NULL, 0x1100, NULL); + if (phase_state == cPhs_ERROR_e) { + return phase_state; + } + } + + return phase_state; } /* 80C66D40-80C66DD0 0002A0 0090+00 1/0 0/0 0/0 .text Execute__16daObjL4DigSand_cFPPA3_A4_f */ -void daObjL4DigSand_c::Execute(f32 (**param_0)[3][4]) { - // NONMATCHING +int daObjL4DigSand_c::Execute(f32 (**param_0)[3][4]) { + if (daPy_py_c::i_checkNowWolf() && checkItemGet(SMELL_POH, 1)) { + attention_info.flags = 0x80; + } else { + attention_info.flags = 0; + } + + action(); + + *param_0 = &mBgMtx; + setBaseMtx(); + return 1; } -/* ############################################################################################## */ -/* 80C67610-80C6761C -00001 000C+00 0/1 0/0 0/0 .data @3715 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3715[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)mode_wait__16daObjL4DigSand_cFv, -}; -#pragma pop - -/* 80C6761C-80C67628 -00001 000C+00 0/1 0/0 0/0 .data @3716 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3716[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)mode_dig__16daObjL4DigSand_cFv, -}; -#pragma pop - -/* 80C67628-80C67634 -00001 000C+00 0/1 0/0 0/0 .data @3717 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3717[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)mode_end__16daObjL4DigSand_cFv, -}; -#pragma pop - -/* 80C67634-80C67658 000048 0024+00 0/1 0/0 0/0 .data l_func$3714 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 l_func[36] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -#pragma pop - /* 80C66DD0-80C66E74 000330 00A4+00 1/1 0/0 0/0 .text action__16daObjL4DigSand_cFv */ void daObjL4DigSand_c::action() { - // NONMATCHING + typedef void (daObjL4DigSand_c::*mode_func)(); + static mode_func l_func[] = { + &daObjL4DigSand_c::mode_wait, + &daObjL4DigSand_c::mode_dig, + &daObjL4DigSand_c::mode_end, + }; + + (this->*l_func[mMode])(); } /* 80C66E74-80C66E80 0003D4 000C+00 1/1 0/0 0/0 .text mode_init_wait__16daObjL4DigSand_cFv */ void daObjL4DigSand_c::mode_init_wait() { - // NONMATCHING + mMode = 0; } /* 80C66E80-80C66EAC 0003E0 002C+00 1/0 0/0 0/0 .text mode_wait__16daObjL4DigSand_cFv */ void daObjL4DigSand_c::mode_wait() { - // NONMATCHING + if (field_0x941 == 1) { + mode_init_dig(); + } } -/* ############################################################################################## */ -/* 80C675D4-80C675D8 000000 0004+00 2/2 0/0 0/0 .rodata @3746 */ -SECTION_RODATA static f32 const lit_3746 = -1000000000.0f; -COMPILER_STRIP_GATE(0x80C675D4, &lit_3746); +/* 80C66EAC-80C66F84 00040C 00D8+00 1/1 0/0 0/0 .text mode_init_dig__16daObjL4DigSand_cFv + */ +void daObjL4DigSand_c::mode_init_dig() { + dBgS_ObjGndChk gndchk; + gndchk.SetActorPid(mBase.mBsPcId); + gndchk.SetPos(¤t.pos); + + f32 gnd_y = dComIfG_Bgsp().GroundCross(&gndchk); + if (gnd_y != -1000000000.0f) { + mGroundY = gnd_y; + } else { +#ifdef DEBUG + // "No BG below dig-sand!" + OS_REPORT_ERROR("掘れる砂の下にBGがありません!"); + fopAcM_delete(this); +#endif + } + + mTimer = 20; + mMode = 1; +} + +/* 80C66FFC-80C670AC 00055C 00B0+00 1/0 0/0 0/0 .text mode_dig__16daObjL4DigSand_cFv */ +void daObjL4DigSand_c::mode_dig() { + if (cLib_calcTimer(&mTimer) == 0) { + f32 var_f31 = std::fabs(((current.pos.y - mGroundY) + 10.0f) / 15.0f); + if (var_f31 < 1.0f) { + var_f31 = 1.0f; + } + + if (cLib_chaseF(¤t.pos.y, mGroundY - 10.0f, var_f31) && field_0x941 == 2) { + mode_init_end(); + } + } +} + +/* 80C670AC-80C67100 00060C 0054+00 1/1 0/0 0/0 .text mode_init_end__16daObjL4DigSand_cFv + */ +void daObjL4DigSand_c::mode_init_end() { + fopAcM_onSwitch(this, getSwNo()); + fopAcM_delete(this); + mMode = 2; +} + +/* 80C67100-80C67104 000660 0004+00 1/0 0/0 0/0 .text mode_end__16daObjL4DigSand_cFv */ +void daObjL4DigSand_c::mode_end() {} + +/* 80C67104-80C671A8 000664 00A4+00 1/0 0/0 0/0 .text Draw__16daObjL4DigSand_cFv */ +int daObjL4DigSand_c::Draw() { + g_env_light.settingTevStruct(0x10, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr); + + dComIfGd_setListBG(); + mDoExt_modelUpdateDL(mpModel); + dComIfGd_setList(); + return 1; +} + +/* 80C671A8-80C671DC 000708 0034+00 1/0 0/0 0/0 .text Delete__16daObjL4DigSand_cFv */ +int daObjL4DigSand_c::Delete() { + dComIfG_resDelete(&mPhase, l_arcName); + return 1; +} + +/* 80C671DC-80C67308 00073C 012C+00 1/0 0/0 0/0 .text + * daObjL4DigSand_create1st__FP16daObjL4DigSand_c */ +static int daObjL4DigSand_create1st(daObjL4DigSand_c* i_this) { + fopAcM_SetupActor(i_this, daObjL4DigSand_c); + return i_this->create1st(); +} + +/* 80C674D4-80C674F4 000A34 0020+00 1/0 0/0 0/0 .text + * daObjL4DigSand_MoveBGDelete__FP16daObjL4DigSand_c */ +static int daObjL4DigSand_MoveBGDelete(daObjL4DigSand_c* i_this) { + return i_this->MoveBGDelete(); +} + +/* 80C674F4-80C67514 000A54 0020+00 1/0 0/0 0/0 .text + * daObjL4DigSand_MoveBGExecute__FP16daObjL4DigSand_c */ +static int daObjL4DigSand_MoveBGExecute(daObjL4DigSand_c* i_this) { + return i_this->MoveBGExecute(); +} + +/* 80C67514-80C67540 000A74 002C+00 1/0 0/0 0/0 .text + * daObjL4DigSand_MoveBGDraw__FP16daObjL4DigSand_c */ +static int daObjL4DigSand_MoveBGDraw(daObjL4DigSand_c* i_this) { + return i_this->MoveBGDraw(); +} /* 80C67658-80C67678 -00001 0020+00 1/0 0/0 0/0 .data daObjL4DigSand_METHODS */ static actor_method_class daObjL4DigSand_METHODS = { - (process_method_func)daObjL4DigSand_create1st__FP16daObjL4DigSand_c, - (process_method_func)daObjL4DigSand_MoveBGDelete__FP16daObjL4DigSand_c, - (process_method_func)daObjL4DigSand_MoveBGExecute__FP16daObjL4DigSand_c, - 0, - (process_method_func)daObjL4DigSand_MoveBGDraw__FP16daObjL4DigSand_c, + (process_method_func)daObjL4DigSand_create1st, + (process_method_func)daObjL4DigSand_MoveBGDelete, + (process_method_func)daObjL4DigSand_MoveBGExecute, + (process_method_func)NULL, + (process_method_func)daObjL4DigSand_MoveBGDraw, }; /* 80C67678-80C676A8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_Lv4DigSand */ @@ -248,234 +240,3 @@ extern actor_process_profile_definition g_profile_Obj_Lv4DigSand = { fopAc_ACTOR_e, // mActorType fopAc_CULLBOX_CUSTOM_e, // cullType }; - -/* 80C676A8-80C676B4 0000BC 000C+00 1/1 0/0 0/0 .data __vt__12dBgS_AcchCir */ -SECTION_DATA extern void* __vt__12dBgS_AcchCir[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_AcchCirFv, -}; - -/* 80C676B4-80C676C0 0000C8 000C+00 2/2 0/0 0/0 .data __vt__10cCcD_GStts */ -SECTION_DATA extern void* __vt__10cCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10cCcD_GSttsFv, -}; - -/* 80C676C0-80C676CC 0000D4 000C+00 1/1 0/0 0/0 .data __vt__10dCcD_GStts */ -SECTION_DATA extern void* __vt__10dCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10dCcD_GSttsFv, -}; - -/* 80C676CC-80C676D8 0000E0 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGCyl */ -SECTION_DATA extern void* __vt__8cM3dGCyl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGCylFv, -}; - -/* 80C676D8-80C676E4 0000EC 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 80C676E4-80C67708 0000F8 0024+00 2/2 0/0 0/0 .data __vt__12dBgS_ObjAcch */ -SECTION_DATA extern void* __vt__12dBgS_ObjAcch[9] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_ObjAcchFv, - (void*)NULL, - (void*)NULL, - (void*)func_80C675C4, - (void*)NULL, - (void*)NULL, - (void*)func_80C675BC, -}; - -/* 80C67708-80C67738 00011C 0030+00 2/2 0/0 0/0 .data __vt__14dBgS_ObjGndChk */ -SECTION_DATA extern void* __vt__14dBgS_ObjGndChk[12] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__14dBgS_ObjGndChkFv, - (void*)NULL, - (void*)NULL, - (void*)func_80C675A4, - (void*)NULL, - (void*)NULL, - (void*)func_80C675B4, - (void*)NULL, - (void*)NULL, - (void*)func_80C675AC, -}; - -/* 80C66EAC-80C66F84 00040C 00D8+00 1/1 0/0 0/0 .text mode_init_dig__16daObjL4DigSand_cFv - */ -void daObjL4DigSand_c::mode_init_dig() { - // NONMATCHING -} - -/* 80C66F84-80C66FFC 0004E4 0078+00 4/3 0/0 0/0 .text __dt__14dBgS_ObjGndChkFv */ -// dBgS_ObjGndChk::~dBgS_ObjGndChk() { -extern "C" void __dt__14dBgS_ObjGndChkFv() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80C675D8-80C675DC 000004 0004+00 0/1 0/0 0/0 .rodata @3765 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3765 = 10.0f; -COMPILER_STRIP_GATE(0x80C675D8, &lit_3765); -#pragma pop - -/* 80C675DC-80C675E0 000008 0004+00 0/1 0/0 0/0 .rodata @3766 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3766 = 15.0f; -COMPILER_STRIP_GATE(0x80C675DC, &lit_3766); -#pragma pop - -/* 80C675E0-80C675E4 00000C 0004+00 0/1 0/0 0/0 .rodata @3767 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3767 = 1.0f; -COMPILER_STRIP_GATE(0x80C675E0, &lit_3767); -#pragma pop - -/* 80C66FFC-80C670AC 00055C 00B0+00 1/0 0/0 0/0 .text mode_dig__16daObjL4DigSand_cFv */ -void daObjL4DigSand_c::mode_dig() { - // NONMATCHING -} - -/* 80C670AC-80C67100 00060C 0054+00 1/1 0/0 0/0 .text mode_init_end__16daObjL4DigSand_cFv - */ -void daObjL4DigSand_c::mode_init_end() { - // NONMATCHING -} - -/* 80C67100-80C67104 000660 0004+00 1/0 0/0 0/0 .text mode_end__16daObjL4DigSand_cFv */ -void daObjL4DigSand_c::mode_end() { - /* empty function */ -} - -/* 80C67104-80C671A8 000664 00A4+00 1/0 0/0 0/0 .text Draw__16daObjL4DigSand_cFv */ -void daObjL4DigSand_c::Draw() { - // NONMATCHING -} - -/* 80C671A8-80C671DC 000708 0034+00 1/0 0/0 0/0 .text Delete__16daObjL4DigSand_cFv */ -void daObjL4DigSand_c::Delete() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80C67738-80C67760 00014C 0028+00 1/1 0/0 0/0 .data __vt__16daObjL4DigSand_c */ -SECTION_DATA extern void* __vt__16daObjL4DigSand_c[10] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)CreateHeap__16daObjL4DigSand_cFv, - (void*)Create__16daObjL4DigSand_cFv, - (void*)Execute__16daObjL4DigSand_cFPPA3_A4_f, - (void*)Draw__16daObjL4DigSand_cFv, - (void*)Delete__16daObjL4DigSand_cFv, - (void*)IsDelete__16dBgS_MoveBgActorFv, - (void*)ToFore__16dBgS_MoveBgActorFv, - (void*)ToBack__16dBgS_MoveBgActorFv, -}; - -/* 80C671DC-80C67308 00073C 012C+00 1/0 0/0 0/0 .text - * daObjL4DigSand_create1st__FP16daObjL4DigSand_c */ -static void daObjL4DigSand_create1st(daObjL4DigSand_c* param_0) { - // NONMATCHING -} - -/* 80C67308-80C67350 000868 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -// cM3dGCyl::~cM3dGCyl() { -extern "C" void __dt__8cM3dGCylFv() { - // NONMATCHING -} - -/* 80C67350-80C67398 0008B0 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 80C67398-80C673F4 0008F8 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING -} - -/* 80C673F4-80C67464 000954 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */ -// dBgS_AcchCir::~dBgS_AcchCir() { -extern "C" void __dt__12dBgS_AcchCirFv() { - // NONMATCHING -} - -/* 80C67464-80C674D4 0009C4 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -// dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" void __dt__12dBgS_ObjAcchFv() { - // NONMATCHING -} - -/* 80C674D4-80C674F4 000A34 0020+00 1/0 0/0 0/0 .text - * daObjL4DigSand_MoveBGDelete__FP16daObjL4DigSand_c */ -static void daObjL4DigSand_MoveBGDelete(daObjL4DigSand_c* param_0) { - // NONMATCHING -} - -/* 80C674F4-80C67514 000A54 0020+00 1/0 0/0 0/0 .text - * daObjL4DigSand_MoveBGExecute__FP16daObjL4DigSand_c */ -static void daObjL4DigSand_MoveBGExecute(daObjL4DigSand_c* param_0) { - // NONMATCHING -} - -/* 80C67514-80C67540 000A74 002C+00 1/0 0/0 0/0 .text - * daObjL4DigSand_MoveBGDraw__FP16daObjL4DigSand_c */ -static void daObjL4DigSand_MoveBGDraw(daObjL4DigSand_c* param_0) { - // NONMATCHING -} - -/* 80C67540-80C67588 000AA0 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} - -/* 80C67588-80C675A4 000AE8 001C+00 1/1 0/0 0/0 .text cLib_calcTimer__FPUc */ -extern "C" void func_80C67588(void* _this, u8* param_0) { - // NONMATCHING -} - -/* 80C675A4-80C675AC 000B04 0008+00 1/0 0/0 0/0 .text @20@__dt__14dBgS_ObjGndChkFv */ -static void func_80C675A4() { - // NONMATCHING -} - -/* 80C675AC-80C675B4 000B0C 0008+00 1/0 0/0 0/0 .text @76@__dt__14dBgS_ObjGndChkFv */ -static void func_80C675AC() { - // NONMATCHING -} - -/* 80C675B4-80C675BC 000B14 0008+00 1/0 0/0 0/0 .text @60@__dt__14dBgS_ObjGndChkFv */ -static void func_80C675B4() { - // NONMATCHING -} - -/* 80C675BC-80C675C4 000B1C 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_80C675BC() { - // NONMATCHING -} - -/* 80C675C4-80C675CC 000B24 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_80C675C4() { - // NONMATCHING -} - -/* 80C675E4-80C675E4 000010 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ \ No newline at end of file diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp index 2477af3cd45..9ab9ebd4968 100644 --- a/src/f_op/f_op_actor_mng.cpp +++ b/src/f_op/f_op_actor_mng.cpp @@ -1925,11 +1925,11 @@ fopAc_ac_c* fopAcM_myRoomSearchEnemy(s8 roomNo) { /* 8001CAD8-8001CB48 017418 0070+00 0/0 0/0 81/81 .text * fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc */ -s32 fopAcM_createDisappear(const fopAc_ac_c* i_actor, const cXyz* i_pos, u8 param_3, u8 param_4, - u8 param_5) { +s32 fopAcM_createDisappear(const fopAc_ac_c* i_actor, const cXyz* i_pos, u8 i_size, u8 i_type, + u8 i_enemyID) { s8 roomNo = fopAcM_GetRoomNo(i_actor); return fopAcM_GetID(fopAcM_fastCreate(PROC_DISAPPEAR, - (param_5 << 0x10) | (param_3 << 0x8) | param_4, i_pos, + (i_enemyID << 0x10) | (i_size << 0x8) | i_type, i_pos, roomNo, &i_actor->current.angle, NULL, 0xFF, NULL, NULL)); }