private void ProcessStatModifiers(Xml.StatModifiers effect, bool remove = false) { if (effect == null) { return; } if (remove) { Target.Stats.BonusStr -= (long)Math.Ceiling(effect.Str * Intensity); Target.Stats.BonusInt -= (long)Math.Ceiling(effect.Int * Intensity); Target.Stats.BonusWis -= (long)Math.Ceiling(effect.Wis * Intensity); Target.Stats.BonusCon -= (long)Math.Ceiling(effect.Con * Intensity); Target.Stats.BonusDex -= (long)Math.Ceiling(effect.Dex * Intensity); Target.Stats.BonusHp -= (long)Math.Ceiling(effect.Hp * Intensity); Target.Stats.BonusMp -= (long)Math.Ceiling(effect.Mp * Intensity); Target.Stats.BonusHit -= (long)Math.Ceiling(effect.Hit * Intensity); Target.Stats.BonusDmg -= (long)Math.Ceiling(effect.Dmg * Intensity); Target.Stats.BonusAc -= (long)Math.Ceiling(effect.Ac * Intensity); Target.Stats.BonusRegen -= (long )Math.Ceiling(effect.Regen * Intensity); Target.Stats.BonusMr -= (long)Math.Ceiling(effect.Mr * Intensity); Target.Stats.BonusDamageModifier -= effect.DamageModifier * Intensity; Target.Stats.BonusHealModifier -= effect.HealModifier * Intensity; Target.Stats.BonusReflectChance -= effect.ReflectChance * Intensity; Target.Stats.BonusReflectIntensity -= effect.ReflectIntensity * Intensity; if (effect.OffensiveElement == Target.Stats.OffensiveElementOverride) { Target.Stats.OffensiveElementOverride = Xml.Element.None; } if (effect.DefensiveElement == Target.Stats.DefensiveElementOverride) { Target.Stats.DefensiveElementOverride = Xml.Element.None; } } else { Target.Stats.BonusStr += (long)Math.Ceiling(effect.Str * Intensity); Target.Stats.BonusInt += (long)Math.Ceiling(effect.Int * Intensity); Target.Stats.BonusWis += (long)Math.Ceiling(effect.Wis * Intensity); Target.Stats.BonusCon += (long)Math.Ceiling(effect.Con * Intensity); Target.Stats.BonusDex += (long)Math.Ceiling(effect.Dex * Intensity); Target.Stats.BonusHp += (long)Math.Ceiling(effect.Hp * Intensity); Target.Stats.BonusMp += (long)Math.Ceiling(effect.Mp * Intensity); Target.Stats.BonusHit += (long)Math.Ceiling(effect.Hit * Intensity); Target.Stats.BonusDmg += (long)Math.Ceiling(effect.Dmg * Intensity); Target.Stats.BonusAc += (long)Math.Ceiling(effect.Ac * Intensity); Target.Stats.BonusRegen += (long)Math.Ceiling(effect.Regen * Intensity); Target.Stats.BonusMr += (long)Math.Ceiling(effect.Mr * Intensity); Target.Stats.BonusDamageModifier += effect.DamageModifier * Intensity; Target.Stats.BonusHealModifier += effect.HealModifier * Intensity; Target.Stats.BonusReflectChance += effect.ReflectChance * Intensity; Target.Stats.BonusReflectIntensity += effect.ReflectIntensity * Intensity; Target.Stats.OffensiveElementOverride = effect.OffensiveElement; Target.Stats.DefensiveElementOverride = effect.OffensiveElement; } }
private void ProcessStatModifiers(Xml.StatModifiers effect, bool remove = false) { if (effect == null) { return; } if (remove) { Target.Stats.BonusStr -= effect.Str; Target.Stats.BonusInt -= effect.Int; Target.Stats.BonusWis -= effect.Wis; Target.Stats.BonusCon -= effect.Con; Target.Stats.BonusDex -= effect.Dex; Target.Stats.BonusHp -= effect.Hp; Target.Stats.BonusMp -= effect.Mp; Target.Stats.BonusHit -= effect.Hit; Target.Stats.BonusDmg -= effect.Dmg; Target.Stats.BonusAc -= effect.Ac; Target.Stats.BonusRegen -= effect.Regen; Target.Stats.BonusMr -= effect.Mr; Target.Stats.BonusDamageModifier = effect.DamageModifier; Target.Stats.BonusHealModifier = effect.HealModifier; Target.Stats.BonusReflectChance -= effect.ReflectChance; Target.Stats.BonusReflectIntensity -= effect.ReflectIntensity; if (effect.OffensiveElement == Target.Stats.OffensiveElementOverride) { Target.Stats.OffensiveElementOverride = Xml.Element.None; } if (effect.DefensiveElement == Target.Stats.DefensiveElementOverride) { Target.Stats.DefensiveElementOverride = Xml.Element.None; } } else { Target.Stats.BonusStr += effect.Str; Target.Stats.BonusInt += effect.Int; Target.Stats.BonusWis += effect.Wis; Target.Stats.BonusCon += effect.Con; Target.Stats.BonusDex += effect.Dex; Target.Stats.BonusHp += effect.Hp; Target.Stats.BonusMp += effect.Mp; Target.Stats.BonusHit += effect.Hit; Target.Stats.BonusDmg += effect.Dmg; Target.Stats.BonusAc += effect.Ac; Target.Stats.BonusRegen += effect.Regen; Target.Stats.BonusMr += effect.Mr; Target.Stats.BonusDamageModifier = effect.DamageModifier; Target.Stats.BonusHealModifier = effect.HealModifier; Target.Stats.BonusReflectChance += effect.ReflectChance; Target.Stats.BonusReflectIntensity += effect.ReflectIntensity; Target.Stats.OffensiveElementOverride = effect.OffensiveElement; Target.Stats.DefensiveElementOverride = effect.OffensiveElement; } }
public CastableEffects() { _statuses = new Statuses(); _statModifiers = new StatModifiers(); _damage = new CastableDamage(); _heal = new CastableHeal(); _sound = new CastableEffectsSound(); _animations = new SpellAnimations(); _scriptOverride = false; }
public ModifierEffect() { _handler = new Handler(); _conditions = new Conditions(); _statModifiers = new StatModifiers(); _damage = new StatusDamage(); _heal = new StatusHeal(); _messages = new Messages(); _sound = new ModifierEffectSound(); _animations = new StatusAnimations(); }
/// <summary> /// Deserializes xml markup from file into an StatModifiers object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output StatModifiers object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out StatModifiers obj, out Exception exception) { exception = null; obj = default(StatModifiers); try { obj = LoadFromFile(fileName); return(true); } catch (Exception ex) { exception = ex; return(false); } }
/// <summary> /// Deserializes StatModifiers object /// </summary> /// <param name="input">string workflow markup to deserialize</param> /// <param name="obj">Output StatModifiers object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string input, out StatModifiers obj, out Exception exception) { exception = null; obj = default(StatModifiers); try { obj = Deserialize(input); return(true); } catch (Exception ex) { exception = ex; return(false); } }
public static bool LoadFromFile(string fileName, out StatModifiers obj) { Exception exception = null; return(LoadFromFile(fileName, out obj, out exception)); }
public static bool Deserialize(string input, out StatModifiers obj) { Exception exception = null; return(Deserialize(input, out obj, out exception)); }