]> git.zerfleddert.de Git - micropolis/commitdiff
re-add (disabled) air crash disaster
authorMichael Gernoth <michael@gernoth.net>
Thu, 24 Jan 2008 17:13:09 +0000 (18:13 +0100)
committerMichael Gernoth <michael@gernoth.net>
Thu, 24 Jan 2008 17:13:09 +0000 (18:13 +0100)
edit src/sim/makefile and remove -DNO_AIRCRASH from DEFINES to enable it

res/whead.tcl
src/sim/makefile
src/sim/s_disast.c
src/sim/w_sim.c
src/sim/w_sprite.c

index 1255d5b714e80190b34382d116ac5f73cbe8fd83..7e9df1f4f2a3bc15d24439815b13037ff9d59615 100644 (file)
@@ -269,6 +269,11 @@ bind $win.col1.w1.f1.disasters.m <Mod2-Key> {tk_traverseToMenu %W %A}
   $win.col1.w1.f1.disasters.m add command\
     -label {Meltdown}\
     -command "UIDisaster $win \"sim MakeMeltdown\" \"have a nuclear meltdown?\""
   $win.col1.w1.f1.disasters.m add command\
     -label {Meltdown}\
     -command "UIDisaster $win \"sim MakeMeltdown\" \"have a nuclear meltdown?\""
+  if {[sim HasAirCrash]} {
+    $win.col1.w1.f1.disasters.m add command\
+      -label {Air Crash}\
+      -command "UIDisaster $win \"sim MakeAirCrash\" \"crash an airplane?\""
+  }
   $win.col1.w1.f1.disasters.m add command\
     -label {Tornado}\
     -command "UIDisaster $win \"sim MakeTornado\" \"spin up a tornado?\""
   $win.col1.w1.f1.disasters.m add command\
     -label {Tornado}\
     -command "UIDisaster $win \"sim MakeTornado\" \"spin up a tornado?\""
index a08847e7a26ec550945ba66708f7ef4b7a86e439..13c22c54a931ba797bf043cd56383d3caaab9a08 100644 (file)
@@ -11,7 +11,7 @@ OPTFLAGS = -O3
 #OPTFLAGS = -g
 
 #DEFINES = -DIS_LINUX -DCAM -DNET
 #OPTFLAGS = -g
 
 #DEFINES = -DIS_LINUX -DCAM -DNET
-DEFINES = -DIS_LINUX
+DEFINES = -DIS_LINUX -DNO_AIRCRASH
 
 CFLAGS = $(OPTFLAGS) $(DEFINES)
 
 
 CFLAGS = $(OPTFLAGS) $(DEFINES)
 
index 691e4f3be05d7916564211d168e57ac79ddc71c7..384e15266d75a12c1bd6816bdbe2c880b1ef6581 100644 (file)
@@ -97,6 +97,7 @@ DoDisasters(void)
       MakeFlood();
       break;
     case 4:
       MakeFlood();
       break;
     case 4:
+      MakeAirCrash();
       break;
     case 5:
       MakeTornado();
       break;
     case 5:
       MakeTornado();
index 71f2f1a68741aff273aee5397971fff5b9af2819..c256e1e866fcaaf38d2e8391c699ba959bedf9bf 100644 (file)
@@ -145,6 +145,7 @@ SIMCMD_CALL(StartBulldozer)
 SIMCMD_CALL(StopBulldozer)
 SIMCMD_CALL(MakeFire)
 SIMCMD_CALL(MakeFlood)
 SIMCMD_CALL(StopBulldozer)
 SIMCMD_CALL(MakeFire)
 SIMCMD_CALL(MakeFlood)
+SIMCMD_CALL(MakeAirCrash)
 SIMCMD_CALL(MakeTornado)
 SIMCMD_CALL(MakeEarthquake)
 SIMCMD_CALL(MakeMonster)
 SIMCMD_CALL(MakeTornado)
 SIMCMD_CALL(MakeEarthquake)
 SIMCMD_CALL(MakeMonster)
@@ -1511,6 +1512,22 @@ int SimCmdSugarMode(ARGS)
   return (TCL_OK);
 }
 
   return (TCL_OK);
 }
 
+int SimCmdHasAirCrash(ARGS)
+{
+  int aircrash = 0;
+
+  if (argc != 2) {
+    return (TCL_ERROR);
+  }
+
+#ifndef NO_AIRCRASH
+  aircrash = 1;
+#endif
+
+  sprintf(interp->result, "%d", aircrash);
+  return (TCL_OK);
+}
+
 
 /************************************************************************/
 
 
 /************************************************************************/
 
@@ -1567,6 +1584,7 @@ sim_command_init()
   SIM_CMD(StopBulldozer);
   SIM_CMD(MakeFire);
   SIM_CMD(MakeFlood);
   SIM_CMD(StopBulldozer);
   SIM_CMD(MakeFire);
   SIM_CMD(MakeFlood);
+  SIM_CMD(MakeAirCrash);
   SIM_CMD(MakeTornado);
   SIM_CMD(MakeEarthquake);
   SIM_CMD(MakeMonster);
   SIM_CMD(MakeTornado);
   SIM_CMD(MakeEarthquake);
   SIM_CMD(MakeMonster);
@@ -1674,4 +1692,5 @@ sim_command_init()
   SIM_CMD(NeedRest);
   SIM_CMD(MultiPlayerMode);
   SIM_CMD(SugarMode);
   SIM_CMD(NeedRest);
   SIM_CMD(MultiPlayerMode);
   SIM_CMD(SugarMode);
+  SIM_CMD(HasAirCrash);
 }
 }
index 22688e5b2e9f457d0c0f09351f571cecf58511a1..ff1e679cf150e24c96952b2937cecf855914b0f2 100644 (file)
@@ -1588,6 +1588,23 @@ GeneratePlane(int x, int y)
 }
 
 
 }
 
 
+MakeAirCrash(void)
+{
+#ifndef NO_AIRCRASH
+  if (GetSprite(AIR) == NULL) {
+    short x, y;
+
+    x = Rand(WORLD_X - 20) + 10;
+    y = Rand(WORLD_Y - 10) + 5;
+
+    GeneratePlane(x, y);
+  }
+
+  ExplodeSprite(GetSprite(AIR));
+#endif
+}
+
+
 MakeTornado(void)
 {
   short x, y;
 MakeTornado(void)
 {
   short x, y;
Impressum, Datenschutz