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 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 float Evaluate() { return(converter.multiplier * attributeInstance.GetTotalValue() + converter.baseValue); }
public float GetDelta() { return(deltaAttribute.GetTotalValue()); }
public float GetMax() { return(maxAttribute.GetTotalValue()); }
public float GetMin() { return(minAttribute.GetTotalValue()); }