diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-28 23:09:17 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-28 23:09:17 +0000 |
commit | 6227494d3fee44608ba466d38a4e893e25a7d634 (patch) | |
tree | 8c82bc0d3501baf89ac790200b30b58557cbe759 | |
parent | e515471c2e027d2f1bd06e7b4cde7e8983949fcb (diff) | |
download | crawl-ref-6227494d3fee44608ba466d38a4e893e25a7d634.tar.gz crawl-ref-6227494d3fee44608ba466d38a4e893e25a7d634.zip |
Add the beginnings of TSO follower blessings. Assume that followers are
any living friendly or charmed monsters. Deliberately don't check for
evil or unholy status; that should help shake out cases where you can
get them. Currently, only do blessings on followers that kill evil
monsters 1/3 of the time, instead of gaining power as they normally
would.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3923 c06c8d41-db1a-0410-9941-cceddc491573
-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); |