summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/xom.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-08-13 20:36:56 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-08-13 20:36:56 +0000
commit309c246160be3d3cdc6c39fcf089e8e3ad3a622e (patch)
treeaf370bb522302bab481f7fa1fdf924e5549ddb2f /crawl-ref/source/xom.cc
parente9181a121c71a972c33ecc9420234672cd88689f (diff)
downloadcrawl-ref-309c246160be3d3cdc6c39fcf089e8e3ad3a622e.tar.gz
crawl-ref-309c246160be3d3cdc6c39fcf089e8e3ad3a622e.zip
Remove four scroll-duplicate spells: Detect Curse, Remove Curse,
Magic Mapping, and Identify. [*] This leaves six spells in the Divinations school, of which Forescry and See Invisible could easily be moved to other schools; Detect Secret Doors could be removed; and Detect Traps/Items/Creatures should be moved to some kind of misc. item with charges (whether rechargeable or not). I didn't want to remove those until the replacement code is in. I added a hack to make sure the probabilities of Xom "casting" magic mapping remain the same. That will have to be repaired later, preferrably by handling it together with Detect Items/Creatures as a separate Xom effect. Shifts spells in saves and bones files. *) This is different from the recent addition of the scroll of silence in that these four spells pose no risk whatsoever and can be spammed safely, making even the food and magic costs negligible. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10542 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r--crawl-ref/source/xom.cc31
1 files changed, 29 insertions, 2 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index c21a8c9be4..f4ff2c7c28 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -60,11 +60,14 @@ REVISION("$Rev$");
// I filtered some out, especially conjurations. Then I sorted them in
// roughly ascending order of power.
+// Define fake magic mapping spell to keep the old behaviour.
+#define FAKE_SPELL_MAGIC_MAPPING SPELL_NO_SPELL
+
// Spells to be cast at tension 0 (no or only low-level monsters around),
// mostly flavour.
static const spell_type _xom_nontension_spells[] =
{
- SPELL_MAGIC_MAPPING, SPELL_DETECT_ITEMS, SPELL_SUMMON_BUTTERFLIES,
+ FAKE_SPELL_MAGIC_MAPPING, SPELL_DETECT_ITEMS, SPELL_SUMMON_BUTTERFLIES,
SPELL_DETECT_CREATURES, SPELL_FLY, SPELL_SPIDER_FORM,
SPELL_STATUE_FORM, SPELL_ICE_FORM, SPELL_DRAGON_FORM, SPELL_NECROMUTATION
};
@@ -491,7 +494,7 @@ static bool _xom_makes_you_cast_random_spell(int sever, int tension)
spellenum = std::min(nxomspells, std::max(3 + coinflip(), spellenum));
spell = _xom_nontension_spells[random2(spellenum)];
- if (spell == SPELL_MAGIC_MAPPING || spell == SPELL_DETECT_ITEMS)
+ if (spell == FAKE_SPELL_MAGIC_MAPPING || spell == SPELL_DETECT_ITEMS)
{
// If the level is already mostly explored, there's
// a chance we might try something else.
@@ -500,6 +503,30 @@ static bool _xom_makes_you_cast_random_spell(int sever, int tension)
return (false);
}
}
+
+ // Handle magic mapping specially, now it's no longer a spell.
+ if (spell == FAKE_SPELL_MAGIC_MAPPING)
+ {
+ if (you.level_type == LEVEL_PANDEMONIUM)
+ return (false);
+
+ god_speaks(GOD_XOM, _get_xom_speech("spell effect").c_str());
+
+#if defined(DEBUG_DIAGNOSTICS) || defined(DEBUG_RELIGION) || defined(DEBUG_XOM)
+ mprf(MSGCH_DIAGNOSTICS,
+ "_xom_makes_you_cast_random_spell(); spell: %d, spellenum: %d",
+ spell, spellenum);
+#endif
+
+ take_note(Note(NOTE_XOM_EFFECT, you.piety, tension, "magic mapping"),
+ true);
+
+ const int power = stepdown_value( sever, 10, 10, 40, 45 );
+ magic_mapping( 5 + power, 50 + random2avg( power * 2, 2 ), false );
+
+ return (true);
+ }
+
// Don't attempt to cast spells the undead cannot memorise.
if (you_cannot_memorise(spell))
return (false);