diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/mrsun.cpp | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/src/mrsun.cpp b/src/mrsun.cpp index 5faa01e..5cd2d9c 100755 --- a/src/mrsun.cpp +++ b/src/mrsun.cpp @@ -28,7 +28,8 @@ class daMrSun_c : public dEn_c { float swoopC; float swoopSpeed; float glowPos; - float spinReduce; + short spinReduceZ; + short spinReduceY; float spinStateOn; @@ -71,6 +72,12 @@ CREATE_STATE(daMrSun_c, Wait); #define ACTIVATE 1 #define DEACTIVATE 0 + + + + + + int daMrSun_c::onCreate() { OSReport("Creating the Mr.Sun Models"); allocator.link(-1, GameHeaps[0], 0, 0x20); @@ -112,7 +119,7 @@ int daMrSun_c::onCreate() { HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; HitMeBaby.bitfield1 = 0x4F; - HitMeBaby.bitfield2 = 0x820C; + HitMeBaby.bitfield2 = 0x8820C; HitMeBaby.unkShort1C = 0; HitMeBaby.callback = &dEn_c::collisionCallback; @@ -172,25 +179,20 @@ void daMrSun_c::updateModelMatrices() { if (hasGlow) { mMtx glowMatrix; - short rotZ; - float scaleX; + short rotY; glowPos += 0.01666666666666; if (glowPos > 1) { glowPos = 0; } - if (this->spinStateOn = 0) { rotZ = (2000 * sin(glowPos * 3.14)) + 1000; } - else { rotZ = (0xFFFF * sin(glowPos * 3.14)) + 0x7FFF; } - - scaleX = (0.2 * sin(glowPos * 3.14)) + 0.5; + rotY = (1000 * sin(glowPos * 3.14)) + 500; - Vec glowscale = (Vec){scaleX, scaleX, 0.5}; glowMatrix.translation(pos.x, pos.y, pos.z); glowMatrix.applyRotationX(&rot.x); - glowMatrix.applyRotationZ(&rotZ); + glowMatrix.applyRotationY(&rotY); glowModel.setDrawMatrix(glowMatrix); - glowModel.setScale(&glowscale); + glowModel.setScale(&scale); glowModel.calcWorld(false); } } @@ -201,9 +203,9 @@ void daMrSun_c::updateModelMatrices() { void daMrSun_c::beginState_Follow() { OSReport("Mr.Sun is following youuuuu."); this->timer = 0; - this->rot.x = 14000; + this->rot.x = 18000; this->rot.y = 0; -// this->rot.z = 14000; +// this->rot.z = 18000; } void daMrSun_c::executeState_Follow() { @@ -219,13 +221,13 @@ void daMrSun_c::executeState_Follow() { this->speed.x = this->speed.x + speedDelta; if (this->speed.x < 0) { this->speed.x = this->speed.x + (speedDelta / 2); } - if (this->speed.x < 50.0) { this->speed.x = this->speed.x + (speedDelta * 2); } + if (this->speed.x < 50.0) { this->speed.x = this->speed.x + (speedDelta); } } else { this->speed.x = this->speed.x - speedDelta; if (this->speed.x > 0) { this->speed.x = this->speed.x - (speedDelta / 2); } - if (this->speed.x < 50.0) { this->speed.x = this->speed.x - (speedDelta * 2); } + if (this->speed.x < 50.0) { this->speed.x = this->speed.x - (speedDelta); } } HandleXSpeed(this); @@ -408,7 +410,8 @@ void daMrSun_c::endState_Spit() { void daMrSun_c::beginState_Spin() { OSReport("Hoola hoola hoola hoop."); - this->spinReduce = 0; + this->spinReduceZ = 0; + this->spinReduceY = 0; } void daMrSun_c::executeState_Spin() { @@ -432,19 +435,24 @@ void daMrSun_c::executeState_Spin() { this->timer = this->timer + 1; - int rotBonus; + short rotBonus; if (this->timer < 60) { rotBonus = this->timer; } else { rotBonus = 120 - this->timer; } - - this->rot.z = this->rot.z + (50 * rotBonus); - this->rot.y = this->rot.y + (50 * rotBonus); - if ((this->spinReduce = 0) && (this->timer < 100)) { - this->spinReduce = this->rot.z / 20; } + // 1-59 + 60-1 = 3542 - if (this->timer < 100) { - this->rot.z = this->rot.z - this->spinReduce; - this->rot.y = this->rot.y - this->spinReduce; } +// if (this->timer > 100) { +// if (this->spinReduceZ = 0) { +// this->spinReduceZ = this->rot.z / 20; } +// if (this->spinReduceY = 0) { +// this->spinReduceY = this->rot.y / 20; } +// +// this->rot.z = this->rot.z - this->spinReduceZ; +// this->rot.y = this->rot.y - this->spinReduceY; } +// +// else { + this->rot.z = this->rot.z + (55.1 * rotBonus); + this->rot.y = this->rot.y + (18.4 * rotBonus); //} int randomBall; @@ -503,7 +511,7 @@ void daMrSun_c::executeState_Spin() { void daMrSun_c::endState_Spin() { OSReport("K, I is dizzy now."); - this->rot.x = 14000; + this->rot.x = 18000; this->rot.y = 0; this->rot.z = 0; |