summaryrefslogtreecommitdiff
path: root/src/bossRamboo.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bossRamboo.cpp178
1 files changed, 22 insertions, 156 deletions
diff --git a/src/bossRamboo.cpp b/src/bossRamboo.cpp
index 08a04f7..ff14fdc 100644
--- a/src/bossRamboo.cpp
+++ b/src/bossRamboo.cpp
@@ -3,10 +3,9 @@
#include <g3dhax.h>
#include <sfx.h>
#include <stage.h>
-#include "effects.h"
-#include "player.h"
+#include "boss.h"
-class daRamboo_c : public dEn_c {
+class daRamboo_c : public daBoss {
int onCreate();
int onDelete();
int onExecute();
@@ -35,7 +34,7 @@ class daRamboo_c : public dEn_c {
u64 eventFlag;
- dEn_c *Kameck;
+ daKameckDemo *Kameck;
static daRamboo_c *build();
@@ -66,21 +65,6 @@ daRamboo_c *daRamboo_c::build() {
}
-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(daRamboo_c *, Vec pos);
-extern "C" dStageActor_c *GetSpecificPlayerActor(int number);
-extern "C" void *PlaySound(daRamboo_c *, int soundID);
-
-extern "C" void *StopBGMMusic();
-extern "C" void *StartBGMMusic();
-
-extern "C" void *MakeMarioEnterDemoMode();
-extern "C" void *MakeMarioExitDemoMode();
-extern "C" void *UpdateGameMgr();
-
-
-
CREATE_STATE(daRamboo_c, Grow);
CREATE_STATE(daRamboo_c, Advance);
CREATE_STATE(daRamboo_c, Wait);
@@ -96,19 +80,10 @@ struct EventTable_t {
extern EventTable_t *EventTable;
-void daRamboo_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
- this->dEn_c::playerCollision(apThis, apOther);
- this->_vf220(apOther->owner);
-
- this->isDead = 0;
- this->flags_4FC |= (1<<(31-7));
- if(apOther->owner->which_player < 4) {
- this->counter_504[apOther->owner->which_player] = 0;
- }
-}
+void daRamboo_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); }
void daRamboo_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) {
OSReport("Hit Fireball");
- CreateEffect(378, &apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5});
+ SpawnEffect("Wm_en_obakedoor_sm", 0, &apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5});
this->pos.x += 6.0;
}
bool daRamboo_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { return false; }
@@ -116,8 +91,8 @@ void daRamboo_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysic
OSReport("Hit Rolling Object");
if (apOther->owner->name == 412) { // Check if it's a glow block
- CreateEffect(378, &apOther->owner->pos);
- CreateEffect(380, &apOther->owner->pos);
+ SpawnEffect("Wm_en_obakedoor_sm", 0, &apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ SpawnEffect("Wm_mr_yoshistep", 0, &apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
doStateChange(&StateID_Flee);
//FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void)
@@ -125,8 +100,8 @@ void daRamboo_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysic
}
}
void daRamboo_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { }
-void daRamboo_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { }
-void daRamboo_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) { }
+void daRamboo_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); }
+void daRamboo_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); }
@@ -272,13 +247,6 @@ int daRamboo_c::onExecute() {
this->fogSrt.process();
if(this->fogSrt.isEntryAnimationDone(0))
this->fogSrt.setFrameForEntry(1.0, 0);
-
- // if (this->aPhysics.result1 == 1) {
- // char PlayerID = NearestPlayer(this);
- // dStageActor_c *Player = GetSpecificPlayerActor(PlayerID);
-
- // this->_vf220(Player);
- // }
if (EventTable->events & this->eventFlag) {
doStateChange(&StateID_Outro);
@@ -326,60 +294,15 @@ void daRamboo_c::beginState_Grow() {
OSReport("Growing when Kameck Tells me to.");
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);
}
void daRamboo_c::executeState_Grow() {
- 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.175;
-
- float modifier;
-
- modifier = 1.0 + ((this->timer - 150) * scaleSpeed);
-
- this->scale = (Vec){modifier, modifier, modifier};
-
- }
+ bool ret;
+ ret = GrowBoss(this, Kameck, 1.0, 15.0, 0, this->timer);
- 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_CS_TERESA_BRING_IT);
doStateChange(&StateID_Advance);
}
@@ -387,14 +310,7 @@ void daRamboo_c::executeState_Grow() {
void daRamboo_c::endState_Grow() {
this->Baseline = this->pos.y;
- // Clean up the flags and Kameck
- dStage32C_c::instance->freezeMarioBossFlag = 0;
- WLClass::instance->_8 = 1;
-
- MakeMarioExitDemoMode();
- StartBGMMusic();
-
- Kameck->Delete(1);
+ CleanupKameck(this, Kameck);
}
@@ -542,18 +458,12 @@ void daRamboo_c::beginState_Outro() {
this->hideModel.bindAnim(&this->anmWaitB, 0.0);
this->anmWaitB.setUpdateRate(1.0);
- this->removeMyActivePhysics();
this->timer = 0;
this->rot.x = 0x0; // X is vertical axis
this->rot.y = 0xE000; // Y is horizontal axis
this->rot.z = 0x0; // Z is ... an axis >.>
- StopBGMMusic();
-
- WLClass::instance->_4 = 5;
- WLClass::instance->_8 = 0;
- dStage32C_c::instance->freezeMarioBossFlag = 1;
-
+ OutroSetup(this);
}
void daRamboo_c::executeState_Outro() {
@@ -566,66 +476,22 @@ void daRamboo_c::executeState_Outro() {
}
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
- }
+ PlayerVictoryCries(this);
}
this->timer += 1;
return;
}
- if (this->scale.x > 0) {
-
- 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.175;
- this->scale.y -= 0.175;
- this->scale.z -= 0.175;
-
- this->pos.y += 2.0;
-
- Vec tempPos = (Vec){this->pos.x + 160.0, this->pos.y - 80.0, 5500.0};
+ bool ret;
+ Vec tempPos = (Vec){this->pos.x + 160.0, this->pos.y - 80.0, 5500.0};
+ ret = ShrinkBoss(this, &tempPos, 15.0, this->timer);
- if (this->timer == 30) {
- 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;
- }
+ if (ret) {
+ BossExplode(this, &tempPos);
}
else {
- this->scale.x = 0.0;
- this->scale.y = 0.0;
- this->scale.z = 0.0;
-
- Vec tempPos = (Vec){this->pos.x + 160.0, this->pos.y - 80.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();
+ PlaySound(this, SE_EMY_BIG_TERESA_DEAD);
}
this->timer += 1;