@@ -521,302 +521,6 @@ function Game:update(dt)
521521 else
522522 none_eval = 0
523523 end
524- if
525- (G .STATE == G .STATES .NEW_ROUND or G .STATE == G .STATES .HAND_PLAYED )
526- and to_big (G .GAME .chips ) >= to_big (G .GAME .blind .chips )
527- and not G .hand .cards [1 ]
528- and not G .deck .cards [1 ]
529- and not G .play .cards [1 ]
530- and not G .discard .cards [1 ]
531- and none_eval > 2
532- then
533- none_eval = - 999
534- G .GAME .blind .in_blind = false
535- local game_over = true
536- local game_won = false
537- G .RESET_BLIND_STATES = true
538- G .RESET_JIGGLES = true
539- if G .GAME .current_round .semicolon then
540- game_over = false
541- end
542- if to_big (G .GAME .chips ) >= to_big (G .GAME .blind .chips ) then
543- game_over = false
544- end
545- -- context.end_of_round calculations
546- SMODS .saved = false
547- SMODS .calculate_context ({ end_of_round = true , game_over = game_over , beat_boss = G .GAME .blind .boss })
548- if SMODS .saved then
549- game_over = false
550- end
551- -- TARGET: main end_of_round evaluation
552- local i = 1
553- while i <= # G .jokers .cards do
554- local gone = G .jokers .cards [i ]:calculate_banana ()
555- if not gone then
556- i = i + 1
557- end
558- end
559- if G .GAME .round_resets .ante >= G .GAME .win_ante and G .GAME .blind_on_deck == " Boss" then
560- game_won = true
561- G .GAME .won = true
562- end
563- if game_over then
564- G .STATE = G .STATES .GAME_OVER
565- if not G .GAME .won and not G .GAME .seeded and not G .GAME .challenge then
566- G .PROFILES [G .SETTINGS .profile ].high_scores .current_streak .amt = 0
567- end
568- G :save_settings ()
569- G .FILE_HANDLER .force = true
570- G .STATE_COMPLETE = false
571- else
572- G .GAME .unused_discards = (G .GAME .unused_discards or 0 ) + G .GAME .current_round .discards_left
573- if G .GAME .blind and G .GAME .blind .config .blind then
574- discover_card (G .GAME .blind .config .blind )
575- end
576-
577- if G .GAME .blind_on_deck == " Boss" then
578- local _handname , _played , _order = " High Card" , - 1 , 100
579- for k , v in pairs (G .GAME .hands ) do
580- if v .played > _played or (v .played == _played and _order > v .order ) then
581- _played = v .played
582- _handname = k
583- end
584- end
585- G .GAME .current_round .most_played_poker_hand = _handname
586- end
587-
588- if G .GAME .blind :get_type () == " Boss" and not G .GAME .seeded and not G .GAME .challenge then
589- G .GAME .current_boss_streak = G .GAME .current_boss_streak + 1
590- check_and_set_high_score (" boss_streak" , G .GAME .current_boss_streak )
591- end
592-
593- if G .GAME .current_round .hands_played == 1 then
594- inc_career_stat (" c_single_hand_round_streak" , 1 )
595- else
596- if not G .GAME .seeded and not G .GAME .challenge then
597- G .PROFILES [G .SETTINGS .profile ].career_stats .c_single_hand_round_streak = 0
598- G :save_settings ()
599- end
600- end
601-
602- check_for_unlock ({ type = " round_win" })
603- set_joker_usage ()
604- if game_won and not G .GAME .win_notified then
605- G .GAME .win_notified = true
606- G .E_MANAGER :add_event (Event ({
607- trigger = " immediate" ,
608- blocking = false ,
609- blockable = false ,
610- func = function ()
611- if G .STATE == G .STATES .ROUND_EVAL then
612- win_game ()
613- G .GAME .won = true
614- return true
615- end
616- end ,
617- }))
618- end
619- for _ , v in ipairs (SMODS .get_card_areas (" playing_cards" , " end_of_round" )) do
620- SMODS .calculate_end_of_round_effects ({
621- cardarea = v ,
622- end_of_round = true ,
623- beat_boss = G .GAME .blind .boss ,
624- })
625- end
626-
627- local i = 1
628- while i <= # G .hand .cards do
629- local gone = G .hand .cards [i ]:calculate_banana ()
630- if not gone then
631- i = i + 1
632- end
633- end
634- for i = 1 , # G .discard .cards do
635- G .discard .cards [i ]:calculate_perishable ()
636- end
637- i = 1
638- while i <= # G .deck .cards do
639- G .deck .cards [i ]:calculate_perishable ()
640- local gone = G .deck .cards [i ]:calculate_banana ()
641- if not gone then
642- i = i + 1
643- end
644- end
645- if G .GAME .used_vouchers .v_cry_double_down then
646- local function update_dbl (area )
647- local area = G .jokers
648- for i = 1 , # area .cards do
649- if
650- area .cards [i ].ability .immutable
651- and type (area .cards [i ].ability .immutable .other_side ) == " table"
652- then
653- -- tweak to do deck effects with on the flip side
654- if not G .P_CENTERS [area .cards [i ].ability .immutable .other_side .key ].immutable then
655- if
656- area .cards [i ].ability .immutable .other_side
657- and area .cards [i ].edition .cry_double_sided
658- then
659- Cryptid .manipulate_table (
660- area .cards [i ],
661- area .cards [i ].ability .immutable ,
662- " other_side" ,
663- {
664- value = 1.5 ,
665- type = " X" ,
666- big = Cryptid .is_card_big ({
667- config = {
668- center = G .P_CENTERS [area .cards [i ].ability .immutable .other_side .key ],
669- },
670- }),
671- }
672- )
673- card_eval_status_text (
674- area .cards [i ],
675- " extra" ,
676- nil ,
677- nil ,
678- nil ,
679- { message = localize (" k_upgrade_ex" ) }
680- )
681- end
682- end
683- end
684- end
685- end
686- update_dbl (G .jokers )
687- update_dbl (G .consumeables )
688- update_dbl (G .hand )
689- update_dbl (G .discard )
690- update_dbl (G .deck )
691- end
692- i = 1
693- while i <= # G .hand .cards do
694- local gone = G .hand .cards [i ]:calculate_abstract_break ()
695- if not gone then
696- i = i + 1
697- end
698- end
699- -- i = 1
700- -- while i <= #G.deck.cards do
701- -- local gone = G.deck.cards[i]:calculate_abstract_break()
702- -- if not gone then i = i + 1 end
703- -- end
704- -- i = 1
705- -- while i <= #G.discard.cards do
706- -- local gone = G.discard.cards[i]:calculate_abstract_break()
707- -- if not gone then i = i + 1 end
708- -- end
709- G .FUNCS .draw_from_hand_to_discard ()
710- if G .GAME .blind_on_deck == " Boss" then
711- G .GAME .voucher_restock = nil
712- if
713- G .GAME .modifiers .set_eternal_ante
714- and (G .GAME .round_resets .ante == G .GAME .modifiers .set_eternal_ante )
715- then
716- for k , v in ipairs (G .jokers .cards ) do
717- v :set_eternal (true )
718- end
719- end
720- if
721- G .GAME .modifiers .set_joker_slots_ante
722- and (G .GAME .round_resets .ante == G .GAME .modifiers .set_joker_slots_ante )
723- then
724- G .jokers .config .card_limit = 0
725- end
726- delay (0.4 )
727- ease_ante (G .GAME .blind and G .GAME .blind :cry_calc_ante_gain () or 1 )
728- Cryptid .apply_ante_tax ()
729- delay (0.4 )
730- check_for_unlock ({ type = " ante_up" , ante = G .GAME .round_resets .ante + 1 })
731- end
732- G .FUNCS .draw_from_discard_to_deck ()
733- G .E_MANAGER :add_event (Event ({
734- trigger = " after" ,
735- delay = 0.3 ,
736- func = function ()
737- if G .GAME .blind .config .blind .cry_before_cash and not G .GAME .blind .disabled then
738- G .GAME .blind :cry_before_cash ()
739- else
740- G .GAME .cry_make_a_decision = nil
741-
742- G .STATE = G .STATES .ROUND_EVAL
743- G .STATE_COMPLETE = false
744- end
745-
746- if G .GAME .blind_on_deck == " Small" then
747- G .GAME .round_resets .blind_states .Small = " Defeated"
748- elseif G .GAME .blind_on_deck == " Big" then
749- G .GAME .round_resets .blind_states .Big = " Defeated"
750- else
751- if G .GAME .current_round .cry_voucher_stickers .pinned == false then
752- G .GAME .current_round .voucher = SMODS .get_next_vouchers ()
753- G .GAME .current_round .cry_voucher_stickers = Cryptid .next_voucher_stickers ()
754- G .GAME .current_round .cry_voucher_edition = cry_get_next_voucher_edition () or {}
755- G .GAME .current_round .cry_bonusvouchers = {}
756- G .GAME .cry_bonusvouchersused = {} -- i'm not sure why i'm putting these in two separate tables but it doesn't matter much
757- for i = 1 , G .GAME .cry_bonusvouchercount do
758- G .GAME .current_round .cry_bonusvouchers [i ] = SMODS .get_next_vouchers ()
759- end
760- if G .GAME .modifiers .cry_no_vouchers then
761- very_fair_quip = pseudorandom_element (
762- G .localization .misc .very_fair_quips ,
763- pseudoseed (" cry_very_fair" )
764- )
765- end
766- end
767- G .GAME .round_resets .blind_states .Boss = " Defeated"
768- for k , v in ipairs (G .playing_cards ) do
769- v .ability .played_this_ante = nil
770- end
771- end
772-
773- if G .GAME .round_resets .temp_handsize then
774- G .hand :change_size (- G .GAME .round_resets .temp_handsize )
775- G .GAME .round_resets .temp_handsize = nil
776- end
777- if G .GAME .round_resets .temp_reroll_cost then
778- G .GAME .round_resets .temp_reroll_cost = nil
779- calculate_reroll_cost (true )
780- end
781- for _ , v in pairs (find_joker (" cry-loopy" )) do
782- if v .ability .extra .retrigger ~= 0 then
783- v .ability .extra .retrigger = 0
784- card_eval_status_text (
785- v ,
786- " extra" ,
787- nil ,
788- nil ,
789- nil ,
790- { message = localize (" k_reset" ), colour = G .C .GREEN }
791- )
792- end
793- end
794- for _ , v in pairs (G .deck .cards ) do
795- v .sus = nil
796- end
797- if G .GAME .sus_cards then
798- SMODS .calculate_context ({ remove_playing_cards = true , removed = G .GAME .sus_cards })
799- G .GAME .sus_cards = nil
800- end
801-
802- reset_idol_card ()
803- reset_mail_rank ()
804- reset_ancient_card ()
805- reset_castle_card ()
806- for _ , mod in ipairs (SMODS .mod_list ) do
807- if mod .reset_game_globals and type (mod .reset_game_globals ) == " function" then
808- mod .reset_game_globals (false )
809- end
810- end
811- for k , v in ipairs (G .playing_cards ) do
812- v .ability .discarded = nil
813- v .ability .forced_selection = nil
814- end
815- return true
816- end ,
817- }))
818- end
819- end
820524end
821525
822526-- All the scattered set_cost hooks from all the pre refactor files moved into one hook
@@ -2091,7 +1795,7 @@ end
20911795
20921796local end_roundref = end_round
20931797function end_round ()
2094- if (# G .hand .cards < 1 and # G .deck .cards < 1 and # G .play .cards < 1 ) or (# G .hand .cards < 1 and # G .deck .cards < 1 ) then
1798+ if (( # G .hand .cards < 1 and # G .deck .cards < 1 and # G .play .cards < 1 ) or (# G .hand .cards < 1 and # G .deck .cards < 1 )) and G . STATE ~= G . STATES . NEW_ROUND then
20951799 if
20961800 Cryptid .enabled (" set_cry_poker_hand_stuff" ) == true
20971801 and not Cryptid .safe_get (G .PROFILES , G .SETTINGS .profile , " cry_none" )
0 commit comments