Add sapling
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
|
@ -173,14 +173,14 @@ return {
|
||||||
j_Roland_martingale = {
|
j_Roland_martingale = {
|
||||||
name = "Martingale",
|
name = "Martingale",
|
||||||
text = {
|
text = {
|
||||||
"{C:green}#1# in #2#{} chance to give {X:mult,C:white}X#1#{} 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 #2#{s:0.9} chance to give {X:mult,C:white,s:0.9}X#2#{s:0.9} 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 #2#{s:0.81} chance to give {X:mult,C:white,s:0.81}X#3#{s:0.81} 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 #2#{s:0.6561} chance to give {X:mult,C:white,s:0.6561}X#4#{s:0.6561} 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 #2#{s:0.43046721} chance to give {X:mult,C:white,s:0.43046721}X#5#{s:0.43046721} 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 #2#{s:0.1853020188851841} chance to give {X:mult,C:white,s:0.1853020188851841}X#6#{s:0.1853020188851841} 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 #2#{s:0.0343368382029250877861747139} chance to give {X:mult,C:white,s:0.0343368382029250877861747139}X#7#{s:0.0343368382029250877861747139} 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 #2#{s:0} chance to give {X:mult,C:white,s:0}X#8#{s:0} 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 = {
|
j_Roland_mrsbones = {
|
||||||
|
|
@ -205,6 +205,15 @@ return {
|
||||||
"{C:inactive}(Currently {X:green,C:white}X#2#{C:inactive})",
|
"{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 = {
|
j_Roland_sunny = {
|
||||||
name = "Sunny Side Up",
|
name = "Sunny Side Up",
|
||||||
text = {
|
text = {
|
||||||
|
|
|
||||||
|
|
@ -62,18 +62,20 @@ end
|
||||||
local _ = luaf._proto
|
local _ = luaf._proto
|
||||||
|
|
||||||
--- Creates a non-numerically-indexed query from the given table.
|
--- Creates a non-numerically-indexed query from the given table.
|
||||||
---@param obj table
|
---@param obj table?
|
||||||
---@param f_pairs? fun(t: table): unknown
|
---@param f_pairs? fun(t: table): unknown
|
||||||
---@param numeric boolean?
|
---@param numeric boolean?
|
||||||
---@return Query
|
---@return Query
|
||||||
---@overload fun(obj: true): (fun(): true)
|
|
||||||
---@overload fun(obj: false): (fun(): false)
|
|
||||||
---@overload fun(obj: string): (fun(any): any)
|
---@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)
|
local function f(obj, f_pairs, numeric)
|
||||||
if obj == true then
|
if obj == true then
|
||||||
return luaf.tru
|
return luaf.tru
|
||||||
elseif obj == false then
|
elseif obj == false then
|
||||||
return luaf.fals
|
return luaf.fals
|
||||||
|
elseif obj == nil then
|
||||||
|
return luaf.pairs {}
|
||||||
elseif type(obj) == "string" then
|
elseif type(obj) == "string" then
|
||||||
return luaf.index(obj)
|
return luaf.index(obj)
|
||||||
elseif type(obj) ~= "table" then
|
elseif type(obj) ~= "table" then
|
||||||
|
|
|
||||||
112
src/joker.lua
|
|
@ -435,7 +435,7 @@ joker {
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
calculate = function(_, _, context)
|
calculate = function(_, _, context)
|
||||||
if not context.forcetrigger and not context.selling_self then
|
if not context.selling_self and not context.forcetrigger then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -459,6 +459,38 @@ joker {
|
||||||
end,
|
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 {
|
joker {
|
||||||
key = "yard",
|
key = "yard",
|
||||||
pronouns = "he_him",
|
pronouns = "he_him",
|
||||||
|
|
@ -472,7 +504,7 @@ joker {
|
||||||
return {vars = {card.ability.extra.money}}
|
return {vars = {card.ability.extra.money}}
|
||||||
end,
|
end,
|
||||||
calculate = function(_, card, context)
|
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
|
{dollars = card.ability.extra.money * #context.removed, card = card} or nil
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
@ -550,49 +582,12 @@ joker {
|
||||||
end,
|
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 {
|
joker {
|
||||||
key = "martingale",
|
key = "martingale",
|
||||||
pronouns = "he_him",
|
pronouns = "he_him",
|
||||||
config = {extra = {odds = 2}},
|
config = {extra = {odds = 2}},
|
||||||
cost = 8,
|
cost = 8,
|
||||||
rarity = 3,
|
rarity = 2,
|
||||||
eternal_compat = true,
|
eternal_compat = true,
|
||||||
blueprint_compat = true,
|
blueprint_compat = true,
|
||||||
perishable_compat = true,
|
perishable_compat = true,
|
||||||
|
|
@ -628,3 +623,40 @@ joker {
|
||||||
SMODS.calculate_effect({card = card, xmult = xmult}, card)
|
SMODS.calculate_effect({card = card, xmult = xmult}, card)
|
||||||
end,
|
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,
|
||||||
|
}
|
||||||
|
|
|
||||||