/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
natid victim, int *sublaunchp)
{
struct shpstr ship;
+ struct nukstr nuke;
struct sctstr sect;
int sublaunch = 0;
- struct plchrstr *pcp = plchr + pp->pln_type;
char *from;
int dam;
prplane(pp),
cname(victim),
what,
- (type == EF_SHIP || type == EF_PLANE) ? "in " : "",
+ type != EF_SECTOR ? "in " : "",
xyas(x, y, pp->pln_own));
mpr(pp->pln_own, "\tLaunching from ");
if (pp->pln_ship >= 0) {
if (chance((0.05 + (100 - pp->pln_effic) / 100.0)
* (1 - techfact(pp->pln_tech, 1.0)))) {
mpr(pp->pln_own, "KABOOOOM! Missile explodes %s!\n", from);
+ if (getnuke(nuk_on_plane(pp), &nuke)) {
+ pr("%s lost!\n", prnuke(&nuke));
+ nuke.nuk_effic = 0;
+ putnuke(nuke.nuk_uid, &nuke);
+ }
if (chance(0.33)) {
dam = pln_damage(pp, 'p', 1) / 2;
if (pp->pln_ship >= 0) {
shipdamage(&ship, dam);
putship(ship.shp_uid, &ship);
} else {
- pr("Explosion damages %s %d%%",
+ pr("Explosion damages %s %d%%\n",
xyas(pp->pln_x, pp->pln_y, pp->pln_own), dam);
getsect(pp->pln_x, pp->pln_y, §);
sectdamage(§, dam);
putplane(pp->pln_uid, pp);
mpr(pp->pln_own, "\tSHWOOOOOSH! Missile launched!\n");
- if (pcp->pl_flags & P_T)
+ if (type != EF_PLANE)
mpr(victim, "Incoming %s missile sighted at %s...\n",
sublaunch ? "sub-launched" : cname(pp->pln_own),
xyas(x, y, victim));
- if ((pcp->pl_flags & P_T && !(pcp->pl_flags & P_MAR))) {
+ if (type == EF_SECTOR || type == EF_LAND) {
if (msl_abm_intercept(pp, x, y, sublaunch))
return -1;
}
- if (pcp->pl_flags & P_MAR) {
+ if (type == EF_SHIP) {
if (shp_missile_defense(x, y, pp->pln_own, pln_def(pp))) {
return -1;
}
msl_hit(struct plnstr *pp, int hardtarget, int type,
int news_item, int snews_item, int sublaunch, natid victim)
{
- struct plchrstr *pcp = plchr + pp->pln_type;
int hitchance, hit;
if (nuk_on_plane(pp) >= 0) {
hit ? "HIT!" : "miss");
}
- if (pcp->pl_flags & P_T)
+ if (type != EF_PLANE)
mpr(victim, "...Incoming %s missile %s\n",
sublaunch ? "" : cname(pp->pln_own),
hit ? "HIT!\n" : "missed\n");
int news_item)
{
struct plnstr *pp;
- struct plchrstr *pcp;
struct emp_qelem *intlist;
struct emp_qelem intfoo;
struct emp_qelem *qp;
pp = &ip->plane;
if (pp->pln_own != sp->sct_own)
continue;
- pcp = ip->pcp;
if (mission_pln_equip(ip, NULL, 'i') < 0) {
emp_remque(qp);
free(qp);
next = qp->q_forw;
ip = (struct plist *)qp;
pp = &ip->plane;
- pcp = ip->pcp;
if (mission_pln_equip(ip, NULL, 'i') < 0) {
emp_remque(qp);
free(qp);
qp = intlist->q_forw;
ip = (struct plist *)qp;
pp = &ip->plane;
- pcp = ip->pcp;
mpr(msl->pln_own, "%s %s launched in defense!\n",
cname(pp->pln_own), def_name);