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); }
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); }
public AttributeModifier(Attribute attribute, AttributeModifierData data) : base(data.Amount, data.Type) { Data = data; Attribute = attribute; }
private void OnAttributeChanged(AttributesComponent attributes, Attribute attribute) { this.requiresUpdate = true; }