X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=moving.c;h=c48ded55789c8ccbd9c472482910857dc5f21d92;hp=26011bfb0960dfd89d51fd51acc9bab6e5b082fe;hb=7d27c8befdb5de9a50ff4af88e764c8336bc1797;hpb=02f05de93d48d0147cfffbb8e55ca7776ca09797 diff --git a/moving.c b/moving.c index 26011bf..c48ded5 100644 --- a/moving.c +++ b/moving.c @@ -98,9 +98,9 @@ void move(void) { quady = (iy+9)/10; sectx = ix - 10*(quadx-1); secty = iy - 10*(quady-1); - proutn("\nEntering"); - cramlc(1, quadx, quady); - skip(1); + prout(""); + prout("Entering %s.", + cramlc(quadrant, quadx, quady)); game.quad[sectx][secty] = ship; newqad(0); return; @@ -129,9 +129,8 @@ void move(void) { skip(1); proutn("***"); crmshp(); - proutn(" pulled into black hole at"); - cramlc(2, ix, iy); - skip(1); + proutn(" pulled into black hole at "); + prout(cramlc(sector, ix, iy)); finish(FHOLE); return; default: @@ -139,14 +138,13 @@ void move(void) { skip(1); crmshp(); if (iquad == IHWEB) - proutn(" encounters Tholian web at"); + proutn(" encounters Tholian web at "); else - proutn(" blocked by object at"); - cramlc(2, ix,iy); + proutn(" blocked by object at "); + proutn(cramlc(sector, ix,iy)); prout(";"); proutn("Emergency stop required "); - cramf(stopegy, 0, 2); - prout(" units of energy."); + prout("%2d units of energy.", (int)stopegy); energy -= stopegy; finalx = x-deltax+0.5; sectx = finalx; @@ -357,9 +355,8 @@ static void getcd(int isprobe, int akey) { if (!isprobe) { if (itemp) { if (iprompt) { - proutn("Helmsman Sulu- \"Course locked in for"); - cramlc(2, irows, icols); - prout(".\""); + proutn("Helmsman Sulu- \"Course locked in for %s.\"", + cramlc(sector, irows, icols)); } } else prout("Ensign Chekov- \"Course laid in, Captain.\""); @@ -431,8 +428,8 @@ void impuls(void) { prout("First Officer Spock- \"Captain, the impulse engines"); prout("require 20.0 units to engage, plus 100.0 units per"); if (energy > 30) { - proutn("quadrant. We can go, therefore, a maximum of "); - cramf(0.01 * (energy-20.0)-0.05, 0, 1); + proutn("quadrant. We can go, therefore, a maximum of %d", + (int)(0.01 * (energy-20.0)-0.05)); prout(" quadrants.\""); } else { @@ -500,10 +497,11 @@ void warp(int i) { prout("We can't do it, Captain. We haven't the energy."); } else { - proutn("We haven't the energy, but we could do it at warp "); - crami(iwarp, 1); - if (shldup) - prout(",\nif you'll lower the shields."); + proutn("We haven't the energy, but we could do it at warp %d", iwarp); + if (shldup) { + prout(","); + prout("if you'll lower the shields."); + } else prout("."); } @@ -518,8 +516,8 @@ void warp(int i) { if (Time >= 0.8*game.state.remtime) { skip(1); prout("First Officer Spock- \"Captain, I compute that such"); - proutn(" a trip would require approximately "); - cramf(100.0*Time/game.state.remtime, 0, 2); + proutn(" a trip would require approximately %2.0f", + 100.0*Time/game.state.remtime); prout(" percent of our"); prout(" remaining time. Are you sure this is wise?\""); if (ja() == 0) { ididit = 0; return;} @@ -630,9 +628,8 @@ void setwrp(void) { warpfac = aaitem; wfacsq=warpfac*warpfac; if (warpfac <= oldfac || warpfac <= 6.0) { - proutn("Helmsman Sulu- \"Warp factor "); - cramf(warpfac, 0, 1); - prout(", Captain.\""); + proutn("Helmsman Sulu- \"Warp factor %do, Captain.\"", + (int)warpfac); return; } if (warpfac < 8.00) { @@ -714,9 +711,7 @@ void atover(int igrab) { } warpfac = 6.0+2.0*Rand(); wfacsq = warpfac * warpfac; - proutn("Warp factor set to "); - cramf(warpfac, 1, 1); - skip(1); + prout("Warp factor set to %d", (int)warpfac); power = 0.75*energy; dist = power/(warpfac*warpfac*warpfac*(shldup+1)); distreq = 1.4142+Rand(); @@ -744,9 +739,8 @@ void timwrp() { prout("***TIME WARP ENTERED."); if (game.state.snap && Rand() < 0.5) { /* Go back in time */ - proutn("You are traveling backwards in time "); - cramf(game.state.date-game.snapsht.date, 0, 2); - prout(" stardates."); + prout("You are traveling backwards in time %d stardates.", + (int)(game.state.date-game.snapsht.date)); game.state = game.snapsht; game.state.snap = 0; if (game.state.remcom) { @@ -764,7 +758,7 @@ void timwrp() { /* Make sure Galileo is consistant -- Snapshot may have been taken when on planet, which would give us two Galileos! */ gotit = 0; - for (l = 1; l <= inplan; l++) { + for (l = 0; l < inplan; l++) { if (game.state.plnets[l].known == shuttle_down) { gotit = 1; if (iscraft==1 && ship==IHE) { @@ -793,9 +787,7 @@ void timwrp() { else { /* Go forward in time */ Time = -0.5*intime*log(Rand()); - proutn("You are traveling forward in time "); - cramf(Time, 1, 2); - prout(" stardates."); + prout("You are traveling forward in time %d stardates.", (int)Time); /* cheat to make sure no tractor beams occur during time warp */ game.future[FTBEAM] += Time; game.damage[DRADIO] += Time; @@ -837,8 +829,7 @@ void probe(void) { if (key == IHEOL) { /* slow mode, so let Kirk know how many probes there are left */ - crami(nprobes,1); - prout(nprobes==1 ? " probe left." : " probes left."); + prout(nprobes==1 ? "%d probe left." : "%d probes left.", nprobes); proutn("Are you sure you want to fire a probe? "); if (ja()==0) return; } @@ -922,9 +913,8 @@ void help(void) { } /* dematerialize starship */ game.quad[sectx][secty]=IHDOT; - proutn("Starbase in"); - cramlc(1, quadx, quady); - proutn(" responds--"); + proutn("Starbase in %s responds--", cramlc(quadrant, quadx, quady)); + proutn(""); crmshp(); prout(" dematerializes."); /* Give starbase three chances to rematerialize starship */