diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-23 00:18:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-23 00:51:45 +0300 |
commit | 1a5f8957c707625efbcf36722b057d5eda5a21bb (patch) | |
tree | 9dd38bb08f081c232b318d4466552c0f570c2e74 | |
parent | a13d85161a7148295e4ba50b0cdae124e8d6c75a (diff) | |
download | plus-1a5f8957c707625efbcf36722b057d5eda5a21bb.tar.gz plus-1a5f8957c707625efbcf36722b057d5eda5a21bb.tar.bz2 plus-1a5f8957c707625efbcf36722b057d5eda5a21bb.tar.xz plus-1a5f8957c707625efbcf36722b057d5eda5a21bb.zip |
Add skill casting particle arrow effect.
New skill data attribute: castingParticle.
-rw-r--r-- | src/being/being.cpp | 19 | ||||
-rw-r--r-- | src/being/being.h | 4 | ||||
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 4 | ||||
-rw-r--r-- | src/resources/skill/skilldata.cpp | 1 | ||||
-rw-r--r-- | src/resources/skill/skilldata.h | 1 |
6 files changed, 28 insertions, 3 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 6bb166dc2..b5732b15f 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1019,6 +1019,25 @@ void Being::handleAttack(Being *restrict const victim, BLOCK_END("Being::handleAttack") } +void Being::handleSkillCasting(Being *restrict const victim, + const int skillId, + const int skillLevel) restrict2 +{ + if (!victim || !mInfo || !skillDialog) + return; + + setAction(BeingAction::CAST, skillId); + + skillDialog->playCastingSrcEffect(skillId, this); + skillDialog->playCastingDstEffect(skillId, victim); + + const SkillData *restrict const data = skillDialog->getSkillDataByLevel( + skillId, + skillLevel); + if (data) + fireMissile(victim, data->castingParticle); +} + void Being::handleSkill(Being *restrict const victim, const int damage, const int skillId, diff --git a/src/being/being.h b/src/being/being.h index 3ee2c5ed1..72e6d2065 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -209,6 +209,10 @@ class Being notfinal : public ActorSprite, const int damage, const int attackId = 1) restrict2; + void handleSkillCasting(Being *restrict const victim, + const int skillId, + const int skillLevel) restrict2; + void handleSkill(Being *restrict const victim, const int damage, const int skillId, diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 0c6b2d42c..8dcc10e2d 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -439,6 +439,8 @@ void SkillDialog::loadSkillData(XmlNodePtr node, node, "description", ""); data->particle = XML::getProperty( node, "particle", ""); + data->castingParticle = XML::getProperty( + node, "castingParticle", ""); data->castingAnimation = XML::getProperty( node, "castingAnimation", diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index 8686ce564..16a9f6fb8 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -980,9 +980,7 @@ void BeingRecv::processSkillCastingContinue(Net::MessageIn &msg, { // being to being Being *const dstBeing = actorManager->findBeing(dstId); if (srcBeing) - srcBeing->setAction(BeingAction::CAST, skillId); - skillDialog->playCastingSrcEffect(skillId, srcBeing); - skillDialog->playCastingDstEffect(skillId, dstBeing); + srcBeing->handleSkillCasting(dstBeing, skillId, skillLevel); } else if (dstX != 0 || dstY != 0) { // being to position diff --git a/src/resources/skill/skilldata.cpp b/src/resources/skill/skilldata.cpp index 21a80b79f..fc42dc78d 100644 --- a/src/resources/skill/skilldata.cpp +++ b/src/resources/skill/skilldata.cpp @@ -38,6 +38,7 @@ SkillData::SkillData() : dispName(), description(), particle(), + castingParticle(), invokeCmd(), castingAnimation(), soundHit(std::string(), 0), diff --git a/src/resources/skill/skilldata.h b/src/resources/skill/skilldata.h index e02cbc145..a8c4e8ccd 100644 --- a/src/resources/skill/skilldata.h +++ b/src/resources/skill/skilldata.h @@ -35,6 +35,7 @@ struct SkillData final std::string description; std::string particle; + std::string castingParticle; std::string invokeCmd; std::string castingAnimation; |