From 48ff09664ba87241ae6fa4f5f182c75caf6c320e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 21 Feb 2009 16:36:39 +0100 Subject: [PATCH] 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. --- info/Sector-types.t | 27 +++++++++++++++------------ src/lib/subs/show.c | 17 ++++++++++++----- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/info/Sector-types.t b/info/Sector-types.t index 372389ac..9e29b6ed 100644 --- a/info/Sector-types.t +++ b/info/Sector-types.t @@ -237,10 +237,11 @@ The \*Qshow\*U command can be used to show special things about sector types. To check out build costs, you do: .EX show sect build .NF -sector type cost to des cost for 1% eff lcms for 1% hcms for 1% -- 0 0 0 0 -f 0 5 0 1 -other 0 1 0 0 + desig build 100% eff +sector type $ lcm hcm $ +- wilderness 0 0 0 0 +f fortress 0 0 100 500 +any other 0 0 0 100 Infrastructure building - adding 1 point of efficiency costs: type lcms hcms mobility $$$$ @@ -249,14 +250,16 @@ rail network 1 1 1 1 defense factor 1 1 1 1 .FI .s1 -Cost to des is the cost to designate the sector type. This is charged when you -give the designate command. -.s1 -Cost for 1% efficiency is the $$ cost per point of efficiency built. -Lcms/hcms for 1% are similar. -.s1 -Sectors that cost nothing to designate and just $1 per point of -efficiency are not shown. +.in \w'build hcm\0\0'u +.L "desig $" +Cost charged by the designate command. +.L "build lcm" +The lcm required to build the sector. +.L "build hcm" +The hcm required to build the sector. +.L "build $" +What it costs to build the sector. +.in .s1 The show command also shows infrastructure build costs. Infrastructure is additional facilities you can build up in your diff --git a/src/lib/subs/show.c b/src/lib/subs/show.c index 7c484f6c..fe65d8bf 100644 --- a/src/lib/subs/show.c +++ b/src/lib/subs/show.c @@ -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++) {