Add dedicated Estate support
This commit is contained in:
parent
11120727f6
commit
d219e79c89
4 changed files with 69 additions and 5 deletions
|
|
@ -260,7 +260,7 @@ return {
|
||||||
},
|
},
|
||||||
j_Roland_suitable = {
|
j_Roland_suitable = {
|
||||||
name = "Suitable",
|
name = "Suitable",
|
||||||
text = {"{V:1}#1# {}are {C:attention}Wild", "Suit changes every round"},
|
text = {"{V:1}#1# {}are {C:attention}Wild", "Suit changes", "every round"},
|
||||||
},
|
},
|
||||||
j_Roland_sunny = {
|
j_Roland_sunny = {
|
||||||
name = "Sunny Side Up",
|
name = "Sunny Side Up",
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ local frozen_sounds = f(4):map(frozen_sound):map("key"):table()
|
||||||
|
|
||||||
local needs_chip_mult_override = {
|
local needs_chip_mult_override = {
|
||||||
Bull = true,
|
Bull = true,
|
||||||
Estate = true,
|
|
||||||
Erosion = true,
|
Erosion = true,
|
||||||
Misprint = true,
|
Misprint = true,
|
||||||
TierList = true,
|
TierList = true,
|
||||||
|
|
@ -36,6 +35,7 @@ local current_round_overrides = {
|
||||||
Obelisk = "most_played_poker_hand",
|
Obelisk = "most_played_poker_hand",
|
||||||
["Ancient Joker"] = "ancient_card",
|
["Ancient Joker"] = "ancient_card",
|
||||||
Wherewolf = "Bakery_Wherewolf_card",
|
Wherewolf = "Bakery_Wherewolf_card",
|
||||||
|
j_Roland_suitable = "Roland_suitable",
|
||||||
}
|
}
|
||||||
|
|
||||||
SMODS.current_mod.frozen_chip_mult = needs_chip_mult_override
|
SMODS.current_mod.frozen_chip_mult = needs_chip_mult_override
|
||||||
|
|
@ -83,6 +83,7 @@ SMODS.Edition {
|
||||||
freeze(card)
|
freeze(card)
|
||||||
end,
|
end,
|
||||||
on_remove = function(card)
|
on_remove = function(card)
|
||||||
|
card.Roland_frozen_estate = nil
|
||||||
card.Roland_frozen_ability = nil
|
card.Roland_frozen_ability = nil
|
||||||
end,
|
end,
|
||||||
get_weight = function(self)
|
get_weight = function(self)
|
||||||
|
|
@ -155,8 +156,6 @@ function Card:calculate_joker(context, ...)
|
||||||
ability.Roland_frozen_mult_mod or
|
ability.Roland_frozen_mult_mod or
|
||||||
ability.Roland_frozen_chip_mod or
|
ability.Roland_frozen_chip_mod or
|
||||||
ability.Roland_frozen_xmult,
|
ability.Roland_frozen_xmult,
|
||||||
(ability.Roland_frozen_mult_mod and ability.Roland_frozen_chip_mod) and
|
|
||||||
ability.Roland_frozen_chip_mod or nil,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -182,6 +181,57 @@ function Card:calculate_dollar_bonus(...)
|
||||||
return orig_calculate_dollar_bonus(self, ...)
|
return orig_calculate_dollar_bonus(self, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
q(function()
|
||||||
|
local estate = G.P_CENTERS.j_Bakery_Estate
|
||||||
|
|
||||||
|
if not estate then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local function estate_pos(card)
|
||||||
|
if card.area ~= G.jokers and card.area.config.type ~= "title" then
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
card.Roland_frozen_estate = card.Roland_frozen_estate and
|
||||||
|
card.Roland_frozen_estate or
|
||||||
|
(f(card.area.cards):swap():any(function(_, k)
|
||||||
|
return k == card
|
||||||
|
end) or 1)
|
||||||
|
|
||||||
|
return card.Roland_frozen_estate
|
||||||
|
end
|
||||||
|
|
||||||
|
local orig_calculate = estate.calculate
|
||||||
|
|
||||||
|
---@param card Card|{ Roland_frozen_ability: table, Roland_frozen_estate: integer }
|
||||||
|
function estate:calculate(card, context, ...)
|
||||||
|
if not card or not card.edition or not card.edition.Roland_frozen then
|
||||||
|
return orig_calculate(self, card, context, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not context.joker_main then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local joker_count = estate_pos(card)
|
||||||
|
local extra = card.ability.extra or {}
|
||||||
|
return {chips = extra.chips * joker_count, mult = extra.mult * joker_count}
|
||||||
|
end
|
||||||
|
|
||||||
|
local orig_loc_vars = estate.loc_vars
|
||||||
|
|
||||||
|
function estate:loc_vars(info_queue, card, ...)
|
||||||
|
if not card or not card.edition or not card.edition.Roland_frozen then
|
||||||
|
return orig_loc_vars(self, info_queue, card, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
local joker_count = estate_pos(card)
|
||||||
|
local extra = card.ability.extra or {}
|
||||||
|
return {vars = {extra.chips * joker_count, extra.mult * joker_count}}
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
q(function()
|
q(function()
|
||||||
local proxy = G.P_CENTERS.j_Bakery_Proxy
|
local proxy = G.P_CENTERS.j_Bakery_Proxy
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -604,7 +604,7 @@ function SMODS.get_enhancements(card, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
local ret = orig_get_enhancements(card, ...) or {}
|
local ret = orig_get_enhancements(card, ...) or {}
|
||||||
table.insert(ret, "m_wild")
|
ret.m_wild = true
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -342,6 +342,20 @@ function f:values()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@generic K, V
|
||||||
|
---@param self F|{ [K]: V }
|
||||||
|
---@return F|{ [V]: K }
|
||||||
|
---@nodiscard
|
||||||
|
function f:swap()
|
||||||
|
return f.new(function()
|
||||||
|
local k, v = self:next()
|
||||||
|
|
||||||
|
if k ~= nil then
|
||||||
|
return v, k
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
---@generic K, V
|
---@generic K, V
|
||||||
---@param self F|{ [K]: V }
|
---@param self F|{ [K]: V }
|
||||||
---@param skip? integer
|
---@param skip? integer
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue