2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2017, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 * Ken Stevens, Steve McClure, Markus Armbruster
6 * Empire is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * See files README, COPYING and CREDITS in the root of the source
22 * tree for related information and legal notices. It is expected
23 * that future projects/authors will amend these files as needed.
27 * nati.c: List nation information
29 * Known contributors to this file:
47 int poplimit, safepop, uwpop;
50 if (player->argp[1]) {
51 if (!(natp = natargp(player->argp[1], NULL)))
54 natp = getnatp(player->cnum);
56 cnum = natp->nat_cnum;
57 if (!player->god && cnum != player->cnum) {
58 pr("Only deities can request a nation report for another country.\n");
62 pr("\n(#%i) %s Nation Report\t", cnum, cname(cnum));
64 pr("Nation status is %s", natstate(natp));
65 pr(" Bureaucratic Time Units: %d\n", natp->nat_btu);
66 if (natp->nat_stat != STAT_UNUSED) {
67 getsect(natp->nat_xcap, natp->nat_ycap, §);
69 pr("No capital (was at %s).\n",
70 xyas(sect.sct_x, sect.sct_y, player->cnum));
72 civ = sect.sct_item[I_CIVIL];
73 mil = sect.sct_item[I_MILIT];
74 pr("%d%% eff %s at %s has %d civilian%s & %d military\n",
76 sect.sct_type == SCT_CAPIT ? "capital" : "mountain capital",
77 xyas(sect.sct_x, sect.sct_y, player->cnum),
78 civ, splur(civ), mil);
81 pr(" The treasury has $%.2f", (double)natp->nat_money);
82 pr(" Military reserves: %d\n", natp->nat_reserve);
83 pr("Education..........%6.2f Happiness.......%6.2f\n",
84 natp->nat_level[NAT_ELEV], natp->nat_level[NAT_HLEV]);
85 pr("Technology.........%6.2f Research........%6.2f\n",
86 natp->nat_level[NAT_TLEV], natp->nat_level[NAT_RLEV]);
87 pr("Technology factor :%6.2f%%", tfact(cnum, 100.));
92 pfac = (natp->nat_level[NAT_TLEV] + 100.0) /
93 (natp->nat_level[NAT_RLEV] + 100.0);
94 pr(" Plague factor : %6.2f%%\n", pfac);
97 poplimit = max_population(natp->nat_level[NAT_RLEV], SCT_MINE, 0);
98 pr("Max population : %d\n", poplimit);
100 safepop = (int)(poplimit / (1.0 + obrate * (double)etu_per_update));
101 uwpop = (int)(poplimit / (1.0 + uwbrate * (double)etu_per_update));
102 pr("Max safe population for civs/uws: %d/%d\n", safepop, uwpop);
106 pr("Happiness needed is %.2f\n", hap);
108 pr("No happiness needed\n");