public void Perform(Member source, Target target, int amountPaid) { Message.Subscribe <SequenceFinished>(_ => { Message.Unsubscribe(this); Message.Publish(new CardResolutionFinished()); }, this); SequenceMessage.Queue(cardActions.Play(source, target, amountPaid)); }
public IPayloadProvider Resolve(BattleStateSnapshot beforeCard, Member source, Target target, Group @group, Scope scope, int amountPaid) { var applicapleMembers = target.Members.Where(x => x.State[TemporalStatType.HP] < x.State.MaxHp() * _percentage).ToArray(); if (applicapleMembers.Any()) { return(_effect.Play(source, new Multiple(applicapleMembers), group, scope, amountPaid)); } return(new NoPayload()); }
public IPayloadProvider Resolve(BattleStateSnapshot beforeCard, Member source, Target target, Group @group, Scope scope, int amountPaid) { if (source.State[new InMemoryResourceType { Name = _resource }] >= _amount) { return(_effect.Play(source, target, group, scope, amountPaid)); } return(new NoPayload()); }