Skip to content

Commit 40d570d

Browse files
committed
equilibrium log fix
1 parent 68a470e commit 40d570d

File tree

2 files changed

+98
-5
lines changed

2 files changed

+98
-5
lines changed

items/code.lua

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,10 +3535,11 @@ local log = {
35353535
G.GAME.bosses_used[bl] = (G.GAME.bosses_used[bl] or 1) - 1
35363536
end
35373537
G.GAME.USING_CODE = true
3538+
localize{}
35383539
G.CHOOSE_CARD = UIBox({
35393540
definition = create_UIBox_log({
35403541
bl and G.localization.descriptions.Blind[bl].name or "None",
3541-
voucher and G.localization.descriptions.Voucher[voucher[1]].name or "None",
3542+
voucher and G.P_CENTERS[voucher[1]] and localize { type = 'name_text', set = G.P_CENTERS[voucher[1]].set, key = voucher[1] } or "None",
35423543
}, localize("cry_code_antevoucher")),
35433544
config = {
35443545
align = "cm",
@@ -3558,8 +3559,18 @@ local log = {
35583559
local pseudorandom = copy_table(G.GAME.pseudorandom)
35593560
local j = {}
35603561
for i = 1, 5 do
3561-
local next_joker = G.localization.descriptions["Joker"][Cryptid.predict_joker("sho")]
3562-
j[#j + 1] = next_joker and next_joker.name or "[NOT A JOKER]"
3562+
local key = Cryptid.predict_joker("sho")
3563+
local next_joker = G.P_CENTERS[key] and localize { type = 'name_text', set = G.P_CENTERS[key].set, key = key }
3564+
or "ERROR"
3565+
if next_joker == "ERROR" then
3566+
local try = (G.localization.descriptions[G.P_CENTERS[key].set] or {})[key]
3567+
try = try and try.name or "[ERROR]"
3568+
if type(try or "a") == "table" then
3569+
try = try[1]
3570+
end
3571+
next_joker = try
3572+
end
3573+
j[#j + 1] = next_joker
35633574
end
35643575
G.GAME.pseudorandom = copy_table(pseudorandom)
35653576
G.GAME.USING_CODE = true
@@ -3583,7 +3594,9 @@ local log = {
35833594
local j = {}
35843595
for i = 1, 10 do
35853596
local card = G.deck.cards[#G.deck.cards + 1 - i]
3586-
j[#j + 1] = localize(card.base.value, "ranks") .. " of " .. localize(card.base.suit, "suits_plural")
3597+
if card then
3598+
j[#j + 1] = localize(card.base.value, "ranks") .. " of " .. localize(card.base.suit, "suits_plural")
3599+
end
35873600
end
35883601
G.GAME.USING_CODE = true
35893602
G.CHOOSE_CARD = UIBox({
@@ -3640,7 +3653,7 @@ local log = {
36403653
}),
36413654
},
36423655
},
3643-
G.GAME.blind and G.GAME.blind.in_blind and {
3656+
G.GAME.blind and G.GAME.blind.in_blind and G.deck and #(G.deck.cards or {}) > 0 and {
36443657
n = G.UIT.R,
36453658
config = { align = "cm" },
36463659
nodes = {

lib/overrides.lua

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,86 @@ function Game:update(dt)
508508
G.STATE = G.STATES.SELECTING_HAND
509509
G.STATE_COMPLETE = false
510510
end
511+
if
512+
G.STATE == G.STATES.HAND_PLAYED
513+
and to_big(G.GAME.chips) > to_big(G.GAME.blind.chips)
514+
and not G.hand.cards[1]
515+
and not G.deck.cards[1]
516+
then
517+
--im having to manually recreate some of this idk why
518+
G.RESET_BLIND_STATES = true
519+
G.RESET_JIGGLES = true
520+
G.GAME.blind.in_blind = false
521+
G.E_MANAGER:add_event(Event({
522+
trigger = 'after',
523+
delay = 0.3,
524+
func = function()
525+
if G.GAME.blind.config.blind.cry_before_cash and not G.GAME.blind.disabled then
526+
G.GAME.blind:cry_before_cash()
527+
else
528+
G.GAME.cry_make_a_decision = nil
529+
530+
G.STATE = G.STATES.ROUND_EVAL
531+
G.STATE_COMPLETE = false
532+
end
533+
534+
if G.GAME.blind_on_deck == 'Small' then
535+
G.GAME.round_resets.blind_states.Small = 'Defeated'
536+
elseif G.GAME.blind_on_deck == 'Big' then
537+
G.GAME.round_resets.blind_states.Big = 'Defeated'
538+
else
539+
if G.GAME.current_round.cry_voucher_stickers.pinned == false then
540+
G.GAME.current_round.voucher = SMODS.get_next_vouchers()
541+
G.GAME.current_round.cry_voucher_stickers = Cryptid.next_voucher_stickers()
542+
G.GAME.current_round.cry_voucher_edition = cry_get_next_voucher_edition() or {}
543+
G.GAME.current_round.cry_bonusvouchers = {}
544+
G.GAME.cry_bonusvouchersused = {} -- i'm not sure why i'm putting these in two separate tables but it doesn't matter much
545+
for i = 1, G.GAME.cry_bonusvouchercount do
546+
G.GAME.current_round.cry_bonusvouchers[i] = SMODS.get_next_vouchers()
547+
end
548+
if G.GAME.modifiers.cry_no_vouchers then
549+
very_fair_quip = pseudorandom_element(G.localization.misc.very_fair_quips, pseudoseed("cry_very_fair"))
550+
end
551+
end
552+
G.GAME.round_resets.blind_states.Boss = 'Defeated'
553+
for k, v in ipairs(G.playing_cards) do
554+
v.ability.played_this_ante = nil
555+
end
556+
end
557+
558+
if G.GAME.round_resets.temp_handsize then G.hand:change_size(-G.GAME.round_resets.temp_handsize); G.GAME.round_resets.temp_handsize = nil end
559+
if G.GAME.round_resets.temp_reroll_cost then G.GAME.round_resets.temp_reroll_cost = nil; calculate_reroll_cost(true) end
560+
for _, v in pairs(find_joker("cry-loopy")) do
561+
if v.ability.extra.retrigger ~= 0 then
562+
v.ability.extra.retrigger = 0
563+
card_eval_status_text(v, 'extra', nil, nil, nil, {message = localize("k_reset"), colour = G.C.GREEN})
564+
end
565+
end
566+
for _, v in pairs(G.deck.cards) do
567+
v.sus = nil
568+
end
569+
if G.GAME.sus_cards then
570+
SMODS.calculate_context({ remove_playing_cards = true, removed = G.GAME.sus_cards })
571+
G.GAME.sus_cards = nil
572+
end
573+
574+
reset_idol_card()
575+
reset_mail_rank()
576+
reset_ancient_card()
577+
reset_castle_card()
578+
for _, mod in ipairs(SMODS.mod_list) do
579+
if mod.reset_game_globals and type(mod.reset_game_globals) == 'function' then
580+
mod.reset_game_globals(false)
581+
end
582+
end
583+
for k, v in ipairs(G.playing_cards) do
584+
v.ability.discarded = nil
585+
v.ability.forced_selection = nil
586+
end
587+
return true
588+
end
589+
}))
590+
end
511591
end
512592

513593
-- All the scattered set_cost hooks from all the pre refactor files moved into one hook

0 commit comments

Comments
 (0)