These are unused.
[super-star-trek.git] / reports.c
index ccb13cd80a0ac465a6bc205e1f2abe1a19bb0c01..07a5196946a84c34e24e77d9419631bb9a036d29 100644 (file)
--- a/reports.c
+++ b/reports.c
@@ -3,23 +3,26 @@
 #include <stdlib.h>\r
 #include <string.h>\r
 \r
-void attakreport(void) {\r
+void attakreport(int l) {\r
+    if (!l) {\r
        if (game.future[FCDBAS] < 1e30) {\r
-               proutn("Starbase in ");\r
-               cramlc(1, batx, baty);\r
-               prout(" is currently under attack.");\r
-               proutn("It can hold out until Stardate ");\r
-               cramf(game.future[FCDBAS], 0,1);\r
-               prout(".");\r
+               prout("Starbase in %s is currently under Commander attack.",\r
+                     cramlc(quadrant, batx, baty));\r
+               prout("It can hold out until Stardate %d.", \r
+                     (int)game.future[FCDBAS]);\r
        }\r
        if (isatb == 1) {\r
-               proutn("Starbase in ");\r
-               cramlc(1, game.state.isx, game.state.isy);\r
-               prout(" is under Super-commander attack.");\r
-               proutn("It can hold out until Stardate ");\r
-               cramf(game.future[FSCDBAS], 0, 1);\r
-               prout(".");\r
+               prout("Starbase in %s is under Super-commander attack.",\r
+                     cramlc(quadrant, game.state.isx, game.state.isy));\r
+               prout("It can hold out until Stardate %d.", \r
+                     (int)game.future[FSCDBAS]);\r
        }\r
+     } else {\r
+        if (game.future[FCDBAS] < 1e30)\r
+           proutn("Base in %i - %i attacked by C. Alive until %.1f", batx, baty, game.future[FCDBAS]);\r
+        if (isatb == 1)\r
+           proutn("Base in %i - %i attacked by S. Alive until %.1f", game.state.isx, game.state.isy, game.future[FSCDBAS]);\r
+     }\r
 }\r
        \r
 \r
@@ -67,7 +70,7 @@ void report(int f) {
        if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED || iseenit) {\r
                /* Don't report this if not seen and\r
                        either the radio is dead or not at base! */\r
-               attakreport();\r
+               attakreport(0);\r
                iseenit = 1;\r
        }\r
        if (casual) prout("%d casualt%s suffered so far.",\r
@@ -88,12 +91,12 @@ void report(int f) {
                        proutn("An armed deep space probe is in");\r
                else\r
                        proutn("A deep space probe is in");\r
-               cramlc(1, probecx, probecy);\r
+               proutn(cramlc(quadrant, probecx, probecy));\r
                prout(".");\r
        }\r
        if (icrystl) {\r
                if (cryprob <= .05)\r
-                       prout("Dilithium crystals aboard ship...not yet used.");\r
+                       prout("Dilithium crystals aboard ship... not yet used.");\r
                else {\r
                        int i=0;\r
                        double ai = 0.05;\r
@@ -122,10 +125,9 @@ void lrscan(void) {
        }\r
        else {\r
                skip(1);\r
-               proutn("Long-range scan for");\r
+               proutn("Long-range scan for ");\r
        }\r
-       cramlc(1, quadx, quady);\r
-       skip(1);\r
+       prout(cramlc(quadrant, quadx, quady));\r
        for (x = quadx-1; x <= quadx+1; x++) {\r
                for (y = quady-1; y <= quady+1; y++) {\r
                        if (x == 0 || x > 8 || y == 0 || y > 8)\r
@@ -135,7 +137,7 @@ void lrscan(void) {
                                game.starch[x][y] = game.damage[DRADIO] > 0 ? game.state.galaxy[x][y]+1000 :1;\r
                        }\r
                }\r
-               putchar('\n');\r
+               skip(1);\r
        }\r
 \r
 }\r
@@ -152,11 +154,10 @@ void dreprt(void) {
                                prout("                IN FLIGHT   DOCKED");\r
                                jdam = TRUE;\r
                        }\r
-                       proutn("  %16s ", device[i]);\r
-                       cramf(game.damage[i]+0.05, 8, 2);\r
-                       proutn("  ");\r
-                       cramf(docfac*game.damage[i]+0.005, 8, 2);\r
-                       skip(1);\r
+                       prout("  %16s %8.2f  %8.2f", \r
+                               device[i],\r
+                               game.damage[i]+0.05,\r
+                               docfac*game.damage[i]+0.005);\r
                }\r
        }\r
        if (!jdam) prout("All devices functional.");\r
@@ -182,9 +183,8 @@ void chart(int nn) {
                                        if (game.starch[i][j] == 1) game.starch[i][j] = game.state.galaxy[i][j]+1000;\r
                }\r
                else {\r
-                       proutn("(Last surveillance update ");\r
-                       cramf(game.state.date-stdamtim, 0, 1);\r
-                       prout(" stardates ago.)");\r
+                   proutn("(Last surveillance update %d stardates ago.",\r
+                          (int)(game.state.date-stdamtim));\r
                }\r
        }\r
        if (nn ==0) skip(1);\r
@@ -209,18 +209,16 @@ void chart(int nn) {
        if (nn == 0) {\r
                skip(1);\r
                crmshp();\r
-               proutn(" is currently in");\r
-               cramlc(1, quadx, quady);\r
-               skip(1);\r
-       }\r
+               prout(" is currently in %s", cramlc(quadrant, quadx, quady));\r
+}\r
 }\r
                \r
                \r
 void srscan(int l) {\r
        static char requests[][3] =\r
                {"","da","co","po","ls","wa","en","to","sh","kl","ti"};\r
-       char *cp;\r
-       int leftside=TRUE, rightside=TRUE, i, j, jj, k=0, nn=FALSE;\r
+       char *cp = NULL;\r
+       int leftside=TRUE, rightside=TRUE, i, j, k=0, nn=FALSE;\r
        int goodScan=TRUE;\r
        switch (l) {\r
                case 1: // SRSCAN\r
@@ -288,10 +286,10 @@ void srscan(int l) {
                                        proutn(" Condition     %s", cp);\r
                                        break;\r
                                case 3:\r
-                                       proutn(" Position     ");\r
-                                       cramlc(0, quadx, quady);\r
-                                       proutn(",");\r
-                                       cramlc(0, sectx, secty);\r
+                                       proutn(" Position      ");\r
+                                       proutn(cramlc(neither, quadx, quady));\r
+                                       proutn(" , ");\r
+                                       proutn(cramlc(neither, sectx, secty));\r
                                        break;\r
                                case 4:\r
                                        proutn(" Life Support  ");\r
@@ -299,7 +297,7 @@ void srscan(int l) {
                                                if (condit == IHDOCKED)\r
                                                        proutn("DAMAGED, supported by starbase");\r
                                                else\r
-                                                       proutn("DAMAGED, reserves=%4.2f", lsupres);\r
+                                                       proutn("DAMAGED, reserves=%.2f", lsupres);\r
                                        }\r
                                        else\r
                                                proutn("ACTIVE");\r
@@ -328,7 +326,7 @@ void srscan(int l) {
                                        proutn(" Klingons Left %d", game.state.remkl);\r
                                        break;\r
                                case 10:\r
-                                       proutn(" Time Left     %.2f", game.state.remtime);\r
+                                       attakreport(1);\r
                                        break;\r
                        }\r
                                        \r
@@ -341,7 +339,7 @@ void srscan(int l) {
                        \r
                        \r
 void eta(void) {\r
-       int key, ix1, ix2, iy1, iy2, prompt=FALSE;\r
+       int ix1, ix2, iy1, iy2, prompt=FALSE;\r
        int wfl;\r
        double ttime, twarp, tpower;\r
        if (game.damage[DCOMPTR] != 0.0) {\r
@@ -372,11 +370,11 @@ void eta(void) {
                }\r
                ix2 = aaitem + 0.5;\r
        }\r
-       else {  // same quadrant\r
-               ix2 = ix1;\r
-               iy2 = iy1;\r
-               ix1 = quady;    // ya got me why x and y are reversed!\r
-               iy1 = quadx;\r
+        else {\r
+                if (quady>ix1) ix2 = 1;\r
+                else ix2=10;\r
+                if (quadx>iy1) iy2 = 1;\r
+                else iy2=10;\r
        }\r
 \r
        if (ix1 > 8 || ix1 < 1 || iy1 > 8 || iy1 < 1 ||\r
@@ -447,23 +445,17 @@ void eta(void) {
                }\r
                else\r
                        proutn("Remaining");\r
-               proutn(" energy will be ");\r
-               cramf(energy-tpower, 1, 1);\r
-               prout(".");\r
+               prout(" energy will be %.2f.", energy-tpower);\r
                if (wfl) {\r
-                       proutn("And we will arrive at stardate ");\r
-                       cramf(game.state.date+ttime, 1, 1);\r
-                       prout(".");\r
+                       prout("And we will arrive at stardate %.2f.",\r
+                               game.state.date+ttime);\r
                }\r
                else if (twarp==1.0)\r
                        prout("Any warp speed is adequate.");\r
                else {\r
-                       proutn("Minimum warp needed is ");\r
-                       cramf(twarp, 1, 2);\r
-                       skip(1);\r
-                       proutn("and we will arrive at stardate ");\r
-                       cramf(game.state.date+ttime, 1, 2);\r
-                       prout(".");\r
+                       prout("Minimum warp needed is %.2f,", twarp);\r
+                       prout("and we will arrive at stardate %.2f.",\r
+                               game.state.date+ttime);\r
                }\r
                if (game.state.remtime < ttime)\r
                        prout("Unfortunately, the Federation will be destroyed by then.");\r