From 14752e5f2cfddc5b99a104afe1c8d42a74aff22b Mon Sep 17 00:00:00 2001 From: zelgadis Date: Mon, 26 May 2008 03:16:36 +0000 Subject: monsters::lose_energy() now takes optional paramaters to multiply and/or divide (rounded up) the amount of energy lost. When a monster's attack is warded off the energy consumed is half that of what the attack would normally have taken, a change from it not taking any energy at all. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5249 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 8a26e078f8..7228295e86 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -3888,6 +3888,9 @@ bool melee_attack::mons_perform_attack() if (attacker != defender && mons_attack_warded_off()) { + // A warded-off attack takes half the normal energy. + attacker->lose_energy(EUT_ATTACK, 2); + perceived_attack = true; return (false); } -- cgit v1.2.3-54-g00ecf