diff --git a/assets/1x/iphone.png b/assets/1x/charm.png similarity index 100% rename from assets/1x/iphone.png rename to assets/1x/charm.png diff --git a/assets/1x/escapey.png b/assets/1x/escapey.png deleted file mode 100644 index 632b98d..0000000 Binary files a/assets/1x/escapey.png and /dev/null differ diff --git a/assets/1x/joker.png b/assets/1x/joker.png new file mode 100644 index 0000000..0aa3e02 Binary files /dev/null and b/assets/1x/joker.png differ diff --git a/assets/1x/martingale.png b/assets/1x/martingale.png deleted file mode 100644 index c551c1f..0000000 Binary files a/assets/1x/martingale.png and /dev/null differ diff --git a/assets/2x/back.png b/assets/2x/back.png index 628031a..8998917 100644 Binary files a/assets/2x/back.png and b/assets/2x/back.png differ diff --git a/assets/2x/blind.png b/assets/2x/blind.png index ede8520..b34e9bf 100644 Binary files a/assets/2x/blind.png and b/assets/2x/blind.png differ diff --git a/assets/2x/iphone.png b/assets/2x/charm.png similarity index 97% rename from assets/2x/iphone.png rename to assets/2x/charm.png index 99d1ef9..91ae0d3 100644 Binary files a/assets/2x/iphone.png and b/assets/2x/charm.png differ diff --git a/assets/2x/escapey.png b/assets/2x/escapey.png deleted file mode 100644 index 1bdbffb..0000000 Binary files a/assets/2x/escapey.png and /dev/null differ diff --git a/assets/2x/icon.png b/assets/2x/icon.png index 3ff2034..143b522 100644 Binary files a/assets/2x/icon.png and b/assets/2x/icon.png differ diff --git a/assets/2x/joker.png b/assets/2x/joker.png new file mode 100644 index 0000000..4964a43 Binary files /dev/null and b/assets/2x/joker.png differ diff --git a/assets/2x/martingale.png b/assets/2x/martingale.png deleted file mode 100644 index dc65347..0000000 Binary files a/assets/2x/martingale.png and /dev/null differ diff --git a/assets/2x/seal.png b/assets/2x/seal.png index 9ba37fb..d25f392 100644 Binary files a/assets/2x/seal.png and b/assets/2x/seal.png differ diff --git a/assets/2x/spectral.png b/assets/2x/spectral.png index 2eba88f..20eb236 100644 Binary files a/assets/2x/spectral.png and b/assets/2x/spectral.png differ diff --git a/src/back.lua b/src/back.lua index 6b9e5ff..807719e 100644 --- a/src/back.lua +++ b/src/back.lua @@ -11,22 +11,25 @@ end local back = (function() local x = 0 - return function(b) - local key = b.key - local apply = b.apply - local calculate = b.calculate + ---@param tbl SMODS.Back|{alt_apply?: fun(self: SMODS.Back|table, back: Back|table), alt_calculate?: fun(self: SMODS.Back|table, back: Back|table, context: CalcContext|table): table?, boolean?} + return function(tbl) + local key = tbl.key + local apply = tbl.apply + local calculate = tbl.calculate - function b:apply(...) + function tbl:apply(...) + ---@diagnostic disable-next-line: redundant-return-value return apply and G.GAME.selected_sleeve ~= "sleeve_Roland_" .. key and save(apply(self, ...)) end - function b:calculate(...) + function tbl:calculate(...) + ---@diagnostic disable-next-line: return-type-mismatch return calculate and G.GAME.selected_sleeve ~= "sleeve_Roland_" .. key and calculate(self, ...) end - b.pos = {x = x, y = 0} - b.atlas = "back" - SMODS.Back(b) + tbl.pos = {x = x, y = 0} + tbl.atlas = "back" + SMODS.Back(tbl) x = x + 1 ---@diagnostic disable-next-line: undefined-global @@ -37,19 +40,19 @@ local back = (function() ---@diagnostic disable-next-line: undefined-global CardSleeves.Sleeve { key = key, - pos = b.pos, + pos = tbl.pos, atlas = "void", - config = b.config and f(b.config):into() or nil, + config = tbl.config and f(tbl.config):into() or nil, loc_vars = function(self, ...) - local ret = b.loc_vars and b.loc_vars(self, ...) or {} + local ret = tbl.loc_vars and tbl.loc_vars(self, ...) or {} ret.key = self:is_alt() and self.key .. "_alt" or self.key return ret end, apply = function(self, ...) - return (b.alt_apply and self:is_alt() and b.alt_apply or apply)(self, ...) + return (tbl.alt_apply and self:is_alt() and tbl.alt_apply or apply)(self, ...) end, calculate = function(self, ...) - return (b.alt_calculate and self:is_alt() and b.alt_calculate or calculate)(self, ...) + return (tbl.alt_calculate and self:is_alt() and tbl.alt_calculate or calculate)(self, ...) end, is_alt = function(self) return self.get_current_deck_key() == "b_Roland_" .. key diff --git a/src/charm.lua b/src/charm.lua index 98940ad..faf2e29 100644 --- a/src/charm.lua +++ b/src/charm.lua @@ -1,8 +1,8 @@ local _, q = unpack(... or require "src.functional") SMODS.Atlas { - key = "iphone", - path = "iphone.png", + key = "charm", + path = "charm.png", px = 68, py = 68, } @@ -13,8 +13,9 @@ q(function() local charm = Bakery_API.Charm { key = "iphone", - atlas = "iphone", + atlas = "charm", pos = {x = 0, y = 0}, + alerted = true, unlocked = true, discovered = true, calculate = function(_, _, context) @@ -33,6 +34,6 @@ q(function() charm:inject() charm:process_loc_text() - -- charm._d, charm._u, charm._saved_d_u = true, true, true -- SMODS._save_d_u(charm) + -- SMODS._save_d_u(charm) SMODS.current_mod = current_mod end) diff --git a/src/joker.lua b/src/joker.lua index 5f44078..8931d37 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -1,5 +1,25 @@ local f, q, u = unpack(... or require "src.functional") +local joker = (function() + local z = 0 + + ---@return {x: number, y: number} + local function inc() + local ret = {x = z % 6, y = math.floor(z / 6)} + z = z + 1 + return ret + end + + ---@param tbl SMODS.Joker|{sinis?: boolean|{x: number, y: number}, soul_pos?: boolean|{x: number, y: number}} + return function(tbl) + tbl.pos = inc() + tbl.atlas = "joker" + tbl.soul_pos = tbl.soul_pos and inc() or nil + tbl.sinis = tbl.sinis and inc() or nil + SMODS.Joker(tbl) + end +end)() + local function destructible(card) return not card.highlighted and not (card.ability or {}).eternal end @@ -8,11 +28,9 @@ local function is_carbon(card) return card.edition and card.edition.key == "e_Bakery_Carbon" end -local function is_mergeable_with(it) - return function(card) - return it.rank ~= card.rank and - card.label == "j_Roland_escapey" and not - (card.ability or {}).eternal +local function is_mergeable_with(x) + return function(y) + return x.rank ~= y.rank and y.label == "j_Roland_escapey" and not (y.ability or {}).eternal end end @@ -51,29 +69,20 @@ SMODS.Sound { } SMODS.Atlas { + key = "joker", + path = "joker.png", px = 71, py = 95, - key = "escapey", - path = "escapey.png", } -SMODS.Atlas { - px = 71, - py = 95, - key = "martingale", - path = "martingale.png", -} - -SMODS.Joker { +joker { key = "escapey", - atlas = "escapey", pronouns = "they_them", - pos = {x = 0, y = 0}, - sinis = {x = 2, y = 0}, - soul_pos = {x = 1, y = 0}, config = {extra = {hands = 2}}, - cost = 6, + cost = 4, rarity = 2, + sinis = true, + soul_pos = true, eternal_compat = true, blueprint_compat = false, perishable_compat = true, @@ -214,11 +223,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "msjoker", -- Blue bow - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, cost = 1, rarity = 1, eternal_compat = true, @@ -233,11 +240,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "mrsbones", - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, config = {extra = {xmult = 4, requirement = 4}}, cost = 4, rarity = 2, @@ -267,11 +272,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "estrogen", - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, config = {extra = {division = 4}}, cost = 8, rarity = 3, @@ -286,11 +289,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "hexagon", - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, config = {extra = {money = 6}}, cost = 6, rarity = 1, @@ -310,11 +311,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "hexagoner", - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, config = {extra = {mult = 0}}, cost = 6, rarity = 2, @@ -337,11 +336,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "hexagonest", - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, config = {extra = {mult = 0}}, cost = 6, rarity = 3, @@ -370,11 +367,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "sunny", -- Cracked egg - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, cost = 2, rarity = 1, eternal_compat = false, @@ -415,11 +410,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "yard", - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, config = {extra = {money = 2}}, cost = 6, rarity = 2, @@ -435,11 +428,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "misfortune", - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, cost = 6, rarity = 2, eternal_compat = true, @@ -447,11 +438,9 @@ SMODS.Joker { perishable_compat = true, } -SMODS.Joker { +joker { key = "temple", - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, config = {extra = {xmult = 1.5}}, cost = 6, rarity = 2, @@ -470,11 +459,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "bulldozer", - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, cost = 6, rarity = 2, eternal_compat = true, @@ -491,11 +478,9 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "oops", -- Slot machine - atlas = "void", pronouns = "they_them", - pos = {x = 0, y = 0}, cost = 8, rarity = 3, config = {extra = {probability = 1, delta = 1}}, @@ -524,12 +509,10 @@ SMODS.Joker { end, } -SMODS.Joker { +joker { key = "martingale", - atlas = "martingale", pronouns = "he_him", - pos = {x = 0, y = 0}, - config = {extra = {odds = 2, times = 0, martingale = true}}, + config = {extra = {odds = 2, times = 0}}, cost = 7, rarity = 3, eternal_compat = true,