public AnimatedAbility Clone(AnimatedCharacter target)
        {
            var clonedSequence = ((AnimationSequencerImpl)Sequencer).Clone(target) as AnimationSequencer;

            AnimatedAbility clone = new AnimatedAbilityImpl(clonedSequence);

            clone.Target           = target;
            clone.Name             = Name;
            clone.KeyboardShortcut = KeyboardShortcut;
            clone.Persistent       = Persistent;
            clone.StopAbility      = StopAbility?.Clone(target);
            return(clone);
        }
 public void CopyAbilitiesTo(AnimatedCharacter targetCharacter)
 {
     foreach (AnimatedAbility ability in this.Abilities)
     {
         string            abilityName   = targetCharacter.GetNewValidAbilityName(ability.Name);
         AnimatedAbility   copiedAbility = new AnimatedAbilityImpl();
         ReferenceElement  refElement    = new ReferenceElementImpl();
         ReferenceResource refResource   = new ReferenceResourceImpl();
         refResource.Ability   = ability;
         refResource.Character = this;
         refElement.Reference  = refResource;
         refElement.Name       = ability.Name;
         copiedAbility.InsertElement(refElement);
         copiedAbility.Name = abilityName;
         if (ability is AnimatedAttack)
         {
             AnimatedAttack    attack             = ability as AnimatedAttack;
             AnimatedAttack    copiedAttack       = ability.TransformToAttack();
             AnimatedAbility   copiedOnHitAbility = new AnimatedAbilityImpl();
             ReferenceElement  refElementOnHit    = new ReferenceElementImpl();
             ReferenceResource refResourceOnHit   = new ReferenceResourceImpl();
             refResource.Ability       = attack.OnHitAnimation;
             refResource.Character     = this;
             refElementOnHit.Reference = refResourceOnHit;
             refElementOnHit.Name      = attack.OnHitAnimation.Name;
             copiedOnHitAbility.InsertElement(refElementOnHit);
             copiedAttack.OnHitAnimation = copiedOnHitAbility;
             if (ability is AreaEffectAttack)
             {
                 copiedAttack = copiedAttack.TransformToAreaEffectAttack();
             }
             copiedAbility = copiedAttack;
         }
         targetCharacter.Abilities.InsertAction(copiedAbility);
     }
 }