diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/enum.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 30 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 50 |
3 files changed, 57 insertions, 25 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index b1318981aa..9f24460b02 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -706,7 +706,9 @@ enum conduct_type DID_KILL_HOLY, DID_LIVING_KILLED_BY_UNDEAD_SLAVE, DID_LIVING_KILLED_BY_SERVANT, + DID_UNDEAD_KILLED_BY_UNDEAD_SLAVE, DID_UNDEAD_KILLED_BY_SERVANT, + DID_DEMON_KILLED_BY_UNDEAD_SLAVE, DID_DEMON_KILLED_BY_SERVANT, DID_NATURAL_EVIL_KILLED_BY_SERVANT, // TSO DID_HOLY_KILLED_BY_UNDEAD_SLAVE, diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index f24f852c7b..74729ab5e7 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1448,24 +1448,36 @@ int monster_die(monsters *monster, killer_type killer, || you.religion == GOD_LUGONU || !anon && mons_is_god_gift(&menv[killer_index])) { - if (targ_holy == MH_NATURAL && attacker_holy == MH_UNDEAD) + if (attacker_holy == MH_UNDEAD) { - // Yes, this is a hack, but it makes sure that + const bool confused = + !mons_friendly(&menv[killer_index]); + + // Yes, these are hacks, but they make sure that // confused monsters doing kills are not // referred to as "slaves", and I think it's - // okay that Yredelemnul ignores kills done by - // confused monsters as opposed to enslaved or - // friendly ones. (jpeg) - if (mons_friendly(&menv[killer_index])) + // okay that e.g. Yredelemnul ignores kills done + // by confused monsters as opposed to enslaved + // or friendly ones. (jpeg) + if (targ_holy == MH_NATURAL) { notice |= did_god_conduct( - DID_LIVING_KILLED_BY_UNDEAD_SLAVE, + !confused ? DID_LIVING_KILLED_BY_UNDEAD_SLAVE : + DID_LIVING_KILLED_BY_SERVANT, monster->hit_dice); } - else + else if (targ_holy == MH_UNDEAD) + { + notice |= did_god_conduct( + !confused ? DID_UNDEAD_KILLED_BY_UNDEAD_SLAVE : + DID_UNDEAD_KILLED_BY_SERVANT, + monster->hit_dice); + } + else if (targ_holy == MH_DEMONIC) { notice |= did_god_conduct( - DID_LIVING_KILLED_BY_SERVANT, + !confused ? DID_DEMON_KILLED_BY_UNDEAD_SLAVE : + DID_DEMON_KILLED_BY_SERVANT, monster->hit_dice); } } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 54e0bd70b2..b4ea68054b 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -2772,24 +2772,9 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, } break; - // You shouldn't have undead slaves if you worship a good god, - // but check anyway, just in case. case DID_HOLY_KILLED_BY_UNDEAD_SLAVE: switch (you.religion) { - case GOD_ZIN: - case GOD_SHINING_ONE: - case GOD_ELYVILON: - if (testbits(victim->flags, MF_CREATED_FRIENDLY) - || testbits(victim->flags, MF_WAS_NEUTRAL)) - { - level *= 3; - penance = level; - } - piety_change = -level; - retval = true; - break; - case GOD_YREDELEMNUL: case GOD_KIKUBAAQUDGHA: // note: reapers aren't undead case GOD_MAKHLEB: @@ -2881,6 +2866,23 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, } break; + case DID_UNDEAD_KILLED_BY_UNDEAD_SLAVE: + switch (you.religion) + { + case GOD_VEHUMET: + case GOD_MAKHLEB: + case GOD_BEOGH: + case GOD_LUGONU: + simple_god_message(" accepts your slave's kill."); + retval = true; + if (random2(level + 10 - you.experience_level/3) > 5) + piety_change = 1; + break; + default: + break; + } + break; + case DID_UNDEAD_KILLED_BY_SERVANT: switch (you.religion) { @@ -2902,6 +2904,21 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, } break; + case DID_DEMON_KILLED_BY_UNDEAD_SLAVE: + switch (you.religion) + { + case GOD_MAKHLEB: + case GOD_BEOGH: + simple_god_message(" accepts your slave's kill."); + retval = true; + if (random2(level + 10 - you.experience_level/3) > 5) + piety_change = 1; + break; + default: + break; + } + break; + case DID_DEMON_KILLED_BY_SERVANT: switch (you.religion) { @@ -3096,7 +3113,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, "Kill Demon", "Kill Natural Evil", "Kill Chaotic", "Kill Wizard", "Kill Priest", "Kill Holy", "Undead Slave Kill Living", "Servant Kill Living", - "Servant Kill Undead", "Servant Kill Demon", + "Undead Slave Kill Undead", "Servant Kill Undead", + "Undead Slave Kill Demon", "Servant Kill Demon", "Servant Kill Natural Evil", "Undead Slave Kill Holy", "Servant Kill Holy", "Spell Memorise", "Spell Cast", "Spell Practise", "Spell Nonutility", "Cards", "Stimulants", |