2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 * Ken Stevens, Steve McClure
6 * This program 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 2 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, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23 * related information and legal notices. It is expected that any future
24 * projects/authors will amend these files as needed.
28 * nati.c: List nation information
30 * Known contributors to this file:
52 int poplimit, safepop, uwpop;
55 if ((natp = getnatp(player->cnum)) == 0) {
56 pr("Bad country number %d\n", player->cnum);
59 pr("\n(#%i) %s Nation Report\t", player->cnum, cname(player->cnum));
61 pr("Nation status is %s", natstate(natp));
62 pr(" Bureaucratic Time Units: %d\n", natp->nat_btu);
63 if (natp->nat_stat & STAT_INUSE) {
64 getsect(natp->nat_xcap, natp->nat_ycap, §);
65 if (!player->owner || (sect.sct_type != SCT_CAPIT &&
66 sect.sct_type != SCT_MOUNT &&
67 sect.sct_type != SCT_SANCT))
68 pr("No capital. (was at %s)\n",
69 xyas(sect.sct_x, sect.sct_y, player->cnum));
71 civ = sect.sct_item[I_CIVIL];
72 mil = sect.sct_item[I_MILIT];
73 pr("%d%% eff %s at %s has %d civilian%s & %d military\n",
76 SCT_CAPIT ? "capital" : "mountain capital"),
77 xyas(sect.sct_x, sect.sct_y, player->cnum), civ, splur(civ),
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 (double)natp->nat_level[NAT_ELEV],
85 (double)natp->nat_level[NAT_HLEV]);
86 pr("Technology.........%6.2f Research........%6.2f\n",
87 (double)natp->nat_level[NAT_TLEV],
88 (double)natp->nat_level[NAT_RLEV]);
89 pr("Technology factor :%6.2f%%", tfact(player->cnum, 100.));
94 pfac = ((double)natp->nat_level[NAT_TLEV] + 100.) /
95 ((double)natp->nat_level[NAT_RLEV] + 100.);
96 pr(" Plague factor : %6.2f%%\n", pfac);
101 poplimit = max_pop(natp->nat_level[NAT_RLEV], 0);
102 pr("Max population : %d\n", poplimit);
105 (int)((double)poplimit / (1.0 + obrate * (double)etu_per_update));
107 (int)((double)poplimit / (1.0 + uwbrate * (double)etu_per_update));
109 if (((double)safepop * (1.0 + obrate * (double)etu_per_update)) >
110 ((double)poplimit + 0.0000001))
113 if (((double)uwpop * (1.0 + uwbrate * (double)etu_per_update)) >
114 ((double)poplimit + 0.0000001))
117 pr("Max safe population for civs/uws: %d/%d\n", safepop, uwpop);
119 hap = ((natp->nat_level[NAT_TLEV] - 40) / 40.0 +
120 natp->nat_level[NAT_ELEV] / 3.0);
123 pr("Happiness needed is %f\n", hap);
125 pr("No happiness needed\n");