diff --git a/src/Camera/CameraJetCoaster.cpp b/src/Camera/CameraJetCoaster.cpp index c379f86a3..37446399a 100644 --- a/src/Camera/CameraJetCoaster.cpp +++ b/src/Camera/CameraJetCoaster.cpp @@ -20,7 +20,6 @@ // rogue includes needed for matching sinit & bss #include #include -#include // NOTE: it is weak but I don't want to put it in the header since it's pretty // big and only used in one function. Also, dunno even if the size is correct diff --git a/src/Enemy/bossgesso.cpp b/src/Enemy/bossgesso.cpp index 7ff4572a0..d2f6a017a 100644 --- a/src/Enemy/bossgesso.cpp +++ b/src/Enemy/bossgesso.cpp @@ -7,12 +7,15 @@ #include #include #include +#include #include #include #include #include #include #include +#include +#include #include #include #include @@ -726,7 +729,10 @@ f32 TBossGesso::inSight() BOOL TBossGesso::is2ndFightNow() const { - return gpMarDirector->unk7D == 4 ? true : false; + if (gpMarDirector->unk7D == 4) + return TRUE; + + return FALSE; } void TBossGesso::stopIfRoll() @@ -918,7 +924,7 @@ void TBossGesso::doAttackSingle() JGeometry::TVec3 delta = SMS_GetMarioPos(); - if (SMS_GetMarioPos().y + 20.0f < mPosition.y) + if (delta.y + 20.0f < mPosition.y) return; delta -= mPosition; @@ -1246,7 +1252,205 @@ void TBossGesso::calcRootMatrix() void TBossGesso::performInContainer(u32, JDrama::TGraphics*) { } -void TBossGesso::perform(u32 cue, JDrama::TGraphics* graphics) { } +void TBossGesso::perform(u32 cue, JDrama::TGraphics* graphics) +{ + if (cue & CUE_CALC_ANIM) { + if (mBeak->getHolder() != nullptr || tentacleHeld()) { + if (gpMarioOriginal->mIntendedMag > 0.1f) { + SMSGetMSound()->startSoundActor(MSD_SE_BS_GESO_PULL, &mPosition, + 0, nullptr, 0, 4); + } + } + } + + if (cue & CUE_MOVE) { + if (!unk1A0 && !is2ndFightNow() && mAttackMode == 6) { + JGeometry::TVec3 toMario = SMS_GetMarioPos(); + toMario.x -= mPosition.x; + toMario.y -= mPosition.y; + toMario.z -= mPosition.z; + + if (toMario.x * toMario.x + toMario.y * toMario.y + + toMario.z * toMario.z + < 4000000.0f) { + unk19C++; + if (unk19C >= 1200) { + showMessage(0xE0004); + unk1A0 = 1; + } + } + } + + if (mBeak->getHolder() != nullptr + && mTimeInCurrentAttackMode % 4 == 0) { + rumblePad(1, mBeak->mPosition); + } + + if (unk1AC > 0) + unk1AC--; + + if (unk1AE > 0) + unk1AE--; + } + + if (mAttackMode == 6) { + if (cue & CUE_CALC_ANIM) { + if (JDrama::TNameRefGen::search("container") + == nullptr) { + changeAttackMode(0); + } else if (mTentacles[0]->mState != 4) { + JGeometry::TVec3 pos(11603.0f, 2114.3f, 2411.4f); + mTentacles[0]->mNodes[0].setPosition(pos); + pos.x = 11510.0f; + mTentacles[0]->mNodes[1].setPosition(pos); + } + } + + mTentacles[0]->testPerform(cue, graphics); + return; + } + + if (cue & CUE_ENTRY) { + if (mSpine->getLatestNerve() == &TNerveBGBeakDamage::theNerve()) { + SMS_AddDamageFogEffect(mMActor->getModel()->getModelData(), + mPosition, graphics); + } else { + SMS_ResetDamageFogEffect(mMActor->getModel()->getModelData()); + } + + // TODO: a virtual call on the model data's material follows here, + // passing unk190 -- slot 0x38, class not pinned down yet. + } + + TSpineEnemy::perform(cue, graphics); + mPolDrop->testPerform(cue, graphics); + + if (mLiveFlag & LIVE_FLAG_DEAD) + return; + + if (cue & CUE_CALC_ANIM) { + if (unk194 > 0) { + gpMarioParticleManager->emitAndBindToMtxPtr( + 0x13B, getModel()->getAnmMtx(0), 1, this); + unk194--; + } + } + + MActor* cork; + if (mCork->unkC == 0) { + cork = mCork->unk4; + if (cue & CUE_CALC_ANIM) { + PSMTXCopy(mCork->mOwner->getModel()->getAnmMtx(27), + mCork->unk4->getModel()->getBaseTRMtx()); + } + } else { + cork = mCork->unk8; + } + + cork->perform(cue, graphics); + + if (cue & CUE_CALC_VIEW) { + TCircleShadowRequest request; + + MtxPtr joint = mMActor->getModel()->getAnmMtx(1); + request.unk0 + = JGeometry::TVec3(joint[0][3], mPosition.y, joint[2][3]); + + JGeometry::TVec3 right(joint[0][0], joint[1][0], joint[2][0]); + JGeometry::TVec3 front(joint[0][2], joint[1][2], joint[2][2]); + + request.unkC = PSVECMag(right); + request.unk10 = PSVECMag(front); + request.unkC *= mScaledBodyRadius; + request.unk10 *= mScaledBodyRadius; + request.unk1C = getShadowType(); + request.unk14 = mRotation.y; + + gpBindShadowManager->request(request, getActorType()); + } + + mBeak->testPerform(cue, graphics); + mLeftEye->testPerform(cue, graphics); + mRightEye->testPerform(cue, graphics); + mBody->testPerform(cue, graphics); + + if (cue & CUE_MOVE) { + mMtxCalc->unk50 -= unk188; + if (mMtxCalc->unk50 < 0.0f) + mMtxCalc->unk50 = 0.0f; + else if (mMtxCalc->unk50 > 1.0f) + mMtxCalc->unk50 = 1.0f; + } + + if (unk17C) { + if (cue & CUE_CALC_ANIM) { + PSMTXCopy(mMActor->getModel()->getBaseTRMtx(), + unk178->getModel()->getBaseTRMtx()); + unk178->calcAnm(); + } + + if (cue & CUE_ENTRY) + gpPollution->stampModel(unk178->getModel()); + } + + if (cue & CUE_CALC_ANIM) { + if (mLiveFlag & LIVE_FLAG_CLIPPED_OUT) { + for (int i = 0; i < TENTACLE_NUM; ++i) { + if (mTentacles[i]->mState != 4) + mTentacles[i]->mNodes[0].setPosition(mPosition); + } + } else { + static const int rootJoints[] = { 2, 3, 5, 6 }; + + for (int i = 0; i < TENTACLE_NUM; ++i) { + if (mTentacles[i]->mState == 4) + continue; + + JGeometry::TVec3 trans; + if (getJointTransByIndex(rootJoints[i], &trans) >= 0) + mTentacles[i]->mNodes[0].setPosition(trans); + } + } + } + + for (int i = 0; i < TENTACLE_NUM; ++i) { + if (cue & CUE_ENTRY) { + if (mSpine->getLatestNerve() == &TNerveBGBeakDamage::theNerve()) { + mTentacles[i]->unk2C->offMakeDL(); + SMS_AddDamageFogEffect( + mTentacles[i]->unk2C->getModel()->getModelData(), mPosition, + graphics); + } else { + SMS_ResetDamageFogEffect( + mTentacles[i]->unk2C->getModel()->getModelData()); + } + } + + mTentacles[i]->testPerform(cue, graphics); + } + + if (cue & CUE_CALC_ANIM) { + if (mMActor->checkCurBckFromIndex(14) + || mMActor->checkCurBckFromIndex(15)) { + f32 len = lenFromToeToMario(); + SMSGetMSound()->startSoundActorWithInfo(MSD_SE_BS_GESO_ROLL, + &mPosition, nullptr, len, 0, + 0, nullptr, 0, 4); + } + } + + if (cue & CUE_MOVE) { + if (mBeak->getHolder() != nullptr && unk190.color.a == 0) { + int left = mTentacles[1]->mState; + int right = mTentacles[3]->mState; + + if (!((left == 4 || left == 6 || left == 3) + && (right == 4 || right == 6 || right == 3))) { + gpMarDirector->mConsole->startAppearBalloon(0xE0003, true); + } + } + } +} TBossGessoManager::TBossGessoManager(const char* name) : TEnemyManager(name) diff --git a/src/GC2D/PauseMenu2.cpp b/src/GC2D/PauseMenu2.cpp index 0d1ea52c8..0b90a4c3f 100644 --- a/src/GC2D/PauseMenu2.cpp +++ b/src/GC2D/PauseMenu2.cpp @@ -33,7 +33,7 @@ extern JPAEmitterManager* gpEmitterManager4D2; // rogue includes needed for matching sinit & bss #include #include -#include +#include // fabricated void TPauseMenu2::draw(JDrama::TGraphics* gfx) diff --git a/src/MSound/MSound.cpp b/src/MSound/MSound.cpp index 62f9efcdd..d56c901c3 100644 --- a/src/MSound/MSound.cpp +++ b/src/MSound/MSound.cpp @@ -23,7 +23,7 @@ #include // rogue -#include +#include // TODO: place in correct header template static inline T min(T a, T b) { return a < b ? a : b; } diff --git a/src/Map/MapEventMare.cpp b/src/Map/MapEventMare.cpp index ae6f2551e..cdb2837c1 100644 --- a/src/Map/MapEventMare.cpp +++ b/src/Map/MapEventMare.cpp @@ -19,7 +19,6 @@ // rogue includes needed for matching sinit & bss #include #include -#include f32 TMareWallRock::mAppearSpeed = 3.0f; f32 TMareWallRock::mDepressSpeed = 3.0f; diff --git a/src/Map/MapWire.cpp b/src/Map/MapWire.cpp index 8cb2b176f..ced7923bd 100644 --- a/src/Map/MapWire.cpp +++ b/src/Map/MapWire.cpp @@ -18,7 +18,7 @@ // rogue includes needed for matching sinit & bss #include #include -#include +#include TMapWirePoint::TMapWirePoint() { diff --git a/src/System/Application.cpp b/src/System/Application.cpp index afc323ea3..f401e4af1 100644 --- a/src/System/Application.cpp +++ b/src/System/Application.cpp @@ -49,7 +49,7 @@ // rogue includes needed for matching sinit & bss #include #include -#include +#include TMarDirector* gpMarDirector; MSound* gpMSound;