Skip to content
Snippets Groups Projects
Commit 0e77efc0 authored by DarkGod's avatar DarkGod
Browse files

Mitosis & Call of the Ooze correctly respect maxes

parent 0cfe8448
No related branches found
No related tags found
No related merge requests found
......@@ -84,18 +84,18 @@ gifts_req_high5 = {
level = function(level) return 26 + (level-1) end,
}
function checkMaxSummon(self, silent, div)
function checkMaxSummon(self, silent, div, check_attr)
div = div or 1
local nb = 0
-- Count party members
if game.party:hasMember(self) then
for act, def in pairs(game.party.members) do
if act.summoner and act.summoner == self and act.wild_gift_summon then nb = nb + 1 end
if act.summoner and act.summoner == self and act.wild_gift_summon and (not check_attr or act:attr(check_attr)) then nb = nb + 1 end
end
else
for _, act in pairs(game.level.entities) do
if act.summoner and act.summoner == self and act.wild_gift_summon then nb = nb + 1 end
if act.summoner and act.summoner == self and act.wild_gift_summon and (not check_attr or act:attr(check_attr)) then nb = nb + 1 end
end
end
......
......@@ -162,11 +162,12 @@ newTalent{
points = 5,
equilibrium = 5,
cooldown = 20,
getMax = function(self, t) local _, _, max = checkMaxSummon(self, true) return math.min(max, math.max(1, math.floor(self:combatTalentScale(t, 0.5, 2.5)))) end,
getMax = function(self, t) local _, _, max = checkMaxSummon(self, true) return math.min(max, self:callTalent(self.T_MITOSIS, "getMax"), math.max(1, math.floor(self:combatTalentScale(t, 0.5, 2.5)))) end,
getModHP = function(self, t) return self:combatTalentLimit(t, 1, 0.46, 0.7) end, -- Limit < 1
action = function(self, t)
local ot = self:getTalentFromId(self.T_MITOSIS)
for i = 1, t.getMax(self, t) do
local _, cur_nb, max = checkMaxSummon(self, true, nil, "bloated_ooze")
for i = cur_nb + 1, t.getMax(self, t) do
ot.spawn(self, ot, ot.getMaxHP(self, ot) * t.getModHP(self, t))
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment