Add blind dev-art
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
|
@ -60,6 +60,10 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Blind = {
|
Blind = {
|
||||||
|
bl_Roland_blizzard = {
|
||||||
|
name = "The Blizzard",
|
||||||
|
text = {"All cards", "are Frozen"},
|
||||||
|
},
|
||||||
bl_Roland_divide = {
|
bl_Roland_divide = {
|
||||||
name = "The Great Divide",
|
name = "The Great Divide",
|
||||||
text = {"Half of the deck", "is discarded"},
|
text = {"Half of the deck", "is discarded"},
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,20 @@ local function has_enhancement(card)
|
||||||
return not not (e and next(e))
|
return not not (e and next(e))
|
||||||
end
|
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)
|
local function sort_by_enhancement(v1, v2)
|
||||||
return has_enhancement(v1) and not has_enhancement(v2)
|
return has_enhancement(v1) and not has_enhancement(v2)
|
||||||
end
|
end
|
||||||
|
|
@ -210,6 +224,29 @@ blind {
|
||||||
end,
|
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 {
|
blind {
|
||||||
key = "tranquilizer",
|
key = "tranquilizer",
|
||||||
boss = {min = 6},
|
boss = {min = 6},
|
||||||
|
|
|
||||||
|
|
@ -102,18 +102,21 @@ function play_sound(sound, pitch, ...)
|
||||||
pseudorandom_element(frozen_sounds, pseudoseed "Roland_frozen") or
|
pseudorandom_element(frozen_sounds, pseudoseed "Roland_frozen") or
|
||||||
sound
|
sound
|
||||||
|
|
||||||
local overriden_pitch = pseudorandom(pseudoseed "Roland_frozen_pitch") / 2 + 1.3
|
local added_pitch = pseudorandom(pseudoseed "Roland_frozen_pitch") / 4 + 0.8
|
||||||
return orig_play_sound(overriden_sound, overriden_pitch, ...)
|
return orig_play_sound(overriden_sound, pitch + added_pitch, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
local orig_click = Card.click
|
local orig_click = Card.click
|
||||||
|
|
||||||
function Card:click(...)
|
function Card:click(...)
|
||||||
if self.edition and self.edition.Roland_frozen then
|
local highlight = self.highlighted
|
||||||
play_sound("Roland_frozen_click", nil, 0.6)
|
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
|
end
|
||||||
|
|
||||||
return orig_click(self, ...)
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
local orig_calculate_joker = Card.calculate_joker
|
local orig_calculate_joker = Card.calculate_joker
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ end
|
||||||
---@param fpairs? fun(t: table<K, V>): (fun(table: table<K, V>, index?: K): K, V)
|
---@param fpairs? fun(t: table<K, V>): (fun(table: table<K, V>, index?: K): K, V)
|
||||||
---@return F|{ [K]: U }
|
---@return F|{ [K]: U }
|
||||||
---@nodiscard
|
---@nodiscard
|
||||||
---@overload fun(self: F|{ [K]: V }, func: string): F|{ [K]: U }
|
---@overload fun(self: F|{ [K]: V }, func: string, fpairs?: fun(t: table<K, V>): (fun(table: table<K, V>, index?: K): K, V)): F|{ [K]: U }
|
||||||
function f:flatmap(func, fpairs)
|
function f:flatmap(func, fpairs)
|
||||||
-- local i = 0
|
-- local i = 0
|
||||||
local vt, vk, vv, vp
|
local vt, vk, vv, vp
|
||||||
|
|
@ -267,10 +267,11 @@ end
|
||||||
---@generic K, V
|
---@generic K, V
|
||||||
---@param self F|{ [K]: V }
|
---@param self F|{ [K]: V }
|
||||||
---@param func F|fun(v: V, k: K): boolean
|
---@param func F|fun(v: V, k: K): boolean
|
||||||
|
---@param is? any
|
||||||
---@return F|{ [K]: V }
|
---@return F|{ [K]: V }
|
||||||
---@nodiscard
|
---@nodiscard
|
||||||
---@overload fun(self: F|{ [K]: V }, func: string): F|{ [K]: V }
|
---@overload fun(self: F|{ [K]: V }, func: string, is?: any): F|{ [K]: V }
|
||||||
function f:where(func)
|
function f:where(func, is)
|
||||||
func = type(func) == "string" and f.index(func) or func
|
func = type(func) == "string" and f.index(func) or func
|
||||||
|
|
||||||
return f.new(function()
|
return f.new(function()
|
||||||
|
|
@ -283,7 +284,15 @@ function f:where(func)
|
||||||
return
|
return
|
||||||
end
|
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
|
return k, v
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||