
local timeTot = 0
local timePerUpdate = 0.1

function Create()
end

--function CalculateTicketsRequired()
--	local MaxCapacity = World.NumPrisoners
--	local TicketsRequired = (MaxCapacity.Normal + MaxCapacity.Protected + MaxCapacity.MinSec + MaxCapacity.MaxSec + MaxCapacity.DeathRow + MaxCapacity.SuperMax) * 2
--	return TicketsRequired
--end

function Update(timePassed)
	timeTot = timeTot + timePassed
	if timeTot > timePerUpdate then
		if newSafe == nil then
			newSafe = Object.Spawn("VendingLotterySafe",this.Pos.x,this.Pos.y)
		--	Object.SetProperty(newSafe,"WeeklyLottery",true)
		--	newSafe.SubType = 2
			Object.SetProperty(newSafe,"Walls.y",this.Walls.y)
		--	Object.SetProperty(newSafe,"LotteryDaysInterval",28)
		--	Object.SetProperty(newSafe,"NextLotteryDay",28)
		--	Object.SetProperty(newSafe,"CapacityMultiplier",2)
		--	Object.SetProperty(newSafe,"TicketsSoldRequired",CalculateTicketsRequired())
		else
			this.Delete()
		end
	end
end
