Skip to content

Commit 5d27231

Browse files
committed
fixes to stuff
1 parent ac9cd87 commit 5d27231

File tree

6 files changed

+82
-87
lines changed

6 files changed

+82
-87
lines changed

items/epic.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ local boredom = {
920920
and card.cry_boredom_marked == context.other_card
921921
then
922922
if
923-
SMODS.pseudorandom_element(
923+
pseudorandom_probability(
924924
card,
925925
"cry_boredom_joker",
926926
1,
@@ -939,7 +939,7 @@ local boredom = {
939939
if
940940
context.repetition
941941
and context.cardarea == G.play
942-
and SMODS.pseudorandom_element(
942+
and pseudorandom_probability(
943943
card,
944944
"cry_boredom_card",
945945
1,

items/m.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ local notebook = {
567567
end
568568
if
569569
to_number(jollycount) >= to_number(card.ability.extra.jollies) --if there are 5 or more jolly jokers
570-
or SMODS.pseudorandom_element(
570+
or pseudorandom_probability(
571571
card,
572572
"cry_notebook",
573573
1,
@@ -850,7 +850,7 @@ local scrabble = {
850850
if context.cardarea == G.jokers and context.before and not context.retrigger_joker then
851851
local check = false
852852
if
853-
SMODS.pseudorandom_element(
853+
pseudorandom_probability(
854854
card,
855855
"scrabbleother",
856856
1,

items/misc.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ local echo = {
3636
calculate = function(self, card, context)
3737
if
3838
context.repetition
39-
and SMODS.pseudorandom_element(card, "cry_echo", 1, card and card.ability.extra or self.config.extra)
39+
and SMODS.pseudorandom_probability(card, "cry_echo", 1, card and card.ability.extra or self.config.extra)
4040
then
4141
return {
4242
message = localize("k_again_ex"),

items/misc_joker.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4342,7 +4342,7 @@ local rnjoker = {
43424342
end
43434343
elseif j.cond == "odds" then
43444344
if
4345-
SMODS.pseudorandom_element(
4345+
pseudorandom_probability(
43464346
card,
43474347
1,
43484348
card and card.ability.extra.odds or self.config.extra.odds
@@ -7820,7 +7820,7 @@ local busdriver = {
78207820
if context.joker_main and (to_big(card.ability.extra.mult) > to_big(0)) then
78217821
local oddy = math.max(1, card.ability.extra.odds)
78227822
if
7823-
SMODS.pseudorandom_element(
7823+
pseudorandom_probability(
78247824
card,
78257825
"cry_busdriver",
78267826
3,
@@ -9395,7 +9395,7 @@ local digitalhallucinations = {
93959395

93969396
if
93979397
context.open_booster
9398-
and (SMODS.pseudorandom_element(card, "digi", 1, card and card.ability.odds or self.config.odds))
9398+
and (pseudorandom_probability(card, "digi", 1, card and card.ability.odds or self.config.odds))
93999399
then
94009400
local boosty = context.card
94019401
-- finally mod compat?

lib/overrides.lua

Lines changed: 71 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -481,89 +481,82 @@ function Game:update(dt)
481481
G.RESET_BLIND_STATES = true
482482
G.RESET_JIGGLES = true
483483
G.GAME.blind.in_blind = false
484-
G.E_MANAGER:add_event(Event({
485-
trigger = "after",
486-
delay = 0.3,
487-
func = function()
488-
if G.GAME.blind.config.blind.cry_before_cash and not G.GAME.blind.disabled then
489-
G.GAME.blind:cry_before_cash()
490-
else
491-
G.GAME.cry_make_a_decision = nil
484+
if G.GAME.blind.config.blind.cry_before_cash and not G.GAME.blind.disabled then
485+
G.GAME.blind:cry_before_cash()
486+
else
487+
G.GAME.cry_make_a_decision = nil
492488

493-
G.STATE = G.STATES.ROUND_EVAL
494-
G.STATE_COMPLETE = false
489+
G.STATE = G.STATES.ROUND_EVAL
490+
G.STATE_COMPLETE = false
491+
end
492+
if G.GAME.blind_on_deck == "Small" then
493+
G.GAME.round_resets.blind_states.Small = "Defeated"
494+
elseif G.GAME.blind_on_deck == "Big" then
495+
G.GAME.round_resets.blind_states.Big = "Defeated"
496+
else
497+
if G.GAME.current_round.cry_voucher_stickers.pinned == false then
498+
G.GAME.current_round.voucher = SMODS.get_next_vouchers()
499+
G.GAME.current_round.cry_voucher_stickers = Cryptid.next_voucher_stickers()
500+
G.GAME.current_round.cry_voucher_edition = cry_get_next_voucher_edition() or {}
501+
G.GAME.current_round.cry_bonusvouchers = {}
502+
G.GAME.cry_bonusvouchersused = {} -- i'm not sure why i'm putting these in two separate tables but it doesn't matter much
503+
for i = 1, G.GAME.cry_bonusvouchercount do
504+
G.GAME.current_round.cry_bonusvouchers[i] = SMODS.get_next_vouchers()
495505
end
496-
497-
if G.GAME.blind_on_deck == "Small" then
498-
G.GAME.round_resets.blind_states.Small = "Defeated"
499-
elseif G.GAME.blind_on_deck == "Big" then
500-
G.GAME.round_resets.blind_states.Big = "Defeated"
501-
else
502-
if G.GAME.current_round.cry_voucher_stickers.pinned == false then
503-
G.GAME.current_round.voucher = SMODS.get_next_vouchers()
504-
G.GAME.current_round.cry_voucher_stickers = Cryptid.next_voucher_stickers()
505-
G.GAME.current_round.cry_voucher_edition = cry_get_next_voucher_edition() or {}
506-
G.GAME.current_round.cry_bonusvouchers = {}
507-
G.GAME.cry_bonusvouchersused = {} -- i'm not sure why i'm putting these in two separate tables but it doesn't matter much
508-
for i = 1, G.GAME.cry_bonusvouchercount do
509-
G.GAME.current_round.cry_bonusvouchers[i] = SMODS.get_next_vouchers()
510-
end
511-
if G.GAME.modifiers.cry_no_vouchers then
512-
very_fair_quip =
513-
pseudorandom_element(G.localization.misc.very_fair_quips, pseudoseed("cry_very_fair"))
514-
end
515-
end
516-
G.GAME.round_resets.blind_states.Boss = "Defeated"
517-
for k, v in ipairs(G.playing_cards) do
518-
v.ability.played_this_ante = nil
519-
end
506+
if G.GAME.modifiers.cry_no_vouchers then
507+
very_fair_quip =
508+
pseudorandom_element(G.localization.misc.very_fair_quips, pseudoseed("cry_very_fair"))
520509
end
510+
end
511+
G.GAME.round_resets.blind_states.Boss = "Defeated"
512+
for k, v in ipairs(G.playing_cards) do
513+
v.ability.played_this_ante = nil
514+
end
515+
ease_ante(G.GAME.blind and G.GAME.blind:cry_calc_ante_gain() or 1); Cryptid.apply_ante_tax(); delay(0.4); check_for_unlock({type = 'ante_up', ante = G.GAME.round_resets.ante + 1})
516+
end
521517

522-
if G.GAME.round_resets.temp_handsize then
523-
G.hand:change_size(-G.GAME.round_resets.temp_handsize)
524-
G.GAME.round_resets.temp_handsize = nil
525-
end
526-
if G.GAME.round_resets.temp_reroll_cost then
527-
G.GAME.round_resets.temp_reroll_cost = nil
528-
calculate_reroll_cost(true)
529-
end
530-
for _, v in pairs(find_joker("cry-loopy")) do
531-
if v.ability.extra.retrigger ~= 0 then
532-
v.ability.extra.retrigger = 0
533-
card_eval_status_text(
534-
v,
535-
"extra",
536-
nil,
537-
nil,
538-
nil,
539-
{ message = localize("k_reset"), colour = G.C.GREEN }
540-
)
541-
end
542-
end
543-
for _, v in pairs(G.deck.cards) do
544-
v.sus = nil
545-
end
546-
if G.GAME.sus_cards then
547-
SMODS.calculate_context({ remove_playing_cards = true, removed = G.GAME.sus_cards })
548-
G.GAME.sus_cards = nil
549-
end
518+
if G.GAME.round_resets.temp_handsize then
519+
G.hand:change_size(-G.GAME.round_resets.temp_handsize)
520+
G.GAME.round_resets.temp_handsize = nil
521+
end
522+
if G.GAME.round_resets.temp_reroll_cost then
523+
G.GAME.round_resets.temp_reroll_cost = nil
524+
calculate_reroll_cost(true)
525+
end
526+
for _, v in pairs(find_joker("cry-loopy")) do
527+
if v.ability.extra.retrigger ~= 0 then
528+
v.ability.extra.retrigger = 0
529+
card_eval_status_text(
530+
v,
531+
"extra",
532+
nil,
533+
nil,
534+
nil,
535+
{ message = localize("k_reset"), colour = G.C.GREEN }
536+
)
537+
end
538+
end
539+
for _, v in pairs(G.deck.cards) do
540+
v.sus = nil
541+
end
542+
if G.GAME.sus_cards then
543+
SMODS.calculate_context({ remove_playing_cards = true, removed = G.GAME.sus_cards })
544+
G.GAME.sus_cards = nil
545+
end
550546

551-
reset_idol_card()
552-
reset_mail_rank()
553-
reset_ancient_card()
554-
reset_castle_card()
555-
for _, mod in ipairs(SMODS.mod_list) do
556-
if mod.reset_game_globals and type(mod.reset_game_globals) == "function" then
557-
mod.reset_game_globals(false)
558-
end
559-
end
560-
for k, v in ipairs(G.playing_cards) do
561-
v.ability.discarded = nil
562-
v.ability.forced_selection = nil
563-
end
564-
return true
565-
end,
566-
}))
547+
reset_idol_card()
548+
reset_mail_rank()
549+
reset_ancient_card()
550+
reset_castle_card()
551+
for _, mod in ipairs(SMODS.mod_list) do
552+
if mod.reset_game_globals and type(mod.reset_game_globals) == "function" then
553+
mod.reset_game_globals(false)
554+
end
555+
end
556+
for k, v in ipairs(G.playing_cards) do
557+
v.ability.discarded = nil
558+
v.ability.forced_selection = nil
559+
end
567560
end
568561
end
569562

lovely/none.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ 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+
evaluate_play_after(text, disp_text, poker_hands, scoring_hand, non_loc_disp_text, percent, percent_delta)
185+
end
184186
return text, disp_text, poker_hands, scoring_hand, non_loc_disp_text, percent, percent_delta
185187
end
186188
function evaluate_play_after(text, disp_text, poker_hands, scoring_hand, non_loc_disp_text, percent, percent_delta)

0 commit comments

Comments
 (0)