Attached Files |
0001-Trigger-mummies-etc.-on-Dith-shadow-spell-kills.patch [^] (2,249 bytes) 2015-01-05 23:50 [Show Content] [Hide Content]From 02ded3cce030357f8846c56c85b4c719a5708d8a Mon Sep 17 00:00:00 2001
From: Neil Moore <neil@s-z.org>
Date: Mon, 5 Jan 2015 17:47:52 -0500
Subject: [PATCH] Trigger mummies, etc. on Dith shadow spell kills.
---
crawl-ref/source/mon-death.cc | 14 +++++++++-----
crawl-ref/source/ouch.cc | 2 +-
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/crawl-ref/source/mon-death.cc b/crawl-ref/source/mon-death.cc
index e3cfd51..3dc7c5e 100644
--- a/crawl-ref/source/mon-death.cc
+++ b/crawl-ref/source/mon-death.cc
@@ -1874,19 +1874,23 @@ int monster_die(monster* mons, killer_type killer,
}
}
- // Kills by the spectral weapon are considered as kills by the player instead
- // Ditto Dithmenos shadow kills.
- if ((killer == KILL_MON || killer == KILL_MON_MISSILE)
+ // Kills by the spectral weapon are considered as kills by the player
+ // instead. Ditto Dithmenos shadow melee and shadow throw.
+ if (MON_KILL(killer)
&& !invalid_monster_index(killer_index)
&& ((menv[killer_index].type == MONS_SPECTRAL_WEAPON
&& menv[killer_index].summoner == MID_PLAYER)
|| mons_is_player_shadow(&menv[killer_index])))
{
- killer = (killer == KILL_MON_MISSILE) ? KILL_YOU_MISSILE
- : KILL_YOU;
killer_index = you.mindex();
}
+ // Set an appropriate killer; besides the cases in the preceding if,
+ // this handles Dithmeno shadow spell, which look like they come from
+ // you because the shadow's mid is MID_PLAYER.
+ if (MON_KILL(killer) && killer_index == you.mindex())
+ killer = (killer == KILL_MON_MISSILE) ? KILL_YOU_MISSILE : KILL_YOU;
+
// Take notes and mark milestones.
record_monster_defeat(mons, killer);
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 5ddc7e5..c731b97 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -1112,7 +1112,7 @@ int actor_to_death_source(const actor* agent)
return NON_MONSTER;
if (agent->is_player())
- return NON_MONSTER;
+ return MHITYOU;
else if (agent->is_monster())
return agent->as_monster()->mindex();
else
--
2.1.3
|