# carF
$enddrive = {
	if cardrive = 1:gt 'street'
	if cardrive = 2:gt 'down'
	if cardrive = 3:gt 'Nord'
	if cardrive = 4:gt 'lake', 'start'
	if cardrive = 5:gt 'park', 'start'
	if cardrive = 6:gt 'zaprF', 'start'
	if cardrive = 7:gt 'autoservisF', 'start'
	if cardrive = 8:gt 'autosalonF', 'start'
	if cardrive = 9:gt 'autotraidF', 'start'
	if cardrive = 10:gt 'park', 'whore'
	if cardrive = 11:gt 'sauna'
	if cardrive = 12:gt 'obekt'
	if cardrive = 18:gt 'youplace'
	if cardrive = 19:gt 'road'
	if cardrive = 20:gt 'gorodok'
	if cardrive = 21:gt 'zaprF', 'start'
}

if $ARGS[0] = 'start':
	$metka = $ARGS[0]
	$loc = $CURLOC
	cla
	*clr
	gs 'stat'
	set minut += 1
	clr
	fcolor = rgb(0, 0, 0)
	bcolor = rgb(255, 255, 255)
	lcolor = rgb(106, 90, 205)
	'<center><b><<$car>></b></center>'

	if car = 1:'<center><img src="images/picar/car.jpg"></center>'
	if car = 2:'<center><img src="images/picar/car2.jpg"></center>'
	if car = 3:'<center><img src="images/picar/car3.jpg"></center>'
	if car = 4:'<center><img src="images/picar/car4.jpg"></center>'
	if car = 5:'<center><img src="images/picar/car5.jpg"></center>'
	if car = 6:'<center><img src="images/picar/car6.jpg"></center>'
	if car = 7:'<center><img src="images/picar/car7.jpg"></center>'
	if car = 8:'<center><img src="images/picar/car8.jpg"></center>'
	if car = 9:'<center><img src="images/picar/car9.jpg"></center>'
	if car = 10:'<center><img src="images/picar/car10.jpg"></center>'
	if car = 11:'<center><img src="images/picar/car11.jpg"></center>'
	if car = 12:'<center><img src="images/picar/car12.jpg"></center>'
	if car = 13:'<center><img src="images/picar/car13.jpg"></center>'
	if car = 14:'<center><img src="images/picar/car14.jpg"></center>'
	if car = 15:'<center><img src="images/picar/car15.jpg"></center>'
	if car = 16:'<center><img src="images/picar/car16.jpg"></center>'
	if car = 17:'<center><img src="images/picar/car17.jpg"></center>'
	if car = 18:'<center><img src="images/picar/car18.jpg"></center>'
	if car = 19:'<center><img src="images/picar/car19.jpg"></center>'
	if car = 20:'<center><img src="images/picar/car20.jpg"></center>'
	if car = 21:'<center><img src="images/picar/car21.jpg"></center>'
	if car = 22:'<center><img src="images/picar/car22.jpg"></center>'
	if car = 23:'<center><img src="images/picar/car23.jpg"></center>'
	if car = 24:'<center><img src="images/picar/car24.jpg"></center>'
	if car = 25:'<center><img src="images/picar/car25.jpg"></center>'
	if car = 26:'<center><img src="images/picar/car26.jpg"></center>'
	if car = 27:'<center><img src="images/picar/car27.jpg"></center>'
	if car = 28:'<center><img src="images/picar/car28.jpg"></center>'
	if car = 29:'<center><img src="images/picar/car29.jpg"></center>'
	if car = 30:'<center><img src="images/picar/car30.jpg"></center>'
	if car = 95:'<center><img src="images/picar/car95.jpg"></center>'
	if car = 96:'<center><img src="images/picar/car96.jpg"></center>'
	if car = 97:'<center><img src="images/picar/car97.jpg"></center>'
	if car = 98:'<center><img src="images/picar/car98.jpg"></center>'
	if car = 99:'<center><img src="images/picar/car99.jpg"></center>'
	if car = 100:'<center><img src="images/picar/car100.jpg"></center>'

	act 'Move away from the machine':dynamic $enddrive

	if kanistra > 0:
		'In the trunk <<kanistra>> pc. five-liter jerry cans of gasoline.'

		if benz <= 35:
			act 'Pour canister into the tank':
				cla
				set benz += 5
				set kanistra -= 1
				'You filled canister of gasoline in the tank.'

				act 'Move away':gt 'carF', 'start'
			end
		end
	end

	act 'Get in the car':gt 'carF', 'salon'
end

if $ARGS[0] = 'salon':
	$metka = $ARGS[0]
	$loc = $CURLOC
	cla
	*clr
	gs 'stat'
	set minut += 1
	clr
	'<center><b><<$car>></b></center>'

	if car = 1:'<center><img src="images/picar/salon.jpg"></center>'
	if car = 2:'<center><img src="images/picar/salon2.jpg"></center>'
	if car = 3:'<center><img src="images/picar/salon3.jpg"></center>'
	if car = 4:'<center><img src="images/picar/salon4.jpg"></center>'
	if car = 5:'<center><img src="images/picar/salon5.jpg"></center>'
	if car = 6:'<center><img src="images/picar/salon6.jpg"></center>'
	if car = 7:'<center><img src="images/picar/salon7.jpg"></center>'
	if car = 8:'<center><img src="images/picar/salon8.jpg"></center>'
	if car = 9:'<center><img src="images/picar/salon9.jpg"></center>'
	if car = 10:'<center><img src="images/picar/salon10.jpg"></center>'
	if car = 11:'<center><img src="images/picar/salon11.jpg"></center>'
	if car = 12:'<center><img src="images/picar/salon12.jpg"></center>'
	if car = 13:'<center><img src="images/picar/salon13.jpg"></center>'
	if car = 14:'<center><img src="images/picar/salon14.jpg"></center>'
	if car = 15:'<center><img src="images/picar/salon15.jpg"></center>'
	if car = 16:'<center><img src="images/picar/salon16.jpg"></center>'
	if car = 17:'<center><img src="images/picar/salon17.jpg"></center>'
	if car = 18:'<center><img src="images/picar/salon18.jpg"></center>'
	if car = 19:'<center><img src="images/picar/salon19.jpg"></center>'
	if car = 20:'<center><img src="images/picar/salon20.jpg"></center>'
	if car = 21:'<center><img src="images/picar/salon21.jpg"></center>'
	if car = 22:'<center><img src="images/picar/salon22.jpg"></center>'
	if car = 23:'<center><img src="images/picar/salon23.jpg"></center>'
	if car = 24:'<center><img src="images/picar/salon24.jpg"></center>'
	if car = 25:'<center><img src="images/picar/salon25.jpg"></center>'
	if car = 26:'<center><img src="images/picar/salon26.jpg"></center>'
	if car = 27:'<center><img src="images/picar/salon27.jpg"></center>'
	if car = 28:'<center><img src="images/picar/salon28.jpg"></center>'
	if car = 29:'<center><img src="images/picar/salon29.jpg"></center>'
	if car = 30:'<center><img src="images/picar/salon30.jpg"></center>'
	if car = 95:'<center><img src="images/picar/salon95.jpg"></center>'
	if car = 96:'<center><img src="images/picar/salon96.jpg"></center>'
	if car = 97:'<center><img src="images/picar/salon97.jpg"></center>'
	if car = 98:'<center><img src="images/picar/salon98.jpg"></center>'
	if car = 99:'<center><img src="images/picar/salon99.jpg"></center>'
	if car = 100:'<center><img src="images/picar/salon100.jpg"></center>'

	'Gasoline - <<benz>>l, fuel tank capacity of 40 liters.'

	if teh <= 0:set teh = 0 & set wrek = 1
	if wrek = 1 or teh <= 0:set $teh = 'Car will not start, it needs repairs.'
	if teh >= tehcar * 75 / 100 and wrek = 0:set $teh = 'Machine in excellent condition.'
	if teh < tehcar * 75 / 100 and teh >= tehcar * 50 / 100 and wrek = 0:set $teh = 'When moving the machine you have any noises'
	if teh < tehcar * 50 / 100 and teh >= tehcar * 25 / 100 and wrek = 0:set $teh = 'Car crash and barely rides.'
	if teh < tehcar * 25 / 100 and wrek = 0:set $teh = 'As this bowl can still go, is a mystery even to the designers.'

	'<<$teh>>'

	if cardrive = 1:'Through the windshield you see the residential area.'
	if cardrive = 2:'Through the windshield you see downtown.'
	if cardrive = 3:'Through the windshield you see the northern region.'
	if cardrive = 4:'Through the windshield you see the lake.'
	if cardrive = 5:'Through the windshield you see the park.'
	if prava = 0:'You have no rights.'

	act 'Out of the car':dynamic $enddrive

	if benz > 0 and wrek = 0 and prava > 0:
		if teh >= tehcar * 75/100 and wrek = 0:
			set wrekrand = rand(0, 1000)

			if wrekrand = 1000:set wrek = 1
		end

		if teh < tehcar*75/100 and teh >= tehcar * 50/100 and wrek = 0:
			set wrekrand = rand(0, 100)

			if wrekrand = 100:set wrek = 1
		end

		if teh < tehcar*50/100 and teh >= tehcar * 25/100 and wrek = 0:
			set wrekrand = rand(0, 100)

			if wrekrand >= 80:set wrek = 1
		end

		if teh < tehcar*25/100 and wrek = 0:
			set wrekrand = rand(0, 100)

			if wrekrand >= 40:set wrek = 1
		end
		if wrek = 1:
			'Something clattered loudly and the engine stalled.'

			act 'Fuck':gt 'carF', 'salon'
		end

		if alko > 0:
			dpsrand = rand(0, 100)

			if dpsrand <= alko:
				'Policeman stops you, he looks at your condition and requests to breath into a tube. You breathe and instrument panel lights red lamochka.'
				'Traffic police snorts and writes something in his cell, and then shows you. There is written sms with the number 50000'
				'Or let´s make the report. Now operates divestment forever for driving not sober.'

				if money >= 50000:
					act 'Give a bribe (50,000 rubles)':
						cla
						money = money - 50000
						'You pay and the policeman warns you that you will not be riding in this state.'

						act 'In the salon':gt 'carF', 'salon'
					end
				end

				act 'Come on, all under the law':
					cla
					prava = 0
					'Disempower you, not for driving sober.'

					act 'In the salon':gt 'carF', 'salon'
				end

				exit
			end
		end

		if alko >= 10:
			avarand = rand(0, 100)

			if avarand >= 50:
				teh = teh / 2
				wrek = 1
				'You with a drunk crashed into a tree, breaking the car into pieces.'

				act 'In the salon':gt 'carF', 'salon'

				exit
			end
		end

		if wrek = 0:
			if cardrive >= 20:
				if cardrive ! 3:
					act 'Go to town':
						cla
						set minut += 75
						set benz -= 1
						set teh -= rand(3, 6)
						set cardrive = 3
						'You are more than an hour drive on the highway that would get here before the city.'
						dynamic $enddrive
					end
				end

				if cardrive ! 21:
					act 'Go to the gas station':
						cla
						set minut += 15
						set benz -= 1
						set teh -= rand(1, 3)
						set cardrive = 21
						'You get 15 minutes to the destination.'
						dynamic $enddrive
					end
				end
			end

			if placeMansion > 0 and cardrive ! 18:
				act 'Go to your site':
					cla

					if cardrive >= 20:
						set minut += 60
						set benz -= 1
						set teh -= rand(1, 3)
						set cardrive = 18
					else
						set minut += 15
						set benz -= 1
						set teh -= rand(1, 3)
						set cardrive = 18
					end

					'You drive to the town.'
					dynamic $enddrive
				end
			end

			if cardrive ! 1:
				act 'Go to the residential area':
					cla
					set minut += 15
					set benz -= 1
					set teh -= rand(1, 3)
					set cardrive = 1
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 2:
				act 'Go to city center':
					cla
					set minut += 15
					set benz -= 1
					set teh -= rand(1, 3)
					set cardrive = 2
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 3:
				act 'Go to the northern area':
					cla
					set minut += 15
					set benz -= 1
					set teh -= rand(1, 3)
					set cardrive = 3
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 4:
				act 'Go to the lake':
					cla
					set minut += 15
					set benz -= 1
					set teh -= rand(1, 3)
					set cardrive = 4
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 5:
				act 'Go to the park':
					cla
					set minut += 15
					set benz -= 1
					set teh -= rand(1, 3)
					set cardrive = 5
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 6:
				act 'Go to the gas station':
					cla
					set minut += 15
					set benz -= 1
					set teh -= rand(1, 3)
					set cardrive = 6
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 7:
				act 'Go to the car wash':
					cla
					set minut += 15
					set benz -= 1
					set teh -= rand(1, 3)
					set cardrive = 7
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 8:
				act 'Go to a car dealership':
					cla
					set minut += 15
					set benz -= 1
					set teh -= rand(1, 3)
					set cardrive = 8
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 9:
				act 'Go to the car market':
					cla
					set minut += 15
					set benz -= 1
					set teh -= rand(1, 3)
					set cardrive = 9
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 12:
				act 'Go on to':
					cla
					set minut += 60
					set benz -= 1
					set teh -= rand(2, 5)
					set cardrive = 12
					'You get 15 minutes to the destination.'
					dynamic $enddrive
				end
			end

			if cardrive ! 20:
				act 'Go to town':
					cla
					set minut += 75
					set benz -= 1
					set teh -= rand(3, 6)
					set cardrive = 20
					'You eat more than an hour on the highway to the town.'
					dynamic $enddrive
				end
			end

			act 'Go around the track (1:00)':
				cla
				'You go on the road.'
				numberRoad = input("In which city will stop (from 0 to 20)")

				if numberRoad >= 0 and numberRoad <= 20:
					set cardrive = 19
					set nroad = numberRoad
					set ncarroad = numberRoad
				end

				xgt 'carF', 'salon'
			end

			act 'To drive on the track (1:00)':
				cla
				set minut += 60
				set benz -= 4
				set teh -= rand(2, 6)
				set manna += 20
				set wipo += 10
				'You go to the track and having fun Likhachev, then turn back.'

				act 'Finish':xgt 'carF', 'salon'
			end
		end
	end
end

--- carF ---------------------------------
