coord ally;
int first = 1;
char mess[128];
- int rel;
*minmobp = 9876.0;
*maxmobp = -9876.0;
lnd_stays(actor, "has no mil on it to guide it", llp);
continue;
}
- rel = getrel(getnatp(sect.sct_own), player->cnum);
- if (sect.sct_own != land.lnd_own && rel != ALLIED &&
+ if (sect.sct_own != land.lnd_own &&
+ getrel(getnatp(sect.sct_own), actor) != ALLIED &&
!(lchr[(int)llp->unit.land.lnd_type].l_flags & L_SPY) &&
sect.sct_own) {
sprintf(mess, "has been kidnapped by %s", cname(sect.sct_own));
newx = xnorm(llp->unit.land.lnd_x + dx);
newy = ynorm(llp->unit.land.lnd_y + dy);
getsect(newx, newy, §);
- rel = getrel(getnatp(sect.sct_own), player->cnum);
+ rel = getrel(getnatp(sect.sct_own), actor);
if ((sect.sct_own != actor && rel != ALLIED &&
!(lchr[(int)llp->unit.land.lnd_type].l_flags & L_SPY) &&
sect.sct_own) || (sect.sct_type == SCT_WATER ||
putland(llp->unit.land.lnd_uid, &llp->unit.land);
putsect(&osect);
getsect(osect.sct_x, osect.sct_y, &osect);
- if (osect.sct_own != oldown && oldown == player->cnum) {
+ if (osect.sct_own != oldown && oldown == actor) {
/* It was your sector, now it's not. Simple :) */
mpr(actor, "You no longer own %s\n",
xyas(osect.sct_x, osect.sct_y, actor));
if (chance(LND_SPY_DETECT_CHANCE(llp->unit.land.lnd_effic))) {
if (rel == NEUTRAL || rel == FRIENDLY) {
wu(0, sect.sct_own,
- "%s unit spotted in %s\n", cname(player->cnum),
+ "%s unit spotted in %s\n", cname(actor),
xyas(sect.sct_x, sect.sct_y, sect.sct_own));
setrel(sect.sct_own, llp->unit.land.lnd_own, HOSTILE);
} else if (rel <= HOSTILE) {
wu(0, sect.sct_own,
- "%s spy shot in %s\n", cname(player->cnum),
+ "%s spy shot in %s\n", cname(actor),
xyas(sect.sct_x, sect.sct_y, sect.sct_own));
mpr(actor, "%s was shot and killed.\n",
prland(&llp->unit.land));
}
/*
- * find all artillery units belonging
- * to the attacker or defender that can fire.
- * Each arty unit adds +1%/damage point
+ * Fire land unit support against VICTIM for ATTACKER, at X,Y.
+ * If DEFENDING, this is defensive support, else offensive support.
+ * Return total damage.
*/
int
lnd_support(natid victim, natid attacker, coord x, coord y, int defending)
{
struct nstr_item ni;
struct lndstr land;
- int rel, rel2;
int dam, dam2;
int dist;
int range;
while (nxtitem(&ni, &land)) {
if ((land.lnd_x == x) && (land.lnd_y == y))
continue;
- rel = getrel(getnatp(land.lnd_own), attacker);
- rel2 = getrel(getnatp(land.lnd_own), victim);
- if ((land.lnd_own != attacker) &&
- ((rel != ALLIED) || (rel2 != AT_WAR)))
+ if (!feels_like_helping(land.lnd_own, attacker, victim))
continue;
/* are we in range? */