summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-09 18:57:45 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-09 18:57:45 +0300
commitf5ccf6d55d650370ee85d92d9f2ed747ed41e200 (patch)
tree69e7bca54190b6cac6c2bbb60b4db19230875345 /src/being/being.cpp
parent4fe5fd9a471760c8ce54c71c8cdf3f27c8fb27ae (diff)
downloadplus-f5ccf6d55d650370ee85d92d9f2ed747ed41e200.tar.gz
plus-f5ccf6d55d650370ee85d92d9f2ed747ed41e200.tar.bz2
plus-f5ccf6d55d650370ee85d92d9f2ed747ed41e200.tar.xz
plus-f5ccf6d55d650370ee85d92d9f2ed747ed41e200.zip
Add to skills miss effect.
New skill attribute missEffectId.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp51
1 files changed, 35 insertions, 16 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 71265d9ac..6bb17ad4b 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -720,10 +720,21 @@ void Being::takeDamage(Being *const attacker,
{
if (effectManager)
{
- const int hitEffectId = getHitEffect(attacker,
- AttackType::MISS,
- attackId,
- level);
+ int hitEffectId = -1;
+ if (type == AttackType::SKILL)
+ {
+ hitEffectId = getHitEffect(attacker,
+ AttackType::SKILLMISS,
+ attackId,
+ level);
+ }
+ else
+ {
+ hitEffectId = getHitEffect(attacker,
+ AttackType::MISS,
+ attackId,
+ level);
+ }
if (hitEffectId >= 0)
effectManager->trigger(hitEffectId, this);
}
@@ -743,7 +754,26 @@ int Being::getHitEffect(const Being *const attacker,
// Init the particle effect path based on current
// weapon or default.
int hitEffectId = 0;
- if (type != AttackType::SKILL)
+ if (type == AttackType::SKILL || type == AttackType::SKILLMISS)
+ {
+ SkillData *const data = skillDialog->getSkillDataByLevel(
+ attackId, level);
+ if (!data)
+ return -1;
+ if (type == AttackType::SKILL)
+ {
+ hitEffectId = data->hitEffectId;
+ if (hitEffectId == -1)
+ hitEffectId = paths.getIntValue("skillHitEffectId");
+ }
+ else
+ {
+ hitEffectId = data->missEffectId;
+ if (hitEffectId == -1)
+ hitEffectId = paths.getIntValue("skillMissEffectId");
+ }
+ }
+ else
{
if (attacker)
{
@@ -789,17 +819,6 @@ int Being::getHitEffect(const Being *const attacker,
hitEffectId = getDefaultEffectId(type);
}
}
- else
- {
- hitEffectId = attackId + 100000;
- SkillData *const data = skillDialog->getSkillDataByLevel(
- attackId, level);
- if (!data)
- return -1;
- hitEffectId = data->hitEffectId;
- if (hitEffectId == -1)
- hitEffectId = paths.getIntValue("skillHitEffectId");
- }
BLOCK_END("Being::getHitEffect")
return hitEffectId;
}