From 481585f8747707bb1aee196672edc7a926ae0611 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Sat, 22 Oct 2011 03:28:23 -0500 Subject: Lots of boss updates --- src/bossBalboaWrench.cpp | 86 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 18 deletions(-) (limited to 'src/bossBalboaWrench.cpp') diff --git a/src/bossBalboaWrench.cpp b/src/bossBalboaWrench.cpp index efb3abe..02742e7 100644 --- a/src/bossBalboaWrench.cpp +++ b/src/bossBalboaWrench.cpp @@ -37,6 +37,7 @@ class daBalboa_c : public dEn_c { int homingWrenchLifeSpan; float homingWrenchDirection; char throwCount; + char upsideDown; static daBalboa_c *build(); @@ -192,11 +193,11 @@ int daBalboa_c::onCreate() { OSReport("Creating Balboa's Physics Struct"); ActivePhysics::Info HitMeBaby; - HitMeBaby.xDistToCenter = 0.0; + HitMeBaby.xDistToCenter = 24.0; HitMeBaby.yDistToCenter = 36.0; HitMeBaby.xDistToEdge = 24.0; - HitMeBaby.yDistToEdge = 30.0; + HitMeBaby.yDistToEdge = 32.0; HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; @@ -217,11 +218,13 @@ int daBalboa_c::onCreate() { this->rot.z = 0; // Z is ... an axis >.> this->direction = 0; // Heading left. this->pos.z = -800.0; + this->pos.y -= 8.0; - this->PopUp[0] = (Vec){this->pos.x, this->pos.y + 120.0, this->pos.z}; - this->PopUp[1] = (Vec){this->pos.x - 320.0, this->pos.y - 60.0, this->pos.z}; - this->PopUp[2] = (Vec){this->pos.x, this->pos.y + 120.0, this->pos.z}; - this->PopUp[3] = (Vec){this->pos.x - 320.0, this->pos.y - 60.0, this->pos.z}; + 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}; + this->PopUp[2] = (Vec){this->pos.x, this->pos.y + 248.0, this->pos.z}; + this->PopUp[3] = (Vec){this->pos.x - 224.0, this->pos.y + 248.0, this->pos.z}; + this->PopUp[4] = (Vec){this->pos.x - 112.0, this->pos.y - 40.0, this->pos.z}; OSReport("Setting the State"); @@ -304,7 +307,7 @@ void daBalboa_c::executeState_Grow() { float modifier; - modifier = 2.0 + ((this->timer - 60) * scaleSpeed); + modifier = 1.0 + ((this->timer - 60) * scaleSpeed); this->scale = (Vec){modifier, modifier, modifier}; // this->pos.y = this->pos.y + (yPosScaling/80); @@ -338,17 +341,48 @@ void daBalboa_c::beginState_ManholeUp() { this->timer = 0; int randChoice; - randChoice = GenerateRandomNumber(4); + randChoice = GenerateRandomNumber(5); this->pos = this->PopUp[randChoice]; - if (randChoice < 2) { // On the left side! + if (randChoice == 0) { // On the left side! this->rot.y = 0xE000; + this->rot.z = 0; + this->upsideDown = 0; this->direction = 0; } - else { // On the right side! + + else if (randChoice == 1) { // On the right side! + this->rot.y = 0x2000; + this->rot.z = 0; + this->upsideDown = 0; + this->direction = 1; } + + else if (randChoice == 2) { // On the right ceiling! + this->rot.y = 0xE000; + this->rot.z = 0x8000; + this->upsideDown = 1; + this->direction = 0; } + + else if (randChoice == 3) { // On the left ceiling! this->rot.y = 0x2000; + this->rot.z = 0x8000; + this->upsideDown = 1; this->direction = 1; } + else if (randChoice == 4) { // In the Center! + char PlayerID = NearestPlayer(this); + dStageActor_c *Player = GetSpecificPlayerActor(PlayerID); + + this->upsideDown = 0; + this->rot.z = 0; + if (Player->pos.x < this->pos.x) { + this->rot.y = 0xE000; + this->direction = 0; } + else { + this->rot.y = 0x2000; + this->direction = 1; } + } + PlaySound(this, 0x21F); } @@ -357,9 +391,13 @@ void daBalboa_c::executeState_ManholeUp() { this->bodyModel._vf1C(); if (this->timer < 30) { - this->pos.y += 0.5; } // Height is 80 pixels, move up 15 pixels. + if (this->upsideDown == 0) { + this->pos.y += 0.6; } // Height is 72 pixels, move up 18 pixels. + else { + this->pos.y -= 0.6; } // Height is 72 pixels, move down 18 pixels. + } - if (this->timer > 90) { + if (this->timer > 60) { doStateChange(&StateID_HeadPoke); } this->timer += 1; @@ -385,8 +423,12 @@ void daBalboa_c::beginState_HeadPoke() { void daBalboa_c::executeState_HeadPoke() { if (this->timer < 30) { - this->pos.y += 1.0; } // Height is 80 pixels, move up another 30 pixels. - + if (this->upsideDown == 0) { + this->pos.y += 0.6; } // Height is 72 pixels, move up 20 pixels. + else { + this->pos.y -= 0.6; } // Height is 72 pixels, move down 20 pixels. + } + if (this->timer > 90) { doStateChange(&StateID_AllOut); } @@ -406,7 +448,7 @@ void daBalboa_c::beginState_AllOut() { nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("throw_3"); this->anmThrow_3.bind(&this->bodyModel, anmChr, 1); - this->bodyModel.bindAnim(&this->anmThrow_1, 0.0); + this->bodyModel.bindAnim(&this->anmThrow_3, 0.0); this->anmThrow_3.setUpdateRate(1.0); this->timer = 0; @@ -419,9 +461,13 @@ void daBalboa_c::executeState_AllOut() { this->bodyModel._vf1C(); if (this->timer < 30) { - this->pos.y += 1.2; } // Height is 80 pixels, move up another 35 pixels. + if (this->upsideDown == 0) { + this->pos.y += 1.2; } // Height is 72 pixels, move up last 36 pixels. + else { + this->pos.y -= 1.2; } // Height is 72 pixels, move down last 36 pixels. + } - if (this->timer > 90) { + if (this->timer > 45) { int randChoice; randChoice = GenerateRandomNumber(2); @@ -611,7 +657,11 @@ void daBalboa_c::beginState_BackDown() { void daBalboa_c::executeState_BackDown() { if (this->timer < 60) { - this->pos.y -= 2.6667; } // Height is 80 pixels, move down 80 pixels. + if (this->upsideDown == 0) { + this->pos.y -= 1.2; } // Height is 72 pixels, move down + else { + this->pos.y += 1.2; } // Height is 72 pixels, move up + } if (this->timer > 90) { doStateChange(&StateID_ManholeUp); } -- cgit v1.2.3 From 804bc013c1a3ec3afeedb19a1351ee4c3206c901 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Sat, 22 Oct 2011 17:36:52 -0500 Subject: unworking balboa boss for testing --- src/bossBalboaWrench.cpp | 99 +++++++----------------------------------------- 1 file changed, 14 insertions(+), 85 deletions(-) (limited to 'src/bossBalboaWrench.cpp') diff --git a/src/bossBalboaWrench.cpp b/src/bossBalboaWrench.cpp index 02742e7..703123d 100644 --- a/src/bossBalboaWrench.cpp +++ b/src/bossBalboaWrench.cpp @@ -33,9 +33,6 @@ class daBalboa_c : public dEn_c { float Baseline; float dying; Vec PopUp [4]; - dStageActor_c *homingWrench; - int homingWrenchLifeSpan; - float homingWrenchDirection; char throwCount; char upsideDown; @@ -193,7 +190,7 @@ int daBalboa_c::onCreate() { OSReport("Creating Balboa's Physics Struct"); ActivePhysics::Info HitMeBaby; - HitMeBaby.xDistToCenter = 24.0; + HitMeBaby.xDistToCenter = 0.0; HitMeBaby.yDistToCenter = 36.0; HitMeBaby.xDistToEdge = 24.0; @@ -216,6 +213,7 @@ int daBalboa_c::onCreate() { this->rot.x = 0; // X is vertical axis this->rot.y = 0xE000; // Y is horizontal axis this->rot.z = 0; // Z is ... an axis >.> + this->upsideDown = 0; this->direction = 0; // Heading left. this->pos.z = -800.0; this->pos.y -= 8.0; @@ -249,20 +247,7 @@ int daBalboa_c::onExecute() { this->_vf220(Player); } - - if (this->homingWrenchLifeSpan > 1) { - this->homingWrench->pos.y += this->homingWrenchDirection; - this->homingWrenchLifeSpan -= 1; - } - - if (this->homingWrenchLifeSpan == 1) { - this->homingWrench->Delete(); - CreateEffect(&this->homingWrench->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}, 242); - this->homingWrenchLifeSpan = 0; - } - - return true; } @@ -316,6 +301,7 @@ void daBalboa_c::executeState_Grow() { if (this->timer > 170) { PlaySound(this, SE_EMY_CHOROPU_BOUND); + this->upsideDown = 0; doStateChange(&StateID_BackDown); } @@ -503,52 +489,13 @@ void daBalboa_c::beginState_ThrowHoming() { } - Vec tempPos = this->pos; - if (this->direction == 0) { - tempPos.x -= 32.0; - tempPos.y += 10.0; - - this->homingWrench = CreateActor(372, this->direction << 28, tempPos, 0, 0); - this->homingWrench->speed.x = -7.0; - this->homingWrench->scale = (Vec){3.0, 3.0, 3.0}; - - } - else { - tempPos.x += 32.0; - tempPos.y += 10.0; - - this->homingWrench = CreateActor(372, this->direction << 28, tempPos, 0, 0); - this->homingWrench->speed.x = 7.0; - this->homingWrench->scale = (Vec){3.0, 3.0, 3.0}; - - } - - - char PlayerID = NearestPlayer(this); - dStageActor_c *Player = GetSpecificPlayerActor(PlayerID); - + u32 settings; - if ((Player->pos.y >= tempPos.y - 16.0) && (Player->pos.y <= tempPos.y + 16.0)) { - this->homingWrenchDirection = 0.0; } + settings = (this->direction) | (this->upsideDown << 1); + settings = settings | 0x10; - else if ((Player->pos.y >= tempPos.y - 106.0) && (Player->pos.y < tempPos.y - 16.0)) { - this->homingWrenchDirection = -0.4; } + CreateActor(544, settings, this->pos, 0, 0); - else if ((Player->pos.y <= tempPos.y + 106.0) && (Player->pos.y > tempPos.y + 16.0)) { - this->homingWrenchDirection = 0.4; } - - else if (Player->pos.y < tempPos.y - 106.0) { - this->homingWrenchDirection = -0.8; } - - else if (Player->pos.y > tempPos.y + 106.0) { - this->homingWrenchDirection = 0.8; } - - else { - this->homingWrenchDirection = 0.0; } - - - PlaySound(this, 0x222); - this->homingWrenchLifeSpan = 360; this->timer = 0; } @@ -594,33 +541,15 @@ void daBalboa_c::executeState_ThrowWrench() { } - char PlayerID = NearestPlayer(this); - dStageActor_c *Player = GetSpecificPlayerActor(PlayerID); - - - float slope = ( (this->pos.y - Player->pos.y) / (this->pos.x - Player->pos.x) ); - - - Vec tempPos = this->pos; - if (this->direction == 0) { - tempPos.x -= 32.0; - tempPos.y += 10.0; - - dStageActor_c *wrench = CreateActor(372, this->direction << 28, tempPos, 0, 0); - wrench->speed.x = -8.0; - wrench->speed.y = -8.0 * slope; - } + u32 settings; + u8 up = this->upsideDown; + u8 throwc = this->throwCount; + u8 dir = this->direction; - else { - tempPos.x += 32.0; - tempPos.y += 10.0; - - dStageActor_c *wrench = CreateActor(372, this->direction << 28, tempPos, 0, 0); - wrench->speed.x = 8.0; - wrench->speed.y = 8.0 * slope; - } + settings = (dir) | (up << 1); + settings = settings | (throwc & 1 << 8); - PlaySound(this, 0x222); + CreateActor(544, settings, this->pos, 0, 0); this->timer = 0; this->throwCount += 1; -- cgit v1.2.3