summaryrefslogtreecommitdiff
path: root/src/bossMegaGoomba.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-02-03 00:31:46 +0100
committerTreeki <treeki@gmail.com>2013-02-03 00:31:46 +0100
commit06828e3a02a0ca2eaf56d804bb6845659cfa59e7 (patch)
treebb28c665445fc622958b9614d014ba791cad2d0f /src/bossMegaGoomba.cpp
parent012efaa6343cd2bec2f728d0bec6243263712a45 (diff)
downloadkamek-06828e3a02a0ca2eaf56d804bb6845659cfa59e7.tar.gz
kamek-06828e3a02a0ca2eaf56d804bb6845659cfa59e7.zip
fix a bug in the collision headers, and assorted collision bugs
Diffstat (limited to '')
-rw-r--r--src/bossMegaGoomba.cpp105
1 files changed, 68 insertions, 37 deletions
diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp
index 6314aaf..44d4de7 100644
--- a/src/bossMegaGoomba.cpp
+++ b/src/bossMegaGoomba.cpp
@@ -72,24 +72,26 @@ class daMegaGoomba_c : public dEn_c {
void removeMyActivePhysics();
void addMyActivePhysics();
+ int tryHandleJumpedOn(ActivePhysics *apThis, ActivePhysics *apOther);
+
void spriteCollision(ActivePhysics *apThis, ActivePhysics *apOther);
void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther);
bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCat11_PipeCannon(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther);
- void collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCatD_Drill(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCat11_PipeCannon(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther);
void addScoreWhenHit(void *other);
- void _vf120(ActivePhysics *apThis, ActivePhysics *apOther);
- void _vf110(ActivePhysics *apThis, ActivePhysics *apOther);
- void _vf108(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool _vf120(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool _vf110(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool _vf108(ActivePhysics *apThis, ActivePhysics *apOther);
void dieOther_Begin();
void dieOther_Execute();
@@ -249,6 +251,14 @@ 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);
+ if (tryHandleJumpedOn(apThis, apOther) == 0) {
+ this->dEn_c::playerCollision(apThis, apOther);
+ this->_vf220(apOther->owner);
+ this->counter_504[apOther->owner->which_player] = 180;
+ }
+}
+
+int daMegaGoomba_c::tryHandleJumpedOn(ActivePhysics *apThis, ActivePhysics *apOther) {
float saveBounce = EnemyBounceValue;
EnemyBounceValue = 5.2f;
@@ -267,47 +277,68 @@ void daMegaGoomba_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOth
apOther->someFlagByte |= 2;
if(this->takeHit(1))
doStateChange(&StateID_DieFall);
- } else if(ret == 0) {
- this->dEn_c::playerCollision(apThis, apOther);
- this->_vf220(apOther->owner);
- this->counter_504[apOther->owner->which_player] = 180;
- } else if(ret == 2) {
- } else {
}
+
+ return ret;
}
-void daMegaGoomba_c::collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) {
- if (this->counter_504[apOther->owner->which_player] > 0) { return; }
+bool daMegaGoomba_c::collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) {
+ if (this->counter_504[apOther->owner->which_player] > 0) { return false; }
VEC2 eSpeed = {speed.x, speed.y};
killWithSpecifiedState(apOther->owner, &eSpeed, &dEn_c::StateID_DieOther);
+ return true;
}
-void daMegaGoomba_c::collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther) {
- if (this->counter_504[apOther->owner->which_player] > 0) { return; }
- VEC2 eSpeed = {speed.x, speed.y};
- killWithSpecifiedState(apOther->owner, &eSpeed, &dEn_c::StateID_DieOther);
+bool daMegaGoomba_c::collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther) {
+ return collisionCat7_GroundPound(apThis, apOther);
}
-void daMegaGoomba_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) {}
-bool daMegaGoomba_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { return false; }
-void daMegaGoomba_c::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther) { doStateChange(&StateID_DieFall); }
-void daMegaGoomba_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) {
+bool daMegaGoomba_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) {
+ return false;
+}
+bool daMegaGoomba_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) {
+ return false;
+}
+extern "C" void dAcPy_vf3F8(void* player, dEn_c* monster, int t);
+bool daMegaGoomba_c::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther) {
+ if (tryHandleJumpedOn(apThis, apOther) == 0) {
+ dAcPy_vf3F8(apOther->owner, this, 3);
+ this->counter_504[apOther->owner->which_player] = 0xA;
+ }
+ return true;
+}
+bool daMegaGoomba_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) {
if(this->takeHit(1))
doStateChange(&StateID_DieFall);
+ return true;
}
-void daMegaGoomba_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) {
+bool daMegaGoomba_c::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther) {
if(this->takeHit(1))
doStateChange(&StateID_DieFall);
+ return true;
}
-void daMegaGoomba_c::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { }
-void daMegaGoomba_c::collisionCat11_PipeCannon(ActivePhysics *apThis, ActivePhysics *apOther) {}
-void daMegaGoomba_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) {}
-void daMegaGoomba_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) {
+bool daMegaGoomba_c::collisionCatD_Drill(ActivePhysics *apThis, ActivePhysics *apOther) {
+ return collisionCat7_GroundPound(apThis, apOther);
+}
+bool daMegaGoomba_c::collisionCat11_PipeCannon(ActivePhysics *apThis, ActivePhysics *apOther) {
+ return true;
+}
+bool daMegaGoomba_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) {
+ return true;
+}
+bool daMegaGoomba_c::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) {
if(this->takeHit(1))
doStateChange(&StateID_DieFall);
+ return true;
}
void daMegaGoomba_c::addScoreWhenHit(void *other) {}
-void daMegaGoomba_c::_vf120(ActivePhysics *apThis, ActivePhysics *apOther) { }
-void daMegaGoomba_c::_vf110(ActivePhysics *apThis, ActivePhysics *apOther) { }
-void daMegaGoomba_c::_vf108(ActivePhysics *apThis, ActivePhysics *apOther) { }
+bool daMegaGoomba_c::_vf120(ActivePhysics *apThis, ActivePhysics *apOther) {
+ return true; // Replicate existing broken behaviour
+}
+bool daMegaGoomba_c::_vf110(ActivePhysics *apThis, ActivePhysics *apOther) {
+ return true; // Replicate existing broken behaviour
+}
+bool daMegaGoomba_c::_vf108(ActivePhysics *apThis, ActivePhysics *apOther) {
+ return true; // Replicate existing broken behaviour
+}
void daMegaGoomba_c::bindAnimChr_and_setUpdateRate(const char* name, int unk, float unk2, float rate) {
nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr(name);