diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-05-12 12:32:36 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-05-12 12:32:36 +0200 |
commit | 0f3e84929038eeff1135bd7462347be64ac9fc71 (patch) | |
tree | 575905489b3e96c4483e2cd664ed8370a2dcbd76 /lib/mods | |
parent | 226d3565889f551c00d4fccf184c98edb12c07c7 (diff) |
Lua: Move "Udun" spell functions to C
Diffstat (limited to 'lib/mods')
-rw-r--r-- | lib/mods/theme/scpt/s_udun.lua | 83 |
1 files changed, 8 insertions, 75 deletions
diff --git a/lib/mods/theme/scpt/s_udun.lua b/lib/mods/theme/scpt/s_udun.lua index c4266239..3ddfeb14 100644 --- a/lib/mods/theme/scpt/s_udun.lua +++ b/lib/mods/theme/scpt/s_udun.lua @@ -8,49 +8,8 @@ DRAIN = add_spell ["mana"] = 0, ["mana_max"] = 0, ["fail"] = 20, - ["spell"] = function() - local ret, item, obj, o_name, add - - -- Ask for an item - ret, item = get_item("What item to drain?", "You have nothing you can drain", USE_INVEN, - function (obj) - if (obj.tval == TV_WAND) or (obj.tval == TV_ROD_MAIN) or (obj.tval == TV_STAFF) then - return TRUE - end - return FALSE - end - ) - - if ret == TRUE then - -- get the item - obj = get_object(item) - - add = 0 - if (obj.tval == TV_STAFF) or (obj.tval == TV_WAND) then - local kind = get_kind(obj) - - add = kind.level * obj.pval * obj.number - - -- Destroy it! - inven_item_increase(item, -99) - inven_item_describe(item) - inven_item_optimize(item) - end - if obj.tval == TV_ROD_MAIN then - add = obj.timeout - obj.timeout = 0; - - --Combine / Reorder the pack (later) - player.notice = bor(player.notice, PN_COMBINE, PN_REORDER) - player.window = bor(player.window, PW_INVEN, PW_EQUIP, PW_PLAYER) - end - increase_mana(add) - end - return TRUE - end, - ["info"] = function() - return "" - end, + ["spell"] = function() return udun_drain() end, + ["info"] = function() return udun_drain_info() end, ["desc"] = { "Drains the mana contained in wands, staves and rods to increase yours", } @@ -74,26 +33,8 @@ GENOCIDE = add_spell ["max_level"] = { 5, 15 }, }, }, - ["spell"] = function() - local type - - type = 0 - if get_level(GENOCIDE) >= 10 then type = 1 end - if type == 0 then - genocide(TRUE) - return TRUE - else - if get_check("Genocide all monsters near you? ") == TRUE then - mass_genocide(TRUE) - else - genocide(TRUE) - end - return TRUE - end - end, - ["info"] = function() - return "" - end, + ["spell"] = function() return udun_genocide() end, + ["info"] = function() return udun_genocide_info() end, ["desc"] = { "Genocides all monsters of a race on the level", "At level 10 it can genocide all monsters near you" @@ -109,12 +50,8 @@ WRAITHFORM = add_spell ["mana_max"] = 40, ["fail"] = 95, ["inertia"] = { 4, 30 }, - ["spell"] = function() - return set_shadow(randint(30) + 20 + get_level(WRAITHFORM, 40)) - end, - ["info"] = function() - return "dur "..(20 + get_level(WRAITHFORM, 40)).."+d30" - end, + ["spell"] = function() return udun_wraithform() end, + ["info"] = function() return udun_wraithform_info() end, ["desc"] = { "Turns you into an immaterial being", } @@ -129,12 +66,8 @@ FLAMEOFUDUN = add_spell ["mana_max"] = 100, ["fail"] = 95, ["inertia"] = { 7, 15 }, - ["spell"] = function() - return set_mimic(randint(15) + 5 + get_level(FLAMEOFUDUN, 30), resolve_mimic_name("Balrog"), get_level(FLAMEOFUDUN)) - end, - ["info"] = function() - return "dur "..(5 + get_level(FLAMEOFUDUN, 30)).."+d15" - end, + ["spell"] = function() return udun_flame_of_udun() end, + ["info"] = function() return udun_flame_of_udun_info() end, ["desc"] = { "Turns you into a powerful Balrog", } |