casino.qsrc 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081
  1. # casino
  2. $loc = 'casino'
  3. $menu_loc = 'casino'
  4. if $ARGS[0] = 'outside':
  5. $metka = 'outside'
  6. $menu_arg = 'outside'
  7. menu_off = 0
  8. *clr & cla
  9. gs 'stat'
  10. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/zdcasino.jpg"></right>'
  11. 'You stand in front of the door of the huge building casinos.'
  12. act 'Return to the city industrial area': minut += 10 & gt 'nord'
  13. act 'Enter the casino': gt 'casino', 'foyer'
  14. !!if tobiQW < 1000:tobiQW = 1000
  15. end
  16. if $ARGS[0] = 'foyer':
  17. $metka = $ARGS[0]
  18. $menu_arg = $ARGS[0]
  19. menu_off = 0
  20. *clr & cla
  21. minut += 1
  22. gs 'stat'
  23. picrand = rand(1, 3)
  24. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/hcasino<<picrand>>.jpg"></right>'
  25. 'You enter the foyer of the casino, there are lots of games .'
  26. *nl
  27. 'In the hall are various <a href="exec:gt ''casino'', ''slots''">slot machines</a>.'
  28. 'In the games room there is <a href="exec:gt ''casino'', ''roulette''">Roulette</a> and <a href="exec:gt ''casino'', ''cards''">card games</a>.'
  29. act 'Go outside': gt 'casino', 'outside'
  30. act 'Go to the slot machines': gt 'casino', 'slots'
  31. act 'Go to the roulette table': gt 'casino', 'roulette'
  32. act 'Go to the card tables': gt 'casino', 'cards'
  33. end
  34. !!----------
  35. !! Roulette
  36. !!----------
  37. if $ARGS[0] = 'roulette':
  38. $metka = $ARGS[0]
  39. $menu_arg = $ARGS[0]
  40. menu_off = 0
  41. *clr & cla
  42. minut += 1
  43. gs 'stat'
  44. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/ruletka.jpg"></right>'
  45. 'You came to the table with American roulette.'
  46. act 'Go back to the foyer': gt 'casino', 'foyer'
  47. act 'Play roulette': gt 'casino', 'roulette_bet1'
  48. act 'Approach the croupier':
  49. *clr & cla
  50. menu_off = 1
  51. minut += 1
  52. gs 'stat'
  53. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/crup.jpg"></right>'
  54. '"Can I help you?" He asks.'
  55. act 'Shake your head and move away': gt 'casino', 'roulette'
  56. act 'Ask rules':
  57. msg 'The rules are very simple.
  58. First you choose the amount you want to bet.
  59. But in our casino maximum amount is 1000 <b>₽</b>.
  60. Then you choose where to put your chips. There are six different types of bets:
  61. 1. Red/Black (Payout: 1 to 1)
  62. 2. Even/Odd (Payout: 1 to 1)
  63. 3. Small/Large (Payout: 1 to 1)
  64. 4. Dozen (Payout: 1 to 3)
  65. 5. Series (Payout: 1 to 3)
  66. 6. Number (Payout: 1 to 36)
  67. And the rest depends on your luck.'
  68. gt 'casino', 'roulette'
  69. end
  70. end
  71. end
  72. if $ARGS[0] = 'roulette_bet1':
  73. *clr & cla
  74. menu_off = 1
  75. minut += 1
  76. kh = 0
  77. chnch = 0
  78. mb = 0
  79. du = 0
  80. series = 0
  81. chi = 100
  82. x_rul = 100
  83. gs 'stat'
  84. '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/amrul.jpg"></center>'
  85. 'The maximum amount you can bet is 1000 <b>₽</b>.'
  86. 'You lean over the table.'
  87. act 'Move away from the table':gt 'roulette'
  88. act 'Make a bet':
  89. st_1 = input 'Enter the amount'
  90. if money < st_1:
  91. msg '<br>You don''t have enough money.'
  92. gt 'casino', 'roulette_bet1'
  93. elseif st_1 <= 0:
  94. msg '<br>You can''t bet zero or a negative amount.'
  95. gt 'casino', 'roulette_bet1'
  96. elseif st_1 > 1000:
  97. msg '<br>The maximum amount you can bet is 1000 <b>₽</b>'
  98. gt 'casino', 'roulette_bet1'
  99. else
  100. money -= st_1
  101. gt 'casino', 'roulette_bet2'
  102. end
  103. end
  104. end
  105. if $ARGS[0] = 'roulette_bet2':
  106. *clr & cla
  107. minut += 1
  108. kh = 0
  109. chnch = 0
  110. mb = 0
  111. du = 0
  112. series = 0
  113. chi = 100
  114. gs 'stat'
  115. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/stavkaru.jpg"></right>'
  116. 'Where do you put your chips?'
  117. act 'Don''t bet':
  118. money += st_1
  119. gt 'casino', 'roulette_bet1'
  120. end
  121. act 'Red / Black':
  122. act 'Reconsider': gt 'casino', 'roulette_bet2'
  123. act 'Red': kh = 1 & gt 'casino', 'roulette_result'
  124. act 'Black': kh = 2 & gt 'casino', 'roulette_result'
  125. end
  126. act 'Even / Odd':
  127. act 'Reconsider': gt 'casino', 'roulette_bet2'
  128. act 'Even': chnch = 1 & gt 'casino', 'roulette_result'
  129. act 'Odd': chnch = 2 & gt 'casino', 'roulette_result'
  130. end
  131. act 'Small / Large':
  132. act 'Reconsider': gt 'casino', 'roulette_bet2'
  133. act 'Small: 1-18': mb = 1 & gt 'casino', 'roulette_result'
  134. act 'Large: 19-36': mb = 2 & gt 'casino', 'roulette_result'
  135. end
  136. act 'Dozen':
  137. act 'Reconsider': gt 'casino', 'roulette_bet2'
  138. act 'First dozen: 1-12': du = 1 & gt 'casino', 'roulette_result'
  139. act 'Second dozen: 13-24': du = 2 & gt 'casino', 'roulette_result'
  140. act 'Third dozen:25-36': du = 3 & gt 'casino', 'roulette_result'
  141. end
  142. act 'Series':
  143. act 'Reconsider': gt 'casino', 'roulette_bet2'
  144. act 'First row: 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34': series = 1 & gt 'casino', 'roulette_result'
  145. act 'Second row: 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35': series = 2 & gt 'casino', 'roulette_result'
  146. act 'Third row: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36': series = 3 & gt 'casino', 'roulette_result'
  147. end
  148. act 'Number':
  149. chi = input 'Enter a number from 0-36'
  150. if chi < 0 and chi > 36:
  151. msg 'You need to choose a number between 0 and 36.'
  152. gt 'casino', 'roulette_bet2'
  153. else
  154. gt 'casino', 'roulette_result'
  155. end
  156. end
  157. end
  158. if $ARGS[0] = 'roulette_result':
  159. cla
  160. minut += 5
  161. gs 'stat'
  162. x_rul = 100
  163. x_rul = rand(0, 36)
  164. if x_rul = 0:
  165. $color = ' '
  166. else
  167. 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:
  168. $color = 'red'
  169. else
  170. $color = 'black'
  171. end
  172. end
  173. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/resul.jpg"></right>'
  174. *nl
  175. 'The ball stopps at <<x_rul>> <<$color>>'
  176. if kh ! 0:
  177. if kh = 1:
  178. 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:
  179. act 'You have won <<2 * st_1>>':
  180. money += 2 * st_1
  181. gt 'casino', 'roulette_bet1'
  182. end
  183. else
  184. act 'You have lost':gt 'casino', 'roulette_bet1'
  185. end
  186. elseif kh = 2:
  187. 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:
  188. act 'You have won <<2 * st_1>>':
  189. money += 2 * st_1
  190. gt 'casino', 'roulette_bet1'
  191. end
  192. else
  193. act 'You have lost':gt 'casino', 'roulette_bet1'
  194. end
  195. end
  196. elseif chnch ! 0:
  197. if chnch = 1:
  198. chnch = 0
  199. if x_rul mod 2 = 0:
  200. act 'You have won <<2 * st_1>>':
  201. money += 2 * st_1
  202. gt 'casino', 'roulette_bet1'
  203. end
  204. else
  205. act 'You have lost':gt 'casino', 'roulette_bet1'
  206. end
  207. elseif chnch = 2:
  208. chnch = 0
  209. if x_rul mod 2 = 1:
  210. act 'You have won <<2 * st_1>>':
  211. money += 2 * st_1
  212. gt 'casino', 'roulette_bet1'
  213. end
  214. else
  215. act 'You have lost':gt 'casino', 'roulette_bet1'
  216. end
  217. end
  218. elseif mb ! 0:
  219. if mb = 1:
  220. mb = 0
  221. if x_rul > 0 and x_rul < 19:
  222. act 'You have won <<2 * st_1>>':
  223. money += 2 * st_1
  224. gt 'casino', 'roulette_bet1'
  225. end
  226. else
  227. act 'You have lost':gt 'casino', 'roulette_bet1'
  228. end
  229. elseif mb = 2:
  230. mb = 0
  231. if x_rul > 18 and x_rul < 37:
  232. act 'You have won <<2 * st_1>>':
  233. money += 2 * st_1
  234. gt 'casino', 'roulette_bet1'
  235. end
  236. else
  237. act 'You have lost':gt 'casino', 'roulette_bet1'
  238. end
  239. end
  240. elseif du ! 0:
  241. if du = 1:
  242. du = 0
  243. if x_rul > 0 and x_rul < 13:
  244. act 'You have won <<3 * st_1>>':
  245. money += 3 * st_1
  246. gt 'casino', 'roulette_bet1'
  247. end
  248. else
  249. act 'You have lost':gt 'casino', 'roulette_bet1'
  250. end
  251. elseif du = 2:
  252. du = 0
  253. if x_rul > 12 and x_rul < 25:
  254. act 'You have won <<3 * st_1>>':
  255. money += 3 * st_1
  256. gt 'casino', 'roulette_bet1'
  257. end
  258. else
  259. act 'You have lost':gt 'casino', 'roulette_bet1'
  260. end
  261. elseif du = 3:
  262. du = 0
  263. if x_rul > 24 and x_rul < 37:
  264. act 'You have won <<3 * st_1>>':
  265. money += 3 * st_1
  266. gt 'casino', 'roulette_bet1'
  267. end
  268. else
  269. act 'You have lost':gt 'casino', 'roulette_bet1'
  270. end
  271. end
  272. elseif series ! 0:
  273. if series = 1:
  274. series = 0
  275. 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:
  276. act 'You have won <<3*st_1>>':
  277. money += 3 * st_1
  278. gt 'casino', 'roulette_bet1'
  279. end
  280. else
  281. act 'You have lost':gt 'casino', 'roulette_bet1'
  282. end
  283. elseif series = 2:
  284. series = 0
  285. 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:
  286. act 'You have won <<3*st_1>>':
  287. money += 3 * st_1
  288. gt 'casino', 'roulette_bet1'
  289. end
  290. else
  291. act 'You have lost':gt 'casino', 'roulette_bet1'
  292. end
  293. elseif series = 3:
  294. series = 0
  295. 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:
  296. act 'You have won <<3*st_1>>':
  297. money += 3 * st_1
  298. gt 'casino', 'roulette_bet1'
  299. end
  300. else
  301. act 'You have lost':gt 'casino', 'roulette_bet1'
  302. end
  303. end
  304. elseif chi ! 100:
  305. if chi = x_rul:
  306. act 'You have won <<37 * st_1>>':
  307. money += 37 * st_1
  308. gt 'casino', 'roulette_bet1'
  309. end
  310. else
  311. act 'You have lost':gt 'casino', 'roulette_bet1'
  312. end
  313. end
  314. end
  315. !!-------
  316. !! Slots
  317. !!-------
  318. if $ARGS[0] = 'slots':
  319. $metka = $ARGS[0]
  320. $menu_arg = $ARGS[0]
  321. menu_off = 0
  322. *clr & cla
  323. minut += 1
  324. gs 'stat'
  325. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/zaligravt.jpg"></right>'
  326. '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.'
  327. 'Every once in a while you hear the satisfying sound of coins streaming into the tray of the next lucky winner.'
  328. 'According to the huge animated digital display on the back wall, there is a hefty jackpot up for grabs.'
  329. act 'Go to the foyer': gt 'casino', 'foyer'
  330. act 'Use one of the slot machines':
  331. *clr & cla
  332. menu_off = 1
  333. minut += 1
  334. gs 'stat'
  335. betAmount = 10
  336. slotsJackpot = betAmount * 20000
  337. '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/avt.jpg"></center>'
  338. '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.'
  339. act 'Go back to the foyer': gt 'casino', 'foyer'
  340. act 'Pull the lever':
  341. if money >= betAmount:
  342. money -= betAmount
  343. slotsRand = rand(1, 100000)
  344. if slotsRand > 99990:
  345. winnings = slotsJackpot
  346. msg 'Jackpot! What are the odds!?'
  347. elseif slotsRand >= 99900:
  348. winnings = betAmount * 1500
  349. elseif slotsRand >= 99000:
  350. winnings = betAmount * 100
  351. elseif slotsRand >= 90000:
  352. winnings = betAmount * 5
  353. elseif slotsRand >= 66667:
  354. winnings = betAmount * 2
  355. else
  356. winnings = 0
  357. end
  358. if winnings > 0:
  359. money += winnings
  360. msg 'You have won <<winnings>> <b>₽</b>.'
  361. else
  362. msg 'You have lost. Try again?'
  363. end
  364. minut += 1
  365. gs 'stat'
  366. gt 'casino', 'slots'
  367. else
  368. 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.'
  369. gt 'casino', 'slots'
  370. end
  371. killvar 'slotsRand'
  372. killvar 'winnings'
  373. end
  374. end
  375. end
  376. !!-------
  377. !! Cards
  378. !!-------
  379. if $ARGS[0] = 'cards':
  380. $metka = $ARGS[0]
  381. $menu_arg = $ARGS[0]
  382. menu_off = 0
  383. *clr & cla
  384. minut += 1
  385. gs 'stat'
  386. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/zalcart.jpg"></right>'
  387. 'In the hall a lot of free games tables in Blackjack and Casino Wars.'
  388. act 'Go back to the foyer': gt 'casino', 'foyer'
  389. act 'Play Blackjack': gt 'casino', 'blackjack_play'
  390. act 'Play Casino War': gt 'cards_cw'
  391. !!SYMBOLS
  392. !! ♥
  393. !! ♠
  394. !! ♦
  395. !! ♣
  396. !!deck of cards
  397. $suit[1] = 'Spades'
  398. $symbol[1] = '♠'
  399. $suit[2] = 'Clubs'
  400. $symbol[2] = '♣'
  401. $suit[3] = 'Hearts'
  402. $symbol[3] = '♥'
  403. $suit[4] = 'Diamonds'
  404. $symbol[4] = '♦'
  405. $number[1] = 'Ace '
  406. points[1] = 11
  407. $number[2] = 'Deuce '
  408. points[2] = 2
  409. $number[3] = 'Three '
  410. points[3] = 3
  411. $number[4] = 'Four '
  412. points[4] = 4
  413. $number[5] = 'Five '
  414. points[5] = 5
  415. $number[6] = 'Six '
  416. points[6] = 6
  417. $number[7] = 'Seven '
  418. points[7] = 7
  419. $number[8] = 'Eight '
  420. points[8] = 8
  421. $number[9] = 'Nine '
  422. points[9] = 9
  423. $number[10] = 'Ten '
  424. points[10] = 10
  425. $number[11] = 'Jack '
  426. points[11] = 10
  427. $number[12] = 'Queen '
  428. points[12] = 10
  429. $number[13] = 'King '
  430. points[13] = 10
  431. $number[14] = 'Ace '
  432. points[14] = 11
  433. end
  434. !!--------------------
  435. !! Cards: Casino Wars
  436. !!--------------------
  437. if $ARGS[0] = 'cards_cw':
  438. $metka = $ARGS[0]
  439. $menu_arg = $ARGS[0]
  440. menu_off = 0
  441. *clr & cla
  442. minut += 1
  443. gs 'stat'
  444. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/stolcw.jpg"></right>'
  445. 'You approach the gambling table at the casino.'
  446. act 'Move away from the table': gt 'casino', 'cards'
  447. act 'Sit down at the table': gt 'casino', 'cards_cwplay'
  448. act 'Approach the croupier':
  449. *clr & cla
  450. menu_off = 1
  451. minut += 1
  452. gs 'stat'
  453. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/crupcw.jpg"></right>'
  454. '"How can I help you?"'
  455. act 'Move away from the dealer': gt 'casino', 'cards_cw'
  456. act 'Ask for the rules':
  457. msg 'The rules are very simple.
  458. First you choose how much you want to wager.
  459. But note that in our casino maximum rate is 1000 <b>₽</b>.
  460. 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.
  461. Regular:
  462. Everyone is dealt a card. Face cards have different values.
  463. Highest card wins. Payout is 1 to 1.
  464. If both have the same card, choose between continuing (doubles bet), or end the round and return your bet.
  465. 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.
  466. Bet on draw:
  467. When betting on a draw and winning, you get your bet back.
  468. However, if it is a draw, the payout will be 10 to 1.
  469. That''s it. Enjoy the game.'
  470. gt 'casino', 'cards_cw'
  471. end
  472. end
  473. end
  474. if $ARGS[0] = 'casino_cwplay':
  475. *clr & cla
  476. menu_off = 1
  477. minut += 1
  478. gs 'stat'
  479. if turn1 = 0:
  480. cla
  481. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/stavkacw.jpg"></right>'
  482. 'Place your bets, ladies and gentlemen.'
  483. act 'Place your bet':
  484. if money < 1:
  485. 'You don''t have any money!'
  486. act 'Leave the table': gt 'casino', 'cards_cw'
  487. end
  488. bet_amount = input 'Enter the amount to bet'
  489. if money < bet_amount:
  490. msg 'You don''t have enough money to bet that much'
  491. elseif bet_amount < 1:
  492. msg 'You must place a minimum bet of 1 <b>₽</b>.'
  493. elseif bet_amount > 1000:
  494. msg 'The maximum bet allowed is 1000 <b>₽</b>.'
  495. else
  496. money -= bet_amount
  497. turn1 = 1
  498. end
  499. gt 'casino', 'casino_cwplay'
  500. end
  501. act 'Leave the table': gt 'casino', 'cards_cw'
  502. end
  503. if turn1 = 1:
  504. cla
  505. bet_draw = 0
  506. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/stavkacw.jpg"></right>'
  507. 'Continue with regular bet (payout 2 to 1), or bet on a draw (payout 11 to 1)?'
  508. if money < bet_amount:
  509. turn1 = 2
  510. gt 'casino', 'casino_cwplay'
  511. else
  512. act 'Continue with regular bet':
  513. turn1 = 2
  514. gt 'casino', 'casino_cwplay'
  515. end
  516. act 'Bet on draw (doubles bet)':
  517. turn1 = 2
  518. bet_draw = 1
  519. money -= bet_amount
  520. gt 'casino', 'casino_cwplay'
  521. end
  522. end
  523. end
  524. if turn1 = 2:
  525. cla
  526. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartcw.jpg"></right>'
  527. ' The dealer deals the cards:'
  528. '...'
  529. suit = rand(1, 4)
  530. number = rand(1, 13)
  531. $d_card[1] = $number[number] + 'of ' + $suit[suit]
  532. d_points = number
  533. suit = rand(1, 4)
  534. !! Player draws from cards 2-14 so that they win if both they and the dealer draw an ace
  535. number = rand(2, 14)
  536. $p_card[1] = $number[number] + 'of ' + $suit[suit]
  537. p_points = number
  538. wait 1000
  539. 'Dealer''s Card:'
  540. '  <<$d_card[1]>>'
  541. '__________________________'
  542. 'Your Card:'
  543. '  <<$p_card[1]>>'
  544. if d_points > p_points:
  545. ' '
  546. 'Casino won'
  547. act 'You lost':
  548. turn1 = 0
  549. gt 'casino', 'casino_cwplay'
  550. end
  551. elseif d_points < p_points:
  552. ' '
  553. 'You won'
  554. act 'Take money (<<2 * bet_amount>> <b>₽</b>)':
  555. money += 2 * bet_amount
  556. turn1 = 0
  557. gt 'casino', 'casino_cwplay'
  558. end
  559. else
  560. if bet_draw = 1:
  561. ' '
  562. 'You won'
  563. act 'Take money (<<11 * bet_amount>> <b>₽</b>)':
  564. money += 11 * bet_amount
  565. turn1 = 0
  566. gt 'casino', 'casino_cwplay'
  567. end
  568. else
  569. turn1 = 3
  570. gt 'casino', 'casino_cwplay'
  571. end
  572. end
  573. end
  574. if turn1 = 3:
  575. '<right><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartcw.jpg"></right>'
  576. ' '
  577. 'Draw'
  578. if money >= bet_amount:
  579. act 'Continue (bet another <<bet_amount>> <b>₽</b>)':
  580. cla
  581. money -= bet_amount
  582. ' The dealer deals the cards:'
  583. '...'
  584. suit = rand(1, 4)
  585. number = rand(1, 13)
  586. $d_card[2] = $number[number] + 'of ' + $suit[suit]
  587. d_points = number
  588. suit = rand(1, 4)
  589. number = rand(2, 14)
  590. $p_card[2] = $number[number] + 'of ' + $suit[suit]
  591. p_points = number
  592. 'Dealer''s Cards:'
  593. '  <<$d_card[1]>>'
  594. '  <<$d_card[2]>>'
  595. '__________________________'
  596. 'Your Cards:'
  597. '  <<$p_card[1]>>'
  598. '  <<$p_card[2]>>'
  599. if d_points > p_points:
  600. ' '
  601. 'Casino won'
  602. act 'You lost':
  603. turn1 = 0
  604. gt 'casino', 'casino_cwplay'
  605. end
  606. elseif d_points < p_points:
  607. ' '
  608. 'You won'
  609. act 'Take money (<<4 * bet_amount>> <b>₽</b>)':
  610. money += 4 * bet_amount
  611. turn1 = 0
  612. gt 'casino', 'casino_cwplay'
  613. end
  614. elseif d_points = p_points:
  615. ' '
  616. 'Draw'
  617. act 'Take money (<<3 * bet_amount>> <b>₽</b>)':
  618. money += 3 * bet_amount
  619. turn1 = 0
  620. gt 'casino', 'casino_cwplay'
  621. end
  622. end
  623. end
  624. else
  625. ' '
  626. 'You don''t have enough money to continue'
  627. end
  628. act 'Take original bet (<<bet_amount>> <b>₽</b>)':
  629. money += bet_amount
  630. turn1 = 0
  631. gt 'casino', 'casino_cwplay'
  632. end
  633. end
  634. end
  635. !!--------------------
  636. !! Cards: Blackjack
  637. !!--------------------
  638. if $ARGS[0] = 'blackjack_play':
  639. menu_off = 1
  640. minut += 1
  641. gs 'stat'
  642. killvar 'dealerHand'
  643. killvar 'playerHand'
  644. killvar 'playerBets'
  645. killvar 'playerPoints'
  646. dealerHand[] = 0
  647. dealerHand[] = 1
  648. playerHand[] = 2
  649. playerHand[] = 3
  650. cardsDealt = 4
  651. numHands = 1
  652. currentHand = 0
  653. handLosses = 0
  654. numAces = 0
  655. dealerPoints = 0
  656. insurance = 0
  657. betTotal = 0
  658. doubleBet = 0
  659. minBet = 10
  660. maxBet = 500
  661. *PL '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/stolbd.jpg"></center>'
  662. *PL 'You are sitting at the blackjack table.'
  663. act 'Move away from the table' : gt 'casino', 'cards'
  664. act 'Play blackjack' : gt 'casino', 'bet'
  665. act 'Ask for the rules' : gt 'casino', 'rules'
  666. end
  667. if $ARGS[0] = 'rules':
  668. *PL '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/crupbd.jpg"></center>'
  669. *PL '<h2><u>Blackjack Rules:</u></h2>'
  670. *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>'
  671. *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>'
  672. *P '<li>After the player finishes drawing, the dealer must continue to draw until he has 17 points or more.</li>'
  673. *P '<li>To win, the player must score more points than the dealer, have the dealer bust, or get a blackjack.</li>'
  674. *P '<li>Getting over 21 points is known as a bust, and an automatic loss.</li>'
  675. *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>'
  676. *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>'
  677. *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>'
  678. *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>'
  679. *P '<li>The player cannot score a blackjack using a split hand.</li>'
  680. act 'Return' : gt 'casino', 'blackjack_play'
  681. end
  682. if $ARGS[0] = 'bet':
  683. *PL '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/stavkabd.jpg"></center>'
  684. playerBets[0] = INPUT('Place your bet.')
  685. if money < playerBets[0]:
  686. MSG 'You don''t have enough money for that bet.'
  687. gt 'casino', 'blackjack_play'
  688. elseif playerBets[0] < minBet:
  689. MSG 'There is a minimum bet of <<minBet>> <b>₽</b>.'
  690. gt 'casino', 'blackjack_play'
  691. elseif playerBets[0] > maxBet:
  692. MSG 'There is a maximum bet of <<maxBet>> <b>₽</b>.'
  693. gt 'casino', 'blackjack_play'
  694. end
  695. betTotal = playerBets[0]
  696. gs 'deckShuffle'
  697. if (deckFace[playerHand[0]] = 1 and deckFace[playerHand[1]] > 9) or (deckFace[playerHand[0]] > 9 and deckFace[playerHand[1]] = 1):
  698. gt 'casino', 'blackjack'
  699. elseif deckFace[dealerHand[0]] > 9 and deckFace[dealerHand[1]] = 1:
  700. gt 'casino', 'blackjack'
  701. elseif deckFace[dealerCards[0]] = 1:
  702. gt 'casino', 'insurance1'
  703. else
  704. gt 'casino', 'player'
  705. end
  706. end
  707. if $ARGS[0] = 'blackjack':
  708. gs 'casino', 'blackjack_view', 1
  709. if playerPoints[0] = 21 and dealerPoints = 21:
  710. *PL 'DRAW GAME'
  711. *PL 'You retrieve your bet.'
  712. elseif playerPoints[0] = 21:
  713. *PL 'PLAYER WINS'
  714. *PL 'You receive <<playerBets[0] * 3 / 2>> <b>₽</b> in winnings.'
  715. money += playerBets[0] * 3 / 2
  716. else
  717. *PL 'DEALER WINS'
  718. *PL 'The dealer takes your <<playerBets[0]>> <b>₽</b> bet.'
  719. money -= playerBets[0]
  720. end
  721. act 'Continue' : gt 'casino', 'blackjack_play'
  722. end
  723. if $ARGS[0] = 'insurance1':
  724. gs 'casino', 'blackjack_view'
  725. *PL 'The dealer has an ace showing. Would you like to place a bet for insurance?'
  726. insurance = 0
  727. act 'Bet insurance' :
  728. insurance = INPUT('Place your bet.')
  729. if money < insurance:
  730. MSG 'You don''t have enough money for that bet.'
  731. gt 'casino', 'insurance1'
  732. elseif insurance < 0:
  733. MSG 'You cannot bet a negative amount of money.'
  734. gt 'casino', 'insurance1'
  735. elseif insurance > playerBets[0] / 2:
  736. MSG 'Insurance cannot exceed half the original bet.'
  737. gt 'casino', 'insurance1'
  738. else
  739. gt 'casino', 'insurance2'
  740. end
  741. end
  742. act 'No insurance' : gt 'casino', 'insurance2'
  743. end
  744. if $ARGS[0] = 'insurance2':
  745. if deckFace[dealerCards[1]] > 9: gs 'casino', 'blackjack_view', 1
  746. if deckFace[dealerCards[1]] < 10: gs 'casino', 'blackjack_view'
  747. if dealerPoints = 21:
  748. *PL 'DEALER WINS'
  749. *P 'The dealer takes your <<playerBets[0]>> <b>₽</b> bet'
  750. if insurance > 0: *P ' but also gives you <<insurance>> <b>₽</b> for your side bet'
  751. *P '.'
  752. money -= playerBets[0]
  753. money += insurance
  754. act 'Continue' : gt 'casino', 'blackjack_play'
  755. else
  756. *PL 'The dealer takes a peek at his hole card; no blackjack.'
  757. if insurance > 0: *P 'He relieves you of <<insurance>> <b>₽</b> for your side bet.'
  758. money -= insurance
  759. act 'Continue' :
  760. CLA
  761. wait 500
  762. gt 'casino', 'player'
  763. end
  764. end
  765. end
  766. if $ARGS[0] = 'player':
  767. gs 'casino', 'blackjack_view'
  768. if playerPoints[currentHand] > 21: currentHand += 1 & handLosses += 1 & doubleBet = 0
  769. if playerPoints[currentHand] = 21 or doubleBet = 1: currentHand += 1 & doubleBet = 0
  770. if handLosses = numHands:
  771. *PL 'DEALER WINS'
  772. *P 'The dealer relieves you of <<betTotal>> <b>₽</b>.'
  773. money -= betTotal
  774. act 'Continue' : gt 'casino', 'blackjack_play'
  775. elseif currentHand >= numHands:
  776. *PL 'You can take no further actions.'
  777. act 'Continue' :
  778. cla
  779. wait 500
  780. gt 'casino', 'dealer'
  781. end
  782. else
  783. if numHands = 1:
  784. *PL 'You are considering actions for your hand.'
  785. $text = ''
  786. else
  787. *PL 'You are considering your actions for <b>hand #<<currentHand + 1>></b>.'
  788. $text = 'Hand #<<currentHand + 1>>: '
  789. end
  790. act '<<$text>>Hit' :
  791. i = currentHand * 16 + 2
  792. :loop1
  793. if playerHand[i] ! 0: i += 1 & jump 'loop1'
  794. playerHand[i] = cardsDealt
  795. cardsDealt += 1
  796. *clr & cla
  797. *PL '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
  798. wait 750
  799. gt 'casino', 'player'
  800. end
  801. if money >= betTotal + playerBets[currentHand]:
  802. act '<<$text>>Double' :
  803. doubleBet = 1
  804. betTotal += playerBets[currentHand]
  805. playerBets[currentHand] += playerBets[currentHand]
  806. i = currentHand * 16 + 2
  807. :loop2
  808. if playerHand[i] ! 0: i += 1 & jump 'loop2'
  809. playerHand[i] = cardsDealt
  810. cardsDealt += 1
  811. *clr & cla
  812. *PL '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
  813. wait 750
  814. gt 'casino', 'player'
  815. end
  816. 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]]):
  817. act '<<$text>>Split' :
  818. betTotal += playerBets[currentHand]
  819. playerBets[numHands] = playerBets[currentHand]
  820. numHands += 1
  821. i = (currentHand + 1) * 16
  822. :loop3
  823. if playerHand[i] ! 0: i += 16 & jump 'loop3'
  824. playerHand[i] = playerHand[currentHand * 16 + 1]
  825. playerHand[currentHand * 16 + 1] = cardsDealt
  826. cardsDealt += 1
  827. playerHand[i + 1] = cardsDealt
  828. cardsDealt += 1
  829. *clr & cla
  830. *PL '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
  831. wait 750
  832. gt 'casino', 'player'
  833. end
  834. end
  835. end
  836. act '<<$text>>Stay' :
  837. currentHand += 1
  838. cla
  839. wait 500
  840. if currentHand < numHands: gt 'casino', 'player'
  841. if currentHand >= numHands: gt 'casino', 'dealer'
  842. end
  843. end
  844. end
  845. if $ARGS[0] = 'dealer':
  846. gs 'casino', 'blackjack_view', 1
  847. if dealerPoints < 17:
  848. act 'Continue' :
  849. i = 2
  850. :loop4
  851. if dealerHand[i] ! 0: i += 1 & jump 'loop4'
  852. dealerHand[i] = cardsDealt
  853. cardsDealt += 1
  854. *clr & cla
  855. *PL '<center><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbde.jpg"></center>'
  856. wait 750
  857. gt 'casino', 'dealer'
  858. end
  859. elseif dealerPoints > 21:
  860. betTotal = 0
  861. i = 0
  862. :loop5
  863. if playerPoints[i] <= 21: betTotal += playerBets[i]
  864. i += 1
  865. if i < numHands: jump 'loop5'
  866. *PL 'PLAYER WINS'
  867. *P 'You receive <<betTotal>> <b>₽</b> in winnings.'
  868. money += betTotal
  869. act 'Continue' : gt 'casino', 'blackjack_play'
  870. else
  871. betTotal = 0
  872. i = 0
  873. :loop6
  874. if playerPoints[i] > 21:
  875. betTotal -= playerBets[i]
  876. elseif playerPoints[i] < dealerPoints:
  877. betTotal -= playerBets[i]
  878. elseif playerpoints[i] > dealerPoints:
  879. betTotal += playerBets[i]
  880. end
  881. i += 1
  882. if i < numHands: jump 'loop6'
  883. if betTotal = 0:
  884. *PL 'DRAW GAME'
  885. if numHands = 1: *P 'You retrieve your bet.'
  886. if numHands > 1: *P 'You retrieve your bets.'
  887. elseif betTotal < 0:
  888. *PL 'DEALER WINS'
  889. if numHands > 1: *P 'After taking into account all the hands, you have lost. '
  890. *P 'The dealer relieves you of <<0 - betTotal>> <b>₽</b>.'
  891. else
  892. *PL 'PLAYER WINS'
  893. if numHands > 1: *P 'After taking into account all the hands, you have won. '
  894. *P 'You receive <<betTotal>> <b>₽</b> in winnings.'
  895. end
  896. money += betTotal
  897. act 'Continue' : gt 'casino', 'blackjack_play'
  898. end
  899. end
  900. if $ARGS[0] = 'blackjack_view':
  901. *PL '<table width="100%"><tr><td>'
  902. *PL '<u>Dealer</u>'
  903. if ARGS[1] = 0:
  904. *P '<img <<$set_imgh>> src="<<$deckImg[dealerHand[0]]>>">'
  905. *PL '<img <<$set_imgh>> src="images/locations/city/industrial/casino/cards/back.jpg">'
  906. else
  907. numAces = 0
  908. dealerPoints = 0
  909. i = 0
  910. :loop1
  911. *P '<img <<$set_imgh>> src="<<$deckImg[dealerHand[i]]>>">'
  912. if deckFace[dealerHand[i]] = 1:
  913. dealerPoints += 11
  914. numAces += 1
  915. elseif deckFace[dealerHand[i]] > 9:
  916. dealerPoints += 10
  917. else
  918. dealerPoints += deckFace[dealerHand[i]]
  919. end
  920. i += 1
  921. if dealerHand[i] ! 0: jump 'loop1'
  922. :loop2
  923. if dealerPoints > 21 and numAces > 0:
  924. dealerPoints -= 10
  925. numAces -= 1
  926. jump 'loop2'
  927. end
  928. if dealerPoints > 21:
  929. *P '<br>BUST!'
  930. elseif dealerPoints = 21 and dealerHand[2] = 0:
  931. *P '<br>BLACKJACK!'
  932. else
  933. *P '<br><<dealerPoints>> points'
  934. end
  935. end
  936. *PL '<br><br><u>Player</u>'
  937. i = 0
  938. :loop3
  939. numAces = 0
  940. playerPoints[i] = 0
  941. if numHands > 1: *PL 'Hand #<<i + 1>>:'
  942. j = 0
  943. :loop4
  944. if playerHand[i * 16 + j] ! 0:
  945. *P '<img <<$set_imgh>> src="<<$deckImg[playerHand[i * 16 + j]]>>">'
  946. if deckFace[playerHand[i * 16 + j]] = 1:
  947. playerPoints[i] += 11
  948. numAces += 1
  949. elseif deckFace[playerHand[i * 16 + j]] > 9:
  950. playerPoints[i] += 10
  951. else
  952. playerPoints[i] += deckFace[playerHand[i * 16 + j]]
  953. end
  954. j += 1
  955. jump 'loop4'
  956. end
  957. :loop5
  958. if playerPoints[i] > 21 and numAces > 0:
  959. playerPoints[i] -= 10
  960. numAces -= 1
  961. jump 'loop5'
  962. end
  963. if playerPoints[i] > 21:
  964. *P '<br>BUST!'
  965. elseif playerPoints[i] = 21 and playerHand[2] = 0 and numHands = 1:
  966. *P '<br>BLACKJACK!'
  967. else
  968. *P '<br><<playerPoints[i]>> points |'
  969. end
  970. *P ' Bet = <<playerBets[i]>> <b>₽</b><br><br>'
  971. i += 1
  972. if i < numHands: jump 'loop3'
  973. *PL '</td><td valign="top"><div align="right"><img <<$set_imgh>> src="images/locations/city/industrial/casino/cartbd.jpg"></div></td></tr></table>'
  974. end
  975. --- casino ---------------------------------