summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc17
1 files changed, 10 insertions, 7 deletions
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);
}