Overhaul show sect b

Print sector type mnemonic and name, like show sect s and c.  Print
"can't" instead of negative number for sectors players can't designate
(this was not an issue before the previous commit).  Show build cost
per 100%, like show ship, land, plane and nuke.  Size the columns more
sensibly.
This commit is contained in:
Markus Armbruster 2009-02-21 16:36:39 +01:00
parent be6d7ca913
commit 48ff09664b
2 changed files with 27 additions and 17 deletions

View file

@ -460,7 +460,8 @@ show_sect_build(int foo)
{
int i, first;
pr("sector type cost to des cost for 1%% eff lcms for 1%% hcms for 1%%\n");
pr(" desig build 100%% eff\n"
"sector type $ lcm hcm $\n");
for (i = 0; dchr[i].d_name; i++) {
if (dchr[i].d_mnem == 0)
continue;
@ -469,11 +470,17 @@ show_sect_build(int foo)
if (dchr[i].d_cost <= 0 && dchr[i].d_build == 1
&& dchr[i].d_lcms == 0 && dchr[i].d_hcms == 0)
continue; /* the usual, skip */
pr("%-14c %-14d %-17d %-14d %d\n",
dchr[i].d_mnem, dchr[i].d_cost, dchr[i].d_build,
dchr[i].d_lcms, dchr[i].d_hcms);
pr("%c %-21.21s", dchr[i].d_mnem, dchr[i].d_name);
if (dchr[i].d_cost < 0)
pr(" can't");
else
pr(" %5d", dchr[i].d_cost);
pr(" %5d %5d %5d\n",
100 * dchr[i].d_lcms,
100 * dchr[i].d_hcms,
100 * dchr[i].d_build);
}
pr("other 0 1 0 0\n");
pr("any other 0 0 0 100\n");
first = 1;
for (i = 0; intrchr[i].in_name; i++) {