Skip to content

Commit 5026616

Browse files
author
jolly[bot]
committed
jolly-bot: auto-format Lua files using Stylua
1 parent 9ca8a6b commit 5026616

File tree

4 files changed

+111
-75
lines changed

4 files changed

+111
-75
lines changed

items/code.lua

Lines changed: 66 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,16 +1476,18 @@ local rework = {
14761476
return { vars = {} }
14771477
end,
14781478
can_use = function(self, card)
1479-
local cards = Cryptid.get_highlighted_cards({G.jokers}, card, 1, 1, function(card)
1479+
local cards = Cryptid.get_highlighted_cards({ G.jokers }, card, 1, 1, function(card)
14801480
return card.ability.set == "Joker"
14811481
end)
1482-
return #cards == 1 and not cards[1].ability.eternal and cards[1].ability.name
1483-
~= ("cry-meteor" or "cry-exoplanet" or "cry-stardust" or "cry_cursed" or ("Diet Cola" or Card.get_gameset(
1484-
card
1485-
) == "madness"))
1482+
return #cards == 1
1483+
and not cards[1].ability.eternal
1484+
and cards[1].ability.name
1485+
~= ("cry-meteor" or "cry-exoplanet" or "cry-stardust" or "cry_cursed" or ("Diet Cola" or Card.get_gameset(
1486+
card
1487+
) == "madness"))
14861488
end,
14871489
use = function(self, card, area, copier)
1488-
local cards = Cryptid.get_highlighted_cards({G.jokers}, card, 1, 1, function(card)
1490+
local cards = Cryptid.get_highlighted_cards({ G.jokers }, card, 1, 1, function(card)
14891491
return card.ability.set == "Joker"
14901492
end)
14911493
local jkr = cards[1]
@@ -1633,19 +1635,25 @@ local merge = {
16331635
cost = 4,
16341636
order = 407,
16351637
can_use = function(self, card)
1636-
local hand = Cryptid.get_highlighted_cards({G.hand}, card, 1, 1)
1637-
local consumeables = Cryptid.get_highlighted_cards({G.consumeables}, card, 1, 1, function(card) return card.ability.consumeable end)
1638-
if #hand ~= 1 or #consumeables ~= 1 or
1639-
consumeables[1].ability.eternal
1638+
local hand = Cryptid.get_highlighted_cards({ G.hand }, card, 1, 1)
1639+
local consumeables = Cryptid.get_highlighted_cards({ G.consumeables }, card, 1, 1, function(card)
1640+
return card.ability.consumeable
1641+
end)
1642+
if
1643+
#hand ~= 1
1644+
or #consumeables ~= 1
1645+
or consumeables[1].ability.eternal
16401646
or consumeables[1].ability.set == "Unique"
16411647
then
16421648
return false
16431649
end
16441650
return true
16451651
end,
16461652
use = function(self, card, area, copier)
1647-
local hand = Cryptid.get_highlighted_cards({G.hand}, card, 1, 1)
1648-
local consumeables = Cryptid.get_highlighted_cards({G.consumeables}, card, 1, 1, function(card) return card.ability.consumeable end)
1653+
local hand = Cryptid.get_highlighted_cards({ G.hand }, card, 1, 1)
1654+
local consumeables = Cryptid.get_highlighted_cards({ G.consumeables }, card, 1, 1, function(card)
1655+
return card.ability.consumeable
1656+
end)
16491657
if #hand == 1 and #consumeables == 1 then
16501658
G.E_MANAGER:add_event(Event({
16511659
trigger = "immediate",
@@ -1733,16 +1741,17 @@ local commit = {
17331741
cost = 4,
17341742
order = 408,
17351743
can_use = function(self, card)
1736-
local jokers = Cryptid.get_highlighted_cards({G.jokers}, card, 1, 1, function(card) return card.ability.set == "Joker" end)
1744+
local jokers = Cryptid.get_highlighted_cards({ G.jokers }, card, 1, 1, function(card)
1745+
return card.ability.set == "Joker"
1746+
end)
17371747
return #jokers == 1
17381748
and not jokers[1].ability.eternal
1739-
and not (
1740-
type(jokers[1].config.center.rarity) == "number"
1741-
and jokers[1].config.center.rarity >= 5
1742-
)
1749+
and not (type(jokers[1].config.center.rarity) == "number" and jokers[1].config.center.rarity >= 5)
17431750
end,
17441751
use = function(self, card, area, copier)
1745-
local jokers = Cryptid.get_highlighted_cards({G.jokers}, card, 1, 1, function(card) return card.ability.set == "Joker" end)
1752+
local jokers = Cryptid.get_highlighted_cards({ G.jokers }, card, 1, 1, function(card)
1753+
return card.ability.set == "Joker"
1754+
end)
17461755
local deleted_joker_key = jokers[1].config.center.key
17471756
local rarity = jokers[1].config.center.rarity
17481757
local legendary = nil
@@ -2140,15 +2149,15 @@ local seed = {
21402149
atlas = "atlasnotjokers",
21412150
order = 411,
21422151
can_use = function(self, card)
2143-
local cards = Cryptid.get_highlighted_cards({G.jokers, G.hand, G.consumeables, G.pack_cards}, card, 1, 1)
2152+
local cards = Cryptid.get_highlighted_cards({ G.jokers, G.hand, G.consumeables, G.pack_cards }, card, 1, 1)
21442153
--the card itself and one other card
21452154
return #cards == 1
21462155
end,
21472156
loc_vars = function(self, info_queue, card)
21482157
info_queue[#info_queue + 1] = { key = "cry_rigged", set = "Other", vars = {} }
21492158
end,
21502159
use = function(self, card, area, copier)
2151-
local cards = Cryptid.get_highlighted_cards({G.jokers, G.hand, G.consumeables, G.pack_cards}, card, 1, 1)
2160+
local cards = Cryptid.get_highlighted_cards({ G.jokers, G.hand, G.consumeables, G.pack_cards }, card, 1, 1)
21522161
if cards[1] then
21532162
cards[1].ability.cry_rigged = true
21542163
if cards[1].config.center.key == "j_cry_googol_play" then
@@ -2395,14 +2404,14 @@ local hook = {
23952404
atlas = "atlasnotjokers",
23962405
order = 414,
23972406
can_use = function(self, card)
2398-
local jokers = Cryptid.get_highlighted_cards({G.jokers}, card, 2, 2)
2407+
local jokers = Cryptid.get_highlighted_cards({ G.jokers }, card, 2, 2)
23992408
return #jokers == 2
24002409
end,
24012410
loc_vars = function(self, info_queue, card)
24022411
info_queue[#info_queue + 1] = { key = "cry_hooked", set = "Other", vars = { "hooked Joker" } }
24032412
end,
24042413
use = function(self, card, area, copier)
2405-
local jokers = Cryptid.get_highlighted_cards({G.jokers}, card, 2, 2)
2414+
local jokers = Cryptid.get_highlighted_cards({ G.jokers }, card, 2, 2)
24062415
local card1 = jokers[1]
24072416
local card2 = jokers[2]
24082417
if card1 and card2 then
@@ -2583,7 +2592,7 @@ local assemble = {
25832592
if Cryptid.enabled("set_cry_poker_hand_stuff") == true and G.PROFILES[G.SETTINGS.profile].cry_none then
25842593
aaa = -1
25852594
end
2586-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, aaa+1, 999)
2595+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, aaa + 1, 999)
25872596
return (#cards > aaa and #G.jokers.cards > 1)
25882597
end,
25892598
use = function(self, card, area, copier)
@@ -2592,7 +2601,7 @@ local assemble = {
25922601
if G.PROFILES[G.SETTINGS.profile].cry_none then
25932602
num = -1
25942603
end
2595-
local hand = Cryptid.get_highlighted_cards({G.hand}, card, num+1, G.hand.config.highlighted_limit)
2604+
local hand = Cryptid.get_highlighted_cards({ G.hand }, card, num + 1, G.hand.config.highlighted_limit)
25962605
if #hand > num and not G.cry_force_use then
25972606
upgrade_hand = G.GAME.hands[G.FUNCS.get_poker_hand_info(hand)]
25982607
else
@@ -2601,10 +2610,11 @@ local assemble = {
26012610
func = function()
26022611
local text = G.FUNCS.get_poker_hand_info(G.play.cards)
26032612
print(text)
2604-
upgrade_hand = G.GAME.hands[text] or (G.PROFILES[G.SETTINGS.profile].cry_none and G.GAME.hands["cry_None"])
2613+
upgrade_hand = G.GAME.hands[text]
2614+
or (G.PROFILES[G.SETTINGS.profile].cry_none and G.GAME.hands["cry_None"])
26052615
upgrade_hand.mult = upgrade_hand.mult + #G.jokers.cards
26062616
return true
2607-
end
2617+
end,
26082618
}))
26092619
end
26102620
if upgrade_hand then
@@ -2665,12 +2675,12 @@ local inst = {
26652675
return {}
26662676
end,
26672677
can_use = function(self, card)
2668-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, 1, 1)
2678+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, 1, 1)
26692679
return #cards == 1
26702680
end,
26712681
use = function(self, card, area, copier)
26722682
local same = 0
2673-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, 1, 1)
2683+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, 1, 1)
26742684
for i = 1, #G.deck.cards do
26752685
if G.deck.cards[i].base.value == cards[1].base.value then
26762686
same = i
@@ -2688,7 +2698,7 @@ local inst = {
26882698
bulk_use = function(self, card, area, copier, number)
26892699
for j = 1, number do
26902700
local same = 0
2691-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, 1, 1)
2701+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, 1, 1)
26922702
for i = 1, #G.deck.cards do
26932703
if G.deck.cards[i].base.value == cards[1].base.value then
26942704
same = i
@@ -3244,7 +3254,7 @@ local class = {
32443254

32453255
if enh_suffix then
32463256
local TempCard = {}
3247-
local cards = Cryptid.get_highlighted_cards({G.hand}, {}, 1, G.CODE_MAX_HIGHLIGHT)
3257+
local cards = Cryptid.get_highlighted_cards({ G.hand }, {}, 1, G.CODE_MAX_HIGHLIGHT)
32483258
for i = 1, #cards do
32493259
TempCard[i] = cards[i]
32503260
end
@@ -3402,7 +3412,6 @@ local class = {
34023412
G.ENTERED_ENH = pseudorandom_element(choices, pseudoseed("forceclass"))
34033413
G.FUNCS.class_cancel()
34043414
G.FUNCS.class_apply()
3405-
34063415
end,
34073416
}
34083417
-- ://Global
@@ -3434,7 +3443,7 @@ local global = {
34343443
atlas = "atlasnotjokers",
34353444
order = 422,
34363445
can_use = function(self, card)
3437-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, 1, 1)
3446+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, 1, 1)
34383447
return #cards == 1
34393448
end,
34403449
loc_vars = function(self, info_queue, card)
@@ -3444,7 +3453,7 @@ local global = {
34443453
if area then
34453454
area:remove_from_highlighted(card)
34463455
end
3447-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, 1, 1)
3456+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, 1, 1)
34483457
if cards[1] then
34493458
cards[1].ability.cry_global_sticker = true
34503459
end
@@ -3686,7 +3695,7 @@ local variable = {
36863695

36873696
if rank_suffix then
36883697
local TempCard = {}
3689-
local cards = Cryptid.get_highlighted_cards({G.hand}, {}, 1, G.CODE_MAX_HIGHLIGHT)
3698+
local cards = Cryptid.get_highlighted_cards({ G.hand }, {}, 1, G.CODE_MAX_HIGHLIGHT)
36903699
for i = 1, #cards do
36913700
TempCard[i] = cards[i]
36923701
end
@@ -3820,7 +3829,9 @@ local variable = {
38203829
}))
38213830
delay(0.5)
38223831
end
3823-
if G.CHOOSE_RANK then G.CHOOSE_RANK:remove() end
3832+
if G.CHOOSE_RANK then
3833+
G.CHOOSE_RANK:remove()
3834+
end
38243835
G.CODE_MAX_HIGHLIGHT = nil
38253836
end
38263837
end
@@ -4013,11 +4024,15 @@ local multiply = {
40134024
pos = { x = 10, y = 2 },
40144025
cost = 4,
40154026
can_use = function(self, card)
4016-
local cards = Cryptid.get_highlighted_cards({G.jokers}, card, 1, 1, function(card) return not Card.no(card, "immutable", true) end)
4027+
local cards = Cryptid.get_highlighted_cards({ G.jokers }, card, 1, 1, function(card)
4028+
return not Card.no(card, "immutable", true)
4029+
end)
40174030
return #cards == 1
40184031
end,
40194032
use = function(self, card, area, copier)
4020-
local cards = Cryptid.get_highlighted_cards({G.jokers}, card, 1, 1, function(card) return not Card.no(card, "immutable", true) end)
4033+
local cards = Cryptid.get_highlighted_cards({ G.jokers }, card, 1, 1, function(card)
4034+
return not Card.no(card, "immutable", true)
4035+
end)
40214036
if cards[1] and not cards[1].config.cry_multiply then
40224037
cards[1].config.cry_multiply = 1
40234038
end
@@ -4276,13 +4291,13 @@ local ctrl_v = {
42764291
return {}
42774292
end,
42784293
can_use = function(self, card)
4279-
local cards = Cryptid.get_highlighted_cards({G.hand, G.consumeables, G.pack_cards}, card, 1, 1, function(card)
4294+
local cards = Cryptid.get_highlighted_cards({ G.hand, G.consumeables, G.pack_cards }, card, 1, 1, function(card)
42804295
return card.area ~= G.pack_Cards or card.ability.set == "Default" or card.ability.set == "Enhanced"
42814296
end)
42824297
return #cards == 1
42834298
end,
42844299
use = function(self, card, area, copier)
4285-
local cards = Cryptid.get_highlighted_cards({G.hand, G.consumeables, G.pack_cards}, card, 1, 1, function(card)
4300+
local cards = Cryptid.get_highlighted_cards({ G.hand, G.consumeables, G.pack_cards }, card, 1, 1, function(card)
42864301
return card.area ~= G.pack_Cards or card.ability.set == "Default" or card.ability.set == "Enhanced"
42874302
end)
42884303
if cards[1] then
@@ -4339,9 +4354,15 @@ local ctrl_v = {
43394354
end
43404355
end,
43414356
bulk_use = function(self, card, area, copier, number)
4342-
local cards = Cryptid.get_highlighted_cards({G.hand, G.consumeables, G.pack_cards}, cards, 1, 1, function(card)
4343-
return card.area ~= G.pack_Cards or card.ability.set == "Default" or card.ability.set == "Enhanced"
4344-
end)
4357+
local cards = Cryptid.get_highlighted_cards(
4358+
{ G.hand, G.consumeables, G.pack_cards },
4359+
cards,
4360+
1,
4361+
1,
4362+
function(card)
4363+
return card.area ~= G.pack_Cards or card.ability.set == "Default" or card.ability.set == "Enhanced"
4364+
end
4365+
)
43454366
for i = 1, number do
43464367
if cards[1] then
43474368
if cards[1].area == G.hand then
@@ -4381,7 +4402,7 @@ local ctrl_v = {
43814402
if Incantation then
43824403
card:setQty(1)
43834404
end
4384-
4405+
43854406
-- Edit by IcyEthics: Needed to choose between not allowing copying playing cards or adding them to deck. Made it so they're added to deck.
43864407
if card.ability.set == "Default" or card.ability.set == "Enhanced" then
43874408
table.insert(G.playing_cards, card)
@@ -4614,11 +4635,11 @@ local source = {
46144635
atlas = "atlasnotjokers",
46154636
pos = { x = 2, y = 4 },
46164637
can_use = function(self, card)
4617-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, 1, card.ability.max_highlighted)
4638+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, 1, card.ability.max_highlighted)
46184639
return #cards > 0 and #cards <= to_number(card.ability.max_highlighted)
46194640
end,
46204641
use = function(self, card, area, copier) --Good enough
4621-
local cards = Cryptid.get_highlighted_cards({G.hand}, {}, 1, 1)
4642+
local cards = Cryptid.get_highlighted_cards({ G.hand }, {}, 1, 1)
46224643
for i = 1, #cards do
46234644
local highlighted = cards[i]
46244645
G.E_MANAGER:add_event(Event({

items/spectral.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,14 @@ local ritual = {
639639
atlas = "atlasnotjokers",
640640
pos = { x = 5, y = 1 },
641641
can_use = function(self, card)
642-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, 1, card.ability.max_highlighted, function(card)
642+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, 1, card.ability.max_highlighted, function(card)
643643
return not card.edition
644644
end)
645645
return #cards > 0 and #cards <= card.ability.max_highlighted
646646
end,
647647
use = function(self, card, area, copier)
648648
local used_consumable = copier or card
649-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, 1, card.ability.max_highlighted, function(card)
649+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, 1, card.ability.max_highlighted, function(card)
650650
return not card.edition
651651
end)
652652
for i = 1, #cards do
@@ -916,7 +916,7 @@ local conduit = {
916916
end,
917917
use = function(self, card, area, copier)
918918
local used_consumable = copier or card
919-
local combinedTable = Cryptid.get_highlighted_cards({G.hand, G.jokers}, card, 2, 2)
919+
local combinedTable = Cryptid.get_highlighted_cards({ G.hand, G.jokers }, card, 2, 2)
920920
local highlighted_1 = combinedTable[1]
921921
local highlighted_2 = combinedTable[2]
922922
G.E_MANAGER:add_event(Event({
@@ -1177,7 +1177,7 @@ local typhoon = {
11771177
use = function(self, card, area, copier) --Good enough
11781178
local used_consumable = copier or card
11791179
check_for_unlock({ cry_used_consumable = "c_cry_typhoon" })
1180-
local cards = Cryptid.get_highlighted_cards({G.hand}, card, 1, card.ability.max_highlighted)
1180+
local cards = Cryptid.get_highlighted_cards({ G.hand }, card, 1, card.ability.max_highlighted)
11811181
for i = 1, #cards do
11821182
local highlighted = cards[i]
11831183
G.E_MANAGER:add_event(Event({
@@ -1230,7 +1230,7 @@ local meld = {
12301230
cost = 4,
12311231
atlas = "atlasnotjokers",
12321232
can_use = function(self, card)
1233-
local cards = Cryptid.get_highlighted_cards({G.jokers, G.hand}, card, 1, 1, function(card)
1233+
local cards = Cryptid.get_highlighted_cards({ G.jokers, G.hand }, card, 1, 1, function(card)
12341234
return not Card.no(card, "dbl") and not card.edition
12351235
end)
12361236
return #cards == 1
@@ -1251,7 +1251,7 @@ local meld = {
12511251
info_queue[#info_queue + 1] = G.P_CENTERS.e_cry_double_sided
12521252
end,
12531253
use = function(self, card, area, copier)
1254-
local cards = Cryptid.get_highlighted_cards({G.jokers}, card, 1, 1)
1254+
local cards = Cryptid.get_highlighted_cards({ G.jokers }, card, 1, 1)
12551255
if #cards == 1 then
12561256
cards[1]:remove_from_deck(true)
12571257
cards[1]:set_edition({ cry_double_sided = true })

lib/forcetrigger.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -937,19 +937,17 @@ function Cryptid.forcetrigger(card, context)
937937
elseif card.ability.consumeable and Cryptid.forcetriggerConsumableCheck(card) then
938938
G.cry_force_use = true
939939
if
940-
(card.ability.consumeable.max_highlighted
941-
or card.ability.name == "Aura") and not card.config.center.original_mod
940+
(card.ability.consumeable.max_highlighted or card.ability.name == "Aura")
941+
and not card.config.center.original_mod
942942
then --Cards that require cards in hand to be selected
943943
local _cards = {}
944944
local targets = {}
945945

946946
--Get all cards that we can target
947947
for k, v in ipairs(G.hand.cards) do
948948
if
949-
not (
950-
(card.ability.name == "Aura")
951-
and (v.edition or v.will_be_editioned)
952-
) and not v.will_be_destroyed
949+
not ((card.ability.name == "Aura") and (v.edition or v.will_be_editioned))
950+
and not v.will_be_destroyed
953951
then
954952
_cards[#_cards + 1] = v
955953
end
@@ -1004,7 +1002,9 @@ function Cryptid.forcetrigger(card, context)
10041002
local ggpn = G.GAME.probabilities.normal
10051003
G.GAME.probabilities.normal = 1e9
10061004

1007-
if not card.config.center.force_use then card:use_consumeable() else
1005+
if not card.config.center.force_use then
1006+
card:use_consumeable()
1007+
else
10081008
card.config.center:force_use(card, card.area)
10091009
end
10101010

0 commit comments

Comments
 (0)