2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2018, 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:
50 if (!snxtitem(&ni, EF_LAND, player->argp[1], NULL))
55 if (!player->argp[2]) {
56 for (n = 1; n <= 41; n++)
62 while (player->argp[n]) {
63 if (!strcmp("type", player->argp[n])) {
65 } else if (!strcmp("x", player->argp[n])) {
67 } else if (!strcmp("y", player->argp[n])) {
69 } else if (!strcmp("army", player->argp[n])) {
71 } else if (!strcmp("eff", player->argp[n])) {
73 } else if (!strcmp("mil", player->argp[n])) {
75 } else if (!strcmp("fort", player->argp[n])) {
77 } else if (!strcmp("mob", player->argp[n])) {
79 } else if (!strcmp("food", player->argp[n])) {
81 } else if (!strcmp("fuel", player->argp[n])) {
83 } else if (!strcmp("tech", player->argp[n])) {
85 } else if (!strcmp("retr", player->argp[n])) {
87 } else if (!strcmp("react", player->argp[n])) {
89 } else if (!strcmp("xl", player->argp[n])) {
91 } else if (!strcmp("nland", player->argp[n])) {
93 } else if (!strcmp("land", player->argp[n])) {
95 } else if (!strcmp("ship", player->argp[n])) {
97 } else if (!strcmp("shell", player->argp[n])) {
99 } else if (!strcmp("gun", player->argp[n])) {
101 } else if (!strcmp("petrol", player->argp[n])) {
103 } else if (!strcmp("iron", player->argp[n])) {
105 } else if (!strcmp("dust", player->argp[n])) {
107 } else if (!strcmp("bar", player->argp[n])) {
109 } else if (!strcmp("oil", player->argp[n])) {
111 } else if (!strcmp("lcm", player->argp[n])) {
113 } else if (!strcmp("hcm", player->argp[n])) {
115 } else if (!strcmp("rad", player->argp[n])) {
117 } else if (!strcmp("att", player->argp[n])) {
119 } else if (!strcmp("def", player->argp[n])) {
121 } else if (!strcmp("vul", player->argp[n])) {
123 } else if (!strcmp("spd", player->argp[n])) {
125 } else if (!strcmp("vis", player->argp[n])) {
127 } else if (!strcmp("spy", player->argp[n])) {
129 } else if (!strcmp("radius", player->argp[n])) {
131 } else if (!strcmp("frg", player->argp[n])) {
133 } else if (!strcmp("acc", player->argp[n])) {
135 } else if (!strcmp("dam", player->argp[n])) {
137 } else if (!strcmp("amm", player->argp[n])) {
139 } else if (!strcmp("aaf", player->argp[n])) {
141 } else if (!strcmp("uw", player->argp[n])) {
143 } else if (!strcmp("civ", player->argp[n])) {
146 pr("Unrecognized field %s\n", player->argp[n]);
149 pr("Too many fields\n");
159 pr("DUMP LAND UNITS %ld\n", (long)now);
294 np = getnatp(player->cnum);
295 while (nxtitem(&ni, &land)) {
296 if (land.lnd_own == 0)
298 if (!player->owner && !player->god)
302 pr("%d ", land.lnd_own);
306 switch (field[n++]) {
308 pr(" %.4s", lchr[(int)land.lnd_type].l_name);
311 pr(" %d", xrel(np, land.lnd_x));
314 pr(" %d", yrel(np, land.lnd_y));
317 pr(" %c", land.lnd_army ? land.lnd_army : '~');
320 pr(" %d", land.lnd_effic);
323 pr(" %d", land.lnd_item[I_MILIT]);
326 pr(" %d", land.lnd_harden);
329 pr(" %d", land.lnd_mobil);
332 pr(" %d", land.lnd_item[I_FOOD]);
338 pr(" %d", land.lnd_tech);
341 pr(" %d", land.lnd_retreat);
347 pr(" %d", lnd_nxlight(&land));
350 pr(" %d", lnd_nland(&land));
353 pr(" %d", land.lnd_land);
356 pr(" %d", land.lnd_ship);
359 pr(" %d", land.lnd_item[I_SHELL]);
362 pr(" %d", land.lnd_item[I_GUN]);
365 pr(" %d", land.lnd_item[I_PETROL]);
368 pr(" %d", land.lnd_item[I_IRON]);
371 pr(" %d", land.lnd_item[I_DUST]);
374 pr(" %d", land.lnd_item[I_BAR]);
377 pr(" %d", land.lnd_item[I_OIL]);
380 pr(" %d", land.lnd_item[I_LCM]);
383 pr(" %d", land.lnd_item[I_HCM]);
386 pr(" %d", land.lnd_item[I_RAD]);
389 pr(" %1.2f", lnd_att(&land));
392 pr(" %1.2f", lnd_def(&land));
395 pr(" %d", lnd_vul(&land));
398 pr(" %d", lnd_spd(&land));
401 pr(" %d", lnd_vis(&land));
404 pr(" %d", lchr[land.lnd_type].l_spy);
407 pr(" %d", lchr[land.lnd_type].l_rad);
410 pr(" %d", lnd_frg(&land));
413 pr(" %d", lnd_acc(&land));
416 pr(" %d", lnd_dam(&land));
419 pr(" %d", lchr[land.lnd_type].l_ammo);
422 pr(" %d", lnd_aaf(&land));
425 pr(" %d", land.lnd_item[I_UW]);
428 pr(" %d", land.lnd_item[I_CIVIL]);
436 pr("%s: No unit(s)\n", player->argp[1]);
438 pr("%s: No unit(s)\n", "");
441 pr("%d unit%s\n", nunits, splur(nunits));