public Style() { AttackElement = AttackElement.None; SupportElement = SupportElement.None; AttackSkill = null; LinkSkill = null; affinities = new Dictionary<byte, Affinity>(); }
public Style() { AttackElement = AttackElement.None; SupportElement = SupportElement.None; AttackSkill = null; LinkSkill = null; affinities = new Dictionary <byte, Affinity>(); }
/// <summary> /// Sets whether or not this unit is immune to an element. /// </summary> /// <param name="element">The element to set</param> /// <param name="immune">True to make immune, false to remove immunity</param> public void SetElementImmune(AttackElement element, bool immune = true) { if (immune && elementModifiers.ContainsKey(element)) { elementModifiers.Remove(element); } else if (!immune && !elementModifiers.ContainsKey(element) && (!Nonliving || element != AttackElement.POISON)) { elementModifiers.Add(element, 0); } }
/// <summary> /// Figures out how many dice to add or remove from attacks of a given element that /// are made against this unit. If this unit is immune to that element, this returns /// null. /// </summary> /// <param name="element">The element to check</param> /// <returns>Null for immune, otherwise the number of dice to add or remove</returns> public int?GetElementModifier(AttackElement element) { if (elementModifiers.ContainsKey(element)) { return(elementModifiers[element]); } else { return(null); } }
public Attack(string name, string description, int damage, AttackElement element, int unlockCost, bool unlocked, StatusEffect statusEffect = null, float statusEffectProbability = 0f) { Name = name; Description = description; Damage = damage; Element = element; StatusEffect = statusEffect; StatusEffectProbability = statusEffectProbability; UnlockCost = unlockCost; Unlocked = unlocked; }
/// <summary> /// Increases or decreases the number of dice rolled by attacks of a given element against. /// this unit. Positive numbers increase, negative numbers decrease. Null makes this unit /// immune to that element. /// </summary> /// <param name="element">The element to modify</param> /// <param name="modifier">The number of dice that will be added. Negative to subtract, null to make immune.</param> public void SetElementModifier(AttackElement element, int?modifier) { if (modifier == null && elementModifiers.ContainsKey(element)) { elementModifiers.Remove(element); } else if (modifier != null && (!Nonliving || element != AttackElement.POISON)) { if (!elementModifiers.ContainsKey(element)) { elementModifiers.Add(element, (int)modifier); } else { elementModifiers[element] = (int)modifier; } } }
/// <summary> /// Checks if this unit is immune to an element. /// </summary> /// <param name="element">The element to check</param> /// <returns>True if immune, false otherwise</returns> public bool GetElementImmune(AttackElement element) { return(!elementModifiers.ContainsKey(element)); }