diff --git a/Cryptid.json b/Cryptid.json index f55c6feee..8782d8f85 100644 --- a/Cryptid.json +++ b/Cryptid.json @@ -12,7 +12,7 @@ "version": "0.5.17~dev", "dependencies": [ "Amulet (>=2.7)", - "Steamodded (>=1.0.0~BETA-2008b)" + "Steamodded (>=1.0.0~BETA-2010b)" ], "conflicts": [ "AntePreview (>= 2.0.0~0c16a) (<<3.0.0)", diff --git a/items/misc.lua b/items/misc.lua index e39ffc139..dc52fefb1 100644 --- a/items/misc.lua +++ b/items/misc.lua @@ -1867,14 +1867,16 @@ local glass_edition = { context.cardarea == G.jokers and context.post_trigger and context.other_card == card --animation-wise this looks weird sometimes + and Cryptid.isNonRollProbabilityContext(context.other_context) then + local shatter_chance = card and card.edition and card.edition.shatter_chance or self.config.shatter_chance if not SMODS.is_eternal(card) and not SMODS.pseudorandom_probability( card, "cry_fragile", - card.edition.shatter_chance - 1, - card.edition.shatter_chance, + shatter_chance - 1, + shatter_chance, nil, true ) @@ -1884,24 +1886,24 @@ local glass_edition = { end end if context.main_scoring and context.cardarea == G.play then + return { x_mult = card and card.edition and card.edition.x_mult or self.config.x_mult } + end + + if context.destroy_card and context.destroy_card == card and context.cardarea == G.play then + local shatter_chance = card and card.edition and card.edition.shatter_chance or self.config.shatter_chance if not SMODS.is_eternal(card) - and SMODS.pseudorandom_probability( + and not SMODS.pseudorandom_probability( card, "cry_fragile", - card.edition.shatter_chance - 1, - card.edition.shatter_chance, + shatter_chance - 1, + shatter_chance, nil, true ) then - card.config.will_shatter = true + return { remove = true } end - return { x_mult = self.config.x_mult } - end - - if context.destroy_card and context.destroy_card == card and card.config.will_shatter then - return { remove = true } end end, attributes = { "chance", "destroy_card", "xmult" }, diff --git a/lib/calculate.lua b/lib/calculate.lua index 43e261ca7..22aa80622 100644 --- a/lib/calculate.lua +++ b/lib/calculate.lua @@ -21,9 +21,6 @@ function eval_card(card, context) end, } end - if card.will_shatter then - return {}, {} - end -- Store old probability for later reference local ret, post = ec(card, context) return ret, post diff --git a/lib/overrides.lua b/lib/overrides.lua index ec55a4f0e..72b51dea8 100644 --- a/lib/overrides.lua +++ b/lib/overrides.lua @@ -1617,7 +1617,9 @@ function Card:shatter(volume) self.shattered = true self.dissolve = 0 self.dissolve_colours = { { 1, 1, 1, 0.8 } } - self:juice_up() + if type(volume) ~= "table" or not volume.no_juice then + self:juice_up() + end local childParts = Particles(0, 0, 0, 0, { timer_type = "TOTAL", timer = 0.007 * dissolve_time, @@ -1640,8 +1642,12 @@ function Card:shatter(volume) G.E_MANAGER:add_event(Event({ blockable = false, func = function() - play_sound("glass" .. math.random(1, 6), math.random() * 0.2 + 0.9, volume or 0.5) - play_sound("generic1", math.random() * 0.2 + 0.9, volume or 0.5) + local silent = type(volume) == "table" and volume.silent + if not silent then + local vol = (type(volume) == "number" and volume) or (type(volume) == "table" and volume.volume) or 0.5 + play_sound("glass" .. math.random(1, 6), math.random() * 0.2 + 0.9, vol) + play_sound("generic1", math.random() * 0.2 + 0.9, vol) + end return true end, }))