diff --git a/networking/action_handlers.lua b/networking/action_handlers.lua index 2ce92cc1..c43a0d1f 100644 --- a/networking/action_handlers.lua +++ b/networking/action_handlers.lua @@ -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 = "" diff --git a/overrides/game.lua b/overrides/game.lua index 47fbe745..2e561edb 100644 --- a/overrides/game.lua +++ b/overrides/game.lua @@ -14,15 +14,34 @@ 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( @@ -30,7 +49,6 @@ function G.FUNCS.reroll_shop(e) "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 @@ -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 @@ -59,6 +79,7 @@ function G.FUNCS.use_card(e, mute, nosave) "MULTIPLAYER" ) end + return use_card_ref(e, mute, nosave) end @@ -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 diff --git a/ui/game/functions.lua b/ui/game/functions.lua index e813f7f2..c35c6d7e 100644 --- a/ui/game/functions.lua +++ b/ui/game/functions.lua @@ -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 @@ -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 diff --git a/ui/game/game_end.lua b/ui/game/game_end.lua index 8b4ba6de..d95290f8 100644 --- a/ui/game/game_end.lua +++ b/ui/game/game_end.lua @@ -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()