summaryrefslogtreecommitdiff
path: root/src/bossBalboaWrench.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bossBalboaWrench.cpp181
1 files changed, 80 insertions, 101 deletions
diff --git a/src/bossBalboaWrench.cpp b/src/bossBalboaWrench.cpp
index efb3abe..703123d 100644
--- a/src/bossBalboaWrench.cpp
+++ b/src/bossBalboaWrench.cpp
@@ -33,10 +33,8 @@ class daBalboa_c : public dEn_c {
float Baseline;
float dying;
Vec PopUp [4];
- dStageActor_c *homingWrench;
- int homingWrenchLifeSpan;
- float homingWrenchDirection;
char throwCount;
+ char upsideDown;
static daBalboa_c *build();
@@ -196,7 +194,7 @@ int daBalboa_c::onCreate() {
HitMeBaby.yDistToCenter = 36.0;
HitMeBaby.xDistToEdge = 24.0;
- HitMeBaby.yDistToEdge = 30.0;
+ HitMeBaby.yDistToEdge = 32.0;
HitMeBaby.category1 = 0x3;
HitMeBaby.category2 = 0x0;
@@ -215,13 +213,16 @@ 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;
- 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");
@@ -246,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;
}
@@ -304,7 +292,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);
@@ -313,6 +301,7 @@ void daBalboa_c::executeState_Grow() {
if (this->timer > 170) {
PlaySound(this, SE_EMY_CHOROPU_BOUND);
+ this->upsideDown = 0;
doStateChange(&StateID_BackDown);
}
@@ -338,17 +327,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 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 { // On the right side!
+
+ 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 +377,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 +409,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 +434,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 +447,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);
@@ -457,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; }
-
- 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) && (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; }
+ settings = (this->direction) | (this->upsideDown << 1);
+ settings = settings | 0x10;
+ CreateActor(544, settings, this->pos, 0, 0);
- PlaySound(this, 0x222);
- this->homingWrenchLifeSpan = 360;
this->timer = 0;
}
@@ -548,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;
+ settings = (dir) | (up << 1);
+ settings = settings | (throwc & 1 << 8);
- dStageActor_c *wrench = CreateActor(372, this->direction << 28, tempPos, 0, 0);
- wrench->speed.x = 8.0;
- wrench->speed.y = 8.0 * slope;
- }
-
- PlaySound(this, 0x222);
+ CreateActor(544, settings, this->pos, 0, 0);
this->timer = 0;
this->throwCount += 1;
@@ -611,7 +586,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); }