From a165e5d78010cd1cfedc8bdc320fd7084d58ba2b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 5 Sep 2014 12:32:11 +0300 Subject: add different ways to use skill based on skill type. --- src/gui/windows/skilldialog.cpp | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'src/gui/windows') 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; } } } -- cgit v1.2.3-70-g09d2