From 2de657642dded89bf7f04024b5e7f6eb4a00a18a Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 13 Aug 2009 10:25:22 +0000 Subject: FR 2819565: Abort when trying to read a known ?blinking or ?teleportation or when zapping a known /teleportation at yourself if you know you have a -TELE artefact equipped. In the same situation, prompt when trying to evoke Blink or cast one of the teleportation spells, in case the player insists on training Evoc/Spellcasting/Translocations that way. Also, automatically update the autoinscriptions when tweaking artefact properties in wizard mode. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10532 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spl-cast.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (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 0d6b7ed2b1..f549179ac8 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -279,7 +279,16 @@ int list_spells(bool toggle_with_I, bool viewing, int minRange) { const char letter = index_to_letter(i); const spell_type spell = get_spell_by_letter(letter); - if (!viewing) + + // If an equipped artefact prevents teleportation, the following spells + // cannot be cast. + if ((spell == SPELL_BLINK || spell == SPELL_CONTROLLED_BLINK + || spell == SPELL_TELEPORT_SELF) + && scan_artefacts(ARTP_PREVENT_TELEPORTATION, false)) + { + grey = true; + } + else if (!viewing) { if (spell_mana(spell) > you.magic_points || _spell_no_hostile_in_range(spell, minRange)) @@ -1128,6 +1137,14 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail) if (!wiz_cast && _spell_is_uncastable(spell)) return (SPRET_ABORT); + if ((spell == SPELL_BLINK || spell == SPELL_CONTROLLED_BLINK + || spell == SPELL_TELEPORT_SELF) + && scan_artefacts(ARTP_PREVENT_TELEPORTATION, false) + && !yesno("You cannot teleport right now. Cast anyway?", true, 'n')) + { + return (SPRET_ABORT); + } + const unsigned int flags = get_spell_flags(spell); ASSERT(wiz_cast || !(flags & SPFLAG_TESTING)); -- cgit v1.2.3-54-g00ecf