Compare commits

..

No commits in common. "386db180b5a3251d2a1e78ee55b2a2ce35d538f7" and "860381ebff646bc1228ea7c2ab3315cc1be1983a" have entirely different histories.

3 changed files with 3 additions and 59 deletions

View file

@ -3,7 +3,7 @@
"id": "Roland",
"name": "Roland",
"prefix": "Roland",
"version": "2.9.44",
"version": "2.9.42",
"badge_colour": "8BE9FD",
"display_name": "Roland",
"main_file": "src/main.lua",

View file

@ -54,22 +54,9 @@ local function freeze(card)
end
(card.ability or {}).Roland_crimson = not not (card.ability or {}).Roland_crimson
local config = card.config or {}
card.Roland_frozen_base = card.Roland_frozen_base or copy(card.base)
card.Roland_frozen_card = card.Roland_frozen_card or copy(config.card)
card.Roland_frozen_ability = card.Roland_frozen_ability or copy(card.ability)
card.base = card.Roland_frozen_base and copy(card.Roland_frozen_base) or card.base
config.card = card.Roland_frozen_card and copy(card.Roland_frozen_card) or config.card
card.ability = card.Roland_frozen_ability and copy(card.Roland_frozen_ability) or card.ability
card.Roland_frozen = card.Roland_frozen or {probability = SMODS.get_probability_vars(card, 1, 1)}
if type(card.set_sprites) == "function" and
f(card.Roland_frozen_card):diff(config.card) then
card:set_sprites(card.config.center, card.config.card)
end
local ability, ret = card.ability, card.Roland_frozen_ability
ability.extra = ability.extra == nil and {} or ability.extra
@ -209,14 +196,10 @@ SMODS.Edition {
local _ = not context.fix_probability and not context.mod_probability and freeze(card)
end,
on_remove = function(card)
card.Roland_frozen,
card.Roland_frozen_base,
card.Roland_frozen_card,
card.Roland_frozen_ability,
card.Roland_frozen_current_round = nil, nil, nil, nil, nil
card.Roland_frozen, card.Roland_frozen_ability, card.Roland_frozen_current_round = nil, nil, nil
end,
get_weight = function(self)
return self.weight * G.GAME.edition_rate
return G.GAME.edition_rate * self.weight
end,
}
@ -248,30 +231,6 @@ function Card:click(...)
return ret
end
local orig_save = Card.save
function Card:save(...)
if false then
---@type Card|{Roland_frozen: table, Roland_frozen_ability: table, Roland_frozen_base: table, Roland_frozen_card: table, Roland_frozen_current_round: table}
self = self
end
local ret = orig_save(self, ...)
ret.Roland_frozen,
ret.Roland_frozen_base,
ret.Roland_frozen_card,
ret.Roland_frozen_ability,
ret.Roland_frozen_current_round =
self.Roland_frozen,
self.Roland_frozen_base,
self.Roland_frozen_card,
self.Roland_frozen_ability,
self.Roland_frozen_current_round
return ret
end
local orig_calculate_joker = Card.calculate_joker
---@param self Card|{Roland_frozen_ability?: table}

View file

@ -289,7 +289,6 @@ function f.new(fnext)
concat = f.concat,
const = f.const,
count = f.count,
diff = f.diff,
each = f.each,
eq = f.eq,
fals = f.fals,
@ -719,20 +718,6 @@ function f:count(func)
return ret
end
---@generic K, V
---@param self F|{ [K]: V }
---@param other { [K]: V }
---@return K?
---@overload fun(self: F|{ [K]: V }, func: string): integer
---@nodiscard
function f:diff(other)
for k, v in self.next do
if other[k] ~= v then
return k
end
end
end
---@generic K, V, T
---@param self F|{ [K]: V }
---@param _ `T`