2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2006, 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 * ldump.c: Dump land unit information
30 * Known contributors to this file:
59 if (!snxtitem(&ni, EF_LAND, player->argp[1]))
64 if (!player->argp[2]) {
65 for (n = 1; n <= 39; n++)
71 while (player->argp[n]) {
72 if (!strcmp("type", player->argp[n])) {
74 } else if (!strcmp("x", player->argp[n])) {
76 } else if (!strcmp("y", player->argp[n])) {
78 } else if (!strcmp("army", player->argp[n])) {
80 } else if (!strcmp("eff", player->argp[n])) {
82 } else if (!strcmp("mil", player->argp[n])) {
84 } else if (!strcmp("fort", player->argp[n])) {
86 } else if (!strcmp("mob", player->argp[n])) {
88 } else if (!strcmp("food", player->argp[n])) {
90 } else if (!strcmp("fuel", player->argp[n])) {
92 } else if (!strcmp("tech", player->argp[n])) {
94 } else if (!strcmp("retr", player->argp[n])) {
96 } else if (!strcmp("react", player->argp[n])) {
98 } else if (!strcmp("xl", player->argp[n])) {
100 } else if (!strcmp("nland", player->argp[n])) {
102 } else if (!strcmp("land", player->argp[n])) {
104 } else if (!strcmp("ship", player->argp[n])) {
106 } else if (!strcmp("shell", player->argp[n])) {
108 } else if (!strcmp("gun", player->argp[n])) {
110 } else if (!strcmp("petrol", player->argp[n])) {
112 } else if (!strcmp("iron", player->argp[n])) {
114 } else if (!strcmp("dust", player->argp[n])) {
116 } else if (!strcmp("bar", player->argp[n])) {
118 } else if (!strcmp("oil", player->argp[n])) {
120 } else if (!strcmp("lcm", player->argp[n])) {
122 } else if (!strcmp("hcm", player->argp[n])) {
124 } else if (!strcmp("rad", player->argp[n])) {
126 } else if (!strcmp("att", player->argp[n])) {
128 } else if (!strcmp("def", player->argp[n])) {
130 } else if (!strcmp("vul", player->argp[n])) {
132 } else if (!strcmp("spd", player->argp[n])) {
134 } else if (!strcmp("vis", player->argp[n])) {
136 } else if (!strcmp("spy", player->argp[n])) {
138 } else if (!strcmp("radius", player->argp[n])) {
140 } else if (!strcmp("frg", player->argp[n])) {
142 } else if (!strcmp("acc", player->argp[n])) {
144 } else if (!strcmp("dam", player->argp[n])) {
146 } else if (!strcmp("amm", player->argp[n])) {
148 } else if (!strcmp("aaf", player->argp[n])) {
151 pr("Unrecognized field %s\n", player->argp[n]);
154 pr("Too many fields\n");
164 pr("DUMP LAND UNITS %ld\n", (long)now);
293 np = getnatp(player->cnum);
294 while (nxtitem(&ni, &land)) {
295 if (land.lnd_own == 0)
297 if (!player->owner && !player->god)
299 count_land_planes(&land);
300 lnd_count_units(&land);
304 pr("%d ", land.lnd_own);
308 switch (field[n++]) {
310 pr(" %.4s", lchr[(int)land.lnd_type].l_name);
313 pr(" %d", xrel(np, land.lnd_x));
316 pr(" %d", yrel(np, land.lnd_y));
319 if (land.lnd_army == ' ')
322 pr(" %c", land.lnd_army);
325 pr(" %d", land.lnd_effic);
328 pr(" %d", lnd_getmil(&land));
331 pr(" %d", land.lnd_harden);
334 pr(" %d", land.lnd_mobil);
337 pr(" %d", land.lnd_item[I_FOOD]);
341 pr(" %d", land.lnd_fuel);
346 pr(" %d", land.lnd_tech);
349 pr(" %d", land.lnd_retreat);
352 pr(" %d", land.lnd_rad_max);
355 pr(" %d", land.lnd_nxlight);
358 pr(" %d", land.lnd_nland);
361 pr(" %d", land.lnd_land);
364 pr(" %d", land.lnd_ship);
367 pr(" %d", land.lnd_item[I_SHELL]);
370 pr(" %d", land.lnd_item[I_GUN]);
373 pr(" %d", land.lnd_item[I_PETROL]);
376 pr(" %d", land.lnd_item[I_IRON]);
379 pr(" %d", land.lnd_item[I_DUST]);
382 pr(" %d", land.lnd_item[I_BAR]);
385 pr(" %d", land.lnd_item[I_OIL]);
388 pr(" %d", land.lnd_item[I_LCM]);
391 pr(" %d", land.lnd_item[I_HCM]);
394 pr(" %d", land.lnd_item[I_RAD]);
397 pr(" %1.2f", land.lnd_att);
400 pr(" %1.2f", land.lnd_def);
403 pr(" %d", land.lnd_vul);
406 pr(" %d", land.lnd_spd);
409 pr(" %d", land.lnd_vis);
412 pr(" %d", land.lnd_spy);
415 pr(" %d", land.lnd_rad);
418 pr(" %d", land.lnd_frg);
421 pr(" %d", land.lnd_acc);
424 pr(" %d", land.lnd_dam);
427 pr(" %d", land.lnd_ammo);
430 pr(" %d", land.lnd_aaf);
438 pr("%s: No unit(s)\n", player->argp[1]);
440 pr("%s: No unit(s)\n", "");
443 pr("%d unit%s\n", nunits, splur(nunits));