-- ************************************ ChangeStation ************************************ --
CosmeticChairStation = deriveLuaClass("CosmeticChairStation", "WorkStation")

function CosmeticChairStation:onPlaceCharacter(character)
	CosmeticChairStation.super.onPlaceCharacter(self, character)
	self.step = character.curStepValue

	if (self.step == "NITROGEN" and level:getObject("laser_table").stock == 0) then
		level:getObject("laser_table"):createOverhead("ICON_NO_STOCK:icons")
	end
end

function CosmeticChairStation:onLeaveCharacter(character)
	CosmeticChairStation.super.onLeaveCharacter(self, character)
	self:playAnimation(self.defaultAnimation)
end

function CosmeticChairStation:onWorkStart(task)
--print(self.step)
	if (self.step == "NITROGEN") then
		local stockStation = level:getObject("laser_table")
		if (stockStation.stock <= 0) then
			return false
		end
	end

	if (not self.step) then
		return false
	end
	return CosmeticChairStation.super.onWorkStart(self, task)
end

function CosmeticChairStation:onTreatmentStart(task)
	if (self.step == "NITROGEN") then
		local stockStation = level:getObject("laser_table")
		if (stockStation.stock > 0) then
			stockStation:decStock()
			stockStation:decDisplayStock()
		end
	end
end
