diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-13 20:13:49 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-13 20:13:49 +0000 |
commit | 98cb4527a13a0fde17cf6122dd9b2e9ee2c2d765 (patch) | |
tree | f4197251ad558deae6206da93799749009afd9d5 /crawl-ref/source/mstuff2.cc | |
parent | 31bac929c7e02cec1a5e3ee8c85cefec44a3e8fd (diff) | |
download | crawl-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/mstuff2.cc')
-rw-r--r-- | crawl-ref/source/mstuff2.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index c252a47cde..c5d3bb55f2 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -40,6 +40,7 @@ #include "mon-util.h" #include "player.h" #include "randart.h" +#include "religion.h" #include "spells3.h" #include "spells4.h" #include "spl-cast.h" @@ -2263,6 +2264,20 @@ static int _monster_abjure_square(const coord_def &pos, if (!actual) return (pow > 40 || pow >= abj.duration); + // TSO and Trog's abjuration protection. + if (you.religion == GOD_SHINING_ONE) + { + pow = pow * target->hit_dice / 30; + if (pow < abj.duration) + simple_god_message(" protects your fellow warrior from evil magic!"); + } + else if (you.religion == GOD_TROG) + { + pow = pow * 4 / 5; + if (pow < abj.duration) + simple_god_message(" shields your ally from puny magic!"); + } + #ifdef DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "Abj: dur: %d, pow: %d, ndur: %d", abj.duration, pow, abj.duration - pow); |