diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-04 18:06:05 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-04 18:06:05 +0000 |
commit | c8abbb6f1236d147674c8d88065b8400756ce686 (patch) | |
tree | 922e3d30273cfa94ef2efc4b3f04642d459a4c4f /crawl-ref/source | |
parent | c6ae3ddc627c3d8a2300ed6ca5afb62baf7db018 (diff) | |
download | crawl-ref-c8abbb6f1236d147674c8d88065b8400756ce686.tar.gz crawl-ref-c8abbb6f1236d147674c8d88065b8400756ce686.zip |
* Change TARG_NOT_SELF to TARG_HOSTILE (not to confused with TARG_ENEMY
that also includes neutral monsters) for Ely's Heal Other powers.
* Update change log.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9579 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/abl-show.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/directn.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/xom.cc | 3 |
4 files changed, 17 insertions, 11 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index d7a2d1e501..a9fea0082f 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1690,7 +1690,7 @@ static bool _do_ability(const ability_def& abil) const bool self = (abil.ability == ABIL_ELYVILON_LESSER_HEALING_SELF); if (cast_healing(3 + (you.skills[SK_INVOCATIONS] / 6), true, self ? you.pos() : coord_def(0,0), - self ? TARG_NUM_MODES : TARG_NOT_SELF) < 0) + self ? TARG_NUM_MODES : TARG_HOSTILE) < 0) { return (false); } @@ -1709,7 +1709,7 @@ static bool _do_ability(const ability_def& abil) const bool self = (abil.ability == ABIL_ELYVILON_GREATER_HEALING_SELF); if (cast_healing(10 + (you.skills[SK_INVOCATIONS] / 3), true, self ? you.pos() : coord_def(0,0), - self ? TARG_NUM_MODES : TARG_NOT_SELF) < 0) + self ? TARG_NUM_MODES : TARG_HOSTILE) < 0) { return (false); } diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index e95e57787e..a151b45e99 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -1048,7 +1048,7 @@ 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 || mode == TARG_NOT_SELF)) + if (Options.default_target && (mode == TARG_ENEMY || mode == TARG_HOSTILE)) { skip_iter = true; // Skip first iteration...XXX mega-hack if (you.prev_targ != MHITNOT && you.prev_targ != MHITYOU) @@ -1056,7 +1056,8 @@ void direction(dist& moves, targeting_type restricts, const monsters *montarget = &menv[you.prev_targ]; if (you.can_see(montarget) // not made friendly since then - && (mode == TARG_NOT_SELF || !mons_friendly(montarget)) + && (mons_attitude(montarget) == ATT_HOSTILE + || mode == TARG_ENEMY && !mons_friendly(montarget)) && _is_target_in_range(montarget->pos(), range)) { found_autotarget = true; @@ -1330,9 +1331,10 @@ void direction(dist& moves, targeting_type restricts, case CMD_TARGET_CYCLE_TARGET_MODE: mode = static_cast<targ_mode_type>((mode + 1) % TARG_NUM_MODES); mprf( "Targeting mode is now: %s", - (mode == TARG_ANY) ? "any" : - (mode == TARG_ENEMY) ? "enemies" - : "friends" ); + (mode == TARG_ANY) ? "any" : + (mode == TARG_ENEMY) ? "enemies" : + (mode == TARG_HOSTILE) ? "hostiles" + : "friends" ); break; case CMD_TARGET_PREV_TARGET: @@ -2004,9 +2006,12 @@ static bool _find_monster( const coord_def& where, int mode, bool need_path, return (false); // Now compare target modes. - if (mode == TARG_ANY || mode == TARG_NOT_SELF) + if (mode == TARG_ANY) return (true); + if (mode == TARG_HOSTILE) + return (mons_attitude(mon) == ATT_HOSTILE); + if (mode == TARG_FRIEND) return (mons_friendly(mon)); diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index dc1e511346..8420349fb3 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1584,9 +1584,9 @@ enum mon_holy_type enum targ_mode_type { TARG_ANY, - TARG_ENEMY, + TARG_ENEMY, // hostile + neutral TARG_FRIEND, - TARG_NOT_SELF, + TARG_HOSTILE, TARG_NUM_MODES }; diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 82abc823f1..66745cc71c 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -280,7 +280,8 @@ void xom_tick() xom_acts(abs(you.piety - MAX_PIETY/2), tension); return; } - else if (you.gift_timeout <= 1 && x_chance_in_y(chance-1, 4)) + else if (you.gift_timeout <= 1 && chance > 0 + && x_chance_in_y(chance-1, 4)) { // During tension, Xom may briefly forget about being bored. const int interest = random2(chance*15); |