We know this if either short or long range sensors are working */\r
if (game.damage[DSRSENS] == 0.0 || game.damage[DLRSENS] == 0.0 ||\r
condit == IHDOCKED) {\r
- proutn("***");\r
- cramen(ienm);\r
+ crmena(1, ienm, 2, game.kx[loccom], game.ky[loccom]);\r
proutn(" escapes to %s (and regains strength).",\r
cramlc(quadrant, iqx, iqy));\r
}\r
/* handle local matters related to escape */\r
+ game.quad[game.kx[loccom]][game.ky[loccom]] = IHDOT;\r
game.kx[loccom] = game.kx[nenhere];\r
game.ky[loccom] = game.ky[nenhere];\r
game.kavgd[loccom] = game.kavgd[nenhere];\r
if (my != 0) my = my*motion < 0 ? -1 : 1;\r
nextx = comx;\r
nexty = comy;\r
- game.quad[comx][comy] = IHDOT;\r
/* main move loop */\r
for (ll = 1; ll <= nsteps; ll++) {\r
#ifdef DEBUG\r
else break; /* done early */\r
}\r
/* Put commander in place within same quadrant */\r
+ game.quad[comx][comy] = IHDOT;\r
game.quad[nextx][nexty] = ienm;\r
if (nextx != comx || nexty != comy) {\r
/* it moved */\r
if (game.damage[DSRSENS] == 0 || condit == IHDOCKED) {\r
proutn("***");\r
cramen(ienm);\r
+ proutn(" from");\r
+ cramlc(2, comx, comy);\r
if (game.kdist[loccom] < dist1) proutn(" advances to");\r
else proutn(" retreats to ");\r
prout(cramlc(sector, nextx, nexty));\r
sortkl();\r
}\r
\r
-static int checkdest(int iqx, int iqy, int flag, int *ipage) {\r
- int i, j;\r
+static int movescom(int iqx, int iqy, int flag, int *ipage) {\r
+ int i;\r
\r
if ((iqx==quadx && iqy==quady) ||\r
iqx < 1 || iqx > 8 || iqy < 1 || iqy > 8 ||\r
for (i = 1; i <= game.state.rembase; i++)\r
if (game.state.baseqx[i]==iqx && game.state.baseqy[i]==iqy) return 1;\r
}\r
-\r
+ if (justin && !iscate) return 1;\r
/* do the move */\r
game.state.galaxy[game.state.isx][game.state.isy] -= 100;\r
game.state.isx = iqx;\r
game.state.isy = iqy;\r
game.state.galaxy[game.state.isx][game.state.isy] += 100;\r
- if (iscate) {\r
+ if (ishere) {\r
/* SC has scooted, Remove him from current quadrant */\r
iscate=0;\r
isatb=0;\r
DESTROY(&game.state.plnets[i]);\r
game.state.newstuf[game.state.isx][game.state.isy] -= 1;\r
if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED) {\r
- if (*ipage==0) pause(1);\r
+ if (*ipage==0) pause_game(1);\r
*ipage = 1;\r
prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports");\r
proutn(" a planet in ");\r
/* try moving in both x and y directions */\r
iqx = game.state.isx + ideltax;\r
iqy = game.state.isy + ideltax;\r
- if (checkdest(iqx, iqy, flag, ipage)) {\r
+ if (movescom(iqx, iqy, flag, ipage)) {\r
/* failed -- try some other maneuvers */\r
if (ideltax==0 || ideltay==0) {\r
/* attempt angle move */\r
if (ideltax != 0) {\r
iqy = game.state.isy + 1;\r
- if (checkdest(iqx, iqy, flag, ipage)) {\r
+ if (movescom(iqx, iqy, flag, ipage)) {\r
iqy = game.state.isy - 1;\r
- checkdest(iqx, iqy, flag, ipage);\r
+ movescom(iqx, iqy, flag, ipage);\r
}\r
}\r
else {\r
iqx = game.state.isx + 1;\r
- if (checkdest(iqx, iqy, flag, ipage)) {\r
+ if (movescom(iqx, iqy, flag, ipage)) {\r
iqx = game.state.isx - 1;\r
- checkdest(iqx, iqy, flag, ipage);\r
+ movescom(iqx, iqy, flag, ipage);\r
}\r
}\r
}\r
else {\r
/* try moving just in x or y */\r
iqy = game.state.isy;\r
- if (checkdest(iqx, iqy, flag, ipage)) {\r
+ if (movescom(iqx, iqy, flag, ipage)) {\r
iqy = game.state.isy + ideltay;\r
iqx = game.state.isx;\r
- checkdest(iqx, iqy, flag, ipage);\r
+ movescom(iqx, iqy, flag, ipage);\r
}\r
}\r
}\r
iseenit = 0;\r
isatb=1;\r
game.future[FSCDBAS] = game.state.date + 1.0 +2.0*Rand();\r
- if (batx != 0) game.future[FSCDBAS] += game.future[FCDBAS]-game.state.date;\r
+ if (game.future[FCDBAS] < 1e30) game.future[FSCDBAS] +=\r
+ game.future[FCDBAS]-game.state.date;\r
if (game.damage[DRADIO] > 0 && condit != IHDOCKED)\r
return; /* no warning */\r
iseenit = 1;\r
- if (*ipage == 0) pause(1);\r
+ if (*ipage == 0) pause_game(1);\r
*ipage=1;\r
proutn("Lt. Uhura- \"Captain, the starbase in ");\r
proutn(cramlc(quadrant, game.state.isx, game.state.isy));\r
(game.damage[DRADIO] > 0.0 && condit != IHDOCKED) ||\r
game.starch[game.state.isx][game.state.isy] > 0))\r
return;\r
- if (*ipage==0) pause(1);\r
+ if (*ipage==0) pause_game(1);\r
*ipage = 1;\r
prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports");\r
proutn(" the Super-commander is in ");\r
}\r
}\r
game.quad[ithx][ithy] = IHT;\r
+ game.kx[nenhere]=ithx;\r
+ game.ky[nenhere]=ithy;\r
\r
/* check to see if all holes plugged */\r
for (i = 1; i < 11; i++) {\r
crmena(1,IHT, 2, ithx, ithy);\r
prout(" completes web.");\r
ithere = ithx = ithy = 0;\r
+ nenhere--;\r
return;\r
}\r