diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-09 12:05:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-09 12:05:10 +0300 |
commit | e26586ce6efaceb31ec534d488dace4d73702f56 (patch) | |
tree | 547db865ddb0fb3c82f60ebee0bb13879e465c4c /src/gui/windows/skilldialog.cpp | |
parent | d472a3cf2a40169ffb4eca900e9cc53e6bcc4cc7 (diff) | |
download | manaverse-e26586ce6efaceb31ec534d488dace4d73702f56.tar.gz manaverse-e26586ce6efaceb31ec534d488dace4d73702f56.tar.bz2 manaverse-e26586ce6efaceb31ec534d488dace4d73702f56.tar.xz manaverse-e26586ce6efaceb31ec534d488dace4d73702f56.zip |
Add skill attributes with effect id what will play on caster and target while casting skill.
New skill attributes:
skillCastingSrcEffectId - will play this effect on caster while casting skill
skillCastingDstEffectId - will play this effect on target while casting skill.
This effects for casting skill, not for skill attack.
Diffstat (limited to 'src/gui/windows/skilldialog.cpp')
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 04d883402..31cf81ad4 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -325,6 +325,10 @@ void SkillDialog::loadXmlFile(const std::string &fileName) node, "errorText", name); skill->alwaysVisible = XML::getBoolProperty( node, "alwaysVisible", false); + skill->castingSrcEffectId = XML::getProperty( + node, "castingSrcEffectId", -1); + skill->castingDstEffectId = XML::getProperty( + node, "castingDstEffectId", -1); skill->visible = skill->alwaysVisible; model->addSkill(skill); mSkills[id] = skill; @@ -614,6 +618,30 @@ void SkillDialog::playRemoveEffect(const int id) const paths.getIntValue("skillRemoveEffectId")); } +void SkillDialog::playCastingSrcEffect(const int id, Being *const being) const +{ + if (!effectManager) + return; + SkillInfo *const info = getSkill(id); + if (!info) + return; + effectManager->triggerDefault(info->castingSrcEffectId, + being, + paths.getIntValue("skillCastingSrcEffectId")); +} + +void SkillDialog::playCastingDstEffect(const int id, Being *const being) const +{ + if (!effectManager) + return; + SkillInfo *const info = getSkill(id); + if (!info) + return; + effectManager->triggerDefault(info->castingDstEffectId, + being, + paths.getIntValue("skillCastingDstEffectId")); +} + void SkillDialog::useSkill(const SkillInfo *const info) { const SkillData *const data = info->data; |