internal override void Execute(Action action) { Effects.CancellingEffect effect = new Effects.CancellingEffect(action.Who, typeof(NightkillPower)); if(dieOnSuccess) { effect.ActionCancelled += new EventHandler<ActionEventArgs>(OnActionCancelled); } action.Target.ApplyEffect(effect); }
internal override void Execute(Action action) { Effects.CancellingEffect effect = new Effects.CancellingEffect(action.Who, typeof(Power), Effects.CancelWhichType.Source); effect.ActionCancelled += new EventHandler<ActionEventArgs>(OnBlocked); action.Target.ApplyEffect(effect); //Remove cancellable Effects caused by target foreach(VillageMember member in action.Village.Members) { IEnumerable<Effect> causedEffects = member.Effects.Where(e => e.IsCancellable && e.Source == action.Target); foreach(Effect causedEffect in causedEffects) { member.RemoveEffect(causedEffect); } } }