summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-24 13:19:24 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-24 13:19:24 +0000
commit35129e9e324fd6464cb8799edfca960881a0dd09 (patch)
tree24eff7f35548be23e04afcdd6462f0580bd0c287 /crawl-ref/source/spl-cast.cc
parentc19b2fdd21ba70ded0b4f42a8c7d018108d2d70d (diff)
downloadcrawl-ref-35129e9e324fd6464cb8799edfca960881a0dd09.tar.gz
crawl-ref-35129e9e324fd6464cb8799edfca960881a0dd09.zip
[1757174] Disallow mapping in labyrinths.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2536 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r--crawl-ref/source/spl-cast.cc17
1 files changed, 14 insertions, 3 deletions
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);
}