From 94e6620656e106498e9f4cf9df0a45a4d6bbbc09 Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 20 May 2008 23:51:46 +0000 Subject: Run through the god conducts for killing if we make a bad kill of a summoned creature (e.g. a living kill while praying to Elyvilon). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5166 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monstuff.cc | 10 +++++----- crawl-ref/source/religion.cc | 20 ++++++++++++++++++++ crawl-ref/source/religion.h | 1 + 3 files changed, 26 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index acdf66aef3..68b3278017 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -740,7 +740,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) const bool gives_xp = !monster->has_ench(ENCH_ABJ); bool in_transit = false; - bool drop_items = !hard_reset; + bool drop_items = !hard_reset && !mons_is_holy(monster); #ifdef DGL_MILESTONES _check_kill_milestone(monster, killer, i); @@ -878,6 +878,8 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) case KILL_YOU_MISSILE: // You kill by missile or beam. case KILL_YOU_CONF: // You kill by confusion. { + const bool bad_kill = + god_hates_killing(you.religion, monster); const bool created_friendly = testbits(monster->flags, MF_CREATED_FRIENDLY); const bool was_neutral = @@ -896,8 +898,8 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) // killing triggers tutorial lesson _tutorial_inspect_kill(); - // prevent summoned creatures from being done_good kills, - if (!created_friendly && gives_xp) + // prevent summoned creatures from being good kills + if (bad_kill || (!created_friendly && gives_xp)) { if (mons_holiness(monster) == MH_NATURAL) { @@ -944,12 +946,10 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) monster->hit_dice, true, monster); } - // Holy beings take their gear with them when they die. if (mons_is_holy(monster)) { did_god_conduct(DID_KILL_HOLY, monster->hit_dice, true, monster); - drop_items = false; } } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 1c868b6a3f..24d3de701b 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -5027,6 +5027,26 @@ std::string god_hates_your_god_reaction(god_type god, return ""; } +bool god_hates_killing(god_type god, const monsters* mon) +{ + bool retval = false; + const mon_holy_type holiness = mon->holiness(); + + switch (holiness) + { + case MH_HOLY: + retval = (is_good_god(god)); + break; + case MH_NATURAL: + retval = (god == GOD_ELYVILON); + break; + default: + break; + } + + return retval; +} + bool god_likes_butchery(god_type god) { return (god == GOD_OKAWARU diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 67e02b647e..1ca01f75f1 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -55,6 +55,7 @@ bool god_hates_your_god(god_type god, god_type your_god = you.religion); std::string god_hates_your_god_reaction(god_type god, god_type your_god = you.religion); +bool god_hates_killing(god_type god, const monsters* mon); bool god_likes_butchery(god_type god); bool god_hates_butchery(god_type god); harm_protection_type god_protects_from_harm(god_type god, bool actual = true); -- cgit v1.2.3-54-g00ecf