/*
* 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
* Dave Pare, 1986
* Thomas Ruschak, 1992
* Steve McClure, 1996
- * Markus Armbruster, 2006-2008
+ * Markus Armbruster, 2006-2009
*/
#include <config.h>
#define FLAK_GUN_MAX 14
-static int plane_caps(struct emp_qelem *);
static void sam_intercept(struct emp_qelem *, struct emp_qelem *,
natid, natid, coord, coord, int);
static void ac_intercept(struct emp_qelem *, struct emp_qelem *,
getilists(ilist, rel, plane_owner);
if (mission_flags & PM_R) {
- flags = plane_caps(bomb_list);
+ flags = pln_caps(bomb_list);
if (flags & P_S) {
PR(plane_owner, "\nSPY Plane report\n");
PRdate(plane_owner);
}
if (mission_flags & PM_R) {
- flags = plane_caps(bomb_list);
+ flags = pln_caps(bomb_list);
if (opt_HIDDEN)
setcont(plane_owner, sect.sct_own, FOUND_FLY);
if (sect.sct_type == SCT_WATER) {
pln_put(&ilist[cn]);
}
-static int
-plane_caps(struct emp_qelem *list)
-{
- struct emp_qelem *qp;
- struct plist *plp;
- int fl;
-
- fl = 0;
- for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
- plp = (struct plist *)qp;
- fl |= plp->pcp->pl_flags;
- }
-
- return fl;
-}
-
static void
sam_intercept(struct emp_qelem *att_list, struct emp_qelem *def_list,
natid def_own, natid plane_owner, coord x, coord y,
&& pp->pln_radius < mapdist(x, y, pp->pln_opx, pp->pln_opy))
continue;
if (CANT_HAPPEN(pp->pln_flags & PLN_LAUNCHED)
- || mission_pln_equip(dplp, 0, P_F, 0) < 0) {
+ || mission_pln_equip(dplp, NULL, 0) < 0) {
emp_remque(dqp);
free(dqp);
continue;
&& pp->pln_radius < mapdist(x, y, pp->pln_opx, pp->pln_opy))
continue;
if (CANT_HAPPEN(pp->pln_flags & PLN_LAUNCHED)
- || mission_pln_equip(plp, 0, P_F, 0) < 0) {
+ || mission_pln_equip(plp, NULL, 0) < 0) {
emp_remque(qp);
free(qp);
continue;
emp_remque(qp);
emp_insque(qp, &int_list);
pp->pln_flags |= PLN_LAUNCHED;
- pp->pln_mobil -= pln_mobcost(dist, pp, P_F);
+ pp->pln_mobil -= pln_mobcost(dist, pp, 0);
putplane(pp->pln_uid, pp);
icount++;
if (icount > att_count)
pln_put(&int_list);
}
-void
+static void
ac_combat_headers(natid plane_owner, natid def_own)
{
PR(plane_owner,
/*
* air-to-air combat.
*/
-void
+static void
ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list)
{
struct plist *attacker;
struct plist *interceptor;
struct emp_qelem *att;
struct emp_qelem *in;
- int nplanes;
int more_att;
int more_int;
struct emp_qelem *att_next;
att_next = att->q_forw;
attacker = (struct plist *)att;
interceptor = (struct plist *)in;
- nplanes = attacker->plane.pln_effic;
- if (nplanes > interceptor->plane.pln_effic)
- nplanes = interceptor->plane.pln_effic;
ac_dog(attacker, interceptor);
in = in_next;
att = att_next;
def = pln_def(&dp->plane) * dp->plane.pln_effic / 100;
def = MAX(def, dp->pcp->pl_def / 2);
- if ((ap->pcp->pl_flags & P_F) && ap->bombs != 0)
+ if ((ap->pcp->pl_flags & P_F) && ap->load != 0)
att -= 2;
- if ((dp->pcp->pl_flags & P_F) && dp->bombs != 0)
+ if ((dp->pcp->pl_flags & P_F) && dp->load != 0)
def -= 2;
att += ap->pcp->pl_stealth / 25.0;
def += dp->pcp->pl_stealth / 25.0;
struct emp_qelem *next;
char msg[255];
- plp = (struct plist *)list->q_forw;
-
for (qp = list->q_forw; qp != list; qp = next) {
next = qp->q_forw;
plp = (struct plist *)qp;
flak = guns - def;
if ((pl_flags & P_T) == 0)
flak--;
- if (pl_flags & P_X)
- flak -= 2;
- if (pl_flags & P_H)
- flak -= 1;
if (flak > 8)
mult = flaktable[FLAK_MAX];
continue;
/* got one! */
ip = malloc(sizeof(*ip));
- ip->bombs = 0;
- ip->misc = 0;
+ ip->load = 0;
ip->pcp = &plchr[(int)plane.pln_type];
ip->plane = plane;
emp_insque(&ip->queue, &list[plane.pln_own]);