Skip to content
Snippets Groups Projects
Commit 7cc2e4ce authored by DarkGod's avatar DarkGod
Browse files

some fix to mirror image

Changed Adept to instead grant a flat +2 to all talent levels
parent 20d8dda9
No related branches found
No related tags found
No related merge requests found
...@@ -6847,6 +6847,7 @@ end ...@@ -6847,6 +6847,7 @@ end
function _M:alterTalentLevelRaw(t, lvl) function _M:alterTalentLevelRaw(t, lvl)
if t.no_unlearn_last then return lvl end -- Those are dangerous, do not change them if t.no_unlearn_last then return lvl end -- Those are dangerous, do not change them
if self.talents_add_levels and self.talents_add_levels[t.id] then lvl = lvl + self.talents_add_levels[t.id] end if self.talents_add_levels and self.talents_add_levels[t.id] then lvl = lvl + self.talents_add_levels[t.id] end
if self:attr("all_talents_bonus_level") then lvl = lvl + self:attr("all_talents_bonus_level") end
if self:attr("spells_bonus_level") and t.is_spell then lvl = lvl + self:attr("spells_bonus_level") end if self:attr("spells_bonus_level") and t.is_spell then lvl = lvl + self:attr("spells_bonus_level") end
if self.talents_add_levels_custom and next(self.talents_add_levels_custom) then if self.talents_add_levels_custom and next(self.talents_add_levels_custom) then
for id, filter in pairs(self.talents_add_levels_custom) do if type(filter) == "function" then for id, filter in pairs(self.talents_add_levels_custom) do if type(filter) == "function" then
......
...@@ -208,6 +208,20 @@ newTalent{ ...@@ -208,6 +208,20 @@ newTalent{
faction = self.faction, faction = self.faction,
summoner = self, summoner = self,
heal = function() return 0 end, -- Cant ever heal heal = function() return 0 end, -- Cant ever heal
useCharge = function(self)
self.charges = self.charges - 1
self.max_life = self.max_charges
self.life = self.charges
if self.charges < 0 then self:die(self) end
end,
callbackOnAct = function(self)
self.max_life = self.max_charges
self.life = self.charges
end,
onTemporaryValueChange = function(self, ...)
self:callbackOnAct()
return mod.class.NPC.onTemporaryValueChange(self, ...)
end,
takeHit = function(self, value, src, death_note) -- Cant ever take more than one damage per turn per actor takeHit = function(self, value, src, death_note) -- Cant ever take more than one damage per turn per actor
if not src then return false, 0 end if not src then return false, 0 end
if src ~= self then if src ~= self then
...@@ -216,7 +230,9 @@ newTalent{ ...@@ -216,7 +230,9 @@ newTalent{
self.turn_procs.mirror_image_dmg = self.turn_procs.mirror_image_dmg or {} self.turn_procs.mirror_image_dmg = self.turn_procs.mirror_image_dmg or {}
self.turn_procs.mirror_image_dmg[src] = true self.turn_procs.mirror_image_dmg[src] = true
end end
return mod.class.NPC.takeHit(self, 1, src, death_note) self:useCharge()
return false, 1
-- return mod.class.NPC.takeHit(self, 1, src, death_note)
end, end,
on_die = function(self) on_die = function(self)
self.summoner:removeEffect(self.summoner.EFF_MIRROR_IMAGE_REAL, true, true) self.summoner:removeEffect(self.summoner.EFF_MIRROR_IMAGE_REAL, true, true)
...@@ -230,6 +246,8 @@ newTalent{ ...@@ -230,6 +246,8 @@ newTalent{
game.zone:addEntity(game.level, image, "actor", tx, ty) game.zone:addEntity(game.level, image, "actor", tx, ty)
image.max_life = t:_getLife(self) image.max_life = t:_getLife(self)
image.life = t:_getLife(self) image.life = t:_getLife(self)
image.max_charges = t:_getLife(self)
image.charges = t:_getLife(self)
-- Clone particles -- Clone particles
for ps, _ in pairs(self.__particles) do for ps, _ in pairs(self.__particles) do
......
...@@ -471,17 +471,11 @@ uberTalent{ ...@@ -471,17 +471,11 @@ uberTalent{
mode = "passive", mode = "passive",
cant_steal = true, cant_steal = true,
info = function(self, t) info = function(self, t)
return ([[Your talent masteries are increased by 0.3. Note that many talents will not benefit from this increase.]]) return ([[You are adept at many different skills, granting you +2 to all talent levels.
:tformat() This works on already known talents and those that you will learn afterwards.]]):tformat()
end, end,
passives = function(self, t, tmptable) passives = function(self, t, p)
self:talentTemporaryValue(tmptable, "talents_mastery_bonus", {all = 0.3}) self:talentTemporaryValue(p, "all_talents_bonus_level", 2)
if not self._updating_adept then
self._updating_adept = true
self:updateAllTalentsPassives()
self._updating_adept = nil
end
end, end,
} }
......
...@@ -4059,7 +4059,8 @@ newEffect{ ...@@ -4059,7 +4059,8 @@ newEffect{
pcall(function() -- Just in case pcall(function() -- Just in case
eff.image:forceUseTalent(ab.id, {force_level=self:getTalentLevelRaw(ab.id), ignore_cd=true, no_talent_fail=true, ignore_energy=true, force_talent_ignore_ressources=true, force_target=tgt}) eff.image:forceUseTalent(ab.id, {force_level=self:getTalentLevelRaw(ab.id), ignore_cd=true, no_talent_fail=true, ignore_energy=true, force_talent_ignore_ressources=true, force_target=tgt})
eff.image:takeHit(1, eff.image) -- eff.image:takeHit(1, eff.image)
eff.image:useCharge()
end) end)
eff.last_talent = true eff.last_talent = true
......
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