summaryrefslogtreecommitdiff
path: root/src/bossCaptainBowser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bossCaptainBowser.cpp')
-rw-r--r--src/bossCaptainBowser.cpp217
1 files changed, 148 insertions, 69 deletions
diff --git a/src/bossCaptainBowser.cpp b/src/bossCaptainBowser.cpp
index 0f1cf96..c894ecd 100644
--- a/src/bossCaptainBowser.cpp
+++ b/src/bossCaptainBowser.cpp
@@ -5,14 +5,32 @@
#include <stage.h>
#include "boss.h"
-extern "C" void *BowserExtiDemoState(void *, unsigned int);
-extern "C" void *MagicEnd(dStageActor_c *);
-
-void BowserDoom(dStageActor_c *Controller) {
- OSReport("THERE IS A FUCKING STATE HERE");
- BowserExtiDemoState(WLClass::instance, 1);
- MagicEnd(Controller);
- // MakeMarioExitDemoMode();
+extern "C" void *BowserExitDemoState(void *, unsigned int);
+extern "C" void *ForceMarioExitDemoMode(void *, unsigned int);
+extern "C" void *ShakeScreen(void *, unsigned int, unsigned int, unsigned int);
+extern "C" void *StageScreen;
+
+
+void BowserDoomStart(dStageActor_c *Controller) {
+ OSReport("Here we go!");
+
+ dEn_c *Bowser = (dEn_c*)FindActorByType(EN_BOSS_KOOPA, (Actor*)Controller);
+ Bowser->Delete(1);
+
+}
+
+void BowserDoomExecute(dStageActor_c *Controller) {
+ dFlagMgr_c::instance->set(0, 0, true, false, false);
+ dFlagMgr_c::instance->set(1, 0, true, false, false);
+ dFlagMgr_c::instance->set(2, 0, true, false, false);
+ dFlagMgr_c::instance->set(3, 0, true, false, false);
+ dFlagMgr_c::instance->set(4, 0, true, false, false);
+ Controller->Delete(1);
+}
+
+void BowserDoomEnd(dStageActor_c *Controller) {
+ OSReport("Bai bai everybody");
+ Controller->Delete(1);
}
@@ -76,12 +94,14 @@ public:
char isAngry;
char isInvulnerable;
+ char isIntro;
float scaleIncreaser;
int homingBillCountdown;
int homingBillSlot;
int maxDamage;
int playerCount;
float sinTimer;
+ float roarLen;
static daCaptainBowser *build();
@@ -110,23 +130,6 @@ daCaptainBowser *daCaptainBowser::build() {
return new(buffer) daCaptainBowser;
}
-void ShipPhysicsCallback(daCaptainBowser *self, dEn_c *other) {
- if (other->name == 657) {
- OSReport("CANNON COLLISION");
- if (self->isInvulnerable) {
- return;
- }
- self->damage -= 1;
-
- SpawnEffect("Wm_en_burst_m", 0, &other->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
- PlaySound(other, SE_OBJ_TARU_BREAK);
- other->Delete(1);
-
- if (self->damage == self->maxDamage/2) { self->doStateChange(&daCaptainBowser::StateID_Roar); }
- else if (self->damage < 0) { self->doStateChange(&daCaptainBowser::StateID_Outro); }
- }
-}
-
///////////////////////
// Externs and States
///////////////////////
@@ -169,6 +172,23 @@ void ShipPhysicsCallback(daCaptainBowser *self, dEn_c *other) {
}
}
+ void ShipPhysicsCallback(daCaptainBowser *self, dEn_c *other) {
+ if (other->name == 657) {
+ OSReport("CANNON COLLISION");
+ if (self->isInvulnerable) {
+ return;
+ }
+ self->damage -= 1;
+
+ SpawnEffect("Wm_en_burst_m", 0, &other->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ PlaySound(other, SE_OBJ_TARU_BREAK);
+ other->Delete(1);
+
+ if (self->damage == self->maxDamage/2) { self->doStateChange(&daCaptainBowser::StateID_Roar); }
+ else if (self->damage < 0) { self->doStateChange(&daCaptainBowser::StateID_Outro); }
+ }
+ }
+
void daCaptainBowser::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
DamagePlayer(this, apThis, apOther);
}
@@ -214,7 +234,7 @@ int daCaptainBowser::onCreate() {
// Prep the goods
this->playerCount = GetActivePlayerCount();
- this->maxDamage = (10* this->playerCount) +10;
+ this->maxDamage = (10 * this->playerCount) + 10;
this->scale = (Vec){0.57, 0.57, 0.57};
@@ -277,7 +297,8 @@ int daCaptainBowser::onCreate() {
// State Changers
- doStateChange(&StateID_Wait);
+ this->isIntro = 3;
+ doStateChange(&StateID_Intro);
return true;
}
@@ -295,49 +316,51 @@ int daCaptainBowser::onExecute() {
bodyModel._vf1C();
shipModel._vf1C();
- float xmod = sin(this->sinTimer * 3.14 / 180.0) * 80.0;
- float ymod = sin(this->sinTimer * 3.14 / 130.0) * 112.0;
+ if(this->isIntro == 0) {
- pos.x = ClassWithCameraInfo::instance->screenCentreX + 200.0 + xmod;
- pos.y = ClassWithCameraInfo::instance->screenCentreY - 180.0 + ymod;
+ float xmod = sin(this->sinTimer * 3.14 / 180.0) * 80.0;
+ float ymod = sin(this->sinTimer * 3.14 / 130.0) * 112.0;
- this->sinTimer++;
-
- // this->homingBillCountdown--;
-
- // if (this->homingBillCountdown == 0) {
+ pos.x = ClassWithCameraInfo::instance->screenCentreX + 200.0 + xmod;
+ pos.y = ClassWithCameraInfo::instance->screenCentreY - 180.0 + ymod;
+
+ this->sinTimer++;
+ }
+ // this->homingBillCountdown--;
- // Vec tempPos;
-
- // switch (this->homingBillSlot) {
- // case 0:
- // this->homingBillSlot++;
- // tempPos.x = this->pos.x - 26.0;
- // tempPos.y = this->pos.y + 40.0;
- // tempPos.z = this->pos.z + 2000.0;
- // break;
-
- // case 1:
- // this->homingBillSlot++;
- // tempPos.x = this->pos.x + 22.0;
- // tempPos.y = this->pos.y + 40.0;
- // tempPos.z = this->pos.z + 2000.0;
- // break;
-
- // case 2:
- // this->homingBillSlot = 0;
- // tempPos.x = this->pos.x + 70.0;
- // tempPos.y = this->pos.y + 40.0;
- // tempPos.z = this->pos.z + 2000.0;
- // break;
- // }
-
- // SpawnEffect("Wm_en_killervanish", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){0.1, 0.1, 0.1});
- // PlaySoundAsync(this, SE_EMY_SR_KILLER_SHOT);
- // CreateActor(EN_SEARCH_KILLER, 0, tempPos, 0, 0);
-
- // this->homingBillCountdown = (isAngry) ? 90: 180;
- // }
+ // if (this->homingBillCountdown == 0) {
+
+ // Vec tempPos;
+
+ // switch (this->homingBillSlot) {
+ // case 0:
+ // this->homingBillSlot++;
+ // tempPos.x = this->pos.x - 26.0;
+ // tempPos.y = this->pos.y + 40.0;
+ // tempPos.z = this->pos.z + 2000.0;
+ // break;
+
+ // case 1:
+ // this->homingBillSlot++;
+ // tempPos.x = this->pos.x + 22.0;
+ // tempPos.y = this->pos.y + 40.0;
+ // tempPos.z = this->pos.z + 2000.0;
+ // break;
+
+ // case 2:
+ // this->homingBillSlot = 0;
+ // tempPos.x = this->pos.x + 70.0;
+ // tempPos.y = this->pos.y + 40.0;
+ // tempPos.z = this->pos.z + 2000.0;
+ // break;
+ // }
+
+ // SpawnEffect("Wm_en_killervanish", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){0.1, 0.1, 0.1});
+ // PlaySoundAsync(this, SE_EMY_SR_KILLER_SHOT);
+ // CreateActor(EN_SEARCH_KILLER, 0, tempPos, 0, 0);
+
+ // this->homingBillCountdown = (isAngry) ? 90: 180;
+ // }
if(this->shipAnm.isAnimationDone()) {
this->shipAnm.setCurrentFrame(0.0);
@@ -347,6 +370,9 @@ int daCaptainBowser::onExecute() {
}
int daCaptainBowser::onDraw() {
+
+ if(this->isIntro > 2) { return false; }
+
matrix.translation(pos.x-146.0, pos.y+122.0, pos.z-200.0); // 136.0 is the bottom of the platform footing
short newrot = rot.y + 0xD800;
matrix.applyRotationYXZ(&rot.x, &newrot, &rot.z);
@@ -376,12 +402,65 @@ int daCaptainBowser::onDraw() {
// State Intro
//////////////////
void daCaptainBowser::beginState_Intro() {
-
+ this->timer = 0;
+ bindAnimChr_and_setUpdateRate("kp_wait", 1, 0.0, 1.5);
+ this->isInvulnerable = 1;
+ roarLen = 300;
}
void daCaptainBowser::executeState_Intro() {
+ if (this->chrAnimation.isAnimationDone()) {
+ // End the intro
+ if (this->isIntro == 1) {
+ OSReport("We're done: %d", this->timer);
+ doStateChange(&StateID_Wait);
+ return;
+ }
+ this->chrAnimation.setCurrentFrame(0.0); }
+
+ // Screen Rumble
+ // if ((this->timer > 180) && (this->timer < 420)) {
+ if (this->timer == 180) {
+ // Do Rumbly - 807CD3AC
+
+ pos.x = ClassWithCameraInfo::instance->screenCentreX;
+ pos.y = ClassWithCameraInfo::instance->screenCentreY;
+
+ ShakeScreen(StageScreen, 5, 1, 0);
+ OSReport("Shit Happens");
+ PlaySound(this, SE_BOSS_KOOPA_RUMBLE1); // 0x5D4
+ // Stage80::instance->ShakeScreen(self, 5, 1, 0);
+ }
+
+ // Bowser Flies In
+ if (this->timer == 422) { this->isIntro = 2; }
+ if ((this->timer > 420) && (this->timer < (420 + roarLen))) {
+ pos.x = ClassWithCameraInfo::instance->screenCentreX + ((this->timer - 420.0) * 1.5) - ((roarLen * 1.5) - 200.0);
+ pos.y = ClassWithCameraInfo::instance->screenCentreY - 380.0 + ((this->timer - 420.0) * 1.5) - ((roarLen * 1.5) - 200.0);
+ }
+
+ // Bowser does a shitty roar
+ if (this->timer == (roarLen - 190 + 420)) {
+ this->isIntro = 1;
+ bindAnimChr_and_setUpdateRate("kp_roar3", 1, 0.0, 1.0);
+ }
+ if (this->timer > (roarLen - 190 + 420)) {
+
+ if (this->chrAnimation.getCurrentFrame() == 53.0) {
+ PlaySound(this, SE_VOC_KP_L_SHOUT);
+ }
+
+ if (this->chrAnimation.getCurrentFrame() > 53.0) {
+ effect.spawn("Wm_ko_shout", 0, &(Vec){pos.x-186.0, pos.y+144.0, pos.z}, &(S16Vec){0,0,0x7000}, &(Vec){1.0, 1.0, 1.0});
+ }
+ }
+
+ this->timer++;
+ }
+ void daCaptainBowser::endState_Intro() {
+ this->isInvulnerable = 0;
+ this->isIntro = 0;
}
- void daCaptainBowser::endState_Intro() { }
//////////////////