summaryrefslogtreecommitdiff
path: root/src/bossBalboaWrench.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bossBalboaWrench.cpp')
-rw-r--r--src/bossBalboaWrench.cpp99
1 files changed, 14 insertions, 85 deletions
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;