diff --git a/localization/en-us.lua b/localization/en-us.lua index 99ddfdc3..06372052 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -1418,7 +1418,7 @@ return { k_timer_sfx = "Timer Sound Effects", ml_mp_kofi_message = { "This mod and game server is", - "developed and maintained by ", + "developed and maintained by", "one person, if", "you like it consider", }, diff --git a/localization/es_419.lua b/localization/es_419.lua index da833e4b..921f7aad 100644 --- a/localization/es_419.lua +++ b/localization/es_419.lua @@ -841,7 +841,7 @@ return { }, ml_mp_kofi_message = { "Este mod y sus servidores son", - "desarrollados y mantenidos por ", + "desarrollados y mantenidos por", "una sola persona, si te gusta", "puedes considerar", }, diff --git a/localization/es_ES.lua b/localization/es_ES.lua index cf281b4a..76fd47d0 100644 --- a/localization/es_ES.lua +++ b/localization/es_ES.lua @@ -261,7 +261,7 @@ return { }, ml_mp_kofi_message = { "Este mod y servidor es", - "desarrollado y mantenido por ", + "desarrollado y mantenido por", "una persona, sí", "te gusta, considera", }, diff --git a/localization/fr.lua b/localization/fr.lua index 4844f114..192d9a18 100644 --- a/localization/fr.lua +++ b/localization/fr.lua @@ -286,7 +286,7 @@ return { }, ml_mp_kofi_message = { "Ce mod et serveur de jeu est", - "développé et maintenu par ", + "développé et maintenu par", "une seule personne, si", "vous l'aimez, n'hésitez pas à", }, diff --git a/localization/it.lua b/localization/it.lua index 6c77895c..dc90d661 100644 --- a/localization/it.lua +++ b/localization/it.lua @@ -646,7 +646,6 @@ return { "nemico", }, ml_mp_kofi_message = { - " ", " ", "Questa mod e server è sviluppata e mantenuta", "da una persona, se ti è piaciuta considera", diff --git a/localization/mi.lua b/localization/mi.lua index bf1ed58c..b42cd9de 100644 --- a/localization/mi.lua +++ b/localization/mi.lua @@ -243,7 +243,7 @@ return { }, ml_mp_kofi_message = { "Kōtahi anake te tāngata e", - "whakahaere, e tuarā ana ", + "whakahaere, e tuarā ana", "i te Balatro Multiplayer.", "Mēnā e pīrangi ana,", }, diff --git a/lovely/TheOrder.toml b/lovely/TheOrder.toml index 67bca2a2..cd4584f9 100644 --- a/lovely/TheOrder.toml +++ b/lovely/TheOrder.toml @@ -203,4 +203,20 @@ if MP.should_use_the_order() then _poker_hands = MP.sorted_hand_list(self.ability.to_do_poker_hand) end ''' -match_indent = true \ No newline at end of file +match_indent = true + +# STEAMODDED BUG - fix for certificate calling pseudorandom for no reason +[[patches]] +[patches.pattern] +target = '''=[SMODS _ "src/utils.lua"]''' +pattern = ''' +local seal_poll = pseudorandom(pseudoseed(key or 'stdseal'..G.GAME.round_resets.ante)) +if seal_poll > 1 - (type_weight*mod / total_weight) or guaranteed then -- is a seal generated +''' +position = 'at' +payload = ''' +local seal_poll = guaranteed and 1 or pseudorandom(pseudoseed(key or 'stdseal'..G.GAME.round_resets.ante)) +if seal_poll > 1 - (type_weight*mod / total_weight) then -- is a seal generated +''' +match_indent = true +times = 1 \ No newline at end of file diff --git a/lovely/shared_area.toml b/lovely/shared_area.toml index f142500f..19d223c0 100644 --- a/lovely/shared_area.toml +++ b/lovely/shared_area.toml @@ -13,7 +13,7 @@ payload = '''if MP.LOBBY.code then 0, CAI.consumeable_H + 0.3, CAI.consumeable_W / 2, CAI.consumeable_H, - {card_limit = 0, type = 'joker', highlight_limit = 1}) + {card_limit = 0, type = 'joker', highlight_limit = 1, fixed_limit = true}) elseif MP.shared then MP.shared:remove() MP.shared = nil @@ -29,6 +29,7 @@ position = 'after' payload = '''if MP.shared then MP.shared.T.x = G.consumeables.T.x + (G.consumeables.T.w / 2) MP.shared.T.y = G.consumeables.T.y + G.consumeables.T.h + 0.4 + MP.shared:hard_set_T() end ''' match_indent = true diff --git a/networking/action_handlers.lua b/networking/action_handlers.lua index c84ef6eb..ebae5f38 100644 --- a/networking/action_handlers.lua +++ b/networking/action_handlers.lua @@ -756,7 +756,7 @@ function G.FUNCS.load_end_game_jokers() 0, 5 * G.CARD_W, G.CARD_H, - { card_limit = G.GAME.starting_params.joker_slots, type = "joker", highlight_limit = 1 } + { card_limit = G.GAME.starting_params.joker_slots, type = "joker", highlight_limit = 1, fixed_limit = true } ) return end @@ -1377,13 +1377,15 @@ function MP.register_action(name, cb) HANDLERS[name] = cb end +local network_to_ui_channel = love.thread.getChannel("networkToUi") + local game_update_ref = Game.update ---@diagnostic disable-next-line: duplicate-set-field function Game:update(dt) game_update_ref(self, dt) repeat - local msg = love.thread.getChannel("networkToUi"):pop() + local msg = network_to_ui_channel:pop() if msg then -- horribly messy catch if string.sub(msg, 1, 1) == "a" then @@ -1398,28 +1400,34 @@ function Game:update(dt) return end - local parsedAction = json.decode(msg) - - if not ((parsedAction.action == "keepAlive") or (parsedAction.action == "keepAliveAck")) then - local log = string.format("Client got %s message: ", parsedAction.action) - for k, v in pairs(parsedAction) do - if parsedAction.action == "startGame" and k == "seed" then - last_game_seed = v - else - log = log .. string.format(" (%s: %s) ", k, v) - end - end - if - (parsedAction.action == "receiveEndGameJokers" or parsedAction.action == "stopGame") - and last_game_seed - then - log = log .. string.format(" (seed: %s) ", last_game_seed) - end - sendTraceMessage(log, "MULTIPLAYER") - end - - local handler = HANDLERS[parsedAction.action] - if handler then handler(parsedAction) end + local ok, parsedAction = pcall(json.decode, msg) + if ok then + if not ((parsedAction.action == "keepAlive") or (parsedAction.action == "keepAliveAck")) then + local log = string.format("Client got %s message: ", parsedAction.action) + for k, v in pairs(parsedAction) do + if parsedAction.action == "startGame" and k == "seed" then + last_game_seed = v + else + log = log .. string.format(" (%s: %s) ", k, v) + end + end + if + (parsedAction.action == "receiveEndGameJokers" or parsedAction.action == "stopGame") + and last_game_seed + then + log = log .. string.format(" (seed: %s) ", last_game_seed) + end + sendTraceMessage(log, "MULTIPLAYER") + end + + local handler = HANDLERS[parsedAction.action] + if handler then handler(parsedAction) end + else + sendWarnMessage( + "Invalid server response: " .. msg, + "MULTIPLAYER" + ) + end end until not msg end diff --git a/ui/game/game_end.lua b/ui/game/game_end.lua index 63a45f72..746c8d45 100644 --- a/ui/game/game_end.lua +++ b/ui/game/game_end.lua @@ -47,7 +47,7 @@ function MP.UI.create_UIBox_mp_game_end(has_won) 0, 5 * G.CARD_W, G.CARD_H, - { card_limit = G.GAME.starting_params.joker_slots, type = "joker", highlight_limit = 1 } + { card_limit = G.GAME.starting_params.joker_slots, type = "joker", highlight_limit = 1, fixed_limit = true } ) if not MP.end_game_jokers_received then MP.ACTIONS.get_end_game_jokers() @@ -305,7 +305,7 @@ function MP.UI.create_UIBox_mp_game_end(has_won) { n = G.UIT.T, config = { - text = localize("ml_mp_kofi_message")[3] .. " " .. localize("ml_mp_kofi_message")[4], + text = localize("ml_mp_kofi_message")[3] .. (localize("ml_mp_kofi_message")[4] and (" " .. localize("ml_mp_kofi_message")[4]) or ""), scale = 0.35, colour = G.C.UI.TEXT_LIGHT, col = true, diff --git a/ui/game/timer.lua b/ui/game/timer.lua index 8665cc76..18b9d00d 100644 --- a/ui/game/timer.lua +++ b/ui/game/timer.lua @@ -4,6 +4,7 @@ function MP.UI.cam_timer_opponent() if not MP.LOBBY.config.timer then return false end if MP.GAME.pvp_countdown_in_progress then return false end if MP.GAME.timer <= 0 then return false end + if MP.GAME.nemesis_timer_started then return false end if MP.is_pvp_boss() and MP.is_layer_active("pvp_timer") then if G.STATE == G.STATES.ROUND_EVAL or G.STATE == G.STATES.NEW_ROUND then return false end if MP.INSANE_INT.greater_than(MP.GAME.score, MP.GAME.enemy.score) then return true end @@ -339,6 +340,7 @@ function Game:update(dt) else -- Old timer: tick when opponent timering, not in pvp if is_pvp_boss then return end + if MP.GAME.pvp_reached and MP.GAME.ready_blind and not MP.GAME.timer_started then return end if not (MP.GAME.timer_started or MP.GAME.nemesis_timer_started) then return end end