Skip to content
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
23 changes: 22 additions & 1 deletion src/overrides.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,27 @@ function Blind:modify_hand(cards, poker_hands, text, mult, hand_chips, scoring_h
return _G.mult, _G.hand_chips, modded or flags.calculated
end

local card_set_base = Card.set_base
function Card:set_base(card, initial)
if self.playing_card and self.base then
local new_rank = card and card.value and SMODS.Ranks[card.value] and SMODS.Ranks[card.value].id
local contexts = {}
if new_rank then
if self.base.id and self.base.id ~= new_rank then
SMODS.merge_defaults(contexts, {change_rank = true, other_card = self, new_rank = new_rank, old_rank = self.base.id, rank_increase = ((self.base.id < new_rank) and true) or false})
end
end
if card and card.suit and self.base.suit ~= card.suit then
SMODS.merge_defaults(contexts, {change_suit = true, other_card = self, new_suit = card.suit, old_suit = self.base.suit})
end
if next(contexts) then
SMODS.calculate_context(contexts)
end
end

card_set_base(self, card, initial)
end

local use_consumeable = Card.use_consumeable
function Card:use_consumeable(area, copier)
local ret = use_consumeable(self, area, copier)
Expand All @@ -2323,4 +2344,4 @@ function Card:use_consumeable(area, copier)
end
end
return ret
end
end