Example #1
0
    public bool PlayerPlay(ActionCard card)
    {
        if (thingPanel.activeSelf)
        {
            return(false);
        }
        Data_ActionCard cardData = card.GetData();

        if (curState == GameState.PLAYER_TURN && player.mp.GetValue() >= cardData.manaCost)
        {
            AudioManager.instance.PlaySound("Use Card");
            card.interactable = false;
            MoveCardCenter(card.gameObject, 2, 0.8f, true);
            MoveCard(card.gameObject, "Graveyard", 2, 0.5f);
            player.mp.UpdateValue(-cardData.manaCost);
            player.hand.RemoveCard(card);
            Debug.Log("You use '" + card.GetData().cardName + "', \nand he now has " + player.hand.GetCardCount() + " cards.");
            return(true);
        }
        return(false);
    }
Example #2
0
    public bool EnemyPlay(ActionCard card)
    {
        Data_ActionCard cardData = card.GetData();

        if (curState == GameState.ENEMY_TURN && enemy.mp.GetValue() >= cardData.manaCost)
        {
            AudioManager.instance.PlaySound("Use Card");
            MoveCardCenter(card.gameObject, 2, 0.8f, true);
            MoveCard(card.gameObject, "Graveyard", 2, 0.5f);
            enemy.mp.UpdateValue(-cardData.manaCost);
            enemy.hand.RemoveCard(card);
            return(true);
        }
        return(false);
    }