diff --git a/assets/1x/joker.png b/assets/1x/joker.png index bb743cc..941ca33 100644 Binary files a/assets/1x/joker.png and b/assets/1x/joker.png differ diff --git a/assets/2x/back.png b/assets/2x/back.png index 444b8e3..34c5e0e 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 e5011f8..762d48b 100644 Binary files a/assets/2x/blind.png and b/assets/2x/blind.png differ diff --git a/assets/2x/charm.png b/assets/2x/charm.png index 9dd71bb..876fd04 100644 Binary files a/assets/2x/charm.png and b/assets/2x/charm.png differ diff --git a/assets/2x/icon.png b/assets/2x/icon.png index 41fc8a9..16d33fa 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 index c1cd431..e814093 100644 Binary files a/assets/2x/joker.png and b/assets/2x/joker.png differ diff --git a/assets/2x/seal.png b/assets/2x/seal.png index 4ff1f12..4f82e4d 100644 Binary files a/assets/2x/seal.png and b/assets/2x/seal.png differ diff --git a/assets/2x/sleeve.png b/assets/2x/sleeve.png index 6cb23bb..9aff582 100644 Binary files a/assets/2x/sleeve.png and b/assets/2x/sleeve.png differ diff --git a/assets/2x/spectral.png b/assets/2x/spectral.png index b79fdf0..2f321b3 100644 Binary files a/assets/2x/spectral.png and b/assets/2x/spectral.png differ diff --git a/assets/2x/tag.png b/assets/2x/tag.png index 60e1399..6e71af5 100644 Binary files a/assets/2x/tag.png and b/assets/2x/tag.png differ diff --git a/assets/2x/tarot.png b/assets/2x/tarot.png index 3e8f85d..8532f69 100644 Binary files a/assets/2x/tarot.png and b/assets/2x/tarot.png differ diff --git a/assets/2x/unicon.png b/assets/2x/unicon.png index 32c5f89..327c45f 100644 Binary files a/assets/2x/unicon.png and b/assets/2x/unicon.png differ diff --git a/localization/en-us.lua b/localization/en-us.lua index c18151e..74e56da 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -121,7 +121,11 @@ return { Joker = { j_Roland_amber = { name = "Amber Acorn", - text = {"{X:mult,C:white}X#1#{} Mult", "Moves before", "hand is played"}, + text = { + "{X:mult,C:white}X#1#{} Mult", + "Moves before", + "hand is played", + }, }, j_Roland_arctic = { name = "Arctic Circle", @@ -161,6 +165,14 @@ return { "if it is {C:dark_edition}Frozen", }, }, + j_Roland_crimson = { + name = "Crimson Heart", + text = { + "{X:mult,C:white}X#1#{} Mult", + "{C:red}Debuffs {C:attention}Joker", + "to the left", + }, + }, j_Roland_domino = { name = "Domino", text = { diff --git a/manifest.json b/manifest.json index 70cb6ed..749d955 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "id": "Roland", "name": "Roland", "prefix": "Roland", - "version": "2.8.25", + "version": "2.8.26", "badge_colour": "8BE9FD", "display_name": "Roland", "main_file": "src/main.lua", diff --git a/src/blind.lua b/src/blind.lua index 6961d3a..cc056c8 100644 --- a/src/blind.lua +++ b/src/blind.lua @@ -29,7 +29,6 @@ SMODS.Sound { } local function common_rank() - ---@type { [integer]: integer }, { [integer]: string } local tally, to_name = {}, {} f(G.playing_cards):where(SMODS.has_no_rank, false):each(function(v) diff --git a/src/challenge.lua b/src/challenge.lua index 570b37b..4945d1c 100644 --- a/src/challenge.lua +++ b/src/challenge.lua @@ -173,7 +173,6 @@ SMODS.Challenge { local mod = G.GAME.modifiers mod.Roland_Eternally_Crimson = not context.setting_blind and mod.Roland_Eternally_Crimson or nil local debuff = context.debuff_card - ---@type (SMODS.Joker|{ability?: {Roland_crimson_heart_chosen: boolean?}, debuff: boolean?})[] local cards = G.jokers.cards if debuff and diff --git a/src/edition.lua b/src/edition.lua index 325caac..5ff8c8f 100644 --- a/src/edition.lua +++ b/src/edition.lua @@ -268,7 +268,7 @@ q(function() return v.config.center.key == card.Roland_frozen.proxy end - return f(G.jokers.cards):any(eq) ---@type Card? + return f(G.jokers.cards):any(eq) end local orig_calculate = proxy.calculate diff --git a/src/joker.lua b/src/joker.lua index 77ed701..87b30c1 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -31,6 +31,21 @@ local joker = (function() end end)() +---@generic T +---@param tbl T[] +---@return fun(t: T[], i: integer): integer, T +---@return T[] +local function ipairs_reversed(tbl) + return function(t, i) + local k = i and i - 1 or #t + local v = t[k] + + if v ~= nil then + return k, v + end + end, tbl +end + ---@param card Card local function is_frozen(card) return card.edition and card.edition.key == "e_Roland_frozen" @@ -244,7 +259,7 @@ joker { table.insert(info_queue, negative) end, calculate = function(_, _, context) - return (context.selling_self or context.forcetrigger) and f(G.consumeables.cards):each(function(v) --@type Card + return (context.selling_self or context.forcetrigger) and f(G.consumeables.cards):each(function(v) return v.ability.consumeable and q { delay = 1, func = function() @@ -701,6 +716,50 @@ joker { end, } +joker { + key = "crimson", + pronouns = "she_her", + config = {extra = {xmult = 3}}, + pixel_size = {w = 68, h = 68}, + attributes = {"xmult"}, + cost = 6, + rarity = 2, + eternal_compat = true, + blueprint_compat = true, + perishable_compat = false, + loc_vars = function(_, _, card) + return {vars = {card.ability.extra.xmult}} + end, + calculate = function(self, card, context) + return (self.crimson() or context.joker_main or context.forcetrigger) and + {card = card, xmult = card.ability.extra.xmult} or nil + end, + crimson = function() + f(G.jokers.cards, ipairs_reversed):each(function(v) + local right = G.jokers.cards[v.rank + 1] + + local debuffed_by_crimson = right and + not right.debuff and + right.config.center.key == "j_Roland_crimson" + + if debuffed_by_crimson and v.ability.Roland_crimson == nil then + v.ability.Roland_crimson = v.debuff and true or false + v:set_debuff(true) + elseif not debuffed_by_crimson and v.ability.Roland_crimson ~= nil then + v:set_debuff(v.ability.Roland_crimson) + v.ability.Roland_crimson = nil + end + end) + end, +} + +local orig_stop_drag = Card.stop_drag + +function Card:stop_drag(...) + local _ = self.area == G.jokers and G.P_CENTERS.j_Roland_crimson.crimson() + return orig_stop_drag(self, ...) +end + joker { key = "martingale", pronouns = "he_him", @@ -766,7 +825,6 @@ joker { local extra = card.ability.extra local col = {} - ---@type { [number]: string|table|nil }|{colours: {[number]: {[1]: number, [2]: number, [3]: number, [4]: number}}} local vars = f(self.Roland_idle_capacity):flatmap(function(v) local l = localize_card(extra.cards[v], "b_Roland_unassigned").vars @@ -779,7 +837,7 @@ joker { end):values():table() table.insert(vars, extra.xmult) - vars.colours = col + vars["colours"] = col return {vars = vars} end, calculate = function(_, card, context) diff --git a/src/lib/funky.lua b/src/lib/funky.lua index dd37382..9ca7259 100644 --- a/src/lib/funky.lua +++ b/src/lib/funky.lua @@ -34,7 +34,7 @@ end ---@return V ---@nodiscard local function autopairs(tbl, fpairs) - return (fpairs or tbl[#tbl] and ipairs or pairs)(tbl) + return (fpairs or (tbl[#tbl] and ipairs or pairs))(tbl) end ---@param any any diff --git a/src/lib/shared.lua b/src/lib/shared.lua index 4fa4e07..72c5e7f 100644 --- a/src/lib/shared.lua +++ b/src/lib/shared.lua @@ -43,6 +43,15 @@ if false then -- This allows for better type inference. SMODS.Mods.Roland.config = require "config" + ---@type Card[] + CardArea.cards = CardArea.cards + + --- @type { constants?: { TEN: table }, new: (fun(self: self, arr?: number[], sign?: number, noNormalize?: boolean): table), pow: (fun(x: number, y: number): number) } + _G["Big"] = _G["Big"] + + --- @type fun(area: CardArea, ...: ...): Card + create_card_for_shop = create_card_for_shop + -- This exists to remove the @deprecated warning. ---Returns the elements from the given `list`. This function is equivalent to ---```lua diff --git a/src/spectral.lua b/src/spectral.lua index f5e8289..f570cf6 100644 --- a/src/spectral.lua +++ b/src/spectral.lua @@ -75,7 +75,7 @@ spectral { table.insert(info_queue, G.P_CENTERS.m_stone) end, can_use = function() - return u() and next(G.hand.cards) + return u() and not not next(G.hand.cards) end, use = function(_, card) q { diff --git a/src/tweaks.lua b/src/tweaks.lua index 46cbe12..3846b4e 100644 --- a/src/tweaks.lua +++ b/src/tweaks.lua @@ -81,7 +81,6 @@ end local orig_create_card_for_shop = create_card_for_shop function create_card_for_shop(...) - ---@type Card local ret = orig_create_card_for_shop(...) if not SMODS.Mods.Roland.config.illusion_seal or @@ -119,7 +118,6 @@ function get_blind_amount(ante, ...) return 1 / 0 end - --- @type { constants?: { TEN: table }, new: (fun(self: self, arr?: number[], sign?: number, noNormalize?: boolean): table), pow: (fun(x: number, y: number): number) } local big, rem = _G["Big"], tonumber(blind((ante % loop) + 1)) return ante / 15 >= loop and big:new(f(blind(ante - (loop * 15))):map(f().const(10)):table()) or