From 8aec1a6bc351ddeee0605028e718436a1804ca62 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 15 Nov 2009 20:09:46 +1000 Subject: 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. --- crawl-ref/source/files.cc | 29 +++++++++++++++++++++++++++++ crawl-ref/source/mon-stuff.cc | 3 +++ 2 files changed, 32 insertions(+) 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) diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index 67690b0a84..2a171f7a75 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -1110,6 +1110,9 @@ static void _elven_twin_died(monsters* twin) if (!found_duvessa && !found_dowan) return; + // Okay, let them climb stairs now. + monster->props["can_climb"] = "yes"; + // If you've stabbed one of them, the other one is likely asleep still. if (monster->asleep()) behaviour_event(monster, ME_DISTURB, MHITNOT, monster->pos()); -- cgit v1.2.3-54-g00ecf