mirror of
https://github.com/zeldaret/tww.git
synced 2026-06-30 11:01:40 -04:00
d_a_daiocta and d_a_daiocta_eye matching (#934)
* Initial work; 25% matching in .text
* 27% matching in .text
* Match daDaiocta_c::modeProc
* 56% matching in .text
* 61% matching in .text
* 69% matching in .text
* 74% matching in .text
* 84% matching in .text
* daDaiocta_Eye_c 31%
* Match daDaiocta_Eye_c node callbacks
* daDaiocta_Eye_c 69%
* daDaiocta_Eye_c 85%
* daDaiocta_Eye_c 100% for retail and demo
* daDaiocta_c 96%
* daDaiocta_c 100% for retail and demo
* Field name cleanup
* More field naming
* Implement {is_, to_, to_dis}appear daObjAuzu inlines
* Misc code formatting changes
* Use JntHitType enum (d_a_daiocta)
* Apply suggestions from code review
Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com>
* Use fopAcM_SetMtx inline
---------
Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com>
This commit is contained in:
+2
-2
@@ -1586,8 +1586,8 @@ config.libs = [
|
||||
ActorRel(NonMatching, "d_a_bwd"),
|
||||
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_bwdg"),
|
||||
ActorRel(NonMatching, "d_a_bwds"),
|
||||
ActorRel(NonMatching, "d_a_daiocta"),
|
||||
ActorRel(NonMatching, "d_a_daiocta_eye"),
|
||||
ActorRel(Matching, "d_a_daiocta"),
|
||||
ActorRel(Matching, "d_a_daiocta_eye"),
|
||||
ActorRel(Matching, "d_a_deku_item"),
|
||||
ActorRel(NonMatching, "d_a_dk"),
|
||||
ActorRel(Matching, "d_a_dummy"),
|
||||
|
||||
+150
-17
@@ -1,7 +1,12 @@
|
||||
#ifndef D_A_DAIOCTA_H
|
||||
#define D_A_DAIOCTA_H
|
||||
|
||||
#include "d/d_bg_s_acch.h"
|
||||
#include "d/d_cc_d.h"
|
||||
#include "d/d_particle.h"
|
||||
#include "f_op/f_op_actor.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include "m_Do/m_Do_hostIO.h"
|
||||
|
||||
class J3DNode;
|
||||
class dCcD_SrcSph;
|
||||
@@ -9,23 +14,44 @@ class dCcD_SrcCps;
|
||||
|
||||
class daDaiocta_c : public fopAc_ac_c {
|
||||
public:
|
||||
enum OctoType_e {
|
||||
FOUR_EYED = 0,
|
||||
EIGHT_EYED = 1,
|
||||
TWELVE_EYED = 2
|
||||
};
|
||||
|
||||
enum Proc_e {
|
||||
|
||||
PROC_INIT = 0,
|
||||
PROC_EXEC = 1
|
||||
};
|
||||
|
||||
enum Mode_e {
|
||||
|
||||
MODE_HIDE = 0,
|
||||
MODE_APPEAR = 1,
|
||||
MODE_WAIT = 2,
|
||||
MODE_DAMAGE = 3,
|
||||
MODE_DAMAGE_BOMB = 4,
|
||||
MODE_DELETE = 5,
|
||||
MODE_DEMO = 6,
|
||||
MODE_NULL
|
||||
};
|
||||
|
||||
struct ModeEntry {
|
||||
typedef void (daDaiocta_c::*ModeProcFunc)(void);
|
||||
ModeProcFunc mInitFunc;
|
||||
ModeProcFunc mUpdFunc;
|
||||
char* mModeName;
|
||||
};
|
||||
|
||||
u8 getSw() { return mSwitchNo; }
|
||||
|
||||
void _coHit(fopAc_ac_c*);
|
||||
void _nodeControl(J3DNode*, J3DModel*);
|
||||
void _createHeap();
|
||||
void createAwaHeap();
|
||||
void createSuikomiHeap();
|
||||
void createBodyHeap();
|
||||
void createArrowHitHeap();
|
||||
BOOL _createHeap();
|
||||
BOOL createAwaHeap();
|
||||
BOOL createSuikomiHeap();
|
||||
BOOL createBodyHeap();
|
||||
BOOL createArrowHitHeap();
|
||||
void setMtx();
|
||||
void setSuikomiMtx();
|
||||
void setAwaMtx();
|
||||
@@ -34,10 +60,10 @@ public:
|
||||
void setAwaRandom(int);
|
||||
void initAwa();
|
||||
void execAwa();
|
||||
void isLivingEye();
|
||||
void isDead();
|
||||
void isDamageEye();
|
||||
void isDamageBombEye();
|
||||
bool isLivingEye();
|
||||
bool isDead();
|
||||
bool isDamageEye();
|
||||
bool isDamageBombEye();
|
||||
void setRotEye();
|
||||
void setCollision();
|
||||
void modeHideInit();
|
||||
@@ -67,20 +93,127 @@ public:
|
||||
cPhs_State _create();
|
||||
bool _delete();
|
||||
|
||||
static const s32 m_heapsize;
|
||||
static const char m_arc_name[];
|
||||
static const dCcD_SrcSph m_sph_src;
|
||||
static const dCcD_SrcCps m_cps_src;
|
||||
|
||||
public:
|
||||
/* 0x290 */ u8 field_0x290[0x574 - 0x290];
|
||||
/* 0x574 */ u8 mSwitchNo;
|
||||
};
|
||||
// Offsets shown are for retail
|
||||
/* 0x0290 */ cXyz mSphCenters[37];
|
||||
/* 0x044C */ u8 m044C[0x04E0 - 0x044C];
|
||||
/* 0x04E0 */ u32 mAnmMtxIndices[12];
|
||||
/* 0x0510 */ u8 m0510[0x056C - 0x0510];
|
||||
/* 0x056C */ s32 mMode;
|
||||
/* 0x0570 */ s8 mAnmIdx;
|
||||
/* 0x0571 */ s8 mPrmIdx;
|
||||
/* 0x0572 */ s8 mOldPrmIdx;
|
||||
/* 0x0573 */ u8 mOctoType;
|
||||
/* 0x0574 */ u8 mSwitchNo;
|
||||
/* 0x0575 */ u8 m575;
|
||||
/* 0x0576 */ u8 m0576[0x0578 - 0x0576];
|
||||
/* 0x0578 */ f32 mAppearRadius;
|
||||
/* 0x057C */ u8 m057C;
|
||||
/* 0x057D */ u8 m057D[0x0580 - 0x057D];
|
||||
/* 0x0580 */ request_of_phase_process_class mPhs;
|
||||
/* 0x0588 */ mDoExt_McaMorf* mpMorf;
|
||||
/* 0x058C */ mDoExt_brkAnm mBrkAnm1;
|
||||
/* 0x05A4 */ dCcD_Sph mSph[6];
|
||||
/* 0x0CAC */ dCcD_Cps mCps[17];
|
||||
/* 0x2164 */ dCcD_Stts mStts;
|
||||
/* 0x21A0 */ cXyz m21A0;
|
||||
/* 0x21AC */ cXyz m21AC;
|
||||
/* 0x21B8 */ cXyz m21B8;
|
||||
/* 0x21C4 */ cXyz m21C4;
|
||||
/* 0x21D0 */ cXyz m21D0;
|
||||
/* 0x21DC */ cXyz m21DC;
|
||||
/* 0x21E8 */ cXyz m21E8;
|
||||
/* 0x21F4 */ cXyz m21F4;
|
||||
/* 0x2200 */ csXyz m2200;
|
||||
/* 0x2206 */ u8 m2206[0x2208 - 0x2206];
|
||||
/* 0x2208 */ f32 m2208;
|
||||
/* 0x220C */ cXyz m220C;
|
||||
/* 0x2218 */ dBgS_ObjAcch mAcch;
|
||||
/* 0x23DC */ dBgS_AcchCir mAcchCir;
|
||||
#if VERSION > VERSION_DEMO
|
||||
/* 0x241C */ dPa_followEcallBack mParticleCallback;
|
||||
#else
|
||||
JPABaseEmitter* mpEmitter;
|
||||
#endif
|
||||
/* 0x2430 */ f32 mWaterY;
|
||||
/* 0x2434 */ cXyz m2434;
|
||||
/* 0x2440 */ fpc_ProcID mDaioctaEyePcId[12];
|
||||
/* 0x2470 */ bool mEyeAlloc[12];
|
||||
/* 0x247C */ u8 m247C[0x26BC - 0x247C];
|
||||
/* 0x26BC */ int mRotEyeTimer;
|
||||
/* 0x26C0 */ u8 m26C0;
|
||||
/* 0x26C1 */ u8 m26C1;
|
||||
/* 0x26C2 */ u8 m26C2[0x26C4 - 0x26C2];
|
||||
/* 0x26C4 */ fpc_ProcID mpAuzu;
|
||||
/* 0x26C8 */ JntHit_c* mpJntHit;
|
||||
/* 0x26CC */ J3DModel* mpSuikomiModel;
|
||||
/* 0x26D0 */ mDoExt_brkAnm mBrkAnm2;
|
||||
/* 0x26E8 */ mDoExt_btkAnm mBtkAnm;
|
||||
/* 0x26FC */ J3DModel* mpAwaModels[30];
|
||||
/* 0x2774 */ mDoExt_bckAnm mAwaBckAnms[30];
|
||||
/* 0x2954 */ mDoExt_btkAnm mAwaBtkAnms[30];
|
||||
/* 0x2BAC */ mDoExt_brkAnm mAwaBrkAnms[30];
|
||||
/* 0x2E7C */ int mAwaTimers[30];
|
||||
/* 0x2EF4 */ cXyz mAwaTranslation[30];
|
||||
/* 0x305C */ cXyz mAwaScale[30];
|
||||
/* 0x31C4 */ u8 m31C4;
|
||||
/* 0x31C5 */ u8 m31C5[0x31C8 - 0x31C5];
|
||||
}; // Size: 0x31C8
|
||||
STATIC_ASSERT(sizeof(daDaiocta_c) == DEMO_SELECT(0x31B8, 0x31C8));
|
||||
|
||||
class daDaiocta_HIO_c {
|
||||
class daDaiocta_HIO_c : public mDoHIO_entry_c {
|
||||
public:
|
||||
daDaiocta_HIO_c();
|
||||
|
||||
public:
|
||||
/* Place member variables here */
|
||||
};
|
||||
/* 0x004 */ u8 m004;
|
||||
/* 0x005 */ u8 m005;
|
||||
/* 0x006 */ u8 m006;
|
||||
/* 0x007 */ u8 m007;
|
||||
/* 0x008 */ u8 m008;
|
||||
/* 0x009 */ u8 m009[0x00A - 0x009];
|
||||
/* 0x00A */ s16 m00A;
|
||||
/* 0x00C */ s16 mRotEyeTimerMin;
|
||||
/* 0x00E */ s16 mRotEyeTimerAddMax;
|
||||
/* 0x010 */ s16 m010;
|
||||
/* 0x012 */ s16 m012;
|
||||
/* 0x014 */ s16 m014;
|
||||
/* 0x016 */ s16 m016;
|
||||
/* 0x018 */ s16 m018;
|
||||
/* 0x01A */ u8 m01A[0x01C - 0x01A];
|
||||
/* 0x01C */ f32 mSphRadii[6];
|
||||
/* 0x034 */ f32 mCpsRadii[10];
|
||||
/* 0x05C */ f32 m05C;
|
||||
/* 0x060 */ f32 m060;
|
||||
/* 0x064 */ f32 m064;
|
||||
/* 0x068 */ f32 m068;
|
||||
/* 0x06C */ f32 m06C;
|
||||
/* 0x070 */ f32 m070;
|
||||
/* 0x074 */ f32 m074;
|
||||
/* 0x078 */ f32 mDefaultAppearRadius;
|
||||
/* 0x07C */ f32 mMinAppearRadius;
|
||||
/* 0x080 */ f32 m080;
|
||||
/* 0x084 */ f32 m084;
|
||||
/* 0x088 */ f32 m088;
|
||||
/* 0x08C */ f32 m08C;
|
||||
/* 0x090 */ f32 m090;
|
||||
/* 0x094 */ f32 m094;
|
||||
/* 0x098 */ f32 m098[9];
|
||||
/* 0x0BC */ f32 m0BC[9];
|
||||
/* 0x0E0 */ f32 m0E0;
|
||||
/* 0x0E4 */ f32 m0E4;
|
||||
/* 0x0E8 */ f32 m0E8;
|
||||
/* 0x0EC */ f32 m0EC;
|
||||
/* 0x0F0 */ f32 m0F0;
|
||||
/* 0x0F4 */ f32 m0F4;
|
||||
/* 0x0F8 */ f32 m0F8;
|
||||
/* 0x0FC */ cXyz m0FC;
|
||||
}; // Size: 0x108
|
||||
STATIC_ASSERT(sizeof(daDaiocta_HIO_c) == DEMO_SELECT(0x10C, 0x108));
|
||||
|
||||
#endif /* D_A_DAIOCTA_H */
|
||||
|
||||
@@ -1,16 +1,47 @@
|
||||
#ifndef D_A_DAIOCTA_EYE_H
|
||||
#define D_A_DAIOCTA_EYE_H
|
||||
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
#include "d/d_cc_d.h"
|
||||
#include "d/d_jnt_hit.h"
|
||||
#include "d/d_particle.h"
|
||||
#include "f_op/f_op_actor.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include "m_Do/m_Do_hostIO.h"
|
||||
|
||||
class J3DNode;
|
||||
class daDaiocta_c;
|
||||
|
||||
class daDaiocta_Eye_c : public fopAc_ac_c {
|
||||
public:
|
||||
void rndRotEye() {}
|
||||
enum Mode_e {
|
||||
MODE_WAIT = 0,
|
||||
MODE_DAMAGE = 1,
|
||||
MODE_DEATH = 2
|
||||
};
|
||||
|
||||
typedef void (daDaiocta_Eye_c::*ModeProcFunc)(void);
|
||||
public:
|
||||
void rndRotEye() {
|
||||
mEyeRotTargetX = cM_rndF(mEyeRndRotMaxX);
|
||||
|
||||
if (std::fabsf(mEyeRotTargetX - mCurEyeRot.x) < m2EC) {
|
||||
mEyeRotTargetX += m2EC;
|
||||
}
|
||||
|
||||
mEyeRotTargetY = cM_rndF(mEyeRndRotMaxY);
|
||||
if (std::fabsf(mEyeRotTargetY - mCurEyeRot.y) < m2EE) {
|
||||
mEyeRotTargetY += m2EE;
|
||||
}
|
||||
|
||||
mEyeRotTargetZ = cM_rndF(mEyeRndRotMaxZ);
|
||||
if (std::fabsf(mEyeRotTargetZ - mCurEyeRot.z) < m2F0) {
|
||||
mEyeRotTargetZ += m2F0;
|
||||
}
|
||||
}
|
||||
|
||||
void _nodeControl(J3DNode*, J3DModel*);
|
||||
void _createHeap();
|
||||
BOOL _createHeap();
|
||||
void _coHit(fopAc_ac_c*);
|
||||
void setMtx();
|
||||
void checkTgHit();
|
||||
@@ -27,16 +58,68 @@ public:
|
||||
cPhs_State _create();
|
||||
bool _delete();
|
||||
|
||||
static const s32 m_heapsize;
|
||||
static const char m_arc_name[];
|
||||
static const s32 m_scale_damage_time;
|
||||
public:
|
||||
/* Place member variables here */
|
||||
};
|
||||
/* 0x290 */ s32 mEyeNo;
|
||||
/* 0x294 */ bool mbIsDead;
|
||||
/* 0x295 */ bool m295;
|
||||
/* 0x296 */ bool mbIsDamaged;
|
||||
/* 0x297 */ bool mbIsDamagedBomb;
|
||||
/* 0x298 */ bool mbAppear;
|
||||
/* 0x299 */ u8 m299[0x29C - 0x299];
|
||||
/* 0x29C */ s32 mMode;
|
||||
/* 0x2A0 */ request_of_phase_process_class mPhs;
|
||||
/* 0x2A8 */ J3DModel* mpModel;
|
||||
/* 0x2AC */ J3DAnmTevRegKey* mpBrk;
|
||||
/* 0x2B0 */ mDoExt_brkAnm mBrkAnm;
|
||||
/* 0x2C8 */ J3DAnmTextureSRTKey* mpBtk;
|
||||
/* 0x2CC */ mDoExt_btkAnm mBtkAnm;
|
||||
/* 0x2E0 */ s16 mEyeRotTargetX;
|
||||
/* 0x2E2 */ s16 mEyeRotTargetY;
|
||||
/* 0x2E4 */ s16 mEyeRotTargetZ;
|
||||
/* 0x2E6 */ csXyz mCurEyeRot;
|
||||
/* 0x2EC */ s16 m2EC;
|
||||
/* 0x2EE */ s16 m2EE;
|
||||
/* 0x2F0 */ s16 m2F0;
|
||||
/* 0x2F2 */ s16 mEyeRndRotMaxX;
|
||||
/* 0x2F4 */ s16 mEyeRndRotMaxY;
|
||||
/* 0x2F6 */ s16 mEyeRndRotMaxZ;
|
||||
/* 0x2F8 */ dCcD_Sph mSph;
|
||||
/* 0x424 */ dCcD_Stts mStts;
|
||||
/* 0x460 */ cXyz mEyeScale;
|
||||
/* 0x46C */ int mScaleAnimeIdx;
|
||||
/* 0x470 */ JntHit_c* mpJntHit;
|
||||
/* 0x474 */ daDaiocta_c* mpParentActor;
|
||||
/* 0x478 */ dPa_followEcallBack mParticleCallback;
|
||||
/* 0x48C */ cXyz mParticlePos;
|
||||
/* 0x48C */ csXyz m498;
|
||||
/* 0x49E */ u8 m49E[0x4A0 - 0x49E];
|
||||
}; // Size: 0x4A0
|
||||
STATIC_ASSERT(sizeof(daDaiocta_Eye_c) == 0x4A0);
|
||||
|
||||
class daDaiocta_Eye_HIO_c {
|
||||
class daDaiocta_Eye_HIO_c : public mDoHIO_entry_c {
|
||||
public:
|
||||
daDaiocta_Eye_HIO_c();
|
||||
|
||||
public:
|
||||
/* Place member variables here */
|
||||
s16 m04;
|
||||
u8 m06[0x08 - 0x06];
|
||||
f32 m08;
|
||||
f32 m0C;
|
||||
f32 mParticleTranslationX;
|
||||
f32 mParticleTranslationY;
|
||||
f32 mParticleTranslationZ;
|
||||
f32 mSphRadius;
|
||||
s16 mEyeRotStep;
|
||||
s16 mEyeRotScale;
|
||||
s16 m24;
|
||||
s16 m26;
|
||||
s16 m28;
|
||||
s16 mEyeRndRotMaxX;
|
||||
s16 mEyeRndRotMaxY;
|
||||
s16 mEyeRndRotMaxZ;
|
||||
JntHit_HIO_c m30;
|
||||
};
|
||||
|
||||
#endif /* D_A_DAIOCTA_EYE_H */
|
||||
|
||||
@@ -9,14 +9,14 @@ namespace daObjAuzu {
|
||||
class Act_c : public fopAc_ac_c {
|
||||
public:
|
||||
void attr() const {}
|
||||
void is_appear() const {}
|
||||
bool is_appear() const { return field_0x2B4 > 0.999f; }
|
||||
void prm_get_appear() const {}
|
||||
void prm_get_linkID() const {}
|
||||
void prm_get_swSave() const {}
|
||||
void prm_get_type() const {}
|
||||
void prm_make_squid() {}
|
||||
void to_appear() {}
|
||||
void to_disappear() {}
|
||||
void to_appear() { field_0x2B8 = true; }
|
||||
void to_disappear() { field_0x2B8 = false; }
|
||||
|
||||
void solidHeapCB(fopAc_ac_c*);
|
||||
void create_heap();
|
||||
@@ -33,8 +33,11 @@ namespace daObjAuzu {
|
||||
bool _draw();
|
||||
|
||||
public:
|
||||
/* Place member variables here */
|
||||
};
|
||||
/* 0x290 */ u8 field_0x290[0x2B4 - 0x290];
|
||||
/* 0x2B4 */ f32 field_0x2B4;
|
||||
/* 0x2B8 */ bool field_0x2B8;
|
||||
/* 0x2B9 */ u8 field_0x2B9[0x2C0 - 0x2B9];
|
||||
}; // Size: 0x2C0
|
||||
};
|
||||
|
||||
#endif /* D_A_OBJ_AUZU_H */
|
||||
|
||||
+1470
-68
File diff suppressed because it is too large
Load Diff
+370
-27
@@ -5,9 +5,19 @@
|
||||
|
||||
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
||||
#include "d/actor/d_a_daiocta_eye.h"
|
||||
#include "d/actor/d_a_daiocta.h"
|
||||
#include "d/actor/d_a_bomb.h"
|
||||
#include "d/actor/d_a_player.h"
|
||||
#include "d/d_bg_s_func.h"
|
||||
#include "d/d_cc_d.h"
|
||||
#include "d/d_lib.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "d/d_priority.h"
|
||||
#include "d/res/res_daiocta.h"
|
||||
|
||||
const s32 daDaiocta_Eye_c::m_heapsize = 2848;
|
||||
const char daDaiocta_Eye_c::m_arc_name[] = "daiocta";
|
||||
const s32 daDaiocta_Eye_c::m_scale_damage_time = 8;
|
||||
|
||||
static dCcD_SrcSph l_sph_src = {
|
||||
// dCcD_SrcGObjInf
|
||||
@@ -38,110 +48,443 @@ static dCcD_SrcSph l_sph_src = {
|
||||
}},
|
||||
};
|
||||
|
||||
static daDaiocta_Eye_HIO_c l_HIO;
|
||||
|
||||
/* 000000EC-000001B0 .text __ct__19daDaiocta_Eye_HIO_cFv */
|
||||
daDaiocta_Eye_HIO_c::daDaiocta_Eye_HIO_c() {
|
||||
/* Nonmatching */
|
||||
mSphRadius = 195.0f;
|
||||
m04 = 0xF; // unused
|
||||
m08 = 5.0f; // unused
|
||||
m0C = 8.0f; // unused
|
||||
mParticleTranslationX = 0.0f;
|
||||
mParticleTranslationY = 0.0f;
|
||||
mParticleTranslationZ = 30.0f;
|
||||
mEyeRotStep = 0x1000;
|
||||
mEyeRotScale = 0x4;
|
||||
m24 = 0x4000;
|
||||
m26 = 0x1000;
|
||||
m28 = 0x1000;
|
||||
mEyeRndRotMaxX = 0x7FFF;
|
||||
mEyeRndRotMaxY = 0x2000;
|
||||
mEyeRndRotMaxZ = 0x2000;
|
||||
}
|
||||
|
||||
/* 000001B0-000001FC .text nodeControl_CB__FP7J3DNodei */
|
||||
static BOOL nodeControl_CB(J3DNode*, int) {
|
||||
/* Nonmatching */
|
||||
static BOOL nodeControl_CB(J3DNode* i_nodeP, int i_calcTiming) {
|
||||
if (i_calcTiming == J3DNodeCBCalcTiming_In) {
|
||||
J3DModel* model_p = j3dSys.getModel();
|
||||
daDaiocta_Eye_c* this_p = (daDaiocta_Eye_c *) model_p->getUserArea();
|
||||
if (this_p) {
|
||||
this_p->_nodeControl(i_nodeP, model_p);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 000001FC-000002B8 .text _nodeControl__15daDaiocta_Eye_cFP7J3DNodeP8J3DModel */
|
||||
void daDaiocta_Eye_c::_nodeControl(J3DNode*, J3DModel*) {
|
||||
/* Nonmatching */
|
||||
void daDaiocta_Eye_c::_nodeControl(J3DNode* i_nodeP, J3DModel* i_modelP) {
|
||||
J3DJoint* jnt_p = (J3DJoint *) i_nodeP;
|
||||
s32 jnt_no = jnt_p->getJntNo();
|
||||
cXyz dummy(0.0f, 0.0f, 0.0f);
|
||||
mDoMtx_stack_c::copy(i_modelP->getAnmMtx(jnt_no));
|
||||
|
||||
if (jnt_no == 2) {
|
||||
mDoMtx_stack_c::ZXYrotM(mCurEyeRot);
|
||||
mDoMtx_stack_c::scaleM(mEyeScale);
|
||||
}
|
||||
|
||||
cMtx_copy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
|
||||
i_modelP->setAnmMtx(jnt_no, mDoMtx_stack_c::get());
|
||||
}
|
||||
|
||||
/* 000002B8-000002D8 .text createHeap_CB__FP10fopAc_ac_c */
|
||||
static BOOL createHeap_CB(fopAc_ac_c*) {
|
||||
/* Nonmatching */
|
||||
static BOOL createHeap_CB(fopAc_ac_c* i_this) {
|
||||
return ((daDaiocta_Eye_c *)i_this)->_createHeap();
|
||||
}
|
||||
|
||||
/* 000002D8-000004E4 .text _createHeap__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::_createHeap() {
|
||||
/* Nonmatching */
|
||||
BOOL daDaiocta_Eye_c::_createHeap() {
|
||||
static Vec eye_sph_offset[] = {
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
};
|
||||
|
||||
static __jnt_hit_data_c search_data[] = {
|
||||
{
|
||||
/* mShapeType */ JntHitType_SPH_e,
|
||||
/* mJointIndex */ 2,
|
||||
/* mRadius */ 110.0f,
|
||||
/* mpOffsets */ eye_sph_offset
|
||||
}
|
||||
};
|
||||
|
||||
J3DModelData* modelData = static_cast<J3DModelData *>(dComIfG_getObjectRes(m_arc_name, DAIOCTA_BDL_DO_EYE1));
|
||||
JUT_ASSERT(0xE9, modelData != NULL);
|
||||
|
||||
mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000222);
|
||||
|
||||
if (!mpModel) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
mpModel->setUserArea((u32)this);
|
||||
|
||||
mpBrk = static_cast<J3DAnmTevRegKey *>(dComIfG_getObjectRes(m_arc_name, DAIOCTA_BRK_DAMAGE_EYE_A1));
|
||||
|
||||
if (!mpBrk) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int init_result = init_result = mBrkAnm.init(
|
||||
modelData, mpBrk, TRUE,
|
||||
J3DFrameCtrl::EMode_NONE, 1.0f,
|
||||
0, -1, false, FALSE
|
||||
);
|
||||
|
||||
if (init_result == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
mpBtk = static_cast<J3DAnmTextureSRTKey *>(dComIfG_getObjectRes(m_arc_name, DAIOCTA_BTK_DAMAGE_EYE_A1));
|
||||
|
||||
if (!mpBtk) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
init_result = mBtkAnm.init(
|
||||
modelData, mpBtk, TRUE,
|
||||
J3DFrameCtrl::EMode_NONE, 1.0f,
|
||||
0, -1, false, FALSE
|
||||
);
|
||||
|
||||
if (init_result == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (i == 2) modelData->getJointNodePointer(i)->setCallBack(nodeControl_CB);
|
||||
}
|
||||
|
||||
mpJntHit = JntHit_create(mpModel, search_data, ARRAY_SSIZE(search_data));
|
||||
|
||||
if (mpJntHit) {
|
||||
jntHit = mpJntHit;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 000004E4-00000510 .text coHit_CB__FP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf */
|
||||
void coHit_CB(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*) {
|
||||
/* Nonmatching */
|
||||
void coHit_CB(fopAc_ac_c* i_this, dCcD_GObjInf*, fopAc_ac_c* i_actor, dCcD_GObjInf*) {
|
||||
if(i_actor) {
|
||||
((daDaiocta_Eye_c *)i_this)->_coHit(i_actor);
|
||||
}
|
||||
}
|
||||
|
||||
/* 00000510-000005D0 .text _coHit__15daDaiocta_Eye_cFP10fopAc_ac_c */
|
||||
void daDaiocta_Eye_c::_coHit(fopAc_ac_c*) {
|
||||
/* Nonmatching */
|
||||
void daDaiocta_Eye_c::_coHit(fopAc_ac_c* i_actor) {
|
||||
if (fpcM_GetName(i_actor) == PROC_BOMB) {
|
||||
daBomb_c* bomb_p = (daBomb_c *) i_actor;
|
||||
if (bomb_p->chk_state(daBomb_c::STATE_4)) {
|
||||
if (!mbIsDead) {
|
||||
health = 0;
|
||||
mbIsDead = true;
|
||||
m295 = true;
|
||||
dComIfGp_particle_set(
|
||||
dPa_name::ID_SCENE_8206, &mParticlePos, &shape_angle,
|
||||
NULL, 0xFF, &mParticleCallback, fopAcM_GetRoomNo(this)
|
||||
);
|
||||
modeDeathInit();
|
||||
} else {
|
||||
mbIsDamagedBomb = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 000005D0-000006C0 .text setMtx__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::setMtx() {
|
||||
/* Nonmatching */
|
||||
mpModel->setBaseScale(scale);
|
||||
mDoMtx_stack_c::transS(current.pos);
|
||||
mDoMtx_stack_c::ZXYrotM(shape_angle);
|
||||
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
||||
|
||||
mDoMtx_stack_c::transS(current.pos);
|
||||
mDoMtx_stack_c::ZXYrotM(shape_angle);
|
||||
mDoMtx_stack_c::transM(
|
||||
l_HIO.mParticleTranslationX,
|
||||
l_HIO.mParticleTranslationY,
|
||||
l_HIO.mParticleTranslationZ
|
||||
);
|
||||
mDoMtx_stack_c::multVecZero(&mParticlePos);
|
||||
}
|
||||
|
||||
/* 000006C0-00000A6C .text checkTgHit__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::checkTgHit() {
|
||||
/* Nonmatching */
|
||||
mStts.Move();
|
||||
cCcD_Obj* tg_hit_obj_p = mSph.GetTgHitObj();
|
||||
if (tg_hit_obj_p) {
|
||||
mDoAud_onEnemyDamage();
|
||||
bool damaged = false;
|
||||
|
||||
if (tg_hit_obj_p->ChkAtType(AT_TYPE_NORMAL_ARROW)) {
|
||||
fopAcM_seStart(this, JA_SE_LK_MS_WEP_HIT, 32);
|
||||
health -= 2;
|
||||
damaged = true;
|
||||
} else if (tg_hit_obj_p->ChkAtType(AT_TYPE_ICE_ARROW)) {
|
||||
fopAcM_seStart(this, JA_SE_LK_MS_WEP_HIT, 32);
|
||||
health -= 2;
|
||||
damaged = true;
|
||||
} else if (tg_hit_obj_p->ChkAtType(AT_TYPE_FIRE_ARROW)) {
|
||||
fopAcM_seStart(this, JA_SE_LK_MS_WEP_HIT, 32);
|
||||
health -= 2;
|
||||
damaged = true;
|
||||
} else if (tg_hit_obj_p->ChkAtType(AT_TYPE_LIGHT_ARROW)) {
|
||||
fopAcM_seStart(this, JA_SE_LK_MS_WEP_HIT, 32);
|
||||
health -= 4;
|
||||
damaged = true;
|
||||
} else if (tg_hit_obj_p->ChkAtType(AT_TYPE_HOOKSHOT)) {
|
||||
fopAcM_seStart(this, JA_SE_LK_MS_WEP_HIT, 32);
|
||||
health -= 2;
|
||||
damaged = true;
|
||||
} else if (tg_hit_obj_p->ChkAtType(AT_TYPE_BOOMERANG)) {
|
||||
fopAcM_seStart(this, JA_SE_LK_W_WEP_HIT, 32);
|
||||
health--;
|
||||
damaged = true;
|
||||
}
|
||||
|
||||
if (damaged == true) {
|
||||
daPy_py_c* player_p = daPy_getPlayerActorClass();
|
||||
cXyz tg_hit_pos = *mSph.GetTgHitPosP();
|
||||
dComIfGp_particle_set(dPa_name::ID_COMMON_0010, &tg_hit_pos);
|
||||
if (health <= 0) {
|
||||
cXyz hit_particle_scale(2.0f, 2.0f, 2.0f);
|
||||
dComIfGp_particle_set(
|
||||
dPa_name::ID_COMMON_BIG_HIT,
|
||||
&tg_hit_pos,
|
||||
&player_p->shape_angle,
|
||||
&hit_particle_scale
|
||||
);
|
||||
fopAcM_seStart(this, JA_SE_LK_LAST_HIT, 0);
|
||||
health = 0;
|
||||
modeDeathInit();
|
||||
} else {
|
||||
modeDamageInit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 00000A6C-00000A78 .text modeWaitInit__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::modeWaitInit() {
|
||||
/* Nonmatching */
|
||||
mMode = MODE_WAIT;
|
||||
}
|
||||
|
||||
/* 00000A78-00000A98 .text modeWait__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::modeWait() {
|
||||
/* Nonmatching */
|
||||
checkTgHit();
|
||||
}
|
||||
|
||||
/* 00000A98-00000BD8 .text modeDamageInit__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::modeDamageInit() {
|
||||
/* Nonmatching */
|
||||
mMode = MODE_DAMAGE;
|
||||
mScaleAnimeIdx = m_scale_damage_time;
|
||||
mbIsDamaged = true;
|
||||
|
||||
J3DModelData* model_data_p = mpModel->getModelData();
|
||||
mpBrk = (J3DAnmTevRegKey *) dComIfG_getObjectRes(m_arc_name, DAIOCTA_BRK_DAMAGE_EYE_A1);
|
||||
mBrkAnm.init(
|
||||
model_data_p, mpBrk, TRUE,
|
||||
J3DFrameCtrl::EMode_NONE, 1.0f,
|
||||
0, -1, true, FALSE
|
||||
);
|
||||
mpBtk = (J3DAnmTextureSRTKey *) dComIfG_getObjectRes(m_arc_name, DAIOCTA_BTK_DAMAGE_EYE_A1);
|
||||
mBtkAnm.init(
|
||||
model_data_p, mpBtk, TRUE,
|
||||
J3DFrameCtrl::EMode_NONE, 1.0f,
|
||||
0, -1, true, FALSE
|
||||
);
|
||||
|
||||
fopAcM_monsSeStart(mpParentActor, JA_SE_CV_DO_DAMAGE, 0);
|
||||
}
|
||||
|
||||
/* 00000BD8-00000CD0 .text modeDamage__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::modeDamage() {
|
||||
/* Nonmatching */
|
||||
static float scale_table[] = {
|
||||
1.0f, 0.975f,
|
||||
1.0f, 0.95f,
|
||||
1.0f, 0.9f,
|
||||
1.0f, 0.85f
|
||||
};
|
||||
|
||||
dLib_scaleAnime(
|
||||
&mEyeScale.x, scale_table,
|
||||
ARRAY_SSIZE(scale_table), &mScaleAnimeIdx,
|
||||
0.2f, 10.0f, 0.025f
|
||||
);
|
||||
mEyeScale.y = mEyeScale.x;
|
||||
mEyeScale.z = mEyeScale.x;
|
||||
|
||||
if (mBtkAnm.isStop() && mBrkAnm.isStop() && mScaleAnimeIdx == 0) {
|
||||
modeWaitInit();
|
||||
} else if (mScaleAnimeIdx == 0) {
|
||||
mScaleAnimeIdx = m_scale_damage_time;
|
||||
}
|
||||
}
|
||||
|
||||
/* 00000CD0-00000E20 .text modeDeathInit__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::modeDeathInit() {
|
||||
/* Nonmatching */
|
||||
mMode = MODE_DEATH;
|
||||
mbIsDamaged = true;
|
||||
mEyeScale.setall(1.0f);
|
||||
mpBrk = (J3DAnmTevRegKey *) dComIfG_getObjectRes(m_arc_name, DAIOCTA_BRK_DAMAGE_EYE_B1);
|
||||
mBrkAnm.init(
|
||||
mpModel->getModelData(), mpBrk, TRUE,
|
||||
J3DFrameCtrl::EMode_NONE, 1.0f,
|
||||
0, -1, true, FALSE
|
||||
);
|
||||
mpBtk = (J3DAnmTextureSRTKey *) dComIfG_getObjectRes(m_arc_name, DAIOCTA_BTK_DAMAGE_EYE_B1);
|
||||
mBtkAnm.init(
|
||||
mpModel->getModelData(), mpBtk, TRUE,
|
||||
J3DFrameCtrl::EMode_NONE, 1.0f,
|
||||
0, -1, true, FALSE
|
||||
);
|
||||
fopAcM_monsSeStart(mpParentActor, JA_SE_CV_DO_EYE_LOSE, 0);
|
||||
}
|
||||
|
||||
/* 00000E20-00000E2C .text modeDeath__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::modeDeath() {
|
||||
/* Nonmatching */
|
||||
mbIsDead = true;
|
||||
}
|
||||
|
||||
/* 00000E2C-00000ED0 .text modeProcCall__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::modeProcCall() {
|
||||
/* Nonmatching */
|
||||
static ModeProcFunc mode_proc[] = {
|
||||
&daDaiocta_Eye_c::modeWait,
|
||||
&daDaiocta_Eye_c::modeDamage,
|
||||
&daDaiocta_Eye_c::modeDeath,
|
||||
};
|
||||
(this->*mode_proc[mMode])();
|
||||
}
|
||||
|
||||
/* 00000ED0-00001120 .text _execute__15daDaiocta_Eye_cFv */
|
||||
bool daDaiocta_Eye_c::_execute() {
|
||||
/* Nonmatching */
|
||||
if (!mbAppear) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mbIsDead == true) {
|
||||
mSph.OffTgSPrmBit(cCcD_TgSPrm_Set_e);
|
||||
}
|
||||
|
||||
m2EC = l_HIO.m24;
|
||||
m2EE = l_HIO.m26;
|
||||
m2F0 = l_HIO.m28;
|
||||
mEyeRndRotMaxX = l_HIO.mEyeRndRotMaxX;
|
||||
mEyeRndRotMaxY = l_HIO.mEyeRndRotMaxY;
|
||||
mEyeRndRotMaxZ = l_HIO.mEyeRndRotMaxZ;
|
||||
|
||||
mBrkAnm.play();
|
||||
mBtkAnm.play();
|
||||
|
||||
mbIsDamaged = false;
|
||||
mbIsDamagedBomb = false;
|
||||
modeProcCall();
|
||||
setMtx();
|
||||
|
||||
attention_info.position = current.pos;
|
||||
|
||||
attention_info.position.y += 100.0f;
|
||||
|
||||
eyePos = current.pos;
|
||||
|
||||
cLib_addCalcAngleS2(&mCurEyeRot.x, mEyeRotTargetX, l_HIO.mEyeRotScale + 1, l_HIO.mEyeRotStep);
|
||||
cLib_addCalcAngleS2(&mCurEyeRot.y, mEyeRotTargetY, l_HIO.mEyeRotScale + 1, l_HIO.mEyeRotStep);
|
||||
cLib_addCalcAngleS2(&mCurEyeRot.z, mEyeRotTargetZ, l_HIO.mEyeRotScale + 1, l_HIO.mEyeRotStep);
|
||||
mSph.SetR(l_HIO.mSphRadius);
|
||||
mSph.SetC(current.pos);
|
||||
dComIfG_Ccsp()->Set(&mSph);
|
||||
|
||||
m498.set(0, shape_angle.y, 0);
|
||||
|
||||
cXyz current_pos = current.pos;
|
||||
current_pos.y += 1000.0f;
|
||||
f32 water_height = dBgS_GetWaterHeight(current_pos);
|
||||
|
||||
if (current.pos.y < water_height) {
|
||||
if (mParticleCallback.getEmitter()) {
|
||||
mParticleCallback.end();
|
||||
}
|
||||
} else if (mMode != MODE_DEATH) {
|
||||
attention_info.flags = fopAc_Attn_LOCKON_BATTLE_e;
|
||||
attention_info.distances[fopAc_Attn_TYPE_BATTLE_e] = 34;
|
||||
}
|
||||
|
||||
if (mMode == MODE_DEATH || dComIfGp_event_runCheck()) {
|
||||
attention_info.flags = 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 00001120-000011EC .text _draw__15daDaiocta_Eye_cFv */
|
||||
bool daDaiocta_Eye_c::_draw() {
|
||||
/* Nonmatching */
|
||||
if (!mbAppear) {
|
||||
return false;
|
||||
}
|
||||
|
||||
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr);
|
||||
g_env_light.setLightTevColorType(mpModel, &tevStr);
|
||||
|
||||
mBtkAnm.entry(mpModel->getModelData());
|
||||
mBrkAnm.entry(mpModel->getModelData());
|
||||
|
||||
mDoExt_modelUpdateDL(mpModel);
|
||||
|
||||
mBtkAnm.remove(mpModel->getModelData());
|
||||
mBrkAnm.remove(mpModel->getModelData());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 000011EC-000012D4 .text createInit__15daDaiocta_Eye_cFv */
|
||||
void daDaiocta_Eye_c::createInit() {
|
||||
/* Nonmatching */
|
||||
mbAppear = false;
|
||||
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
|
||||
mStts.Init(0, 0, this);
|
||||
mSph.Set(l_sph_src);
|
||||
mSph.SetStts(&mStts);
|
||||
mSph.SetCoHitCallback(coHit_CB);
|
||||
max_health = 4;
|
||||
health = max_health;
|
||||
mEyeScale.setall(1.0f);
|
||||
if (parentActorID != fpcM_ERROR_PROCESS_ID_e) {
|
||||
fopAc_ac_c* parent_p = fopAcM_SearchByID(parentActorID);
|
||||
if (parent_p && fopAc_IsActor(parent_p) && fpcM_GetName(parent_p) == PROC_DAIOCTA) {
|
||||
mpParentActor = (daDaiocta_c *) parent_p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 000012D4-00001450 .text _create__15daDaiocta_Eye_cFv */
|
||||
cPhs_State daDaiocta_Eye_c::_create() {
|
||||
/* Nonmatching */
|
||||
fopAcM_SetupActor(this, daDaiocta_Eye_c);
|
||||
cPhs_State result = dComIfG_resLoad(&mPhs, m_arc_name);
|
||||
if (result == cPhs_COMPLEATE_e) {
|
||||
if (!fopAcM_entrySolidHeap(this, createHeap_CB, m_heapsize)) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
createInit();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* 00001764-000017B4 .text _delete__15daDaiocta_Eye_cFv */
|
||||
bool daDaiocta_Eye_c::_delete() {
|
||||
/* Nonmatching */
|
||||
dComIfG_resDelete(&mPhs, m_arc_name);
|
||||
mParticleCallback.remove();
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 000017B4-000017D4 .text daDaiocta_EyeCreate__FPv */
|
||||
|
||||
Reference in New Issue
Block a user