Skip to content

Commit 2845a65

Browse files
authored
Merge pull request #60 from lord-ruby/dev
better checks for echo
2 parents e1cfd19 + 67eef7c commit 2845a65

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

compat/cryptid/reverse_codes.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,11 +1557,13 @@ local echo = {
15571557
if not G.GAME.entr_echo then
15581558
G.GAME.entr_echo = {}
15591559
end
1560-
G.GAME.entr_echo[cards[1].config.center.key] = G.GAME.entr_echo[cards[1].config.center.key] or {}
1561-
G.GAME.entr_echo[cards[1].config.center.key][#G.GAME.entr_echo[cards[1].config.center.key]+1] = cards[2].config.center.key
1562-
1563-
G.GAME.entr_echo[cards[2].config.center.key] = G.GAME.entr_echo[cards[2].config.center.key] or {}
1564-
G.GAME.entr_echo[cards[2].config.center.key][#G.GAME.entr_echo[cards[2].config.center.key]+1] = cards[1].config.center.key
1560+
if #cards >= 2 then
1561+
G.GAME.entr_echo[cards[1].config.center.key] = G.GAME.entr_echo[cards[1].config.center.key] or {}
1562+
G.GAME.entr_echo[cards[1].config.center.key][#G.GAME.entr_echo[cards[1].config.center.key]+1] = cards[2].config.center.key
1563+
1564+
G.GAME.entr_echo[cards[2].config.center.key] = G.GAME.entr_echo[cards[2].config.center.key] or {}
1565+
G.GAME.entr_echo[cards[2].config.center.key][#G.GAME.entr_echo[cards[2].config.center.key]+1] = cards[1].config.center.key
1566+
end
15651567
end,
15661568
can_use = function(self, card)
15671569
local cards = Cryptid.get_highlighted_cards({G.consumeables, G.shop_jokers, G.shop_vouchers, G.shop_booster, G.pack_cards}, card, 2,2, function(card)

lib/utils.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,4 +1903,9 @@ function Entropy.allow_spawning(center)
19031903
if v.config and v.config.center and center and v.config.center.key == center.key then return SMODS.showman(center.key) or nil end
19041904
end
19051905
return true
1906-
end
1906+
end
1907+
1908+
function Entropy.get_reroll_height()
1909+
if HotPotato then return 1.04 end
1910+
return Entropy.CanSwitchAltPath() and 1 or 1.6
1911+
end

lovely/core.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ payload = '''
10161016
}}
10171017
}},
10181018
}} or nil),
1019-
{n=G.UIT.R, config={align = "cm", minw = 2.8, minh = Entropy.CanSwitchAltPath() and 1 or 1.6, r=0.15,colour = G.C.GREEN, button = 'reroll_shop', func = 'can_reroll', hover = true,shadow = true}, nodes = {
1019+
{n=G.UIT.R, config={align = "cm", minw = 2.8, minh = Entropy.get_reroll_height(), r=0.15,colour = G.C.GREEN, button = 'reroll_shop', func = 'can_reroll', hover = true,shadow = true}, nodes = {
10201020
{n=G.UIT.R, config={align = "cm", padding = 0.07, focus_args = {button = 'x', orientation = 'cr'}, func = 'set_button_pip'}, nodes={
10211021
{n=G.UIT.R, config={align = "cm", maxw = 1.3}, nodes={
10221022
{n=G.UIT.T, config={text = localize('k_reroll'), scale = 0.4, colour = G.C.WHITE, shadow = true}},

0 commit comments

Comments
 (0)