From 35cd8f6ff54e998626683370bc57bb2373fac172 Mon Sep 17 00:00:00 2001 From: Stephen Owen Date: Tue, 20 May 2025 08:44:30 -0400 Subject: [PATCH 1/2] Fix StyloPhone to handle stone-like modded jokers Adds an extra clause to prevent an attempted negative pitch playback, which can happen when other mods add a stone like joker or any card that has a `h_x_effect` style enhancement --- Bunco.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Bunco.lua b/Bunco.lua index 3cae36ac..2b68e7a0 100644 --- a/Bunco.lua +++ b/Bunco.lua @@ -3914,7 +3914,9 @@ create_joker({ -- Stylophone local instrument = 'bunc_stone' local function calculate_pitch(pitch) - return 2^(pitch / 12) + if pitch < 1 then pitch = 1 end + local result = 2^(pitch / 12) + return result end if other_card.config.center ~= G.P_CENTERS.m_stone then @@ -8454,4 +8456,4 @@ SMODS.Stake:take_ownership('gold', { if _G["JokerDisplay"] then filesystem.load(BUNCOMOD.content.path..'compat/jokerdisplay.lua')() -end \ No newline at end of file +end From 1c917d9f69aa368383e1c75f9369a456eff0e3b1 Mon Sep 17 00:00:00 2001 From: Stephen Owen Date: Tue, 20 May 2025 08:52:58 -0400 Subject: [PATCH 2/2] Fix StyloPhone to handle stone-like modded jokers, mult step --- Bunco.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Bunco.lua b/Bunco.lua index 2b68e7a0..b8a6fee2 100644 --- a/Bunco.lua +++ b/Bunco.lua @@ -3902,6 +3902,7 @@ create_joker({ -- Jumper end }) + create_joker({ -- Stylophone name = 'Stylophone', position = 60, vars = {{x = 0.3}}, @@ -3941,13 +3942,18 @@ create_joker({ -- Stylophone if context.individual and context.cardarea == G.play then play_stylophone(context.other_card) + if context.other_card.config.center ~= G.P_CENTERS.m_stone then + local otherId = context.other_card:get_id() + if otherId < 1 then otherId = 1 end + return { - mult = context.other_card:get_id() * card.ability.extra.x, + mult = otherId * card.ability.extra.x, card = card } end end + if context.click and context.other_card.area == G.hand then extra_juice(card) play_stylophone(context.other_card)