Example #1
0
        private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1)
        {
            if (card.Id != 0 && type == ExecutorType.Activate)
            {
                if (_activatedCards.ContainsKey(card.Id) && _activatedCards[card.Id] >= 9)
                {
                    return(false);
                }
                if (!Executor.OnPreActivate(card))
                {
                    return(false);
                }
            }
            Executor.SetCard(type, card, desc);
            bool result = card != null && exec.Type == type &&
                          (exec.CardId == -1 || exec.CardId == card.Id) &&
                          (exec.Func == null || exec.Func());

            if (card.Id != 0 && type == ExecutorType.Activate && result)
            {
                int count = card.IsDisabled() ? 3 : 1;
                if (!_activatedCards.ContainsKey(card.Id))
                {
                    _activatedCards.Add(card.Id, count);
                }
                else
                {
                    _activatedCards[card.Id] += count;
                }
            }
            return(result);
        }
Example #2
0
 private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, long desc = -1)
 {
     Executor.SetCard(type, card, desc);
     return(card != null &&
            exec.Type == type &&
            (exec.CardId == -1 || exec.CardId == card.Id) &&
            (exec.Func == null || exec.Func()));
 }
Example #3
0
 private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1)
 {
     Executor.SetCard(type, card, desc);
     if (card != null &&
         exec.Type == type &&
         (exec.CardId == -1 || exec.CardId == card.Id) &&
         (exec.Func == null || exec.Func()))
     {
         return(true);
     }
     return(false);
 }
Example #4
0
 private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1)
 {
     Executor.SetCard(type, card, desc);
     if (card != null &&
         exec.Type == type &&
         (exec.CardId == -1 || exec.CardId == card.Id) &&
         (exec.Func == null || exec.Func()))
         return true;
     return false;
 }