From d2a1017761869d23760a73a30e51903e872da28a Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 13 Nov 2008 13:56:45 +0000 Subject: FR 2046572: Don't anger allies by teleporting them. (Maybe enslaved monsters should be exempted from that, but for now they're not.) Make *all* allies (including zombies) avoid Zot traps known to the player, but don't let them avoid unknown ones (unless native, or highly intelligent, as usual.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7444 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index a49f943d84..9e8d112083 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -5257,11 +5257,21 @@ static bool _nasty_beam(monsters *mon, const bolt &beam) return (true); // Now for some non-hurtful enchantments. + if (beam.flavour == BEAM_DIGGING) + return (false); + + // haste/healing/invisibility + if (_nice_beam(mon, beam)) + return (false); // No charming holy beings! if (beam.flavour == BEAM_CHARM) return (mons_is_holy(mon)); + // Friendly and good neutral monsters don't mind being teleported. + if (beam.flavour == BEAM_TELEPORT) + return (!mons_wont_attack(mon)); + // degeneration / sleep / enslave soul if (beam.flavour == BEAM_DEGENERATE || beam.flavour == BEAM_SLEEP || beam.flavour == BEAM_ENSLAVE_SOUL) @@ -5284,13 +5294,6 @@ static bool _nasty_beam(monsters *mon, const bolt &beam) if (beam.flavour == BEAM_ENSLAVE_DEMON) return (mons_holiness(mon) == MH_DEMONIC); - // haste/healing/invisibility - if (beam.flavour == BEAM_HASTE || beam.flavour == BEAM_HEALING - || beam.flavour == BEAM_INVISIBILITY) - { - return (false); - } - // everything else is considered nasty by everyone return (true); } -- cgit v1.2.3-54-g00ecf