From 2e5be3f2ca71d84537a3bba7f29986553c732ab3 Mon Sep 17 00:00:00 2001 From: Shibari <ShibariTOME@Gmail.com> Date: Mon, 22 Jan 2018 13:13:30 -0500 Subject: [PATCH] Revise and bug fix Defiler talents --- game/modules/tome/data/damage_types.lua | 16 +++++ .../tome/data/talents/corruptions/blight.lua | 15 +++-- .../tome/data/talents/corruptions/blood.lua | 58 +++++++++++-------- .../tome/data/talents/corruptions/bone.lua | 26 +++++---- .../tome/data/talents/corruptions/curses.lua | 2 +- .../tome/data/talents/corruptions/plague.lua | 4 +- .../data/talents/corruptions/sanguisuge.lua | 3 +- .../tome/data/talents/corruptions/torment.lua | 31 +++++++--- .../data/talents/corruptions/vile-life.lua | 12 +++- .../tome/data/timed_effects/magical.lua | 13 ++++- 10 files changed, 121 insertions(+), 59 deletions(-) diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index 88e904d335..333d06415e 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -2446,6 +2446,22 @@ newDamageType{ end, } +-- Used by Blood Grasp, heal+temporary max life based on damage +newDamageType{ + name = "sanguine blight", type = "SANGUINE", text_color = "#DARK_GREEN#", + projector = function(src, x, y, type, dam, state) + state = initState(state) + useImplicitCrit(src, state) + if _G.type(dam) == "number" then dam = {dam=dam} end + local target = game.level.map(x, y, Map.ACTOR) -- Get the target first to make sure we heal even on kill + local dealt = DamageType:get(DamageType.BLIGHT).projector(src, x, y, DamageType.BLIGHT, dam.dam, state) + if dealt > 0 then + src:setEffect(src.EFF_BLOOD_GRASP, 7, {life = dealt * 0.5} ) + src:heal(dealt * 0.2, src) + end + return dealt + end, +} -- Drain Vim newDamageType{ name = "vim draining blight", type = "DRAIN_VIM", text_color = "#DARK_GREEN#", diff --git a/game/modules/tome/data/talents/corruptions/blight.lua b/game/modules/tome/data/talents/corruptions/blight.lua index 9a2e2fb5c1..cf33e79b26 100644 --- a/game/modules/tome/data/talents/corruptions/blight.lua +++ b/game/modules/tome/data/talents/corruptions/blight.lua @@ -29,7 +29,7 @@ newTalent{ activate = function(self, t) game:playSoundNear(self, "talents/slime") local ret = { - per = self:addTemporaryValue("combat_critical_power", self:combatTalentSpellDamage(t, 20, 60)), + per = self:addTemporaryValue("combat_critical_power", self:combatTalentSpellDamage(t, 20, 50)), } if core.shader.active() then local h1x, h1y = self:attachementSpot("head", true) if h1x then self:talentParticles(ret, {type="circle", args={toback=true, shader=true, oversize=0.7, a=225, appear=8, speed=0, img="dark_ritual_aura", base_rot=0, radius=0, x=h1x, y=h1y}}) end @@ -43,7 +43,7 @@ newTalent{ info = function(self, t) return ([[Increases your spell critical damage multiplier by %d%%. The multiplier will increase with your Spellpower.]]): - format(self:combatTalentSpellDamage(t, 20, 60)) + format(self:combatTalentSpellDamage(t, 20, 50)) end, } @@ -125,7 +125,7 @@ newTalent{ cooldown = 12, vim = 12, range = 10, - getResist = function(self, t) return math.ceil(self:combatTalentScale(t, 8, 35)) end, + getResist = function(self, t) return math.ceil(self:combatTalentScale(t, 3, 20)) end, getPercent = function(self, t) return self:combatTalentSpellDamage(t, 12, 45) end, -- Scaling? getDamage = function(self, t) return self:combatTalentSpellDamage(t, 20, 60) end, tactical = { ATTACK = {ACID = 2}, DISABLE = 1 }, @@ -158,7 +158,7 @@ newTalent{ vim = 28, cooldown = 24, range = 0, - radius = 5, + radius = 4, tactical = { ATTACKAREA = {BLIGHT = 3}, DISABLE = 2 }, target = function(self, t) return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)} @@ -172,7 +172,6 @@ newTalent{ local fail = 50*power/(power + 26) -- Limit < 50% chance return power, heal_factor, fail end, - getPoisonPenetration = function(self, t) return self:combatTalentLimit(t, 100, 15, 75) end, getPoison = function(self,t) if self:getTalentLevel(t) >= 6 then return 4 elseif self:getTalentLevel(t) >= 4 then return 3 @@ -189,7 +188,7 @@ newTalent{ -- Add a lasting map effect game.level.map:addEffect(self, self.x, self.y, duration, - DamageType.BLIGHT_POISON, {dam=dam, power=power, heal_factor=heal_factor, fail=fail, penetration=t.getPoisonPenetration(self,t), poison=t.getPoison(self,t), apply_power=actor:combatSpellpower()}, + DamageType.BLIGHT_POISON, {dam=dam, power=power, heal_factor=heal_factor, fail=fail, penetration=0, poison=t.getPoison(self,t), apply_power=actor:combatSpellpower()}, radius, 5, nil, MapEffect.new{ @@ -209,13 +208,13 @@ newTalent{ info = function(self, t) local dam = damDesc(self, DamageType.BLIGHT, t.getDamage(self,t)) local power, heal_factor, fail = t.getEffects(self, t) - return ([[A furious storm of blighted poison rages around the caster in a radius of %d for %d turns. Each creature hit by the storm takes %0.2f blight damage and is poisoned for %0.2f blight damage over 4 turns. The blight poison is especially virulent, and has a %d%% chance to ignore poison immunity. + return ([[A furious storm of blighted poison rages around the caster in a radius of %d for %d turns. Each creature hit by the storm takes %0.2f blight damage and is poisoned for %0.2f blight damage over 4 turns. At talent level 2 you have a chance to inflict Insidious Blight, which reduces healing by %d%%. At talent level 4 you have a chance to inflict Numbing Blight, which reduces all damage dealt by %d%%. At talent level 6 you have a chance to inflict Crippling Blight, which causes talents to have a %d%% chance of failure. Each possible effect is equally likely. The poison damage dealt is capable of a critical strike. The damage will increase with your Spellpower.]]): - format(self:getTalentRadius(t), t.getDuration(self, t), dam/4, dam, t.getPoisonPenetration(self,t), heal_factor, power, fail) + format(self:getTalentRadius(t), t.getDuration(self, t), dam/4, dam, heal_factor, power, fail) end, } \ No newline at end of file diff --git a/game/modules/tome/data/talents/corruptions/blood.lua b/game/modules/tome/data/talents/corruptions/blood.lua index 6b6ceb3c4c..cf38a8e395 100644 --- a/game/modules/tome/data/talents/corruptions/blood.lua +++ b/game/modules/tome/data/talents/corruptions/blood.lua @@ -56,7 +56,6 @@ newTalent{ end, } --- Finish me pls newTalent{ name = "Blood Grasp", type = {"corruption/blood", 2}, @@ -68,33 +67,23 @@ newTalent{ proj_speed = 20, tactical = { ATTACK = {BLIGHT = 1.75}, HEAL = {BLIGHT = 1}}, -- damage to foe heals self requires_target = true, + getDamage = function(self, t) return self:combatTalentSpellDamage(t, 10, 190) end, target = function(self, t) - return {type="bolt", range=self:getTalentRange(t), talent=t, display={particle="bolt_blood"}} + return {type="bolt", range=self:getTalentRange(t), selffire=false, friendlyfire=false, talent=t, display={particle="bolt_blood"}} end, action = function(self, t) local tg = self:getTalentTarget(t) local x, y = self:getTarget(tg) if not x or not y then return nil end - local dt = function(px, py) - local target = game.level.map(px, py, engine.Map.ACTOR) - if not target then return end - - local damage = DamageType:get(DamageType.BLIGHT).projector(self, target.x, target.y, DamageType.BLIGHT, self:combatTalentSpellDamage(t, 10, 190)) - local heal = damage / 2 - self:setEffect(self.EFF_BLOOD_GRASP, 5, {life = heal} ) - self:heal(heal, self) - --local _ _, _, _, x, y = self:canProject(tg, x, y) - --{dam=self:spellCrit(self:combatTalentSpellDamage(t, 10, 290)), healfactor=0.5} - -- game.level.map:particleEmitter(self.x, self.y, 10, "bone_spear", {tx=target.x - self.x, ty=target.y - self.y}) - end - self:projectile(tg, x, y, dt, nil, {type="blood"}) + local damage = self:spellCrit(t.getDamage(self, t)) + self:projectile(tg, x, y, DamageType.SANGUINE, {dam=damage}, {type="blood"}) game:playSoundNear(self, "talents/slime") return true end, info = function(self, t) - return ([[Project a bolt of corrupted blood, doing %0.2f blight damage and healing you for half the damage dealt. - Half the damage dealt will be gained as maximum life for 5 turns. - The damage will increase with your Spellpower.]]):format(damDesc(self, DamageType.BLIGHT, self:combatTalentSpellDamage(t, 10, 290))) + return ([[Project a bolt of corrupted blood, doing %0.2f blight damage and healing you for 20%% the damage dealt. + 50%% of the damage dealt will be gained as maximum life for 7 turns (before the healing). + The damage will increase with your Spellpower.]]):format(damDesc(self, DamageType.BLIGHT, t.getDamage(self, t))) end, } @@ -103,25 +92,44 @@ newTalent{ type = {"corruption/blood", 3}, require = corrs_req3, points = 5, - cooldown = 12, + cooldown = 8, vim = 30, - tactical = { ATTACKAREA = {BLIGHT = 2}, DISABLE = 1 }, + tactical = { ATTACKAREA = {BLIGHT = 0.5} }, -- Needs a better tactical table, setting to low priority for now so it gets used later in the rotation when diseases are up range = 0, - radius = function(self, t) return math.floor(self:combatTalentScale(t, 3, 7)) end, + radius = function(self, t) return 10 end, + getDamage = function(self, t) return self:combatTalentSpellDamage(t, 10, 250) end, + getSlow = function(self, t) return self:combatTalentLimit(t, 100, 20, 70) end, + getHeal = function(self, t) return self:combatTalentSpellDamage(t, 10, 90) end, requires_target = true, target = function(self, t) - return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=false, talent=t} + return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=false, friendlyfire=false, talent=t} end, action = function(self, t) local tg = self:getTalentTarget(t) - self:project(tg, self.x, self.y, DamageType.BLOOD_BOIL, self:spellCrit(self:combatTalentSpellDamage(t, 28, 190))) + local x, y = self.x, self.y + local damage = self:spellCrit(t.getDamage(self, t)) + local slow = t.getSlow(self, t) / 100 + local heal = t.getHeal(self, t) + local amount = 0 + self:project(tg, x, y, function(px, py) + local target = game.level.map(px, py, Map.ACTOR) + if not target then return end + local eff = target:removeEffectsFilter(function(e) return e.subtype.poison or e.subtype.disease or e.subtype.wound end, 1) + if eff and eff > 0 then + local dealt = DamageType:get(DamageType.BLIGHT).projector(self, target.x, target.y, DamageType.BLIGHT, damage) + target:setEffect(target.EFF_SLOW, 5, {src=self, power=slow}) + amount = amount + 1 + end + end) + if amount > 0 then self:heal(heal * amount, self) end game.level.map:particleEmitter(self.x, self.y, tg.radius, "circle", {oversize=1, a=180, appear=8, limit_life=8, speed=-3, img="blood_circle", radius=tg.radius}) game:playSoundNear(self, "talents/slime") return true end, info = function(self, t) - return ([[Make the blood of all creatures around you in radius %d boil, doing %0.2f blight damage and slowing them by 20%%. - The damage will increase with your Spellpower.]]):format(self:getTalentRadius(t), damDesc(self, DamageType.BLIGHT, self:combatTalentSpellDamage(t, 28, 190))) + return ([[Make the impure blood of all creatures around you in radius %d boil. + Each enemy afflicted by a disease, poison, or wound will have one removed at random dealing %0.2f blight damage, healing you for %d, and slowing them by %d%% for 5 turns. + The damage will increase with your Spellpower.]]):format(self:getTalentRadius(t), damDesc(self, DamageType.BLIGHT, t.getDamage(self, t)), t.getHeal(self, t), t.getSlow(self, t)) end, } diff --git a/game/modules/tome/data/talents/corruptions/bone.lua b/game/modules/tome/data/talents/corruptions/bone.lua index b8502c47e2..63b756f775 100644 --- a/game/modules/tome/data/talents/corruptions/bone.lua +++ b/game/modules/tome/data/talents/corruptions/bone.lua @@ -45,9 +45,8 @@ newTalent{ if not target then return end local effs = #target:effectsFilter({status="detrimental", type="magical"}) local damage = dam * (1 + t.getBonus(self, t) * effs) - game.log(tostring(damage)..", "..tostring(dam)..", "..tostring(effs)) DamageType:get(DamageType.PHYSICAL).projector(self, tx, ty, DamageType.PHYSICAL, damage) - end) + end) local _ _, _, _, x, y = self:canProject(tg, x, y) game.level.map:particleEmitter(self.x, self.y, tg.range, "bone_spear", {tx=x - self.x, ty=y - self.y}) game:playSoundNear(self, "talents/arcane") @@ -126,7 +125,6 @@ newTalent{ end, } --- Fix breaking Movement newTalent{ name = "Bone Spike", type = {"corruption/bone", 3}, @@ -145,13 +143,20 @@ newTalent{ self.turn_procs.bone_spike = true game:onTickEnd(function() local tg = self:getTalentTarget(t) - local dam = self:spellCrit(t.getDamage(self, t)) - + local dam = t.getDamage(self, t) + local did_crit = false self:project(tg, self.x, self.y, function(px, py) local target = game.level.map(px, py, engine.Map.ACTOR) if not target then return end local nb = #target:effectsFilter({status="detrimental", type="magical"}) if nb and nb < 3 then return end + + -- Make sure crit is only calculated once, but do it here so we don't trigger a crit if there are no targets + if did_crit == false then + dam = self:spellCrit(dam) + did_crit = true + end + self:project({type="beam", range=10, selffire=false, friendlyfire=false, talent=t}, target.x, target.y, DamageType.PHYSICAL, dam) local _ _, _, _, x, y = self:canProject(tg, x, y) game.level.map:particleEmitter(self.x, self.y, 10, "bone_spear", {speed=0.2, tx=target.x - self.x, ty=target.y - self.y}) @@ -159,12 +164,11 @@ newTalent{ end) end, info = function(self, t) - return ([[Whenever you use a non-instant talent you launch a spear of bone at all enemies afflicted by 3 or more magical detrimental effects dealing %d to all enemies it passes through. + return ([[Whenever you use a non-instant talent you launch a spear of bone at all enemies afflicted by 3 or more magical detrimental effects dealing %d physical damage to all enemies it passes through. The damage will increase with your Spellpower.]]):format(damDesc(self, DamageType.PHYSICAL, t.getDamage(self, t)) ) end, } --- Fix on clone bug newTalent{ name = "Bone Shield", type = {"corruption/bone", 4}, @@ -175,8 +179,8 @@ newTalent{ sustain_vim = 50, tactical = { DEFEND = 4 }, direct_hit = true, - getRegen = function(self, t) return self:combatTalentLimit(t, 3, 20, 3.5) end, - getNb = function(self, t) return math.floor(self:combatTalentScale(t, 1, 4.5)) end, + getRegen = function(self, t) return self:combatTalentLimit(t, 3, 20, 3.3) end, + getNb = function(self, t) return math.floor(self:combatTalentScale(t, 1, 3.5)) end, getThreshold = function(self, t) return math.floor(self:combatSpellpower()) end, iconOverlay = function(self, t, p) local p = self.sustain_talents[t.id] @@ -199,6 +203,7 @@ newTalent{ p.nb = p.nb + 1 if p.adv_gfx then if p.particles[1] and p.particles[1]._shader and p.particles[1]._shader.shad then + if not p.particles[1].shader then p.particles[1] = self:addParticles(Particles.new("shader_ring_rotating", 1, {toback=true, a=0.5, rotation=0, radius=1.5, img="bone_shield"}, {type="boneshield"})) end p.particles[1]._shader.shad:resetClean() p.particles[1]._shader:setResetUniform("chargesCount", util.bound(p.nb, 0, 10)) p.particles[1].shader.chargesCount = util.bound(p.nb, 0, 10) @@ -217,6 +222,8 @@ newTalent{ p.nb = p.nb - 1 if p.adv_gfx then if p.particles[1] and p.particles[1]._shader and p.particles[1]._shader.shad then + -- Clones don't copy this so we need to recreate it sometimes + if not p.particles[1].shader then p.particles[1] = self:addParticles(Particles.new("shader_ring_rotating", 1, {toback=true, a=0.5, rotation=0, radius=1.5, img="bone_shield"}, {type="boneshield"})) end p.particles[1]._shader.shad:resetClean() p.particles[1]._shader:setResetUniform("chargesCount", util.bound(p.nb, 0, 10)) p.particles[1].shader.chargesCount = util.bound(p.nb, 0, 10) @@ -234,7 +241,6 @@ newTalent{ local adv_gfx = core.shader.allow("adv") and true or false local ps = {} - game.log("Bone Shield clone activate "..tostring(util.bound(nb, 0, 10)) or ".shader value is nil") if adv_gfx then ps[1] = self:addParticles(Particles.new("shader_ring_rotating", 1, {toback=true, a=0.5, rotation=0, radius=1.5, img="bone_shield"}, {type="boneshield"})) ps[1]._shader.shad:resetClean() diff --git a/game/modules/tome/data/talents/corruptions/curses.lua b/game/modules/tome/data/talents/corruptions/curses.lua index 8250a48654..e5c222aa0d 100644 --- a/game/modules/tome/data/talents/corruptions/curses.lua +++ b/game/modules/tome/data/talents/corruptions/curses.lua @@ -103,7 +103,7 @@ newTalent{ return true end, info = function(self, t) - return ([[Curses your target, stopping any natural healing and dealing %0.2f darkness damage over 10 turns. + return ([[Curses your target, preventing normal life regeneration and dealing %0.2f darkness damage over 10 turns. The damage will increase with your Spellpower.]]):format(damDesc(self, DamageType.DARKNESS, self:combatTalentSpellDamage(t, 10, 70)*10)) end, } diff --git a/game/modules/tome/data/talents/corruptions/plague.lua b/game/modules/tome/data/talents/corruptions/plague.lua index adcb7cbd5c..81d759ac86 100644 --- a/game/modules/tome/data/talents/corruptions/plague.lua +++ b/game/modules/tome/data/talents/corruptions/plague.lua @@ -92,7 +92,7 @@ newTalent{ Virulent Disease will always try to apply a disease the target does not currently have, and also one that will have the most debilitating effect for the target. This disease will try to prioritize being applied to an enemy with a high disease count near the target. The effect will increase with your Spellpower.]]): - format(damDesc(self, DamageType.BLIGHT, 7 + self:combatTalentSpellDamage(t, 6, 65)), self:combatTalentSpellDamage(t, 5, 35)) + format(damDesc(self, DamageType.BLIGHT, 7 + self:combatTalentSpellDamage(t, 6, 45)), self:combatTalentSpellDamage(t, 5, 35)) end, } @@ -152,7 +152,7 @@ newTalent{ end) if diseases and #diseases > 0 then -- burst in a radius - self:project({type="ball", radius=self:getTalentRadius(t), range=self:getTalentRange(t)}, x, y, function(px, py) + self:project({type="ball", radius=self:getTalentRadius(t), range=self:getTalentRange(t), talent=t}, x, y, function(px, py) local target = game.level.map(px, py, engine.Map.ACTOR) if not target or target == source or target == self or (self:reactionToward(target) >= 0) then return end diff --git a/game/modules/tome/data/talents/corruptions/sanguisuge.lua b/game/modules/tome/data/talents/corruptions/sanguisuge.lua index 770f8e8c0e..9ae1fd9865 100644 --- a/game/modules/tome/data/talents/corruptions/sanguisuge.lua +++ b/game/modules/tome/data/talents/corruptions/sanguisuge.lua @@ -30,7 +30,7 @@ newTalent{ VIM = {BLIGHT = function(self, t, target) return 2*target:getRankVimAdjust()^.5 end} }, requires_target = true, - range = function(self, t) return math.floor(self:combatTalentScale(t, 5, 9)) end, + range = function(self, t) return math.min(10, math.floor(self:combatTalentScale(t, 6, 10))) end, action = function(self, t) local tg = {type="hit", range=self:getTalentRange(t), talent=t, display={particle="bolt_slime"}} local x, y = self:getTarget(tg) @@ -47,6 +47,7 @@ newTalent{ end, } +-- Sustain? newTalent{ name = "Bloodcasting", type = {"corruption/sanguisuge", 2}, diff --git a/game/modules/tome/data/talents/corruptions/torment.lua b/game/modules/tome/data/talents/corruptions/torment.lua index 84d331b7f4..dcf83202b6 100644 --- a/game/modules/tome/data/talents/corruptions/torment.lua +++ b/game/modules/tome/data/talents/corruptions/torment.lua @@ -104,6 +104,9 @@ newTalent{ end, } +--friendlyfire +-- Note: Normally you would use die_at instead of temporary maximum life for an effect like Sanguine Infusion and not have to special case it like this +-- Unfortunately, part of the goal of SI is to encourage healing and synergize well with Bone Shield, so were stuck with ugliness newTalent{ name = "Blood Vengeance", type = {"corruption/torment", 4}, @@ -115,25 +118,39 @@ newTalent{ sustain_vim = 22, tactical = { BUFF = 2 }, activate = function(self, t) - local l, c = t.getPower(self, t) + local ret = {} game:playSoundNear(self, "talents/flame") - local ret = { - l = self:addTemporaryValue("reduce_spell_cooldown_on_hit", l), - c = self:addTemporaryValue("reduce_spell_cooldown_on_hit_chance", c), - } if core.shader.active(4) then self:effectParticles(ret, {type="shader_ring_rotating", args={rotation=0, radius=1.1, img="blood_vengeance_lightningshield"}, shader={type="lightningshield"}}) end return ret end, deactivate = function(self, t, p) - self:removeTemporaryValue("reduce_spell_cooldown_on_hit", p.l) - self:removeTemporaryValue("reduce_spell_cooldown_on_hit_chance", p.c) return true end, + callbackPriorities={callbackOnHit = -1}, -- Before Bone Shield but after Rot + callbackOnHit = function(self, t, cb) + local eff = self:hasEffect(self.EFF_BLOOD_GRASP) + local life = self.max_life + (eff and eff.life or 0) + local l, c = t.getPower(self, t) + if cb.value >= self.max_life * l / 100 then + + local alt = {} + for tid, cd in pairs(self.talents_cd) do + if rng.percent(c) then alt[tid] = true end + end + for tid, cd in pairs(alt) do + self:alterTalentCoolingdown(tid, -1) + end + game.logSeen(self, "#RED#The powerful blow energizes %s reducing their cooldowns!#LAST#", self.name) + end + return cb.value + + end, info = function(self, t) local l, c = t.getPower(self, t) return ([[When you are dealt a blow that reduces your life by at least %d%%, you have a %d%% chance to reduce the remaining cooldown of all your talents by 1. + Temporary life from Sanguine Infusion will not count against the damage threshold. The chance will increase with your Spellpower.]]): format(l, c) end, diff --git a/game/modules/tome/data/talents/corruptions/vile-life.lua b/game/modules/tome/data/talents/corruptions/vile-life.lua index 3776575a85..b7c444890d 100644 --- a/game/modules/tome/data/talents/corruptions/vile-life.lua +++ b/game/modules/tome/data/talents/corruptions/vile-life.lua @@ -75,11 +75,17 @@ newTalent{ if type == DamageType.FIRE then src:setEffect(src.EFF_BURNING, 5, {src=self, apply_power=self:combatSpellpower(), power=t.getFire(self, t) / 5}) elseif type == DamageType.COLD then - src:setEffect(src.EFF_FROZEN, 3, {apply_power=self:combatSpellpower(), hp=t.getCold(self, t)}) + if src:canBe("stun") then + src:setEffect(src.EFF_FROZEN, 3, {apply_power=self:combatSpellpower(), hp=t.getCold(self, t)}) + end elseif type == DamageType.ACID then - src:setEffect(src.EFF_BLINDED, t.getAcid(self, t), {apply_power=self:combatSpellpower()}) + if src:canBe("blind") then + src:setEffect(src.EFF_BLINDED, t.getAcid(self, t), {apply_power=self:combatSpellpower()}) + end elseif type == DamageType.LIGHTNING then - src:setEffect(src.EFF_DAZED, t.getLightning(self, t), {apply_power=self:combatSpellpower()}) + if src:canBe("stun") then + src:setEffect(src.EFF_DAZED, t.getLightning(self, t), {apply_power=self:combatSpellpower()}) + end elseif type == DamageType.NATURE then src:setEffect(src.EFF_SLOW, 4, {apply_power=self:combatSpellpower(), power=t.getNature(self, t) / 100}) end diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua index cb9c1b4c55..c8cffeb819 100644 --- a/game/modules/tome/data/timed_effects/magical.lua +++ b/game/modules/tome/data/timed_effects/magical.lua @@ -2209,15 +2209,24 @@ newEffect{ newEffect{ name = "BLOOD_GRASP", image = "talents/blood_grasp.png", desc = "Sanguine Infusion", - long_desc = function(self, eff) return ("Max life increased by %d."):format(eff.life) end, + long_desc = function(self, eff) return ("Maximum life increased by %d."):format(eff.life) end, type = "magical", subtype = {corruption=true}, status = "beneficial", parameters = {life = 0}, + on_merge = function(self, old_eff, new_eff) + self:removeTemporaryValue("max_life", old_eff.tmpid) + + old_eff.life = math.max(old_eff.life, new_eff.life) + old_eff.tmpid = self:addTemporaryValue("max_life", old_eff.life) + old_eff.dur = new_eff.dur + return old_eff + end, activate = function(self, eff) - self:effectTemporaryValue(eff, "max_life", eff.life) + eff.tmpid = self:addTemporaryValue("max_life", eff.life) end, deactivate = function(self, eff) + self:removeTemporaryValue("max_life", eff.tmpid) end, } -- GitLab