summaryrefslogtreecommitdiff
path: root/lib/core
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-04-02 22:10:00 +0200
committerBardur Arantsson <bardur@scientician.net>2012-04-07 15:28:25 +0200
commita77005060dac93cfdd5cdfdf7dc849e0f5207f60 (patch)
tree50fcc8d4f1ad5120547113f248e2ece67fc7dd5c /lib/core
parent2d8ba33e34c0cbab8b7db8bbd972f1b18b28b199 (diff)
Lua: Move get_level_{use,max}_stick bits to C
Diffstat (limited to 'lib/core')
-rw-r--r--lib/core/s_aux.lua26
1 files changed, 3 insertions, 23 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