(show, show_item): Resurrect show item.

This commit is contained in:
Ron Koenderink 2006-01-22 18:57:14 +00:00
parent 8900dfaa3d
commit fee6c50b1a
4 changed files with 27 additions and 5 deletions

View file

@ -677,6 +677,7 @@ extern void show_land_stats(int);
extern void show_sect_build(int); extern void show_sect_build(int);
extern void show_sect_stats(int); extern void show_sect_stats(int);
extern void show_sect_capab(int); extern void show_sect_capab(int);
extern void show_item(int);
/* shpsub.c */ /* shpsub.c */
extern void shp_sel(struct nstr_item *, struct emp_qelem *); extern void shp_sel(struct nstr_item *, struct emp_qelem *);
extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid); extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid);

View file

@ -1,15 +1,16 @@
.TH Command SHOW .TH Command SHOW
.NA show "Characteristics of bridges, ships, planes, land units or sectors" .NA show "Characteristics of bridges, units, products or sectors"
.LV Basic .LV Basic
.SY "show <bridge|land|nuke|plane|sector|ship|tower> [b|s|c] [tech]" .SY "show <land|nuke|plane|sector|ship> [b|s|c] [tech]"
.SY "show <bridge|item|tower>"
The show command describes the characteristics of bridge spans, bridge The show command describes the characteristics of bridge spans, bridge
towers, planes, ships, land units, nukes, and sectors for a towers, planes, ships, land units, nukes, items and sectors for a
given technology level. given technology level.
.s1 .s1
The format of each output is more fully described in separate info The format of each output is more fully described in separate info
pages (Ship-types, Nuke-types, etc.). pages (Ship-types, Nuke-types, etc.).
.s1 .s1
Except for bridge (bridge span) and tower (bridge tower), a Except for bridge (bridge span), items and tower (bridge tower), a
further parameter is required to indicate whether you wish information further parameter is required to indicate whether you wish information
about building (b), statistics (s) or capabilities (c) of the selected about building (b), statistics (s) or capabilities (c) of the selected
type. type.

View file

@ -55,7 +55,7 @@ show(void)
int rlev; int rlev;
if (!(p = getstarg(player->argp[1], if (!(p = getstarg(player->argp[1],
"Describe what (plane, nuke, bridge, ship, sect, land unit, tower)? ", "Describe what (plane, nuke, bridge, ship, sect, land unit, tower, item)? ",
buf)) buf))
|| !*p) || !*p)
return RET_SYN; return RET_SYN;
@ -82,6 +82,9 @@ show(void)
case 't': case 't':
show_tower(99999); show_tower(99999);
return RET_OK; return RET_OK;
case 'i':
show_item(99999);
return RET_OK;
case 'n': case 'n':
if (opt_DRNUKE) if (opt_DRNUKE)
tlev = ((rlev / drnuke_const) > tlev ? tlev : tlev = ((rlev / drnuke_const) > tlev ? tlev :

View file

@ -608,3 +608,20 @@ show_sect_capab(int foo)
pr("\n"); pr("\n");
} }
} }
void
show_item(int tlev)
{
struct ichrstr *ip;
pr("item value sell lbs packing melt item\n");
pr("mnem in rg wh ur bk deno name\n");
for (ip = ichr; ip->i_name; ip++) {
pr(" %c %5d %4s %3d %2d %2d %2d %2d %2d %4d %s\n",
ip->i_mnem, ip->i_value, ip->i_sell ? "yes" : "no", ip->i_lbs,
ip->i_pkg[IPKG], ip->i_pkg[NPKG], ip->i_pkg[WPKG],
ip->i_pkg[UPKG], ip->i_pkg[BPKG],
ip->i_melt_denom, ip->i_name);
}
}