Exemplo n.º 1
0
    void ChargeUntargeted()
    {
        if (status == CardStatus.InHand)
        {
            Debug.LogError("Cannot charge a card in hand!", this);
            return;
        }

        SetIsCharged(true);

        PlayerFunds funds = (template.authorPlayer == gm.localPlayerNum) ? gm.myFunds : gm.enemyFunds;

        funds.deductFromFunds(template.chargeCost);
    }
Exemplo n.º 2
0
    /// Called by PlayCardAction
    public void AddToCardSlot(CardSlot cardSlot)
    {
        // parent to the card slot and move to it
        this.transform.SetParent(cardSlot.transform);
        this.transform.DOLocalMove(Vector2.zero, 0.1f);

        cardSlot.AddCard(this);
        hand.RemoveFromHand(this);
        status = CardStatus.OnBoard;

        PlayerFunds funds = (template.authorPlayer == gm.localPlayerNum) ? gm.myFunds : gm.enemyFunds;

        funds.deductFromFunds(template.playCost);

        UpdateTargetingGroupForChargeability();
        mouseDraggable.isDraggable = false;         // disable dragging

        sortingLayerManager.SetSortingLayer("CardInCardSlot");
    }