chessplay 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. # chessplay
  2. if $chess_name='':$chess_name='girl'
  3. gs'stat'
  4. if chess_hod=0:
  5. chess_ini=50
  6. chess_pos=50
  7. end
  8. if chess_ini<0:chess_ini=0
  9. if chess_ini>100:chess_ini=100
  10. if chess_pos<0:chess_pos=0
  11. if chess_pos>100:chess_pos=100
  12. 'Move <<chess_hod>>'
  13. 'Instead you, the board is sitting <<$chess_name>> pondering moves'
  14. if chess_hod=0:'Chess pieces are on the starting positions'
  15. if chess_hod>0:
  16. if chess_ini=50:'The initiative is not who seized'
  17. if chess_pos=50:'Positions is equal'
  18. if chess_ini<50:'You managed to seize the initiative'
  19. if chess_ini>50:'You have lost the initiative'
  20. if chess_pos<50:'Your position is stronger'
  21. if chess_pos>50:'Your position is weaker'
  22. if chess_pos<10:'You are close to the, that would checkmate the enemy'
  23. if chess_pos>90:'You are close to defeat'
  24. end
  25. !'chess_ini <<chess_ini>>'
  26. !'chess_pos <<chess_pos>>'
  27. deV=rand(1,100)
  28. if chess_hod<10:
  29. if deV>=chessH:
  30. !Initiative opponent
  31. derV=1
  32. else
  33. !the enemy defense
  34. derV=0
  35. end
  36. end
  37. if chess_hod>=10:
  38. if chess_ini<90:
  39. if deV>=chessH:
  40. !Initiative opponent
  41. derV=1
  42. else
  43. !the enemy defense
  44. derV=0
  45. end
  46. end
  47. if chess_ini>=90:
  48. derV=2
  49. end
  50. end
  51. $chess_hod_dy={
  52. chessV_proc=chessV/100
  53. chessVmin=chessV_proc*90
  54. chessVmax=chessV_proc*110
  55. chessV_hod=rand(chessVmin,chessVmax)
  56. chess_proc=chess/100
  57. chessmin=chess_proc*90
  58. chessmax=chess_proc*110
  59. chessY_hod=rand(chessmin,chessmax)
  60. !'chessV_hod <<chessV_hod>>'
  61. !'chessY_hod <<chessY_hod>>'
  62. if chess_hod<10:
  63. if chessV_hod>chessY_hod:
  64. if derV=1:
  65. chess_ini+=1
  66. 'The enemy manages to increase the lead'
  67. end
  68. if derV=0:
  69. chess_pos+=1
  70. 'The enemy can improve their position'
  71. end
  72. end
  73. if chessV_hod=chessY_hod:
  74. 'Your actions and those of the enemy no matter what is not particularly affected.'
  75. end
  76. if chessV_hod<chessY_hod:
  77. if derY=1:
  78. chess_ini-=1
  79. 'You manage to increase the lead'
  80. end
  81. if derY=0:
  82. chess_pos-=1
  83. 'You can improve its position'
  84. end
  85. end
  86. else
  87. if derY=2:
  88. chess_temp=100-chess_ini
  89. chessY_hod+=100-chess_temp
  90. chess_ini=50
  91. end
  92. if derV=2:
  93. chess_temp=100+chess_ini
  94. chessV_hod+=100+chess_temp
  95. chess_ini=50
  96. end
  97. if chessV_hod=chessY_hod:
  98. 'Your actions and those of the enemy no matter what is not particularly affected.'
  99. end
  100. if chessV_hod<chessY_hod:
  101. chessResult=chessY_hod-chessV_hod
  102. if derY=2:
  103. chess_pos-=chess_temp+chessResult
  104. 'Your attack failed'
  105. end
  106. if derV=2:
  107. chess_pos-=chess_temp+chessResult
  108. 'Attack the enemy failed'
  109. end
  110. if derY=1:
  111. chess_ini-=chessResult
  112. 'You manage to increase the lead'
  113. end
  114. if derY=0:
  115. chess_pos-=chessResult
  116. 'You can improve its position'
  117. end
  118. end
  119. if chessV_hod>chessY_hod:
  120. chessResult=chessV_hod-chessY_hod
  121. if derY=2:
  122. chess_pos+=chess_temp+chessResult
  123. 'Your attack failed miserably'
  124. end
  125. if derV=2:
  126. chess_pos+=chess_temp+chessResult
  127. 'Attack the enemy was successful'
  128. end
  129. if derV=1:
  130. chess_ini+=chessResult
  131. 'You lose the initiative'
  132. end
  133. if derV=0:
  134. chess_pos+=chessResult
  135. 'You lose position'
  136. end
  137. end
  138. end
  139. derY=0
  140. derV=0
  141. act'Further':gt $curloc
  142. }
  143. if chess_pos>0 and chess_pos<100:
  144. act'To seize the initiative':
  145. cls
  146. chess_hod+=1
  147. derY=1
  148. gs'stat'
  149. 'You play aggressively, trying to seize the initiative in the game.'
  150. dynamic $chess_hod_dy
  151. end
  152. act'Strengthens the position of':
  153. cls
  154. chess_hod+=1
  155. derY=0
  156. gs'stat'
  157. 'You build a defense in depth, though losing in the initiative.'
  158. dynamic $chess_hod_dy
  159. end
  160. if chess_pos<50 and chess_hod>=10:
  161. act'Attack':
  162. cls
  163. chess_hod+=1
  164. derY=2
  165. gs'stat'
  166. 'You attack using seized the initiative.'
  167. dynamic $chess_hod_dy
  168. end
  169. end
  170. end
  171. if chess_pos<=0:
  172. chess_win+=1
  173. 'You checkmate the enemy'
  174. end
  175. if chess_pos>=100:
  176. chess_loss+=1
  177. 'You checkmate'
  178. end
  179. if chess_pos<=0 or chess_pos>=100:
  180. if chess_exit=0:act'Escape':gt'gdkkru'
  181. end
  182. --- chessplay ---------------------------------