public void Attack(Slim slim) { Random a = new Random(); attack_add = a.Next(5); damage = this.Power + attack_add - slim.Deffence_power; slim.Hp = slim.Hp - damage; }
public void Attack(Slim slim) { Random a = new Random(); attack_add = a.Next(5); damage = this.Power + attack_add - slim.Deffence_power; if (damage > 0) { slim.Hp -= damage; } else { damage = 0; } }