diff options
Diffstat (limited to 'crawl-ref/source/mstuff2.cc')
-rw-r--r-- | crawl-ref/source/mstuff2.cc | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index d39aff5257..7873eb8477 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -67,7 +67,8 @@ static monster_type _pick_random_wraith() static monster_type wraiths[] = { MONS_WRAITH, MONS_SHADOW_WRAITH, MONS_FREEZING_WRAITH, - MONS_SPECTRAL_WARRIOR + MONS_SPECTRAL_WARRIOR, MONS_PHANTOM, MONS_HUNGRY_GHOST, + MONS_FLAYED_GHOST }; return (RANDOM_ELEMENT(wraiths)); @@ -97,7 +98,7 @@ static monster_type _pick_undead_summon() static void _do_high_level_summon(monsters *monster, bool monsterNearby, spell_type spell_cast, monster_type (*mpicker)(), int nsummons, - god_type god) + god_type god, coord_def *target = NULL) { if (_mons_abjured(monster, monsterNearby)) return; @@ -113,8 +114,8 @@ static void _do_high_level_summon(monsters *monster, bool monsterNearby, create_monster( mgen_data(which_mons, SAME_ATTITUDE(monster), - duration, spell_cast, monster->pos(), monster->foe, 0, - god)); + duration, spell_cast, target ? *target : monster->pos(), + monster->foe, 0, god)); } } @@ -123,6 +124,7 @@ static bool _los_free_spell(spell_type spell_cast) return (spell_cast == SPELL_HELLFIRE_BURST || spell_cast == SPELL_BRAIN_FEED || spell_cast == SPELL_SMITING + || spell_cast == SPELL_SUMMON_WRAITHS || spell_cast == SPELL_FIRE_STORM || spell_cast == SPELL_AIRSTRIKE); } @@ -134,6 +136,23 @@ static bool _legs_msg_applicable() && (you.species != SP_MERFOLK || !player_is_swimming())); } +void mons_cast_haunt(monsters *monster) +{ + coord_def fpos; + switch (monster->foe) + { + case MHITNOT: + return; + case MHITYOU: + fpos = you.pos(); + break; + default: + fpos = menv[monster->foe].pos(); + } + _do_high_level_summon(monster, mons_near(monster), SPELL_SUMMON_WRAITHS, + _pick_random_wraith, random_range(3, 6), GOD_NO_GOD, &fpos); +} + void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, bool do_noise) { @@ -427,11 +446,6 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, } return; - case SPELL_SUMMON_WRAITHS: - _do_high_level_summon(monster, monsterNearby, spell_cast, - _pick_random_wraith, random_range(3, 6), god); - return; - case SPELL_SUMMON_HORRIBLE_THINGS: _do_high_level_summon(monster, monsterNearby, spell_cast, _pick_horrible_thing, random_range(3, 5), god); |