Skip to content

Commit

Permalink
Fix ghost cards in deck preview due to DNA
Browse files Browse the repository at this point in the history
  • Loading branch information
DivvyCr committed Mar 31, 2024
1 parent 73c294b commit e670083
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Mods/DVSimulate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,19 @@ function Card:calculate_joker(context)
end
end

-- Intercept and override DNA to avoid side-effects:
if DV.SIM.running and self.ability.name == "DNA" then
if context.before
and G.GAME.current_round.hands_played == 0
and #context.full_hand == 1 then
-- G.playing_card is the next UID for playing cards
G.playing_card = (G.playing_card and G.playing_card + 1) or 1
local c = copy_card(context.full_hand[1], nil, nil, G.playing_card)
G.hand:emplace(c)
end
return
end

-- Breaks with joker-on-joker effects:
-- if DV.contains(self.ability.name, DV.SIM.IGNORED) then
-- return {}
Expand Down

0 comments on commit e670083

Please sign in to comment.