repair = xtime;\r
if (condit == IHDOCKED) repair /= docfac;\r
/* Don't fix Deathray here */\r
- for (l=1; l<=ndevice; l++)\r
+ for (l=1; l<=NDEVICES; l++)\r
if (game.damage[l] > 0.0 && l != DDRAY)\r
game.damage[l] -= (game.damage[l]-repair > 0.0 ? repair : game.damage[l]);\r
/* If radio repaired, update star chart and attack reports */\r
}\r
iran10(§x, §y);\r
crmshp();\r
- proutn(" is pulled to");\r
- cramlc(1, quadx, quady);\r
+ proutn(" is pulled to ");\r
+ proutn(cramlc(quadrant, quadx, quady));\r
proutn(", ");\r
- cramlc(2, sectx, secty);\r
- skip(1);\r
+ prout(cramlc(sector, sectx, secty));\r
if (resting) {\r
prout("(Remainder of rest/repair period cancellegame.state.)");\r
resting = 0;\r
if (ipage==0) pause(1);\r
ipage = 1;\r
skip(1);\r
- proutn("Lt. Uhura- \"Captain, the starbase in");\r
- cramlc(1, batx, baty);\r
- skip(1);\r
+ proutn("Lt. Uhura- \"Captain, the starbase in ");\r
+ prout(cramlc(quadrant, batx, baty));\r
prout(" reports that it is under atttack and that it can");\r
- proutn(" hold out only until stardate ");\r
- cramf(game.future[FCDBAS],1,1);\r
+ proutn(" hold out only until stardate %d",\r
+ (int)game.future[FCDBAS]);\r
prout(".\"");\r
if (resting) {\r
skip(1);\r
ipage = 1;\r
skip(1);\r
prout("Lt. Uhura- \"Captain, Starfleet Command reports that");\r
- proutn(" the starbase in");\r
- cramlc(1, batx, baty);\r
+ proutn(" the starbase in ");\r
+ proutn(cramlc(quadrant, batx, baty));\r
prout(" has been destroyed by");\r
if (isatb==2) prout("the Klingon Super-Commander");\r
else prout("a Klingon Commander");\r
ipage = 1;\r
skip(1);\r
proutn("Lt. Uhura- \"The deep space probe is now in ");\r
- cramlc(1, probecx, probecy);\r
+ proutn(cramlc(quadrant, probecx, probecy));\r
prout(".\"");\r
}\r
}\r
do {\r
if (delay <= 0) resting = 0;\r
if (resting == 0) {\r
- cramf(game.state.remtime, 0, 2);\r
- prout(" stardates left.");\r
+ prout("%d stardates left.", (int)game.state.remtime);\r
return;\r
}\r
temp = Time = delay;\r
game.state.nplankl++;\r
crmena(1, IHP, 2, ii, jj);\r
prout(" destroyed.");\r
- game.state.plnets[iplnet] = nulplanet;\r
+ DESTROY(&game.state.plnets[iplnet]);\r
iplnet = plnetx = plnety = 0;\r
if (landed == 1) {\r
finish(FPNOVA);\r
skip(1);\r
break;\r
}\r
- proutn(", buffeted to");\r
- cramlc(2, newcx, newcy);\r
+ proutn(", buffeted to ");\r
+ proutn(cramlc(sector, newcx, newcy));\r
game.quad[ii][jj] = IHDOT;\r
game.quad[newcx][newcy] = iquad;\r
game.kx[ll] = newcx;\r
/* it isn't here, or we just entered (treat as inroute) */\r
if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED) {\r
skip(1);\r
- proutn("Message from Starfleet Command Stardate ");\r
- cramf(game.state.date, 0, 1);\r
- skip(1);\r
- proutn(" Supernova in");\r
- cramlc(1, nqx, nqy);\r
- prout("; caution advised.");\r
+ prout("Message from Starfleet Command Stardate %.2f", game.state.date);\r
+ proutn(" Supernova in %s; caution advised.",\r
+ cramlc(quadrant, nqx, nqy));\r
}\r
}\r
else {\r
skip(1);\r
prouts("***RED ALERT! RED ALERT!");\r
skip(1);\r
- proutn("***Incipient supernova detected at");\r
- cramlc(2, nsx, nsy);\r
- skip(1);\r
+ prout("***Incipient supernova detected at ", cramlc(sector, nsx, nsy));\r
nqx = quadx;\r
nqy = quady;\r
if (square(nsx-sectx) + square(nsy-secty) <= 2.1) {\r
npdead = num - nrmdead*10;\r
if (npdead) {\r
int l;\r
- for (l = 1; l <= inplan; l++)\r
+ for (l = 0; l < inplan; l++)\r
if (game.state.plnets[l].x == nqx && game.state.plnets[l].y == nqy) {\r
- game.state.plnets[l] = nulplanet;\r
+ DESTROY(&game.state.plnets[l]);\r
}\r
}\r
/* Destroy any base in supernovaed quadrant */\r
if (game.state.remkl==0 && (nqx != quadx || nqy != quady)) {\r
skip(2);\r
if (insx == 0) prout("Lucky you!");\r
- proutn("A supernova in");\r
- cramlc(1, nqx, nqy);\r
- prout(" has just destroyed the last Klingons.");\r
+ proutn("A supernova in %s has just destroyed the last Klingons.",\r
+ cramlc(quadrant, nqx, nqy));\r
finish(FWON);\r
return;\r
}\r