summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/xom.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-29 22:59:35 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-29 22:59:35 +0000
commit63036c9e5ed0103475fea0c6710317f15e8cdb24 (patch)
treec6e731b631741fc069a6baeb80bf15c58458e9e0 /crawl-ref/source/xom.cc
parente744cede0540585248737db8e27a8320e5476955 (diff)
downloadcrawl-ref-63036c9e5ed0103475fea0c6710317f15e8cdb24.tar.gz
crawl-ref-63036c9e5ed0103475fea0c6710317f15e8cdb24.zip
Implemented monster spell miscasts. Spell miscasting is now handled
by the MiscastEffect class, which has helper methods to make most of the non-helper code agnostic with respect to whether the miscaster is the player or a monster. Mummy death curses now affect monsters, and Zot traps now directly affect friendly and good-neutral monsters. In wizard mode you can force the player or a monster to miscast by targeting it and pressing 'M'. Todo/issues/notes: * Clouds now have a killer_type in addition to a kill_category. * There aren't any divination monster miscast effects yet. * Many of the harmless message-only miscast effects are missing monster messages. * If a monster actually miscasts a spell (not getting a mummy death curse or setting off a Zot trap) and this kills both the monster and the player then the wrong monster will be listed in hiscore entry. Since monsters can't do true spell miscasts yet, this can wait. * There was old, non-functioning code making Zot traps heal, haste or turn invisible hostile monsters that triggered it. I fixed it and then commented it out. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6723 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r--crawl-ref/source/xom.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index d91f1e42a8..bd25195742 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -29,6 +29,7 @@
#include "religion.h"
#include "spells2.h"
#include "spl-cast.h"
+#include "spl-mis.h"
#include "spl-util.h"
#include "state.h"
#include "stuff.h"
@@ -739,7 +740,8 @@ static bool _xom_is_bad(int sever)
{
god_speaks(GOD_XOM, _get_xom_speech("zero miscast effect").c_str());
- miscast_effect(SPTYP_RANDOM, 0, 0, 0, "the mischief of Xom");
+ MiscastEffect(&you, -GOD_XOM, SPTYP_RANDOM, 0,
+ "the mischief of Xom");
done = true;
}
@@ -747,7 +749,7 @@ static bool _xom_is_bad(int sever)
{
god_speaks(GOD_XOM, _get_xom_speech("minor miscast effect").c_str());
- miscast_effect(SPTYP_RANDOM, 0, 0, random2(2),
+ MiscastEffect(&you, -GOD_XOM, SPTYP_RANDOM, random2(2),
"the capriciousness of Xom");
done = true;
@@ -765,7 +767,7 @@ static bool _xom_is_bad(int sever)
{
god_speaks(GOD_XOM, _get_xom_speech("medium miscast effect").c_str());
- miscast_effect(SPTYP_RANDOM, 0, 0, random2(3),
+ MiscastEffect(&you, -GOD_XOM, SPTYP_RANDOM, random2(3),
"the capriciousness of Xom");
done = true;
@@ -894,10 +896,11 @@ static bool _xom_is_bad(int sever)
}
else if (x_chance_in_y(11, sever))
{
- god_speaks(GOD_XOM, _get_xom_speech("major miscast effect").c_str());
+ god_speaks(GOD_XOM,
+ _get_xom_speech("major miscast effect").c_str());
- miscast_effect(SPTYP_RANDOM, 0, 0, random2(4),
- "the severe capriciousness of Xom");
+ MiscastEffect(&you, -GOD_XOM, SPTYP_RANDOM, random2(4),
+ "the severe capriciousness of Xom");
done = true;
}