diff options
author | Stephen Simpson <megazig@gmail.com> | 2011-10-14 00:35:57 -0500 |
---|---|---|
committer | Stephen Simpson <megazig@gmail.com> | 2011-10-14 00:35:57 -0500 |
commit | dd010814367f49a742bca1d5ef3b23765240b373 (patch) | |
tree | 0aae2fdbd14ecd5f1f95e81d0eceac8ab1f4ec59 /src | |
parent | 1897a8a60cec5bf43bf5cf04cc6b188138aed3ee (diff) | |
parent | 68d90d197b750695d59e4c0c6224614bb29aef2b (diff) | |
download | kamek-dd010814367f49a742bca1d5ef3b23765240b373.tar.gz kamek-dd010814367f49a742bca1d5ef3b23765240b373.zip |
Merge branch 'level-select' of ssh://treeki.shacknet.nu:30000/Kamek into level-select
Diffstat (limited to '')
-rw-r--r-- | src/bossFuzzyBear.cpp | 85 | ||||
-rw-r--r-- | src/effectvideo.cpp | 23 |
2 files changed, 76 insertions, 32 deletions
diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp index c218f6d..9c91662 100644 --- a/src/bossFuzzyBear.cpp +++ b/src/bossFuzzyBear.cpp @@ -2,7 +2,7 @@ #include <game.h> #include <g3dhax.h> #include <sfx.h> - +#include "effects.h" #include "player.h" class daFuzzyBear_c : public dEn_c { @@ -21,7 +21,7 @@ class daFuzzyBear_c : public dEn_c { float AreaWidthRight; float LaunchSpeedShort; float LaunchSpeedHigh; - float dying; + u8 dying; float storeSpeed; Vec initialPos; char RolyBounces; @@ -64,6 +64,7 @@ extern "C" void *HandleYSpeed(daFuzzyBear_c *); extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daFuzzyBear_c *); extern "C" void *doSpriteMovement(dEn_c *); 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); @@ -95,6 +96,8 @@ void daFuzzyBear_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, Ac OSReport("Hit Fireball"); 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); this->damage++; if (this->damage > 14) { doStateChange(&StateID_DieBigFall); } } @@ -126,7 +129,7 @@ void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhy doSpriteMovement(blah); PlaySound(this, SE_EMY_BLOW_PAKKUN_DOWN); - + CreateEffect(&blah->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 161); if (this->damage > 14) { doStateChange(&StateID_DieBigFall); } else { doStateChange(&StateID_RolyPoly); } @@ -140,6 +143,8 @@ void daFuzzyBear_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics * this->timer = 0; this->damage += 3; + CreateEffect(&apOther->owner->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 162); + if (this->damage > 14) { doStateChange(&StateID_DieBigFall); } else { doStateChange(&StateID_RolyPoly); } } @@ -147,15 +152,35 @@ void daFuzzyBear_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysic void daFuzzyBear_c::dieBigFall_Execute() { - - this->timer = this->timer + 1; - - this->dying = this->dying + 0.15; - - this->pos.x = this->pos.x + 0.15; - this->pos.y = this->pos.y + ((-0.2 * (this->dying*this->dying)) + 5); - - this->dEn_c::dieBigFall_Execute(); + + if (this->dying == 1) { return; } + + if (this->scale.x > 0.1) { + + PlaySound(this, SE_BOSS_CMN_DAMAGE_LAST); + + this->scale.x -= 0.015; + this->scale.y -= 0.015; + this->scale.z -= 0.015; + + 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; + } + } + 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 += 1; + } @@ -304,6 +329,8 @@ void daFuzzyBear_c::executeState_Grow() { } void daFuzzyBear_c::endState_Grow() { this->Baseline = this->pos.y; +// StopSound(SE_BOSS_ROY_MAGIC_MAKE_FAST); + OSReport("OK. All grown up now."); } @@ -378,6 +405,10 @@ void daFuzzyBear_c::executeState_Bounce() { this->pos.y = this->pos.y + (scaleDown/10.0); if (this->pos.y > this->Baseline) { this->pos.y = this->Baseline - 1.0; } } + 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); + } else { float modifier; modifier = (scaleBase - 1.0) + ((this->timer - 10) * 0.1); @@ -388,7 +419,7 @@ void daFuzzyBear_c::executeState_Bounce() { PlaySound(this, SE_PLY_JUMPDAI); } - if (this->timer >= 20) { + if (this->timer > 20) { int randChoice; @@ -577,15 +608,22 @@ void daFuzzyBear_c::beginState_RolyPoly() { this->scale = (Vec){3.0, 3.0, 3.0}; } + this->timer = 0; } void daFuzzyBear_c::executeState_RolyPoly() { OSReport("Fuzzy Roly State Execute"); float wallDistance, scaleDown, scaleUp; - PlaySound(this, SE_OBJ_TEKKYU_G_ROLL); + PlaySound(this, SE_OBJ_TEKKYU_G_CRASH); if (this->pos.y > this->Baseline) { this->pos.y -= 2.0; } - else { this->pos.y = this->Baseline - 1.0; } + else { + this->pos.y = this->Baseline - 1.0; + + Vec tempPos = (Vec){this->pos.x, this->pos.y - 34.0, 5500.0}; + + if (this->timer && 0x20) { CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){0.7, 0.7, 0.7}, 242); } + } if (this->direction == 0) { // is even this->pos.x = this->pos.x - 4.0; } @@ -599,7 +637,7 @@ void daFuzzyBear_c::executeState_RolyPoly() { wallDistance = 50.0; } - + this->timer += 1; if (this->pos.x <= this->initialPos.x - ((15 * 24.0) + wallDistance)) { // Hit left wall, head right. this->speed.x = -this->speed.x; @@ -638,6 +676,7 @@ void daFuzzyBear_c::endState_RolyPoly() { this->rot.z = 0; OSReport("Fuzzy Roly State End"); this->isInvulnerable = 0; + this->timer = 0; } @@ -654,18 +693,8 @@ void daFuzzyBear_c::executeState_Wait() { if (this->timer > 60) { int randChoice; - if (BigBossFuzzyBear == 1) { - - randChoice = GenerateRandomNumber(3); - - if (randChoice == 0) { doStateChange(&StateID_Spray); } -// else if (randChoice == 1) { doStateChange(&StateID_Needles); } - else { doStateChange(&StateID_RolyPoly); } - - } - else { - doStateChange(&StateID_Bounce); - } + if (BigBossFuzzyBear == 1) { doStateChange(&StateID_Spray); } + else { doStateChange(&StateID_Bounce); } } } void daFuzzyBear_c::endState_Wait() { } diff --git a/src/effectvideo.cpp b/src/effectvideo.cpp index ec23158..cacc22d 100644 --- a/src/effectvideo.cpp +++ b/src/effectvideo.cpp @@ -3,11 +3,16 @@ #include <g3dhax.h> #include "player.h" #include "effects.h" +#include <sfx.h> + + +extern "C" void *PlaySound(dEn_c *, int soundID); class EffectVideo : public dEn_c { int onCreate(); int onExecute(); + int onDelete(); s32 timer; u32 effect; @@ -26,23 +31,33 @@ EffectVideo *EffectVideo::build() { int EffectVideo::onCreate() { this->timer = -60; - this->effect = 0; + this->effect = 900; this->onExecute(); return true; } + +int EffectVideo::onDelete() { + return true; +} + + int EffectVideo::onExecute() { - if (this->effect > 1000) { return true; } + if (this->effect >= 1001) { return true; } - if (this->timer == 30) { + if (this->timer > 60) { CreateEffect(this, this->effect); + PlaySound(this, this->effect); + this->pos.x += 16.0; + + this->effect += 1; + this->timer = 0; } - this->effect += 1; this->timer += 1; return true; } |