# shortgs

!! smoker - handles all changes which happen when PC smokes one cigarette
!! use : gs 'shortgs','smoker'
if $ARGS[0] = 'smoker':
	siga -= 1
	smoker += 1
	smokeHour = hour
	smokeDay = daystart
	smokeminut = minut + 5
	smokerNeed = 0
	cumspclnt = 2
	gs 'cum_cleanup'
	pcs_breath = 0
	pcs_mood += 100
	wipo += 100
	if pcs_energy < 80: pcs_energy += 4
	gs '$menu_obnovit'
end &!--- smoker ---

!! milk_me
!! use href="exec:gt ''shortgs'',''milk_me''"
if $ARGS[0] = 'milk_me':
	minut += 15
	if $location_type ! 'bathroom':
		'You can''t use it here.'
	elseif lactatemv > 0 and pain['nipples'] < 60:
		'<center><img <<$set_imgh>> src="images/pc/body/tits/pump_lactating.jpg"></center>'
		'You attach the pump to your breast and start rythmically squeezing the bulb until your breasts feel empty.<br>You give it a few more pumps and detach the pump.<br>You filled the bottle with <<lactatemv>>ml of your milk.'
		breastcounter += 1
		lactatemv = 0
		if breastpumped = 1:pain['nipples'] += 10 & 'Your nipples are feeling sore.'
		breastpumped = 1
		pcs_nips += rand(0,1)
		if bcream_used = 1:pcs_nips += 1
	elseif lactate = 0 and pain['nipples'] < 60:
		if rand(1,100) + breastcounter >= rand(100,200):
			'<center><img <<$set_imgh>> src="images/pc/body/tits/lactate_start.jpg"></center>'
			'As usual, you attach the pump but after a few pumps white liquid suddenly starts spurting from your nipples.<br>You started lactating!'
			lactate = 1
			lactatemv = 0
			lactatemm = 10
		else
			'<center><img <<$set_imgh>> src="images/pc/body/tits/t<<tits>>.jpg"></center>'
			'You attach the pump to your nipples and start squeezing the bulb. The vacuum feels good on your nipples.<br>A few droplets of liquid come out of your nipples but it is not milk.'
			breastcounter += 1
			if breastpumped = 1:pain['nipples'] += 10 & 'Your nipples are feeling sore.'
			breastpumped = 1
			pcs_nips += rand(0,1)
			if bcream_used = 1:pcs_nips += 1
		end
	else
		'Your nipples feel too sore to use the pump right now.'
	end
	act 'Finish':gt $loc, $metka
end &! --- milk_me ---

!! following function counts the number of guys which PC slept with. 
!! use func('shortgs','guy') or func('shortgs','guy',X) for subset (X can be 'A','B','C','AB','AC','BC')
if $ARGS[0] = 'guy':
	r_sht=0
	if $ARGS[1] = '': $temptask = 'ABC' else $temptask = $ARGS[1]
	:loop_shtty
	$temptaskchar = mid($temptask,1,1) 
	$temptask = mid($temptask,2,len($temptask)-1)
	s_sht=0
	:loop_shya
	if s_sht<=dyneval("result = <<$temptaskchar>>arraynumber"):
		s_sht += 1
		if npc_sex['<<$temptaskchar>><<s_sht>>'] > 0: r_sht = r_sht + iif(npc_gender['<<$temptaskchar>><<s_sht>>'] = 0,1,0)
		jump 'loop_shya'
	end
	if len($temptask) > 0:jump 'loop_shtty'
	result = r_sht
	killvar 'r_sht'
	killvar '$temptask'
	killvar '$temptaskchar'
	killvar 's_sht'
end &! --- guy ---

!! following function counts the number of girls which PC slept with.
!! use func('shortgs','girl') or func('shortgs','girl',X) for subset (X can be 'A','B','C','AB','AC','BC')
if $ARGS[0] = 'girl':
	r_sht=0
	if $ARGS[1] = '': $temptask = 'ABC' else $temptask = $ARGS[1]
	:loop_shttl
	$temptaskchar = mid($temptask,1,1) 
	$temptask = mid($temptask,2,len($temptask)-1)
	s_sht=0
	:loop_shl
	if s_sht<=dyneval("result = <<$temptaskchar>>arraynumber"):
		s_sht += 1
		if npc_sex['<<$temptaskchar>><<s_sht>>'] > 0: r_sht = r_sht + iif(npc_gender['<<$temptaskchar>><<s_sht>>'] = 1,1,0)
		jump 'loop_shl'
	end
	if len($temptask) > 0: jump 'loop_shttl'
	result = r_sht
	killvar 'r_sht'
	killvar '$temptask'
	killvar '$temptaskchar'
	killvar 's_sht'
end &! --- girl ---

!! following procedure should be used when PC gets naked, but it should be paired with the reverse procedure 
!! use gs 'shortgs','undress'
if $ARGS[0] = 'undress':
	gs 'clothing','strip'
	gs 'underwear', 'remove'
end &! --- undress ---

!! reverse procedure, it can be modified for lose or stolen panties later. 
!! use gs 'shortgs','dress'
if $ARGS[0] = 'dress':
	gs 'clothing','wear_last_worn'
	gs 'underwear', 'wear'
end &! --- dress ---

!! procedure, which prevents PC to leave a room naked.  
!! use gs 'shortgs','checkdress',' <<$loc>>,<<$metka>> '  or equivalent
if $ARGS[0] = 'checkdress':
	if $clothingworntype = 'nude':
		msg '<b><font color="red">You need to get dressed before going out.</font></b>'
		dynamic 'gt <<$ARGS[1]>>'
	end
end &! --- checkdress ---

!! this is an integer sqrt function
!! call func('shortgs','sqrt', n)
if $ARGS[0] = 'sqrt':
	sqrtnum = ARGS[1]
	if sqrtnum = 0: result = 0 & exit
	sqrtn = sqrtnum/2 + 1
	sqrtn1 = (sqrtn + sqrtnum / sqrtn) / 2
:sqrtloop
	if sqrtn1 < sqrtn:
		sqrtn = sqrtn1
		sqrtn1 = (sqrtn + sqrtnum / sqrtn) / 2
		jump 'sqrtloop'
	end
    result = sqrtn  
end

!! this function calculates modul of given arguments as it was coordinates in cartezian systeme
!! use func('shortgs','modul',n1,n2,..n8)
if $ARGS[0] = 'modul':
	modul_sum = ARGS[1]*ARGS[1]+ARGS[2]*ARGS[2]+ARGS[3]*ARGS[3]+ARGS[4]*ARGS[4]+ARGS[5]*ARGS[5]+ARGS[6]*ARGS[6]+ARGS[7]*ARGS[7]+ARGS[8]*ARGS[8]
    result = func('shortgs','sqrt',modul_sum)
	killvar 'modul_sum'
end
!! day of week 1 - Monday .. 7 - Sunday
if $ARGS[0] = 'dow':
	dow_a = (14 - month) / 12
	dow_Y = year - dow_a
	dow_M = month + 12*dow_a - 2
	dummy = (day + dow_y + dow_y/4 - dow_y/100 + dow_y/400 + (31*dow_m)/12) mod 7
	if dummy = 0: dummy = 7
	result = dummy
end
!! day of year
if $ARGS[0] = 'doy':
	doy_N1 = 275 * ARGS[2] / 9
	doy_N2 = (ARGS[2] + 9) / 12
	doy_N3 = 1 + (ARGS[1] - 4 * (ARGS[1] / 4) + 2) / 3
	result = doy_N1 - (doy_N2 * doy_N3) + ARGS[3] - 30
end
if $ARGS[0] = 'mk':
	gs 'saveposition'
	*clr & cla
	$mk_subst['0'] = 'M' & $mk_subst['1'] = 'F' & $mk_subst['2'] = 'O' & $mk_subst['3'] = 'L' & $mk_subst['4'] = 'R' & $mk_subst['5'] = 'P'
	'<center><font face="courier" size=1>'
	'<table border = 1>'
	'<tr><th>Mon</th><th>Tue</th><th>Wen</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th><th>Mon</th><th>Tue</th><th>Wen</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th>
	<th>Mon</th><th>Tue</th><th>Wen</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th><th>Mon</th><th>Tue</th><th>Wen</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th></tr>'
	i = ArrSize('$MenCal')
	empty0 = week + 29 - i - 1
	empty1 = min(28,empty0)
	full1 = max(0,28 - empty0)
	empty2 = max(0,empty0-28)
	full2 = i - full1
	empty3 = 28 - empty2 - full2
	count=0
	$tabmc = '<tr>'
:tabmcl1
	if empty1 > 0: empty1 -=1 & $tabmc +='<td>&nbsp</td>' & jump 'tabmcl1'
:tabmcl2
	if full1 > 0: 
		full1 -=1 
		if $MenCal[count]='0': $tabmc +='<td bgcolor="red"><<$mk_subst[$MenCal[count]]>></td>' else $tabmc +='<td><<$mk_subst[$MenCal[count]]>></td>'
		count +=1
		jump 'tabmcl1'
	end
	$tabmc += '</tr><tr>'
:tabmcl3
	if empty2 > 0: empty2 -=1 & $tabmc +='<td>&nbsp</td>' & jump 'tabmcl3'
:tabmcl4
	if full2 > 0:
		full2 -=1
		if $MenCal[count]='0': $tabmc +='<td bgcolor="red"><<$mk_subst[$MenCal[count]]>></td>' else $tabmc +='<td><<$mk_subst[$MenCal[count]]>></td>'
		count +=1
		jump 'tabmcl4'
	end
:tabmcl5
	if empty3 > 0: empty3 -=1 & $tabmc +='<td></td>' & jump 'tabmcl5'
	$tabmc += '</tr><table></font></center>'
	$tabmc
	act 'Back': gt 'restoreposition'
end

--- shortgs ---------------------------------

