summaryrefslogtreecommitdiff
path: root/src/bossPlayerClown.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-02-12 02:20:23 +0100
committerTreeki <treeki@gmail.com>2013-02-12 02:20:23 +0100
commit629307bf47f6b7097128352999bd789cfeb93402 (patch)
treefde3b412a563a1768a38de7936a751b45dc9fe2e /src/bossPlayerClown.cpp
parentbcedcedeba831e4b5199303ccbf565a0f1be170f (diff)
downloadkamek-629307bf47f6b7097128352999bd789cfeb93402.tar.gz
kamek-629307bf47f6b7097128352999bd789cfeb93402.zip
lotsa fixes and updates to the final battle
Diffstat (limited to '')
-rw-r--r--src/bossPlayerClown.cpp38
1 files changed, 35 insertions, 3 deletions
diff --git a/src/bossPlayerClown.cpp b/src/bossPlayerClown.cpp
index c213872..3bf1119 100644
--- a/src/bossPlayerClown.cpp
+++ b/src/bossPlayerClown.cpp
@@ -112,6 +112,10 @@ void CConExecuteMove(dEn_c *clown) {
cTimer++;
+ float leftBound = ClassWithCameraInfo::instance->screenLeft + 12.0f;
+ if (clown->pos.x < leftBound)
+ clown->pos.x = leftBound;
+
// run normal move
PClownCarMove(clown);
}
@@ -211,9 +215,9 @@ int daClownShot::onCreate() {
_324 = 0.0f;
// These structs tell stupid collider what to collide with - these are from koopa troopa
- static const lineSensor_s below(12<<12, 4<<12, 0<<12);
- static const pointSensor_s above(0<<12, 12<<12);
- static const lineSensor_s adjacent(6<<12, 9<<12, 6<<12);
+ static const lineSensor_s below(SENSOR_BREAK_BRICK | SENSOR_BREAK_BLOCK, 12<<12, 4<<12, 0<<12);
+ static const pointSensor_s above(SENSOR_BREAK_BRICK | SENSOR_BREAK_BLOCK, 0<<12, 12<<12);
+ static const lineSensor_s adjacent(SENSOR_BREAK_BRICK | SENSOR_BREAK_BLOCK, 6<<12, 9<<12, 6<<12);
collMgr.init(this, &below, &above, &adjacent);
collMgr.calculateBelowCollisionWithSmokeEffect();
@@ -260,3 +264,31 @@ int daClownShot::onExecute() {
+// This is for making clown shots able to kill other shit
+
+extern "C" bool Amp_NewPreSpriteCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
+ // apThis = amp, apOther = other thing
+ dEn_c *amp = (dEn_c*)apThis->owner;
+
+ if (apOther->info.category2 == 9) {
+ if (amp->collisionCat9_RollingObject(apThis, apOther))
+ return true;
+ } else if (apOther->owner->name == WM_PAKKUN) {
+ amp->killByDieFall(apOther->owner);
+ return true;
+ }
+
+ return false;
+}
+
+extern "C" void KazanRock_Explode(void *kazanRock);
+extern "C" void KazanRock_OriginalCollisionCallback(ActivePhysics *apThis, ActivePhysics *apOther);
+extern "C" void KazanRock_CollisionCallback(ActivePhysics *apThis, ActivePhysics *apOther) {
+ if (apOther->owner->name == WM_PAKKUN) {
+ apThis->someFlagByte |= 2;
+ KazanRock_Explode(apThis->owner);
+ } else {
+ KazanRock_OriginalCollisionCallback(apThis, apOther);
+ }
+}
+