Esempio n. 1
0
        protected override bool RingPlay()
        {
            UICard.ToGraveyard(1, () => {
                SetCurrentEffect(new CommonEffect(CommonEffectType.Grab));

                GrabPerform();

                StartCoroutine(ClickedEffect());
            }, false);

            return(true);
        }
Esempio n. 2
0
        protected override void OnPlayTriggered()
        {
            if (activeCard.Caller == Receiver && activeCard.IsAlignmentCard(false))
            {
                activeCard.ApplyingEffects = true;

                UICard.ToGraveyard(1, () => {
                    activeCard.SetCurrentEffect(new CommonEffect(CommonEffectType.DiscardRandom));

                    activeCard.DiscardRandom();
                }, false);
            }
        }
Esempio n. 3
0
        protected override bool RingPlay()
        {
            GetComponent <SC_CardGrabber> ().maxMatchHeat = Counters;

            UICard.ToGraveyard(1, () => {
                SetCurrentEffect(new CommonEffect(CommonEffectType.Grab));

                GrabPerform();

                StartCoroutine(ClickedEffect());
            }, false);

            return(true);
        }
Esempio n. 4
0
        IEnumerator DrawSignatureMove()
        {
            while (ApplyingEffects && Caller.IntChoices["SignatureMoveDraw"] == -1)
            {
                yield return(new WaitForEndOfFrame());
            }

            UICard.OverrideActiveHover = false;

            if (ApplyingEffects)
            {
                Caller.SkipDraw = true;

                RectTransform rT = Caller.IsLocalPlayer ? GM.localHand : GM.otherHand;

                SC_UI_Card c = transform.GetChild(transform.childCount - 1).GetComponent <SC_UI_Card> ();

                c.RecT.anchorMin = c.RecT.anchorMax = c.RecT.pivot = c.BigRec.anchorMin = c.BigRec.anchorMax = c.BigRec.pivot = new Vector2(.5f, Caller.IsLocalPlayer ? 0 : 1);

                c.BigRec.anchoredPosition = Vector2.up * GM.yOffset;

                c.transform.SetParent(rT);

                SC_Deck.OrganizeHand(rT);

                Vector3 target = c.transform.localPosition;

                c.transform.position = transform.position;

                yield return(c.transform.DOLocalMove(target, GM.drawSpeed, true).WaitForCompletion());

                Caller.Hand.Add(c.Card);

                additionalCardsToModify.Remove(c.Card);

                c.CantPlay = false;

                if (GetComponentsInChildren <SC_BaseCard> ().Length == 1)
                {
                    OnCardHoveredEvent -= cardHovered;

                    UICard.ToGraveyard(1, AppliedEffects, false);
                }
                else
                {
                    ApplyingEffects = false;
                }
            }
        }
Esempio n. 5
0
        protected override void OnNewTurnTriggered()
        {
            if (Caller.Turn)
            {
                Counters++;

                if (Counters >= 10)
                {
                    activeCard = this;

                    ApplyingEffects = true;

                    UICard.ToGraveyard(1, () => {
                        SetCurrentEffect(new CommonEffect(CommonEffectType.Grab, true));

                        GrabPerform();
                    }, false);
                }
            }
        }
Esempio n. 6
0
        protected override void OnFinishedPlayingTriggered()
        {
            if (activeCard as SC_AttackCard)
            {
                Counters--;

                if (Counters <= 0)
                {
                    UICard.ToGraveyard(1, () => { activeCard.BaseFinishedUsing(); }, false);
                }
                else
                {
                    activeCard.BaseFinishedUsing();
                }
            }
            else
            {
                activeCard.BaseFinishedUsing();
            }
        }
Esempio n. 7
0
        public void Discard(SC_Player owner, Action a = null)
        {
            Caller = owner;

            Caller.Hand.Remove(this);

            SC_Deck.OrganizeHand(Caller.IsLocalPlayer ? GM.localHand : GM.otherHand);

            if (discardNbr != -1)
            {
                a = () => {
                    if (CurrentEffect.effectType == CommonEffectType.DiscardChosen)
                    {
                        activeCard.DiscardChosen();
                    }
                    else
                    {
                        activeCard.DiscardRandom();
                    }
                };
            }

            UICard.ToGraveyard(GM.drawSpeed, a ?? AppliedEffects);
        }
Esempio n. 8
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();
            }
        }