diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-10-14 00:12:58 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-10-14 00:12:58 +0200 |
commit | b6c2789b34a23cfa2aba49da8c50b0faae83534a (patch) | |
tree | 7370ff4a56bc41420779f70b1e7e9c5c871386f8 /crawl-ref | |
parent | f7670d170e9f1f6984844967b4051be08af68b7b (diff) | |
download | crawl-ref-b6c2789b34a23cfa2aba49da8c50b0faae83534a.tar.gz crawl-ref-b6c2789b34a23cfa2aba49da8c50b0faae83534a.zip |
Rename Summon Wraiths to Haunt, make it a targetted spell, necro only,
that can summon multiple wraiths and ghosts (FR 2865657).
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/effects.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/mstuff2.cc | 32 | ||||
-rw-r--r-- | crawl-ref/source/mstuff2.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/spells3.cc | 62 | ||||
-rw-r--r-- | crawl-ref/source/spells3.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/spl-data.h | 8 |
8 files changed, 85 insertions, 33 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 975cd9b593..84acf15828 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -41,6 +41,7 @@ REVISION("$Rev$"); #include "monplace.h" #include "monstuff.h" #include "mon-util.h" +#include "mstuff2.h" #include "mutation.h" #include "notes.h" #include "ouch.h" @@ -834,6 +835,14 @@ void direct_effect(monsters *source, spell_type spell, } break; + case SPELL_SUMMON_WRAITHS: + if (!def) + mpr("You feel haunted."); + else + mpr("You sense an evil presence."); + mons_cast_haunt(source); + break; + default: ASSERT(false); } diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index f1562b5df7..d0b8981a23 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1695,6 +1695,7 @@ int exper_value(const monsters *monster) { case SPELL_PARALYSE: case SPELL_SMITING: + case SPELL_SUMMON_WRAITHS: case SPELL_HELLFIRE_BURST: case SPELL_HELLFIRE: case SPELL_SYMBOL_OF_TORMENT: @@ -3237,6 +3238,7 @@ static bool _ms_los_spell(spell_type monspell) return (false); if (monspell == SPELL_SMITING || monspell == SPELL_AIRSTRIKE + || monspell == SPELL_SUMMON_WRAITHS || spell_typematch(monspell, SPTYP_SUMMONING)) { return (true); 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); diff --git a/crawl-ref/source/mstuff2.h b/crawl-ref/source/mstuff2.h index 0529d03c86..70238e5835 100644 --- a/crawl-ref/source/mstuff2.h +++ b/crawl-ref/source/mstuff2.h @@ -33,6 +33,7 @@ bool orange_statue_effects(monsters *mons); bool silver_statue_effects(monsters *mons); bool moth_incite_monsters(const monsters *mon); void mons_clear_trapping_net(monsters *mon); +void mons_cast_haunt(monsters *monster); bool mons_clonable(const monsters* orig, bool needs_adjacent = true); int clone_mons(const monsters* orig, bool quiet = false, diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 2965ace0a3..b5cff1372f 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -1259,34 +1259,60 @@ bool cast_twisted_resurrection(int pow, god_type god) return (true); } -bool cast_summon_wraiths(int pow, god_type god) +bool cast_summon_wraiths(int pow, const coord_def& where, god_type god) { - bool success = false; + monsters *m = monster_at(where); - const int chance = random2(25); - monster_type mon = ((chance > 8) ? MONS_WRAITH : // 64% - (chance > 3) ? MONS_FREEZING_WRAITH // 20% - : MONS_SPECTRAL_WARRIOR); // 16% + if (m == NULL) + { + mpr("An evil force gathers but it quickly dissipates."); + return (true); + } + int mi = monster_index(m); + ASSERT(!(invalid_monster_index(mi))); - bool friendly = (random2(pow) > 5); + if (stop_attack_prompt(m, false, you.pos())) + return false; - const int monster = - create_monster( - mgen_data(mon, - friendly ? BEH_FRIENDLY : BEH_HOSTILE, - 5, SPELL_SUMMON_WRAITHS, - you.pos(), MHITYOU, MG_FORCE_BEH, god)); + bool friendly = true; + int success = 0; + int to_summon = stepdown_value(2 + (random2(pow) / 10) + (random2(pow) / 10), + 2, 2, 6, -1); - if (monster != -1) + while(to_summon--) { - success = true; + const int chance = random2(25); + monster_type mon = ((chance > 22) ? MONS_PHANTOM : // 8% + (chance > 20) ? MONS_HUNGRY_GHOST : // 8% + (chance > 18) ? MONS_FLAYED_GHOST : // 8% + (chance > 7) ? MONS_WRAITH : // 44%/40% + (chance > 2) ? MONS_FREEZING_WRAITH // 20%/16% + : MONS_SPECTRAL_WARRIOR); // 12% + if ((chance == 3 || chance == 8) && player_see_invis()) + mon = MONS_SHADOW_WRAITH; // 0%/8% + + const int monster = + create_monster( + mgen_data(mon, + BEH_FRIENDLY, + 5, SPELL_SUMMON_WRAITHS, + where, mi, MG_FORCE_BEH, god)); + + if (monster != -1) + { + success++; - if (player_angers_monster(&menv[monster])) - friendly = false; + if (player_angers_monster(&menv[monster])) + friendly = false; + } + } + if (success > 1) + mpr(friendly ? "Insubstantial figures form in the air." + : "You sense hostile presences."); + else if (success) mpr(friendly ? "An insubstantial figure forms in the air." : "You sense a hostile presence."); - } else canned_msg(MSG_NOTHING_HAPPENS); diff --git a/crawl-ref/source/spells3.h b/crawl-ref/source/spells3.h index f4b01a82b3..0bbe327f6a 100644 --- a/crawl-ref/source/spells3.h +++ b/crawl-ref/source/spells3.h @@ -61,7 +61,7 @@ int animate_dead(actor *caster, int pow, beh_type beha, unsigned short hitting, bool cast_simulacrum(int pow, god_type god = GOD_NO_GOD); bool cast_twisted_resurrection(int pow, god_type god = GOD_NO_GOD); -bool cast_summon_wraiths(int pow, god_type god = GOD_NO_GOD); +bool cast_summon_wraiths(int pow, const coord_def& where, god_type god = GOD_NO_GOD); bool cast_death_channel(int pow, god_type god = GOD_NO_GOD); void you_teleport(); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index b4edf1fb05..295a3bf957 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1726,7 +1726,7 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail) break; case SPELL_SUMMON_WRAITHS: - cast_summon_wraiths(powc, god); + cast_summon_wraiths(powc, beam.target, god); break; case SPELL_DEATH_CHANNEL: diff --git a/crawl-ref/source/spl-data.h b/crawl-ref/source/spl-data.h index cdfc92696b..bc28ababf3 100644 --- a/crawl-ref/source/spl-data.h +++ b/crawl-ref/source/spl-data.h @@ -856,12 +856,12 @@ }, { - SPELL_SUMMON_WRAITHS, "Summon Wraiths", - SPTYP_NECROMANCY | SPTYP_SUMMONING, - SPFLAG_BATTLE, + SPELL_SUMMON_WRAITHS, "Haunt", + SPTYP_NECROMANCY, + SPFLAG_TARGET | SPFLAG_NOT_SELF, 7, 200, - -1, -1, + LOS_RADIUS, LOS_RADIUS, 0, NULL, false, |