/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
*
* ---
*
- * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- * related information and legal notices. It is expected that any future
- * projects/authors will amend these files as needed.
+ * See files README, COPYING and CREDITS in the root of the source
+ * tree for related information and legal notices. It is expected
+ * that future projects/authors will amend these files as needed.
*
* ---
*
#include <config.h>
-#include "misc.h"
-#include "player.h"
-#include "xy.h"
-#include "sect.h"
-#include "plane.h"
-#include "news.h"
+#include "commands.h"
+#include "damage.h"
#include "mission.h"
-#include "ship.h"
-#include "nsc.h"
-#include "nat.h"
-#include "path.h"
-#include "file.h"
+#include "news.h"
#include "optlist.h"
-#include "damage.h"
-#include "commands.h"
+#include "path.h"
+#include "plane.h"
+#include "ship.h"
static int launch_as(struct plnstr *pp);
static int launch_missile(struct plnstr *pp, int sublaunch);
continue;
}
if (opt_MARKET) {
- if (ontradingblock(EF_PLANE, (int *)&plane)) {
+ if (ontradingblock(EF_PLANE, &plane)) {
pr("plane #%d inelligible - it's for sale.\n",
plane.pln_uid);
continue;
if (!ship.shp_own) {
pr("%s: ship #%d was sunk!\n",
prplane(&plane), ship.shp_uid);
- makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
- plane.pln_x, plane.pln_y);
- plane.pln_own = 0;
+ plane.pln_effic = 0;
putplane(plane.pln_uid, &plane);
continue;
}
if (ship.shp_own != player->cnum && rel != ALLIED) {
pr("%s: you or an ally do not own ship #%d\n",
prplane(&plane), ship.shp_uid);
- makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
- plane.pln_x, plane.pln_y);
- plane.pln_own = 0;
+ plane.pln_effic = 0;
putplane(plane.pln_uid, &plane);
continue;
}
if (retval != RET_OK)
return retval;
if (gone) {
- makelost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x,
- plane.pln_y);
- plane.pln_own = 0;
+ plane.pln_effic = 0;
putplane(plane.pln_uid, &plane);
}
}
launch_as(struct plnstr *pp)
{
coord sx, sy;
- s_char *cp, buf[1024];
+ char *cp, buf[1024];
struct plnstr plane;
struct nstr_item ni;
int goodtarget;
oldown = plane.pln_own;
planedamage(&plane, dam);
pr("Hit satellite for %d%% damage!\n", dam);
- mpr(oldown,
- "%s anti-sat did %d%% damage to %s over %s\n",
+ mpr(oldown, "%s anti-sat did %d%% damage to %s over %s\n",
cname(player->cnum), dam, prplane(&plane),
xyas(plane.pln_x, plane.pln_y, plane.pln_own));
putplane(plane.pln_uid, &plane);
struct plchrstr *pcp = plchr + pp->pln_type;
coord sx, sy;
int n, dam;
- s_char *cp;
+ char *cp;
struct mchrstr *mcp;
struct shpstr target_ship;
struct sctstr sect;
int nukedam;
int rel;
struct natstr *natp;
- s_char buf[1024];
+ char buf[1024];
if (pcp->pl_flags & P_MAR)
cp = getstarg(player->argp[2], "Target ship? ", buf);
int i;
int dist;
int dir;
- s_char *cp;
- s_char *p;
- s_char buf[1024];
+ char *cp;
+ char *p;
+ char buf[1024];
pr("\n");
cp = getstarg(player->argp[2], "Target sector? ", buf);
pr("3... 2... 1... Blastoff!!!\n");
if (chance(0.07 + (100 - pp->pln_effic) / 100.0)) {
pr("KABOOOOM! Range safety officer detonates booster!\n");
- makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
- pp->pln_own = 0;
+ pp->pln_effic = 0;
return RET_OK;
}
i = pp->pln_tech + pp->pln_effic;
pp->pln_x = sx;
pp->pln_y = sy;
pp->pln_flags |= PLN_LAUNCHED;
- pp->pln_mobil = (pp->pln_mobil > dist) ? (pp->pln_mobil - dist) : 0;
+ pp->pln_mobil = pp->pln_mobil > dist ? pp->pln_mobil - dist : 0;
putplane(pp->pln_uid, pp);
- pr(", will be ready for use in %d time units\n", plane_mob_max - pp->pln_mobil);
+ pr(", will be ready for use in %d time units\n",
+ plane_mob_max - pp->pln_mobil);
return RET_OK;
}