summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-09 16:56:33 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-09 17:01:31 +0300
commit8071fcbf88095bcaf54742062a4ebde87a801fd0 (patch)
treef40dd9a936e105dcbbb28a5a519889264ad86f52
parent53bcb5fd2f680d9a3be9f56e5fab420d83746b00 (diff)
downloadmanaplus-8071fcbf88095bcaf54742062a4ebde87a801fd0.tar.gz
manaplus-8071fcbf88095bcaf54742062a4ebde87a801fd0.tar.bz2
manaplus-8071fcbf88095bcaf54742062a4ebde87a801fd0.tar.xz
manaplus-8071fcbf88095bcaf54742062a4ebde87a801fd0.zip
Allow select skill units and attack it.
Also add key for select skill unit.
-rw-r--r--src/actions/target.cpp9
-rw-r--r--src/actions/target.h1
-rw-r--r--src/being/being.cpp8
-rw-r--r--src/dyetool/actions/target.cpp1
-rw-r--r--src/enums/input/inputaction.h1
-rw-r--r--src/gui/viewport.cpp3
-rw-r--r--src/input/inputactionmap.h6
-rw-r--r--src/input/pages/basic.cpp6
-rw-r--r--src/resources/db/skillunitdb.cpp4
9 files changed, 33 insertions, 6 deletions
diff --git a/src/actions/target.cpp b/src/actions/target.cpp
index 7817ac8e5..f4a177b5d 100644
--- a/src/actions/target.cpp
+++ b/src/actions/target.cpp
@@ -67,6 +67,15 @@ impHandler0(targetMercenary)
#endif
}
+impHandler0(targetSkillUnit)
+{
+#ifdef EATHENA_SUPPORT
+ return setTarget(ActorType::SkillUnit, AllowSort_true);
+#else
+ return false;
+#endif
+}
+
impHandler0(targetPet)
{
#ifdef EATHENA_SUPPORT
diff --git a/src/actions/target.h b/src/actions/target.h
index a1ca2e22b..954fcd195 100644
--- a/src/actions/target.h
+++ b/src/actions/target.h
@@ -33,6 +33,7 @@ namespace Actions
decHandler(targetNPC);
decHandler(targetMercenary);
decHandler(targetPet);
+ decHandler(targetSkillUnit);
decHandler(contextMenu);
} // namespace Actions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 3edd7c70f..1f3a35844 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -699,9 +699,11 @@ void Being::takeDamage(Being *restrict const attacker,
}
else if (mType == ActorType::Monster
#ifdef EATHENA_SUPPORT
- || mType == ActorType::Mercenary
- || mType == ActorType::Pet
- || mType == ActorType::Homunculus
+ ||
+ mType == ActorType::Mercenary ||
+ mType == ActorType::Pet ||
+ mType == ActorType::Homunculus ||
+ mType == ActorType::SkillUnit
#endif
)
{
diff --git a/src/dyetool/actions/target.cpp b/src/dyetool/actions/target.cpp
index de77c4c73..952a93353 100644
--- a/src/dyetool/actions/target.cpp
+++ b/src/dyetool/actions/target.cpp
@@ -33,6 +33,7 @@ impHandlerVoid(targetClosestMonster)
impHandlerVoid(targetNPC)
impHandlerVoid(targetMercenary)
impHandlerVoid(targetPet)
+impHandlerVoid(targetSkillUnit)
impHandlerVoid(contextMenu)
} // namespace Actions
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index 68a11baa3..c35439497 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -625,6 +625,7 @@ enumStart(InputAction)
RESET_MODIFIERS,
BAR_TO_CHAT,
SEEN,
+ TARGET_SKILL_UNIT,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index c7483b8a2..40f32457c 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -452,7 +452,8 @@ bool Viewport::leftMouseAction()
}
else if (!stopAttack &&
(type == ActorType::Monster ||
- type == ActorType::Npc))
+ type == ActorType::Npc ||
+ type == ActorType::SkillUnit))
{
if ((localPlayer->withinAttackRange(mHoverBeing) ||
inputManager.isActionActive(InputAction::ATTACK)))
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 1bd74708d..a808a8208 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5239,6 +5239,12 @@ static const InputActionData inputActionData
"seen|lastseen",
UseArgs_true,
Protected_true},
+ {"keyTargetSkillUnit",
+ defaultAction(&Actions::targetSkillUnit),
+ InputCondition::INGAME | InputCondition::NOTARGET,
+ "targetskillunit|targetskill",
+ UseArgs_false,
+ Protected_false},
};
#undef defaultAction
diff --git a/src/input/pages/basic.cpp b/src/input/pages/basic.cpp
index d5c6f2a15..3817e34ac 100644
--- a/src/input/pages/basic.cpp
+++ b/src/input/pages/basic.cpp
@@ -133,6 +133,12 @@ SetupActionData setupActionDataBasic[] =
},
{
// TRANSLATORS: input action name
+ N_("Target skill unit"),
+ InputAction::TARGET_SKILL_UNIT,
+ "",
+ },
+ {
+ // TRANSLATORS: input action name
N_("Change targeting type"),
InputAction::CHANGE_TARGETING_TYPE,
"",
diff --git a/src/resources/db/skillunitdb.cpp b/src/resources/db/skillunitdb.cpp
index c59f6f616..f77e3f3a2 100644
--- a/src/resources/db/skillunitdb.cpp
+++ b/src/resources/db/skillunitdb.cpp
@@ -101,9 +101,9 @@ void SkillUnitDb::loadXmlFile(const std::string &fileName)
"name", _("skill")));
currentInfo->setTargetSelection(XML::getBoolProperty(skillUnitNode,
- "targetSelection", false));
+ "targetSelection", true));
- BeingCommon::readBasicAttributes(currentInfo, skillUnitNode, "talk");
+ BeingCommon::readBasicAttributes(currentInfo, skillUnitNode, "attack");
currentInfo->setDeadSortOffsetY(XML::getProperty(skillUnitNode,
"deadSortOffsetY", 31));