Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cryptid.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
24 changes: 13 additions & 11 deletions items/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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" },
Expand Down
3 changes: 0 additions & 3 deletions lib/calculate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions lib/overrides.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
}))
Expand Down