diff options
author | Steve Melenchuk <smelenchuk@gmail.com> | 2013-05-06 14:56:31 -0600 |
---|---|---|
committer | Steve Melenchuk <smelenchuk@gmail.com> | 2013-05-06 14:56:31 -0600 |
commit | c494288c9e3e6f405f4286adf06a007055a3b08c (patch) | |
tree | a5c4e309325a1b3491d9e085a5fcd7141a7c4575 /crawl-ref/source/l_spells.cc | |
parent | 81797164b00afdef286fafed7f70d5a4e80c7c84 (diff) | |
download | crawl-ref-c494288c9e3e6f405f4286adf06a007055a3b08c.tar.gz crawl-ref-c494288c9e3e6f405f4286adf06a007055a3b08c.zip |
Round two of duplicate code pruning for LOS attack spells.
As a reminder for those of you that don't remember b4b189b, this merges
handling for player and monster casting of Drain Life, Ozocubu's
Refrigeration, and Olgreb's Toxic Radiance so as to prune a lot of
duplicate handling between the three spells/abilities; it was reverted
because the previous version of this cleanup exhibited problems when
several of the same type of monster were in sight (#6566).
The new version of the code splits player-as-target and
monster-as-target code into their own functions (another concern raised
with the original version of this code).
Probably this can be cleaned up more, but it's better than either the
original version or the first version of the pruned code!
This reverts commit bd9d7a8fecc46bef40d884854d0cc567ce64d912.
Diffstat (limited to 'crawl-ref/source/l_spells.cc')
-rw-r--r-- | crawl-ref/source/l_spells.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/l_spells.cc b/crawl-ref/source/l_spells.cc index 31336fd8f8..2e522ae1c1 100644 --- a/crawl-ref/source/l_spells.cc +++ b/crawl-ref/source/l_spells.cc @@ -12,8 +12,12 @@ #include "env.h" #include "spl-damage.h" -LUAWRAP(_refrigeration, cast_refrigeration(luaL_checkint(ls, 1), true)) -LUAWRAP(_toxic_radiance, cast_toxic_radiance(true)) +LUAWRAP(_refrigeration, + cast_los_attack_spell(SPELL_OZOCUBUS_REFRIGERATION, + luaL_checkint(ls, 1), NULL, true)) +LUAWRAP(_toxic_radiance, + cast_los_attack_spell(SPELL_OLGREBS_TOXIC_RADIANCE, + luaL_checkint(ls, 1), NULL, true)) const struct luaL_reg spells_dlib[] = { |