From e75c713f473923f38998489ee074e0f9813ab2d5 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Sat, 21 Aug 2010 00:57:39 +0000 Subject: [PATCH] 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 --- game/modules/tome/class/Actor.lua | 5 ++++- game/modules/tome/data/talents/spells/conveyance.lua | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 404b3ebc35..c7b4fa053a 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -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 diff --git a/game/modules/tome/data/talents/spells/conveyance.lua b/game/modules/tome/data/talents/spells/conveyance.lua index fd45f8ebd4..3d81ba734e 100644 --- a/game/modules/tome/data/talents/spells/conveyance.lua +++ b/game/modules/tome/data/talents/spells/conveyance.lua @@ -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 -- GitLab