return RET_SYN;
while (nxtitem(&ni, &pl)) {
if (!player->owner
- && getrel(getnatp(pl.pln_own), player->cnum) != ALLIED)
+ && relations_with(pl.pln_own, player->cnum) != ALLIED)
continue;
plc = &plchr[(int)pl.pln_type];
if ((plc->pl_flags & (P_O | P_N | P_MAR))
}
getsect(nuke.nuk_x, nuke.nuk_y, §);
if (!player->owner
- && getrel(getnatp(sect.sct_own), player->cnum) != ALLIED) {
+ && relations_with(sect.sct_own, player->cnum) != ALLIED) {
pr("Disarming %s in sector %s requires an alliance!\n",
prplane(&pl), xyas(sect.sct_x, sect.sct_y, player->cnum));
continue;
for (qp = olist.q_forw; qp != &olist; qp = next) {
next = qp->q_forw;
llp = (struct ulist *)qp;
- rel = getrel(getnatp(def->own), player->cnum);
+ rel = relations_with(def->own, player->cnum);
if (chance(0.10) || rel == ALLIED || !def->own) {
pr("%s made it on shore safely.\n", prland(&llp->unit.land));
llp->unit.land.lnd_x = def->x;
newy = def->y + diroff[n + 1][1];
getsect(newx, newy, §); /* incase cross world boundary */
if (!player->owner
- && getrel(getnatp(sect.sct_own), player->cnum) != ALLIED)
+ && relations_with(sect.sct_own, player->cnum) != ALLIED)
continue;
att_combat_init(&off[++last], EF_SECTOR);
off[last].x = sect.sct_x;
if (!player->owner) {
if (load_unload == UNLOAD || !noisy)
continue;
- if (getrel(getnatp(ship.shp_own), player->cnum) < FRIENDLY)
+ if (relations_with(ship.shp_own, player->cnum) < FRIENDLY)
continue;
}
}
if (load_unload == UNLOAD
&& !player->owner
- && getrel(getnatp(sect.sct_own), player->cnum) < FRIENDLY) {
+ && relations_with(sect.sct_own, player->cnum) < FRIENDLY) {
if (noisy)
pr("You can't unload into an unfriendly %s\n",
dchr[sect.sct_type].d_name);
if (!player->owner) {
if (load_unload == UNLOAD || !noisy)
continue;
- if (getrel(getnatp(land.lnd_own), player->cnum) != ALLIED)
+ if (relations_with(land.lnd_own, player->cnum) != ALLIED)
continue;
}
xyas(sect.sct_x, sect.sct_y, player->cnum));
continue;
}
- if (getrel(getnatp(sect.sct_own), player->cnum) != ALLIED) {
+ if (relations_with(sect.sct_own, player->cnum) != ALLIED) {
pr("Sector %s is not yours.\n",
xyas(sect.sct_x, sect.sct_y, player->cnum));
continue;
getsect(item.gen.x, item.gen.y, §);
if (type == EF_SHIP) {
if (!player->owner
- && getrel(getnatp(sect.sct_own), player->cnum) < FRIENDLY) {
+ && relations_with(sect.sct_own, player->cnum) < FRIENDLY) {
pr("%s is not in a friendly harbor!\n",
prship(&item.ship));
continue;
}
} else {
if (!player->owner
- && getrel(getnatp(sect.sct_own), player->cnum) != ALLIED) {
+ && relations_with(sect.sct_own, player->cnum) != ALLIED) {
pr("%s is not in an allied sector!\n",
obj_nameof(&item.gen));
continue;
if (rad[y][x] != dchr[SCT_WATER].d_mnem && rad[y][x] != 'X')
continue;
if (tmcp->m_flags & M_SUB &&
- getrel(getnatp(targ.shp_own), player->cnum) < FRIENDLY) {
+ relations_with(targ.shp_own, player->cnum) < FRIENDLY) {
if (mcp->m_vrnge + visib < 8)
pr("Sonar detects sub #%d @ %s\n",
targ.shp_uid,
pr("Sonar contact in %s\n", xyas(x, y, player->cnum));
found = 1;
}
- if (getrel(getnatp(targ->shp_own), pp->pln_own) < FRIENDLY &&
+ if (relations_with(targ->shp_own, pp->pln_own) < FRIENDLY &&
roll(100) > pln_identchance(pp, shp_hardtarget(targ),
EF_SHIP))
if (roll(100) > pln_identchance(pp, shp_hardtarget(targ),
continue;
own = dsect.sct_own;
- relat = getrel(getnatp(own), player->cnum);
+ relat = relations_with(own, player->cnum);
if (relat <= NEUTRAL
&& chance(dsect.sct_item[I_MILIT] / 200.0)) {
/* spy caught */
return RET_SYN;
total = 0;
while (nxtitem(&targets, &target)) {
- if (!player->owner &&
- (getrel(getnatp(target.shp_own), player->cnum) < FRIENDLY))
+ if (!player->owner
+ && relations_with(target.shp_own, player->cnum) < FRIENDLY)
continue;
if (target.shp_uid == tender.shp_uid)
continue;
if (!check_ship_ok(tenderp) || !check_land_ok(&land))
return RET_SYN;
while (nxtitem(&targets, &target)) {
- if (!player->owner &&
- (getrel(getnatp(target.shp_own), player->cnum) < FRIENDLY))
+ if (!player->owner
+ && relations_with(target.shp_own, player->cnum) < FRIENDLY)
continue;
if (target.shp_uid == tenderp->shp_uid)
continue;
if (cn == friend)
return 1; /* help self against anybody else */
/* third party helps ally if at war with foe: */
- return getrel(getnatp(cn), friend) == ALLIED
- && getrel(getnatp(cn), foe) == AT_WAR;
+ return relations_with(cn, friend) == ALLIED
+ && relations_with(cn, foe) == AT_WAR;
}
/* Shoot back
if (cno < 0
|| !getship(cno, &ship)
|| (!player->owner
- && (getrel(getnatp(ship.shp_own), player->cnum)
+ && (relations_with(ship.shp_own, player->cnum)
!= ALLIED))) {
pr("Not yours\n");
continue;