card.dd 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. (include "card.ddh")
  2. (class_function Card void create (group)
  3. (group
  4. (= this.id 0)
  5. (dd_matrix_identity this.target)
  6. (= this.hidden 0)
  7. (= this.font 0)
  8. )
  9. )
  10. # draw the card with its transformation matrix
  11. (class_function Card void draw (group)
  12. (group
  13. (dd_matrix_push)
  14. (this.applyMatrix)
  15. (this.drawRaw)
  16. (dd_matrix_pop)
  17. )
  18. )
  19. (class_function Card void clean (group)
  20. (group
  21. )
  22. )
  23. # apply the card's matrix
  24. (class_function Card void applyMatrix (group)
  25. (group
  26. (dd_multMatrixf this)
  27. )
  28. )
  29. # draw the card's mesh with no transformation
  30. (class_function Card void drawRaw (group)
  31. (group
  32. (if (== this.hidden 0)
  33. (this.mesh.draw)
  34. )
  35. (this.meshBack.draw)
  36. )
  37. )
  38. (class_function Card void drawText (group)
  39. (group
  40. (if (== this.id 0)
  41. (group
  42. (dd_scalef 0.7 0.7 0.7)
  43. (this.font.draw "move rose 1 step")
  44. )
  45. (== this.id 1)
  46. (group
  47. (dd_scalef 0.7 0.7 0.7)
  48. (this.font.draw "move rose 3 steps")
  49. )
  50. (== this.id 2)
  51. (group
  52. (dd_scalef 0.5 0.5 0.5)
  53. (dd_translatef 0 1.75 0)
  54. (this.font.draw "rose player grabs rose")
  55. (dd_translatef 0 -1.0 0)
  56. (this.font.draw "give a card to the")
  57. (dd_translatef 0 -1.0 0)
  58. (this.font.draw "rose player")
  59. (dd_translatef 0 -1.0 0)
  60. (this.font.draw "receive a random card")
  61. (dd_translatef 0 -1.0 0)
  62. (this.font.draw "from the rose player")
  63. (dd_translatef 0 -1.0 0)
  64. (this.font.draw "move rose 1 step")
  65. )
  66. (== this.id 3)
  67. (group
  68. (dd_scalef 0.6 0.6 0.6)
  69. (dd_translatef 0 1.4 0)
  70. (this.font.draw "if rose is 1 step")
  71. (dd_translatef 0 -1.0 0)
  72. (this.font.draw "before you")
  73. (dd_translatef 0 -1.0 0)
  74. (this.font.draw "move it 1 step")
  75. (dd_translatef 0 -1.0 0)
  76. (this.font.draw "otherwise")
  77. (dd_translatef 0 -1.0 0)
  78. (this.font.draw "move it 3 steps")
  79. )
  80. (== this.id 4)
  81. (group
  82. (dd_scalef 0.65 0.65 0.65)
  83. (dd_translatef 0 1.0 0)
  84. (this.font.draw "draw 1 card")
  85. (dd_translatef 0 -1.0 0)
  86. (this.font.draw "discard this card")
  87. (dd_translatef 0 -1.0 0)
  88. (this.font.draw "plan and execute")
  89. (dd_translatef 0 -1.0 0)
  90. (this.font.draw "another card")
  91. )
  92. (== this.id 5)
  93. (group
  94. (dd_scalef 0.55 0.55 0.55)
  95. (dd_translatef 0 1.5 0)
  96. (this.font.draw "if rose is in front of")
  97. (dd_translatef 0 -1.0 0)
  98. (this.font.draw "you grab it otherwise")
  99. (dd_translatef 0 -1.0 0)
  100. (this.font.draw "move rose 1 step")
  101. (dd_translatef 0 -1.0 0)
  102. (this.font.draw "the rose player")
  103. (dd_translatef 0 -1.0 0)
  104. (this.font.draw "grabs the rose")
  105. )
  106. (== this.id 6)
  107. (group
  108. (dd_scalef 0.7 0.7 0.7)
  109. (this.font.draw "the rose player")
  110. (dd_translatef 0 -1.0 0)
  111. (this.font.draw "grabs the rose")
  112. )
  113. (== this.id 7)
  114. (group
  115. (dd_scalef 0.6 0.6 0.6)
  116. (dd_translatef 0 1.4 0)
  117. (this.font.draw "if you are not")
  118. (dd_translatef 0 -1.0 0)
  119. (this.font.draw "the rose player")
  120. (dd_translatef 0 -1.0 0)
  121. (this.font.draw "move rose 1 step")
  122. (dd_translatef 0 -1.0 0)
  123. (this.font.draw "otherwise")
  124. (dd_translatef 0 -1.0 0)
  125. (this.font.draw "move rose 3 steps")
  126. )
  127. (== this.id 8)
  128. (group
  129. (dd_scalef 0.6 0.6 0.6)
  130. (dd_translatef 0 1.3 0)
  131. (this.font.draw "if you are holding")
  132. (dd_translatef 0 -1.0 0)
  133. (this.font.draw "the rose")
  134. (dd_translatef 0 -1.0 0)
  135. (this.font.draw "discard 1 card")
  136. (dd_translatef 0 -1.0 0)
  137. (dd_translatef 0 -1.0 0)
  138. (this.font.draw "move rose 1 step")
  139. )
  140. )
  141. )
  142. )
  143. (class_function Card void setId (group int givenId)
  144. (group
  145. (= this.id givenId)
  146. (if (== this.id 0)
  147. (= this.cardDescription "move the rose 1 step")
  148. (== this.id 1)
  149. (= this.cardDescription "move the rose 3 steps")
  150. (== this.id 2)
  151. (= this.cardDescription (multistring
  152. "The rose player grabs the rose then"
  153. "give a card to the rose player and "
  154. "receive a random card back then "
  155. "move the rose 1 step "
  156. )
  157. )
  158. (== this.id 3)
  159. (= this.cardDescription (multistring
  160. "if the rose is 1 step before you "
  161. "move it 1 step "
  162. "otherwise "
  163. "move it 3 steps"
  164. )
  165. )
  166. (== this.id 4)
  167. (= this.cardDescription (multistring
  168. "draw 1 card then "
  169. "discard this card to "
  170. "plan and execute "
  171. "another card"
  172. )
  173. )
  174. (== this.id 5)
  175. (= this.cardDescription (multistring
  176. "if the rose is in front of "
  177. "you grab it otherwise "
  178. "move the rose 1 step then "
  179. "the rose player "
  180. "grabs the rose"
  181. )
  182. )
  183. (== this.id 6)
  184. (= this.cardDescription (multistring
  185. "the rose player "
  186. "grabs the rose"
  187. )
  188. )
  189. (== this.id 7)
  190. (= this.cardDescription (multistring
  191. "if you are not "
  192. "the rose player then "
  193. "move the rose 1 step "
  194. "otherwise "
  195. "move the rose 3 steps"
  196. )
  197. )
  198. (== this.id 8)
  199. (= this.cardDescription (multistring
  200. "if you are holding "
  201. "the rose then "
  202. "discard 1 card -"
  203. "move the rose 1 step"
  204. )
  205. )
  206. # rose
  207. (== this.id 9)
  208. (= this.cardDescription (multistring
  209. "a beautiful red rose that smells amazing"
  210. )
  211. )
  212. # tutorial - initialisation
  213. (== this.id 10)
  214. (= this.cardDescription (multistring
  215. "During initialisation every player draws 5 cards "
  216. "and one player gets the rose card in front of them."
  217. )
  218. )
  219. # tutorial - planning
  220. (== this.id 11)
  221. (= this.cardDescription (multistring
  222. "In the planning phase starting with the player with the rose "
  223. "every player picks a card and plans it face down on the table"
  224. )
  225. )
  226. # tutorial - user's turn
  227. (== this.id 12)
  228. (= this.cardDescription (multistring
  229. "The rose always moves clockwise."
  230. "If a player holds the rose moving it one step will "
  231. "make it move in front of that player"
  232. )
  233. )
  234. # tutorial - execution
  235. (== this.id 13)
  236. (= this.cardDescription (multistring
  237. "In the execution phase starting with the player with the rose,"
  238. "reveal each card and execute its effect"
  239. )
  240. )
  241. # tutorial - end
  242. (== this.id 14)
  243. (= this.cardDescription (multistring
  244. "In the end phase every player draws one card except the "
  245. "player with the rose If a player has 2 or less cards in their hand "
  246. "they win"
  247. )
  248. )
  249. # else
  250. (= this.cardDescription "no description")
  251. )
  252. )
  253. )