Skip to content
Snippets Groups Projects
Commit 8c939ea8 authored by dg's avatar dg
Browse files

Epidemic now reduce the target's healing receieved

git-svn-id: http://svn.net-core.org/repos/t-engine4@2555 51575b47-30f0-44d4-a5cc-537603b46e54
parent b56567e6
No related branches found
No related tags found
No related merge requests found
......@@ -683,7 +683,7 @@ function _M:onHeal(value, src)
if self:hasEffect(self.EFF_UNSTOPPABLE) then
return 0
end
value = value * (self.healing_factor or 1)
value = value * util.bound((self.healing_factor or 1), 0, 2.5)
print("[HEALING]", self.uid, self.name, "for", value)
return value
end
......
......@@ -212,7 +212,7 @@ newTalent{
local target = game.level.map(px, py, engine.Map.ACTOR)
if not target or (self:reactionToward(target) >= 0) then return end
if target:checkHit(self:combatSpellpower(), target:combatSpellResist(), 0, 95, 12 - self:getTalentLevel(t)) and target:canBe("disease") then
target:setEffect(self.EFF_EPIDEMIC, 6, {src=self, dam=self:combatTalentSpellDamage(t, 15, 50)})
target:setEffect(self.EFF_EPIDEMIC, 6, {src=self, dam=self:combatTalentSpellDamage(t, 15, 50), heal_factor=40 + self:getTalentLevel(t) * 4})
else
game.logSeen(target, "%s resists the disease!", target.name:capitalize())
end
......@@ -225,7 +225,8 @@ newTalent{
info = function(self, t)
return ([[Infects the target with a very contagious disease doing %0.2f damage per turn for 6 turns.
If any blight damage from non-diseases hits the target, the epidemic will activate and spread a random disease to nearby targets.
Creatures suffering from that disease will also suffer healing reduction (%d%%).
The damage will increase with your Magic stat.]]):
format(damDesc(self, DamageType.BLIGHT, self:combatTalentSpellDamage(t, 15, 50)))
format(damDesc(self, DamageType.BLIGHT, self:combatTalentSpellDamage(t, 15, 50)), 40 + self:getTalentLevel(t) * 4)
end,
}
......@@ -1246,9 +1246,11 @@ newEffect{
end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("diseases_spread_on_blight", 1)
eff.healid = self:addTemporaryValue("healing_factor", -eff.heal_factor / 100)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("diseases_spread_on_blight", eff.tmpid)
self:removeTemporaryValue("healing_factor", eff.healid)
end,
}
......@@ -2511,7 +2513,7 @@ newEffect{
end
return
end
if eff.target.dead then
eff.isSevered = true
else
......@@ -2526,7 +2528,7 @@ newEffect{
end
end
end
if eff.isSevered then
if eff.particles then
-- remove old particle emitter
......
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