# 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 <<$set_imgh>> src="images/shared/home/bed.jpg"></center>'
	else
		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/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 pcs_makeup ! 1:'<b><font color="red">You need to wash off your makeup before going to bed.</font></b>'

	if pcs_sleep > 80:
		'You are not tired.'
	elseif succubusQW = 2:
		act 'Undress and go to sleep':
			if $clothingworntype ! 'nude': gs 'clothing', 'strip'
			gt 'bed2', 'succhoice'
		end
	else
		act 'Undress and go to sleep':
			if disable_autosave = 0:
				if StoryLine = 0:
					savegame 'autosave.sav'
				else
					savegame 'autosave_alt.sav'
				end
			end
			if $clothingworntype ! 'nude': gs 'clothing', 'strip'
			if magf2bdo = 2:
				gt 'bed2', 'magbstchoice'
			else
				gt 'bed2', 'sleep'
			end
		end
	end

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

!!Braid hair skill
	
	if canBraidHair = 1 and hBraids = 0 and (pcs_hairlng > 80 and pcs_hairlng <= 800):
		act 'Spend some time braiding your hair':
			cls
			hbraids = 15
			minut += 30
			'You spend some time braiding your hair. It may not be salon level quality, but at the end you are happy with the results.'
			act 'Return to bed':gt 'bed2'
		end
	end
	
	if hbraids > 0:
		act 'Spend some time removing your braids':
			cls
			hbraids = 0
			minut += 30
			'You spend some time removing your braids. It may not be salon level quality, but at the end you are happy with the results.'
			act 'Return to bed':gt 'bed2'
		end
	end
	

	act 'Get out of bed':gt $loc, $metka
end

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

	pcs_hairbsh = 0
	InSleep = 1
	cloth_vid = 0
	pain['killer'] = 0
	if StoryLine = 1 and $loc ! 'bedrPar' and SchoolAtestat = 0:
		notathomesleep += 1
	else
		notathomesleep = 0
	end

	if succubusflag = 1 and sucwalkday <= daystart:
		If succublvl <= rand(1,20) or pcs_willpwr < ((succublvl * willpowermax) / 10) or sucpowzeroed >= 3: gs 'succubus', 'sucwalkinginit'
	end

	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 pcs_makeup > 1:pcs_makeup = 0 & 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
	pcs_health += 5

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

		if pcs_horny = 100:
			cls
			pcs_horny = 0
			orgasm += 1
			minut += 5
			gs 'stat'
			'<center><img <<$set_imgh>> src="images/shared/sex/oface/o_face.jpg"></center>'
			'You abruptly wake up in the throes of an orgasm. As you recover, you check the time, <<hour>>:<<minut>>.'

			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

			exit
		end
	end

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


	if budilnikOn = 1 and alarm_now = alarm_time:
		pcs_mood -= 10
		$waketext = 'Your alarm goes off.'
		gs 'bed2', 'wake'
	elseif pcs_sleep >= 100 and budilnikOn = 1 and alarm_now >= alarm_set:
		$waketext = 'You wake up just before your alarm goes off.'
		gs 'bed2', 'wake'
	elseif pcs_sleep > 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 tanga = 1:
		if bedpanty = 1:
			tanga = 0
			dirtbelo += 1
		else
			if clrbelo > 0:
				clrbelo -= 1 & dirtbelo += 1
			else
				tanga = 0 & dirtbelo += 1
			end
		end
	else
		if bedpanty = 0 and clrbelo > 0:tanga = 1 & clrbelo -= 1
	end
	gt $loc, $metka
end

if $ARGS[0] = 'succhoice':
	minut += 15
	gs 'stat'
	cla
	if $clothingworntype ! 'nude':
		'<center><img <<$set_imgh>> src="images/shared/home/bed.jpg"></center>'
	else
		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/son.jpg"></center>'
	end
	''
	'You toss and turn for a while, but the energy that has been buzzing under your skin since that dream just won''t let you sleep.'
	''
	'Thinking about it you realize that you could push the energy out or pull it in!'
	''
	'<font color="red"><b>You also feel that both are <i>permanent</i> choices.</b></font>'
	act 'Try to ignore it and go to sleep':
		if disable_autosave = 0:
			if StoryLine = 0:
				savegame 'autosave.sav'
			else
				savegame 'autosave_alt.sav'
			end
		end
		gt 'bed2', 'sleep'
	end
	act 'Push the Energy out for all time': gt 'bed2', 'succhoiceNO'
	act 'Pull the Energy in and let it change you permanently': gt 'bed2', 'succhoiceYES'
end

if $ARGS[0] = 'succhoiceNO':
	cla
	if $clothingworntype ! 'nude':
		'<center><img <<$set_imgh>> src="images/shared/home/bed.jpg"></center>'
	else
		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/son.jpg"></center>'
	end
	''
	'You push the energy out of you and it dissipates.'
	succubusQW = 3
	pcs_horny = 0
	minut +=5
	gs 'stat'
	act 'Go to sleep':
		if disable_autosave = 0:
			if StoryLine = 0:
				savegame 'autosave.sav'
			else
				savegame 'autosave_alt.sav'
			end
		end
		gt 'bed2', 'sleep'
	end
end

if $ARGS[0] = 'succhoiceYES':
	cla
	if $clothingworntype ! 'nude':
		'<center><img <<$set_imgh>> src="images/shared/home/bed.jpg"></center>'
	else
		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/son.jpg"></center>'
	end
	succubusQW = 4
	''
	'You pull the energy deeper into yourself and hold it there.'
	''
	'Then you feel pressure building...'
	wait 450
	minut += 5
	gs 'stat'
	'BUILDING...'
	wait 450
	minut += 5
	gs 'stat'
	'<b>BUILDING...</b>'
	wait 450
	minut += 5
	gs 'stat'
	'Power bursts through your body causing you to hop out of bed.'
	act 'Continue': gt 'bed2', 'succubinit'
end

if $ARGS[0] = 'succubinit':
	cls
	cla
	minut += 10
	gs 'stat'
	!!Sets the succubus flag, succubus level (succublvl), Initial lesbian sex count (suclezsnapshot), initial Succubus hunger (succhungry),
	!! & the succubus descriptor ($sucself1). The -2 on succhungry is to give th PC 2 days to get in the Succubus grove.
	succubusflag = 1
	succublvl = 1
	suclezsnapshot = lesbian
	succhungry = -2
	sucwalkday = daystart + 2 + rand(0,5)
	$sucself1 = 'that feeling'
	pcs_horny = 100
	'<center><img <<$set_imgh>> src="images/pc/body/succubusself.jpg"></center>'
	''
	'<font color="red">You feel the power flowing around your body for several minutes, leaking through your skin and making changes all throughout you, before fading to a presence deep in your core leaving you looking the same as before... but feeling so different! </font>'
	act 'Finish': gt $loc, $metka
end

if $ARGS[0] = 'magbstchoice':
	cls
	cla
	tittmp = tits + 1
	'<center><img <<$set_imgh>> src="images/pc/body/tits/t<<tittmp>>.jpg"></center>'
	killvar 'tittmp'
	'You have an odd dream where you are looking at your naked chest in a mirror and your breasts seem larger...'
	'As the dream starts to drift away, you find yourself gazing at the reflection of your breasts and think:'
	act 'Nice, I wish my breasts really would grow.':
		magf2bdo = 1
		magtarcup += 1
		killvar 'mgf2bnocnt'
		gt 'bed2', 'sleep'
	end
	act 'Eh, I don''t like them like that.': magf2bdo = 0 & mgf2bnocnt += 1 & gt 'bed2', 'sleep'
end

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

