memset(mi, 0, sizeof(mi));
act[0] = 0;
for (cn = 1; cn < MAXNOC; cn++) {
- act[cn] = getrel(getnatp(cn), victim) <= HOSTILE;
+ act[cn] = relations_with(cn, victim) <= HOSTILE;
emp_initque((struct emp_qelem *)&mi[cn]);
}
return dosupport(x, y, victim, actee, MI_DSUPPORT);
}
+/*
+ * Perform support missions in X,Y against VICTIM for ACTEE.
+ * MISSION is either MI_OSUPPORT or MI_DSUPPORT.
+ * Return total damage.
+ */
static int
dosupport(coord x, coord y, natid victim, natid actee, int mission)
{
memset(mi, 0, sizeof(mi));
act[0] = 0;
for (cn = 1; cn < MAXNOC; cn++) {
- act[cn] = (cn == actee
- || (getrel(getnatp(cn), actee) == ALLIED
- && getrel(getnatp(cn), victim) == AT_WAR));
+ act[cn] = feels_like_helping(cn, actee, victim);
emp_initque((struct emp_qelem *)&mi[cn]);
}
prplane(pp), xyas(x, y, pp->pln_own));
continue;
}
- if (getrel(getnatp(pp->pln_own), victim) > HOSTILE) {
+ if (relations_with(pp->pln_own, victim) > HOSTILE) {
wu(0, pp->pln_own,
"\t%s tracks %s %s at %s\n",
prplane(pp), cname(victim), s, xyas(x, y, pp->pln_own));