diff options
author | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-06-29 16:59:35 -0700 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-06-29 17:00:46 -0700 |
commit | 8835e0aa838701c728fa6eaec30e74ab7681ddf7 (patch) | |
tree | 7e0cbcf2b5bd4f7f70ecb47f019403ea80c89b85 /crawl-ref/source/directn.cc | |
parent | fe1f5a6b0eb699d5d39957b9dfe40f2e5214d6a0 (diff) | |
download | crawl-ref-8835e0aa838701c728fa6eaec30e74ab7681ddf7.tar.gz crawl-ref-8835e0aa838701c728fa6eaec30e74ab7681ddf7.zip |
Improve beogh gift-giving UI
Allow iteration with +-, and auto-abort if there are no
valid targets in LOS.
It'd be nice if this still included the "valid target"
highlight that the last version had...
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r-- | crawl-ref/source/directn.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 130b18c617..be8ac949ff 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -1055,6 +1055,8 @@ bool direction_chooser::find_default_monster_target(coord_def& result) const && mons_is_evolvable(mons_target) || mode == TARG_HOSTILE_UNDEAD && !mons_target->friendly() && mons_target->holiness() == MH_UNDEAD + || mode == TARG_BEOGH_GIFTABLE + && !beogh_can_gift_items_to(mons_target) || mode == TARG_INJURED_FRIEND && (mons_target->friendly() && mons_get_damage_level(mons_target) > MDAM_OKAY || (!mons_target->wont_attack() @@ -1128,6 +1130,7 @@ coord_def direction_chooser::find_default_target() const else if (mode == TARG_ENEMY || mode == TARG_HOSTILE || mode == TARG_HOSTILE_SUBMERGED || mode == TARG_EVOLVABLE_PLANTS + || mode == TARG_BEOGH_GIFTABLE || mode == TARG_HOSTILE_UNDEAD || mode == TARG_INJURED_FRIEND || (mode == TARG_ANY || mode == TARG_FRIEND) && cancel_at_self) @@ -2410,6 +2413,9 @@ static bool _want_target_monster(const monster *mon, int mode) if (mode == TARG_HOSTILE_UNDEAD) return !mon->friendly() && mon->holiness() == MH_UNDEAD; + if (mode == TARG_BEOGH_GIFTABLE) + return beogh_can_gift_items_to(mon); + ASSERT(mode == TARG_ENEMY); if (mon->friendly()) return false; |