From b1c2d6e096eebdbae0c2f5a8dd48a5f67a1eb678 Mon Sep 17 00:00:00 2001 From: haranp Date: Thu, 25 Dec 2008 17:04:20 +0000 Subject: Complete rewrite of the beam code, making it considerably saner. However, there might be quite a few bugs lurking in this rewrite. Sorry. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7975 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 3c22c76c3d..5a1b84b795 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -135,15 +135,6 @@ int effective_stat_bonus( int wepType ) #endif } -// Returns random2(x) if random_factor is true, otherwise the mean. -static int maybe_random2( int x, bool random_factor ) -{ - if (random_factor) - return random2(x); - else - return x / 2; -} - // Returns the to-hit for your extra unarmed.attacks. // DOES NOT do the final roll (i.e., random2(your_to_hit)). static int calc_your_to_hit_unarmed(int uattack = UNAT_NO_ATTACK, @@ -2408,7 +2399,7 @@ void melee_attack::chaos_affects_defender() beam.ench_power = beam.damage.num; - fire_beam(beam); + beam.fire(); if (you.can_see(defender)) obvious_effect = beam.obvious_effect; @@ -2975,7 +2966,7 @@ bool melee_attack::apply_damage_brand() beam_temp.beam_source = (attacker->atype() == ACT_PLAYER) ? MHITYOU : monster_index(atk); - mons_ench_f2( def, beam_temp ); + beam_temp.apply_enchantment_to_monster(def); obvious_effect = beam_temp.obvious_effect; } -- cgit v1.2.3-54-g00ecf