diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-25 17:13:23 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-25 17:13:23 +0000 |
commit | 1f9e38751c81744f2e8d4ffb1aea7f3870ba9d5b (patch) | |
tree | 8dfafad2a170ec6b870f90c9cf3aee89638a33cd /crawl-ref/source/spells4.cc | |
parent | 67f77bb507d0f27b169f53258bcc94a24d7f8894 (diff) | |
download | crawl-ref-1f9e38751c81744f2e8d4ffb1aea7f3870ba9d5b.tar.gz crawl-ref-1f9e38751c81744f2e8d4ffb1aea7f3870ba9d5b.zip |
Ranges redone. bolt no longer has a rangeMax, just a range.
Almost all ranges are now capped by LOS. There are still some things
missing, most noticeably randomizing ranges for the range-1-to-2
spells (e.g. Flame Tongue.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6984 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r-- | crawl-ref/source/spells4.cc | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index d2a9210cc8..002554c889 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -1266,21 +1266,13 @@ bool backlight_monsters(coord_def where, int pow, int garbage) return (true); } -bool cast_evaporate(int pow, bolt& beem, int potion) +bool cast_evaporate(int pow, bolt& beem, int pot_idx) { - if (potion == -1) - return (false); - else if (you.inv[potion].base_type != OBJ_POTIONS) - { - mpr( "This spell works only on potions!" ); - canned_msg(MSG_SPELL_FIZZLES); - return (false); - } + ASSERT(you.inv[pot_idx].base_type == OBJ_POTIONS); + item_def& potion = you.inv[pot_idx]; beem.name = "potion"; - beem.colour = you.inv[potion].colour; - beem.range = 9; - beem.rangeMax = 9; + beem.colour = potion.colour; beem.type = dchar_glyph(DCHAR_FIRED_FLASK); beem.beam_source = MHITYOU; beem.thrower = KILL_YOU_MISSILE; @@ -1294,7 +1286,7 @@ bool cast_evaporate(int pow, bolt& beem, int potion) beem.flavour = BEAM_POTION_STINKING_CLOUD; beam_type tracer_flavour = BEAM_MMISSILE; - switch (you.inv[potion].sub_type) + switch (potion.sub_type) { case POT_STRONG_POISON: beem.flavour = BEAM_POTION_POISON; @@ -1341,7 +1333,7 @@ bool cast_evaporate(int pow, bolt& beem, int potion) case POT_BERSERK_RAGE: beem.effect_known = false; beem.flavour = (coinflip() ? BEAM_POTION_FIRE : BEAM_POTION_STEAM); - if (you.inv[potion].sub_type == POT_BERSERK_RAGE) + if (potion.sub_type == POT_BERSERK_RAGE) tracer_flavour = BEAM_FIRE; else tracer_flavour = BEAM_RANDOM; @@ -1412,13 +1404,13 @@ bool cast_evaporate(int pow, bolt& beem, int potion) fire_beam(beem); // Use up a potion. - if (is_blood_potion(you.inv[potion])) - remove_oldest_blood_potion(you.inv[potion]); + if (is_blood_potion(potion)) + remove_oldest_blood_potion(potion); - dec_inv_item_quantity( potion, 1 ); + dec_inv_item_quantity( pot_idx, 1 ); return (true); -} // end cast_evaporate() +} // The intent of this spell isn't to produce helpful potions // for drinking, but rather to provide ammo for the Evaporate |