summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-10 16:04:14 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-10 16:04:14 +0000
commit512696e788bbd4172853b8a1d7cca95497c98a6a (patch)
treed6477f6a71ab70118cc8126711557eafdb979e03 /crawl-ref/source/fight.cc
parent684f80b554daadb08cf2c40b8e905737e8655530 (diff)
downloadcrawl-ref-512696e788bbd4172853b8a1d7cca95497c98a6a.tar.gz
crawl-ref-512696e788bbd4172853b8a1d7cca95497c98a6a.zip
Allow player ghosts to use corona.
Breaks save compatibility, upped save major version. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1282 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index ce615b13ce..98ef1e7c03 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -2131,7 +2131,7 @@ int melee_attack::player_to_hit(bool random_factor)
// Check for backlight (Corona).
if (defender && defender->atype() == ACT_MONSTER)
{
- if (def->has_ench(ENCH_BACKLIGHT))
+ if (defender->backlit())
your_to_hit += 2 + random2(8);
// Invisible monsters are hard to hit.
else if (def->invisible() && !see_invis)
@@ -3071,6 +3071,9 @@ int melee_attack::mons_to_hit()
if (attacker->confused())
mhit -= 5;
+ if (defender->backlit())
+ mhit += 2 + random2(8);
+
// Invisible defender is hard to hit if you can't see invis. Note
// that this applies only to monsters vs monster and monster vs
// player. Does not apply to a player fighting an invisible