diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-15 20:09:46 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-15 20:35:49 +1000 |
commit | 8aec1a6bc351ddeee0605028e718436a1804ca62 (patch) | |
tree | d1933a0df9f657f1dff0765b18d0a5bb6133f871 /crawl-ref/source/files.cc | |
parent | 047483716aeb3349cba7228270b5ca0d38c7e9ec (diff) | |
download | crawl-ref-8aec1a6bc351ddeee0605028e718436a1804ca62.tar.gz crawl-ref-8aec1a6bc351ddeee0605028e718436a1804ca62.zip |
Duvessa and Dowan death effect changes (dpeg).
As suggested by dpeg, they will now only climb the stairs as a pair, or
if one of them is already dead. This is slightly scummable, but they
still get a free turn against you.
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r-- | crawl-ref/source/files.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 5f32136ae6..ee78c2a02c 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -1055,6 +1055,8 @@ static void _grab_followers() const bool can_follow = level_type_allows_followers(you.level_type); int non_stair_using_allies = 0; + monsters *dowan = NULL; + monsters *duvessa = NULL; // Handle nearby ghosts. for (adjacent_iterator ai(you.pos()); ai; ++ai) @@ -1063,6 +1065,12 @@ static void _grab_followers() if (fmenv == NULL) continue; + if (fmenv->type == MONS_DUVESSA && fmenv->alive()) + duvessa = fmenv; + + if (fmenv->type == MONS_DOWAN && fmenv->alive()) + dowan = fmenv; + if (fmenv->wont_attack() && !mons_can_use_stairs(fmenv)) non_stair_using_allies++; @@ -1075,6 +1083,27 @@ static void _grab_followers() } } + // Deal with Dowan and Duvessa here. + if (dowan && duvessa) + { + if (!testbits(dowan->flags, MF_TAKING_STAIRS) + || !testbits(duvessa->flags, MF_TAKING_STAIRS)) + { + dowan->flags &= ~MF_TAKING_STAIRS; + duvessa->flags &= ~MF_TAKING_STAIRS; + } + } + else if (dowan && !duvessa) + { + if (!dowan->props.exists("can_climb")) + dowan->flags &= ~MF_TAKING_STAIRS; + } + else if (!dowan && duvessa) + { + if (!duvessa->props.exists("can_climb")) + duvessa->flags &= ~MF_TAKING_STAIRS; + } + if (can_follow) { if (non_stair_using_allies > 0) |