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

When frozen the movement keys will do autoattacks to the ice

git-svn-id: http://svn.net-core.org/repos/t-engine4@3421 51575b47-30f0-44d4-a5cc-537603b46e54
parent 31cc4827
No related branches found
No related tags found
No related merge requests found
...@@ -485,6 +485,7 @@ function _M:move(x, y, force) ...@@ -485,6 +485,7 @@ function _M:move(x, y, force)
local ox, oy = self.x, self.y local ox, oy = self.x, self.y
if force or self:enoughEnergy() then if force or self:enoughEnergy() then
-- Confused ? -- Confused ?
if not force and self:attr("confused") then if not force and self:attr("confused") then
if rng.percent(self:attr("confused")) then if rng.percent(self:attr("confused")) then
...@@ -492,8 +493,12 @@ function _M:move(x, y, force) ...@@ -492,8 +493,12 @@ function _M:move(x, y, force)
end end
end end
-- Encased in ice, attack the ice
if self:attr("encased_in_ice") then
self:attackTarget(self)
moved = true
-- Should we prob travel through walls ? -- Should we prob travel through walls ?
if not force and self:attr("prob_travel") and game.level.map:checkEntity(x, y, Map.TERRAIN, "block_move", self) then elseif not force and self:attr("prob_travel") and game.level.map:checkEntity(x, y, Map.TERRAIN, "block_move", self) then
moved = self:probabilityTravel(x, y, self:attr("prob_travel")) moved = self:probabilityTravel(x, y, self:attr("prob_travel"))
-- Never move but tries to attack ? ok -- Never move but tries to attack ? ok
elseif not force and self:attr("never_move") then elseif not force and self:attr("never_move") 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