summaryrefslogtreecommitdiff
path: root/src/gui/windows
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
parentde2637f1e6211bb4a8b122b3aca53723a3440522 (diff)
downloadplus-871f05609ec03cad93773112c3324ba7b0488388.tar.gz
plus-871f05609ec03cad93773112c3324ba7b0488388.tar.bz2
plus-871f05609ec03cad93773112c3324ba7b0488388.tar.xz
plus-871f05609ec03cad93773112c3324ba7b0488388.zip
Allow skill source and destination particle effects depend on skill level.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/skilldialog.cpp74
-rw-r--r--src/gui/windows/skilldialog.h13
2 files changed, 13 insertions, 74 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
diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h
index bd66491e2..c322c6c0a 100644
--- a/src/gui/windows/skilldialog.h
+++ b/src/gui/windows/skilldialog.h
@@ -128,19 +128,8 @@ class SkillDialog final : public Window,
void playRemoveEffect(const int id) const;
- void playSrcEffect(const int id,
- Being *const being) const;
-
- void playDstEffect(const int id,
- Being *const being) const;
-
- void playCastingSrcEffect(const int id,
- Being *const being) const;
-
- void playCastingDstEffect(const int id,
- Being *const being) const;
-
void playCastingDstTileEffect(const int id,
+ const int level,
const int x,
const int y,
const int delay) const;