00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include <config.h>
00035
00036 #include "commands.h"
00037 #include "optlist.h"
00038
00039 int
00040 nati(void)
00041 {
00042 struct natstr *natp;
00043 struct sctstr sect;
00044 double hap;
00045 int mil;
00046 int civ;
00047 int cnum;
00048 int poplimit, safepop, uwpop;
00049 double pfac;
00050
00051 if (player->argp[1]) {
00052 if (!(natp = natargp(player->argp[1], NULL)))
00053 return RET_SYN;
00054 } else
00055 natp = getnatp(player->cnum);
00056
00057 cnum = natp->nat_cnum;
00058 if (!player->god && cnum != player->cnum) {
00059 pr("Only deities can request a nation report for another country.\n");
00060 return RET_FAIL;
00061 }
00062
00063 pr("\n(#%i) %s Nation Report\t", cnum, cname(cnum));
00064 prdate();
00065 pr("Nation status is %s", natstate(natp));
00066 pr(" Bureaucratic Time Units: %d\n", natp->nat_btu);
00067 if (natp->nat_stat != STAT_UNUSED) {
00068 getsect(natp->nat_xcap, natp->nat_ycap, §);
00069 if (influx(natp))
00070 pr("No capital (was at %s).\n",
00071 xyas(sect.sct_x, sect.sct_y, cnum));
00072 else {
00073 civ = sect.sct_item[I_CIVIL];
00074 mil = sect.sct_item[I_MILIT];
00075 pr("%d%% eff %s at %s has %d civilian%s & %d military\n",
00076 sect.sct_effic,
00077 (sect.sct_type ==
00078 SCT_CAPIT ? "capital" : "mountain capital"),
00079 xyas(sect.sct_x, sect.sct_y, cnum), civ, splur(civ),
00080 mil);
00081 }
00082 }
00083 pr(" The treasury has $%.2f", (double)natp->nat_money);
00084 pr(" Military reserves: %ld\n", natp->nat_reserve);
00085 pr("Education..........%6.2f Happiness.......%6.2f\n",
00086 natp->nat_level[NAT_ELEV], natp->nat_level[NAT_HLEV]);
00087 pr("Technology.........%6.2f Research........%6.2f\n",
00088 natp->nat_level[NAT_TLEV], natp->nat_level[NAT_RLEV]);
00089 pr("Technology factor :%6.2f%%", tfact(cnum, 100.));
00090
00091 if (opt_NO_PLAGUE)
00092 pfac = 0.0;
00093 else
00094 pfac = (natp->nat_level[NAT_TLEV] + 100.0) /
00095 (natp->nat_level[NAT_RLEV] + 100.0);
00096 pr(" Plague factor : %6.2f%%\n", pfac);
00097 pr("\n");
00098
00099 poplimit = max_population(natp->nat_level[NAT_RLEV], SCT_MINE, 0);
00100 pr("Max population : %d\n", poplimit);
00101
00102 safepop = (int)(poplimit / (1.0 + obrate * (double)etu_per_update));
00103 uwpop = (int)(poplimit / (1.0 + uwbrate * (double)etu_per_update));
00104 pr("Max safe population for civs/uws: %d/%d\n", safepop, uwpop);
00105
00106 hap = hap_req(natp);
00107 if (hap > 0.0)
00108 pr("Happiness needed is %.2f\n", hap);
00109 else
00110 pr("No happiness needed\n");
00111
00112 return RET_OK;
00113 }