示例#1
0
        private void RefreshAttributeRow(Attribute attribute, CharacterInfoRow row)
        {
            row.SetLabel(attribute.Name);
            row.SetValue(((int)attribute.Value()).ToString());
            row.SetTooltip(attribute.Description);

            if (attribute.HasNegativeModifiers())
            {
                row.SetValueColor(this.negativeColor);
                return;
            }

            row.SetValueColor(attribute.HasModifiers() ? this.positiveColor : this.defaultColor);
        }
示例#2
0
        private static float GetChallengeRatingMultiplier(Attribute attribute, int challengeRating)
        {
            if (challengeRating == 1)
            {
                return(1);
            }

            float multiplier;

            if (attribute.Type == AttributeType.Constitution)
            {
                multiplier = Mathf.Pow(Math.Max(1, challengeRating), 1.15f);
            }
            else
            {
                multiplier = Mathf.Max(1, Mathf.Pow(challengeRating, 0.5f));
            }

            return(multiplier);
        }
示例#3
0
 public AttributeModifier(Attribute attribute, AttributeModifierData data) : base(data.Amount, data.Type)
 {
     Data      = data;
     Attribute = attribute;
 }
示例#4
0
 private void OnAttributeChanged(AttributesComponent attributes, Attribute attribute)
 {
     this.requiresUpdate = true;
 }