projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Get rid of linux.c and os2.c, code is pure ANSI now.
[super-star-trek.git]
/
ai.c
diff --git
a/ai.c
b/ai.c
index 37f266c8150d360012fb2232297c0d0f90b29b96..3deab689799c2bc2a91c56db62eea833a24c5358 100644
(file)
--- a/
ai.c
+++ b/
ai.c
@@
-26,9
+26,8
@@
static int tryexit(int lookx, int looky, int ienm, int loccom, int irun) {
condit == IHDOCKED) {
\r
proutn("***");
\r
cramen(ienm);
\r
condit == IHDOCKED) {
\r
proutn("***");
\r
cramen(ienm);
\r
- proutn(" escapes to");
\r
- cramlc(1, iqx, iqy);
\r
- prout(" (and regains strength).");
\r
+ proutn(" escapes to %s (and regains strength).",
\r
+ cramlc(quadrant, iqx, iqy));
\r
}
\r
/* handle local matters related to escape */
\r
game.kx[loccom] = game.kx[nenhere];
\r
}
\r
/* handle local matters related to escape */
\r
game.kx[loccom] = game.kx[nenhere];
\r
@@
-154,11
+153,8
@@
static void movebaddy(int comx, int comy, int loccom, int ienm) {
}
\r
#ifdef DEBUG
\r
if (idebug) {
\r
}
\r
#ifdef DEBUG
\r
if (idebug) {
\r
- proutn("MOTION = ");
\r
- cramf(motion, 1, 2);
\r
- proutn(" FORCES = ");
\r
- cramf(forces, 1, 2);
\r
- skip(1);
\r
+ proutn("MOTION = %1.2f", motion);
\r
+ proutn(" FORCES = %1,2f", forces);
\r
}
\r
#endif
\r
/* don't move if no motion */
\r
}
\r
#endif
\r
/* don't move if no motion */
\r
@@
-239,8
+235,7
@@
static void movebaddy(int comx, int comy, int loccom, int ienm) {
nexty = looky;
\r
#ifdef DEBUG
\r
if (idebug) {
\r
nexty = looky;
\r
#ifdef DEBUG
\r
if (idebug) {
\r
- cramlc(0, nextx, nexty);
\r
- skip(1);
\r
+ prout(cramlc(neither, nextx, nexty));
\r
}
\r
#endif
\r
}
\r
}
\r
#endif
\r
}
\r
@@
-258,9
+253,8
@@
static void movebaddy(int comx, int comy, int loccom, int ienm) {
proutn("***");
\r
cramen(ienm);
\r
if (game.kdist[loccom] < dist1) proutn(" advances to");
\r
proutn("***");
\r
cramen(ienm);
\r
if (game.kdist[loccom] < dist1) proutn(" advances to");
\r
- else proutn(" retreats to");
\r
- cramlc(2, nextx, nexty);
\r
- skip(1);
\r
+ else proutn(" retreats to ");
\r
+ prout(cramlc(sector, nextx, nexty));
\r
}
\r
}
\r
}
\r
}
\r
}
\r
}
\r
@@
-351,8
+345,8
@@
static int checkdest(int iqx, int iqy, int flag, int *ipage) {
if (*ipage==0) pause(1);
\r
*ipage = 1;
\r
prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports");
\r
if (*ipage==0) pause(1);
\r
*ipage = 1;
\r
prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports");
\r
- proutn(" a planet in");
\r
-
cramlc(1, game.state.isx, game.state.isy
);
\r
+ proutn(" a planet in
");
\r
+
proutn(cramlc(quadrant, game.state.isx, game.state.isy)
);
\r
prout(" has been destroyed");
\r
prout(" by the Super-commander.\"");
\r
}
\r
prout(" has been destroyed");
\r
prout(" by the Super-commander.\"");
\r
}
\r
@@
-512,13
+506,12
@@
void scom(int *ipage) {
iseenit = 1;
\r
if (*ipage == 0) pause(1);
\r
*ipage=1;
\r
iseenit = 1;
\r
if (*ipage == 0) pause(1);
\r
*ipage=1;
\r
- proutn("Lt. Uhura- \"Captain, the starbase in");
\r
-
cramlc(1, game.state.isx, game.state.isy
);
\r
+ proutn("Lt. Uhura- \"Captain, the starbase in
");
\r
+
proutn(cramlc(quadrant, game.state.isx, game.state.isy)
);
\r
skip(1);
\r
prout(" reports that it is under attack from the Klingon Super-commander.");
\r
skip(1);
\r
prout(" reports that it is under attack from the Klingon Super-commander.");
\r
- proutn(" It can survive until stardate ");
\r
- cramf(game.future[FSCDBAS], 0, 1);
\r
- prout(" .\"");
\r
+ proutn(" It can survive until stardate %d.\"",
\r
+ (int)game.future[FSCDBAS]);
\r
if (resting==0) return;
\r
prout("Mr. Spock- \"Captain, shall we cancel the rest period?\"");
\r
if (ja()==0) return;
\r
if (resting==0) return;
\r
prout("Mr. Spock- \"Captain, shall we cancel the rest period?\"");
\r
if (ja()==0) return;
\r
@@
-539,8
+532,8
@@
void scom(int *ipage) {
if (*ipage==0) pause(1);
\r
*ipage = 1;
\r
prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports");
\r
if (*ipage==0) pause(1);
\r
*ipage = 1;
\r
prout("Lt. Uhura- \"Captain, Starfleet Intelligence reports");
\r
- proutn(" the Super-commander is in");
\r
-
cramlc(1, game.state.isx, game.state. isy
);
\r
+ proutn(" the Super-commander is in
");
\r
+
proutn(cramlc(quadrant, game.state.isx, game.state. isy)
);
\r
prout(".\"");
\r
return;
\r
}
\r
prout(".\"");
\r
return;
\r
}
\r