示例#1
0
    // Führt einen Angriff des Gegners aus
    private void performEnemyAttack()
    {
        float evaded = Random.Range(0.0f, 1.0f);

        savedEvade = enemyBase.getEvasion() > evaded;

        savedDamage = Mathf.RoundToInt((enemyBase.getBasicAttackDamage() - player.getDefense()) * Random.Range(0.8f, 1.2f));

        enemyCombat.performAttackAnimation(1);
    }
示例#2
0
    // Führt einen Angriff des Spielers aus
    private void performPlayerAttack(int attackSkillIndex)
    {
        if (canAttack && player.getCooldownFromAttack(attackSkillIndex) == 0)
        {
            float evaded = Random.Range(0.0f, 1.0f);
            savedEvade = enemyBase.getEvasion() > evaded;

            savedDamage = Mathf.RoundToInt((player.getDamageFromAttack(attackSkillIndex) - enemyBase.getDefence()) * Random.Range(0.8f, 1.2f));

            playerCombat.performAttackAnimation(attackSkillIndex);
            canAttack = false;

            player.setCooldownFromAttack(attackSkillIndex);
            updateAttackNames();
        }
    }