summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-04-09 15:41:46 +0200
committerBardur Arantsson <bardur@scientician.net>2012-04-09 16:14:37 +0200
commit93e3dd939f24965125641ca4a08135a6e723c1a3 (patch)
treeca5d28be0937901011ea814db8e0e5d6e55ce2fe /lib
parentb92fe01dfebbfed138d0cec1ac23c608be881dfc (diff)
Lua: Remove quests.lua and remove unnecessary dynamism for quests
Diffstat (limited to 'lib')
-rw-r--r--lib/core/init.lua1
-rw-r--r--lib/core/quests.lua57
-rw-r--r--lib/mods/theme/core/init.lua1
-rw-r--r--lib/mods/theme/core/quests.lua57
4 files changed, 0 insertions, 116 deletions
diff --git a/lib/core/init.lua b/lib/core/init.lua
index 9d0c01a3..d294adb4 100644
--- a/lib/core/init.lua
+++ b/lib/core/init.lua
@@ -17,7 +17,6 @@ tome_dofile_anywhere(ANGBAND_DIR_CORE, "monsters.lua")
tome_dofile_anywhere(ANGBAND_DIR_CORE, "building.lua")
tome_dofile_anywhere(ANGBAND_DIR_CORE, "dungeon.lua")
tome_dofile_anywhere(ANGBAND_DIR_CORE, "s_aux.lua")
-tome_dofile_anywhere(ANGBAND_DIR_CORE, "quests.lua")
tome_dofile_anywhere(ANGBAND_DIR_CORE, "gods.lua")
-- Load the ingame contextual help
diff --git a/lib/core/quests.lua b/lib/core/quests.lua
deleted file mode 100644
index dfe9db51..00000000
--- a/lib/core/quests.lua
+++ /dev/null
@@ -1,57 +0,0 @@
--- Quest helper files
-
--- Quest structs
-
-__quest_hook = {}
-__quest_callbacks = {}
-__quest_callbacks_max = 0
-__quest_dynamic_desc = {}
-
-function add_quest(q)
- local i, index, d, z, qq
-
- assert(q.global, "No quest global name")
- assert(q.name, "No quest name")
- assert(q.desc, "No quest desc")
- assert(q.level, "No quest level")
- assert(q.hooks, "No quest hooks")
-
- i = new_quest(q.name);
- setglobal(q.global, i)
-
- -- Make it save & load
- add_loadsave("quest("..q.global..").status", QUEST_STATUS_UNTAKEN)
-
- if type(q.desc) == "table" then
- z = 0
- for index, d in q.desc do
- quest_desc(i, z, d);
- z = z + 1
- end
- else
- __quest_dynamic_desc[i] = q.desc
- quest(i).dynamic_desc = TRUE
- end
- quest(i).level = q.level
- if not q.silent then
- quest(i).silent = FALSE
- else
- quest(i).silent = q.silent
- end
- __quest_hook[i] = q.hooks
- for index, d in q.hooks do
- add_hook_script(index, "__lua__quest_callback"..__quest_callbacks_max, "__lua__quest_callback"..__quest_callbacks_max)
- setglobal("__lua__quest_callback"..__quest_callbacks_max, d)
- __quest_callbacks_max = __quest_callbacks_max + 1
- end
- if q.data then
- for index, d in q.data do
- -- Besure it exists
- setglobal(index, d)
-
- -- Make it save & load
- add_loadsave(index, d)
- end
- end
- return i
-end
diff --git a/lib/mods/theme/core/init.lua b/lib/mods/theme/core/init.lua
index 9d0c01a3..d294adb4 100644
--- a/lib/mods/theme/core/init.lua
+++ b/lib/mods/theme/core/init.lua
@@ -17,7 +17,6 @@ tome_dofile_anywhere(ANGBAND_DIR_CORE, "monsters.lua")
tome_dofile_anywhere(ANGBAND_DIR_CORE, "building.lua")
tome_dofile_anywhere(ANGBAND_DIR_CORE, "dungeon.lua")
tome_dofile_anywhere(ANGBAND_DIR_CORE, "s_aux.lua")
-tome_dofile_anywhere(ANGBAND_DIR_CORE, "quests.lua")
tome_dofile_anywhere(ANGBAND_DIR_CORE, "gods.lua")
-- Load the ingame contextual help
diff --git a/lib/mods/theme/core/quests.lua b/lib/mods/theme/core/quests.lua
deleted file mode 100644
index dfe9db51..00000000
--- a/lib/mods/theme/core/quests.lua
+++ /dev/null
@@ -1,57 +0,0 @@
--- Quest helper files
-
--- Quest structs
-
-__quest_hook = {}
-__quest_callbacks = {}
-__quest_callbacks_max = 0
-__quest_dynamic_desc = {}
-
-function add_quest(q)
- local i, index, d, z, qq
-
- assert(q.global, "No quest global name")
- assert(q.name, "No quest name")
- assert(q.desc, "No quest desc")
- assert(q.level, "No quest level")
- assert(q.hooks, "No quest hooks")
-
- i = new_quest(q.name);
- setglobal(q.global, i)
-
- -- Make it save & load
- add_loadsave("quest("..q.global..").status", QUEST_STATUS_UNTAKEN)
-
- if type(q.desc) == "table" then
- z = 0
- for index, d in q.desc do
- quest_desc(i, z, d);
- z = z + 1
- end
- else
- __quest_dynamic_desc[i] = q.desc
- quest(i).dynamic_desc = TRUE
- end
- quest(i).level = q.level
- if not q.silent then
- quest(i).silent = FALSE
- else
- quest(i).silent = q.silent
- end
- __quest_hook[i] = q.hooks
- for index, d in q.hooks do
- add_hook_script(index, "__lua__quest_callback"..__quest_callbacks_max, "__lua__quest_callback"..__quest_callbacks_max)
- setglobal("__lua__quest_callback"..__quest_callbacks_max, d)
- __quest_callbacks_max = __quest_callbacks_max + 1
- end
- if q.data then
- for index, d in q.data do
- -- Besure it exists
- setglobal(index, d)
-
- -- Make it save & load
- add_loadsave(index, d)
- end
- end
- return i
-end