summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/enum.h1
-rw-r--r--crawl-ref/source/monstuff.cc71
-rw-r--r--crawl-ref/source/religion.cc104
3 files changed, 130 insertions, 46 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 876a16b3ba..c8d8a95ba4 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -661,6 +661,7 @@ enum conduct_type
DID_UNDEAD_KILLED_BY_SERVANT,
DID_DEMON_KILLED_BY_SERVANT,
DID_NATURAL_EVIL_KILLED_BY_SERVANT, // TSO
+ DID_HOLY_KILLED_BY_UNDEAD_SLAVE,
DID_HOLY_KILLED_BY_SERVANT,
DID_SPELL_MEMORISE,
DID_SPELL_CASTING,
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 570f2de62f..e75feffe9b 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1135,27 +1135,24 @@ void monster_die(monsters *monster, killer_type killer,
attacker_holy = anon ? MH_NATURAL
: mons_holiness(&menv[killer_index]);
- if (attacker_holy == MH_UNDEAD)
+ if (targ_holy == MH_NATURAL && attacker_holy == MH_UNDEAD)
{
- if (targ_holy == MH_NATURAL)
+ // Yes, this is a hack, but it makes sure that confused
+ // monsters doing the kill are not referred to as "slave",
+ // 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]))
{
- // Yes, this is a hack, but it makes sure that confused
- // monsters doing the kill are not referred to as
- // "slave", 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]))
- {
- notice |=
- did_god_conduct(DID_LIVING_KILLED_BY_UNDEAD_SLAVE,
+ notice |=
+ did_god_conduct(DID_LIVING_KILLED_BY_UNDEAD_SLAVE,
monster->hit_dice);
- }
- else
- {
- notice |=
- did_god_conduct(DID_LIVING_KILLED_BY_SERVANT,
+ }
+ else
+ {
+ notice |=
+ did_god_conduct(DID_LIVING_KILLED_BY_SERVANT,
monster->hit_dice);
- }
}
}
else if (you.religion == GOD_SHINING_ONE
@@ -1172,37 +1169,57 @@ void monster_die(monsters *monster, killer_type killer,
// pass here since those followers are assumed to
// come from Summoning spells... the others are
// from invocations (Zin, TSO, Makh, Kiku). -- bwr
-
if (targ_holy == MH_NATURAL)
{
- notice |= did_god_conduct( DID_LIVING_KILLED_BY_SERVANT,
- monster->hit_dice );
+ notice |= did_god_conduct(DID_LIVING_KILLED_BY_SERVANT,
+ monster->hit_dice);
if (mons_is_evil(monster))
{
notice |=
did_god_conduct(
DID_NATURAL_EVIL_KILLED_BY_SERVANT,
- monster->hit_dice );
+ monster->hit_dice);
}
}
else if (targ_holy == MH_DEMONIC)
{
- notice |= did_god_conduct( DID_DEMON_KILLED_BY_SERVANT,
- monster->hit_dice );
+ notice |= did_god_conduct(DID_DEMON_KILLED_BY_SERVANT,
+ monster->hit_dice);
}
else if (targ_holy == MH_UNDEAD)
{
- notice |= did_god_conduct( DID_UNDEAD_KILLED_BY_SERVANT,
- monster->hit_dice );
+ notice |= did_god_conduct(DID_UNDEAD_KILLED_BY_SERVANT,
+ monster->hit_dice);
}
}
// Holy kills are always noticed.
if (targ_holy == MH_HOLY)
{
- notice |= did_god_conduct( DID_HOLY_KILLED_BY_SERVANT,
- monster->hit_dice );
+ if (attacker_holy == MH_UNDEAD)
+ {
+ // Yes, this is a hack, but it makes sure that confused
+ // monsters doing the kill are not referred to as
+ // "slave", 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]))
+ {
+ notice |=
+ did_god_conduct(DID_HOLY_KILLED_BY_UNDEAD_SLAVE,
+ monster->hit_dice);
+ }
+ else
+ {
+ notice |=
+ did_god_conduct(DID_HOLY_KILLED_BY_SERVANT,
+ monster->hit_dice);
+ }
+ }
+ else
+ notice |= did_god_conduct(DID_HOLY_KILLED_BY_SERVANT,
+ monster->hit_dice);
}
if (you.religion == GOD_VEHUMET
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index bb73352186..7f798a717f 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -609,12 +609,18 @@ std::string get_god_likes(god_type which_god, bool verbose)
switch (which_god)
{
- case GOD_KIKUBAAQUDGHA: case GOD_MAKHLEB: case GOD_LUGONU:
+ case GOD_MAKHLEB: case GOD_LUGONU:
likes.push_back("you or your allies kill holy beings");
break;
+ case GOD_KIKUBAAQUDGHA:
+ likes.push_back("you kill holy beings");
+ likes.push_back("your god-given allies kill holy beings");
+ likes.push_back("your undead slaves kill holy beings");
+ break;
+
case GOD_YREDELEMNUL:
- likes.push_back("your allies kill holy beings");
+ likes.push_back("your undead slaves kill holy beings");
break;
default:
@@ -2255,6 +2261,7 @@ static bool _do_god_revenge(conduct_type thing_done)
retval = _beogh_idol_revenge();
break;
case DID_KILL_HOLY:
+ case DID_HOLY_KILLED_BY_UNDEAD_SLAVE:
case DID_HOLY_KILLED_BY_SERVANT:
retval = _tso_holy_revenge();
break;
@@ -2292,7 +2299,7 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
break;
}
penance = level;
- // deliberate fall-through
+ // deliberate fall through
case GOD_ZIN:
case GOD_ELYVILON:
if (!known)
@@ -2617,7 +2624,6 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
// If you or any friendly kills one, you'll get the credit or
// the blame.
case DID_KILL_HOLY:
- case DID_HOLY_KILLED_BY_SERVANT:
switch (you.religion)
{
case GOD_ZIN:
@@ -2640,16 +2646,12 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
if (god_hates_attacking_friend(you.religion, victim))
break;
- if (thing_done == DID_KILL_HOLY)
- simple_god_message(" accepts your kill.");
- else
- simple_god_message(" accepts your collateral kill.");
+ simple_god_message(" accepts your kill.");
retval = true;
if (random2(level + 18) > 2)
piety_change = 1;
- if (you.religion == GOD_YREDELEMNUL
- && thing_done == DID_KILL_HOLY)
+ if (you.religion == GOD_YREDELEMNUL)
{
simple_god_message(" appreciates your killing of a holy "
"being.");
@@ -2664,9 +2666,75 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
}
break;
- // Undead slave is any friendly undead monster. Kiku and Yred pay
- // attention to the undead, and both like the death of living
- // things.
+ // 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:
+ case GOD_LUGONU:
+ if (god_hates_attacking_friend(you.religion, victim))
+ break;
+
+ simple_god_message(" accepts your slave's kill.");
+ retval = true;
+ if (random2(level + 18) > 2)
+ piety_change = 1;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case DID_HOLY_KILLED_BY_SERVANT:
+ 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_KIKUBAAQUDGHA: // note: reapers aren't undead
+ case GOD_MAKHLEB:
+ case GOD_LUGONU:
+ if (god_hates_attacking_friend(you.religion, victim))
+ break;
+
+ simple_god_message(" accepts your collateral kill.");
+ retval = true;
+ if (random2(level + 18) > 2)
+ piety_change = 1;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
case DID_LIVING_KILLED_BY_UNDEAD_SLAVE:
switch (you.religion)
{
@@ -2685,8 +2753,6 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
}
break;
- // Servants are currently any friendly or charmed monster, excluding
- // undead, which are handled above.
case DID_LIVING_KILLED_BY_SERVANT:
switch (you.religion)
{
@@ -2905,10 +2971,10 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
"Kill Wizard", "Kill Priest", "Kill Holy",
"Undead Slave Kill Living", "Servant Kill Living",
"Servant Kill Undead", "Servant Kill Demon",
- "Servant Kill Natural Evil", "Servant Kill Holy",
- "Spell Memorise", "Spell Cast", "Spell Practise",
- "Spell Nonutility", "Cards", "Stimulants", "Drink Blood",
- "Cannibalism", "Eat Meat", "Eat Souled Being",
+ "Servant Kill Natural Evil", "Undead Slave Kill Holy",
+ "Servant Kill Holy", "Spell Memorise", "Spell Cast",
+ "Spell Practise", "Spell Nonutility", "Cards", "Stimulants",
+ "Drink Blood", "Cannibalism", "Eat Meat", "Eat Souled Being",
"Deliberate Mutation", "Cause Glowing",
"Destroy Orcish Idol", "Create Life"
};