ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Wed Sep 19, 2018 10:23 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Aug 13, 2018 7:12 pm 
Offline
Cornac

Joined: Wed Jun 06, 2018 10:53 am
Posts: 31
Short description.
A player character can exchange places with a friendly unit while under pin effect.

Actual result.
A pinned player character swaps places when ordered to move to an adjacent tile occupied by a friendly unit.

Expected result.
A pinned player character shouldn't be able to swap places when ordered to move to an adjacent tile occupied by a friendly unit.

Steps to reproduce.
1. Enable Developer Mode.
2. Create a cornac/alchemist character.
3. Apply pinned effect with game.player:setEffect(game.player.EFF_PINNED, 10, {}).
4. Try to switch places with Golem.

Game version.
1.5.10 for windows from ToME site.

Comment.
Also works when a player character tries to switch places with a pinned friendly unit. May be it is intended, but I think it's not unreasonable to consider this move a movement. A summoner can utilise this to cover some ground (while pinned/bone grabbed) in tight places like corridors.
A condition for Displace code (line 59) in ..\mod\class\interface\Combat.lua may do the trick. Definitely requires more testing.
Code:
         -- Displace
         if (not self:attr("never_move")) and (not target:attr("never_move")) then
            local tx, ty, sx, sy = target.x, target.y, self.x, self.y
            target:move(sx, sy, true)
            self:move(tx, ty, true)
            if target.describeFloor then target:describeFloor(target.x, target.y, true) end
            if self.describeFloor then self:describeFloor(self.x, self.y, true) end
   
            local energy = game.energy_to_act * self:combatMovementSpeed(x, y)
            if self:attr("bump_swap_speed_divide") then
               energy = energy / self:attr("bump_swap_speed_divide")
            end
            self:useEnergy(energy)
            self.did_energy = true
         elseif self:attr("never_move") then
            game.logPlayer(self, "You are unable to swap places because you can't move!")
         else
            game.logPlayer(self, "You are unable to swap places because the target can't move!")
         end


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group