diff options
| author | Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com> | 2026-10-15 12:41:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-15 12:41:55 -0400 |
| commit | ab2eff8a8487d896be2d224bd57189f679034f56 (patch) | |
| tree | 5f080d4595e2a2f6e87bed34b00f0764e8788bea /src | |
| parent | a84c13a4bb5a6122c3e5caf0dcec850b72a9ef8a (diff) | |
| parent | 95c9fe3a014493f3749dbe964366145324a6d9d5 (diff) | |
Merge pull request #356 from lisasunlight98-crypto/match-d_t_beetle
Match d_t_beetle (100%)
Diffstat (limited to 'src')
| -rw-r--r-- | src/REL/d/t/d_t_beetle.cpp | 59 |
1 files changed, 22 insertions, 37 deletions
diff --git a/src/REL/d/t/d_t_beetle.cpp b/src/REL/d/t/d_t_beetle.cpp index cc0c305c..9ba5b33d 100644 --- a/src/REL/d/t/d_t_beetle.cpp +++ b/src/REL/d/t/d_t_beetle.cpp @@ -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; +} - mVec3_c diff = position - (mPosition + mScale.y * mVec3_c::Ey * 1.0f); +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.mag() <= 1.0f; // is beetle within a certain distance from center + return diff.absXZ() <= 1.0f && diff.y <= 0.5f && diff.y >= -0.5f; } -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; +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; - if (diff.absXZ() <= 0.01f && diff.y <= 0.5f) { - returnCheck = 1; - } - - if (returnCheck && diff.y >= -0.5f) { - returnValue = 1; - } - - return returnValue; + return diff.mag() <= 1.0f; } -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; -} |
