Deep wound makes the target kill itself

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
marvalis
Uruivellas
Posts: 683
Joined: Sun Sep 05, 2010 5:11 am

Deep wound makes the target kill itself

#1 Post by marvalis »

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...

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,
}

Widget
Low Yeek
Posts: 6
Joined: Sat Jul 03, 2010 1:33 pm

Re: Deep wound makes the target kill itself

#2 Post by Widget »

I don't think that's a bug. It's to do with the fact that the bleeding effect is applied to the target, so an active effect attached to the Red ant is dealing damage to the Red ant. Basically, as far as the game's concerned the source of the damage is the target itself.

Zaive
Archmage
Posts: 313
Joined: Mon May 24, 2010 1:33 pm

Re: Deep wound makes the target kill itself

#3 Post by Zaive »

You sure? When you get poisoned by an enemy it always says that enemy is dealing damage to you during the poison effect, not you to yourself.
Burb Lulls wrote:"FLURRYFLURRYFLURRYFLURRYFLURRYFLURRY"

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Deep wound makes the target kill itself

#4 Post by yufra »

Looks like the issue is in the setEffect line, and the third argument table should have "src=self".
<DarkGod> lets say it's intended

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Deep wound makes the target kill itself

#5 Post by darkgod »

fixed
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply