]> git.pond.sub.org Git - empserver/commitdiff
(show, show_item): Resurrect show item.
authorRon Koenderink <rkoenderink@yahoo.ca>
Sun, 22 Jan 2006 18:57:14 +0000 (18:57 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sun, 22 Jan 2006 18:57:14 +0000 (18:57 +0000)
include/prototypes.h
info/show.t
src/lib/commands/show.c
src/lib/subs/show.c

index 6e8294b110fa9cfa79be3d78572f8422d547227c..f93cdd70f2eeb63cf3abf81215652c794c794887 100644 (file)
@@ -677,6 +677,7 @@ extern void show_land_stats(int);
 extern void show_sect_build(int);
 extern void show_sect_stats(int);
 extern void show_sect_capab(int);
+extern void show_item(int);
 /* shpsub.c */
 extern void shp_sel(struct nstr_item *, struct emp_qelem *);
 extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid);
index bcdfe3a2cf062ad2e4e8d63cb512c9b254028bdd..369969b565f79fbe0996568ff47badc679ced0a0 100644 (file)
@@ -1,15 +1,16 @@
 .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
-.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
-towers, planes, ships, land units, nukes, and sectors for a
+towers, planes, ships, land units, nukes, items and sectors for a
 given technology level.
 .s1
 The format of each output is more fully described in separate info
 pages (Ship-types, Nuke-types, etc.).
 .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
 about building (b), statistics (s) or capabilities (c) of the selected
 type.
index 36f87a76ca3e679b51158f05911575964d8a5967..a643ba89da5fbd5f154669e029023477f2c4de94 100644 (file)
@@ -55,7 +55,7 @@ show(void)
     int rlev;
 
     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))
        || !*p)
        return RET_SYN;
@@ -82,6 +82,9 @@ show(void)
     case 't':
        show_tower(99999);
        return RET_OK;
+    case 'i':
+       show_item(99999);
+       return RET_OK;
     case 'n':
        if (opt_DRNUKE)
            tlev = ((rlev / drnuke_const) > tlev ? tlev :
index c14282c2f9ff5fc40bf476768eeb85ea96ab0653..84dd29bddfca1993959f486ec0b1cd7ce74fe73e 100644 (file)
@@ -608,3 +608,20 @@ show_sect_capab(int foo)
        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);
+    }
+}