Add sapling

This commit is contained in:
Emik 2026-02-17 22:15:35 +01:00
parent b11298f675
commit 4c467c4e68
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
11 changed files with 94 additions and 51 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -173,14 +173,14 @@ return {
j_Roland_martingale = {
name = "Martingale",
text = {
"{C:green}#1# in #2#{} chance to give {X:mult,C:white}X#1#{} Mult",
"{s:0.9}Otherwise {C:green,s:0.9}#1# in #2#{s:0.9} chance to give {X:mult,C:white,s:0.9}X#2#{s:0.9} Mult",
"{s:0.81}Otherwise {C:green,s:0.81}#1# in #2#{s:0.81} chance to give {X:mult,C:white,s:0.81}X#3#{s:0.81} Mult",
"{s:0.6561}Otherwise {C:green,s:0.6561}#1# in #2#{s:0.6561} chance to give {X:mult,C:white,s:0.6561}X#4#{s:0.6561} Mult",
"{s:0.43046721}Otherwise {C:green,s:0.43046721}#1# in #2#{s:0.43046721} chance to give {X:mult,C:white,s:0.43046721}X#5#{s:0.43046721} Mult",
"{s:0.1853020188851841}Otherwise {C:green,s:0.1853020188851841}#1# in #2#{s:0.1853020188851841} chance to give {X:mult,C:white,s:0.1853020188851841}X#6#{s:0.1853020188851841} Mult",
"{s:0.0343368382029250877861747139}Otherwise {C:green,s:0.0343368382029250877861747139}#1# in #2#{s:0.0343368382029250877861747139} chance to give {X:mult,C:white,s:0.0343368382029250877861747139}X#7#{s:0.0343368382029250877861747139} Mult",
"{s:0}Otherwise {C:green,s:0}#1# in #2#{s:0} chance to give {X:mult,C:white,s:0}X#8#{s:0} Mult",
"{C:green}#1# in #3#{} chance to give {X:mult,C:white}X#2#{} Mult",
"{s:0.9}Otherwise {C:green,s:0.9}#1# in #3#{s:0.9} chance to give {X:mult,C:white,s:0.9}X#3#{s:0.9} Mult",
"{s:0.81}Otherwise {C:green,s:0.81}#1# in #3#{s:0.81} chance to give {X:mult,C:white,s:0.81}X#4#{s:0.81} Mult",
"{s:0.6561}Otherwise {C:green,s:0.6561}#1# in #3#{s:0.6561} chance to give {X:mult,C:white,s:0.6561}X#5#{s:0.6561} Mult",
"{s:0.43046721}Otherwise {C:green,s:0.43046721}#1# in #3#{s:0.43046721} chance to give {X:mult,C:white,s:0.43046721}X#6#{s:0.43046721} Mult",
"{s:0.1853020188851841}Otherwise {C:green,s:0.1853020188851841}#1# in #3#{s:0.1853020188851841} chance to give {X:mult,C:white,s:0.1853020188851841}X#7#{s:0.1853020188851841} Mult",
"{s:0.0343368382029250877861747139}Otherwise {C:green,s:0.0343368382029250877861747139}#1# in #3#{s:0.0343368382029250877861747139} chance to give {X:mult,C:white,s:0.0343368382029250877861747139}X#8#{s:0.0343368382029250877861747139} Mult",
"{s:0}Otherwise {C:green,s:0}#1# in #3#{s:0} chance to give {X:mult,C:white,s:0}X#9#{s:0} Mult",
},
},
j_Roland_mrsbones = {
@ -205,6 +205,15 @@ return {
"{C:inactive}(Currently {X:green,C:white}X#2#{C:inactive})",
},
},
j_Roland_sapling = {
name = "Sapling",
text = {
"{C:mult}+#1# {}Mult if",
"scoring hand",
"contains at",
"least {C:attention}#2# suits",
},
},
j_Roland_sunny = {
name = "Sunny Side Up",
text = {

View file

@ -62,18 +62,20 @@ end
local _ = luaf._proto
--- Creates a non-numerically-indexed query from the given table.
---@param obj table
---@param obj table?
---@param f_pairs? fun(t: table): unknown
---@param numeric boolean?
---@return Query
---@overload fun(obj: true): (fun(): true)
---@overload fun(obj: false): (fun(): false)
---@overload fun(obj: string): (fun(any): any)
-- ---@overload fun(obj: true): (fun(): true)
-- ---@overload fun(obj: false): (fun(): false)
local function f(obj, f_pairs, numeric)
if obj == true then
return luaf.tru
elseif obj == false then
return luaf.fals
elseif obj == nil then
return luaf.pairs {}
elseif type(obj) == "string" then
return luaf.index(obj)
elseif type(obj) ~= "table" then

View file

@ -435,7 +435,7 @@ joker {
}
end,
calculate = function(_, _, context)
if not context.forcetrigger and not context.selling_self then
if not context.selling_self and not context.forcetrigger then
return
end
@ -459,6 +459,38 @@ joker {
end,
}
joker {
key = "sapling",
pronouns = "they_them",
cost = 4,
rarity = 1,
config = {extra = {mult = 15, suits = 3}},
eternal_compat = true,
blueprint_compat = true,
perishable_compat = true,
loc_vars = function(_, _, card)
local extra = card.ability.extra
return {vars = {extra.mult, extra.suits}}
end,
calculate = function(_, card, context)
local function count(v)
return f(context.scoring_hand):any(function(c)
return c:is_suit(v)
end)
end
if not context.joker_main and not context.forcetrigger then
return
end
local extra = card.ability.extra
if context.forcetrigger or f(SMODS.Suits):count(count) >= card.ability.extra.suits then
return {mult = extra.mult}
end
end,
}
joker {
key = "yard",
pronouns = "he_him",
@ -472,7 +504,7 @@ joker {
return {vars = {card.ability.extra.money}}
end,
calculate = function(_, card, context)
return context.remove_playing_cards and
return (context.remove_playing_cards or context.forcetrigger) and
{dollars = card.ability.extra.money * #context.removed, card = card} or nil
end,
}
@ -550,49 +582,12 @@ joker {
end,
}
joker {
key = "oops",
pronouns = "she_they",
artist = "char",
cost = 7,
rarity = 3,
config = {extra = {probability = 1, probability_mult = 2, reset = 1}},
eternal_compat = true,
blueprint_compat = false,
perishable_compat = true,
loc_vars = function(_, _, card)
local extra = card.ability.extra
return {vars = {extra.probability_mult, extra.probability}}
end,
calculate = function(_, card, context)
if context.blueprint or not card.ability then
return
end
local extra = card.ability.extra
if context.mod_probability then
return {numerator = extra.probability}
end
if context.end_of_round and extra.probability ~= extra.reset then
extra.probability = extra.reset
return {message = localize "k_reset", colour = G.C.RED}
end
if context.after then
extra.probability = extra.probability * extra.probability_mult
return {message = localize "k_upgrade_ex", colour = G.C.GREEN}
end
end,
}
joker {
key = "martingale",
pronouns = "he_him",
config = {extra = {odds = 2}},
cost = 8,
rarity = 3,
rarity = 2,
eternal_compat = true,
blueprint_compat = true,
perishable_compat = true,
@ -628,3 +623,40 @@ joker {
SMODS.calculate_effect({card = card, xmult = xmult}, card)
end,
}
joker {
key = "oops",
pronouns = "she_they",
artist = "char",
cost = 7,
rarity = 3,
config = {extra = {probability = 1, probability_mult = 2, reset = 1}},
eternal_compat = true,
blueprint_compat = false,
perishable_compat = true,
loc_vars = function(_, _, card)
local extra = card.ability.extra
return {vars = {extra.probability_mult, extra.probability}}
end,
calculate = function(_, card, context)
if context.blueprint or not card.ability then
return
end
local extra = card.ability.extra
if context.mod_probability then
return {numerator = extra.probability}
end
if context.end_of_round and extra.probability ~= extra.reset then
extra.probability = extra.reset
return {message = localize "k_reset", colour = G.C.RED}
end
if context.after then
extra.probability = extra.probability * extra.probability_mult
return {message = localize "k_upgrade_ex", colour = G.C.GREEN}
end
end,
}