From 8adccc39ea1de465bf5bed984e55182c61d9970d Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Thu, 20 Nov 2025 13:51:10 +0700 Subject: [PATCH 01/13] Translate notation --- localization/vi.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/localization/vi.lua b/localization/vi.lua index 9679faf..b43ae89 100644 --- a/localization/vi.lua +++ b/localization/vi.lua @@ -12,6 +12,12 @@ return { talisman_bignum = 'BigNum (ee308)', talisman_omeganum = 'OmegaNum', + talisman_notation = 'Ký Hiệu số', + + talisman_notations_hypere = 'Hyper-E', + talisman_notations_letter = 'Chữ Cái', + talisman_notations_array = 'Mảng', + talisman_string_A = 'Chọn tính năng để bật:', talisman_string_B = 'Tắt Hoạt Ảnh Ghi Điểm', talisman_string_C = 'Giới Hạn Điểm (yêu cầu khởi động lại)', From 576640b7cd2e54121aa7e38f39c517600aec15cc Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Thu, 20 Nov 2025 14:21:39 +0700 Subject: [PATCH 02/13] Set default E_SWITCH_POINT for Balanotation Bonus commit since the notation config thingy kinda missed out vanilla notation --- big-num/notations/Balatro.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/big-num/notations/Balatro.lua b/big-num/notations/Balatro.lua index 7e7757e..68d6b8a 100644 --- a/big-num/notations/Balatro.lua +++ b/big-num/notations/Balatro.lua @@ -3,6 +3,7 @@ local nativefs = require("nativefs") Notation = nativefs.load(Talisman.mod_path.."/big-num/notations/notation.lua")() BalaNotation = {} BalaNotation.__index = BalaNotation +BalaNotation.E_SWITCH_POINT = 100000000000 BalaNotation.__tostring = function () return "BalaNotation" end From 198a53d23d0c0897f0b474282c15e5a7eaba8129 Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Thu, 20 Nov 2025 14:59:16 +0700 Subject: [PATCH 03/13] Make `score_number_scale` consider Big I can't bother doing the patch spam, so I'll just let it off the hook for vanilla Balatro notation. --- talisman.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/talisman.lua b/talisman.lua index bfa2fee..d5b4d9d 100644 --- a/talisman.lua +++ b/talisman.lua @@ -232,6 +232,16 @@ function lenient_bignum(x) --prevent some log-related crashes local sns = score_number_scale function score_number_scale(scale, amt) + if Talisman.config_file.notation_key == "Balatro" then + if not is_number(amt) then return 0.7*(scale or 1) end + if to_big(amt) >= to_big(G.E_SWITCH_POINT) then + return 0.7*(scale or 1) + elseif to_big(amt) >= to_big(1000000) then + return 14*0.75/(math.floor(math.log(amt))+4)*(scale or 1) + else + return 0.75*(scale or 1) + end + end local ret = sns(scale, amt) if type(ret) == "table" then if ret > to_big(1e300) then return 1e300 end From c48bea4f1f27c922cb411943e03c917024448597 Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Thu, 20 Nov 2025 17:18:56 +0700 Subject: [PATCH 04/13] Add a dynamic scaling to score text Works on any notations --- talisman.lua | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/talisman.lua b/talisman.lua index d5b4d9d..39b4d97 100644 --- a/talisman.lua +++ b/talisman.lua @@ -221,7 +221,7 @@ if Talisman.config_file.break_infinity then return mc(x) end -function lenient_bignum(x) + function lenient_bignum(x) if type(x) == "number" then return x end if to_big(x) < to_big(1e300) and to_big(x) > to_big(-1e300) then return x:to_number() @@ -229,25 +229,39 @@ function lenient_bignum(x) return x end - --prevent some log-related crashes - local sns = score_number_scale - function score_number_scale(scale, amt) - if Talisman.config_file.notation_key == "Balatro" then - if not is_number(amt) then return 0.7*(scale or 1) end - if to_big(amt) >= to_big(G.E_SWITCH_POINT) then - return 0.7*(scale or 1) - elseif to_big(amt) >= to_big(1000000) then - return 14*0.75/(math.floor(math.log(amt))+4)*(scale or 1) - else - return 0.75*(scale or 1) + --despite the name, it only works best with m6x11plus\ + --and only support the following characters: `0-9`, `e`, `{`, `}`, `,`,\ + --`#` and `.` for the sake of number format simplicity + function tal_get_string_pixel_length(num) + if is_number(num) then + local num_text, length = number_format(num, G.E_SWITCH_POINT), 0 + for i = 1, #num_text do + if string.sub(num_text, i, i) == "," or string.sub(num_text, i, i) == "." then + length = length + 3/6 + elseif string.sub(num_text, i, i) == "{" or string.sub(num_text, i, i) == "}" then + length = length + 1 + elseif string.sub(num_text, i, i) == "#" then + length = length + 8/6 + else + length = length + 7/6 + end end + return length end - local ret = sns(scale, amt) - if type(ret) == "table" then - if ret > to_big(1e300) then return 1e300 end - return ret:to_number() + end + + -- I'm completely overriding this since I don't think any other mods + -- would alter a text scale adjustment function (HuyTheKiller) + function score_number_scale(scale, amt) + G.E_SWITCH_POINT = Notations[Talisman.config_file.notation_key or Talisman.default_notation].E_SWITCH_POINT or G.E_SWITCH_POINT or 100000000000 + if not is_number(amt) then return 0.7*(scale or 1) end + if to_big(amt) >= to_big(G.E_SWITCH_POINT) or Talisman.config_file.notation_key ~= "Balatro" then + return math.min(6/math.floor(tal_get_string_pixel_length(amt)+1), 0.7)*(scale or 1) + elseif to_big(amt) >= to_big(1000000) then + return 14*0.75/(math.floor(math.log(amt))+4)*(scale or 1) + else + return 0.75*(scale or 1) end - return ret end local gftsj = G.FUNCS.text_super_juice From cc005164433c15d0a4fbf7ac184fdbd4160e0bd8 Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Thu, 20 Nov 2025 18:56:13 +0700 Subject: [PATCH 05/13] Address Ante UI count --- lovely.toml | 7 +++++-- talisman.lua | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lovely.toml b/lovely.toml index 29dbe38..0a1e3f5 100644 --- a/lovely.toml +++ b/lovely.toml @@ -293,7 +293,7 @@ match_indent = true target = "functions/UI_definitions.lua" pattern = "{n=G.UIT.O, config={object = DynaText({string = {{ref_table = G.GAME.round_resets, ref_value = 'ante'}}, colours = {G.C.IMPORTANT},shadow = true, font = G.LANGUAGES['en-us'].font, scale = 2*scale}),id = 'ante_UI_count'}}," position = "at" -payload = "{n=G.UIT.O, config={object = DynaText({string = {{ref_table = G.GAME.round_resets, ref_value = 'ante_disp'}}, colours = {G.C.IMPORTANT},shadow = true, font = G.LANGUAGES['en-us'].font, scale = scale_number(G.GAME.round_resets.ante, 2*scale, 100)}),id = 'ante_UI_count'}},--{n=G.UIT.T, config={text = number_format(G.GAME.round_resets.ante), lang = G.LANGUAGES['en-us'], scale = scale_number(G.GAME.round_resets.ante, 2*scale, 100), colour = G.C.IMPORTANT, shadow = true,id = 'ante_UI_count'}}," +payload = "{n=G.UIT.O, config={object = DynaText({string = {{ref_table = G.GAME.round_resets, ref_value = 'ante_disp'}}, colours = {G.C.IMPORTANT},shadow = true, font = G.LANGUAGES['en-us'].font, scale = scale_number(G.GAME.round_resets.ante, 2*scale, 100, 1000000)}),id = 'ante_UI_count'}},--{n=G.UIT.T, config={text = number_format(G.GAME.round_resets.ante, 1000000), lang = G.LANGUAGES['en-us'], scale = scale_number(G.GAME.round_resets.ante, 2*scale, 100, 1000000), colour = G.C.IMPORTANT, shadow = true,id = 'ante_UI_count'}}," match_indent = true [[patches]] @@ -309,7 +309,10 @@ match_indent = true target = "functions/common_events.lua" pattern = "G.GAME.round_resets.ante = G.GAME.round_resets.ante + mod" position = "after" -payload = "G.GAME.round_resets.ante_disp = number_format(G.GAME.round_resets.ante)" +payload = ''' +G.GAME.round_resets.ante_disp = number_format(G.GAME.round_resets.ante, 1000000) +ante_UI.config.object.scale = scale_number(G.GAME.round_resets.ante, 0.8, 100, 1000000) +''' match_indent = true [[patches]] diff --git a/talisman.lua b/talisman.lua index 39b4d97..4323ce0 100644 --- a/talisman.lua +++ b/talisman.lua @@ -979,7 +979,7 @@ end local g_start_run = Game.start_run function Game:start_run(args) local ret = g_start_run(self, args) - self.GAME.round_resets.ante_disp = self.GAME.round_resets.ante_disp or number_format(self.GAME.round_resets.ante) + self.GAME.round_resets.ante_disp = self.GAME.round_resets.ante_disp or number_format(self.GAME.round_resets.ante, 1000000) return ret end From 9f8576ec87ce5a7c524d5114a4ddc6a92ff30789 Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Thu, 20 Nov 2025 19:36:04 +0700 Subject: [PATCH 06/13] Fix `scale_number` not working on negative --- talisman.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/talisman.lua b/talisman.lua index 4323ce0..7a606a5 100644 --- a/talisman.lua +++ b/talisman.lua @@ -445,14 +445,14 @@ if Talisman.config_file.break_infinity then else scale = scale*math.floor(math.log(max*10, 10))/math.floor(math.max(7,string.len(number.str or number_format(number))-1)) end - elseif to_big(number) >= to_big(e_switch_point or G.E_SWITCH_POINT) then + elseif math.abs(to_big(number)) >= to_big(e_switch_point or G.E_SWITCH_POINT) then if number:arraySize() <= 2 and (number.array[1] or 0) <= 999 then --gross hack scale = scale*math.floor(math.log(max*10, 10))/7 --this divisor is a constant so im precalcualting it else scale = scale*math.floor(math.log(max*10, 10))/math.floor(math.max(7,string.len(number_format(number))-1)) end - elseif to_big(number) >= to_big(max) then - scale = scale*math.floor(math.log(max*10, 10))/math.floor(math.log(number*10, 10)) + elseif math.abs(to_big(number)) >= to_big(max) then + scale = scale*math.floor(math.log(max*10, 10))/math.floor(math.log(math.abs(number)*10, 10)) end local scale = math.min(3, scale:to_number()) number.scale = scale From 900555c9110678ddc8131602381e5008b7793a68 Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Mon, 8 Dec 2025 16:57:17 +0700 Subject: [PATCH 07/13] Aw man I have no idea why the notation introduction commit forces overriding non-bigs so I'm not gonna touch it --- talisman.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/talisman.lua b/talisman.lua index 7a606a5..a9c02b8 100644 --- a/talisman.lua +++ b/talisman.lua @@ -195,6 +195,7 @@ if Talisman.config_file.break_infinity then if override_non_bigs then num = to_big(num) end + if type(num) == "string" then return num end if num.str then return num.str end if num:arraySize() > 2 then local str = Notations[Talisman.config_file.notation_key or Talisman.default_notation]:format(num, 3) @@ -527,8 +528,12 @@ function is_number(x) end function to_big(x, y) - if type(x) == 'string' and x == "0" then --hack for when 0 is asked to be a bignumber need to really figure out the fix - return 0 + if type(x) == 'string' then --hack for when 0 is asked to be a bignumber need to really figure out the fix + if x == "0" then + return 0 + elseif x == "?" then -- another hack to deal with nontation commit's hacky method, turning all strings to bignumber + return x + end elseif Big and Big.m then local x = Big:new(x,y) return x From 035bec4de61639f1e0a0287b0d755b715934fa5d Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Mon, 8 Dec 2025 23:18:24 +0700 Subject: [PATCH 08/13] =?UTF-8?q?=F0=9F=92=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- talisman.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talisman.lua b/talisman.lua index a9c02b8..9a04bc3 100644 --- a/talisman.lua +++ b/talisman.lua @@ -528,7 +528,7 @@ function is_number(x) end function to_big(x, y) - if type(x) == 'string' then --hack for when 0 is asked to be a bignumber need to really figure out the fix + if type(x) == 'string' and (x == '0' or x == '?') then --hack for when 0 is asked to be a bignumber need to really figure out the fix if x == "0" then return 0 elseif x == "?" then -- another hack to deal with nontation commit's hacky method, turning all strings to bignumber From 4a0528463576b21e29bae48bb2f7374663831578 Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Thu, 11 Dec 2025 14:10:21 +0700 Subject: [PATCH 09/13] Fully resolve notation commit's hacky method I believe notation commit's intention was to convert all numbers to bignums, but it did not consider strings as well, which ended up syphoning all of them into to_big(1) for no reason. --- talisman.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/talisman.lua b/talisman.lua index 9a04bc3..36d81d1 100644 --- a/talisman.lua +++ b/talisman.lua @@ -186,16 +186,10 @@ if Talisman.config_file.break_infinity then return obj end - local override_non_bigs = true - local nf = number_format function number_format(num, e_switch_point) - if type(num) == 'table' or override_non_bigs then - --num = to_big(num) - if override_non_bigs then - num = to_big(num) - end - if type(num) == "string" then return num end + if is_number(num) then + num = to_big(num) if num.str then return num.str end if num:arraySize() > 2 then local str = Notations[Talisman.config_file.notation_key or Talisman.default_notation]:format(num, 3) @@ -528,12 +522,8 @@ function is_number(x) end function to_big(x, y) - if type(x) == 'string' and (x == '0' or x == '?') then --hack for when 0 is asked to be a bignumber need to really figure out the fix - if x == "0" then - return 0 - elseif x == "?" then -- another hack to deal with nontation commit's hacky method, turning all strings to bignumber - return x - end + if type(x) == 'string' and x == "0" then --hack for when 0 is asked to be a bignumber need to really figure out the fix + return 0 elseif Big and Big.m then local x = Big:new(x,y) return x From eeb0b9b1e736bd8728a1b3edc10365d9824af5b4 Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Fri, 2 Jan 2026 10:36:44 +0700 Subject: [PATCH 10/13] Fix flames not working in latest smods --- lovely.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lovely.toml b/lovely.toml index 0a1e3f5..a0ca564 100644 --- a/lovely.toml +++ b/lovely.toml @@ -206,6 +206,14 @@ position = "at" payload = "if not is_number(G.GAME.current_round.current_hand.chips) or not is_number(G.GAME.current_round.current_hand.mult) then" match_indent = true +[[patches]] +[patches.pattern] +target = "functions/misc_functions.lua" +pattern = "if type(G.GAME.current_round.current_hand[name]) ~= 'number' then all_numbers = false end" +position = "at" +payload = "if not is_number(G.GAME.current_round.current_hand[name]) then all_numbers = false end" +match_indent = true + [[patches]] [patches.pattern] target = "main.lua" From ef3efd9c1f2516fb7a13a461574c9f3b4a35414d Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Fri, 2 Jan 2026 10:48:59 +0700 Subject: [PATCH 11/13] Repair broken patch --- lovely.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lovely.toml b/lovely.toml index a0ca564..43e335a 100644 --- a/lovely.toml +++ b/lovely.toml @@ -1546,10 +1546,10 @@ target = 'functions/misc_functions.lua' position = 'at' match_indent = true pattern = ''' -G.ARGS.score_intensity.earned_score = SMODS.calculate_round_score(true) +G.ARGS.score_intensity.earned_score = all_numbers and SMODS.calculate_round_score(true) or 0 ''' payload = ''' -G.ARGS.score_intensity.earned_score = math.min(to_number(SMODS.calculate_round_score(true)), 1e300) +G.ARGS.score_intensity.earned_score = all_numbers and math.min(to_number(SMODS.calculate_round_score(true)), 1e300) or 0 ''' # evaluate_play_final_scoring comparison From 173d2bb35bf3c8eb6882eed6056aea876371c764 Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Fri, 2 Jan 2026 10:54:09 +0700 Subject: [PATCH 12/13] Readd old patch --- lovely.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lovely.toml b/lovely.toml index 43e335a..199afdd 100644 --- a/lovely.toml +++ b/lovely.toml @@ -1540,6 +1540,18 @@ payload = ''' G.ARGS.score_intensity.earned_score = math.min(to_number(G.GAME.current_round.current_hand.chips*G.GAME.current_round.current_hand.mult), 1e300) ''' +[[patches]] # keeping this patch for backward compat +[patches.pattern] +target = 'functions/misc_functions.lua' +position = 'at' +match_indent = true +pattern = ''' +G.ARGS.score_intensity.earned_score = SMODS.calculate_round_score(true) +''' +payload = ''' +G.ARGS.score_intensity.earned_score = math.min(to_number(SMODS.calculate_round_score(true)), 1e300) +''' + [[patches]] [patches.pattern] target = 'functions/misc_functions.lua' From 0218e4ce089117910a16102b7d5c958ac3cfbdd2 Mon Sep 17 00:00:00 2001 From: HuyTheKiller Date: Fri, 2 Jan 2026 10:59:05 +0700 Subject: [PATCH 13/13] Move to regex --- lovely.toml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/lovely.toml b/lovely.toml index 199afdd..936b785 100644 --- a/lovely.toml +++ b/lovely.toml @@ -1540,29 +1540,13 @@ payload = ''' G.ARGS.score_intensity.earned_score = math.min(to_number(G.GAME.current_round.current_hand.chips*G.GAME.current_round.current_hand.mult), 1e300) ''' -[[patches]] # keeping this patch for backward compat -[patches.pattern] -target = 'functions/misc_functions.lua' -position = 'at' -match_indent = true -pattern = ''' -G.ARGS.score_intensity.earned_score = SMODS.calculate_round_score(true) -''' -payload = ''' -G.ARGS.score_intensity.earned_score = math.min(to_number(SMODS.calculate_round_score(true)), 1e300) -''' - [[patches]] -[patches.pattern] +[patches.regex] target = 'functions/misc_functions.lua' position = 'at' match_indent = true -pattern = ''' -G.ARGS.score_intensity.earned_score = all_numbers and SMODS.calculate_round_score(true) or 0 -''' -payload = ''' -G.ARGS.score_intensity.earned_score = all_numbers and math.min(to_number(SMODS.calculate_round_score(true)), 1e300) or 0 -''' +pattern = '''SMODS\.calculate_round_score\(true\)''' +payload = '''math.min(to_number(SMODS.calculate_round_score(true)), 1e300)''' # evaluate_play_final_scoring comparison [[patches]]