예제 #1
0
    /// <summary>
    /// Determines the behavour of three primary attributes.
    /// Constitution increases max HP by 1 per point.
    /// Intellect increases max MP by 1 per point.
    /// Mind increases experience granted by 1% per point.
    /// </summary>
    public void AttributeModified(Attribute attribute)
    {
        PlayerHealth health = GetComponent <PlayerHealth>();
        PlayerMana   mana   = GetComponent <PlayerMana>();

        health.ModifyMaxHealth(attributes[GetAttributeID(Attributes.Constitution)].value.ModifiedValue);
        mana.ModifyMaxMana(attributes[GetAttributeID(Attributes.Intellect)].value.ModifiedValue);
        Experience.Instance.ChangeExperienceModifier((float)attributes[GetAttributeID(Attributes.Mind)].value.ModifiedValue / 100);
        Debug.Log(attribute.type + " was updated. New value is " + attribute.value.ModifiedValue);
    }