diff --git a/assets/1x/blind.png b/assets/1x/blind.png index a84f9a5..dd136a4 100644 Binary files a/assets/1x/blind.png and b/assets/1x/blind.png differ diff --git a/assets/2x/back.png b/assets/2x/back.png index d43f9c3..d988c90 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 caabb5e..2f2c8bf 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 75b1980..b0fa100 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 1e41869..01207b6 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 bc70e89..b08aaef 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 3eb0e7c..2ae587a 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 e5be358..fc30302 100644 Binary files a/assets/2x/spectral.png and b/assets/2x/spectral.png differ diff --git a/localization/en-us.lua b/localization/en-us.lua index de7117b..815822d 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -60,6 +60,10 @@ return { }, }, Blind = { + bl_Roland_blizzard = { + name = "The Blizzard", + text = {"All cards", "are Frozen"}, + }, bl_Roland_divide = { name = "The Great Divide", text = {"Half of the deck", "is discarded"}, diff --git a/src/blind.lua b/src/blind.lua index 33b4772..30d4459 100644 --- a/src/blind.lua +++ b/src/blind.lua @@ -61,6 +61,20 @@ local function has_enhancement(card) return not not (e and next(e)) end +local function set_freeze(state) + ---@param card Card|{ Roland_blizzard: true|nil } + return function(card) + card.Roland_blizzard = state + + q { + delay = 0.1, + func = function() + card:set_edition(state and {Roland_frozen = true}) + end, + } + end +end + local function sort_by_enhancement(v1, v2) return has_enhancement(v1) and not has_enhancement(v2) end @@ -210,6 +224,29 @@ blind { end, } +blind { + key = "blizzard", + boss = {min = 4}, + boss_colour = HEX "102a41ff", + pronouns = "it_its", + defeat = function(self) + self.cards():where("Roland_blizzard"):each(set_freeze()) + end, + disable = function(self) + self:defeat() + end, + calculate = function(self, b) + return not b.disabled and self.cards():where(function(v) + return not v.Roland_blizzard and not v.edition and v.facing == "front" + end):each(set_freeze(true)) or nil + end, + cards = function() + return f(G):where(function(v) + return type(v) == "table" and type(v.cards) == "table" + end):flatmap("cards", ipairs) + end, +} + blind { key = "tranquilizer", boss = {min = 6}, diff --git a/src/edition.lua b/src/edition.lua index 3c58ea4..5fdad5a 100644 --- a/src/edition.lua +++ b/src/edition.lua @@ -102,18 +102,21 @@ function play_sound(sound, pitch, ...) pseudorandom_element(frozen_sounds, pseudoseed "Roland_frozen") or sound - local overriden_pitch = pseudorandom(pseudoseed "Roland_frozen_pitch") / 2 + 1.3 - return orig_play_sound(overriden_sound, overriden_pitch, ...) + local added_pitch = pseudorandom(pseudoseed "Roland_frozen_pitch") / 4 + 0.8 + return orig_play_sound(overriden_sound, pitch + added_pitch, ...) end local orig_click = Card.click function Card:click(...) - if self.edition and self.edition.Roland_frozen then - play_sound("Roland_frozen_click", nil, 0.6) + local highlight = self.highlighted + local ret = orig_click(self, ...) + + if self.edition and self.edition.Roland_frozen and highlight ~= self.highlighted then + play_sound("Roland_frozen_click", highlight and 0 or 0.5, 0.6) end - return orig_click(self, ...) + return ret end local orig_calculate_joker = Card.calculate_joker diff --git a/src/lib/funky.lua b/src/lib/funky.lua index 1967995..4659bb1 100644 --- a/src/lib/funky.lua +++ b/src/lib/funky.lua @@ -220,7 +220,7 @@ end ---@param fpairs? fun(t: table): (fun(table: table, index?: K): K, V) ---@return F|{ [K]: U } ---@nodiscard ----@overload fun(self: F|{ [K]: V }, func: string): F|{ [K]: U } +---@overload fun(self: F|{ [K]: V }, func: string, fpairs?: fun(t: table): (fun(table: table, index?: K): K, V)): F|{ [K]: U } function f:flatmap(func, fpairs) -- local i = 0 local vt, vk, vv, vp @@ -267,10 +267,11 @@ end ---@generic K, V ---@param self F|{ [K]: V } ---@param func F|fun(v: V, k: K): boolean +---@param is? any ---@return F|{ [K]: V } ---@nodiscard ----@overload fun(self: F|{ [K]: V }, func: string): F|{ [K]: V } -function f:where(func) +---@overload fun(self: F|{ [K]: V }, func: string, is?: any): F|{ [K]: V } +function f:where(func, is) func = type(func) == "string" and f.index(func) or func return f.new(function() @@ -283,7 +284,15 @@ function f:where(func) return end - if func(v, k) then + if is == nil then + if func(v, k) then + return k, v + end + elseif is == false then + if not func(v, k) then + return k, v + end + elseif is == func(v, k) then return k, v end end