forked from icyethics/Blockbuster-Spellcasting
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockbusterSpellcasting.lua
More file actions
55 lines (44 loc) · 1.26 KB
/
BlockbusterSpellcasting.lua
File metadata and controls
55 lines (44 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
-- Setting variables to use for other mods to test whether this mod is loaded
if not Blockbuster then
Blockbuster = {}
end
Blockbuster.Spellcasting = {}
Blockbuster.Spellcasting.mod_dir = ''..SMODS.current_mod.path
Blockbuster.Spellcasting_config = SMODS.current_mod.config
-- Read in Atlases
local atlases =
{
{'modicon', 32, 32, 'modicon.png'},
{'suit_spells', 71, 95, 'blockbuster_spells.png'},
{'deck', 71, 95, 'kino_backs.png'},
{'non_suit_spells', 71, 95, 'non_suit_spells.png'}
}
for _index, _object in ipairs(atlases) do
SMODS.Atlas {
key = _object[1],
px = _object[2],
py = _object[3],
path = _object[4]
}
end
-- Read in Files
function Blockbuster.load_file(file_address)
local helper, load_error = SMODS.load_file(file_address)
if load_error then
sendDebugMessage ("The error is: "..load_error)
else
helper()
end
end
local _list_of_folders = {
"src",
"items/spells",
"items/backs"
}
for _index, _folder in ipairs(_list_of_folders) do
local files = NFS.getDirectoryItems(Blockbuster.Spellcasting.mod_dir .. _folder)
for _, _filename in ipairs(files) do
Blockbuster.load_file(_folder .. "/" .. _filename)
end
end
-- Register spells to the spelltable