public override int Resolve() { AbstractArgument instance = owner.GetArgument(argumentToDestroy); if (instance != null) { if (destroyedByThisCard != null) { EventSystemManager.Instance.TriggerEvent(new EventArgDestroyed(argumentToDestroy, destroyedByThisCard)); } else if (destroyedByThisArgument != null) { EventSystemManager.Instance.TriggerEvent(new EventArgDestroyed(argumentToDestroy, destroyedByThisArgument)); } else { EventSystemManager.Instance.TriggerEvent(new EventArgDestroyed(argumentToDestroy)); // trigger on-destroy effects (if any on the argument itself or on the destroying card/arg) } this.argumentToDestroy.TriggerOnDestroy(); // Remove event subscriptions and handle victory/defeat if a core argument was destroyed owner.GetSupportArguments().Remove(this.argumentToDestroy); // remove argument from the list of arguments (previous line will return if it's a core argument so no worries) // Remove all actions that were in the action queue and associated w/ the destroyed argument NegotiationManager.Instance.actionQueue.RemoveAll(action => action.origin == instance); } return(0); }
public override void Play(AbstractCharacter source, AbstractArgument target) { base.Play(source, target); if (source.GetArgument(new ArgumentFinesse()) != null) { NegotiationManager.Instance.AddAction(new DamageAction(target.OWNER.GetCoreArgument(), target.OWNER, MIN_DAMAGE, MAX_DAMAGE, this)); List <AbstractArgument> nonCoreArgs = target.OWNER.GetTargetableArguments(); foreach (AbstractArgument arg in nonCoreArgs) { NegotiationManager.Instance.AddAction(new DamageAction(arg, arg.OWNER, MIN_DAMAGE, MAX_DAMAGE, this)); } } else { NegotiationManager.Instance.AddAction(new DamageAction(target, target.OWNER, MIN_DAMAGE, MAX_DAMAGE, this)); } }