diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-12-08 14:13:53 -0600 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-12-08 14:13:53 -0600 |
commit | da3aa8b641e21a766b4212385e434ff2f9927e98 (patch) | |
tree | 16ed9a79f04bbc4bfdc0bb6b1b4d551df044c812 /src/bossMegaGoomba.cpp | |
parent | 16d563a330e1a3190b6212a0bca2a4c80e2b5cff (diff) | |
parent | 3e1eddbcca15042a7a63f29f5db3ce66237355b9 (diff) | |
download | kamek-da3aa8b641e21a766b4212385e434ff2f9927e98.tar.gz kamek-da3aa8b641e21a766b4212385e434ff2f9927e98.zip |
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
Diffstat (limited to '')
-rw-r--r-- | src/bossMegaGoomba.cpp | 66 |
1 files changed, 38 insertions, 28 deletions
diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp index e67caac..c2ef1c7 100644 --- a/src/bossMegaGoomba.cpp +++ b/src/bossMegaGoomba.cpp @@ -28,7 +28,7 @@ class daMegaGoomba_c : public dEn_c { float dying; lineSensor_s belowSensor; - pointSensor_s adjacentSensor; + lineSensor_s adjacentSensor; ActivePhysics leftTrapAPhysics, rightTrapAPhysics; ActivePhysics stalkAPhysics; @@ -65,6 +65,8 @@ class daMegaGoomba_c : public dEn_c { void stunPlayers(); void unstunPlayers(); + bool hackOfTheCentury; + bool playerStunned[4]; void removeMyActivePhysics(); @@ -128,38 +130,39 @@ void setNewActivePhysicsRect(daMegaGoomba_c *actor, Vec *scale) { actor->belowSensor.flags = SENSOR_LINE; actor->belowSensor.lineA = s32((amtX * -28.0f) * 4096.0f); actor->belowSensor.lineB = s32((amtX * 28.0f) * 4096.0f); - actor->belowSensor.distanceFromCenter = s32((amtY * 4) * 4096.0f); + actor->belowSensor.distanceFromCenter = 0; - actor->adjacentSensor.flags = SENSOR_POINT; - actor->adjacentSensor.x = s32((amtX * 32.0f) * 4096.0f); - actor->adjacentSensor.y = s32((amtY * 22.0f) * 4096.0f); + actor->adjacentSensor.flags = SENSOR_LINE; + actor->adjacentSensor.lineA = s32((amtY * 4.0f) * 4096.0f); + actor->adjacentSensor.lineB = s32((amtY * 32.0f) * 4096.0f); + actor->adjacentSensor.distanceFromCenter = s32((amtX * 46.0f) * 4096.0f); u8 cat1 = 3, cat2 = 0, bitfield1 = 0x6f, bitfield2 = 0xffbafffe; ActivePhysics::Info info = { - 0.0f, amtY*57.0f, amtX*14.0f, amtY*31.0f, + 0.0f, amtY*57.0f, amtX*20.0f, amtY*31.0f, cat1, cat2, bitfield1, bitfield2, 0, &dEn_c::collisionCallback}; actor->aPhysics.initWithStruct(actor, &info); // Original trapezium was -12,12 to -48,48 ActivePhysics::Info left = { - amtX*-28.0f, amtY*56.0f, amtX*14.0f, amtY*31.0f, + amtX*-32.0f, amtY*55.0f, amtX*12.0f, amtY*30.0f, cat1, cat2, bitfield1, bitfield2, 0, &dEn_c::collisionCallback}; actor->leftTrapAPhysics.initWithStruct(actor, &left); - actor->leftTrapAPhysics.trpValue0 = amtX * 14.0f; - actor->leftTrapAPhysics.trpValue1 = amtX * 14.0f; - actor->leftTrapAPhysics.trpValue2 = amtX * -14.0f; - actor->leftTrapAPhysics.trpValue3 = amtX * 14.0f; + actor->leftTrapAPhysics.trpValue0 = amtX * 12.0f; + actor->leftTrapAPhysics.trpValue1 = amtX * 12.0f; + actor->leftTrapAPhysics.trpValue2 = amtX * -12.0f; + actor->leftTrapAPhysics.trpValue3 = amtX * 12.0f; actor->leftTrapAPhysics.collisionCheckType = 3; ActivePhysics::Info right = { - amtX*28.0f, amtY*56.0f, amtX*14.0f, amtY*31.0f, + amtX*32.0f, amtY*55.0f, amtX*12.0f, amtY*30.0f, cat1, cat2, bitfield1, bitfield2, 0, &dEn_c::collisionCallback}; actor->rightTrapAPhysics.initWithStruct(actor, &right); - actor->rightTrapAPhysics.trpValue0 = amtX * -14.0f; - actor->rightTrapAPhysics.trpValue1 = amtX * -14.0f; - actor->rightTrapAPhysics.trpValue2 = amtX * -14.0f; - actor->rightTrapAPhysics.trpValue3 = amtX * 14.0f; + actor->rightTrapAPhysics.trpValue0 = amtX * -12.0f; + actor->rightTrapAPhysics.trpValue1 = amtX * -12.0f; + actor->rightTrapAPhysics.trpValue2 = amtX * -12.0f; + actor->rightTrapAPhysics.trpValue3 = amtX * 12.0f; actor->rightTrapAPhysics.collisionCheckType = 3; ActivePhysics::Info stalk = { @@ -245,7 +248,13 @@ void daMegaGoomba_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOth //unk=0 does _vfs, unk=1 does playSeCmnStep //char ret = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 0); + float saveBounce = EnemyBounceValue; + EnemyBounceValue = 5.2f; + char ret = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 2); + + EnemyBounceValue = saveBounce; + if(ret == 1) { // regular jump apOther->someFlagByte |= 2; if(this->takeHit(1)) { @@ -349,13 +358,6 @@ void daMegaGoomba_c::setupCollision() { this->pos_delta2.y = 16.0; this->pos_delta2.z = 0.0; - this->spriteSomeRectX = 32.0; - this->spriteSomeRectY = 32.0; - this->_320 = 0.0; - this->_324 = 16.0; - this->_328 = 80.0; - this->_32C = 256.0; - this->pos.z = (foo == 0) ? 1500.0 : -2500.0; this->_518 = 2; @@ -419,7 +421,11 @@ int daMegaGoomba_c::onDelete() { int daMegaGoomba_c::onExecute() { //80033450 acState.execute(); - checkZoneBoundaries(0); + if (!hackOfTheCentury) { + hackOfTheCentury = true; + } else { + checkZoneBoundaries(0); + } updateModelMatrices(); return true; @@ -524,7 +530,9 @@ void daMegaGoomba_c::endState_Turn() { // Walk State void daMegaGoomba_c::beginState_Walk() { //inline this piece of code - this->direction = dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(this, this->pos); + //YOU SUCK, WHOEVER ADDED THIS LINE OF CODE AND MADE ME SPEND AGES + //HUNTING DOWN WHAT WAS BREAKING TURNING. -Treeki + //this->direction = dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(this, this->pos); this->speed.x = this->speed.z = 0.0; this->max_speed.x = (this->direction) ? -this->XSpeed : this->XSpeed; this->speed.y = -4.0; @@ -549,10 +557,10 @@ void daMegaGoomba_c::executeState_Walk() { this->doStateChange(&StateID_Turn); //this->acState.setField10ToOne(); } - u32 bitfield2 = this->collMgr.adjacentTileProps[this->direction]; + /*u32 bitfield2 = this->collMgr.adjacentTileProps[this->direction]; if(bitfield2) { this->doStateChange(&StateID_Turn); - } + }*/ DoStuffAndMarkDead(this, this->pos, 1.0); @@ -632,7 +640,9 @@ void daMegaGoomba_c::dieOther_End() { void daMegaGoomba_c::dieOther_Execute() { bodyModel._vf1C(); - if (counter_500 == 0) + if (counter_500 == 0) { + SpawnEffect("Wm_ob_icebreaksmk", 0, &pos, &(S16Vec){0,0,0}, &(Vec){5.0f, 5.0f, 5.0f}); Delete(1); + } } |