|
|
@ -119,8 +119,7 @@ namespace MWMechanics
|
|
|
|
// throughout the iteration of this spell's
|
|
|
|
// throughout the iteration of this spell's
|
|
|
|
// effects, we display a "can't re-cast" message
|
|
|
|
// effects, we display a "can't re-cast" message
|
|
|
|
|
|
|
|
|
|
|
|
// Try absorbing the spell. Some handling must still happen for absorbed effects.
|
|
|
|
int absorbChance = getAbsorbChance(caster, target);
|
|
|
|
bool absorbed = absorbSpell(mId, caster, target);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int currentEffectIndex = 0;
|
|
|
|
int currentEffectIndex = 0;
|
|
|
|
for (std::vector<ESM::ENAMstruct>::const_iterator effectIt (effects.mList.begin());
|
|
|
|
for (std::vector<ESM::ENAMstruct>::const_iterator effectIt (effects.mList.begin());
|
|
|
@ -142,6 +141,13 @@ namespace MWMechanics
|
|
|
|
}
|
|
|
|
}
|
|
|
|
canCastAnEffect = true;
|
|
|
|
canCastAnEffect = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Try absorbing the effect
|
|
|
|
|
|
|
|
if(absorbChance && Misc::Rng::roll0to99() < absorbChance)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
absorbSpell(mId, caster, target);
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!checkEffectTarget(effectIt->mEffectID, target, caster, castByPlayer))
|
|
|
|
if (!checkEffectTarget(effectIt->mEffectID, target, caster, castByPlayer))
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
@ -155,10 +161,6 @@ namespace MWMechanics
|
|
|
|
if (target.getClass().isActor() && target != caster && !caster.isEmpty() && isHarmful)
|
|
|
|
if (target.getClass().isActor() && target != caster && !caster.isEmpty() && isHarmful)
|
|
|
|
target.getClass().onHit(target, 0.0f, true, MWWorld::Ptr(), caster, osg::Vec3f(), true);
|
|
|
|
target.getClass().onHit(target, 0.0f, true, MWWorld::Ptr(), caster, osg::Vec3f(), true);
|
|
|
|
|
|
|
|
|
|
|
|
// Avoid proceeding further for absorbed spells.
|
|
|
|
|
|
|
|
if (absorbed)
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Reflect harmful effects
|
|
|
|
// Reflect harmful effects
|
|
|
|
if (!reflected && reflectEffect(*effectIt, magicEffect, caster, target, reflectedEffects))
|
|
|
|
if (!reflected && reflectEffect(*effectIt, magicEffect, caster, target, reflectedEffects))
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|