shopkeeper/temple priest teleporting (trunk only)
Forwarded from the newsgroup by <Someone>: temple priest might
abandon his post via teleport if conditions are obscure enough. Change
rloc_pos_ok() to only accept spots inside the same shop or temple when a
shopkeeper or temple priest is teleported to a random destination. rloc()
tries rloc_pos_ok() 500 times before reverting to goodpos(), so this will
usually succeed for a large room; it may fail for a small one (reverting
to the current behavior, more or less). Shopkeepers or priests who get
polymorphed into a critter which teleports to the stairs when in need of
healing will still leave their shop or temple if wounded (no change).
Priests resist if the player tries to teleport them, but shopkeepers
don't. So for direct attack by the player, this only affects shopkeeper
destination. But it affects both types as far as being hit by quantum
mechanics (probably caused by player's use of conflict) or if polymorphed
into monsters which steal and then flee (again, probably caused by the
player since those strong monsters won't voluntarily polymorph).
This commit is contained in:
@@ -153,6 +153,8 @@ don't discover unknown bag of tricks when monster it releases is undetected
|
||||
make region ttl field a long instead of short to get rid of lint warnings
|
||||
about a possible loss of data
|
||||
pushing a boulder onto a level teleporter trap could issue repeat messages
|
||||
if shopkeeper or priest gets teleported while inside his shop or temple,
|
||||
give locations inside that room preference when choosing destination
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
@@ -921,6 +921,14 @@ struct monst *mtmp;
|
||||
!within_bounded_area(x, y, dndest.nlx, dndest.nly,
|
||||
dndest.nhx, dndest.nhy)));
|
||||
} else {
|
||||
/* [try to] prevent a shopkeeper or temple priest from being
|
||||
sent out of his room (caller might resort to goodpos() if
|
||||
we report failure here, so this isn't full prevention) */
|
||||
if (mtmp->isshk && inhishop(mtmp)) {
|
||||
if (levl[x][y].roomno != ESHK(mtmp)->shoproom) return FALSE;
|
||||
} else if (mtmp->ispriest && inhistemple(mtmp)) {
|
||||
if (levl[x][y].roomno != EPRI(mtmp)->shroom) return FALSE;
|
||||
}
|
||||
/* current location is <xx,yy> */
|
||||
if (!tele_jump_ok(xx, yy, x, y)) return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user