summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-08 12:34:34 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-08 12:34:34 +0000
commit1688c6756463c584f8130785a7f84dfece538fdf (patch)
treedca3df0dd0848272b94eaefa1fc5db6fa9f686b8 /crawl-ref/source/spells4.cc
parent98ffb74e5af50771a94e1b92a0bd97dc804ab8cf (diff)
downloadcrawl-ref-1688c6756463c584f8130785a7f84dfece538fdf.tar.gz
crawl-ref-1688c6756463c584f8130785a7f84dfece538fdf.zip
The accuracy of dragon breath is now halved if you're wielding
a weapon of dragon slaying (with the somewhat weak reasoning that a dragon will try to avert its eyes from your awful weapon). From how I read the code this function is only called if you are attacked as monsters will not breathe at other monsters, so that the above check is valid. Also fix 1865179: Airstrike now wakes (and annoys) monsters. 1861118: Evaporate now can be cancelled during potion or direction choice. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3223 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc30
1 files changed, 4 insertions, 26 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 173f4ea7fd..665ebd1901 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -1680,43 +1680,21 @@ bool backlight_monsters(int x, int y, int pow, int garbage)
return (true);
} // end backlight_monsters()
-void cast_evaporate(int pow)
+bool cast_evaporate(int pow, bolt& beem, int potion)
{
// experimenting with allowing the potion to be thrown... we're
// still making it have to be "in hands" at this point. -- bwr
struct dist spelld;
- struct bolt beem;
-
- const int potion =
- prompt_invent_item( "Throw which potion?", MT_INVLIST, OBJ_POTIONS );
if (potion == -1)
- {
- msg::stream << "Wisps of steam play over your " << your_hand(true)
- << '.' << std::endl;
- return;
- }
+ return (false);
else if (you.inv[potion].base_type != OBJ_POTIONS)
{
mpr( "This spell works only on potions!" );
canned_msg(MSG_SPELL_FIZZLES);
- return;
- }
-
- message_current_target();
- direction( spelld, DIR_NONE, TARG_ENEMY );
-
- if (!spelld.isValid)
- {
- canned_msg(MSG_SPELL_FIZZLES);
- return;
+ return (false);
}
- beem.set_target(spelld);
-
- beem.source_x = you.x_pos;
- beem.source_y = you.y_pos;
-
beem.name = "potion";
beem.colour = you.inv[potion].colour;
beem.range = 9;
@@ -1812,7 +1790,7 @@ void cast_evaporate(int pow)
// both old and new code use up a potion:
dec_inv_item_quantity( potion, 1 );
- return;
+ return (true);
} // end cast_evaporate()
// The intent of this spell isn't to produce helpful potions