(nuke): Players need the uid to work with nukes, show it. Show
members introduced in nuke.h rev. 1.19 and 1.20: nuk_plane, nuk_effic, nuk_tech, nuk_stockpile. Make output similar to the other unit reports while we're at it.
This commit is contained in:
parent
89694cd468
commit
fcc0162188
2 changed files with 49 additions and 49 deletions
44
info/nuke.t
44
info/nuke.t
|
@ -1,23 +1,29 @@
|
|||
.TH Command NUKE
|
||||
.NA nuke "List all nuclear \*Qdevices\*U in a given area"
|
||||
.NA nuke "Report status of nukes"
|
||||
.LV Expert
|
||||
.SY "nuke <SECTS>"
|
||||
For each sector in <SECTS>, this command prints the number of each
|
||||
type of nuclear device in that sector. If the sector is a nuclear
|
||||
plant whose efficiency is at least 60% (i.e. a sector where you can
|
||||
build nuclear warheads), then you will be given additional information
|
||||
about the sector relevant to the building of nukes.
|
||||
.SY "nuke <NUKES>"
|
||||
The nuke report command is a census of your nuke and lists all the
|
||||
info available in readable format.
|
||||
.s1
|
||||
.EX nuke #1
|
||||
.NF
|
||||
sect eff num nuke-type lcm hcm oil rad avail
|
||||
21,-3 n 100% 2 5mt fusion 499 499 1498 783 549
|
||||
21 100kt fission
|
||||
1 250kt fusion
|
||||
19,-3 + 100% 12 5mt fusion
|
||||
3 50kt neutron
|
||||
.FI
|
||||
Note that the sector information is printed only once, and all nukes
|
||||
in that sector are listed below it.
|
||||
The report format contains the following fields:
|
||||
.s1
|
||||
.SA "build, launch, transport, Planes"
|
||||
.in +1i
|
||||
.L #
|
||||
the nuke number
|
||||
.L type
|
||||
the type of nuke; \*Q10kt fission\*U, \*Q1mt fusion\*U, etc.,
|
||||
.L x,y
|
||||
the nuke's current location,
|
||||
.L w
|
||||
the \*Qstockpile\*U designation letter,
|
||||
.L eff
|
||||
the nuke's efficiency,
|
||||
.L tech
|
||||
the tech level at which it was created,
|
||||
.L carry
|
||||
the plane the nuke is on, if any,
|
||||
.L burst
|
||||
whether the nuke is programmed to air- or groundburst.
|
||||
.in
|
||||
.s1
|
||||
.SA "arm, build, launch, transport, Planes"
|
||||
|
|
|
@ -46,51 +46,45 @@
|
|||
int
|
||||
nuke(void)
|
||||
{
|
||||
int first_line = 0;
|
||||
int nnukes;
|
||||
int show_comm;
|
||||
struct nstr_item nstr;
|
||||
struct nukstr nuk;
|
||||
struct sctstr sect;
|
||||
struct plnstr plane;
|
||||
|
||||
if (!snxtitem(&nstr, EF_NUKE, player->argp[1]))
|
||||
return RET_SYN;
|
||||
|
||||
nnukes = 0;
|
||||
while (nxtitem(&nstr, &nuk)) {
|
||||
if (!player->god && !player->owner)
|
||||
if (!player->owner || nuk.nuk_own == 0)
|
||||
continue;
|
||||
if (nuk.nuk_own == 0)
|
||||
continue;
|
||||
if (first_line++ == 0) {
|
||||
if (nnukes++ == 0) {
|
||||
if (player->god)
|
||||
pr("own ");
|
||||
pr(" sect eff num nuke-type lcm hcm oil rad avail\n");
|
||||
pr(" # nuke type x,y s eff tech carry burst\n");
|
||||
}
|
||||
getsect(nuk.nuk_x, nuk.nuk_y, §);
|
||||
show_comm = 0;
|
||||
if (sect.sct_type == SCT_NUKE && sect.sct_effic >= 60)
|
||||
show_comm = 1;
|
||||
if (player->god)
|
||||
pr("%-3d ", nuk.nuk_own);
|
||||
prxy("%4d,%-4d", sect.sct_x, sect.sct_y, player->cnum);
|
||||
pr(" %c", dchr[sect.sct_type].d_mnem);
|
||||
if (sect.sct_newtype != sect.sct_type)
|
||||
pr("%c", dchr[sect.sct_newtype].d_mnem);
|
||||
else
|
||||
pr(" ");
|
||||
pr("%4d%%", sect.sct_effic);
|
||||
|
||||
pr("%3d ", 1);
|
||||
pr("%-16.16s ", nchr[(int)nuk.nuk_type].n_name);
|
||||
|
||||
if (show_comm) {
|
||||
pr("%5d ", sect.sct_item[I_LCM]);
|
||||
pr("%5d ", sect.sct_item[I_HCM]);
|
||||
pr("%5d ", sect.sct_item[I_OIL]);
|
||||
pr("%5d ", sect.sct_item[I_RAD]);
|
||||
pr("%5d", sect.sct_avail);
|
||||
show_comm = 0;
|
||||
pr("%4d %-19.19s ", nstr.cur, nchr[(int)nuk.nuk_type].n_name);
|
||||
prxy("%4d,%-4d", nuk.nuk_x, nuk.nuk_y, player->cnum);
|
||||
pr(" %c %3d%% %4d", nuk.nuk_stockpile, nuk.nuk_effic, nuk.nuk_tech);
|
||||
if (nuk.nuk_plane >= 0) {
|
||||
getplane(nuk.nuk_plane, &plane);
|
||||
pr("%5dP %s",
|
||||
nuk.nuk_plane,
|
||||
plane.pln_flags & PLN_AIRBURST ? " air" : "ground");
|
||||
}
|
||||
pr("\n");
|
||||
}
|
||||
|
||||
if (nnukes == 0) {
|
||||
if (player->argp[1])
|
||||
pr("%s: No nuke(s)\n", player->argp[1]);
|
||||
else
|
||||
pr("%s: No nuke(s)\n", "");
|
||||
return RET_FAIL;
|
||||
} else
|
||||
pr("%d nuke%s\n", nnukes, splur(nnukes));
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue