summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-26 11:11:03 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-26 11:11:03 +0000
commitfa909934b0e8289bf954c143e806cf6d42583c53 (patch)
tree7e8523c6c3890c1827d615993d030172205af150 /crawl-ref/source/monstuff.cc
parenteaf0d8123d3841efd48c81c306317e3040582fd3 (diff)
downloadcrawl-ref-fa909934b0e8289bf954c143e806cf6d42583c53.tar.gz
crawl-ref-fa909934b0e8289bf954c143e806cf6d42583c53.zip
Orcs may surrender to Beogh worshippers when beaten up. Adjusted experience gain for monsters, duration of orc battle cries and removed use of invocations to determine the success of spontaneous orc conversion.
Fixed monsters getting bad experience values. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2586 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index aee12608a2..3fa1b16f82 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -428,10 +428,48 @@ static bool is_pet_kill(killer_type killer, int i)
&& (me.who == KC_YOU || me.who == KC_FRIENDLY));
}
+static bool monster_avoided_death(monsters *monster, killer_type killer, int i)
+{
+ if (monster->hit_points < -25
+ || monster->hit_points < -monster->max_hit_points
+ || monster->max_hit_points <= 0
+ || monster->hit_dice < 1)
+ return (false);
+
+ // Orcs may convert to Beogh under threat of death.
+ if (YOU_KILL(killer)
+ && mons_near(monster)
+ && !mons_friendly(monster)
+ && mons_species(monster->type) == MONS_ORC
+ && you.species == SP_HILL_ORC && you.religion == GOD_BEOGH
+ && !player_under_penance() && you.piety >= 75)
+ {
+#ifdef DEBUG_DIAGNOSTICS
+ mprf(MSGCH_DIAGNOSTICS, "Death convert attempt on %s, HD: %d, "
+ "your xl: %d",
+ monster->name(DESC_PLAIN).c_str(),
+ monster->hit_dice,
+ you.experience_level);
+#endif
+ if (random2(you.piety) > 30
+ && random2(you.experience_level) >= random2(monster->hit_dice)
+ // bias beaten-up-conversion towards the stronger orcs.
+ && random2(monster->hit_dice) > 2)
+ {
+ beogh_convert_orc(monster);
+ return (true);
+ }
+ }
+ return (false);
+}
+
void monster_die(monsters *monster, killer_type killer, int i, bool silent)
{
if (monster->type == -1)
return;
+
+ if (!silent && monster_avoided_death(monster, killer, i))
+ return;
if (mons_is_caught(monster))
{