summaryrefslogtreecommitdiff
path: root/src/bossThwompaDomp.cpp
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-03-09 01:40:14 -0600
committerColin Noga <Tempus@chronometry.ca>2012-03-09 01:40:14 -0600
commit59624313e01ef4269f2ca27babe522d407e200b0 (patch)
tree3ef69879f19f4eded72a310a94736e151a108cc7 /src/bossThwompaDomp.cpp
parent05d99e2cf552024116356591be0a88bf862b89c9 (diff)
downloadkamek-59624313e01ef4269f2ca27babe522d407e200b0.tar.gz
kamek-59624313e01ef4269f2ca27babe522d407e200b0.zip
Redid all the boss and custom sprite junk, effect list, saved 25 kb - but bosses break
Diffstat (limited to '')
-rw-r--r--src/bossThwompaDomp.cpp136
1 files changed, 18 insertions, 118 deletions
diff --git a/src/bossThwompaDomp.cpp b/src/bossThwompaDomp.cpp
index 89f2c14..b19045e 100644
--- a/src/bossThwompaDomp.cpp
+++ b/src/bossThwompaDomp.cpp
@@ -3,7 +3,7 @@
#include <g3dhax.h>
#include <sfx.h>
#include <stage.h>
-#include "effects.h"
+#include "boss.h"
// Externs
extern "C" int posIsInZone(Vec,float*,float*,u8 zone);
@@ -15,19 +15,8 @@
extern "C" Vec ConvertStagePositionIntoScreenPosition__Maybe(Vec);
extern "C" void AnotherSoundRelatedFunction(void*,SFX,Vec,int);
- extern "C" void *PlaySound(dEn_c *, int soundID);
- extern "C" void *PlaySoundAsync(dEn_c *, int soundID);
- extern "C" dStageActor_c *GetSpecificPlayerActor(int number);
- extern "C" void *StopBGMMusic();
- extern "C" void *StartBGMMusic();
-
- extern "C" void *MakeMarioEnterDemoMode();
- extern "C" void *MakeMarioExitDemoMode();
- extern "C" void *UpdateGameMgr();
-
-
-class daEnMegaDosun_c : public dEn_c {
+class daEnMegaDosun_c : public daBoss {
int onCreate();
int onDelete();
int onExecute();
@@ -56,7 +45,7 @@ class daEnMegaDosun_c : public dEn_c {
bool isOutofScreen;
Vec OutOfScreenPosition;
- dEn_c *Kameck;
+ daKameckDemo *Kameck;
void setupBodyModel();
@@ -99,23 +88,15 @@ daEnMegaDosun_c *daEnMegaDosun_c::build() {
// Collisions
void daEnMegaDosun_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
- this->dEn_c::playerCollision(apThis, apOther);
- this->_vf220(apOther->owner);
-
- // fix multiple player collisions via megazig
- this->isDead = 0;
- this->flags_4FC |= (1<<(31-7));
- if(apOther->owner->which_player < 4) {
- this->counter_504[apOther->owner->which_player] = 0;
- }
+ DamagePlayer(this, apThis, apOther);
}
void daEnMegaDosun_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { }
bool daEnMegaDosun_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { return false; }
- void daEnMegaDosun_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { }
+ void daEnMegaDosun_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); }
void daEnMegaDosun_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { }
void daEnMegaDosun_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { }
void daEnMegaDosun_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) { }
- void daEnMegaDosun_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) { }
+ void daEnMegaDosun_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); }
void daEnMegaDosun_c::setupBodyModel() {
@@ -252,77 +233,24 @@ int daEnMegaDosun_c::onDelete() {
void daEnMegaDosun_c::beginState_Grow() {
this->scale = (Vec){0.5, 0.5, 0.5};
-
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 daEnMegaDosun_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.00625;
-
- float modifier;
-
- modifier = 0.5 + ((this->timer - 150) * scaleSpeed);
-
- this->scale = (Vec){modifier, modifier, modifier};
- }
+ bool ret;
+ ret = GrowBoss(this, Kameck, 0.5, 1.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_BIG_DOSSUN);
doStateChange(&StateID_UpMove);
}
+ this->timer += 1;
}
void daEnMegaDosun_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);
}
// StateID_UpWait
@@ -337,14 +265,14 @@ int daEnMegaDosun_c::onDelete() {
}
if (this->pos.x > this->rightBuffer) {
- CreateEffect(&(Vec){this->pos.x + 38.0, this->pos.y + 32.0, 5500.0}, &(S16Vec){0,0,0x4000}, &(Vec){1.0, 1.0, 1.0}, 364);
+ SpawnEffect("Wm_en_dossunfall02", 0, &(Vec){this->pos.x + 38.0, this->pos.y + 32.0, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
PlaySoundAsync(this, SE_OBJ_TEKKYU_G_CRASH);
this->direction = 0;
}
if (this->pos.x < this->leftBuffer) {
- CreateEffect(&(Vec){this->pos.x - 40.0, this->pos.y + 32.0, 5500.0}, &(S16Vec){0,0,0xC000}, &(Vec){1.0, 1.0, 1.0}, 364);
+ SpawnEffect("Wm_en_dossunfall02", 0, &(Vec){this->pos.x - 40.0, this->pos.y + 32.0, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
PlaySoundAsync(this, SE_OBJ_TEKKYU_G_CRASH);
this->direction = 1;
@@ -493,16 +421,8 @@ int daEnMegaDosun_c::onDelete() {
// Outro
void daEnMegaDosun_c::beginState_Outro() {
- OSReport("Outro Being\n");
-
- WLClass::instance->_4 = 5;
- WLClass::instance->_8 = 0;
-
- this->removeMyActivePhysics();
+ OutroSetup(this);
this->timer = 0;
- StopBGMMusic();
-
- dStage32C_c::instance->freezeMarioBossFlag = 1;
this->speed.y = 0.0;
this->y_speed_inc = 0.0;
@@ -516,8 +436,8 @@ int daEnMegaDosun_c::onDelete() {
PlaySound(this, SE_EMY_BIG_DOSSUN_DEAD);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 988);
- CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 989);
+ SpawnEffect("Wm_mr_stockitemuse_b", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0});
+ SpawnEffect("Wm_mr_stockitemuse_c", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0});
}
if (this->timer == 60) {
@@ -529,27 +449,7 @@ int daEnMegaDosun_c::onDelete() {
if (this->timer == 120) {
OSReport("Outro Play Victory Cry\n");
- UpdateGameMgr();
-
- 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);
}
if (this->timer > 240) {