// For places that only want to update some of the fields (usually DamageModifiers) public WarheadArgs(WarheadArgs args) { Weapon = args.Weapon; DamageModifiers = args.DamageModifiers; Source = args.Source; SourceActor = args.SourceActor; WeaponTarget = args.WeaponTarget; }
/// <summary>Applies all the weapon's warheads to the target.</summary> public void Impact(Target target, WarheadArgs args) { var world = args.SourceActor.World; foreach (var warhead in Warheads) { if (warhead.Delay > 0) { world.AddFrameEndTask(w => w.Add(new DelayedImpact(warhead.Delay, warhead, target, args))); } else { warhead.DoImpact(target, args); } } }
/// <summary>Applies all the weapon's warheads to the target. Only use for projectile-less, special-case impacts.</summary> public void Impact(Target target, Actor firedBy) { // The impact will happen immediately at target.CenterPosition. var args = new WarheadArgs { Weapon = this, SourceActor = firedBy, WeaponTarget = target }; if (firedBy.OccupiesSpace != null) { args.Source = firedBy.CenterPosition; } Impact(target, args); }