chessplay.qsrc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. # chessplay
  2. menu_off = 1
  3. if $ARGS[0] = '':
  4. if $chess_name='':$chess_name='Boy'
  5. gs'stat'
  6. chess_GG = 20
  7. chess_com = 20
  8. ! chess_ind is used to show the integer difference between Sveta and her opponent
  9. ! if it is 0 then Sveta is equally skilled as her opponent
  10. ! the opponent will play more neutrally if the skill gap is within 5 points
  11. ! if it is > 0 then Sveta is less skilled then her opponent
  12. ! the opponent will play more aggressively if Sveta is less skilled by at least 5 points
  13. ! if it is < 0 then Sveta is more skilled then her opponent
  14. ! the opponent will play more conservatively if Sveta is more skilled by at least 5 points
  15. chess_ind = chessV - pcs_chess
  16. ! chess_diff is used to show how that difference affects the swing in momentum with each move
  17. if chess_ind < 0:
  18. chess_diff = (chess_ind/2)*-1
  19. else
  20. chess_diff = (chess_ind/2)
  21. end
  22. ! move_limit and time_limit keeps games from going forever
  23. chess_move_limit = 60
  24. chess_time_limit = 120
  25. ! chess_move and total_chess_time keep track of total moves and time until it hits the limits
  26. chess_move = 0
  27. total_chess_time = 0
  28. gt 'chessplay', 'game'
  29. end
  30. if $ARGS[0] = 'expfame':
  31. if ARGS[1] = 0:
  32. chessmulti = 1
  33. elseif ARGS[1] = 1:
  34. chessmulti = 3
  35. elseif ARGS[1] = 2:
  36. chessmulti = 5
  37. end
  38. if chessV=10:
  39. gs 'exp_gain', 'chess', chessmulti * 2
  40. gs 'fame', 'pav', 'chess', chessmulti * 2
  41. gs 'exp_gain', 'intel', rand(0,1)
  42. elseif chessV=30:
  43. gs 'exp_gain', 'chess', chessmulti * 4
  44. gs 'fame', 'pav', 'chess', chessmulti * 4
  45. gs 'exp_gain', 'intel', rand(1,2)
  46. elseif chessV=50:
  47. gs 'exp_gain', 'chess', chessmulti * 6
  48. gs 'fame', 'pav', 'chess', chessmulti * 6
  49. gs 'exp_gain', 'intel', rand(2,3)
  50. elseif chessV=70:
  51. gs 'exp_gain', 'chess', chessmulti * 8
  52. gs 'fame', 'pav', 'chess', chessmulti * 8
  53. gs 'exp_gain', 'intel', rand(2,4)
  54. elseif chessV=90:
  55. gs 'exp_gain', 'chess', chessmulti * 10
  56. gs 'fame', 'pav', 'chess', chessmulti * 10
  57. gs 'exp_gain', 'intel', rand(2,5)
  58. end
  59. gs 'stat'
  60. end
  61. if $ARGS[0] = 'game':
  62. chess_move += 1
  63. chess_time = rand(1,3)
  64. minut += chess_time
  65. total_chess_time += chess_time
  66. gs 'stat'
  67. if chess_move = 1:
  68. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/board' + rand(1,1) + '.jpg"></center>'
  69. *nl
  70. if chess_ind > 5:
  71. 'You are less skilled at chess than '+$chess_name+'. They will play more aggressively to try and defeat you.'
  72. 'You might want to play more conservatively and wear down their attacks.'
  73. elseif chess_ind < -5:
  74. 'You are more skilled at chess than '+$chess_name+'. They will play more conservatively to try and defeat you.'
  75. 'You might want to play more aggressively and wear down their defenses.'
  76. else
  77. 'You are about equally skilled at chess as '+$chess_name+'. They will use a wide range of moves to try and defeat you.'
  78. 'You might want to try different types of moves to keep your opponent off balance.'
  79. end
  80. end
  81. if chess_GG <= 0 and chess_com <= 0:
  82. *clr & cla
  83. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/stalemate' + rand(1,1) + '.jpg"></center>'
  84. *nl
  85. 'Stalemate! You have drawn the match against '+$chess_name+'!'
  86. 'You and '+$chess_name+' could not find a way to win the match.'
  87. gs 'chessplay', 'expfame', 1
  88. act 'Return': gt 'kruchess'
  89. elseif chess_GG <= 0:
  90. *clr & cla
  91. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/lose' + rand(1,1) + '.jpg"></center>'
  92. *nl
  93. 'Checkmate! You have lost the match against '+$chess_name+'!'
  94. gs 'chessplay', 'fame', 0
  95. act 'Return': gt 'kruchess'
  96. elseif chess_com <= 0:
  97. *clr & cla
  98. chess_win += 1
  99. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/win' + rand(1,1) + '.jpg"></center>'
  100. *nl
  101. 'Checkmate! You have won the match against '+$chess_name+'!'
  102. gs 'chessplay', 'fame', 2
  103. act 'Return': gt 'kruchess'
  104. elseif chess_moves >= chess_move_limit:
  105. *clr & cla
  106. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/stalemate' + rand(1,1) + '.jpg"></center>'
  107. *nl
  108. 'Draw! You agree to end the match with '+$chess_name+'.'
  109. 'You and '+$chess_name+' have both used too many moves and neither could find a way to win the match.'
  110. gs 'chessplay', 'fame', 1
  111. act 'Return': gt 'kruchess'
  112. elseif total_chess_time >= chess_time_limit:
  113. *clr & cla
  114. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/stalemate' + rand(1,1) + '.jpg"></center>'
  115. *nl
  116. 'Draw! You agree to end the match with '+$chess_name+'.'
  117. 'You and '+$chess_name+' have both used too much time and neither could find a way to win the match.'
  118. gs 'chessplay', 'fame', 1
  119. act 'Return': gt 'kruchess'
  120. else
  121. gs 'chessplay', 'moves'
  122. end
  123. end
  124. if $ARGS[0] = 'moves':
  125. if chess_ind > 5:
  126. chessM = rand(4,11)
  127. elseif chess_ind < -5:
  128. chessM = rand(0,7)
  129. else
  130. chessM = rand(2,9)
  131. end
  132. act 'Play conservatively':
  133. ! this works as the opposite of aggressive play
  134. ! conservative wins against offense and trap
  135. ! conservative loses to defense and tactical
  136. ! conservative ties with conservative and aggressive
  137. *clr & cla
  138. if chessM <= 1:
  139. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
  140. *nl
  141. $chess_name+' also plays conservatively.'
  142. 'Neither of you gain an advantage from this move.'
  143. elseif chessM <= 3:
  144. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
  145. *nl
  146. $chess_name+' plays defensively and is now in a better position than you.'
  147. gs 'chessplay', 'advantage', 'conservative', 'bad'
  148. elseif chessM <= 5:
  149. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
  150. *nl
  151. $chess_name+' plays tactically and is able to deftly pick apart your conservative defenses.'
  152. gs 'chessplay', 'advantage', 'conservative', 'bad'
  153. elseif chessM <= 7:
  154. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
  155. *nl
  156. $chess_name+' tries to trap you, but you encircle it with your defenses.'
  157. gs 'chessplay', 'advantage', 'conservative', 'good'
  158. elseif chessM <= 9:
  159. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
  160. *nl
  161. $chess_name+' plays offensively, but your defense repulses his attacks.'
  162. gs 'chessplay', 'advantage', 'conservative', 'good'
  163. elseif chessM <= 11:
  164. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
  165. *nl
  166. $chess_name+' plays aggressively, but your defense manages to hold them off.'
  167. 'Neither of you gain an advantage from this move.'
  168. end
  169. *nl
  170. 'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
  171. 'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
  172. chess_GG -= 1
  173. chess_com -= 1
  174. gs 'chessplay', 'game'
  175. end
  176. act 'Play defensively':
  177. ! this works as the opposite of offensive play
  178. ! defense wins against trap and conservative
  179. ! defense loses to aggressive and tactical
  180. ! defense ties with offense and defense
  181. *clr & cla
  182. if chessM <= 1:
  183. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
  184. *nl
  185. $chess_name+' plays very conservatively and does not threaten your defenses at all.'
  186. gs 'chessplay', 'advantage', 'defense', 'good'
  187. elseif chessM <= 3:
  188. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
  189. *nl
  190. $chess_name+' also plays defensively.'
  191. 'Neither of you gain an advantage from this move.'
  192. elseif chessM <= 5:
  193. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
  194. *nl
  195. $chess_name+' plays tactically and is able to deftly pick apart your defenses.'
  196. gs 'chessplay', 'advantage', 'defense', 'bad'
  197. elseif chessM <= 7:
  198. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
  199. *nl
  200. $chess_name+' tries to trap you, but you avoid it with your defenses.'
  201. gs 'chessplay', 'advantage', 'defense', 'good'
  202. elseif chessM <= 9:
  203. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
  204. *nl
  205. $chess_name+' plays offensively, but your defense absorbs his attacks.'
  206. 'Neither of you gain an advantage from this move.'
  207. elseif chessM <= 11:
  208. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
  209. *nl
  210. $chess_name+' plays aggressively and overwhelms your defenses.'
  211. gs 'chessplay', 'advantage', 'defense', 'bad'
  212. end
  213. *nl
  214. 'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
  215. 'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
  216. chess_GG -= 1
  217. chess_com -= 1
  218. gs 'chessplay', 'game'
  219. end
  220. act 'Play tactically':
  221. ! this works as the opposite of trap play
  222. ! tactical wins against defense and conservative
  223. ! tactical loses to aggressive and offense
  224. ! tactical ties with tactical and trap
  225. *clr & cla
  226. if chessM <= 1:
  227. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
  228. *nl
  229. $chess_name+' plays very conservatively and your tactical moves leave you in a better position.'
  230. gs 'chessplay', 'advantage', 'tactical', 'good'
  231. elseif chessM <= 3:
  232. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
  233. *nl
  234. $chess_name+' plays defensively allowing you to pick apart their defenses.'
  235. gs 'chessplay', 'advantage', 'tactical', 'good'
  236. elseif chessM <= 5:
  237. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
  238. *nl
  239. $chess_name+' also plays tactically.'
  240. 'Neither of you gain an advantage from this move.'
  241. elseif chessM <= 7:
  242. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
  243. *nl
  244. $chess_name+' tries to trap you, but you avoid it with your tactical movements.'
  245. 'Neither of you gain an advantage from this move.'
  246. elseif chessM <= 9:
  247. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
  248. *nl
  249. $chess_name+' plays offensively, and some of your pieces are caught out of position.'
  250. gs 'chessplay', 'advantage', 'tactical', 'bad'
  251. elseif chessM <= 11:
  252. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
  253. *nl
  254. $chess_name+' plays aggressively and rushes past your unprepared defenses.'
  255. gs 'chessplay', 'advantage', 'tactical', 'bad'
  256. end
  257. *nl
  258. 'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
  259. 'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
  260. chess_GG -= 1
  261. chess_com -= 1
  262. gs 'chessplay', 'game'
  263. end
  264. act 'Bait a trap for your opponent':
  265. ! this works as the opposite of tactical play
  266. ! trap wins against offense and aggressive
  267. ! trap loses to conservative and defense
  268. ! trap ties with tactical and trap
  269. *clr & cla
  270. if chessM <= 1:
  271. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
  272. *nl
  273. $chess_name+' plays very conservatively and their defenses are now very well prepared.'
  274. gs 'chessplay', 'advantage', 'trap', 'bad'
  275. elseif chessM <= 3:
  276. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
  277. *nl
  278. $chess_name+' plays defensively and your bait is now out of position.'
  279. gs 'chessplay', 'advantage', 'trap', 'bad'
  280. elseif chessM <= 5:
  281. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
  282. *nl
  283. $chess_name+' plays tactically and avoids your trap.'
  284. 'Neither of you gain an advantage from this move.'
  285. elseif chessM <= 7:
  286. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
  287. *nl
  288. $chess_name+' also tries to trap you.'
  289. 'Neither of you gain an advantage from this move.'
  290. elseif chessM <= 9:
  291. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
  292. *nl
  293. $chess_name+' plays offensively, and a couple of their pieces are caught out of position.'
  294. gs 'chessplay', 'advantage', 'trap', 'good'
  295. elseif chessM <= 11:
  296. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
  297. *nl
  298. $chess_name+' plays aggressively and many of their pieces fall into your trap.'
  299. gs 'chessplay', 'advantage', 'trap', 'good'
  300. end
  301. *nl
  302. 'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
  303. 'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
  304. chess_GG -= 1
  305. chess_com -= 1
  306. gs 'chessplay', 'game'
  307. end
  308. act 'Play offensively':
  309. ! this works as the opposite of defensive play
  310. ! offense wins against tactical and aggressive
  311. ! offense loses to conservative and trap
  312. ! offense ties with offense and defense
  313. *clr & cla
  314. if chessM <= 1:
  315. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
  316. *nl
  317. $chess_name+' plays very conservatively and repulses all your attacks.'
  318. gs 'chessplay', 'advantage', 'offense', 'bad'
  319. elseif chessM <= 3:
  320. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
  321. *nl
  322. $chess_name+' plays defensively and manages to absorb all your attacks.'
  323. 'Neither of you gain an advantage from this move.'
  324. elseif chessM <= 5:
  325. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
  326. *nl
  327. $chess_name+' plays tactically, but your offense is able to outmaneuver them.'
  328. gs 'chessplay', 'advantage', 'offense', 'good'
  329. elseif chessM <= 7:
  330. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
  331. *nl
  332. $chess_name+' traps some of your pieces. You should think more carefully next time.'
  333. gs 'chessplay', 'advantage', 'offense', 'bad'
  334. elseif chessM <= 9:
  335. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
  336. *nl
  337. $chess_name+' also plays offensively.'
  338. 'Neither of you gain an advantage from this move.'
  339. elseif chessM <= 11:
  340. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
  341. *nl
  342. $chess_name+' plays aggressively and overextends themselves.'
  343. gs 'chessplay', 'advantage', 'offense', 'good'
  344. end
  345. *nl
  346. 'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
  347. 'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
  348. chess_GG -= 1
  349. chess_com -= 1
  350. gs 'chessplay', 'game'
  351. end
  352. act 'Play aggressively':
  353. ! this works as the opposite of conservative play
  354. ! aggressive wins against defense and tactical
  355. ! aggressive loses to offense and trap
  356. ! aggressive ties with conservative and aggressive
  357. *clr & cla
  358. if chessM <= 1:
  359. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
  360. *nl
  361. $chess_name+' plays conservatively and their defenses manage to hold you off.'
  362. 'Neither of you gain an advantage from this move.'
  363. elseif chessM <= 3:
  364. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
  365. *nl
  366. $chess_name+' plays defensively and you overwhelm a few of their pieces.'
  367. gs 'chessplay', 'advantage', 'aggressive', 'good'
  368. elseif chessM <= 5:
  369. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
  370. *nl
  371. $chess_name+' plays tactically and cannot cope with your aggressive moves.'
  372. gs 'chessplay', 'advantage', 'aggressive', 'good'
  373. elseif chessM <= 7:
  374. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
  375. *nl
  376. $chess_name+' tries to trap you, but some of your pieces fall for it.'
  377. gs 'chessplay', 'advantage', 'aggressive', 'bad'
  378. elseif chessM <= 9:
  379. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
  380. *nl
  381. $chess_name+' plays offensively, leaving some of your pieces exposed.'
  382. gs 'chessplay', 'advantage', 'aggressive', 'bad'
  383. elseif chessM <= 11:
  384. '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
  385. *nl
  386. $chess_name+' also plays aggressively.'
  387. 'Neither of you gain an advantage from this move.'
  388. end
  389. *nl
  390. 'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
  391. 'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
  392. chess_GG -= 1
  393. chess_com -= 1
  394. gs 'chessplay', 'game'
  395. end
  396. end
  397. ! $ARGS[1] = move chosen by player - used to set base skill difference and advantage change
  398. ! $ARGS[2] = whether this move was a good choice - whether Sveta should gain or lose advantage
  399. if $ARGS[0] = 'advantage':
  400. ! conservative and aggressive are the most extreme and therefore have the biggest reward and risk
  401. ! but also requires the greatest difference in skill to pull off successfully or prevent your opponent from using successfully
  402. if $ARGS[1] = 'conservative' or $ARGS[1] = 'aggressive':
  403. chess_pos = 4
  404. chess_neg = -4
  405. chess_adv = 4
  406. ! defense and offense are a middle ground and have medium reward and risk
  407. ! requires a medium skill gap to pull off successfully or prevent your opponent from using successfully
  408. elseif $ARGS[1] = 'defense' or $ARGS[1] = 'offense':
  409. chess_pos = 2
  410. chess_neg = -2
  411. chess_adv = 2
  412. ! tactical and trap are the least extreme and therefore have the least reward and risk
  413. ! they require the least difference in skill to pull off successfully or prevent your opponent from using successfully
  414. elseif $ARGS[1] = 'tactical' or $ARGS[1] = 'trap':
  415. chess_pos = 1
  416. chess_neg = -1
  417. chess_adv = 1
  418. end
  419. if $ARGS[2] = 'good':
  420. if chess_ind > chess_pos:
  421. 'You are less skilled than your opponent and cannot capitalize on your advantage.'
  422. 'Try to gain more skill at chess to use this move successfully against this opponent.'
  423. elseif chess_ind < chess_neg:
  424. 'You are more skilled than your opponent and gain a major advantage.'
  425. chess_GG = chess_GG + chess_adv + chess_diff
  426. chess_com = chess_com - chess_adv - chess_diff
  427. else
  428. 'You are about equally skilled as your opponent and gain some advantage.'
  429. chess_GG = chess_GG + chess_adv/2 + chess_diff/2
  430. chess_com = chess_com - chess_adv/2 - chess_diff/2
  431. end
  432. elseif $ARGS[2] = 'bad':
  433. if chess_ind > chess_pos:
  434. 'You are less skilled than your opponent and you lose a major advantage.'
  435. 'Try to gain more skill at chess to prevent your opponent from using this move successfully.'
  436. chess_GG = chess_GG - chess_adv - chess_diff
  437. chess_com = chess_com + chess_adv + chess_diff
  438. elseif chess_ind < chess_neg:
  439. 'You are more skilled than your opponent and prevent them from capitalizing on their advantage.'
  440. else
  441. 'You are about equally skilled as your opponent and you lose some advantage.'
  442. chess_GG = chess_GG - chess_adv/2 - chess_diff/2
  443. chess_com = chess_com + chess_adv/2 + chess_diff/2
  444. end
  445. end
  446. end
  447. --- chessplay ---------------------------------