Beispiel #1
0
        private Weapon CloneWeapon(Weapon target, bool mundane = false)
        {
            target.Ammunition = !string.IsNullOrEmpty(Ammunition) ? Ammunition : target.Ammunition;

            if (CriticalDamages.Any())
            {
                target.CriticalDamages = CriticalDamages.Select(d => d.Clone()).ToList();
            }

            if (Damages.Any())
            {
                target.Damages = Damages.Select(d => d.Clone()).ToList();
            }

            if (SecondaryCriticalDamages.Any())
            {
                target.SecondaryCriticalDamages = SecondaryCriticalDamages.Select(d => d.Clone()).ToList();
            }

            if (SecondaryDamages.Any())
            {
                target.SecondaryDamages = SecondaryDamages.Select(d => d.Clone()).ToList();
            }

            target.Size                        = !string.IsNullOrEmpty(Size) ? Size : target.Size;
            target.ThreatRange                 = ThreatRange > 0 ? ThreatRange : target.ThreatRange;
            target.CriticalMultiplier          = !string.IsNullOrEmpty(CriticalMultiplier) ? CriticalMultiplier : target.CriticalMultiplier;
            target.Quantity                    = Quantity > 1 ? Quantity : target.Quantity;
            target.SecondaryCriticalMultiplier = !string.IsNullOrEmpty(SecondaryCriticalMultiplier) ? SecondaryCriticalMultiplier : target.SecondaryCriticalMultiplier;

            if (!mundane)
            {
                target.SecondaryHasAbilities = SecondaryHasAbilities ? SecondaryHasAbilities : target.SecondaryHasAbilities;
                target.SecondaryMagicBonus   = SecondaryMagicBonus > 0 ? SecondaryMagicBonus : target.SecondaryMagicBonus;
            }

            return(target);
        }