// NOTE: these are public, but only exist to be used by GameAttribute scripts. // They provide raw attribute access of values, no scripts will be triggered when used. public int _RawGetAttribute(GameAttributeI attribute, int? key) { return RawGetAttributeValue(attribute, key).Value; }
public int this[GameAttributeI attribute] { get { return GetAttributeValue(attribute, null).Value; } set { SetAttributeValue(attribute, null, new GameAttributeValue(value)); } }
public int this[GameAttributeI attribute, int? key] { get { return GetAttributeValue(attribute, key).Value; } set { SetAttributeValue(attribute, key, new GameAttributeValue(value)); } }
public int GetItemBonus(GameAttributeI attributeI, int attributeKey) { return this.Loaded ? this.GetEquippedItems().Sum(item => item.Attributes[attributeI, attributeKey]) : 0; }