From e9090a2a5d07f0474905b1a9e8cbc0b148de67dc Mon Sep 17 00:00:00 2001 From: Emik Date: Mon, 7 Apr 2025 17:01:57 +0200 Subject: [PATCH] Rephrase and refactor tokens --- manifest.json | 2 +- src/token.lua | 127 ++++++++++++++++++++++++-------------------------- 2 files changed, 61 insertions(+), 68 deletions(-) diff --git a/manifest.json b/manifest.json index a67766d..302f70c 100644 --- a/manifest.json +++ b/manifest.json @@ -17,5 +17,5 @@ "conflicts": [ "Jen" ], - "version": "1.0.6" + "version": "1.0.7" } \ No newline at end of file diff --git a/src/token.lua b/src/token.lua index d9f3e5c..c317047 100644 --- a/src/token.lua +++ b/src/token.lua @@ -20,80 +20,73 @@ SMODS.ConsumableType { secondary_colour = G.C.VOUCHER, } -for _, v in pairs({ - {"tag_standard", "Standard", 0, 0, 3}, - {"tag_charm", "Charm", 1, 0, 5}, - {"tag_meteor", "Meteor", 2, 0, 5}, - {"tag_ethereal", "Ethereal", 3, 0, 5}, - {"tag_buffoon", "Buffoon", 4, 0, 8}, - {"tag_cry_console", "Console", 5, 0, 7}, - - {"tag_cry_loss", "Loss", 0, 1, 12}, - {"tag_cry_bundle", "Bundle", 1, 1, 10}, - {"tag_uncommon", "Uncommon", 2, 1, 3}, - {"tag_rare", "Rare", 3, 1, 5}, - {"tag_cry_epic", "Epic", 4, 1, 8}, - {"tag_cry_gourmond", "Gourmond", 5, 1, 4}, - - {"tag_double", "Double", 0, 2, 6}, - {"tag_cry_triple", "Triple", 1, 2, 8}, - {"tag_cry_quadruple", "Quadruple", 2, 2, 10}, - {"tag_cry_quintuple", "Quintuple", 3, 2, 13}, - {"tag_skip", "Speed", 4, 2, 7}, - {"tag_economy", "Economy", 5, 2, 10}, - - {"tag_investment", "Investment", 0, 3, 8}, - {"tag_foil", "Foil", 1, 3, 3}, - {"tag_holo", "Holographic", 2, 3, 4}, - {"tag_polychrome", "Polychrome", 3, 3, 5}, - {"tag_negative", "Negative", 4, 3, 10}, - - {"tag_d_six", "Dice", 0, 4, 2}, - -- {"tag_orbital", "Orbital", 1, 4, 6}, - {"tag_top_up", "Top-up", 2, 4, 2}, - {"tag_cry_bettertop_up", "Top-up+", 3, 4, 3}, - {"tag_coupon", "Coupon", 4, 4, 10}, - {"tag_cry_memory", "Memory", 5, 4, 8}, - - {"tag_garbage", "Garbage", 0, 5, 6}, - {"tag_handy", "Handy", 1, 5, 8}, - {"tag_juggle", "Juggle", 2, 5, 2}, - {"tag_cry_schematic", "Schematic", 3, 5, 10}, - {"tag_voucher", "Voucher", 4, 5, 5}, - {"tag_cry_better_voucher", "Voucher+", 5, 5, 7}, - - {"tag_cry_gambler", "Gamble", 0, 6, 10}, - {"tag_cry_cat", "Cat", 1, 6, 1}, - {"tag_cry_mosaic", "Mosaic", 2, 6, 6}, - {"tag_cry_fragile", "Fragile", 3, 6, 7}, - {"tag_cry_astral", "Astral", 4, 6, 8}, - {"tag_cry_m", "M", 5, 6, 8}, - - {"tag_cry_blur", "Blurred", 0, 7, 11}, - {"tag_cry_oversat", "Oversaturated", 1, 7, 12}, - {"tag_cry_glitched", "Glitched", 2, 7, 13}, - {"tag_cry_gold", "Golden", 3, 7, 9}, - {"tag_cry_booster", "Booster", 4, 7, 4}, - {"tag_cry_scope", "Scope", 5, 7, 3}, - - {"tag_cry_banana", "Banana", 0, 8, 4}, +local vowels = {A = true, E = true, I = true, O = true, U = true} +for k, v in pairs({ + tag_standard = {"Standard", 0, 0, 3}, + tag_charm = {"Charm", 1, 0, 5}, + tag_meteor = {"Meteor", 2, 0, 5}, + tag_ethereal = {"Ethereal", 3, 0, 5}, + tag_buffoon = {"Buffoon", 4, 0, 8}, + tag_cry_console = {"Console", 5, 0, 7}, + tag_cry_loss = {"Loss", 0, 1, 12}, + tag_cry_bundle = {"Bundle", 1, 1, 10}, + tag_uncommon = {"Uncommon", 2, 1, 3}, + tag_rare = {"Rare", 3, 1, 5}, + tag_cry_epic = {"Epic", 4, 1, 8}, + tag_cry_gourmond = {"Gourmond", 5, 1, 4}, + tag_double = {"Double", 0, 2, 6}, + tag_cry_triple = {"Triple", 1, 2, 8}, + tag_cry_quadruple = {"Quadruple", 2, 2, 10}, + tag_cry_quintuple = {"Quintuple", 3, 2, 13}, + tag_skip = {"Speed", 4, 2, 7}, + tag_economy = {"Economy", 5, 2, 10}, + tag_investment = {"Investment", 0, 3, 8}, + tag_foil = {"Foil", 1, 3, 3}, + tag_holo = {"Holographic", 2, 3, 4}, + tag_polychrome = {"Polychrome", 3, 3, 5}, + tag_negative = {"Negative", 4, 3, 10}, + tag_d_six = {"Dice", 0, 4, 2}, + -- tag_orbital = {"Orbital", 1, 4, 6}, + tag_top_up = {"Top-up", 2, 4, 2}, + tag_cry_bettertop_up = {"Top-up+", 3, 4, 3}, + tag_coupon = {"Coupon", 4, 4, 10}, + tag_cry_memory = {"Memory", 5, 4, 8}, + tag_garbage = {"Garbage", 0, 5, 6}, + tag_handy = {"Handy", 1, 5, 8}, + tag_juggle = {"Juggle", 2, 5, 2}, + tag_cry_schematic = {"Schematic", 3, 5, 10}, + tag_voucher = {"Voucher", 4, 5, 5}, + tag_cry_better_voucher = {"Voucher+", 5, 5, 7}, + tag_cry_gambler = {"Gamble", 0, 6, 10}, + tag_cry_cat = {"Cat", 1, 6, 1}, + tag_cry_mosaic = {"Mosaic", 2, 6, 6}, + tag_cry_fragile = {"Fragile", 3, 6, 7}, + tag_cry_astral = {"Astral", 4, 6, 8}, + tag_cry_m = {"M", 5, 6, 8}, + tag_cry_blur = {"Blurred", 0, 7, 11}, + tag_cry_oversat = {"Oversaturated", 1, 7, 12}, + tag_cry_glitched = {"Glitched", 2, 7, 13}, + tag_cry_gold = {"Golden", 3, 7, 9}, + tag_cry_booster = {"Booster", 4, 7, 4}, + tag_cry_scope = {"Scope", 5, 7, 3}, + tag_cry_banana = {"Banana", 0, 8, 4}, }) do - if Cryptid or v[1]:sub(1, 7) ~= "tag_cry" then + if Cryptid or k:sub(1, 7) ~= "tag_cry" then SMODS.Consumable { - key = "token_" .. v[1], + key = "token_" .. k, set = "jane_tokens", atlas = "janetokens", loc_txt = { - name = v[2] .. " Token", - text = {"Use to create a", "{C:attention}" .. v[2] .. " Tag"}, + name = v[1] .. " Token", + text = {"Creates a" .. vowels[v[1]:sub(1, 1)] and "n" or "" .. " {C:attention}" .. v[1] .. " Tag"}, }, loc_vars = function(_, info_queue, _) - info_queue[#info_queue + 1] = G.P_TAGS[v[1]] - return {vars = {v[2]}} + info_queue[#info_queue + 1] = G.P_TAGS[k] + return {vars = {}} end, - pos = {x = v[3], y = v[4]}, - cost = v[5], + pos = {x = v[2], y = v[3]}, + cost = v[4], can_stack = true, can_divide = true, can_use = Jane.can_use, @@ -102,13 +95,13 @@ for _, v in pairs({ end, use = function(_, _, _, _) play_sound("jane_e_gilded", 1.25, 0.4) - add_tag(Tag(v[1])) + add_tag(Tag(k)) end, bulk_use = function(_, _, _, _, number) play_sound("jane_e_gilded", 1.25, 0.4) for _ = 1, number do - add_tag(Tag(v[1])) + add_tag(Tag(k)) end end, }