Exemple #1
0
    //Called when the Execute button is hit, calculates damage/defense values against existing player/opponent health
    //Updates player health, enemy health
    //Deck: resets to allow to deal again
    public void ExecuteTurn()
    {
        DamageTaken = EnemyDamage - queueLogic.CurrentDefenseVal;
        if (DamageTaken < 0)
        {
            DamageTaken = 0;
        }

        PlayerDamage  = queueLogic.CurrentAttackVal;
        PlayerHealth -= DamageTaken;
        EnemyHealth  -= PlayerDamage;

        messagerLogic.DisplayTurn(PlayerDamage, DamageTaken);

        if (PlayerHealth <= 0)
        {
            PlayerHealth = 0;
            GameOver();
        }

        else if (EnemyHealth <= 0)
        {
            EnemyHealth = 0;
            GameWin();
        }

        deckLogic.isDealt = false;
        queueLogic.DisableQueue();
    }