# daystart
!! Calculate the number of the current day since the start of the game.

!!sets daystart_start to current day and must be called only after start date is set
if daystart_start = 0:
	if month > 1:daystart_start += 31
	if month > 2:
		if ((year mod 4 = 0) and (year mod 100 ! 0)) or (year mod 400 = 0):
			daystart_start += 29
		else
			daystart_start += 28
		end
	end
	if month > 3:daystart_start += 31
	if month > 4:daystart_start += 30
	if month > 5:daystart_start += 31
	if month > 6:daystart_start += 30
	if month > 7:daystart_start += 31
	if month > 8:daystart_start += 31
	if month > 9:daystart_start += 30
	if month > 10:daystart_start += 31
	if month > 11:daystart_start += 30
	if month > 12:daystart_start += 31
	daystart_start += day
end

daystart = (year - 2016) * 365
!! Leap year correction
daystart += (year - 2013) / 4

i=1
:daystart
if month > i:
	daystart += monthsend[i]
	i += 1
	jump 'daystart'
end

daystart += day
daystart -= daystart_start
daystart += 1

--- daystart ---------------------------------

