2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2013, 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 * edit.c: Edit things (sectors, ships, planes, units, nukes, countries)
29 * Known contributors to this file:
32 * Steve McClure, 1998-2000
33 * Ron Koenderink, 2003-2009
34 * Markus Armbruster, 2003-2011
52 static int docountry(char, int, char *, struct natstr *);
53 static int doland(char, int, char *, struct sctstr *);
54 static int doplane(char, int, char *, struct plnstr *);
55 static int doship(char, int, char *, struct shpstr *);
56 static int dounit(char, int, char *, struct lndstr *);
57 static int getin(char *, char **);
58 static void pr_land(struct lndstr *);
59 static void pr_plane(struct plnstr *);
60 static void pr_ship(struct shpstr *);
61 static void prnat(struct natstr *);
62 static void prsect(struct sctstr *);
84 what = getstarg(player->argp[1],
85 "Edit what (country, land, ship, plane, nuke, unit)? ",
92 if (!(ptr = getstarg(player->argp[2], "Sector : ", buf)))
94 if (!sarg_xy(ptr, &x, &y))
96 if (!getsect(x, y, §))
100 np = natargp(player->argp[2], "Country? ");
105 if ((num = onearg(player->argp[2], "Plane number? ")) < 0)
107 if (!getplane(num, &plane))
111 if ((num = onearg(player->argp[2], "Ship number? ")) < 0)
113 if (!getship(num, &ship))
117 if ((num = onearg(player->argp[2], "Unit number? ")) < 0)
119 if (!getland(num, &land))
123 pr("Not implemented yet.\n");
129 if (!player->argp[3]) {
149 if (player->argp[arg_index]) {
150 if (player->argp[arg_index+1]) {
151 thing = player->argp[arg_index++][0];
152 ptr = player->argp[arg_index++];
156 } else if (arg_index == 3) {
157 err = getin(buf, &ptr);
187 if ((err = docountry(thing, arg, ptr, np)) != RET_OK)
191 if (!check_sect_ok(§))
193 if ((err = doland(thing, arg, ptr, §)) != RET_OK)
199 if (!check_ship_ok(&ship))
201 if ((err = doship(thing, arg, ptr, &ship)) != RET_OK)
203 if (!ef_ensure_space(EF_SHIP, ship.shp_uid, 50))
205 if (!putship(ship.shp_uid, &ship))
209 if (!check_land_ok(&land))
211 if ((err = dounit(thing, arg, ptr, &land)) != RET_OK)
213 if (!ef_ensure_space(EF_LAND, land.lnd_uid, 50))
215 if (!putland(land.lnd_uid, &land))
219 if (!check_plane_ok(&plane))
221 if ((err = doplane(thing, arg, ptr, &plane)) != RET_OK)
223 if (!ef_ensure_space(EF_PLANE, plane.pln_uid, 50))
225 if (!putplane(plane.pln_uid, &plane))
233 benefit(natid who, int good)
240 nreport(player->cnum, N_AIDS, who, 1);
243 nreport(player->cnum, N_HURTS, who, 1);
248 noise(struct sctstr *sptr, char *name, int old, int new)
250 pr("%s of %s changed from %d to %d\n",
251 name, xyas(sptr->sct_x, sptr->sct_y, player->cnum), old, new);
253 wu(player->cnum, sptr->sct_own,
254 "%s in %s was changed from %d to %d by an act of %s\n",
255 name, xyas(sptr->sct_x, sptr->sct_y, sptr->sct_own),
256 old, new, cname(player->cnum));
257 benefit(sptr->sct_own, old < new);
261 prsect(struct sctstr *sect)
263 pr("Location <L>: %s\t", xyas(sect->sct_x, sect->sct_y, player->cnum));
264 pr("Distribution sector <D>: %s\n",
265 xyas(sect->sct_dist_x, sect->sct_dist_y, player->cnum));
266 pr("Designation <s>: %c\tNew designation <S>: %c\n",
267 dchr[sect->sct_type].d_mnem, dchr[sect->sct_newtype].d_mnem);
268 pr("own oo eff mob min gld frt oil urn wrk lty che ctg plg ptime fall avail\n");
269 pr(" o O e m i g f c u w l x X p t F a\n");
270 pr("%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %5d %4d %5d\n",
271 sect->sct_own, sect->sct_oldown, sect->sct_effic, sect->sct_mobil,
272 sect->sct_min, sect->sct_gmin, sect->sct_fertil, sect->sct_oil,
273 sect->sct_uran, sect->sct_work, sect->sct_loyal,
274 sect->sct_che, sect->sct_che_target,
275 sect->sct_pstage, sect->sct_ptime,
276 sect->sct_fallout, sect->sct_avail);
278 pr("Mines <M>: %d\n", sect->sct_mines);
279 pr("Road %% <R>: %d\t", sect->sct_road);
280 pr("Rail %% <r>: %d\t", sect->sct_rail);
281 pr("Defense %% <d>: %d\n", sect->sct_defense);
286 prnat(struct natstr *np)
290 pr("Country #: %2d\n", np->nat_cnum);
291 pr("Name <n>: %-20s\t", np->nat_cnam);
292 pr("Representative <r>: %-20s\n", np->nat_pnam);
293 pr("BTUs <b>: %3d\t\t\t", np->nat_btu);
294 pr("Reserves <m>: %5d\n", np->nat_reserve);
295 pr("Capital <c>: %s\t\t",
296 xyas(np->nat_xcap, np->nat_ycap, player->cnum));
297 pr("Origin <o>: %3s\n",
298 xyas(np->nat_xorg, np->nat_yorg, player->cnum));
299 pr("Status <s>: 0x%x\t\t\t", np->nat_stat);
300 pr("Seconds Used <u>: %3d\n", np->nat_timeused);
301 pr("Technology <T>: %.2f\t\t", np->nat_level[NAT_TLEV]);
302 pr("Research <R>: %.2f\n", np->nat_level[NAT_RLEV]);
303 pr("Education <E>: %.2f\t\t", np->nat_level[NAT_ELEV]);
304 pr("Happiness <H>: %.2f\n", np->nat_level[NAT_HLEV]);
305 pr("Money <M>: $%6ld\n", np->nat_money);
306 pr("Telegrams <t>: %6d\n", np->nat_tgms);
308 pr("Countries contacted: ");
309 for (i = 0; i < MAXNOC; i++) {
310 if (getcontact(np, i))
311 pr("%d(%d) ", i, getcontact(np, i));
318 pr_plane(struct plnstr *plane)
320 pr("UID <U>: %d\t\t", plane->pln_uid);
321 pr("Owner <O>: %d\t\t", plane->pln_own);
322 pr("Location <l>: %s\n",
323 xyas(plane->pln_x, plane->pln_y, player->cnum));
324 pr("Efficiency <e>: %d\t", plane->pln_effic);
325 pr("Mobility <m>: %d\n", plane->pln_mobil);
326 pr("Tech <t>: %d\t\t", plane->pln_tech);
327 pr("Wing <w>: %.1s\n", &plane->pln_wing);
328 pr("Range <r>: %d\t\t", plane->pln_range);
329 pr("Flags <f>: %d\n", plane->pln_flags);
330 pr("Ship <s>: %d\t\t", plane->pln_ship);
331 pr("Land Unit <y>: %d\t", plane->pln_land);
335 pr_land(struct lndstr *land)
337 pr("UID <U>: %d\n", land->lnd_uid);
338 pr("Owner <O>: %d\n", land->lnd_own);
339 pr("Location <L>: %s\n", xyas(land->lnd_x, land->lnd_y, player->cnum));
340 pr("Efficiency <e>: %d\t", land->lnd_effic);
341 pr("Mobility <M>: %d\n", land->lnd_mobil);
342 pr("Tech <t>: %d\t\t", land->lnd_tech);
343 pr("Army <a>: %.1s\n", &land->lnd_army);
344 pr("Fortification <F>: %d\t", land->lnd_harden);
345 pr("Land unit <Y>: %d\n", land->lnd_land);
346 pr("Ship <S>: %d\t\t", land->lnd_ship);
347 pr("Retreat percentage <Z>: %d\n", land->lnd_retreat);
348 pr("Retreat path <R>: '%s'\t\tRetreat Flags <W>: %d\n",
349 land->lnd_rpath, land->lnd_rflags);
350 pr("civ mil uw food shl gun pet irn dst oil lcm hcm rad\n");
351 pr(" c m u f s g p i d o l h r\n");
352 pr("%3d", land->lnd_item[I_CIVIL]);
353 pr("%4d", land->lnd_item[I_MILIT]);
354 pr("%4d", land->lnd_item[I_UW]);
355 pr("%5d", land->lnd_item[I_FOOD]);
356 pr("%4d", land->lnd_item[I_SHELL]);
357 pr("%4d", land->lnd_item[I_GUN]);
358 pr("%5d", land->lnd_item[I_PETROL]);
359 pr("%5d", land->lnd_item[I_IRON]);
360 pr("%5d", land->lnd_item[I_DUST]);
361 pr("%5d", land->lnd_item[I_OIL]);
362 pr("%5d", land->lnd_item[I_LCM]);
363 pr("%5d", land->lnd_item[I_HCM]);
364 pr("%4d", land->lnd_item[I_RAD]);
369 pr_ship(struct shpstr *ship)
373 if (!(natp = getnatp(ship->shp_own)))
375 pr("%s (#%d) %s\n", natp->nat_cnam, ship->shp_own, prship(ship));
376 pr("UID <U>: %d\n", ship->shp_uid);
377 pr("Owner <O>: %d\t\t\t", ship->shp_own);
378 pr("Location <L>: %s\n", xyas(ship->shp_x, ship->shp_y, player->cnum));
379 pr("Tech <T>: %d\t\t\t", ship->shp_tech);
380 pr("Efficiency <E>: %d\n", ship->shp_effic);
381 pr("Mobility <M>: %d\t\t", ship->shp_mobil);
382 pr("Fleet <F>: %.1s\n", &ship->shp_fleet);
383 pr("Retreat path <R>: '%s'\t\tRetreat Flags <W>: %d\n",
384 ship->shp_rpath, ship->shp_rflags);
385 pr("Plague Stage <a>: %d\t\t", ship->shp_pstage);
386 pr("Plague Time <b>: %d\n", ship->shp_ptime);
387 pr("civ mil uw food shl gun pet irn dst oil lcm hcm rad\n");
388 pr(" c m u f s g p i d o l h r\n");
389 pr("%3d", ship->shp_item[I_CIVIL]);
390 pr("%4d", ship->shp_item[I_MILIT]);
391 pr("%4d", ship->shp_item[I_UW]);
392 pr("%5d", ship->shp_item[I_FOOD]);
393 pr("%4d", ship->shp_item[I_SHELL]);
394 pr("%4d", ship->shp_item[I_GUN]);
395 pr("%5d", ship->shp_item[I_PETROL]);
396 pr("%5d", ship->shp_item[I_IRON]);
397 pr("%5d", ship->shp_item[I_DUST]);
398 pr("%5d", ship->shp_item[I_OIL]);
399 pr("%5d", ship->shp_item[I_LCM]);
400 pr("%5d", ship->shp_item[I_HCM]);
401 pr("%4d", ship->shp_item[I_RAD]);
406 errcheck(int num, int min, int max)
416 getin(char *buf, char **valp)
421 p = getstarg(NULL, "%c xxxxx -- thing value : ", buf);
426 for (; isspace(*p); p++) ;
430 for (; *p && !isspace(*p); p++) ;
431 for (; isspace(*p); p++) ;
438 #if 0 /* not needed right now */
440 warn_deprecated(char key)
442 pr("Key <%c> is deprecated and will go away in a future release\n", key);
447 doland(char op, int arg, char *p, struct sctstr *sect)
449 natid newown, oldown;
457 newown = (natid)errcheck(arg, 0, MAXNOC - 1);
458 pr("Owner of %s changed from %s (#%d) to %s (#%d).\n",
459 xyas(sect->sct_x, sect->sct_y, player->cnum),
460 cname(sect->sct_own), sect->sct_own, cname(newown), newown);
462 wu(player->cnum, sect->sct_own,
463 "Sector %s lost to deity intervention\n",
464 xyas(sect->sct_x, sect->sct_y, sect->sct_own));
466 benefit(sect->sct_own, 0);
467 sect->sct_own = newown;
469 wu(player->cnum, newown,
470 "Sector %s gained from deity intervention\n",
471 xyas(sect->sct_x, sect->sct_y, newown));
478 oldown = (natid)errcheck(arg, 0, MAXNOC - 1);
479 pr("Old owner of %s changed from %s (#%d) to %s (#%d).\n",
480 xyas(sect->sct_x, sect->sct_y, player->cnum),
481 cname(sect->sct_oldown),
482 sect->sct_oldown, cname(oldown), oldown);
483 sect->sct_oldown = oldown;
486 new = errcheck(arg, 0, 100);
487 noise(sect, "Efficiency", sect->sct_effic, new);
488 sect->sct_effic = new;
491 new = errcheck(arg, -127, 255);
492 noise(sect, "Mobility", sect->sct_mobil, new);
493 sect->sct_mobil = new;
496 new = errcheck(arg, 0, 127);
497 noise(sect, "Iron ore content", sect->sct_min, new);
498 sect->sct_min = (unsigned char)new;
501 new = errcheck(arg, 0, 127);
502 noise(sect, "Gold content", sect->sct_gmin, new);
503 sect->sct_gmin = (unsigned char)new;
506 new = errcheck(arg, 0, 127);
507 noise(sect, "Fertility", sect->sct_fertil, new);
508 sect->sct_fertil = (unsigned char)new;
511 new = errcheck(arg, 0, 127);
512 noise(sect, "Oil content", sect->sct_oil, new);
513 sect->sct_oil = (unsigned char)new;
516 new = errcheck(arg, 0, 127);
517 noise(sect, "Uranium content", sect->sct_uran, new);
518 sect->sct_uran = (unsigned char)new;
521 new = errcheck(arg, 0, 100);
522 noise(sect, "Workforce percentage", sect->sct_work, new);
523 sect->sct_work = (unsigned char)new;
526 new = errcheck(arg, 0, 127);
527 pr("Loyalty of %s changed from %d to %d%%\n",
528 xyas(sect->sct_x, sect->sct_y, player->cnum),
529 sect->sct_loyal, new);
530 sect->sct_loyal = (unsigned char)new;
534 new = errcheck(arg, 0, CHE_MAX);
535 pr("Guerillas in %s changed from %d to %d\n",
536 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
540 old = sect->sct_che_target;
541 new = errcheck(arg, 0, MAXNOC - 1);
542 pr("Che target of %s changed from %s (#%d) to %s (#%d).\n",
543 xyas(sect->sct_x, sect->sct_y, player->cnum),
544 cname(old), old, cname(new), new);
545 sect->sct_che_target = new;
550 old = sect->sct_pstage;
551 new = errcheck(arg, 0, PLG_EXPOSED);
552 pr("Plague stage of %s changed from %d to %d%%\n",
553 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
554 sect->sct_pstage = new;
557 old = sect->sct_ptime;
558 new = errcheck(arg, 0, 255);
559 pr("Plague time of %s changed from %d to %d%%\n",
560 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
561 sect->sct_ptime = new;
564 old = sect->sct_fallout;
565 new = errcheck(arg, 0, FALLOUT_MAX);
566 pr("Fallout for sector %s changed from %d to %d\n",
567 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
568 sect->sct_fallout = new;
571 new = errcheck(arg, 0, 9999);
572 noise(sect, "Available workforce", sect->sct_avail, new);
573 sect->sct_avail = new;
576 new = errcheck(arg, 0, MINES_MAX);
577 sect->sct_mines = new;
578 pr("Mines changed to %d\n", new);
581 if (!sarg_xy(p, &newx, &newy))
585 ef_set_uid(EF_SECTOR, §, XYOFFSET(newx, newy));
588 if (!sarg_xy(p, &newx, &newy))
590 pr("Distribution location for sector %s changed from %s to %s\n",
591 xyas(sect->sct_x, sect->sct_y, player->cnum),
592 xyas(sect->sct_dist_x, sect->sct_dist_y, player->cnum),
593 xyas(newx, newy, player->cnum));
594 sect->sct_dist_x = newx;
595 sect->sct_dist_y = newy;
598 des = sct_typematch(p);
601 pr("Designation for sector %s changed from %c to %c\n",
602 xyas(sect->sct_x, sect->sct_y, player->cnum),
603 dchr[sect->sct_type].d_mnem, dchr[des].d_mnem);
604 set_coastal(sect, sect->sct_type, des);
605 sect->sct_type = des;
608 des = sct_typematch(p);
611 pr("New designation for sector %s changed from %c to %c\n",
612 xyas(sect->sct_x, sect->sct_y, player->cnum),
613 dchr[sect->sct_newtype].d_mnem, dchr[des].d_mnem);
614 sect->sct_newtype = des;
621 noise(sect, "Road percentage", sect->sct_road, arg);
622 sect->sct_road = arg;
629 noise(sect, "Rail percentage", sect->sct_rail, arg);
630 sect->sct_rail = arg;
637 noise(sect, "Defense percentage", sect->sct_defense, arg);
638 sect->sct_defense = arg;
641 pr("huh? (%c)\n", op);
649 docountry(char op, int arg, char *p, struct natstr *np)
652 natid nat = np->nat_cnum;
653 float farg = (float)atof(p);
657 if (!check_nat_name(p, nat))
659 pr("Country name changed from %s to %s\n", np->nat_cnam, p);
660 strcpy(np->nat_cnam, p);
663 pr("Country representative changed from %s to %s\n",
665 strncpy(np->nat_pnam, p, sizeof(np->nat_pnam) - 1);
671 arg = errcheck(arg, 0, 1024);
672 pr("BTU's changed from %d to %d\n", np->nat_btu, arg);
676 benefit(nat, np->nat_reserve < arg);
677 pr("Military reserves changed from %d to %d\n",
678 np->nat_reserve, arg);
679 wu(player->cnum, nat,
680 "Military reserves changed from %d to %d by divine intervention.\n",
681 np->nat_reserve, arg);
682 np->nat_reserve = arg;
685 if (!sarg_xy(p, &newx, &newy))
687 pr("Capital coordinates changed from %s to %s\n",
688 xyas(np->nat_xcap, np->nat_ycap, player->cnum),
689 xyas(newx, newy, player->cnum));
694 if (!sarg_xy(p, &newx, &newy))
696 pr("Origin coordinates changed from %s to %s\n",
697 xyas(np->nat_xorg, np->nat_yorg, player->cnum),
698 xyas(newx, newy, player->cnum));
703 np->nat_stat = errcheck(arg, STAT_UNUSED, STAT_GOD);
706 arg = errcheck(arg, 0, m_m_p_d * 60);
707 pr("Number of seconds used changed from %d to %d.\n",
708 np->nat_timeused, arg);
709 np->nat_timeused = arg;
712 pr("Money changed from %ld to %d\n", np->nat_money, arg);
713 wu(player->cnum, nat,
714 "Money changed from %ld to %d by divine intervention.\n",
719 pr("Tech changed from %.2f to %.2f.\n",
720 np->nat_level[NAT_TLEV], farg);
721 np->nat_level[NAT_TLEV] = farg;
724 pr("Research changed from %.2f to %.2f.\n",
725 np->nat_level[NAT_RLEV], farg);
726 np->nat_level[NAT_RLEV] = farg;
729 pr("Education changed from %.2f to %.2f.\n",
730 np->nat_level[NAT_ELEV], farg);
731 np->nat_level[NAT_ELEV] = farg;
734 pr("Happiness changed from %.2f to %.2f.\n",
735 np->nat_level[NAT_HLEV], farg);
736 np->nat_level[NAT_HLEV] = farg;
739 pr("huh? (%c)\n", op);
748 doship(char op, int arg, char *p, struct shpstr *ship)
755 ship->shp_pstage = arg;
758 ship->shp_ptime = arg;
761 strncpy(ship->shp_rpath, p, sizeof(ship->shp_rpath) - 1);
764 ship->shp_rflags = arg;
767 ef_set_uid(EF_SHIP, ship, arg);
771 wu(player->cnum, ship->shp_own,
772 "%s taken from you by deity intervention!\n", prship(ship));
773 if (arg && arg < MAXNOC) {
774 wu(player->cnum, (natid)arg,
775 "%s given to you by deity intervention!\n", prship(ship));
776 ship->shp_own = (natid)arg;
781 if (!sarg_xy(p, &newx, &newy))
789 mchr[(int)ship->shp_type].m_tech, SHRT_MAX));
792 ship->shp_effic = errcheck(arg, SHIP_MINEFF, 100);
795 ship->shp_mobil = arg;
800 else if (isalpha(p[0]))
801 ship->shp_fleet = p[0];
803 pr("%c: invalid fleet\n", p[0]);
808 ship->shp_item[I_CIVIL] = arg;
811 ship->shp_item[I_MILIT] = arg;
814 ship->shp_item[I_UW] = arg;
817 ship->shp_item[I_FOOD] = arg;
820 ship->shp_item[I_SHELL] = arg;
823 ship->shp_item[I_GUN] = arg;
826 ship->shp_item[I_PETROL] = arg;
829 ship->shp_item[I_IRON] = arg;
832 ship->shp_item[I_DUST] = arg;
835 ship->shp_item[I_OIL] = arg;
838 ship->shp_item[I_LCM] = arg;
841 ship->shp_item[I_HCM] = arg;
844 ship->shp_item[I_RAD] = arg;
847 pr("huh? (%c)\n", op);
854 dounit(char op, int arg, char *p, struct lndstr *land)
861 land->lnd_land = arg;
864 ef_set_uid(EF_LAND, land, arg);
868 wu(player->cnum, land->lnd_own,
869 "%s taken from you by deity intervention!\n", prland(land));
871 if (arg && arg < MAXNOC) {
872 wu(player->cnum, (natid)arg,
873 "%s given to you by deity intervention!\n", prland(land));
874 land->lnd_own = (natid)arg;
879 if (!sarg_xy(p, &newx, &newy))
885 land->lnd_effic = errcheck(arg, LAND_MINEFF, 100);
888 land->lnd_mobil = arg;
893 lchr[(int)land->lnd_type].l_tech, SHRT_MAX));
898 else if (isalpha(p[0]))
899 land->lnd_army = p[0];
901 pr("%c: invalid army\n", p[0]);
906 land->lnd_harden = errcheck(arg, 0, 255);
909 land->lnd_ship = arg;
912 land->lnd_retreat = arg;
915 strncpy(land->lnd_rpath, p, sizeof(land->lnd_rpath) - 1);
918 land->lnd_rflags = arg;
921 land->lnd_item[I_CIVIL] = arg;
924 land->lnd_item[I_MILIT] = arg;
927 land->lnd_item[I_UW] = arg;
930 land->lnd_item[I_FOOD] = arg;
933 land->lnd_item[I_SHELL] = arg;
936 land->lnd_item[I_GUN] = arg;
939 land->lnd_item[I_PETROL] = arg;
942 land->lnd_item[I_IRON] = arg;
945 land->lnd_item[I_DUST] = arg;
948 land->lnd_item[I_OIL] = arg;
951 land->lnd_item[I_LCM] = arg;
954 land->lnd_item[I_HCM] = arg;
957 land->lnd_item[I_RAD] = arg;
960 pr("huh? (%c)\n", op);
968 doplane(char op, int arg, char *p, struct plnstr *plane)
974 ef_set_uid(EF_PLANE, plane, arg);
977 if (!sarg_xy(p, &newx, &newy))
984 wu(player->cnum, plane->pln_own,
985 "%s taken from you by deity intervention!\n",
987 if (arg && arg < MAXNOC) {
988 plane->pln_own = (natid)arg;
989 wu(player->cnum, plane->pln_own,
990 "%s given to you by deity intervention!\n", prplane(plane));
992 plane->pln_effic = 0;
995 plane->pln_effic = errcheck(arg, PLANE_MINEFF, 100);
998 plane->pln_mobil = errcheck(arg, -127, 255);
1003 plchr[(int)plane->pln_type].pl_tech, SHRT_MAX));
1007 plane->pln_wing = 0;
1008 else if (isalpha(p[0]))
1009 plane->pln_wing = p[0];
1011 pr("%c: invalid wing\n", p[0]);
1016 plane->pln_range = (unsigned char)arg;
1019 plane->pln_ship = arg;
1022 plane->pln_land = arg;
1025 plane->pln_flags = arg;
1028 pr("huh? (%c)\n", op);