From 6ff7925159b6c37100bf4b01a80083dd95625639 Mon Sep 17 00:00:00 2001 From: HeartPiece Date: Mon, 11 Sep 2023 11:25:23 +1000 Subject: [PATCH] Update Queen and CellIterator variable naming --- docs/recommended_todo.md | 16 ++-- include/Game/Entities/Queen.h | 10 +- include/Game/cellPyramid.h | 46 +++++----- src/plugProjectKandoU/aiBattle.cpp | 2 +- src/plugProjectKandoU/cellIterator.cpp | 92 +++++++++---------- src/plugProjectKandoU/cellPyramid.cpp | 64 ++++++------- src/plugProjectNishimuraU/BigTreasure.cpp | 2 +- .../BigTreasureAttack.cpp | 2 +- src/plugProjectNishimuraU/ElecHiba.cpp | 2 +- src/plugProjectNishimuraU/Fart.cpp | 2 +- src/plugProjectNishimuraU/Fuefuki.cpp | 2 +- src/plugProjectNishimuraU/GasHiba.cpp | 2 +- src/plugProjectNishimuraU/Hiba.cpp | 2 +- src/plugProjectNishimuraU/Kabuto.cpp | 2 +- src/plugProjectNishimuraU/OniKurage.cpp | 4 +- src/plugProjectNishimuraU/OtakaraBase.cpp | 2 +- src/plugProjectNishimuraU/Queen.cpp | 40 ++++---- src/plugProjectNishimuraU/QueenState.cpp | 68 +++++++------- src/plugProjectNishimuraU/Tank.cpp | 2 +- 19 files changed, 181 insertions(+), 181 deletions(-) diff --git a/docs/recommended_todo.md b/docs/recommended_todo.md index a0e8ab726..83ea29bbc 100644 --- a/docs/recommended_todo.md +++ b/docs/recommended_todo.md @@ -95,10 +95,10 @@ | File | Size (bytes) | File | Size (bytes) | | ---- | ---- | ---- | ---- | | aiTeki.cpp | 5890 | gamePelletList.cpp | 8282 | -| cellIterator.cpp | 8953 | mapMgrTraceMove.cpp | 9030 | +| mapMgrTraceMove.cpp | 9030 | cellIterator.cpp | 9254 | | itemBarrel.cpp | 11148 | aiBreakGate.cpp | 13918 | | flockMgr.cpp | 13955 | itemTreasure.cpp | 14296 | -| naviWhistle.cpp | 16714 | aiBattle.cpp | 17374 | +| naviWhistle.cpp | 16714 | aiBattle.cpp | 17389 | | creatureLOD.cpp | 18468 | texCaster.cpp | 20776 | | aiRescue.cpp | 21024 | gameResultTexMgr.cpp | 21442 | | singleGS_CaveResult.cpp | 22846 | aiCrop.cpp | 26982 | @@ -137,17 +137,17 @@ | nslibmath.cpp | 4592 | TyreShadow.cpp | 7234 | | MaroFrog.cpp | 7314 | UmimushiShadow.cpp | 7565 | | ContRumble.cpp | 9005 | SnakeJointMgr.cpp | 10097 | -| KumaChappy.cpp | 11401 | Kabuto.cpp | 12265 | -| BabyState.cpp | 12869 | Tank.cpp | 13313 | +| KumaChappy.cpp | 11401 | Kabuto.cpp | 12279 | +| BabyState.cpp | 12869 | Tank.cpp | 13327 | | Kogane.cpp | 14614 | JointShadowBase.cpp | 14958 | | ElecBugState.cpp | 15715 | RandMapMgr.cpp | 17083 | | TadpoleState.cpp | 17593 | SnakeWholeShadow.cpp | 19376 | | SnakeCrowShadow.cpp | 19385 | ImomushiState.cpp | 19863 | | UjiaState.cpp | 20924 | RumbleMgr.cpp | 21534 | -| Rock.cpp | 21671 | ElecHiba.cpp | 21823 | -| Frog.cpp | 22143 | QueenState.cpp | 22521 | -| Ujia.cpp | 22966 | Queen.cpp | 23496 | -| Ujib.cpp | 23602 | ElecBug.cpp | 24345 | +| Rock.cpp | 21671 | ElecHiba.cpp | 21837 | +| Frog.cpp | 22143 | QueenState.cpp | 22713 | +| Ujia.cpp | 22966 | Ujib.cpp | 23602 | +| Queen.cpp | 23612 | ElecBug.cpp | 24345 | | ArmorState.cpp | 24714 | SaraiState.cpp | 24923 | | TobiState.cpp | 24962 | UjibState.cpp | 25505 | | Armor.cpp | 25780 | Tobi.cpp | 25937 | diff --git a/include/Game/Entities/Queen.h b/include/Game/Entities/Queen.h index 5ea075d86..2eab0ab44 100644 --- a/include/Game/Entities/Queen.h +++ b/include/Game/Entities/Queen.h @@ -105,13 +105,13 @@ struct Obj : public EnemyBase { FSM* mFsm; // _2BC bool mCanCreateLarva; // _2C0 bool mIsRoomForLarva; // _2C1, have not hit max capacity yet - u8 _2C2; // _2C2 - u8 _2C3; // _2C3 - u8 _2C4; // _2C4 - u8 _2C5; // _2C5 + bool mIsRolling; // _2C2 + bool mDoEasyRoll; // _2C3, first roll will avoid active captain (only HoB) + bool mIsAppearBGM; // _2C4, has BGM started + bool mIsAttackLoopBGM; // _2C5, is the attack loop BGM playing f32 mWaitTimer; // _2C8 f32 mBirthTimer; // _2CC - f32 _2D0; // _2D0 + f32 _2D0; // _2D0, related to hit counter? StateID mNextState; // _2D4 QueenShadowMgr* mShadowMgr; // _2D8 Sys::MatLoopAnimator* mMatLoopAnimator; // _2DC diff --git a/include/Game/cellPyramid.h b/include/Game/cellPyramid.h index 9b884eb2b..acc772836 100644 --- a/include/Game/cellPyramid.h +++ b/include/Game/cellPyramid.h @@ -95,17 +95,17 @@ struct Cell { void exit(CellLeg*, bool); void entry(CellLeg*, bool); - Cell* _00[4]; // _00 - Cell* _10; // _10 - u16 _14; // _14 - u16 _16; // _16 - u16 _18; // _18 - u8 _1A[2]; // _1A - CellLeg* _1C; // _1C - Cell* _20; // _20 - Cell* _24; // _24 - short _28; // _28 - u8 _2A[2]; // _2A + Cell* _00[4]; // _00 + Cell* _10; // _10 + u16 _14; // _14 + u16 _16; // _16 + u16 _18; // _18 + u8 _1A[2]; // _1A + CellLeg* mLeg; // _1C + Cell* _20; // _20 + Cell* _24; // _24 + short _28; // _28 + u8 _2A[2]; // _2A static CellPyramid* sCurrCellMgr; }; @@ -223,10 +223,10 @@ struct CellIteratorArg { Sys::Sphere mSphere; // _00 CellIteratorCondition* mCondition; // _10, this is a ptr to something with a vtable, and 0x8 of vtable returns a bool ._. - int _14; // _14 + int _14; // _14, set to 0 and unused CellPyramid* mCellMgr; // _18 - u8 _1C; // _1C - u8 _1D; // _1D + bool mIgnoreOverlap; // _1C, if false, will calc overlapping bounding spheres rather than just "in cell or no" + u8 _1D; // _1D, set to 0 and unused }; #define CI_LOOP(it) for (it.first(); !it.isDone(); it.next()) @@ -245,17 +245,17 @@ struct CellIterator { bool satisfy(); bool step(); - CellLeg* _00; // _00 - int _04; // _04 - int _08; // _08 - int _0C; // _0C - int _10; // _10 - int _14; // _14 - int _18; // _18 - int _1C; // _1C + CellLeg* mCurrLeg; // _00 + int mCurrX; // _04 + int mCurrY; // _08 + int mCurrLayerIdx; // _0C + int mMinX; // _10 + int mMinY; // _14 + int mMaxX; // _18 + int mMaxY; // _1C u32 mPassID; // _20 CellIteratorArg mArg; // _24 - u32 _44; // _44 + u32 _44; // _44, unused }; extern CellPyramid* cellMgr; diff --git a/src/plugProjectKandoU/aiBattle.cpp b/src/plugProjectKandoU/aiBattle.cpp index 4ba17bb3d..23add896c 100644 --- a/src/plugProjectKandoU/aiBattle.cpp +++ b/src/plugProjectKandoU/aiBattle.cpp @@ -182,7 +182,7 @@ void ActBattle::init(PikiAI::ActionArg* arg) Vector3f midPoint = (mParent->getPosition() + mOther->getPosition()) * 0.5f; Sys::Sphere itSphere(midPoint, 10.0f); Game::CellIteratorArg citArg(itSphere); - citArg._1C = 0; + citArg.mIgnoreOverlap = false; Game::CellIterator cellIt(citArg); CI_LOOP(cellIt) diff --git a/src/plugProjectKandoU/cellIterator.cpp b/src/plugProjectKandoU/cellIterator.cpp index 135433b40..a1d8a57cb 100644 --- a/src/plugProjectKandoU/cellIterator.cpp +++ b/src/plugProjectKandoU/cellIterator.cpp @@ -17,8 +17,8 @@ CellIteratorArg::CellIteratorArg() mCellMgr = cellMgr; - _1D = 0; - _1C = 0; + _1D = 0; + mIgnoreOverlap = false; } /* @@ -29,12 +29,12 @@ CellIteratorArg::CellIteratorArg() */ CellIteratorArg::CellIteratorArg(Sys::Sphere& sphere) { - mSphere = sphere; - mCondition = nullptr; - _14 = 0; - mCellMgr = Game::cellMgr; - _1D = 0; - _1C = 0; + mSphere = sphere; + mCondition = nullptr; + _14 = 0; + mCellMgr = Game::cellMgr; + _1D = 0; + mIgnoreOverlap = false; } /* @@ -60,14 +60,14 @@ void CellIterator::first() mPassID = cellMgr->mPassID; - _00 = 0; - _0C = 0; + mCurrLeg = nullptr; + mCurrLayerIdx = 0; calcExtent(); - Cell* foundCell = mArg.mCellMgr->mLayers[_0C](_04, _08); + Cell* foundCell = mArg.mCellMgr->mLayers[mCurrLayerIdx](mCurrX, mCurrY); if (foundCell) { - _00 = foundCell->_1C; + mCurrLeg = foundCell->mLeg; } find(); } @@ -90,7 +90,7 @@ bool CellIterator::next() * Size: 000010 * Matches */ -bool CellIterator::isDone() { return _00 == nullptr; } +bool CellIterator::isDone() { return mCurrLeg == nullptr; } /* * --INFO-- @@ -99,8 +99,8 @@ bool CellIterator::isDone() { return _00 == nullptr; } */ CellObject* CellIterator::operator*() { - if (_00) { - return _00->mObject; + if (mCurrLeg) { + return mCurrLeg->mObject; } return nullptr; } @@ -119,18 +119,18 @@ CellObject* CellIterator::getCellObject() { return *(*this); } */ bool CellIterator::step() { - if (_00) { - _00 = _00->mNext; + if (mCurrLeg) { + mCurrLeg = mCurrLeg->mNext; } - if (!_00) { - _08++; - if (_08 > _1C) { - _08 = _14; - _04++; - if (_04 > _18) { - _0C++; - if (_0C >= mArg.mCellMgr->mLayerCount) { + if (!mCurrLeg) { + mCurrY++; + if (mCurrY > mMaxY) { + mCurrY = mMinY; + mCurrX++; + if (mCurrX > mMaxX) { + mCurrLayerIdx++; + if (mCurrLayerIdx >= mArg.mCellMgr->mLayerCount) { return false; } @@ -138,9 +138,9 @@ bool CellIterator::step() } } - Cell* foundCell = mArg.mCellMgr->mLayers[_0C](_04, _08); + Cell* foundCell = mArg.mCellMgr->mLayers[mCurrLayerIdx](mCurrX, mCurrY); if (foundCell) { - _00 = foundCell->_1C; + mCurrLeg = foundCell->mLeg; } } @@ -170,25 +170,25 @@ bool CellIterator::find() */ bool CellIterator::satisfy() { - if (!_00) { + if (!mCurrLeg) { return false; } - if (!_00 || _00->mObject->mPassID == mPassID) { + if (!mCurrLeg || mCurrLeg->mObject->mPassID == mPassID) { return false; } - if (mArg.mCondition && !mArg.mCondition->satisfy(_00->mObject)) { + if (mArg.mCondition && !mArg.mCondition->satisfy(mCurrLeg->mObject)) { return false; } - CellObject* obj = _00->mObject; + CellObject* obj = mCurrLeg->mObject; Vector3f objPos = obj->getPosition(); Sys::Sphere sphere; obj->getBoundingSphere(sphere); - if (!mArg._1C) { + if (!mArg.mIgnoreOverlap) { if (!mArg._14) { f32 radius = mArg.mSphere.mRadius + sphere.mRadius; radius *= radius; @@ -204,7 +204,7 @@ bool CellIterator::satisfy() } } - _00->mObject->mPassID = mPassID; + mCurrLeg->mObject->mPassID = mPassID; return true; /* stwu r1, -0x50(r1) @@ -338,27 +338,27 @@ void CellIterator::calcExtent() f32 a = mArg.mCellMgr->_40; f32 b = mArg.mCellMgr->_3C; - f32 norm = 1.0f / (mgr->_34 * mgr->mLayers[_0C]._04); + f32 norm = 1.0f / (mgr->_34 * mgr->mLayers[mCurrLayerIdx]._04); - _10 = (x - r - a) * norm; - _14 = (z - r - b) * norm; - _18 = (x + r - a) * norm; - _1C = (z + r - b) * norm; + mMinX = (x - r - a) * norm; + mMinY = (z - r - b) * norm; + mMaxX = (x + r - a) * norm; + mMaxY = (z + r - b) * norm; - if (_10 > _18) { - JUT_PANICLINE(249, "x %f>%f", _10, _18); + if (mMinX > mMaxX) { + JUT_PANICLINE(249, "x %f>%f", mMinX, mMaxX); } - if (_14 > _1C) { - JUT_PANICLINE(252, "y %f>%f", _14, _1C); + if (mMinY > mMaxY) { + JUT_PANICLINE(252, "y %f>%f", mMinY, mMaxY); } - if ((_18 - _10) * (_1C - _14) >= 10000) { - JUT_PANICLINE(259, "xy %f %f\n%f %f\n", _10, _14, _18, _1C); + if ((mMaxX - mMinX) * (mMaxY - mMinY) >= 10000) { + JUT_PANICLINE(259, "xy %f %f\n%f %f\n", mMinX, mMinY, mMaxX, mMaxY); } - _04 = _10; - _08 = _14; + mCurrX = mMinX; + mCurrY = mMinY; /* stwu r1, -0x40(r1) mflr r0 diff --git a/src/plugProjectKandoU/cellPyramid.cpp b/src/plugProjectKandoU/cellPyramid.cpp index 404825823..c0536ba51 100644 --- a/src/plugProjectKandoU/cellPyramid.cpp +++ b/src/plugProjectKandoU/cellPyramid.cpp @@ -79,7 +79,7 @@ Cell::Cell() _00[2] = nullptr; _00[1] = nullptr; _00[0] = nullptr; - _1C = nullptr; + mLeg = nullptr; _10 = nullptr; _14 = 0; _16 = 0; @@ -96,8 +96,8 @@ Cell::Cell() */ void Cell::clear() { - _1C = nullptr; - _18 = 0; + mLeg = nullptr; + _18 = 0; } /* @@ -107,7 +107,7 @@ void Cell::clear() */ void Cell::mapSearch(IDelegate1* delegate, u32 passID) { - for (CellLeg* leg = _1C; leg != nullptr; leg = leg->mNext) { + for (CellLeg* leg = mLeg; leg != nullptr; leg = leg->mNext) { if (leg->mObject->mPassID != passID) { leg->mObject->mPassID = passID; delegate->invoke(leg->mObject); @@ -133,7 +133,7 @@ void Cell::mapSearch(IDelegate1* delegate, u32 passID) */ void Cell::mapSearchUp(IDelegate1* delegate, u32 passID) { - for (CellLeg* leg = _1C; leg != nullptr; leg = leg->mNext) { + for (CellLeg* leg = mLeg; leg != nullptr; leg = leg->mNext) { if (leg->mObject->mPassID != passID) { leg->mObject->mPassID = passID; delegate->invoke(leg->mObject); @@ -151,7 +151,7 @@ void Cell::mapSearchUp(IDelegate1* delegate, u32 passID) */ void Cell::mapSearchDown(IDelegate1* delegate, u32 passID) { - for (CellLeg* leg = _1C; leg != nullptr; leg = leg->mNext) { + for (CellLeg* leg = mLeg; leg != nullptr; leg = leg->mNext) { if (leg->mObject->mPassID != passID) { leg->mObject->mPassID = passID; delegate->invoke(leg->mObject); @@ -503,7 +503,7 @@ int CollisionBuffer::findIndex(CellObject* object) inline void CellLayer::resolveCollision() { for (int i = 0; i < mSizeX * mSizeY; ++i) { - if (mCells[i]._1C) { + if (mCells[i].mLeg) { mCells[i].resolveCollision(); } } @@ -597,8 +597,8 @@ inline void Cell::rec_resolveColl() void Cell::clearAllCollBuffer() { // UNUSED FUNCTION - // if (_1C ) { - for (CellLeg* leg = _1C; leg != nullptr; leg = leg->mNext) { + // if (mLeg ) { + for (CellLeg* leg = mLeg; leg != nullptr; leg = leg->mNext) { if (leg->mObject) { leg->mObject->mCollisionBuffer.clear(); } @@ -620,7 +620,7 @@ void CellLayer::clearAllCollBuffer() { // UNUSED FUNCTION for (int i = 0; i < mSizeX * mSizeY; i++) { - if (mCells[i]._1C) { + if (mCells[i].mLeg) { mCells[i].clearAllCollBuffer(); } } @@ -669,10 +669,10 @@ inline void Cell::remove() */ inline void Cell::exit(CellLeg* aLeg, bool p2) { - if (_1C == aLeg) { - _1C = aLeg->mNext; - if (_1C) { - _1C->mPrev = nullptr; + if (mLeg == aLeg) { + mLeg = aLeg->mNext; + if (mLeg) { + mLeg->mPrev = nullptr; } } if ((p2) && (_14 != 0)) { @@ -695,7 +695,7 @@ inline void Cell::exit(CellLeg* aLeg, bool p2) } aLeg->mPrev = nullptr; aLeg->mNext = nullptr; - if ((_1C == nullptr) && (Cell::sCurrCellMgr != nullptr)) { + if ((mLeg == nullptr) && (Cell::sCurrCellMgr != nullptr)) { P2ASSERTLINE(786, Cell::sCurrCellMgr != nullptr); if (_24) { _24->_20 = _20; @@ -720,7 +720,7 @@ void Cell::entry(CellLeg* leg, bool p2) leg->mCell->exit(leg, p2); } CellLeg* nextLeg; - CellLeg* currLeg = _1C; + CellLeg* currLeg = mLeg; if (currLeg) { if (currLeg != leg) { nextLeg = currLeg->mNext; @@ -732,13 +732,13 @@ void Cell::entry(CellLeg* leg, bool p2) } } } else { - _1C = leg; - _1C->mNext = nullptr; - _1C->mPrev = nullptr; + mLeg = leg; + mLeg->mNext = nullptr; + mLeg->mPrev = nullptr; } leg->mCell = this; - bool legCheck = _1C->findLeg(leg); + bool legCheck = mLeg->findLeg(leg); if (!legCheck) { JUT_PANICLINE(855, "leg entry failed !\n"); } @@ -1501,11 +1501,11 @@ void CellPyramid::entry(CellObject* param_1, Sys::Sphere& param_2, int& param_3, // Cell* cell = param_1->mCellLegs.arrayView[iVar9].mCell; // if (cell) { // cell->exit(¶m_1->mCellLegs.arrayView[iVar9], bVar5); - // // if (cell->_1C == ¶m_1.mCellLegs.arrayView[iVar9]) { - // // cell->_1C = + // // if (cell->mLeg == ¶m_1.mCellLegs.arrayView[iVar9]) { + // // cell->mLeg = // // param_1.mCellLegs.arrayView[iVar9].mNext; if - // // (cell->_1C - // // ) { cell->_1C->mPrev = nullptr; + // // (cell->mLeg + // // ) { cell->mLeg->mPrev = nullptr; // // } // // } // // if ((bVar5) && (cell->_14 != 0)) { @@ -1530,7 +1530,7 @@ void CellPyramid::entry(CellObject* param_1, Sys::Sphere& param_2, int& param_3, // // } // // param_1.mCellLegs.arrayView[iVar9].mPrev = nullptr; // // param_1.mCellLegs.arrayView[iVar9].mNext = nullptr; - // // if ((cell->_1C == nullptr) && + // // if ((cell->mLeg == nullptr) && // // (Cell::sCurrCellMgr != nullptr)) { // // if (Cell::sCurrCellMgr == nullptr) { // // // #ifdef MATCHING @@ -1566,7 +1566,7 @@ void CellPyramid::entry(CellObject* param_1, Sys::Sphere& param_2, int& param_3, // if (3 < iVar9) // goto LAB_801589e8; // cell->entry(param_1.mCellLegs.arrayView, SUB41((uint)-iVar12 >> 0x1f, 0)); - // for (pCVar6 = cell->_1C; pCVar6 != (CellLeg*)0x0; pCVar6 = pCVar6->pNext) { + // for (pCVar6 = cell->mLeg; pCVar6 != (CellLeg*)0x0; pCVar6 = pCVar6->pNext) { // if (pCVar6 == param_1->mCellLegs) { // bVar5 = true; // goto LAB_80158994; @@ -2321,14 +2321,14 @@ inline void CellPyramid::dumpCount(int&, int&) */ void Cell::resolveCollision_2() { - for (CellLeg* legA = _1C; legA != nullptr; legA = legA->mNext) { + for (CellLeg* legA = mLeg; legA != nullptr; legA = legA->mNext) { for (CellLeg* legB = legA->mNext; legB != nullptr; legB = legB->mNext) { if (legA->mObject->collisionUpdatable()) { legA->mObject->checkCollision(legB->mObject); } } for (Cell* cell = _10; cell != nullptr; cell = cell->_10) { - for (CellLeg* legB = cell->_1C; legB != nullptr; legB = legB->mNext) { + for (CellLeg* legB = cell->mLeg; legB != nullptr; legB = legB->mNext) { if (legA->mObject->collisionUpdatable()) { legA->mObject->checkCollision(legB->mObject); } @@ -2344,7 +2344,7 @@ void Cell::resolveCollision_2() */ void Cell::resolveCollision_1() { - for (CellLeg* legA = _1C; legA != nullptr; legA = legA->mNext) { + for (CellLeg* legA = mLeg; legA != nullptr; legA = legA->mNext) { for (CellLeg* legB = legA->mNext; legB != nullptr; legB = legB->mNext) { // TODO: What is going on with mPassID? if ((legA->mObject != legB->mObject) && (legB->mObject->mPassID != (u32)legA->mObject)) { @@ -2353,7 +2353,7 @@ void Cell::resolveCollision_1() } } for (Cell* cell = _10; cell != nullptr; cell = cell->_10) { - for (CellLeg* legB = cell->_1C; legB != nullptr; legB = legB->mNext) { + for (CellLeg* legB = cell->mLeg; legB != nullptr; legB = legB->mNext) { // TODO: What is going on with mPassID? if ((legA->mObject != legB->mObject) && (legB->mObject->mPassID != (u32)legA->mObject)) { legB->mObject->mPassID = (u32)legA->mObject; @@ -2371,7 +2371,7 @@ void Cell::resolveCollision_1() */ void Cell::resolveCollision_3() { - for (CellLeg* legA = _1C; legA != nullptr; legA = legA->mNext) { + for (CellLeg* legA = mLeg; legA != nullptr; legA = legA->mNext) { if (legA->mObject->collisionUpdatable() == false) { CellObject* legAObject = legA->mObject; if (legAObject->mPassID != Game::cellMgr->mPassID) { @@ -2394,7 +2394,7 @@ void Cell::resolveCollision_3() } } for (Cell* cell = _10; cell != nullptr; cell = cell->_10) { - for (CellLeg* legB = cell->_1C; legB != nullptr; legB = legB->mNext) { + for (CellLeg* legB = cell->mLeg; legB != nullptr; legB = legB->mNext) { if (legA->mObject != legB->mObject) { if (*CellMgrParms::getInstance()->mCellParms.mP001()) { if ((CellObject*)legA->mObject->mPassID != legB->mObject) { diff --git a/src/plugProjectNishimuraU/BigTreasure.cpp b/src/plugProjectNishimuraU/BigTreasure.cpp index 1cd5daf78..bbb75d82a 100644 --- a/src/plugProjectNishimuraU/BigTreasure.cpp +++ b/src/plugProjectNishimuraU/BigTreasure.cpp @@ -360,7 +360,7 @@ bool Obj::isAttackLimitTime() Sys::Sphere sphere(mPosition, 300.0f); CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg); diff --git a/src/plugProjectNishimuraU/BigTreasureAttack.cpp b/src/plugProjectNishimuraU/BigTreasureAttack.cpp index f8ec7926f..657c62dac 100644 --- a/src/plugProjectNishimuraU/BigTreasureAttack.cpp +++ b/src/plugProjectNishimuraU/BigTreasureAttack.cpp @@ -102,7 +102,7 @@ bool BigTreasureFireAttack::update() Sys::Sphere sphere(pos, 25.0f); CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg); diff --git a/src/plugProjectNishimuraU/ElecHiba.cpp b/src/plugProjectNishimuraU/ElecHiba.cpp index a18733d1c..952cd7e67 100644 --- a/src/plugProjectNishimuraU/ElecHiba.cpp +++ b/src/plugProjectNishimuraU/ElecHiba.cpp @@ -301,7 +301,7 @@ void Obj::interactDenkiAttack(Vector3f& position) // also some other constants pulled from parms CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg); diff --git a/src/plugProjectNishimuraU/Fart.cpp b/src/plugProjectNishimuraU/Fart.cpp index 61fd0daee..c5eb9fb02 100644 --- a/src/plugProjectNishimuraU/Fart.cpp +++ b/src/plugProjectNishimuraU/Fart.cpp @@ -93,7 +93,7 @@ void Obj::interactFartGasAttack() sphere.mRadius = parms->mGeneral.mAttackRadius.mValue; CellIteratorArg arg(sphere); - arg._1C = true; + arg.mIgnoreOverlap = true; CellIterator iterator(arg); CI_LOOP(iterator) diff --git a/src/plugProjectNishimuraU/Fuefuki.cpp b/src/plugProjectNishimuraU/Fuefuki.cpp index 5e91e02ed..94eafbf98 100644 --- a/src/plugProjectNishimuraU/Fuefuki.cpp +++ b/src/plugProjectNishimuraU/Fuefuki.cpp @@ -465,7 +465,7 @@ bool Obj::isJumpAway() f32 privateDiameter = privRad * privRad; CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg); diff --git a/src/plugProjectNishimuraU/GasHiba.cpp b/src/plugProjectNishimuraU/GasHiba.cpp index 3714df976..edf5a749b 100644 --- a/src/plugProjectNishimuraU/GasHiba.cpp +++ b/src/plugProjectNishimuraU/GasHiba.cpp @@ -168,7 +168,7 @@ void Obj::interactGasAttack() sphere.mRadius = parms->mGeneral.mAttackRadius.mValue; CellIteratorArg arg(sphere); - arg._1C = true; + arg.mIgnoreOverlap = true; CellIterator iterator(arg); CI_LOOP(iterator) diff --git a/src/plugProjectNishimuraU/Hiba.cpp b/src/plugProjectNishimuraU/Hiba.cpp index ab6598885..eeb88caab 100644 --- a/src/plugProjectNishimuraU/Hiba.cpp +++ b/src/plugProjectNishimuraU/Hiba.cpp @@ -159,7 +159,7 @@ void Obj::interactFireAttack() sphere.mRadius = parms->mGeneral.mAttackRadius.mValue; CellIteratorArg arg(sphere); - arg._1C = true; + arg.mIgnoreOverlap = true; CellIterator iterator(arg); CI_LOOP(iterator) diff --git a/src/plugProjectNishimuraU/Kabuto.cpp b/src/plugProjectNishimuraU/Kabuto.cpp index f60e9df9e..a2e049287 100644 --- a/src/plugProjectNishimuraU/Kabuto.cpp +++ b/src/plugProjectNishimuraU/Kabuto.cpp @@ -234,7 +234,7 @@ bool Obj::isAttackableTarget() sphere.mPosition = pos; CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg); CI_LOOP(iter) { diff --git a/src/plugProjectNishimuraU/OniKurage.cpp b/src/plugProjectNishimuraU/OniKurage.cpp index a3ec6f56c..e940921ef 100644 --- a/src/plugProjectNishimuraU/OniKurage.cpp +++ b/src/plugProjectNishimuraU/OniKurage.cpp @@ -491,7 +491,7 @@ Creature* Obj::getSearchedTarget(f32 offset) Sys::Sphere sphere(mPosition, *C_PARMS->mGeneral.mTerritoryRadius()); CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg); CI_LOOP(iter) @@ -775,7 +775,7 @@ bool Obj::isSuck(f32 offset, Creature* target) } else { Sys::Sphere sphere(mPosition, *C_PARMS->mGeneral.mMaxAttackRange()); CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg); CI_LOOP(iter) diff --git a/src/plugProjectNishimuraU/OtakaraBase.cpp b/src/plugProjectNishimuraU/OtakaraBase.cpp index 73abea7ef..b56031b90 100644 --- a/src/plugProjectNishimuraU/OtakaraBase.cpp +++ b/src/plugProjectNishimuraU/OtakaraBase.cpp @@ -609,7 +609,7 @@ void Obj::attackTarget() sphere.mRadius = radius; CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg); CI_LOOP(iter) diff --git a/src/plugProjectNishimuraU/Queen.cpp b/src/plugProjectNishimuraU/Queen.cpp index 2ba670188..c0cfc3a44 100644 --- a/src/plugProjectNishimuraU/Queen.cpp +++ b/src/plugProjectNishimuraU/Queen.cpp @@ -47,7 +47,7 @@ void Obj::onInit(CreatureInitArg* initArg) disableEvent(0, EB_PlatformCollEnabled); disableEvent(0, EB_Cullable); mNextState = QUEEN_NULL; - _2C2 = 0; + mIsRolling = false; mWaitTimer = 0.0f; mIsRoomForLarva = false; mBirthTimer = 0.0f; @@ -55,8 +55,8 @@ void Obj::onInit(CreatureInitArg* initArg) resetJointShadow(); mShadowMgr->init(); setupEffect(); - _2C4 = 0; - _2C5 = 0; + mIsAppearBGM = false; + mIsAttackLoopBGM = false; resetMidBossAppearBGM(); mMatLoopAnimator->start(C_MGR->mTexAnimation); @@ -88,7 +88,7 @@ void Obj::onKill(CreatureKillArg* killArg) void Obj::setParameters() { mCanCreateLarva = true; - _2C3 = 0; + mDoEasyRoll = false; if (gameSystem) { if (gameSystem->mMode == GSM_PIKLOPEDIA) { @@ -98,7 +98,7 @@ void Obj::setParameters() SingleGameSection* section = static_cast(gameSystem->mSection); if (section && section->getCaveID() == 'f_01') { // if in Hole of Beasts mCanCreateLarva = false; - _2C3 = 1; + mDoEasyRoll = true; C_PARMS->mGeneral.mHealth.mValue = C_PROPERPARMS.mHoBHealth.mValue; } } @@ -239,7 +239,7 @@ void Obj::doFinishStoneState() int stateID = getStateID(); if (stateID == QUEEN_Damage) { startDamageEffect(); - } else if (stateID == QUEEN_Rolling && _2C2) { + } else if (stateID == QUEEN_Rolling && mIsRolling) { startRollingEffect(); } @@ -253,7 +253,7 @@ void Obj::doFinishStoneState() */ bool Obj::ignoreAtari(Creature* creature) { - if (_2C2 && !isEvent(0, EB_Bittered) && (creature->isNavi() || creature->isTeki())) { + if (mIsRolling && !isEvent(0, EB_Bittered) && (creature->isNavi() || creature->isTeki())) { return true; } @@ -298,7 +298,7 @@ void Obj::rollingAttack() Sys::Sphere sphere(mPosition, 250.0f); CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg); CI_LOOP(iter) @@ -360,9 +360,9 @@ void Obj::flickPikmin(f32 angle) */ bool Obj::isRollingAttackLeft() { - if (_2C3) { - _2C3 = 0; - Navi* navi = naviMgr->getActiveNavi(); + if (mDoEasyRoll) { + mDoEasyRoll = false; + Navi* navi = naviMgr->getActiveNavi(); if (navi) { f32 angle = HALF_PI + getFaceDir(); Vector3f angles = Vector3f(pikmin2_sinf(angle), 0.0f, pikmin2_cosf(angle)); @@ -742,8 +742,8 @@ void Obj::startBossChargeBGM() */ void Obj::startBossAttackLoopBGM() { - if (!_2C5) { - _2C5 = 1; + if (!mIsAttackLoopBGM) { + mIsAttackLoopBGM = true; PSM::EnemyBoss* soundObj = static_cast(mSoundObj); PSM::checkBoss(soundObj); soundObj->jumpRequest(8); @@ -757,8 +757,8 @@ void Obj::startBossAttackLoopBGM() */ void Obj::finishBossAttackLoopBGM() { - if (_2C5) { - _2C5 = 0; + if (mIsAttackLoopBGM) { + mIsAttackLoopBGM = false; PSM::EnemyBoss* soundObj = static_cast(mSoundObj); PSM::checkBoss(soundObj); soundObj->jumpRequest(1); @@ -772,7 +772,7 @@ void Obj::finishBossAttackLoopBGM() */ void Obj::startStoneStateBossAttackLoopBGM() { - if (_2C5) { + if (mIsAttackLoopBGM) { PSM::EnemyBoss* soundObj = static_cast(mSoundObj); PSM::checkBoss(soundObj); soundObj->jumpRequest(1); @@ -786,7 +786,7 @@ void Obj::startStoneStateBossAttackLoopBGM() */ void Obj::finishStoneStateBossAttackLoopBGM() { - if (_2C5) { + if (mIsAttackLoopBGM) { PSM::EnemyBoss* soundObj = static_cast(mSoundObj); PSM::checkBoss(soundObj); soundObj->jumpRequest(8); @@ -821,7 +821,7 @@ void Obj::resetMidBossAppearBGM() PSM::checkMidBoss(soundObj); soundObj->setAppearFlag(false); if (mCanCreateLarva) { - _2C4 = 1; + mIsAppearBGM = true; soundObj->_118 = 1; } } @@ -834,8 +834,8 @@ void Obj::resetMidBossAppearBGM() */ void Obj::setMidBossAppearBGM() { - if (!_2C4) { - _2C4 = 1; + if (!mIsAppearBGM) { + mIsAppearBGM = true; PSM::EnemyMidBoss* soundObj = static_cast(mSoundObj); PSM::checkMidBoss(soundObj); soundObj->setAppearFlag(true); diff --git a/src/plugProjectNishimuraU/QueenState.cpp b/src/plugProjectNishimuraU/QueenState.cpp index 44718323b..378231940 100644 --- a/src/plugProjectNishimuraU/QueenState.cpp +++ b/src/plugProjectNishimuraU/QueenState.cpp @@ -72,11 +72,11 @@ void StateDead::cleanup(EnemyBase* enemy) { } */ void StateSleep::init(EnemyBase* enemy, StateArg* stateArg) { - Obj* queen = static_cast(enemy); - queen->mNextState = QUEEN_NULL; - queen->_2C5 = 0; - queen->mWaitTimer = 0.0f; - queen->_2D0 = queen->mToFlick; + Obj* queen = static_cast(enemy); + queen->mNextState = QUEEN_NULL; + queen->mIsAttackLoopBGM = false; + queen->mWaitTimer = 0.0f; + queen->_2D0 = queen->mToFlick; queen->hardConstraintOn(); queen->mTargetVelocity = Vector3f(0.0f); queen->startMotion(1, nullptr); @@ -139,11 +139,11 @@ void StateSleep::cleanup(EnemyBase* enemy) */ void StateWait::init(EnemyBase* enemy, StateArg* stateArg) { - Obj* queen = static_cast(enemy); - queen->mNextState = QUEEN_NULL; - queen->_2C5 = 0; - queen->mWaitTimer = 0.0f; - queen->_2D0 = queen->mToFlick; + Obj* queen = static_cast(enemy); + queen->mNextState = QUEEN_NULL; + queen->mIsAttackLoopBGM = false; + queen->mWaitTimer = 0.0f; + queen->_2D0 = queen->mToFlick; queen->hardConstraintOn(); queen->mTargetVelocity = Vector3f(0.0f); queen->startMotion(2, nullptr); @@ -203,10 +203,10 @@ void StateWait::cleanup(EnemyBase* enemy) { enemy->hardConstraintOff(); } */ void StateDamage::init(EnemyBase* enemy, StateArg* stateArg) { - Obj* queen = static_cast(enemy); - queen->mNextState = QUEEN_NULL; - queen->_2C5 = 0; - queen->mWaitTimer = 0.0f; + Obj* queen = static_cast(enemy); + queen->mNextState = QUEEN_NULL; + queen->mIsAttackLoopBGM = false; + queen->mWaitTimer = 0.0f; queen->startDamageEffect(); queen->hardConstraintOn(); queen->mTargetVelocity = Vector3f(0.0f); @@ -268,10 +268,10 @@ void StateDamage::cleanup(EnemyBase* enemy) */ void StateFlick::init(EnemyBase* enemy, StateArg* stateArg) { - Obj* queen = static_cast(enemy); - queen->mNextState = QUEEN_NULL; - queen->_2C5 = 0; - queen->mWaitTimer = 0.0f; + Obj* queen = static_cast(enemy); + queen->mNextState = QUEEN_NULL; + queen->mIsAttackLoopBGM = false; + queen->mWaitTimer = 0.0f; queen->createFlickEffect(); queen->hardConstraintOn(); queen->mTargetVelocity = Vector3f(0.0f); @@ -323,7 +323,7 @@ void StateRolling::init(EnemyBase* enemy, StateArg* stateArg) { Obj* queen = static_cast(enemy); queen->mNextState = QUEEN_NULL; - queen->_2C2 = 0; + queen->mIsRolling = false; queen->mTargetVelocity = Vector3f(0.0f); queen->setEmotionExcitement(); RollingStateArg* arg = static_cast(stateArg); @@ -342,7 +342,7 @@ void StateRolling::init(EnemyBase* enemy, StateArg* stateArg) void StateRolling::exec(EnemyBase* enemy) { Obj* queen = static_cast(enemy); - if (static_cast(enemy)->_2C2 != 0) { + if (static_cast(enemy)->mIsRolling) { f32 initAngle; if (queen->getCurrAnimIndex() == 5) { @@ -388,7 +388,7 @@ void StateRolling::exec(EnemyBase* enemy) if (queen->mHealth <= 0.0f) { queen->mNextState = QUEEN_Dead; - queen->_2C2 = 0; + queen->mIsRolling = false; queen->mTargetVelocity = Vector3f(0.0f); queen->finishMotion(); @@ -421,33 +421,33 @@ void StateRolling::exec(EnemyBase* enemy) } if (dotProd > territory) { - if (queen->_2C2 != 0) { + if (queen->mIsRolling) { queen->createCrashFallRock(); Vector3f anotherPos = queen->getPosition(); cameraMgr->startVibration(27, anotherPos, 2); rumbleMgr->startRumble(15, anotherPos, 2); } - queen->_2C2 = 0; + queen->mIsRolling = false; queen->mNextState = QUEEN_Rolling; queen->finishMotion(); queen->finishRollingEffect(true); queen->getJAIObject()->startSound(PSSE_EN_QUEEN_CRUSH, 0); } else if ((queen->mWaitTimer > CG_PROPERPARMS(queen).mRollingTime.mValue) && (dotProd > homeRad) && (dotProd < 50.0f)) { - if (queen->_2C2 != 0) { + if (queen->mIsRolling) { queen->finishBossAttackLoopBGM(); } - queen->_2C2 = 0; + queen->mIsRolling = false; queen->mNextState = QUEEN_Wait; queen->finishMotion(); queen->finishRollingEffect(false); } } else if ((u32)queen->mCurAnim->mType == 0) { - if (queen->_2C2 == 0) { - queen->_2C2 = 1; + if (!queen->mIsRolling) { + queen->mIsRolling = true; queen->startRollingEffect(); queen->startBossAttackLoopBGM(); @@ -893,9 +893,9 @@ void StateRolling::cleanup(EnemyBase* enemy) Obj* queen = static_cast(enemy); queen->setEmotionCaution(); queen->forceFinishRollingEffect(); - queen->mToFlick = 0.0f; - queen->_2D0 = 0.0f; - queen->_2C2 = 0; + queen->mToFlick = 0.0f; + queen->_2D0 = 0.0f; + queen->mIsRolling = false; } /* @@ -905,10 +905,10 @@ void StateRolling::cleanup(EnemyBase* enemy) */ void StateBorn::init(EnemyBase* enemy, StateArg* stateArg) { - Obj* queen = static_cast(enemy); - queen->mNextState = QUEEN_NULL; - queen->_2C5 = 0; - queen->mWaitTimer = 0.0f; + Obj* queen = static_cast(enemy); + queen->mNextState = QUEEN_NULL; + queen->mIsAttackLoopBGM = false; + queen->mWaitTimer = 0.0f; queen->hardConstraintOn(); queen->mTargetVelocity = Vector3f(0.0f); queen->startMotion(7, nullptr); diff --git a/src/plugProjectNishimuraU/Tank.cpp b/src/plugProjectNishimuraU/Tank.cpp index 148fc7125..9bdc85962 100644 --- a/src/plugProjectNishimuraU/Tank.cpp +++ b/src/plugProjectNishimuraU/Tank.cpp @@ -289,7 +289,7 @@ bool Obj::isAttackable(bool check) sphere.mRadius = halfRatio; CellIteratorArg iterArg(sphere); - iterArg._1C = 1; + iterArg.mIgnoreOverlap = true; CellIterator iter(iterArg);