From 1e3740888ab90fe2e0ef04b1ae4e3b85c4b5b9b8 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Fri, 13 Apr 2012 18:36:50 +0200 Subject: Lua: Move "Eru" spell functions to C --- lib/scpt/s_eru.lua | 58 ++++++++---------------------------------------------- 1 file changed, 8 insertions(+), 50 deletions(-) (limited to 'lib/scpt/s_eru.lua') diff --git a/lib/scpt/s_eru.lua b/lib/scpt/s_eru.lua index c0cb0aaf..d61b6118 100644 --- a/lib/scpt/s_eru.lua +++ b/lib/scpt/s_eru.lua @@ -14,24 +14,8 @@ ERU_SEE = add_spell -- Unnafected by blindness ["blind"] = FALSE, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - local obvious - obvious = set_tim_invis(randint(20) + 10 + get_level(ERU_SEE, 100)) - if get_level(ERU_SEE) >= 30 then - wiz_lite_extra() - obvious = TRUE - elseif get_level(ERU_SEE) >= 10 then - map_area() - obvious = TRUE - end - if get_level(ERU_SEE) >= 20 then - obvious = is_obvious(set_blind(0), obvious) - end - return obvious - end, - ["info"] = function() - return "dur "..(10 + get_level(ERU_SEE, 100)).."+d20" - end, + ["spell"] = function() return eru_see_the_music() end, + ["info"] = function() return eru_see_the_music_info() end, ["desc"] = { "Allows you to 'see' the Great Music from which the world", "originates, allowing you to see unseen things", @@ -53,21 +37,8 @@ ERU_LISTEN = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - if get_level(ERU_LISTEN) >= 30 then - ident_all() - identify_pack() - return TRUE - elseif get_level(ERU_LISTEN) >= 14 then - identify_pack() - return TRUE - else - return ident_spell() - end - end, - ["info"] = function() - return "" - end, + ["spell"] = function() return eru_listen_to_the_music() end, + ["info"] = function() return eru_listen_to_the_music_info() end, ["desc"] = { "Allows you to listen to the Great Music from which the world", "originates, allowing you to understand the meaning of things", @@ -88,17 +59,8 @@ ERU_UNDERSTAND = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - if get_level(ERU_UNDERSTAND) >= 10 then - identify_pack_fully() - return TRUE - else - return identify_fully() - end - end, - ["info"] = function() - return "" - end, + ["spell"] = function() return eru_know_the_music() end, + ["info"] = function() return eru_know_the_music_info() end, ["desc"] = { "Allows you to understand the Great Music from which the world", "originates, allowing you to know the full abilities of things", @@ -118,12 +80,8 @@ ERU_PROT = add_spell ["piety"] = TRUE, ["stat"] = A_WIS, ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() - return fire_ball(GF_MAKE_GLYPH, 0, 1, 1 + get_level(ERU_PROT, 2, 0)) - end, - ["info"] = function() - return "rad "..(1 + get_level(ERU_PROT, 2, 0)) - end, + ["spell"] = function() return eru_lay_of_protection() end, + ["info"] = function() return eru_lay_of_protection_info() end, ["desc"] = { "Creates a circle of safety around you", } -- cgit v1.2.3 From d98a999477698bb0a304c4995df44f2b7ef5389d Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Tue, 29 May 2012 06:25:07 +0200 Subject: Lua: Convert all the spell metadata to C code (Yay automated translation!) --- lib/scpt/s_eru.lua | 88 ------------------------------------------------------ 1 file changed, 88 deletions(-) delete mode 100644 lib/scpt/s_eru.lua (limited to 'lib/scpt/s_eru.lua') diff --git a/lib/scpt/s_eru.lua b/lib/scpt/s_eru.lua deleted file mode 100644 index d61b6118..00000000 --- a/lib/scpt/s_eru.lua +++ /dev/null @@ -1,88 +0,0 @@ --- Handle Eru Iluvatar magic school - -ERU_SEE = add_spell -{ - ["name"] = "See the Music", - ["school"] = {SCHOOL_ERU}, - ["level"] = 1, - ["mana"] = 1, - ["mana_max"] = 50, - ["fail"] = 20, - -- Uses piety to cast - ["piety"] = TRUE, - ["stat"] = A_WIS, - -- Unnafected by blindness - ["blind"] = FALSE, - ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() return eru_see_the_music() end, - ["info"] = function() return eru_see_the_music_info() end, - ["desc"] = { - "Allows you to 'see' the Great Music from which the world", - "originates, allowing you to see unseen things", - "At level 10 it allows you to see your surroundings", - "At level 20 it allows you to cure blindness", - "At level 30 it allows you to fully see all the level" - } -} - -ERU_LISTEN = add_spell -{ - ["name"] = "Listen to the Music", - ["school"] = {SCHOOL_ERU}, - ["level"] = 7, - ["mana"] = 15, - ["mana_max"] = 200, - ["fail"] = 25, - -- Uses piety to cast - ["piety"] = TRUE, - ["stat"] = A_WIS, - ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() return eru_listen_to_the_music() end, - ["info"] = function() return eru_listen_to_the_music_info() end, - ["desc"] = { - "Allows you to listen to the Great Music from which the world", - "originates, allowing you to understand the meaning of things", - "At level 14 it allows you to identify all your pack", - "At level 30 it allows you to identify all items on the level", - } -} - -ERU_UNDERSTAND = add_spell -{ - ["name"] = "Know the Music", - ["school"] = {SCHOOL_ERU}, - ["level"] = 30, - ["mana"] = 200, - ["mana_max"] = 600, - ["fail"] = 50, - -- Uses piety to cast - ["piety"] = TRUE, - ["stat"] = A_WIS, - ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() return eru_know_the_music() end, - ["info"] = function() return eru_know_the_music_info() end, - ["desc"] = { - "Allows you to understand the Great Music from which the world", - "originates, allowing you to know the full abilities of things", - "At level 10 it allows you to *identify* all your pack", - } -} - -ERU_PROT = add_spell -{ - ["name"] = "Lay of Protection", - ["school"] = {SCHOOL_ERU}, - ["level"] = 35, - ["mana"] = 400, - ["mana_max"] = 400, - ["fail"] = 80, - -- Uses piety to cast - ["piety"] = TRUE, - ["stat"] = A_WIS, - ["random"] = SKILL_SPIRITUALITY, - ["spell"] = function() return eru_lay_of_protection() end, - ["info"] = function() return eru_lay_of_protection_info() end, - ["desc"] = { - "Creates a circle of safety around you", - } -} -- cgit v1.2.3