summaryrefslogtreecommitdiff
path: root/include/d
diff options
context:
space:
mode:
authorElijah Thomas <42302100+elijah-thomas774@users.noreply.github.com>2025-03-30 21:34:05 -0400
committerGitHub <noreply@github.com>2025-03-30 21:34:05 -0400
commite85a989271d9445d4c4e1da41dfb6d90cb0652aa (patch)
tree595f51b5c210a9c65bed82611e02be5e6026f934 /include/d
parent4a17d86c3b3972506481b33ff3d3e2c96f31f541 (diff)
Chair (#143)
* chair * mostly done * updateChairPos match --------- Co-authored-by: robojumper <robojumper@gmail.com>
Diffstat (limited to 'include/d')
-rw-r--r--include/d/a/d_a_item.h2
-rw-r--r--include/d/a/d_a_player.h9
-rw-r--r--include/d/a/obj/d_a_obj_chair.h71
-rw-r--r--include/d/col/c/c_cc_d.h10
4 files changed, 90 insertions, 2 deletions
diff --git a/include/d/a/d_a_item.h b/include/d/a/d_a_item.h
index 1f0b7691..35e71c7b 100644
--- a/include/d/a/d_a_item.h
+++ b/include/d/a/d_a_item.h
@@ -63,6 +63,8 @@ public:
static void itemGetEventStart(dAcBase_c *);
static void itemGetEventEnd(dAcBase_c *);
+ static void healLink(u32 amount, bool);
+
private:
/* 0x334 */ UNKTYPE *mpMdl; // Model has its own handling system
/* 0x338 */ dShadowCircle_c mShdw;
diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h
index 133b09f3..d1e16f3e 100644
--- a/include/d/a/d_a_player.h
+++ b/include/d/a/d_a_player.h
@@ -1,3 +1,6 @@
+#ifndef D_A_PLAYER_H
+#define D_A_PLAYER_H
+
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/obj/d_a_obj_base.h"
@@ -256,6 +259,10 @@ public:
return mCurrentAction;
}
+ bool checkCurrentAction(int action) const {
+ return mCurrentAction == action;
+ }
+
inline bool checkActionFlags(u32 mask) const {
return (mActionFlags & mask) != 0;
}
@@ -271,3 +278,5 @@ public:
static dAcPy_c *LINK;
};
+
+#endif
diff --git a/include/d/a/obj/d_a_obj_chair.h b/include/d/a/obj/d_a_obj_chair.h
index 89e3712d..c8c146f7 100644
--- a/include/d/a/obj/d_a_obj_chair.h
+++ b/include/d/a/obj/d_a_obj_chair.h
@@ -2,18 +2,87 @@
#define D_A_OBJ_CHAIR_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_w.h"
+#include "d/col/cc/d_cc_d.h"
+#include "d/d_shadow.h"
+#include "d/flag/sceneflag_manager.h"
+#include "m/m3d/m_smdl.h"
+#include "m/m_angle.h"
+#include "m/m_vec.h"
+#include "nw4r/g3d/res/g3d_resfile.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
class dAcOChair_c : public dAcObjBase_c {
public:
+ enum ChairType {
+ CHAIR_A, // Standard Stool
+ CHAIR_B, // Standard Chair
+ CHAIR_C, // Seat like in Headmaster Room
+ CHAIR_D, // Couch
+ CHAIR_E, // Bench
+ CHAIR_F, // Faron - Stump
+ CHAIR_G, // Eldin - In Huts
+ CHAIR_H, // Lanayru - 'Past'
+ CHAIR_I, // In Front of ET
+ };
+
dAcOChair_c() : mStateMgr(*this, sStateID::null) {}
virtual ~dAcOChair_c() {}
+ virtual int create() override;
+ virtual int doDelete() override;
+ virtual int draw() override;
+ virtual bool createHeap() override;
+ virtual int actorExecute() override;
+
STATE_FUNC_DECLARE(dAcOChair_c, Wait);
+ ChairType getChairType(u8 &param);
+
+ void updateChairPos();
+
+ bool isBench() const {
+ return (mChairType == CHAIR_D || mChairType == CHAIR_E || mChairType == CHAIR_I);
+ }
+ bool isChairTypeIdk0() const {
+ return (
+ mChairType == CHAIR_A || mChairType == CHAIR_F || mChairType == CHAIR_G || mChairType == CHAIR_H ||
+ mChairType == CHAIR_I
+ );
+ }
+ bool isChairTypeIdk1() const {
+ return mChairType == CHAIR_F || mChairType == CHAIR_H;
+ }
+
+ // Might be an inline from dAcBase_c?
+ mAng getRelativeYRotationToPlayer() {
+ mAng a = getXZAngleToPlayer();
+ return a - rotation.y;
+ }
+
private:
- /* 0x??? */ STATE_MGR_DECLARE(dAcOChair_c);
+ /* 0x330 */ nw4r::g3d::ResFile mRes;
+ /* 0x334 */ m3d::smdl_c mMdl;
+ /* 0x350 */ dShadowCircle_c mShadow;
+
+ /* 0x358 */ dCcD_Cyl mCyl;
+ /* 0x4A8 */ dBgW mBgW;
+ /* 0x6B8 */ dBgS_ObjAcch mObjAcch;
+ /* 0xA68 */ dBgS_AcchCir mAcchCir;
+
+ /* 0xAC4 */ STATE_MGR_DECLARE(dAcOChair_c);
+ /* 0xB00 */ mVec3_c mChairPos;
+ /* 0xB0C */ u8 _B0C[0xB14 - 0xB0C];
+ /* 0xB14 */ u32 mSeatNodeID;
+ /* 0xB18 */ mAng mChairRot;
+ /* 0xB1A */ u8 field_0xB1A;
+ /* 0xB1B */ u8 field_0xB1B;
+ /* 0xB1C */ u8 field_0xB1C;
+ /* 0xB1D */ u8 mHealTimer;
+ /* 0xB1E */ u8 mChairType;
+ /* 0xB1E */ u8 mSceneflag;
};
#endif
diff --git a/include/d/col/c/c_cc_d.h b/include/d/col/c/c_cc_d.h
index b9d9daa4..2893419d 100644
--- a/include/d/col/c/c_cc_d.h
+++ b/include/d/col/c/c_cc_d.h
@@ -315,7 +315,8 @@ public:
};
struct cCcD_SrcGObjTgInfo {
- /* 0x00 */ u16 mField_0x0;
+ /* 0x00 */ u8 mField_0x0;
+ /* 0x01 */ u8 mField_0x1;
/* 0x02 */ u16 mField_0x2;
};
@@ -631,6 +632,10 @@ public:
mField_0x4B = val;
}
+ void SetInfo_0x1(u8 val) {
+ mSrc.mInfo.mField_0x1 = val;
+ }
+
void SetInfo_0x2(u16 val) {
mSrc.mInfo.mField_0x2 = val;
}
@@ -911,6 +916,9 @@ public:
void SetTg_0x4B(u8 val) {
mTg.Set_0x4B(val);
}
+ void SetTgInfo_0x1(u8 val) {
+ mTg.SetInfo_0x1(val);
+ }
void SetTgInfo_0x2(u16 val) {
mTg.SetInfo_0x2(val);
}