projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Abstract all references to the future array (outside of events.c) away.
[super-star-trek.git]
/
src
/
reports.c
diff --git
a/src/reports.c
b/src/reports.c
index 0948073b01a4d6a2e88bd7573184ed9d51012a94..a79a4105d2e1b4ee94eb8fea6f9566d064a91432 100644
(file)
--- a/
src/reports.c
+++ b/
src/reports.c
@@
-6,23
+6,23
@@
void attakreport(int curt)
{
if (!curt) {
void attakreport(int curt)
{
if (!curt) {
- if (
game.future[FCDBAS] < FOREVER
) {
+ if (
is_scheduled(FCDBAS)
) {
prout("Starbase in %s is currently under Commander attack.",
cramlc(quadrant, game.batx, game.baty));
prout("It can hold out until Stardate %d.",
prout("Starbase in %s is currently under Commander attack.",
cramlc(quadrant, game.batx, game.baty));
prout("It can hold out until Stardate %d.",
- (int)
game.future[FCDBAS]
);
+ (int)
scheduled(FCDBAS)
);
}
if (game.isatb == 1) {
prout("Starbase in %s is under Super-commander attack.",
cramlc(quadrant, game.state.isx, game.state.isy));
prout("It can hold out until Stardate %d.",
}
if (game.isatb == 1) {
prout("Starbase in %s is under Super-commander attack.",
cramlc(quadrant, game.state.isx, game.state.isy));
prout("It can hold out until Stardate %d.",
- (int)
game.future[FSCDBAS]
);
+ (int)
scheduled(FSCDBAS)
);
}
} else {
}
} else {
- if (
game.future[FCDBAS] < FOREVER
)
- proutn("Base in %i - %i attacked by C. Alive until %.1f", game.batx, game.baty,
game.future[FCDBAS]
);
+ if (
is_scheduled(FCDBAS)
)
+ proutn("Base in %i - %i attacked by C. Alive until %.1f", game.batx, game.baty,
scheduled(FCDBAS)
);
if (game.isatb == 1)
if (game.isatb == 1)
- proutn("Base in %i - %i attacked by S. Alive until %.1f", game.state.isx, game.state.isy,
game.future[FSCDBAS]
);
+ proutn("Base in %i - %i attacked by S. Alive until %.1f", game.state.isx, game.state.isy,
scheduled(FSCDBAS)
);
}
clreol();
}
}
clreol();
}
@@
-87,8
+87,8
@@
void report(void)
if (game.nprobes!=1) proutn("s");
prout(".");
}
if (game.nprobes!=1) proutn("s");
prout(".");
}
- if ((game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED)
&&
-
game.future[FDSPROB] != FOREVER
) {
+ if ((game.damage[DRADIO] == 0.0 || game.condit == IHDOCKED)
+
&& is_scheduled(FDSPROB)
) {
if (game.isarmed)
proutn("An armed deep space probe is in");
else
if (game.isarmed)
proutn("An armed deep space probe is in");
else
@@
-227,6
+227,7
@@
void chart(int nn)
proutn(" |");
if (i<GALSIZE) skip(1);
}
proutn(" |");
if (i<GALSIZE) skip(1);
}
+ prout("");
}
static void sectscan(int goodScan, int i, int j)
}
static void sectscan(int goodScan, int i, int j)
@@
-313,6
+314,16
@@
static void status(int req)
proutn("Klingons Left %d", KLINGREM);
break;
case 10:
proutn("Klingons Left %d", KLINGREM);
break;
case 10:
+ if (game.options & OPTION_WORLDS) {
+ planet *here = game.state.galaxy[game.quadx][game.quady].planet;
+ if (here && here->inhabited != UNINHABITED)
+ proutn("Major system %s", systemname(here));
+ else
+ proutn("Sector is uninhabited");
+ }
+
+ break;
+ case 11:
attakreport(1);
break;
}
attakreport(1);
break;
}
@@
-320,8
+331,9
@@
static void status(int req)
int srscan(int l)
{
int srscan(int l)
{
+ /* the "sy" request is undocumented */
static char requests[][3] =
static char requests[][3] =
- {"","da","co","po","ls","wa","en","to","sh","kl","ti"};
+ {"","da","co","po","ls","wa","en","to","sh","kl","
sy", "
ti"};
int leftside=TRUE, rightside=TRUE, i, j, jj, req=0, nn=FALSE;
int goodScan=TRUE;
switch (l) {
int leftside=TRUE, rightside=TRUE, i, j, jj, req=0, nn=FALSE;
int goodScan=TRUE;
switch (l) {
@@
-358,7
+370,7
@@
int srscan(int l)
if (req > sizeof(requests)/sizeof(requests[0])) {
prout("UNRECOGNIZED REQUEST. Legal requests are:");
prout(" date, condition, position, lsupport, warpfactor,");
if (req > sizeof(requests)/sizeof(requests[0])) {
prout("UNRECOGNIZED REQUEST. Legal requests are:");
prout(" date, condition, position, lsupport, warpfactor,");
- prout(" energy, torpedoes, shields, klingons, time, bases.");
+ prout(" energy, torpedoes, shields, klingons, time,
system,
bases.");
return FALSE;
}
// no break
return FALSE;
}
// no break
@@
-514,9
+526,9
@@
void eta(void)
prout("Unfortunately, the Federation will be destroyed by then.");
if (twarp > 6.0)
prout("You'll be taking risks at that speed, Captain");
prout("Unfortunately, the Federation will be destroyed by then.");
if (twarp > 6.0)
prout("You'll be taking risks at that speed, Captain");
- if ((game.isatb==1 && game.state.isy == i
x1 && game.state.isx == iy
1 &&
-
game.future[FSCDBAS]
< ttime+game.state.date)||
- (
game.future[FCDBAS]<ttime+game.state.date && game.baty==ix1 && game.batx == iy
1))
+ if ((game.isatb==1 && game.state.isy == i
y1 && game.state.isx == ix
1 &&
+
scheduled(FSCDBAS)
< ttime+game.state.date)||
+ (
scheduled(FCDBAS)<ttime+game.state.date && game.baty==iy1 && game.batx == ix
1))
prout("The starbase there will be destroyed by then.");
proutn("New warp factor to try? ");
if (scan() == IHREAL) {
prout("The starbase there will be destroyed by then.");
proutn("New warp factor to try? ");
if (scan() == IHREAL) {