Attached Files:
|
0001-Upgrade-Duvessa-or-Dowan-even-when-the-other-twin-di.patch [^] (1,370 bytes) 2014-06-18 23:12 [Show Content] [Hide Content]From ee9211adbab173aa32c1beabf2e4384da3083783 Mon Sep 17 00:00:00 2001
From: Mikko Vepsalainen <mtvepsal@gmail.com>
Date: Fri, 6 Jun 2014 23:57:24 +0300
Subject: [PATCH 1/3] Upgrade Duvessa or Dowan even when the other twin dies
out of sight. Fixes #7211.
---
crawl-ref/source/mon-death.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/crawl-ref/source/mon-death.cc b/crawl-ref/source/mon-death.cc
index 434503d..0ed0e99 100644
--- a/crawl-ref/source/mon-death.cc
+++ b/crawl-ref/source/mon-death.cc
@@ -2494,7 +2494,7 @@ int monster_die(monster* mons, killer_type killer,
wizard, fake);
}
}
- else if (mons_is_elven_twin(mons) && mons_near(mons))
+ else if (mons_is_elven_twin(mons))
elven_twin_died(mons, in_transit, killer, killer_index);
else if (mons->type == MONS_VAULT_WARDEN)
timeout_terrain_changes(0, true);
@@ -3171,7 +3171,7 @@ void elven_twin_died(monster* twin, bool in_transit, killer_type killer, int kil
// 'Dowan_Dowan_dies', but as neither will match, these can safely be
// ignored.
string key = mons->name(DESC_THE, true) + "_"
- + twin->name(DESC_THE) + "_dies_";
+ + twin->name(DESC_THE, true) + "_dies_";
if (mons_near(mons) && !mons->observable())
key += "invisible_";
--
1.7.9.5
0002-Dowan-s-updated-spellbook-after-her-sister-s-death-i.patch [^] (879 bytes) 2014-06-18 23:12 [Show Content] [Hide Content]From 33a0b55264dbd0b49d2bfb2df614d0151baa5a8a Mon Sep 17 00:00:00 2001
From: Mikko Vepsalainen <mtvepsal@gmail.com>
Date: Sat, 7 Jun 2014 00:39:51 +0300
Subject: [PATCH 2/3] Dowan's updated spellbook after her sister's death is
now shown in description. Fixes #8401.
---
crawl-ref/source/mon-death.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/crawl-ref/source/mon-death.cc b/crawl-ref/source/mon-death.cc
index 0ed0e99..ed30c09 100644
--- a/crawl-ref/source/mon-death.cc
+++ b/crawl-ref/source/mon-death.cc
@@ -3227,6 +3227,9 @@ void elven_twin_died(monster* twin, bool in_transit, killer_type killer, int kil
mons->spells[3] = SPELL_STONE_ARROW;
mons->spells[4] = SPELL_HASTE;
// Nothing with 6.
+
+ // Indicate that he has an updated spellbook.
+ mons->props["custom_spells"] = true;
}
}
--
1.7.9.5
0003-Duvessa-and-Dowan-cleanup.patch [^] (4,657 bytes) 2014-06-18 23:12 [Show Content] [Hide Content]From fbc6635ee2a9b328d4e6e8231fde42783c5fc193 Mon Sep 17 00:00:00 2001
From: Mikko Vepsalainen <mtvepsal@gmail.com>
Date: Sat, 7 Jun 2014 15:24:58 +0300
Subject: [PATCH 3/3] Duvessa and Dowan cleanup.
Avoid some code duplication, minor cleanup. Functional change: Dowan will haste
even when invisible, if he's near when Duvessa dies (consistent with Duvessa's
berserking).
---
crawl-ref/source/mon-death.cc | 50 ++++++++++++++++++++---------------------
crawl-ref/source/mon-death.h | 1 +
crawl-ref/source/view.cc | 17 +++++---------
3 files changed, 31 insertions(+), 37 deletions(-)
diff --git a/crawl-ref/source/mon-death.cc b/crawl-ref/source/mon-death.cc
index ed30c09..fe4df39 100644
--- a/crawl-ref/source/mon-death.cc
+++ b/crawl-ref/source/mon-death.cc
@@ -3157,7 +3157,7 @@ void elven_twin_died(monster* twin, bool in_transit, killer_type killer, int kil
return;
// Okay, let them climb stairs now.
- mons->props["can_climb"] = "yes";
+ mons->props["can_climb"] = true;
if (!in_transit)
mons->props["speech_prefix"] = "twin_died";
else
@@ -3198,39 +3198,39 @@ void elven_twin_died(monster* twin, bool in_transit, killer_type killer, int kil
else if (mons->can_speak())
mprf("%s", death_message.c_str());
- if (mons_is_duvessa(mons))
- {
- if (mons_near(mons))
- {
- // Provides its own flavour message.
- mons->go_berserk(true);
- }
- else
- {
- // She'll go berserk the next time she sees you
- mons->props["duvessa_berserk"] = bool(true);
- }
- }
- else
+ // Upgrade the spellbook already here, as elven_twin_energize
+ // may not be called due to lack of visibility.
+ if (mons_is_dowan(mons))
{
- ASSERT(mons_is_dowan(mons));
- if (mons->observable())
- {
- mons->add_ench(ENCH_HASTE);
- simple_monster_message(mons, " seems to find hidden reserves of power!");
- }
- else
- mons->props["dowan_upgrade"] = bool(true);
-
mons->spells[0] = SPELL_THROW_ICICLE;
mons->spells[1] = SPELL_BLINK;
mons->spells[3] = SPELL_STONE_ARROW;
mons->spells[4] = SPELL_HASTE;
// Nothing with 6.
-
+
// Indicate that he has an updated spellbook.
mons->props["custom_spells"] = true;
}
+
+ // Finally give them new energy
+ if (mons_near(mons))
+ elven_twin_energize(mons);
+ else
+ mons->props["elven_twin_energize"] = true;
+}
+
+void elven_twin_energize(monster* mons)
+{
+ if (mons_is_duvessa(mons))
+ mons->go_berserk(true);
+ else
+ {
+ ASSERT(mons_is_dowan(mons));
+ if (mons->observable())
+ simple_monster_message(mons, " seems to find hidden reserves of power!");
+
+ mons->add_ench(ENCH_HASTE);
+ }
}
/**
diff --git a/crawl-ref/source/mon-death.h b/crawl-ref/source/mon-death.h
index e7c99d7..b858fe3 100644
--- a/crawl-ref/source/mon-death.h
+++ b/crawl-ref/source/mon-death.h
@@ -52,6 +52,7 @@ bool mons_is_duvessa(const monster* mons);
bool mons_is_dowan(const monster* mons);
bool mons_is_elven_twin(const monster* mons);
void elven_twin_died(monster* twin, bool in_transit, killer_type killer, int killer_index);
+void elven_twin_energize(monster* mons);
void elven_twins_pacify(monster* twin);
void elven_twins_unpacify(monster* twin);
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 7b4a2cc..957feb2 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -41,6 +41,7 @@
#include "message.h"
#include "misc.h"
#include "mon-behv.h"
+#include "mon-death.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "options.h"
@@ -147,19 +148,11 @@ void seen_monsters_react()
gozag_check_bribe(*mi);
slime_convert(*mi);
- // XXX: Hack for triggering Duvessa's going berserk.
- if (mi->props.exists("duvessa_berserk"))
+ // XXX: Hack for triggering Duvessa & Dowan rage
+ if (mi->props.exists("elven_twin_energize"))
{
- mi->props.erase("duvessa_berserk");
- mi->go_berserk(true);
- }
-
- // XXX: Hack for triggering Dowan's spell changes.
- if (mi->props.exists("dowan_upgrade"))
- {
- mi->add_ench(ENCH_HASTE);
- mi->props.erase("dowan_upgrade");
- simple_monster_message(*mi, " seems to find hidden reserves of power!");
+ mi->props.erase("elven_twin_energize");
+ elven_twin_energize(*mi);
}
}
}
--
1.7.9.5
|