diff --git a/info/nuke.t b/info/nuke.t index fa3c22f4..a5d59de3 100644 --- a/info/nuke.t +++ b/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 " -For each sector in , 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 " +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" diff --git a/src/lib/commands/nuke.c b/src/lib/commands/nuke.c index 03357e0b..27769a65 100644 --- a/src/lib/commands/nuke.c +++ b/src/lib/commands/nuke.c @@ -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; }