diff options
author | Steve Melenchuk <smelenchuk@gmail.com> | 2014-04-05 17:55:46 -0600 |
---|---|---|
committer | Steve Melenchuk <smelenchuk@gmail.com> | 2014-05-07 18:23:22 -0600 |
commit | 4ee74b775d0df24ae970870f51aab3ca2f884081 (patch) | |
tree | def4d5fbf389c06a6259a8696a7ec86b186bb811 /crawl-ref/source/dactions.cc | |
parent | 370b73db21adefc530e03f585cd63096bbf607ed (diff) | |
download | crawl-ref-4ee74b775d0df24ae970870f51aab3ca2f884081.tar.gz crawl-ref-4ee74b775d0df24ae970870f51aab3ca2f884081.zip |
Gozag: Don't let bribes take effect until the player spots the monster.
Prevents abuses like clearing out the Orc:$ end entirely offscreen; also
gives the opportunity for some nice dialogue.
Diffstat (limited to 'crawl-ref/source/dactions.cc')
-rw-r--r-- | crawl-ref/source/dactions.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/dactions.cc b/crawl-ref/source/dactions.cc index ee032b0b3b..8c16aeb6ac 100644 --- a/crawl-ref/source/dactions.cc +++ b/crawl-ref/source/dactions.cc @@ -127,7 +127,10 @@ bool mons_matches_daction(const monster* mon, daction_type act) case DACT_BRIBE_TIMEOUT: return mon->has_ench(ENCH_BRIBED) - || !you_worship(GOD_GOZAG) && mon->has_ench(ENCH_PERMA_BRIBED); + || mon->props.exists(GOZAG_BRIBE_KEY) + || !you_worship(GOD_GOZAG) + && (mon->has_ench(ENCH_PERMA_BRIBED) + || mon->props.exists(GOZAG_PERMABRIBE_KEY)); default: return false; @@ -235,8 +238,14 @@ void apply_daction_to_mons(monster* mon, daction_type act, bool local, case DACT_BRIBE_TIMEOUT: mon->del_ench(ENCH_BRIBED); + if (mon->props.exists(GOZAG_BRIBE_KEY)) + mon->props.erase(GOZAG_BRIBE_KEY); if (!you_worship(GOD_GOZAG)) + { mon->del_ench(ENCH_PERMA_BRIBED); + if (mon->props.exists(GOZAG_PERMABRIBE_KEY)) + mon->props.erase(GOZAG_PERMABRIBE_KEY); + } break; // The other dactions do not affect monsters directly. |