From 35129e9e324fd6464cb8799edfca960881a0dd09 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Wed, 24 Oct 2007 13:19:24 +0000 Subject: [1757174] Disallow mapping in labyrinths. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2536 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spl-cast.cc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/spl-cast.cc') diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index e665d1d4d1..335aa9003e 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -944,7 +944,18 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) dec_penance(GOD_SIF_MUNA, 1); } - if (spfl < spell_fail(spell)) + const int spfail_chance = spell_fail(spell); + // Divination mappings backfire in Labyrinths. + if (you.level_type == LEVEL_LABYRINTH + && testbits(flags, SPFLAG_MAPPING)) + { + mprf(MSGCH_WARN, + "The warped magic of this place twists your " + "spell in on itself!"); + spfl = spfail_chance / 2 - 1; + } + + if (spfl < spfail_chance) { spellcasting_side_effects(spell, true); @@ -972,14 +983,14 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) // spells can be quite nasty: 9 * 9 * 90 / 500 = 15 // points of contamination! int nastiness = spell_mana(spell) * spell_mana(spell) - * (spell_fail(spell) - spfl) + 250; + * (spfail_chance - spfl) + 250; const int cont_points = div_rand_round(nastiness, 500); contaminate_player( cont_points ); miscast_effect( sptype, spell_mana(spell), - spell_fail(spell) - spfl, 100 ); + spfail_chance - spfl, 100 ); return (SPRET_FAIL); } -- cgit v1.2.3-54-g00ecf