forked from survovoaneend/All-In-Jest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnevernamed.lua
More file actions
244 lines (230 loc) · 5.8 KB
/
nevernamed.lua
File metadata and controls
244 lines (230 loc) · 5.8 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
All_in_Jest = SMODS.current_mod
local mod_path = ''..SMODS.current_mod.path
G.AIJ = {}
local injectitems_ref = SMODS.injectItems
--talisman compat
to_big = to_big or function(n)
return n
end
to_number = to_number or function(n)
return n
end
SMODS.current_mod.optional_features = {
retrigger_joker = true
}
SMODS.injectItems = function()
injectitems_ref()
G.AIJ.shared_mystery_sprites = G.AIJ.shared_mystery_sprites or {
bg1 = Sprite(0, 0, 1, 1, G.ASSET_ATLAS['aij_mystery_atlas'], {
x = 0,
y = 0
}),
bg2 = Sprite(0, 0, 1, 1, G.ASSET_ATLAS['aij_mystery_atlas'], {
x = 1,
y = 0
}),
bg3 = Sprite(0, 0, 1, 1, G.ASSET_ATLAS['aij_mystery_atlas'], {
x = 2,
y = 0
}),
bg4 = Sprite(0, 0, 1, 1, G.ASSET_ATLAS['aij_mystery_atlas'], {
x = 3,
y = 0
}),
}
end
SMODS.Atlas {
key = "joker_atlas",
path = "jokers.png",
px = 71,
py = 95
}
SMODS.Atlas {
key = "jumbo_joker",
path = "jumbo_joker.png",
px = 81,
py = 111
}
SMODS.Atlas {
key = "deck_atlas",
path = "decks.png",
px = 71,
py = 95
}
SMODS.Atlas {
key = "legendary_atlas",
path = "legendaries.png",
px = 71,
py = 95
}
SMODS.Atlas {
key = "consumable_atlas",
path = "consumables.png",
px = 71,
py = 95
}
SMODS.Atlas {
key = "enhancements_atlas",
path = "enhancements.png",
px = 71,
py = 95
}
SMODS.Atlas {
key = 'tag_atlas',
path = 'tag.png',
px = 34,
py = 34
}
SMODS.Atlas {
key = 'familiar_atlas',
path = 'familiar.png',
px = 71,
py = 95
}
SMODS.Atlas {
key = 'booster_atlas',
path = 'boosters.png',
px = 71,
py = 95
}
SMODS.Atlas {
key = 'mystery_atlas',
path = 'mystery.png',
px = 71,
py = 95
}
SMODS.Atlas {
key = 'modicon',
px = 32,
py = 32,
path = 'modicon.png'
}
SMODS.Shader {
key = 'silhouette',
path = 'silhouette.fs',
}
SMODS.Shader {
key = 'chaotic',
path = 'chaotic.fs',
}
SMODS.Rarity({
key = "familiar_face",
loc_txt = {
name = "Familiar Face"
},
badge_colour = HEX("12077d"),
})
SMODS.Atlas {
key = 'blind_drawn_replacement',
path = 'unknown_blind.png',
px = 34,
py = 34,
frames = 21,
atlas_table = 'ANIMATION_ATLAS'
}
SMODS.Gradient {
key = 'plasma',
colours = {
HEX('F9A2E6'), HEX('b288bc')
},
cycle = 5,
interpolation = 'trig'
}
SMODS.Gradient {
key = 'stellar',
colours = {
HEX('666694'), HEX('7a73bb')
},
cycle = 5,
interpolation = 'trig'
}
AllInJest = {}
assert(SMODS.load_file('Utils/context.lua'))()
assert(SMODS.load_file('Utils/draw.lua'))()
assert(SMODS.load_file('Utils/functions.lua'))()
assert(SMODS.load_file('Utils/overrides.lua'))()
assert(SMODS.load_file('Utils/ui.lua'))()
local folders = NFS.getDirectoryItems(mod_path.."Items")
local objects = {}
local function collect_item_files(base_fs, rel, out)
for _, name in ipairs(NFS.getDirectoryItems(base_fs)) do
local abs = base_fs.."/"..name
local info = NFS.getInfo(abs)
if info and info.type == "directory" then
collect_item_files(abs, rel.."/"..name, out)
elseif info and info.type == "file" and name:match("%.lua$") then
table.insert(out, rel.."/"..name)
end
end
end
local files = {}
collect_item_files(mod_path.."Items", "Items", files)
local function load_items(curr_obj)
if curr_obj.init then curr_obj:init() end
if not curr_obj.items then
print("Warning: curr_obj has no items")
return
end
for _, item in ipairs(curr_obj.items) do
item.ignore = item.ignore or false
item.jest_spec_moon = item.jest_spec_moon or false
item.jest_rec_paperback = item.jest_rec_paperback or false
if item.jest_spec_moon and All_in_Jest.config.moons_enabled and not item.ignore then
if item.jest_rec_paperback then
if (next(SMODS.find_mod("paperback")) or next(SMODS.find_mod("Bunco")))
and ((PB_UTIL and PB_UTIL.config and PB_UTIL.config.suits_enabled)
or next(SMODS.find_mod("Bunco"))) then
SMODS[item.object_type](item)
goto continue
else
goto continue
end
else
SMODS[item.object_type](item)
goto continue
end
end
if item.jest_spec_moon and not All_in_Jest.config.moons_enabled then
goto continue
end
if SMODS[item.object_type] and not item.ignore then
SMODS[item.object_type](item)
elseif CardSleeves and CardSleeves[item.object_type] and not item.ignore then
CardSleeves[item.object_type](item)
elseif not item.ignore then
print("Error loading item "..item.key.." of unknown type "..item.object_type)
end
::continue::
end
end
for _, rel in ipairs(files) do
local f, err = SMODS.load_file(rel)
if not f then
print("Error loading item file '"..rel.."': "..tostring(err))
else
local ok, curr_obj = pcall(f)
if ok then
table.insert(objects, curr_obj)
end
end
end
table.sort(objects, function(a, b)
local function get_lowest_order(obj)
if not obj.items then return math.huge end
local lowest = math.huge
for _, item in ipairs(obj.items) do
if item.order and item.order < lowest then
lowest = item.order
end
end
return lowest
end
return get_lowest_order(a) < get_lowest_order(b)
end)
for _, curr_obj in ipairs(objects) do
load_items(curr_obj)
end
-- SMODS mod-specific settings
function All_in_Jest.set_ability_reset_keys()
return {'jest_charged_applied'}
end