diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-05 12:32:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:57 +0300 |
commit | a165e5d78010cd1cfedc8bdc320fd7084d58ba2b (patch) | |
tree | d9f63f5a06e910f98ada42f3d7a3991872c6c629 /src/gui/windows/skilldialog.cpp | |
parent | 2cdf1b18d5593dfecacfc7b2e113c404dc64d1f4 (diff) | |
download | manaplus-a165e5d78010cd1cfedc8bdc320fd7084d58ba2b.tar.gz manaplus-a165e5d78010cd1cfedc8bdc320fd7084d58ba2b.tar.bz2 manaplus-a165e5d78010cd1cfedc8bdc320fd7084d58ba2b.tar.xz manaplus-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.cpp | 31 |
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; } } } |