diff --git a/assets/1x/joker.png b/assets/1x/joker.png index 02982e2..40fa29a 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 3cf3fc1..044616b 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 a10c8e9..6477e01 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 9a405dc..2bacb90 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 041f3bd..938aec1 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 e6a9a7e..c0cb074 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 079ef28..ecd13af 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 81a74dd..80898f8 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 8641e2d..268cf97 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 c244c82..13d9445 100644 Binary files a/assets/2x/tarot.png and b/assets/2x/tarot.png differ diff --git a/localization/en-us.lua b/localization/en-us.lua index 41033a6..a55be8b 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -130,6 +130,14 @@ return { "of every consumable", }, }, + j_Roland_blight = { + name = "Blight", + text = { + "Third played card", + "gives {X:red,C:white}X#1#{} Mult", + "if it is {C:dark_edition}Frozen", + }, + }, j_Roland_bulldozer = { name = "Bulldozer", text = { @@ -232,6 +240,19 @@ return { "least {C:attention}#2# suits", }, }, + j_Roland_snowsquall = { + name = "Snowsquall", + text = { + "This Joker gains", + "{C:mult}+#1# {}Mult for every", + "played {C:dark_edition}Frozen {}card", + "{C:inactive}(Currently {C:red}+#2#{C:inactive} Mult)", + }, + }, + j_Roland_stubborn = { + name = "Stubborn", + text = {"{X:mult,C:white}X#1#{} Mult", "Moves before", "hand is played"}, + }, j_Roland_suitable = { name = "Suitable", text = {"{V:1}#1# {}are {C:attention}Wild", "Suit changes", "every round"}, diff --git a/src/joker.lua b/src/joker.lua index 8647c04..fbe2976 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -721,7 +721,93 @@ joker { end):values():table() ) end, - in_pool = function() - return not not f(G.playing_cards):concat(G.jokers.cards):any(is_frozen) +} + +joker { + key = "snowsquall", + pronouns = "they_them", + config = {extra = {mult_gain = 1, mult = 0}}, + attributes = {"mult", "scaling", "hand_type"}, + cost = 6, + rarity = 2, + eternal_compat = true, + blueprint_compat = true, + perishable_compat = false, + loc_vars = function(_, info_queue, card) + table.insert(info_queue, G.P_CENTERS.e_Roland_frozen) + local extra = card.ability.extra + return {vars = {extra.mult_gain, extra.mult}} + end, + calculate = function(_, card, context) + local extra = card.ability.extra + + if context.joker_main or context.forcetrigger then + return {mult = extra.mult} + end + + if context.blueprint or + not context.individual or + context.cardarea ~= G.play or + not is_frozen(context.other_card) then + return + end + + extra.mult = extra.mult + extra.mult_gain + return {message = localize "k_upgrade_ex", colour = G.C.RED, message_card = card} + end, +} + +joker { + key = "stubborn", + pronouns = "he_they", + config = {extra = {xmult = 3}}, + attributes = {"xmult"}, + cost = 9, + rarity = 3, + eternal_compat = true, + blueprint_compat = true, + perishable_compat = false, + loc_vars = function(_, _, card) + return {vars = {card.ability.extra.xmult}} + end, + calculate = function(_, card, context) + if context.joker_main or context.forcetrigger then + return {card = card, xmult = card.ability.extra.xmult} + end + + if not context.press_play then + return + end + + local keys = f(card.area.cards):where(f().nq(card)):keys():table() + local k = pseudorandom_element(keys, pseudoseed "Roland_stubborn") or card.rank + + card.area.cards[k], card.area.cards[card.rank] = + card.area.cards[card.rank], card.area.cards[k] + end, +} + +joker { + key = "blight", + pronouns = "he_him", + config = {extra = {xmult = 2}}, + attributes = {"xmult"}, + cost = 4, + rarity = 1, + eternal_compat = true, + blueprint_compat = true, + perishable_compat = false, + loc_vars = function(_, info_queue, card) + table.insert(info_queue, G.P_CENTERS.e_Roland_frozen) + return {vars = {card.ability.extra.xmult}} + end, + calculate = function(_, card, context) + local target = (context.scoring_hand or {})[3] + + return context.individual and + context.cardarea == G.play and + context.other_card == target and + is_frozen(context.other_card) and + {xmult = card.ability.extra.xmult} or nil end, } diff --git a/src/lib/funky.lua b/src/lib/funky.lua index 990fd25..7c1b901 100644 --- a/src/lib/funky.lua +++ b/src/lib/funky.lua @@ -24,29 +24,34 @@ local none ---@return fun(tbl: table, key: K): K, V ---@return K ---@return V +---@nodiscard local function autopairs(tbl, fpairs) return (fpairs or tbl[#tbl] and ipairs or pairs)(tbl) end ---@param any any ---@return boolean +---@nodiscard local function is_f(any) return type(any) == "table" and any.from == f.from and any.new == f.new end --- Always returns nil. ---@return nil +---@nodiscard function f.noop() end --- Always returns false. ---@return false +---@nodiscard function f.fals() return false end --- Always returns true. ---@return true +---@nodiscard function f.tru() return true end @@ -55,10 +60,29 @@ end ---@generic T ---@param ... T ---@return T +---@nodiscard function f.id(...) return ... end +---@generic T +---@param value T +---@return fun(T): boolean +function f.eq(value) + return function(v) + return value == v + end +end + +---@generic T +---@param value T +---@return fun(T): boolean +function f.nq(value) + return function(v) + return value ~= v + end +end + ---@generic T ---@param v T ---@return fun(): T @@ -491,6 +515,15 @@ function f:count(func) return ret end +---@generic K, V, T +---@param self F|{ [K]: V } +---@param _ `T` +---@return F|{ [K]: `T` } +---@nodiscard +function f:pun(_) + return self +end + ---@generic K, V ---@param self F|{ [K]: V } ---@return string