/*void GiveNewCards()
     * {
     *
     *
     * }*/

    public void CardsFight(CardControllerScript attacker, CardControllerScript defender)
    {
        attacker.OnDamageDeal();

        defender.OnTakeDamage();
        attacker.OnTakeDamage();
        defender.thisCard.GetDamage(attacker.thisCard.attack);
        attacker.thisCard.GetDamage(defender.thisCard.attack);

        defender.CheckForAlive();
        attacker.CheckForAlive();
    }
    public void DamageHero(CardControllerScript card, bool isEnemyAttacked)
    {
        if (isEnemyAttacked)
        {
            enemyHP = Mathf.Clamp(enemyHP - card.thisCard.attack, 0, int.MaxValue);
        }
        else
        {
            playerHP = Mathf.Clamp(playerHP - card.thisCard.attack, 0, int.MaxValue);
        }

        ShowHP();
        card.OnDamageDeal();
        CheckForResult();
    }
Exemple #3
0
    public void DamageHero(CardControllerScript card, bool isEnemyAttacked)
    {
        if (isEnemyAttacked)
        {
            enemyHP -= card.thisCard.attack;
        }
        else
        {
            playerHP -= card.thisCard.attack;
        }

        ShowHP();

        card.OnDamageDeal();
        CheckForResult();
    }