Skip to content

Commit 87a218f

Browse files
committed
Reposition context.drawing_cards to influence new card_limit calculation
1 parent 839d149 commit 87a218f

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

lovely/better_calc.toml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,25 +1072,6 @@ draw_card(G.deck,G.hand, i*100/hand_space,'up', true, cards_to_draw[i])
10721072
'''
10731073

10741074

1075-
# context.hand_space
1076-
[[patches]]
1077-
[patches.pattern]
1078-
target = 'functions/state_events.lua'
1079-
match_indent = true
1080-
position = 'after'
1081-
pattern = '''
1082-
if G.GAME.blind.name == 'The Serpent' and
1083-
not G.GAME.blind.disabled and
1084-
(G.GAME.current_round.hands_played > 0 or
1085-
G.GAME.current_round.discards_used > 0) then
1086-
hand_space = math.min(#G.deck.cards, 3)
1087-
end
1088-
'''
1089-
payload = '''
1090-
local flags = SMODS.calculate_context({drawing_cards = true, amount = hand_space})
1091-
hand_space = math.min(#G.deck.cards, flags.cards_to_draw or flags.modify or hand_space)
1092-
'''
1093-
10941075
# Used to identify first hand of round
10951076
# new_round
10961077
[[patches]]

lovely/card_limit.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ payload = """local hand_space = e
269269
local cards_to_draw = {}
270270
local space_taken = 0
271271
local limit = G.hand.config.card_limit - #G.hand.cards - (SMODS.cards_to_draw or 0)
272+
local flags = SMODS.calculate_context({drawing_cards = true, amount = limit})
273+
limit = flags.cards_to_draw or flags.modify or limit
272274
local unfixed = not G.hand.config.fixed_limit
273275
local n = 0
274276
while n < #G.deck.cards and limit > 0 do

version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
return "1.0.0~BETA-1215c-STEAMODDED"
1+
return "1.0.0~BETA-1216a-STEAMODDED"

0 commit comments

Comments
 (0)