From 3119cff6c968cf6b28fc5ccb7769993e266fcea1 Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 5 Jul 2008 20:28:11 +0000 Subject: Fix [2011384]: Make Xom's divine lightning conditional on dangerous monsters' being nearby again. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6413 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/xom.cc | 55 ++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index ee2b1fad67..bfcbc4a87a 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -691,34 +691,37 @@ static bool _xom_is_good(int sever) } else if (random2(sever) <= 11) { - if (you.hp <= random2(201) && player_in_a_dangerous_place()) - you.attribute[ATTR_DIVINE_LIGHTNING_PROTECTION] = 1; - - god_speaks(GOD_XOM, "The area is suffused with divine lightning!"); - - bolt beam; - beam.beam_source = NON_MONSTER; - beam.type = dchar_glyph(DCHAR_FIRED_BURST); - beam.damage = dice_def(3, 30); - beam.flavour = BEAM_ELECTRICITY; - beam.target_x = you.x_pos; - beam.target_y = you.y_pos; - beam.name = "blast of lightning"; - beam.colour = LIGHTCYAN; - beam.thrower = KILL_MISC; - beam.aux_source = "Xom's lightning strike"; - beam.ex_size = 2; - beam.is_tracer = false; - beam.is_explosion = true; - explosion(beam); - - if (you.attribute[ATTR_DIVINE_LIGHTNING_PROTECTION]) + if (player_in_a_dangerous_place()) { - mpr("Your divine protection wanes."); - you.attribute[ATTR_DIVINE_LIGHTNING_PROTECTION] = 0; - } + if (you.hp <= random2(201)) + you.attribute[ATTR_DIVINE_LIGHTNING_PROTECTION] = 1; + + god_speaks(GOD_XOM, "The area is suffused with divine lightning!"); + + bolt beam; + beam.beam_source = NON_MONSTER; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); + beam.damage = dice_def(3, 30); + beam.flavour = BEAM_ELECTRICITY; + beam.target_x = you.x_pos; + beam.target_y = you.y_pos; + beam.name = "blast of lightning"; + beam.colour = LIGHTCYAN; + beam.thrower = KILL_MISC; + beam.aux_source = "Xom's lightning strike"; + beam.ex_size = 2; + beam.is_tracer = false; + beam.is_explosion = true; + explosion(beam); + + if (you.attribute[ATTR_DIVINE_LIGHTNING_PROTECTION]) + { + mpr("Your divine protection wanes."); + you.attribute[ATTR_DIVINE_LIGHTNING_PROTECTION] = 0; + } - done = true; + done = true; + } } return (done); -- cgit v1.2.3-54-g00ecf