/// <summary> /// Defend from enemies /// </summary> /// <param name="direction"></param> public void Defend(Point direction = null) { double criticalHp = PlayerInfo.MaxHealth * 0.3; if (PlayerInfo.Health <= criticalHp) { if (PlayerInfo.CarriedItems.Count(x => x == PurchasableItem.HealthPotion) > 0) { AIHelper.CreateHealAction(); } } else { Attack(direction); } }