File tree Expand file tree Collapse file tree 2 files changed +16
-17
lines changed
Expand file tree Collapse file tree 2 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -254,22 +254,21 @@ position = "at"
254254payload = """ local hand_space = e
255255local cards_to_draw = {}
256256local space_taken = 0
257- local limit = G.hand.config.card_limit - #G.hand.cards - (SMODS.cards_to_draw or 0)
258- local unfixed = not G.hand.config.fixed_limit
259- local n = 0
260- while n < #G.deck.cards do
261- local card = G.deck.cards[#G.deck.cards-n]
262- local mod = unfixed and (card.ability.card_limit - card.ability.extra_slots_used) or 0
263- if limit - 1 + mod < 0 then
264- else
265- limit = limit - 1 + mod
266- table.insert(cards_to_draw, card)
267- space_taken = space_taken + (1 - mod)
268- if limit <= 0 then break end
269- end
270- n = n + 1
257+ local limit = G.hand.config.card_limit - #G.hand.cards - (SMODS.cards_to_draw or 0)
258+ local unfixed = not G.hand.config.fixed_limit
259+ local n = 0
260+ while n < #G.deck.cards and limit > 0 do
261+ local card = G.deck.cards[#G.deck.cards-n]
262+ local mod = unfixed and (card.ability.card_limit - card.ability.extra_slots_used) or 0
263+ if limit - 1 + mod < 0 then
264+ else
265+ limit = limit - 1 + mod
266+ table.insert(cards_to_draw, card)
267+ space_taken = space_taken + (1 - mod)
271268 end
272- hand_space = #cards_to_draw
269+ n = n + 1
270+ end
271+ hand_space = #cards_to_draw
273272"""
274273match_indent = true
275274
Original file line number Diff line number Diff line change @@ -3186,9 +3186,9 @@ function CardArea:handle_card_limit()
31863186 if SMODS .should_handle_limit (self ) then
31873187 self .config .card_limits .old_slots = self .config .card_limits .total_slots or 0
31883188 self .config .card_limits .extra_slots = self :count_property (' card_limit' )
3189- self .config .card_limits .total_slots = self : count_property ( ' card_limit ' ) + (self .config .card_limits .base or 0 ) + (self .config .card_limits .mod or 0 )
3189+ self .config .card_limits .total_slots = self . config . card_limits . extra_slots + (self .config .card_limits .base or 0 ) + (self .config .card_limits .mod or 0 )
31903190 self .config .card_limits .extra_slots_used = self :count_property (' extra_slots_used' )
3191- self .config .card_count = # self .cards + self : count_property ( ' extra_slots_used' )
3191+ self .config .card_count = # self .cards + self . config . card_limits . extra_slots_used
31923192
31933193 if G .hand and self == G .hand and self .config .card_count + (SMODS .cards_to_draw or 0 ) < self .config .card_limits .total_slots then
31943194 if G .STATE == G .STATES .DRAW_TO_HAND and not SMODS .blind_modifies_draw (G .GAME .blind .config .blind .key ) and not SMODS .draw_queued then
You can’t perform that action at this time.
0 commit comments