(land, nuke, plan, shi): Change stop prefix to `!'. Explain it in the

footer when actually present.
This commit is contained in:
Markus Armbruster 2006-06-01 16:29:54 +00:00
parent b8825e962c
commit 016249c9e5
4 changed files with 44 additions and 20 deletions

View file

@ -45,14 +45,14 @@
int int
land(void) land(void)
{ {
int nunits; int nunits, noff;
struct nstr_item ni; struct nstr_item ni;
struct lndstr land; struct lndstr land;
if (!snxtitem(&ni, EF_LAND, player->argp[1])) if (!snxtitem(&ni, EF_LAND, player->argp[1]))
return RET_SYN; return RET_SYN;
nunits = 0; nunits = noff = 0;
while (nxtitem(&ni, &land)) { while (nxtitem(&ni, &land)) {
if (land.lnd_own == 0) if (land.lnd_own == 0)
continue; continue;
@ -69,13 +69,15 @@ land(void)
pr(" fl"); pr(" fl");
pr(" tch retr rd xl ln carry\n"); pr(" tch retr rd xl ln carry\n");
} }
if (land.lnd_off)
noff++;
if (player->god) if (player->god)
pr("%3d ", land.lnd_own); pr("%3d ", land.lnd_own);
pr("%4d ", ni.cur); pr("%4d ", ni.cur);
pr("%-15.15s", lchr[(int)land.lnd_type].l_name); pr("%-15.15s", lchr[(int)land.lnd_type].l_name);
prxy(" %4d,%-4d", land.lnd_x, land.lnd_y, player->cnum); prxy(" %4d,%-4d", land.lnd_x, land.lnd_y, player->cnum);
pr("%1.1s", &land.lnd_army); pr("%1.1s", &land.lnd_army);
pr(" %c%3d%%", land.lnd_off ? '=' : ' ', land.lnd_effic); pr(" %c%3d%%", land.lnd_off ? '!' : ' ', land.lnd_effic);
pr("%4d", land.lnd_item[I_MILIT]); pr("%4d", land.lnd_item[I_MILIT]);
pr("%4d", land.lnd_harden); pr("%4d", land.lnd_harden);
pr("%4d", land.lnd_mobil); pr("%4d", land.lnd_mobil);
@ -99,7 +101,11 @@ land(void)
else else
pr("%s: No unit(s)\n", ""); pr("%s: No unit(s)\n", "");
return RET_FAIL; return RET_FAIL;
} else } else {
pr("%d unit%s\n", nunits, splur(nunits)); pr("%d unit%s", nunits, splur(nunits));
if (noff)
pr(", %d stopped (eff marked with !)", noff);
pr("\n");
}
return RET_OK; return RET_OK;
} }

View file

@ -47,14 +47,14 @@
int int
nuke(void) nuke(void)
{ {
int nnukes; int nnukes, noff;
struct nstr_item nstr; struct nstr_item nstr;
struct nukstr nuk; struct nukstr nuk;
struct plnstr plane; struct plnstr plane;
if (!snxtitem(&nstr, EF_NUKE, player->argp[1])) if (!snxtitem(&nstr, EF_NUKE, player->argp[1]))
return RET_SYN; return RET_SYN;
nnukes = 0; nnukes = noff = 0;
while (nxtitem(&nstr, &nuk)) { while (nxtitem(&nstr, &nuk)) {
if (!player->owner || nuk.nuk_own == 0) if (!player->owner || nuk.nuk_own == 0)
continue; continue;
@ -63,12 +63,14 @@ nuke(void)
pr("own "); pr("own ");
pr(" # nuke type x,y s eff tech carry burst\n"); pr(" # nuke type x,y s eff tech carry burst\n");
} }
if (nuk.nuk_off)
noff++;
if (player->god) if (player->god)
pr("%-3d ", nuk.nuk_own); pr("%-3d ", nuk.nuk_own);
pr("%4d %-19.19s ", nstr.cur, nchr[(int)nuk.nuk_type].n_name); pr("%4d %-19.19s ", nstr.cur, nchr[(int)nuk.nuk_type].n_name);
prxy("%4d,%-4d", nuk.nuk_x, nuk.nuk_y, player->cnum); prxy("%4d,%-4d", nuk.nuk_x, nuk.nuk_y, player->cnum);
pr(" %1.1s %c%3d%% %4d", pr(" %1.1s %c%3d%% %4d",
&nuk.nuk_stockpile, nuk.nuk_off ? '=' : ' ', nuk.nuk_effic, &nuk.nuk_stockpile, nuk.nuk_off ? '!' : ' ', nuk.nuk_effic,
nuk.nuk_tech); nuk.nuk_tech);
if (nuk.nuk_plane >= 0) { if (nuk.nuk_plane >= 0) {
getplane(nuk.nuk_plane, &plane); getplane(nuk.nuk_plane, &plane);
@ -85,8 +87,12 @@ nuke(void)
else else
pr("%s: No nuke(s)\n", ""); pr("%s: No nuke(s)\n", "");
return RET_FAIL; return RET_FAIL;
} else } else {
pr("%d nuke%s\n", nnukes, splur(nnukes)); pr("%d nuke%s", nnukes, splur(nnukes));
if (noff)
pr(", %d stopped (eff marked with !)", noff);
pr("\n");
}
return RET_OK; return RET_OK;
} }

View file

@ -47,13 +47,13 @@
int int
plan(void) plan(void)
{ {
int nplanes; int nplanes, noff;
struct nstr_item np; struct nstr_item np;
struct plnstr plane; struct plnstr plane;
if (!snxtitem(&np, EF_PLANE, player->argp[1])) if (!snxtitem(&np, EF_PLANE, player->argp[1]))
return RET_SYN; return RET_SYN;
nplanes = 0; nplanes = noff = 0;
while (nxtitem(&np, &plane)) { while (nxtitem(&np, &plane)) {
if (!player->owner || plane.pln_own == 0) if (!player->owner || plane.pln_own == 0)
continue; continue;
@ -62,12 +62,14 @@ plan(void)
pr("own "); pr("own ");
pr(" # type x,y w eff mu def tech ran hard carry special\n"); pr(" # type x,y w eff mu def tech ran hard carry special\n");
} }
if (plane.pln_off)
noff++;
if (player->god) if (player->god)
pr("%3d ", plane.pln_own); pr("%3d ", plane.pln_own);
pr("%4d %-19.19s ", np.cur, plchr[(int)plane.pln_type].pl_name); pr("%4d %-19.19s ", np.cur, plchr[(int)plane.pln_type].pl_name);
prxy("%4d,%-4d", plane.pln_x, plane.pln_y, player->cnum); prxy("%4d,%-4d", plane.pln_x, plane.pln_y, player->cnum);
pr(" %1.1s %c%3d%% %3d %3d %4d %3d %3d", pr(" %1.1s %c%3d%% %3d %3d %4d %3d %3d",
&plane.pln_wing, plane.pln_off ? '=' : ' ', plane.pln_effic, &plane.pln_wing, plane.pln_off ? '!' : ' ', plane.pln_effic,
plane.pln_mobil, plane.pln_def, plane.pln_tech, plane.pln_mobil, plane.pln_def, plane.pln_tech,
plane.pln_range, plane.pln_harden); plane.pln_range, plane.pln_harden);
if (plane.pln_ship >= 0) if (plane.pln_ship >= 0)
@ -93,8 +95,12 @@ plan(void)
else else
pr("%s: No plane(s)\n", ""); pr("%s: No plane(s)\n", "");
return RET_FAIL; return RET_FAIL;
} else } else {
pr("%d plane%s\n", nplanes, splur(nplanes)); pr("%d plane%s", nplanes, splur(nplanes));
if (noff)
pr(", %d stopped (eff marked with !)", noff);
pr("\n");
}
return RET_OK; return RET_OK;
} }

View file

@ -45,14 +45,14 @@
int int
shi(void) shi(void)
{ {
int nships; int nships, noff;
struct nstr_item ni; struct nstr_item ni;
struct shpstr ship; struct shpstr ship;
if (!snxtitem(&ni, EF_SHIP, player->argp[1])) if (!snxtitem(&ni, EF_SHIP, player->argp[1]))
return RET_SYN; return RET_SYN;
nships = 0; nships = noff = 0;
while (nxtitem(&ni, &ship)) { while (nxtitem(&ni, &ship)) {
if (!player->owner || ship.shp_own == 0) if (!player->owner || ship.shp_own == 0)
continue; continue;
@ -67,13 +67,15 @@ shi(void)
pr(" fuel"); pr(" fuel");
pr(" tech\n"); pr(" tech\n");
} }
if (ship.shp_off)
noff++;
if (player->god) if (player->god)
pr("%3d ", ship.shp_own); pr("%3d ", ship.shp_own);
pr("%4d ", ni.cur); pr("%4d ", ni.cur);
pr("%-16.16s ", mchr[(int)ship.shp_type].m_name); pr("%-16.16s ", mchr[(int)ship.shp_type].m_name);
prxy("%4d,%-4d ", ship.shp_x, ship.shp_y, player->cnum); prxy("%4d,%-4d ", ship.shp_x, ship.shp_y, player->cnum);
pr("%1.1s", &ship.shp_fleet); pr("%1.1s", &ship.shp_fleet);
pr(" %c%3d%%", ship.shp_off ? '=' : ' ', ship.shp_effic); pr(" %c%3d%%", ship.shp_off ? '!' : ' ', ship.shp_effic);
pr("%4d", ship.shp_item[I_CIVIL]); pr("%4d", ship.shp_item[I_CIVIL]);
pr("%4d", ship.shp_item[I_MILIT]); pr("%4d", ship.shp_item[I_MILIT]);
@ -100,7 +102,11 @@ shi(void)
else else
pr("%s: No ship(s)\n", ""); pr("%s: No ship(s)\n", "");
return RET_FAIL; return RET_FAIL;
} else } else {
pr("%d ship%s\n", nships, splur(nships)); pr("%d ship%s", nships, splur(nships));
if (noff)
pr(", %d stopped (eff marked with !)", noff);
pr("\n");
}
return RET_OK; return RET_OK;
} }