2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2010, 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-2009
35 * Markus Armbruster, 2003-2009
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 what = getstarg(player->argp[1],
89 "Edit what (country, land, ship, plane, nuke, unit)? ",
96 if (!(ptr = getstarg(player->argp[2], "Sector : ", buf)))
98 if (!sarg_xy(ptr, &x, &y))
100 if (!getsect(x, y, §))
104 np = natargp(player->argp[2], "Country? ");
109 if ((num = onearg(player->argp[2], "Plane number? ")) < 0)
111 if (!getplane(num, &plane))
115 if ((num = onearg(player->argp[2], "Ship number? ")) < 0)
117 if (!getship(num, &ship))
121 if ((num = onearg(player->argp[2], "Unit number? ")) < 0)
123 if (!getland(num, &land))
127 pr("Not implemented yet.\n");
133 if (!player->argp[3]) {
153 if (player->argp[arg_index]) {
154 if (player->argp[arg_index+1]) {
155 thing = player->argp[arg_index++][0];
156 ptr = player->argp[arg_index++];
160 } else if (arg_index == 3) {
161 err = getin(buf, &ptr);
191 if ((err = docountry(thing, arg, ptr, np)) != RET_OK)
195 if (!check_sect_ok(§))
197 if ((err = doland(thing, arg, ptr, §)) != RET_OK)
203 if (!check_ship_ok(&ship))
205 if ((err = doship(thing, arg, ptr, &ship)) != RET_OK)
207 if (!ef_ensure_space(EF_SHIP, ship.shp_uid, 50))
209 if (!putship(ship.shp_uid, &ship))
213 if (!check_land_ok(&land))
215 if ((err = dounit(thing, arg, ptr, &land)) != RET_OK)
217 if (!ef_ensure_space(EF_LAND, land.lnd_uid, 50))
219 if (!putland(land.lnd_uid, &land))
223 if (!check_plane_ok(&plane))
225 if ((err = doplane(thing, arg, ptr, &plane)) != RET_OK)
227 if (!ef_ensure_space(EF_PLANE, plane.pln_uid, 50))
229 if (!putplane(plane.pln_uid, &plane))
237 benefit(natid who, int good)
244 nreport(player->cnum, N_AIDS, who, 1);
247 nreport(player->cnum, N_HURTS, who, 1);
252 noise(struct sctstr *sptr, char *name, int old, int new)
254 pr("%s of %s changed from %d to %d\n",
255 name, xyas(sptr->sct_x, sptr->sct_y, player->cnum), old, new);
257 wu(player->cnum, sptr->sct_own,
258 "%s in %s was changed from %d to %d by an act of %s\n",
259 name, xyas(sptr->sct_x, sptr->sct_y, sptr->sct_own),
260 old, new, cname(player->cnum));
261 benefit(sptr->sct_own, old < new);
265 prsect(struct sctstr *sect)
267 pr("Location <L>: %s\t", xyas(sect->sct_x, sect->sct_y, player->cnum));
268 pr("Distribution sector <D>: %s\n",
269 xyas(sect->sct_dist_x, sect->sct_dist_y, player->cnum));
270 pr("Designation <s>: %c\tNew designation <S>: %c\n",
271 dchr[sect->sct_type].d_mnem, dchr[sect->sct_newtype].d_mnem);
272 pr("own oo eff mob min gld frt oil urn wrk lty che ctg plg ptime fall avail\n");
273 pr(" o O e m i g f c u w l x X p t F a\n");
274 pr("%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %5d %4d %5d\n",
275 sect->sct_own, sect->sct_oldown, sect->sct_effic, sect->sct_mobil,
276 sect->sct_min, sect->sct_gmin, sect->sct_fertil, sect->sct_oil,
277 sect->sct_uran, sect->sct_work, sect->sct_loyal,
278 sect->sct_che, sect->sct_che_target,
279 sect->sct_pstage, sect->sct_ptime,
280 sect->sct_fallout, sect->sct_avail);
282 pr("Mines <M>: %d\n", sect->sct_mines);
283 pr("Road %% <R>: %d\t", sect->sct_road);
284 pr("Rail %% <r>: %d\t", sect->sct_rail);
285 pr("Defense %% <d>: %d\n", sect->sct_defense);
290 prnat(struct natstr *np)
294 pr("Country #: %2d\n", np->nat_cnum);
295 pr("Name <n>: %-20s\t", np->nat_cnam);
296 pr("Representative <r>: %-20s\n", np->nat_pnam);
297 pr("BTUs <b>: %3d\t\t\t", np->nat_btu);
298 pr("Reserves <m>: %5ld\n", np->nat_reserve);
299 pr("Capital <c>: %s\t\t",
300 xyas(np->nat_xcap, np->nat_ycap, player->cnum));
301 pr("Origin <o>: %3s\n",
302 xyas(np->nat_xorg, np->nat_yorg, player->cnum));
303 pr("Status <s>: 0x%x\t\t\t", np->nat_stat);
304 pr("Seconds Used <u>: %3d\n", np->nat_timeused);
305 pr("Technology <T>: %.2f\t\t", np->nat_level[NAT_TLEV]);
306 pr("Research <R>: %.2f\n", np->nat_level[NAT_RLEV]);
307 pr("Education <E>: %.2f\t\t", np->nat_level[NAT_ELEV]);
308 pr("Happiness <H>: %.2f\n", np->nat_level[NAT_HLEV]);
309 pr("Money <M>: $%6ld\n", np->nat_money);
310 pr("Telegrams <t>: %6d\n", np->nat_tgms);
312 pr("Countries contacted: ");
313 for (i = 0; i < MAXNOC; i++) {
314 if (getcontact(np, i))
315 pr("%d(%d) ", i, getcontact(np, i));
322 pr_plane(struct plnstr *plane)
324 pr("UID <U>: %d\t\t", plane->pln_uid);
325 pr("Owner <O>: %d\t\t", plane->pln_own);
326 pr("Location <l>: %s\n",
327 xyas(plane->pln_x, plane->pln_y, player->cnum));
328 pr("Efficiency <e>: %d\t", plane->pln_effic);
329 pr("Mobility <m>: %d\n", plane->pln_mobil);
330 pr("Tech <t>: %d\t\t", plane->pln_tech);
331 pr("Wing <w>: %.1s\n", &plane->pln_wing);
332 pr("Range <r>: %d\t\t", plane->pln_range);
333 pr("Flags <f>: %d\n", plane->pln_flags);
334 pr("Ship <s>: %d\t\t", plane->pln_ship);
335 pr("Land Unit <y>: %d\t", plane->pln_land);
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("Retreat percentage <Z>: %d\n", land->lnd_retreat);
352 pr("Retreat path <R>: '%s'\t\tRetreat Flags <W>: %d\n",
353 land->lnd_rpath, land->lnd_rflags);
354 pr("civ mil uw food shl gun pet irn dst oil lcm hcm rad\n");
355 pr(" c m u f s g p i d o l h r\n");
356 pr("%3d", land->lnd_item[I_CIVIL]);
357 pr("%4d", land->lnd_item[I_MILIT]);
358 pr("%4d", land->lnd_item[I_UW]);
359 pr("%5d", land->lnd_item[I_FOOD]);
360 pr("%4d", land->lnd_item[I_SHELL]);
361 pr("%4d", land->lnd_item[I_GUN]);
362 pr("%5d", land->lnd_item[I_PETROL]);
363 pr("%5d", land->lnd_item[I_IRON]);
364 pr("%5d", land->lnd_item[I_DUST]);
365 pr("%5d", land->lnd_item[I_OIL]);
366 pr("%5d", land->lnd_item[I_LCM]);
367 pr("%5d", land->lnd_item[I_HCM]);
368 pr("%4d", land->lnd_item[I_RAD]);
373 pr_ship(struct shpstr *ship)
377 if (!(natp = getnatp(ship->shp_own)))
379 pr("%s (#%d) %s\n", natp->nat_cnam, ship->shp_own, prship(ship));
380 pr("UID <U>: %d\n", ship->shp_uid);
381 pr("Owner <O>: %d\t\t\t", ship->shp_own);
382 pr("Location <L>: %s\n", xyas(ship->shp_x, ship->shp_y, player->cnum));
383 pr("Tech <T>: %d\t\t\t", ship->shp_tech);
384 pr("Efficiency <E>: %d\n", ship->shp_effic);
385 pr("Mobility <M>: %d\t\t", ship->shp_mobil);
386 pr("Fleet <F>: %.1s\n", &ship->shp_fleet);
387 pr("Retreat path <R>: '%s'\t\tRetreat Flags <W>: %d\n",
388 ship->shp_rpath, ship->shp_rflags);
389 pr("Plague Stage <a>: %d\t\t",ship->shp_pstage);
390 pr("Plague Time <b>: %d\n", ship->shp_ptime);
391 pr("civ mil uw food shl gun pet irn dst oil lcm hcm rad\n");
392 pr(" c m u f s g p i d o l h r\n");
393 pr("%3d", ship->shp_item[I_CIVIL]);
394 pr("%4d", ship->shp_item[I_MILIT]);
395 pr("%4d", ship->shp_item[I_UW]);
396 pr("%5d", ship->shp_item[I_FOOD]);
397 pr("%4d", ship->shp_item[I_SHELL]);
398 pr("%4d", ship->shp_item[I_GUN]);
399 pr("%5d", ship->shp_item[I_PETROL]);
400 pr("%5d", ship->shp_item[I_IRON]);
401 pr("%5d", ship->shp_item[I_DUST]);
402 pr("%5d", ship->shp_item[I_OIL]);
403 pr("%5d", ship->shp_item[I_LCM]);
404 pr("%5d", ship->shp_item[I_HCM]);
405 pr("%4d", ship->shp_item[I_RAD]);
410 errcheck(int num, int min, int max)
420 getin(char *buf, char **valp)
425 p = getstarg(NULL, "%c xxxxx -- thing value : ", buf);
430 for (; isspace(*p); p++) ;
434 for (; *p && !isspace(*p); p++) ;
435 for (; isspace(*p); p++) ;
443 warn_deprecated(char key)
445 pr("Key <%c> is deprecated and will go away in a future release\n", key);
449 doland(char op, int arg, char *p, struct sctstr *sect)
451 natid newown, oldown;
459 newown = (natid)errcheck(arg, 0, MAXNOC - 1);
460 pr("Owner of %s changed from %s (#%d) to %s (#%d).\n",
461 xyas(sect->sct_x, sect->sct_y, player->cnum),
462 cname(sect->sct_own), sect->sct_own, cname(newown), newown);
464 wu(player->cnum, sect->sct_own,
465 "Sector %s lost to deity intervention\n",
466 xyas(sect->sct_x, sect->sct_y, sect->sct_own));
468 benefit(sect->sct_own, 0);
469 sect->sct_own = newown;
471 wu(player->cnum, newown,
472 "Sector %s gained from deity intervention\n",
473 xyas(sect->sct_x, sect->sct_y, sect->sct_own));
480 oldown = (natid)errcheck(arg, 0, MAXNOC - 1);
481 pr("Old owner of %s changed from %s (#%d) to %s (#%d).\n",
482 xyas(sect->sct_x, sect->sct_y, player->cnum),
483 cname(sect->sct_oldown),
484 sect->sct_oldown, cname(oldown), oldown);
485 sect->sct_oldown = oldown;
488 new = errcheck(arg, 0, 100);
489 noise(sect, "Efficiency", sect->sct_effic, new);
490 sect->sct_effic = new;
493 new = errcheck(arg, -127, 255);
494 noise(sect, "Mobility", sect->sct_mobil, new);
495 sect->sct_mobil = new;
498 new = errcheck(arg, 0, 127);
499 noise(sect, "Iron ore content", sect->sct_min, new);
500 sect->sct_min = (unsigned char)new;
503 new = errcheck(arg, 0, 127);
504 noise(sect, "Gold content", sect->sct_gmin, new);
505 sect->sct_gmin = (unsigned char)new;
508 new = errcheck(arg, 0, 127);
509 noise(sect, "Fertility", sect->sct_fertil, new);
510 sect->sct_fertil = (unsigned char)new;
513 new = errcheck(arg, 0, 127);
514 noise(sect, "Oil content", sect->sct_oil, new);
515 sect->sct_oil = (unsigned char)new;
518 new = errcheck(arg, 0, 127);
519 noise(sect, "Uranium content", sect->sct_uran, new);
520 sect->sct_uran = (unsigned char)new;
523 new = errcheck(arg, 0, 100);
524 noise(sect, "Workforce percentage", sect->sct_work, new);
525 sect->sct_work = (unsigned char)new;
528 new = errcheck(arg, 0, 127);
529 pr("Loyalty of %s changed from %d to %d%%\n",
530 xyas(sect->sct_x, sect->sct_y, player->cnum),
531 sect->sct_loyal, new);
532 sect->sct_loyal = (unsigned char)new;
536 new = errcheck(arg, 0, CHE_MAX);
537 pr("Guerillas in %s changed from %d to %d\n",
538 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
542 old = sect->sct_che_target;
543 new = errcheck(arg, 0, MAXNOC - 1);
544 pr("Che target of %s changed from %s (#%d) to %s (#%d).\n",
545 xyas(sect->sct_x, sect->sct_y, player->cnum),
546 cname(old), old, cname(new), new);
547 sect->sct_che_target = new;
552 old = sect->sct_pstage;
553 new = errcheck(arg, 0, PLG_EXPOSED);
554 pr("Plague stage of %s changed from %d to %d%%\n",
555 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
556 sect->sct_pstage = new;
559 old = sect->sct_ptime;
560 new = errcheck(arg, 0, 255);
561 pr("Plague time of %s changed from %d to %d%%\n",
562 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
563 sect->sct_ptime = new;
566 old = sect->sct_fallout;
567 new = errcheck(arg, 0, FALLOUT_MAX);
568 pr("Fallout for sector %s changed from %d to %d\n",
569 xyas(sect->sct_x, sect->sct_y, player->cnum), old, new);
570 sect->sct_fallout = new;
573 new = errcheck(arg, 0, 9999);
574 noise(sect, "Available workforce", sect->sct_avail, new);
575 sect->sct_avail = new;
578 new = errcheck(arg, 0, MINES_MAX);
579 sect->sct_mines = new;
580 pr("Mines changed to %d\n", new);
583 if (!sarg_xy(p, &newx, &newy))
587 ef_set_uid(EF_SECTOR, §, XYOFFSET(newx, newy));
590 if (!sarg_xy(p, &newx, &newy))
592 pr("Distribution location for sector %s changed from %s to %s\n",
593 xyas(sect->sct_x, sect->sct_y, player->cnum),
594 xyas(sect->sct_dist_x, sect->sct_dist_y, player->cnum),
595 xyas(newx, newy, player->cnum));
596 sect->sct_dist_x = newx;
597 sect->sct_dist_y = newy;
600 des = sct_typematch(p);
603 pr("Designation for sector %s changed from %c to %c\n",
604 xyas(sect->sct_x, sect->sct_y, player->cnum),
605 dchr[sect->sct_type].d_mnem, dchr[des].d_mnem);
606 set_coastal(sect, sect->sct_type, des);
607 sect->sct_type = des;
610 des = sct_typematch(p);
613 pr("New designation for sector %s changed from %c to %c\n",
614 xyas(sect->sct_x, sect->sct_y, player->cnum),
615 dchr[sect->sct_newtype].d_mnem, dchr[des].d_mnem);
616 sect->sct_newtype = des;
623 noise(sect, "Road percentage", sect->sct_road, arg);
624 sect->sct_road = arg;
631 noise(sect, "Rail percentage", sect->sct_rail, arg);
632 sect->sct_rail = arg;
639 noise(sect, "Defense percentage", sect->sct_defense, arg);
640 sect->sct_defense = arg;
643 pr("huh? (%c)\n", op);
651 docountry(char op, int arg, char *p, struct natstr *np)
654 natid nat = np->nat_cnum;
655 float farg = (float)atof(p);
659 if (!check_nat_name(p))
661 pr("Country name changed from %s to %s\n", np->nat_cnam, p);
662 strcpy(np->nat_cnam, p);
665 pr("Country representative changed from %s to %s\n",
667 strncpy(np->nat_pnam, p, sizeof(np->nat_pnam) - 1);
673 arg = errcheck(arg, 0, 1024);
674 pr("BTU's changed from %d to %d\n", np->nat_btu, arg);
678 benefit(nat, np->nat_reserve < arg);
679 pr("Military reserves changed from %ld to %d\n",
680 np->nat_reserve, arg);
681 wu(player->cnum, nat,
682 "Military reserves changed from %ld to %d by divine intervention.\n",
683 np->nat_reserve, arg);
684 np->nat_reserve = arg;
687 if (!sarg_xy(p, &newx, &newy))
689 pr("Capital coordinates changed from %s to %s\n",
690 xyas(np->nat_xcap, np->nat_ycap, player->cnum),
691 xyas(newx, newy, player->cnum));
696 if (!sarg_xy(p, &newx, &newy))
698 pr("Origin coordinates changed from %s to %s\n",
699 xyas(np->nat_xorg, np->nat_yorg, player->cnum),
700 xyas(newx, newy, player->cnum));
705 np->nat_stat = errcheck(arg, STAT_UNUSED, STAT_GOD);
708 arg = errcheck(arg, 0, m_m_p_d * 60);
709 pr("Number of seconds used changed from %d to %d.\n",
710 np->nat_timeused, arg);
711 np->nat_timeused = arg;
714 pr("Money changed from %ld to %d\n", np->nat_money, arg);
715 wu(player->cnum, nat,
716 "Money changed from %ld to %d by divine intervention.\n",
721 pr("Tech changed from %.2f to %.2f.\n",
722 np->nat_level[NAT_TLEV], farg);
723 np->nat_level[NAT_TLEV] = farg;
726 pr("Research changed from %.2f to %.2f.\n",
727 np->nat_level[NAT_RLEV], farg);
728 np->nat_level[NAT_RLEV] = farg;
731 pr("Education changed from %.2f to %.2f.\n",
732 np->nat_level[NAT_ELEV], farg);
733 np->nat_level[NAT_ELEV] = farg;
736 pr("Happiness changed from %.2f to %.2f.\n",
737 np->nat_level[NAT_HLEV], farg);
738 np->nat_level[NAT_HLEV] = farg;
741 pr("huh? (%c)\n", op);
750 doship(char op, int arg, char *p, struct shpstr *ship)
757 ship->shp_pstage = arg;
760 ship->shp_ptime = arg;
763 strncpy(ship->shp_rpath, p, sizeof(ship->shp_rpath) - 1);
766 ship->shp_rflags = arg;
769 ef_set_uid(EF_SHIP, ship, arg);
773 wu(player->cnum, ship->shp_own,
774 "%s taken from you by deity intervention!\n", prship(ship));
775 if (arg && arg < MAXNOC) {
776 wu(player->cnum, (natid)arg,
777 "%s given to you by deity intervention!\n", prship(ship));
778 ship->shp_own = (natid)arg;
783 if (!sarg_xy(p, &newx, &newy))
791 mchr[(int)ship->shp_type].m_tech, SHRT_MAX));
794 ship->shp_effic = errcheck(arg, SHIP_MINEFF, 100);
797 ship->shp_mobil = arg;
805 else if (isalpha(p[0]))
806 ship->shp_fleet = p[0];
808 pr("%c: invalid fleet\n", p[0]);
813 ship->shp_item[I_CIVIL] = arg;
816 ship->shp_item[I_MILIT] = arg;
819 ship->shp_item[I_UW] = arg;
822 ship->shp_item[I_FOOD] = arg;
825 ship->shp_item[I_SHELL] = arg;
828 ship->shp_item[I_GUN] = arg;
831 ship->shp_item[I_PETROL] = arg;
834 ship->shp_item[I_IRON] = arg;
837 ship->shp_item[I_DUST] = arg;
840 ship->shp_item[I_OIL] = arg;
843 ship->shp_item[I_LCM] = arg;
846 ship->shp_item[I_HCM] = arg;
849 ship->shp_item[I_RAD] = arg;
852 pr("huh? (%c)\n", op);
859 dounit(char op, int arg, char *p, struct lndstr *land)
866 land->lnd_land = arg;
869 ef_set_uid(EF_LAND, land, arg);
873 wu(player->cnum, land->lnd_own,
874 "%s taken from you by deity intervention!\n", prland(land));
876 if (arg && arg < MAXNOC) {
877 wu(player->cnum, (natid)arg,
878 "%s given to you by deity intervention!\n", prland(land));
879 land->lnd_own = (natid)arg;
884 if (!sarg_xy(p, &newx, &newy))
890 land->lnd_effic = errcheck(arg, LAND_MINEFF, 100);
893 land->lnd_mobil = arg;
898 lchr[(int)land->lnd_type].l_tech, SHRT_MAX));
903 else if (isalpha(p[0]))
904 land->lnd_army = p[0];
906 pr("%c: invalid army\n", p[0]);
911 land->lnd_harden = errcheck(arg, 0, 255);
917 land->lnd_ship = arg;
923 land->lnd_retreat = arg;
926 strncpy(land->lnd_rpath, p, sizeof(land->lnd_rpath) - 1);
929 land->lnd_rflags = arg;
932 land->lnd_item[I_CIVIL] = arg;
935 land->lnd_item[I_MILIT] = arg;
938 land->lnd_item[I_UW] = arg;
941 land->lnd_item[I_FOOD] = arg;
944 land->lnd_item[I_SHELL] = arg;
947 land->lnd_item[I_GUN] = arg;
950 land->lnd_item[I_PETROL] = arg;
953 land->lnd_item[I_IRON] = arg;
956 land->lnd_item[I_DUST] = arg;
959 land->lnd_item[I_OIL] = arg;
962 land->lnd_item[I_LCM] = arg;
965 land->lnd_item[I_HCM] = arg;
968 land->lnd_item[I_RAD] = arg;
971 pr("huh? (%c)\n", op);
979 doplane(char op, int arg, char *p, struct plnstr *plane)
988 ef_set_uid(EF_PLANE, plane, arg);
991 if (!sarg_xy(p, &newx, &newy))
998 wu(player->cnum, plane->pln_own,
999 "%s taken from you by deity intervention!\n",
1001 if (arg && arg < MAXNOC) {
1002 plane->pln_own = (natid)arg;
1003 wu(player->cnum, plane->pln_own,
1004 "%s given to you by deity intervention!\n", prplane(plane));
1006 plane->pln_effic = 0;
1009 plane->pln_effic = errcheck(arg, PLANE_MINEFF, 100);
1012 plane->pln_mobil = errcheck(arg, -127, 255);
1017 plchr[(int)plane->pln_type].pl_tech, SHRT_MAX));
1021 plane->pln_wing = 0;
1022 else if (isalpha(p[0]))
1023 plane->pln_wing = p[0];
1025 pr("%c: invalid wing\n", p[0]);
1030 plane->pln_range = (unsigned char)arg;
1033 plane->pln_ship = arg;
1036 plane->pln_land = arg;
1039 plane->pln_flags = arg;
1042 pr("huh? (%c)\n", op);