Ejemplo n.º 1
0
    public void InflictDamage(CombatUnit source, int attackPower)
    {
        Debug.Log("InflictDamage called");
        int damage = (source.GetAttack() * attackPower) - GetDefence();

        hp -= damage;
        if (hp < 0)
        {
            hp = 0;
        }
        Debug.Log("Starting hp bar");
        hpBar.DealDamage(hp);
    }