diff options
-rw-r--r-- | crawl-ref/source/it_use3.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/spells2.cc | 18 | ||||
-rw-r--r-- | crawl-ref/source/spells2.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/spells3.cc | 33 | ||||
-rw-r--r-- | crawl-ref/source/spells3.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 35 |
6 files changed, 49 insertions, 44 deletions
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index 60e0aacb91..27f69159c3 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -225,7 +225,7 @@ void special_wielded() case SPWLD_SHADOW: if (random2(8) <= player_spec_death()) { - summon_shadow(); + summon_shadows(1); did_god_conduct(DID_NECROMANCY, 1); } diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 3a0bffba35..2d404b801d 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -971,14 +971,24 @@ char burn_freeze(int pow, beam_type flavour) return 1; } -bool summon_spatial_vortex(bool god_gift) +bool summon_spatial_vortices(int how_many, bool god_gift) { + bool success = false; + mpr("Space twists in upon itself!"); - return (create_monster( + for (int i = 0; i < how_many; ++i) + { + if (create_monster( mgen_data(MONS_SPATIAL_VORTEX, BEH_HOSTILE, - 3, you.pos(), - MHITYOU, (god_gift ? MG_GOD_GIFT : 0))) != -1); + 3, you.pos(), MHITYOU, + (god_gift ? MG_GOD_GIFT : 0) | MG_FORCE_BEH)) != -1) + { + success = true; + } + } + + return (success); } bool summon_animals(int pow) diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index 356d1cbb02..eea2a1e549 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -152,7 +152,7 @@ bool summon_daeva(int pow, bool god_gift = false); /* *********************************************************************** * called from: spell * *********************************************************************** */ -bool summon_spatial_vortex(bool god_gift = false); +bool summon_spatial_vortices(int how_many, bool god_gift = false); bool summon_animals(int pow); diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 8c9ee35340..7750320fdf 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -413,14 +413,33 @@ bool cast_sublimation_of_blood(int pow) return (success); } -bool summon_shadow(bool god_gift, bool force_hostile) +bool summon_shadows(int how_many, bool god_gift, + bool force_hostile) { - return (create_monster( - mgen_data(MONS_SHADOW, - !force_hostile ? BEH_FRIENDLY : BEH_HOSTILE, - 2, you.pos(), - !force_hostile ? you.pet_target : MHITYOU, - (god_gift ? MG_GOD_GIFT : 0))) != -1); + bool success = false; + + mpr(how_many > 1 ? "Flickering shadows surround you." + : "A nearby shadow flickers."); + + for (int i = 0; i < how_many; ++i) + { + int monster = + create_monster( + mgen_data(MONS_SHADOW, + !force_hostile ? BEH_FRIENDLY : BEH_HOSTILE, + 2, you.pos(), + !force_hostile ? you.pet_target : MHITYOU, + (god_gift ? MG_GOD_GIFT : 0) | MG_FORCE_BEH)); + + if (monster != -1) + { + success = true; + + player_angers_monster(&menv[monster]); + } + } + + return (success); } bool cast_call_imp(int pow, bool god_gift) diff --git a/crawl-ref/source/spells3.h b/crawl-ref/source/spells3.h index e7817c7575..3eefd5dcd3 100644 --- a/crawl-ref/source/spells3.h +++ b/crawl-ref/source/spells3.h @@ -113,7 +113,8 @@ bool remove_curse(bool suppress_msg); * *********************************************************************** */ bool cast_sublimation_of_blood(int pow); -bool summon_shadow(bool god_gift = false, bool force_hostile = false); +bool summon_shadows(int how_many, bool god_gift = false, + bool force_hostile = false); bool cast_call_imp(int pow, bool god_gift = false); bool summon_lesser_demon(int pow, bool god_gift = false); bool summon_common_demon(int pow, bool god_gift = false); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 3d6e55240c..97f47ff026 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2369,7 +2369,7 @@ static void _miscast_translocation(int severity, const char* cause) ouch(4 + random2avg(7, 2), 0, KILLED_BY_WILD_MAGIC, cause); break; case 5: - summon_spatial_vortex(); + summon_spatial_vortices(1); break; } break; @@ -2396,16 +2396,7 @@ static void _miscast_translocation(int severity, const char* cause) potion_effect(POT_CONFUSION, 40); break; case 5: - mpr("Space twists in upon itself!"); - { - const int count = 2 + random2(3); - for (int i = 0; i < count; ++i) - { - create_monster( - mgen_data(MONS_SPATIAL_VORTEX, BEH_HOSTILE, 3, - you.pos(), MHITYOU)); - } - } + summon_spatial_vortices(2 + random2(3)); break; case 6: _send_abyss(cause); @@ -2414,7 +2405,6 @@ static void _miscast_translocation(int severity, const char* cause) break; case 3: // much less harmless - switch (random2(4)) { case 0: @@ -2492,11 +2482,9 @@ static void _miscast_summoning(int severity, const char* cause) mpr("You are caught in a localised spatial distortion."); ouch(5 + random2avg(9, 2), 0, KILLED_BY_WILD_MAGIC, cause); break; - case 3: - summon_spatial_vortex(); + summon_spatial_vortices(1); break; - case 4: case 5: if (create_monster( @@ -2513,16 +2501,7 @@ static void _miscast_summoning(int severity, const char* cause) switch (random2(6)) { case 0: - mpr("Space twists in upon itself!"); - { - const int count = 2 + random2(3); - for (int i = 0; i < count; ++i) - { - create_monster( - mgen_data(MONS_SPATIAL_VORTEX, - BEH_HOSTILE, 3, you.pos(), MHITYOU)); - } - } + summon_spatial_vortices(2 + random2(3)); break; case 1: @@ -2811,11 +2790,7 @@ static void _miscast_necromancy(int severity, const char* cause) switch (random2(3)) { case 0: - mpr("Flickering shadows surround you."); - - for (int i = random2(3); i >= 0; --i) - summon_shadow(false, true); - + summon_shadows(random2(3) + 1, true); break; case 1: |