Skip to content

Commit 975a7aa

Browse files
committed
fix duplicate context call
1 parent c7f1a38 commit 975a7aa

File tree

2 files changed

+4
-88
lines changed

2 files changed

+4
-88
lines changed

lib/overrides.lua

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -515,92 +515,7 @@ function Game:update(dt)
515515
and not G.deck.cards[1]
516516
then
517517
--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 =
550-
pseudorandom_element(G.localization.misc.very_fair_quips, pseudoseed("cry_very_fair"))
551-
end
552-
end
553-
G.GAME.round_resets.blind_states.Boss = "Defeated"
554-
for k, v in ipairs(G.playing_cards) do
555-
v.ability.played_this_ante = nil
556-
end
557-
end
558-
559-
if G.GAME.round_resets.temp_handsize then
560-
G.hand:change_size(-G.GAME.round_resets.temp_handsize)
561-
G.GAME.round_resets.temp_handsize = nil
562-
end
563-
if G.GAME.round_resets.temp_reroll_cost then
564-
G.GAME.round_resets.temp_reroll_cost = nil
565-
calculate_reroll_cost(true)
566-
end
567-
for _, v in pairs(find_joker("cry-loopy")) do
568-
if v.ability.extra.retrigger ~= 0 then
569-
v.ability.extra.retrigger = 0
570-
card_eval_status_text(
571-
v,
572-
"extra",
573-
nil,
574-
nil,
575-
nil,
576-
{ message = localize("k_reset"), colour = G.C.GREEN }
577-
)
578-
end
579-
end
580-
for _, v in pairs(G.deck.cards) do
581-
v.sus = nil
582-
end
583-
if G.GAME.sus_cards then
584-
SMODS.calculate_context({ remove_playing_cards = true, removed = G.GAME.sus_cards })
585-
G.GAME.sus_cards = nil
586-
end
587-
588-
reset_idol_card()
589-
reset_mail_rank()
590-
reset_ancient_card()
591-
reset_castle_card()
592-
for _, mod in ipairs(SMODS.mod_list) do
593-
if mod.reset_game_globals and type(mod.reset_game_globals) == "function" then
594-
mod.reset_game_globals(false)
595-
end
596-
end
597-
for k, v in ipairs(G.playing_cards) do
598-
v.ability.discarded = nil
599-
v.ability.forced_selection = nil
600-
end
601-
return true
602-
end,
603-
}))
518+
604519
end
605520
end
606521

lovely/none.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,11 @@ payload = '''
180180
}))
181181
delay(0.3)
182182
delay(0.3)
183-
evaluate_play_after(text, disp_text, poker_hands, scoring_hand, non_loc_disp_text, percent, percent_delta)
183+
if not (SMODS.Mods["Talisman"] or {}).can_load then
184+
pseudorandom_probability_after(text, disp_text, poker_hands, scoring_hand, non_loc_disp_text, percent, percent_delta)
184185
return text, disp_text, poker_hands, scoring_hand, non_loc_disp_text, percent, percent_delta
185186
end
186-
function evaluate_play_after(text, disp_text, poker_hands, scoring_hand, non_loc_disp_text, percent, percent_delta)
187+
function pseudorandom_probability_after(text, disp_text, poker_hands, scoring_hand, non_loc_disp_text, percent, percent_delta)
187188
'''
188189
match_indent = true
189190

0 commit comments

Comments
 (0)