From 59624313e01ef4269f2ca27babe522d407e200b0 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Fri, 9 Mar 2012 01:40:14 -0600 Subject: Redid all the boss and custom sprite junk, effect list, saved 25 kb - but bosses break --- src/bossTopman.cpp | 196 +++++++---------------------------------------------- 1 file changed, 24 insertions(+), 172 deletions(-) (limited to 'src/bossTopman.cpp') diff --git a/src/bossTopman.cpp b/src/bossTopman.cpp index a52c66b..625e957 100644 --- a/src/bossTopman.cpp +++ b/src/bossTopman.cpp @@ -3,10 +3,9 @@ #include #include #include -#include "effects.h" -#include "player.h" +#include "boss.h" -class daDreidel : public dEn_c { +class daDreidel : public daBoss { int onCreate(); int onDelete(); int onExecute(); @@ -30,7 +29,7 @@ class daDreidel : public dEn_c { float dying; - dEn_c *Kameck; + daKameckDemo *Kameck; static daDreidel *build(); @@ -77,25 +76,10 @@ daDreidel *daDreidel::build() { /////////////////////// // Externs and States /////////////////////// - extern "C" void *PlaySound(dStageActor_c *, int soundID); - extern "C" void *PlaySoundAsync(dStageActor_c *, int soundID); extern "C" void *EN_LandbarrelPlayerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther); - - extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); - extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daDreidel *, Vec pos); - extern "C" dStageActor_c *GetSpecificPlayerActor(int num); -// CalculateDistanceFromActorsNextPosToFurthestPlayer - - //FIXME make this dEn_c->used... - extern "C" char usedForDeterminingStatePress_or_playerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther, int unk1); + // CalculateDistanceFromActorsNextPosToFurthestPlayer??? extern "C" int SmoothRotation(short* rot, u16 amt, int unk2); - extern "C" void *StopBGMMusic(); - extern "C" void *StartBGMMusic(); - - extern "C" void *MakeMarioEnterDemoMode(); - extern "C" void *MakeMarioExitDemoMode(); - extern "C" void *UpdateGameMgr(); CREATE_STATE(daDreidel, Walk); CREATE_STATE(daDreidel, Turn); @@ -167,41 +151,17 @@ daDreidel *daDreidel::build() { this->playerCollision(apThis, apOther); } - void daDreidel::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { - this->dEn_c::playerCollision(apThis, apOther); - this->_vf220(apOther->owner); - - this->isDead = 0; - this->flags_4FC |= (1<<(31-7)); - if(apOther->owner->which_player < 4) { - this->counter_504[apOther->owner->which_player] = 0; - } - } - - void daDreidel::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { - this->collisionCatD_GroundPound(apThis, apOther); - } + void daDreidel::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } + void daDreidel::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } + void daDreidel::collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } - void daDreidel::collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { - this->collisionCatD_GroundPound(apThis, apOther); - } - - void daDreidel::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { - doStateChange(&StateID_KnockBack); - } + void daDreidel::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { doStateChange(&StateID_KnockBack); } + void daDreidel::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_KnockBack); } void daDreidel::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther){ } - void daDreidel::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { } - - void daDreidel::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther){ - doStateChange(&StateID_KnockBack); - } - void daDreidel::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther){ } - void daDreidel::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { } - bool daDreidel::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { return true; } @@ -407,23 +367,7 @@ void daDreidel::updateModelMatrices() { this->timer = 0; - // 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); + SetupKameck(this, Kameck); } void daDreidel::executeState_Grow() { @@ -432,52 +376,18 @@ void daDreidel::updateModelMatrices() { this->chrAnimation.setCurrentFrame(0.0); } - this->timer = this->timer + 1; - - float scaleSpeed, yPosScaling; - + this->timer += 1; - if ((this->timer > 150) && (this->timer < 230)) { + bool ret; + ret = GrowBoss(this, Kameck, 0.2, 0.4, 0, this->timer); - scaleSpeed = 0.005; - yPosScaling = 18; - - float modifier; - - modifier = 0.2 + ((this->timer - 150) * scaleSpeed); - - this->scale = (Vec){modifier, modifier, modifier}; - // this->pos.y = this->pos.y + (yPosScaling/80); - - } - if (this->timer > 420) { + if (ret) { PlaySound(this, SE_EMY_MECHAKOOPA_BOUND); doStateChange(&StateID_Walk); } - - if (this->timer == 130) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt); } - if (this->timer == 150) { PlaySound(this, SE_BOSS_IGGY_WANWAN_TO_L); } - if (this->timer == 400) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt2); } - 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 - } } void daDreidel::endState_Grow() { - // Clean up the flags and Kameck - dStage32C_c::instance->freezeMarioBossFlag = 0; - WLClass::instance->_8 = 1; - - MakeMarioExitDemoMode(); - StartBGMMusic(); - - Kameck->Delete(1); + CleanupKameck(this, Kameck); } @@ -627,82 +537,24 @@ void daDreidel::updateModelMatrices() { // Outro State /////////////// void daDreidel::beginState_Outro() { - - WLClass::instance->_4 = 5; - WLClass::instance->_8 = 0; - - this->removeMyActivePhysics(); - this->timer = 0; - StopBGMMusic(); - - dStage32C_c::instance->freezeMarioBossFlag = 1; - + OutroSetup(this); } void daDreidel::executeState_Outro() { if (this->dying == 1) { - if (this->timer > 180) { - ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE); - } - - if (this->timer == 60) { - - UpdateGameMgr(); - - if (GetSpecificPlayerActor(0) != 0) { - PlaySound(this, SE_VOC_MA_CLEAR_BOSS); - // Send PlBase into DemoGoal State here, kthxbai - } - - if (GetSpecificPlayerActor(1) != 0) { - PlaySound(this, SE_VOC_LU_CLEAR_BOSS); - // Send PlBase into DemoGoal State here, kthxbai - } - - if (GetSpecificPlayerActor(2) != 0) { - PlaySound(this, SE_VOC_KO_CLEAR_BOSS); - // Send PlBase into DemoGoal State here, kthxbai - } - - if (GetSpecificPlayerActor(3) != 0) { - PlaySound(this, SE_VOC_KO2_CLEAR_BOSS); - // Send PlBase into DemoGoal State here, kthxbai - } - } + if (this->timer > 180) { ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE); } + if (this->timer == 60) { PlayerVictoryCries(this); } this->timer += 1; return; } - if (this->scale.x > 0.1) { - - PlaySound(this, SE_EMY_BUBBLE_EXTINCT); - - // Adjust this to equal the scale of your boss / 80. - this->scale.x -= 0.0075; - this->scale.y -= 0.0075; - this->scale.z -= 0.0075; + bool ret; + ret = ShrinkBoss(this, &this->pos, 0.5, this->timer); - if (this->timer == 30) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 756); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 801); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 957); - this->timer = 0; - } - - this->timer += 1; - } - else { - this->scale.x = 0.0; - this->scale.y = 0.0; - this->scale.z = 0.0; - - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 588); - this->dying = 1; - this->timer = 0; - - PlaySound(this, STRM_BGM_SHIRO_BOSS_CLEAR); - MakeMarioEnterDemoMode(); - } + if (ret) { BossExplode(this, &this->pos); } + else { PlaySound(this, SE_EMY_BUBBLE_EXTINCT); } + + this->timer += 1; } void daDreidel::endState_Outro() { } -- cgit v1.2.3