diff options
Diffstat (limited to 'src/bossPlayerClown.cpp')
-rw-r--r-- | src/bossPlayerClown.cpp | 38 |
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); + } +} + |