diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-06-02 21:46:20 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-06-02 22:19:03 +0200 |
commit | 3756182bf99335d02f7872c105b5ae5f9b5c4e57 (patch) | |
tree | eb96de37a1c0994406ef2e50f8d44fe17ee817fb /lib/scpt | |
parent | 53bf1478ad25f03d6df584371b0653f83ead1b6d (diff) |
Lua: Move store handling to C
Diffstat (limited to 'lib/scpt')
-rw-r--r-- | lib/scpt/init.lua | 3 | ||||
-rw-r--r-- | lib/scpt/stores.lua | 105 |
2 files changed, 0 insertions, 108 deletions
diff --git a/lib/scpt/init.lua b/lib/scpt/init.lua index 69fca70d..079d064d 100644 --- a/lib/scpt/init.lua +++ b/lib/scpt/init.lua @@ -8,9 +8,6 @@ tome_dofile("player.lua") -- Load the ingame contextual help tome_dofile("help.lua") --- let the store specific stuff happen! -tome_dofile("stores.lua") - -- Add the mkey activations tome_dofile("mkeys.lua") diff --git a/lib/scpt/stores.lua b/lib/scpt/stores.lua deleted file mode 100644 index d10ee5ad..00000000 --- a/lib/scpt/stores.lua +++ /dev/null @@ -1,105 +0,0 @@ --- Whats shops can buy what -store_buy_list -{ - ["General Store"] = - { - TV_CORPSE, - TV_FOOD, - TV_LITE, - TV_FLASK, - TV_SPIKE, - TV_SHOT, - TV_ARROW, - TV_BOLT, - TV_DIGGING, - TV_CLOAK, - TV_BOTTLE, - }, - ["Armoury"] = - { - TV_BOOTS, - TV_GLOVES, - TV_CROWN, - TV_HELM, - TV_SHIELD, - TV_CLOAK, - TV_SOFT_ARMOR, - TV_HARD_ARMOR, - TV_DRAG_ARMOR, - }, - ["Weaponsmith"] = - { - TV_SHOT, - TV_BOLT, - TV_ARROW, - TV_BOOMERANG, - TV_BOW, - TV_DIGGING, - TV_HAFTED, - TV_POLEARM, - TV_SWORD, - TV_AXE, - TV_MSTAFF, - }, - -- We use a function because we want to restrict to blessed weapons and god spells - ["Temple"] = function (obj) - if obj.tval == TV_DRUID_BOOK then return TRUE - elseif obj.tval == TV_BOOK and obj.sval == 255 and (can_spell_random(obj.pval) == SKILL_SPIRITUALITY) then return TRUE - elseif obj.tval == TV_SCROLL then return TRUE - elseif obj.tval == TV_POTION2 then return TRUE - elseif obj.tval == TV_POTION then return TRUE - elseif obj.tval == TV_HAFTED then return TRUE - elseif obj.tval == TV_POLEARM and is_blessed(obj) == TRUE then return TRUE - elseif obj.tval == TV_SWORD and is_blessed(obj) == TRUE then return TRUE - elseif obj.tval == TV_AXE and is_blessed(obj) == TRUE then return TRUE - elseif obj.tval == TV_BOOMERANG and is_blessed(obj) == TRUE then return TRUE - end - end, - ["Alchemy shop"] = - { - TV_SCROLL, - TV_POTION2, - TV_POTION, - TV_BATERIE, - TV_BOTTLE, - }, - -- We use a function because we dont want god spells - ["Magic shop"] = function (obj) - local buy = - { - [TV_SYMBIOTIC_BOOK] = TRUE, - [TV_AMULET] = TRUE, - [TV_RING] = TRUE, - [TV_STAFF] = TRUE, - [TV_WAND] = TRUE, - [TV_ROD] = TRUE, - [TV_ROD_MAIN] = TRUE, - [TV_SCROLL] = TRUE, - [TV_POTION2] = TRUE, - [TV_POTION] = TRUE, - [TV_MSTAFF] = TRUE, - [TV_RANDART] = TRUE, - } - - if obj.tval == TV_BOOK and obj.sval == 255 and (can_spell_random(obj.pval) == SKILL_MAGIC) then return TRUE - elseif obj.tval == TV_BOOK and obj.sval ~= 255 then return TRUE - elseif buy[obj.tval] == TRUE then return TRUE - end - end, - -- Black markets wants ALL! - ["Black Market"] = function (obj) - return TRUE - end, - ["Book Store"] = - { - TV_BOOK, - TV_SYMBIOTIC_BOOK, - TV_MUSIC_BOOK, - TV_DAEMON_BOOK, - TV_DRUID_BOOK, - }, - ["Pet Shop"] = - { - TV_EGG, - }, -} |