diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-03-09 01:40:14 -0600 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-03-09 01:40:14 -0600 |
commit | 59624313e01ef4269f2ca27babe522d407e200b0 (patch) | |
tree | 3ef69879f19f4eded72a310a94736e151a108cc7 | |
parent | 05d99e2cf552024116356591be0a88bf862b89c9 (diff) | |
download | kamek-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-- | bossTopman.yaml | 2 | ||||
-rw-r--r-- | src/boss.cpp | 140 | ||||
-rw-r--r-- | src/boss.h | 48 | ||||
-rw-r--r-- | src/bossBalboaWrench.cpp | 182 | ||||
-rw-r--r-- | src/bossFuzzyBear.cpp | 348 | ||||
-rw-r--r-- | src/bossMegaGoomba.cpp | 30 | ||||
-rw-r--r-- | src/bossPodouble.cpp | 204 | ||||
-rw-r--r-- | src/bossRamboo.cpp | 178 | ||||
-rw-r--r-- | src/bossThwompaDomp.cpp | 136 | ||||
-rw-r--r-- | src/bossTopman.cpp | 196 | ||||
-rw-r--r-- | src/bossWrenchThrow.cpp | 40 | ||||
-rw-r--r-- | src/effectvideo.cpp | 26 | ||||
-rw-r--r-- | src/electricLine.cpp | 3 | ||||
-rw-r--r-- | src/fakeStarCoin.cpp | 27 | ||||
-rwxr-xr-x | src/firelaser.cpp | 4 | ||||
-rw-r--r-- | src/levelspecial.cpp | 186 | ||||
-rwxr-xr-x | src/mrsun.cpp | 26 | ||||
-rw-r--r-- | src/penguin.cpp | 2 | ||||
-rw-r--r-- | src/shyguy.cpp | 24 | ||||
-rw-r--r-- | src/topman.cpp | 7 | ||||
-rw-r--r-- | worldmap.yaml | 3 |
21 files changed, 598 insertions, 1214 deletions
diff --git a/bossTopman.yaml b/bossTopman.yaml index 94ab3ac..31f7f6b 100644 --- a/bossTopman.yaml +++ b/bossTopman.yaml @@ -5,6 +5,6 @@ source_files: [../src/bossTopman.cpp] hooks: - name: BossTopmanBuild type: add_func_pointer - src_addr_pal: 0x8095D018 + src_addr_pal: 0x8097BCC0 target_func: 'daDreidel::build(void)' diff --git a/src/boss.cpp b/src/boss.cpp new file mode 100644 index 0000000..e90dd2c --- /dev/null +++ b/src/boss.cpp @@ -0,0 +1,140 @@ +#include "boss.h" + + + +void DamagePlayer(dEn_c *actor, ActivePhysics *apThis, ActivePhysics *apOther) { + actor->dEn_c::playerCollision(apThis, apOther); + actor->_vf220(apOther->owner); + + // fix multiple player collisions via megazig + actor->isDead = 0; + actor->flags_4FC |= (1<<(31-7)); + if(apOther->owner->which_player < 4) { + actor->counter_504[apOther->owner->which_player] = 0; + } +} + + +void SetupKameck(daBoss *actor, daKameckDemo *Kameck) { + // 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){actor->pos.x - 124.0, actor->pos.y + 104.0, 3564.0}; + S16Vec rot = (S16Vec){0, 0, 0}; + + // Create And use Kameck + Kameck = (daKameckDemo*)actor->createChild(KAMECK_FOR_CASTLE_DEMO, (dStageActor_c*)actor, 0, &pos, &rot, 0); + Kameck->doStateChange(&daKameckDemo::StateID_DemoWait); +} + + +void CleanupKameck(daBoss *actor, daKameckDemo *Kameck) { + // Clean up the flags and Kameck + dStage32C_c::instance->freezeMarioBossFlag = 0; + WLClass::instance->_8 = 1; + + MakeMarioExitDemoMode(); + StartBGMMusic(); + + Kameck->Delete(1); +} + + +bool GrowBoss(daBoss *actor, daKameckDemo *Kameck, float initialScale, float endScale, float yPosModifier, int timer) { + if (timer == 130) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt); } + if (timer == 400) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt2); } + + float scaleSpeed, yPosScaling; + + if (timer == 150) { PlaySound(actor, SE_BOSS_IGGY_WANWAN_TO_L); } + + if ((timer > 150) && (timer < 230)) { + scaleSpeed = (endScale -initialScale) / 80.0; + + float modifier; + + modifier = initialScale + ((timer - 150) * scaleSpeed); + + actor->scale = (Vec){modifier, modifier, modifier}; + actor->pos.y = actor->pos.y + (yPosModifier/80.0); + } + + if (timer == 360) { + Vec tempPos = (Vec){actor->pos.x - 40.0, actor->pos.y + 120.0, 3564.0}; + SpawnEffect("Wm_ob_greencoinkira", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_mr_yoshiicehit_a", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_mr_yoshiicehit_b", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_ob_redringget", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_ob_keyget01", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_ob_greencoinkira_a", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_ob_keyget01_c", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + } + + if (timer > 420) { return true; } + return false; +} + + +void OutroSetup(daBoss *actor) { + actor->removeMyActivePhysics(); + + StopBGMMusic(); + + WLClass::instance->_4 = 5; + WLClass::instance->_8 = 0; + dStage32C_c::instance->freezeMarioBossFlag = 1; +} + + +bool ShrinkBoss(daBoss *actor, Vec *pos, float scale, int timer) { + PlaySound(actor, SE_BOSS_CMN_DAMAGE_LAST); + + // Adjust actor to equal the scale of your boss / 80. + actor->scale.x -= scale / 80.0; + actor->scale.y -= scale / 80.0; + actor->scale.z -= scale / 80.0; + + actor->pos.y += 2.0; + + + if (actor->timer == 30) { + SpawnEffect("Wm_ob_starcoinget_gl", 0, pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}); + SpawnEffect("Wm_mr_vshipattack_hosi", 0, pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}); + SpawnEffect("Wm_ob_keyget01_b", 0, pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}); + actor->timer = 0; + } + + if (actor->scale.x < 0) { return true; } + return false; +} + + +void BossExplode(daBoss *actor, Vec *pos) { + actor->scale.x = 0.0; + actor->scale.y = 0.0; + actor->scale.z = 0.0; + + SpawnEffect("Wm_ob_keyget02", 0, pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}); + actor->dying = 1; + actor->timer = 0; + + PlaySound(actor, STRM_BGM_SHIRO_BOSS_CLEAR); + MakeMarioEnterDemoMode(); +} + + +void PlayerVictoryCries(daBoss *actor) { + UpdateGameMgr(); + if (GetSpecificPlayerActor(0) != 0) { PlaySound(actor, SE_VOC_MA_CLEAR_BOSS); } + if (GetSpecificPlayerActor(1) != 0) { PlaySound(actor, SE_VOC_LU_CLEAR_BOSS); } + if (GetSpecificPlayerActor(2) != 0) { PlaySound(actor, SE_VOC_KO_CLEAR_BOSS); } + if (GetSpecificPlayerActor(3) != 0) { PlaySound(actor, SE_VOC_KO2_CLEAR_BOSS); } +}
\ No newline at end of file diff --git a/src/boss.h b/src/boss.h new file mode 100644 index 0000000..784c5fa --- /dev/null +++ b/src/boss.h @@ -0,0 +1,48 @@ +#ifndef __PLAYER_H +#define __PLAYER_H + +#include <common.h> +#include <game.h> +#include <g3dhax.h> +#include <stage.h> +#include <sfx.h> + +extern "C" void *PlaySound(dStageActor_c *, int soundID); +extern "C" void *PlaySoundAsync(dStageActor_c *, int soundID); + +extern "C" bool SpawnEffect(const char*, int, Vec*, S16Vec*, Vec*); + +extern "C" dStageActor_c* GetSpecificPlayerActor(int number); +extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); + +extern "C" u32 GenerateRandomNumber(int max); +extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(dEn_c *, Vec pos); +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(); + + +class daBoss : public dEn_c { +public: + u32 timer; + char dying; +}; + + +// Functions +void DamagePlayer(dEn_c* actor, ActivePhysics *apThis, ActivePhysics *apOther); +void SetupKameck(daBoss* actor, daKameckDemo *Kameck); +void CleanupKameck(daBoss* actor, daKameckDemo *Kameck); +bool GrowBoss(daBoss* actor, daKameckDemo *Kameck, float initialScale, float endScale, float yPosModifier, int timer); +void OutroSetup(daBoss* actor); +bool ShrinkBoss(daBoss *actor, Vec *pos, float scale, int timer); +void BossExplode(daBoss* actor, Vec *pos); +void PlayerVictoryCries(daBoss* actor); + +#endif + 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; } diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp index 3fe4085..55b907e 100644 --- a/src/bossFuzzyBear.cpp +++ b/src/bossFuzzyBear.cpp @@ -3,11 +3,10 @@ #include <g3dhax.h> #include <sfx.h> #include <stage.h> -#include "effects.h" -#include "player.h" +#include "boss.h" -class daFuzzyBear_c : public dEn_c { +class daFuzzyBear_c : public daBoss { int onCreate(); int onDelete(); int onExecute(); @@ -35,7 +34,7 @@ class daFuzzyBear_c : public dEn_c { char roly; char isInvulnerable; - dEn_c *Kameck; + daKameckDemo *Kameck; static daFuzzyBear_c *build(); @@ -58,7 +57,7 @@ class daFuzzyBear_c : public dEn_c { USING_STATES(daFuzzyBear_c); DECLARE_STATE(Grow); DECLARE_STATE(Bounce); - DECLARE_STATE(Needles); + // DECLARE_STATE(Needles); DECLARE_STATE(Spray); DECLARE_STATE(RolyPoly); DECLARE_STATE(Wait); @@ -71,25 +70,10 @@ daFuzzyBear_c *daFuzzyBear_c::build() { } -extern "C" void *PlaySound(daFuzzyBear_c *, int soundID); -extern "C" void *StopSound(int soundID); - -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(daFuzzyBear_c *, Vec pos); -extern "C" dStageActor_c *GetSpecificPlayerActor(int num); - -extern "C" void *StopBGMMusic(); -extern "C" void *StartBGMMusic(); - -extern "C" void *MakeMarioEnterDemoMode(); -extern "C" void *MakeMarioExitDemoMode(); -extern "C" void *UpdateGameMgr(); - CREATE_STATE(daFuzzyBear_c, Grow); CREATE_STATE(daFuzzyBear_c, Bounce); -CREATE_STATE(daFuzzyBear_c, Needles); +// CREATE_STATE(daFuzzyBear_c, Needles); CREATE_STATE(daFuzzyBear_c, Spray); CREATE_STATE(daFuzzyBear_c, RolyPoly); CREATE_STATE(daFuzzyBear_c, Wait); @@ -97,28 +81,15 @@ CREATE_STATE(daFuzzyBear_c, Outro); -void daFuzzyBear_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 daFuzzyBear_c::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { - this->playerCollision(apThis, apOther); -} +void daFuzzyBear_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } +void daFuzzyBear_c::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } void daFuzzyBear_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { - if (this->isInvulnerable == 1) { return; } this->timer = 0; PlaySound(this, SE_BOSS_KOOPA_FIRE_DISAPP); - CreateEffect(&apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 102); + SpawnEffect("Wm_mr_fireball_hit", 0, &apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); this->damage++; if (this->damage > 14) { doStateChange(&StateID_Outro); } } @@ -138,7 +109,7 @@ void daFuzzyBear_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhy mario->doSpriteMovement(); } void daFuzzyBear_c::collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { - this->collisionCat7_WMWaggleWater(apThis, apOther); + this->collisionCat9_RollingObject(apThis, apOther); } void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -172,7 +143,7 @@ void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhy PlaySound(this, SE_EMY_BLOW_PAKKUN_DOWN); - CreateEffect(&blah->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 161); + SpawnEffect("Wm_mr_kickhit", 0, &blah->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); if (this->damage > 14) { doStateChange(&StateID_Outro); } else { doStateChange(&StateID_RolyPoly); } @@ -191,7 +162,7 @@ void daFuzzyBear_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics * this->timer = 0; this->damage += 5; - CreateEffect(&apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 162); + SpawnEffect("Wm_mr_kick_glow", 0, &apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); if (this->damage > 14) { doStateChange(&StateID_Outro); } else { doStateChange(&StateID_RolyPoly); } @@ -199,7 +170,7 @@ void daFuzzyBear_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics * bool daFuzzyBear_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { return false; } void daFuzzyBear_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) { } -void daFuzzyBear_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) { } +void daFuzzyBear_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } @@ -332,84 +303,27 @@ void daFuzzyBear_c::updateModelMatrices() { void daFuzzyBear_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); this->scale = (Vec){1.0, 1.0, 1.0}; } void daFuzzyBear_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)) { - - if (BigBossFuzzyBear == 1) { - scaleSpeed = 0.025; - yPosScaling = 25; } - else { - scaleSpeed = 0.01875; - yPosScaling = 18; } + this->timer += 1; - float modifier; - - modifier = 1.0 + ((this->timer - 150) * scaleSpeed); - - this->scale = (Vec){modifier, modifier, modifier}; - this->pos.y = this->pos.y + (yPosScaling/80); - - } - - if (this->timer == 360) { + bool ret; + if (BigBossFuzzyBear == 1) { + ret = GrowBoss(this, Kameck, 1.0, 3.0, 25, this->timer); } + else { + ret = GrowBoss(this, Kameck, 1.0, 2.5, 18, this->timer); } - 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 (ret) { doStateChange(&StateID_Bounce); } - } - - if (this->timer > 420) { doStateChange(&StateID_Bounce); } - } void daFuzzyBear_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); } @@ -483,7 +397,7 @@ void daFuzzyBear_c::executeState_Bounce() { } else if (this->timer == 10) { Vec tempPos = (Vec){this->pos.x, this->pos.y - wallDistance, 5500.0}; - CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 66); + SpawnEffect("Wm_mr_beachlandsmk", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); } else { float modifier; @@ -532,76 +446,76 @@ void daFuzzyBear_c::endState_Bounce() { OSReport("No more bouncing."); } // Needles State - shoots out some black icicles -void daFuzzyBear_c::beginState_Needles() { - this->timer = 0; - this->speed.y = 0; - this->speed.x = 0; - OSReport("Fuzzy Needle State Begin"); -} -void daFuzzyBear_c::executeState_Needles() { - float origScale; - - this->speed.y = 0; - this->speed.x = 0; - - if (BigBossFuzzyBear == 0) { - origScale = 2.5; - } - else { - origScale = 3.0; - } - - this->timer = this->timer + 1; - OSReport("Needle Timer: %d", this->timer); - - if (this->timer <= 120) { - this->scale.y = (sin(this->timer * 3.14 / 5.0) / 2.0) + origScale; // 3 shakes per second, exactly 24 shakes overall - this->scale.x = (sin(this->timer * 3.14 / 5.0) / 2.0) + origScale; // 3 shakes per second, exactly 24 shakes overall - - if (this->timer == 30) { - dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); - spawner->speed.x = -6.0; - spawner->speed.y = 0.0; - spawner->scale = (Vec){1.0, 1.0, 1.0}; - } - - if (this->timer == 45) { - dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); - spawner->speed.x = 6.0; - spawner->speed.y = 6.0; - spawner->scale = (Vec){1.0, 1.0, 1.0}; - } - - if (this->timer == 60) { - dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); - spawner->speed.x = 0.0; - spawner->speed.y = 6.0; - spawner->scale = (Vec){1.0, 1.0, 1.0}; - } - - if (this->timer == 75) { - dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); - spawner->speed.x = -6.0; - spawner->speed.y = 6.0; - spawner->scale = (Vec){1.0, 1.0, 1.0}; - } - - if (this->timer == 90) { - dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); - spawner->speed.x = -6.0; - spawner->speed.y = 0.0; - spawner->scale = (Vec){1.0, 1.0, 1.0}; - } - } - else { doStateChange(&StateID_Bounce); } - - this->HandleXSpeed(); - this->HandleYSpeed(); - - this->UpdateObjectPosBasedOnSpeedValuesReal(); - -} -void daFuzzyBear_c::endState_Needles() { OSReport("Fuzzy Needle State End"); } +// void daFuzzyBear_c::beginState_Needles() { +// this->timer = 0; +// this->speed.y = 0; +// this->speed.x = 0; +// OSReport("Fuzzy Needle State Begin"); +// } +// void daFuzzyBear_c::executeState_Needles() { +// float origScale; + +// this->speed.y = 0; +// this->speed.x = 0; + +// if (BigBossFuzzyBear == 0) { +// origScale = 2.5; +// } +// else { +// origScale = 3.0; +// } + +// this->timer = this->timer + 1; +// OSReport("Needle Timer: %d", this->timer); + +// if (this->timer <= 120) { +// this->scale.y = (sin(this->timer * 3.14 / 5.0) / 2.0) + origScale; // 3 shakes per second, exactly 24 shakes overall +// this->scale.x = (sin(this->timer * 3.14 / 5.0) / 2.0) + origScale; // 3 shakes per second, exactly 24 shakes overall + +// if (this->timer == 30) { +// dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); +// spawner->speed.x = -6.0; +// spawner->speed.y = 0.0; +// spawner->scale = (Vec){1.0, 1.0, 1.0}; +// } + +// if (this->timer == 45) { +// dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); +// spawner->speed.x = 6.0; +// spawner->speed.y = 6.0; +// spawner->scale = (Vec){1.0, 1.0, 1.0}; +// } + +// if (this->timer == 60) { +// dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); +// spawner->speed.x = 0.0; +// spawner->speed.y = 6.0; +// spawner->scale = (Vec){1.0, 1.0, 1.0}; +// } + +// if (this->timer == 75) { +// dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); +// spawner->speed.x = -6.0; +// spawner->speed.y = 6.0; +// spawner->scale = (Vec){1.0, 1.0, 1.0}; +// } + +// if (this->timer == 90) { +// dStageActor_c *spawner = CreateActor(339, 0, this->pos, 0, 0); +// spawner->speed.x = -6.0; +// spawner->speed.y = 0.0; +// spawner->scale = (Vec){1.0, 1.0, 1.0}; +// } +// } +// else { doStateChange(&StateID_Bounce); } + +// this->HandleXSpeed(); +// this->HandleYSpeed(); + +// this->UpdateObjectPosBasedOnSpeedValuesReal(); + +// } +// void daFuzzyBear_c::endState_Needles() { OSReport("Fuzzy Needle State End"); } // Spray State - jumps in the air and shakes out some small fuzzies @@ -702,7 +616,9 @@ void daFuzzyBear_c::executeState_RolyPoly() { Vec tempPos = (Vec){this->pos.x, this->pos.y - 34.0, 5500.0}; - if (this->timer & 0x1) { CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){0.4, 0.4, 0.4}, 242); } + if (this->timer & 0x1) { + SpawnEffect("Wm_ob_icehitsmk", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){0.4, 0.4, 0.4}); + } } if (this->direction == 0) { // is even @@ -763,8 +679,6 @@ void daFuzzyBear_c::endState_RolyPoly() { - - void daFuzzyBear_c::beginState_Wait() { this->timer = 0;} void daFuzzyBear_c::executeState_Wait() { @@ -782,83 +696,25 @@ void daFuzzyBear_c::endState_Wait() { } void daFuzzyBear_c::beginState_Outro() { - - WLClass::instance->_4 = 5; - WLClass::instance->_8 = 0; - - this->removeMyActivePhysics(); - this->timer = 0; - StopBGMMusic(); - - dStage32C_c::instance->freezeMarioBossFlag = 1; - + OutroSetup(this); } void daFuzzyBear_c::executeState_Outro() { if (this->dying == 1) { - if (this->timer > 180) { - ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE); - } - - if (this->timer == 60) { - - 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 - } - } + 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); - - // Adjust this to equal the scale of your boss / 80. - this->scale.x -= 0.015; - this->scale.y -= 0.015; - this->scale.z -= 0.015; + bool ret; + ret = ShrinkBoss(this, &this->pos, 2.75, this->timer); - if (this->timer == 30) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 756); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 801); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 957); - this->timer = 0; - } + if (ret) { BossExplode(this, &this->pos); } - this->timer += 1; - } - else { - this->scale.x = 0.0; - this->scale.y = 0.0; - this->scale.z = 0.0; - - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 588); - this->dying = 1; - this->timer = 0; + this->timer += 1; - PlaySound(this, STRM_BGM_SHIRO_BOSS_CLEAR); - MakeMarioEnterDemoMode(); - } } void daFuzzyBear_c::endState_Outro() { } diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp index f701ee7..e353c23 100644 --- a/src/bossMegaGoomba.cpp +++ b/src/bossMegaGoomba.cpp @@ -3,7 +3,29 @@ #include <g3dhax.h> #include <sfx.h> -#include "player.h" +//Enable this if you're fixing it +// void setNewActivePhysicsRect(dStageActor_c* actor, Vec* scale) { +// float amtX = scale->x; +// float amtY = scale->y; + +// ActivePhysics::Info info; +// info.xDistToCenter = 0.0; +// info.yDistToCenter = 7.65 * amtY; +// info.xDistToEdge = 4.0 * amtX; +// info.yDistToEdge = 7.7 * amtY; + +// info.category1 = actor->aPhysics.info.category1; +// info.category2 = actor->aPhysics.info.category2; +// info.bitfield1 = actor->aPhysics.info.bitfield1; +// info.bitfield2 = actor->aPhysics.info.bitfield2; +// info.unkShort1C = actor->aPhysics.info.unkShort1C; +// info.callback = actor->aPhysics.info.callback; + +// //OSReport("Making new Physics Class and adding to the list\n"); +// actor->aPhysics.removeFromList(); +// actor->aPhysics.initWithStruct(actor, &info); +// actor->aPhysics.addToList(); +// } class daMegaGoomba_c : public dEn_c { int onCreate(); @@ -465,7 +487,7 @@ void daMegaGoomba_c::executeState_Grow() { float modifier = GetHermiteCurveValue(this->timer, this->keysX, Xkey_count); this->scale = (Vec){modifier, modifier, modifier}; - setNewActivePhysicsRect(this, &this->scale); + // setNewActivePhysicsRect(this, &this->scale); } if(this->timer == 60.0) @@ -488,7 +510,7 @@ void daMegaGoomba_c::beginState_Shrink() { // disable being hit Vec tempVec = (Vec){0.0, 0.0, 0.0}; - setNewActivePhysicsRect(this, &tempVec ); + // setNewActivePhysicsRect(this, &tempVec ); } void daMegaGoomba_c::executeState_Shrink() { this->timer += 1.0; @@ -503,7 +525,7 @@ void daMegaGoomba_c::executeState_Shrink() { } void daMegaGoomba_c::endState_Shrink() { // enable being hit - setNewActivePhysicsRect(this, &this->scale); + // setNewActivePhysicsRect(this, &this->scale); this->already_hit = false; } diff --git a/src/bossPodouble.cpp b/src/bossPodouble.cpp index 77dae1a..e79f20a 100644 --- a/src/bossPodouble.cpp +++ b/src/bossPodouble.cpp @@ -3,8 +3,7 @@ #include <g3dhax.h> #include <sfx.h> #include <stage.h> -#include "effects.h" -#include "player.h" +#include "boss.h" void poodleCollisionCallback(ActivePhysics *apThis, ActivePhysics *apOther); @@ -14,7 +13,7 @@ void poodleCollisionCallback(ActivePhysics *apThis, ActivePhysics *apOther) { else { dEn_c::collisionCallback(apThis, apOther); } } -class daPodouble : public dEn_c { +class daPodouble : public daBoss { int onCreate(); int onDelete(); int onExecute(); @@ -45,7 +44,7 @@ class daPodouble : public dEn_c { char isInvulnerable; int countdown; - dEn_c *Kameck; + daKameckDemo *Kameck; static daPodouble *build(); @@ -84,21 +83,10 @@ daPodouble *daPodouble::build() { /////////////////////// // Externs and States /////////////////////// - extern "C" void *PlaySound(dStageActor_c *, int soundID); - extern "C" void *PlaySoundAsync(dStageActor_c *, int soundID); - - extern "C" u32 GenerateRandomNumber(int max); - extern "C" dStageActor_c *GetSpecificPlayerActor(int num); extern "C" int SmoothRotation(short* rot, u16 amt, int unk2); extern "C" void* WaterManager; extern "C" u32 CheckforLiquid(void*, Vec, int, int, int, int layer); - extern "C" void *StopBGMMusic(); - extern "C" void *StartBGMMusic(); - - extern "C" void *MakeMarioEnterDemoMode(); - extern "C" void *MakeMarioExitDemoMode(); - extern "C" void *UpdateGameMgr(); CREATE_STATE(daPodouble, Bounce); @@ -114,17 +102,7 @@ daPodouble *daPodouble::build() { // Collision Functions //////////////////////// - void daPodouble::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 < 3) { - this->counter_504[apOther->owner->which_player] = 0; - } - } + void daPodouble::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } void daPodouble::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { this->playerCollision(apThis, apOther); } void daPodouble::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { this->playerCollision(apThis, apOther); } @@ -359,79 +337,27 @@ int daPodouble::onDraw() { this->timer = 0; if (isFire) { return; } - // 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); this->scale = (Vec){1.0, 1.0, 1.0}; } void daPodouble::executeState_Grow() { - this->timer = this->timer + 1; - - float scaleSpeed, yPosScaling; - - - if ((this->timer > 150) && (this->timer < 230)) { - - scaleSpeed = 0.03125; - yPosScaling = 18; + this->timer += 1; - float modifier; + bool ret; + ret = GrowBoss(this, Kameck, 1.0, 3.5, 18, this->timer); - modifier = 1.0 + ((this->timer - 150) * scaleSpeed); - - this->scale = (Vec){modifier, modifier, modifier}; - this->pos.y = this->pos.y + (yPosScaling/80); - - } - if (this->timer > 420) { + if (ret) { PlaySound(this, SE_EMY_CS_MOVE_W8_BUBBLE_APP); doStateChange(&StateID_Bounce); } - - if (isFire) { return; } - if (this->timer == 130) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt); } - if (this->timer == 150) { PlaySound(this, SE_BOSS_IGGY_WANWAN_TO_L); } - if (this->timer == 400) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt2); } - 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 - } } void daPodouble::endState_Grow() { this->Baseline = this->pos.y; if (isFire) { return; } - // Clean up the flags and Kameck - dStage32C_c::instance->freezeMarioBossFlag = 0; - WLClass::instance->_8 = 1; - - MakeMarioExitDemoMode(); - StartBGMMusic(); - - Kameck->Delete(1); + CleanupKameck(this, Kameck); } @@ -474,11 +400,11 @@ int daPodouble::onDraw() { OSReport("Liquid type %d", liquid); if (liquid == 1) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}, 415); + SpawnEffect("Wm_mr_magmawave", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}); PlaySoundAsync(this, SE_EMY_BUBBLE_SPLASH); } if (liquid == 0) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}, 422); + SpawnEffect("Wm_mr_waterwave_in", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}); PlaySoundAsync(this, SE_OBJ_CMN_SPLASH); } @@ -534,10 +460,10 @@ int daPodouble::onDraw() { if (this->isFire == 0) { PlaySoundAsync(this, SE_OBJ_PNGN_ICE_THAW); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 243); } + SpawnEffect("Wm_ob_iceevaporate", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}); } else { PlaySoundAsync(this, SE_EMY_FIRE_SNAKE_EXTINCT); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}, 252); } + SpawnEffect("Wm_en_firesnk_icehitsmk_b", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}); } } void daPodouble::executeState_Damage() { @@ -580,82 +506,28 @@ int daPodouble::onDraw() { daPodouble *other = (daPodouble*)FindActorByType(SHIP_WINDOW, (Actor*)this); if (other != 0) { other->doStateChange(&StateID_SyncDie); } - WLClass::instance->_4 = 5; - WLClass::instance->_8 = 0; - - this->removeMyActivePhysics(); + OutroSetup(this); this->timer = 0; - StopBGMMusic(); - - dStage32C_c::instance->freezeMarioBossFlag = 1; } void daPodouble::executeState_Outro() { if (this->dying == 1) { - if (this->timer > 180) { - ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE); - } - - if (this->timer == 60) { - - 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 - } - } + 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_EMY_BUBBLE_EXTINCT); - - // Adjust this to equal the scale of your boss / 80. - this->scale.x -= 0.04375; - this->scale.y -= 0.04375; - this->scale.z -= 0.04375; + bool ret; + ret = ShrinkBoss(this, &this->pos, 3.5, this->timer); - if (this->timer == 30) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 756); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 801); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 957); - this->timer = 0; - } - - this->timer += 1; - } - else { - this->scale.x = 0.0; - this->scale.y = 0.0; - this->scale.z = 0.0; - - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 588); - this->dying = 1; - this->timer = 0; + if (ret) { BossExplode(this, &this->pos); } + else { PlaySound(this, SE_EMY_BUBBLE_EXTINCT); } + + this->timer += 1; - PlaySound(this, STRM_BGM_SHIRO_BOSS_CLEAR); - MakeMarioEnterDemoMode(); - } } void daPodouble::endState_Outro() { } @@ -673,32 +545,12 @@ int daPodouble::onDraw() { if (this->dying == 1) { return; } - if (this->scale.x > 0.1) { + bool ret; + ret = ShrinkBoss(this, &this->pos, 3.5, this->timer); - PlaySound(this, SE_EMY_BUBBLE_EXTINCT); - - // Adjust this to equal the scale of your boss / 80. - this->scale.x -= 0.04375; - this->scale.y -= 0.04375; - this->scale.z -= 0.04375; - - if (this->timer == 30) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 756); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 801); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 957); - this->timer = 0; - } + if (ret) { BossExplode(this, &this->pos); } + else { PlaySound(this, SE_EMY_BUBBLE_EXTINCT); } + this->timer += 1; - this->timer += 1; - } - else { - this->scale.x = 0.0; - this->scale.y = 0.0; - this->scale.z = 0.0; - - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 588); - this->dying = 1; - this->timer = 0; - } } void daPodouble::endState_SyncDie() { } 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; 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) { diff --git a/src/bossTopman.cpp b/src/bossTopman.cpp index a52c66b..625e957 100644 --- a/src/bossTopman.cpp +++ b/src/bossTopman.cpp @@ -3,10 +3,9 @@ #include <g3dhax.h> #include <sfx.h> #include <stage.h> -#include "effects.h" -#include "player.h" +#include "boss.h" -class daDreidel : public dEn_c { +class daDreidel : public daBoss { int onCreate(); int onDelete(); int onExecute(); @@ -30,7 +29,7 @@ class daDreidel : public dEn_c { float dying; - dEn_c *Kameck; + daKameckDemo *Kameck; static daDreidel *build(); @@ -77,25 +76,10 @@ daDreidel *daDreidel::build() { /////////////////////// // Externs and States /////////////////////// - extern "C" void *PlaySound(dStageActor_c *, int soundID); - extern "C" void *PlaySoundAsync(dStageActor_c *, int soundID); extern "C" void *EN_LandbarrelPlayerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther); - - extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); - extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daDreidel *, Vec pos); - extern "C" dStageActor_c *GetSpecificPlayerActor(int num); -// CalculateDistanceFromActorsNextPosToFurthestPlayer - - //FIXME make this dEn_c->used... - extern "C" char usedForDeterminingStatePress_or_playerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther, int unk1); + // CalculateDistanceFromActorsNextPosToFurthestPlayer??? extern "C" int SmoothRotation(short* rot, u16 amt, int unk2); - extern "C" void *StopBGMMusic(); - extern "C" void *StartBGMMusic(); - - extern "C" void *MakeMarioEnterDemoMode(); - extern "C" void *MakeMarioExitDemoMode(); - extern "C" void *UpdateGameMgr(); CREATE_STATE(daDreidel, Walk); CREATE_STATE(daDreidel, Turn); @@ -167,41 +151,17 @@ daDreidel *daDreidel::build() { this->playerCollision(apThis, apOther); } - void daDreidel::collisionCatD_GroundPound(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 daDreidel::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { - this->collisionCatD_GroundPound(apThis, apOther); - } + void daDreidel::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } + void daDreidel::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } + void daDreidel::collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } - void daDreidel::collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { - this->collisionCatD_GroundPound(apThis, apOther); - } - - void daDreidel::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { - doStateChange(&StateID_KnockBack); - } + void daDreidel::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { doStateChange(&StateID_KnockBack); } + void daDreidel::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_KnockBack); } void daDreidel::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther){ } - void daDreidel::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { } - - void daDreidel::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther){ - doStateChange(&StateID_KnockBack); - } - void daDreidel::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther){ } - void daDreidel::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { } - bool daDreidel::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { return true; } @@ -407,23 +367,7 @@ void daDreidel::updateModelMatrices() { 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 daDreidel::executeState_Grow() { @@ -432,52 +376,18 @@ void daDreidel::updateModelMatrices() { this->chrAnimation.setCurrentFrame(0.0); } - this->timer = this->timer + 1; - - float scaleSpeed, yPosScaling; - + this->timer += 1; - if ((this->timer > 150) && (this->timer < 230)) { + bool ret; + ret = GrowBoss(this, Kameck, 0.2, 0.4, 0, this->timer); - scaleSpeed = 0.005; - yPosScaling = 18; - - float modifier; - - modifier = 0.2 + ((this->timer - 150) * scaleSpeed); - - this->scale = (Vec){modifier, modifier, modifier}; - // this->pos.y = this->pos.y + (yPosScaling/80); - - } - if (this->timer > 420) { + if (ret) { PlaySound(this, SE_EMY_MECHAKOOPA_BOUND); doStateChange(&StateID_Walk); } - - if (this->timer == 130) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt); } - if (this->timer == 150) { PlaySound(this, SE_BOSS_IGGY_WANWAN_TO_L); } - if (this->timer == 400) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt2); } - 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 - } } void daDreidel::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); } @@ -627,82 +537,24 @@ void daDreidel::updateModelMatrices() { // Outro State /////////////// void daDreidel::beginState_Outro() { - - WLClass::instance->_4 = 5; - WLClass::instance->_8 = 0; - - this->removeMyActivePhysics(); - this->timer = 0; - StopBGMMusic(); - - dStage32C_c::instance->freezeMarioBossFlag = 1; - + OutroSetup(this); } void daDreidel::executeState_Outro() { if (this->dying == 1) { - if (this->timer > 180) { - ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE); - } - - if (this->timer == 60) { - - 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 - } - } + 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_EMY_BUBBLE_EXTINCT); - - // Adjust this to equal the scale of your boss / 80. - this->scale.x -= 0.0075; - this->scale.y -= 0.0075; - this->scale.z -= 0.0075; + bool ret; + ret = ShrinkBoss(this, &this->pos, 0.5, this->timer); - if (this->timer == 30) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 756); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 801); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 957); - this->timer = 0; - } - - this->timer += 1; - } - else { - this->scale.x = 0.0; - this->scale.y = 0.0; - this->scale.z = 0.0; - - CreateEffect(&this->pos, &(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(); - } + if (ret) { BossExplode(this, &this->pos); } + else { PlaySound(this, SE_EMY_BUBBLE_EXTINCT); } + + this->timer += 1; } void daDreidel::endState_Outro() { } diff --git a/src/bossWrenchThrow.cpp b/src/bossWrenchThrow.cpp index 1abc226..af5e272 100644 --- a/src/bossWrenchThrow.cpp +++ b/src/bossWrenchThrow.cpp @@ -1,10 +1,8 @@ #include <common.h> #include <game.h> #include <g3dhax.h> -#include "player.h" -#include "effects.h" #include <sfx.h> - +#include "boss.h" class daWrench : public dEn_c { int onCreate(); @@ -46,24 +44,10 @@ CREATE_STATE(daWrench, Straight); CREATE_STATE(daWrench, Kaboom); -extern "C" void *PlaySound(dEn_c *, int soundID); -extern "C" void *PlaySoundAsync(dEn_c *, int soundID); extern "C" void *PlayWrenchSound(dEn_c *); -extern "C" dStageActor_c *GetSpecificPlayerActor(int number); -extern "C" u32 GenerateRandomNumber(int max); - - -void daWrench::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 daWrench::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } void daWrench::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { } bool daWrench::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -71,7 +55,7 @@ bool daWrench::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePh } void daWrench::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) {} void daWrench::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5}, 48); + SpawnEffect("Wm_ob_cmnboxgrain", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5}); PlaySoundAsync(this, SE_BOSS_JR_FLOOR_BREAK); this->Delete(1); @@ -80,7 +64,7 @@ void daWrench::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *ap void daWrench::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { this->_vf220(apOther->owner); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5}, 48); + SpawnEffect("Wm_ob_cmnboxgrain", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.5, 0.5, 0.5}); PlaySoundAsync(this, SE_BOSS_JR_FLOOR_BREAK); this->Delete(1); @@ -239,8 +223,8 @@ void daWrench::executeState_Kaboom() { // hit the ground PlaySoundAsync(this, SE_BOSS_JR_BOMB_BURST); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}, 9); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.25, 1.25, 1.25}, 167); + SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}); + SpawnEffect("Wm_mr_wirehit", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.25, 1.25, 1.25}); this->Delete(1); } if (collMgr.bitfield_for_checks & (0x15 << direction)) { @@ -248,12 +232,12 @@ void daWrench::executeState_Kaboom() { PlaySoundAsync(this, SE_BOSS_JR_BOMB_BURST); if (this->direction == 0) { // directions 1 spins clockwise, fly rightwards - CreateEffect(&this->pos, &(S16Vec){0,0x4000,0}, &(Vec){0.75, 0.75, 0.75}, 9); - CreateEffect(&this->pos, &(S16Vec){0,0x4000,0}, &(Vec){1.25, 1.25, 1.25}, 167); + SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0x4000,0}, &(Vec){0.75, 0.75, 0.75}); + SpawnEffect("Wm_mr_wirehit", 0, &this->pos, &(S16Vec){0,0x4000,0}, &(Vec){1.25, 1.25, 1.25}); } else { // directions 0 spins anti-clockwise, fly leftwards - CreateEffect(&this->pos, &(S16Vec){0,0xE000,0}, &(Vec){0.75, 0.75, 0.75}, 9); - CreateEffect(&this->pos, &(S16Vec){0,0xE000,0}, &(Vec){1.25, 1.25, 1.25}, 167); + SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0xE000,0}, &(Vec){0.75, 0.75, 0.75}); + SpawnEffect("Wm_mr_wirehit", 0, &this->pos, &(S16Vec){0,0xE000,0}, &(Vec){1.25, 1.25, 1.25}); } this->Delete(1); @@ -298,14 +282,14 @@ void daWrench::executeState_Straight() { // hit the ground PlaySoundAsync(this, SE_BOSS_JR_FLOOR_BREAK); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}, 9); + SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}); this->Delete(1); } if (collMgr.bitfield_for_checks & (0x15 << direction)) { // hit the wall PlaySoundAsync(this, SE_BOSS_JR_FLOOR_BREAK); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}, 9); + SpawnEffect("Wm_en_burst_s", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}); this->Delete(1); } diff --git a/src/effectvideo.cpp b/src/effectvideo.cpp index 3aa43fb..6264142 100644 --- a/src/effectvideo.cpp +++ b/src/effectvideo.cpp @@ -1,12 +1,11 @@ #include <common.h> #include <game.h> #include <g3dhax.h> -#include "player.h" -#include "effects.h" #include <sfx.h> extern "C" void *PlaySoundAsync(dEn_c *, int soundID); +extern "C" bool SpawnEffect(const char*, int, Vec*, S16Vec*, Vec*); class EffectVideo : public dEn_c { @@ -76,7 +75,28 @@ int EffectVideo::onExecute() { } else { // Plays an Effect - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale}, this->effect); + + switch (this->effect) { + + case 43: + SpawnEffect("Wm_ob_cmnspark", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale}); + break; + + case 177: + SpawnEffect("Wm_ob_greencoinkira_b", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale}); + break; + + case 193: + SpawnEffect("Wm_mr_electricshock_biri01_s", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale}); + break; + + case 365: + SpawnEffect("Wm_en_kuribobigsplit", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){this->scale, this->scale, this->scale}); + break; + + default: + break; + } } this->timer = 0; diff --git a/src/electricLine.cpp b/src/electricLine.cpp index 28822f1..d8a72e2 100644 --- a/src/electricLine.cpp +++ b/src/electricLine.cpp @@ -2,9 +2,6 @@ #include <game.h> #include <g3dhax.h> #include <sfx.h> -#include <stage.h> -#include "effects.h" -#include "player.h" class daElectricLine : public dEn_c { int onCreate(); diff --git a/src/fakeStarCoin.cpp b/src/fakeStarCoin.cpp index 5160545..9dcbad3 100644 --- a/src/fakeStarCoin.cpp +++ b/src/fakeStarCoin.cpp @@ -1,12 +1,11 @@ #include <common.h> #include <game.h> #include <g3dhax.h> -#include "player.h" -#include "effects.h" #include <sfx.h> extern "C" void *PlaySound(dEn_c *, int soundID); +extern "C" bool SpawnEffect(const char*, int, Vec*, S16Vec*, Vec*); class daFakeStarCoin : public dEn_c { @@ -42,15 +41,15 @@ class daFakeStarCoin : public dEn_c { void daFakeStarCoin::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { PlaySound(this, SE_EMY_CS_TERESA_BEAT_YOU); - CreateEffect(377, &this->pos); + SpawnEffect("Wm_en_obakedoor", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); //FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void) this->Delete(this->_390); } void daFakeStarCoin::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 336); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}, 342); + SpawnEffect("Wm_en_explosion", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_en_explosion_smk", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}); PlaySound(this, SE_OBJ_EMY_FIRE_DISAPP); @@ -58,9 +57,9 @@ void daFakeStarCoin::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, A this->Delete(this->_390); } bool daFakeStarCoin::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}, 44); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 231); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}, 235); + SpawnEffect("Wm_ob_cmnicekira", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}); + SpawnEffect("Wm_ob_icebreakwt", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_ob_iceattack", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}); PlaySound(this, SE_OBJ_PNGN_ICE_BREAK); @@ -69,8 +68,8 @@ bool daFakeStarCoin::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, Ac return false; } void daFakeStarCoin::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 48); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 378); + SpawnEffect("Wm_ob_cmnboxgrain", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_en_obakedoor_sm", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); PlaySound(this, SE_BOSS_JR_FLOOR_BREAK); @@ -78,8 +77,8 @@ void daFakeStarCoin::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePh this->Delete(this->_390); } void daFakeStarCoin::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 48); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 378); + SpawnEffect("Wm_ob_cmnboxgrain", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_en_obakedoor_sm", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); PlaySound(this, SE_BOSS_JR_FLOOR_BREAK); @@ -87,8 +86,8 @@ void daFakeStarCoin::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics this->Delete(this->_390); } void daFakeStarCoin::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) { - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 336); - CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}, 342); + SpawnEffect("Wm_en_explosion", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_en_explosion_smk", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}); PlaySound(this, SE_OBJ_EMY_FIRE_DISAPP); diff --git a/src/firelaser.cpp b/src/firelaser.cpp index db615ec..32eb0bd 100755 --- a/src/firelaser.cpp +++ b/src/firelaser.cpp @@ -33,7 +33,6 @@ CREATE_STATE(daFireLaser_c, pewpewpew); struct EventTable_t { u64 events; - // ... }; extern EventTable_t *EventTable; @@ -41,7 +40,6 @@ extern EventTable_t *EventTable; int daFireLaser_c::onCreate() { - OSReport("Creating a fiery laser"); this->timer = 0; this->direction = this->settings & 0xF; @@ -74,7 +72,6 @@ int daFireLaser_c::onDraw() { // Pew Pew State void daFireLaser_c::beginState_pewpewpew() { - OSReport("Firin' mah lazer."); this->timer = 0; } void daFireLaser_c::executeState_pewpewpew() { @@ -85,7 +82,6 @@ void daFireLaser_c::executeState_pewpewpew() { this->timer = this->timer + 1; if (this->timer < 20) { - OSReport("Pew pew pew!"); float xlaunch; float ylaunch; diff --git a/src/levelspecial.cpp b/src/levelspecial.cpp index 75d7ecc..3ce6aab 100644 --- a/src/levelspecial.cpp +++ b/src/levelspecial.cpp @@ -26,8 +26,8 @@ struct EventTable_t { extern EventTable_t *EventTable; -extern u16 TimeStopFlag; -extern u32 TimerBranch; +// extern u16 TimeStopFlag; +// extern u32 TimerBranch; extern u32 AlwaysDrawFlag; extern u32 AlwaysDrawBranch; @@ -35,7 +35,7 @@ extern float MarioDescentRate; extern float MarioJumpMax; extern float MarioJumpArc; extern float MiniMarioJumpArc; -extern float MarioSize; +// extern float MarioSize; extern float GlobalSpriteSize; extern float GlobalSpriteSpeed; @@ -61,13 +61,13 @@ fBase_c *FindActorByID(u32 id); bool ResetAfterLevel(void) { - TimeStopFlag = 0; - TimerBranch = 0x3403FFA4; + // TimeStopFlag = 0; + // TimerBranch = 0x3403FFA4; MarioDescentRate = -4; MarioJumpMax = 3.628; MarioJumpArc = 2.5; MiniMarioJumpArc = 2.5; - MarioSize = 1.0; + // MarioSize = 1.0; GlobalSpriteSize = 1.0; GlobalSpriteSpeed = 1.0; GlobalRiderSize = 1.0; @@ -121,13 +121,13 @@ void LevelSpecial_Update(LevelSpecial *self) { OSReport("Activate Special Event!", offState); switch (self->type) { - case 1: // Time Freeze - TimeStopFlag = self->effect * 0x100; - break; + // case 1: // Time Freeze + // TimeStopFlag = self->effect * 0x100; + // break; - case 2: // Stop Timer - TimerBranch = 0x7C601B78; - break; + // case 2: // Stop Timer + // TimerBranch = 0x7C601B78; + // break; case 3: // Mario Gravity @@ -147,80 +147,80 @@ void LevelSpecial_Update(LevelSpecial *self) { } break; - case 4: // Mario Size - dAc_Py_c *Mario; - if (self->effect == 0) //Super Size - { - MarioSize = 4.0; +// case 4: // Mario Size +// dAc_Py_c *Mario; +// if (self->effect == 0) //Super Size +// { +// MarioSize = 4.0; - for(int n=0; n<4; n++) { - OSReport("Changing Physics for Player %d\n", n); - Mario = GetSpecificPlayerActor(n); - OSReport("Player Actor at %08x\n", Mario); - if(Mario == 0) - continue; -// Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter * 4.0; -// Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge * 4.0; -// Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter * 4.0; -// Mario->aPhysics.info.yDistToEdge = Mario->aPhysics.info.yDistToEdge * 4.0; -// - Mario->bPhysics.info.xDistToCenter = Mario->bPhysics.info.xDistToCenter * 4.0; - Mario->bPhysics.info.xDistToEdge = Mario->bPhysics.info.xDistToEdge * 4.0; - Mario->bPhysics.info.yDistToCenter = Mario->bPhysics.info.yDistToCenter * 4.0; - Mario->bPhysics.info.yDistToEdge = Mario->bPhysics.info.yDistToEdge * 4.0; -// -// Mario->cPhysics.info.xDistToCenter = Mario->cPhysics.info.xDistToCenter * 4.0; -// Mario->cPhysics.info.xDistToEdge = Mario->cPhysics.info.xDistToEdge * 4.0; -// Mario->cPhysics.info.yDistToCenter = Mario->cPhysics.info.yDistToCenter * 4.0; -// Mario->cPhysics.info.yDistToEdge = Mario->cPhysics.info.yDistToEdge * 4.0; -// -// Mario->dPhysics.info.xDistToCenter = Mario->dPhysics.info.xDistToCenter * 4.0; -// Mario->dPhysics.info.xDistToEdge = Mario->dPhysics.info.xDistToEdge * 4.0; -// Mario->dPhysics.info.yDistToCenter = Mario->dPhysics.info.yDistToCenter * 4.0; -// Mario->dPhysics.info.yDistToEdge = Mario->dPhysics.info.yDistToEdge * 4.0; -// -// Mario->ePhysics.info.xDistToCenter = Mario->ePhysics.info.xDistToCenter * 4.0; -// Mario->ePhysics.info.xDistToEdge = Mario->ePhysics.info.xDistToEdge * 4.0; -// Mario->ePhysics.info.yDistToCenter = Mario->ePhysics.info.yDistToCenter * 4.0; -// Mario->ePhysics.info.yDistToEdge = Mario->ePhysics.info.yDistToEdge * 4.0; - } - } +// for(int n=0; n<4; n++) { +// OSReport("Changing Physics for Player %d\n", n); +// Mario = GetSpecificPlayerActor(n); +// OSReport("Player Actor at %08x\n", Mario); +// if(Mario == 0) +// continue; +// // Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter * 4.0; +// // Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge * 4.0; +// // Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter * 4.0; +// // Mario->aPhysics.info.yDistToEdge = Mario->aPhysics.info.yDistToEdge * 4.0; +// // +// Mario->bPhysics.info.xDistToCenter = Mario->bPhysics.info.xDistToCenter * 4.0; +// Mario->bPhysics.info.xDistToEdge = Mario->bPhysics.info.xDistToEdge * 4.0; +// Mario->bPhysics.info.yDistToCenter = Mario->bPhysics.info.yDistToCenter * 4.0; +// Mario->bPhysics.info.yDistToEdge = Mario->bPhysics.info.yDistToEdge * 4.0; +// // +// // Mario->cPhysics.info.xDistToCenter = Mario->cPhysics.info.xDistToCenter * 4.0; +// // Mario->cPhysics.info.xDistToEdge = Mario->cPhysics.info.xDistToEdge * 4.0; +// // Mario->cPhysics.info.yDistToCenter = Mario->cPhysics.info.yDistToCenter * 4.0; +// // Mario->cPhysics.info.yDistToEdge = Mario->cPhysics.info.yDistToEdge * 4.0; +// // +// // Mario->dPhysics.info.xDistToCenter = Mario->dPhysics.info.xDistToCenter * 4.0; +// // Mario->dPhysics.info.xDistToEdge = Mario->dPhysics.info.xDistToEdge * 4.0; +// // Mario->dPhysics.info.yDistToCenter = Mario->dPhysics.info.yDistToCenter * 4.0; +// // Mario->dPhysics.info.yDistToEdge = Mario->dPhysics.info.yDistToEdge * 4.0; +// // +// // Mario->ePhysics.info.xDistToCenter = Mario->ePhysics.info.xDistToCenter * 4.0; +// // Mario->ePhysics.info.xDistToEdge = Mario->ePhysics.info.xDistToEdge * 4.0; +// // Mario->ePhysics.info.yDistToCenter = Mario->ePhysics.info.yDistToCenter * 4.0; +// // Mario->ePhysics.info.yDistToEdge = Mario->ePhysics.info.yDistToEdge * 4.0; +// } +// } - else //Half-Pint - { - MarioSize = 0.25; - - for(int n=0; n<4; n++) { - Mario = GetSpecificPlayerActor(n); - if(Mario == 0) - continue; - Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter * 0.25; - Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge * 0.25; - Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter * 0.25; - Mario->aPhysics.info.yDistToEdge = Mario->aPhysics.info.yDistToEdge * 0.25; - - Mario->bPhysics.info.xDistToCenter = Mario->bPhysics.info.xDistToCenter * 0.25; - Mario->bPhysics.info.xDistToEdge = Mario->bPhysics.info.xDistToEdge * 0.25; - Mario->bPhysics.info.yDistToCenter = Mario->bPhysics.info.yDistToCenter * 0.25; - Mario->bPhysics.info.yDistToEdge = Mario->bPhysics.info.yDistToEdge * 0.25; - - Mario->cPhysics.info.xDistToCenter = Mario->cPhysics.info.xDistToCenter * 0.25; - Mario->cPhysics.info.xDistToEdge = Mario->cPhysics.info.xDistToEdge * 0.25; - Mario->cPhysics.info.yDistToCenter = Mario->cPhysics.info.yDistToCenter * 0.25; - Mario->cPhysics.info.yDistToEdge = Mario->cPhysics.info.yDistToEdge * 0.25; - - Mario->dPhysics.info.xDistToCenter = Mario->dPhysics.info.xDistToCenter * 0.25; - Mario->dPhysics.info.xDistToEdge = Mario->dPhysics.info.xDistToEdge * 0.25; - Mario->dPhysics.info.yDistToCenter = Mario->dPhysics.info.yDistToCenter * 0.25; - Mario->dPhysics.info.yDistToEdge = Mario->dPhysics.info.yDistToEdge * 0.25; - - Mario->ePhysics.info.xDistToCenter = Mario->ePhysics.info.xDistToCenter * 0.25; - Mario->ePhysics.info.xDistToEdge = Mario->ePhysics.info.xDistToEdge * 0.25; - Mario->ePhysics.info.yDistToCenter = Mario->ePhysics.info.yDistToCenter * 0.25; - Mario->ePhysics.info.yDistToEdge = Mario->ePhysics.info.yDistToEdge * 0.25; - } - } - break; +// else //Half-Pint +// { +// MarioSize = 0.25; + +// for(int n=0; n<4; n++) { +// Mario = GetSpecificPlayerActor(n); +// if(Mario == 0) +// continue; +// Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter * 0.25; +// Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge * 0.25; +// Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter * 0.25; +// Mario->aPhysics.info.yDistToEdge = Mario->aPhysics.info.yDistToEdge * 0.25; + +// Mario->bPhysics.info.xDistToCenter = Mario->bPhysics.info.xDistToCenter * 0.25; +// Mario->bPhysics.info.xDistToEdge = Mario->bPhysics.info.xDistToEdge * 0.25; +// Mario->bPhysics.info.yDistToCenter = Mario->bPhysics.info.yDistToCenter * 0.25; +// Mario->bPhysics.info.yDistToEdge = Mario->bPhysics.info.yDistToEdge * 0.25; + +// Mario->cPhysics.info.xDistToCenter = Mario->cPhysics.info.xDistToCenter * 0.25; +// Mario->cPhysics.info.xDistToEdge = Mario->cPhysics.info.xDistToEdge * 0.25; +// Mario->cPhysics.info.yDistToCenter = Mario->cPhysics.info.yDistToCenter * 0.25; +// Mario->cPhysics.info.yDistToEdge = Mario->cPhysics.info.yDistToEdge * 0.25; + +// Mario->dPhysics.info.xDistToCenter = Mario->dPhysics.info.xDistToCenter * 0.25; +// Mario->dPhysics.info.xDistToEdge = Mario->dPhysics.info.xDistToEdge * 0.25; +// Mario->dPhysics.info.yDistToCenter = Mario->dPhysics.info.yDistToCenter * 0.25; +// Mario->dPhysics.info.yDistToEdge = Mario->dPhysics.info.yDistToEdge * 0.25; + +// Mario->ePhysics.info.xDistToCenter = Mario->ePhysics.info.xDistToCenter * 0.25; +// Mario->ePhysics.info.xDistToEdge = Mario->ePhysics.info.xDistToEdge * 0.25; +// Mario->ePhysics.info.yDistToCenter = Mario->ePhysics.info.yDistToCenter * 0.25; +// Mario->ePhysics.info.yDistToEdge = Mario->ePhysics.info.yDistToEdge * 0.25; +// } +// } +// break; case 5: // Global Enemy Size @@ -263,13 +263,13 @@ void LevelSpecial_Update(LevelSpecial *self) { OSReport("Deactivate Special Event", offState); switch (self->type) { - case 1: // Time Freeze - TimeStopFlag = 0; - break; + // case 1: // Time Freeze + // TimeStopFlag = 0; + // break; - case 2: // Stop Timer - TimerBranch = 0x3403FFA4; - break; + // case 2: // Stop Timer + // TimerBranch = 0x3403FFA4; + // break; case 3: // Mario Gravity @@ -279,8 +279,8 @@ void LevelSpecial_Update(LevelSpecial *self) { MarioJumpMax = 3.628; break; - case 4: // Mario Size - dAc_Py_c *Mario; + // case 4: // Mario Size + // dAc_Py_c *Mario; // if (self->effect == 0) //Super Size // { // MarioSize = 4.0; @@ -352,7 +352,7 @@ void LevelSpecial_Update(LevelSpecial *self) { // Mario->ePhysics.info.yDistToEdge = Mario->ePhysics.info.yDistToEdge / 0.25; // } // } - break; + // break; case 5: // Global Enemy Size SizerOn = 0; diff --git a/src/mrsun.cpp b/src/mrsun.cpp index a93c06f..4e92d7a 100755 --- a/src/mrsun.cpp +++ b/src/mrsun.cpp @@ -2,7 +2,7 @@ #include <game.h> #include <g3dhax.h> -#include "player.h" +#include "boss.h" class daMrSun_c : public dEn_c { int onCreate(); @@ -52,6 +52,8 @@ class daMrSun_c : public dEn_c { void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther); + void collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther); + void collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther); USING_STATES(daMrSun_c); DECLARE_STATE(Follow); @@ -68,13 +70,6 @@ daMrSun_c *daMrSun_c::build() { } -extern "C" u32 GenerateRandomNumber(int max); -extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daMrSun_c *, Vec pos); -extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); -extern "C" dStageActor_c *GetSpecificPlayerActor(int number); -extern "C" void *PlaySound(daMrSun_c *, int soundID); - - CREATE_STATE(daMrSun_c, Follow); CREATE_STATE(daMrSun_c, Swoop); CREATE_STATE(daMrSun_c, Spiral); @@ -95,10 +90,7 @@ extern EventTable_t *EventTable; -void daMrSun_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { - this->_vf220(apOther->owner); - OSReport("I hit Mario."); -} +void daMrSun_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } void daMrSun_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Fireball"); } bool daMrSun_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -126,7 +118,9 @@ void daMrSun_c::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *ap OSReport("Hit StarMario"); this->timer = 0; doStateChange(&StateID_DieFall); } -void daMrSun_c::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Groundpound"); } +void daMrSun_c::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } +void daMrSun_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } +void daMrSun_c::collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); } @@ -269,12 +263,6 @@ int daMrSun_c::onExecute() { //OSReport("Oh Mr.Sun, Sun, Mr.Golden Sun"); acState.execute(); updateModelMatrices(); - if (this->aPhysics.result1 == 1) { - char PlayerID = NearestPlayer(this); - dStageActor_c *Player = GetSpecificPlayerActor(PlayerID); - - this->_vf220(Player); - } if (EventTable->events & this->eventFlag) { if (this->killFlag == 0) { diff --git a/src/penguin.cpp b/src/penguin.cpp index 82c0091..6d12204 100644 --- a/src/penguin.cpp +++ b/src/penguin.cpp @@ -3,8 +3,6 @@ #include <g3dhax.h> #include <sfx.h> #include <stage.h> -#include "effects.h" -#include "player.h" class daPengi : public dEn_c { int onCreate(); diff --git a/src/shyguy.cpp b/src/shyguy.cpp index d09edb2..73aaa44 100644 --- a/src/shyguy.cpp +++ b/src/shyguy.cpp @@ -2,9 +2,6 @@ #include <game.h> #include <g3dhax.h> #include <sfx.h> -#include <stage.h> -#include "effects.h" -#include "player.h" // Shy Guy Settings @@ -135,6 +132,7 @@ daShyGuy *daShyGuy::build() { /////////////////////// extern "C" void *PlaySound(dStageActor_c *, int soundID); extern "C" void *PlaySoundAsync(dStageActor_c *, int soundID); + extern "C" bool SpawnEffect(const char*, int, Vec*, S16Vec*, Vec*); extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daShyGuy *, Vec pos); @@ -989,10 +987,10 @@ void daShyGuy::updateModelMatrices() { if (this->timer == 80) { if (this->direction == 1) { - CreateEffect(&(Vec){this->pos.x + 7.0, this->pos.y + 14.0, this->pos.z - 5500.0}, &(S16Vec){0,0,0}, &(Vec){0.8, 0.8, 0.8}, 966); + SpawnEffect("Wm_ob_keyget02_lighit", 0, &(Vec){this->pos.x + 7.0, this->pos.y + 14.0, this->pos.z - 5500.0}, &(S16Vec){0,0,0}, &(Vec){0.8, 0.8, 0.8}); } else { - CreateEffect(&(Vec){this->pos.x - 7.0, this->pos.y + 14.0, this->pos.z + 5500.0}, &(S16Vec){0,0,0}, &(Vec){0.8, 0.8, 0.8}, 966); + SpawnEffect("Wm_ob_keyget02_lighit", 0, &(Vec){this->pos.x - 7.0, this->pos.y + 14.0, this->pos.z + 5500.0}, &(S16Vec){0,0,0}, &(Vec){0.8, 0.8, 0.8}); } } @@ -1024,11 +1022,11 @@ void daShyGuy::updateModelMatrices() { PlaySoundAsync(this, SE_EMY_CRASHER_PUNCH); if (this->direction == 1) { - CreateEffect(&(Vec){this->pos.x - 18.0, this->pos.y + 16.0, this->pos.z}, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}, 123); + SpawnEffect("Wm_mr_wallkick_b_l", 0, &(Vec){this->pos.x - 18.0, this->pos.y + 16.0, this->pos.z}, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}); Chuckles.addToList(); } else { - CreateEffect(&(Vec){this->pos.x + 18.0, this->pos.y + 16.0, this->pos.z}, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}, 124); + SpawnEffect("Wm_mr_wallkick_s_r", 0, &(Vec){this->pos.x + 18.0, this->pos.y + 16.0, this->pos.z}, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}); Knuckles.addToList(); } } @@ -1037,11 +1035,11 @@ void daShyGuy::updateModelMatrices() { if(this->chrAnimation.isAnimationDone()) { if (this->direction == 1) { - CreateEffect(&(Vec){this->pos.x - 38.0, this->pos.y + 16.0, this->pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 171); + SpawnEffect("Wm_mr_wirehit_hit", 0, &(Vec){this->pos.x - 38.0, this->pos.y + 16.0, this->pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); Chuckles.removeFromList(); } else { - CreateEffect(&(Vec){this->pos.x + 38.0, this->pos.y + 16.0, this->pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 171); + SpawnEffect("Wm_mr_wirehit_hit", 0, &(Vec){this->pos.x + 38.0, this->pos.y + 16.0, this->pos.z}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); Knuckles.removeFromList(); } @@ -1228,7 +1226,7 @@ void daShyGuy::updateModelMatrices() { void daShyGuy::beginState_GoDizzy() { bindAnimChr_and_setUpdateRate("c18_L_DMG_F_1_R", 1, 0.0, 1.0); - CreateEffect(318, &(Vec){this->pos.x, this->pos.y + 24.0, 0}, 0); + SpawnEffect("Wm_en_spindamage", 0, &(Vec){this->pos.x, this->pos.y + 24.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); this->max_speed.x = 0; this->speed.x = 0; @@ -1309,7 +1307,7 @@ void daShyGuy::updateModelMatrices() { // this->baln = 0; balloonPhysics.removeFromList(); - CreateEffect(&(Vec){this->pos.x, this->pos.y - 32.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 337); + SpawnEffect("Wm_en_explosion_ln", 0, &(Vec){this->pos.x, this->pos.y - 32.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); type = 0; } @@ -1322,7 +1320,7 @@ void daShyGuy::updateModelMatrices() { bool ret = calculateTileCollisions(); if (speed.y == 0.0) { - CreateEffect(&(Vec){this->pos.x, this->pos.y, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 6); + SpawnEffect("Wm_en_sndlandsmk_s", 0, &(Vec){this->pos.x, this->pos.y, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); doStateChange(&StateID_GoDizzy); } } @@ -1410,7 +1408,7 @@ void daShyGuy::updateModelMatrices() { if (type > 5 && type < 9) { this->renderBalloon = 0; - CreateEffect(&(Vec){this->pos.x, this->pos.y - 32.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 337); + SpawnEffect("Wm_en_explosion_ln", 0, &(Vec){this->pos.x, this->pos.y - 32.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); } } void daShyGuy::executeState_Die() { diff --git a/src/topman.cpp b/src/topman.cpp index a255a82..c9a679d 100644 --- a/src/topman.cpp +++ b/src/topman.cpp @@ -2,9 +2,6 @@ #include <game.h> #include <g3dhax.h> #include <sfx.h> -#include <stage.h> -#include "effects.h" -#include "player.h" class daTopman : public dEn_c { int onCreate(); @@ -548,11 +545,11 @@ void daTopman::updateModelMatrices() { } void daTopman::endState_KnockBack() { if (this->rot.y == 0x2800) { - // CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 175); + this->direction = 0; } else { - // CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 192); + this->direction = 1; } // OSReport("Rotation: %x", this->rot.y); diff --git a/worldmap.yaml b/worldmap.yaml index ce5f624..ef643a0 100644 --- a/worldmap.yaml +++ b/worldmap.yaml @@ -6,8 +6,7 @@ source_files: - ../src/levelinfo_old.cpp
- ../src/layoutlib.S
- ../src/scene.S
- - ../src/player.cpp
- - ../src/effects.cpp
+ - ../src/boss.cpp
hooks:
- name: BuildWorldMap
|