projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Starchart and base-attack tweaks.
[super-star-trek.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index 37a02d1bc92c93d81fc432fdd8a181e85fc26b32..3362fddf818368d526d4ceb6372207c797ac8502 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-62,10
+62,11
@@
void events(void)
{
int evcode, i=0, j, k, l;
double fintim = game.state.date + game.optime, datemin, xtime, repair, yank=0;
{
int evcode, i=0, j, k, l;
double fintim = game.state.date + game.optime, datemin, xtime, repair, yank=0;
- bool
radio_was_broken,
ictbeam = false, istract = false;
+ bool ictbeam = false, istract = false;
struct quadrant *pdest, *q;
coord w, hold;
event *ev, *ev2;
struct quadrant *pdest, *q;
coord w, hold;
event *ev, *ev2;
+ bool fixed_dev[NDEVICES];
if (idebug) {
prout("=== EVENTS from %.2f to %.2f:", game.state.date, fintim);
if (idebug) {
prout("=== EVENTS from %.2f to %.2f:", game.state.date, fintim);
@@
-91,8
+92,6
@@
void events(void)
}
}
}
}
- radio_was_broken = damaged(DRADIO);
-
hold.x = hold.y = 0;
for (;;) {
/* Select earliest extraneous event, evcode==0 if no events */
hold.x = hold.y = 0;
for (;;) {
/* Select earliest extraneous event, evcode==0 if no events */
@@
-137,11
+136,18
@@
void events(void)
if (game.condition == docked)
repair /= game.docfac;
/* Don't fix Deathray here */
if (game.condition == docked)
repair /= game.docfac;
/* Don't fix Deathray here */
- for (l=0; l<NDEVICES; l++)
- if (game.damage[l] > 0.0 && l != DDRAY)
- game.damage[l] -= (game.damage[l]-repair > 0.0 ? repair : game.damage[l]);
+ for (l=0; l<NDEVICES; l++) {
+ fixed_dev[l] = false;
+ if (game.damage[l] > 0.0 && l != DDRAY) {
+ double reminder = (game.damage[l] > repair ?
+ game.damage[l] - repair : .0);
+ game.damage[l] = reminder;
+ if (!(reminder > 0))
+ fixed_dev[l] = true;
+ }
+ }
/* If radio repaired, update star chart and attack reports */
/* If radio repaired, update star chart and attack reports */
- if (
radio_was_broken && !damaged(DRADIO)
) {
+ if (
fixed_dev[DRADIO]
) {
prout(_("Lt. Uhura- \"Captain, the sub-space radio is working and"));
prout(_(" surveillance reports are coming in."));
skip(1);
prout(_("Lt. Uhura- \"Captain, the sub-space radio is working and"));
prout(_(" surveillance reports are coming in."));
skip(1);
@@
-149,10
+155,11
@@
void events(void)
attackreport(false);
game.iseenit = true;
}
attackreport(false);
game.iseenit = true;
}
- rechart();
prout(_(" The star chart is now up to date.\""));
skip(1);
}
prout(_(" The star chart is now up to date.\""));
skip(1);
}
+ if (fixed_dev[DRADIO] || fixed_dev[DLRSENS] || fixed_dev[DSRSENS])
+ rechart();
/* Cause extraneous event EVCODE to occur */
game.optime -= xtime;
switch (evcode) {
/* Cause extraneous event EVCODE to occur */
game.optime -= xtime;
switch (evcode) {
@@
-541,7
+548,7
@@
void events(void)
} else {
prout(_("Uhura- Starfleet reports increased Klingon activity"));
if (q->planet != NOPLANET)
} else {
prout(_("Uhura- Starfleet reports increased Klingon activity"));
if (q->planet != NOPLANET)
- proutn(_("near %s"), systnames[q->planet]);
+ proutn(_("near %s
"), systnames[q->planet]);
prout(_("in %s.\n"), cramlc(quadrant, w));
}
}
prout(_("in %s.\n"), cramlc(quadrant, w));
}
}
@@
-895,7
+902,11
@@
void supernova(bool induced, coord *w)
game.state.nscrem = game.state.kscmdr.x = game.state.kscmdr.y = game.isatb = 0;
game.iscate = false;
unschedule(FSCMOVE);
game.state.nscrem = game.state.kscmdr.x = game.state.kscmdr.y = game.isatb = 0;
game.iscate = false;
unschedule(FSCMOVE);
+ }
+ if (same(nq, game.battle)) {
unschedule(FSCDBAS);
unschedule(FSCDBAS);
+ unschedule(FCDBAS);
+ invalidate(game.battle);
}
if (game.state.remcom) {
int maxloop = game.state.remcom, l;
}
if (game.state.remcom) {
int maxloop = game.state.remcom, l;