Skip to content
1 change: 0 additions & 1 deletion src/Camera/CameraJetCoaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// rogue includes needed for matching sinit & bss
#include <MSound/MSSetSound.hpp>
#include <MSound/MSoundBGM.hpp>
#include <M3DUtil/InfectiousStrings.hpp>

// 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
Expand Down
210 changes: 207 additions & 3 deletions src/Enemy/bossgesso.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
#include <M3DUtil/MActor.hpp>
#include <M3DUtil/MActorAnm.hpp>
#include <Map/Map.hpp>
#include <Map/PollutionManager.hpp>
#include <MoveBG/ItemManager.hpp>
#include <GC2D/GCConsole2.hpp>
#include <Player/Mario.hpp>
#include <Player/MarioAccess.hpp>
#include <Player/ModelWaterManager.hpp>
#include <Camera/CameraShake.hpp>
#include <MarioUtil/DrawUtil.hpp>
#include <MarioUtil/ShadowUtil.hpp>
#include <MarioUtil/TexUtil.hpp>
#include <MarioUtil/MathUtil.hpp>
#include <MarioUtil/RumbleMgr.hpp>
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -918,7 +924,7 @@ void TBossGesso::doAttackSingle()

JGeometry::TVec3<f32> delta = SMS_GetMarioPos();

if (SMS_GetMarioPos().y + 20.0f < mPosition.y)
if (delta.y + 20.0f < mPosition.y)
return;

delta -= mPosition;
Expand Down Expand Up @@ -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<f32> 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<THitActor>("container")
== nullptr) {
changeAttackMode(0);
} else if (mTentacles[0]->mState != 4) {
JGeometry::TVec3<f32> 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<f32>(joint[0][3], mPosition.y, joint[2][3]);

JGeometry::TVec3<f32> right(joint[0][0], joint[1][0], joint[2][0]);
JGeometry::TVec3<f32> 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<f32> 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)
Expand Down
2 changes: 1 addition & 1 deletion src/GC2D/PauseMenu2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern JPAEmitterManager* gpEmitterManager4D2;
// rogue includes needed for matching sinit & bss
#include <MSound/MSSetSound.hpp>
#include <MSound/MSoundBGM.hpp>
#include <M3DUtil/InfectiousStrings.hpp>
#include <System/DummyStrings.hpp>

// fabricated
void TPauseMenu2::draw(JDrama::TGraphics* gfx)
Expand Down
2 changes: 1 addition & 1 deletion src/MSound/MSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <math.h>

// rogue
#include <M3DUtil/InfectiousStrings.hpp>
#include <System/DummyStrings.hpp>

// TODO: place in correct header
template <class T> static inline T min(T a, T b) { return a < b ? a : b; }
Expand Down
1 change: 0 additions & 1 deletion src/Map/MapEventMare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
// rogue includes needed for matching sinit & bss
#include <MSound/MSSetSound.hpp>
#include <MSound/MSoundBGM.hpp>
#include <M3DUtil/InfectiousStrings.hpp>

f32 TMareWallRock::mAppearSpeed = 3.0f;
f32 TMareWallRock::mDepressSpeed = 3.0f;
Expand Down
2 changes: 1 addition & 1 deletion src/Map/MapWire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// rogue includes needed for matching sinit & bss
#include <MSound/MSSetSound.hpp>
#include <MSound/MSoundBGM.hpp>
#include <M3DUtil/InfectiousStrings.hpp>
#include <System/DummyStrings.hpp>

TMapWirePoint::TMapWirePoint()
{
Expand Down
2 changes: 1 addition & 1 deletion src/System/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
// rogue includes needed for matching sinit & bss
#include <MSound/MSSetSound.hpp>
#include <MSound/MSoundBGM.hpp>
#include <M3DUtil/InfectiousStrings.hpp>
#include <System/DummyStrings.hpp>

TMarDirector* gpMarDirector;
MSound* gpMSound;
Expand Down
Loading