public void AddEffects(IEnumerable<EffectInformation> effects, DungeonCharacter dc)
 {
     if (!Effects.ContainsKey(dc))
     {
         Effects.Add(dc,new List<EffectInformation>());
     }
     Effects[dc].AddRange(effects);
 }
 public void AddEffect(EffectInformation effect, DungeonCharacter dc)
 {
     if (!Effects.ContainsKey(dc))
     {
         Effects.Add(dc,new List<EffectInformation>());
     }
     Effects[dc].Add(effect);
 }
        public static double ConvertAgilityToMiliseconds(DungeonCharacter dc)
        {
            //int Agi = dc.DCStats.GetStat(StatsType.Agility);
            int agi = Hero.GetInstance().DCStats.GetStat(StatsType.Agility);

            double y = 500 + (1500 * Math.Pow(1.008, -.5 * agi));
            return y;
        }
        public override void HandleAttack(EnumAttacks attack, Target targets, DungeonCharacter attacker)
        {
            if (attack.Equals(EnumAttacks.WeakAttack))
            {
                int str = (attacker.DCStats.GetStat(StatsType.Strength));

                int damage = _random.Next((int)(BaseDamage * StatAlgorithms.GetPercentStrength(str, LowPercent)), (int)(BaseDamage * StatAlgorithms.GetPercentStrength(str, HighPercent)));

                var cmd = new StatAugmentCommand();

                int appliedDamage = StatAlgorithms.ApplyDefence(damage, targets.ElementAt(DEFAULT_INDEX));
                cmd.AddEffect(new EffectInformation(StatsType.CurHp, -appliedDamage), targets.ElementAt(DEFAULT_INDEX));

                cmd.AddEffect(new EffectInformation(StatsType.CurResources, attack.Cost + (int)(.1275 * attacker.DCStats.GetStat(StatsType.Intelegence))), attacker);
                cmd.RegisterCommand();
            }
            else
            {
                NextLink.HandleAttack(attack,targets,attacker);
            }
        }
 public abstract void HandleAttack(EnumAttacks attack, Target targets, DungeonCharacter attacker);
 internal StatAugmentCommandThread(EffectInformation effect, DungeonCharacter target)
 {
     _effect = effect;
     _target = target;
 }
 public static EffectInformation ModifyStatBy(StatsType stat, DungeonCharacter target, double percent, int duration)
 {
     return new EffectInformation(stat, (int)(target.DCStats.GetStat(stat) * percent), 0, duration);
 }
        public static int ApplyDefence(int damage, DungeonCharacter target)
        {
            double damageReduction = 25 + (75 * Math.Pow(1.0105, -.5 * target.DCStats.GetStat(StatsType.Defense)));

            return (int)(damage * (damageReduction/100));
        }