2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 * Ken Stevens, Steve McClure
6 * This program 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 2 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, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * See files README, COPYING and CREDITS in the root of the source
23 * tree for related information and legal notices. It is expected
24 * that future projects/authors will amend these files as needed.
28 * pdump.c: Dump plane information
30 * Known contributors to this file:
53 if (!snxtitem(&np, EF_PLANE, player->argp[1]))
57 if (!player->argp[2]) {
58 for (n = 1; n <= 32; n++)
64 while (player->argp[n]) {
66 if (!strcmp("type", player->argp[n])) {
68 } else if (!strcmp("x", player->argp[n])) {
70 } else if (!strcmp("y", player->argp[n])) {
72 } else if (!strcmp("wing", player->argp[n])) {
74 } else if (!strcmp("eff", player->argp[n])) {
76 } else if (!strcmp("mob", player->argp[n])) {
78 } else if (!strcmp("tech", player->argp[n])) {
80 } else if (!strcmp("att", player->argp[n])) {
82 } else if (!strcmp("def", player->argp[n])) {
84 } else if (!strcmp("acc", player->argp[n])) {
86 } else if (!strcmp("react", player->argp[n])) {
88 } else if (!strcmp("range", player->argp[n])) {
90 } else if (!strcmp("load", player->argp[n])) {
92 } else if (!strcmp("fuel", player->argp[n])) {
94 } else if (!strcmp("hard", player->argp[n])) {
96 } else if (!strcmp("ship", player->argp[n])) {
98 } else if (!strcmp("land", player->argp[n])) {
100 } else if (!strcmp("laun", player->argp[n])) {
102 } else if (!strcmp("orb", player->argp[n])) {
104 } else if (!strcmp("nuke", player->argp[n])) {
106 } else if (!strcmp("grd", player->argp[n])) {
109 pr("Unrecognized field %s\n", player->argp[n]);
112 pr("Too many fields\n");
122 pr("DUMP PLANES %ld\n", (long)now);
198 natp = getnatp(player->cnum);
199 while (nxtitem(&np, &plane)) {
200 if (!player->owner || plane.pln_own == 0)
204 pr("%d ", plane.pln_own);
208 switch (field[n++]) {
210 pr(" %.4s", plchr[(int)plane.pln_type].pl_name);
213 pr(" %d", xrel(natp, plane.pln_x));
216 pr(" %d", yrel(natp, plane.pln_y));
219 pr(" %c", plane.pln_wing ? plane.pln_wing : '~');
222 pr(" %d", plane.pln_effic);
225 pr(" %d", plane.pln_mobil);
228 pr(" %d", plane.pln_tech);
231 pr(" %d", plane.pln_att);
234 pr(" %d", plane.pln_def);
237 pr(" %d", plane.pln_acc);
240 pr(" %d", plane.pln_range);
243 pr(" %d", plane.pln_range_max);
246 pr(" %d", plane.pln_load);
249 pr(" %d", plchr[(int)plane.pln_type].pl_fuel);
252 pr(" %d", plane.pln_harden);
255 pr(" %d", plane.pln_ship);
258 pr(" %d", plane.pln_land);
261 if ((plchr[(int)plane.pln_type].pl_flags & (P_O | P_M)) ==
264 (plane.pln_flags & PLN_LAUNCHED) ? 'Y' : 'N');
269 if ((plchr[(int)plane.pln_type].pl_flags & (P_O | P_M)) ==
272 (plane.pln_flags & PLN_SYNCHRONOUS) ? 'Y' : 'N');
277 if (plane.pln_nuketype != -1) {
278 pr(" %.5s", nchr[(int)plane.pln_nuketype].n_name);
284 pr(" %c", plane.pln_flags & PLN_AIRBURST ? 'A' : 'G');
292 pr("%s: No plane(s)\n", player->argp[1]);
294 pr("%s: No plane(s)\n", "");
297 pr("%d plane%s\n", nplanes, splur(nplanes));