コード例 #1
0
 public void PrintAttributes()
 {
     stamina_txt.text   = playerMan.Stamina.ToString();
     strenght_txt.text  = playerMan.Strength.ToString();
     agillity_txt.text  = playerMan.Agility.ToString();
     intellect_txt.text = playerMan.Intellect.ToString();
     spirit_txt.text    = playerMan.Spirit.ToString();
     armor_txt.text     = playerCalc.CalculateArmor(playerMan.Agility).ToString();
 }
コード例 #2
0
ファイル: EnemyStats.cs プロジェクト: Totoual/Portfolio
    /// <summary>
    /// To attack tou exthrou kathe 1.5 deutera
    /// </summary>
    IEnumerator Attack(GameObject player)
    {
        runnedOnce = false;                                                                             // Auto kaleite apo to enemyBehavior wste na energopoioume to collision;
        if (Vector3.Distance(this.transform.position, player.transform.position) <= 4f && isNotDead && !immobilised)
        {
            Debug.Log(Mathf.RoundToInt(playerCalc.CalculateArmor(plManager.Agility) * 20 / 100));
            playerCalc.currentHealth -= (attackDmg - Mathf.RoundToInt(playerCalc.CalculateArmor(plManager.Agility) * 5 / 100)); //Orizoume to dmg pou dexetai o paixtis kathe fora pou epitythete to enemy
            playerCalc.rage          += 2;
            playerCalc.CalculateDeath();                                                                                        // Elegxoume an exei pethanei o paixtis.
            this.GetComponent <Animation> ().Play(animation: "attack");
            //Debug.Log ("attacking Player");
            yield return(new WaitForSeconds(0.3f));

            GetComponent <ButtonMusicPlayer> ().PlayEnemyAttackClip();
        }
        yield return(new WaitForSeconds(1.2f));

        StartCoroutine(Attack(player));                          // Ksanakaloume tin coroutine
    }