Compare commits

..

No commits in common. "main" and "1.4.3" have entirely different histories.
main ... 1.4.3

4 changed files with 36 additions and 54 deletions

View file

@ -14,7 +14,7 @@ return {
j_Roland_escapey = { j_Roland_escapey = {
name = "Escapey", name = "Escapey",
text = { text = {
"Destroy {C:attention}tags{} or {C:attention}non-selected", "Destroy {C:attention}tags{} and {C:attention}non-selected",
"{C:attention}consumables{} on use. Level up", "{C:attention}consumables{} on use. Level up",
"the {C:planet}most played hand{} by {C:planet}#1#{}", "the {C:planet}most played hand{} by {C:planet}#1#{}",
"for each destroyed object", "for each destroyed object",
@ -23,7 +23,7 @@ return {
"#3#{C:inactive,s:0.75,E:1}#4#{C:red,s:1.5,E:1}#5#", "#3#{C:inactive,s:0.75,E:1}#4#{C:red,s:1.5,E:1}#5#",
"#6#{C:blue,E:1}#7#{}#8#{C:inactive,s:0.75,E:1}#9#{C:red,s:1.5,E:1}#10#", "#6#{C:blue,E:1}#7#{}#8#{C:inactive,s:0.75,E:1}#9#{C:red,s:1.5,E:1}#10#",
}, },
merge = {"Since no objects apply, fuse", "with other ", " jokers"}, merge = {"Since no objects apply, merge", "with other ", " jokers"},
quotes = { quotes = {
marble = {{"there is no escape..."}}, marble = {{"there is no escape..."}},
normal = { normal = {

View file

@ -6,7 +6,7 @@
"author": [ "author": [
"Emik" "Emik"
], ],
"version": "1.4.5", "version": "1.4.3",
"badge_colour": "8BE9FD", "badge_colour": "8BE9FD",
"main_file": "src/main.lua", "main_file": "src/main.lua",
"badge_text_colour": "44475A", "badge_text_colour": "44475A",

@ -1 +1 @@
Subproject commit 4f3eae046476664b720a96f91b0e04f388709bbb Subproject commit 5954713389e218b093dafd6121828de978af1dc2

View file

@ -10,10 +10,10 @@ end
local function common_hand() local function common_hand()
return (G.GAME or {}).current_round and F.reduce( return (G.GAME or {}).current_round and F.reduce(
G.GAME.hands, G.GAME.hands,
{name = "High Card", order = -1 / 0, played = 0}, { name = "High Card", order = -1 / 0, played = 0 },
function(a, v, k) function(a, v, k)
return (a.played < v.played or (a.played == v.played) and (a.order > v.order)) and return (a.played < v.played or (a.played == v.played) and (a.order > v.order)) and
{name = k, order = v.order, played = v.played} or a { name = k, order = v.order, played = v.played } or a
end, end,
pairs pairs
).name or "High Card" ).name or "High Card"
@ -41,10 +41,10 @@ SMODS.Atlas {
SMODS.Joker { SMODS.Joker {
key = "escapey", key = "escapey",
atlas = "escapey", atlas = "escapey",
pos = {x = 0, y = 0}, pos = { x = 0, y = 0 },
sinis = {x = 2, y = 0}, sinis = { x = 2, y = 0 },
soul_pos = {x = 1, y = 0}, soul_pos = { x = 1, y = 0 },
config = {extra = {level_up_by = 1}}, config = { extra = { level_up_by = 1 } },
cost = 8, cost = 8,
rarity = 3, rarity = 3,
eternal_compat = true, eternal_compat = true,
@ -87,7 +87,6 @@ SMODS.Joker {
G.escapey_debugger(F.reduce(context, "", function(acc, _, next) return acc .. ", " .. next end, pairs):sub(2)) G.escapey_debugger(F.reduce(context, "", function(acc, _, next) return acc .. ", " .. next end, pairs):sub(2))
end end
end, end,
---@param card Card
Bakery_can_use = function(_, card) Bakery_can_use = function(_, card)
return not card.debuff and can_use() and ( return not card.debuff and can_use() and (
#G.GAME.tags ~= 0 or #G.GAME.tags ~= 0 or
@ -95,40 +94,27 @@ SMODS.Joker {
F.any(F.filter(G.jokers.cards, is_mergeable_with(card))) F.any(F.filter(G.jokers.cards, is_mergeable_with(card)))
) )
end, end,
---@param card Card
Bakery_use_button_text = function(_, card) Bakery_use_button_text = function(_, card)
if card.debuff then return card.debuff and "DEBUFFED" or
return "DEBUFFED" ((#G.GAME.tags == 0 and not
end F.any(G.consumeables.cards, destructible) and
F.any(F.filter(G.jokers.cards, is_mergeable_with(card)))) and "MERGE" or "ESCAPE")
return #G.GAME.tags == 0 and F.count(G.consumeables.cards, destructible) == 0 and
F.any(F.filter(G.jokers.cards, is_mergeable_with(card))) and "FUSE" or "ESCAPE"
end, end,
---@param card Card
Bakery_use_joker = function(_, card) Bakery_use_joker = function(_, card)
if card.debuff then local hand, object_count = common_hand(), F.count(F.filter(G.consumeables.cards, destructible)) + #G.GAME.tags
return
end
local consumables = F.filter(G.consumeables.cards, destructible)
local consumable_count = F.count(consumables)
local object_count = consumable_count + #G.GAME.tags
if object_count == 0 then if object_count == 0 then
local level_sum, sell_sum = 0, 0 local sum = 0
F.foreach( F.foreach(
F.filter(G.jokers.cards, is_mergeable_with(card)), F.filter(G.jokers.cards, is_mergeable_with(card)),
function(v) function(v)
level_sum = level_sum + v.ability.extra.level_up_by * (v.getEvalQty and v:getEvalQty() or 1) sum = sum + v.ability.extra.level_up_by * (v.getEvalQty and v:getEvalQty() or 1)
sell_sum = sell_sum + v.sell_cost * (v.getEvalQty and v:getEvalQty() or 1) v:start_dissolve({ HEX("57ecab") }, nil, 1.6)
v:start_dissolve({HEX("57ecab")}, nil, 1.6)
end end
) )
card.ability.extra.level_up_by = card.ability.extra.level_up_by + level_sum card.ability.extra.level_up_by = card.ability.extra.level_up_by + sum
card.sell_cost = card.sell_cost + sell_sum
return
end end
local function update(name, chip, mul, lv, notif, snd, vol, pit, de) local function update(name, chip, mul, lv, notif, snd, vol, pit, de)
@ -165,8 +151,6 @@ SMODS.Joker {
end end
end end
local hand = common_hand()
if hand == "all" or hand == "allhands" or hand == "all_hands" then if hand == "all" or hand == "allhands" or hand == "all_hands" then
update(localize("k_all_hands"), "...", "...", "") update(localize("k_all_hands"), "...", "...", "")
elseif G.GAME.hands[hand or "NO_HAND_SPECIFIED"] then elseif G.GAME.hands[hand or "NO_HAND_SPECIFIED"] then
@ -178,30 +162,28 @@ SMODS.Joker {
) )
end end
if consumable_count == 0 then F.foreach(
local trigger = #G.GAME.tags >= 30 and "immediate" or "before" F.filter(G.consumeables.cards, destructible),
local delay = #G.GAME.tags >= 30 and 0 or 1 / #G.GAME.tags function(v)
v:start_dissolve({ HEX("57ecab") }, nil, 1.6)
end
)
F.foreach( local trigger = #G.GAME.tags >= 30 and "immediate" or "before"
G.GAME.tags, local delay = #G.GAME.tags >= 30 and 0 or 1 / #G.GAME.tags
function(v)
G.E_MANAGER:add_event(Event {trigger = trigger, blocking = #G.GAME.tags < 30, delay = delay, func = fast_delete(v)}) F.foreach(
end G.GAME.tags,
) function(v)
else G.E_MANAGER:add_event(Event { trigger = trigger, blocking = #G.GAME.tags < 30, delay = delay, func = fast_delete(v) })
F.foreach( end
consumables, )
function(v)
v:start_dissolve({HEX("57ecab")}, nil, 1.6)
end
)
end
level_up_hand(card, hand, nil, object_count * card.ability.extra.level_up_by) level_up_hand(card, hand, nil, object_count * card.ability.extra.level_up_by)
update_hand_text( update_hand_text(
{sound = "button", volume = 0.7, pitch = 1.1, delay = 0}, { sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
{mult = 0, chips = 0, handname = "", level = ""} { mult = 0, chips = 0, handname = "", level = "" }
) )
end, end,
} }