More de-FORTRANizing of the output code.
[super-star-trek.git] / moving.c
index d1f5bafaea108c1396b6d5fd2ae2b539ab3f34f2..c48ded55789c8ccbd9c472482910857dc5f21d92 100644 (file)
--- a/moving.c
+++ b/moving.c
@@ -98,9 +98,9 @@ void move(void) {
                                quady = (iy+9)/10;\r
                                sectx = ix - 10*(quadx-1);\r
                                secty = iy - 10*(quady-1);\r
-                               proutn("\nEntering");\r
-                               cramlc(1, quadx, quady);\r
-                               skip(1);\r
+                               prout("");\r
+                               prout("Entering %s.",\r
+                                     cramlc(quadrant, quadx, quady));\r
                                game.quad[sectx][secty] = ship;\r
                                newqad(0);\r
                                return;\r
@@ -129,9 +129,8 @@ void move(void) {
                                                skip(1);\r
                                                proutn("***");\r
                                                crmshp();\r
-                                               proutn(" pulled into black hole at");\r
-                                               cramlc(2, ix, iy);\r
-                                               skip(1);\r
+                                               proutn(" pulled into black hole at ");\r
+                                               prout(cramlc(sector, ix, iy));\r
                                                finish(FHOLE);\r
                                                return;\r
                                        default:\r
@@ -139,14 +138,13 @@ void move(void) {
                                                skip(1);\r
                                                crmshp();\r
                                                if (iquad == IHWEB)\r
-                                                       proutn(" encounters Tholian web at");\r
+                                                       proutn(" encounters Tholian web at ");\r
                                                else\r
-                                                       proutn(" blocked by object at");\r
-                                               cramlc(2, ix,iy);\r
+                                                       proutn(" blocked by object at ");\r
+                                               proutn(cramlc(sector, ix,iy));\r
                                                prout(";");\r
                                                proutn("Emergency stop required ");\r
-                                               cramf(stopegy, 0, 2);\r
-                                               prout(" units of energy.");\r
+                                               prout("%2d units of energy.", (int)stopegy);\r
                                                energy -= stopegy;\r
                                                finalx = x-deltax+0.5;\r
                                                sectx = finalx;\r
@@ -357,9 +355,8 @@ static void getcd(int isprobe, int akey) {
                if (!isprobe) {\r
                        if (itemp) {\r
                                if (iprompt) {\r
-                                       proutn("Helmsman Sulu- \"Course locked in for");\r
-                                       cramlc(2, irows, icols);\r
-                                       prout(".\"");\r
+                                       proutn("Helmsman Sulu- \"Course locked in for %s.\"",\r
+                                               cramlc(sector, irows, icols));\r
                                }\r
                        }\r
                        else prout("Ensign Chekov- \"Course laid in, Captain.\"");\r
@@ -431,8 +428,8 @@ void impuls(void) {
                prout("First Officer Spock- \"Captain, the impulse engines");\r
                prout("require 20.0 units to engage, plus 100.0 units per");\r
                if (energy > 30) {\r
-                       proutn("quadrant.  We can go, therefore, a maximum of ");\r
-                       cramf(0.01 * (energy-20.0)-0.05, 0, 1);\r
+                       proutn("quadrant.  We can go, therefore, a maximum of %d", \r
+                              (int)(0.01 * (energy-20.0)-0.05));\r
                        prout(" quadrants.\"");\r
                }\r
                else {\r
@@ -519,8 +516,8 @@ void warp(int i) {
                if (Time >= 0.8*game.state.remtime) {\r
                        skip(1);\r
                        prout("First Officer Spock- \"Captain, I compute that such");\r
-                       proutn("  a trip would require approximately ");\r
-                       cramf(100.0*Time/game.state.remtime, 0, 2);\r
+                       proutn("  a trip would require approximately %2.0f",\r
+                               100.0*Time/game.state.remtime);\r
                        prout(" percent of our");\r
                        prout(" remaining time.  Are you sure this is wise?\"");\r
                        if (ja() == 0) { ididit = 0; return;}\r
@@ -631,9 +628,8 @@ void setwrp(void) {
        warpfac = aaitem;\r
        wfacsq=warpfac*warpfac;\r
        if (warpfac <= oldfac || warpfac <= 6.0) {\r
-               proutn("Helmsman Sulu- \"Warp factor ");\r
-               cramf(warpfac, 0, 1);\r
-               prout(", Captain.\"");\r
+               proutn("Helmsman Sulu- \"Warp factor %do, Captain.\"", \r
+                       (int)warpfac);\r
                return;\r
        }\r
        if (warpfac < 8.00) {\r
@@ -715,9 +711,7 @@ void atover(int igrab) {
                }\r
                warpfac = 6.0+2.0*Rand();\r
                wfacsq = warpfac * warpfac;\r
-               proutn("Warp factor set to ");\r
-               cramf(warpfac, 1, 1);\r
-               skip(1);\r
+               prout("Warp factor set to %d", (int)warpfac);\r
                power = 0.75*energy;\r
                dist = power/(warpfac*warpfac*warpfac*(shldup+1));\r
                distreq = 1.4142+Rand();\r
@@ -745,9 +739,8 @@ void timwrp() {
        prout("***TIME WARP ENTERED.");\r
        if (game.state.snap && Rand() < 0.5) {\r
                /* Go back in time */\r
-               proutn("You are traveling backwards in time ");\r
-               cramf(game.state.date-game.snapsht.date, 0, 2);\r
-               prout(" stardates.");\r
+               prout("You are traveling backwards in time %d stardates.",\r
+                     (int)(game.state.date-game.snapsht.date));\r
                game.state = game.snapsht;\r
                game.state.snap = 0;\r
                if (game.state.remcom) {\r
@@ -794,9 +787,7 @@ void timwrp() {
        else {\r
                /* Go forward in time */\r
                Time = -0.5*intime*log(Rand());\r
-               proutn("You are traveling forward in time ");\r
-               cramf(Time, 1, 2);\r
-               prout(" stardates.");\r
+               prout("You are traveling forward in time %d stardates.", (int)Time);\r
                /* cheat to make sure no tractor beams occur during time warp */\r
                game.future[FTBEAM] += Time;\r
                game.damage[DRADIO] += Time;\r
@@ -922,9 +913,8 @@ void help(void) {
        }\r
        /* dematerialize starship */\r
        game.quad[sectx][secty]=IHDOT;\r
-       proutn("Starbase in");\r
-       cramlc(1, quadx, quady);\r
-       proutn(" responds--");\r
+       proutn("Starbase in %s responds--", cramlc(quadrant, quadx, quady));\r
+       proutn("");\r
        crmshp();\r
        prout(" dematerializes.");\r
        /* Give starbase three chances to rematerialize starship */\r