Skip to content

Commit d9be594

Browse files
authored
SMODS.Back.initial_deck (#1124)
1 parent fb3e7fb commit d9be594

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

lovely/playing_card.toml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,29 @@ or not SMODS.add_to_pool(SMODS.Suits[v.suit], {initial_deck = true, rank = v.val
4242
goto continue
4343
end'''
4444

45+
[[patches]]
46+
[patches.pattern]
47+
target = "game.lua"
48+
pattern = 'local _ = nil'
49+
position = 'before'
50+
match_indent = true
51+
payload = '''
52+
if self.GAME.selected_back_key.initial_deck then
53+
local _id = self.GAME.selected_back_key.initial_deck
54+
local _exclude = _id.exclude
55+
for i,_tab in ipairs({_id.Ranks or _id.exclude and {} or SMODS.Rank.obj_buffer, _id.Suits}) do
56+
if _tab ~= nil then
57+
local _create = not not _exclude
58+
for _,_v in ipairs(_tab) do
59+
if (i==1 and v.value or v.suit) == _v then _create = not _exclude; break end
60+
end
61+
if not _create then
62+
goto continue
63+
end
64+
end
65+
end
66+
end'''
67+
4568
[[patches]]
4669
[patches.pattern]
4770
target = "game.lua"
@@ -352,4 +375,4 @@ target = 'card.lua'
352375
pattern = '''if next(card) then'''
353376
position = 'at'
354377
match_indent = true
355-
payload = '''if next(card) and not manual_sprites then'''
378+
payload = '''if next(card) and not manual_sprites then'''

0 commit comments

Comments
 (0)