summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-11 12:51:20 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-11 12:51:20 +0000
commit3861479ddd6f0af75d97ba21794a831cfedf156c (patch)
tree2d6473b698d179fea3cfb5ed3fa801331de293d8 /crawl-ref/source/spells1.cc
parent1d4cd176bdd2593a80dd0b320583a92c632ca114 (diff)
downloadcrawl-ref-3861479ddd6f0af75d97ba21794a831cfedf156c.tar.gz
crawl-ref-3861479ddd6f0af75d97ba21794a831cfedf156c.zip
Fixed abjuration (player and monster versions) to work with the new enchantment
duration system. Also strengthened monster abjuration, which became terribly weak after the 0.2 nerf. Monster abjuration now applies in a circle around the caster, squares adjacent to the caster getting full blast, and weaker abjuration effects going outwards. Player abjuration stays unchanged. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1836 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index f9d0a86d3b..4db7987997 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -667,6 +667,9 @@ void abjuration(int pow)
mpr("Send 'em back where they came from!");
+ // Scale power into something comparable to summon lifetime.
+ const int abjdur = pow * 10;
+
for (int ab = 0; ab < MAX_MONSTERS; ab++)
{
monster = &menv[ab];
@@ -679,10 +682,15 @@ void abjuration(int pow)
mon_enchant abj = monster->get_ench(ENCH_ABJ);
if (abj.ench != ENCH_NONE)
- monster->lose_ench_levels(abj, 1 + (random2(pow) / 8));
-
- if (monster->has_ench(ENCH_ABJ))
- simple_monster_message(monster, " shudders.");
+ {
+ const 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
+ if (!monster->lose_ench_duration(abj, sockage))
+ simple_monster_message(monster, " shudders.");
+ }
}
} // end abjuration()