public int AddPassiveEffects(PassiveEffect pe) { for (int i = 0; i < ElementRates.Length; i++) { ElementRates[i] += pe.ElementRates[i]; } for (int i = 0; i < StateRates.Length; i++) { StateRates[i] += pe.StateRates[i]; } StatModifiers.Add(pe.StatModifiers); SPConsumeRate += pe.SPConsumeRate; ComboDifficulty += pe.ComboDifficulty; Counter += pe.Counter; Reflect += pe.Reflect; ExtraTurns += pe.ExtraTurns; if (pe.DisabledToolType1 > 0) { DisabledToolTypes.Add(pe.DisabledToolType1); } if (pe.DisabledToolType2 > 0) { DisabledToolTypes.Add(pe.DisabledToolType2); } if (pe.RemoveByHit > 0) { RemoveByHit.AddRange(new int[] { pe.Id, pe.RemoveByHit }); } return(pe.Id); }
public void AddStatModifier(Unit.StatTypes statType, StatModifierTypes modType, int value) { if (statType == Unit.StatTypes.Default || modType == StatModifierTypes.None) { throw new Exception("Not valid stat modifier inputs"); } if (StatModifiers.Any(x => x.StatType == statType)) { StatModifiers.RemoveAll(x => x.StatType == statType); } StatModifiers.Add(new StatModifier() { StatType = statType, ModType = modType, Value = value }); }