/// <summary> /// Adds armor modifications to the ArmorMods dictionary /// </summary> /// <param name="mod">Mod to apply</param> private void ApplyArmorModifiers(KeyValuePair <DamageModifiers, int> mod) { if (ArmorModifiers.ContainsKey(mod.Key)) { ArmorModifiers[mod.Key] += mod.Value; } else { ArmorModifiers.Add(mod.Key, mod.Value); } }
/// <summary> /// Removes armor modifiers from the armor mod dict /// </summary> /// <param name="mod">Mod to remove</param> private void RemoveArmorModifiers(KeyValuePair <DamageModifiers, int> mod) { if (ArmorModifiers.ContainsKey(mod.Key)) { ArmorModifiers[mod.Key] -= mod.Value; // If the value is 0 after subtraction, remove modifier if (ArmorModifiers[mod.Key] == 0) { ArmorModifiers.Remove(mod.Key); } } }