Alter Orrery Deck
This commit is contained in:
parent
f62f40e889
commit
4505bc2d7c
2 changed files with 24 additions and 24 deletions
17
src/back.lua
17
src/back.lua
|
|
@ -58,20 +58,19 @@ SMODS.Back {
|
|||
loc_txt = {
|
||||
name = "Orrery Deck",
|
||||
text = {
|
||||
"All hands start at",
|
||||
"{X:chips,C:white}150{C:mult} X {X:red,C:white}1{} and",
|
||||
"{C:cry_ascendant}equalised {}whenever",
|
||||
"their {C:chips}Chips{}, {C:mult}Mult{},",
|
||||
"or {C:planet}level {C:attention}change",
|
||||
"{C:attention}Hand stats {}are",
|
||||
"always " .. (Cryptid and "{C:cry_ascendant}" or "{C:attention}") .. "equalized",
|
||||
}
|
||||
},
|
||||
apply = 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
|
||||
v.mult = G.GAME.orrery.mult
|
||||
v.chips = G.GAME.orrery.chips
|
||||
for k, v in pairs(G.GAME.hands) do
|
||||
v.mult = 1
|
||||
v.chips = 150
|
||||
orrery[k] = {chips = v.chips, level = v.level, mult = v.mult}
|
||||
end
|
||||
|
||||
save_run()
|
||||
|
|
|
|||
31
src/main.lua
31
src/main.lua
|
|
@ -256,21 +256,21 @@ function Game:update(dt)
|
|||
local pools = {chips = 0, level = 0, mult = 0}
|
||||
|
||||
for k, v in pairs(G.GAME.hands) do
|
||||
if k ~= "cry_WholeDeck" then
|
||||
if orrery.hands[k] and orrery.hands[k] ~= v then
|
||||
inequalities = inequalities + 1
|
||||
end
|
||||
|
||||
count = count + 1
|
||||
orrery.hands[k] = v
|
||||
hands[#hands + 1] = v
|
||||
pools.mult = v.mult + pools.mult
|
||||
pools.chips = v.chips + pools.chips
|
||||
pools.level = v.level + pools.level
|
||||
if orrery[k] and
|
||||
(orrery[k].mult ~= v.mult or
|
||||
orrery[k].chips ~= v.chips or
|
||||
orrery[k].level ~= v.level) then
|
||||
inequalities = inequalities + 1
|
||||
end
|
||||
|
||||
count = count + 1
|
||||
hands[#hands + 1] = v
|
||||
pools.mult = v.mult + pools.mult
|
||||
pools.chips = v.chips + pools.chips
|
||||
pools.level = v.level + pools.level
|
||||
end
|
||||
|
||||
if pools.mult == orrery.mult and pools.chips == orrery.chips and pools.level == orrery.level then
|
||||
if inequalities == 0 then
|
||||
return
|
||||
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)
|
||||
end
|
||||
|
||||
orrery.mult = pools.mult
|
||||
orrery.chips = pools.chips
|
||||
orrery.level = pools.level
|
||||
for k, v in pairs(G.GAME.hands) do
|
||||
orrery[k] = {chips = v.chips, level = v.level, mult = v.mult}
|
||||
end
|
||||
|
||||
hand(localize("k_all_hands"), math.floor(pools.chips / count), math.floor(pools.mult / count), math.floor(pools.level / count))
|
||||
delay(1)
|
||||
update_hand_text({sound = "button", volume = 0.7, pitch = 1.1, delay = 0}, {mult = 0, chips = 0, handname = "", level = ""})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue