:: casino
<<set $here = 'casino'>>
<<set $ARGS = $location_var[$here]>>
<<set $loc = 'casino'>>
<<set $menu_loc = 'casino'>>
<<if $location_var[$here][0] == 'outside'>>
	<<set $loc_arg = 'outside'>>
	<<set $menu_arg = 'outside'>>
	<<set $menu_off = 0>>
	<<set $location_type = 'public_outdoors'>>
	<right><<image 'images/locations/city/industrial/casino/zdcasino.jpg'>></right>
	You stand in front of the door of the huge building casinos.
	<<actCLA 'Return to the city industrial area'>>
		<<set $time.minutes += 10>> <<gt 'city_industrial'>>
	<</actCLA>>
	<<act 'Enter the casino'>>
		<<gt 'casino' 'foyer'>>
	<</act>>
	<!-- !!if tobiQW < 1000:tobiQW = 1000-->
<</if>>
<<if $location_var[$here][0] == 'foyer'>>
	<<set $loc_arg = $location_var[$here][0]>>
	<<set $menu_arg = $location_var[$here][0]>>
	<<set $menu_off = 0>>
	<<set $location_type = 'public_indoors'>>
	<<set $time.minutes += 1>>
	<<set $picrand = rand(1, 3)>>
	<right><<image 'images/locations/city/industrial/casino/hcasino<<picrand>>.jpg'>></right>
	You enter the foyer of the casino, there are lots of games .
	In the hall are various <<link "slot machines">><<gt 'casino' 'slots'>><</link>>.
	In the games room there is <<link "Roulette">><<gt 'casino' 'roulette'>><</link>> and <<link "card games">><<gt 'casino' 'cards'>><</link>>.
	<<act 'Go outside'>>
		<<gt 'casino' 'outside'>>
	<</act>>
	<<act 'Go to the slot machines'>>
		<<gt 'casino' 'slots'>>
	<</act>>
	<<act 'Go to the roulette table'>>
		<<gt 'casino' 'roulette'>>
	<</act>>
	<<act 'Go to the card tables'>>
		<<gt 'casino' 'cards'>>
	<</act>>
<</if>>
<!-- !!------------>
<!-- !! Roulette-->
<!-- !!------------>
<<if $location_var[$here][0] == 'roulette'>>
	<<set $loc_arg = $location_var[$here][0]>>
	<<set $menu_arg = $location_var[$here][0]>>
	<<set $menu_off = 0>>
	<<set $time.minutes += 1>>
	<right><<image 'images/locations/city/industrial/casino/ruletka.jpg'>></right>
	You came to the table with American roulette.
	<<act 'Go back to the foyer'>>
		<<gt 'casino' 'foyer'>>
	<</act>>
	<<act 'Play roulette'>>
		<<gt 'casino' 'roulette_bet1'>>
	<</act>>
	<<actCLA 'Approach the croupier'>>
		<<set $menu_off = 1>>
		<<set $time.minutes += 1>>
		<right><<image 'images/locations/city/industrial/casino/crup.jpg'>></right>
		<p>"Can I help you?" He asks.</p>
		<<act 'Shake your head and move away'>>
			<<gt 'casino' 'roulette'>>
		<</act>>
		<<actCLA 'Ask rules'>>
			<<msg 'The rules are very simple.>>
			First you choose the amount you want to bet.
			<!-- FAILED TO CONVERT
				But in our casino maximum amount is 1000 <b>₽</b>.
			-----
				ERROR: FAILED TO CONVERT LITERAL: """But in our casino maximum amount is 1000 <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b>."""

			-->
			<<warn "CONVERSION ERROR d0426e5dcacf84c296508fa7d8feeb51">>
			<!-- FAILED TO CONVERT
				Then you choose where to put your chips. There are six different types of bets:
			-----
				ERROR: FAILED TO CONVERT LITERAL: """Then you choose where to put your chips. There are six different types of bets:"""

			-->
			<<warn "CONVERSION ERROR 3c1a3071b560c14141f415645835949b">>
			1. Red/Black (Payout: 1 to 1)
			2. Even/Odd (Payout: 1 to 1)
			3. Small/Large (Payout: 1 to 1)
			4. Dozen (Payout: 1 to 3)
			5. Series (Payout: 1 to 3)
			6. Number (Payout: 1 to 36)
			And the rest depends on your luck.'
			<<gt 'casino' 'roulette'>>
		<</actCLA>>
	<</actCLA>>
<</if>>
<<if $location_var[$here][0] == 'roulette_bet1'>>
	<<set $menu_off = 1>>
	<<set $time.minutes += 1>>
	<<set $kh = 0>>
	<<set $chnch = 0>>
	<<set $mb = 0>>
	<<set $du = 0>>
	<<set $series = 0>>
	<<set $chi = 100>>
	<<set $x_rul = 100>>
	<<image "locations/city/industrial/casino/amrul.jpg">>
	<p>The maximum amount you can bet is 1000 <b>₽</b>.</p>
	You lean over the table.
	<<act 'Move away from the table'>>
		<<gt 'casino' 'roulette'>>
	<</act>>
	<<actCLA 'Make a bet'>>
		<<set $st_1 = input 'Enter the amount'>>
		<<if $finances.cash < $st_1>>
			<<msg '<br>You don""t have enough money.'>>
			<<gt 'casino' 'roulette_bet1'>>
		<<elseif getvar("$st_1") <= 0>>
			<<msg '<br>You can""t bet zero or a negative amount.'>>
			<<gt 'casino' 'roulette_bet1'>>
		<<elseif getvar("$st_1") > 1000>>
			<<msg '<br>The maximum amount you can bet is 1000 <b>₽</b>'>>
			<<gt 'casino' 'roulette_bet1'>>
		<<else>>
			<<set $finances.cash -= $st_1>>
			<<gt 'casino' 'roulette_bet2'>>
		<</if>>
	<</actCLA>>
<</if>>
<<if $location_var[$here][0] == 'roulette_bet2'>>
	<<set $time.minutes += 1>>
	<<set $kh = 0>>
	<<set $chnch = 0>>
	<<set $mb = 0>>
	<<set $du = 0>>
	<<set $series = 0>>
	<<set $chi = 100>>
	<right><<image 'images/locations/city/industrial/casino/stavkaru.jpg'>></right>
	<p>Where do you put your chips?</p>
	<<actCLA 'Don`t bet'>>
		<<set $finances.cash += $st_1>>
		<<gt 'casino' 'roulette_bet1'>>
	<</actCLA>>
	<<actCLA 'Red / Black'>>
		<<act 'Reconsider'>>
			<<gt 'casino' 'roulette_bet2'>>
		<</act>>
		<<actCLA 'Red'>>
			<<set $kh = 1>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
		<<actCLA 'Black'>>
			<<set $kh = 2>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
	<</actCLA>>
	<<actCLA 'Even / Odd'>>
		<<act 'Reconsider'>>
			<<gt 'casino' 'roulette_bet2'>>
		<</act>>
		<<actCLA 'Even'>>
			<<set $chnch = 1>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
		<<actCLA 'Odd'>>
			<<set $chnch = 2>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
	<</actCLA>>
	<<actCLA 'Small / Large'>>
		<<act 'Reconsider'>>
			<<gt 'casino' 'roulette_bet2'>>
		<</act>>
		<<actCLA 'Small: 1-18'>>
			<<set $mb = 1>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
		<<actCLA 'Large: 19-36'>>
			<<set $mb = 2>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
	<</actCLA>>
	<<actCLA 'Dozen'>>
		<<act 'Reconsider'>>
			<<gt 'casino' 'roulette_bet2'>>
		<</act>>
		<<actCLA 'First dozen: 1-12'>>
			<<set $du = 1>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
		<<actCLA 'Second dozen: 13-24'>>
			<<set $du = 2>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
		<<actCLA 'Third dozen:25-36'>>
			<<set $du = 3>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
	<</actCLA>>
	<<actCLA 'Series'>>
		<<act 'Reconsider'>>
			<<gt 'casino' 'roulette_bet2'>>
		<</act>>
		<<actCLA 'First row: 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34'>>
			<<set $series = 1>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
		<<actCLA 'Second row: 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35'>>
			<<set $series = 2>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
		<<actCLA 'Third row: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36'>>
			<<set $series = 3>> <<gt 'casino' 'roulette_result'>>
		<</actCLA>>
	<</actCLA>>
	<<actCLA 'Number'>>
		<<act 'Reconsider'>>
			<<gt 'casino' 'roulette_bet2'>>
		<</act>>
		<<actCLA 'Choose a number'>>
			<<set $chi = input 'Enter a number from 0 - 36'>>
			<<if getvar("$chi") < 0 and getvar("$chi") > 36>>
				<<msg 'You need to choose a number between 0 and 36.'>>
				<<gt 'casino' 'roulette_bet2'>>
			<<else>>
				<<gt 'casino' 'roulette_result'>>
			<</if>>
		<</actCLA>>
	<</actCLA>>
<</if>>
<<if $location_var[$here][0] == 'roulette_result'>>
	<<set $time.minutes += 5>>
	<<set $x_rul = 100>>
	<<set $x_rul = rand(0, 36)>>
	<<if getvar("$x_rul") == 0>>
		<<set $color = ' '>>
	<<else>>
		<<if getvar("$x_rul") == 1 or getvar("$x_rul") == 3 or getvar("$x_rul") == 5 or getvar("$x_rul") == 7 or getvar("$x_rul") == 9 or getvar("$x_rul") == 12 or getvar("$x_rul") == 14 or getvar("$x_rul") == 16 or getvar("$x_rul") == 18 or getvar("$x_rul") == 19 or getvar("$x_rul") == 21 or getvar("$x_rul") == 23 or getvar("$x_rul") == 25 or getvar("$x_rul") == 27 or getvar("$x_rul") == 30 or getvar("$x_rul") == 32 or getvar("$x_rul") == 34 or getvar("$x_rul") == 36>>
			<<set $color = 'red'>>
		<<else>>
			<<set $color = 'black'>>
		<</if>>
	<</if>>
	<right><<image 'images/locations/city/industrial/casino/resul.jpg'>></right>
	<p>The ball stops at x_rul $color</p>
	<<if getvar("$kh") != 0>>
		<<if getvar("$kh") == 1>>
			<<if getvar("$x_rul") == 1 or getvar("$x_rul") == 3 or getvar("$x_rul") == 5 or getvar("$x_rul") == 7 or getvar("$x_rul") == 9 or getvar("$x_rul") == 12 or getvar("$x_rul") == 14 or getvar("$x_rul") == 16 or getvar("$x_rul") == 18 or getvar("$x_rul") == 19 or getvar("$x_rul") == 21 or getvar("$x_rul") == 23 or getvar("$x_rul") == 25 or getvar("$x_rul") == 27 or getvar("$x_rul") == 30 or getvar("$x_rul") == 32 or getvar("$x_rul") == 34 or getvar("$x_rul") == 36>>
				<<actCLA 'You have won 2 * st_1'>>
					<<set $finances.cash += 2 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<<elseif getvar("$kh") == 2>>
			<<if getvar("$x_rul") == 2 or getvar("$x_rul") == 4 or getvar("$x_rul") == 6 or getvar("$x_rul") == 8 or getvar("$x_rul") == 10 or getvar("$x_rul") == 11 or getvar("$x_rul") == 13 or getvar("$x_rul") == 15 or getvar("$x_rul") == 17 or getvar("$x_rul") == 20 or getvar("$x_rul") == 22 or getvar("$x_rul") == 24 or getvar("$x_rul") == 26 or getvar("$x_rul") == 28 or getvar("$x_rul") == 29 or getvar("$x_rul") == 31 or getvar("$x_rul") == 33 or getvar("$x_rul") == 35>>
				<<actCLA 'You have won 2 * st_1'>>
					<<set $finances.cash += 2 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<</if>>
	<<elseif getvar("$chnch") != 0>>
		<<if getvar("$chnch") == 1>>
			<<set $chnch = 0>>
			<<if $x_rul % 2 == 0>>
				<<actCLA 'You have won 2 * st_1'>>
					<<set $finances.cash += 2 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<<elseif getvar("$chnch") == 2>>
			<<set $chnch = 0>>
			<<if $x_rul % 2 == 1>>
				<<actCLA 'You have won 2 * st_1'>>
					<<set $finances.cash += 2 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<</if>>
	<<elseif getvar("$mb") != 0>>
		<<if getvar("$mb") == 1>>
			<<set $mb = 0>>
			<<if getvar("$x_rul") > 0 and getvar("$x_rul") < 19>>
				<<actCLA 'You have won 2 * st_1'>>
					<<set $finances.cash += 2 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<<elseif getvar("$mb") == 2>>
			<<set $mb = 0>>
			<<if getvar("$x_rul") > 18 and getvar("$x_rul") < 37>>
				<<actCLA 'You have won 2 * st_1'>>
					<<set $finances.cash += 2 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<</if>>
	<<elseif getvar("$du") != 0>>
		<<if getvar("$du") == 1>>
			<<set $du = 0>>
			<<if getvar("$x_rul") > 0 and getvar("$x_rul") < 13>>
				<<actCLA 'You have won 3 * st_1'>>
					<<set $finances.cash += 3 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<<elseif getvar("$du") == 2>>
			<<set $du = 0>>
			<<if getvar("$x_rul") > 12 and getvar("$x_rul") < 25>>
				<<actCLA 'You have won 3 * st_1'>>
					<<set $finances.cash += 3 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<<elseif getvar("$du") == 3>>
			<<set $du = 0>>
			<<if getvar("$x_rul") > 24 and getvar("$x_rul") < 37>>
				<<actCLA 'You have won 3 * st_1'>>
					<<set $finances.cash += 3 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<</if>>
	<<elseif getvar("$series") != 0>>
		<<if getvar("$series") == 1>>
			<<set $series = 0>>
			<<if getvar("$x_rul") == 1 or getvar("$x_rul") == 4 or getvar("$x_rul") == 7 or getvar("$x_rul") == 10 or getvar("$x_rul") == 13 or getvar("$x_rul") == 16 or getvar("$x_rul") == 19 or getvar("$x_rul") == 22 or getvar("$x_rul") == 25 or getvar("$x_rul") == 28 or getvar("$x_rul") == 31 or getvar("$x_rul") == 34>>
				<<actCLA 'You have won 3*st_1'>>
					<<set $finances.cash += 3 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<<elseif getvar("$series") == 2>>
			<<set $series = 0>>
			<<if getvar("$x_rul") == 2 or getvar("$x_rul") == 3 or getvar("$x_rul") == 8 or getvar("$x_rul") == 11 or getvar("$x_rul") == 14 or getvar("$x_rul") == 17 or getvar("$x_rul") == 20 or getvar("$x_rul") == 23 or getvar("$x_rul") == 26 or getvar("$x_rul") == 29 or getvar("$x_rul") == 32 or getvar("$x_rul") == 35>>
				<<actCLA 'You have won 3*st_1'>>
					<<set $finances.cash += 3 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<<elseif getvar("$series") == 3>>
			<<set $series = 0>>
			<<if getvar("$x_rul") == 3 or getvar("$x_rul") == 4 or getvar("$x_rul") == 9 or getvar("$x_rul") == 12 or getvar("$x_rul") == 15 or getvar("$x_rul") == 18 or getvar("$x_rul") == 21 or getvar("$x_rul") == 24 or getvar("$x_rul") == 27 or getvar("$x_rul") == 30 or getvar("$x_rul") == 33 or getvar("$x_rul") == 36>>
				<<actCLA 'You have won 3*st_1'>>
					<<set $finances.cash += 3 * $st_1>>
					<<gt 'casino' 'roulette_bet1'>>
				<</actCLA>>
			<<else>>
				<<act 'You have lost'>>
					<<gt 'casino' 'roulette_bet1'>>
				<</act>>
			<</if>>
		<</if>>
	<<elseif getvar("$chi") != 100>>
		<<if $chi == $x_rul>>
			<<actCLA 'You have won 37 * st_1'>>
				<<set $finances.cash += 37 * $st_1>>
				<<gt 'casino' 'roulette_bet1'>>
			<</actCLA>>
		<<else>>
			<<act 'You have lost'>>
				<<gt 'casino' 'roulette_bet1'>>
			<</act>>
		<</if>>
	<</if>>
<</if>>
<!-- !!--------->
<!-- !! Slots-->
<!-- !!--------->
<<if $location_var[$here][0] == 'slots'>>
	<<set $loc_arg = $location_var[$here][0]>>
	<<set $menu_arg = $location_var[$here][0]>>
	<<set $menu_off = 0>>
	<<set $time.minutes += 1>>
	<right><<image 'images/locations/city/industrial/casino/zaligravt.jpg'>></right>
	You enter the hall and are momentarily dazzled by the multitude of ringing sounds and blinking lights coming from endless rows of slot machines. In front of them you see people of various ages, sexes and backgrounds, trying their luck or perhaps just killing time.
	Every once in a while you hear the satisfying sound of coins streaming into the tray of the next lucky winner.
	According to the huge animated digital display on the back wall, there is a hefty jackpot up for grabs.
	<<act 'Go to the foyer'>>
		<<gt 'casino' 'foyer'>>
	<</act>>
	<<actCLA 'Use one of the slot machines'>>
		<<set $menu_off = 1>>
		<<set $time.minutes += 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 foyer'>>
			<<gt 'casino' 'foyer'>>
		<</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 'You have lost. Try again?'>>
				<</if>>
				<<set $time.minutes += 1>>
				<<gt 'casino' 'slots'>>
			<<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 'casino' 'slots'>>
			<</if>>
			<<set $slotsRand to null>>
			<<set $winnings to null>>
		<</actCLA>>
	<</actCLA>>
<</if>>
<!-- !!--------->
<!-- !! Cards-->
<!-- !!--------->
<<if $location_var[$here][0] == 'cards'>>
	<<set $loc_arg = $location_var[$here][0]>>
	<<set $menu_arg = $location_var[$here][0]>>
	<<set $menu_off = 0>>
	<<set $time.minutes += 1>>
	<right><<image 'images/locations/city/industrial/casino/zalcart.jpg'>></right>
	In the hall a lot of free games tables in Blackjack and Casino Wars.
	<<act 'Go back to the foyer'>>
		<<gt 'casino' 'foyer'>>
	<</act>>
	<<act 'Play Blackjack'>>
		<<gt 'casino' 'blackjack_play'>>
	<</act>>
	<<act 'Play Casino War'>>
		<<gt 'casino' 'cards_cw'>>
	<</act>>
	<!-- !!SYMBOLS-->
	<!-- !! ♥-->
	<!-- !! ♠-->
	<!-- !! ♦-->
	<!-- !! ♣-->
	<!-- !!deck of cards-->
	<<setinit $suit[1] = 'Spades'>>
	<<setinit $symbol[1] = '♠'>>
	<<setinit $suit[2] = 'Clubs'>>
	<<setinit $symbol[2] = '♣'>>
	<<setinit $suit[3] = 'Hearts'>>
	<<setinit $symbol[3] = '♥'>>
	<<setinit $suit[4] = 'Diamonds'>>
	<<setinit $symbol[4] = '♦'>>
	<<setinit $number[1] = 'Ace '>>
	<<setinit $points[1] = 11>>
	<<setinit $number[2] = 'Deuce '>>
	<<setinit $points[2] = 2>>
	<<setinit $number[3] = 'Three '>>
	<<setinit $points[3] = 3>>
	<<setinit $number[4] = 'Four '>>
	<<setinit $points[4] = 4>>
	<<setinit $number[5] = 'Five '>>
	<<setinit $points[5] = 5>>
	<<setinit $number[6] = 'Six '>>
	<<setinit $points[6] = 6>>
	<<setinit $number[7] = 'Seven '>>
	<<setinit $points[7] = 7>>
	<<setinit $number[8] = 'Eight '>>
	<<setinit $points[8] = 8>>
	<<setinit $number[9] = 'Nine '>>
	<<setinit $points[9] = 9>>
	<<setinit $number[10] = 'Ten '>>
	<<setinit $points[10] = 10>>
	<<setinit $number[11] = 'Jack '>>
	<<setinit $points[11] = 10>>
	<<setinit $number[12] = 'Queen '>>
	<<setinit $points[12] = 10>>
	<<setinit $number[13] = 'King '>>
	<<setinit $points[13] = 10>>
	<<setinit $number[14] = 'Ace '>>
	<<setinit $points[14] = 11>>
<</if>>
<!-- !!---------------------->
<!-- !! Cards: Casino Wars-->
<!-- !!---------------------->
<<if $location_var[$here][0] == 'cards_cw'>>
	<<set $loc_arg = $location_var[$here][0]>>
	<<set $menu_arg = $location_var[$here][0]>>
	<<set $menu_off = 0>>
	<<set $time.minutes += 1>>
	<right><<image 'images/locations/city/industrial/casino/stolcw.jpg'>></right>
	You approach the gambling table at the casino.
	<<act 'Move away from the table'>>
		<<gt 'casino' 'cards'>>
	<</act>>
	<<act 'Sit down at the table'>>
		<<gt 'casino' 'cards_cwplay'>>
	<</act>>
	<<actCLA 'Approach the croupier'>>
		<<set $menu_off = 1>>
		<<set $time.minutes += 1>>
		<right><<image 'images/locations/city/industrial/casino/crupcw.jpg'>></right>
		<p>"How can I help you?"</p>
		<<act 'Move away from the dealer'>>
			<<gt 'casino' 'cards_cw'>>
		<</act>>
		<<actCLA 'Ask for the rules'>>
			<<msg 'The rules are very simple.>>
			First you choose how much you want to wager.
			<!-- FAILED TO CONVERT
				But note that in our casino maximum rate is 1000 <b>₽</b>.
			-----
				ERROR: FAILED TO CONVERT LITERAL: """But note that in our casino maximum rate is 1000 <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b>."""

			-->
			<<warn "CONVERSION ERROR 8d5b7453b83a575e2be4797113185d0b">>
			After that , you can either continue with your bet , or bet on a draw (which costs your bet a second time) , for a larger payout.
			<!-- FAILED TO CONVERT
				Regular:
			-----
				ERROR: FAILED TO CONVERT LITERAL: """Regular:"""

			-->
			<<warn "CONVERSION ERROR 59f8565c122162a329a36d7179d92e58">>
			Everyone is dealt a card. Face cards have different values.
			Highest card wins. Payout is 1 to 1.
			If both have the same card , choose between continuing (doubles bet) , or end the round and return your bet.
			If you win the second round you get a payout of 2 to 1. If it is another draw you get a payout of 1.5 to 1.
			<!-- FAILED TO CONVERT
				Bet on draw:
			-----
				ERROR: FAILED TO CONVERT LITERAL: """Bet on draw:"""

			-->
			<<warn "CONVERSION ERROR 3120e08f4dd99eb4e5f47cea72d66246">>
			When betting on a draw and winning , you get your bet back.
			$However , if it is a draw , the payout will be 10 to 1.
			That's it. Enjoy the game.'
			<<gt 'casino' 'cards_cw'>>
		<</actCLA>>
	<</actCLA>>
<</if>>
<<if $location_var[$here][0] == 'cards_cwplay'>>
	<<set $menu_off = 1>>
	<<set $time.minutes += 1>>
	<<if getvar("$turn1") == 0>>
		<right><<image 'images/locations/city/industrial/casino/stavkacw.jpg'>></right>
		Place your bets, ladies and gentlemen.
		<<act 'Leave the table'>>
			<<gt 'casino' 'cards_cw'>>
		<</act>>
		<<actCLA 'Place your bet'>>
			<<if $finances.cash < 1>>
				<p>You don't have any money!</p>
				<<act 'Leave the table'>>
					<<gt 'casino' 'cards_cw'>>
				<</act>>
			<</if>>
			<<set $bet_amount = input 'Enter the amount to bet'>>
			<<if $finances.cash < $bet_amount>>
				<<msg 'You don""t have enough money to bet that much'>>
			<<elseif getvar("$bet_amount") < 1>>
				<<msg 'You must place a minimum bet of 1 <b>₽</b>.'>>
			<<elseif getvar("$bet_amount") > 1000>>
				<<msg 'The maximum bet allowed is 1000 <b>₽</b>.'>>
			<<else>>
				<<set $finances.cash -= $bet_amount>>
				<<set $turn1 = 1>>
			<</if>>
			<<gt 'casino' 'cards_cwplay'>>
		<</actCLA>>
	<</if>>
	<<if getvar("$turn1") == 1>>
		<<set $bet_draw = 0>>
		<right><<image 'images/locations/city/industrial/casino/stavkacw.jpg'>></right>
		<p>Continue with regular bet (payout 2 to 1), or bet on a draw (payout 11 to 1)?</p>
		<<if $finances.cash < $bet_amount>>
			<<set $turn1 = 2>>
			<<gt 'casino' 'cards_cwplay'>>
		<<else>>
			<<actCLA 'Continue with regular bet'>>
				<<set $turn1 = 2>>
				<<gt 'casino' 'cards_cwplay'>>
			<</actCLA>>
			<<actCLA 'Bet on draw (doubles bet)'>>
				<<set $turn1 = 2>>
				<<set $bet_draw = 1>>
				<<set $finances.cash -= $bet_amount>>
				<<gt 'casino' 'cards_cwplay'>>
			<</actCLA>>
		<</if>>
	<</if>>
	<<if getvar("$turn1") == 2>>
		<right><<image 'images/locations/city/industrial/casino/cartcw.jpg'>></right>
		 The dealer deals the cards:
		...
		<<set $suit = rand(1, 4)>>
		<<set $number = rand(1, 13)>>
		<<setinit $d_card[1] = $number[$number] + 'of ' + $suit[$suit]>>
		<<set $d_points = $number>>
		<<set $suit = rand(1, 4)>>
		<!-- !! Player draws from cards 2-14 so that they win if both they and the dealer draw an ace-->
		<<set $number = rand(2, 14)>>
		<<setinit $p_card[1] = $number[$number] + 'of ' + $suit[$suit]>>
		<<set $p_points = $number>>
		<<wait 1000>>
		Dealer''s Card:
		<p>  $d_card[1]</p>
		__________________________
		Your Card:
		<p>  $p_card[1]</p>
		<<if $d_points > $p_points>>
			Casino won
			<<actCLA 'You lost'>>
				<<set $turn1 = 0>>
				<<gt 'casino' 'cards_cwplay'>>
			<</actCLA>>
		<<elseif $d_points < $p_points>>
			You won
			<<actCLA 'Take money (2 * bet_amount <b>₽</b>)'>>
				<<set $finances.cash += 2 * $bet_amount>>
				<<set $turn1 = 0>>
				<<gt 'casino' 'cards_cwplay'>>
			<</actCLA>>
		<<else>>
			<<if getvar("$bet_draw") == 1>>
				You won
				<<actCLA 'Take money (11 * bet_amount <b>₽</b>)'>>
					<<set $finances.cash += 11 * $bet_amount>>
					<<set $turn1 = 0>>
					<<gt 'casino' 'cards_cwplay'>>
				<</actCLA>>
			<<else>>
				<<set $turn1 = 3>>
				<<gt 'casino' 'cards_cwplay'>>
			<</if>>
		<</if>>
	<</if>>
	<<if getvar("$turn1") == 3>>
		<right><<image 'images/locations/city/industrial/casino/cartcw.jpg'>></right>
		Draw
		<<if $finances.cash >= $bet_amount>>
			<<actCLA 'Continue (bet another bet_amount <b>₽</b>)'>>
				<<set $finances.cash -= $bet_amount>>
				 The dealer deals the cards:
				...
				<<set $suit = rand(1, 4)>>
				<<set $number = rand(1, 13)>>
				<<setinit $d_card[2] = $number[$number] + 'of ' + $suit[$suit]>>
				<<set $d_points = $number>>
				<<set $suit = rand(1, 4)>>
				<<set $number = rand(2, 14)>>
				<<setinit $p_card[2] = $number[$number] + 'of ' + $suit[$suit]>>
				<<set $p_points = $number>>
				Dealer''s Cards:
				<p>  $d_card[1]</p>
				<p>  $d_card[2]</p>
				__________________________
				Your Cards:
				<p>  $p_card[1]</p>
				<p>  $p_card[2]</p>
				<<if $d_points > $p_points>>
					Casino won
					<<actCLA 'You lost'>>
						<<set $turn1 = 0>>
						<<gt 'casino' 'cards_cwplay'>>
					<</actCLA>>
				<<elseif $d_points < $p_points>>
					You won
					<<actCLA 'Take money (4 * bet_amount <b>₽</b>)'>>
						<<set $finances.cash += 4 * $bet_amount>>
						<<set $turn1 = 0>>
						<<gt 'casino' 'cards_cwplay'>>
					<</actCLA>>
				<<elseif $d_points == $p_points>>
					Draw
					<<actCLA 'Take money (3 * bet_amount <b>₽</b>)'>>
						<<set $finances.cash += 3 * $bet_amount>>
						<<set $turn1 = 0>>
						<<gt 'casino' 'cards_cwplay'>>
					<</actCLA>>
				<</if>>
			<</actCLA>>
		<<else>>
			You don't have enough money to continue
		<</if>>
		<<actCLA 'Take original bet (bet_amount <b>₽</b>)'>>
			<<set $finances.cash += $bet_amount>>
			<<set $turn1 = 0>>
			<<gt 'casino' 'cards_cwplay'>>
		<</actCLA>>
	<</if>>
<</if>>
<!-- !!---------------------->
<!-- !! Cards: Blackjack-->
<!-- !!---------------------->
<<if $location_var[$here][0] == 'blackjack_play'>>
	<<set $menu_off = 1>>
	<<set $time.minutes += 1>>
	<<set $dealerHand to null>>
	<<set $playerHand to null>>
	<<set $playerBets to null>>
	<<set $playerPoints to null>>
	<<setinitpush "$dealerHand" 0>>
	<<setinitpush "$dealerHand" 1>>
	<<setinitpush "$playerHand" 2>>
	<<setinitpush "$playerHand" 3>>
	<<set $cardsDealt = 4>>
	<<set $numHands = 1>>
	<<set $currentHand = 0>>
	<<set $handLosses = 0>>
	<<set $numAces = 0>>
	<<set $dealerPoints = 0>>
	<<set $insurance = 0>>
	<<set $betTotal = 0>>
	<<set $doubleBet = 0>>
	<<set $minBet = 10>>
	<<set $maxBet = 500>>
	<<gs 'deckShuffle' 'sort'>>
	<!-- FAILED TO CONVERT
		*pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/stolbd.jpg"></center>'
	-----
		<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<center><img $set_imgh src""" = "images / $locations / $city / $industrial / $casino / ERROR: FAILED TO CONVERT LITERAL: """stolbd.jpg"><""" / ERROR: FAILED TO CONVERT LITERAL: """center>'""">>

	-->
	<<warn "CONVERSION ERROR 171d521c8c9468e70497b0d6665ea383">>
	 * pl 'You are sitting at the blackjack table.'
	<<act 'Move away from the table'>>
		<<gt 'casino' 'cards'>>
	<</act>>
	<<act 'Play blackjack'>>
		<<gt 'casino' 'bet1'>>
	<</act>>
	<<act 'Ask for the rules'>>
		<<gt 'casino' 'rules'>>
	<</act>>
<</if>>
<<if $location_var[$here][0] == 'rules'>>
	<!-- FAILED TO CONVERT
		*pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/crupbd.jpg"></center>'
	-----
		<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<center><img $set_imgh src""" = "images / $locations / $city / $industrial / $casino / ERROR: FAILED TO CONVERT LITERAL: """crupbd.jpg"><""" / ERROR: FAILED TO CONVERT LITERAL: """center>'""">>

	-->
	<<warn "CONVERSION ERROR dc29ed1ace573d076d23e478d8141bf9">>
	<!-- FAILED TO CONVERT
		*pl '<h2><u>Blackjack Rules:</u></h2>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """pl '<h2><u>Blackjack Rules:<""" / ERROR: FAILED TO CONVERT LITERAL: """u><""" / ERROR: FAILED TO CONVERT LITERAL: """h2>'"""

	-->
	<<warn "CONVERSION ERROR ee1ce9b4767800fdb7ebbc110dbc85cd">>
	<!-- FAILED TO CONVERT
		*p '<ol><li>The player and dealer are each dealt 2 cards after initial bets (<<minBet>> <b>₽</b> - <<maxBet>> <b>₽</b>). The dealer will have 1 face-up card and 1 face-down card.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<ol><li>The player and dealer are each dealt 2 cards after initial bets (<<minBet>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b>""" - ERROR: FAILED TO CONVERT LITERAL: """<<maxBet>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b>). The dealer will have 1 face""" - up card and 1 face - ERROR: FAILED TO CONVERT LITERAL: """down card.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR 0abce28e0ed88c3df349b8a08adc8320">>
	<!-- FAILED TO CONVERT
		*p '<li>Face cards are worth 10 points, aces can double as either 11 or 1, and all other cards are worth their numeric value.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<li>Face cards are worth 10 points""" , aces can double as either 11 or 1 , ERROR: FAILED TO CONVERT LITERAL: """and all other cards are worth their numeric value.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR db2b73ba58e5ac409b60fb5c8576a803">>
	<!-- FAILED TO CONVERT
		*p '<li>After the player finishes drawing, the dealer must continue to draw until he has 17 points or more.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<li>After the player finishes drawing""" , ERROR: FAILED TO CONVERT LITERAL: """the dealer must continue to draw until he has 17 points or more.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR ae3a3d9c5e7ccd46224b43043b9d8c0e">>
	<!-- FAILED TO CONVERT
		*p '<li>To win, the player must score more points than the dealer, have the dealer bust, or get a blackjack.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<li>To win""" , the player must score more points than the dealer , have the dealer bust , ERROR: FAILED TO CONVERT LITERAL: """or get a blackjack.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR d0a6a1493dae01d70b1ddae521e90e22">>
	<!-- FAILED TO CONVERT
		*p '<li>Getting over 21 points is known as a bust, and an automatic loss.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<li>Getting over 21 points is known as a bust""" , ERROR: FAILED TO CONVERT LITERAL: """and an automatic loss.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR e290fcfe049bd84269ba201ee78c99f8">>
	<!-- FAILED TO CONVERT
		*p '<li>Getting an ace and a 10 point card in the first 2 cards is known as a blackjack, and is an automatic win which pays 3 : 2.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<li>Getting an ace and a 10 point card in the first 2 cards is known as a blackjack""" , ERROR: FAILED TO CONVERT LITERAL: """and is an automatic win which pays 3 : 2.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR e8ff88fee75a8f3920f0166d24979313">>
	<!-- FAILED TO CONVERT
		*p '<li>If the dealer''s face-up card is an ace, the player can make a side-bet called "insurance" that pays 2 : 1 if the dealer has a blackjack.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<li>If the dealer''s face""" - up card is an ace , the player can make a side - ERROR: FAILED TO CONVERT LITERAL: """bet called "insurance" that pays 2 : 1 if the dealer has a blackjack.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR 0eecf76fdb8dd0a927ba078c22fe41c4">>
	<!-- FAILED TO CONVERT
		*p '<li>At any time, the player can choose to double his/her bet, which gives the player 1 more card but prevents further draws on that hand.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<li>At any time""" , the player can choose to double his / her bet , ERROR: FAILED TO CONVERT LITERAL: """which gives the player 1 more card but prevents further draws on that hand.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR 357a2c8eafc40a9df312001b0d915b24">>
	<!-- FAILED TO CONVERT
		*p '<li>If the player''s hand only consists of two cards of equal value, he/she can split them into 2 hands. Each hand must be covered by an amount equal to the original bet.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<li>If the player''s hand only consists of two cards of equal value""" , $he / ERROR: FAILED TO CONVERT LITERAL: """she can split them into 2 hands. Each hand must be covered by an amount equal to the original bet.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR e82f4a36b4d3a32844a2c749a25868f6">>
	<!-- FAILED TO CONVERT
		*p '<li>The player cannot score a blackjack using a split hand.</li>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """p '<li>The player cannot score a blackjack using a split hand.<""" / ERROR: FAILED TO CONVERT LITERAL: """li>'"""

	-->
	<<warn "CONVERSION ERROR a83b33e3b82ab683831094f001b0dc8b">>
	<<act 'Return'>>
		<<gt 'casino' 'blackjack_play'>>
	<</act>>
<</if>>
<<if $location_var[$here][0] == 'bet1'>>
	<!-- FAILED TO CONVERT
		*pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/stavkabd.jpg"></center>'
	-----
		<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<center><img $set_imgh src""" = "images / $locations / $city / $industrial / $casino / ERROR: FAILED TO CONVERT LITERAL: """stavkabd.jpg"><""" / ERROR: FAILED TO CONVERT LITERAL: """center>'""">>

	-->
	<<warn "CONVERSION ERROR fce3ff49403d960f6de244410e280246">>
	<<setinit $playerBets[0] = input('Place your bet.')>>
	<<if $finances.cash < $playerBets[0]>>
		<<msg 'You don""t have enough money for that bet.'>>
		<<gt 'casino' 'blackjack_play'>>
	<<elseif $playerBets[0] < $minBet>>
		<<msg 'There is a minimum bet of <<minBet>> <b>₽</b>.'>>
		<<gt 'casino' 'blackjack_play'>>
	<<elseif $playerBets[0] > $maxBet>>
		<<msg 'There is a maximum bet of <<maxBet>> <b>₽</b>.'>>
		<<gt 'casino' 'blackjack_play'>>
	<<else>>
		<<gt 'casino' 'bet2'>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'bet2'>>
	<<set $betTotal = $playerBets[0]>>
	<<gs 'deckShuffle' 'shuffle'>>
	<<if ($deckFace[$playerHand[0]] == 1 and $deckFace[$playerHand[1]] > 9) or ($deckFace[$playerHand[0]] > 9 and $deckFace[$playerHand[1]] == 1)>>
		<<gt 'casino' 'blackjack'>>
	<<elseif $deckFace[$dealerHand[0]] > 9 and $deckFace[$dealerHand[1]] == 1>>
		<<gt 'casino' 'blackjack'>>
	<<elseif $deckFace[$dealerCards[0]] == 1>>
		<<gt 'casino' 'insurance1'>>
	<<else>>
		<<gt 'casino' 'player'>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'blackjack'>>
	<<gs 'casino' 'blackjack_view' 1>>
	<<if $playerPoints[0] == 21 and getvar("$dealerPoints") == 21>>
		 * pl 'DRAW GAME'
		 * pl 'You retrieve your bet.'
	<<elseif $playerPoints[0] == 21>>
		 * pl 'PLAYER WINS'
		<!-- FAILED TO CONVERT
			*pl 'You receive <<playerBets[0] * 3 / 2>> <b>₽</b> in winnings.'
		-----
			 * ERROR: FAILED TO CONVERT LITERAL: """pl 'You receive <<playerBets[0]""" * 3 / ERROR: FAILED TO CONVERT LITERAL: """2>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b> in winnings.'"""

		-->
		<<warn "CONVERSION ERROR 90327f9974aa5811cc97d698dd617fe0">>
		<<set $finances.cash += $playerBets[0] * 3 / 2>>
	<<else>>
		 * pl 'DEALER WINS'
		<!-- FAILED TO CONVERT
			*pl 'The dealer takes your <<playerBets[0]>> <b>₽</b> bet.'
		-----
			 * ERROR: FAILED TO CONVERT LITERAL: """pl 'The dealer takes your <<playerBets[0]>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b> bet.'"""

		-->
		<<warn "CONVERSION ERROR 3bc396d987aa505ee1680ceb87e0617c">>
		<<set $finances.cash -= $playerBets[0]>>
	<</if>>
	<<act 'Continue'>>
		<<gt 'casino' 'blackjack_play'>>
	<</act>>
<</if>>
<<if $location_var[$here][0] == 'insurance1'>>
	<<gs 'casino' 'blackjack_view'>>
	 * pl 'The dealer has an ace showing.  Would you like to place a bet for insurance?'
	<<set $insurance = 0>>
	<<actCLA 'Bet insurance'>>
		<<set $insurance = input('Place your bet.')>>
		<<if $finances.cash < $insurance>>
			<<msg 'You don""t have enough money for that bet.'>>
			<<gt 'casino' 'insurance1'>>
		<<elseif getvar("$insurance") < 0>>
			<<msg 'You cannot bet a negative amount of money.'>>
			<<gt 'casino' 'insurance1'>>
		<<elseif $insurance > $playerBets[0] / 2>>
			<<msg 'Insurance cannot exceed half the original bet.'>>
			<<gt 'casino' 'insurance1'>>
		<<else>>
			<<gt 'casino' 'insurance2'>>
		<</if>>
	<</actCLA>>
	<<act 'No insurance'>>
		<<gt 'casino' 'insurance2'>>
	<</act>>
<</if>>
<<if $location_var[$here][0] == 'insurance2'>>
	<<if $deckFace[$dealerCards[1]] > 9>>
		<<gs 'casino' 'blackjack_view' 1>>

	<</if>>
	<<if $deckFace[$dealerCards[1]] < 10>>
		<<gs 'casino' 'blackjack_view'>>

	<</if>>
	<<if getvar("$dealerPoints") == 21>>
		 * pl 'DEALER WINS'
		<!-- FAILED TO CONVERT
			*p 'The dealer takes your <<playerBets[0]>> <b>₽</b> bet'
		-----
			 * ERROR: FAILED TO CONVERT LITERAL: """p 'The dealer takes your <<playerBets[0]>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b> bet'"""

		-->
		<<warn "CONVERSION ERROR 5014b25b0f24327138bcc314f579578a">>
		<!-- FAILED TO CONVERT
			if insurance > 0: *p ' but also gives you <<insurance>> <b>₽</b> for your side bet'
		-----
			<<if getvar("$insurance") > 0>>
			<!-- FAILED TO CONVERT
	*p ' but also gives you <<insurance>> <b>₽</b> for your side bet'
-----
	 * ERROR: FAILED TO CONVERT LITERAL: """p ' but also gives you <<insurance>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b> for your side bet'"""

-->
<<warn "CONVERSION ERROR 7c8e1c290fd3c410bfa31338b3392759">>

		<</if>>

		-->
		<<warn "CONVERSION ERROR 3c544625d70bbd642394bce3bd68ab33">>
		 * p '.'
		<<set $finances.cash -= $playerBets[0]>>
		<<set $finances.cash += $insurance>>
		<<act 'Continue'>>
			<<gt 'casino' 'blackjack_play'>>
		<</act>>
	<<else>>
		<!-- FAILED TO CONVERT
			*pl 'The dealer takes a peek at his hole card; no blackjack.'
		-----
			 * ERROR: FAILED TO CONVERT LITERAL: """pl 'The dealer takes a peek at his hole card; no blackjack.'"""

		-->
		<<warn "CONVERSION ERROR b78f3a9bdd9ba805b9cb997889009bf5">>
		<!-- FAILED TO CONVERT
			if insurance > 0: *p 'He relieves you of <<insurance>> <b>₽</b> for your side bet.'
		-----
			<<if getvar("$insurance") > 0>>
			<!-- FAILED TO CONVERT
	*p 'He relieves you of <<insurance>> <b>₽</b> for your side bet.'
-----
	 * ERROR: FAILED TO CONVERT LITERAL: """p 'He relieves you of <<insurance>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b> for your side bet.'"""

-->
<<warn "CONVERSION ERROR 98b6553550d8925910a433989659d868">>

		<</if>>

		-->
		<<warn "CONVERSION ERROR 6d05d87cf90fb9a1941b18782598e1fb">>
		<<set $finances.cash -= $insurance>>
		<<act 'Continue'>>
			<<gt 'casino' 'player'>>
		<</act>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'player'>>
	<<gs 'casino' 'blackjack_view'>>
	<<if getvar("$playerPoints["+$currentHand+"]") > 21>>
		<<setn $currentHand += 1>> <<setn $handLosses += 1>> <<set $doubleBet = 0>>

	<</if>>
	<<if getvar("$playerPoints["+$currentHand+"]") == 21 or getvar("$doubleBet") == 1>>
		<<setn $currentHand += 1>> <<set $doubleBet = 0>>

	<</if>>
	<<if $handLosses == $numHands>>
		 * pl 'DEALER WINS'
		<!-- FAILED TO CONVERT
			*p 'The dealer relieves you of <<betTotal>> <b>₽</b>.'
		-----
			 * ERROR: FAILED TO CONVERT LITERAL: """p 'The dealer relieves you of <<betTotal>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b>.'"""

		-->
		<<warn "CONVERSION ERROR 392318e92e7c6b589d9095e0f1d33577">>
		<<set $finances.cash -= $betTotal>>
		<<act 'Continue'>>
			<<gt 'casino' 'blackjack_play'>>
		<</act>>
	<<elseif $currentHand >= $numHands>>
		 * pl 'You can take no further actions.'
		<<act 'Continue'>>
			<<gt 'casino' 'dealer'>>
		<</act>>
	<<else>>
		<<if getvar("$numHands") == 1>>
			 * pl 'You are considering actions for your hand.'
			<<set $text = ''>>
		<<else>>
			<!-- FAILED TO CONVERT
				*pl 'You are considering your actions for <b>hand #<<currentHand + 1>></b>.'
			-----
				 * ERROR: FAILED TO CONVERT LITERAL: """pl 'You are considering your actions for <b>hand #<<currentHand""" + ERROR: FAILED TO CONVERT LITERAL: """1>><""" / ERROR: FAILED TO CONVERT LITERAL: """b>.'"""

			-->
			<<warn "CONVERSION ERROR 5be0914f2e28a047b3cccf306f9836e4">>
			<<set $text = 'Hand #currentHand + 1: '>>
		<</if>>
		<<actCLA '$textHit'>>
			<<set $i = $currentHand * 16 + 2>>
			<<warn 'JUMP MARKER ENCOUNTERED: :loop1'>>
			<<if getvar("$playerHand["+$i+"]") != 0>>
				<<setn $i += 1>> 

			<</if>>
			<<setinit $playerHand[$i] = $cardsDealt>>
			<<set $cardsDealt += 1>>
			<!-- FAILED TO CONVERT
				*pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
			-----
				<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<center><img $set_imgh src""" = "images / $locations / $city / $industrial / $casino / ERROR: FAILED TO CONVERT LITERAL: """cartbde.jpg"><""" / ERROR: FAILED TO CONVERT LITERAL: """center>'""">>

			-->
			<<warn "CONVERSION ERROR f6abb7e00b3aff46a3bcdff1c0441ac0">>
			<<gt 'casino' 'player'>>
		<</actCLA>>
		<<if $finances.cash >= $betTotal + $playerBets[$currentHand]>>
			<<actCLA '$textDouble'>>
				<<set $doubleBet = 1>>
				<<set $betTotal += $playerBets[$currentHand]>>
				<<setinit $playerBets[$currentHand] += $playerBets[$currentHand]>>
				<<set $i = $currentHand * 16 + 2>>
				<<warn 'JUMP MARKER ENCOUNTERED: :loop2'>>
				<<if getvar("$playerHand["+$i+"]") != 0>>
					<<setn $i += 1>> 

				<</if>>
				<<setinit $playerHand[$i] = $cardsDealt>>
				<<set $cardsDealt += 1>>
				<!-- FAILED TO CONVERT
					*pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
				-----
					<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<center><img $set_imgh src""" = "images / $locations / $city / $industrial / $casino / ERROR: FAILED TO CONVERT LITERAL: """cartbde.jpg"><""" / ERROR: FAILED TO CONVERT LITERAL: """center>'""">>

				-->
				<<warn "CONVERSION ERROR f6abb7e00b3aff46a3bcdff1c0441ac0">>
				<<gt 'casino' 'player'>>
			<</actCLA>>
			<<if $playerHand[$currentHand * 16 + 2] == 0 and (($deckFace[$playerHand[$currentHand * 16]] > 9 and $deckFace[$playerHand[$currentHand * 16 + 1]] > 9) or $deckFace[$playerHand[$currentHand * 16]] == $deckFace[$playerHand[$currentHand * 16 + 1]])>>
				<<actCLA '$textSplit'>>
					<<set $betTotal += $playerBets[$currentHand]>>
					<<setinit $playerBets[$numHands] = $playerBets[$currentHand]>>
					<<set $numHands += 1>>
					<<set $i = ($currentHand + 1) * 16>>
					<<warn 'JUMP MARKER ENCOUNTERED: :loop3'>>
					<<if getvar("$playerHand["+$i+"]") != 0>>
						<<setn $i += 16>> 

					<</if>>
					<<setinit $playerHand[$i] = $playerHand[$currentHand * 16 + 1]>>
					<<setinit $playerHand[$currentHand * 16 + 1] = $cardsDealt>>
					<<set $cardsDealt += 1>>
					<<setinit $playerHand[$i + 1] = $cardsDealt>>
					<<set $cardsDealt += 1>>
					<!-- FAILED TO CONVERT
						*pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
					-----
						<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<center><img $set_imgh src""" = "images / $locations / $city / $industrial / $casino / ERROR: FAILED TO CONVERT LITERAL: """cartbde.jpg"><""" / ERROR: FAILED TO CONVERT LITERAL: """center>'""">>

					-->
					<<warn "CONVERSION ERROR f6abb7e00b3aff46a3bcdff1c0441ac0">>
					<<gt 'casino' 'player'>>
				<</actCLA>>
			<</if>>
		<</if>>
		<<actCLA '$textStay'>>
			<<set $currentHand += 1>>
			<<if $currentHand < $numHands>>
				<<gt 'casino' 'player'>>

			<</if>>
			<<if $currentHand >= $numHands>>
				<<gt 'casino' 'dealer'>>

			<</if>>
		<</actCLA>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'dealer'>>
	<<gs 'casino' 'blackjack_view' 1>>
	<<if getvar("$dealerPoints") < 17>>
		<<actCLA 'Continue'>>
			<<set $i = 2>>
			<<warn 'JUMP MARKER ENCOUNTERED: :loop4'>>
			<<if getvar("$dealerHand["+$i+"]") != 0>>
				<<setn $i += 1>> 

			<</if>>
			<<setinit $dealerHand[$i] = $cardsDealt>>
			<<set $cardsDealt += 1>>
			<!-- FAILED TO CONVERT
				*pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
			-----
				<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<center><img $set_imgh src""" = "images / $locations / $city / $industrial / $casino / ERROR: FAILED TO CONVERT LITERAL: """cartbde.jpg"><""" / ERROR: FAILED TO CONVERT LITERAL: """center>'""">>

			-->
			<<warn "CONVERSION ERROR f6abb7e00b3aff46a3bcdff1c0441ac0">>
			<<gt 'casino' 'dealer'>>
		<</actCLA>>
	<<elseif getvar("$dealerPoints") > 21>>
		<<set $betTotal = 0>>
		<<set $i = 0>>
		<<warn 'JUMP MARKER ENCOUNTERED: :loop5'>>
		<<if getvar("$playerPoints["+$i+"]") <= 21>>
			<<set $betTotal += $playerBets[$i]>>

		<</if>>
		<<set $i += 1>>
		<<if $i < $numHands>>
			<<warn 'JUMP COMMAND ENCOUNTERED: jump loop5'>>

		<</if>>
		 * pl 'PLAYER WINS'
		<!-- FAILED TO CONVERT
			*p 'You receive <<betTotal>> <b>₽</b> in winnings.'
		-----
			 * ERROR: FAILED TO CONVERT LITERAL: """p 'You receive <<betTotal>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b> in winnings.'"""

		-->
		<<warn "CONVERSION ERROR 3b42dd114b2a34c5af388844ecd1c965">>
		<<set $finances.cash += $betTotal>>
		<<act 'Continue'>>
			<<gt 'casino' 'blackjack_play'>>
		<</act>>
	<<else>>
		<<set $betTotal = 0>>
		<<set $i = 0>>
		<<warn 'JUMP MARKER ENCOUNTERED: :loop6'>>
		<<if getvar("$playerPoints["+$i+"]") > 21>>
			<<set $betTotal -= $playerBets[$i]>>
		<<elseif $playerPoints[$i] < $dealerPoints>>
			<<set $betTotal -= $playerBets[$i]>>
		<<elseif $playerpoints[$i] > $dealerPoints>>
			<<set $betTotal += $playerBets[$i]>>
		<</if>>
		<<set $i += 1>>
		<<if $i < $numHands>>
			<<warn 'JUMP COMMAND ENCOUNTERED: jump loop6'>>

		<</if>>
		<<if getvar("$betTotal") == 0>>
			 * pl 'DRAW GAME'
			<<if getvar("$numHands") == 1>>
				 * p 'You retrieve your bet.'

			<</if>>
			<<if getvar("$numHands") > 1>>
				 * p 'You retrieve your bets.'

			<</if>>
		<<elseif getvar("$betTotal") < 0>>
			 * pl 'DEALER WINS'
			<<if getvar("$numHands") > 1>>
				 * p 'After taking into account all the hands , you have lost. '

			<</if>>
			<!-- FAILED TO CONVERT
				*p 'The dealer relieves you of <<0 - betTotal>> <b>₽</b>.'
			-----
				 * ERROR: FAILED TO CONVERT LITERAL: """p 'The dealer relieves you of <<0""" - ERROR: FAILED TO CONVERT LITERAL: """betTotal>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b>.'"""

			-->
			<<warn "CONVERSION ERROR bd8c9fc64f3057f4837ea32193fd43a5">>
		<<else>>
			 * pl 'PLAYER WINS'
			<<if getvar("$numHands") > 1>>
				 * p 'After taking into account all the hands , you have won. '

			<</if>>
			<!-- FAILED TO CONVERT
				*p 'You receive <<betTotal>> <b>₽</b> in winnings.'
			-----
				 * ERROR: FAILED TO CONVERT LITERAL: """p 'You receive <<betTotal>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b> in winnings.'"""

			-->
			<<warn "CONVERSION ERROR 3b42dd114b2a34c5af388844ecd1c965">>
		<</if>>
		<<set $finances.cash += $betTotal>>
		<<act 'Continue'>>
			<<gt 'casino' 'blackjack_play'>>
		<</act>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'blackjack_view'>>
	<!-- FAILED TO CONVERT
		*pl '<table width="100%"><tr><td>'
	-----
		<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<table width""" = "100 % ERROR: FAILED TO CONVERT LITERAL: """"><tr><td>'""">>

	-->
	<<warn "CONVERSION ERROR 25d82dc126a2e1c26c1c72bb9dca71dc">>
	<!-- FAILED TO CONVERT
		*pl '<u>Dealer</u>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """pl '<u>Dealer<""" / ERROR: FAILED TO CONVERT LITERAL: """u>'"""

	-->
	<<warn "CONVERSION ERROR 12a95417bedf3aa699b4abc100052a07">>
	<<if $location_var[$here][1] == 0>>
		<!-- FAILED TO CONVERT
			*p '<img <<$set_imgh>> src="<<$deckImg[dealerHand[0]]>>">'
		-----
			<<set  * ERROR: FAILED TO CONVERT LITERAL: """p '<img $set_imgh src""" = ERROR: FAILED TO CONVERT LITERAL: """"$deckImg[$dealerHand[0]]">'""">>

		-->
		<<warn "CONVERSION ERROR a1b28d195ac341027a05798db3acb9cc">>
		<!-- FAILED TO CONVERT
			*pl '<img <<$set_imgh>> src="images/locations/city/industrial/casino/cards/back.jpg">'
		-----
			<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<img $set_imgh src""" = "images / $locations / $city / $industrial / $casino / $cards / ERROR: FAILED TO CONVERT LITERAL: """back.jpg">'""">>

		-->
		<<warn "CONVERSION ERROR 03ce7e496858fca871aaeba226a9be80">>
	<<else>>
		<<set $numAces = 0>>
		<<set $dealerPoints = 0>>
		<<set $i = 0>>
		<<warn 'JUMP MARKER ENCOUNTERED: :loop7'>>
		<!-- FAILED TO CONVERT
			*p '<img <<$set_imgh>> src="<<$deckImg[dealerHand[i]]>>">'
		-----
			<<set  * ERROR: FAILED TO CONVERT LITERAL: """p '<img $set_imgh src""" = ERROR: FAILED TO CONVERT LITERAL: """"$deckImg[$dealerHand[$i]]">'""">>

		-->
		<<warn "CONVERSION ERROR ecf87c32640c6f39943ad0edbf5798cd">>
		<<if $deckFace[$dealerHand[$i]] == 1>>
			<<set $dealerPoints += 11>>
			<<set $numAces += 1>>
		<<elseif $deckFace[$dealerHand[$i]] > 9>>
			<<set $dealerPoints += 10>>
		<<else>>
			<<set $dealerPoints += $deckFace[$dealerHand[$i]]>>
		<</if>>
		<<set $i += 1>>
		<<if getvar("$dealerHand["+$i+"]") != 0>>
			<<warn 'JUMP COMMAND ENCOUNTERED: jump loop7'>>

		<</if>>
		<<warn 'JUMP MARKER ENCOUNTERED: :loop8'>>
		<<if getvar("$dealerPoints") > 21 and getvar("$numAces") > 0>>
			<<set $dealerPoints -= 10>>
			<<set $numAces -= 1>>
			<<warn 'JUMP COMMAND ENCOUNTERED: jump loop8'>>
		<</if>>
		<<if getvar("$dealerPoints") > 21>>
			<!-- FAILED TO CONVERT
				*p '<br>BUST!'
			-----
				 * ERROR: FAILED TO CONVERT LITERAL: """p '<br>BUST!'"""

			-->
			<<warn "CONVERSION ERROR f4a983c1a36fe543683894c329ff4773">>
		<<elseif getvar("$dealerPoints") == 21 and $dealerHand[2] == 0>>
			<!-- FAILED TO CONVERT
				*p '<br>BLACKJACK!'
			-----
				 * ERROR: FAILED TO CONVERT LITERAL: """p '<br>BLACKJACK!'"""

			-->
			<<warn "CONVERSION ERROR dfdb0b48f27858686424252d046f6955">>
		<<else>>
			<!-- FAILED TO CONVERT
				*p '<br><<dealerPoints>> points'
			-----
				 * ERROR: FAILED TO CONVERT LITERAL: """p '<br><<dealerPoints>> points'"""

			-->
			<<warn "CONVERSION ERROR 3c92d254ffa0eab4fee5e1316385e548">>
		<</if>>
	<</if>>
	<!-- FAILED TO CONVERT
		*pl '<br><br><u>Player</u>'
	-----
		 * ERROR: FAILED TO CONVERT LITERAL: """pl '<br><br><u>Player<""" / ERROR: FAILED TO CONVERT LITERAL: """u>'"""

	-->
	<<warn "CONVERSION ERROR bcc7f5f51a6a070f4b4e3d20960418cd">>
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :loop9'>>
	<<set $numAces = 0>>
	<<setinit $playerPoints[$i] = 0>>
	<!-- FAILED TO CONVERT
		if numHands > 1: *pl 'Hand #<<i + 1>>:'
	-----
		<<if getvar("$numHands") > 1>>
		<!-- FAILED TO CONVERT
	*pl 'Hand #<<i + 1>>:'
-----
	 * ERROR: FAILED TO CONVERT LITERAL: """pl 'Hand #<<i""" + ERROR: FAILED TO CONVERT LITERAL: """1>>:'"""

-->
<<warn "CONVERSION ERROR 234a95a9acd1816f2c9782eb367afe00">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR c88b493747a945e32fdb9a8cae27d167">>
	<<set $j = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :loop10'>>
	<<if $playerHand[$i * 16 + $j] != 0>>
		<!-- FAILED TO CONVERT
			*p '<img <<$set_imgh>> src="<<$deckImg[playerHand[i * 16 + j]]>>">'
		-----
			<<set  * ERROR: FAILED TO CONVERT LITERAL: """p '<img $set_imgh src""" = ERROR: FAILED TO CONVERT LITERAL: """"$deckImg[$playerHand[$i * 16 + $j]]">'""">>

		-->
		<<warn "CONVERSION ERROR 8edfc621a7591820ca4a0f5a922a45e6">>
		<<if $deckFace[$playerHand[$i * 16 + $j]] == 1>>
			<<setinit $playerPoints[$i] += 11>>
			<<set $numAces += 1>>
		<<elseif $deckFace[$playerHand[$i * 16 + $j]] > 9>>
			<<setinit $playerPoints[$i] += 10>>
		<<else>>
			<<setinit $playerPoints[$i] += $deckFace[$playerHand[$i * 16 + $j]]>>
		<</if>>
		<<set $j += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump loop10'>>
	<</if>>
	<<warn 'JUMP MARKER ENCOUNTERED: :loop11'>>
	<<if getvar("$playerPoints["+$i+"]") > 21 and getvar("$numAces") > 0>>
		<<setinit $playerPoints[$i] -= 10>>
		<<set $numAces -= 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump loop11'>>
	<</if>>
	<<if getvar("$playerPoints["+$i+"]") > 21>>
		<!-- FAILED TO CONVERT
			*p '<br>BUST!'
		-----
			 * ERROR: FAILED TO CONVERT LITERAL: """p '<br>BUST!'"""

		-->
		<<warn "CONVERSION ERROR f4a983c1a36fe543683894c329ff4773">>
	<<elseif getvar("$playerPoints["+$i+"]") == 21 and $playerHand[2] == 0 and getvar("$numHands") == 1>>
		<!-- FAILED TO CONVERT
			*p '<br>BLACKJACK!'
		-----
			 * ERROR: FAILED TO CONVERT LITERAL: """p '<br>BLACKJACK!'"""

		-->
		<<warn "CONVERSION ERROR dfdb0b48f27858686424252d046f6955">>
	<<else>>
		<!-- FAILED TO CONVERT
			*p '<br><<playerPoints[i]>> points |'
		-----
			 * ERROR: FAILED TO CONVERT LITERAL: """p '<br><<playerPoints[$i]>> points |'"""

		-->
		<<warn "CONVERSION ERROR ab83a1fc0be85dccaf5f8e9d35ec7ab1">>
	<</if>>
	<!-- FAILED TO CONVERT
		*p ' Bet = <<playerBets[i]>> <b>₽</b><br><br>'
	-----
		<<set  * p ' Bet = ERROR: FAILED TO CONVERT LITERAL: """<<playerBets[$i]>> <b>₽<""" / ERROR: FAILED TO CONVERT LITERAL: """b><br><br>'""">>

	-->
	<<warn "CONVERSION ERROR 7df51073f73742f840ff109b45021f90">>
	<<set $i += 1>>
	<<if $i < $numHands>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump loop9'>>

	<</if>>
	<!-- FAILED TO CONVERT
		*pl '</td><td valign="top"><div align="right"><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbd.jpg"></div></td></tr></table>'
	-----
		<<set  * ERROR: FAILED TO CONVERT LITERAL: """pl '<""" / ERROR: FAILED TO CONVERT LITERAL: """td><td valign""" = ERROR: FAILED TO CONVERT LITERAL: """"top"><div align="right"><img $set_imgh src="images""" / $locations / $city / $industrial / $casino / ERROR: FAILED TO CONVERT LITERAL: """cartbd.jpg"><""" / ERROR: FAILED TO CONVERT LITERAL: """div><""" / ERROR: FAILED TO CONVERT LITERAL: """td><""" / ERROR: FAILED TO CONVERT LITERAL: """tr><""" / ERROR: FAILED TO CONVERT LITERAL: """table>'""">>

	-->
	<<warn "CONVERSION ERROR 6cff4848472ca978954399d87001d63e">>
<</if>>
