2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2011, 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 * ldump.c: Dump land unit information
29 * Known contributors to this file:
51 if (!snxtitem(&ni, EF_LAND, player->argp[1], NULL))
56 if (!player->argp[2]) {
57 for (n = 1; n <= 41; n++)
63 while (player->argp[n]) {
64 if (!strcmp("type", player->argp[n])) {
66 } else if (!strcmp("x", player->argp[n])) {
68 } else if (!strcmp("y", player->argp[n])) {
70 } else if (!strcmp("army", player->argp[n])) {
72 } else if (!strcmp("eff", player->argp[n])) {
74 } else if (!strcmp("mil", player->argp[n])) {
76 } else if (!strcmp("fort", player->argp[n])) {
78 } else if (!strcmp("mob", player->argp[n])) {
80 } else if (!strcmp("food", player->argp[n])) {
82 } else if (!strcmp("fuel", player->argp[n])) {
84 } else if (!strcmp("tech", player->argp[n])) {
86 } else if (!strcmp("retr", player->argp[n])) {
88 } else if (!strcmp("react", player->argp[n])) {
90 } else if (!strcmp("xl", player->argp[n])) {
92 } else if (!strcmp("nland", player->argp[n])) {
94 } else if (!strcmp("land", player->argp[n])) {
96 } else if (!strcmp("ship", player->argp[n])) {
98 } else if (!strcmp("shell", player->argp[n])) {
100 } else if (!strcmp("gun", player->argp[n])) {
102 } else if (!strcmp("petrol", player->argp[n])) {
104 } else if (!strcmp("iron", player->argp[n])) {
106 } else if (!strcmp("dust", player->argp[n])) {
108 } else if (!strcmp("bar", player->argp[n])) {
110 } else if (!strcmp("oil", player->argp[n])) {
112 } else if (!strcmp("lcm", player->argp[n])) {
114 } else if (!strcmp("hcm", player->argp[n])) {
116 } else if (!strcmp("rad", player->argp[n])) {
118 } else if (!strcmp("att", player->argp[n])) {
120 } else if (!strcmp("def", player->argp[n])) {
122 } else if (!strcmp("vul", player->argp[n])) {
124 } else if (!strcmp("spd", player->argp[n])) {
126 } else if (!strcmp("vis", player->argp[n])) {
128 } else if (!strcmp("spy", player->argp[n])) {
130 } else if (!strcmp("radius", player->argp[n])) {
132 } else if (!strcmp("frg", player->argp[n])) {
134 } else if (!strcmp("acc", player->argp[n])) {
136 } else if (!strcmp("dam", player->argp[n])) {
138 } else if (!strcmp("amm", player->argp[n])) {
140 } else if (!strcmp("aaf", player->argp[n])) {
142 } else if (!strcmp("uw", player->argp[n])) {
144 } else if (!strcmp("civ", player->argp[n])) {
147 pr("Unrecognized field %s\n", player->argp[n]);
150 pr("Too many fields\n");
160 pr("DUMP LAND UNITS %ld\n", (long)now);
295 np = getnatp(player->cnum);
296 while (nxtitem(&ni, &land)) {
297 if (land.lnd_own == 0)
299 if (!player->owner && !player->god)
303 pr("%d ", land.lnd_own);
307 switch (field[n++]) {
309 pr(" %.4s", lchr[(int)land.lnd_type].l_name);
312 pr(" %d", xrel(np, land.lnd_x));
315 pr(" %d", yrel(np, land.lnd_y));
318 pr(" %c", land.lnd_army ? land.lnd_army : '~');
321 pr(" %d", land.lnd_effic);
324 pr(" %d", land.lnd_item[I_MILIT]);
327 pr(" %d", land.lnd_harden);
330 pr(" %d", land.lnd_mobil);
333 pr(" %d", land.lnd_item[I_FOOD]);
339 pr(" %d", land.lnd_tech);
342 pr(" %d", land.lnd_retreat);
348 pr(" %d", lnd_nxlight(&land));
351 pr(" %d", lnd_nland(&land));
354 pr(" %d", land.lnd_land);
357 pr(" %d", land.lnd_ship);
360 pr(" %d", land.lnd_item[I_SHELL]);
363 pr(" %d", land.lnd_item[I_GUN]);
366 pr(" %d", land.lnd_item[I_PETROL]);
369 pr(" %d", land.lnd_item[I_IRON]);
372 pr(" %d", land.lnd_item[I_DUST]);
375 pr(" %d", land.lnd_item[I_BAR]);
378 pr(" %d", land.lnd_item[I_OIL]);
381 pr(" %d", land.lnd_item[I_LCM]);
384 pr(" %d", land.lnd_item[I_HCM]);
387 pr(" %d", land.lnd_item[I_RAD]);
390 pr(" %1.2f", lnd_att(&land));
393 pr(" %1.2f", lnd_def(&land));
396 pr(" %d", lnd_vul(&land));
399 pr(" %d", lnd_spd(&land));
402 pr(" %d", lnd_vis(&land));
405 pr(" %d", lchr[land.lnd_type].l_spy);
408 pr(" %d", lchr[land.lnd_type].l_rad);
411 pr(" %d", lnd_frg(&land));
414 pr(" %d", lnd_acc(&land));
417 pr(" %d", lnd_dam(&land));
420 pr(" %d", lchr[land.lnd_type].l_ammo);
423 pr(" %d", lnd_aaf(&land));
426 pr(" %d", land.lnd_item[I_UW]);
429 pr(" %d", land.lnd_item[I_CIVIL]);
437 pr("%s: No unit(s)\n", player->argp[1]);
439 pr("%s: No unit(s)\n", "");
442 pr("%d unit%s\n", nunits, splur(nunits));