예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
            }
        }
예제 #6
0
 public float Evaluate()
 {
     return(converter.multiplier * attributeInstance.GetTotalValue() + converter.baseValue);
 }
예제 #7
0
 public float GetDelta()
 {
     return(deltaAttribute.GetTotalValue());
 }
예제 #8
0
 public float GetMax()
 {
     return(maxAttribute.GetTotalValue());
 }
예제 #9
0
 public float GetMin()
 {
     return(minAttribute.GetTotalValue());
 }