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

Probability Travel does not work over no-teleport zones and in the wilderness

git-svn-id: http://svn.net-core.org/repos/t-engine4@1035 51575b47-30f0-44d4-a5cc-537603b46e54
parent 142dd3d7
No related branches found
No related tags found
No related merge requests found
......@@ -279,14 +279,17 @@ end
--- Blink through walls
function _M:probabilityTravel(x, y, dist)
if game.zone.wilderness then return true end
local dirx, diry = x - self.x, y - self.y
local tx, ty = x, y
while game.level.map:isBound(tx, ty) and game.level.map:checkAllEntities(tx, ty, "block_move", self) and dist > 0 do
if game.level.map.attrs(tx, ty, "no_teleport") then break end
tx = tx + dirx
ty = ty + diry
dist = dist - 1
end
if game.level.map:isBound(tx, ty) and not game.level.map:checkAllEntities(tx, ty, "block_move", self) then
if game.level.map:isBound(tx, ty) and not game.level.map:checkAllEntities(tx, ty, "block_move", self) and not game.level.map.attrs(tx, ty, "no_teleport") then
return engine.Actor.move(self, tx, ty, false)
end
return true
......
......@@ -41,6 +41,8 @@ newTalent{
game.logSeen(target, "The spell fizzles!")
return true
end
-- Annoy them!
if target ~= self and target:reactionToward(self) < 0 then target:setTarget(self) end
local x, y = self.x, self.y
if self:getTalentLevel(t) >= 4 then
......@@ -94,6 +96,8 @@ newTalent{
game.logSeen(target, "The spell fizzles!")
return true
end
-- Annoy them!
if target ~= self and target:reactionToward(self) < 0 then target:setTarget(self) end
local x, y = self.x, self.y
if self:getTalentLevel(t) >= 4 then
......
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