X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Freports.c;h=7ea7c171f3374ba5dad7d6b7f8b8cd48eeeac2ea;hp=7f4a13e72bad3bf955f2d031722e9abbab3d3457;hb=ad1478c7cc24b761592a1e355015b44b243aeeda;hpb=d87b83a23fb7b5ac0ba610069a3ce7da8026fd80 diff --git a/src/reports.c b/src/reports.c index 7f4a13e..7ea7c17 100644 --- a/src/reports.c +++ b/src/reports.c @@ -3,7 +3,8 @@ #include #include -void attakreport(int curt) +void attakreport(bool curt) +/* report status of bases under attack */ { if (!curt) { if (is_scheduled(FCDBAS)) { @@ -28,7 +29,8 @@ void attakreport(int curt) } -void report(void) +void report(void) +/* report on general game status */ { char *s1,*s2,*s3; @@ -72,7 +74,7 @@ void report(void) if (!damaged(DRADIO) || game.condit == IHDOCKED || game.iseenit) { /* Don't report this if not seen and either the radio is dead or not at base! */ - attakreport(0); + attakreport(false); game.iseenit = 1; } if (game.casual) prout(_("%d casualt%s suffered so far."), @@ -114,6 +116,7 @@ void report(void) } void lrscan(void) +/* long-range sensor scan */ { int x, y; chew(); @@ -150,6 +153,7 @@ void lrscan(void) } void dreprt(void) +/* damage report */ { bool jdam = false; int i; @@ -185,7 +189,8 @@ void rechart(void) } } -void chart(int nn) +void chart(bool title) +/* display the star chart */ { int i,j; chew(); @@ -198,7 +203,7 @@ void chart(int nn) rechart(); } - if (nn == 0) prout(_(" STAR CHART FOR THE KNOWN GALAXY")); + if (!title) prout(_(" STAR CHART FOR THE KNOWN GALAXY")); if (game.state.date > game.lastchart) prout(_("(Last surveillance update %d stardates ago)."), (int)(game.state.date-game.lastchart)); @@ -232,6 +237,7 @@ void chart(int nn) } static void sectscan(int goodScan, int i, int j) +/* light up an individual dot in a sector */ { if (goodScan || (abs(i-game.sector.x)<= 1 && abs(j-game.sector.y) <= 1)){ if ((game.quad[i][j]==IHMATER0)||(game.quad[i][j]==IHMATER1)||(game.quad[i][j]==IHMATER2)||(game.quad[i][j]==IHE)||(game.quad[i][j]==IHF)){ @@ -252,7 +258,8 @@ static void sectscan(int goodScan, int i, int j) proutn("- "); } -static void status(int req) +static void status(int req) +/* print status report lines */ { char *cp = NULL; int t, dam = 0; @@ -316,28 +323,29 @@ static void status(int req) break; case 10: if (game.options & OPTION_WORLDS) { - int here = game.state.galaxy[game.quadrant.x][game.quadrant.y].planet; - if (here != NOPLANET && game.state.plnets[here].inhabited != UNINHABITED) - proutn(_("Major system %s"), systemname(here)); + int plnet = game.state.galaxy[game.quadrant.x][game.quadrant.y].planet; + if (plnet != NOPLANET && game.state.plnets[plnet].inhabited != UNINHABITED) + proutn(_("Major system %s"), systemname(plnet)); else proutn(_("Sector is uninhabited")); } break; case 11: - attakreport(1); + attakreport(true); break; } } -int srscan(int l) +int srscan(int l) +/* short-range scan */ { /* the "sy" request is undocumented */ static char requests[][3] = {"","da","co","po","ls","wa","en","to","sh","kl","sy", "ti"}; int i, j, jj, req=0; - int goodScan=true, leftside=true, rightside=true, nn=false; + int goodScan=true, leftside=true, rightside=true, title=false; switch (l) { case SCAN_FULL: // SRSCAN if (damaged(DSRSENS)) { @@ -357,7 +365,7 @@ int srscan(int l) game.state.galaxy[game.quadrant.x][game.quadrant.y].charted = true; } scan(); - if (isit("chart")) nn = true; + if (isit("chart")) title = true; if (isit("no")) rightside = false; chew(); prout(" 1 2 3 4 5 6 7 8 9 10"); @@ -400,12 +408,13 @@ int srscan(int l) if (req!=0) return(goodScan); } prout(""); - if (nn) chart(1); + if (title) chart(true); return(goodScan); } void eta(void) +/* use computer to get estimated time of arrival for a warp jump */ { int ix1, ix2, iy1, iy2; bool wfl, prompt = false;