]> git.pond.sub.org Git - empserver/commitdiff
show: Extend show item to show the power value
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 27 May 2016 19:40:11 +0000 (21:40 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:55 +0000 (19:59 +0200)
Also update "info power" to point to "show item" instead of the
formerly hardcoded values.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
info/Item-types.t
info/power.t
src/lib/subs/show.c
tests/version/journal.log

index 35176c1f3119669d225e5eb64c50fd31e35aca29..bf4246ad2a7e1a5ecca6cb3b3b3897cfdabe61aa 100644 (file)
@@ -9,22 +9,22 @@ The show command displays the detailed characteristics of items.
 .s1
 .EX show item
 .NF
 .s1
 .EX show item
 .NF
-item value sell lbs    packing     melt  item
-mnem                in no wh ur bk deno  name
-   c     1   no   1  1 10 10 10 10    4  civilians
-   m     0   no   1  1  1  1  1  1   20  military
-   s     5  yes   1  1  1 10  1  1   80  shells
-   g    60  yes  10  1  1 10  1  1  100  guns
-   p     4  yes   1  1  1 10  1  1   50  petrol
-   i     2  yes   1  1  1 10  1  1  100  iron ore
-   d    20  yes   5  1  1 10  1  1  100  dust (gold)
-   b   280  yes  50  1  1  5  1  4  200  bars of gold
-   f     0  yes   1  1  1 10  1  1    2  food
-   o     8  yes   1  1  1 10  1  1   50  oil
-   l     2  yes   1  1  1 10  1  1  100  light products
-   h     4  yes   1  1  1 10  1  1  100  heavy products
-   u     1  yes   2  1  1  2  1  1    2  uncompensated workers
-   r   150  yes   8  1  1 10  1  1 1000  radioactive materials
+item power value sell lbs    packing     melt  item
+mnem                      in no wh ur bk deno  name
+  c    100     1   no   1  1 10 10 10 10    4  civilians
+  m    100     0  yes   1  1  1  1  1  1   20  military
+  s     80     5  yes   1  1  1 10  1  1   80  shells
+  g    400    60  yes  10  1  1 10  1  1  100  guns
+  p      2     4  yes   1  1  1 10  1  1   50  petrol
+  i     10     2  yes   1  1  1 10  1  1  100  iron ore
+  d    200    20  yes   5  1  1 10  1  1  100  dust (gold)
+  b   1000   280  yes  50  1  1  5  1  4  200  bars of gold
+  f      0     0  yes   1  1  1 10  1  1    2  food
+  o    100     8  yes   1  1  1 10  1  1   50  oil
+  l    100     2  yes   1  1  1 10  1  1  100  light products
+  h    200     4  yes   1  1  1 10  1  1  100  heavy products
+  u      0     1  yes   2  1  1  2  1  1    2  uncompensated workers
+  r      0   150  yes   8  1  1 10  1  1 1000  radioactive materials
 .FI
 .s1
 The meaning of the headings are:
 .FI
 .s1
 The meaning of the headings are:
@@ -32,6 +32,9 @@ The meaning of the headings are:
 .L "item mnem"
 A one-letter mnemonic abbreviation of the item name.  Commands let you
 use this to select the item.
 .L "item mnem"
 A one-letter mnemonic abbreviation of the item name.  Commands let you
 use this to select the item.
+.L power
+How much 1000 units of this item contribute to power (see \*Qinfo
+power\*U).
 .L value
 The value if the item is mortgaged.
 .L sell
 .L value
 The value if the item is mortgaged.
 .L sell
index b3e8748c3341e082e0ecbf3162c1e3af5d45db2b..bb5d0820116775602aeb01fb82fc2214911b4bcb 100644 (file)
@@ -86,9 +86,8 @@ The power value of a ship or land unit is (lcm cost / 10 + hcm cost +
 The power value of a plane is 20 * efficiency / 100 * (20 + nation
 tech level) / 500.
 .s1
 The power value of a plane is 20 * efficiency / 100 * (20 + nation
 tech level) / 500.
 .s1
-The power value of commodities is civilians / 10 + military / 10 +
-shells / 12.5 + guns / 2.5 + petrol / 500 + iron / 100 + dust / 5 +
-bars + oil / 10 lcms / 10 + hcms / 5.
+The power value of commodities is amount * type factor.  \*Qshow
+item\*U shows the type factor in column \*Qpower\*U.
 .s1
 Efficiency is in percent.
 .s1
 .s1
 Efficiency is in percent.
 .s1
index 52409e6d07854b37cbbaa87bb79f5bb69c71358f..bab48c074763f9677fb935a635d59d28819564b6 100644 (file)
@@ -486,12 +486,14 @@ show_item(int tlev)
 {
     struct ichrstr *ip;
 
 {
     struct ichrstr *ip;
 
-    pr("item value sell lbs    packing     melt  item\n");
-    pr("mnem                in no wh ur bk deno  name\n");
+    pr("item power value sell lbs    packing     melt  item\n");
+    pr("mnem                      in no wh ur bk deno  name\n");
 
     for (ip = ichr; ip->i_name; ip++) {
 
     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,
+       pr("  %c  %5d %5d %4s %3d %2d %2d %2d %2d %2d %4d  %s\n",
+          ip->i_mnem, ip->i_power,
+          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);
           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);
index 7daffb452bd0fbc7e1dd9e391064dd949c0807dd..aabc96af7b102143b2e0fd1985bbc042f6f402b5 100644 (file)
     Play#0 output Play#0 6 0 640
     Play#0 input show item
     Play#0 command show
     Play#0 output Play#0 6 0 640
     Play#0 input show item
     Play#0 command show
-    Play#0 output Play#0 1 item value sell lbs    packing     melt  item
-    Play#0 output Play#0 1 mnem                in no wh ur bk deno  name
-    Play#0 output Play#0 1    c     1   no   1  1 10 10 10 10    4  civilians
-    Play#0 output Play#0 1    m     0  yes   1  1  1  1  1  1   20  military
-    Play#0 output Play#0 1    s     5  yes   1  1  1 10  1  1   80  shells
-    Play#0 output Play#0 1    g    60  yes  10  1  1 10  1  1  100  guns
-    Play#0 output Play#0 1    p     4  yes   1  1  1 10  1  1   50  petrol
-    Play#0 output Play#0 1    i     2  yes   1  1  1 10  1  1  100  iron ore
-    Play#0 output Play#0 1    d    20  yes   5  1  1 10  1  1  100  dust (gold)
-    Play#0 output Play#0 1    b   280  yes  50  1  1  5  1  4  200  bars of gold
-    Play#0 output Play#0 1    f     0  yes   1  1  1 10  1  1    2  food
-    Play#0 output Play#0 1    o     8  yes   1  1  1 10  1  1   50  oil
-    Play#0 output Play#0 1    l     2  yes   1  1  1 10  1  1  100  light products
-    Play#0 output Play#0 1    h     4  yes   1  1  1 10  1  1  100  heavy products
-    Play#0 output Play#0 1    u     1  yes   2  1  1  2  1  1    2  uncompensated workers
-    Play#0 output Play#0 1    r   150  yes   8  1  1 10  1  1 1000  radioactive materials
+    Play#0 output Play#0 1 item power value sell lbs    packing     melt  item
+    Play#0 output Play#0 1 mnem                      in no wh ur bk deno  name
+    Play#0 output Play#0 1   c    100     1   no   1  1 10 10 10 10    4  civilians
+    Play#0 output Play#0 1   m    100     0  yes   1  1  1  1  1  1   20  military
+    Play#0 output Play#0 1   s     80     5  yes   1  1  1 10  1  1   80  shells
+    Play#0 output Play#0 1   g    400    60  yes  10  1  1 10  1  1  100  guns
+    Play#0 output Play#0 1   p      2     4  yes   1  1  1 10  1  1   50  petrol
+    Play#0 output Play#0 1   i     10     2  yes   1  1  1 10  1  1  100  iron ore
+    Play#0 output Play#0 1   d    200    20  yes   5  1  1 10  1  1  100  dust (gold)
+    Play#0 output Play#0 1   b   1000   280  yes  50  1  1  5  1  4  200  bars of gold
+    Play#0 output Play#0 1   f      0     0  yes   1  1  1 10  1  1    2  food
+    Play#0 output Play#0 1   o    100     8  yes   1  1  1 10  1  1   50  oil
+    Play#0 output Play#0 1   l    100     2  yes   1  1  1 10  1  1  100  light products
+    Play#0 output Play#0 1   h    200     4  yes   1  1  1 10  1  1  100  heavy products
+    Play#0 output Play#0 1   u      0     1  yes   2  1  1  2  1  1    2  uncompensated workers
+    Play#0 output Play#0 1   r      0   150  yes   8  1  1 10  1  1 1000  radioactive materials
     Play#0 output Play#0 6 0 640
     Play#0 input show updates
     Play#0 command show
     Play#0 output Play#0 6 0 640
     Play#0 input show updates
     Play#0 command show