Skip to content
Snippets Groups Projects
Commit 54bb1d17 authored by dg's avatar dg
Browse files

Lightning daze, acid blind, ice damage now use either spellpower or mindpower for power application

git-svn-id: http://svn.net-core.org/repos/t-engine4@6612 51575b47-30f0-44d4-a5cc-537603b46e54
parent 69a4e003
No related branches found
No related tags found
No related merge requests found
......@@ -973,7 +973,7 @@ newDamageType{
local target = game.level.map(x, y, Map.ACTOR)
if target then
if target:canBe("pin") and target:canBe("stun") and not target:attr("fly") and not target:attr("levitation") then
target:setEffect(target.EFF_FROZEN_FEET, dam.dur, {apply_power=src:combatSpellpower()})
target:setEffect(target.EFF_FROZEN_FEET, dam.dur, {apply_power=math.max(src:combatSpellpower(), src:combatMindpower())})
end
end
end,
......@@ -988,7 +988,7 @@ newDamageType{
-- Freeze it, if we pass the test
local sx, sy = game.level.map:getTileToScreen(x, y)
if target:canBe("stun") then
target:setEffect(target.EFF_FROZEN, dam.dur, {hp=dam.hp * 1.5, apply_power=src:combatSpellpower(), min_dur=1})
target:setEffect(target.EFF_FROZEN, dam.dur, {hp=dam.hp * 1.5, apply_power=math.max(src:combatSpellpower(), src:combatMindpower()), min_dur=1})
game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, "Frozen!", {0,255,155})
else
game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, "Resist!", {0,255,155})
......@@ -1021,7 +1021,7 @@ newDamageType{
local target = game.level.map(x, y, Map.ACTOR)
if target and rng.percent(25) then
if target:canBe("blind") then
target:setEffect(target.EFF_BLINDED, 3, {src=src, apply_power=src:combatSpellpower()})
target:setEffect(target.EFF_BLINDED, 3, {src=src, apply_power=math.max(src:combatSpellpower(), src:combatMindpower())})
else
game.logSeen(target, "%s resists!", target.name:capitalize())
end
......@@ -1056,7 +1056,7 @@ newDamageType{
local target = game.level.map(x, y, Map.ACTOR)
if target and dam.daze > 0 and rng.percent(dam.daze) then
if target:canBe("stun") then
game:onTickEnd(function() target:setEffect(target.EFF_DAZED, 3, {src=src, apply_power=src:combatSpellpower()}) end) -- Do it at the end so we don't break our own daze
game:onTickEnd(function() target:setEffect(target.EFF_DAZED, 3, {src=src, apply_power=dam.power_check or math.max(src:combatSpellpower(), src:combatMindpower())}) end) -- Do it at the end so we don't break our own daze
if src:isTalentActive(src.T_HURRICANE) then
local t = src:getTalentFromId(src.T_HURRICANE)
t.do_hurricane(src, t, target)
......
......@@ -202,7 +202,7 @@ newTalent{
local x, y = self:getTarget(tg)
if not x or not y then return nil end
local dam = self:mindCrit(t.getDamage(self, t))
self:project(tg, x, y, DamageType.LIGHTNING_DAZE, rng.avg(dam / 3, dam, 3))
self:project(tg, x, y, DamageType.LIGHTNING_DAZE, {power_check=self:combatMindpower(), dam=rng.avg(dam / 3, dam, 3)})
if core.shader.active() then game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_lightning", {radius=tg.radius, tx=x-self.x, ty=y-self.y}, {type="lightning"})
else game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_lightning", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
......
......@@ -151,7 +151,7 @@ newTalent{
if act then
self:incPsi(en)
end
DamageType:get(DamageType.LIGHTNING_DAZE).projector(self, tx, ty, DamageType.LIGHTNING_DAZE, rng.avg(dam/3, dam, 3))
DamageType:get(DamageType.LIGHTNING_DAZE).projector(self, tx, ty, DamageType.LIGHTNING_DAZE, {power_check=self:combatMindpower(), dam=rng.avg(dam/3, dam, 3)})
end)
-- Lightning ball gets a special treatment to make it look neat
local sradius = (tg.radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
......
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