--[[
	Increments the health by the specified amount, will also update markers and other visual showcases of the health amount.
]]

function BaseSystem:incrementHealth(amount)
	self._health = math.clamp(self._health + amount, 0, self._maxHealth)

	local percent = self._health / self._maxHealth

	if not self.noScreenUpdate then
		local aliveColor = Color3.fromRGB(110, 153, 202)
		local deadColor = Color3.fromRGB(200, 93, 96)

		local targetColor = deadColor:Lerp(aliveColor, percent)
		for _, child in pairs(self._model:FindFirstChild("Screen"):GetChildren()) do
			TweenService:Create(child, tweenInfo, {Color = targetColor}):Play()
		end
	end

	if self:canTurnOn() then
		self:turnOn()
	elseif self._health == 0 and self:isOn() then
		self:turnOff()
	end

	if amount < 0 and percent < 0.25 then
		sendAlert(Constants.Alert.Fail, self.repairAlert)
	elseif self._health == 0 then
		sendAlert(Constants.Alert.Fail, self.brokenAlert)
	end

	if self:isOn() then
		if percent < 0.2 then
			self:_setMarker(self.brokenMarker)
		elseif percent < 0.5 then
			self:_setMarker(self.repairMarker)
		else
			self:_setMarker()
		end
	end
end
