Skip to content
Snippets Groups Projects
Commit 721512d8 authored by dg's avatar dg
Browse files

Life regen is now affected by healing factor

New infusion: Insidious Poison, spit a bolt of poison at the target, doing nature damage per turn and reducing healing received


git-svn-id: http://svn.net-core.org/repos/t-engine4@2571 51575b47-30f0-44d4-a5cc-537603b46e54
parent e801f8f4
No related branches found
No related tags found
No related merge requests found
......@@ -678,6 +678,13 @@ function _M:tooltip(x, y, seen_by)
return ts
end
--- Regenerate life, call it from your actor class act() method
function _M:regenLife()
if self.life_regen then
self.life = util.bound(self.life + self.life_regen * util.bound((self.healing_factor or 1), 0, 2.5), 0, self.max_life)
end
end
--- Called before healing
function _M:onHeal(value, src)
if self:hasEffect(self.EFF_UNSTOPPABLE) then
......
......@@ -707,6 +707,18 @@ newDamageType{
end,
}
-- Insidious poison: prevents healing
newDamageType{
name = "insidious poison", type = "INSIDIOUS_POISON",
projector = function(src, x, y, type, dam)
DamageType:get(DamageType.NATURE).projector(src, x, y, DamageType.NATURE, dam.dam / dam.dur)
local target = game.level.map(x, y, Map.ACTOR)
if target and target:canBe("poison") then
target:setEffect(target.EFF_INSIDIOUS_POISON, dam.dur, {src=src, power=dam.dam / dam.dur, heal_factor=dam.heal_factor})
end
end,
}
-- Bleeding damage
newDamageType{
name = "bleed", type = "BLEED",
......
......@@ -231,6 +231,23 @@ newEntity{ base = "BASE_INFUSION",
inscription_talent = "INFUSION:_MIND_POWER",
}
newEntity{ base = "BASE_INFUSION",
name = "insidious poison infusion",
level_range = {10, 50},
rarity = 16,
cost = 20,
material_level = 2,
inscription_data = {
cooldown = resolvers.rngrange(15, 25),
range = resolvers.mbonus_level(3, 3),
heal_factor = resolvers.mbonus_level(50, 20, function(e, v) return v * 0.1 end),
power = resolvers.mbonus_level(300, 70, function(e, v) return v * 0.1 end),
use_stat_mod = 2,
},
inscription_talent = "INFUSION:_INSIDIOUS_POISON",
}
-----------------------------------------------------------
-- Runes
-----------------------------------------------------------
......
......@@ -226,6 +226,35 @@ newInscription{
end,
}
newInscription{
name = "Infusion: Insidious Poison",
type = {"inscriptions/infusions", 1},
points = 1,
tactical = { ATTACK = 1, DISABLE=1 },
requires_target = true,
range = function(self, t)
local data = self:getInscriptionData(t.short_name)
return data.range
end,
action = function(self, t)
local data = self:getInscriptionData(t.short_name)
local tg = {type="bolt", range=self:getTalentRange(t), talent=t, display={particle="bolt_slime", trail="slimetrail"}}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:projectile(tg, x, y, DamageType.INSIDIOUS_POISON, {dam=data.power + data.inc_stat, dur=7, heal_factor=data.heal_factor}, {type="slime"})
game:playSoundNear(self, "talents/slime")
return true
end,
info = function(self, t)
local data = self:getInscriptionData(t.short_name)
return ([[Activate the infusion to spit a bolt of poison doing %0.2f nature damage per turns for 7 turns and reducing the target's healing received by %d%%.]]):format(damDesc(self, DamageType.COLD, data.power + data.inc_stat) / 7, data.heal_factor)
end,
short_info = function(self, t)
local data = self:getInscriptionData(t.short_name)
return ([[%d nature damage, %d%% healing reduction]]):format(damDesc(self, DamageType.NATURE, data.power + data.inc_stat) / 7, data.heal_factor)
end,
}
-----------------------------------------------------------------------
-- Runes
-----------------------------------------------------------------------
......@@ -455,7 +484,6 @@ newInscription{
is_spell = true,
tactical = { ATTACK = 1, DISABLE=1 },
requires_target = true,
direct_hit = true,
range = function(self, t)
local data = self:getInscriptionData(t.short_name)
return data.range
......
......@@ -194,6 +194,47 @@ newEffect{
end,
}
newEffect{
name = "SPYDRIC_POISON",
desc = "Spydric Poison",
long_desc = function(self, eff) return ("The target is poisoned, taking %0.2f nature damage per turn and preventing any movements (but can still act freely)."):format(eff.power) end,
type = "poison",
status = "detrimental",
parameters = {power=10},
on_gain = function(self, err) return "#Target# is poisoned and cannot move!", "+Spydric Poison" end,
on_lose = function(self, err) return "#Target# is no longer poisoned.", "-Spydric Poison" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("never_move", 1)
eff.dur = self:updateEffectDuration(eff.dur, "pin")
end,
on_timeout = function(self, eff)
DamageType:get(DamageType.NATURE).projector(eff.src, self.x, self.y, DamageType.NATURE, eff.power)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("never_move", eff.tmpid)
end,
}
newEffect{
name = "INSIDIOUS_POISON",
desc = "Insidious Poison",
long_desc = function(self, eff) return ("The target is poisoned, taking %0.2f nature damage per turn and decreasing all heals received by %d%%."):format(eff.power, eff.heal_factor) end,
type = "poison",
status = "detrimental",
parameters = {power=10, heal_factor=30},
on_gain = function(self, err) return "#Target# is poisoned!", "+Insidious Poison" end,
on_lose = function(self, err) return "#Target# is no longer poisoned.", "-Insidious Poison" end,
activate = function(self, eff)
eff.healid = self:addTemporaryValue("healing_factor", -eff.heal_factor / 100)
end,
on_timeout = function(self, eff)
DamageType:get(DamageType.NATURE).projector(eff.src, self.x, self.y, DamageType.NATURE, eff.power)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("healing_factor", eff.healid)
end,
}
newEffect{
name = "FROZEN",
desc = "Frozen",
......@@ -325,27 +366,6 @@ newEffect{
end,
}
newEffect{
name = "SPYDRIC_POISON",
desc = "Spydric Poison",
long_desc = function(self, eff) return ("The target is poisoned, taking %0.2f nature damage per turn and preventing any movements (but can still act freely)."):format(eff.power) end,
type = "poison",
status = "detrimental",
parameters = {power=10},
on_gain = function(self, err) return "#Target# is poisoned and cannot move!", "+Spydric Poison" end,
on_lose = function(self, err) return "#Target# is no longer poisoned.", "-Spydric Poison" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("never_move", 1)
eff.dur = self:updateEffectDuration(eff.dur, "pin")
end,
on_timeout = function(self, eff)
DamageType:get(DamageType.NATURE).projector(eff.src, self.x, self.y, DamageType.NATURE, eff.power)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("never_move", eff.tmpid)
end,
}
newEffect{
name = "SILENCED",
desc = "Silenced",
......
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