This commit is contained in:
2024-05-24 22:01:27 +08:00
parent 7f124132ed
commit 3f54d1f79b
42 changed files with 11201 additions and 11796 deletions

View File

@@ -303,7 +303,7 @@ function G.UIDEF.card_focus_ui(card)
playing_card_colour[4] = 1.5
if G.hand and card.area == G.hand then ease_value(playing_card_colour, 4, -1.5, nil, 'REAL',nil, 0.2, 'quad') end
local t_card_norm = {x = card.T.x + card.T.w/2 - G.ROOM.T.w/2, y = card.T.y + card.T.h/2 - G.ROOM.T.h/2}
local tcnx, tcny = card.T.x + card.T.w/2 - G.ROOM.T.w/2, card.T.y + card.T.h/2 - G.ROOM.T.h/2
local base_background = UIBox{
T = {card.VT.x,card.VT.y,0,0},
@@ -316,15 +316,15 @@ function G.UIDEF.card_focus_ui(card)
}},
config = {
align = 'cm',
offset = {x= 0.007*t_card_norm.x*card.T.w, y = 0.007*t_card_norm.y*card.T.h},
offset = {x= 0.007*tcnx*card.T.w, y = 0.007*tcny*card.T.h},
parent = card,
r_bond = (not G.hand or card.area ~= G.hand) and 'Weak' or 'Strong'
}
}
base_background.set_alignment = function()
local card_norm = {x = card.T.x + card.T.w/2 - G.ROOM.T.w/2, y = card.T.y + card.T.h/2 - G.ROOM.T.h/2}
Moveable.set_alignment(card.children.focused_ui, {offset = {x= 0.007*card_norm.x*card.T.w, y = 0.007*card_norm.y*card.T.h}})
local cnx, cny = card.T.x + card.T.w/2 - G.ROOM.T.w/2, card.T.y + card.T.h/2 - G.ROOM.T.h/2
Moveable.set_alignment(card.children.focused_ui, {offset = {x= 0.007*cnx*card.T.w, y = 0.007*cny*card.T.h}})
end
local base_attach = base_background:get_UIE_by_ID('ATTACH_TO_ME')
@@ -1135,6 +1135,8 @@ end
function get_badge_colour(key)
G.BADGE_COL = G.BADGE_COL or {
eternal = G.C.ETERNAL,
perishable = G.C.PERISHABLE,
rental = G.C.RENTAL,
foil = G.C.DARK_EDITION,
holographic = G.C.DARK_EDITION,
polychrome = G.C.DARK_EDITION,
@@ -2312,6 +2314,7 @@ function G.UIDEF.settings_tab(tab)
end
end
)}),
create_toggle({label = localize('b_reduced_motion'), ref_table = G.SETTINGS, ref_value = 'reduced_motion'}),
G.F_CRASH_REPORTS and create_toggle({label = localize('b_set_crash_reports'), ref_table = G.SETTINGS, ref_value = 'crashreports', info = localize('ml_crash_report_info')}) or nil,
}}
elseif tab == 'Video' then
@@ -5270,6 +5273,49 @@ function G.UIDEF.challenge_description_tab(args)
)
end
end
if challenge.restrictions.banned_other then
local other_tab = {}
for k, v in pairs(challenge.restrictions.banned_other) do
if v.type == 'blind' then
other_tab[#other_tab+1] = G.P_BLINDS[v.id]
end
end
table.sort(other_tab, function (a, b) return a.order < b.order end)
for k, v in ipairs(other_tab) do
local temp_blind = AnimatedSprite(0,0,1,1, G.ANIMATION_ATLAS['blind_chips'], v.pos)
temp_blind:define_draw_steps({
{shader = 'dissolve', shadow_height = 0.05},
{shader = 'dissolve'}
})
temp_blind.float = true
temp_blind.states.hover.can = true
temp_blind.states.drag.can = false
temp_blind.states.collide.can = true
temp_blind.config = {blind = v, force_focus = true}
temp_blind.hover = function()
if not G.CONTROLLER.dragging.target or G.CONTROLLER.using_touch then
if not temp_blind.hovering and temp_blind.states.visible then
temp_blind.hovering = true
temp_blind.hover_tilt = 3
temp_blind:juice_up(0.05, 0.02)
play_sound('chips1', math.random()*0.1 + 0.55, 0.12)
temp_blind.config.h_popup = create_UIBox_blind_popup(v, true)
temp_blind.config.h_popup_config ={align = 'cl', offset = {x=-0.1,y=0},parent = temp_blind}
Node.hover(temp_blind)
end
end
end
temp_blind.stop_hover = function() temp_blind.hovering = false; Node.stop_hover(temp_blind); temp_blind.hover_tilt = 0 end
table.insert(banned_other,
{n=G.UIT.R, config={align = "cm", padding = 0}, nodes={
{n=G.UIT.O, config={object = temp_blind}}
}}
)
end
end
end
if not banned_cards[1] then banned_cards[#banned_cards+1] = {n=G.UIT.R, config={align = "cl"}, nodes= localize{type = 'text', key = 'ch_m_none', vars = {}}} end
if not banned_tags[1] then banned_tags[#banned_tags+1] = {n=G.UIT.R, config={align = "cl"}, nodes= localize{type = 'text', key = 'ch_c_none', vars = {}}} end
@@ -5687,11 +5733,13 @@ function G.UIDEF.language_selector()
table.sort(langs, (function(a, b) return a.label < b.label end))
local _row = {}
for k, v in ipairs(langs) do
_row[#_row+1] = {n=G.UIT.C, config={align = "cm", func = 'beta_lang_alert', padding = 0.05, r = 0.1, minh = 0.7, minw = 4.5, button = v.beta and 'warn_lang' or 'change_lang', ref_table = v, colour = v.beta and G.C.RED or G.C.BLUE, hover = true, shadow = true, focus_args = {snap_to = (k == 1)}}, nodes={
{n=G.UIT.R, config={align = "cm"}, nodes={
{n=G.UIT.T, config={text = v.label, lang = v, scale = 0.45, colour = G.C.UI.TEXT_LIGHT, shadow = true}}
if not G.F_HIDE_BETA_LANGS or (not v.beta) then
_row[#_row+1] = {n=G.UIT.C, config={align = "cm", func = 'beta_lang_alert', padding = 0.05, r = 0.1, minh = 0.7, minw = 4.5, button = v.beta and 'warn_lang' or 'change_lang', ref_table = v, colour = v.beta and G.C.RED or G.C.BLUE, hover = true, shadow = true, focus_args = {snap_to = (k == 1)}}, nodes={
{n=G.UIT.R, config={align = "cm"}, nodes={
{n=G.UIT.T, config={text = v.label, lang = v, scale = 0.45, colour = G.C.UI.TEXT_LIGHT, shadow = true}}
}}
}}
}}
end
if _row[3] or (k == #langs) then
rows[#rows+1] = {n=G.UIT.R, config={align = "cm", padding = 0.1}, nodes=_row}
_row = {}
@@ -5704,12 +5752,12 @@ function G.UIDEF.language_selector()
local t = create_UIBox_generic_options({contents ={
{n=G.UIT.R, config={align = "cm", padding = 0.05}, nodes=rows},
{n=G.UIT.R, config={align = "cm", padding = 0.05}, nodes={
G.F_EXTERNAL_LINKS and {n=G.UIT.R, config={align = "cm", padding = 0.05}, nodes={
{n=G.UIT.C, config={align = "cm", padding = 0.1, minw = 4, maxw = 4, r = 0.1, minh = 0.8, hover = true, colour = mix_colours(G.C.GREEN, G.C.GREY, 0.4), button = 'loc_survey', shadow = true}, nodes={
{n=G.UIT.O, config={object = discord}},
{n=G.UIT.T, config={text = G.LANG.button, scale = 0.45, colour = G.C.UI.TEXT_LIGHT, shadow = true}}
}},
}}
}} or nil
}})
return t
end

View File

@@ -1169,7 +1169,7 @@ G.FUNCS.apply_window_changes = function(_initial)
vsync = G.SETTINGS.WINDOW.vsync,
resizable = true,
display = G.SETTINGS.WINDOW.selected_display,
highdpi = true
highdpi = (love.system.getOS() == 'OS X')
})
G.SETTINGS.QUEUED_CHANGE = {}
if _initial ~= true then
@@ -1215,7 +1215,7 @@ G.FUNCS.RUN_SETUP_check_back = function(e)
end
G.FUNCS.RUN_SETUP_check_back_name = function(e)
if G.GAME.viewed_back.name ~= e.config.id then
if e.config.object and G.GAME.viewed_back.name ~= e.config.id then
--removes the UI from the previously selected back and adds the new one
e.config.object:remove()
@@ -2085,8 +2085,8 @@ end
end
G.FUNCS.can_skip_booster = function(e)
if G.pack_cards and G.pack_cards.cards[1] and
(G.STATE == G.STATES.PLANET_PACK or G.STATE == G.STATES.STANDARD_PACK or G.STATE == G.STATES.BUFFOON_PACK or (G.hand and G.hand.cards[1])) then
if G.pack_cards and (G.pack_cards.cards[1]) and
(G.STATE == G.STATES.PLANET_PACK or G.STATE == G.STATES.STANDARD_PACK or G.STATE == G.STATES.BUFFOON_PACK or (G.hand and (G.hand.cards[1] or (G.hand.config.card_limit <= 0)))) then
e.config.colour = G.C.GREY
e.config.button = 'skip_booster'
else
@@ -2458,11 +2458,6 @@ end
G.SHOP_SIGN = nil
G.STATE_COMPLETE = false
G.STATE = G.STATES.BLIND_SELECT
if G.GAME.round_resets.blind_states.Boss == 'Defeated' then
G.GAME.round_resets.blind_ante = G.GAME.round_resets.ante
G.GAME.round_resets.blind_tags.Small = get_next_tag_key()
G.GAME.round_resets.blind_tags.Big = get_next_tag_key()
end
G.CONTROLLER.locks.toggle_shop = nil
return true
end
@@ -2906,6 +2901,12 @@ G.FUNCS.cash_out = function(e)
G.VIBRATION = G.VIBRATION + 1
end
ease_chips(0)
if G.GAME.round_resets.blind_states.Boss == 'Defeated' then
G.GAME.round_resets.blind_ante = G.GAME.round_resets.ante
G.GAME.round_resets.blind_tags.Small = get_next_tag_key()
G.GAME.round_resets.blind_tags.Big = get_next_tag_key()
end
reset_blinds()
delay(0.6)
end

View File

@@ -843,8 +843,8 @@ function card_eval_status_text(card, eval_type, amt, percent, dir, extra)
elseif eval_type == 'dollars' then
sound = 'coin3'
amt = amt
text = localize("$")..tostring(amt)
colour = G.C.MONEY
text = (amt <-0.01 and '-' or '')..localize("$")..tostring(math.abs(amt))
colour = amt <-0.01 and G.C.RED or G.C.MONEY
elseif eval_type == 'swap' then
sound = 'generic1'
amt = amt
@@ -877,7 +877,7 @@ function card_eval_status_text(card, eval_type, amt, percent, dir, extra)
end
delay = delay*1.25
if amt > 0 then
if amt > 0 or amt < 0 then
if extra and extra.instant then
if extrafunc then extrafunc() end
attention_text({
@@ -1127,16 +1127,16 @@ end
function update_canvas_juice(dt)
G.JIGGLE_VIBRATION = G.ROOM.jiggle or 0
if not G.SETTINGS.screenshake or (type(G.SETTINGS.screenshake) ~= 'number') then
G.SETTINGS.screenshake = 50
G.SETTINGS.screenshake = G.SETTINGS.reduced_motion and 0 or 50
end
local shake_amt = math.max(0,G.SETTINGS.screenshake-30)/100
local shake_amt = (G.SETTINGS.reduced_motion and 0 or 1)*math.max(0,G.SETTINGS.screenshake-30)/100
G.ARGS.eased_cursor_pos = G.ARGS.eased_cursor_pos or {x=G.CURSOR.T.x,y=G.CURSOR.T.y, sx = G.CONTROLLER.cursor_position.x, sy = G.CONTROLLER.cursor_position.y}
G.ARGS.eased_cursor_pos.x = G.ARGS.eased_cursor_pos.x*(1-3*dt) + 3*dt*(shake_amt*G.CURSOR.T.x + (1-shake_amt)*G.ROOM.T.w/2)
G.ARGS.eased_cursor_pos.y = G.ARGS.eased_cursor_pos.y*(1-3*dt) + 3*dt*(shake_amt*G.CURSOR.T.y + (1-shake_amt)*G.ROOM.T.h/2)
G.ARGS.eased_cursor_pos.sx = G.ARGS.eased_cursor_pos.sx*(1-3*dt) + 3*dt*(shake_amt*G.CONTROLLER.cursor_position.x + (1-shake_amt)*G.WINDOWTRANS.real_window_w/2)
G.ARGS.eased_cursor_pos.sy = G.ARGS.eased_cursor_pos.sy*(1-3*dt) + 3*dt*(shake_amt*G.CONTROLLER.cursor_position.y + (1-shake_amt)*G.WINDOWTRANS.real_window_h/2)
shake_amt = G.SETTINGS.screenshake/100*3
shake_amt = (G.SETTINGS.reduced_motion and 0 or 1)*G.SETTINGS.screenshake/100*3
if shake_amt < 0.05 then shake_amt = 0 end
G.ROOM.jiggle = (G.ROOM.jiggle or 0)*(1-5*dt)*(shake_amt > 0.05 and 1 or 0)
@@ -1942,6 +1942,10 @@ function create_playing_card(card_init, area, skip_materialize, silent, colours)
end
function get_pack(_key, _type)
if not G.GAME.first_shop_buffoon and not G.GAME.banned_keys['p_buffoon_normal_1'] then
G.GAME.first_shop_buffoon = true
return G.P_CENTERS['p_buffoon_normal_'..(math.random(1, 2))]
end
local cume, it, center = 0, 0, nil
for k, v in ipairs(G.P_CENTER_POOLS['Booster']) do
if (not _type or _type == v.kind) and not G.GAME.banned_keys[v.key] then cume = cume + (v.weight or 1 ) end
@@ -1964,7 +1968,7 @@ function get_current_pool(_type, _rarity, _legendary, _append)
if _type == 'Joker' then
local rarity = _rarity or pseudorandom('rarity'..G.GAME.round_resets.ante..(_append or ''))
rarity = (_legendary and 4) or (rarity > 0.95 and 3) or (rarity > 0.7 and 2) or 1
_starting_pool, _pool_key = G.P_JOKER_RARITY_POOLS[rarity], 'Joker'..rarity..(_append or '')
_starting_pool, _pool_key = G.P_JOKER_RARITY_POOLS[rarity], 'Joker'..rarity..((not _legendary and _append) or '')
else _starting_pool, _pool_key = G.P_CENTER_POOLS[_type], _type..(_append or '')
end
@@ -2034,7 +2038,7 @@ function get_current_pool(_type, _rarity, _legendary, _append)
--if pool is empty
if _pool_size == 0 then
_pool = EMPTY(G.ARGS.TEMP_POOL)
if _type == 'Tarot' or _type == 'Tarot_Planet' then _pool[#_pool + 1] = "c_fool"
if _type == 'Tarot' or _type == 'Tarot_Planet' then _pool[#_pool + 1] = "c_strength"
elseif _type == 'Planet' then _pool[#_pool + 1] = "c_pluto"
elseif _type == 'Spectral' then _pool[#_pool + 1] = "c_incantation"
elseif _type == 'Joker' then _pool[#_pool + 1] = "j_joker"
@@ -2045,7 +2049,7 @@ function get_current_pool(_type, _rarity, _legendary, _append)
end
end
return _pool, _pool_key..G.GAME.round_resets.ante
return _pool, _pool_key..(not _legendary and G.GAME.round_resets.ante or '')
end
function poll_edition(_key, _mod, _no_neg, _guaranteed)
@@ -2130,9 +2134,15 @@ function create_card(_type, area, legendary, _rarity, skip_materialize, soulable
if G.GAME.modifiers.all_eternal then
card:set_eternal(true)
end
if area == G.shop_jokers then
if G.GAME.modifiers.enable_eternals_in_shop and pseudorandom('stake_shop_joker_eternal'..G.GAME.round_resets.ante) > 0.7 then
if (area == G.shop_jokers) or (area == G.pack_cards) then
local eternal_perishable_poll = pseudorandom((area == G.pack_cards and 'packetper' or 'etperpoll')..G.GAME.round_resets.ante)
if G.GAME.modifiers.enable_eternals_in_shop and eternal_perishable_poll > 0.7 then
card:set_eternal(true)
elseif G.GAME.modifiers.enable_perishables_in_shop and ((eternal_perishable_poll > 0.4) and (eternal_perishable_poll <= 0.7)) then
card:set_perishable(true)
end
if G.GAME.modifiers.enable_rentals_in_shop and pseudorandom((area == G.pack_cards and 'packssjr' or 'ssjr')..G.GAME.round_resets.ante) > 0.7 then
card:set_rental(true)
end
end
@@ -2291,7 +2301,11 @@ function reset_mail_rank()
end
function reset_ancient_card()
local ancient_card = pseudorandom_element({'Spades','Hearts','Clubs','Diamonds'}, pseudoseed('anc'..G.GAME.round_resets.ante))
local ancient_suits = {}
for k, v in ipairs({'Spades','Hearts','Clubs','Diamonds'}) do
if v ~= G.GAME.current_round.ancient_card.suit then ancient_suits[#ancient_suits + 1] = v end
end
local ancient_card = pseudorandom_element(ancient_suits, pseudoseed('anc'..G.GAME.round_resets.ante))
G.GAME.current_round.ancient_card.suit = ancient_card
end
@@ -2309,6 +2323,18 @@ function reset_castle_card()
end
end
function reset_blinds()
G.GAME.round_resets.blind_states = G.GAME.round_resets.blind_states or {Small = 'Select', Big = 'Upcoming', Boss = 'Upcoming'}
if G.GAME.round_resets.blind_states.Boss == 'Defeated' then
G.GAME.round_resets.blind_states.Small = 'Upcoming'
G.GAME.round_resets.blind_states.Big = 'Upcoming'
G.GAME.round_resets.blind_states.Boss = 'Upcoming'
G.GAME.blind_on_deck = 'Small'
G.GAME.round_resets.blind_choices.Boss = get_new_boss()
G.GAME.round_resets.boss_rerolled = false
end
end
function get_new_boss()
G.GAME.perscribed_bosses = G.GAME.perscribed_bosses or {
}
@@ -2330,6 +2356,9 @@ function get_new_boss()
eligible_bosses[k] = true
end
end
for k, v in pairs(G.GAME.banned_keys) do
if eligible_bosses[k] then eligible_bosses[k] = nil end
end
local min_use = 100
for k, v in pairs(G.GAME.bosses_used) do
@@ -2415,7 +2444,7 @@ function generate_card_ui(_c, full_UI_table, specific_vars, card_type, badges, h
end
if _c.set == 'Other' then
localize{type = 'other', key = _c.key, nodes = desc_nodes, vars = specific_vars}
localize{type = 'other', key = _c.key, nodes = desc_nodes, vars = specific_vars or _c.vars}
elseif card_type == 'Locked' then
if _c.wip then localize{type = 'other', key = 'wip_locked', set = 'Other', nodes = desc_nodes, vars = loc_vars}
elseif _c.demo and specific_vars then localize{type = 'other', key = 'demo_shop_locked', nodes = desc_nodes, vars = loc_vars}
@@ -2702,6 +2731,8 @@ function generate_card_ui(_c, full_UI_table, specific_vars, card_type, badges, h
if v == 'red_seal' then info_queue[#info_queue+1] = {key = 'red_seal', set = 'Other'} end
if v == 'purple_seal' then info_queue[#info_queue+1] = {key = 'purple_seal', set = 'Other'} end
if v == 'eternal' then info_queue[#info_queue+1] = {key = 'eternal', set = 'Other'} end
if v == 'perishable' then info_queue[#info_queue+1] = {key = 'perishable', set = 'Other', vars = {G.GAME.perishable_rounds or 1, specific_vars.perish_tally or G.GAME.perishable_rounds}} end
if v == 'rental' then info_queue[#info_queue+1] = {key = 'rental', set = 'Other', vars = {G.GAME.rental_rate or 1}} end
if v == 'pinned_left' then info_queue[#info_queue+1] = {key = 'pinned_left', set = 'Other'} end
end
end

View File

@@ -61,6 +61,7 @@ function GET_DISPLAYINFO(screenmode, display)
end
function timer_checkpoint(label, type, reset)
G.PREV_GARB = G.PREV_GARB or 0
if not G.F_ENABLE_PERF_OVERLAY then return end
G.check = G.check or {
draw = {
@@ -83,7 +84,7 @@ function timer_checkpoint(label, type, reset)
cp.checkpoint_list[cp.checkpoints+1] = cp.checkpoint_list[cp.checkpoints+1] or {}
cp.checkpoints = cp.checkpoints+1
cp.checkpoint_list[cp.checkpoints].label = label
cp.checkpoint_list[cp.checkpoints].label = label..': '..(collectgarbage( "count" ) - G.PREV_GARB)
cp.checkpoint_list[cp.checkpoints].time = love.timer.getTime()
cp.checkpoint_list[cp.checkpoints].TTC = cp.checkpoint_list[cp.checkpoints].time - cp.last_time
cp.checkpoint_list[cp.checkpoints].trend = cp.checkpoint_list[cp.checkpoints].trend or {}
@@ -93,7 +94,7 @@ function timer_checkpoint(label, type, reset)
cp.checkpoint_list[cp.checkpoints].trend[401] = nil
cp.checkpoint_list[cp.checkpoints].states[401] = nil
cp.last_time = cp.checkpoint_list[cp.checkpoints].time
G.PREV_GARB = collectgarbage( "count" )
local av = 0
for k, v in ipairs(cp.checkpoint_list[cp.checkpoints].trend) do
av = av + v/#cp.checkpoint_list[cp.checkpoints].trend
@@ -215,6 +216,40 @@ function pseudoshuffle(list, seed)
end
end
function generate_starting_seed()
if G.GAME.stake >= 8 then
local r_leg, r_tally = {}, 0
local g_leg, g_tally = {}, 0
for k, v in pairs(G.P_JOKER_RARITY_POOLS[4]) do
local win_ante = get_joker_win_sticker(v, true)
if win_ante and (win_ante >= 8) then
g_leg[v.key] = true
g_tally = g_tally + 1
else
r_leg[v.key] = true
r_tally = r_tally + 1
end
end
if r_tally > 0 and g_tally > 0 then
local seed_found = nil
local extra_num = 0
while not seed_found do
extra_num = extra_num + 0.561892350821
seed_found = random_string(8, extra_num + G.CONTROLLER.cursor_hover.T.x*0.33411983 + G.CONTROLLER.cursor_hover.T.y*0.874146 + 0.412311010*G.CONTROLLER.cursor_hover.time)
if not r_leg[get_first_legendary(seed_found)] then seed_found = nil end
end
return seed_found
end
end
return random_string(8, G.CONTROLLER.cursor_hover.T.x*0.33411983 + G.CONTROLLER.cursor_hover.T.y*0.874146 + 0.412311010*G.CONTROLLER.cursor_hover.time)
end
function get_first_legendary(_key)
local _t, key = pseudorandom_element(G.P_JOKER_RARITY_POOLS[4], pseudoseed('Joker4', _key))
return _t.key
end
function pseudorandom_element(_t, seed)
if seed then math.randomseed(seed) end
local keys = {}
@@ -260,8 +295,14 @@ function pseudohash(str)
end
end
function pseudoseed(key)
function pseudoseed(key, predict_seed)
if key == 'seed' then return math.random() end
if predict_seed then
local _pseed = pseudohash(key..(predict_seed or ''))
_pseed = math.abs(tonumber(string.format("%.13f", (2.134453429141+_pseed*1.72431234)%1)))
return (_pseed + (pseudohash(predict_seed) or 0))/2
end
if not G.GAME.pseudorandom[key] then
G.GAME.pseudorandom[key] = pseudohash(key..(G.GAME.pseudorandom.seed or ''))
@@ -350,15 +391,25 @@ function evaluate_poker_hand(hand)
top = nil
}
if next(get_X_same(5,hand)) and next(get_flush(hand)) then
results["Flush Five"] = get_X_same(5,hand)
local parts = {
_5 = get_X_same(5,hand),
_4 = get_X_same(4,hand),
_3 = get_X_same(3,hand),
_2 = get_X_same(2,hand),
_flush = get_flush(hand),
_straight = get_straight(hand),
_highest = get_highest(hand)
}
if next(parts._5) and next(parts._flush) then
results["Flush Five"] = parts._5
if not results.top then results.top = results["Flush Five"] end
end
if next(get_X_same(3,hand)) and next(get_X_same(2,hand)) and next(get_flush(hand)) then
if next(parts._3) and next(parts._2) and next(parts._flush) then
local fh_hand = {}
local fh_3 = get_X_same(3,hand)[1]
local fh_2 = get_X_same(2,hand)[1]
local fh_3 = parts._3[1]
local fh_2 = parts._2[1]
for i=1, #fh_3 do
fh_hand[#fh_hand+1] = fh_3[i]
end
@@ -369,13 +420,13 @@ function evaluate_poker_hand(hand)
if not results.top then results.top = results["Flush House"] end
end
if next(get_X_same(5,hand)) then
results["Five of a Kind"] = get_X_same(5,hand)
if next(parts._5) then
results["Five of a Kind"] = parts._5
if not results.top then results.top = results["Five of a Kind"] end
end
if next(get_flush(hand)) and next(get_straight(hand)) then
local _s, _f, ret = get_straight(hand), get_flush(hand), {}
if next(parts._flush) and next(parts._straight) then
local _s, _f, ret = parts._straight, parts._flush, {}
for _, v in ipairs(_f[1]) do
ret[#ret+1] = v
end
@@ -391,15 +442,15 @@ function evaluate_poker_hand(hand)
if not results.top then results.top = results["Straight Flush"] end
end
if next(get_X_same(4,hand)) then
results["Four of a Kind"] = get_X_same(4,hand)
if next(parts._4) then
results["Four of a Kind"] = parts._4
if not results.top then results.top = results["Four of a Kind"] end
end
if next(get_X_same(3,hand)) and next(get_X_same(2,hand)) then
if next(parts._3) and next(parts._2) then
local fh_hand = {}
local fh_3 = get_X_same(3,hand)[1]
local fh_2 = get_X_same(2,hand)[1]
local fh_3 = parts._3[1]
local fh_2 = parts._2[1]
for i=1, #fh_3 do
fh_hand[#fh_hand+1] = fh_3[i]
end
@@ -410,26 +461,29 @@ function evaluate_poker_hand(hand)
if not results.top then results.top = results["Full House"] end
end
if next(get_flush(hand)) then
results["Flush"] = get_flush(hand)
if next(parts._flush) then
results["Flush"] = parts._flush
if not results.top then results.top = results["Flush"] end
end
if next(get_straight(hand)) then
results["Straight"] = get_straight(hand)
if next(parts._straight) then
results["Straight"] = parts._straight
if not results.top then results.top = results["Straight"] end
end
if next(get_X_same(3,hand)) then
results["Three of a Kind"] = get_X_same(3,hand)
if next(parts._3) then
results["Three of a Kind"] = parts._3
if not results.top then results.top = results["Three of a Kind"] end
end
if #get_X_same(2,hand) == 2 then
if (#parts._2 == 2) or (#parts._3 == 1 and #parts._2 == 1) then
local fh_hand = {}
local r = get_X_same(2,hand)
local r = parts._2
local fh_2a = r[1]
local fh_2b = r[2]
if not fh_2b then
fh_2b = parts._3[1]
end
for i=1, #fh_2a do
fh_hand[#fh_hand+1] = fh_2a[i]
end
@@ -440,13 +494,13 @@ function evaluate_poker_hand(hand)
if not results.top then results.top = results["Two Pair"] end
end
if next(get_X_same(2,hand)) then
results["Pair"] = get_X_same(2,hand)
if next(parts._2) then
results["Pair"] = parts._2
if not results.top then results.top = results["Pair"] end
end
if next(get_highest(hand)) then
results["High Card"] = get_highest(hand)
if next(parts._highest) then
results["High Card"] = parts._highest
if not results.top then results.top = results["High Card"] end
end
@@ -570,6 +624,47 @@ function reset_drawhash()
G.DRAW_HASH = EMPTY(G.DRAW_HASH)
end
--Copyright 2021 Max Cahill (Zlib license)
--
--This software is provided 'as-is', without any express or implied
--warranty. In no event will the authors be held liable for any damages
--arising from the use of this software.
--
--Permission is granted to anyone to use this software for any purpose,
--including commercial applications, and to alter it and redistribute it
--freely, subject to the following restrictions:
--
--1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--3. This notice may not be removed or altered from any source distribution.
--This function was slightly modified from it's original state
function nuGC(time_budget, memory_ceiling, disable_otherwise)
time_budget = time_budget or 3e-4
memory_ceiling = memory_ceiling or 300
local max_steps = 1000
local steps = 0
local start_time = love.timer.getTime()
while
love.timer.getTime() - start_time < time_budget and
steps < max_steps
do
collectgarbage("step", 1)
steps = steps + 1
end
--safety net
if collectgarbage("count") / 1024 > memory_ceiling then
collectgarbage("collect")
end
--don't collect gc outside this margin
if disable_otherwise then
collectgarbage("stop")
end
end
--The drawhash is a hash table of all drawn nodes and all nodes that may be invisible but still collide with the cursor
function add_to_drawhash(obj)
if obj then
@@ -599,7 +694,7 @@ end
function play_sound(sound_code, per, vol)
if G.F_MUTE then return end
if sound_code and not G.muted and G.SETTINGS.SOUND.volume > 0 then
if sound_code and G.SETTINGS.SOUND.volume > 0.001 then
G.ARGS.play_sound = G.ARGS.play_sound or {}
G.ARGS.play_sound.type = 'sound'
G.ARGS.play_sound.time = G.TIMERS.REAL
@@ -825,7 +920,7 @@ function get_blind_amount(ante)
local k = 0.75
if not G.GAME.modifiers.scaling or G.GAME.modifiers.scaling == 1 then
local amounts = {
300, 800, 2800, 6000, 11000, 20000, 35000, 50000
300, 800, 2000, 5000, 11000, 20000, 35000, 50000
}
if ante < 1 then return 100 end
if ante <= 8 then return amounts[ante] end
@@ -835,7 +930,8 @@ function get_blind_amount(ante)
return amount
elseif G.GAME.modifiers.scaling == 2 then
local amounts = {
300, 1000, 3200, 9000, 18000, 32000, 56000, 90000
300, 900, 2600, 8000, 20000, 36000, 60000, 100000
--300, 900, 2400, 7000, 18000, 32000, 56000, 90000
}
if ante < 1 then return 100 end
if ante <= 8 then return amounts[ante] end
@@ -845,7 +941,8 @@ function get_blind_amount(ante)
return amount
elseif G.GAME.modifiers.scaling == 3 then
local amounts = {
300, 1200, 3600, 10000, 25000, 50000, 90000, 180000
300, 1000, 3200, 9000, 25000, 60000, 110000, 200000
--300, 1000, 3000, 8000, 22000, 50000, 90000, 180000
}
if ante < 1 then return 100 end
if ante <= 8 then return amounts[ante] end
@@ -1347,7 +1444,6 @@ function recursive_table_cull(t)
end
function save_with_action(action)
print('SAVE WITH ACTION')
G.action = action
save_run()
G.action = nil
@@ -1460,6 +1556,7 @@ function init_localization()
for _, set in pairs(group) do
for _, center in pairs(set) do
center.text_parsed = {}
if not center.text then else
for _, line in ipairs(center.text) do
center.text_parsed[#center.text_parsed+1] = loc_parse_string(line)
end
@@ -1474,6 +1571,7 @@ function init_localization()
end
end
end
end
end
end
end
@@ -1661,6 +1759,7 @@ function localize(args, misc_cat)
assembled_string = assembled_string..(type(subpart) == 'string' and subpart or args.vars[tonumber(subpart[1])] or 'ERROR')
end
local desc_scale = G.LANG.font.DESCSCALE
if G.F_MOBILE_UI then desc_scale = desc_scale*1.5 end
if args.type == 'name' then
final_line[#final_line+1] = {n=G.UIT.O, config={
object = DynaText({string = {assembled_string},
@@ -1673,7 +1772,7 @@ function localize(args, misc_cat)
shadow = true,
y_offset = -0.6,
spacing = math.max(0, 0.32*(17 - #assembled_string)),
scale = (0.55 - 0.004*#assembled_string)*(part.control.s and tonumber(part.control.s) or 1)*desc_scale
scale = (0.55 - 0.004*#assembled_string)*(part.control.s and tonumber(part.control.s) or 1)
})
}}
elseif part.control.E then

View File

@@ -101,6 +101,8 @@ function end_round()
end
card_eval_status_text(G.jokers.cards[i], 'jokers', nil, nil, nil, eval)
end
G.jokers.cards[i]:calculate_rental()
G.jokers.cards[i]:calculate_perishable()
end
if G.GAME.round_resets.ante == G.GAME.win_ante and G.GAME.blind:get_type() == 'Boss' then
game_won = true
@@ -736,6 +738,7 @@ G.FUNCS.evaluate_play = function(e)
hand_chips = mod_chips(old_mult)
extras.hand_chips = true; extras.mult = true
end
if effects[ii].extra.func then effects[ii].extra.func() end
update_hand_text({delay = 0}, {chips = extras.hand_chips and hand_chips, mult = extras.mult and mult})
card_eval_status_text(scoring_hand[i], 'extra', nil, percent, nil, effects[ii].extra)
end

View File

@@ -1,5 +1,4 @@
function live_test()
end
function do_action(action)