diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-05-12 14:55:09 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-05-12 15:50:48 +0200 |
commit | 2ead486354a2934f3d3e4e2ebb86e95653ee4b23 (patch) | |
tree | 3fe4545eb1c7cec805a92a08f3b5d0be9b0551da /lib/mods | |
parent | 363eb2f7405a66b496641d77aaa0b8a3d6c63384 (diff) |
Lua: Move "Yavanna" spell functions to C
Diffstat (limited to 'lib/mods')
-rw-r--r-- | lib/mods/theme/scpt/s_yavann.lua | 77 |
1 files changed, 10 insertions, 67 deletions
diff --git a/lib/mods/theme/scpt/s_yavann.lua b/lib/mods/theme/scpt/s_yavann.lua index 2f594e85..a2b2fe1c 100644 --- a/lib/mods/theme/scpt/s_yavann.lua +++ b/lib/mods/theme/scpt/s_yavann.lua @@ -12,15 +12,8 @@ YAVANNA_CHARM_ANIMAL = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - local ret, dir = get_aim_dir() - if ret == FALSE then return end - - return fire_ball(GF_CONTROL_ANIMAL, dir, 10 + get_level(YAVANNA_CHARM_ANIMAL, 170), get_level(YAVANNA_CHARM_ANIMAL, 2)) - end, - ["info"] = function() - return "power "..(10 + get_level(YAVANNA_CHARM_ANIMAL, 170)).." rad "..(get_level(YAVANNA_CHARM_ANIMAL, 2)) - end, + ["spell"] = function() return yavanna_charm_animal() end, + ["info"] = function() return yavanna_charm_animal_info() end, ["desc"] = { "It tries to tame an animal", } @@ -38,13 +31,8 @@ YAVANNA_GROW_GRASS = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - grow_grass(get_level(YAVANNA_GROW_GRASS, 4)) - return TRUE - end, - ["info"] = function() - return "rad "..(get_level(YAVANNA_GROW_GRASS, 4)) - end, + ["spell"] = function() return yavanna_grow_grass() end, + ["info"] = function() return yavanna_grow_grass_info() end, ["desc"] = { "Create a floor of grass around you. While on grass and praying", "a worshipper of Yavanna will know a greater regeneration rate" @@ -63,12 +51,8 @@ YAVANNA_TREE_ROOTS = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - return set_roots(10 + get_level(YAVANNA_TREE_ROOTS, 30), 10 + get_level(YAVANNA_TREE_ROOTS, 60), 10 + get_level(YAVANNA_TREE_ROOTS, 20)) - end, - ["info"] = function() - return "dur "..(10 + get_level(YAVANNA_TREE_ROOTS, 30)).." AC "..(10 + get_level(YAVANNA_TREE_ROOTS, 60)).." dam "..(10 + get_level(YAVANNA_TREE_ROOTS, 20)) - end, + ["spell"] = function() return yavanna_tree_roots() end, + ["info"] = function() return yavanna_tree_roots_info() end, ["desc"] = { "Creates roots deep in the floor from your feet, making you more stable and able", "to make stronger attacks, but prevents any movement (even teleportation).", @@ -88,21 +72,8 @@ YAVANNA_WATER_BITE = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - local rad - - rad = 0 - if get_level(YAVANNA_WATER_BITE) >= 25 then rad = 1 end - - return set_project(randint(30) + 30 + get_level(YAVANNA_WATER_BITE, 150), - GF_WATER, - 10 + get_level(YAVANNA_WATER_BITE), - rad, - bor(PROJECT_STOP, PROJECT_KILL)) - end, - ["info"] = function() - return "dur "..(30 + get_level(YAVANNA_WATER_BITE, 150)).."+d30 dam "..(10 + get_level(YAVANNA_WATER_BITE)).."/blow" - end, + ["spell"] = function() return yavanna_water_bite() end, + ["info"] = function() return yavanna_water_bite_info() end, ["desc"] = { "Imbues your melee weapon with a natural stream of water", "At level 25, it spreads over a 1 radius zone around your target" @@ -121,36 +92,8 @@ YAVANNA_UPROOT = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - local m_idx, x, y, c_ptr, ret, dir - - ret, dir = get_rep_dir() - if ret == FALSE then return end - y, x = explode_dir(dir) - y, x = y + player.py, x + player.px - c_ptr = cave(y, x) - - if c_ptr.feat == FEAT_TREES then - cave_set_feat(y, x, FEAT_GRASS); - - -- Summon it - y, x = find_position(y, x) - m_idx = place_monster_one(y, x, test_monster_name("Ent"), 0, FALSE, MSTATUS_FRIEND) - - -- level it - if m_idx ~= 0 then - monster_set_level(m_idx, 30 + get_level(YAVANNA_UPROOT, 70)) - end - - msg_print("The tree awakes!"); - else - msg_print("There is no tree there.") - end - return TRUE - end, - ["info"] = function() - return "lev "..(30 + get_level(YAVANNA_UPROOT, 70)) - end, + ["spell"] = function() return yavanna_uproot() end, + ["info"] = function() return yavanna_uproot_info() end, ["desc"] = { "Awakes a tree to help you battle the forces of Morgoth", } |