# avt
tehNT = car['potential_new_condition']
if tehNT = 0: tehNT = 200
tehT = rand(10, tehNT)

!! i could replace all tehT and tehNT with appropriate car[] variables but then the code gets even less readable
if tehT >= tehNT * 75 / 100:$tehT = 'The car looks like it''s in excellent condition.'
if tehT < tehNT * 75 / 100 and tehT >= tehNT * 50 / 100:$tehT = 'When you turn on the car, the engine makes some noise.'
if tehT < tehNT * 50 / 100 and tehT >= tehNT * 25 / 100:$tehT = 'When you turn on the car, the engine rumbles and smokes.'
if tehT < tehNT * 25 / 100:$tehT = 'You''re not sure how someone managed to get this piece of junk here.'

if carT = 1:
	if tehT >= tehNT * 75 / 100:bupay = rand(100000, 180000)
	if tehT < tehNT * 75 / 100 and tehT >= tehNT * 50 / 100:bupay = rand(60000, 130000)
	if tehT < tehNT * 50 / 100 and tehT >= tehNT * 25 / 100:bupay = rand(35000, 65000)
	if tehT < tehNT * 25 / 100:bupay = rand(15000, 50000)
elseif carT = 2:
	if tehT >= tehNT * 75 / 100:bupay = rand(80000, 100000)
	if tehT < tehNT * 75 / 100 and tehT >= tehNT * 50 / 100:bupay = rand(50000, 90000)
	if tehT < tehNT * 50 / 100 and tehT >= tehNT * 25 / 100:bupay = rand(30000, 60000)
	if tehT < tehNT * 25 / 100:bupay = rand(15000, 40000)
end

used_car['<<autotraidF_carnum>>_condition'] = tehT
$used_car['<<autotraidF_carnum>>_condition'] = $tehT
used_car['<<autotraidF_carnum>>_price'] = bupay

killvar 'bupay'
killvar 'tehNT'
killvar 'tehT'
killvar 'carT'

--- avt ---------------------------------

