d_a_obj_soil OK

This commit is contained in:
lepelog
2025-12-08 01:27:38 +01:00
parent 3754ad2e08
commit d73722da4c
12 changed files with 816 additions and 57 deletions
+1
View File
@@ -78,6 +78,7 @@ public:
AC_PROP_0x4000000 = (1 << 26),
AC_PROP_0x8000000 = (1 << 27),
AC_PROP_0x10000000 = (1 << 28),
AC_PROP_0x20000000 = (1 << 29),
AC_PROP_0x40000000 = (1 << 30),
};
+2
View File
@@ -62,6 +62,8 @@ public:
// Item select/equip/use functions [0x801E3160 - 0x801E7AD0] ?
static s32 calcItemWheelSelection(bool reset, s32 numOptions);
static void addDigInteractionTarget(dAcBase_c*, f32);
public:
f32 getField_0x4564() const {
return field_0x4564;
+92 -2
View File
@@ -1,26 +1,116 @@
#ifndef D_A_OBJ_SOIL_H
#define D_A_OBJ_SOIL_H
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/a/obj/d_a_obj_tbox.h"
#include "d/col/bg/d_bg_w.h"
#include "d/col/cc/d_cc_d.h"
#include "d/t/d_t_insect.h"
#include "m/m3d/m_smdl.h"
#include "m/m_vec.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "rvl/GX/GXTypes.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
#include "toBeSorted/dowsing_target.h"
class dAcOsoil_c : public dAcObjBase_c {
public:
dAcOsoil_c() : mStateMgr(*this, sStateID::null) {}
dAcOsoil_c() : mStateMgr(*this, sStateID::null), mResFile(nullptr), mDowsingTarget(this, DowsingTarget::SLOT_NONE) {}
virtual ~dAcOsoil_c() {}
STATE_FUNC_DECLARE(dAcOsoil_c, Soil);
STATE_FUNC_DECLARE(dAcOsoil_c, Hole);
STATE_FUNC_DECLARE(dAcOsoil_c, Ready);
enum Subtype {
SUBTYPE_VENT, // used by instances spawned by dAcOWind_c
SUBTYPE_TBOX, // unused?
SUBTYPE_DROP, // you can dig up items from this one
SUBTYPE_MOGMA, // when dug up, a mogma appears
SUBTYPE_KEY_PIECE,
};
enum Itemtype {
ITEMTYPE_KEY_PIECE,
ITEMTYPE_DIRECT_GIVE, // used for the small key in Skyview 2
ITEMTYPE_DROP,
};
enum ModelIndex {
MODEL_COVERED,
MODEL_DUG_UP,
};
bool isStateHole() {
return mStateMgr.isState(StateID_Hole);
}
STATE_MGR_DEFINE_UTIL_EXECUTESTATE(dAcOsoil_c);
private:
/* 0x330 */ u8 field_0x330[0x6CC-0x330];
/* 0x330 */ nw4r::g3d::ResFile mResFile;
/* 0x334 */ m3d::smdl_c mModels[2];
/* 0x36C */ dBgW mActorInteraction;
/* 0x57C */ dCcD_Cyl mCollider;
/* 0x6CC */ STATE_MGR_DECLARE(dAcOsoil_c);
/* 0x708 */ dAcRef_c<dAcTbox_c> mTboxLink;
/* 0x714 */ dAcRef_c<dTgInsect_c> mInsectLink;
/* 0x720 */ DowsingTarget mDowsingTarget;
/* 0x740 */ GXColor mColors[2];
/* 0x748 */ u8 field_0x748[0x778 - 0x748]; // unused
/* 0x778 */ mVec3_c mItemAndInsectSpawnPos;
/* 0x784 */ u16 mFinalDigTimer;
/* 0x786 */ u8 mModelIndex;
/* 0x787 */ u8 mSubtype;
/* 0x788 */ u8 mSceneflag;
/* 0x789 */ u8 mSpawnSceneflag;
/* 0x78A */ u8 mCountInParams;
/* 0x78B */ u8 mDigsLeft;
/* 0x78C */ u8 mItemSubtype;
/* 0x78D */ u8 mSomeCounter1;
/* 0x78E */ u8 mDowsingStateRelated;
/* 0x78F */ bool mHasTriedTboxLink;
/* 0x790 */ bool mInteractionDisabled;
/* 0x791 */ bool mTboxPrepared;
/* 0x792 */ bool mForInsects;
/* 0x793 */ bool field_0x793;
/* 0x794 */ bool mAlwaysLoaded;
/* 0x795 */ bool mIsHidden;
/* 0x796 */ bool mHideCover;
/* 0x797 */ bool field_0x797; // unused
/* 0x798 */ bool mShouldSetFlagInEvent;
/* 0x799 */ bool mHideWhenCameraNear;
static dCcD_SrcCyl sCylSrc;
bool isSubtypeVentOrDrop() const {
return mSubtype == SUBTYPE_VENT || mSubtype == SUBTYPE_DROP;
}
s32 getSubtype() const {
return mSubtype;
}
virtual int doDelete() override;
virtual int actorCreate() override;
virtual bool createHeap() override;
virtual int actorPostCreate() override;
virtual int actorExecute() override;
virtual int draw() override;
bool checkCoHit(bool*);
void giveItemRepeated();
void calcItemAndInsectSpawnPos();
void tryLinkTbox();
void giveItemFinal();
void fn_255_1A50();
void setModelColorFromParams(GXColor* pOutColor, m3d::smdl_c& mdl);
void fn_255_1D80();
void setModelAlphaToGlobalAlpha();
void handleModelsOpacities();
void test();
};
#endif
+3
View File
@@ -1012,6 +1012,9 @@ public:
void OnCoSet() {
mCo.OnSPrm(1);
}
void OffCoSet() {
mCo.OffSPrm(1);
}
u32 ChkCoSet2() const {
return mCo.MskSPrm(0x800);
}
+5
View File
@@ -22,6 +22,11 @@ public:
void reset();
void setTev1Color(GXColor color) {
mTev1Color = color;
mUseTev1 = true;
}
public:
/* 0x0C */ f32 field_0x0C;
/* 0x10 */ f32 field_0x10;
+8
View File
@@ -1,6 +1,7 @@
#ifndef D_T_INSECT_H
#define D_T_INSECT_H
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/t/d_tg.h"
#include "m/m_vec.h"
@@ -48,6 +49,13 @@ public:
mKillSignal = 1;
}
void reveal(mVec3_c* pos) {
mRevealed = 1;
if (pos != nullptr) {
mRevealedSpawnPos = *pos;
}
}
static const f32 SCALE_X;
static const f32 SCALE_Y;
+7
View File
@@ -7,6 +7,13 @@ struct mColor : public nw4r::ut::Color {
mColor() : nw4r::ut::Color() {}
mColor(int red, int green, int blue, int alpha) : nw4r::ut::Color(red, green, blue, alpha) {}
mColor(int hex) : nw4r::ut::Color(hex) {}
void operator=(GXColor& color) {
r = color.r;
g = color.g;
b = color.b;
a = color.a;
}
};
#endif
+5
View File
@@ -277,6 +277,11 @@ public:
return EGG::Vector3f::angle(other);
}
void offsetWithAngle(s16 yRot, f32 scale) {
this->x += nw4r::math::SinIdx(yRot) * scale;
this->z += nw4r::math::CosIdx(yRot) * scale;
}
static mVec3_c Zero;
static mVec3_c Ex;
static mVec3_c Ey;