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
7 changes: 6 additions & 1 deletion networking/action_handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,16 @@ 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 = 0 }
)
return
end

if MP.end_game_jokers.cards then
for _, card in pairs(MP.end_game_jokers.cards) do
card.mp_end_game_display = true
end
end
-- Log the jokers
if MP.end_game_jokers.cards then
local jokers_str = ""
Expand Down
34 changes: 28 additions & 6 deletions overrides/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,41 @@ end

local sell_card_ref = Card.sell_card
function Card:sell_card()
if self.ability and self.ability.name then
sendTraceMessage(
string.format("Client sent message: action:soldCard,card:%s", self.ability.name),
"MULTIPLAYER"
)
if self.mp_end_game_display then
return
end

if self.mp_end_game_display then
return
end

if self.ability and self.ability.name then
sendTraceMessage(
string.format("Client sent message: action:soldCard,card:%s", self.ability.name),
"MULTIPLAYER"
)
end

return sell_card_ref(self)
end


local can_sell_ref = Card.can_sell_card
function Card:can_sell_card(...)
if self.mp_end_game_display then
return false
end

return can_sell_card_ref(self, ...)
end

local reroll_shop_ref = G.FUNCS.reroll_shop
function G.FUNCS.reroll_shop(e)
sendTraceMessage(
string.format("Client sent message: action:rerollShop,cost:%s", G.GAME.current_round.reroll_cost),
"MULTIPLAYER"
)

-- Update reroll stats if in a multiplayer game
if MP.LOBBY.code and MP.GAME.stats then
MP.GAME.stats.reroll_count = MP.GAME.stats.reroll_count + 1
MP.GAME.stats.reroll_cost_total = MP.GAME.stats.reroll_cost_total + G.GAME.current_round.reroll_cost
Expand All @@ -42,12 +60,14 @@ end
local buy_from_shop_ref = G.FUNCS.buy_from_shop
function G.FUNCS.buy_from_shop(e)
local c1 = e.config.ref_table

if c1 and c1:is(Card) then
sendTraceMessage(
string.format("Client sent message: action:boughtCardFromShop,card:%s,cost:%s", c1.ability.name, c1.cost),
"MULTIPLAYER"
)
end

return buy_from_shop_ref(e)
end

Expand All @@ -59,6 +79,7 @@ function G.FUNCS.use_card(e, mute, nosave)
"MULTIPLAYER"
)
end

return use_card_ref(e, mute, nosave)
end

Expand All @@ -69,5 +90,6 @@ G.FUNCS.evaluate_round = function()
G.after_pvp = nil
SMODS.calculate_context({ mp_end_of_pvp = true })
end

evaluate_round_ref()
end
7 changes: 6 additions & 1 deletion ui/game/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ function G.FUNCS.toggle_players_jokers()
if MP.end_game_jokers_text == localize("k_enemy_jokers") then
local your_jokers_save = copy_table(G.jokers:save())
MP.end_game_jokers:load(your_jokers_save)

for _, card in pairs(MP.end_game_jokers.cards or {}) do
card.mp_end_game_display = true
end

MP.end_game_jokers_text = localize("k_your_jokers")
else
if MP.end_game_jokers_received then
Expand All @@ -105,10 +110,10 @@ function G.FUNCS.toggle_players_jokers()
if MP.end_game_jokers.cards then remove_all(MP.end_game_jokers.cards) end
MP.end_game_jokers.cards = {}
end

MP.end_game_jokers_text = localize("k_enemy_jokers")
end
end

function G.FUNCS.view_nemesis_deck()
G.SETTINGS.paused = true
if G.deck_preview then
Expand Down
2 changes: 1 addition & 1 deletion ui/game/game_end.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,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 = 0 }
)
if not MP.end_game_jokers_received then
MP.ACTIONS.get_end_game_jokers()
Expand Down
Loading