#include "ship.h"
#include "xy.h"
-static int pln_equip(struct plist *, struct ichrstr *, char);
static int fit_plane_on_ship(struct plnstr *, struct shpstr *);
/*
amt = 0;
for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
plp = (struct plist *)qp;
- amt += plp->misc;
+ amt += plp->load;
}
if (cno < 0) {
getsect(tx, ty, §);
amt = 0;
for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
plp = (struct plist *)qp;
- amt += plp->misc;
+ amt += plp->load;
}
if (amt > 0) {
plane.pln_mission = 0;
putplane(plane.pln_uid, &plane);
plp = malloc(sizeof(struct plist));
- plp->misc = 0;
- plp->bombs = 0;
+ plp->load = 0;
plp->pcp = pcp;
plp->plane = plane;
emp_insque(&plp->queue, list);
}
}
-static int
+int
pln_equip(struct plist *plp, struct ichrstr *ip, char mission)
{
struct plchrstr *pcp;
itype = I_SHELL;
break;
case 't': /* transport */
- case 'd': /* drop */
if (!(pcp->pl_flags & P_C) || !ip)
break;
itype = ip->i_uid;
itype = I_SHELL;
load *= 2;
break;
+ case 'd': /* drop */
+ if (!(pcp->pl_flags & P_C) || CANT_HAPPEN(!ip))
+ break;
+ itype = ip->i_uid;
+ if (pcp->pl_flags & P_V)
+ load *= 2;
+ break;
case 'a': /* paradrop */
if (!(pcp->pl_flags & P_P))
break;
itype = I_MILIT;
+ if (pcp->pl_flags & P_V)
+ load *= 2;
break;
case 'r': /* reconnaissance */
case 'e': /* escort */
- load = 0;
+ case 'i': /* missile interception */
+ if (CANT_HAPPEN(!(pcp->pl_flags & P_M)
+ || !(pcp->pl_flags & (P_N | P_O))))
+ break;
+ if (load)
+ itype = I_SHELL;
break;
default:
CANT_REACH();
return -1;
}
item[itype] -= needed;
- if (itype == I_SHELL && (mission == 's' || mission == 'p'))
- plp->bombs = needed;
- else
- plp->misc = needed;
+ plp->load = needed;
}
if (pp->pln_ship >= 0) {