@@ -2851,14 +2851,17 @@ local declare = {
28512851 loc_vars = function (self , q , card )
28522852 return {
28532853 vars = {
2854- localize (({
2855- " Straight" ,
2856- " Flush" ,
2857- " Full House" ,
2858- " Full House"
2859- })[(G .GAME .DECLARE_USED or 0 ) + 1 ], " poker_hands" ),
2860- number_format (- G .GAME .DECLARE_USED )
2861- }
2854+ localize (
2855+ ({
2856+ " Straight" ,
2857+ " Flush" ,
2858+ " Full House" ,
2859+ " Full House" ,
2860+ })[(G .GAME .DECLARE_USED or 0 ) + 1 ],
2861+ " poker_hands"
2862+ ),
2863+ number_format (- G .GAME .DECLARE_USED ),
2864+ },
28622865 }
28632866 end ,
28642867 can_use = function (self , card )
@@ -2881,7 +2884,7 @@ local declare = {
28812884 G .CHOOSE_CARD .alignment .offset .y = 0
28822885 G .ROOM .jiggle = G .ROOM .jiggle + 1
28832886 G .CHOOSE_CARD :align_to_major ()
2884- end ,
2887+ end ,
28852888 init = function ()
28862889 function create_UIBox_declare (card )
28872890 G .E_MANAGER :add_event (Event ({
@@ -2956,115 +2959,117 @@ local declare = {
29562959 })
29572960 return t
29582961 end
2959- G .FUNCS .declare_cancel = function ()
2962+ G .FUNCS .declare_cancel = function ()
29602963 if G .CHOOSE_CARD then
29612964 G .CHOOSE_CARD :remove ()
29622965 end
29632966 G .GAME .USING_CODE = false
29642967 G .GAME .USING_DECLARE = false
29652968 end
2966- G .FUNCS .declare_apply = function ()
2967- G .GAME .hands [" cry_Declare" .. tostring (G .GAME .DECLARE_USED or 0 )] = Cryptid .create_declare_hand (G .hand .highlighted , G .ENTERED_CARD )
2968- G .GAME .DECLARE_USED = (G .GAME .DECLARE_USED or 0 ) + 1
2969- G .FUNCS .declare_cancel ()
2970- end
2971- G .FUNCS .declare_apply_suitless = function ()
2972- G .GAME .hands [" cry_Declare" .. tostring (G .GAME .DECLARE_USED or 0 )] = Cryptid .create_declare_hand (G .hand .highlighted , G .ENTERED_CARD , true )
2973- G .GAME .DECLARE_USED = (G .GAME .DECLARE_USED or 0 ) + 1
2974- G .FUNCS .declare_cancel ()
2975- end
2976- Cryptid .create_declare_hand = function (cards , name , suitless )
2977- if G .ENTERED_CARD == " " then
2978- G .ENTERED_CARD = " cry_Declare" .. tostring (G .GAME .DECLARE_USED or 0 )
2979- end
2980- local complexity = # cards
2981- local ranks = {}
2982- local suits = {}
2983- for i , v in pairs (cards ) do
2984- if not ranks [v :get_id ()] then
2985- ranks [v :get_id ()] = true
2986- complexity = complexity + 0.85
2987- end
2988- if not suitless then
2989- if (SMODS .has_no_suit (v ) and not suits [" suitless" ]) or not suits [v .base .suit ] then
2990- suits [SMODS .has_no_suit (v ) and " suitless" or v .base .suit ] = true
2991- complexity = complexity + 0.45
2992- end
2993- end
2994- end
2995- if # cards > 5 then
2996- complexity = complexity * 1.25 ^ (# cards - 5 )
2997- end
2998- complexity = complexity * 0.75
2999- local mult = complexity
3000- local chips = complexity * 8.45 -- arbitrary just shake it up a little
3001- local l_mult = complexity * 0.1
3002- local l_chips = complexity
3003- local declare_cards = {}
3004- for i , v in pairs (cards ) do
3005- local card = {
3006- rank = v :get_id () > 0 and v :get_id () or " rankless" ,
3007- suit = not suitless and (SMODS .has_no_suit (v ) and " suitless" or v .base .suit ),
3008- }
3009- declare_cards [# declare_cards + 1 ] = card
3010- end
3011- for i , v in pairs (G .GAME .hands ) do
3012- v .order = (v .order or 0 ) + 1
3013- end
3014- local desc = localize (" cry_Declare" .. tostring (G .GAME .DECLARE_USED or 0 ), " poker_hand_descriptions" )
3015- desc [# desc + 1 ] = localize (" cry_code_suitless" )
3016- return {
3017- order = 1 ,
3018- l_mult = l_mult ,
3019- l_chips = l_chips ,
3020- mult = mult ,
3021- chips = chips ,
3022- example = Cryptid .create_declare_example (cards , suitless ),
3023- visible = true ,
3024- played = 0 ,
3025- _saved_d_v = true ,
3026- played_this_round = 0 ,
3027- s_mult = mult ,
3028- s_chips = chips ,
3029- from_declare = true ,
3030- declare_cards = declare_cards ,
3031- declare_name = G .ENTERED_CARD ,
3032- level = 1 ,
3033- index = G .GAME .DECLARE_USED or 0 ,
3034- desc_text = suitless and desc or nil ,
3035- }
3036- end
3037- local localize_ref = localize
3038- function localize (first , second , ...)
3039- if second == " poker_hands" then
3040- if G and G .GAME and G .GAME .hands [first ] and G .GAME .hands [first ].declare_name then
3041- return G .GAME .hands [first ].declare_name
3042- end
3043- end
3044- if second == " poker_hand_descriptions" then
3045- if G and G .GAME and G .GAME .hands [first ] and G .GAME .hands [first ].desc_text then
3046- return G .GAME .hands [first ].desc_text
3047- end
3048- end
3049- return localize_ref (first , second , ... )
3050- end
3051- local is_visibleref = SMODS .is_poker_hand_visible
3052- function SMODS .is_poker_hand_visible (handname )
3053- if not SMODS .PokerHands [handname ]
3054- then return G .GAME .hands [handname ].visible
3055- end
3056- return is_visibleref (handname )
3057- end
3058- function Cryptid .create_declare_example (cards , suitless )
3059- local c = {}
3060- for i , v in pairs (cards ) do
3061- local key = SMODS .Suits [v .base .suit ].card_key .. " _" .. SMODS .Ranks [v .base .value ].card_key
3062- local enhancement = (SMODS .has_no_suit (v ) and " m_stone" ) or (suitless and " m_wild" ) or nil
3063- c [# c + 1 ] = {key , true , enhancement = enhancement }
3064- end
3065- return c
3066- end
3067- end
2969+ G .FUNCS .declare_apply = function ()
2970+ G .GAME .hands [" cry_Declare" .. tostring (G .GAME .DECLARE_USED or 0 )] =
2971+ Cryptid .create_declare_hand (G .hand .highlighted , G .ENTERED_CARD )
2972+ G .GAME .DECLARE_USED = (G .GAME .DECLARE_USED or 0 ) + 1
2973+ G .FUNCS .declare_cancel ()
2974+ end
2975+ G .FUNCS .declare_apply_suitless = function ()
2976+ G .GAME .hands [" cry_Declare" .. tostring (G .GAME .DECLARE_USED or 0 )] =
2977+ Cryptid .create_declare_hand (G .hand .highlighted , G .ENTERED_CARD , true )
2978+ G .GAME .DECLARE_USED = (G .GAME .DECLARE_USED or 0 ) + 1
2979+ G .FUNCS .declare_cancel ()
2980+ end
2981+ Cryptid .create_declare_hand = function (cards , name , suitless )
2982+ if G .ENTERED_CARD == " " then
2983+ G .ENTERED_CARD = " cry_Declare" .. tostring (G .GAME .DECLARE_USED or 0 )
2984+ end
2985+ local complexity = # cards
2986+ local ranks = {}
2987+ local suits = {}
2988+ for i , v in pairs (cards ) do
2989+ if not ranks [v :get_id ()] then
2990+ ranks [v :get_id ()] = true
2991+ complexity = complexity + 0.85
2992+ end
2993+ if not suitless then
2994+ if (SMODS .has_no_suit (v ) and not suits [" suitless" ]) or not suits [v .base .suit ] then
2995+ suits [SMODS .has_no_suit (v ) and " suitless" or v .base .suit ] = true
2996+ complexity = complexity + 0.45
2997+ end
2998+ end
2999+ end
3000+ if # cards > 5 then
3001+ complexity = complexity * 1.25 ^ (# cards - 5 )
3002+ end
3003+ complexity = complexity * 0.75
3004+ local mult = complexity
3005+ local chips = complexity * 8.45 -- arbitrary just shake it up a little
3006+ local l_mult = complexity * 0.1
3007+ local l_chips = complexity
3008+ local declare_cards = {}
3009+ for i , v in pairs (cards ) do
3010+ local card = {
3011+ rank = v :get_id () > 0 and v :get_id () or " rankless" ,
3012+ suit = not suitless and (SMODS .has_no_suit (v ) and " suitless" or v .base .suit ),
3013+ }
3014+ declare_cards [# declare_cards + 1 ] = card
3015+ end
3016+ for i , v in pairs (G .GAME .hands ) do
3017+ v .order = (v .order or 0 ) + 1
3018+ end
3019+ local desc = localize (" cry_Declare" .. tostring (G .GAME .DECLARE_USED or 0 ), " poker_hand_descriptions" )
3020+ desc [# desc + 1 ] = localize (" cry_code_suitless" )
3021+ return {
3022+ order = 1 ,
3023+ l_mult = l_mult ,
3024+ l_chips = l_chips ,
3025+ mult = mult ,
3026+ chips = chips ,
3027+ example = Cryptid .create_declare_example (cards , suitless ),
3028+ visible = true ,
3029+ played = 0 ,
3030+ _saved_d_v = true ,
3031+ played_this_round = 0 ,
3032+ s_mult = mult ,
3033+ s_chips = chips ,
3034+ from_declare = true ,
3035+ declare_cards = declare_cards ,
3036+ declare_name = G .ENTERED_CARD ,
3037+ level = 1 ,
3038+ index = G .GAME .DECLARE_USED or 0 ,
3039+ desc_text = suitless and desc or nil ,
3040+ }
3041+ end
3042+ local localize_ref = localize
3043+ function localize (first , second , ...)
3044+ if second == " poker_hands" then
3045+ if G and G .GAME and G .GAME .hands [first ] and G .GAME .hands [first ].declare_name then
3046+ return G .GAME .hands [first ].declare_name
3047+ end
3048+ end
3049+ if second == " poker_hand_descriptions" then
3050+ if G and G .GAME and G .GAME .hands [first ] and G .GAME .hands [first ].desc_text then
3051+ return G .GAME .hands [first ].desc_text
3052+ end
3053+ end
3054+ return localize_ref (first , second , ... )
3055+ end
3056+ local is_visibleref = SMODS .is_poker_hand_visible
3057+ function SMODS .is_poker_hand_visible (handname )
3058+ if not SMODS .PokerHands [handname ] then
3059+ return G .GAME .hands [handname ].visible
3060+ end
3061+ return is_visibleref (handname )
3062+ end
3063+ function Cryptid .create_declare_example (cards , suitless )
3064+ local c = {}
3065+ for i , v in pairs (cards ) do
3066+ local key = SMODS .Suits [v .base .suit ].card_key .. " _" .. SMODS .Ranks [v .base .value ].card_key
3067+ local enhancement = (SMODS .has_no_suit (v ) and " m_stone" ) or (suitless and " m_wild" ) or nil
3068+ c [# c + 1 ] = { key , true , enhancement = enhancement }
3069+ end
3070+ return c
3071+ end
3072+ end ,
30683073}
30693074
30703075-- ://Class
0 commit comments