* Dave Pare, 1986
* Ken Stevens, 1995
* Steve McClure, 1998
- * Markus Armbruster, 2004-2010
+ * Markus Armbruster, 2004-2012
*/
#ifndef PLANE_H
struct plist {
struct emp_qelem queue; /* list of planes */
int load; /* number of bombs or items carried */
+ short pstage; /* plague stage */
struct plchrstr *pcp; /* pointer to desc of plane */
struct plnstr plane; /* struct plane */
};
.s1
This includes preventing any loading and unloading of ships and land
units (since they can, of course, carry plague), explorations out of the
-sector, moving commodities out of the sector, distribution or
-delivery, etc. Basically, any people or commodities
+sector, moving commodities out of the sector, even by air,
+distribution or delivery, etc. Basically, any people or commodities
that originate from a sector, ship or land unit actively battling
plague will cause the destination sector, ship or land unit to become
infected.
+Beware, "people" includes pilots.
.s1
Once an outbreak has been spotted, the plague takes on an infectious
state at the next update. There is very little time to isolate the
* Dave Pare, 1986
* Ken Stevens, 1995
* Steve McClure, 1998-2000
- * Markus Armbruster, 2005-2011
+ * Markus Armbruster, 2005-2012
*/
#include <config.h>
#include "nuke.h"
#include "optlist.h"
#include "path.h"
+#include "plague.h"
#include "plane.h"
#include "ship.h"
struct plist pl;
pl.load = 0;
+ pl.pstage = PLG_HEALTHY;
pl.pcp = plchr + pp->pln_type;
pl.plane = *pp;
emp_initque(&pl.queue);
* Dave Pare, 1986
* Thomas Ruschak, 1992
* Steve McClure, 1996
- * Markus Armbruster, 2006-2011
+ * Markus Armbruster, 2006-2012
*/
#include <config.h>
#include "nsc.h"
#include "optlist.h"
#include "path.h"
+#include "plague.h"
#include "plane.h"
#include "player.h"
#include "prototypes.h"
/* got one! */
ip = malloc(sizeof(*ip));
ip->load = 0;
+ ip->pstage = PLG_HEALTHY;
ip->pcp = &plchr[(int)plane.pln_type];
ip->plane = plane;
emp_insque(&ip->queue, &list[plane.pln_own]);
* Known contributors to this file:
* Ken Stevens, 1995
* Steve McClure, 1996-2000
- * Markus Armbruster, 2003-2011
+ * Markus Armbruster, 2003-2012
*/
#include <config.h>
#include "nsc.h"
#include "optlist.h"
#include "path.h"
+#include "plague.h"
#include "prototypes.h"
#include "queue.h"
#include "xy.h"
continue;
plp = malloc(sizeof(struct plist));
plp->load = 0;
+ plp->pstage = PLG_HEALTHY;
plp->pcp = &plchr[(int)plane.pln_type];
plp->plane = plane;
emp_insque(&plp->queue, escorts);
/* save planes for later */
plp = malloc(sizeof(struct plist));
plp->load = 0;
+ plp->pstage = PLG_HEALTHY;
plp->pcp = pcp;
memcpy(&plp->plane, glp->thing, sizeof(struct plnstr));
if (plp->pcp->pl_flags & P_M)
pcp = plp->pcp;
if (pp->pln_ship >= 0) {
getship(pp->pln_ship, &ship);
+ plp->pstage = ship.shp_pstage;
item = ship.shp_item;
} else if (pp->pln_land >= 0) {
getland(pp->pln_land, &land);
+ plp->pstage = land.lnd_pstage;
item = land.lnd_item;
} else {
getsect(pp->pln_x, pp->pln_y, §);
+ plp->pstage = sect.sct_pstage;
item = sect.sct_item;
}
if (pcp->pl_fuel > item[I_PETROL]) {
* Known contributors to this file:
* Ken Stevens, 1995
* Steve McClure, 1996-2000
- * Markus Armbruster, 2004-2010
+ * Markus Armbruster, 2004-2012
*/
#include <config.h>
#include "nsc.h"
#include "nuke.h"
#include "optlist.h"
+#include "plague.h"
#include "plane.h"
#include "prototypes.h"
#include "queue.h"
/* got a valid interceptor */
irv = malloc(sizeof(*irv));
irv->load = 0;
+ irv->pstage = PLG_HEALTHY;
irv->pcp = &plchr[(int)plane.pln_type];
irv->plane = plane;
emp_insque(&irv->queue, list);
#include "nsc.h"
#include "nuke.h"
#include "optlist.h"
+#include "plague.h"
#include "plane.h"
#include "player.h"
#include "prototypes.h"
cname(player->cnum), prplane(&plp->plane),
prship(&ship));
}
+ if (plp->pcp->pl_crew && plp->pstage == PLG_INFECT
+ && ship.shp_pstage == PLG_HEALTHY)
+ ship.shp_pstage = PLG_EXPOSED;
}
} else {
plp->plane.pln_x = tx;
cname(player->cnum),
prplane(&plp->plane), xyas(tx, ty, sect.sct_own));
}
+ if (plp->pcp->pl_crew && plp->pstage == PLG_INFECT
+ && sect.sct_pstage == PLG_HEALTHY)
+ sect.sct_pstage = PLG_EXPOSED;
plp->plane.pln_ship = cno;
}
}
struct shpstr ship;
int there;
int max;
+ int pstage;
if (!ip)
return;
- amt = 0;
- for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
- plp = (struct plist *)qp;
- amt += plp->load;
- }
if (cno < 0) {
getsect(tx, ty, §);
if (!sect.sct_own) {
}
there = sect.sct_item[ip->i_uid];
max = ITEM_MAX;
+ pstage = sect.sct_pstage;
} else {
getship(cno, &ship);
there = ship.shp_item[ip->i_uid];
max = mchr[ship.shp_type].m_item[ip->i_uid];
+ pstage = ship.shp_pstage;
+ }
+
+ amt = 0;
+ for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
+ plp = (struct plist *)qp;
+ amt += plp->load;
+ if (plp->load
+ && plp->pstage == PLG_INFECT && pstage == PLG_HEALTHY)
+ pstage = PLG_EXPOSED;
}
+
there += amt;
if (there > max) {
pr("%d excess %s discarded\n", there - max, ip->i_name);
pr("%d %s landed safely", amt, ip->i_name);
if (cno < 0) {
sect.sct_item[ip->i_uid] = there;
+ sect.sct_pstage = pstage;
if (sect.sct_own != player->cnum)
wu(0, sect.sct_own, "%s planes drop %d %s in %s\n",
cname(player->cnum), amt, ip->i_name,
putsect(§);
} else {
ship.shp_item[ip->i_uid] = there;
+ ship.shp_pstage = pstage;
if (ship.shp_own != player->cnum)
wu(0, ship.shp_own, "%s planes land %d %s on carrier %d\n",
cname(player->cnum), amt, ip->i_name, ship.shp_uid);
putplane(plane.pln_uid, &plane);
plp = malloc(sizeof(struct plist));
plp->load = 0;
+ plp->pstage = PLG_HEALTHY;
plp->pcp = pcp;
plp->plane = plane;
emp_insque(&plp->queue, list);
pcp = plp->pcp;
if (pp->pln_ship >= 0) {
getship(pp->pln_ship, &ship);
+ plp->pstage = ship.shp_pstage;
item = ship.shp_item;
own = ship.shp_own;
} else if (pp->pln_land >= 0) {
getland(pp->pln_land, &land);
+ plp->pstage = land.lnd_pstage;
item = land.lnd_item;
own = land.lnd_own;
} else {
getsect(pp->pln_x, pp->pln_y, §);
+ plp->pstage = sect.sct_pstage;
item = sect.sct_item;
own = sect.sct_oldown;
}