(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
|
.TH Command NUKE
|
||||||
.NA nuke "List all nuclear \*Qdevices\*U in a given area"
|
.NA nuke "Report status of nukes"
|
||||||
.LV Expert
|
.LV Expert
|
||||||
.SY "nuke <SECTS>"
|
.SY "nuke <NUKES>"
|
||||||
For each sector in <SECTS>, this command prints the number of each
|
The nuke report command is a census of your nuke and lists all the
|
||||||
type of nuclear device in that sector. If the sector is a nuclear
|
info available in readable format.
|
||||||
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.
|
|
||||||
.s1
|
.s1
|
||||||
.EX nuke #1
|
The report format contains the following fields:
|
||||||
.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.
|
|
||||||
.s1
|
.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
|
int
|
||||||
nuke(void)
|
nuke(void)
|
||||||
{
|
{
|
||||||
int first_line = 0;
|
int nnukes;
|
||||||
int show_comm;
|
int show_comm;
|
||||||
struct nstr_item nstr;
|
struct nstr_item nstr;
|
||||||
struct nukstr nuk;
|
struct nukstr nuk;
|
||||||
struct sctstr sect;
|
struct plnstr plane;
|
||||||
|
|
||||||
if (!snxtitem(&nstr, EF_NUKE, player->argp[1]))
|
if (!snxtitem(&nstr, EF_NUKE, player->argp[1]))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
nnukes = 0;
|
||||||
while (nxtitem(&nstr, &nuk)) {
|
while (nxtitem(&nstr, &nuk)) {
|
||||||
if (!player->god && !player->owner)
|
if (!player->owner || nuk.nuk_own == 0)
|
||||||
continue;
|
continue;
|
||||||
if (nuk.nuk_own == 0)
|
if (nnukes++ == 0) {
|
||||||
continue;
|
|
||||||
if (first_line++ == 0) {
|
|
||||||
if (player->god)
|
if (player->god)
|
||||||
pr("own ");
|
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)
|
if (player->god)
|
||||||
pr("%-3d ", nuk.nuk_own);
|
pr("%-3d ", nuk.nuk_own);
|
||||||
prxy("%4d,%-4d", sect.sct_x, sect.sct_y, player->cnum);
|
pr("%4d %-19.19s ", nstr.cur, nchr[(int)nuk.nuk_type].n_name);
|
||||||
pr(" %c", dchr[sect.sct_type].d_mnem);
|
prxy("%4d,%-4d", nuk.nuk_x, nuk.nuk_y, player->cnum);
|
||||||
if (sect.sct_newtype != sect.sct_type)
|
pr(" %c %3d%% %4d", nuk.nuk_stockpile, nuk.nuk_effic, nuk.nuk_tech);
|
||||||
pr("%c", dchr[sect.sct_newtype].d_mnem);
|
if (nuk.nuk_plane >= 0) {
|
||||||
else
|
getplane(nuk.nuk_plane, &plane);
|
||||||
pr(" ");
|
pr("%5dP %s",
|
||||||
pr("%4d%%", sect.sct_effic);
|
nuk.nuk_plane,
|
||||||
|
plane.pln_flags & PLN_AIRBURST ? " air" : "ground");
|
||||||
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("\n");
|
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;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue