summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--crawl-ref/source/abl-show.cc5
-rw-r--r--crawl-ref/source/delay.cc23
-rw-r--r--crawl-ref/source/direct.cc8
-rw-r--r--crawl-ref/source/itemname.cc2
-rw-r--r--crawl-ref/source/monstuff.cc10
-rw-r--r--crawl-ref/source/view.cc2
6 files changed, 31 insertions, 19 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 1e3bf2b0c8..ecf933fe8f 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -1315,9 +1315,8 @@ static bool do_ability(const ability_def& abil)
mpr("There's no-one here to preach to!");
return (false);
}
-// const int pow = (you.skills[SK_INVOCATIONS] + 12) * (50 + you.piety) / 600;
- // up to (60 + 33)/3 = 31
- const int pow = ( 2*skill_bump(SK_INVOCATIONS) + you.piety / 6 ) / 3;
+ // up to (60 + 40)/2 = 50
+ const int pow = ( 2*skill_bump(SK_INVOCATIONS) + you.piety / 5 ) / 2;
start_delay(DELAY_RECITE, 3, pow, you.hp);
exercise( SK_INVOCATIONS, (one_chance_in(3)? 2 : 1) );
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);
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index 4c6f298417..334793fb33 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -794,9 +794,9 @@ void direction(dist& moves, targeting_type restricts,
{
monsters &m = menv[mid];
- m.attitude = m.attitude == ATT_FRIENDLY? ATT_NEUTRAL :
- m.attitude == ATT_HOSTILE? ATT_FRIENDLY :
- ATT_HOSTILE;
+ m.attitude = (m.attitude == ATT_FRIENDLY? ATT_NEUTRAL :
+ m.attitude == ATT_HOSTILE ? ATT_FRIENDLY
+ : ATT_HOSTILE);
// To update visual branding of friendlies. Only
// seem capabable of adding bolding, not removing it,
@@ -1950,7 +1950,7 @@ static void describe_monster(const monsters *mon)
mon->pronoun(PRONOUN_CAP).c_str());
}
// hostile with target != you
- else if (!mons_friendly(mon) && mon->foe != MHITYOU)
+ else if (!mons_friendly(mon) && !mons_neutral(mon) && mon->foe != MHITYOU)
{
// special case: batty monsters get set to BEH_WANDER as
// part of their special behaviour.
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index a1220dd627..a7bbc0fbe9 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -885,7 +885,7 @@ static const char* staff_secondary_string(int p)
{
case 0: return "crooked ";
case 1: return "knobbly ";
- case 2: return "heavily ";
+ case 2: return "weird ";
case 3: return "gnarled ";
case 4: return "thin ";
case 5: return "curved ";
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 47a57b7e70..92a0f8c514 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1847,14 +1847,14 @@ static void handle_behaviour(monsters *mon)
{
bool changed = true;
bool isFriendly = mons_friendly(mon);
- bool isNeutral = mons_neutral(mon);
+ bool isNeutral = mons_neutral(mon);
bool proxPlayer = mons_near(mon);
bool proxFoe;
- bool isHurt = (mon->hit_points <= mon->max_hit_points / 4 - 1);
+ bool isHurt = (mon->hit_points <= mon->max_hit_points / 4 - 1);
bool isHealthy = (mon->hit_points > mon->max_hit_points / 2);
- bool isSmart = (mons_intel(mon->type) > I_ANIMAL);
- bool isScared = mon->has_ench(ENCH_FEAR);
- bool isMobile = !mons_is_stationary(mon);
+ bool isSmart = (mons_intel(mon->type) > I_ANIMAL);
+ bool isScared = mon->has_ench(ENCH_FEAR);
+ bool isMobile = !mons_is_stationary(mon);
// check for confusion -- early out.
if (mon->has_ench(ENCH_CONFUSION))
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 4cd2e8d3c3..a4036e12b8 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -897,7 +897,7 @@ void handle_monster_shouts(monsters* monster, bool force)
// Silent monsters can give noiseless "visual shouts" if the
// player can see them, in which case silence isn't checked for.
- if (!force && mons_friendly(monster)
+ if (!force && (mons_friendly(monster) || mons_neutral(monster))
|| (type == S_SILENT && !player_monster_visible(monster))
|| (type != S_SILENT && (silenced(you.x_pos, you.y_pos)
|| silenced(monster->x, monster->y))))