public void ResetActiveAttack() { if (Abilities.Active != null && (Abilities.Active == ActiveAttack || Abilities.Active.Name == ActiveAttack.Name)) { (Abilities.Active as AnimatedAttack).IsActive = false; Abilities.Active = null; } ActiveAttack = null; }
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); } }
public CancelAttackEvent(AnimatedAttack attackToExecute, List <AnimatedCharacter> attackers, AttackInstructions instructions) { this.AttackToExecute = attackToExecute; this.Attackers = attackers; this.AttackInstructions = instructions; }
public FinishAttackEvent(AnimatedAttack finishedAttack) { this.FinishedAttack = finishedAttack; }
public ConfigureAttackEvent(AnimatedAttack attackToConfigure, List <AnimatedCharacter> attackers, AttackInstructions instructions) { this.AttackToConfigure = attackToConfigure; this.Attackers = attackers; this.AttackInstructions = instructions; }