Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly fixed a Spectrogram Crash #404

Merged
merged 2 commits into from
Feb 20, 2025
Merged
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
33 changes: 16 additions & 17 deletions items/epic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1833,7 +1833,7 @@ local spectrogram = {
name = "cry-Spectrogram",
key = "spectrogram",
pos = { x = 1, y = 5 },
config = { extra = {} },
config = { extra = {echonum = 0} },
rarity = "cry_epic",
cost = 9,
order = 133,
Expand All @@ -1849,25 +1849,24 @@ local spectrogram = {
return { vars = {} }
end,
calculate = function(self, card, context)
if context.retrigger_joker_check and not context.retrigger_joker and context.other_card ~= self then
if context.other_context.scoring_hand then
if context.other_card == G.jokers.cards[#G.jokers.cards] then
local echonum = 0
for i, v in pairs (context.other_context.scoring_hand) do
if v.config.center_key == 'm_cry_echo' then
echonum = echonum + 1
end
end
if echonum > 0 then
return {
message = localize("k_again_ex"),
repetitions = echonum,
card = card,
}
end
if context.before and context.cardarea == G.jokers then
card.ability.extra.echonum = 0
for i, v in pairs(context.scoring_hand) do
if v.config.center_key == 'm_cry_echo' and not v.debuff then
card.ability.extra.echonum = card.ability.extra.echonum + 1
end
end
end

if context.retrigger_joker_check and not context.retrigger_joker and context.other_card ~= self then
if card.ability.extra.echonum and card.ability.extra.echonum > 0 then
return {
message = localize("k_again_ex"),
repetitions = card.ability.extra.echonum,
card = card,
}
end
end
end,
cry_credits = {
idea = {
Expand Down