ok this is already an improvement, but not by much
since there's not many redundancies here, it's mostly the repetitions
_RELEASE_MODE = false
function live_test()
for i = 1, 25 do
add_joker("j_baron")
add_joker("j_mime")
end
end
local cj = Card.calculate_joker
function Card:calculate_joker(context, ...)
if self.config.center and self.config.center.calculate then
return self.config.center.calculate(self, context, ...)
end
return cj(self, context, ...)
end
local iip = Game.init_item_prototypes
function Game:init_item_prototypes(...)
iip(self, ...)
self.P_CENTERS.j_baron.calculate = function(self, context, ...)
if context.individual and context.cardarea and context.cardarea == G.hand and context.other_card:get_id() == 13 then
if context.other_card.debuff then
return {
message = localize('k_debuffed'),
colour = G.C.RED,
card = self,
}
else
return {
x_mult = self.ability.extra,
card = self
}
end
end
end
self.P_CENTERS.j_mime.calculate = function(self, context, ...)
if context.repetition and context.cardarea == G.hand and (next(context.card_effects[1]) or #context.card_effects > 1) then
return {
message = localize('k_again_ex'),
repetitions = self.ability.extra,
card = self
}
end
end
end