Add forcetrigger support
This commit is contained in:
parent
671af56191
commit
f21141d26f
2 changed files with 52 additions and 29 deletions
|
|
@ -356,7 +356,10 @@ return {
|
||||||
v_dictionary = {
|
v_dictionary = {
|
||||||
b_Roland_bye = "Bye!",
|
b_Roland_bye = "Bye!",
|
||||||
b_Roland_comma = ", ",
|
b_Roland_comma = ", ",
|
||||||
|
b_Roland_debuffed = "DEBUFFED",
|
||||||
b_Roland_entering_shop = "Entering shop!",
|
b_Roland_entering_shop = "Entering shop!",
|
||||||
|
b_Roland_escape = "ESCAPE",
|
||||||
|
b_Roland_fuse = "FUSE",
|
||||||
b_Roland_debug_export = "Debug: Import functional.lua",
|
b_Roland_debug_export = "Debug: Import functional.lua",
|
||||||
b_Roland_equinox_assist = "Assist: Only hide text during Equinox",
|
b_Roland_equinox_assist = "Assist: Only hide text during Equinox",
|
||||||
b_Roland_most_common_card = "(Rank)",
|
b_Roland_most_common_card = "(Rank)",
|
||||||
|
|
|
||||||
|
|
@ -128,14 +128,21 @@ joker {
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
Bakery_use_button_text = function(_, card)
|
Bakery_use_button_text = function(_, card)
|
||||||
if card.debuff then
|
return localize {
|
||||||
return "DEBUFFED"
|
type = "variable",
|
||||||
end
|
key = card.debuff and "b_Roland_debuffed" or
|
||||||
|
(#G.GAME.tags == 0 and not
|
||||||
return #G.GAME.tags == 0 and not f(G.consumeables.cards):any(destructible) and
|
f(G.consumeables.cards):any(destructible) and
|
||||||
f(G.jokers.cards):any(is_mergeable_with(card)) and "FUSE" or "ESCAPE"
|
f(G.jokers.cards):any(is_mergeable_with(card)) and
|
||||||
|
"b_Roland_fuse" or "b_Roland_escape"),
|
||||||
|
}
|
||||||
end,
|
end,
|
||||||
Bakery_use_joker = function(_, card)
|
calculate = function(self, card, context)
|
||||||
|
if context.forcetrigger then
|
||||||
|
return self.level_up(card)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
Bakery_use_joker = function(self, card)
|
||||||
if card.debuff then
|
if card.debuff then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -184,8 +191,9 @@ joker {
|
||||||
local destroyed = 0
|
local destroyed = 0
|
||||||
|
|
||||||
if consumable_count == 0 then
|
if consumable_count == 0 then
|
||||||
local trigger = #G.GAME.tags >= 30 and "immediate" or "before"
|
local threshold = 30
|
||||||
local delay = #G.GAME.tags >= 30 and 0 or 1 / #G.GAME.tags
|
local delay = #G.GAME.tags >= threshold and 0 or 1 / #G.GAME.tags
|
||||||
|
local trigger = #G.GAME.tags >= threshold and "immediate" or "before"
|
||||||
|
|
||||||
f(G.GAME.tags):each(function(v)
|
f(G.GAME.tags):each(function(v)
|
||||||
q {
|
q {
|
||||||
|
|
@ -204,10 +212,14 @@ joker {
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.level_up(card, destroyed)
|
||||||
|
end,
|
||||||
|
---@param card Card
|
||||||
|
---@param times? integer
|
||||||
|
proc = function(card, times)
|
||||||
local hands = f(G.GAME.hands):where(f "visible"):keys():table()
|
local hands = f(G.GAME.hands):where(f "visible"):keys():table()
|
||||||
|
|
||||||
pseudoshuffle(hands, pseudoseed "RolandEscapey")
|
pseudoshuffle(hands, pseudoseed "RolandEscapey")
|
||||||
local levels = destroyed * card.ability.extra.hands
|
local levels = card.ability.extra.hands * (times or 1)
|
||||||
level_up("all", math.floor(levels / #hands), card)
|
level_up("all", math.floor(levels / #hands), card)
|
||||||
|
|
||||||
f(hands):take(levels % #hands):each(function(v)
|
f(hands):take(levels % #hands):each(function(v)
|
||||||
|
|
@ -229,7 +241,8 @@ joker {
|
||||||
return {vars = {card.ability.extra.chips}}
|
return {vars = {card.ability.extra.chips}}
|
||||||
end,
|
end,
|
||||||
calculate = function(_, card, context)
|
calculate = function(_, card, context)
|
||||||
return context.joker_main and {card = card, chips = card.ability.extra.chips} or nil
|
return (context.joker_main or context.forcetrigger) and
|
||||||
|
{card = card, chips = card.ability.extra.chips} or nil
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -246,11 +259,11 @@ joker {
|
||||||
return {vars = {card.ability.extra.xmult, card.ability.extra.requirement * 100}}
|
return {vars = {card.ability.extra.xmult, card.ability.extra.requirement * 100}}
|
||||||
end,
|
end,
|
||||||
calculate = function(_, card, context)
|
calculate = function(_, card, context)
|
||||||
if context.blueprint then
|
if context.blueprint and not context.forcetrigger then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if context.joker_main then
|
if context.joker_main or context.forcetrigger then
|
||||||
return {xmult = card.ability.extra.xmult}
|
return {xmult = card.ability.extra.xmult}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -284,7 +297,7 @@ joker {
|
||||||
return {vars = {card.ability.extra.xmult}}
|
return {vars = {card.ability.extra.xmult}}
|
||||||
end,
|
end,
|
||||||
calculate = function(_, card, context)
|
calculate = function(_, card, context)
|
||||||
if not context.joker_main then
|
if not context.joker_main and not context.forcetrigger then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -310,7 +323,7 @@ joker {
|
||||||
calculate = function(_, card, context)
|
calculate = function(_, card, context)
|
||||||
local extra = card.ability.extra
|
local extra = card.ability.extra
|
||||||
|
|
||||||
if not context.before or context.scoring_name ~= extra.hand_name then
|
if (not context.before or context.scoring_name ~= extra.hand_name) and not context.forcetrigger then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -336,7 +349,7 @@ joker {
|
||||||
calculate = function(_, card, context)
|
calculate = function(_, card, context)
|
||||||
local extra = card.ability.extra
|
local extra = card.ability.extra
|
||||||
|
|
||||||
if context.joker_main then
|
if context.joker_main or context.forcetrigger then
|
||||||
return {mult = extra.mult}
|
return {mult = extra.mult}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -365,16 +378,21 @@ joker {
|
||||||
calculate = function(_, card, context)
|
calculate = function(_, card, context)
|
||||||
local extra = card.ability.extra
|
local extra = card.ability.extra
|
||||||
|
|
||||||
if not context.before or card.getting_sliced or context.scoring_name ~= extra.hand_name then
|
if (not context.before or card.getting_sliced or context.scoring_name ~= extra.hand_name) and not context.forcetrigger then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
card.getting_sliced = true
|
card.getting_sliced = not context.forcetrigger
|
||||||
|
|
||||||
q(function()
|
q(function()
|
||||||
local scored_cards = f(G.play.cards):where(f "highlighted"):each()
|
local scored_cards = f(G.play.cards):where(f "highlighted"):table()
|
||||||
local copied = {}
|
local copied = {}
|
||||||
|
|
||||||
|
if not next(scored_cards) then
|
||||||
|
card.getting_sliced = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
for _ = 1, extra.times do
|
for _ = 1, extra.times do
|
||||||
G.playing_card = (G.playing_card or 0) + 1
|
G.playing_card = (G.playing_card or 0) + 1
|
||||||
G.deck.config.card_limit = G.deck.config.card_limit + 1
|
G.deck.config.card_limit = G.deck.config.card_limit + 1
|
||||||
|
|
@ -389,7 +407,10 @@ joker {
|
||||||
|
|
||||||
SMODS.calculate_effect({{message = localize "k_copied_ex", message_card = card}}, card)
|
SMODS.calculate_effect({{message = localize "k_copied_ex", message_card = card}}, card)
|
||||||
playing_card_joker_effects(copied)
|
playing_card_joker_effects(copied)
|
||||||
card:start_dissolve()
|
|
||||||
|
if not context.forcetrigger then
|
||||||
|
card:start_dissolve()
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
@ -482,7 +503,7 @@ joker {
|
||||||
|
|
||||||
local extra = card.ability.extra
|
local extra = card.ability.extra
|
||||||
|
|
||||||
if context.forcetrigger or f(SMODS.Suits):count(count) >= card.ability.extra.suits then
|
if f(SMODS.Suits):count(count) >= card.ability.extra.suits or context.forcetrigger then
|
||||||
return {mult = extra.mult}
|
return {mult = extra.mult}
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
@ -539,11 +560,10 @@ joker {
|
||||||
return {vars = {card.ability.extra.xmult}}
|
return {vars = {card.ability.extra.xmult}}
|
||||||
end,
|
end,
|
||||||
calculate = function(_, card, context)
|
calculate = function(_, card, context)
|
||||||
if context.individual and
|
return ((context.individual and
|
||||||
context.cardarea == "unscored" and
|
context.cardarea == "unscored" and
|
||||||
SMODS.has_enhancement(context.other_card, "m_wild") then
|
SMODS.has_enhancement(context.other_card, "m_wild")
|
||||||
return {xmult = card.ability.extra.xmult}
|
) or context.forcetrigger) and {xmult = card.ability.extra.xmult} or nil
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
in_pool = function()
|
in_pool = function()
|
||||||
return f(G.playing_cards):any(function(v)
|
return f(G.playing_cards):any(function(v)
|
||||||
|
|
@ -564,7 +584,7 @@ joker {
|
||||||
return {vars = {self.xmult()}}
|
return {vars = {self.xmult()}}
|
||||||
end,
|
end,
|
||||||
calculate = function(self, card, context)
|
calculate = function(self, card, context)
|
||||||
return context.joker_main and {card = card, xmult = self.xmult()} or nil
|
return (context.joker_main or context.forcetrigger) and {card = card, xmult = self.xmult()} or nil
|
||||||
end,
|
end,
|
||||||
xmult = function()
|
xmult = function()
|
||||||
local function mult(id)
|
local function mult(id)
|
||||||
|
|
@ -600,7 +620,7 @@ joker {
|
||||||
return {vars = vars}
|
return {vars = vars}
|
||||||
end,
|
end,
|
||||||
calculate = function(self, card, context)
|
calculate = function(self, card, context)
|
||||||
if not context.joker_main then
|
if not context.joker_main and not context.forcetrigger then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -636,7 +656,7 @@ joker {
|
||||||
return {vars = {extra.probability_mult, extra.probability}}
|
return {vars = {extra.probability_mult, extra.probability}}
|
||||||
end,
|
end,
|
||||||
calculate = function(_, card, context)
|
calculate = function(_, card, context)
|
||||||
if context.blueprint or not card.ability then
|
if context.blueprint and not context.forcetrigger or not card.ability then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue