public void ChangeBounty(int value) { bounty += value; if (bounty < 0) { bounty = 0; } if (OnStatChange != null) { OnStatChange.Invoke(); } }
// 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); }
public void ChangeSpeedStat(int value) { speed += value; if (speed < 1) { speed = 1; } if (OnStatChange != null) { OnStatChange.Invoke(); } }
public void ChangeDefenseStat(int value) { defense += value; if (defense < 1) { defense = 1; } if (OnStatChange != null) { OnStatChange.Invoke(); } }
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; } }