summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-28 08:47:30 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-28 08:47:30 +0000
commit20a6609453ee2b51c388c296516c1abc1beab1d2 (patch)
tree201d735a3a4d66471005cb763078a6c05056752c /crawl-ref/source/spells3.cc
parent7aed4c41d7fa0f9d70df56a82abbe69061e56269 (diff)
downloadcrawl-ref-20a6609453ee2b51c388c296516c1abc1beab1d2.tar.gz
crawl-ref-20a6609453ee2b51c388c296516c1abc1beab1d2.zip
Preliminary integration of Zooko's Xom patch (untested).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1489 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index a3277a4a17..548aa5de9f 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -40,6 +40,7 @@
#include "mon-util.h"
#include "player.h"
#include "randart.h"
+#include "religion.h"
#include "spells1.h"
#include "spells4.h"
#include "spl-cast.h"
@@ -590,7 +591,7 @@ void you_teleport(void)
return;
} // end you_teleport()
-void you_teleport2( bool allow_control, bool new_abyss_area )
+static bool teleport_player( bool allow_control, bool new_abyss_area )
{
bool is_controlled = (allow_control && !you.conf
&& player_control_teleport()
@@ -599,7 +600,7 @@ void you_teleport2( bool allow_control, bool new_abyss_area )
if (scan_randarts(RAP_PREVENT_TELEPORTATION))
{
mpr("You feel a strange sense of stasis.");
- return;
+ return false;
}
// after this point, we're guaranteed to teleport. Kill the appropriate
@@ -616,7 +617,7 @@ void you_teleport2( bool allow_control, bool new_abyss_area )
{
abyss_teleport( new_abyss_area );
you.pet_target = MHITNOT;
- return;
+ return true;
}
FixedVector < int, 2 > plox;
@@ -693,7 +694,17 @@ void you_teleport2( bool allow_control, bool new_abyss_area )
|| mgrd[you.x_pos][you.y_pos] != NON_MONSTER
|| env.cgrid[you.x_pos][you.y_pos] != EMPTY_CLOUD);
}
-} // end you_teleport()
+ return !is_controlled;
+}
+
+void you_teleport_now( bool allow_control, bool new_abyss_area )
+{
+ const bool randtele = teleport_player(allow_control, new_abyss_area);
+ // Xom is amused by uncontrolled teleports that land you in a
+ // dangerous place.
+ if (randtele && player_in_a_dangerous_place())
+ xom_is_stimulated(255);
+}
bool entomb(void)
{