public void TestAddModifier()
    {
        StatModifier modifier = new StatModifier(50);

        _baseHealth.AddModifier(modifier);
        health = _baseHealth.CalculatedValue;
    }
    public void SpendSkillPoint(CharacterSkill skill)
    {
        if (characterData.GetStatPoints() == 0)
        {
            return;
        }

        switch (skill)
        {
        case CharacterSkill.Health:
            _healthBaseStat.AddModifier(new StatModifier(25));
            break;

        case CharacterSkill.Speed:
            _speedBaseStat.AddModifier(new StatModifier(2));
            break;

        case CharacterSkill.Strength:
            _strengthBaseStat.AddModifier(new StatModifier(10));
            break;
        }
        characterData.UseStatPoint(skill);
        onStatsChanged?.Invoke(this, EventArgs.Empty);
        SetPointsText();
    }
Beispiel #3
0
 public void AddModifier(string modName, float value, ModifierType type)
 {
     StatObject.AddModifier(modName, value, type);
 }