summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
Diffstat (limited to 'src/being')
-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;
}