diff options
author | Manoj Srivastava <srivasta@debian.org> | 2014-05-14 23:54:09 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2014-05-14 23:54:09 -0700 |
commit | 4f8b58cc5366bfc2ea3b56fe6ff0443464d10f0f (patch) | |
tree | a0a9cad00e7916b9a97e14831fb362f21871cbef /lib/mods/theme/core/objects.lua |
tome (2.3.11-ah-2) unstable; urgency=low
* Modified the install paths to deploy to the FHS compliant
/usr/games/tome and /var/games/tome, as we have always done
* This is a major change, and includes theming. Some of the options have
changed. Because of this, the manual page has been removed; there is a
command line help option and in game help until the manual page is
rewritten.
# imported from the archive
Diffstat (limited to 'lib/mods/theme/core/objects.lua')
-rw-r--r-- | lib/mods/theme/core/objects.lua | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/mods/theme/core/objects.lua b/lib/mods/theme/core/objects.lua new file mode 100644 index 00000000..97320b82 --- /dev/null +++ b/lib/mods/theme/core/objects.lua @@ -0,0 +1,45 @@ +-- SYSTEM FILE +-- +-- Lua object funtions +-- + +function create_object(tval, sval) + local obj = new_object() + object_prep(obj, lookup_kind(tval, sval)) + return (obj) +end + +function set_item_tester(tester) + if tolua.type(tester) == "number" then + lua_set_item_tester(tester, "") + end + if tolua.type(tester) == "string" then + lua_set_item_tester(0, tester) + end + if tolua.type(tester) == "function" then + __get_item_hook_default = tester + lua_set_item_tester(0, "__get_item_hook_default") + end +end + +function create_artifact(a_idx) + local obj + local tval, sval + + tval = a_info[a_idx + 1].tval + sval = a_info[a_idx + 1].sval + obj = create_object(tval, sval) + obj.name1 = a_idx + apply_magic(obj, -1, TRUE, TRUE, TRUE) + + return (obj) +end + +function get_kind(obj) + return k_info[obj.k_idx + 1] +end + +function get_item(ask, deny, flags, mask) + set_item_tester(mask) + return get_item_aux(0, ask, deny, flags) +end |