summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-03 20:21:50 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-03 20:21:50 +0000
commit02a23f0ae54f800e42a987a6080b2d37b87aebc5 (patch)
tree31c4508b80a3eb20184dbea48316f4977bc5266b /crawl-ref/source/directn.cc
parent2d1dc73ba81562198242670c328146d3f13695c6 (diff)
downloadcrawl-ref-02a23f0ae54f800e42a987a6080b2d37b87aebc5.tar.gz
crawl-ref-02a23f0ae54f800e42a987a6080b2d37b87aebc5.zip
Implement a hack to differentiate between Ely's self healing and healing
others. I've added a new targetting mode TARG_NOT_SELF that basically just forces the autotargetting to skip the player in favour of the previous target or, failing that, the nearest monster (no matter whether friendly, hostile or neutral). Both types of ability crop up at the same piety point, and the ability letters are changed accordingly (which is likely to wreak havoc on those relying on their finger memory, but makes more sense and is easier to remember in the long run). I haven't changed/added the ability descriptions. If someone could do that, please? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9575 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 4926bffab3..e95e57787e 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -1048,14 +1048,15 @@ void direction(dist& moves, targeting_type restricts,
bool target_unshifted = Options.target_unshifted_dirs;
// Find a default target.
- if (Options.default_target && mode == TARG_ENEMY)
+ if (Options.default_target && (mode == TARG_ENEMY || mode == TARG_NOT_SELF))
{
skip_iter = true; // Skip first iteration...XXX mega-hack
if (you.prev_targ != MHITNOT && you.prev_targ != MHITYOU)
{
const monsters *montarget = &menv[you.prev_targ];
if (you.can_see(montarget)
- && !mons_friendly(montarget) // not made friendly since then
+ // not made friendly since then
+ && (mode == TARG_NOT_SELF || !mons_friendly(montarget))
&& _is_target_in_range(montarget->pos(), range))
{
found_autotarget = true;
@@ -2003,7 +2004,7 @@ static bool _find_monster( const coord_def& where, int mode, bool need_path,
return (false);
// Now compare target modes.
- if (mode == TARG_ANY)
+ if (mode == TARG_ANY || mode == TARG_NOT_SELF)
return (true);
if (mode == TARG_FRIEND)