public PrimaryStat getStat(Constants.StatType statType) { switch (statType) { case Constants.StatType.Agility: return(agility); case Constants.StatType.Might: return(might); case Constants.StatType.Stamina: return(stamina); case Constants.StatType.Knowledge: return(knowledge); case Constants.StatType.Perception: return(perception); case Constants.StatType.Willpower: return(willpower); default: return(null); } }
public PrimaryStat(Constants.StatType _type, int _baseValue, int _minimum, int _maximum) { type = _type; baseValue = _baseValue; minimum = _minimum; maximum = _maximum; modifier = 0; }
public Skill(string _name, Constants.StatType _statType0, Constants.StatType _statType1, Constants.StatType _statType2) { name = _name; stats = new List <Constants.StatType>(); stats.Add(_statType0); stats.Add(_statType1); stats.Add(_statType2); points = 0; }
public void decreaseStat(string statName) { Constants.StatType statType = (Constants.StatType)Enum.Parse(typeof(Constants.StatType), statName); int newValue = character.getStat(statType).getBaseValue() - 1; if (newValue >= character.getStat(statType).getMinimum()) { character.getStat(statType).setBaseValue(newValue); character.calculateDerivedStats(); statPoints++; updateUI(); } }
public void increaseStat(string statName) { if (statPoints > 0) { Constants.StatType statType = (Constants.StatType)Enum.Parse(typeof(Constants.StatType), statName); int newValue = character.getStat(statType).getBaseValue() + 1; if (newValue <= character.getStat(statType).getMaximum()) { character.getStat(statType).setBaseValue(newValue); character.calculateDerivedStats(); statPoints--; updateUI(); } } }