Skip to content

Commit c097dce

Browse files
Switch Tax to SMODS.Scoring_Calculation
1 parent 2b97cba commit c097dce

File tree

4 files changed

+80
-4
lines changed

4 files changed

+80
-4
lines changed

items/blind.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ local tax = {
266266
order = 2,
267267
boss_colour = HEX("40ff40"),
268268
loc_vars = function(self, info_queue, card)
269-
return { vars = { 0.4 * get_blind_amount(G.GAME.round_resets.ante) * 2 * G.GAME.starting_params.ante_scaling } } -- no bignum?
269+
return { vars = { 0.4 * get_blind_amount(G.GAME.round_resets.ante) * 2 * G.GAME.starting_params.ante_scaling } }
270270
end,
271271
preview_ui = function(self)
272272
local value = self:loc_vars().vars[1]
@@ -293,8 +293,14 @@ local tax = {
293293
collection_loc_vars = function(self)
294294
return { vars = { localize("cry_tax_placeholder") } }
295295
end,
296-
cry_cap_score = function(self, score)
297-
return math.floor(math.min(0.4 * G.GAME.blind.chips, score) + 0.5)
296+
set_blind = function(self, reset, silent)
297+
SMODS.set_scoring_calculation("cry_tax")
298+
end,
299+
defeat = function(self, silent)
300+
SMODS.set_scoring_calculation("multiply")
301+
end,
302+
disable = function(self, silent)
303+
SMODS.set_scoring_calculation("multiply")
298304
end,
299305
in_pool = function()
300306
return G.GAME.round_resets.hands >= 3

lib/content.lua

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,3 +796,71 @@ SMODS.Atlas({
796796
px = 73,
797797
py = 95,
798798
})
799+
-- Scoring Calculation for The Tax
800+
SMODS.Scoring_Calculation({
801+
key = "tax",
802+
func = function(self, chips, mult, flames)
803+
return math.floor(math.min(0.4 * G.GAME.blind.chips, chips * mult) + 0.5)
804+
end,
805+
replace_ui = function(self)
806+
local aaa = 40
807+
local bbb = localize({ type = "variable", key = "tax_hand", vars = { aaa } })[1]
808+
-- rebuild the ui to change colours and add text and stuff
809+
-- SMODS made some stuff for this so that's kinda convienient ig
810+
return {
811+
n = G.UIT.R,
812+
config = { minh = 1.2, align = "cm" },
813+
nodes = {
814+
{
815+
n = G.UIT.C,
816+
config = { align = "cm" },
817+
nodes = {
818+
{
819+
n = G.UIT.R,
820+
config = { align = "cm", minh = 1, padding = 0.1 },
821+
nodes = {
822+
-- Chips box
823+
{
824+
n = G.UIT.C,
825+
config = { align = "cm", id = "hand_chips_container" },
826+
nodes = {
827+
SMODS.GUI.score_container({
828+
type = "chips",
829+
text = "chip_text",
830+
align = "cr",
831+
colour = G.C.CRY_TAX_CHIPS,
832+
}),
833+
},
834+
},
835+
-- Operator thingy (Stays the same)
836+
SMODS.GUI.operator(0.4),
837+
-- Mult box
838+
{
839+
n = G.UIT.C,
840+
config = { align = "cm", id = "hand_mult_container" },
841+
nodes = {
842+
SMODS.GUI.score_container({
843+
type = "mult",
844+
colour = G.C.CRY_TAX_MULT,
845+
}),
846+
},
847+
},
848+
},
849+
},
850+
-- Text
851+
{
852+
n = G.UIT.R,
853+
config = { align = "cm" },
854+
nodes = {
855+
{
856+
n = G.UIT.T,
857+
config = { text = bbb, scale = 0.25, colour = G.C.IMPORTANT },
858+
},
859+
},
860+
},
861+
},
862+
},
863+
},
864+
}
865+
end,
866+
})

lib/overrides.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ Cryptid.C = {
347347
SELECTED = { HEX("e38039"), HEX("ccdd1b") },
348348
GREENGRADIENT = { HEX("51e099"), HEX("1e523a") },
349349
ALTGREENGRADIENT = { HEX("6bb565"), HEX("bd28bf") },
350+
TAX_MULT = { HEX("FE5F55"), HEX("40ff40") },
351+
TAX_CHIPS = { HEX("009dff"), HEX("40ff40") },
350352
}
351353
cry_pointer_dt = 0
352354
cry_jimball_dt = 0

localization/en-us.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5341,7 +5341,7 @@ return {
53415341
"to win on #2##1#",
53425342
"#2#Stake#3# difficulty",
53435343
},
5344-
5344+
tax_hand = { "Max #1#% of required chips" },
53455345
cry_art = { "Art: #1#" },
53465346
cry_code = { "Code: #1#" },
53475347
cry_idea = { "Idea: #1#" },

0 commit comments

Comments
 (0)