12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094 |
- # casino
- $loc = 'casino'
- $menu_loc = 'casino'
- if $ARGS[0] = 'outside':
- $metka = 'outside'
- $menu_arg = 'outside'
- menu_off = 0
- $location_type = 'public_outdoors'
-
- *clr & cla
- gs 'stat'
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/zdcasino.jpg"></right>'
- 'You stand in front of the door of the huge building casinos.'
- act 'Return to the city industrial area': minut += 10 & gt 'nord'
- act 'Enter the casino': gt 'casino', 'foyer'
- !!if tobiQW < 1000:tobiQW = 1000
- end
- if $ARGS[0] = 'foyer':
- CLOSE ALL
- $metka = $ARGS[0]
- $menu_arg = $ARGS[0]
- menu_off = 0
- $location_type = 'public_indoors'
-
- *clr & cla
- minut += 1
- gs 'stat'
- picrand = rand(1, 3)
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/hcasino<<picrand>>.jpg"></right>'
- 'You enter the foyer of the casino, there are lots of games .'
- *nl
- 'In the hall are various <a href="exec:gt ''casino'', ''slots''">slot machines</a>.'
- 'In the games room there is <a href="exec:gt ''casino'', ''roulette''">Roulette</a> and <a href="exec:gt ''casino'', ''cards''">card games</a>.'
- act 'Go outside': gt 'casino', 'outside'
- act 'Go to the slot machines': gt 'casino', 'slots'
- act 'Go to the roulette table': gt 'casino', 'roulette'
- act 'Go to the card tables': gt 'casino', 'cards'
- end
- !!----------
- !! Roulette
- !!----------
- if $ARGS[0] = 'roulette':
- $metka = $ARGS[0]
- $menu_arg = $ARGS[0]
- menu_off = 0
- *clr & cla
- minut += 1
- gs 'stat'
- '<right><img <<$set_imgh>> src="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 'Play roulette': gt 'casino', 'roulette_bet1'
- act 'Approach the croupier':
- *clr & cla
- menu_off = 1
- minut += 1
- gs 'stat'
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/crup.jpg"></right>'
- '"Can I help you?" He asks.'
- act 'Shake your head and move away': gt 'casino', 'roulette'
- act 'Ask rules':
- msg 'The rules are very simple.
- First you choose the amount you want to bet.
- But in our casino maximum amount is 1000 <b>₽</b>.
- Then you choose where to put your chips. There are six different types of bets:
- 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'
- end
- end
- end
- if $ARGS[0] = 'roulette_bet1':
- *clr & cla
- menu_off = 1
- minut += 1
- kh = 0
- chnch = 0
- mb = 0
- du = 0
- series = 0
- chi = 100
- x_rul = 100
- gs 'stat'
- '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/amrul.jpg"></center>'
- 'The maximum amount you can bet is 1000 <b>₽</b>.'
- 'You lean over the table.'
- act 'Move away from the table':gt 'casino', 'roulette'
- act 'Make a bet':
- st_1 = input 'Enter the amount'
- if money < st_1:
- msg '<br>You don''t have enough money.'
- gt 'casino', 'roulette_bet1'
- elseif st_1 <= 0:
- msg '<br>You can''t bet zero or a negative amount.'
- gt 'casino', 'roulette_bet1'
- elseif st_1 > 1000:
- msg '<br>The maximum amount you can bet is 1000 <b>₽</b>'
- gt 'casino', 'roulette_bet1'
- else
- money -= st_1
- gt 'casino', 'roulette_bet2'
- end
- end
- end
- if $ARGS[0] = 'roulette_bet2':
- *clr & cla
- minut += 1
- kh = 0
- chnch = 0
- mb = 0
- du = 0
- series = 0
- chi = 100
- gs 'stat'
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/stavkaru.jpg"></right>'
- 'Where do you put your chips?'
- act 'Don''t bet':
- money += st_1
- gt 'casino', 'roulette_bet1'
- end
-
- act 'Red / Black':
- cla
- act 'Reconsider': gt 'casino', 'roulette_bet2'
- act 'Red': kh = 1 & gt 'casino', 'roulette_result'
- act 'Black': kh = 2 & gt 'casino', 'roulette_result'
- end
- act 'Even / Odd':
- cla
- act 'Reconsider': gt 'casino', 'roulette_bet2'
- act 'Even': chnch = 1 & gt 'casino', 'roulette_result'
- act 'Odd': chnch = 2 & gt 'casino', 'roulette_result'
- end
- act 'Small / Large':
- cla
- act 'Reconsider': gt 'casino', 'roulette_bet2'
- act 'Small: 1-18': mb = 1 & gt 'casino', 'roulette_result'
- act 'Large: 19-36': mb = 2 & gt 'casino', 'roulette_result'
- end
- act 'Dozen':
- cla
- act 'Reconsider': gt 'casino', 'roulette_bet2'
- act 'First dozen: 1-12': du = 1 & gt 'casino', 'roulette_result'
- act 'Second dozen: 13-24': du = 2 & gt 'casino', 'roulette_result'
- act 'Third dozen:25-36': du = 3 & gt 'casino', 'roulette_result'
- end
- act 'Series':
- cla
- act 'Reconsider': gt 'casino', 'roulette_bet2'
- act 'First row: 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34': series = 1 & gt 'casino', 'roulette_result'
- act 'Second row: 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35': series = 2 & gt 'casino', 'roulette_result'
- act 'Third row: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36': series = 3 & gt 'casino', 'roulette_result'
- end
- act 'Number':
- cla
- act 'Reconsider': gt 'casino', 'roulette_bet2'
- act 'Choose a number':
- chi = input 'Enter a number from 0-36'
- if chi < 0 and chi > 36:
- msg 'You need to choose a number between 0 and 36.'
- gt 'casino', 'roulette_bet2'
- else
- gt 'casino', 'roulette_result'
- end
- end
- end
- end
- if $ARGS[0] = 'roulette_result':
- cla
- minut += 5
- gs 'stat'
- x_rul = 100
- x_rul = rand(0, 36)
- if x_rul = 0:
- $color = ' '
- else
- if x_rul = 1 or x_rul = 3 or x_rul = 5 or x_rul = 7 or x_rul = 9 or x_rul = 12 or x_rul = 14 or x_rul = 16 or x_rul = 18 or x_rul = 19 or x_rul = 21 or x_rul = 23 or x_rul = 25 or x_rul = 27 or x_rul = 30 or x_rul = 32 or x_rul = 34 or x_rul = 36:
- $color = 'red'
- else
- $color = 'black'
- end
- end
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/resul.jpg"></right>'
- *nl
- 'The ball stopps at <<x_rul>> <<$color>>'
- if kh ! 0:
- if kh = 1:
- if x_rul = 1 or x_rul = 3 or x_rul = 5 or x_rul = 7 or x_rul = 9 or x_rul = 12 or x_rul = 14 or x_rul = 16 or x_rul = 18 or x_rul = 19 or x_rul = 21 or x_rul = 23 or x_rul = 25 or x_rul = 27 or x_rul = 30 or x_rul = 32 or x_rul = 34 or x_rul = 36:
- act 'You have won <<2 * st_1>>':
- money += 2 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- elseif kh = 2:
- if x_rul = 2 or x_rul = 4 or x_rul = 6 or x_rul = 8 or x_rul = 10 or x_rul = 11 or x_rul = 13 or x_rul = 15 or x_rul = 17 or x_rul = 20 or x_rul = 22 or x_rul = 24 or x_rul = 26 or x_rul = 28 or x_rul = 29 or x_rul = 31 or x_rul = 33 or x_rul = 35:
- act 'You have won <<2 * st_1>>':
- money += 2 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- end
- elseif chnch ! 0:
- if chnch = 1:
- chnch = 0
- if x_rul mod 2 = 0:
- act 'You have won <<2 * st_1>>':
- money += 2 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- elseif chnch = 2:
- chnch = 0
- if x_rul mod 2 = 1:
- act 'You have won <<2 * st_1>>':
- money += 2 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- end
- elseif mb ! 0:
- if mb = 1:
- mb = 0
- if x_rul > 0 and x_rul < 19:
- act 'You have won <<2 * st_1>>':
- money += 2 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- elseif mb = 2:
- mb = 0
- if x_rul > 18 and x_rul < 37:
- act 'You have won <<2 * st_1>>':
- money += 2 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- end
- elseif du ! 0:
- if du = 1:
- du = 0
- if x_rul > 0 and x_rul < 13:
- act 'You have won <<3 * st_1>>':
- money += 3 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- elseif du = 2:
- du = 0
- if x_rul > 12 and x_rul < 25:
- act 'You have won <<3 * st_1>>':
- money += 3 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- elseif du = 3:
- du = 0
- if x_rul > 24 and x_rul < 37:
- act 'You have won <<3 * st_1>>':
- money += 3 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- end
- elseif series ! 0:
- if series = 1:
- series = 0
- if x_rul = 1 or x_rul = 4 or x_rul = 7 or x_rul = 10 or x_rul = 13 or x_rul = 16 or x_rul = 19 or x_rul = 22 or x_rul = 25 or x_rul = 28 or x_rul = 31 or x_rul = 34:
- act 'You have won <<3*st_1>>':
- money += 3 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- elseif series = 2:
- series = 0
- if x_rul = 2 or x_rul = 3 or x_rul = 8 or x_rul = 11 or x_rul = 14 or x_rul = 17 or x_rul = 20 or x_rul = 23 or x_rul = 26 or x_rul = 29 or x_rul = 32 or x_rul = 35:
- act 'You have won <<3*st_1>>':
- money += 3 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- elseif series = 3:
- series = 0
- if x_rul = 3 or x_rul = 4 or x_rul = 9 or x_rul = 12 or x_rul = 15 or x_rul = 18 or x_rul = 21 or x_rul = 24 or x_rul = 27 or x_rul = 30 or x_rul = 33 or x_rul = 36:
- act 'You have won <<3*st_1>>':
- money += 3 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- end
- elseif chi ! 100:
- if chi = x_rul:
- act 'You have won <<37 * st_1>>':
- money += 37 * st_1
- gt 'casino', 'roulette_bet1'
- end
- else
- act 'You have lost':gt 'casino', 'roulette_bet1'
- end
- end
- end
- !!-------
- !! Slots
- !!-------
- if $ARGS[0] = 'slots':
- $metka = $ARGS[0]
- $menu_arg = $ARGS[0]
- menu_off = 0
-
- *clr & cla
- minut += 1
- gs 'stat'
- '<right><img <<$set_imgh>> src="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 'Use one of the slot machines':
- *clr & cla
- menu_off = 1
- minut += 1
- gs 'stat'
- betAmount = 10
- slotsJackpot = betAmount * 20000
- '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/avt.jpg"></center>'
- '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.'
- act 'Go back to the foyer': gt 'casino', 'foyer'
- act 'Pull the lever':
- if money >= betAmount:
- money -= betAmount
- slotsRand = rand(1, 100000)
- if slotsRand > 99990:
- winnings = slotsJackpot
- msg 'Jackpot! What are the odds!?'
- elseif slotsRand >= 99900:
- winnings = betAmount * 1500
- elseif slotsRand >= 99000:
- winnings = betAmount * 100
- elseif slotsRand >= 90000:
- winnings = betAmount * 5
- elseif slotsRand >= 66667:
- winnings = betAmount * 2
- else
- winnings = 0
- end
- if winnings > 0:
- money += winnings
- msg 'You have won <<winnings>> <b>₽</b>.'
- else
- msg 'You have lost. Try again?'
- end
- minut += 1
- gs 'stat'
-
- 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'
- end
- killvar 'slotsRand'
- killvar 'winnings'
- end
- end
- end
- !!-------
- !! Cards
- !!-------
- if $ARGS[0] = 'cards':
- $metka = $ARGS[0]
- $menu_arg = $ARGS[0]
- menu_off = 0
- *clr & cla
- minut += 1
- gs 'stat'
- '<right><img <<$set_imgh>> src="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 'Play Blackjack': gt 'casino', 'blackjack_play'
- act 'Play Casino War': gt 'casino', 'cards_cw'
- !!SYMBOLS
- !! ♥
- !! ♠
- !! ♦
- !! ♣
- !!deck of cards
- $suit[1] = 'Spades'
- $symbol[1] = '♠'
- $suit[2] = 'Clubs'
- $symbol[2] = '♣'
- $suit[3] = 'Hearts'
- $symbol[3] = '♥'
- $suit[4] = 'Diamonds'
- $symbol[4] = '♦'
- $number[1] = 'Ace '
- points[1] = 11
- $number[2] = 'Deuce '
- points[2] = 2
- $number[3] = 'Three '
- points[3] = 3
- $number[4] = 'Four '
- points[4] = 4
- $number[5] = 'Five '
- points[5] = 5
- $number[6] = 'Six '
- points[6] = 6
- $number[7] = 'Seven '
- points[7] = 7
- $number[8] = 'Eight '
- points[8] = 8
- $number[9] = 'Nine '
- points[9] = 9
- $number[10] = 'Ten '
- points[10] = 10
- $number[11] = 'Jack '
- points[11] = 10
- $number[12] = 'Queen '
- points[12] = 10
- $number[13] = 'King '
- points[13] = 10
- $number[14] = 'Ace '
- points[14] = 11
- end
- !!--------------------
- !! Cards: Casino Wars
- !!--------------------
- if $ARGS[0] = 'cards_cw':
- $metka = $ARGS[0]
- $menu_arg = $ARGS[0]
- menu_off = 0
-
- *clr & cla
- minut += 1
- gs 'stat'
- '<right><img <<$set_imgh>> src="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 'Sit down at the table': gt 'casino', 'cards_cwplay'
- act 'Approach the croupier':
- *clr & cla
- menu_off = 1
- minut += 1
- gs 'stat'
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/crupcw.jpg"></right>'
- '"How can I help you?"'
- act 'Move away from the dealer': gt 'casino', 'cards_cw'
- act 'Ask for the rules':
- msg 'The rules are very simple.
- First you choose how much you want to wager.
- But note that in our casino maximum rate is 1000 <b>₽</b>.
- 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.
- Regular:
- 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.
- Bet on draw:
- 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'
- end
- end
- end
- if $ARGS[0] = 'cards_cwplay':
- *clr & cla
- menu_off = 1
- minut += 1
- gs 'stat'
- if turn1 = 0:
- cla
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/stavkacw.jpg"></right>'
- 'Place your bets, ladies and gentlemen.'
- act 'Leave the table': gt 'casino', 'cards_cw'
-
- act 'Place your bet':
- if money < 1:
- 'You don''t have any money!'
- act 'Leave the table': gt 'casino', 'cards_cw'
- end
- bet_amount = input 'Enter the amount to bet'
- if money < bet_amount:
- msg 'You don''t have enough money to bet that much'
- elseif bet_amount < 1:
- msg 'You must place a minimum bet of 1 <b>₽</b>.'
- elseif bet_amount > 1000:
- msg 'The maximum bet allowed is 1000 <b>₽</b>.'
- else
- money -= bet_amount
- turn1 = 1
- end
- gt 'casino', 'cards_cwplay'
- end
- end
- if turn1 = 1:
- cla
- bet_draw = 0
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/stavkacw.jpg"></right>'
- 'Continue with regular bet (payout 2 to 1), or bet on a draw (payout 11 to 1)?'
- if money < bet_amount:
- turn1 = 2
- gt 'casino', 'cards_cwplay'
- else
- act 'Continue with regular bet':
- turn1 = 2
- gt 'casino', 'cards_cwplay'
- end
- act 'Bet on draw (doubles bet)':
- turn1 = 2
- bet_draw = 1
- money -= bet_amount
- gt 'casino', 'cards_cwplay'
- end
- end
- end
- if turn1 = 2:
- cla
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartcw.jpg"></right>'
- ' The dealer deals the cards:'
- '...'
- suit = rand(1, 4)
- number = rand(1, 13)
- $d_card[1] = $number[number] + 'of ' + $suit[suit]
- d_points = number
- suit = rand(1, 4)
- !! Player draws from cards 2-14 so that they win if both they and the dealer draw an ace
- number = rand(2, 14)
- $p_card[1] = $number[number] + 'of ' + $suit[suit]
- p_points = number
- wait 1000
- 'Dealer''s Card:'
- ' <<$d_card[1]>>'
- '__________________________'
- 'Your Card:'
- ' <<$p_card[1]>>'
- if d_points > p_points:
- ' '
- 'Casino won'
- act 'You lost':
- turn1 = 0
- gt 'casino', 'cards_cwplay'
- end
- elseif d_points < p_points:
- ' '
- 'You won'
- act 'Take money (<<2 * bet_amount>> <b>₽</b>)':
- money += 2 * bet_amount
- turn1 = 0
- gt 'casino', 'cards_cwplay'
- end
- else
- if bet_draw = 1:
- ' '
- 'You won'
- act 'Take money (<<11 * bet_amount>> <b>₽</b>)':
- money += 11 * bet_amount
- turn1 = 0
- gt 'casino', 'cards_cwplay'
- end
- else
- turn1 = 3
- gt 'casino', 'cards_cwplay'
- end
- end
- end
- if turn1 = 3:
- '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartcw.jpg"></right>'
- ' '
- 'Draw'
- if money >= bet_amount:
- act 'Continue (bet another <<bet_amount>> <b>₽</b>)':
- cla
- money -= bet_amount
- ' The dealer deals the cards:'
- '...'
- suit = rand(1, 4)
- number = rand(1, 13)
- $d_card[2] = $number[number] + 'of ' + $suit[suit]
- d_points = number
- suit = rand(1, 4)
- number = rand(2, 14)
- $p_card[2] = $number[number] + 'of ' + $suit[suit]
- p_points = number
- 'Dealer''s Cards:'
- ' <<$d_card[1]>>'
- ' <<$d_card[2]>>'
- '__________________________'
- 'Your Cards:'
- ' <<$p_card[1]>>'
- ' <<$p_card[2]>>'
- if d_points > p_points:
- ' '
- 'Casino won'
- act 'You lost':
- turn1 = 0
- gt 'casino', 'cards_cwplay'
- end
- elseif d_points < p_points:
- ' '
- 'You won'
- act 'Take money (<<4 * bet_amount>> <b>₽</b>)':
- money += 4 * bet_amount
- turn1 = 0
- gt 'casino', 'cards_cwplay'
- end
- elseif d_points = p_points:
- ' '
- 'Draw'
- act 'Take money (<<3 * bet_amount>> <b>₽</b>)':
- money += 3 * bet_amount
- turn1 = 0
- gt 'casino', 'cards_cwplay'
- end
- end
- end
- else
- ' '
- 'You don''t have enough money to continue'
- end
- act 'Take original bet (<<bet_amount>> <b>₽</b>)':
- money += bet_amount
- turn1 = 0
- gt 'casino', 'cards_cwplay'
- end
- end
- end
- !!--------------------
- !! Cards: Blackjack
- !!--------------------
- if $ARGS[0] = 'blackjack_play':
- menu_off = 1
- minut += 1
- gs 'stat'
- killvar 'dealerHand'
- killvar 'playerHand'
- killvar 'playerBets'
- killvar 'playerPoints'
- dealerHand[] = 0
- dealerHand[] = 1
- playerHand[] = 2
- playerHand[] = 3
- cardsDealt = 4
- numHands = 1
- currentHand = 0
- handLosses = 0
- numAces = 0
- dealerPoints = 0
- insurance = 0
- betTotal = 0
- doubleBet = 0
- minBet = 10
- maxBet = 500
- *pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/stolbd.jpg"></center>'
- *pl 'You are sitting at the blackjack table.'
- act 'Move away from the table' : gt 'casino', 'cards'
- act 'Play blackjack' : gt 'casino', 'bet'
- act 'Ask for the rules' : gt 'casino', 'rules'
- end
- if $ARGS[0] = 'rules':
- *pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/crupbd.jpg"></center>'
- *pl '<h2><u>Blackjack Rules:</u></h2>'
- *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>'
- *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>'
- *p '<li>After the player finishes drawing, the dealer must continue to draw until he has 17 points or more.</li>'
- *p '<li>To win, the player must score more points than the dealer, have the dealer bust, or get a blackjack.</li>'
- *p '<li>Getting over 21 points is known as a bust, and an automatic loss.</li>'
- *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>'
- *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>'
- *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>'
- *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>'
- *p '<li>The player cannot score a blackjack using a split hand.</li>'
- act 'Return' : gt 'casino', 'blackjack_play'
- end
- if $ARGS[0] = 'bet':
- *pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/stavkabd.jpg"></center>'
- playerBets[0] = input('Place your bet.')
- if money < 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'
- end
- betTotal = playerBets[0]
- gs 'deckShuffle'
- 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'
- end
- end
- if $ARGS[0] = 'blackjack':
- gs 'casino', 'blackjack_view', 1
- if playerPoints[0] = 21 and dealerPoints = 21:
- *pl 'DRAW GAME'
- *pl 'You retrieve your bet.'
- elseif playerPoints[0] = 21:
- *pl 'PLAYER WINS'
- *pl 'You receive <<playerBets[0] * 3 / 2>> <b>₽</b> in winnings.'
- money += playerBets[0] * 3 / 2
- else
- *pl 'DEALER WINS'
- *pl 'The dealer takes your <<playerBets[0]>> <b>₽</b> bet.'
- money -= playerBets[0]
- end
- act 'Continue' : gt 'casino', 'blackjack_play'
- end
- if $ARGS[0] = 'insurance1':
- gs 'casino', 'blackjack_view'
- *pl 'The dealer has an ace showing. Would you like to place a bet for insurance?'
- insurance = 0
- act 'Bet insurance' :
- insurance = input('Place your bet.')
- if money < insurance:
- msg 'You don''t have enough money for that bet.'
- gt 'casino', 'insurance1'
- elseif 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'
- end
- end
- act 'No insurance' : gt 'casino', 'insurance2'
- end
- if $ARGS[0] = 'insurance2':
- if deckFace[dealerCards[1]] > 9: gs 'casino', 'blackjack_view', 1
- if deckFace[dealerCards[1]] < 10: gs 'casino', 'blackjack_view'
- if dealerPoints = 21:
- *pl 'DEALER WINS'
- *p 'The dealer takes your <<playerBets[0]>> <b>₽</b> bet'
- if insurance > 0: *p ' but also gives you <<insurance>> <b>₽</b> for your side bet'
- *p '.'
- money -= playerBets[0]
- money += insurance
- act 'Continue' : gt 'casino', 'blackjack_play'
- else
- *pl 'The dealer takes a peek at his hole card; no blackjack.'
- if insurance > 0: *p 'He relieves you of <<insurance>> <b>₽</b> for your side bet.'
- money -= insurance
- act 'Continue' :
- cla
- wait 500
- gt 'casino', 'player'
- end
- end
- end
- if $ARGS[0] = 'player':
- gs 'casino', 'blackjack_view'
- if playerPoints[currentHand] > 21: currentHand += 1 & handLosses += 1 & doubleBet = 0
- if playerPoints[currentHand] = 21 or doubleBet = 1: currentHand += 1 & doubleBet = 0
- if handLosses = numHands:
- *pl 'DEALER WINS'
- *p 'The dealer relieves you of <<betTotal>> <b>₽</b>.'
- money -= betTotal
- act 'Continue' : gt 'casino', 'blackjack_play'
- elseif currentHand >= numHands:
- *pl 'You can take no further actions.'
- act 'Continue' :
- cla
- wait 500
- gt 'casino', 'dealer'
- end
- else
- if numHands = 1:
- *pl 'You are considering actions for your hand.'
- $text = ''
- else
- *pl 'You are considering your actions for <b>hand #<<currentHand + 1>></b>.'
- $text = 'Hand #<<currentHand + 1>>: '
- end
- act '<<$text>>Hit' :
- i = currentHand * 16 + 2
- :loop1
- if playerHand[i] ! 0: i += 1 & jump 'loop1'
- playerHand[i] = cardsDealt
- cardsDealt += 1
- *clr & cla
- *pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
- wait 750
- gt 'casino', 'player'
- end
- if money >= betTotal + playerBets[currentHand]:
- act '<<$text>>Double' :
- doubleBet = 1
- betTotal += playerBets[currentHand]
- playerBets[currentHand] += playerBets[currentHand]
- i = currentHand * 16 + 2
- :loop2
- if playerHand[i] ! 0: i += 1 & jump 'loop2'
- playerHand[i] = cardsDealt
- cardsDealt += 1
- *clr & cla
- *pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
- wait 750
- gt 'casino', 'player'
- end
- 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]]):
- act '<<$text>>Split' :
- betTotal += playerBets[currentHand]
- playerBets[numHands] = playerBets[currentHand]
- numHands += 1
- i = (currentHand + 1) * 16
- :loop3
- if playerHand[i] ! 0: i += 16 & jump 'loop3'
- playerHand[i] = playerHand[currentHand * 16 + 1]
- playerHand[currentHand * 16 + 1] = cardsDealt
- cardsDealt += 1
- playerHand[i + 1] = cardsDealt
- cardsDealt += 1
- *clr & cla
- *pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
- wait 750
- gt 'casino', 'player'
- end
- end
- end
- act '<<$text>>Stay' :
- currentHand += 1
- cla
- wait 500
- if currentHand < numHands: gt 'casino', 'player'
- if currentHand >= numHands: gt 'casino', 'dealer'
- end
- end
- end
- if $ARGS[0] = 'dealer':
- gs 'casino', 'blackjack_view', 1
- if dealerPoints < 17:
- act 'Continue' :
- i = 2
- :loop4
- if dealerHand[i] ! 0: i += 1 & jump 'loop4'
- dealerHand[i] = cardsDealt
- cardsDealt += 1
- *clr & cla
- *pl '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
- wait 750
- gt 'casino', 'dealer'
- end
- elseif dealerPoints > 21:
- betTotal = 0
- i = 0
- :loop5
- if playerPoints[i] <= 21: betTotal += playerBets[i]
- i += 1
- if i < numHands: jump 'loop5'
- *pl 'PLAYER WINS'
- *p 'You receive <<betTotal>> <b>₽</b> in winnings.'
- money += betTotal
- act 'Continue' : gt 'casino', 'blackjack_play'
- else
- betTotal = 0
- i = 0
- :loop6
- if playerPoints[i] > 21:
- betTotal -= playerBets[i]
- elseif playerPoints[i] < dealerPoints:
- betTotal -= playerBets[i]
- elseif playerpoints[i] > dealerPoints:
- betTotal += playerBets[i]
- end
- i += 1
- if i < numHands: jump 'loop6'
- if betTotal = 0:
- *pl 'DRAW GAME'
- if numHands = 1: *p 'You retrieve your bet.'
- if numHands > 1: *p 'You retrieve your bets.'
- elseif betTotal < 0:
- *pl 'DEALER WINS'
- if numHands > 1: *p 'After taking into account all the hands, you have lost. '
- *p 'The dealer relieves you of <<0 - betTotal>> <b>₽</b>.'
- else
- *pl 'PLAYER WINS'
- if numHands > 1: *p 'After taking into account all the hands, you have won. '
- *p 'You receive <<betTotal>> <b>₽</b> in winnings.'
- end
- money += betTotal
- act 'Continue' : gt 'casino', 'blackjack_play'
- end
- end
- if $ARGS[0] = 'blackjack_view':
- *pl '<table width="100%"><tr><td>'
- *pl '<u>Dealer</u>'
- if ARGS[1] = 0:
- *p '<img <<$set_imgh>> src="<<$deckImg[dealerHand[0]]>>">'
- *pl '<img <<$set_imgh>> src="images/locations/city/industrial/casino/cards/back.jpg">'
- else
- numAces = 0
- dealerPoints = 0
- i = 0
- :loop7
- *p '<img <<$set_imgh>> src="<<$deckImg[dealerHand[i]]>>">'
- if deckFace[dealerHand[i]] = 1:
- dealerPoints += 11
- numAces += 1
- elseif deckFace[dealerHand[i]] > 9:
- dealerPoints += 10
- else
- dealerPoints += deckFace[dealerHand[i]]
- end
- i += 1
- if dealerHand[i] ! 0: jump 'loop7'
- :loop2
- if dealerPoints > 21 and numAces > 0:
- dealerPoints -= 10
- numAces -= 1
- jump 'loop2'
- end
- if dealerPoints > 21:
- *p '<br>BUST!'
- elseif dealerPoints = 21 and dealerHand[2] = 0:
- *p '<br>BLACKJACK!'
- else
- *p '<br><<dealerPoints>> points'
- end
- end
- *pl '<br><br><u>Player</u>'
- i = 0
- :loop3
- numAces = 0
- playerPoints[i] = 0
- if numHands > 1: *pl 'Hand #<<i + 1>>:'
- j = 0
- :loop4
- if playerHand[i * 16 + j] ! 0:
- *p '<img <<$set_imgh>> src="<<$deckImg[playerHand[i * 16 + j]]>>">'
- if deckFace[playerHand[i * 16 + j]] = 1:
- playerPoints[i] += 11
- numAces += 1
- elseif deckFace[playerHand[i * 16 + j]] > 9:
- playerPoints[i] += 10
- else
- playerPoints[i] += deckFace[playerHand[i * 16 + j]]
- end
- j += 1
- jump 'loop4'
- end
- :loop8
- if playerPoints[i] > 21 and numAces > 0:
- playerPoints[i] -= 10
- numAces -= 1
- jump 'loop8'
- end
- if playerPoints[i] > 21:
- *p '<br>BUST!'
- elseif playerPoints[i] = 21 and playerHand[2] = 0 and numHands = 1:
- *p '<br>BLACKJACK!'
- else
- *p '<br><<playerPoints[i]>> points |'
- end
- *p ' Bet = <<playerBets[i]>> <b>₽</b><br><br>'
- i += 1
- if i < numHands: jump 'loop3'
- *pl '</td><td valign="top"><div align="right"><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbd.jpg"></div></td></tr></table>'
- end
- --- casino ---------------------------------
|