Merge pull request #356 from lisasunlight98-crypto/match-d_t_beetle

Match d_t_beetle (100%)
This commit is contained in:
Elijah Thomas
2026-10-15 12:41:55 -04:00
committed by GitHub
4 changed files with 35 additions and 52 deletions
+4 -6
View File
@@ -12,10 +12,8 @@ updateBeetle__11dTgBeetle_cFR14dAcBoomerang_c = .text:0x00000620; // type:functi
__dt__11dTgBeetle_cFv = .text:0x00000680; // type:function size:0x5C
_ctors = .ctors:0x00000000; // type:label scope:global
_dtors = .dtors:0x00000000; // type:label scope:global
lbl_302_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float
dTgBeetle__scaleMultiplier = .rodata:0x00000004; // type:object size:0xC align:4 data:float
lbl_302_rodata_4.y = .rodata:0x00000010; // type:object size:0x4 align:4 data:float
lbl_302_rodata_4.z = .rodata:0x00000014; // type:object size:0x4 align:4 data:float
unused_ = .rodata:0x00000000; // type:object size:0x4 scope:global data:float
lbl_302_rodata_4 = .rodata:0x00000004; // type:object size:0x14 scope:local align:4 data:float
g_profile_BEETLE_TAG = .data:0x00000000; // type:object size:0x10
lbl_302_data_10 = .data:0x00000010; // type:object size:0x5 data:string
dTgBeetle__vtable = .data:0x00000018; // type:object size:0x74
lbl_302_data_10 = .data:0x00000010; // type:object size:0x8 scope:local data:string
__vt__11dTgBeetle_c = .data:0x00000018; // type:object size:0x74
+1 -1
View File
@@ -2898,7 +2898,7 @@ config.libs = [
Rel(NonMatching, "d_t_bb_quake", "REL/d/t/d_t_bb_quake.cpp"),
Rel(NonMatching, "d_t_bcal_tag", "REL/d/t/d_t_bcal_tag.cpp"),
Rel(NonMatching, "d_t_bcz", "REL/d/t/d_t_bcz.cpp"),
Rel(NonMatching, "d_t_beetle", "REL/d/t/d_t_beetle.cpp"),
Rel(Matching, "d_t_beetle", "REL/d/t/d_t_beetle.cpp"),
Rel(Matching, "d_t_belt_obstacle", "REL/d/t/d_t_belt_obstacle.cpp"),
Rel(NonMatching, "d_t_clef_game", "REL/d/t/d_t_clef_game.cpp"),
Rel(NonMatching, "d_t_clef_manager", "REL/d/t/d_t_clef_manager.cpp"),
+2 -2
View File
@@ -15,8 +15,8 @@ public:
virtual int create() override;
virtual int doDelete() override;
virtual int actorExecute() override;
u32 isWithinSphere(const mVec3_c &param) const;
u32 isWithinCylinder(const mVec3_c &param) const;
bool isWithinSphere(const mVec3_c &param) const;
bool isWithinCylinder(const mVec3_c &param) const;
void updateBeetle(dAcBoomerang_c &boomerang);
virtual int draw() override;
+28 -43
View File
@@ -10,6 +10,8 @@
SPECIAL_ACTOR_PROFILE(BEETLE_TAG, dTgBeetle_c, fProfile::BEETLE_TAG, 0x297, 0, 0);
extern const f32 unused_ = 0.0f;
int dTgBeetle_c::create() {
if (dScGame_c::currentSpawnInfo.stageName == "F103") { // flooded faron woods
if (mActorSubtype) {
@@ -37,7 +39,7 @@ int dTgBeetle_c::create() {
mZoneShape = SphereShape;
}
}
matrixCreateFromPosRotYScale(mMatrix1, mPosition, mRotation.y, mScale, nullptr, 0);
matrixCreateFromPosRotYScale(mMatrix1, mPosition, mRotation.y, mScale, nullptr, 0.0f);
return SUCCEEDED;
}
}
@@ -48,7 +50,7 @@ int dTgBeetle_c::doDelete() {
int dTgBeetle_c::actorExecute() {
if (mPastOnly == 1 && !mActorSubtype) {
if (dTimeAreaMgr_c::GetInstance()->checkPositionIsInPastState(mRoomID, mPosition, nullptr, 1.0f) == 0) {
if (dTimeAreaMgr_c::GetInstance()->checkPositionIsInPastState(mRoomID, mPosition, nullptr, 1.0f) == 0.0f) {
return SUCCEEDED;
}
}
@@ -75,55 +77,38 @@ int dTgBeetle_c::actorExecute() {
return SUCCEEDED;
}
u32 dTgBeetle_c::isWithinSphere(
const mVec3_c &position
) const { // fn_302_520 is position within a sphere the size of the zone
int dTgBeetle_c::draw() {
return SUCCEEDED;
}
bool dTgBeetle_c::isWithinCylinder(const mVec3_c &position) const {
mVec3_c diff = (position - (mPosition + mVec3_c::Ey * mScale.y * 0.5f));
diff.x /= mScale.x;
diff.y /= mScale.y;
diff.z /= mScale.z;
return diff.absXZ() <= 1.0f && diff.y <= 0.5f && diff.y >= -0.5f;
}
bool dTgBeetle_c::isWithinSphere(const mVec3_c &position) const {
mVec3_c diff = position - (mPosition + mScale.y * mVec3_c::Ey * 1.0f);
diff.x /= mScale.x;
diff.y /= mScale.y;
diff.z /= mScale.z;
return diff.mag() <= 1.0f; // is beetle within a certain distance from center
return diff.mag() <= 1.0f;
}
u32 dTgBeetle_c::isWithinCylinder(
const mVec3_c &position
) const { // is position within a really thin cylinder inside the zone
mVec3_c diff = (position - (mPosition + mVec3_c::Ey * mScale.y * 0.5f));
bool returnValue = 0;
bool returnCheck = 0;
diff.x /= mScale.x;
diff.y /= mScale.y;
diff.z /= mScale.z;
if (diff.absXZ() <= 0.01f && diff.y <= 0.5f) {
returnCheck = 1;
}
if (returnCheck && diff.y >= -0.5f) {
returnValue = 1;
}
return returnValue;
}
void dTgBeetle_c::updateBeetle(dAcBoomerang_c &boomerang) { // fn_302_620 update beetle based on zone type
if (mZoneType == LeafZone) { // leaf zone
return boomerang.setField_0x8CC(0x20);
} else if (mZoneType == BorderZone) { // border zone, reduce flight time
return boomerang.setRemainingFlightTime(0x3C);
} else if (mZoneType == UnknownZone) { //???
return boomerang.setField_0x8CC(0x80);
} else { // instant flashing red
return boomerang.setRemainingFlightTime(-1);
void dTgBeetle_c::updateBeetle(dAcBoomerang_c &boomerang) {
if (mZoneType == LeafZone) {
boomerang.setField_0x8CC(0x20);
} else if (mZoneType == BorderZone) {
boomerang.setRemainingFlightTime(0x3C);
} else if (mZoneType == UnknownZone) {
boomerang.setField_0x8CC(0x80);
} else {
boomerang.setRemainingFlightTime(-1);
}
}
int dTgBeetle_c::draw() {
return SUCCEEDED;
}