1+ local function contains_number(table, exclusions)
2+ for k, v in pairs(table) do
3+ if exclusions and exclusions[k] ~= nil and (exclusions[k] == true or exclusions[k] == v) then
4+ else
5+ if type(v) == "number" and v ~= 0 then
6+ return true
7+ elseif type(v) == "table" and contains_number(v, exclusions) then
8+ return true
9+ end
10+ end
11+ end
12+ return false
13+ end
14+
115local broken_fate = {
216 object_type = "Consumable",
317 key = 'broken_fate',
@@ -18,8 +32,12 @@ local broken_fate = {
1832 can_use = function(self, card, area, copier)
1933 if G.consumeables and #G.consumeables.cards > 0 then
2034 local leftmost_card = G.consumeables.cards[1]
21- leftmost_card = leftmost_card == card and G.consumeables.cards[2] or leftmost_card
22- return leftmost_card.config.center.key ~= "c_aij_broken_fate"
35+ -- Check for Ankh and Hex explicitly, as they have unused variables that make it seem like they are compatible
36+ return (
37+ leftmost_card.config.center.key ~= "c_aij_broken_fate" and
38+ contains_number(leftmost_card.ability, { card_limit = true, h_x_chips = 1, x_chips = 1, h_x_mult = 1, x_mult = 1, hands_played_at_create = true, order = true }) and
39+ leftmost_card.config.center.dongtong_compat ~= false
40+ )
2341 end
2442 end,
2543 use = function(self, card)
@@ -29,18 +47,34 @@ local broken_fate = {
2947 return true end }))
3048 delay(0.2)
3149
50+ -- Define the target for clarity
51+ local target = G.consumeables.cards[1]
52+
53+ -- SNAPSHOT LOGIC:
54+ if target.aij_original_ability then
55+ target.ability = copy_table(target.aij_original_ability)
56+ else
57+ target.aij_original_ability = copy_table(target.ability)
58+ end
59+
3260 local ran_amount = 0.75 + (pseudorandom('aij_broken_fate', 0, math.floor(((2.5 - 0.75) / 0.05) + 0.5)) * 0.05)
3361 local string = "X" .. tostring(ran_amount)
34- G.consumeables.cards[1].ability.consumeable = copy_table(G.consumeables.cards[1].ability.consumeable)
35- jest_ability_calculate(G.consumeables.cards[1], "*", ran_amount, nil, nil, true, false, "ability")
36- card_eval_status_text(G.consumeables.cards[1], 'extra', nil, nil, nil, { message = string, colour = G.C.FILTER })
62+
63+ jest_ability_calculate(target, "*", ran_amount, { card_limit = true, h_x_chips = 1, x_chips = 1, h_x_mult = 1, x_mult = 1, hands_played_at_create = true, order = true }, nil, true, false, "ability")
64+
65+ card_eval_status_text(target, 'extra', nil, nil, nil, { message = string, colour = G.C.FILTER })
3766 delay(0.2)
3867 end,
39- in_pool = function(self, args)
40- if G.consumeables and #G.consumeables.cards > 0 then
41- return true
42- end
43- return false
44- end,
4568}
69+
70+ -- Set some vanilla consumables to be incompatible
71+ -- These have variables that look like they make it compatible, but actually aren't
72+ -- Some of these (the seals) should be refactored to work as expected
73+ G.P_CENTERS["c_ankh"].dongtong_compat = false
74+ G.P_CENTERS["c_hex"].dongtong_compat = false
75+ G.P_CENTERS["c_talisman"].dongtong_compat = false
76+ G.P_CENTERS["c_trance"].dongtong_compat = false
77+ G.P_CENTERS["c_medium"].dongtong_compat = false
78+ G.P_CENTERS["c_deja_vu"].dongtong_compat = false
79+
4680return { name = { "Tarots" }, items = { broken_fate } }
0 commit comments