diff options
author | Colin Noga <Tempus@Spectrum-Song.local> | 2011-09-21 17:45:08 -0500 |
---|---|---|
committer | Colin Noga <Tempus@Spectrum-Song.local> | 2011-09-21 17:45:08 -0500 |
commit | 9b1df8223e713762897d4a8a8508d0c4843570ee (patch) | |
tree | 3e42689e34efed0010731b54c9f203d9ed0d37d9 /src/mrsun.cpp | |
parent | e6a84f7143968ac4a8ffa5fa8405d8d986a63951 (diff) | |
download | kamek-9b1df8223e713762897d4a8a8508d0c4843570ee.tar.gz kamek-9b1df8223e713762897d4a8a8508d0c4843570ee.zip |
Respawning and death anim slowdown for Mr.Sun
Diffstat (limited to '')
-rwxr-xr-x | src/mrsun.cpp | 74 |
1 files changed, 52 insertions, 22 deletions
diff --git a/src/mrsun.cpp b/src/mrsun.cpp index 0fc3d05..88dd7fd 100755 --- a/src/mrsun.cpp +++ b/src/mrsun.cpp @@ -31,25 +31,22 @@ class daMrSun_c : public dEn_c { short spinReduceZ; short spinReduceY; float spinStateOn; + int dying; + char sunDying; - + void dieFall_Execute(); static daMrSun_c *build(); void updateModelMatrices(); - void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther); - void yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther); +// void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther); +// void yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther); - void dieFumi_Begin(); - void dieFumi_Execute(); - void dieFumi_End(); - - USING_STATES(daMrSun_c); DECLARE_STATE(Follow); DECLARE_STATE(Swoop); @@ -86,26 +83,57 @@ CREATE_STATE(daMrSun_c, Wait); #define DEACTIVATE 0 -void daMrSun_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Player"); } -void daMrSun_c::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Yoshi"); } - void daMrSun_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Fireball"); } -void daMrSun_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Iceball"); } -void daMrSun_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Rolling Object"); doStateChange(&StateID_Wait); } +void daMrSun_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { + OSReport("Hit Iceball"); + if (this->settings == 0) { // It's a sun + if (this->sunDying == 5) { + doStateChange(&StateID_DieIceVanish); } + else { + this->sunDying = this->sunDying + 1; } + } } +void daMrSun_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { + OSReport("Hit Rolling Object"); + this->timer = 0; + doStateChange(&StateID_DieFall); } void daMrSun_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { - OSReport("Hit Hammer"); - doStateChange(&StateID_Wait); -} + OSReport("Hit Hammer"); + this->timer = 0; + doStateChange(&StateID_DieFall); } void daMrSun_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Yoshi Fire"); } -void daMrSun_c::dieFumi_Begin() { this->dieFall_Begin(); } -void daMrSun_c::dieFumi_Execute() { this->dieFall_Execute(); } -void daMrSun_c::dieFumi_End() { this->dieFall_End(); } - - - +void daMrSun_c::dieFall_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::dieFall_Execute(); + + + if (this->timer > 450) { + dStageActor_c *Player = GetSpecificPlayerActor(0); + if (Player == 0) { Player = GetSpecificPlayerActor(1); } + if (Player == 0) { Player = GetSpecificPlayerActor(2); } + if (Player == 0) { Player = GetSpecificPlayerActor(3); } + + Player->pos; + + this->pos.x = Player->pos.x - 300; + if (Player == 0) { + this->pos.x = 0; + doStateChange(&StateID_Follow); } + this->pos.y = this->Baseline; + + doStateChange(&StateID_Follow); + } +} int daMrSun_c::onCreate() { @@ -174,6 +202,8 @@ int daMrSun_c::onCreate() { this->timer = 0; this->xSpiralOffset = 0.0; this->ySpiralOffset = 0.0; + this->dying = -15; + this->sunDying = 0; this->pos.z = 3300.00; |