diff options
Diffstat (limited to 'src/bossRamboo.cpp')
-rw-r--r-- | src/bossRamboo.cpp | 61 |
1 files changed, 41 insertions, 20 deletions
diff --git a/src/bossRamboo.cpp b/src/bossRamboo.cpp index ea97629..bf27d51 100644 --- a/src/bossRamboo.cpp +++ b/src/bossRamboo.cpp @@ -4,6 +4,7 @@ #include <sfx.h> #include <stage.h> #include "boss.h" +#include "player.h" class daRamboo_c : public daBoss { int onCreate(); @@ -69,8 +70,12 @@ CREATE_STATE(daRamboo_c, Wait); CREATE_STATE(daRamboo_c, Flee); CREATE_STATE(daRamboo_c, Outro); +extern "C" void *EN_LandbarrelPlayerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther); -void daRamboo_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } +void daRamboo_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { + EN_LandbarrelPlayerCollision(this, apThis, apOther); + DamagePlayer(this, apThis, apOther); +} void daRamboo_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { SpawnEffect("Wm_en_obakedoor_sm", 0, &apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5}); this->pos.x += 6.0; @@ -156,13 +161,14 @@ int daRamboo_c::onCreate() { this->scale = (Vec){2.0, 2.0, 2.0}; + this->aPhysics.collisionCheckType = 1; ActivePhysics::Info HitMeBaby; HitMeBaby.xDistToCenter = 160.0; HitMeBaby.yDistToCenter = 80.0; - HitMeBaby.xDistToEdge = 148.0; - HitMeBaby.yDistToEdge = 148.0; + HitMeBaby.xDistToEdge = 132.0; + HitMeBaby.yDistToEdge = 132.0; HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; @@ -173,15 +179,6 @@ int daRamboo_c::onCreate() { this->aPhysics.initWithStruct(this, &HitMeBaby); - this->aPhysics.collisionCheckType = 2; - this->aPhysics._8 = 48.0; - this->aPhysics._C = 48.0; - this->aPhysics._18 = 48.0; - this->aPhysics.trpValue0 = 48.0; - this->aPhysics.trpValue1 = 48.0; - this->aPhysics.trpValue2 = 48.0; - this->aPhysics.trpValue3 = 48.0; - this->aPhysics.addToList(); this->Baseline = this->pos.y; @@ -237,6 +234,7 @@ int daRamboo_c::onExecute() { this->fogSrt.setFrameForEntry(1.0, 0); if (dFlagMgr_c::instance->flags & this->eventFlag) { + dFlagMgr_c::instance->flags = dFlagMgr_c::instance->flags && this->eventFlag; doStateChange(&StateID_Outro); } @@ -303,6 +301,23 @@ void daRamboo_c::endState_Grow() { +float RightmostPlayerPos() { + dStageActor_c* current; + current->pos.x = 0.0; + + for(char ii = 0; ii < 4; ii++) { + dStageActor_c* player = GetSpecificPlayerActor(ii); + if(!player) { + continue; + } + // actor->pos.x, actor->pos.y, actor->pos.z, + // player->pos.x, player->pos.y, player->pos.z); + if(player->pos.x > current->pos.x) { + current = player; + } + } + return current->pos.x; +} // Advance State @@ -325,11 +340,17 @@ void daRamboo_c::executeState_Advance() { if (this->anmWaitA.isAnimationDone()) { this->anmWaitA.setCurrentFrame(0.0); } - this->pos.x -= this->timer / 48.0; + float px = RightmostPlayerPos(); + + if ((px - 132.0) < this->pos.x) { + this->pos.x -= this->timer / 28.0; } + else { + this->pos.x = (px - 132.0); } + this->pos.y = this->Baseline + sin(this->ytimer * 3.14 / 192) * 36; - if (this->timer >= 48) { this->timer = 47; } + if (this->timer >= 32) { this->timer = 31; } if (this->ytimer >= 384) { this->ytimer = 0; } PlaySound(this, SE_EMY_TERESA); @@ -423,7 +444,7 @@ void daRamboo_c::executeState_Flee() { this->anmWaitB.setUpdateRate(1.0); } - this->pos.x += (60 - this->timer) / 6; + this->pos.x += (60 - this->timer) / 8; if ((this->timer > 60) && (this->anmWaitB.isAnimationDone())) { @@ -454,7 +475,6 @@ void daRamboo_c::beginState_Outro() { OutroSetup(this); } void daRamboo_c::executeState_Outro() { - if (this->anmWaitB.isAnimationDone()) this->anmWaitB.setCurrentFrame(0.0); @@ -467,15 +487,16 @@ void daRamboo_c::executeState_Outro() { PlayerVictoryCries(this); } - this->timer += 1; + this->timer = timer + 1; return; } bool ret; Vec tempPos = (Vec){this->pos.x + 160.0, this->pos.y - 80.0, 5500.0}; ret = ShrinkBoss(this, &tempPos, 15.0, this->timer); + pos.y -= 2.0; - if (ret == true) { + if (ret) { BossExplode(this, &tempPos); this->dying = 1; this->timer = 0; @@ -484,8 +505,8 @@ void daRamboo_c::executeState_Outro() { PlaySound(this, SE_EMY_BIG_TERESA_DEAD); } - this->timer += 1; - + timer = timer + 1; + OSReport("Timer: %d", timer); } void daRamboo_c::endState_Outro() { } |