Deep wound makes the target kill itself
Posted: Sun Feb 13, 2011 4:29 am
Deep wound when used like in bleeding edge makes the target do bleeding damage to itself.
Red ant does 25 bleeding damage to red ant.
Red ant killed red ant!
right...
Red ant does 25 bleeding damage to red ant.
Red ant killed red ant!
right...
Code: Select all
newEffect{
name = "DEEP_WOUND",
desc = "Deep Wound",
long_desc = function(self, eff) return ("Huge cut that bleeds, doing %0.2f physical damage per turn and decreasing all heals received by %d%%."):format(eff.power, eff.heal_factor) end,
type = "physical",
status = "detrimental",
parameters = {power=10, heal_factor=30},
on_gain = function(self, err) return "#Target# starts to bleed.", "+Deep Wounds" end,
on_lose = function(self, err) return "#Target# stops bleeding.", "-Deep Wounds" end,
activate = function(self, eff)
eff.healid = self:addTemporaryValue("healing_factor", -eff.heal_factor / 100)
end,
on_timeout = function(self, eff)
DamageType:get(DamageType.PHYSICAL).projector(eff.src or self, self.x, self.y, DamageType.PHYSICAL, eff.power)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("healing_factor", eff.healid)
end,
}
newTalent{
name = "Bleeding Edge",
type = {"technique/battle-tactics", 3},
require = techs_req_high3,
points = 5,
cooldown = 12,
stamina = 24,
tactical = { ATTACK = 1, DISABLE = 2 },
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
local hit = self:attackTarget(target, nil, self:combatTalentWeaponDamage(t, 1, 1.7), true)
if hit then
if target:checkHit(self:combatAttackDex(), target:combatPhysicalResist(), 0, 95, 5) and target:canBe("cut") then
local sw = self:getInven("MAINHAND")
if sw then
sw = sw[1] and sw[1].combat
end
sw = sw or self.combat
local dam = self:combatDamage(sw)
local damrange = self:combatDamageRange(sw)
dam = rng.range(dam, dam * damrange)
dam = dam * self:combatTalentWeaponDamage(t, 2, 3.2)
target:setEffect(target.EFF_DEEP_WOUND, 7, {heal_factor=self:getTalentLevel(t) * 10, power=dam / 7})
end
end
return true
end,
info = function(self, t)
return ([[Lashes at the target, doing %d%% weapon damage.
If the attack hits the target will bleed for %d%% weapon damage over 7 turns and all healing will be reduced by %d%%.]]):
format(100 * self:combatTalentWeaponDamage(t, 1, 1.7), 100 * self:combatTalentWeaponDamage(t, 2, 3.2), self:getTalentLevel(t) * 10)
end,
}