From 4110ad5a92cb3746dd6d7883f914d14d2e54c0e5 Mon Sep 17 00:00:00 2001 From: Andres Date: Wed, 30 Apr 2025 18:36:49 +0200 Subject: [PATCH] fix seeing double crashing the game --- FantomsPreview.json | 8 +++++--- Jokers/_Vanilla.lua | 18 +++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/FantomsPreview.json b/FantomsPreview.json index 2e7cd7b..5a72b1d 100644 --- a/FantomsPreview.json +++ b/FantomsPreview.json @@ -2,12 +2,14 @@ "id": "FantomsPreview", "name": "Fantoms Preview", "display_name": "Fantoms Preview", - "author": ["Fantom, Divvy"], + "author": [ + "Fantom, Divvy" + ], "description": "A QoL mod for balatro allowing for a preview of score/money before submitting the hand.", "prefix": "fn", "main_file": "CorePreview.lua", "priority": 0, - "version": "2.2.0", + "version": "2.3.0", "dependencies": [], "conflicts": [] -} +} \ No newline at end of file diff --git a/Jokers/_Vanilla.lua b/Jokers/_Vanilla.lua index 494d1ff..693c4b9 100644 --- a/Jokers/_Vanilla.lua +++ b/Jokers/_Vanilla.lua @@ -805,10 +805,10 @@ FNSJ.simulate_seeing_double = function(joker_obj, context) -- Account for all 'real' suits: for _, card in ipairs(context.scoring_hand) do if card.ability.effect ~= "Wild Card" then - if DV.SIM.is_suit(card, "Hearts") then inc_suit("Hearts") end - if DV.SIM.is_suit(card, "Diamonds") then inc_suit("Diamonds") end - if DV.SIM.is_suit(card, "Spades") then inc_suit("Spades") end - if DV.SIM.is_suit(card, "Clubs") then inc_suit("Clubs") end + if FN.SIM.is_suit(card, "Hearts") then inc_suit("Hearts") end + if FN.SIM.is_suit(card, "Diamonds") then inc_suit("Diamonds") end + if FN.SIM.is_suit(card, "Spades") then inc_suit("Spades") end + if FN.SIM.is_suit(card, "Clubs") then inc_suit("Clubs") end end end @@ -816,16 +816,16 @@ FNSJ.simulate_seeing_double = function(joker_obj, context) for _, card in ipairs(context.scoring_hand) do if card.ability.effect == "Wild Card" then -- IMPORTANT: Clubs must come first here, because Clubs are required for xmult. This is in line with game's implementation. - if DV.SIM.is_suit(card, "Clubs") and suit_count["Clubs"] == 0 then inc_suit("Clubs") - elseif DV.SIM.is_suit(card, "Hearts") and suit_count["Hearts"] == 0 then inc_suit("Hearts") - elseif DV.SIM.is_suit(card, "Diamonds") and suit_count["Diamonds"] == 0 then inc_suit("Diamonds") - elseif DV.SIM.is_suit(card, "Spades") and suit_count["Spades"] == 0 then inc_suit("Spades") + if FN.SIM.is_suit(card, "Clubs") and suit_count["Clubs"] == 0 then inc_suit("Clubs") + elseif FN.SIM.is_suit(card, "Hearts") and suit_count["Hearts"] == 0 then inc_suit("Hearts") + elseif FN.SIM.is_suit(card, "Diamonds") and suit_count["Diamonds"] == 0 then inc_suit("Diamonds") + elseif FN.SIM.is_suit(card, "Spades") and suit_count["Spades"] == 0 then inc_suit("Spades") end end end if suit_count["Clubs"] > 0 and (suit_count["Hearts"] > 0 or suit_count["Diamonds"] > 0 or suit_count["Spades"] > 0) then - DV.SIM.x_mult(joker_obj.ability.extra) + FN.SIM.x_mult(joker_obj.ability.extra) end end end