diff options
Diffstat (limited to 'src/bossRamboo.cpp')
-rw-r--r-- | src/bossRamboo.cpp | 68 |
1 files changed, 40 insertions, 28 deletions
diff --git a/src/bossRamboo.cpp b/src/bossRamboo.cpp index d37baf6..598cf75 100644 --- a/src/bossRamboo.cpp +++ b/src/bossRamboo.cpp @@ -30,8 +30,8 @@ class daRamboo_c : public dEn_c { int timer; int ytimer; char Hiding; + char dying; float Baseline; - float dying; u64 eventFlag; @@ -147,7 +147,7 @@ void daRamboo_c::setupModels() { nw4r::g3d::ResMdl mdlC = this->resFile.GetResMdl("teresaB"); this->hideModel.setup(mdlC, &allocator, 0x224, 1, 0); - SetupTextures_Enemy(&this->bodyModel, 0); + SetupTextures_Enemy(&this->hideModel, 0); nw4r::g3d::ResAnmChr anmChrE = this->resFile.GetResAnmChr("shay_teresaB"); ret = this->anmShayB.setup(mdlC, anmChrE, &this->allocator, 0); @@ -182,8 +182,8 @@ int daRamboo_c::onCreate() { HitMeBaby.xDistToCenter = 160.0; HitMeBaby.yDistToCenter = -80.0; - HitMeBaby.xDistToEdge = 154.0; - HitMeBaby.yDistToEdge = 154.0; + HitMeBaby.xDistToEdge = 148.0; + HitMeBaby.yDistToEdge = 148.0; HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; @@ -205,6 +205,7 @@ int daRamboo_c::onCreate() { this->rot.z = 0; // Z is ... an axis >.> this->direction = 0; // Heading left. this->Hiding = 0; + this->dying = 0; this->speed.x = 0.0; this->ytimer = 0; @@ -354,14 +355,21 @@ void daRamboo_c::beginState_Advance() { this->speed.z = 0; this->timer = 0; + nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("wait"); + this->anmWaitA.bind(&this->bodyModel, anmChr, 1); + this->bodyModel.bindAnim(&this->anmWaitA, 0.0); + this->anmWaitA.setUpdateRate(1.0); } void daRamboo_c::executeState_Advance() { this->bodyModel._vf1C(); - this->pos.x -= this->timer / 32; - this->pos.y = this->Baseline + sin(this->ytimer * 3.14 / 192) * 48; + if (this->anmWaitA.isAnimationDone()) { + this->anmWaitA.setCurrentFrame(0.0); } + + this->pos.x -= this->timer / 48.0; + this->pos.y = this->Baseline + sin(this->ytimer * 3.14 / 192) * 36; if (this->timer >= 48) { this->timer = 47; } @@ -390,22 +398,37 @@ void daRamboo_c::beginState_Wait() { } void daRamboo_c::executeState_Wait() { + if (this->timer < 90) { + this->hideModel._vf1C(); } - if (this->timer == 55) { + if (this->timer > 55) { + this->bodyModel._vf1C(); } + + + if (this->timer == 70) { + this->Hiding = 0; + + nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("shay_teresaA"); + this->anmShayA.bind(&this->bodyModel, anmChr, 1); + this->bodyModel.bindAnim(&this->anmShayA, 0.0); + this->anmShayA.setUpdateRate(1.0); + } + + + if (this->timer == 55) { nw4r::g3d::ResAnmChr anmChrB = this->resFile.GetResAnmChr("shay_teresaB"); this->anmShayB.bind(&this->hideModel, anmChrB, 1); this->hideModel.bindAnim(&this->anmShayB, 0.0); this->anmShayB.setUpdateRate(1.0); } - if (this->timer > 60) { + + + if (this->anmShayB.isAnimationDone()) { PlaySound(this, SE_EMY_CS_TERESA_BEAT_YOU); doStateChange(&StateID_Advance); } - - this->hideModel._vf1C(); - this->timer += 1; } @@ -429,21 +452,15 @@ void daRamboo_c::endState_Wait() { void daRamboo_c::beginState_Flee() { -// bindAnimChr_and_setUpdateRates("shay_teresaA", this->animationChrC, this->bodyModel, 1.0); - - nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("wait"); - this->anmWaitA.bind(&this->bodyModel, anmChr, 1); - this->bodyModel.bindAnim(&this->anmWaitA, 0.0); - this->anmWaitA.setUpdateRate(1.0); - OSReport("Damnit that hurt."); this->timer = 0; - } void daRamboo_c::executeState_Flee() { - if (timer == 10) { + this->hideModel._vf1C(); + + if (this->timer == 10) { this->Hiding = 1; nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("shay_teresaB_wait"); @@ -452,15 +469,10 @@ void daRamboo_c::executeState_Flee() { this->anmWaitB.setUpdateRate(1.0); } - this->pos.x += (60 - this->timer) / 8; + this->pos.x += (60 - this->timer) / 6; - if (timer < 10) { - this->bodyModel._vf1C(); } - else { - this->hideModel._vf1C(); } - - if (this->timer > 60) { + if ((this->timer > 60) && (this->anmWaitB.isAnimationDone())) { doStateChange(&StateID_Wait); } @@ -518,7 +530,7 @@ void daRamboo_c::executeState_Outro() { return; } - if (this->scale.x > 0.1) { + if (this->scale.x > 0) { PlaySound(this, SE_BOSS_CMN_DAMAGE_LAST); PlaySound(this, SE_EMY_BIG_TERESA_DEAD); |