Alter Orrery Deck

This commit is contained in:
Emik 2025-03-27 16:34:45 +01:00
parent f62f40e889
commit 4505bc2d7c
Signed by untrusted user who does not match committer: emik
GPG key ID: 09CDFF9E5703688D
2 changed files with 24 additions and 24 deletions

View file

@ -58,20 +58,19 @@ SMODS.Back {
loc_txt = { loc_txt = {
name = "Orrery Deck", name = "Orrery Deck",
text = { text = {
"All hands start at", "{C:attention}Hand stats {}are",
"{X:chips,C:white}150{C:mult} X {X:red,C:white}1{} and", "always " .. (Cryptid and "{C:cry_ascendant}" or "{C:attention}") .. "equalized",
"{C:cry_ascendant}equalised {}whenever",
"their {C:chips}Chips{}, {C:mult}Mult{},",
"or {C:planet}level {C:attention}change",
} }
}, },
apply = function(_) apply = function(_)
Jane.q(function() Jane.q(function()
G.GAME.orrery = {chips = 150, hands = {}, level = 1, mult = 1} local orrery = {}
G.GAME.orrery = orrery
for _, v in pairs(G.GAME.hands) do for k, v in pairs(G.GAME.hands) do
v.mult = G.GAME.orrery.mult v.mult = 1
v.chips = G.GAME.orrery.chips v.chips = 150
orrery[k] = {chips = v.chips, level = v.level, mult = v.mult}
end end
save_run() save_run()

View file

@ -256,21 +256,21 @@ function Game:update(dt)
local pools = {chips = 0, level = 0, mult = 0} local pools = {chips = 0, level = 0, mult = 0}
for k, v in pairs(G.GAME.hands) do for k, v in pairs(G.GAME.hands) do
if k ~= "cry_WholeDeck" then if orrery[k] and
if orrery.hands[k] and orrery.hands[k] ~= v then (orrery[k].mult ~= v.mult or
orrery[k].chips ~= v.chips or
orrery[k].level ~= v.level) then
inequalities = inequalities + 1 inequalities = inequalities + 1
end end
count = count + 1 count = count + 1
orrery.hands[k] = v
hands[#hands + 1] = v hands[#hands + 1] = v
pools.mult = v.mult + pools.mult pools.mult = v.mult + pools.mult
pools.chips = v.chips + pools.chips pools.chips = v.chips + pools.chips
pools.level = v.level + pools.level pools.level = v.level + pools.level
end end
end
if pools.mult == orrery.mult and pools.chips == orrery.chips and pools.level == orrery.level then if inequalities == 0 then
return return
end end
@ -283,9 +283,10 @@ function Game:update(dt)
v.level = math.floor(pools.level / count) + (small(pools.level % count) >= i and 1 or 0) v.level = math.floor(pools.level / count) + (small(pools.level % count) >= i and 1 or 0)
end end
orrery.mult = pools.mult for k, v in pairs(G.GAME.hands) do
orrery.chips = pools.chips orrery[k] = {chips = v.chips, level = v.level, mult = v.mult}
orrery.level = pools.level end
hand(localize("k_all_hands"), math.floor(pools.chips / count), math.floor(pools.mult / count), math.floor(pools.level / count)) hand(localize("k_all_hands"), math.floor(pools.chips / count), math.floor(pools.mult / count), math.floor(pools.level / count))
delay(1) delay(1)
update_hand_text({sound = "button", volume = 0.7, pitch = 1.1, delay = 0}, {mult = 0, chips = 0, handname = "", level = ""}) update_hand_text({sound = "button", volume = 0.7, pitch = 1.1, delay = 0}, {mult = 0, chips = 0, handname = "", level = ""})