summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/delay.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-11 01:08:42 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-11 01:08:42 +0000
commitab0485a9c1fe6dde6bc11d7655ed92fc57a0177b (patch)
tree5f07e716680b067f9cbf4bac407fd1494d645f1b /crawl-ref/source/delay.cc
parent1c5f5dc9b4118fd3dbdfbbfaa3b472090d4d0395 (diff)
downloadcrawl-ref-ab0485a9c1fe6dde6bc11d7655ed92fc57a0177b.tar.gz
crawl-ref-ab0485a9c1fe6dde6bc11d7655ed92fc57a0177b.zip
Tweak recite to yield better results for holy beings.
As their MR will be unachievably high no matter what, their "resist value" instead depends on your Invocations skill. Change calculation of power, so high values are easier to reach, to a maximum of 50. Also add special casing for neutral monsters so they no longer pretend not to have noticed you. Oh, and I found a problem concerning holy beings: Now that the player can actually meet hostile holy monsters the good gods reaction at killing one of them needs to be changed accordingly. We cannot simply restrict it to _friendly_ holy beings as, once hit, they won't be friendly anymore. Instead we'll have to use the CREATED_FRIENDLY flag that already takes care of not getting any xp for any being that used to be friendly. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3427 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r--crawl-ref/source/delay.cc23
1 files changed, 18 insertions, 5 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index e32bcd6c2b..1e0f797446 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -66,6 +66,7 @@ static bool recite_mons_useless(const monsters *mon)
|| mon->has_ench(ENCH_BERSERK));
}
+// power is maximum 50
static int recite_to_monsters(int x, int y, int pow, int unused)
{
UNUSED(unused);
@@ -82,12 +83,24 @@ static int recite_to_monsters(int x, int y, int pow, int unused)
if (coinflip()) // nothing happens
return (0);
- const int resist = mons_resist_magic(mons);
+ int resist;
+ const int holiness = mons_holiness(mons);
+ if (holiness == MH_HOLY)
+ {
+ resist = 7 - random2(you.skills[SK_INVOCATIONS]);
+ if (resist < 0)
+ resist = 0;
+ }
+ else
+ {
+ resist = mons_resist_magic(mons);
+
+ // much lower chances at influencing demons
+ if (holiness == MH_DEMONIC)
+ pow -= 3 + random2(5);
+ }
+
pow -= resist;
-
- // much lower chances at influencing demons
- if (mons_class_holiness(mon) == MH_DEMONIC)
- pow -= 3 + random2(5);
if (pow > 0)
pow = random2avg(pow,2);