projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More de-FORTRANizing of the output code.
[super-star-trek.git]
/
ai.c
diff --git
a/ai.c
b/ai.c
index d2223cab385e9ab9892bffb269b8da889aeceb53..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
@@
-173,9
+169,7
@@
static void movebaddy(int comx, int comy, int loccom, int ienm) {
if (nsteps < 1) nsteps = 1; /* This shouldn't be necessary */
\r
#ifdef DEBUG
\r
if (idebug) {
\r
if (nsteps < 1) nsteps = 1; /* This shouldn't be necessary */
\r
#ifdef DEBUG
\r
if (idebug) {
\r
- proutn("NSTEPS = ");
\r
- crami(nsteps, 1);
\r
- skip(1);
\r
+ prout("NSTEPS = %d", nsteps);
\r
}
\r
#endif
\r
/* Compute preferred values of delta X and Y */
\r
}
\r
#endif
\r
/* Compute preferred values of delta X and Y */
\r
@@
-192,8
+186,7
@@
static void movebaddy(int comx, int comy, int loccom, int ienm) {
for (ll = 1; ll <= nsteps; ll++) {
\r
#ifdef DEBUG
\r
if (idebug) {
\r
for (ll = 1; ll <= nsteps; ll++) {
\r
#ifdef DEBUG
\r
if (idebug) {
\r
- crami(ll,2);
\r
- skip(1);
\r
+ prout("%d", ll);
\r
}
\r
#endif
\r
/* Check if preferred position available */
\r
}
\r
#endif
\r
/* Check if preferred position available */
\r
@@
-242,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
@@
-261,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
@@
-354,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
@@
-515,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
@@
-542,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