Use more intuitive logic for merging jokers
This commit is contained in:
parent
0cea7728fe
commit
39d429e56d
2 changed files with 21 additions and 8 deletions
|
|
@ -12,5 +12,5 @@
|
||||||
"Bakery (>=0.1.26~*)"
|
"Bakery (>=0.1.26~*)"
|
||||||
],
|
],
|
||||||
"conflicts": ["Jen"],
|
"conflicts": ["Jen"],
|
||||||
"version": "0.2.1"
|
"version": "0.2.2"
|
||||||
}
|
}
|
||||||
25
src/main.lua
25
src/main.lua
|
|
@ -226,6 +226,16 @@ function Game:update(dt)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function find_uncorrupted(obj, start)
|
||||||
|
for i = start, #obj do
|
||||||
|
if not obj[i].ability.extra.is_corrupted then
|
||||||
|
return i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
local function hand(name, chip, mul, lv, notif, snd, vol, pit, de)
|
local function hand(name, chip, mul, lv, notif, snd, vol, pit, de)
|
||||||
local config = {
|
local config = {
|
||||||
delay = de or 0.3,
|
delay = de or 0.3,
|
||||||
|
|
@ -329,14 +339,17 @@ function Game:update(dt)
|
||||||
G.P_BLINDS["bl_jane_wee"].mult = 22 / blind
|
G.P_BLINDS["bl_jane_wee"].mult = 22 / blind
|
||||||
G.P_BLINDS["bl_jane_descending"].mult = math.floor(8 * math.sqrt(blind)) / blind
|
G.P_BLINDS["bl_jane_descending"].mult = math.floor(8 * math.sqrt(blind)) / blind
|
||||||
|
|
||||||
|
while true do
|
||||||
local honey = SMODS.find_card("j_jane_honey")
|
local honey = SMODS.find_card("j_jane_honey")
|
||||||
|
local first = find_uncorrupted(honey, 1)
|
||||||
|
local second = find_uncorrupted(honey, first)
|
||||||
|
|
||||||
for _, v in ipairs(honey) do
|
if second then
|
||||||
if not v.ability.extra.is_corrupted and v ~= honey[#honey] then
|
honey[first].sell_cost = v.sell_cost + honey[second].sell_cost
|
||||||
v.sell_cost = v.sell_cost + honey[#honey].sell_cost
|
honey[first].ability.extra.is_corrupted = true
|
||||||
v.ability.extra.is_corrupted = true
|
honey[second]:start_dissolve()
|
||||||
honey[#honey]:start_dissolve()
|
else
|
||||||
honey[#honey] = nil
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue