2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 * Ken Stevens, Steve McClure, Markus Armbruster
6 * Empire is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * See files README, COPYING and CREDITS in the root of the source
22 * tree for related information and legal notices. It is expected
23 * that future projects/authors will amend these files as needed.
27 * pdump.c: Dump plane information
29 * Known contributors to this file:
52 if (!snxtitem(&np, EF_PLANE, player->argp[1], NULL))
56 if (!player->argp[2]) {
57 for (n = 1; n <= 32; n++)
63 while (player->argp[n]) {
65 if (!strcmp("type", player->argp[n])) {
67 } else if (!strcmp("x", player->argp[n])) {
69 } else if (!strcmp("y", player->argp[n])) {
71 } else if (!strcmp("wing", player->argp[n])) {
73 } else if (!strcmp("eff", player->argp[n])) {
75 } else if (!strcmp("mob", player->argp[n])) {
77 } else if (!strcmp("tech", player->argp[n])) {
79 } else if (!strcmp("att", player->argp[n])) {
81 } else if (!strcmp("def", player->argp[n])) {
83 } else if (!strcmp("acc", player->argp[n])) {
85 } else if (!strcmp("react", player->argp[n])) {
87 } else if (!strcmp("range", player->argp[n])) {
89 } else if (!strcmp("load", player->argp[n])) {
91 } else if (!strcmp("fuel", player->argp[n])) {
93 } else if (!strcmp("hard", player->argp[n])) {
95 } else if (!strcmp("ship", player->argp[n])) {
97 } else if (!strcmp("land", player->argp[n])) {
99 } else if (!strcmp("laun", player->argp[n])) {
101 } else if (!strcmp("orb", player->argp[n])) {
103 } else if (!strcmp("nuke", player->argp[n])) {
105 } else if (!strcmp("grd", player->argp[n])) {
108 pr("Unrecognized field %s\n", player->argp[n]);
111 pr("Too many fields\n");
121 pr("DUMP PLANES %ld\n", (long)now);
197 natp = getnatp(player->cnum);
198 while (nxtitem(&np, &plane)) {
199 if (!player->owner || plane.pln_own == 0)
203 pr("%d ", plane.pln_own);
207 switch (field[n++]) {
209 pr(" %.4s", plchr[(int)plane.pln_type].pl_name);
212 pr(" %d", xrel(natp, plane.pln_x));
215 pr(" %d", yrel(natp, plane.pln_y));
218 pr(" %c", plane.pln_wing ? plane.pln_wing : '~');
221 pr(" %d", plane.pln_effic);
224 pr(" %d", plane.pln_mobil);
227 pr(" %d", plane.pln_tech);
230 pr(" %d", pln_att(&plane));
233 pr(" %d", pln_def(&plane));
236 pr(" %d", pln_acc(&plane));
239 pr(" %d", plane.pln_range);
242 pr(" %d", pln_range_max(&plane));
245 pr(" %d", pln_load(&plane));
248 pr(" %d", plchr[(int)plane.pln_type].pl_fuel);
251 pr(" %d", plane.pln_harden);
254 pr(" %d", plane.pln_ship);
257 pr(" %d", plane.pln_land);
260 pr(pln_is_in_orbit(&plane) ? " Y" : " N");
263 pr(pln_is_in_orbit(&plane)
264 && (plane.pln_flags & PLN_SYNCHRONOUS)
268 if (getnuke(nuk_on_plane(&plane), &nuke)) {
269 pr(" %.5s", nchr[nuke.nuk_type].n_name);
275 pr(" %c", plane.pln_flags & PLN_AIRBURST ? 'A' : 'G');
283 pr("%s: No plane(s)\n", player->argp[1]);
285 pr("%s: No plane(s)\n", "");
288 pr("%d plane%s\n", nplanes, splur(nplanes));