summaryrefslogtreecommitdiff
path: root/include/d
diff options
context:
space:
mode:
authorelijah-thomas774 <elijahthomas774@gmail.com>2025-05-26 22:12:25 -0400
committerelijah-thomas774 <elijahthomas774@gmail.com>2025-05-26 22:12:25 -0400
commit00a4d0a1665af090e9829ee246cdfce27c39c657 (patch)
tree1c2ead4822a670153a22c22122c0c7817322baf4 /include/d
parent01839e716fb4c7ac9afd4fb3d5c05ed1c6516db7 (diff)
intial progress
Diffstat (limited to 'include/d')
-rw-r--r--include/d/a/d_a_base.h2
-rw-r--r--include/d/a/d_a_player.h12
-rw-r--r--include/d/a/obj/d_a_obj_boomerang.h84
-rw-r--r--include/d/col/bg/d_bg_s_acch.h24
-rw-r--r--include/d/col/bg/d_bg_s_roof_chk.h4
-rw-r--r--include/d/col/c/c_bg_s_lin_chk.h3
-rw-r--r--include/d/col/c/c_cc_d.h18
-rw-r--r--include/d/d_player_act.h7
8 files changed, 140 insertions, 14 deletions
diff --git a/include/d/a/d_a_base.h b/include/d/a/d_a_base.h
index e293b927..550adccb 100644
--- a/include/d/a/d_a_base.h
+++ b/include/d/a/d_a_base.h
@@ -31,7 +31,7 @@ struct SoundSource {
SOUNDSOURCE_VIRTUAL(0x34);
SOUNDSOURCE_VIRTUAL(0x38);
SOUNDSOURCE_VIRTUAL(0x3C);
- SOUNDSOURCE_VIRTUAL(0x40);
+ virtual void vt_0x40(s32);
SOUNDSOURCE_VIRTUAL(0x44);
virtual bool shutdown(); // 0x48
SOUNDSOURCE_VIRTUAL(0x4C);
diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h
index 324e27bf..fd753989 100644
--- a/include/d/a/d_a_player.h
+++ b/include/d/a/d_a_player.h
@@ -5,6 +5,7 @@
#include "d/a/d_a_item.h"
#include "d/col/c/c_bg_s_poly_info.h"
#include "d/d_player_mdl.h"
+#include "nw4r/g3d/res/g3d_resfile.h"
#include "toBeSorted/file_manager.h"
#include "toBeSorted/minigame_mgr.h"
@@ -29,10 +30,16 @@ public:
/* vt 0x318 */ virtual void vt_0x318();
protected:
- /* 0x137C */ u8 _0x137C[0x4564 - 0x137C];
+ /* 0x137C */ u8 _0x137C[0x16F0 - 0x137C];
+ /* 0x16F0 */ nw4r::g3d::ResFile mHeldResFile;
+ /* 0x16F4 */ u8 _0x16F4[0x4564 - 0x16F4];
/* 0x4564 */ f32 field_0x4564;
public:
+ // Beetle Functions [0x8021AA70 - 0x8021BE20]
+ f32 getBeetleRadius();
+
+public:
f32 getField_0x4564() const {
return field_0x4564;
}
@@ -44,6 +51,9 @@ public:
nw4r::g3d::ResFile getSwordResFile() const {
return mSwordRes;
}
+ nw4r::g3d::ResFile getHeldResFile() const {
+ return mHeldResFile;
+ }
inline bool hasvt_0x1C0() const {
return vt_0x1C0() != nullptr;
diff --git a/include/d/a/obj/d_a_obj_boomerang.h b/include/d/a/obj/d_a_obj_boomerang.h
index 3b2a6261..0b3ad479 100644
--- a/include/d/a/obj/d_a_obj_boomerang.h
+++ b/include/d/a/obj/d_a_obj_boomerang.h
@@ -5,30 +5,35 @@
#include "d/a/d_a_base.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_s_acch.h"
+#include "d/col/bg/d_bg_s_lin_chk.h"
#include "d/col/cc/d_cc_d.h"
#include "d/d_shadow.h"
#include "d/lyt/d_lyt_fader.h"
#include "m/m3d/m_anmchr.h"
#include "m/m3d/m_anmchrblend.h"
#include "m/m3d/m_mdl.h"
-#include "m/m3d/m_proc.h"
#include "m/m_color.h"
+#include "m/m_fader.h"
+#include "m/m_vec.h"
#include "nw4r/g3d/res/g3d_resfile.h"
+#include "rvl/GX/GXTypes.h"
#include "s/s_State.hpp"
#include "toBeSorted/actor_event.h"
#include "toBeSorted/d_emitter.h"
-class dAcBoomerangProcBase_c : public m3d::proc_c {
-public:
- ~dAcBoomerangProcBase_c() {}
-};
-class dAcBoomerangProc_c : public dAcBoomerangProcBase_c {
+class dAcBoomerangProc_c : public d3d::UnkProc {
public:
dAcBoomerangProc_c() : mColor0(0), mColor1(0xFFFFFFFF) {}
~dAcBoomerangProc_c() {}
+ bool create(m3d::mdl_c *mdl, mColor clr, int prioOpa, mAllocator_c *alloc);
+ bool create2(m3d::mdl_c *mdl, mColor clr, int prioOpa, mAllocator_c *alloc) {
+ return create(mdl, clr, prioOpa, alloc);
+ }
+
virtual void drawOpa() override;
+private:
mColor mColor0;
mColor mColor1;
};
@@ -60,6 +65,14 @@ public:
STATE_FUNC_DECLARE(dAcBoomerang_c, EventReturnWait);
public: // TYPES
+ enum Variant_e {
+ NONE,
+ BEETLE,
+ HOOK_BEETLE,
+ QUICK_BEETLE,
+ TOUGH_BEETLE,
+ };
+
struct ChrAnimation_t {
const char *mName;
f32 mRate;
@@ -75,22 +88,66 @@ public: // TYPES
};
static const ChrAnimation_t sChrAnims[RB_MAX];
+ enum ModelType_e {
+ MDL_WINGS_BASIC = 0,
+ MDL_BODY_BASIC = 1,
+ MDL_MOUTH_BASIC = 2,
+ MDL_MOUTH_HOOK = 3,
+ MDL_MOTTH_ADV = MDL_MOUTH_HOOK, // Just for naming :P
+ MDL_BODY_ADV = 4,
+ MDL_WINGS_ADV = 5,
+ };
+
+ // Macros until enum is solidified
+#define FLAG_BOOMERANG_CANCEL (0x3)
+#define FLAG_BOOMERANG_RUMBLE_ACTIVE (0x4000)
+
public: // INLINES
- bool checkField_0x8CC(u32 mask) {
+ bool checkField_0x8CC(u32 mask) const {
return field_0x8CC & mask;
}
+ void onField_0x8CC(u32 mask) {
+ field_0x8CC |= mask;
+ }
+ bool isMoving() {
+ return mStateMgr.isState(StateID_Move);
+ }
public: // FUNCTIONS
+ void areaCallback(mVec3_c *param1, u32 param2);
void atHitCallback(cCcD_Obj *i_objInfA, dAcObjBase_c *i_actorB, cCcD_Obj *i_objInfB);
+ /** hides the given shape within the resfile. Ref Brawlcrate's 'polygon#' in the mdl0/Object folder */
+ void hideModel(ModelType_e type);
+
+ /** ?? */
+ void deleteCheck();
+
+ /** ?? Retrieve Beetle */
+ void retrieve();
+
+ /** Attempts to grab ahold of the object upon collision. Called from atHitCallback if type > Hook beetle */
bool tryGrabObject(dAcObjBase_c *pObject);
+
+ /** Sets the room id of the beetle. Sets to links room id or the room id of the collision its around */
+ void setRoomId();
+
+ /** Updates the position based on where links wrist is */
+ void placeOnArm();
+
+ /** Sets the assuming bonk flag and plays the rumble feedback */
+ void bonk();
+
+ /** Applies the selected animation to the beetle */
void setChrAnimation(ChrAnimation_e requestedAnimation);
private:
/* 0x0330 */ nw4r::g3d::ResFile mResFile;
/* 0x0334 */ m3d::mdl_c mMdl;
/* 0x0358 */ m3d::anmChrBlend_c mAnmChrBlend;
- /* 0x0380 */ m3d::anmChr_c mAnmChr[2];
+#define BOOMERANG_ANIM_PINCERS (0)
+#define BOOMERANG_ANIM_WINGS (1)
+ /* 0x0380 */ m3d::anmChr_c mAnmChr[2]; /* 0 - Pincers, 1 - Wings*/
/* 0x03F0 */ dAcBoomerangProc_c mProc;
/* 0x0410 */ dShadowCircle_c mShadow;
/* 0x0418 */ dAcRef_c<dAcObjBase_c> mGrabbedActor;
@@ -105,7 +162,9 @@ private:
/* 0x08B7 */ u8 mRightWingNodeID;
/* 0x08B8 */ u8 _0x8B8[0x8CC - 0x8B8];
/* 0x08B8 */ u32 field_0x8CC;
- /* 0x08D0 */ u8 _0x8D0[0x8FC - 0x8D0];
+ /* 0x08D0 */ u8 _0x8D0[0x8D8 - 0x8D0];
+ /* 0x08D8 */ mVec3_c field_0x8D8;
+ /* 0x08E4 */ u8 _0x8E4[0x8FC - 0x8E4];
/* 0x08FC */ dCcD_Sph mSph0;
/* 0x0A4C */ dCcD_Sph mSph1;
/* 0x0B9C */ EffectsStruct mEff0;
@@ -113,8 +172,13 @@ private:
/* 0x0C04 */ EffectsStruct mEff2;
/* 0x0C38 */ EffectsStruct mEff3;
/* 0x0C6C */ dLytFader_c mLytFader;
- /* 0x114C */ u8 _0x114C[0x115C - 0x114C];
+ /* 0x114C */ mFader_c mFader;
+ /* 0x1150 */ u8 _0x1150[0x115C - 0x1150];
/* 0x115C */ STATE_MGR_DECLARE(dAcBoomerang_c);
+
+ static dCcD_SrcSph sSphSrc;
+ static dBgS_BeetleLinChk sLinChk;
+ static const u32 sSrcAtType;
};
#endif
diff --git a/include/d/col/bg/d_bg_s_acch.h b/include/d/col/bg/d_bg_s_acch.h
index 6682fac3..ef546f23 100644
--- a/include/d/col/bg/d_bg_s_acch.h
+++ b/include/d/col/bg/d_bg_s_acch.h
@@ -146,6 +146,7 @@ public:
/* 0x 0800 0000 */ ACCH_FLAG_0x8000000 = (1 << 27),
/* 0x 1000 0000 */ ACCH_FLAG_0x10000000 = (1 << 28),
/* 0x 2000 0000 */ ACCH_FLAG_0x20000000 = (1 << 29),
+ /* 0x 4000 0000 */ ACCH_FLAG_0x40000000 = (1 << 30),
/* 0x 8000 0000 */ ACCH_FLAG_0x80000000 = (1 << 31),
};
@@ -314,6 +315,12 @@ public:
return mFlags & ACCH_FLAG_0x10000000;
}
+ void ClrLineDown() {
+ mFlags &= ~LINE_DOWN;
+ }
+ void SetLineDown() {
+ mFlags |= LINE_DOWN;
+ }
void Clr_0x20000() {
mFlags &= ~ACCH_FLAG_0x20000;
}
@@ -323,6 +330,15 @@ public:
bool Chk_0x20000() {
return mFlags & ACCH_FLAG_0x20000;
}
+ void Clr_0x40000000() {
+ mFlags &= ~ACCH_FLAG_0x40000000;
+ }
+ void Set_0x40000000() {
+ mFlags |= ACCH_FLAG_0x40000000;
+ }
+ bool Chk_0x40000000() {
+ return mFlags & ACCH_FLAG_0x40000000;
+ }
void Clr_0x80000000() {
mFlags &= ~ACCH_FLAG_0x80000000;
}
@@ -506,6 +522,14 @@ public:
return mGnd;
}
+ dBgS_RoofChk &GetRoof() {
+ return mRoof;
+ }
+
+ void SetField_0xD4(f32 v) {
+ mField_0x0D4 = v;
+ }
+
public:
/* 0x040 */ u32 mFlags;
/* 0x044 */ mVec3_c *mpPos;
diff --git a/include/d/col/bg/d_bg_s_roof_chk.h b/include/d/col/bg/d_bg_s_roof_chk.h
index 214cef0b..0e012dd1 100644
--- a/include/d/col/bg/d_bg_s_roof_chk.h
+++ b/include/d/col/bg/d_bg_s_roof_chk.h
@@ -23,6 +23,10 @@ public:
void SetPos(mVec3_c const *);
+ void SetField_0x7C(u8 param0) {
+ mField_0x7C = param0;
+ }
+
void SetNowY(f32 y) {
mNowY = y;
}
diff --git a/include/d/col/c/c_bg_s_lin_chk.h b/include/d/col/c/c_bg_s_lin_chk.h
index 4d5e8141..e3cafb41 100644
--- a/include/d/col/c/c_bg_s_lin_chk.h
+++ b/include/d/col/c/c_bg_s_lin_chk.h
@@ -50,6 +50,9 @@ public:
bool GetPreGroundChk() const {
return mPreGroundChk;
}
+ void SetPreRoofChk(bool b) {
+ mPreRoofChk = b;
+ }
bool GetPreRoofChk() const {
return mPreRoofChk;
}
diff --git a/include/d/col/c/c_cc_d.h b/include/d/col/c/c_cc_d.h
index d3a0cf5a..975c2b36 100644
--- a/include/d/col/c/c_cc_d.h
+++ b/include/d/col/c/c_cc_d.h
@@ -338,7 +338,7 @@ enum dCcD_ObjAtType {
/* 0x 0000 0008 */ AT_TYPE_PHYSICS = (1 << 3),
/* 0x 0000 0010 */ AT_TYPE_0x10 = (1 << 4),
/* 0x 0000 0020 */ AT_TYPE_BOMB = (1 << 5),
- /* 0x 0000 0040 */ AT_TYPE_0x40 = (1 << 6),
+ /* 0x 0000 0040 */ AT_TYPE_0x40 = (1 << 6), // Used in Beetle
/* 0x 0000 0080 */ AT_TYPE_SLINGSHOT = (1 << 7),
/* 0x 0000 0100 */ AT_TYPE_0x100 = (1 << 8),
/* 0x 0000 0200 */ AT_TYPE_WIND = (1 << 9),
@@ -686,7 +686,7 @@ public:
cCcD_ObjCo();
virtual ~cCcD_ObjCo();
void Set(const cCcD_SrcGObjCo &);
- void SetCoFlag(u32);
+ void SetGrp(u32);
void AdjustHitPos(f32, f32);
void ClrSet() {
@@ -815,6 +815,9 @@ public:
mCo.OnSPrm(f);
}
+ void SetAtType(u32 type) {
+ mAt.SetType(type);
+ }
void SetTgType(u32 type) {
mTg.SetType(type);
}
@@ -932,6 +935,11 @@ public:
void OnAt_0x40() {
mAt.OnSPrm(0x40);
}
+ // Related to Beetle (no hook)
+ void OnAt_0x4000() {
+ mAt.OnSPrm(0x4000);
+ }
+
void SetAtDamage(u8 amount) {
@@ -967,6 +975,9 @@ public:
void ClrTgElectric() {
return mTg.OffSPrm(0x40000);
}
+ u32 ChkTgBonk() const {
+ return mTg.MskSPrm(0x200000);
+ }
void OnTg_0x200000() {
mTg.OnSPrm(0x200000);
@@ -990,6 +1001,9 @@ public:
// Co
+ void SetCoGrp(u32 grp) {
+ mCo.SetGrp(grp << 4);
+ }
void OnCoSet() {
mCo.OnSPrm(1);
}
diff --git a/include/d/d_player_act.h b/include/d/d_player_act.h
index a490da69..6214a749 100644
--- a/include/d/d_player_act.h
+++ b/include/d/d_player_act.h
@@ -584,6 +584,13 @@ public:
return mCurrentAction == 0xAD || mCurrentAction == 0xAE;
}
+ void onModelUpdateFlag(u32 mask) {
+ mModelUpdateFlags |= mask;
+ }
+ void offModelUpdateFlag(u32 mask) {
+ mModelUpdateFlags &= ~mask;
+ }
+
inline bool checkActionFlags(u32 mask) const {
return (mActionFlags & mask) != 0;
}