Add a new wand, the wand of stasis
A wand of stasis prevents teleportation (even in some cases where it would normally not be prevented, e.g. the hero teleporting a monster, or covetous monsters teleporting). This is intended to provide an alternative tactic against covetous monsters (and their AI has been adjusted to handle being under a stasis effect), but might also be useful in other situations. It does not prevent teleportation of objects, only the hero / monsters, and does not at present prevent level teleportation (although I'm not sure about this and it might well change in the future). This breaks save compatibility, but is being pushed together with other save-breaking changes to avoid the need for multiple bumps to EDITLEVEL.
This commit is contained in:
@@ -34,8 +34,13 @@ noteleport_level(struct monst *mon)
|
||||
if (get_iter_mons(m_blocks_teleporting))
|
||||
return TRUE;
|
||||
|
||||
/* natural no-teleport level */
|
||||
if (svl.level.flags.noteleport)
|
||||
/* natural no-teleport level; covetous monsters can bypass these */
|
||||
if (svl.level.flags.noteleport && !is_covetous(mon->data))
|
||||
return TRUE;
|
||||
|
||||
/* wand of stasis prevents teleportation while the effect is active
|
||||
(even for covetous monsters) */
|
||||
if (svl.level.flags.stasis_until >= svm.moves)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
@@ -1958,8 +1963,11 @@ mtele_trap(struct monst *mtmp, struct trap *trap, int in_sight)
|
||||
{
|
||||
char *monname;
|
||||
|
||||
if (tele_restrict(mtmp))
|
||||
/* don't print feedback here: a monster stepping on a trap and not
|
||||
teleporting from it isn't visible */
|
||||
if (noteleport_level(mtmp))
|
||||
return;
|
||||
|
||||
if (teleport_pet(mtmp, FALSE)) {
|
||||
/* save name with pre-movement visibility */
|
||||
monname = Monnam(mtmp);
|
||||
@@ -2257,7 +2265,12 @@ u_teleport_mon(
|
||||
{
|
||||
coord cc;
|
||||
|
||||
if (mtmp->ispriest && *in_rooms(mtmp->mx, mtmp->my, TEMPLE)) {
|
||||
if (svl.level.flags.stasis_until >= svm.moves) {
|
||||
if (give_feedback)
|
||||
pline("A mysterious force prevents you teleporting %s!",
|
||||
mon_nam(mtmp));
|
||||
return FALSE;
|
||||
} else if (mtmp->ispriest && *in_rooms(mtmp->mx, mtmp->my, TEMPLE)) {
|
||||
if (give_feedback)
|
||||
pline("%s resists your magic!", Monnam(mtmp));
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user