Permalink
Browse files

core, gtk: add the air crash disaster back into the code

EA removed it after 9/11, but it was part of the original game, so I'm adding
it back.
  • Loading branch information...
1 parent 670def6 commit f214f85a6cc1120099ceb0362bc626f54d7bd2be @Plombo committed Mar 24, 2012
@@ -122,6 +122,9 @@ void Micropolis::doDisasters()
// 1/9 chance nothing happens (was airplane crash,
// which EA removed after 9/11, and requested it be
// removed from this code)
+#ifndef NO_AIRCRASH
+ makeAirCrash();
+#endif
break;
case 5:
@@ -2474,6 +2474,8 @@ class Micropolis {
void makeShipHere(int x, int y);
+ void makeAirCrash();
+
void makeMonster();
void makeMonsterAt(int x, int y);
@@ -973,6 +973,24 @@ void Micropolis::doShipSprite(SimSprite *sprite)
}
}
+/* Makes an airplane crash - the current airplane if there is one, or at a
+ * location otherwise - that starts a fire. */
+void Micropolis::makeAirCrash()
+{
+#ifndef NO_AIRCRASH
+ if (getSprite(SPRITE_AIRPLANE) == NULL) {
+ short x, y;
+
+ x = getRandom(WORLD_W - 20) + 10;
+ y = getRandom(WORLD_H - 10) + 5;
+
+ generatePlane(Position(x, y));
+ }
+
+ explodeSprite(getSprite(SPRITE_AIRPLANE));
+#endif
+}
+
/**
* Move monster sprite.
@@ -332,6 +332,7 @@ def setCallbacks(self):
builder.get_object('fireItem').connect('activate', lambda item: engine.setFire())
builder.get_object('floodItem').connect('activate', lambda item: engine.makeFlood())
+ builder.get_object('airCrashItem').connect('activate', lambda item: engine.makeAirCrash())
builder.get_object('tornadoItem').connect('activate', lambda item: engine.makeTornado())
builder.get_object('earthquakeItem').connect('activate', lambda item: engine.makeEarthquake())
builder.get_object('monsterItem').connect('activate', lambda item: engine.makeMonster())

0 comments on commit f214f85

Please sign in to comment.