summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-ench.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-01-21 21:35:23 -0700
committerSteve Melenchuk <smelenchuk@gmail.com>2014-01-21 22:11:39 -0700
commit2cf8d755b10f8c80412351ebfb424485cc82f3d9 (patch)
treedcd9b6619a1a77936a38640159ae875f20f7063c /crawl-ref/source/mon-ench.cc
parentce86bbf1374fe8894466314c116b39bd0b2fbf3b (diff)
downloadcrawl-ref-2cf8d755b10f8c80412351ebfb424485cc82f3d9.tar.gz
crawl-ref-2cf8d755b10f8c80412351ebfb424485cc82f3d9.zip
Demonspawn warmonger: Sap Magic.
Based on Punishment of Excess from the proposal. Casting spells while afflicted by this hex progressively hinders your spellcasting success (or adds antimagic enchantment levels if you are a monster). Technically this could be extended to have an effect specific to individual spell schools, but that would result in a lot of duplication of durations and the like.
Diffstat (limited to 'crawl-ref/source/mon-ench.cc')
-rw-r--r--crawl-ref/source/mon-ench.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/crawl-ref/source/mon-ench.cc b/crawl-ref/source/mon-ench.cc
index a4d3478be9..da9499e7d5 100644
--- a/crawl-ref/source/mon-ench.cc
+++ b/crawl-ref/source/mon-ench.cc
@@ -925,6 +925,11 @@ void monster::remove_enchantment_effect(const mon_enchant &me, bool quiet)
calc_speed();
break;
+ case ENCH_SAP_MAGIC:
+ if (!quiet)
+ simple_monster_message(this, " is no longer being sapped.");
+ break;
+
default:
break;
}
@@ -1034,6 +1039,7 @@ void monster::timeout_enchantments(int levels)
case ENCH_BLIND: case ENCH_WORD_OF_RECALL: case ENCH_INJURY_BOND:
case ENCH_FLAYED: case ENCH_AGILE: case ENCH_FROZEN:
case ENCH_EPHEMERAL_INFUSION: case ENCH_BLACK_MARK:
+ case ENCH_SAP_MAGIC:
lose_ench_levels(i->second, levels);
break;
@@ -1220,7 +1226,6 @@ void monster::apply_enchantment(const mon_enchant &me)
case ENCH_LOWERED_MR:
case ENCH_SOUL_RIPE:
case ENCH_TIDE:
- case ENCH_ANTIMAGIC:
case ENCH_REGENERATION:
case ENCH_RAISED_MR:
case ENCH_STONESKIN:
@@ -1246,10 +1251,16 @@ void monster::apply_enchantment(const mon_enchant &me)
case ENCH_AGILE:
case ENCH_FROZEN:
case ENCH_EPHEMERAL_INFUSION:
+ case ENCH_SAP_MAGIC:
// case ENCH_ROLLING:
decay_enchantment(en);
break;
+ case ENCH_ANTIMAGIC:
+ if (!has_ench(ENCH_SAP_MAGIC))
+ decay_enchantment(en);
+ break;
+
case ENCH_MIRROR_DAMAGE:
if (decay_enchantment(en))
simple_monster_message(this, "'s dark mirror aura disappears.");
@@ -2096,7 +2107,8 @@ static const char *enchant_names[] =
"awaken vines", "control_winds", "wind_aided", "summon_capped",
"toxic_radiance", "grasping_roots_source", "grasping_roots",
"iood_charged", "fire_vuln", "tornado_cooldown", "icemail", "agile",
- "frozen", "ephemeral_infusion", "black_mark", "grand_avatar", "buggy",
+ "frozen", "ephemeral_infusion", "black_mark", "grand_avatar",
+ "sap magic", "buggy",
};
static const char *_mons_enchantment_name(enchant_type ench)
@@ -2250,6 +2262,7 @@ int mon_enchant::calc_duration(const monster* mons,
case ENCH_MIRROR_DAMAGE:
case ENCH_DEATHS_DOOR:
case ENCH_EPHEMERAL_INFUSION:
+ case ENCH_SAP_MAGIC:
cturn = 300 / _mod_speed(25, mons->speed);
break;
case ENCH_SLOW: