diff options
-rw-r--r-- | crawl-ref/source/mstuff2.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/spells1.cc | 17 |
2 files changed, 31 insertions, 1 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); 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."); } |