2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2008, 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 files README, COPYING and CREDITS in the root of the source
23 * tree for related information and legal notices. It is expected
24 * that future projects/authors will amend these files as needed.
28 * edit.c: Edit things (sectors, ships, planes, units, nukes, countries)
30 * Known contributors to this file:
33 * Steve McClure, 1998-2000
34 * Ron Koenderink, 2003-2004
35 * Markus Armbruster, 2003-2008
54 static void benefit(natid, int);
55 static int docountry(char, int, char *, struct natstr *);
56 static int doland(char, int, char *, struct sctstr *);
57 static int doplane(char, int, char *, struct plnstr *);
58 static int doship(char, int, char *, struct shpstr *);
59 static int dounit(char, int, char *, struct lndstr *);
60 static int getin(char *, char **);
61 static void noise(struct sctstr *, char *, int, int);
62 static void pr_land(struct lndstr *);
63 static void pr_plane(struct plnstr *);
64 static void pr_ship(struct shpstr *);
65 static void prnat(struct natstr *);
66 static void prsect(struct sctstr *);
88 if ((what = getstarg(player->argp[1],
89 "Edit What (country, land, ship, plane, nuke, unit)? ",
95 if (!(ptr = getstarg(player->argp[2], "Sector : ", buf)))
97 if (!sarg_xy(ptr, &x, &y))
99 if (!getsect(x, y, §))
103 np = natargp(player->argp[2], "Country? ");
108 if ((num = onearg(player->argp[2], "Plane number? ")) < 0)
110 if (!getplane(num, &plane))
114 if ((num = onearg(player->argp[2], "Ship number? ")) < 0)
116 if (!getship(num, &ship))
120 if ((num = onearg(player->argp[2], "Unit number? ")) < 0)
122 if (!getland(num, &land))
126 pr("Not implemented yet.\n");
132 if (player->argp[3] == 0) {
152 if (player->argp[arg_index] != 0) {
153 if (player->argp[arg_index+1] != 0) {
154 thing = player->argp[arg_index++][0];
155 ptr = player->argp[arg_index++];
159 } else if (arg_index == 3) {
160 err = getin(buf, &ptr);
190 if ((err = docountry(thing, arg, ptr, np)) != RET_OK)
194 if (!check_sect_ok(§))
196 if ((err = doland(thing, arg, ptr, §)) != RET_OK)
202 if (!check_ship_ok(&ship))
204 if ((err = doship(thing, arg, ptr, &ship)) != RET_OK)
206 if (!ef_ensure_space(EF_SHIP, ship.shp_uid, 50))
208 if (!putship(ship.shp_uid, &ship))
212 if (!check_land_ok(&land))
214 if ((err = dounit(thing, arg, ptr, &land)) != RET_OK)
216 if (!ef_ensure_space(EF_LAND, land.lnd_uid, 50))
218 if (!putland(land.lnd_uid, &land))
222 if (!check_plane_ok(&plane))
224 if ((err = doplane(thing, arg, ptr, &plane)) != RET_OK)
226 if (!ef_ensure_space(EF_PLANE, plane.pln_uid, 50))
228 if (!putplane(plane.pln_uid, &plane))
236 benefit(natid who, int good)
243 nreport(player->cnum, N_AIDS, who, 1);
246 nreport(player->cnum, N_HURTS, who, 1);
251 noise(struct sctstr *sptr, char *name, int old, int new)
253 pr("%s of %s changed from %d to %d\n",
254 name, xyas(sptr->sct_x, sptr->sct_y, player->cnum), old, new);
256 wu(player->cnum, sptr->sct_own,
257 "%s in %s was changed from %d to %d by an act of %s\n",
258 name, xyas(sptr->sct_x, sptr->sct_y, sptr->sct_own),
259 old, new, cname(player->cnum));
260 benefit(sptr->sct_own, old < new);
264 prsect(struct sctstr *sect)
266 pr("Location <L>: %s\t", xyas(sect->sct_x, sect->sct_y, player->cnum));
267 pr("Distribution sector <D>: %s\n",
268 xyas(sect->sct_dist_x, sect->sct_dist_y, player->cnum));
269 pr("Designation <s>: %c\tNew designation <S>: %c\n",
270 dchr[sect->sct_type].d_mnem, dchr[sect->sct_newtype].d_mnem);
271 pr("own oo eff mob min gld frt oil urn wrk lty che ctg plg ptime fall avail\n");
272 pr(" o O e m i g f c u w l x X p t F a\n");
273 pr("%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %5d %4d %5d\n",
274 sect->sct_own, sect->sct_oldown, sect->sct_effic, sect->sct_mobil,
275 sect->sct_min, sect->sct_gmin, sect->sct_fertil, sect->sct_oil,
276 sect->sct_uran, sect->sct_work, sect->sct_loyal,
277 sect->sct_che, sect->sct_che_target,
278 sect->sct_pstage, sect->sct_ptime,
279 sect->sct_fallout, sect->sct_avail);
281 pr("Mines <M>: %d\n", sect->sct_mines);
282 pr("Road %% <R>: %d\t", sect->sct_road);
283 pr("Rail %% <r>: %d\t", sect->sct_rail);
284 pr("Defense %% <d>: %d\n", sect->sct_defense);
289 prnat(struct natstr *np)
293 pr("Country #: %2d\n", np->nat_cnum);
294 pr("Name <n>: %-20s\t", np->nat_cnam);
295 pr("Representative <r>: %-20s\n", np->nat_pnam);
296 pr("BTUs <b>: %3d\t\t\t", np->nat_btu);
297 pr("Reserves <m>: %5ld\n", np->nat_reserve);
298 pr("Capital <c>: %s\t\t",
299 xyas(np->nat_xcap, np->nat_ycap, player->cnum));
300 pr("Origin <o>: %3s\n",
301 xyas(np->nat_xorg, np->nat_yorg, player->cnum));
302 pr("Status <s>: 0x%x\t\t\t", np->nat_stat);
303 pr("Min Used <u>: %3d\n", np->nat_minused);
304 pr("Technology <T>: %.2f\t\t", np->nat_level[NAT_TLEV]);
305 pr("Research <R>: %.2f\n", np->nat_level[NAT_RLEV]);
306 pr("Education <E>: %.2f\t\t", np->nat_level[NAT_ELEV]);
307 pr("Happiness <H>: %.2f\n", np->nat_level[NAT_HLEV]);
308 pr("Money <M>: $%6ld\n", np->nat_money);
309 pr("Telegrams <t>: %6d\n", np->nat_tgms);
311 pr("Countries contacted: ");
312 for (i = 0; i < MAXNOC; i++) {
313 if (getcontact(np, i))
314 pr("%d(%d) ", i, getcontact(np, i));
321 pr_plane(struct plnstr *plane)
323 pr("UID <U>: %d\t\t", plane->pln_uid);
324 pr("Owner <O>: %d\t\t", plane->pln_own);
325 pr("Location <l>: %s\n",
326 xyas(plane->pln_x, plane->pln_y, player->cnum));
327 pr("Efficiency <e>: %d\t", plane->pln_effic);
328 pr("Mobility <m>: %d\n", plane->pln_mobil);
329 pr("Tech <t>: %d\t\t", plane->pln_tech);
330 pr("Wing <w>: %.1s\n", &plane->pln_wing);
331 pr("Range <r>: %d\t\t", plane->pln_range);
332 pr("Flags <f>: %d\n", plane->pln_flags);
333 pr("Ship <s>: %d\t\t", plane->pln_ship);
334 pr("Land Unit <y>: %d\t", plane->pln_land);
335 pr("Nuke Type <n>: %d\n", plane->pln_nuketype);
339 pr_land(struct lndstr *land)
341 pr("UID <U>: %d\n", land->lnd_uid);
342 pr("Owner <O>: %d\n", land->lnd_own);
343 pr("Location <L>: %s\n", xyas(land->lnd_x, land->lnd_y, player->cnum));
344 pr("Efficiency <e>: %d\t", land->lnd_effic);
345 pr("Mobility <M>: %d\n", land->lnd_mobil);
346 pr("Tech <t>: %d\t\t", land->lnd_tech);
347 pr("Army <a>: %.1s\n", &land->lnd_army);
348 pr("Fortification <F>: %d\t", land->lnd_harden);
349 pr("Land unit <Y>: %d\n", land->lnd_land);
350 pr("Ship <S>: %d\t\t", land->lnd_ship);
351 pr("Radius <P>: %d\n", land->lnd_rad_max);
352 pr("Retreat percentage <Z>: %d\n", land->lnd_retreat);
353 pr("Retreat path <R>: '%s'\t\tRetreat Flags <W>: %d\n",
354 land->lnd_rpath, land->lnd_rflags);
355 pr("civ mil uw food shl gun pet irn dst oil lcm hcm rad\n");
356 pr(" c m u f s g p i d o l h r\n");
357 pr("%3d", land->lnd_item[I_CIVIL]);
358 pr("%4d", land->lnd_item[I_MILIT]);
359 pr("%4d", land->lnd_item[I_UW]);
360 pr("%5d", land->lnd_item[I_FOOD]);
361 pr("%4d", land->lnd_item[I_SHELL]);
362 pr("%4d", land->lnd_item[I_GUN]);
363 pr("%5d", land->lnd_item[I_PETROL]);
364 pr("%5d", land->lnd_item[I_IRON]);
365 pr("%5d", land->lnd_item[I_DUST]);
366 pr("%5d", land->lnd_item[I_OIL]);
367 pr("%5d", land->lnd_item[I_LCM]);
368 pr("%5d", land->lnd_item[I_HCM]);
369 pr("%4d", land->lnd_item[I_RAD]);
374 pr_ship(struct shpstr *ship)
378 if ((natp = getnatp(ship->shp_own)) == 0)
380 pr("%s (#%d) %s\n", natp->nat_cnam, ship->shp_own, prship(ship));
381 pr("UID <U>: %d\n", ship->shp_uid);
382 pr("Owner <O>: %d\t\t\t", ship->shp_own);
383 pr("Location <L>: %s\n", xyas(ship->shp_x, ship->shp_y, player->cnum));
384 pr("Tech <T>: %d\t\t\t", ship->shp_tech);
385 pr("Efficiency <E>: %d\n", ship->shp_effic);
386 pr("Mobility <M>: %d\t\t", ship->shp_mobil);
387 pr("Fleet <F>: %.1s\n", &ship->shp_fleet);
388 pr("Retreat path <R>: '%s'\t\tRetreat Flags <W>: %d\n",
389 ship->shp_rpath, ship->shp_rflags);
390 pr("Plague Stage <a>: %d\t\t",ship->shp_pstage);
391 pr("Plague Time <b>: %d\n", ship->shp_ptime);
392 pr("civ mil uw food shl gun pet irn dst oil lcm hcm rad\n");
393 pr(" c m u f s g p i d o l h r\n");
394 pr("%3d", ship->shp_item[I_CIVIL]);
395 pr("%4d", ship->shp_item[I_MILIT]);
396 pr("%4d", ship->shp_item[I_UW]);
397 pr("%5d", ship->shp_item[I_FOOD]);
398 pr("%4d", ship->shp_item[I_SHELL]);
399 pr("%4d", ship->shp_item[I_GUN]);
400 pr("%5d", ship->shp_item[I_PETROL]);
401 pr("%5d", ship->shp_item[I_IRON]);
402 pr("%5d", ship->shp_item[I_DUST]);
403 pr("%5d", ship->shp_item[I_OIL]);
404 pr("%5d", ship->shp_item[I_LCM]);
405 pr("%5d", ship->shp_item[I_HCM]);
406 pr("%4d", ship->shp_item[I_RAD]);
411 errcheck(int num, int min, int max)
421 getin(char *buf, char **valp)
426 p = getstarg(NULL, "%c xxxxx -- thing value : ", buf);
431 for (; isspace(*p); p++) ;
435 for (; *p && !isspace(*p); p++) ;
436 for (; isspace(*p); p++) ;
444 warn_deprecated(char key)
446 pr("Key <%c> is deprecated and will go away in a future release\n", key);
450 doland(char op, int arg, char *p, struct sctstr *sect)
452 natid newown, oldown;
460 newown = (natid)errcheck(arg, 0, MAXNOC - 1);
461 pr("Owner of %s changed from %s (#%d) to %s (#%d).\n",
462 xyas(sect->sct_x, sect->sct_y, player->cnum),
463 cname(sect->sct_own), sect->sct_own, cname(newown), newown);
465 makelost(EF_SECTOR, sect->sct_own, 0,
466 sect->sct_x, sect->sct_y);
467 wu(player->cnum, sect->sct_own,
468 "Sector %s lost to deity intervention\n",
469 xyas(sect->sct_x, sect->sct_y, sect->sct_own));
471 benefit(sect->sct_own, 0);
472 sect->sct_own = newown;
474 makenotlost(EF_SECTOR, newown, 0, sect->sct_x, sect->sct_y);
475 wu(player->cnum, newown,
476 "Sector %s gained from deity intervention\n",
477 xyas(sect->sct_x, sect->sct_y, sect->sct_own));
484 oldown = (natid)errcheck(arg, 0, MAXNOC - 1);
485 pr("Old owner of %s changed from %s (#%d) to %s (#%d).\n",
486 xyas(sect->sct_x, sect->sct_y, player->cnum),
487 cname(sect->sct_oldown),
488 sect->sct_oldown, cname(oldown), oldown);
489 sect->sct_oldown = oldown;
492 new = errcheck(arg, 0, 100);
493 noise(sect, "Efficiency", sect->sct_effic, new);
494 sect->sct_effic = (unsigned char)new;
497 new = errcheck(arg, -127, 255);
498 noise(sect, "Mobility", sect->sct_mobil, new);
499 sect->sct_mobil = new;
502 new = errcheck(arg, 0, 127);
503 noise(sect, "Iron ore content", sect->sct_min, new);
504 sect->sct_min = (unsigned char)new;
507 new = errcheck(arg, 0, 127);
508 noise(sect, "Gold content", sect->sct_gmin, new);
509 sect->sct_gmin = (unsigned char)new;
512 new = errcheck(arg, 0, 127);
513 noise(sect, "Fertility", sect->sct_fertil, new);
514 sect->sct_fertil = (unsigned char)new;
517 new = errcheck(arg, 0, 127);
518 noise(sect, "Oil content", sect->sct_oil, new);
519 sect->sct_oil = (unsigned char)new;
522 new = errcheck(arg, 0, 127);
523 noise(sect, "Uranium content", sect->sct_uran, new);
524 sect->sct_uran = (unsigned char)new;
527 new = errcheck(arg, 0, 100);
528 noise(sect, "Workforce percentage", sect->sct_work, new);
529 sect->sct_work = (unsigned char)new;
532 new = errcheck(arg, 0, 127);
533 pr("Loyalty of %s changed from %d to %d%%\n",
534 xyas(sect->sct_x, sect->sct_y, player->cnum),
535 sect->sct_loyal, new);
536 sect->sct_loyal = (unsigned char)new;
540 new = errcheck(arg, 0, CHE_MAX);
541 pr("Guerillas in %s changed from %d to %d\n",
542 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
546 old = sect->sct_che_target;
547 new = errcheck(arg, 0, MAXNOC - 1);
548 pr("Che target of %s changed from %s (#%d) to %s (#%d).\n",
549 xyas(sect->sct_x, sect->sct_y, player->cnum),
550 cname(old), old, cname(new), new);
551 sect->sct_che_target = new;
556 old = sect->sct_pstage;
557 new = errcheck(arg, 0, PLG_EXPOSED);
558 pr("Plague stage of %s changed from %d to %d%%\n",
559 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
560 sect->sct_pstage = new;
563 old = sect->sct_ptime;
564 new = errcheck(arg, 0, 255);
565 pr("Plague time of %s changed from %d to %d%%\n",
566 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
567 sect->sct_ptime = new;
570 old = sect->sct_fallout;
571 new = errcheck(arg, 0, FALLOUT_MAX);
572 pr("Fallout for sector %s changed from %d to %d\n",
573 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
574 sect->sct_fallout = new;
577 new = errcheck(arg, 0, 9999);
578 noise(sect, "Available workforce", sect->sct_avail, new);
579 sect->sct_avail = new;
582 new = errcheck(arg, 0, MINES_MAX);
583 sect->sct_mines = new;
584 pr("Mines changed to %d\n", new);
587 if (!sarg_xy(p, &newx, &newy))
591 ef_set_uid(EF_SECTOR, §, XYOFFSET(newx, newy));
594 if (!sarg_xy(p, &newx, &newy))
596 pr("Distribution Location for sector %s changed from %s to %s\n",
597 xyas(sect->sct_x, sect->sct_y, player->cnum),
598 xyas(sect->sct_dist_x, sect->sct_dist_y, player->cnum),
599 xyas(newx, newy, player->cnum));
600 sect->sct_dist_x = newx;
601 sect->sct_dist_y = newy;
604 des = sct_typematch(p);
607 pr("Designation for sector %s changed from %c to %c\n",
608 xyas(sect->sct_x, sect->sct_y, player->cnum),
609 dchr[sect->sct_type].d_mnem, dchr[des].d_mnem);
610 set_coastal(sect, sect->sct_type, des);
611 sect->sct_type = des;
614 des = sct_typematch(p);
617 pr("New Designation for sector %s changed from %c to %c\n",
618 xyas(sect->sct_x, sect->sct_y, player->cnum),
619 dchr[sect->sct_newtype].d_mnem, dchr[des].d_mnem);
620 sect->sct_newtype = des;
627 noise(sect, "Road percentage", sect->sct_road, arg);
628 sect->sct_road = arg;
635 noise(sect, "Rail percentage", sect->sct_rail, arg);
636 sect->sct_rail = arg;
643 noise(sect, "Defense percentage", sect->sct_defense, arg);
644 sect->sct_defense = arg;
647 pr("huh? (%c)\n", op);
655 docountry(char op, int arg, char *p, struct natstr *np)
658 natid nat = np->nat_cnum;
659 float farg = (float)atof(p);
663 pr("Country name changed from %s to %s\n", np->nat_cnam, p);
664 strncpy(np->nat_cnam, p, sizeof(np->nat_cnam) - 1);
667 pr("Country representative changed from %s to %s\n",
669 strncpy(np->nat_pnam, p, sizeof(np->nat_pnam) - 1);
675 arg = errcheck(arg, 0, 1024);
676 pr("BTU's changed from %d to %d\n", np->nat_btu, arg);
680 benefit(nat, np->nat_reserve < arg);
681 pr("Military Reserves changed from %ld to %d\n",
682 np->nat_reserve, arg);
683 wu(player->cnum, nat,
684 "Military Reserves changed from %ld to %d by divine intervention.\n",
685 np->nat_reserve, arg);
686 np->nat_reserve = arg;
689 if (!sarg_xy(p, &newx, &newy))
691 pr("Capital coordinates changed from %s to %s\n",
692 xyas(np->nat_xcap, np->nat_ycap, player->cnum),
693 xyas(newx, newy, player->cnum));
698 if (!sarg_xy(p, &newx, &newy))
700 pr("Origin coordinates changed from %s to %s\n",
701 xyas(np->nat_xorg, np->nat_yorg, player->cnum),
702 xyas(newx, newy, player->cnum));
707 np->nat_stat = errcheck(arg, STAT_UNUSED, STAT_GOD);
710 arg = errcheck(arg, 0, m_m_p_d);
711 pr("Number of minutes used changed from %d to %d.\n",
712 np->nat_minused, arg);
713 np->nat_minused = arg;
716 pr("Money changed from %ld to %d\n", np->nat_money, arg);
717 wu(player->cnum, nat,
718 "Money changed from %ld to %d by divine intervention.\n",
723 pr("Tech changed from %.2f to %.2f.\n",
724 np->nat_level[NAT_TLEV], farg);
725 np->nat_level[NAT_TLEV] = farg;
728 pr("Research changed from %.2f to %.2f.\n",
729 np->nat_level[NAT_RLEV], farg);
730 np->nat_level[NAT_RLEV] = farg;
733 pr("Education changed from %.2f to %.2f.\n",
734 np->nat_level[NAT_ELEV], farg);
735 np->nat_level[NAT_ELEV] = farg;
738 pr("Happiness changed from %.2f to %.2f.\n",
739 np->nat_level[NAT_HLEV], farg);
740 np->nat_level[NAT_HLEV] = farg;
743 pr("huh? (%c)\n", op);
752 doship(char op, int arg, char *p, struct shpstr *ship)
759 ship->shp_pstage = arg;
762 ship->shp_ptime = arg;
765 strncpy(ship->shp_rpath, p, sizeof(ship->shp_rpath) - 1);
768 ship->shp_rflags = arg;
771 ef_set_uid(EF_SHIP, ship, arg);
775 wu(player->cnum, ship->shp_own,
776 "%s taken from you by deity intervention!\n", prship(ship));
777 if (arg && arg < MAXNOC) {
778 wu(player->cnum, (natid)arg,
779 "%s given to you by deity intervention!\n", prship(ship));
780 makelost(EF_SHIP, ship->shp_own, ship->shp_uid,
781 ship->shp_x, ship->shp_y);
782 ship->shp_own = (natid)arg;
783 makenotlost(EF_SHIP, ship->shp_own, ship->shp_uid,
784 ship->shp_x, ship->shp_y);
789 if (!sarg_xy(p, &newx, &newy))
797 mchr[(int)ship->shp_type].m_tech, SHRT_MAX));
800 ship->shp_effic = errcheck(arg, SHIP_MINEFF, 100);
803 ship->shp_mobil = arg;
811 else if (isalpha(p[0]))
812 ship->shp_fleet = p[0];
814 pr("%c: invalid fleet\n", p[0]);
819 ship->shp_item[I_CIVIL] = arg;
822 ship->shp_item[I_MILIT] = arg;
825 ship->shp_item[I_UW] = arg;
828 ship->shp_item[I_FOOD] = arg;
831 ship->shp_item[I_SHELL] = arg;
834 ship->shp_item[I_GUN] = arg;
837 ship->shp_item[I_PETROL] = arg;
840 ship->shp_item[I_IRON] = arg;
843 ship->shp_item[I_DUST] = arg;
846 ship->shp_item[I_OIL] = arg;
849 ship->shp_item[I_LCM] = arg;
852 ship->shp_item[I_HCM] = arg;
855 ship->shp_item[I_RAD] = arg;
858 pr("huh? (%c)\n", op);
865 dounit(char op, int arg, char *p, struct lndstr *land)
872 land->lnd_land = arg;
875 ef_set_uid(EF_LAND, land, arg);
879 wu(player->cnum, land->lnd_own,
880 "%s taken from you by deity intervention!\n", prland(land));
882 if (arg && arg < MAXNOC) {
883 wu(player->cnum, (natid)arg,
884 "%s given to you by deity intervention!\n", prland(land));
885 makelost(EF_LAND, land->lnd_own, land->lnd_uid,
886 land->lnd_x, land->lnd_y);
887 land->lnd_own = (natid)arg;
888 makenotlost(EF_LAND, land->lnd_own, land->lnd_uid,
889 land->lnd_x, land->lnd_y);
894 if (!sarg_xy(p, &newx, &newy))
900 land->lnd_effic = errcheck(arg, LAND_MINEFF, 100);
903 land->lnd_mobil = arg;
908 lchr[(int)land->lnd_type].l_tech, SHRT_MAX));
913 else if (isalpha(p[0]))
914 land->lnd_army = p[0];
916 pr("%c: invalid army\n", p[0]);
921 land->lnd_harden = errcheck(arg, 0, 255);
927 land->lnd_ship = arg;
930 land->lnd_rad_max = arg;
933 land->lnd_retreat = arg;
936 strncpy(land->lnd_rpath, p, sizeof(land->lnd_rpath) - 1);
939 land->lnd_rflags = arg;
942 land->lnd_item[I_CIVIL] = arg;
945 land->lnd_item[I_MILIT] = arg;
948 land->lnd_item[I_UW] = arg;
951 land->lnd_item[I_FOOD] = arg;
954 land->lnd_item[I_SHELL] = arg;
957 land->lnd_item[I_GUN] = arg;
960 land->lnd_item[I_PETROL] = arg;
963 land->lnd_item[I_IRON] = arg;
966 land->lnd_item[I_DUST] = arg;
969 land->lnd_item[I_OIL] = arg;
972 land->lnd_item[I_LCM] = arg;
975 land->lnd_item[I_HCM] = arg;
978 land->lnd_item[I_RAD] = arg;
981 pr("huh? (%c)\n", op);
989 doplane(char op, int arg, char *p, struct plnstr *plane)
995 plane->pln_nuketype = arg;
998 ef_set_uid(EF_PLANE, plane, arg);
1001 if (!sarg_xy(p, &newx, &newy))
1003 plane->pln_x = newx;
1004 plane->pln_y = newy;
1008 wu(player->cnum, plane->pln_own,
1009 "%s taken from you by deity intervention!\n",
1011 if (arg && arg < MAXNOC) {
1012 makelost(EF_PLANE, plane->pln_own, plane->pln_uid,
1013 plane->pln_x, plane->pln_y);
1014 plane->pln_own = (natid)arg;
1015 makenotlost(EF_PLANE, plane->pln_own, plane->pln_uid,
1016 plane->pln_x, plane->pln_y);
1017 wu(player->cnum, plane->pln_own,
1018 "%s given to you by deity intervention!\n", prplane(plane));
1020 plane->pln_effic = 0;
1023 plane->pln_effic = errcheck(arg, PLANE_MINEFF, 100);
1026 plane->pln_mobil = errcheck(arg, -127, 255);
1031 plchr[(int)plane->pln_type].pl_tech, SHRT_MAX));
1035 plane->pln_wing = 0;
1036 else if (isalpha(p[0]))
1037 plane->pln_wing = p[0];
1039 pr("%c: invalid wing\n", p[0]);
1044 plane->pln_range = (unsigned char)arg;
1047 plane->pln_ship = arg;
1050 plane->pln_land = arg;
1053 plane->pln_flags = arg;
1056 pr("huh? (%c)\n", op);