Skip to content

Commit 4135ae5

Browse files
committed
bugfixes and polish
1 parent 67d30e3 commit 4135ae5

File tree

3 files changed

+61
-9
lines changed

3 files changed

+61
-9
lines changed

items/code.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3307,7 +3307,7 @@ local green_seal = {
33073307
local source = {
33083308
dependencies = {
33093309
items = {
3310-
"cry_green_seal",
3310+
"cry_green",
33113311
},
33123312
},
33133313
object_type = "Consumable",

items/misc_joker.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7529,7 +7529,7 @@ local miscitems = {
75297529
stronghold,
75307530
wtf,
75317531
clash,
7532-
adriot,
7532+
adroit,
75337533
penetrating,
75347534
treacherous,
75357535
bonkers,

lib/gameset.lua

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,9 @@ function Card:get_gameset(center)
585585
end
586586
local csa = Card.set_ability
587587
function Card:set_ability(center, y, z)
588+
if not center.config then
589+
center.config = {} --crashproofing
590+
end
588591
csa(self, center, y, z)
589592
if center.gameset_config and center.gameset_config[self:get_gameset(center)] then
590593
for k, v in pairs(center.gameset_config[self:get_gameset(center)]) do
@@ -1122,97 +1125,118 @@ SMODS.ContentSet = SMODS.Center:extend({
11221125
G.P_CENTER_POOLS[self.set] = {}
11231126
end
11241127
SMODS.Center.inject(self)
1128+
if not self.cry_order then
1129+
self.cry_order = 0
1130+
end
11251131
end,
11261132
})
11271133
G.P_CENTER_POOLS["Content Set"] = {}
1134+
-- For now, I made larger sets appear earlier. This can be tweaked later...
11281135
SMODS.ContentSet({
11291136
key = "m",
11301137
atlas = "atlasepic",
11311138
pos = { x = 3, y = 1 }, --m
1139+
cry_order = -22,
11321140
})
11331141
SMODS.ContentSet({
11341142
key = "epic",
11351143
atlas = "atlasepic",
11361144
pos = { x = 2, y = 1 }, --Canvas
1145+
cry_order = -32,
11371146
})
11381147
SMODS.ContentSet({
11391148
key = "code",
11401149
atlas = "code",
11411150
pos = { x = 0, y = 0 }, --://CRASH
1151+
cry_order = -39,
11421152
})
11431153
SMODS.ContentSet({
11441154
key = "exotic",
11451155
atlas = "atlasexotic",
11461156
pos = { x = 0, y = 1 }, --Iterum
11471157
soul_pos = { x = 1, y = 1, extra = { x = 2, y = 1 } },
1158+
cry_order = -20,
11481159
})
11491160
SMODS.ContentSet({
11501161
key = "blind",
11511162
atlas = "blinds",
11521163
pos = { x = 0, y = 4 }, --The Joke
1153-
cry_blind = true
1164+
cry_blind = true,
1165+
cry_order = -26,
11541166
})
11551167
SMODS.ContentSet({
11561168
key = "deck",
11571169
atlas = "atlasdeck",
11581170
pos = { x = 4, y = 5 }, --Critical Deck
1171+
cry_order = -23,
11591172
})
11601173
SMODS.ContentSet({
11611174
key = "spooky",
11621175
atlas = "atlasspooky",
11631176
pos = { x = 1, y = 0 }, --Chocolate Dice
1177+
cry_order = -14,
11641178
})
11651179
SMODS.ContentSet({
11661180
key = "cursed",
11671181
atlas = "atlasspooky",
11681182
pos = { x = 3, y = 0 }, --Ghost
1183+
cry_order = -6,
11691184
})
11701185
SMODS.ContentSet({
11711186
key = "timer",
11721187
atlas = "blinds",
11731188
pos = { x = 0, y = 1 }, --The Clock
1174-
cry_blind = true
1189+
cry_blind = true,
1190+
cry_order = -2,
11751191
})
11761192
SMODS.ContentSet({
11771193
key = "misc",
11781194
atlas = "cry_misc",
11791195
pos = { x = 2, y = 0 }, --Echo Card
1196+
cry_order = -22,
11801197
})
11811198
SMODS.ContentSet({
11821199
key = "misc_joker",
11831200
atlas = "atlasone",
11841201
pos = { x = 2, y = 3 }, --Nice
1202+
cry_order = -111,
11851203
})
11861204
SMODS.ContentSet({
11871205
key = "planet",
11881206
atlas = "atlasnotjokers",
11891207
pos = { x = 4, y = 2 }, --Planet.lua
1208+
cry_order = -8,
11901209
})
11911210
SMODS.ContentSet({
11921211
key = "spectral",
11931212
atlas = "atlasnotjokers",
11941213
pos = { x = 1, y = 1 }, --Replica
1214+
cry_order = -12,
11951215
})
11961216
SMODS.ContentSet({
11971217
key = "tag",
11981218
atlas = "tag_cry",
11991219
pos = { x = 0, y = 2 }, --Cat Tag
1200-
cry_tag = true
1220+
cry_tag = true,
1221+
cry_order = -30,
12011222
})
12021223
SMODS.ContentSet({
12031224
key = "tier3",
12041225
atlas = "atlasvoucher",
12051226
pos = { x = 5, y = 2 }, --Asteroglyph
1227+
cry_order = -18,
12061228
})
12071229
SMODS.ContentSet({
12081230
key = "voucher",
12091231
atlas = "atlasvoucher",
12101232
pos = { x = 1, y = 2 }, --Tag Printer
1233+
cry_order = -15,
12111234
})
12121235
SMODS.ContentSet({
12131236
key = "poker_hand_stuff",
12141237
atlas = "atlasthree",
12151238
pos = { x = 7, y = 1 }, --The Fuck!? (Clusterfuck's XMult Joker)
1239+
cry_order = -16,
12161240
})
12171241

12181242
-- these are mostly copy/paste from vanilla code
@@ -1259,6 +1283,9 @@ function create_UIBox_your_collection_content_sets()
12591283
table.insert(joker_pool, v)
12601284
end
12611285
end
1286+
table.sort(joker_pool, function(a, b)
1287+
return a.cry_order < b.cry_order
1288+
end)
12621289
local joker_options = {}
12631290
for i = 1, math.ceil(#joker_pool / (5 * #G.your_collection)) do
12641291
table.insert(
@@ -1342,6 +1369,9 @@ function create_UIBox_your_collection_current_set()
13421369
end
13431370
end
13441371
cry_index_items(is_in_set)
1372+
table.sort(joker_pool, function(a, b)
1373+
return a.cry_order < b.cry_order
1374+
end)
13451375
local joker_options = {}
13461376
for i = 1, math.ceil(#joker_pool / (5 * #G.your_collection)) do
13471377
table.insert(
@@ -1409,6 +1439,9 @@ G.FUNCS.your_collection_content_set_page = function(args)
14091439
table.insert(joker_pool, v)
14101440
end
14111441
end
1442+
table.sort(joker_pool, function(a, b)
1443+
return a.cry_order < b.cry_order
1444+
end)
14121445
for i = 1, 5 do
14131446
for j = 1, #G.your_collection do
14141447
local center =
@@ -1445,6 +1478,9 @@ G.FUNCS.your_collection_current_set_page = function(args)
14451478
end
14461479
end
14471480
cry_index_items(is_in_set)
1481+
table.sort(joker_pool, function(a, b)
1482+
return a.cry_order < b.cry_order
1483+
end)
14481484
for i = 1, 5 do
14491485
for j = 1, #G.your_collection do
14501486
local center =
@@ -1556,7 +1592,16 @@ function modsCollectionTally(pool, set)
15561592
local obj_tally = {tally = 0, of = 0}
15571593
--infer pool
15581594
local _set = set or safe_get(pool, 1, "set")
1559-
--general consumable UI breaks w/ this
1595+
--check for general consumables
1596+
local consumable = false
1597+
if _set and safe_get(pool, 1, "consumeable") then
1598+
for i = 1, #pool do
1599+
if safe_get(pool, i, "set") ~= _set then
1600+
consumable = true
1601+
break
1602+
end
1603+
end
1604+
end
15601605
if _set then
15611606
if _set == "Seal" then
15621607
pool = SMODS.Seal.obj_table
@@ -1568,16 +1613,23 @@ function modsCollectionTally(pool, set)
15681613
end
15691614
for _, v in pairs(pool) do
15701615
if v.mod and G.ACTIVE_MOD_UI.id == v.mod.id and not v.no_collection then
1571-
if set then
1616+
if consumable then
1617+
if safe_get(v, "consumeable") then
1618+
obj_tally.of = obj_tally.of+1
1619+
if cry_card_enabled(v.key) == true then
1620+
obj_tally.tally = obj_tally.tally+1
1621+
end
1622+
end
1623+
elseif set then
15721624
if v.set and v.set == set then
15731625
obj_tally.of = obj_tally.of+1
1574-
if cry_get_gameset(v) ~= "disabled" then
1626+
if cry_card_enabled(v.key) == true then
15751627
obj_tally.tally = obj_tally.tally+1
15761628
end
15771629
end
15781630
else
15791631
obj_tally.of = obj_tally.of+1
1580-
if cry_get_gameset(v) ~= "disabled" then
1632+
if cry_card_enabled(v.key) == true then
15811633
obj_tally.tally = obj_tally.tally+1
15821634
end
15831635
end

0 commit comments

Comments
 (0)