extern int carrier_planes(struct shpstr *, int);
extern void pln_sel(struct nstr_item *, struct emp_qelem *,
struct sctstr *, int, int, int, int);
-extern int pln_arm(struct emp_qelem *, int, char, struct ichrstr *,
- int, int);
+extern void pln_arm(struct emp_qelem *, int, char, struct ichrstr *, int);
extern int pln_mobcost(int, struct plnstr *, int);
extern void pln_put(struct emp_qelem *);
extern void pln_put1(struct plist *);
bomb(void)
{
char *p;
- int mission_flags;
coord tx, ty;
coord ax, ay;
int ap_to_target;
/*
* select planes within range
*/
- mission_flags = 0;
pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target,
2, wantflags, P_M | P_O);
pln_sel(&ni_esc, &esc_list, &ap_sect, ap_to_target,
/*
* now arm and equip the bombers, transports, whatever.
*/
- mission_flags |= P_X; /* stealth (shhh) */
- mission_flags |= P_H; /* gets turned off if not all choppers */
- mission_flags = pln_arm(&bomb_list, 2 * ap_to_target, mission,
- ip, 0, mission_flags);
+ pln_arm(&bomb_list, 2 * ap_to_target, mission, ip, 0);
if (QEMPTY(&bomb_list)) {
pr("No planes could be equipped for the mission.\n");
return RET_FAIL;
}
- mission_flags = pln_arm(&esc_list, 2 * ap_to_target, mission,
- ip, P_F | P_ESC, mission_flags);
- ac_encounter(&bomb_list, &esc_list, ax, ay,
- flightpath, mission_flags, 0);
+ pln_arm(&esc_list, 2 * ap_to_target, mission, ip, P_F | P_ESC);
+ ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath, 0, 0);
if (QEMPTY(&bomb_list)) {
pr("No planes got through fighter defenses\n");
} else if (target.sct_type == SCT_SANCT) {
int
drop(void)
{
- int mission_flags;
coord tx, ty;
coord ax, ay;
int ap_to_target;
/*
* select planes within range
*/
- mission_flags = 0;
pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target,
2, wantflags, P_M | P_O);
if (QEMPTY(&bomb_list)) {
/*
* now arm and equip the bombers, transports, whatever.
*/
- mission_flags |= P_X; /* stealth (shhh) */
- mission_flags |= P_H; /* gets turned off if not all choppers */
- mission_flags |= P_MINE;
- mission_flags = pln_arm(&bomb_list, 2 * ap_to_target,
- wantflags & P_MINE ? 'm' : 'd',
- ip, 0, mission_flags);
+ pln_arm(&bomb_list, 2 * ap_to_target,
+ wantflags & P_MINE ? 'm' : 'd',
+ ip, 0);
if (QEMPTY(&bomb_list)) {
pr("No planes could be equipped for the mission.\n");
return RET_FAIL;
}
- mission_flags = pln_arm(&esc_list, 2 * ap_to_target, 'd',
- ip, P_ESC | P_F, mission_flags);
- ac_encounter(&bomb_list, &esc_list, ax, ay,
- flightpath, mission_flags, 0);
+ pln_arm(&esc_list, 2 * ap_to_target, 'd', ip, P_ESC | P_F);
+ ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath, 0, 0);
if (QEMPTY(&bomb_list)) {
pr("No planes got through fighter defenses\n");
} else {
int
fly(void)
{
- int mission_flags;
coord tx, ty;
coord ax, ay;
int ap_to_target;
/*
* select planes within range
*/
- mission_flags = 0;
pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target,
1, wantflags, P_M | P_O);
if (QEMPTY(&bomb_list)) {
/*
* now arm and equip the bombers, transports, whatever.
*/
- mission_flags |= P_X; /* stealth (shhh) */
- mission_flags |= P_H; /* gets turned off if not all choppers */
- mission_flags = pln_arm(&bomb_list, ap_to_target, 't',
- ip, 0, mission_flags);
+ pln_arm(&bomb_list, ap_to_target, 't', ip, 0);
if (QEMPTY(&bomb_list)) {
pr("No planes could be equipped for the mission.\n");
return RET_FAIL;
}
- mission_flags = pln_arm(&esc_list, ap_to_target, 't',
- ip, P_ESC | P_F, mission_flags);
+ pln_arm(&esc_list, ap_to_target, 't', ip, P_ESC | P_F);
ac_encounter(&bomb_list, &esc_list, ax, ay,
- flightpath, mission_flags, 0);
+ flightpath, 0, 0);
if (QEMPTY(&bomb_list)) {
pr("No planes got through fighter defenses\n");
} else {
int
para(void)
{
- int mission_flags;
coord tx, ty;
coord ax, ay;
int ap_to_target;
/*
* now arm and equip the bombers, transports, whatever.
*/
- mission_flags = 0;
- mission_flags |= P_X; /* stealth (shhh) */
- mission_flags |= P_H; /* gets turned off if not all choppers */
- mission_flags = pln_arm(&bomb_list, 2 * ap_to_target, 'a',
- &ichr[I_MILIT], 0, mission_flags);
+ pln_arm(&bomb_list, 2 * ap_to_target, 'a', &ichr[I_MILIT], 0);
if (QEMPTY(&bomb_list)) {
pr("No planes could be equipped for the mission.\n");
return RET_FAIL;
}
- mission_flags = pln_arm(&esc_list, 2 * ap_to_target, 'a',
- &ichr[I_MILIT], P_ESC | P_F, mission_flags);
- ac_encounter(&bomb_list, &esc_list, ax, ay,
- flightpath, mission_flags, 0);
+ pln_arm(&esc_list, 2 * ap_to_target, 'a', &ichr[I_MILIT], P_ESC | P_F);
+ ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath, 0, 0);
if (QEMPTY(&bomb_list)) {
pr("No planes got through fighter defenses\n");
} else {
int
reco(void)
{
- int mission_flags;
coord tx, ty;
coord ax, ay;
int ap_to_target;
pr("target is %s\n", xyas(tx, ty, player->cnum));
getsect(tx, ty, &target);
cno = -1;
- mission_flags = 0;
if (pln_onewaymission(&target, &cno, &wantflags) < 0)
return RET_SYN;
ap_to_target = strlen(flightpath);
/*
* now arm and equip the bombers, transports, whatever.
*/
- mission_flags |= P_X; /* stealth (shhh) */
- mission_flags |= P_H; /* gets turned off if not all choppers */
- mission_flags = pln_arm(&bomb_list, ap_to_target, 'r',
- 0, P_S | P_I, mission_flags);
+ pln_arm(&bomb_list, ap_to_target, 'r', 0, P_S | P_I);
if (QEMPTY(&bomb_list)) {
pr("No planes could be equipped for the mission.\n");
return RET_FAIL;
}
- mission_flags = pln_arm(&esc_list, ap_to_target, 'r',
- 0, P_F | P_ESC, mission_flags);
- mission_flags |= PM_R;
-
- if (*player->argp[0] == 's')
- mission_flags |= PM_S;
-
- ac_encounter(&bomb_list, &esc_list, ax, ay,
- flightpath, mission_flags, 0);
+ pln_arm(&esc_list, ap_to_target, 'r', 0, P_F | P_ESC);
+ ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath,
+ *player->argp[0] == 's' ? PM_R | PM_S : PM_R,
+ 0);
if (QEMPTY(&bomb_list)) {
pr("No planes got through fighter defenses\n");
} else {
static void divide(struct emp_qelem *, struct emp_qelem *, coord, coord);
static int dosupport(struct genlist *, coord, coord, natid, natid);
static int find_airport(struct emp_qelem *, coord, coord);
-static int mission_pln_arm(struct emp_qelem *, coord, coord, int,
- int, struct ichrstr *, int, int);
+static void mission_pln_arm(struct emp_qelem *, coord, coord, int,
+ int, struct ichrstr *, int);
static void mission_pln_sel(struct emp_qelem *, int, int, int);
static int perform_mission(coord, coord, natid, struct emp_qelem *, int,
char *, int);
struct sctstr sect;
struct mchrstr *mcp;
struct plchrstr *pcp;
- int dam = 0, dam2, mission_flags;
+ int dam = 0, dam2;
natid plane_owner = 0;
int md, range, air_dam = 0;
double hitchance, vrange;
/* Split off the escorts at this base into e */
divide(&escorts, &e, air->x, air->y);
- mission_flags = 0;
- mission_flags |= P_X; /* stealth (shhh) */
- mission_flags |= P_H; /* gets turned off if not all choppers */
-
- mission_flags = mission_pln_arm(&b, air->x, air->y, 2 * md, 'p', 0,
- 0, mission_flags);
+ mission_pln_arm(&b, air->x, air->y, 2 * md, 'p', 0, 0);
if (QEMPTY(&b))
continue;
- mission_flags = mission_pln_arm(&e, air->x, air->y, 2 * md, 'p', 0,
- P_F | P_ESC, mission_flags);
+ mission_pln_arm(&e, air->x, air->y, 2 * md, 'p', 0, P_F | P_ESC);
pp = BestAirPath(buf, air->x, air->y, x, y);
if (CANT_HAPPEN(!pp))
xyas(x, y, air->own));
}
- ac_encounter(&b, &e, air->x, air->y, pp, mission_flags, 0);
+ ac_encounter(&b, &e, air->x, air->y, pp, 0, 0);
if (!QEMPTY(&b))
air_dam +=
/*
* Arm only the planes at x,y
*/
-static int
+static void
mission_pln_arm(struct emp_qelem *list, coord x, coord y, int dist,
- int mission, struct ichrstr *ip, int flags,
- int mission_flags)
+ int mission, struct ichrstr *ip, int flags)
{
struct emp_qelem *qp;
struct emp_qelem *next;
free(qp);
continue;
}
- if (flags & (P_S | P_I)) {
- if (plp->pcp->pl_flags & P_S)
- mission_flags |= P_S;
- if (plp->pcp->pl_flags & P_I)
- mission_flags |= P_I;
- }
- if (!(plp->pcp->pl_flags & P_H))
- /* no stealth on this mission */
- mission_flags &= ~P_H;
- if (!(plp->pcp->pl_flags & P_X))
- /* no stealth on this mission */
- mission_flags &= ~P_X;
- if (!(plp->pcp->pl_flags & P_MINE)) {
- /* no asw on this mission */
- mission_flags &= ~P_MINE;
- }
pp->pln_flags |= PLN_LAUNCHED;
pp->pln_mobil -= pln_mobcost(dist, pp, flags);
putplane(pp->pln_uid, pp);
}
- return mission_flags;
}
int
struct emp_qelem *esc_list)
{
int dam = 0, cn;
- int mission_flags, combat = 0, rel, dist, z;
+ int combat = 0, rel, dist, z;
struct emp_qelem *qp, interceptors, airp, i, empty, *next;
struct plist *plp;
struct genlist *glp;
/* Split off the interceptors at this base into i */
divide(&interceptors, &i, air->x, air->y);
- mission_flags = 0;
- mission_flags |= P_X; /* stealth (shhh) */
- /* gets turned off if not all choppers */
- mission_flags |= P_H;
sam_intercept(bomb_list, &i, cn, victim, x, y, 0);
sam_intercept(esc_list, &i, cn, victim, x, y, 1);
pln_put(&i);
continue;
}
- mission_flags =
- mission_pln_arm(&i, air->x, air->y, 2 * dist, 0, 0, P_F,
- mission_flags);
+ mission_pln_arm(&i, air->x, air->y, 2 * dist, 0, 0, P_F);
/* Did we run out of interceptors? */
if (QEMPTY(&i))
/* Now, fly the planes to the sector */
emp_initque(&empty);
- ac_encounter(&i, &empty, air->x, air->y,
- path, mission_flags, 1);
+ ac_encounter(&i, &empty, air->x, air->y, path, 0, 1);
/* If none made it, continue */
if (QEMPTY(&i))
}
}
-int
+void
pln_arm(struct emp_qelem *list, int dist, char mission, struct ichrstr *ip,
- int flags, int mission_flags)
+ int flags)
{
struct emp_qelem *qp;
struct emp_qelem *next;
free(qp);
continue;
}
- if (flags & (P_S | P_I)) {
- if (plp->pcp->pl_flags & P_S)
- mission_flags |= P_S;
- if (plp->pcp->pl_flags & P_I)
- mission_flags |= P_I;
- }
- if (!(plp->pcp->pl_flags & P_H))
- /* no stealth on this mission */
- mission_flags &= ~P_H;
- if (!(plp->pcp->pl_flags & P_X))
- /* no stealth on this mission */
- mission_flags &= ~P_X;
- if (!(plp->pcp->pl_flags & P_MINE)) {
- /* no asw on this mission */
- mission_flags &= ~P_MINE;
- /* FIXME no effect */
- }
pp->pln_flags |= PLN_LAUNCHED;
pp->pln_mobil -= pln_mobcost(dist, pp, flags);
putplane(pp->pln_uid, pp);
pr("%s equipped\n", prplane(pp));
}
- return mission_flags;
}
static int