summaryrefslogtreecommitdiff
path: root/src/gui/windows/skilldialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-23 03:12:38 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-23 03:12:38 +0300
commit871f05609ec03cad93773112c3324ba7b0488388 (patch)
tree3ec1d858a3d6a6a3a96b2ab954b41b01751b563e /src/gui/windows/skilldialog.cpp
parentde2637f1e6211bb4a8b122b3aca53723a3440522 (diff)
downloadmanaplus-871f05609ec03cad93773112c3324ba7b0488388.tar.gz
manaplus-871f05609ec03cad93773112c3324ba7b0488388.tar.bz2
manaplus-871f05609ec03cad93773112c3324ba7b0488388.tar.xz
manaplus-871f05609ec03cad93773112c3324ba7b0488388.zip
Allow skill source and destination particle effects depend on skill level.
Diffstat (limited to 'src/gui/windows/skilldialog.cpp')
-rw-r--r--src/gui/windows/skilldialog.cpp74
1 files changed, 12 insertions, 62 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 966168464..02e67408d 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -381,14 +381,6 @@ SkillInfo *SkillDialog::loadSkill(XmlNodePtr node,
node, "errorText", name);
skill->alwaysVisible = fromBool(XML::getBoolProperty(
node, "alwaysVisible", false), Visible);
- skill->castingSrcEffectId = XML::getProperty(
- node, "castingSrcEffectId", -1);
- skill->castingDstEffectId = XML::getProperty(
- node, "castingDstEffectId", -1);
- skill->srcEffectId = XML::getProperty(
- node, "srcEffectId", -1);
- skill->dstEffectId = XML::getProperty(
- node, "dstEffectId", -1);
skill->castingAction = XML::getProperty(node,
"castingAction", SpriteAction::CAST);
skill->castingRideAction = XML::getProperty(node,
@@ -468,6 +460,14 @@ void SkillDialog::loadSkillData(XmlNodePtr node,
node, "hitEffectId", -1);
data->missEffectId = XML::getProperty(
node, "missEffectId", -1);
+ data->castingSrcEffectId = XML::getProperty(
+ node, "castingSrcEffectId", -1);
+ data->castingDstEffectId = XML::getProperty(
+ node, "castingDstEffectId", -1);
+ data->srcEffectId = XML::getProperty(
+ node, "srcEffectId", -1);
+ data->dstEffectId = XML::getProperty(
+ node, "dstEffectId", -1);
skill->addData(level, data);
}
@@ -712,68 +712,18 @@ 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::playSrcEffect(const int id,
- Being *const being) const
-{
- if (!effectManager)
- return;
- SkillInfo *const info = getSkill(id);
- if (!info)
- return;
- effectManager->triggerDefault(info->srcEffectId,
- being,
- paths.getIntValue("skillSrcEffectId"));
-}
-
-void SkillDialog::playDstEffect(const int id,
- Being *const being) const
-{
- if (!effectManager)
- return;
- SkillInfo *const info = getSkill(id);
- if (!info)
- return;
- effectManager->triggerDefault(info->dstEffectId,
- being,
- paths.getIntValue("skillDstEffectId"));
-}
-
void SkillDialog::playCastingDstTileEffect(const int id,
+ const int level,
const int x,
const int y,
const int delay) const
{
if (!effectManager)
return;
- SkillInfo *const info = getSkill(id);
- if (!info)
+ SkillData *const data = getSkillDataByLevel(id, level);
+ if (!data)
return;
- effectManager->triggerDefault(info->castingDstEffectId,
+ effectManager->triggerDefault(data->castingDstEffectId,
x * 32,
y * 32,
cur_time + delay / 1000, // end time in seconds