diff --git a/manifest.json b/manifest.json index e4cf995..ac84076 100644 --- a/manifest.json +++ b/manifest.json @@ -12,5 +12,5 @@ "Bakery (>=0.1.26~*)" ], "conflicts": ["Jen"], - "version": "0.2.1" + "version": "0.2.2" } \ No newline at end of file diff --git a/src/main.lua b/src/main.lua index e9df530..03a2db3 100644 --- a/src/main.lua +++ b/src/main.lua @@ -226,6 +226,16 @@ function Game:update(dt) 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 config = { 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_descending"].mult = math.floor(8 * math.sqrt(blind)) / blind - local honey = SMODS.find_card("j_jane_honey") + while true do + 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 not v.ability.extra.is_corrupted and v ~= honey[#honey] then - v.sell_cost = v.sell_cost + honey[#honey].sell_cost - v.ability.extra.is_corrupted = true - honey[#honey]:start_dissolve() - honey[#honey] = nil + if second then + honey[first].sell_cost = v.sell_cost + honey[second].sell_cost + honey[first].ability.extra.is_corrupted = true + honey[second]:start_dissolve() + else + break end end