summaryrefslogtreecommitdiff
path: root/src/actionmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-15 15:26:51 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-15 15:26:51 +0300
commitd30e64a2be314eb17fa45274524108c054cebea1 (patch)
tree36ef230b5ca5ea023e6a852a089df99d74922095 /src/actionmanager.cpp
parent1b06805d4c1bf43b9694dbcdd568112a75293cab (diff)
downloadmv-d30e64a2be314eb17fa45274524108c054cebea1.tar.gz
mv-d30e64a2be314eb17fa45274524108c054cebea1.tar.bz2
mv-d30e64a2be314eb17fa45274524108c054cebea1.tar.xz
mv-d30e64a2be314eb17fa45274524108c054cebea1.zip
add ability to select and heal nearest player.
Fir this action need press Mod key (left shift) and help key (C).
Diffstat (limited to 'src/actionmanager.cpp')
-rw-r--r--src/actionmanager.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index d0fdfeddb..3e675429e 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -371,6 +371,18 @@ impHandler0(heal)
{
if (actorSpriteManager)
{
+ if (inputManager.isActionActive(Input::KEY_MOD))
+ {
+ Being *target = player_node->getTarget();
+ if (!target || target->getType() != ActorSprite::PLAYER)
+ {
+ target = actorSpriteManager->findNearestLivingBeing(
+ player_node, 10, ActorSprite::PLAYER);
+ if (target)
+ player_node->setTarget(target);
+ }
+ }
+
actorSpriteManager->healTarget();
if (Game::instance())
Game::instance()->setValidSpeed();