diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-04-02 22:10:00 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-04-07 15:28:25 +0200 |
commit | a77005060dac93cfdd5cdfdf7dc849e0f5207f60 (patch) | |
tree | 50fcc8d4f1ad5120547113f248e2ece67fc7dd5c /lib | |
parent | 2d8ba33e34c0cbab8b7db8bbd972f1b18b28b199 (diff) |
Lua: Move get_level_{use,max}_stick bits to C
Diffstat (limited to 'lib')
-rw-r--r-- | lib/core/s_aux.lua | 26 | ||||
-rw-r--r-- | lib/mods/theme/core/s_aux.lua | 26 |
2 files changed, 6 insertions, 46 deletions
diff --git a/lib/core/s_aux.lua b/lib/core/s_aux.lua index 8ae69749..29b22fd7 100644 --- a/lib/core/s_aux.lua +++ b/lib/core/s_aux.lua @@ -201,22 +201,10 @@ function get_level_school(s, max, min) end -- The real get_level, works for schooled magic and for innate powers -get_level_use_stick = -1 -get_level_max_stick = -1 function get_level(s, max, min) - if type(s) == "number" then - -- Ahah shall we use Magic device instead ? - if get_level_use_stick > -1 then - if not max then max = 50 end - if not min then min = 1 end - return get_level_device(s, max, min) - else - local lvl, na = get_level_school(s, max, min) - return lvl - end - else - return get_level_power(s, max, min) - end + if not max then max = 50 end + if not min then min = 1 end + return %get_level(s, max, min) end -- Can we cast the spell ? @@ -249,14 +237,6 @@ function get_power_name(s) end end --- Get the level of a power -function get_level_power(s, max, min) - if not max then max = 50 end - if not min then min = 1 end - - return value_scale(s.get_current_level(), 50, max, min) -end - -- Changes the amount of power(mana, piety, whatever) for the spell function adjust_power(s, x) if check_affect(s, "piety", FALSE) then diff --git a/lib/mods/theme/core/s_aux.lua b/lib/mods/theme/core/s_aux.lua index 8ae69749..29b22fd7 100644 --- a/lib/mods/theme/core/s_aux.lua +++ b/lib/mods/theme/core/s_aux.lua @@ -201,22 +201,10 @@ function get_level_school(s, max, min) end -- The real get_level, works for schooled magic and for innate powers -get_level_use_stick = -1 -get_level_max_stick = -1 function get_level(s, max, min) - if type(s) == "number" then - -- Ahah shall we use Magic device instead ? - if get_level_use_stick > -1 then - if not max then max = 50 end - if not min then min = 1 end - return get_level_device(s, max, min) - else - local lvl, na = get_level_school(s, max, min) - return lvl - end - else - return get_level_power(s, max, min) - end + if not max then max = 50 end + if not min then min = 1 end + return %get_level(s, max, min) end -- Can we cast the spell ? @@ -249,14 +237,6 @@ function get_power_name(s) end end --- Get the level of a power -function get_level_power(s, max, min) - if not max then max = 50 end - if not min then min = 1 end - - return value_scale(s.get_current_level(), 50, max, min) -end - -- Changes the amount of power(mana, piety, whatever) for the spell function adjust_power(s, x) if check_affect(s, "piety", FALSE) then |