summaryrefslogtreecommitdiff
path: root/src/gui/windows/skilldialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-05 12:32:11 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:57 +0300
commita165e5d78010cd1cfedc8bdc320fd7084d58ba2b (patch)
treed9f63f5a06e910f98ada42f3d7a3991872c6c629 /src/gui/windows/skilldialog.cpp
parent2cdf1b18d5593dfecacfc7b2e113c404dc64d1f4 (diff)
downloadplus-a165e5d78010cd1cfedc8bdc320fd7084d58ba2b.tar.gz
plus-a165e5d78010cd1cfedc8bdc320fd7084d58ba2b.tar.bz2
plus-a165e5d78010cd1cfedc8bdc320fd7084d58ba2b.tar.xz
plus-a165e5d78010cd1cfedc8bdc320fd7084d58ba2b.zip
add different ways to use skill based on skill type.
Diffstat (limited to 'src/gui/windows/skilldialog.cpp')
-rw-r--r--src/gui/windows/skilldialog.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 7be86ec1b..5b70f685b 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -492,13 +492,34 @@ void SkillDialog::playUpdateEffect(const int id) const
void SkillDialog::useSkill(const SkillInfo *const info)
{
- if (info && localPlayer && localPlayer->getTarget())
+ if (info && localPlayer)
{
- const Being *const being = localPlayer->getTarget();
- if (being)
+ switch (info->type)
{
- Net::getSkillHandler()->useBeing(info->level,
- info->id, being->getId());
+ case SkillType::Attack:
+ {
+ const Being *const being = localPlayer->getTarget();
+ if (being)
+ {
+ Net::getSkillHandler()->useBeing(info->level,
+ info->id, being->getId());
+ }
+ break;
+ }
+ case SkillType::Self:
+ Net::getSkillHandler()->useBeing(info->level,
+ info->id, localPlayer->getId());
+ break;
+
+ case SkillType::Ground:
+ case SkillType::Support:
+ case SkillType::TargetTrap:
+ // for now unused
+ break;
+
+ case SkillType::Unknown:
+ case SkillType::Unused:
+ break;
}
}
}