From 5dece655469940b4752cb0dc81328c8171e2b5e7 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Fri, 2 Mar 2012 17:12:34 -0600 Subject: Lots of poss updates, meteors, shy guys, penguins, etc. --- src/bossFuzzyBear.cpp | 116 +++++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 54 deletions(-) (limited to 'src/bossFuzzyBear.cpp') diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp index b13955c..97fc893 100644 --- a/src/bossFuzzyBear.cpp +++ b/src/bossFuzzyBear.cpp @@ -44,13 +44,16 @@ class daFuzzyBear_c : public dEn_c { void updateModelMatrices(); void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther); -// void yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther); + void yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther); + void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther); bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther); + void collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther); + void collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther); + void collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther); USING_STATES(daFuzzyBear_c); DECLARE_STATE(Grow); @@ -96,14 +99,22 @@ CREATE_STATE(daFuzzyBear_c, Outro); void daFuzzyBear_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 daFuzzyBear_c::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { + this->playerCollision(apThis, apOther); } void daFuzzyBear_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { if (this->isInvulnerable == 1) { return; } - OSReport("Hit Fireball"); this->timer = 0; PlaySound(this, SE_BOSS_KOOPA_FIRE_DISAPP); @@ -111,14 +122,32 @@ void daFuzzyBear_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, Ac this->damage++; if (this->damage > 14) { doStateChange(&StateID_Outro); } } -bool daFuzzyBear_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Iceball"); return false; } -void daFuzzyBear_c::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Groundpound\n"); } +void daFuzzyBear_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { + apOther->someFlagByte |= 2; + + dActor_c *block = apOther->owner; + dEn_c *mario = (dEn_c*)block; + + mario->speed.y = -mario->speed.y; + mario->pos.y += mario->speed.y; + + if (mario->direction == 0) { mario->speed.x = 4.0; } + else { mario->speed.x = -4.0; } + + mario->doSpriteMovement(); + mario->doSpriteMovement(); +} +void daFuzzyBear_c::collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { + this->collisionCat7_WMWaggleWater(apThis, apOther); +} void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { - OSReport("Hit Rolling Object"); dActor_c *block = apOther->owner; dEn_c *blah = (dEn_c*)block; + if (blah->direction == 0) { blah->direction = 1; this->roly = 1; } + else { blah->direction = 0; this->roly = 0; } + blah->speed.x = -blah->speed.x; blah->pos.x += blah->speed.x; @@ -134,10 +163,7 @@ void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhy else { blah->direction = 0; } return; - } - - if (blah->direction == 0) { blah->direction = 1; this->roly = 0; } - else { blah->direction = 0; this->roly = 1; } + } this->pos.x += blah->speed.x; @@ -155,8 +181,13 @@ void daFuzzyBear_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics * if (this->isInvulnerable == 1) { return; } + dActor_c *block = apOther->owner; + dEn_c *blah = (dEn_c*)block; + + if (blah->direction == 0) { blah->direction = 1; this->roly = 1; } + else { blah->direction = 0; this->roly = 0; } + PlaySound(this, SE_EMY_BIG_PAKKUN_DAMAGE_1); - OSReport("Hit Hammer"); this->timer = 0; this->damage += 5; @@ -165,7 +196,10 @@ void daFuzzyBear_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics * if (this->damage > 14) { doStateChange(&StateID_Outro); } else { doStateChange(&StateID_RolyPoly); } } -void daFuzzyBear_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Yoshi Fire"); } + +bool daFuzzyBear_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { return false; } +void daFuzzyBear_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) { } +void daFuzzyBear_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) { } @@ -196,17 +230,12 @@ void daFuzzyBear_c::setupBodyModel() { int daFuzzyBear_c::onCreate() { - OSReport("Creating the Fuzzy Bear Model"); setupBodyModel(); this->BigBossFuzzyBear = this->settings >> 28; - - - OSReport("Setting Fuzzy Bear's Size to 1.0"); this->scale = (Vec){1.0, 1.0, 1.0}; - OSReport("Creating Fuzzy Bear's Physics Struct"); ActivePhysics::Info HitMeBaby; HitMeBaby.xDistToCenter = 0.0; @@ -227,11 +256,9 @@ int daFuzzyBear_c::onCreate() { HitMeBaby.callback = &dEn_c::collisionCallback; - OSReport("Making the Physics Class and adding to the list"); this->aPhysics.initWithStruct(this, &HitMeBaby); this->aPhysics.addToList(); - OSReport("Setting up Fuzzy Bear's Box of Goodies"); this->pos.y = this->pos.y + 6; this->rot.x = 0; // X is vertical axis @@ -253,6 +280,7 @@ int daFuzzyBear_c::onCreate() { this->damage = 0; this->isInvulnerable = 0; this->dying = 0; + this->disableEatIn(); bindAnimChr_and_setUpdateRate("run", 1, 0.0, 1.0); @@ -276,13 +304,6 @@ int daFuzzyBear_c::onExecute() { if(this->animationChr.isAnimationDone()) this->animationChr.setCurrentFrame(0.0); - - if (this->aPhysics.result1 == 1) { - char PlayerID = NearestPlayer(this); - dStageActor_c *Player = GetSpecificPlayerActor(PlayerID); - - this->_vf220(Player); - } return true; } @@ -309,35 +330,27 @@ void daFuzzyBear_c::updateModelMatrices() { // Grow State void daFuzzyBear_c::beginState_Grow() { - OSReport("Growing when Kameck Tells me to.\n"); this->timer = 0; - OSReport("Stopping the Music.\n"); + // Stop the BGM Music StopBGMMusic(); - OSReport("Setting the boss flag. %p\n", dStage32C_c::instance); - OSReport("Boss flag is; %d\n", dStage32C_c::instance->freezeMarioBossFlag); + // Set the necessary Flags and make Mario enter Demo Mode dStage32C_c::instance->freezeMarioBossFlag = 1; - - MakeMarioEnterDemoMode(); - - OSReport("WLClass Flags are; %d and %d\n", WLClass::instance->_4, WLClass::instance->_8); - WLClass::instance->_4 = 4; WLClass::instance->_8 = 0; - OSReport("Creating the Vecs.\n"); + 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}; - - OSReport("Creating Kameck.\n"); + // Create And use Kameck Kameck = (daKameckDemo*)createChild(KAMECK_FOR_CASTLE_DEMO, (dStageActor_c*)this, 0, &pos, &rot, 0); - - OSReport("Setting Kameck's State.\n"); Kameck->doStateChange(&daKameckDemo::StateID_DemoWait); - OSReport("Executing the Kamek.\n"); + this->scale = (Vec){1.0, 1.0, 1.0}; } void daFuzzyBear_c::executeState_Grow() { @@ -389,25 +402,18 @@ void daFuzzyBear_c::executeState_Grow() { void daFuzzyBear_c::endState_Grow() { this->Baseline = this->pos.y; - OSReport("Ending boss flag.\n"); + // Clean up the flags and Kameck dStage32C_c::instance->freezeMarioBossFlag = 0; WLClass::instance->_8 = 1; MakeMarioExitDemoMode(); - - OSReport("Ending BGMusic.\n"); StartBGMMusic(); - OSReport("Deleting the Kamek.\n"); - Kameck->Delete(1); - OSReport("OK. All grown up now."); } - - // Bounce State void daFuzzyBear_c::beginState_Bounce() { @@ -663,8 +669,12 @@ void daFuzzyBear_c::beginState_RolyPoly() { this->isInvulnerable = 1; - if (this->roly == 0) { this->speed.x = 12.0; } - else { this->speed.x = -12.0; } + if (this->roly == 1) { + this->direction = 1; + this->speed.x = 12.0; } + else { + this->direction = 0; + this->speed.x = -12.0; } this->speed.y = 0; this->RolyBounces = 0; @@ -773,8 +783,6 @@ void daFuzzyBear_c::endState_Wait() { } void daFuzzyBear_c::beginState_Outro() { - MakeMarioEnterDemoMode(); - WLClass::instance->_4 = 5; WLClass::instance->_8 = 0; -- cgit v1.2.3