From 5e9711e3e42885fe4ba533db4824fa5ecb88d8c4 Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Sun, 8 Nov 2009 16:01:23 -0800 Subject: Beam feedback for Phase Shift and paralysis --- crawl-ref/source/beam.cc | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 916e47176a..13826a0e80 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3621,6 +3621,7 @@ bool bolt::misses_player() return (false); const int dodge = player_evasion(); + const int dodge_less = player_evasion(EV_IGNORE_PHASESHIFT); int real_tohit = hit; // Monsters shooting at an invisible player are very inaccurate. @@ -3677,25 +3678,45 @@ bool bolt::misses_player() defer_rand r; bool miss = true; - if (!_test_beam_hit(real_tohit, dodge, is_beam, false, false, r)) + bool dmsl = you.duration[DUR_DEFLECT_MISSILES]; + bool rmsl = dmsl || you.duration[DUR_REPEL_MISSILES] + || player_mutation_level(MUT_REPULSION_FIELD) == 3; + + if (!_test_beam_hit(real_tohit, dodge_less, is_beam, false, false, r)) { mprf("The %s misses you.", name.c_str()); } - else if ((you.duration[DUR_REPEL_MISSILES] - || player_mutation_level(MUT_REPULSION_FIELD) == 3 - || you.duration[DUR_DEFLECT_MISSILES]) - && !_test_beam_hit(real_tohit, dodge, is_beam, false, true, r)) + else if (!_test_beam_hit(real_tohit, dodge_less, is_beam, false, rmsl, r)) { mprf("The %s is repelled.", name.c_str()); } - else if (you.duration[DUR_DEFLECT_MISSILES] - && !_test_beam_hit(real_tohit, dodge, is_beam, true, true, r)) + else if (!_test_beam_hit(real_tohit, dodge_less, is_beam, dmsl, rmsl, r)) { // active voice to imply stronger effect mprf("You deflect the %s!", name.c_str()); } + else if (!_test_beam_hit(real_tohit, dodge, is_beam, dmsl, rmsl, r)) + { + mprf("You momentarily phase out as the %s " + "passes through you.", name.c_str()); + } else { + const bool engulfs = is_explosion || is_big_cloud; + int dodge_more = player_evasion(EV_IGNORE_HELPLESS); + + if (hit_verb.empty()) + hit_verb = engulfs ? "engulfs" : "hits"; + + if (_test_beam_hit(real_tohit, dodge_more, is_beam, dmsl, rmsl, r)) + { + mprf("The %s %s you!", name.c_str(), hit_verb.c_str()); + } + else + { + mprf("Helpless, you fail to dodge the %s.", name.c_str()); + } + miss = false; } @@ -4022,11 +4043,6 @@ void bolt::affect_player() const bool engulfs = is_explosion || is_big_cloud; - if (hit_verb.empty()) - hit_verb = engulfs ? "engulfs" : "hits"; - - mprf("The %s %s you!", name.c_str(), hit_verb.c_str()); - // FIXME: Lots of duplicated code here (compare handling of // monsters) int hurted = 0; @@ -4821,6 +4837,8 @@ void bolt::affect_monster(monsters* mon) // The beam hit. if (mons_near(mon)) { + // Monsters don't currently use Phase Shift and are never currently + // helpless in ranged combat. if (hit_verb.empty()) hit_verb = engulfs ? "engulfs" : "hits"; -- cgit v1.2.3-54-g00ecf