More merging of SERGEEV changes.
[super-star-trek.git] / moving.c
index 8aa48f07a87d9769871672836120b7e0d1af4c05..b0e68cded51fbcd3ff6792e8a38ed02367864161 100644 (file)
--- a/moving.c
+++ b/moving.c
@@ -201,6 +201,9 @@ label100:
        }\r
        newcnd();\r
        iattak = 0;\r
+#ifdef SERGEEV\r
+       drawmaps(0);\r
+#endif /* SERGEEV */\r
        return;\r
 }\r
 \r
@@ -220,7 +223,8 @@ void dock(int l) {
                return;\r
        }\r
        condit = IHDOCKED;\r
-       prout("Docked.");\r
+        if (l) prout("Docked.");\r
+        ididit=1;\r
        if (energy < inenrg) energy = inenrg;\r
        shield = inshld;\r
        torps = intorps;\r
@@ -811,6 +815,9 @@ void timwrp() {
                game.damage[DRADIO] += Time;\r
        }\r
        newqad(0);\r
+#ifdef SERGEEV\r
+        events();\r
+#endif /* SERGEEV */\r
 }\r
 \r
 void probe(void) {\r
@@ -881,6 +888,7 @@ void probe(void) {
        probecy = quady;\r
        game.future[FDSPROB] = game.state.date + 0.01; // Time to move one sector\r
        prout("Ensign Chekov-  \"The deep space probe is launched, Captain.\"");\r
+       ididit = 1;\r
        return;\r
 }\r
 \r
@@ -888,6 +896,9 @@ void help(void) {
        /* There's more than one way to move in this game! */\r
        double ddist, xdist, probf;\r
        int line = 0, l, ix, iy;\r
+#ifdef SERGEEV\r
+       int pox, posy;\r
+#endif /* SERGEEV */\r
 \r
        chew();\r
        /* Test for conditions which prevent calling for help */\r
@@ -935,6 +946,25 @@ void help(void) {
        proutn("");\r
        crmshp();\r
        prout(" dematerializes.");\r
+#ifdef SERGEEV\r
+        sectx=0;\r
+        for (l = 1; l <= 5; l++) {\r
+                ix = basex+3.0*Rand()-1;\r
+                iy = basey+3.0*Rand()-1;\r
+                if (ix>=1 && ix<=10 && iy>=1 && iy<=10 && game.quad[ix][iy]==IHDOT) {\r
+                        /* found one -- finish up */\r
+                        sectx=ix;\r
+                        secty=iy;\r
+                        game.quad[ix][iy]=IHMATER0;\r
+                        break;\r
+                }\r
+        }\r
+        if (sectx==0){\r
+           prout("You have been lost in space...");\r
+           finish(FMATERIALIZE);\r
+           return;\r
+        }\r
+#endif /* SERGEEV */\r
        /* Give starbase three chances to rematerialize starship */\r
        probf = pow((1.0 - pow(0.98,ddist)), 0.33333333);\r
        for (l = 1; l <= 3; l++) {\r