diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-05 20:28:11 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-05 20:28:11 +0000 |
commit | 3119cff6c968cf6b28fc5ccb7769993e266fcea1 (patch) | |
tree | 7f4690a8bc953285f329d00f9dd4b2406236291b /crawl-ref/source/xom.cc | |
parent | 08c06de078c7f347ce2597ca296a1ab568799ecf (diff) | |
download | crawl-ref-3119cff6c968cf6b28fc5ccb7769993e266fcea1.tar.gz crawl-ref-3119cff6c968cf6b28fc5ccb7769993e266fcea1.zip |
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
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r-- | crawl-ref/source/xom.cc | 55 |
1 files 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); |