Skip to content
Snippets Groups Projects
Commit 1e8daf6e authored by dg's avatar dg
Browse files

on hit melee damage shields

phantasm shield


git-svn-id: http://svn.net-core.org/repos/t-engine4@267 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0b786209
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,8 @@ function _M:init(t, no_default)
t.esp = {range=10}
t.on_melee_hit = {}
-- Resistances
t.resists = t.resists or {}
......@@ -395,5 +397,6 @@ function _M:canBe(what)
if what == "blind" and self:attr("blind_immune") then return false end
if what == "stun" and self:attr("stun_immune") then return false end
if what == "knockback" and self:attr("knockback_immune") then return false end
if what == "instakill" and self:attr("instakill_immune") then return false end
return true
end
......@@ -143,6 +143,11 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
game.logSeen(target, "%s misses %s.", self.name:capitalize(), target.name)
end
-- Reactive target on hit damage
if hitted then for typ, dam in pairs(target.on_melee_hit) do
DamageType:get(typ).projector(target, self.x, self.y, typ, dam)
end end
return self:combatSpeed(weapon), hitted
end
......
......@@ -137,7 +137,11 @@ newDamageType{
local target = game.level.map(x, y, Map.ACTOR)
if target then
-- Set on fire!
target:setEffect(target.EFF_BURNING_SHOCK, dam.dur, {src=src, power=dam.dam / dam.dur})
if target:checkHit(src:combatSpellpower(), target:combatSpellResist(), 0, 95, 15) and target:canBe("stun") then
target:setEffect(target.EFF_BURNING_SHOCK, dam.dur, {src=src, power=dam.dam / dam.dur})
else
game.logSeen(target, "%s resists the searing flame!", target.name:capitalize())
end
end
end,
}
......
......@@ -107,7 +107,6 @@ newTalent{
self:useEnergy()
self.temporary = self.temporary - 1
if self.temporary <= 0 then
print("reseting", self.x, self.y, "to", self.old_feat, self.old_feat.name)
game.level.map(self.x, self.y, Map.TERRAIN, self.old_feat)
game:removeEntity(self)
game.level.map:redisplay()
......@@ -115,7 +114,6 @@ newTalent{
end
}
game:addEntity(e)
print("setting", x+i, y+j, "to", game.level.map(x + i, y + j, Map.TERRAIN), game.level.map(x + i, y + j, Map.TERRAIN).name)
game.level.map(x + i, y + j, Map.TERRAIN, e)
end
end end end
......
......@@ -47,6 +47,32 @@ newTalent{
end,
}
newTalent{
name = "Phantasmal Shield",
type = {"spell/phantasm", 3},
mode = "sustained",
require = spells_req3,
points = 5,
sustain_mana = 100,
cooldown = 10,
tactical = {
DEFEND = 10,
},
activate = function(self, t)
local power = 10 + self:combatSpellpower(0.1) * self:getTalentLevel(t)
return {
onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.ARCANE]=power}),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("on_melee_hit", p.onhit)
return true
end,
info = function(self, t)
return ([[The caster surrounds herself with a phantasmal shield. If hit in melee the shield will last out at the attacker for %d arcane damage.
The damage will increase with the Magic stat]]):format(10 + self:combatSpellpower(0.1) * self:getTalentLevel(t))
end,
}
newTalent{
name = "Invisibility",
......
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