|
|
@ -126,10 +126,7 @@ namespace MWMechanics
|
|
|
|
float castChance = calcSpellBaseSuccessChance(spell, actor, effectiveSchool) + castBonus;
|
|
|
|
float castChance = calcSpellBaseSuccessChance(spell, actor, effectiveSchool) + castBonus;
|
|
|
|
castChance *= stats.getFatigueTerm();
|
|
|
|
castChance *= stats.getFatigueTerm();
|
|
|
|
|
|
|
|
|
|
|
|
if (godmode)
|
|
|
|
if (stats.getMagicEffects().get(ESM::MagicEffect::Silence).getMagnitude()&& !godmode)
|
|
|
|
return 100;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stats.getMagicEffects().get(ESM::MagicEffect::Silence).getMagnitude())
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (spell->mData.mType == ESM::Spell::ST_Power)
|
|
|
|
if (spell->mData.mType == ESM::Spell::ST_Power)
|
|
|
@ -138,12 +135,17 @@ namespace MWMechanics
|
|
|
|
if (spell->mData.mType != ESM::Spell::ST_Spell)
|
|
|
|
if (spell->mData.mType != ESM::Spell::ST_Spell)
|
|
|
|
return 100;
|
|
|
|
return 100;
|
|
|
|
|
|
|
|
|
|
|
|
if (stats.getMagicka().getCurrent() < spell->mData.mCost)
|
|
|
|
if (stats.getMagicka().getCurrent() < spell->mData.mCost && !godmode)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (spell->mData.mFlags & ESM::Spell::F_Always)
|
|
|
|
if (spell->mData.mFlags & ESM::Spell::F_Always)
|
|
|
|
return 100;
|
|
|
|
return 100;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (godmode)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 100;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!cap)
|
|
|
|
if (!cap)
|
|
|
|
return std::max(0.f, castChance);
|
|
|
|
return std::max(0.f, castChance);
|
|
|
|
else
|
|
|
|
else
|
|
|
|