summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-04 06:52:54 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-04 06:52:54 +0000
commitb2fa14e4db341fa5ce4c283bec0f6b217ca2347f (patch)
tree8ddd39d825e489b1aaff42bf3f72ed437cfce195 /crawl-ref/source/beam.cc
parent3bc09d83070859d0186c82bab43f75b354d24be1 (diff)
downloadcrawl-ref-b2fa14e4db341fa5ce4c283bec0f6b217ca2347f.tar.gz
crawl-ref-b2fa14e4db341fa5ce4c283bec0f6b217ca2347f.zip
Add miscellaneous minor fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7120 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 85577e91f4..d5324c22fd 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3339,12 +3339,12 @@ static void _affect_place_explosion_clouds(bolt &beam, const coord_def& p)
const god_type god =
(crawl_state.is_god_acting()) ? crawl_state.which_god_acting()
: GOD_NO_GOD;
-
const beh_type att =
- _whose_kill(beam) == KC_OTHER? BEH_HOSTILE : BEH_FRIENDLY;
+ _whose_kill(beam) == KC_OTHER ? BEH_HOSTILE : BEH_FRIENDLY;
+
mons_place(
mgen_data(MONS_FIRE_VORTEX, att, 2, p,
- MHITNOT, 0, god) );
+ MHITNOT, 0, god));
}
}
}
@@ -4757,15 +4757,19 @@ static int _affect_monster_enchantment(bolt &beam, monsters *mon)
if (beam.flavour == BEAM_ENSLAVE_UNDEAD
&& mons_holiness(mon) == MH_UNDEAD)
{
+ const god_type god =
+ (crawl_state.is_god_acting()) ? crawl_state.which_god_acting()
+ : GOD_NO_GOD;
+
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS,
- "HD: %d; pow: %d", mon->hit_dice, beam.ench_power );
+ "HD: %d; pow: %d", mon->hit_dice, beam.ench_power);
#endif
if (mon->attitude == ATT_FRIENDLY)
return (MON_UNAFFECTED);
- if (check_mons_resist_magic( mon, beam.ench_power ))
+ if (check_mons_resist_magic(mon, beam.ench_power))
return mons_immune_magic(mon) ? MON_UNAFFECTED : MON_RESIST;
beam.obvious_effect = true;
@@ -4779,6 +4783,10 @@ static int _affect_monster_enchantment(bolt &beam, monsters *mon)
// Wow, permanent enslaving!
mon->attitude = ATT_FRIENDLY;
+ behaviour_event(mon, ME_ALERT, MHITNOT);
+
+ mons_make_god_gift(mon, god);
+
return (MON_AFFECTED);
}
@@ -4814,9 +4822,8 @@ static int _affect_monster_enchantment(bolt &beam, monsters *mon)
mon->attitude = ATT_FRIENDLY;
else
mon->add_ench(ENCH_CHARM);
+ behaviour_event(mon, ME_ALERT, MHITNOT);
- // Break fleeing and suchlike.
- mon->behaviour = BEH_SEEK;
return (MON_AFFECTED);
}