Example #1
0
        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;
            }
        }
Example #2
0
        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;
            }
        }
Example #3
0
 public CastableEffects()
 {
     _statuses       = new Statuses();
     _statModifiers  = new StatModifiers();
     _damage         = new CastableDamage();
     _heal           = new CastableHeal();
     _sound          = new CastableEffectsSound();
     _animations     = new SpellAnimations();
     _scriptOverride = false;
 }
Example #4
0
 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();
 }
Example #5
0
 /// <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);
     }
 }
Example #6
0
 /// <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);
     }
 }
Example #7
0
        public static bool LoadFromFile(string fileName, out StatModifiers obj)
        {
            Exception exception = null;

            return(LoadFromFile(fileName, out obj, out exception));
        }
Example #8
0
        public static bool Deserialize(string input, out StatModifiers obj)
        {
            Exception exception = null;

            return(Deserialize(input, out obj, out exception));
        }