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:
59 if (!snxtitem(&np, EF_PLANE, player->argp[1]))
63 if (!player->argp[2]) {
64 for (n = 1; n <= 32; n++) field[n-1] = 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 %d\n", now);
134 case 1: pr(" type"); break;
135 case 2: pr(" x"); break;
136 case 3: pr(" y"); break;
137 case 4: pr(" wing"); break;
138 case 5: pr(" eff"); break;
139 case 6: pr(" mob"); break;
140 case 7: pr(" tech"); break;
141 case 8: pr(" att"); break;
142 case 9: pr(" def"); break;
143 case 10: pr(" acc"); break;
144 case 11: pr(" react"); break;
145 case 12: pr(" range"); break;
146 case 13: pr(" load"); break;
147 case 14: pr(" fuel"); break;
148 case 15: pr(" hard"); break;
149 case 16: pr(" ship"); break;
150 case 17: pr(" land"); break;
151 case 18: pr(" laun"); break;
152 case 19: pr(" orb"); break;
153 case 20: pr(" nuke"); break;
154 case 21: pr(" grd"); break;
161 natp = getnatp(player->cnum);
162 while (nxtitem(&np, (s_char *)&plane)) {
163 if (!player->owner || plane.pln_own == 0)
167 pr("%3d ", plane.pln_own);
171 switch (field[n++]) {
172 case 1: pr(" %0.4s", plchr[(int)plane.pln_type].pl_name); break;
173 case 2: pr(" %d", xrel(natp, plane.pln_x)); break;
174 case 3: pr(" %d", yrel(natp, plane.pln_y)); break;
175 case 4: if (plane.pln_wing == ' ')
178 pr(" %c", plane.pln_wing);
180 case 5: pr(" %d", plane.pln_effic); break;
181 case 6: pr(" %d", plane.pln_mobil); break;
182 case 7: pr(" %d", plane.pln_tech); break;
183 case 8: pr(" %d", plane.pln_att); break;
184 case 9: pr(" %d", plane.pln_def); break;
185 case 10: pr(" %d", plane.pln_acc); break;
186 case 11: pr(" %d", plane.pln_range); break;
187 case 12: pr(" %d", plane.pln_range_max); break;
188 case 13: pr(" %d", plane.pln_load); break;
189 case 14: pr(" %d", plane.pln_fuel); break;
190 case 15: pr(" %d", plane.pln_harden); break;
191 case 16: pr(" %d", plane.pln_ship); break;
192 case 17: pr(" %d", plane.pln_land); break;
193 case 18: if ((plchr[(int)plane.pln_type].pl_flags & (P_O|P_M)) == P_O) {
194 pr(" %c", (plane.pln_flags & PLN_LAUNCHED)?'Y':'N');
195 } else pr (" N"); break;
196 case 19: if ((plchr[(int)plane.pln_type].pl_flags & (P_O|P_M)) == P_O) {
197 pr(" %c", opt_ORBIT?(plane.pln_flags & PLN_SYNCHRONOUS)?'Y':'N':'N');
198 } else pr (" N"); break;
199 case 20: if (plane.pln_nuketype != -1) {
200 pr(" %0.5s", nchr[(int)plane.pln_nuketype].n_name); break;
201 } else pr(" N/A"); break;
203 case 21: pr(" %c", plane.pln_flags & PLN_AIRBURST?'A':'G'); break;
210 pr("%s: No plane(s)\n", player->argp[1]);
212 pr("%s: No plane(s)\n", "");
215 pr("%d plane%s\n", nplanes, splur(nplanes));