diff --git a/items/stake.lua b/items/stake.lua index aaf55520d..43fb8a631 100644 --- a/items/stake.lua +++ b/items/stake.lua @@ -179,6 +179,13 @@ local glass = { shiny = true, order = 21, colour = HEX("ffffff8f"), + calculate = function(self, context) + if context.destroy_card and context.cardarea == G.play and G.GAME.modifiers.cry_shatter_rate + and SMODS.pseudorandom_probability(self, 'cry_shatter', 1, G.GAME.modifiers.cry_shatter_rate) and not SMODS.is_eternal(context.destroy_card) then + context.destroy_card.cry_glass_trigger = true + return { remove = true } + end + end, } local sapphire = { object_type = "Stake", diff --git a/lib/overrides.lua b/lib/overrides.lua index 2fb5ac7a3..38e5f2b4d 100644 --- a/lib/overrides.lua +++ b/lib/overrides.lua @@ -2310,3 +2310,8 @@ function UIElement:draw_self() end draw_self(self) end + +local smods_shatters_ref = SMODS.shatters +function SMODS.shatters(card) + return card.cry_glass_trigger or smods_shatters_ref(card) +end \ No newline at end of file diff --git a/lovely/Probability.toml b/lovely/Probability.toml index 23c0d857d..0ea20772f 100644 --- a/lovely/Probability.toml +++ b/lovely/Probability.toml @@ -37,16 +37,16 @@ match_indent = true # wow this is a fat line # Yellow Stake - Glass can't destroy Eternals # Glass Stake - Any card can shatter -[[patches]] -[patches.pattern] -target = "functions/state_events.lua" -pattern = '''if SMODS.has_enhancement(scoring_hand[i], 'm_glass') and scoring_hand[i]:can_calculate() and pseudorandom('glass') < G.GAME.probabilities.normal/(scoring_hand[i].ability.name == 'Glass Card' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then''' -position = "at" -payload = ''' -if (SMODS.has_enhancement(scoring_hand[i], 'm_glass') - and not scoring_hand[i].debuff - and SMODS.pseudorandom_probability(scoring_hand[i], 'glass', 1, scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) - or (G.GAME.modifiers.cry_shatter_rate - and pseudorandom('cry_shatter') < 1 / G.GAME.modifiers.cry_shatter_rate)) - and not SMODS.is_eternal(scoring_hand[i]) then''' -match_indent = true \ No newline at end of file +# [[patches]] +# [patches.pattern] +# target = "functions/state_events.lua" +# pattern = '''if SMODS.has_enhancement(scoring_hand[i], 'm_glass') and scoring_hand[i]:can_calculate() and pseudorandom('glass') < G.GAME.probabilities.normal/(scoring_hand[i].ability.name == 'Glass Card' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then''' +# position = "at" +# payload = ''' +# if (SMODS.has_enhancement(scoring_hand[i], 'm_glass') +# and not scoring_hand[i].debuff +# and SMODS.pseudorandom_probability(scoring_hand[i], 'glass', 1, scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) +# or (G.GAME.modifiers.cry_shatter_rate +# and pseudorandom('cry_shatter') < 1 / G.GAME.modifiers.cry_shatter_rate)) +# and not SMODS.is_eternal(scoring_hand[i]) then''' +# match_indent = true \ No newline at end of file diff --git a/lovely/stake.toml b/lovely/stake.toml index 52a4d3601..3fc03223c 100644 --- a/lovely/stake.toml +++ b/lovely/stake.toml @@ -285,16 +285,13 @@ match_indent = true # Sapphire Stake - ante tax -# The Joke boss effect -# Save game state for Revert -# this needs to be redone at a later point -# [[patches]] -#[patches.pattern] -#target = "functions/state_events.lua" -#pattern = "delay(0.4); ease_ante(1); delay(0.4); check_for_unlock({type = 'ante_up', ante = G.GAME.round_resets.ante + 1})" -#position = "at" -#payload = "delay(0.4); ease_ante(G.GAME.blind and G.GAME.blind:cry_calc_ante_gain() or 1); Cryptid.apply_ante_tax(); delay(0.4); check_for_unlock({type = 'ante_up', ante = G.GAME.round_resets.ante + 1})" -#match_indent = true +[[patches]] +[patches.pattern] +target = "functions/state_events.lua" +pattern = "delay(0.4); SMODS.ante_end = true; ease_ante(1); SMODS.ante_end = nil; delay(0.4); check_for_unlock({type = 'ante_up', ante = G.GAME.round_resets.ante + 1})" +position = "at" +payload = "delay(0.4); SMODS.ante_end = true; ease_ante(1); Cryptid.apply_ante_tax(); SMODS.ante_end = nil; delay(0.4); check_for_unlock({type = 'ante_up', ante = G.GAME.round_resets.ante + 1})" +match_indent = true # Emerald Stake - Permanently flipped cards