Skip to content

Commit 69e43ce

Browse files
authored
Merge pull request #216 from Brawmario/feature/rework-taxes-ante-scaling
Refactor Taxes Joker logic to track sells per ante and update multiplier calculation
2 parents 797f2f6 + 9573de2 commit 69e43ce

File tree

5 files changed

+26
-18
lines changed

5 files changed

+26
-18
lines changed

core.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function MP.reset_game_states()
105105
skips = 0,
106106
lives = MP.LOBBY.config.starting_lives,
107107
sells = 0,
108+
sells_per_ante = {},
108109
spent_in_shop = {},
109110
highest_score = MP.INSANE_INT.empty(),
110111
},

localization/en-us.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ return {
6464
j_mp_taxes = {
6565
name = "Taxes",
6666
text = {
67-
"{C:mult}+#1#{} Mult for every card your",
68-
"{X:purple,C:white}Nemesis{} {C:attention}sold{} this run, updates",
69-
"when {C:attention}PvP Blind{} is selected",
70-
"{C:inactive}(Currently {C:mult}+#2#{C:inactive} Mult,",
71-
"{C:inactive}will be at {C:mult}+#3#{C:inactive} Mult)",
67+
"Gains {C:mult}+#1#{} Mult for every card your",
68+
"{X:purple,C:white}Nemesis{} {C:attention}sold{} since last {C:attention}PvP Blind{},",
69+
"updates when {C:attention}PvP Blind{} is selected",
70+
"{C:inactive}(Currently {C:mult}+#2#{C:inactive} Mult)",
7271
},
7372
},
7473
j_mp_magnet = {

localization/pt_BR.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ return {
6868
j_mp_taxes = {
6969
name = "Impostos",
7070
text = {
71-
"{C:mult}+#1#{} Multi para cada carta seu",
72-
"{X:purple,C:white}Rival{} {C:attention}vender{} nesta partida, atualizando",
73-
"quando um {C:attention}Blind de Duelo{} for selecionado",
74-
"{C:inactive}(Atualmente {C:mult}+#2#{C:inactive} Multi,",
75-
"{C:inactive}atualizará para {C:mult}+#3#{C:inactive} Multi)",
71+
"Este Curinga ganha {C:mult}+#1#{} Multi para cada carta que seu",
72+
"{X:purple,C:white}Rival{} {C:attention}vender{} desde a última {C:attention}Blind de Duelo{},",
73+
"atualizando quando um {C:attention}Blind de Duelo{} for selecionado",
74+
"{C:inactive}(Atualmente {C:mult}+#2#{C:inactive} Multi)",
7675
},
7776
},
7877
j_mp_magnet = {

networking/action_handlers.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,9 @@ local action_asteroid = action_asteroid
409409
local function action_sold_joker()
410410
-- HACK: this action is being sent when any card is being sold, since Taxes is now reworked
411411
MP.GAME.enemy.sells = MP.GAME.enemy.sells + 1
412-
SMODS.calculate_context({ mp_sold_joker = true })
412+
MP.GAME.enemy.sells_per_ante[G.GAME.round_resets.ante] = (
413+
(MP.GAME.enemy.sells_per_ante[G.GAME.round_resets.ante] or 0) + 1
414+
)
413415
end
414416

415417
local function action_lets_go_gambling_nemesis()
@@ -565,7 +567,7 @@ local function action_send_game_stats()
565567
end
566568

567569
local stats_str = string.format("reroll_count:%d,reroll_cost_total:%d",
568-
MP.GAME.stats.reroll_count,
570+
MP.GAME.stats.reroll_count,
569571
MP.GAME.stats.reroll_cost_total)
570572

571573
-- Extract voucher keys where value is true and join them with a dash

objects/jokers/taxes.lua

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
local function calculate_taxes_mult(card)
2-
return MP.GAME.enemy.sells * card.ability.extra.mult_gain
1+
local function next_taxes_total_mult_gain(card)
2+
local sells = MP.GAME.enemy.sells_per_ante[G.GAME.round_resets.ante] or 0
3+
4+
-- If PvP hasn't been reached for the first time, accumulate sells from previous Antes
5+
if G.GAME.round_resets.ante <= MP.LOBBY.config.pvp_start_round then
6+
for i = 1, G.GAME.round_resets.ante - 1 do
7+
sells = sells + (MP.GAME.enemy.sells_per_ante[i] or 0)
8+
end
9+
end
10+
11+
return sells * card.ability.extra.mult_gain
312
end
413

514
SMODS.Atlas({
@@ -22,7 +31,7 @@ SMODS.Joker({
2231
config = { extra = { mult_gain = 4, mult = 0 } },
2332
loc_vars = function(self, info_queue, card)
2433
MP.UTILS.add_nemesis_info(info_queue)
25-
return { vars = { card.ability.extra.mult_gain, card.ability.extra.mult, calculate_taxes_mult(card) } }
34+
return { vars = { card.ability.extra.mult_gain, card.ability.extra.mult } }
2635
end,
2736
in_pool = function(self)
2837
return MP.LOBBY.code and MP.LOBBY.config.multiplayer_jokers
@@ -38,12 +47,10 @@ SMODS.Joker({
3847
and not context.blueprint
3948
and context.blind.key == "bl_mp_nemesis"
4049
then
41-
card.ability.extra.mult = calculate_taxes_mult(card)
50+
card.ability.extra.mult = card.ability.extra.mult + next_taxes_total_mult_gain(card)
4251
return {
4352
message = localize("k_filed_ex"),
4453
}
45-
elseif context.mp_sold_joker and not context.blueprint then
46-
card:juice_up()
4754
end
4855
end,
4956
mp_credits = {

0 commit comments

Comments
 (0)