Exemplo n.º 1
0
    public void RunAction(Card card)
    {
        if (currentCard == null)
        {
            return;
        }

        if (currentCard.desc.IsValidTarget(this, card))
        {
            // This is a valid target
            currentCard.desc.CastSpell(this, currentCard, card);

            // Destroy this card
            hand.Remove(currentCard);
            graveyard.Add(currentCard.desc);
            Destroy(currentCard.gameObject);

            // Clear the playfield
            playArea.ClearCreatures();
            GameMng.GetOtherPlayer(this).playArea.ClearCreatures();

            // Disable target mode
            targetType = CardDesc.TargetType.None;
        }
    }
Exemplo n.º 2
0
    public void SetCard(Card card)
    {
        // Check if we already have a card, if so, return this one to the hand
        if (currentCard)
        {
            hand.Add(currentCard);
        }

        // Change the parent, this is now a floating card
        card.transform.SetParent(overlayContainer);
        card.transform.localScale = new Vector3(2.5f, 2.5f, 2.0f);

        // Card movement
        currentCard = card;

        // If this card is targeted spell, we need to enable "casting" on a target
        targetType = CardDesc.TargetType.None;
        if (card.desc.NeedsTarget())
        {
            targetType = card.desc.targetType;
        }
    }