private void PlayAnimatedAbility(AnimatedAbility ability) { Action d = delegate() { if (!ability.IsAttack) { IntPtr winHandle = WindowsUtilities.FindWindow("CrypticWindow", null); WindowsUtilities.SetForegroundWindow(winHandle); } Character currentTarget = null; if (!ability.PlayOnTargeted) { this.SpawnAndTargetOwnerCharacter(); currentTarget = this.Owner; } else { Roster.RosterExplorerViewModel rostExpVM = this.Container.Resolve <Roster.RosterExplorerViewModel>(); currentTarget = rostExpVM.GetCurrentTarget() as Character; if (currentTarget == null) { this.SpawnAndTargetOwnerCharacter(); currentTarget = this.Owner; } } owner.ActiveAbility = ability; currentTarget.Target(); //ability.Play(Target: currentTarget); this.eventAggregator.GetEvent <PlayAnimatedAbilityEvent>().Publish(new Tuple <Character, AnimatedAbility>(currentTarget, ability)); }; AsyncDelegateExecuter adex = new Library.Utility.AsyncDelegateExecuter(d, 5); adex.ExecuteAsyncDelegate(); }
private void DeActivateAnimatedAbility(AnimatedAbility ability) { Character currentTarget = null; if (!ability.PlayOnTargeted) { this.SpawnAndTargetOwnerCharacter(); } else { Roster.RosterExplorerViewModel rostExpVM = this.Container.Resolve <Roster.RosterExplorerViewModel>(); currentTarget = rostExpVM.GetCurrentTarget() as Character; if (currentTarget == null) { this.SpawnAndTargetOwnerCharacter(); currentTarget = this.Owner; } } owner.ActiveAbility = null; ability.DeActivate(Target: currentTarget); }
private void StopAnimatedAbility(AnimatedAbility ability) { Character currentTarget = null; if (!ability.PlayOnTargeted) { this.SpawnAndTargetOwnerCharacter(); currentTarget = this.Owner; } else { Roster.RosterExplorerViewModel rostExpVM = this.Container.Resolve <Roster.RosterExplorerViewModel>(); currentTarget = rostExpVM.GetCurrentTarget() as Character; if (currentTarget == null) { this.SpawnAndTargetOwnerCharacter(); currentTarget = this.Owner; } } this.Owner.ActiveAbility = null; //ability.Stop(Target: currentTarget); this.eventAggregator.GetEvent <StopAnimatedAbilityEvent>().Publish(new Tuple <Character, AnimatedAbility>(currentTarget, ability)); }