diff options
-rw-r--r-- | crawl-ref/source/monstuff.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/religion.h | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index c29be500bc..21f96acfad 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -939,6 +939,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) } else if (you.religion == GOD_VEHUMET || you.religion == GOD_MAKHLEB + || you.religion == GOD_SHINING_ONE || (!anon && testbits(menv[i].flags, MF_GOD_GIFT))) { // Yes, we are splitting undead pets from the others @@ -997,6 +998,8 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) } } + // Give a follower power from killing evil, or randomly + // bless it. if (you.religion == GOD_SHINING_ONE && mons_is_evil_or_unholy(monster) && (!player_under_penance() @@ -1004,12 +1007,15 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) && !invalid_monster_index(i)) { monsters *mon = &menv[i]; - if (mon->alive() && mon->hit_points < mon->max_hit_points) + if (mon->alive() && mon->hit_points < mon->max_hit_points + && !one_chance_in(3)) { simple_monster_message(mon, " looks invigorated."); heal_monster( mon, 1 + random2(monster->hit_dice / 4), false ); } + else + bless_follower(GOD_SHINING_ONE, is_tso_follower, mon); } // Randomly bless the follower who killed. diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 83204da7b3..1c7c4b0de7 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -3735,6 +3735,15 @@ void beogh_convert_orc(monsters *orc, bool emergency, behaviour_event(orc, ME_ALERT, MHITNOT); } +bool is_tso_follower(const monsters* mon) +{ + // Don't check for evil or unholy allies here, as that's done + // elsewhere. + return (mon->alive() + && (mon->attitude == ATT_FRIENDLY + || mon->has_ench(ENCH_CHARM))); +} + bool is_orcish_follower(const monsters* mon) { return (mon->alive() && mons_species(mon->type) == MONS_ORC diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index d4bcddece5..6c99a2ec3b 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -74,6 +74,7 @@ bool tso_stab_safe_monster(const actor *act); void bless_follower(god_type god, bool (*suitable)(const monsters* mon), monsters* follower = NULL); +bool is_tso_follower(const monsters* mon); bool is_orcish_follower(const monsters* mon); bool god_hates_attacking_friend(god_type god, const actor *fr); |