diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-07 21:24:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-07 21:24:51 +0300 |
commit | 0ff91dcf4754a867be162095f500ca5b0bea2fdf (patch) | |
tree | 8a6ed6ece71be870bba97cc3b5fd124d486d94ec /src | |
parent | 07d4987ae8ae1efea72d8a16b4f4bf17117c6c10 (diff) | |
download | manaplus-0ff91dcf4754a867be162095f500ca5b0bea2fdf.tar.gz manaplus-0ff91dcf4754a867be162095f500ca5b0bea2fdf.tar.bz2 manaplus-0ff91dcf4754a867be162095f500ca5b0bea2fdf.tar.xz manaplus-0ff91dcf4754a867be162095f500ca5b0bea2fdf.zip |
Add additional attributes to missile particles in skills.
Diffstat (limited to 'src')
-rw-r--r-- | src/being/being.cpp | 4 | ||||
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 25 | ||||
-rw-r--r-- | src/resources/skill/skilldata.cpp | 4 | ||||
-rw-r--r-- | src/resources/skill/skilldata.h | 5 |
4 files changed, 30 insertions, 8 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 28a6a1f8d..0929b8b22 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1023,7 +1023,7 @@ void Being::handleSkillCasting(Being *restrict const victim, effectManager->triggerDefault(data->castingDstEffectId, victim, paths.getIntValue("skillCastingDstEffectId")); - fireMissile(victim, data->castingMissileParticle); + fireMissile(victim, data->castingMissile.particle); } } @@ -1046,7 +1046,7 @@ void Being::handleSkill(Being *restrict const victim, effectManager->triggerDefault(data->dstEffectId, victim, paths.getIntValue("skillDstEffectId")); - fireMissile(victim, data->missileParticle); + fireMissile(victim, data->missile.particle); } if (this != localPlayer && (skill != nullptr)) diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index a1ad9b6ab..b4699c525 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -562,10 +562,31 @@ void SkillDialog::loadSkillData(XmlNodeConstPtr node, "shortName", name.substr(0, 3)); data->description = XML::langProperty( node, "description", ""); - data->missileParticle = XML::getProperty( + + MissileInfo &missile = data->missile; + missile.particle = XML::getProperty( node, "missile-particle", ""); - data->castingMissileParticle = XML::getProperty( + missile.z = static_cast<float>(XML::getFloatProperty( + node, "missile-z", 32.0f)); + missile.lifeTime = static_cast<float>(XML::getProperty( + node, "missile-lifetime", 3000)); + missile.speed = static_cast<float>(XML::getFloatProperty( + node, "missile-speed", 7.0f)); + missile.dieDistance = static_cast<float>( + XML::getFloatProperty(node, "missile-diedistance", 8.0f)); + + MissileInfo &castingMissile = data->castingMissile; + castingMissile.particle = XML::getProperty( node, "castingMissile-particle", ""); + castingMissile.z = static_cast<float>(XML::getFloatProperty( + node, "castingMissile-z", 32.0f)); + castingMissile.lifeTime = static_cast<float>(XML::getProperty( + node, "castingMissile-lifetime", 3000)); + castingMissile.speed = static_cast<float>(XML::getFloatProperty( + node, "castingMissile-speed", 7.0f)); + castingMissile.dieDistance = static_cast<float>( + XML::getFloatProperty(node, "castingMissile-diedistance", 8.0f)); + data->castingAnimation = XML::getProperty( node, "castingAnimation", diff --git a/src/resources/skill/skilldata.cpp b/src/resources/skill/skilldata.cpp index 701eed31f..ef3b331cf 100644 --- a/src/resources/skill/skilldata.cpp +++ b/src/resources/skill/skilldata.cpp @@ -37,8 +37,8 @@ SkillData::SkillData() : shortName(), dispName(), description(), - missileParticle(), - castingMissileParticle(), + missile(), + castingMissile(), invokeCmd(), castingAnimation(), soundHit(std::string(), 0), diff --git a/src/resources/skill/skilldata.h b/src/resources/skill/skilldata.h index 44374e98a..7dc2e05ac 100644 --- a/src/resources/skill/skilldata.h +++ b/src/resources/skill/skilldata.h @@ -23,6 +23,7 @@ #ifndef GUI_WIDGETS_SKILLDATA_H #define GUI_WIDGETS_SKILLDATA_H +#include "resources/missileinfo.h" #include "resources/soundinfo.h" class Image; @@ -34,8 +35,8 @@ struct SkillData final std::string dispName; std::string description; - std::string missileParticle; - std::string castingMissileParticle; + MissileInfo missile; + MissileInfo castingMissile; std::string invokeCmd; std::string castingAnimation; |