summaryrefslogtreecommitdiff
path: root/src/bossBalboaWrench.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bossBalboaWrench.cpp')
-rw-r--r--src/bossBalboaWrench.cpp182
1 files changed, 27 insertions, 155 deletions
diff --git a/src/bossBalboaWrench.cpp b/src/bossBalboaWrench.cpp
index 1b1cf6b..f19e852 100644
--- a/src/bossBalboaWrench.cpp
+++ b/src/bossBalboaWrench.cpp
@@ -3,10 +3,9 @@
#include <g3dhax.h>
#include <sfx.h>
#include <stage.h>
-#include "effects.h"
-#include "player.h"
+#include "boss.h"
-class daBalboa_c : public dEn_c {
+class daBalboa_c : public daBoss {
int onCreate();
int onDelete();
int onExecute();
@@ -31,7 +30,7 @@ class daBalboa_c : public dEn_c {
char isRevenging;
int spinner;
- dEn_c *Kameck;
+ daKameckDemo *Kameck;
static daBalboa_c *build();
@@ -68,21 +67,6 @@ daBalboa_c *daBalboa_c::build() {
}
// Externs
- extern "C" u32 GenerateRandomNumber(int max);
- extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer);
- extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daBalboa_c *, Vec pos);
- extern "C" dStageActor_c *GetSpecificPlayerActor(int number);
- extern "C" void *PlaySound(daBalboa_c *, int soundID);
- extern "C" void *PlaySoundAsync(daBalboa_c *, int soundID);
- extern "C" char usedForDeterminingStatePress_or_playerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther, int unk1);
-
- extern "C" void *StopBGMMusic();
- extern "C" void *StartBGMMusic();
-
- extern "C" void *MakeMarioEnterDemoMode();
- extern "C" void *MakeMarioExitDemoMode();
- extern "C" void *UpdateGameMgr();
-
CREATE_STATE(daBalboa_c, Grow);
CREATE_STATE(daBalboa_c, ManholeUp);
@@ -143,7 +127,7 @@ daBalboa_c *daBalboa_c::build() {
dActor_c *block = apOther->owner;
dEn_c *mario = (dEn_c*)block;
- CreateEffect(mario, 33);
+ SpawnEffect("Wm_en_vshit", 0, &mario->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
mario->speed.y = -mario->speed.y;
mario->pos.y += mario->speed.y;
@@ -300,23 +284,7 @@ void daBalboa_c::updateModelMatrices() {
void daBalboa_c::beginState_Grow() {
this->timer = 0;
- // Stop the BGM Music
- StopBGMMusic();
-
- // Set the necessary Flags and make Mario enter Demo Mode
- dStage32C_c::instance->freezeMarioBossFlag = 1;
- WLClass::instance->_4 = 4;
- WLClass::instance->_8 = 0;
-
- MakeMarioEnterDemoMode();
-
- // Make sure to use the correct position
- Vec pos = (Vec){this->pos.x - 124.0, this->pos.y + 104.0, 3564.0};
- S16Vec rot = (S16Vec){0, 0, 0};
-
- // Create And use Kameck
- Kameck = (daKameckDemo*)createChild(KAMECK_FOR_CASTLE_DEMO, (dStageActor_c*)this, 0, &pos, &rot, 0);
- Kameck->doStateChange(&daKameckDemo::StateID_DemoWait);
+ SetupKameck(this, Kameck);
bindAnimChr_and_setUpdateRate("throw_2", 1, 0.0, 0.6);
}
@@ -326,54 +294,18 @@ void daBalboa_c::updateModelMatrices() {
if(this->animationChr.isAnimationDone())
this->animationChr.setCurrentFrame(0.0);
- if (this->timer == 130) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt); }
- if (this->timer == 400) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt2); }
-
- this->timer = this->timer + 1;
-
- float scaleSpeed, yPosScaling;
-
- if (this->timer == 150) { PlaySound(this, SE_BOSS_IGGY_WANWAN_TO_L); }
-
- if ((this->timer > 150) && (this->timer < 230)) {
-
- scaleSpeed = 0.015625;
+ this->timer += 1;
- float modifier;
+ bool ret;
+ ret = GrowBoss(this, Kameck, 1.0, 2.25, 0, this->timer);
- modifier = 1.0 + ((this->timer - 150) * scaleSpeed);
-
- this->scale = (Vec){modifier, modifier, modifier};
-
- }
-
- if (this->timer == 360) {
- Vec tempPos = (Vec){this->pos.x - 40.0, this->pos.y + 120.0, 3564.0};
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 175); // 400 & 401 // 564 // 583 // 754 // 958
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 400); // 400 & 401 // 564 // 583 // 754 // 958
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 401); // 400 & 401 // 564 // 583 // 754 // 958
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 564); // 400 & 401 // 564 // 583 // 754 // 958
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 583); // 400 & 401 // 564 // 583 // 754 // 958
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 754); // 400 & 401 // 564 // 583 // 754 // 958
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 958); // 400 & 401 // 564 // 583 // 754 // 958
- }
-
- if (this->timer > 420) {
+ if (ret) {
PlaySound(this, SE_EMY_CHOROPU_BOUND);
- this->upsideDown = 0;
doStateChange(&StateID_BackDown);
- }
+ }
}
void daBalboa_c::endState_Grow() {
-
- // Clean up the flags and Kameck
- dStage32C_c::instance->freezeMarioBossFlag = 0;
- WLClass::instance->_8 = 1;
-
- MakeMarioExitDemoMode();
- StartBGMMusic();
-
- Kameck->Delete(1);
+ CleanupKameck(this, Kameck);
}
@@ -419,17 +351,14 @@ void daBalboa_c::updateModelMatrices() {
// this->direction = 1; }
else if (randChoice == 2) { // In the Center!
- char PlayerID = NearestPlayer(this);
- dStageActor_c *Player = GetSpecificPlayerActor(PlayerID);
+ char Pdir = dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(this, this->pos);
- this->upsideDown = 0;
- this->rot.z = 0;
- if (Player->pos.x < this->pos.x) {
- this->rot.y = 0xE000;
- this->direction = 0; }
- else {
+ if (Pdir) {
this->rot.y = 0x2000;
this->direction = 1; }
+ else {
+ this->rot.y = 0xE000;
+ this->direction = 0; }
}
PlaySound(this, 0x21F);
@@ -556,8 +485,8 @@ void daBalboa_c::updateModelMatrices() {
PlaySound(this, 0x221);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 1.0, 1.0}, 351);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 1.0, 1.0}, 352);
+ SpawnEffect("Wm_mr_sanddive_out", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 1.0, 1.0});
+ SpawnEffect("Wm_mr_sanddive_smk", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 1.0, 1.0});
}
void daBalboa_c::executeState_BackDown() {
@@ -581,11 +510,7 @@ void daBalboa_c::updateModelMatrices() {
bindAnimChr_and_setUpdateRate("dead", 1, 0.0, 1.0);
- WLClass::instance->_4 = 5;
- WLClass::instance->_8 = 0;
- dStage32C_c::instance->freezeMarioBossFlag = 1;
-
- this->removeMyActivePhysics();
+ OutroSetup(this);
this->timer = 0;
this->rot.x = 0x0; // X is vertical axis
this->rot.z = 0x0; // Z is ... an axis >.>
@@ -597,73 +522,20 @@ void daBalboa_c::updateModelMatrices() {
this->animationChr.setCurrentFrame(0.0);
if (this->dying == 1) {
- if (this->timer > 180) {
- ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE);
- }
-
- if (this->timer == 60) {
-
- if (GetSpecificPlayerActor(0) != 0) {
- PlaySound(this, SE_VOC_MA_CLEAR_BOSS);
- // Send PlBase into DemoGoal State here, kthxbai
- }
-
- if (GetSpecificPlayerActor(1) != 0) {
- PlaySound(this, SE_VOC_LU_CLEAR_BOSS);
- // Send PlBase into DemoGoal State here, kthxbai
- }
-
- if (GetSpecificPlayerActor(2) != 0) {
- PlaySound(this, SE_VOC_KO_CLEAR_BOSS);
- // Send PlBase into DemoGoal State here, kthxbai
- }
-
- if (GetSpecificPlayerActor(3) != 0) {
- PlaySound(this, SE_VOC_KO2_CLEAR_BOSS);
- // Send PlBase into DemoGoal State here, kthxbai
- }
- }
+ if (this->timer > 180) { ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE); }
+ if (this->timer == 60) { PlayerVictoryCries(this); }
this->timer += 1;
return;
}
- if (this->scale.x > 0.1) {
-
- PlaySound(this, SE_BOSS_CMN_DAMAGE_LAST);
- PlaySound(this, SE_EMY_BIG_TERESA_DEAD);
-
- // Adjust this to equal the scale of your boss / 80.
- this->scale.x -= 0.028125;
- this->scale.y -= 0.028125;
- this->scale.z -= 0.028125;
-
- this->pos.y -= 0.02;
-
- if (this->timer == 30) {
- Vec tempPos = (Vec){this->pos.x + 0.0, this->pos.y - 0.0, 5500.0};
-
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 756);
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 801);
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 957);
- this->timer = 0;
- }
- }
- else {
- this->scale.x = 0.0;
- this->scale.y = 0.0;
- this->scale.z = 0.0;
-
- Vec tempPos = (Vec){this->pos.x + 0.0, this->pos.y - 0.0, 5500.0};
-
- CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 588);
- this->dying = 1;
- this->timer = 0;
-
- PlaySound(this, STRM_BGM_SHIRO_BOSS_CLEAR);
- MakeMarioEnterDemoMode();
- }
+ bool ret;
+ ret = ShrinkBoss(this, &this->pos, 2.25, this->timer);
+ this->pos.y -= 0.02;
+ if (ret) { BossExplode(this, &this->pos); }
+ else { PlaySound(this, SE_EMY_CHOROPU_SIGN); }
+
this->timer += 1;
}