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

Summoned creatures give flying texts when doing damage

git-svn-id: http://svn.net-core.org/repos/t-engine4@1086 51575b47-30f0-44d4-a5cc-537603b46e54
parent bcc5a573
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
setDefaultProjector(function(src, x, y, type, dam) setDefaultProjector(function(src, x, y, type, dam)
local target = game.level.map(x, y, Map.ACTOR) local target = game.level.map(x, y, Map.ACTOR)
if target then if target then
local rsrc = src.resolveSource and src:resolveSource() or src
local rtarget = target.resolveSource and target:resolveSource() or target
print("[PROJECTOR] starting dam", dam) print("[PROJECTOR] starting dam", dam)
-- Difficulty settings -- Difficulty settings
...@@ -61,15 +64,16 @@ setDefaultProjector(function(src, x, y, type, dam) ...@@ -61,15 +64,16 @@ setDefaultProjector(function(src, x, y, type, dam)
local srcname = src.x and src.y and game.level.map.seens(src.x, src.y) and src.name:capitalize() or "Something" local srcname = src.x and src.y and game.level.map.seens(src.x, src.y) and src.name:capitalize() or "Something"
game.logSeen(target, flash, "%s hits %s for %s%0.2f %s damage#LAST#.", srcname, target.name, DamageType:get(type).text_color or "#aaaaaa#", dam, DamageType:get(type).name) game.logSeen(target, flash, "%s hits %s for %s%0.2f %s damage#LAST#.", srcname, target.name, DamageType:get(type).text_color or "#aaaaaa#", dam, DamageType:get(type).name)
local sx, sy = game.level.map:getTileToScreen(x, y) local sx, sy = game.level.map:getTileToScreen(x, y)
if target:takeHit(dam, src) then if target:takeHit(dam, src) then
if src == game.player or target == game.player then if rsrc == game.player or rtarget == game.player then
game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, "Kill!", {255,0,255}) game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, "Kill!", {255,0,255})
end end
else else
if src == game.player then if rsrc == game.player then
game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, tostring(-math.ceil(dam)), {0,255,0}) game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, tostring(-math.ceil(dam)), {0,255,0})
elseif target == game.player then elseif rtarget == game.player then
game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, tostring(-math.ceil(dam)), {255,0,0}) game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, tostring(-math.ceil(dam)), {255,0,0})
end end
end end
......
...@@ -213,13 +213,13 @@ newEntity{ ...@@ -213,13 +213,13 @@ newEntity{
cost = 1000, cost = 1000,
use_simple = { name = "quaff the Blood of Life", use = function(self, who) use_simple = { name = "quaff the Blood of Life", use = function(self, who)
game.logSeen(who, "%s quaffs the %s!", who.name:capitalize(), self:getName())
if not who:attr("undead") then if not who:attr("undead") then
who.blood_life = true who.blood_life = true
game.logPlayer(who, "#LIGHT_RED#You feel the Blood of Life rushing through your veins.") game.logPlayer(who, "#LIGHT_RED#You feel the Blood of Life rushing through your veins.")
else else
game.logPlayer(who, "The Blood of Life seems to have no effect on you.") game.logPlayer(who, "The Blood of Life seems to have no effect on you.")
end end
game.logSeen(who, "%s quaffs the %s!", who.name:capitalize(), self:getName())
return "destroy", true return "destroy", true
end}, end},
} }
......
...@@ -80,13 +80,14 @@ newTalent{ ...@@ -80,13 +80,14 @@ newTalent{
local tg = {type="cone", range=0, radius=self:getTalentRange(t), friendlyfire=false, talent=t} local tg = {type="cone", range=0, radius=self:getTalentRange(t), friendlyfire=false, talent=t}
local x, y = self:getTarget(tg) local x, y = self:getTarget(tg)
if not x or not y then return nil end if not x or not y then return nil end
self:project(tg, x, y, DamageType.LIGHTNING, rng.range(1, 30 + self:getWil(80) * self:getTalentLevel(t)), {type="lightning_explosion"}) local dam = 30 + self:getWil(80) * self:getTalentLevel(t)
self:project(tg, x, y, DamageType.LIGHTNING, rng.avg(dam / 3, dam, 3), {type="lightning_explosion"})
game:playSoundNear(self, "talents/lightning") game:playSoundNear(self, "talents/lightning")
return true return true
end, end,
info = function(self, t) info = function(self, t)
return ([[Breathe lightning on your foes, doing 1 to %d damage. return ([[Breathe lightning on your foes, doing %d to %d damage.
The damage will increase with the Willpower stat]]):format(30 + self:getWil(70) * self:getTalentLevel(t)) The damage will increase with the Willpower stat]]):format((30 + self:getWil(70) * self:getTalentLevel(t)) / 3, 30 + self:getWil(70) * self:getTalentLevel(t))
end, end,
} }
......
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