Skip to content

Commit 856229e

Browse files
Merge pull request #766 from InvalidOS/patch-3
Make Duplicare only trigger in probability contexts on roll
2 parents 19cc783 + 05500e0 commit 856229e

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

items/exotic.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,11 @@ local duplicare = {
14621462
if
14631463
not context.blueprint
14641464
and (
1465-
(context.post_trigger and context.other_joker ~= card)
1465+
(
1466+
context.post_trigger
1467+
and context.other_joker ~= card
1468+
and Cryptid.isNonRollProbabilityContext(context.other_context)
1469+
)
14661470
or (context.individual and context.cardarea == G.play)
14671471
)
14681472
then

lib/misc.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,3 +1457,18 @@ function Cryptid.get_next_tag(override)
14571457
return "tag_cry_cat"
14581458
end
14591459
end
1460+
1461+
-- for Cryptid.isNonRollProbabilityContext
1462+
local probability_contexts = {
1463+
"mod_probability",
1464+
"fix_probability"
1465+
}
1466+
1467+
-- Checks if a context table is a probability context called outside of a roll
1468+
function Cryptid.isNonRollProbabilityContext(context)
1469+
for _, ctx in ipairs(probability_contexts) do
1470+
if context[ctx] then return context.from_roll end
1471+
end
1472+
1473+
return true
1474+
end

0 commit comments

Comments
 (0)