diff --git a/include/prototypes.h b/include/prototypes.h index f93cdd70..fefad9c6 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -678,6 +678,7 @@ extern void show_sect_build(int); extern void show_sect_stats(int); extern void show_sect_capab(int); extern void show_item(int); +extern void show_news(int); /* shpsub.c */ extern void shp_sel(struct nstr_item *, struct emp_qelem *); extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid); diff --git a/info/show.t b/info/show.t index 369969b5..a42061ad 100644 --- a/info/show.t +++ b/info/show.t @@ -1,16 +1,16 @@ .TH Command SHOW -.NA show "Characteristics of bridges, units, products or sectors" +.NA show "Characteristics of bridges, units, products, news or sectors" .LV Basic .SY "show [b|s|c] [tech]" -.SY "show " +.SY "show " The show command describes the characteristics of bridge spans, bridge -towers, planes, ships, land units, nukes, items and sectors for a +towers, planes, ships, land units, nukes, items, news 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), items and tower (bridge tower), a +Except for bridge (bridge span), items, news 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. @@ -36,4 +36,4 @@ will give something like 3mt fusion 7 210 10 325 $19000 .FI .s1 -.SA "Ship-types, Nuke-types, Plane-types, Unit-types, Sector-types, Ships, Planes, LandUnits, Products" +.SA "Ship-types, Nuke-types, Plane-types, Unit-types, Sector-types, Ships, Planes, LandUnits, Products, newspaper" diff --git a/src/lib/commands/show.c b/src/lib/commands/show.c index a643ba89..5314847f 100644 --- a/src/lib/commands/show.c +++ b/src/lib/commands/show.c @@ -86,6 +86,10 @@ show(void) show_item(99999); return RET_OK; case 'n': + if (*(p + 1) == 'e') { + show_news(99999); + return RET_OK; + } if (opt_DRNUKE) tlev = ((rlev / drnuke_const) > tlev ? tlev : (rlev / drnuke_const)); diff --git a/src/lib/subs/show.c b/src/lib/subs/show.c index 84dd29bd..b69e61b2 100644 --- a/src/lib/subs/show.c +++ b/src/lib/subs/show.c @@ -57,6 +57,7 @@ #include "nat.h" #include "prototypes.h" #include "nsc.h" +#include "news.h" struct look_list { union { @@ -625,3 +626,20 @@ show_item(int tlev) ip->i_melt_denom, ip->i_name); } } + +void +show_news(int tlev) +{ + int i, j; + + pr("id category good will\n"); + pr(" messsages\n"); + + for (i = 1; i < N_MAX_VERB + 1; i++) { + pr("%-2d %-20.20s %4d\n", rpt[i].r_uid, + page_headings[rpt[i].r_newspage], rpt[i].r_good_will); + + for (j = 0; j < NUM_RPTS; j++) + pr(" %s\n", rpt[i].r_newstory[j]); + } +}