protected override void InflictDamage(Actor victim, Actor firedBy, HitShape shape, WarheadArgs args)
        {
            var healthInfo = victim.Info.TraitInfo <HealthInfo>();
            var damage     = Util.ApplyPercentageModifiers(healthInfo.HP, args.DamageModifiers.Append(Damage, DamageVersus(victim, shape, args)));

            victim.InflictDamage(firedBy, new Damage(damage, DamageTypes));
        }
        protected override void InflictDamage(Actor victim, Actor firedBy, HitShape shape, WarheadArgs args)
        {
            var validTraits = victim.TraitsImplementing <INotifyPassengersDamage>();

            foreach (var trait in validTraits)
            {
                trait.DamagePassengers(Damage, firedBy, Amount, Versus, DamageTypes, args.DamageModifiers);
            }
        }
Пример #3
0
        protected override void InflictDamage(Actor victim, Actor firedBy, HitShape hitshape, WarheadArgs args)
        {
            var warpable = victim.TraitOrDefault <Warpable>();

            if (warpable == null)
            {
                return;
            }

            var damage = Util.ApplyPercentageModifiers(Damage, args.DamageModifiers.Append(DamageVersus(victim, hitshape, args)));

            warpable.AddDamage(damage, firedBy);
        }
Пример #4
0
        protected override void InflictDamage(Actor victim, Actor firedBy, HitShape shape, WarheadArgs args)
        {
            var affectedByTemportal = victim.TraitOrDefault <AffectedByTemporal>();

            if (affectedByTemportal == null)
            {
                return;
            }

            var damage = Util.ApplyPercentageModifiers(Damage, args.DamageModifiers.Append(DamageVersus(victim, shape, args)));

            affectedByTemportal.AddDamage(damage, firedBy, DamageTypes);
        }
Пример #5
0
        protected virtual int DamageVersus(Actor victim, HitShape shape, WarheadArgs args)
        {
            // If no Versus values are defined, DamageVersus would return 100 anyway, so we might as well do that early.
            if (Versus.Count == 0)
            {
                return(100);
            }

            var armor = victim.TraitsImplementing <Armor>()
                        .Where(a => !a.IsTraitDisabled && a.Info.Type != null && Versus.ContainsKey(a.Info.Type) &&
                               (shape.Info.ArmorTypes.IsEmpty || shape.Info.ArmorTypes.Contains(a.Info.Type)))
                        .Select(a => Versus[a.Info.Type]);

            return(Util.ApplyPercentageModifiers(100, armor));
        }
Пример #6
0
        protected virtual void InflictDamage(Actor victim, Actor firedBy, HitShape shape, WarheadArgs args)
        {
            var damage = Util.ApplyPercentageModifiers(Damage, args.DamageModifiers.Append(DamageVersus(victim, shape, args)));

            victim.InflictDamage(firedBy, new Damage(damage, DamageTypes));
        }