Пример #1
0
    IEnumerator EnemyAttack(float damage)
    {
        yield return(new WaitForSeconds(2f));

        playerUnit.TakeDamage(damage);
        Debug.Log("Back to player");

        state = BattleState.PLAYERTURN;
        PlayerTurn();
    }
Пример #2
0
    IEnumerator EnemyTwoTurn()
    {
        if (moldUnitTwo.AttemptAttack(playerUnit.GetSpeed(), playerUnit.GetIntimidation(), playerUnit.GetDefense(false)))
        {
            StartCoroutine(PrintText("MOLD 2 uses SPORES"));
            playerUnit.TakeDamage(moldUnitTwo.ReturnDamage());
        }

        else
        {
            StartCoroutine(PrintText("MOLD 2 misses its attack"));
        }

        yield return(new WaitForSeconds(2f));

        if (playerUnit.currHealth <= 0.0f)
        {
            SceneManager.LoadScene("Game Over");
        }

        state = BattleState.BOSSTURN;
        BossTurn();
    }
Пример #3
0
    IEnumerator EnemyTwoTurn()
    {
        if (moldUnitTwo.AttemptAttack(playerUnit.GetSpeed(), playerUnit.GetIntimidation(), playerUnit.GetDefense(false)))
        {
            StartCoroutine(PrintText("MOLD 2 uses SPORES"));
            playerUnit.TakeDamage(moldUnitTwo.ReturnDamage());
        }

        else
        {
            StartCoroutine(PrintText("MOLD 2 misses its attack"));
        }

        yield return(new WaitForSeconds(2f));

        if (playerUnit.currHealth <= 0.0f)
        {
            //YOU LOSE SIR, GOOD DAY
        }

        state = BattleState.PLAYERTURN;
        PlayerTurn();
    }
Пример #4
0
 private void Attack()
 {
     playerBattle.TakeDamage(5);
     currentATB -= 1;
 }