[manifest]
version = "1.0.0"
dump_lua = true
priority = 2147483647

[[patches]]
[patches.pattern]
target = "globals.lua"
pattern = "EDITION = {1,1,1,1},"
position = "before"
payload = '''jane_RGB = {0,0,0,1},
jane_RGB_HUE = 0,
almighty = {0,0,1,1},'''
match_indent = true

[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if v.name == 'Black Hole' or v.name == 'The Soul' or v.hidden then"
position = "at"
payload = "if Jane.hidden(v) then"
match_indent = true
overwrite = false

[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = "G.GAME.current_round.current_hand.chips*G.GAME.current_round.current_hand.mult"
position = "at"
payload = '''Jane.get_chipmult_sum(G.GAME.current_round.current_hand.chips, G.GAME.current_round.current_hand.mult)'''
match_indent = true

[[patches]]
[patches.pattern]
target = "functions/misc_functions.lua"
pattern = "local AC = G.SETTINGS.ambient_control"
position = "before"
payload = '''if Jane and G.ARGS.score_intensity.required_score ~= 0 then
	Jane.sinister = (G.ARGS.score_intensity.earned_score / (to_big(10) ^ to_big(G.ARGS.score_intensity.required_score))):to_number() > 1
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, {
                cardarea = G.jokers,
                full_hand = G.hand.cards,
                scoring_hand = G.hand.cards,
                scoring_name = text,
                poker_hands = poker_hands,
                edition = true,
                pre_joker = true
            })
        end
    end
end'''
match_indent = true

[[patches]]
[patches.pattern]
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})"
match_indent = true

[[patches]]
[patches.regex]
target = "functions/state_events.lua"
pattern = '''hand_chips\*mult'''
position = "at"
payload = "Jane.get_chipmult_sum(hand_chips, mult)"
match_indent = true
