# KGZgame
minut += 1
gs 'stat'
gs 'KGZdyn'

if KGZHP <= 0:
	cla
	*clr
	'<center><b>GAME OVER</b></center>'

	act 'Quit Game':gt 'KGZstart'

	exit
end

if KGZhour >= 6 and KGZhour <= 21:
	KGZsvet = 1
else
	KGZsvet = 0
end

'<a href="exec:gt ''KGZstart''">Get out of the game</a>'
'Health <<KGZHP>>. Day <<KGZday>>, h <<KGZhour>>.'

if KGZsup <= 0:'You have no provisions, you are starving!'

'Edged weapons:<<$KGZweapon>>'

if KGZgun > 0:'<<$KGZgun>>'
if KGZgun2 > 0:'<<$KGZgun2>>'
if KGZgun3 > 0:'<<$KGZgun3>>'

if KGZgenerator > 0:
	if KGZbenzin = 0:$KGZbenzin = 'But the generator does not work because you do not have gasoline.'
	if KGZbenzin = 1:$KGZbenzin = 'You have filled a full tank of gasoline.'

	'Do you have a portable generator runs on gasoline. <<$KGZbenzin>>'
end

if KGZbolgarka > 0:'Do you have a Bulgarian powered by electricity.'
if KGZratia = 1:'Do you have a radio.'

''

if KGZplace = 0:
	'<center><b>Apartment</b></center>'
	'Your apartment is a safe place. The apartment is stored provisions, which will be enough to <<KGZsup>> days'

	if KGZmedkit > 0:
		'First aid kits <<KGZmedkit>> pieces'

		if KGZHP < 100:
			act 'Treated':
				cls
				KGZhour += 1
				KGZHP = 100
				KGZmedkit -= 1
				minut += 1
				gs 'stat'
				'You heal health through kits.'

				act 'Further':gt $curloc
			end
		end
	end

	act 'Laze':
		cls
		KGZhour += 1
		minut += 1
		gs 'stat'
		'You lounged in the apartment, lounging on the couch and thinking how you vykruchivatsya of the situation.'

		act 'Further':gt $curloc
	end

	act 'Leave the apartment':
		cls
		KGZhour += 1
		minut += 1
		KGZplace = 1
		KGZbatl = 0
		gs 'stat'
		'You cautiously left the apartment trying not to stumble on the dead.'

		act 'Further':gt $curloc
	end
elseif KGZplace = 1:
	KGZdead = rand(KGZday, KGZday * 2)
	'<center><b>Street</b></center>'
	'On the street the broken machine, lie the corpses.'

	if KGZbatl = 0:
		'Roam the streets <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':
				if KGZsvet = 1:KGZdist = rand(5, 30)
				if KGZsvet = 2:KGZdist = rand(3, 10)

				gt 'KGZfight'
			end
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod
	end
elseif KGZplace = 2:
	KGZdead = rand(KGZday, KGZday * 2)
	'<center><b>Shop</b></center>'
	'In store stale air from spoiled food and dead.'

	if KGZbatl = 0:
		'Wander around the store <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':
				if KGZsvet = 1:KGZdist = rand(3, 10)
				if KGZsvet = 2:KGZdist = rand(2, 8)

				gt 'KGZfight'
			end
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod2
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod2
	end
elseif KGZplace = 3:
	KGZdead = rand(KGZday, KGZday * 2)
	'<center><b>Hospital</b></center>'
	'Hospital floor littered with papers and dead bodies of patients and physicians.'

	if KGZbatl = 0:
		'Wander around the hospital <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':
				if KGZsvet = 1:KGZdist = rand(3, 10)
				if KGZsvet = 2:KGZdist = rand(2, 8)

				gt 'KGZfight'
			end
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod3
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod3
	end
elseif KGZplace = 4:
	KGZdead = rand(KGZday, KGZday * 2)
	'<center><b>Boulevard</b></center>'
	'On the boulevard cluster of abandoned and wrecked cars everywhere corpses.'

	if KGZbatl = 0:
		'Wander along the boulevard <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':
				if KGZsvet = 1:KGZdist = rand(5, 30)
				if KGZsvet = 2:KGZdist = rand(3, 10)

				gt 'KGZfight'
			end
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod4
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod4
	end
elseif KGZplace = 5:
	KGZdead = rand(KGZday, KGZday * 2)
	'<center><b>Hunting Store</b></center>'
	'In hunting stores all counters are flipped, things scattered on the floor and something where visible decaying corpses.'

	if KGZbatl = 0:
		'Roam around the room <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(2, 6) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod5
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod5
	end
elseif KGZplace = 6:
	KGZdead = rand(KGZday, KGZday * 2)
	'<center><b>Police station</b></center>'
	'At the police station the police corpses scattered on the floor, tables overturned and papers strewn all around.'

	if KGZbatl = 0:
		'Roam around the room <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(2, 5) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod6
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod6
	end
elseif KGZplace = 7:
	KGZdead = rand(KGZday, KGZday * 2)
	'<center><b>Drugstore</b></center>'
	'In store everything upside down and smells mertvyachinoy.'

	if KGZbatl = 0:
		'Roam around the room <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(2, 5) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod7
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod7
	end
elseif KGZplace = 8:
	KGZdead = rand(KGZday * 2, KGZday * 4)
	'<center><b>Route</b></center>'
	'On the highway, a huge traffic jam of abandoned cars, where there are some broken machines and the dead bodies.'

	if KGZbatl = 0:
		'Wander along the highway <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':
				if KGZsvet = 1:KGZdist = rand(5, 30)
				if KGZsvet = 2:KGZdist = rand(3, 10)

				gt 'KGZfight'
			end
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod8
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod8
	end
elseif KGZplace = 9:
	KGZdead = rand(KGZday, KGZday * 2)
	'<center><b>Threading</b></center>'
	'At the gas station is a pair of abandoned cars. No electricity and speakers only work in manual mode.'

	if KGZbatl = 0:
		'Roam around the room <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(2, 5) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod9
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod9
	end
elseif KGZplace = 10:
	KGZdead = rand(KGZday * 5, KGZday * 10)

	if KGZplaceA = 20:KGZplace = 100 & gt $curloc
	if KGZplaceA = 10:KGZplace = 11 & gt $curloc
	if KGZplaceA = 0:KGZplace = 8 & gt $curloc

	'<center><b>Highway in Fort Bragg</b></center>'
	'<center><b><<KGZplaceA>>th kilometer</b></center>'
	'On the highway are broken machines are corpses.'

	if KGZbatl = 0:
		'Wander along the highway <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':
				if KGZsvet = 1:KGZdist = rand(5, 30)
				if KGZsvet = 2:KGZdist = rand(3, 10)

				gt 'KGZfight'
			end
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod10
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod10
	end
elseif KGZplace = 11:
	KGZdead = rand(KGZday * 10, KGZday * 20)
	'<center><b>Fort Bragg</b></center>'
	'Fort Bragg is a small building surrounded by a fence.'

	if KGZbatl = 0:
		'Roam around the fort <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(3, 10) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod11
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod11
	end
elseif KGZplace = 12:
	if KGZdost = 0:KGZdost = 1

	KGZdead = rand(KGZday * 10, KGZday * 20)
	'<center><b>Roof Fort Bragg</b></center>'
	'On the roof is full of lying motionless rotting bodies, many spent cartridges.'
	'Provisions enough for <<KGZsup>> day'

	if KGZfortQW > 0:'<a href="exec:dynamic $KGZvincent">Young tired man in the form of Ranger</a>, sits leaning on a sniper rifle.'
	if KGZmedkit > 0:
		'First aid kits <<KGZmedkit>> pieces'

		if KGZHP < 100:
			act 'Treated':
				cls
				KGZhour += 1
				KGZHP = 100
				KGZmedkit -= 1
				minut += 1
				gs 'stat'
				'You heal health through kits.'

				act 'Further':gt $curloc
			end
		end
	end

	act 'Rest':
		cls
		KGZhour += 1
		minut += 1
		gs 'stat'
		'You have settled on the convenient roof, not taking his eyes off the hatch which can climb dead.'

		act 'Further':gt $curloc
	end

	act 'Exit to the fort':
		cls
		KGZhour += 1
		minut += 1
		KGZplace = 11
		KGZbatl = 0
		gs 'stat'
		'You gently down into the hatch, trying not to stumble on the dead.'

		act 'Further':gt $curloc
	end
elseif KGZplace = 13:
	KGZdead = rand(KGZday * 10, KGZday * 20)
	'<center><b>Fort Bragg</b></center>'
	'<center><b>Food Storage</b></center>'
	'Stock dark and heard noises.'

	if KGZbatl = 0:
		'Wander around the warehouse <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(2, 3) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod13
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod13
	end
elseif KGZplace = 14:
	KGZdead = rand(KGZday * 10, KGZday * 20)
	'<center><b>Fort Bragg</b></center>'
	'<center><b>Infirmary</b></center>'
	'In the hospital is dark and heard noises.'

	if KGZbatl = 0:
		'By Infirmary roam <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(2, 3) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod14
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod14
	end
elseif KGZplace = 15:
	KGZdead = rand(KGZday * 10, KGZday * 20)
	'<center><b>Fort Bragg</b></center>'
	'<center><b>Arms</b></center>'
	'In the armory dark and heard noises.'

	if KGZbatl = 0:
		'On weapons roam <<KGZdead>>Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(2, 3) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod15
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod15
	end
elseif KGZplace = 16:
	KGZdead = rand(KGZday * 10, KGZday * 20)
	'<center><b>Fort Bragg</b></center>'
	'<center><b>Garage</b></center>'
	'The garage is dark and heard noises.'

	if KGZbatl = 0:
		'Roam around the garage <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

		act 'Srazhatsya':KGZdist = rand(2, 3) & gt 'KGZfight'
	else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod16
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod16
	end
elseif KGZplace = 100:
	KGZdead = rand(KGZday * 20, KGZday * 30)
	'<center><b>City Koldkrik</b></center>'
	'The city was destroyed and fires could be seen.'

	if KGZbatl = 0:
		'Roam the streets <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(10, 30) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod100
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod100
	end
elseif KGZplace = 101:
	'<center><b>House</b></center>'
	'This home is a safe place. The house is kept provision, which will be enough to <<KGZsup>> days'

	if KGZmedkit > 0:
		'First aid kits <<KGZmedkit>> pieces'

		if KGZHP < 100:
			act 'Treated':
				cls
				KGZhour += 1
				KGZHP = 100
				KGZmedkit -= 1
				minut += 1
				gs 'stat'
				'You heal health through kits.'

				act 'Further':gt $curloc
			end
		end
	end

	act 'Laze':
		cls
		KGZhour += 1
		minut += 1
		gs 'stat'
		'You lounged in the apartment, lounging on the couch and thinking how you vykruchivatsya of the situation.'

		act 'Further':gt $curloc
	end

	act 'Out of the house':
		cls
		KGZhour += 1
		minut += 1
		KGZplace = 100
		KGZbatl = 0
		gs 'stat'
		'You cautiously left the apartment trying not to stumble on the dead.'

		act 'Further':gt $curloc
	end
elseif KGZplace = 102:
	KGZdead = rand(KGZday * 5, KGZday * 10)
	'<center><b>Supermarket</b></center>'
	'At the supermarket, dark and heard noises.'

	if KGZbatl = 0:
		'Roam the halls of the Trade <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(5, 10) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod102
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod102
	end
elseif KGZplace = 200:
	KGZdead = rand(KGZday, KGZday * 2)
	'<center><b>Forest</b></center>'
	'In the dark forest and heard noises.'

	if KGZbatl = 0:
		'Wander through the woods <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(10, 30) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod200
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod200
	end
elseif KGZplace = 201:
	KGZdead = rand(KGZday, KGZday * 3)
	'<center><b>Farm</b></center>'
	'Large fenced farm fence.'

	if KGZbatl = 0:
		'Wander around the neighborhood <<KGZdead>> Dead'
		KGZagr = rand(0, 10)

		if KGZagr <= 8:
			'Sensing you dead immediately rush to the attack.'

			act 'Srazhatsya':KGZdist = rand(10, 30) & gt 'KGZfight'
		else
			'Fortunately, you do not notice the dead.'
			dynamic $KGZvihod201
		end
	else
		'The Walking Dead is not visible.'
		dynamic $KGZvihod201
	end
elseif KGZplace = 202:
	'<center><b>House</b></center>'
	'This home is a safe place. The house is kept provision, which will be enough to <<KGZsup>> days'

	if KGZmedkit > 0:
		'First aid kits <<KGZmedkit>> pieces'

		if KGZHP < 100:
			act 'Treated':
				cls
				KGZhour += 1
				KGZHP = 100
				KGZmedkit -= 1
				minut += 1
				gs 'stat'
				'You heal health through kits.'

				act 'Further':gt $curloc
			end
		end
	end

	act 'Laze':
		cls
		KGZhour += 1
		minut += 1
		gs 'stat'
		'You lounged in the apartment, lounging on the couch and thinking how you vykruchivatsya of the situation.'

		act 'Further':gt $curloc
	end

	act 'Out of the house':
		cls
		KGZhour += 1
		minut += 1
		KGZplace = 201
		KGZbatl = 0
		gs 'stat'
		'You cautiously left the apartment trying not to stumble on the dead.'

		act 'Further':gt $curloc
	end
end

--- KGZgame ---------------------------------
