Exemple #1
0
        IEnumerator Use(bool resumed = false)
        {
            if (!resumed)
            {
                if (originalCard == this || !Ephemeral || interceptFinishCard)
                {
                    UI.AddCardToHistory(UICard.image, Caller.IsLocalPlayer);
                }

                OnPlay?.Invoke();

                while (ApplyingEffects)
                {
                    yield return(new WaitForEndOfFrame());
                }

                (this as SC_AttackCard)?.PayCost();

                yield return(new WaitForSeconds(GM.playedDelay));

                if (!unblockable && Receiver.Unlocked && (!Is(CardType.Basic) || Has(CommonEffectType.Lock)))
                {
                    if (Receiver.IsLocalPlayer)
                    {
                        responding = true;

                        if (Receiver.HasOnePlayableCardInHand(false))
                        {
                            UI.ShowMessage("ResponseCan");

                            UpdateHighlightedCards(true);
                        }
                        else
                        {
                            UI.ShowMessage("ResponseCant");
                        }
                    }
                    else if (Receiver.AI && Receiver.HasOnePlayableCardInHand(false))
                    {
                        Receiver.BecomeActive(false);
                    }

                    yield return(new WaitForSeconds(GM.responseTime));

                    if (Receiver.IsLocalPlayer)
                    {
                        UpdateHighlightedCards(false);
                    }

                    responding = false;

                    UI.messagePanel.SetActive(false);
                }
            }

            yield return(StartCoroutine(ApplyEffects()));

            if (GM.Count == 3)
            {
                UI.ShowEndPanel(!Caller.IsLocalPlayer);
            }
            else if (this != lockingCard)
            {
                UICard.RecT.DOSizeDelta(UICard.RecT.sizeDelta / GM.playedSizeMultiplicator, 1);

                if (stayOnRing)
                {
                    UICard.ToRingSlot();
                }
                else
                {
                    UICard.ToGraveyard(1, () => { FinishedUsing(); }, false);
                }
            }
            else
            {
                activeCard = originalCard = null;

                NextTurn();
            }
        }