# portnoi2
poshvalldrop = 0

i = 1
:cheapmet
	if cheap[i] = 1 and ((cheapB[i] > bedra + 8) or (cheapB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
if i <= 85:jump 'cheapmet'

i = 1
:averagemet
	if average[i] = 1 and ((averageB[i] > bedra + 8) or (averageB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
if i <= 125:jump 'averagemet'

i = 1
:expensivemet
	if expensive[i] = 1 and ((expensiveB[i] > bedra + 8) or (expensiveB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
if i <= 147:jump 'expensivemet'

i = 1
:formalmet
	if formal[i] = 1 and ((formalB[i] > bedra + 8) or (formalB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
if i <= 14:jump 'formalmet'

i = 1
:officemet
	if office[i] = 1 and ((officeB[i] > bedra + 8) or (officeB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
if i <= 30:jump 'officemet'

i = 1
:schoolmet
	if school[i] = 1 and ((schoolB[i] > bedra + 8) or (schoolB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
	if i = 6: i = 7
if i <= 14:jump 'schoolmet'

i = 1
:naughtymet
	if naughty[i] = 1 and ((naughtyB[i] > bedra + 8) or (naughtyB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
if i <= 67:jump 'naughtymet'

i = 1
:exhibitmet
	if exhibit[i] = 1 and ((exhibitB[i] > bedra + 8) or (exhibitB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
if i <= 30:jump 'exhibitmet'

i = 1
:uniformmet
	if uniform[i] = 1 and ((uniformB[i] > bedra + 8) or (uniformB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
if i <= 24:jump 'uniformmet'

i = 1
:swimwearmet
	if swimwear[i] = 1 and ((swimwearB[i] > bedra + 8) or (swimwearB[i] < bedra - 8)):poshvalldrop += 1
	i += 1
if i <= 30:jump 'swimwearmet'

poshvalldrop *= 500

if money < poshvalldrop:
	'You do not have enough money to resize all of your clothing. The total cost would be <<poshvalldrop>> <b>₽</b>.'

	if $loc = 'Gshveyfab':
		act 'Leave':gt 'Gshveyfab', 'start'
	else
		act 'Leave':gt 'rinok', 'tailor'
	end

	exit
elseif money >= poshvalldrop:
	money -= poshvalldrop

	i = 1
	:xcheapmet
		if cheap[i] = 1 and ((cheapB[i] > bedra + 8) or (cheapB[i] < bedra - 8)):cheapB[i] = bedra
		i += 1
	if i <= 85:jump 'xcheapmet'

	i = 1
	:xaveragemet
		if average[i] = 1 and ((averageB[i] > bedra + 8) or (averageB[i] < bedra - 8)):averageB[i] = bedra
		i += 1
	if i <= 125:jump 'xaveragemet'

	i = 1
	:xexpensivemet
		if expensive[i] = 1 and ((expensiveB[i] > bedra + 8) or (expensiveB[i] < bedra - 8)):expensiveB[i] = bedra
		i += 1
	if i <= 147:jump 'xexpensivemet'

	i = 1
	:xformalmet
		if formal[i] = 1 and ((formalB[i] > bedra + 8) or (formalB[i] < bedra - 8)):formalB[i] = bedra
		i += 1
	if i <= 14:jump 'xformalmet'

	i = 1
	:xofficemet
		if office[i] = 1 and ((officeB[i] > bedra + 8) or (officeB[i] < bedra - 8)):officeB[i] = bedra
		i += 1
	if i <= 30:jump 'xofficemet'

	i = 1
	:xschoolmet
		if school[i] = 1 and ((schoolB[i] > bedra + 8) or (schoolB[i] < bedra - 8)):schoolB[i] = bedra
		i += 1
		if i = 6: i = 7
	if i <= 14:jump 'xschoolmet'

	i = 1
	:xnaughtymet
		if naughty[i] = 1 and ((naughtyB[i] > bedra + 8) or (naughtyB[i] < bedra - 8)):naughtyB[i] = bedra
		i += 1
	if i <= 67:jump 'xnaughtymet'

	i = 1
	:xexhibitmet
		if exhibit[i] = 1 and ((exhibitB[i] > bedra + 8) or (exhibitB[i] < bedra - 8)):exhibitB[i] = bedra
		i += 1
	if i <= 30:jump 'xexhibitmet'

	i = 1
	:xuniformmet
		if uniform[i] = 1 and ((uniformB[i] > bedra + 8) or (uniformB[i] < bedra - 8)):uniformB[i] = bedra
		i += 1
	if i <= 24:jump 'xuniformmet'

	i = 1
	:xswimwearmet
		if swimwear[i] = 1 and ((swimwearB[i] > bedra + 8) or (swimwearB[i] < bedra - 8)):swimwearB[i] = bedra
		i += 1
	if i <= 30:jump 'xswimwearmet'

	'You resize all clothing for <<poshvalldrop>> <b>₽</b>.'

	if $loc = 'Gshveyfab':
		act 'Leave':gt 'Gshveyfab', 'start'
	else
		act 'Leave':gt 'rinok', 'tailor'
	end

	exit
end

--- portnoi2 ---------------------------------

