Next step towards structure merge.
[super-star-trek.git] / reports.c
index 0c8f6062cc0b44b1c723f3914ae5ab1b4ff4ed16..afed60a5aaaea88811f3dfbd2c5477a88dff3bf1 100644 (file)
--- a/reports.c
+++ b/reports.c
@@ -14,7 +14,7 @@ void attakreport(void) {
        }\r
        if (isatb == 1) {\r
                proutn("Starbase in ");\r
-               cramlc(1, d.isx, d.isy);\r
+               cramlc(1, state.isx, state.isy);\r
                prout(" is under Super-commander attack.");\r
                proutn("It can hold out until Stardate ");\r
                cramf(future[FSCDBAS], 0, 1);\r
@@ -42,28 +42,28 @@ void report(int f) {
                case 5: s3="emeritus"; break;\r
                default: s3="skilled"; break;\r
        }\r
-       printf("\nYou %s playing a %s%s %s game.\n",\r
+       printf("\nYou %s playing a %s%s %s frozen.\n",\r
                   alldone? "were": "are now", s1, s2, s3);\r
        if (skill>3 && thawed && !alldone) prout("No plaque is allowed.");\r
        if (tourn) printf("This is tournament game %d.\n", tourn);\r
        if (f) printf("Your secret password is \"%s\"\n",passwd);\r
        printf("%d of %d Klingons have been killed",\r
-                  d.killk+d.killc+d.nsckill, inkling);\r
-       if (d.killc) printf(", including %d Commander%s.\n", d.killc, d.killc==1?"":"s");\r
-       else if (d.killk+d.nsckill > 0) prout(", but no Commanders.");\r
+                  state.killk+state.killc+state.nsckill, inkling);\r
+       if (state.killc) printf(", including %d Commander%s.\n", state.killc, state.killc==1?"":"s");\r
+       else if (state.killk+state.nsckill > 0) prout(", but no Commanders.");\r
        else prout(".");\r
        if (skill > 2) printf("The Super Commander has %sbeen destroyed.\n",\r
-                                                 d.nscrem?"not ":"");\r
-       if (d.rembase != inbase) {\r
+                                                 state.nscrem?"not ":"");\r
+       if (state.rembase != inbase) {\r
                proutn("There ");\r
-               if (inbase-d.rembase==1) proutn("has been 1 base");\r
+               if (inbase-state.rembase==1) proutn("has been 1 base");\r
                else {\r
                        proutn("have been ");\r
-                       crami(inbase-d.rembase, 1);\r
+                       crami(inbase-state.rembase, 1);\r
                        proutn(" bases");\r
                }\r
                proutn(" destroyed, ");\r
-               crami(d.rembase, 1);\r
+               crami(state.rembase, 1);\r
                prout(" remaining.");\r
        }\r
        else printf("There are %d bases.\n", inbase);\r
@@ -134,8 +134,8 @@ void lrscan(void) {
                        if (x == 0 || x > 8 || y == 0 || y > 8)\r
                                printf("   -1");\r
                        else {\r
-                               printf("%5d", d.galaxy[x][y]);\r
-                               starch[x][y] = damage[DRADIO] > 0 ? d.galaxy[x][y]+1000 :1;\r
+                               printf("%5d", state.galaxy[x][y]);\r
+                               starch[x][y] = damage[DRADIO] > 0 ? state.galaxy[x][y]+1000 :1;\r
                        }\r
                }\r
                putchar('\n');\r
@@ -170,7 +170,7 @@ void chart(int nn) {
 \r
        chew();\r
        skip(1);\r
-       if (stdamtim != 1e30 && stdamtim != d.date && condit == IHDOCKED) {\r
+       if (stdamtim != 1e30 && stdamtim != state.date && condit == IHDOCKED) {\r
                prout("Spock-  \"I revised the Star Chart from the");\r
                prout("  starbase's records.\"");\r
                skip(1);\r
@@ -179,14 +179,14 @@ void chart(int nn) {
        if (stdamtim != 1e30) {\r
                if (condit == IHDOCKED) {\r
                        /* We are docked, so restore chart from base information */\r
-                       stdamtim = d.date;\r
+                       stdamtim = state.date;\r
                        for (i=1; i <= 8 ; i++)\r
                                for (j=1; j <= 8; j++)\r
-                                       if (starch[i][j] == 1) starch[i][j] = d.galaxy[i][j]+1000;\r
+                                       if (starch[i][j] == 1) starch[i][j] = state.galaxy[i][j]+1000;\r
                }\r
                else {\r
                        proutn("(Last surveillance update ");\r
-                       cramf(d.date-stdamtim, 0, 1);\r
+                       cramf(state.date-stdamtim, 0, 1);\r
                        prout(" stardates ago.)");\r
                }\r
        }\r
@@ -205,7 +205,7 @@ void chart(int nn) {
                        else if (starch[i][j] > 999)\r
                                printf("%5d", starch[i][j]-1000);\r
                        else\r
-                               printf("%5d", d.galaxy[i][j]);\r
+                               printf("%5d", state.galaxy[i][j]);\r
                }\r
                prout("  -");\r
        }\r
@@ -238,7 +238,7 @@ void srscan(int l) {
                        }\r
                        if (goodScan)\r
                                starch[quadx][quady] = damage[DRADIO]>0.0 ?\r
-                                                                          d.galaxy[quadx][quady]+1000:1;\r
+                                                                          state.galaxy[quadx][quady]+1000:1;\r
                        scan();\r
                        if (isit("chart")) nn = TRUE;\r
                        if (isit("no")) rightside = FALSE;\r
@@ -278,7 +278,7 @@ void srscan(int l) {
                if (rightside) {\r
                        switch (jj) {\r
                                case 1:\r
-                                       printf(" Stardate      %.1f", d.date);\r
+                                       printf(" Stardate      %.1f", state.date);\r
                                        break;\r
                                case 2:\r
                                        if (condit != IHDOCKED) newcnd();\r
@@ -328,10 +328,10 @@ void srscan(int l) {
                                                   (int)((100.0*shield)/inshld + 0.5), shield);\r
                                        break;\r
                                case 9:\r
-                                       printf(" Klingons Left %d", d.remkl);\r
+                                       printf(" Klingons Left %d", state.remkl);\r
                                        break;\r
                                case 10:\r
-                                       printf(" Time Left     %.2f", d.remtime);\r
+                                       printf(" Time Left     %.2f", state.remtime);\r
                                        break;\r
                        }\r
                                        \r
@@ -397,7 +397,7 @@ void eta(void) {
                proutn("Time or arrival date? ");\r
                if (scan()==IHREAL) {\r
                        ttime = aaitem;\r
-                       if (ttime > d.date) ttime -= d.date; // Actually a star date\r
+                       if (ttime > state.date) ttime -= state.date; // Actually a star date\r
                        if (ttime <= 1e-10 ||\r
                                (twarp=(floor(sqrt((10.0*dist)/ttime)*10.0)+1.0)/10.0) > 10) {\r
                                prout("We'll never make it, sir.");\r
@@ -455,7 +455,7 @@ void eta(void) {
                prout(".");\r
                if (wfl) {\r
                        proutn("And we will arrive at stardate ");\r
-                       cramf(d.date+ttime, 1, 1);\r
+                       cramf(state.date+ttime, 1, 1);\r
                        prout(".");\r
                }\r
                else if (twarp==1.0)\r
@@ -465,16 +465,16 @@ void eta(void) {
                        cramf(twarp, 1, 2);\r
                        skip(1);\r
                        proutn("and we will arrive at stardate ");\r
-                       cramf(d.date+ttime, 1, 2);\r
+                       cramf(state.date+ttime, 1, 2);\r
                        prout(".");\r
                }\r
-               if (d.remtime < ttime)\r
+               if (state.remtime < ttime)\r
                        prout("Unfortunately, the Federation will be destroyed by then.");\r
                if (twarp > 6.0)\r
                        prout("You'll be taking risks at that speed, Captain");\r
-               if ((isatb==1 && d.isy == ix1 && d.isx == iy1 &&\r
-                        future[FSCDBAS]< ttime+d.date)||\r
-                       (future[FCDBAS]<ttime+d.date && baty==ix1 && batx == iy1))\r
+               if ((isatb==1 && state.isy == ix1 && state.isx == iy1 &&\r
+                        future[FSCDBAS]< ttime+state.date)||\r
+                       (future[FCDBAS]<ttime+state.date && baty==ix1 && batx == iy1))\r
                        prout("The starbase there will be destroyed by then.");\r
                proutn("New warp factor to try? ");\r
                if (scan() == IHREAL) {\r