Beispiel #1
0
        public float GetVitalityDecrease(CharacterHealth characterHealth)
        {
            if (Strength < Prefab.ActivationThreshold)
            {
                return(0.0f);
            }
            AfflictionPrefab.Effect currentEffect = Prefab.GetActiveEffect(Strength);
            if (currentEffect == null)
            {
                return(0.0f);
            }
            if (currentEffect.MaxStrength - currentEffect.MinStrength <= 0.0f)
            {
                return(0.0f);
            }

            float currVitalityDecrease = MathHelper.Lerp(
                currentEffect.MinVitalityDecrease,
                currentEffect.MaxVitalityDecrease,
                (Strength - currentEffect.MinStrength) / (currentEffect.MaxStrength - currentEffect.MinStrength));

            if (currentEffect.MultiplyByMaxVitality)
            {
                currVitalityDecrease *= characterHealth == null ? 100.0f : characterHealth.MaxVitality;
            }

            return(currVitalityDecrease);
        }
Beispiel #2
0
 public AfflictionPrefab.Effect GetActiveEffect() => Prefab.GetActiveEffect(Strength);