summaryrefslogtreecommitdiff
path: root/src/bossMegaGoomba.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-12-08 06:47:53 +0100
committerTreeki <treeki@gmail.com>2012-12-08 06:47:53 +0100
commit3e1eddbcca15042a7a63f29f5db3ce66237355b9 (patch)
treec71c3479d714df558e333f4120133b1c6c0aa9e6 /src/bossMegaGoomba.cpp
parente7801309b3862b052e6cb43946fea889cd297cd9 (diff)
downloadkamek-3e1eddbcca15042a7a63f29f5db3ce66237355b9.tar.gz
kamek-3e1eddbcca15042a7a63f29f5db3ce66237355b9.zip
assorted updates and fixes
Diffstat (limited to '')
-rw-r--r--src/bossMegaGoomba.cpp47
1 files changed, 28 insertions, 19 deletions
diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp
index 448c543..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;
@@ -130,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 = {
@@ -247,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)) {
@@ -523,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;
@@ -548,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);