diff options
Diffstat (limited to 'src/bossRamboo.cpp')
-rw-r--r-- | src/bossRamboo.cpp | 121 |
1 files changed, 93 insertions, 28 deletions
diff --git a/src/bossRamboo.cpp b/src/bossRamboo.cpp index 3ed947d..08a04f7 100644 --- a/src/bossRamboo.cpp +++ b/src/bossRamboo.cpp @@ -35,7 +35,8 @@ class daRamboo_c : public dEn_c { u64 eventFlag; - + dEn_c *Kameck; + static daRamboo_c *build(); void bindAnimChr_and_setUpdateRates(const char* name, m3d::anmChr_c animationChr, m3d::mdl_c model, float rate); @@ -47,6 +48,9 @@ class daRamboo_c : public dEn_c { bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther); + void collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther); + void collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther); + USING_STATES(daRamboo_c); DECLARE_STATE(Grow); @@ -68,6 +72,14 @@ extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daRamboo_c extern "C" dStageActor_c *GetSpecificPlayerActor(int number); extern "C" void *PlaySound(daRamboo_c *, int soundID); +extern "C" void *StopBGMMusic(); +extern "C" void *StartBGMMusic(); + +extern "C" void *MakeMarioEnterDemoMode(); +extern "C" void *MakeMarioExitDemoMode(); +extern "C" void *UpdateGameMgr(); + + CREATE_STATE(daRamboo_c, Grow); CREATE_STATE(daRamboo_c, Advance); @@ -85,15 +97,21 @@ extern EventTable_t *EventTable; void daRamboo_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { + this->dEn_c::playerCollision(apThis, apOther); this->_vf220(apOther->owner); - OSReport("I hit Mario."); + + this->isDead = 0; + this->flags_4FC |= (1<<(31-7)); + if(apOther->owner->which_player < 4) { + this->counter_504[apOther->owner->which_player] = 0; + } } void daRamboo_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Fireball"); CreateEffect(378, &apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5}); this->pos.x += 6.0; } -bool daRamboo_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Iceball"); return false; } +bool daRamboo_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { return false; } void daRamboo_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Rolling Object"); @@ -106,7 +124,10 @@ void daRamboo_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysic apOther->owner->Delete(apOther->owner->_390); } } -void daRamboo_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Hammer"); } +void daRamboo_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { } +void daRamboo_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { } +void daRamboo_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) { } + @@ -252,12 +273,12 @@ int daRamboo_c::onExecute() { if(this->fogSrt.isEntryAnimationDone(0)) this->fogSrt.setFrameForEntry(1.0, 0); - if (this->aPhysics.result1 == 1) { - char PlayerID = NearestPlayer(this); - dStageActor_c *Player = GetSpecificPlayerActor(PlayerID); + // if (this->aPhysics.result1 == 1) { + // char PlayerID = NearestPlayer(this); + // dStageActor_c *Player = GetSpecificPlayerActor(PlayerID); - this->_vf220(Player); - } + // this->_vf220(Player); + // } if (EventTable->events & this->eventFlag) { doStateChange(&StateID_Outro); @@ -304,41 +325,76 @@ void daRamboo_c::updateModelMatrices() { void daRamboo_c::beginState_Grow() { OSReport("Growing when Kameck Tells me to."); this->timer = 0; -// PlaySound(this, SE_BOSS_ROY_MAGIC_MAKE_FAST); + // Stop the BGM Music + StopBGMMusic(); + + // Set the necessary Flags and make Mario enter Demo Mode + dStage32C_c::instance->freezeMarioBossFlag = 1; + WLClass::instance->_4 = 4; + WLClass::instance->_8 = 0; + + MakeMarioEnterDemoMode(); + + // Make sure to use the correct position + Vec pos = (Vec){this->pos.x - 124.0, this->pos.y + 104.0, 3564.0}; + S16Vec rot = (S16Vec){0, 0, 0}; + + // Create And use Kameck + Kameck = (daKameckDemo*)createChild(KAMECK_FOR_CASTLE_DEMO, (dStageActor_c*)this, 0, &pos, &rot, 0); + Kameck->doStateChange(&daKameckDemo::StateID_DemoWait); } void daRamboo_c::executeState_Grow() { + + if (this->timer == 130) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt); } + if (this->timer == 400) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt2); } this->timer = this->timer + 1; float scaleSpeed, yPosScaling; + + if (this->timer == 150) { PlaySound(this, SE_BOSS_IGGY_WANWAN_TO_L); } - if (this->timer == 60) { PlaySound(this, SE_BOSS_IGGY_WANWAN_TO_L); } - if ((this->timer > 60) && (this->timer < 140)) { + if ((this->timer > 150) && (this->timer < 230)) { + scaleSpeed = 0.175; -// yPosScaling = 0; float modifier; - modifier = 2.0 + ((this->timer - 60) * scaleSpeed); + modifier = 1.0 + ((this->timer - 150) * scaleSpeed); this->scale = (Vec){modifier, modifier, modifier}; -// this->pos.y = this->pos.y + (yPosScaling/80); } + + if (this->timer == 360) { + Vec tempPos = (Vec){this->pos.x - 40.0, this->pos.y + 120.0, 3564.0}; + CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 175); // 400 & 401 // 564 // 583 // 754 // 958 + CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 400); // 400 & 401 // 564 // 583 // 754 // 958 + CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 401); // 400 & 401 // 564 // 583 // 754 // 958 + CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 564); // 400 & 401 // 564 // 583 // 754 // 958 + CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 583); // 400 & 401 // 564 // 583 // 754 // 958 + CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 754); // 400 & 401 // 564 // 583 // 754 // 958 + CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 958); // 400 & 401 // 564 // 583 // 754 // 958 + } - if (this->timer > 170) { + if (this->timer > 420) { PlaySound(this, SE_EMY_CS_TERESA_BRING_IT); doStateChange(&StateID_Advance); - } - + } } void daRamboo_c::endState_Grow() { this->Baseline = this->pos.y; -// StopSound(SE_BOSS_ROY_MAGIC_MAKE_FAST); - OSReport("OK. All grown up now."); + // Clean up the flags and Kameck + dStage32C_c::instance->freezeMarioBossFlag = 0; + WLClass::instance->_8 = 1; + + MakeMarioExitDemoMode(); + StartBGMMusic(); + + Kameck->Delete(1); } @@ -348,7 +404,6 @@ void daRamboo_c::endState_Grow() { // Advance State void daRamboo_c::beginState_Advance() { - OSReport("Charge!"); this->speed.y = 0; this->speed.z = 0; this->timer = 0; @@ -379,7 +434,7 @@ void daRamboo_c::executeState_Advance() { this->ytimer += 1; } -void daRamboo_c::endState_Advance() { OSReport("Ouch. Stop Charging."); } +void daRamboo_c::endState_Advance() { } @@ -389,7 +444,6 @@ void daRamboo_c::endState_Advance() { OSReport("Ouch. Stop Charging."); } void daRamboo_c::beginState_Wait() { - OSReport("Waiting"); this->timer = 0; PlaySound(this, SE_EMY_TERESA_STOP); @@ -439,8 +493,7 @@ void daRamboo_c::endState_Wait() { this->anmShayA.bind(&this->bodyModel, anmChr, 1); this->bodyModel.bindAnim(&this->anmShayA, 0.0); this->anmShayA.setUpdateRate(1.0); - - OSReport("No more bouncing."); } +} @@ -450,7 +503,6 @@ void daRamboo_c::endState_Wait() { void daRamboo_c::beginState_Flee() { - OSReport("Damnit that hurt."); this->timer = 0; } @@ -478,8 +530,6 @@ void daRamboo_c::executeState_Flee() { } void daRamboo_c::endState_Flee() { - - OSReport("Ugh, so dizzy."); } @@ -487,15 +537,29 @@ void daRamboo_c::endState_Flee() { void daRamboo_c::beginState_Outro() { + nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("shay_teresaB_wait"); + this->anmWaitB.bind(&this->hideModel, anmChr, 1); + this->hideModel.bindAnim(&this->anmWaitB, 0.0); + this->anmWaitB.setUpdateRate(1.0); + this->removeMyActivePhysics(); this->timer = 0; this->rot.x = 0x0; // X is vertical axis this->rot.y = 0xE000; // Y is horizontal axis this->rot.z = 0x0; // Z is ... an axis >.> + StopBGMMusic(); + + WLClass::instance->_4 = 5; + WLClass::instance->_8 = 0; + dStage32C_c::instance->freezeMarioBossFlag = 1; + } void daRamboo_c::executeState_Outro() { + if (this->anmWaitB.isAnimationDone()) + this->anmWaitB.setCurrentFrame(0.0); + if (this->dying == 1) { if (this->timer > 180) { ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE); @@ -561,6 +625,7 @@ void daRamboo_c::executeState_Outro() { this->timer = 0; PlaySound(this, STRM_BGM_SHIRO_BOSS_CLEAR); + MakeMarioEnterDemoMode(); } this->timer += 1; |