/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2012, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
* Known contributors to this file:
* Ken Stevens, 1995
* Steve McClure, 1996-2000
- * Markus Armbruster, 2004-2010
+ * Markus Armbruster, 2004-2021
*/
#include <config.h>
#include <stdlib.h>
-#include "file.h"
+#include "chance.h"
#include "misc.h"
#include "nat.h"
#include "news.h"
#include "nsc.h"
#include "nuke.h"
#include "optlist.h"
+#include "plague.h"
#include "plane.h"
#include "prototypes.h"
#include "queue.h"
struct sctstr sect;
int dam;
- dam = pln_damage(pp, 'p', 0) / 2;
+ dam = pln_damage(pp, 'p', NULL) / 2;
if (pp->pln_ship >= 0) {
shipdamage(&ship, dam);
putship(ship.shp_uid, &ship);
hit = 1;
} else {
hitchance = pln_hitchance(pp, hardtarget, type);
- hit = (roll(100) <= hitchance);
- mpr(pp->pln_own, "\t%d%% hitchance...%s\n", hitchance,
+ hit = pct_chance(hitchance);
+ mpr(pp->pln_own, "\t%d%% hit chance...%s\n", hitchance,
hit ? "HIT!" : "miss");
}
/* 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);
pp = &ip->plane;
if (pp->pln_own != sp->sct_own)
continue;
- if (mission_pln_equip(ip, NULL, 'i') < 0) {
+ if (mission_pln_equip(ip, NULL, 0) < 0) {
emp_remque(qp);
free(qp);
continue;
next = qp->q_forw;
ip = (struct plist *)qp;
pp = &ip->plane;
- if (mission_pln_equip(ip, NULL, 'i') < 0) {
+ if (mission_pln_equip(ip, NULL, 0) < 0) {
emp_remque(qp);
free(qp);
continue;
struct emp_qelem irvlist;
getsect(x, y, §);
- msl_sel(&irvlist, x, y, msl->pln_own, P_N, P_O, 0);
+ msl_sel(&irvlist, x, y, msl->pln_own, P_N, 0, 0);
return msl_intercept(msl, §, sublaunch,
&irvlist, "warhead", "abm",
sublaunch ? N_NUKE_SSTOP : N_NUKE_STOP);