(nati, player_coms): Add ability for deities to request a nation report for any country.

Closes #1083167.
This commit is contained in:
Ron Koenderink 2005-12-20 17:06:47 +00:00
parent 16d0f5d133
commit cdfb94dc1f
3 changed files with 24 additions and 9 deletions

View file

@ -1,8 +1,10 @@
.TH Command NATION
.NA nation "The state of your nation"
.LV Basic
.SY "nation"
The nation report command displays various data about your country.
.SY "nation [as-COUNTRY]"
The nation report command displays various data about a country.
The as-COUNTRY defaults to yourself.
Only a deity can request a nation report for another country.
.s1
The data displayed by the nation command is formatted as a single page
report and should be self explanatory.

View file

@ -48,14 +48,27 @@ nati(void)
float hap;
int mil;
int civ;
int cnum;
int poplimit, safepop, uwpop;
double pfac;
if ((natp = getnatp(player->cnum)) == 0) {
pr("Bad country number %d\n", player->cnum);
if (player->argp[1])
cnum = natarg(player->argp[1], "for which country? ");
else
cnum = player->cnum;
if ((natp = getnatp(cnum)) == 0) {
pr("Bad country number %d\n", cnum);
return RET_SYN;
}
pr("\n(#%i) %s Nation Report\t", player->cnum, cname(player->cnum));
if (!player->god && cnum != player->cnum) {
pr("Only deities can request a nation "
"report for a different country than yourself.\n");
return RET_SYN;
}
pr("\n(#%i) %s Nation Report\t", cnum, cname(cnum));
prdate();
pr("Nation status is %s", natstate(natp));
pr(" Bureaucratic Time Units: %d\n", natp->nat_btu);
@ -63,7 +76,7 @@ nati(void)
getsect(natp->nat_xcap, natp->nat_ycap, &sect);
if (influx(natp))
pr("No capital (was at %s).\n",
xyas(sect.sct_x, sect.sct_y, player->cnum));
xyas(sect.sct_x, sect.sct_y, cnum));
else {
civ = sect.sct_item[I_CIVIL];
mil = sect.sct_item[I_MILIT];
@ -71,7 +84,7 @@ nati(void)
sect.sct_effic,
(sect.sct_type ==
SCT_CAPIT ? "capital" : "mountain capital"),
xyas(sect.sct_x, sect.sct_y, player->cnum), civ, splur(civ),
xyas(sect.sct_x, sect.sct_y, cnum), civ, splur(civ),
mil);
}
}
@ -83,7 +96,7 @@ nati(void)
pr("Technology.........%6.2f Research........%6.2f\n",
(double)natp->nat_level[NAT_TLEV],
(double)natp->nat_level[NAT_RLEV]);
pr("Technology factor :%6.2f%%", tfact(player->cnum, 100.));
pr("Technology factor :%6.2f%%", tfact(cnum, 100.));
if (opt_NO_PLAGUE)
pfac = 0.0;

View file

@ -161,7 +161,7 @@ struct cmndstr player_coms[] = {
move, C_MOD, NORM + CAP},
{"mquota <SHIPS> <value>", 2, mobq, C_MOD, NORM + CAP},
{"name <SHIPS> <NAME>", 0, name, C_MOD, NORM},
{"nation", 0, nati, 0, VIS},
{"nation [as-COUNTRY]", 0, nati, 0, VIS},
{"navigate <SHIPS> <PATH|DESTINATION>", 1, navi, C_MOD, NORM + CAP},
{"ndump <SECTS>", 0, ndump, 0, NORM},
{"newcap <NAT> [<SECTOR>]", 0, new, C_MOD, GOD},