diff options
Diffstat (limited to 'src/bossBalboaWrench.cpp')
-rw-r--r-- | src/bossBalboaWrench.cpp | 96 |
1 files changed, 70 insertions, 26 deletions
diff --git a/src/bossBalboaWrench.cpp b/src/bossBalboaWrench.cpp index 703123d..acdbb44 100644 --- a/src/bossBalboaWrench.cpp +++ b/src/bossBalboaWrench.cpp @@ -30,6 +30,7 @@ class daBalboa_c : public dEn_c { m3d::anmChr_c anmThrow_5; int timer; + int damage; float Baseline; float dying; Vec PopUp [4]; @@ -44,6 +45,7 @@ class daBalboa_c : public dEn_c { void playerCollision(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 collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther); @@ -72,6 +74,7 @@ extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char r extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daBalboa_c *, Vec pos); extern "C" dStageActor_c *GetSpecificPlayerActor(int number); extern "C" void *PlaySound(daBalboa_c *, int soundID); +extern "C" char usedForDeterminingStatePress_or_playerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther, int unk1); CREATE_STATE(daBalboa_c, Grow); @@ -86,26 +89,65 @@ CREATE_STATE(daBalboa_c, Outro); void daBalboa_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { - this->_vf220(apOther->owner); - OSReport("I hit Mario."); + + char ret = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 0); + + if(ret == 1) { // regular jump + + apOther->someFlagByte |= 2; + OSReport("ret == 1; regular jump;\n"); + + } else if(ret == 3) { // spinning + + apOther->someFlagByte |= 2; + OSReport("ret == 3; spinning collision;\n"); + + } else if(ret == 0) { + + OSReport("calling dEn_c::playerCollsiion(apThis, apOther);\n"); + this->dEn_c::playerCollision(apThis, apOther); + this->_vf220(apOther->owner); + + } else if(ret == 2) { + OSReport("Y U USIN' MINIMARIO?\n"); + this->dEn_c::playerCollision(apThis, apOther); + this->_vf220(apOther->owner); + + } else { + OSReport("usedForDeter...() returned %d\n", ret); + } + + //FIXME hack to make multiple playerCollisions work + this->isDead = 0; + this->flags_4FC |= (1<<(31-7)); + if(apOther->owner->_38D > 3) { + OSReport("!!!ATTENTION!!!\napOther->owner->_38D > 3\n"); + }else{ + this->counter_504[apOther->owner->_38D] = 0; + } } + void daBalboa_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 daBalboa_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Iceball"); return false; } -void daBalboa_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { - OSReport("Hit Rolling Object"); + +void daBalboa_c::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { + this->damage -= 1; + + apOther->someFlagByte |= 2; - if (apOther->owner->name == 412) { // Check if it's a glow block - CreateEffect(378, &apOther->owner->pos); - CreateEffect(380, &apOther->owner->pos); + // Create a huge hit effect and play a nice sound + // goto a get hurt state where he does his dance and then retreats underground + + // Prevent him from getting hurt during his dancing + + if (this->damage == 0) { doStateChange(&StateID_Outro); } - apOther->owner->Delete(); - doStateChange(&StateID_Outro); - } } + + +void daBalboa_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { } void daBalboa_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Hammer"); } @@ -217,6 +259,7 @@ int daBalboa_c::onCreate() { this->direction = 0; // Heading left. this->pos.z = -800.0; this->pos.y -= 8.0; + this->damage = 3; this->PopUp[0] = (Vec){this->pos.x, this->pos.y - 72.0, this->pos.z}; this->PopUp[1] = (Vec){this->pos.x - 224.0, this->pos.y - 72.0, this->pos.z}; @@ -240,13 +283,6 @@ int daBalboa_c::onDelete() { int daBalboa_c::onExecute() { acState.execute(); updateModelMatrices(); - - if (this->aPhysics.result1 == 1) { - char PlayerID = NearestPlayer(this); - dStageActor_c *Player = GetSpecificPlayerActor(PlayerID); - - this->_vf220(Player); - } return true; } @@ -490,8 +526,12 @@ void daBalboa_c::beginState_ThrowHoming() { u32 settings; + char dir; - settings = (this->direction) | (this->upsideDown << 1); + if (this->direction) { dir = 0; } + else { dir = 1; } + + settings = (dir) | (this->upsideDown << 1); settings = settings | 0x10; CreateActor(544, settings, this->pos, 0, 0); @@ -518,6 +558,7 @@ void daBalboa_c::endState_ThrowHoming() { } void daBalboa_c::beginState_ThrowWrench() { + this->throwCount = 0; this->timer = 0; } @@ -525,7 +566,7 @@ void daBalboa_c::executeState_ThrowWrench() { - if (this->timer == 60) { + if (this->timer > 60) { if (this->throwCount & 1) { nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("throw_4_left_hand"); @@ -544,25 +585,28 @@ void daBalboa_c::executeState_ThrowWrench() { u32 settings; u8 up = this->upsideDown; u8 throwc = this->throwCount; - u8 dir = this->direction; + u8 dir; + if (this->direction) { dir = 0; } + else { dir = 1; } + settings = (dir) | (up << 1); settings = settings | (throwc & 1 << 8); CreateActor(544, settings, this->pos, 0, 0); - this->timer = 0; this->throwCount += 1; + this->timer = 0; } - if (this->throwCount == 5) { + if (this->throwCount > 4) { doStateChange(&StateID_BackDown); } this->timer += 1; this->bodyModel._vf1C(); } -void daBalboa_c::endState_ThrowWrench() { this->throwCount = 0; } +void daBalboa_c::endState_ThrowWrench() { } |