# bed2

if $args[0] = 'options':
	cla
	act 'Set Alarm Clock':gt 'budilnik', 'start'
	if bedPanty = 0:
		act 'You will wear panties in the morning, click to turn off':bedpanty = 1 & gt 'bed2', 'options'
	else
		act 'You will not wear panties in the morning, click to turn on':bedpanty = 0 & gt 'bed2', 'options'
	end
	if analplug = 1:
		if bedanal = 0:
			act 'If worn, you will remove your analplug at night, click to always leave it in':bedanal = 1 & gt 'bed2', 'options'
		else
			act 'If worn, you will wear your analplug through the night, click to always remove it':bedanal = 0 & gt 'bed2', 'options'
		end
	end

	if vibrator = 1 and cheatVib = 1:
		if bedvibrator = 0:
			act 'If worn, you will remove your vibrator at night, click to always leave it in':bedvibrator = 1 & gt 'bed2', 'options'
		else
			act 'If worn, you will wear your vibrator through the night, click to always remove it':bedvibrator = 0 & gt 'bed2', 'options'
		end
	end

	act 'Return':gt 'bed2'
end

if $args[0] = '':
	gs 'stat'
	cla

	if $clothingworntype ! 'nude':
		'<center><img src="images/pics/bed.jpg"></center>'
	else
		'<center><img src="images/pics/son.jpg"></center>'
	end

	if budilnikOn = 0:
		'You lie on the bed. Alarm set for <<timer>> hours <<timerM>> minutes and currently turned <a href="exec: budilnikOn = 1 & GT ''bed2''">off</a>.'
	else
		'You lie on the bed. Alarm set for <<timer>> hours <<timerM>> minutes and currently turned <a href="exec: budilnikOn = 0 & GT ''bed2''">on</a>.'
	end

	if mop ! 1:'<b><font color="red">You need to wash off your makeup before going to bed.</font></b>'

	if son > 80:
		'You are not tired.'
	else
		act 'Undress and go to sleep':

			if disable_autosave = 0:
				if StoryLine = 0:
					savegame 'autosave.sav'
				else
					savegame 'autosave_alt.sav'
				end
			end

			gs 'clothing', 'strip'

			gt 'bed2', 'sleep'
		end
	end
	act 'Options':gt 'bed2', 'options'

	act 'Get out of bed':gt $locM, $metkaM
end

if $args[0] = 'sleep':
	cls
	'<center><img src="images/pics/son.jpg"></center>'

	hapri = 0
	InSleep = 1
	cloth_vid = 0

	if analplugIN = 1 and bedanal = 0:analplugIN = 0 & 'Before going to bed you remove your butt plug.'
	if vibratorIN = 1 and bedvibrator = 0:vibratorIN = 0 & 'Before going to bed you remove your vibrator'
	if mop > 1:mop = 0 & vidageday = vidageday - 1 & 'Makeup smears your face, you think that it looks bad sleeping in makeup, and your skin will age faster from this.'
	if fat > 5 and stringimplant = 1:silicone += 1 & fat -= 5

	wait 450
	*clr
	gs 'dreams', 'start'

	:loopson
	minut += 1
	stime += 1
	health += 5

	if vibratorIn = 1:
		vtime += 1
		if vtime >= 5:
			horny +=1
			vtime = 0
		end

		if horny = 100:
			*clr
			cla
			horny = 0
			orgasm += 1
			minut += 5
			'<center><img src="images/pic/o_face.jpg"></center>'
			'You abruptly wake up in the throes of an orgasm.'

			act 'Go back to sleep':
				*clr
				cla
				gt 'bed2', 'sleep'
			end

			act 'Give up trying to sleep':
				$waketext = 'Maybe trying to sleep with a vibrator in your pussy wasn''t such a good idea.'
				gt 'bed2', 'wake'
			end
		end
	end

	if stime = 60:
		stime = 0
		son += 15
		gs 'stat'
	end
	
	alarm_now = hour * 60 + minut
	alarm_time = timer * 60 + timerM
	alarm_set = alarm_time - rand(1,5)

	if budilnikOn = 1 and alarm_now = alarm_time:
		manna -= 10
		$waketext = 'Your alarm goes off.'
		gs 'bed2', 'wake'
	elseif son >= 100 and budilnikOn = 1 and alarm_now >= alarm_set:
		$waketext = 'You wake up just before your alarm goes off.'
		gs 'bed2', 'wake'
	elseif son > 100 and budilnikOn = 0:
		$waketext = 'You wake up, no longer tired.'
		gs 'bed2', 'wake'
	else
		jump 'loopson'
	end
end

if $args[0] = 'wake':
	'<<$waketext>>'
	gs 'stat'
	
	if daystart < 10 and StoryLine = 0:'The first thing you think as you wake up is, "Damn! It''s is not a dream, I really am a woman now."'
	if daystart >= 10 and daystart < 30 and StoryLine = 0:'Looking at your female body, you are still a little surprised it''s actually you.'

	if kanikuli = 0 and StoryLine = 1 and SchoolAtestat = 0 and SchoolBlock = 0 and week < 6 and hour >= 4 and hour < 9:
		act 'Get up out of bed and get dressed for school (0:15)':
			if schtype = 0:schtype = 6
			if schoolH[schtype] = 0:schtype = 6
			gs 'clothing', 'wear', 'school', schtype
			minut += 15
			gs 'bed2', 'end'
		end
	end

	act 'Get out of bed and get dressed (0:15)':
		gs 'clothing', 'wear_last_worn'
		minut += 15
		gs 'bed2', 'end'
	end

	act 'Get out of bed (0:10)':
		minut += 10
		gs 'bed2', 'end'
	end
end

if $args[0] = 'end':
	InSleep = 0
	if bedpanty = 0 and clrbelo > 0:
		tanga = 1
	else
		tanga =0
	end
	gt $locM, $metkaM
end

--- bed2 ---------------------------------

