Skip to content
Snippets Groups Projects
Commit 602eabd8 authored by dg's avatar dg
Browse files

stun/freeze/slow/pinned/confusion/blind durations reduced based on rank and...

stun/freeze/slow/pinned/confusion/blind durations reduced based on rank and physical/mental/spell resistance
Freeze cooldown increased to 5


git-svn-id: http://svn.net-core.org/repos/t-engine4@713 51575b47-30f0-44d4-a5cc-537603b46e54
parent 33f34882
No related branches found
No related tags found
No related merge requests found
......@@ -938,6 +938,40 @@ function _M:canBe(what)
return true
end
--- Adjusts timed effect durations based on rank and other things
function _M:updateEffectDuration(dur, what)
-- Rank reduction: below elite = none; elite = 1, boss = 2, elite boss = 3
local rankmod = 0
if self.rank == 3 then rankmod = 25
elseif self.rank == 4 then rankmod = 45
elseif self.rank == 5 then rankmod = 75
end
if rankmod <= 0 then return dur end
print("Effect duration reduction <", dur)
if what == "stun" then
local p = self:combatPhysicalResist(), rankmod * (util.bound(self:combatPhysicalResist() * 3, 40, 115) / 100)
dur = dur - math.ceil(dur * (p) / 100)
elseif what == "pin" then
local p = self:combatPhysicalResist(), rankmod * (util.bound(self:combatPhysicalResist() * 3, 40, 115) / 100)
dur = dur - math.ceil(dur * (p) / 100)
elseif what == "frozen" then
local p = self:combatSpellResist(), rankmod * (util.bound(self:combatSpellResist() * 3, 40, 115) / 100)
dur = dur - math.ceil(dur * (p) / 100)
elseif what == "blind" then
local p = self:combatMentalResist(), rankmod * (util.bound(self:combatMentalResist() * 3, 40, 115) / 100)
dur = dur - math.ceil(dur * (p) / 100)
elseif what == "slow" then
local p = self:combatPhysicalResist(), rankmod * (util.bound(self:combatPhysicalResist() * 3, 40, 115) / 100)
dur = dur - math.ceil(dur * (p) / 100)
elseif what == "confusion" then
local p = self:combatMentalResist(), rankmod * (util.bound(self:combatMentalResist() * 3, 40, 115) / 100)
dur = dur - math.ceil(dur * (p) / 100)
end
print("Effect duration reduction >", dur)
return dur
end
--- Called when we are projected upon
-- This is used to do spell reflection, antimagic, ...
function _M:on_project(tx, ty, who, t, x, y, damtype, dam, particles)
......
......@@ -60,7 +60,7 @@ newTalent{
require = spells_req2,
points = 5,
mana = 14,
cooldown = 3,
cooldown = 5,
tactical = {
ATTACK = 10,
},
......
......@@ -97,7 +97,7 @@ newEffect{
type = "magical",
status = "detrimental",
parameters = {},
on_gain = function(self, err) return "#Target# is frozen!" end,
on_gain = function(self, err) return "#Target# is frozen!", "+Frozen" end,
on_lose = function(self, err) return "#Target# warms up.", "-Frozen" end,
activate = function(self, eff)
-- Change color
......@@ -110,6 +110,7 @@ newEffect{
game.level.map:updateMap(self.x, self.y)
eff.tmpid = self:addTemporaryValue("stunned", 1)
eff.dur = self:updateEffectDuration(eff.dur, "freeze")
end,
deactivate = function(self, eff)
self:removeTemporaryValue("stunned", eff.tmpid)
......@@ -129,6 +130,7 @@ newEffect{
on_lose = function(self, err) return "#Target# is not stunned anymore.", "-Burning Shock" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("stunned", 1)
eff.dur = self:updateEffectDuration(eff.dur, "stun")
end,
on_timeout = function(self, eff)
DamageType:get(DamageType.FIRE).projector(eff.src, self.x, self.y, DamageType.FIRE, eff.power)
......@@ -148,6 +150,7 @@ newEffect{
on_lose = function(self, err) return "#Target# is not stunned anymore.", "-Stunned" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("stunned", 1)
eff.dur = self:updateEffectDuration(eff.dur, "stun")
end,
deactivate = function(self, eff)
self:removeTemporaryValue("stunned", eff.tmpid)
......@@ -230,6 +233,7 @@ newEffect{
on_lose = function(self, err) return "#Target# speeds up.", "-Slow" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("energy", {mod=-eff.power})
eff.dur = self:updateEffectDuration(eff.dur, "slow")
end,
deactivate = function(self, eff)
self:removeTemporaryValue("energy", eff.tmpid)
......@@ -278,6 +282,7 @@ newEffect{
on_lose = function(self, err) return "#Target# recovers sight.", "-Blind" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("blind", 1)
eff.dur = self:updateEffectDuration(eff.dur, "blind")
if self.player then game.level.map:redisplay() end
end,
deactivate = function(self, eff)
......@@ -296,6 +301,7 @@ newEffect{
on_lose = function(self, err) return "#Target# seems more focused.", "-Confused" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("confused", eff.power)
eff.dur = self:updateEffectDuration(eff.dur, "confusion")
end,
deactivate = function(self, eff)
self:removeTemporaryValue("confused", eff.tmpid)
......@@ -549,6 +555,7 @@ newEffect{
on_lose = function(self, err) return "#Target# is no longer pinned.", "-Pinned" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("never_move", 1)
eff.dur = self:updateEffectDuration(eff.dur, "pin")
end,
deactivate = function(self, eff)
self:removeTemporaryValue("never_move", eff.tmpid)
......
No preview for this file type
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