summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-05-15 21:29:50 +0200
committerBardur Arantsson <bardur@scientician.net>2012-05-16 06:03:31 +0200
commit7c95b69311bcbadb84fba499584fe721612ca144 (patch)
tree95f0880109e7728b07b02740138751ae232c1bb2 /lib
parentb446c8368b172aa29d312cf7eeca5e8547e73c81 (diff)
Lua: Move 'print_spell_desc' and 'spell_x' to C
Diffstat (limited to 'lib')
-rw-r--r--lib/core/s_aux.lua50
-rw-r--r--lib/mods/theme/core/s_aux.lua50
2 files changed, 4 insertions, 96 deletions
diff --git a/lib/core/s_aux.lua b/lib/core/s_aux.lua
index 97643626..6cdcbd82 100644
--- a/lib/core/s_aux.lua
+++ b/lib/core/s_aux.lua
@@ -300,42 +300,12 @@ function print_book(book, spl, obj)
return y
end
--- Output the describtion when it is used as a spell
-function print_spell_desc(s, y)
- local index, desc, x
-
- x = 0
-
- if type(__spell_desc[s]) == "string" then c_prt(TERM_L_BLUE, __spell_desc[s], y, x)
- else
- for index, desc in __spell_desc[s] do
- c_prt(TERM_L_BLUE, desc, y, x)
- y = y + 1
- end
- end
- if check_affect(s, "piety", FALSE) then
- c_prt(TERM_L_WHITE, "It uses piety to cast.", y, x)
- y = y + 1
- end
- if not check_affect(s, "blind") then
- c_prt(TERM_ORANGE, "It is castable even while blinded.", y, x)
- y = y + 1
- end
- if not check_affect(s, "confusion") then
- c_prt(TERM_ORANGE, "It is castable even while confused.", y, x)
- y = y + 1
- end
-end
-
-- Output the desc when sued as a device
function print_device_desc(s)
local index, desc
- if type(__spell_desc[s]) == "string" then text_out(__spell_desc[s])
- else
- for index, desc in __spell_desc[s] do
- text_out("\n" .. desc)
- end
+ for index, desc in __spell_desc[s] do
+ text_out("\n" .. desc)
end
end
@@ -356,22 +326,6 @@ function book_spells_num(book)
return size
end
-function spell_x(book, spl, s)
- if book == 255 then
- return spl
- else
- local i, x, val
-
- i, val = next(school_book[book], nil)
- x = 0
- while x < s do
- i, val = next(school_book[book], i)
- x = x + 1
- end
- return val
- end
-end
-
function spell_in_book(book, spell)
local i, s
diff --git a/lib/mods/theme/core/s_aux.lua b/lib/mods/theme/core/s_aux.lua
index 97643626..6cdcbd82 100644
--- a/lib/mods/theme/core/s_aux.lua
+++ b/lib/mods/theme/core/s_aux.lua
@@ -300,42 +300,12 @@ function print_book(book, spl, obj)
return y
end
--- Output the describtion when it is used as a spell
-function print_spell_desc(s, y)
- local index, desc, x
-
- x = 0
-
- if type(__spell_desc[s]) == "string" then c_prt(TERM_L_BLUE, __spell_desc[s], y, x)
- else
- for index, desc in __spell_desc[s] do
- c_prt(TERM_L_BLUE, desc, y, x)
- y = y + 1
- end
- end
- if check_affect(s, "piety", FALSE) then
- c_prt(TERM_L_WHITE, "It uses piety to cast.", y, x)
- y = y + 1
- end
- if not check_affect(s, "blind") then
- c_prt(TERM_ORANGE, "It is castable even while blinded.", y, x)
- y = y + 1
- end
- if not check_affect(s, "confusion") then
- c_prt(TERM_ORANGE, "It is castable even while confused.", y, x)
- y = y + 1
- end
-end
-
-- Output the desc when sued as a device
function print_device_desc(s)
local index, desc
- if type(__spell_desc[s]) == "string" then text_out(__spell_desc[s])
- else
- for index, desc in __spell_desc[s] do
- text_out("\n" .. desc)
- end
+ for index, desc in __spell_desc[s] do
+ text_out("\n" .. desc)
end
end
@@ -356,22 +326,6 @@ function book_spells_num(book)
return size
end
-function spell_x(book, spl, s)
- if book == 255 then
- return spl
- else
- local i, x, val
-
- i, val = next(school_book[book], nil)
- x = 0
- while x < s do
- i, val = next(school_book[book], i)
- x = x + 1
- end
- return val
- end
-end
-
function spell_in_book(book, spell)
local i, s