diff options
author | Chris Campbell <chriscampbell89@gmail.com> | 2013-10-21 13:40:32 +0100 |
---|---|---|
committer | Chris Campbell <chriscampbell89@gmail.com> | 2013-10-21 13:43:53 +0100 |
commit | f1e46e676c67f6c93aaf2728423c56e93656ae71 (patch) | |
tree | 11e362036eb1333c2323092efccbb2808de1c006 /crawl-ref/source/directn.cc | |
parent | ca6a7715978349a647e4de719f16852b161a85d7 (diff) | |
download | crawl-ref-f1e46e676c67f6c93aaf2728423c56e93656ae71.tar.gz crawl-ref-f1e46e676c67f6c93aaf2728423c56e93656ae71.zip |
Fix Mephitic Cloud and Poisonous Cloud never prompting when aimed at self
Spells with SPFLAG_ALLOW_SELF are sometimes useful to aim at the player's
square, but that doesn't mean that they should do so with no prompt, since
they are still more likely to be harmful than not.
The ALLOW_SELF flag now just allows such spells to be self-targeted (with
a prompt) even when Options.allow_self_target is set to CONFIRM_CANCEL.
Currently the spells affected are Mephitic Cloud, Poisonous Cloud,
Freezing Cloud. Other AoE spells like Fireball, Fire Storm, Ice Storm
might feasibly be self-targeted but these seem significantly less likely
to be used in that way.
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r-- | crawl-ref/source/directn.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 7a049f8b35..3f0e042b42 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -962,23 +962,23 @@ bool direction_chooser::move_is_ok() const if (looking_at_you()) { - // may_target_self == makes (some) sense to target yourself - // (SPFLAG_AREA) + // may_target_self == sometimes makes sense to target yourself, + // but should still give a prompt (SPFLAG_ALLOW_SELF) // cancel_at_self == not allowed to target yourself // (SPFLAG_NOT_SELF) - if (!may_target_self && restricts != DIR_TARGET_OBJECT + if (restricts != DIR_TARGET_OBJECT && (mode == TARG_ENEMY || mode == TARG_HOSTILE || mode == TARG_HOSTILE_SUBMERGED || mode == TARG_HOSTILE_UNDEAD)) { - if (cancel_at_self || Options.allow_self_target == CONFIRM_CANCEL) + if (!may_target_self && (cancel_at_self || Options.allow_self_target == CONFIRM_CANCEL)) { mpr("That would be overly suicidal.", MSGCH_EXAMINE_FILTER); return false; } - else if (Options.allow_self_target == CONFIRM_PROMPT) + else if (Options.allow_self_target != CONFIRM_NONE) return yesno("Really target yourself?", false, 'n'); } |