summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/actor.cc
diff options
context:
space:
mode:
authorcjo <cjo@ulyco.com>2013-04-22 12:15:27 -0700
committerChris Campbell <chriscampbell89@gmail.com>2013-04-23 03:20:53 +0100
commit7778caa9ee09d8b08024f7842671a1d5eef1ac2e (patch)
treee9727ffce4a543279a56b2a8cb591e023fc213b8 /crawl-ref/source/actor.cc
parentd69058b34d72309af6cf66264ec4eb58400ef68d (diff)
downloadcrawl-ref-7778caa9ee09d8b08024f7842671a1d5eef1ac2e.tar.gz
crawl-ref-7778caa9ee09d8b08024f7842671a1d5eef1ac2e.zip
Mana Shield demonspawn mutation.
Tier 2 mutation. Level one gives guardian spirit, level two gives increased mana regen rate, level three lets mana regenerate in place of health at low mana.
Diffstat (limited to 'crawl-ref/source/actor.cc')
-rw-r--r--crawl-ref/source/actor.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/crawl-ref/source/actor.cc b/crawl-ref/source/actor.cc
index 95cc5891bb..8e8229b08c 100644
--- a/crawl-ref/source/actor.cc
+++ b/crawl-ref/source/actor.cc
@@ -388,11 +388,18 @@ int actor::evokable_flight(bool calc_unid) const
int actor::spirit_shield(bool calc_unid, bool items) const
{
- if (suppressed() || !items)
- return 0;
+ int ss = 0;
+
+ if (items && !suppressed())
+ {
+ ss += wearing_ego(EQ_ALL_ARMOUR, SPARM_SPIRIT_SHIELD, calc_unid);
+ ss += wearing(EQ_AMULET, AMU_GUARDIAN_SPIRIT, calc_unid);
+ }
+
+ if (is_player())
+ ss += player_mutation_level(MUT_MANA_SHIELD);
- return wearing_ego(EQ_ALL_ARMOUR, SPARM_SPIRIT_SHIELD, calc_unid)
- + wearing(EQ_AMULET, AMU_GUARDIAN_SPIRIT, calc_unid);
+ return ss;
}
int actor::apply_ac(int damage, int max_damage, ac_type ac_rule,