Exemplo n.º 1
0
 public void takeDamage(float dmg, e_attackType type)
 {
     this.HP -= dmg * (1.0f - Convert.ToSingle(Math.Log(armor)) * 0.2f); //TODO ARMOR LOGIC
     if (this.HP <= 0)
     {
         Instantiate(deadPrefab, transform.position, Quaternion.identity);
         Destroy(gameObject);
     }
 }
Exemplo n.º 2
0
    public void takeDamage(float dmg, e_attackType type)
    {
        this.HP -= dmg;
        if (hpbar_slider != null)
        {
            hpbar_slider.value = HP / maxHP;
        }

        if (hpbar_values != null)
        {
            hpbar_values.text = HP + "/" + maxHP;
        }

        if (HP <= 0)
        {
            Die();
        }
    }
Exemplo n.º 3
0
 public void Attack(IDamageable target, e_attackType type)
 {
     target.takeDamage(damage, type);
     attack_timer = 0;
 }