public AmountInstance(Amount amount, GameObject game_object) : base(game_object, amount) { Attributes attributes = game_object.GetAttributes(); minAttribute = attributes.Add(amount.minAttribute); maxAttribute = attributes.Add(amount.maxAttribute); deltaAttribute = attributes.Add(amount.deltaAttribute); }
public string GetProfessionDescriptionString() { AttributeInstance profession = GetProfession(); if ((int)profession.GetTotalValue() == 0) { return(DUPLICANTS.ATTRIBUTES.UNPROFESSIONAL_DESC); } return(string.Format(DUPLICANTS.ATTRIBUTES.PROFESSION_DESC, profession.modifier.Name)); }
public string GetProfessionString(bool longform = true) { AttributeInstance profession = GetProfession(); if ((int)profession.GetTotalValue() == 0) { return(string.Format((!longform) ? UI.ATTRIBUTELEVEL_SHORT : UI.ATTRIBUTELEVEL, 0, DUPLICANTS.ATTRIBUTES.UNPROFESSIONAL_NAME)); } return(string.Format((!longform) ? UI.ATTRIBUTELEVEL_SHORT : UI.ATTRIBUTELEVEL, (int)profession.GetTotalValue(), profession.modifier.ProfessionName)); }
public AttributeInstance Add(Attribute attribute) { AttributeInstance attributeInstance = Get(attribute.Id); if (attributeInstance == null) { attributeInstance = new AttributeInstance(gameObject, attribute); AttributeTable.Add(attributeInstance); } return(attributeInstance); }
public float GetValue(string id) { float result = 0f; AttributeInstance attributeInstance = Get(id); if (attributeInstance != null) { result = attributeInstance.GetTotalValue(); } else { Debug.LogError("Could not find attribute " + id); } return(result); }
public float GetValuePercent(string attribute_id) { float result = 1f; AttributeInstance attributeInstance = Get(attribute_id); if (attributeInstance != null) { result = attributeInstance.GetTotalValue() / attributeInstance.GetBaseValue(); } else { Debug.LogError("Could not find attribute " + attribute_id); } return(result); }
public AttributeInstance GetProfession() { AttributeInstance attributeInstance = null; using (IEnumerator <AttributeInstance> enumerator = GetEnumerator()) { while (enumerator.MoveNext()) { AttributeInstance current = enumerator.Current; if (current.modifier.IsProfession) { if (attributeInstance == null) { attributeInstance = current; } else if (attributeInstance.GetTotalValue() < current.GetTotalValue()) { attributeInstance = current; } } } return(attributeInstance); } }
public AttributeLevel(AttributeInstance attribute) { notification = new Notification(MISC.NOTIFICATIONS.LEVELUP.NAME, NotificationType.Good, HashedString.Invalid, OnLevelUpTooltip, null, true, 0f, null, null, null); this.attribute = attribute; }
public string GetTooltip(AttributeInstance instance) { return(formatter.GetTooltip(this, instance)); }
public string GetDescription(AttributeInstance instance) { return(instance.GetDescription()); }
public AttributeConverterInstance(GameObject game_object, AttributeConverter converter, AttributeInstance attribute_instance) : base(game_object, converter) { this.converter = converter; attributeInstance = attribute_instance; }