Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion localization/en-us.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion localization/es_419.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion localization/es_ES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion localization/fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 à",
},
Expand Down
1 change: 0 additions & 1 deletion localization/it.lua
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,6 @@ return {
"nemico",
},
ml_mp_kofi_message = {
" ",
" ",
"Questa mod e server è sviluppata e mantenuta",
"da una persona, se ti è piaciuta considera",
Expand Down
2 changes: 1 addition & 1 deletion localization/mi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,",
},
Expand Down
18 changes: 17 additions & 1 deletion lovely/TheOrder.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
3 changes: 2 additions & 1 deletion lovely/shared_area.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
56 changes: 32 additions & 24 deletions networking/action_handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions ui/game/game_end.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions ui/game/timer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down