Esempio n. 1
0
    public Strength GetSkillStrength(Tolerance tolerance)
    {
        int num = 0;

        foreach (AffectEffectProperty affectEffectProperty in this.affectEffect)
        {
            if (affectEffectProperty != null)
            {
                Strength strength = Strength.None;
                if (affectEffectProperty.ThisSkillIsAttack && affectEffectProperty.powerType == PowerType.Percentage)
                {
                    strength = tolerance.GetAttributeStrength(affectEffectProperty.attribute);
                }
                else if (Tolerance.OnInfluenceToleranceAffectEffect(affectEffectProperty.type))
                {
                    strength = tolerance.GetAffectEffectStrength(affectEffectProperty.type);
                }
                switch (strength)
                {
                case Strength.Strong:
                    num--;
                    break;

                case Strength.Weak:
                    num++;
                    break;

                case Strength.Drain:
                    return(Strength.Drain);

                case Strength.Invalid:
                    return(Strength.Weak);
                }
            }
        }
        if (num < 0)
        {
            return(Strength.Weak);
        }
        if (num > 0)
        {
            return(Strength.Strong);
        }
        return(Strength.None);
    }
Esempio n. 2
0
    public Strength[] GetSkillStrengthList(Tolerance tolerance)
    {
        List <Strength> list = new List <Strength>();

        foreach (AffectEffectProperty affectEffectProperty in this.affectEffect)
        {
            if (affectEffectProperty != null)
            {
                if (affectEffectProperty.ThisSkillIsAttack && affectEffectProperty.canUseAttribute && affectEffectProperty.powerType == PowerType.Percentage)
                {
                    Strength attributeStrength = tolerance.GetAttributeStrength(affectEffectProperty.attribute);
                    if (!list.Contains(attributeStrength))
                    {
                        list.Add(attributeStrength);
                    }
                }
            }
        }
        if (list.Count == 0)
        {
            list.Add(Strength.None);
        }
        return(list.ToArray());
    }