:: authors3
<<set $here = 'authors3'>>
<<set $ARGS = $location_var[$here]>>
<<set $time.minutes += 10>>
<<set $menu_off = 1>>
<<set $betAmount = 10>>
<<set $slotsJackpot = $betAmount * 20000>>
<<image "locations/city/industrial/casino/avt.jpg">>
<p>Rules of the game are very simple: feed a betAmount <b>₽</b> coin into the machine and pull the lever. There are multiple winning combinations, but everyone here has their eyes on the slotsJackpot <b>₽</b> jackpot.</p>
<<act 'Go back to the main hall'>>
	<<gt 'igravt'>>
<</act>>
<<actCLA 'Pull the lever'>>
	<<if $finances.cash >= $betAmount>>
		<<set $finances.cash -= $betAmount>>
		<<set $slotsRand = rand(1, 100000)>>
		<<if getvar("$slotsRand") > 99990>>
			<<set $winnings = $slotsJackpot>>
			<<msg 'Jackpot! What are the odds!?'>>
		<<elseif getvar("$slotsRand") >= 99900>>
			<<set $winnings = $betAmount * 1500>>
		<<elseif getvar("$slotsRand") >= 99000>>
			<<set $winnings = $betAmount * 100>>
		<<elseif getvar("$slotsRand") >= 90000>>
			<<set $winnings = $betAmount * 5>>
		<<elseif getvar("$slotsRand") >= 66667>>
			<<set $winnings = $betAmount * 2>>
		<<else>>
			<<set $winnings = 0>>
		<</if>>
		<<if getvar("$winnings") > 0>>
			<<set $finances.cash += $winnings>>
			<<msg 'You have won <<winnings>> <b>₽</b>.'>>
		<<else>>
			<<msg 'Alas, you lose. Try again?'>>
		<</if>>
		<<gt 'authors3'>>
	<<else>>
		<<msg 'You don""t have enough money to play. Turns out there""s no such thing as a free lunch, and you need money for a chance to win more money. Life is so unfair.'>>
		<<gt 'authors3'>>
	<</if>>
	<<set $slotsRand to null>>
	<<set $winnings to null>>
<</actCLA>>
