Skip to content

Commit 4fc72d5

Browse files
authored
Merge pull request #514 from AlexZGreat/main
Unlock Requirements for Decks
2 parents 5221fad + 517c8a7 commit 4fc72d5

File tree

7 files changed

+404
-0
lines changed

7 files changed

+404
-0
lines changed

items/code.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3808,6 +3808,7 @@ local pointer = {
38083808
G.CHOOSE_CARD.alignment.offset.y = 0
38093809
G.ROOM.jiggle = G.ROOM.jiggle + 1
38103810
G.CHOOSE_CARD:align_to_major()
3811+
check_for_unlock({ cry_used_consumable = "c_cry_pointer" })
38113812
end,
38123813
init = function(self)
38133814
function create_UIBox_pointer(card)
@@ -4768,6 +4769,18 @@ local encoded = {
47684769
end,
47694770
}))
47704771
end,
4772+
unlocked = false,
4773+
check_for_unlock = function(self, args)
4774+
if args.cry_used_consumable == "c_cry_pointer" then
4775+
unlock_card(self)
4776+
end
4777+
if args.type == "cry_lock_all" then
4778+
lock_card(self)
4779+
end
4780+
if args.type == "cry_unlock_all" then
4781+
unlock_card(self)
4782+
end
4783+
end,
47714784
}
47724785
local CodeJoker = {
47734786
dependencies = {

items/deck.lua

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ local very_fair = {
2424
return avts(...)
2525
end
2626
end,
27+
unlocked = false,
28+
check_for_unlock = function(self, args)
29+
if args.type == "win_deck" then
30+
if get_deck_win_stake("b_cry_blank") > 0 then
31+
unlock_card(self)
32+
end
33+
end
34+
if args.type == "cry_lock_all" then
35+
lock_card(self)
36+
end
37+
if args.type == "cry_unlock_all" then
38+
unlock_card(self)
39+
end
40+
end,
2741
}
2842
local equilibrium = {
2943
object_type = "Back",
@@ -69,6 +83,24 @@ local equilibrium = {
6983
return gp(k, t)
7084
end
7185
end,
86+
unlocked = false,
87+
check_for_unlock = function(self, args)
88+
if Cryptid.safe_get(G, "jokers") then
89+
local count = 0
90+
for i = 1, #G.jokers.cards do
91+
count = count + 1
92+
end
93+
if count >= 10 then
94+
unlock_card(self)
95+
end
96+
end
97+
if args.type == "cry_lock_all" then
98+
lock_card(self)
99+
end
100+
if args.type == "cry_unlock_all" then
101+
unlock_card(self)
102+
end
103+
end,
72104
}
73105
local misprint = {
74106
object_type = "Back",
@@ -87,6 +119,23 @@ local misprint = {
87119
G.GAME.modifiers.cry_misprint_min = (G.GAME.modifiers.cry_misprint_min or 1) * self.config.cry_misprint_min
88120
G.GAME.modifiers.cry_misprint_max = (G.GAME.modifiers.cry_misprint_max or 1) * self.config.cry_misprint_max
89121
end,
122+
unlocked = false,
123+
check_for_unlock = function(self, args)
124+
if Cryptid.safe_get(G, "jokers") then
125+
for i = 1, #G.jokers.cards do
126+
if G.jokers.cards[i].edition and G.jokers.cards[i].edition.cry_glitched then
127+
unlock_card(self)
128+
break
129+
end
130+
end
131+
end
132+
if args.type == "cry_lock_all" then
133+
lock_card(self)
134+
end
135+
if args.type == "cry_unlock_all" then
136+
unlock_card(self)
137+
end
138+
end,
90139
}
91140
local infinite = {
92141
object_type = "Back",
@@ -104,6 +153,20 @@ local infinite = {
104153
apply = function(self)
105154
G.GAME.modifiers.cry_highlight_limit = self.config.cry_highlight_limit
106155
end,
156+
unlocked = false,
157+
check_for_unlock = function(self, args)
158+
if args.type == "hand_contents" then
159+
if #args.cards >= 6 then
160+
unlock_card(self)
161+
end
162+
end
163+
if args.type == "cry_lock_all" then
164+
lock_card(self)
165+
end
166+
if args.type == "cry_unlock_all" then
167+
unlock_card(self)
168+
end
169+
end,
107170
}
108171
local conveyor = {
109172
object_type = "Back",
@@ -120,6 +183,18 @@ local conveyor = {
120183
apply = function(self)
121184
G.GAME.modifiers.cry_conveyor = true
122185
end,
186+
unlocked = false,
187+
check_for_unlock = function(self, args)
188+
if args.cry_used_consumable == "c_cry_analog" then
189+
unlock_card(self)
190+
end
191+
if args.type == "cry_lock_all" then
192+
lock_card(self)
193+
end
194+
if args.type == "cry_unlock_all" then
195+
unlock_card(self)
196+
end
197+
end,
123198
}
124199
local CCD = {
125200
object_type = "Back",
@@ -137,6 +212,18 @@ local CCD = {
137212
apply = function(self)
138213
G.GAME.modifiers.cry_ccd = true
139214
end,
215+
unlocked = false,
216+
check_for_unlock = function(self, args)
217+
if args.cry_used_consumable == "c_cry_hammerspace" then
218+
unlock_card(self)
219+
end
220+
if args.type == "cry_lock_all" then
221+
lock_card(self)
222+
end
223+
if args.type == "cry_unlock_all" then
224+
unlock_card(self)
225+
end
226+
end,
140227
}
141228
local wormhole = {
142229
object_type = "Back",
@@ -173,6 +260,22 @@ local wormhole = {
173260
end,
174261
}, true)
175262
end,
263+
unlocked = false,
264+
check_for_unlock = function(self, args)
265+
if Cryptid.safe_get(G, "jokers") then
266+
for i = 1, #G.jokers.cards do
267+
if G.jokers.cards[i].config.center.rarity == "cry_exotic" then
268+
unlock_card(self)
269+
end
270+
end
271+
end
272+
if args.type == "cry_lock_all" then
273+
lock_card(self)
274+
end
275+
if args.type == "cry_unlock_all" then
276+
unlock_card(self)
277+
end
278+
end,
176279
}
177280
local redeemed = {
178281
object_type = "Back",
@@ -193,6 +296,7 @@ local redeemed = {
193296
local cr = Card.redeem
194297
function Card:redeem()
195298
cr(self)
299+
196300
if G.GAME.modifiers.cry_redeemed then
197301
if
198302
#G.play.cards == 0
@@ -249,6 +353,20 @@ local redeemed = {
249353
end
250354
end
251355
end,
356+
unlocked = false,
357+
check_for_unlock = function(self, args)
358+
if args.type == "discover_amount" then
359+
if G.DISCOVER_TALLIES.vouchers.tally / G.DISCOVER_TALLIES.vouchers.of >= 1 then
360+
unlock_card(self)
361+
end
362+
end
363+
if args.type == "cry_lock_all" then
364+
lock_card(self)
365+
end
366+
if args.type == "cry_unlock_all" then
367+
unlock_card(self)
368+
end
369+
end,
252370
}
253371
local legendary = {
254372
object_type = "Back",
@@ -311,6 +429,26 @@ local legendary = {
311429
end,
312430
}))
313431
end,
432+
unlocked = false,
433+
check_for_unlock = function(self, args)
434+
if Cryptid.safe_get(G, "jokers") then
435+
local count = 0
436+
for i = 1, #G.jokers.cards do
437+
if G.jokers.cards[i].config.center.rarity == 4 then
438+
count = count + 1
439+
end
440+
end
441+
if count >= 2 then
442+
unlock_card(self)
443+
end
444+
end
445+
if args.type == "cry_lock_all" then
446+
lock_card(self)
447+
end
448+
if args.type == "cry_unlock_all" then
449+
unlock_card(self)
450+
end
451+
end,
314452
}
315453
local critical = {
316454
object_type = "Back",
@@ -375,6 +513,23 @@ local critical = {
375513
end
376514
end
377515
end,
516+
unlocked = false,
517+
check_for_unlock = function(self, args)
518+
if Cryptid.safe_get(G, "jokers") then
519+
for i = 1, #G.jokers.cards do
520+
if G.jokers.cards[i].ability.cry_rigged then
521+
unlock_card(self)
522+
break
523+
end
524+
end
525+
end
526+
if args.type == "cry_lock_all" then
527+
lock_card(self)
528+
end
529+
if args.type == "cry_unlock_all" then
530+
unlock_card(self)
531+
end
532+
end,
378533
}
379534
local glowing = {
380535
object_type = "Back",
@@ -404,6 +559,20 @@ local glowing = {
404559
end
405560
end
406561
end,
562+
unlocked = false,
563+
check_for_unlock = function(self, args)
564+
if args.type == "win_deck" then
565+
if get_deck_win_stake("b_cry_beige") > 0 then
566+
unlock_card(self)
567+
end
568+
end
569+
if args.type == "cry_lock_all" then
570+
lock_card(self)
571+
end
572+
if args.type == "cry_unlock_all" then
573+
unlock_card(self)
574+
end
575+
end,
407576
}
408577
local beta = {
409578
object_type = "Back",
@@ -421,6 +590,20 @@ local beta = {
421590
apply = function(self)
422591
G.GAME.modifiers.cry_beta = true
423592
end,
593+
unlocked = false,
594+
check_for_unlock = function(self, args)
595+
if args.type == "win_deck" then
596+
if get_deck_win_stake() >= 9 then
597+
unlock_card(self)
598+
end
599+
end
600+
if args.type == "cry_lock_all" then
601+
lock_card(self)
602+
end
603+
if args.type == "cry_unlock_all" then
604+
unlock_card(self)
605+
end
606+
end,
424607
}
425608
local bountiful = {
426609
object_type = "Back",
@@ -438,6 +621,23 @@ local bountiful = {
438621
apply = function(self)
439622
G.GAME.modifiers.cry_forced_draw_amount = self.config.cry_forced_draw_amount
440623
end,
624+
unlocked = false,
625+
check_for_unlock = function(self, args)
626+
if args.type == "round_win" then
627+
if
628+
G.GAME.blind.name == "The Serpent"
629+
and G.GAME.current_round.discards_left == G.GAME.round_resets.discards
630+
then
631+
unlock_card(self)
632+
end
633+
end
634+
if args.type == "cry_lock_all" then
635+
lock_card(self)
636+
end
637+
if args.type == "cry_unlock_all" then
638+
unlock_card(self)
639+
end
640+
end,
441641
}
442642
local beige = {
443643
object_type = "Back",
@@ -454,6 +654,20 @@ local beige = {
454654
apply = function(self)
455655
G.GAME.modifiers.cry_common_value_quad = true
456656
end,
657+
unlocked = false,
658+
check_for_unlock = function(self, args)
659+
if args.type == "discover_amount" then
660+
if args.amount >= 200 then
661+
unlock_card(self)
662+
end
663+
end
664+
if args.type == "cry_lock_all" then
665+
lock_card(self)
666+
end
667+
if args.type == "cry_unlock_all" then
668+
unlock_card(self)
669+
end
670+
end,
457671
}
458672
local blank = {
459673
object_type = "Back",
@@ -1017,6 +1231,20 @@ local antimatter = {
10171231
return consumable_table
10181232
end
10191233
end,
1234+
unlocked = false,
1235+
check_for_unlock = function(self, args)
1236+
if args.type == "win_deck" then
1237+
if get_deck_win_stake("b_cry_blank") > 0 and get_deck_win_stake() >= 8 then
1238+
unlock_card(self)
1239+
end
1240+
end
1241+
if args.type == "cry_lock_all" then
1242+
lock_card(self)
1243+
end
1244+
if args.type == "cry_unlock_all" then
1245+
unlock_card(self)
1246+
end
1247+
end,
10201248
}
10211249

10221250
return {

0 commit comments

Comments
 (0)