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

Controlled phase door rune is now subject to fizzle when blinking out of LOS, like the spell

git-svn-id: http://svn.net-core.org/repos/t-engine4@2443 51575b47-30f0-44d4-a5cc-537603b46e54
parent 98b4869c
No related branches found
No related tags found
No related merge requests found
......@@ -681,20 +681,16 @@ function _M:playerUseItem(object, item, inven)
self:antimagicBackslash(4 + (o.material_level or 1))
end
if not o.unique and self:doesPackRat() then
game.logPlayer(self, "Pack Rat!")
if o.multicharge and o.multicharge > 1 then
o.multicharge = o.multicharge - 1
else
if o.multicharge and o.multicharge > 1 then
o.multicharge = o.multicharge - 1
local _, del = self:removeObject(self:getInven(inven), item)
if del then
game.log("You have no more %s.", o:getName{no_count=true, do_color=true})
else
local _, del = self:removeObject(self:getInven(inven), item)
if del then
game.log("You have no more %s.", o:getName{no_count=true, do_color=true})
else
game.log("You have %s.", o:getName{do_color=true})
end
self:sortInven(self:getInven(inven))
game.log("You have %s.", o:getName{do_color=true})
end
self:sortInven(self:getInven(inven))
end
self:breakStealth()
self:breakLightningSpeed()
......
......@@ -54,11 +54,7 @@ function _M:archeryAcquireTargets(tg, params)
if params.one_shot then
local a
if not ammo.infinite then
if self:doesPackRat() then
a = self:getInven("QUIVER")[1]
else
a = self:removeObject(self:getInven("QUIVER"), 1)
end
a = self:removeObject(self:getInven("QUIVER"), 1)
else
a = ammo
end
......
......@@ -266,8 +266,17 @@ newInscription{
-- Target code does not restrict the target coordinates to the range, it lets the project function do it
-- but we cant ...
local _ _, x, y = self:canProject(tg, x, y)
-- Check LOS
local rad = 3
if not self:hasLOS(x, y) and rng.percent(35) then
game.logPlayer(self, "The targetted phase door fizzles and works randomly!")
x, y = self.x, self.y
rad = tg.range
end
game.level.map:particleEmitter(self.x, self.y, 1, "teleport")
self:teleportRandom(x, y, 3)
self:teleportRandom(x, y, rad)
game.level.map:particleEmitter(self.x, self.y, 1, "teleport")
return true
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