Esempio n. 1
0
    public void ChangeBounty(int value)
    {
        bounty += value;
        if (bounty < 0)
        {
            bounty = 0;
        }

        if (OnStatChange != null)
        {
            OnStatChange.Invoke();
        }
    }
Esempio n. 2
0
 // Returns false and does not deduct money if it would lead to a negative sum of money
 public bool ChangeMoneySum(int value)
 {
     if (money + value >= 0)
     {
         money += value;
         if (OnStatChange != null)
         {
             OnStatChange.Invoke();
         }
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
    public void ChangeSpeedStat(int value)
    {
        speed += value;
        if (speed < 1)
        {
            speed = 1;
        }

        if (OnStatChange != null)
        {
            OnStatChange.Invoke();
        }
    }
Esempio n. 4
0
    public void ChangeDefenseStat(int value)
    {
        defense += value;
        if (defense < 1)
        {
            defense = 1;
        }

        if (OnStatChange != null)
        {
            OnStatChange.Invoke();
        }
    }
Esempio n. 5
0
    public void ChangeAttackStat(int value)
    {
        attack += value;
        if (attack < 1)
        {
            attack = 1;
        }

        if (OnStatChange != null)
        {
            OnStatChange.Invoke();
        }
    }
    private void UpdateStatDisplay(StatType statType)
    {
        switch (statType)
        {
        default:
            OnStatChange.Invoke(statType);
            break;

        case StatType.MaxHealth:
            Health.FixCurrentValue(true);
            break;

        case StatType.MaxSpirit:
            Spirit.FixCurrentValue(true);
            break;
        }
    }