Skip to content
Open
Show file tree
Hide file tree
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
69 changes: 69 additions & 0 deletions functions/pokefunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1435,3 +1435,72 @@ poke_drain_chips = function(card, amount)

return base_drain + bonus_drain
end

--Taken directly from JokerDisplay's evaluate_hand function, ported to avoid dependency
poke_evaluate_hand = function(cards, count_facedowns)
local valid_cards = cards
local has_facedown = false

if not cards then
local hand_info = JokerDisplay.current_hand_info
return hand_info.text, hand_info.poker_hands, hand_info.scoring_hand
elseif type(cards) ~= "table" then
return "Unknown", {}, {}
end
for i = 1, #cards do
if type(cards[i]) ~= "table" or not cards[i].ability or not (cards[i].ability.set == 'Enhanced' or cards[i].ability.set == 'Default') then
return "Unknown", {}, {}
end
end

-- To prevent crashing during poker hand eval
if G.play then
for i = 1, #G.play.cards do
if type(G.play.cards[i]) ~= "table" or not G.play.cards[i].ability or not (G.play.cards[i].ability.set == 'Enhanced' or G.play.cards[i].ability.set == 'Default') then
return "Unknown", {}, {}
end
end
end

if not count_facedowns then
valid_cards = {}
for i = 1, #cards do
if cards[i].facing and cards[i].facing ~= 'back' then
table.insert(valid_cards, cards[i])
else
has_facedown = true
end
end
else
valid_cards = cards
end

local text, _, poker_hands, scoring_hand, _ = G.FUNCS.get_poker_hand_info(valid_cards)

local final_scoring_hand = {}
for i = 1, #valid_cards do
local splashed = SMODS.always_scores(valid_cards[i]) or next(find_joker('Splash')) or next(find_joker('luvdisc')) or next(find_joker('magikarp')) or next(find_joker('feebas'))
local unsplashed = SMODS.never_scores(valid_cards[i])
if not splashed then
for _, card in pairs(scoring_hand) do
if card == valid_cards[i] then splashed = true end
end
end
local effects = {}
SMODS.calculate_context(
{
modify_scoring_hand = true,
other_card = valid_cards[i],
full_hand = valid_cards,
scoring_hand =
scoring_hand
}, effects)
local flags = SMODS.trigger_effects(effects, valid_cards[i])
flags = flags or {}
if flags.add_to_hand then splashed = true end
if flags.remove_from_hand then unsplashed = true end
if splashed and not unsplashed then table.insert(final_scoring_hand, valid_cards[i]) end
end

return (has_facedown and "Unknown" or text), poker_hands, final_scoring_hand
end
100 changes: 100 additions & 0 deletions localization/en-us.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5230,6 +5230,106 @@ return {
"sticker to leftmost {C:attention}Joker"
}
},
j_poke_rowlet = {
name = 'Rowlet',
text = {
"{C:attention}+#2#{} hand size",
"Earn {C:money}$#1#{} if held hand is a",
"{C:attention}[#3#]{}, resets each hand",
"Next target: {C:attention}[#4#]",
"{C:inactive,s:0.8}(Evolves after earning {C:money,s:0.8}$#5#{C:inactive,s:0.8})",
}
},
j_poke_dartrix = {
name = 'Dartrix',
text = {
"{C:attention}+#2#{} hand size",
"Earn {C:money}$#1#{} if held hand is a",
"{C:attention}[#3#]{}, resets each hand",
"Next target: {C:attention}[#4#]",
"{C:inactive,s:0.8}(Evolves after earning {C:money,s:0.8}$#5#{C:inactive,s:0.8})",
}
},
j_poke_decidueye = {
name = 'Decidueye',
text = {
"{C:attention}+#2#{} hand size",
"Earn {C:money}$#1#{} if held hand is a",
"{C:attention}[#3#]{}, resets each hand",
"Next target: {C:attention}[#4#]",
"{br:2}ERROR - CONTACT STEAK",
"Also {C:green}#6# in #7#{} chance to gain a",
"{C:spectral}Spectral{} card if played {C:attention}poker hand{}",
"is the previous target: {C:attention}[#5#]",
}
},
j_poke_litten = {
name = 'Litten',
text = {
"{C:red}+#1#{} discard",
"Gain {C:mult}+#3#{} after discarding",
"your most played {C:attention}poker hand{}",
"{C:inactive}(Currently {C:mult}+#2#{C:inactive} Mult)",
"{C:inactive,s:0.8}(Evolves at {C:mult,s:0.8}+#4#{C:inactive,s:0.8} Mult)",
}
},
j_poke_torracat = {
name = 'Torracat',
text = {
"{C:red}+#1#{} discard",
"Gain {C:mult}+#3#{} after discarding",
"your most played {C:attention}poker hand{}",
"{C:inactive}(Currently {C:mult}+#2#{C:inactive} Mult)",
"{C:inactive,s:0.8}(Evolves at {C:mult,s:0.8}+#4#{C:inactive,s:0.8} Mult)",
}
},
j_poke_incineroar = {
name = 'Incineroar',
text = {
"{C:red}+#2#{} discard",
"Gain {C:mult}+#4#{} after discarding",
"your most played {C:attention}poker hand{}",
"{br:2}ERROR - CONTACT STEAK",
"Also earn {C:money}$#1#{} per card",
"in discarded {C:attention}poker hand{}",
"{C:inactive}(Currently {C:mult}+#3#{C:inactive} Mult)",
}
},
j_poke_popplio = {
name = 'Popplio',
text = {
"{C:chips}+#3#{} hand",
"Gain {C:chips}+#2#{} Chips if {C:attention}poker hand{} is a",
"{C:attention}[#4#]{}, {C:attention}poker hand{} changes",
"after each hand",
"{C:inactive}(Currently {C:chips}+#1#{C:inactive} Chips)",
"{C:inactive,s:0.8}(Evolves at {C:chips,s:0.8}+#5#{C:inactive,s:0.8} Chips)",
}
},
j_poke_brionne = {
name = 'Brionne',
text = {
"{C:chips}+#3#{} hand",
"Gain {C:chips}+#2#{} Chips if {C:attention}poker hand{} is a",
"{C:attention}[#4#]{}, {C:attention}poker hand{} changes",
"after each hand",
"{C:inactive}(Currently {C:chips}+#1#{C:inactive} Chips)",
"{C:inactive,s:0.8}(Evolves at {C:chips,s:0.8}+#5#{C:inactive,s:0.8} Chips)",
}
},
j_poke_primarina = {
name = 'Primarina',
text = {
"{C:chips}+#3#{} hand",
"Gain {C:chips}+#2#{} Chips if {C:attention}poker hand{} is a",
"{C:attention}[#6#]{}, {C:attention}poker hand{} changes",
"after each hand",
"{br:2}ERROR - CONTACT STEAK",
"Also gain {X:mult,C:white}X#5#{} per consecutive",
"correct hand, resets on round end",
"{C:inactive}(Currently {X:mult,C:white}X#4#{}, {C:chips}+#1#{C:inactive})",
}
},
j_poke_grubbin = {
name = 'Grubbin',
text = {
Expand Down
Loading