diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-05-12 13:09:43 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-05-12 14:36:15 +0200 |
commit | 363eb2f7405a66b496641d77aaa0b8a3d6c63384 (patch) | |
tree | 0618af279a988c863026feccb72c1e6221f645b8 /lib/scpt | |
parent | 0f3e84929038eeff1135bd7462347be64ac9fc71 (diff) |
Lua: Move "Water" spell functions to C
Diffstat (limited to 'lib/scpt')
-rw-r--r-- | lib/scpt/s_water.lua | 68 |
1 files changed, 10 insertions, 58 deletions
diff --git a/lib/scpt/s_water.lua b/lib/scpt/s_water.lua index 739b066b..46942c5d 100644 --- a/lib/scpt/s_water.lua +++ b/lib/scpt/s_water.lua @@ -19,13 +19,8 @@ TIDALWAVE = add_spell }, }, ["inertia"] = { 4, 100 }, - ["spell"] = function() - fire_wave(GF_WAVE, 0, 40 + get_level(TIDALWAVE, 200), 0, 6 + get_level(TIDALWAVE, 10), EFF_WAVE) - return TRUE - end, - ["info"] = function() - return "dam "..(40 + get_level(TIDALWAVE, 200)).." rad "..(6 + get_level(TIDALWAVE, 10)) - end, + ["spell"] = function() return water_tidal_wave() end, + ["info"] = function() return water_tidal_wave_info() end, ["desc"] = { "Summons a monstrous tidal wave that will expand and crush the", "monsters under its mighty waves." @@ -51,17 +46,8 @@ ICESTORM = add_spell }, }, ["inertia"] = { 3, 40 }, - ["spell"] = function() - local type - - if get_level(ICESTORM, 50) >= 10 then type = GF_ICE - else type = GF_COLD end - fire_wave(type, 0, 80 + get_level(ICESTORM, 200), 1 + get_level(ICESTORM, 3, 0), 20 + get_level(ICESTORM, 70), EFF_STORM) - return TRUE - end, - ["info"] = function() - return "dam "..(80 + get_level(ICESTORM, 200)).." rad "..(1 + get_level(ICESTORM, 3, 0)).." dur "..(20 + get_level(ICESTORM, 70)) - end, + ["spell"] = function() return water_ice_storm() end, + ["info"] = function() return water_ice_storm_info() end, ["desc"] = { "Engulfs you in a storm of roaring cold that strikes your foes.", "At level 10 it turns into shards of ice." @@ -77,24 +63,8 @@ ENTPOTION = add_spell ["mana_max"] = 15, ["fail"] = 35, ["inertia"] = { 1, 30 }, - ["spell"] = function() - set_food(PY_FOOD_MAX - 1) - msg_print("The Ent's Potion fills your stomach.") - if get_level(ENTPOTION, 50) >= 5 then - set_afraid(0) - end - if get_level(ENTPOTION, 50) >= 12 then - set_hero(player.hero + randint(25) + 25 + get_level(ENTPOTION, 40)) - end - return TRUE - end, - ["info"] = function() - if get_level(ENTPOTION, 50) >= 12 then - return "dur "..(25 + get_level(ENTPOTION, 40)).."+d25" - else - return "" - end - end, + ["spell"] = function() return water_ent_potion() end, + ["info"] = function() return water_ent_potion_info() end, ["desc"] = { "Fills up your stomach.", "At level 5 it boldens your heart.", @@ -111,22 +81,13 @@ VAPOR = add_spell ["mana_max"] = 12, ["fail"] = 20, ["inertia"] = { 1, 30 }, - ["spell"] = function() - fire_cloud(GF_WATER, 0, 3 + get_level(VAPOR, 20), 3 + get_level(VAPOR, 9, 0), 5) - return TRUE - end, - ["info"] = function() - return "dam "..(3 + get_level(VAPOR, 20)).." rad "..(3 + get_level(VAPOR, 9, 0)).." dur 5" - end, + ["spell"] = function() return water_vapor() end, + ["info"] = function() return water_vapor_info() end, ["desc"] = { "Fills the air with toxic moisture to eradicate annoying critters." } } -function get_geyser_damage() - return get_level(GEYSER, 10), 3 + get_level(GEYSER, 35) -end - GEYSER = add_spell { ["name"] = "Geyser", @@ -135,17 +96,8 @@ GEYSER = add_spell ["mana"] = 1, ["mana_max"] = 35, ["fail"] = 5, - ["spell"] = function() - local ret, dir - ret, dir = get_aim_dir() - if ret == FALSE then return end - return fire_bolt_or_beam(2 * get_level(GEYSER, 85), GF_WATER, dir, damroll(get_geyser_damage())) - end, - ["info"] = function() - local n, d - n, d = get_geyser_damage() - return "dam "..n.."d"..d - end, + ["spell"] = function() return water_geyser() end, + ["info"] = function() return water_geyser_info() end, ["desc"] = { "Shoots a geyser of water from your fingertips.", |