From 926175105ee4bf9d47606eebf14f791f5645ab0b Mon Sep 17 00:00:00 2001 From: Emik Date: Mon, 24 Mar 2025 16:19:56 +0100 Subject: [PATCH] Interleave cards held in hand effects --- lovely.toml | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/lovely.toml b/lovely.toml index dbcde70..3988b99 100644 --- a/lovely.toml +++ b/lovely.toml @@ -40,14 +40,34 @@ payload = '''if Jane and G.ARGS.score_intensity.required_score ~= 0 then end''' match_indent = true +[[patches]] +[patches.pattern] +target = "functions/state_events.lua" +pattern = "for _, v in ipairs(SMODS.get_card_areas('playing_cards')) do" +position = "after" +payload = '''if v == G.hand and not (G.GAME.blind and G.GAME.blind.name == "The Card" and not G.GAME.blind.disabled) and next(SMODS.find_card('j_jane_survivor')) then + for _, v in ipairs(G.hand.cards) do + local area = {cards = {v}} + SMODS.calculate_main_scoring({cardarea = area, full_hand = area.cards, scoring_hand = area.cards, scoring_name = text, poker_hands = poker_hands}, area.cards) + SMODS.calculate_main_scoring({cardarea = area, full_hand = area.cards, scoring_hand = area.cards, scoring_name = text, poker_hands = poker_hands}, nil) + end +else''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "functions/state_events.lua" +pattern = "SMODS.calculate_main_scoring({cardarea = v, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands}, v == G.play and scoring_hand or nil)" +position = "after" +payload = "end" +match_indent = true + [[patches]] [patches.pattern] target = "functions/state_events.lua" pattern = "-- context.final_scoring_step calculations" position = "before" payload = '''if not (G.GAME.blind and G.GAME.blind.name == "The Card" and not G.GAME.blind.disabled) and next(SMODS.find_card('j_jane_survivor')) then - SMODS.calculate_main_scoring({cardarea = G.hand, full_hand = G.hand.cards, scoring_hand = G.hand.cards, scoring_name = text, poker_hands = poker_hands}, G.hand.cards) - for _, area in ipairs(SMODS.get_card_areas('jokers')) do for _, _card in ipairs(area.cards) do local eval = eval_card(_card, { @@ -69,7 +89,19 @@ match_indent = true target = "functions/state_events.lua" pattern = "SMODS.calculate_context({full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, final_scoring_step = true})" position = "after" -payload = "SMODS.calculate_context({full_hand = G.hand.cards, scoring_hand = G.hand.cards, scoring_name = text, poker_hands = poker_hands, final_scoring_step = true})" +payload = '''if not (G.GAME.blind and G.GAME.blind.name == "The Card" and not G.GAME.blind.disabled) and next(SMODS.find_card('j_jane_survivor')) then + SMODS.calculate_context({full_hand = G.hand.cards, scoring_hand = G.hand.cards, scoring_name = text, poker_hands = poker_hands, final_scoring_step = true}) +end''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "functions/state_events.lua" +pattern = "-- context.remove_playing_cards calculations" +position = "before" +payload = '''if not (G.GAME.blind and G.GAME.blind.name == "The Card" and not G.GAME.blind.disabled) and next(SMODS.find_card('j_jane_survivor')) then + SMODS.calculate_destroying_cards({ full_hand = G.hand.cards, scoring_hand = G.hand.cards, scoring_name = text, poker_hands = poker_hands, cardarea = G.hand }, cards_destroyed, G.hand) +end''' match_indent = true [[patches]]