2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2000, 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 the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23 * related information and legal notices. It is expected that any future
24 * projects/authors will amend these files as needed.
28 * pdump.c: Dump plane information
30 * Known contributors to this file:
58 if (!snxtitem(&np, EF_PLANE, player->argp[1]))
62 if (!player->argp[2]) {
63 for (n = 1; n <= 32; n++)
69 while (player->argp[n]) {
71 if (!strcmp("type", player->argp[n])) {
73 } else if (!strcmp("x", player->argp[n])) {
75 } else if (!strcmp("y", player->argp[n])) {
77 } else if (!strcmp("wing", player->argp[n])) {
79 } else if (!strcmp("eff", player->argp[n])) {
81 } else if (!strcmp("mob", player->argp[n])) {
83 } else if (!strcmp("tech", player->argp[n])) {
85 } else if (!strcmp("att", player->argp[n])) {
87 } else if (!strcmp("def", player->argp[n])) {
89 } else if (!strcmp("acc", player->argp[n])) {
91 } else if (!strcmp("react", player->argp[n])) {
93 } else if (!strcmp("range", player->argp[n])) {
95 } else if (!strcmp("load", player->argp[n])) {
97 } else if (!strcmp("fuel", player->argp[n])) {
99 } else if (!strcmp("hard", player->argp[n])) {
101 } else if (!strcmp("ship", player->argp[n])) {
103 } else if (!strcmp("land", player->argp[n])) {
105 } else if (!strcmp("laun", player->argp[n])) {
107 } else if (!strcmp("orb", player->argp[n])) {
109 } else if (!strcmp("nuke", player->argp[n])) {
111 } else if (!strcmp("grd", player->argp[n])) {
114 pr("Unrecognized field %s\n", player->argp[n]);
117 pr("Too many fields\n");
127 pr("DUMP PLANES %ld\n", (long)now);
203 natp = getnatp(player->cnum);
204 while (nxtitem(&np, (s_char *)&plane)) {
205 if (!player->owner || plane.pln_own == 0)
209 pr("%d ", plane.pln_own);
213 switch (field[n++]) {
215 pr(" %.4s", plchr[(int)plane.pln_type].pl_name);
218 pr(" %d", xrel(natp, plane.pln_x));
221 pr(" %d", yrel(natp, plane.pln_y));
224 if (plane.pln_wing == ' ')
227 pr(" %c", plane.pln_wing);
230 pr(" %d", plane.pln_effic);
233 pr(" %d", plane.pln_mobil);
236 pr(" %d", plane.pln_tech);
239 pr(" %d", plane.pln_att);
242 pr(" %d", plane.pln_def);
245 pr(" %d", plane.pln_acc);
248 pr(" %d", plane.pln_range);
251 pr(" %d", plane.pln_range_max);
254 pr(" %d", plane.pln_load);
257 pr(" %d", plane.pln_fuel);
260 pr(" %d", plane.pln_harden);
263 pr(" %d", plane.pln_ship);
266 pr(" %d", plane.pln_land);
269 if ((plchr[(int)plane.pln_type].pl_flags & (P_O | P_M)) ==
272 (plane.pln_flags & PLN_LAUNCHED) ? 'Y' : 'N');
277 if ((plchr[(int)plane.pln_type].pl_flags & (P_O | P_M)) ==
281 pln_flags & PLN_SYNCHRONOUS) ? 'Y' :
287 if (plane.pln_nuketype != -1) {
288 pr(" %.5s", nchr[(int)plane.pln_nuketype].n_name);
295 pr(" %c", plane.pln_flags & PLN_AIRBURST ? 'A' : 'G');
303 pr("%s: No plane(s)\n", player->argp[1]);
305 pr("%s: No plane(s)\n", "");
308 pr("%d plane%s\n", nplanes, splur(nplanes));