summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-13 20:13:49 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-13 20:13:49 +0000
commit98cb4527a13a0fde17cf6122dd9b2e9ee2c2d765 (patch)
treef4197251ad558deae6206da93799749009afd9d5 /crawl-ref/source/spells1.cc
parent31bac929c7e02cec1a5e3ee8c85cefec44a3e8fd (diff)
downloadcrawl-ref-98cb4527a13a0fde17cf6122dd9b2e9ee2c2d765.tar.gz
crawl-ref-98cb4527a13a0fde17cf6122dd9b2e9ee2c2d765.zip
Add abjuration protection for gifts from TSO and Trog, both friendly and
hostile. (TSO currently doesn't send any abjurable hostile gifts, but the framework is in place for if/when that changes.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5786 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index b08c12e433..a783bf7821 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -1250,11 +1250,26 @@ void abjuration(int pow)
mon_enchant abj = monster->get_ench(ENCH_ABJ);
if (abj.ench != ENCH_NONE)
{
- const int sockage = std::max(fuzz_value(abjdur, 60, 30), 40);
+ int sockage = std::max(fuzz_value(abjdur, 60, 30), 40);
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "%s abj: dur: %d, abj: %d",
monster->name(DESC_PLAIN).c_str(), abj.duration, sockage);
#endif
+
+ // TSO and Trog's abjuration protection.
+ if (monster->god == GOD_SHINING_ONE)
+ {
+ sockage = sockage * monster->hit_dice / 45;
+ if (sockage < abj.duration)
+ simple_god_message(" protects a fellow warrior from your evil magic!");
+ }
+ else if (monster->god == GOD_TROG)
+ {
+ sockage = sockage * 8 / 15;
+ if (sockage < abj.duration)
+ simple_god_message(" shields an ally from your puny magic!");
+ }
+
if (!monster->lose_ench_duration(abj, sockage))
simple_monster_message(monster, " shudders.");
}