summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-21 21:23:21 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-21 21:23:21 +0000
commit109b00ddba65e56db1a90a374115df69070bca71 (patch)
tree0d22819524e8d7a5179e7ee280a4b16b16d6ded2 /crawl-ref/source/player.cc
parent101ce9277219b6925dc9e7c70692984c6544c5cd (diff)
downloadcrawl-ref-109b00ddba65e56db1a90a374115df69070bca71.tar.gz
crawl-ref-109b00ddba65e56db1a90a374115df69070bca71.zip
Cleaned up monster enchantments. Instead of the old enum abuse (ENCH_ABJ_I, II,
etc.), enchantment is stored as a struct (ENCH_which, degree, whose_enchantment). This allows us to do such things as award experience for monsters poisoned by friends, or confused monsters bashing themselves or falling into lava (not implemented, but could be :-)). Doing monster_die() correctly is a little tricky for friendly-enchantment-deaths because the original monster may not be around to answer questions, so we fake the killer's stats for indirect friendly kills (which means that some gods may not award piety for minion-cast enchantments, f'r'instance). I think we can live with that for now. Breaks save file compatibility as usual. Clouds could also use similar treatment - poison clouds created by a friendly are not correctly tracked yet. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1075 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 2de57145b7..462a38abae 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2053,8 +2053,8 @@ int player_see_invis(bool calc_unid)
// to find if the square the monster is in is visible see mons_near().
bool player_monster_visible( const monsters *mon )
{
- if (mons_has_ench( mon, ENCH_SUBMERGED )
- || (mons_has_ench( mon, ENCH_INVIS ) && !player_see_invis()))
+ if (mon->has_ench(ENCH_SUBMERGED)
+ || (mon->has_ench(ENCH_INVIS) && !player_see_invis()))
{
return (false);
}
@@ -5203,3 +5203,8 @@ god_type player::deity() const
{
return (religion);
}
+
+kill_category player::kill_alignment() const
+{
+ return (KC_YOU);
+}