summaryrefslogtreecommitdiff
path: root/src/meteor.cpp
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-12-13 21:40:34 -0600
committerColin Noga <Tempus@chronometry.ca>2012-12-13 21:40:34 -0600
commit1ecc9bbfe65096b6f5601385b24095afcc918563 (patch)
treef3ac5050f24b6ab3ac03d5d1a56e066fcc405272 /src/meteor.cpp
parentac0ced5b71d2cf2bce444fce88e7b359ac08815c (diff)
downloadkamek-1ecc9bbfe65096b6f5601385b24095afcc918563.tar.gz
kamek-1ecc9bbfe65096b6f5601385b24095afcc918563.zip
Lots of bug fixes for various bosses, a thundercloud fix, and level special timer improvements.
Diffstat (limited to '')
-rwxr-xr-xsrc/meteor.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/meteor.cpp b/src/meteor.cpp
index 91e90c0..aa76f5d 100755
--- a/src/meteor.cpp
+++ b/src/meteor.cpp
@@ -27,6 +27,9 @@ class dMeteor : public dEn_c {
void updateModelMatrices();
void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther);
+
+ public:
+ void kill();
};
dMeteor *dMeteor::build() {
@@ -47,6 +50,18 @@ void dMeteor::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
DamagePlayer(this, apThis, apOther);
}
+void MeteorPhysicsCallback(dMeteor *self, dEn_c *other) {
+ if (other->name == 657) {
+ OSReport("CANNON COLLISION");
+
+ SpawnEffect("Wm_en_burst_m", 0, &other->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ PlaySound(other, SE_OBJ_TARU_BREAK);
+ other->Delete(1);
+
+ self->kill();
+ }
+}
+
void dMeteor::collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) {
DamagePlayer(this, apThis, apOther);
}
@@ -97,7 +112,7 @@ int dMeteor::onCreate() {
this->aPhysics.addToList();
}
- MakeItRound.baseSetup(this, 0, 0, 0, 1, 0);
+ MakeItRound.baseSetup(this, (void*)&MeteorPhysicsCallback, 0, 0, 1, 0);
MakeItRound.x = 0.0;
MakeItRound.y = 0.0;
@@ -157,4 +172,12 @@ void dMeteor::updateModelMatrices() {
bodyModel.calcWorld(false);
}
+void dMeteor::kill() {
+ PlaySound(this, SE_OBJ_ROCK_LAND);
+ SpawnEffect("Wm_ob_cmnboxsmoke", 0, &pos, &rot, &scale);
+ SpawnEffect("Wm_ob_cmnboxgrain", 0, &pos, &rot, &scale);
+
+ this->Delete(1);
+}
+