Esempio n. 1
0
        public override SkillEffects ComputeEffects(SkillForecast forecast, IRandomizer randomizer)
        {
            var chances = forecast.Chances;
            var effects = new List <IEffect> {
                DamageUtils.GetFinalizedPhysicalDamage(forecast.Hit.BaseDamage, chances, randomizer)
            };

            return(new SkillEffects(effects));
        }
Esempio n. 2
0
        public override SkillEffects ComputeEffects(SkillForecast forecast, IRandomizer randomizer)
        {
            var myKinesis = forecast.Hit.BaseDamage;
            var hit       = new List <IEffect> {
                new Damage(myKinesis)
            };

            return(new SkillEffects(hit));
        }
Esempio n. 3
0
        public override SkillEffects ComputeEffects(SkillForecast forecast, IRandomizer randomizer)
        {
            var healAmount = forecast.Hit.BaseDamage;

            return(new SkillEffects(
                       new List <IEffect> {
                new Damage(healAmount)
            }
                       ));
        }
Esempio n. 4
0
        public override SkillEffects ComputeEffects(SkillForecast forecast, IRandomizer randomizer)
        {
            var baseResult = GetBaseStrategyByRange(forecast.Attacker, forecast.Defender)
                             .ComputeEffects(forecast, randomizer);
            var damage = baseResult.GetDefenderDamage();

            if (damage >= forecast.Defender.Health)
            {
                var baseEffects = baseResult.ReceiverEffects;
                baseEffects.Add(new Effects.Advance(forecast.Attacker));
            }

            return(baseResult);
        }
Esempio n. 5
0
        public override SkillEffects ComputeEffects(SkillForecast forecast, IRandomizer randomizer)
        {
            var baseEffects = base.ComputeEffects(forecast, randomizer);

            var attacker = forecast.Attacker;
            var defender = forecast.Defender;

            // Knockback doesn't take effect if you miss
            if (!baseEffects.ReceiverEffects.OfType <Miss>().Any())
            {
                var direction   = MathUtils.DirectionTo(attacker.Position, defender.Position);
                var destination = MathUtils.GetAdjacentPoint(defender.Position, direction);

                // Knockback does nothing if the destination is blocked
                if (!_map.IsBlocked(destination))
                {
                    baseEffects.ReceiverEffects.Add(new Shove(direction, _map));
                    baseEffects.ReceiverEffects.Add(new SuppressCounter());
                }
            }

            return(baseEffects);
        }
Esempio n. 6
0
        public override SkillEffects ComputeEffects(SkillForecast forecast, IRandomizer randomizer)
        {
            var defender    = forecast.Defender;
            var parryChance = defender.GetStat(StatType.ProjectileParryChance);
            var didParry    = RandomUtils.DidEventHappen(parryChance.Value, randomizer);

            if (didParry)
            {
                return(new SkillEffects(
                           new List <IEffect> {
                    new Miss(MissReason.Parry)
                }
                           ));
            }

            var baseDamage = forecast.Hit.BaseDamage;
            var hit        = DamageUtils.GetFinalizedPhysicalDamage(baseDamage, forecast.Chances, randomizer);

            return(new SkillEffects(new List <IEffect>()
            {
                hit
            }));
        }
Esempio n. 7
0
 public SkillEffects FinalizeForecast(SkillForecast forecast, IRandomizer randomizer)
 {
     return(ComputeBuffedResult(forecast.Attacker, forecast.Defender, () => ComputeEffects(forecast, randomizer)));
 }
Esempio n. 8
0
 public abstract SkillEffects ComputeEffects(SkillForecast forecast, IRandomizer randomizer);