コード例 #1
0
 public void AddEffects(IEnumerable<EffectInformation> effects, DungeonCharacter dc)
 {
     if (!Effects.ContainsKey(dc))
     {
         Effects.Add(dc,new List<EffectInformation>());
     }
     Effects[dc].AddRange(effects);
 }
コード例 #2
0
 public void AddEffect(EffectInformation effect, DungeonCharacter dc)
 {
     if (!Effects.ContainsKey(dc))
     {
         Effects.Add(dc,new List<EffectInformation>());
     }
     Effects[dc].Add(effect);
 }
コード例 #3
0
        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;
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 public abstract void HandleAttack(EnumAttacks attack, Target targets, DungeonCharacter attacker);
コード例 #6
0
 internal StatAugmentCommandThread(EffectInformation effect, DungeonCharacter target)
 {
     _effect = effect;
     _target = target;
 }
コード例 #7
0
 public static EffectInformation ModifyStatBy(StatsType stat, DungeonCharacter target, double percent, int duration)
 {
     return new EffectInformation(stat, (int)(target.DCStats.GetStat(stat) * percent), 0, duration);
 }
コード例 #8
0
        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));
        }