@gamepark/mythologies 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/dist/CustomMoveType.d.ts +13 -0
  2. package/dist/CustomMoveType.js +13 -0
  3. package/dist/Memory.d.ts +13 -0
  4. package/dist/Memory.js +17 -0
  5. package/dist/MythologiesOptions.d.ts +12 -0
  6. package/dist/MythologiesOptions.js +14 -0
  7. package/dist/MythologiesRules.d.ts +111 -0
  8. package/dist/MythologiesRules.js +218 -0
  9. package/dist/MythologiesSetup.d.ts +17 -0
  10. package/dist/MythologiesSetup.js +161 -0
  11. package/dist/PlayerColor.d.ts +10 -0
  12. package/dist/PlayerColor.js +10 -0
  13. package/dist/index.d.ts +3 -0
  14. package/dist/index.js +9 -0
  15. package/dist/material/Destiny.d.ts +9 -0
  16. package/dist/material/Destiny.js +87 -0
  17. package/dist/material/Entity.d.ts +98 -0
  18. package/dist/material/Entity.js +99 -0
  19. package/dist/material/LocationType.d.ts +26 -0
  20. package/dist/material/LocationType.js +31 -0
  21. package/dist/material/MaterialType.d.ts +12 -0
  22. package/dist/material/MaterialType.js +16 -0
  23. package/dist/material/Mythology.d.ts +19 -0
  24. package/dist/material/Mythology.js +21 -0
  25. package/dist/material/Pantheon.d.ts +36 -0
  26. package/dist/material/Pantheon.js +357 -0
  27. package/dist/material/Trial.d.ts +22 -0
  28. package/dist/material/Trial.js +184 -0
  29. package/dist/material/entity/Effect.d.ts +91 -0
  30. package/dist/material/entity/Effect.js +115 -0
  31. package/dist/material/entity/EntityDescription.d.ts +13 -0
  32. package/dist/material/entity/EntityDescription.js +173 -0
  33. package/dist/material/entity/MoveEffectRule.d.ts +15 -0
  34. package/dist/material/entity/MoveEffectRule.js +86 -0
  35. package/dist/material/entity/PlaceCardEffectRule.d.ts +15 -0
  36. package/dist/material/entity/PlaceCardEffectRule.js +75 -0
  37. package/dist/material/entity/SacrificeEffectRule.d.ts +9 -0
  38. package/dist/material/entity/SacrificeEffectRule.js +58 -0
  39. package/dist/material/entity/SimultaneousMoveEffectRule.d.ts +13 -0
  40. package/dist/material/entity/SimultaneousMoveEffectRule.js +124 -0
  41. package/dist/material/entity/SimultaneousSacrificeEffectRule.d.ts +10 -0
  42. package/dist/material/entity/SimultaneousSacrificeEffectRule.js +57 -0
  43. package/dist/material/entity/celtic/Banshee.d.ts +2 -0
  44. package/dist/material/entity/celtic/Banshee.js +6 -0
  45. package/dist/material/entity/celtic/Brigid.d.ts +2 -0
  46. package/dist/material/entity/celtic/Brigid.js +6 -0
  47. package/dist/material/entity/celtic/Cernunnos.d.ts +2 -0
  48. package/dist/material/entity/celtic/Cernunnos.js +6 -0
  49. package/dist/material/entity/celtic/Dagda.d.ts +2 -0
  50. package/dist/material/entity/celtic/Dagda.js +6 -0
  51. package/dist/material/entity/celtic/Dryad.d.ts +2 -0
  52. package/dist/material/entity/celtic/Dryad.js +6 -0
  53. package/dist/material/entity/celtic/Dullahan.d.ts +2 -0
  54. package/dist/material/entity/celtic/Dullahan.js +6 -0
  55. package/dist/material/entity/celtic/Kelpie.d.ts +2 -0
  56. package/dist/material/entity/celtic/Kelpie.js +6 -0
  57. package/dist/material/entity/celtic/Leprechaun.d.ts +2 -0
  58. package/dist/material/entity/celtic/Leprechaun.js +6 -0
  59. package/dist/material/entity/celtic/Morrigan.d.ts +2 -0
  60. package/dist/material/entity/celtic/Morrigan.js +6 -0
  61. package/dist/material/entity/celtic/Selkie.d.ts +2 -0
  62. package/dist/material/entity/celtic/Selkie.js +6 -0
  63. package/dist/material/entity/chinese/ChangE.d.ts +2 -0
  64. package/dist/material/entity/chinese/ChangE.js +6 -0
  65. package/dist/material/entity/chinese/Fenghuang.d.ts +2 -0
  66. package/dist/material/entity/chinese/Fenghuang.js +6 -0
  67. package/dist/material/entity/chinese/Jiangshi.d.ts +2 -0
  68. package/dist/material/entity/chinese/Jiangshi.js +6 -0
  69. package/dist/material/entity/chinese/Mogwai.d.ts +2 -0
  70. package/dist/material/entity/chinese/Mogwai.js +6 -0
  71. package/dist/material/entity/chinese/Nian.d.ts +2 -0
  72. package/dist/material/entity/chinese/Nian.js +6 -0
  73. package/dist/material/entity/chinese/Nuwa.d.ts +2 -0
  74. package/dist/material/entity/chinese/Nuwa.js +6 -0
  75. package/dist/material/entity/chinese/Qilin.d.ts +2 -0
  76. package/dist/material/entity/chinese/Qilin.js +6 -0
  77. package/dist/material/entity/chinese/SunWukong.d.ts +2 -0
  78. package/dist/material/entity/chinese/SunWukong.js +6 -0
  79. package/dist/material/entity/chinese/Tianlong.d.ts +2 -0
  80. package/dist/material/entity/chinese/Tianlong.js +6 -0
  81. package/dist/material/entity/chinese/YanluoWang.d.ts +2 -0
  82. package/dist/material/entity/chinese/YanluoWang.js +6 -0
  83. package/dist/material/entity/egyptian/Anubis.d.ts +2 -0
  84. package/dist/material/entity/egyptian/Anubis.js +12 -0
  85. package/dist/material/entity/egyptian/Babai.d.ts +2 -0
  86. package/dist/material/entity/egyptian/Babai.js +12 -0
  87. package/dist/material/entity/egyptian/Beetle.d.ts +2 -0
  88. package/dist/material/entity/egyptian/Beetle.js +36 -0
  89. package/dist/material/entity/egyptian/Bennu.d.ts +2 -0
  90. package/dist/material/entity/egyptian/Bennu.js +12 -0
  91. package/dist/material/entity/egyptian/Cobra.d.ts +2 -0
  92. package/dist/material/entity/egyptian/Cobra.js +12 -0
  93. package/dist/material/entity/egyptian/Isis.d.ts +2 -0
  94. package/dist/material/entity/egyptian/Isis.js +39 -0
  95. package/dist/material/entity/egyptian/Mummy.d.ts +2 -0
  96. package/dist/material/entity/egyptian/Mummy.js +39 -0
  97. package/dist/material/entity/egyptian/Osiris.d.ts +2 -0
  98. package/dist/material/entity/egyptian/Osiris.js +71 -0
  99. package/dist/material/entity/egyptian/Ra.d.ts +2 -0
  100. package/dist/material/entity/egyptian/Ra.js +12 -0
  101. package/dist/material/entity/egyptian/Sphinx.d.ts +2 -0
  102. package/dist/material/entity/egyptian/Sphinx.js +12 -0
  103. package/dist/material/entity/greek/Athena.d.ts +2 -0
  104. package/dist/material/entity/greek/Athena.js +12 -0
  105. package/dist/material/entity/greek/Centaur.d.ts +2 -0
  106. package/dist/material/entity/greek/Centaur.js +12 -0
  107. package/dist/material/entity/greek/Chimera.d.ts +2 -0
  108. package/dist/material/entity/greek/Chimera.js +12 -0
  109. package/dist/material/entity/greek/Cyclops.d.ts +2 -0
  110. package/dist/material/entity/greek/Cyclops.js +21 -0
  111. package/dist/material/entity/greek/Gorgon.d.ts +2 -0
  112. package/dist/material/entity/greek/Gorgon.js +12 -0
  113. package/dist/material/entity/greek/Griffin.d.ts +2 -0
  114. package/dist/material/entity/greek/Griffin.js +12 -0
  115. package/dist/material/entity/greek/Hades.d.ts +2 -0
  116. package/dist/material/entity/greek/Hades.js +12 -0
  117. package/dist/material/entity/greek/Minotaur.d.ts +2 -0
  118. package/dist/material/entity/greek/Minotaur.js +12 -0
  119. package/dist/material/entity/greek/Poseidon.d.ts +2 -0
  120. package/dist/material/entity/greek/Poseidon.js +44 -0
  121. package/dist/material/entity/greek/Zeus.d.ts +2 -0
  122. package/dist/material/entity/greek/Zeus.js +39 -0
  123. package/dist/material/entity/hindu/Asura.d.ts +2 -0
  124. package/dist/material/entity/hindu/Asura.js +66 -0
  125. package/dist/material/entity/hindu/Brahma.d.ts +2 -0
  126. package/dist/material/entity/hindu/Brahma.js +36 -0
  127. package/dist/material/entity/hindu/Ganesh.d.ts +2 -0
  128. package/dist/material/entity/hindu/Ganesh.js +44 -0
  129. package/dist/material/entity/hindu/Garuda.d.ts +2 -0
  130. package/dist/material/entity/hindu/Garuda.js +12 -0
  131. package/dist/material/entity/hindu/Kinnara.d.ts +2 -0
  132. package/dist/material/entity/hindu/Kinnara.js +12 -0
  133. package/dist/material/entity/hindu/Naga.d.ts +2 -0
  134. package/dist/material/entity/hindu/Naga.js +68 -0
  135. package/dist/material/entity/hindu/Rakshasa.d.ts +2 -0
  136. package/dist/material/entity/hindu/Rakshasa.js +12 -0
  137. package/dist/material/entity/hindu/Shiva.d.ts +2 -0
  138. package/dist/material/entity/hindu/Shiva.js +12 -0
  139. package/dist/material/entity/hindu/Vetala.d.ts +2 -0
  140. package/dist/material/entity/hindu/Vetala.js +12 -0
  141. package/dist/material/entity/hindu/Vishnu.d.ts +2 -0
  142. package/dist/material/entity/hindu/Vishnu.js +71 -0
  143. package/dist/material/entity/inca/Amaru.d.ts +2 -0
  144. package/dist/material/entity/inca/Amaru.js +6 -0
  145. package/dist/material/entity/inca/Caiman.d.ts +2 -0
  146. package/dist/material/entity/inca/Caiman.js +6 -0
  147. package/dist/material/entity/inca/Condor.d.ts +2 -0
  148. package/dist/material/entity/inca/Condor.js +6 -0
  149. package/dist/material/entity/inca/Illapa.d.ts +2 -0
  150. package/dist/material/entity/inca/Illapa.js +6 -0
  151. package/dist/material/entity/inca/Inti.d.ts +2 -0
  152. package/dist/material/entity/inca/Inti.js +6 -0
  153. package/dist/material/entity/inca/MamaQucha.d.ts +2 -0
  154. package/dist/material/entity/inca/MamaQucha.js +6 -0
  155. package/dist/material/entity/inca/Pumapunku.d.ts +2 -0
  156. package/dist/material/entity/inca/Pumapunku.js +6 -0
  157. package/dist/material/entity/inca/Supay.d.ts +2 -0
  158. package/dist/material/entity/inca/Supay.js +6 -0
  159. package/dist/material/entity/inca/Ukuku.d.ts +2 -0
  160. package/dist/material/entity/inca/Ukuku.js +6 -0
  161. package/dist/material/entity/inca/Viracocha.d.ts +2 -0
  162. package/dist/material/entity/inca/Viracocha.js +6 -0
  163. package/dist/material/entity/norse/Alf.d.ts +2 -0
  164. package/dist/material/entity/norse/Alf.js +12 -0
  165. package/dist/material/entity/norse/Draugr.d.ts +2 -0
  166. package/dist/material/entity/norse/Draugr.js +12 -0
  167. package/dist/material/entity/norse/Fenrir.d.ts +2 -0
  168. package/dist/material/entity/norse/Fenrir.js +12 -0
  169. package/dist/material/entity/norse/Freya.d.ts +2 -0
  170. package/dist/material/entity/norse/Freya.js +39 -0
  171. package/dist/material/entity/norse/Jotunn.d.ts +2 -0
  172. package/dist/material/entity/norse/Jotunn.js +36 -0
  173. package/dist/material/entity/norse/Loki.d.ts +2 -0
  174. package/dist/material/entity/norse/Loki.js +36 -0
  175. package/dist/material/entity/norse/Odin.d.ts +2 -0
  176. package/dist/material/entity/norse/Odin.js +6 -0
  177. package/dist/material/entity/norse/Thor.d.ts +2 -0
  178. package/dist/material/entity/norse/Thor.js +12 -0
  179. package/dist/material/entity/norse/Troll.d.ts +2 -0
  180. package/dist/material/entity/norse/Troll.js +6 -0
  181. package/dist/material/entity/norse/Valkyrie.d.ts +2 -0
  182. package/dist/material/entity/norse/Valkyrie.js +72 -0
  183. package/dist/material/entity/zulu/Idlozi.d.ts +2 -0
  184. package/dist/material/entity/zulu/Idlozi.js +6 -0
  185. package/dist/material/entity/zulu/Impundulu.d.ts +2 -0
  186. package/dist/material/entity/zulu/Impundulu.js +6 -0
  187. package/dist/material/entity/zulu/Inkanyamba.d.ts +2 -0
  188. package/dist/material/entity/zulu/Inkanyamba.js +6 -0
  189. package/dist/material/entity/zulu/Inkosazana.d.ts +2 -0
  190. package/dist/material/entity/zulu/Inkosazana.js +6 -0
  191. package/dist/material/entity/zulu/Shembe.d.ts +2 -0
  192. package/dist/material/entity/zulu/Shembe.js +6 -0
  193. package/dist/material/entity/zulu/Tokoloshe.d.ts +2 -0
  194. package/dist/material/entity/zulu/Tokoloshe.js +6 -0
  195. package/dist/material/entity/zulu/Umvelinqangi.d.ts +2 -0
  196. package/dist/material/entity/zulu/Umvelinqangi.js +6 -0
  197. package/dist/material/entity/zulu/Unkulunkulu.d.ts +2 -0
  198. package/dist/material/entity/zulu/Unkulunkulu.js +6 -0
  199. package/dist/material/entity/zulu/Unwabu.d.ts +2 -0
  200. package/dist/material/entity/zulu/Unwabu.js +6 -0
  201. package/dist/material/entity/zulu/Werehyena.d.ts +2 -0
  202. package/dist/material/entity/zulu/Werehyena.js +6 -0
  203. package/dist/rules/ChooseDraftTokenRule.d.ts +15 -0
  204. package/dist/rules/ChooseDraftTokenRule.js +103 -0
  205. package/dist/rules/DrawDestinyCardRule.d.ts +7 -0
  206. package/dist/rules/DrawDestinyCardRule.js +116 -0
  207. package/dist/rules/EndGameRule.d.ts +5 -0
  208. package/dist/rules/EndGameRule.js +44 -0
  209. package/dist/rules/PlaceCardsRule.d.ts +13 -0
  210. package/dist/rules/PlaceCardsRule.js +192 -0
  211. package/dist/rules/PlaceTokenRule.d.ts +13 -0
  212. package/dist/rules/PlaceTokenRule.js +139 -0
  213. package/dist/rules/RuleId.d.ts +36 -0
  214. package/dist/rules/RuleId.js +40 -0
  215. package/dist/rules/UpkeepRule.d.ts +9 -0
  216. package/dist/rules/UpkeepRule.js +140 -0
  217. package/dist/rules/effects/AlfEffectRule.d.ts +10 -0
  218. package/dist/rules/effects/AlfEffectRule.js +59 -0
  219. package/dist/rules/effects/AnubisEffectRule.d.ts +9 -0
  220. package/dist/rules/effects/AnubisEffectRule.js +49 -0
  221. package/dist/rules/effects/AthenaEffectRule.d.ts +9 -0
  222. package/dist/rules/effects/AthenaEffectRule.js +104 -0
  223. package/dist/rules/effects/BabaiEffectRule.d.ts +6 -0
  224. package/dist/rules/effects/BabaiEffectRule.js +40 -0
  225. package/dist/rules/effects/BennuEffectRule.d.ts +6 -0
  226. package/dist/rules/effects/BennuEffectRule.js +35 -0
  227. package/dist/rules/effects/CentaurEffectRule.d.ts +15 -0
  228. package/dist/rules/effects/CentaurEffectRule.js +77 -0
  229. package/dist/rules/effects/ChimeraEffectRule.d.ts +8 -0
  230. package/dist/rules/effects/ChimeraEffectRule.js +51 -0
  231. package/dist/rules/effects/CobraEffectRule.d.ts +12 -0
  232. package/dist/rules/effects/CobraEffectRule.js +55 -0
  233. package/dist/rules/effects/CyclopsEffectRule.d.ts +8 -0
  234. package/dist/rules/effects/CyclopsEffectRule.js +87 -0
  235. package/dist/rules/effects/DraugrEffectRule.d.ts +11 -0
  236. package/dist/rules/effects/DraugrEffectRule.js +56 -0
  237. package/dist/rules/effects/FenrirEffectRule.d.ts +15 -0
  238. package/dist/rules/effects/FenrirEffectRule.js +132 -0
  239. package/dist/rules/effects/GarudaEffectRule.d.ts +9 -0
  240. package/dist/rules/effects/GarudaEffectRule.js +84 -0
  241. package/dist/rules/effects/GorgonEffectRule.d.ts +11 -0
  242. package/dist/rules/effects/GorgonEffectRule.js +78 -0
  243. package/dist/rules/effects/GriffinEffectRule.d.ts +9 -0
  244. package/dist/rules/effects/GriffinEffectRule.js +41 -0
  245. package/dist/rules/effects/HadesEffectRule.d.ts +5 -0
  246. package/dist/rules/effects/HadesEffectRule.js +87 -0
  247. package/dist/rules/effects/KinnaraEffectRule.d.ts +12 -0
  248. package/dist/rules/effects/KinnaraEffectRule.js +84 -0
  249. package/dist/rules/effects/MinotaurEffectRule.d.ts +9 -0
  250. package/dist/rules/effects/MinotaurEffectRule.js +39 -0
  251. package/dist/rules/effects/OdinEffectRule.d.ts +11 -0
  252. package/dist/rules/effects/OdinEffectRule.js +52 -0
  253. package/dist/rules/effects/RaEffectRule.d.ts +5 -0
  254. package/dist/rules/effects/RaEffectRule.js +87 -0
  255. package/dist/rules/effects/RakshasaEffectRule.d.ts +13 -0
  256. package/dist/rules/effects/RakshasaEffectRule.js +48 -0
  257. package/dist/rules/effects/ResolveEffectsRule.d.ts +6 -0
  258. package/dist/rules/effects/ResolveEffectsRule.js +73 -0
  259. package/dist/rules/effects/ShivaEffectRule.d.ts +10 -0
  260. package/dist/rules/effects/ShivaEffectRule.js +82 -0
  261. package/dist/rules/effects/SphinxEffectRule.d.ts +9 -0
  262. package/dist/rules/effects/SphinxEffectRule.js +47 -0
  263. package/dist/rules/effects/ThorEffectRule.d.ts +11 -0
  264. package/dist/rules/effects/ThorEffectRule.js +56 -0
  265. package/dist/rules/effects/TriggerEffectsRule.d.ts +11 -0
  266. package/dist/rules/effects/TriggerEffectsRule.js +159 -0
  267. package/dist/rules/effects/VetalaEffectRule.d.ts +11 -0
  268. package/dist/rules/effects/VetalaEffectRule.js +59 -0
  269. package/package.json +33 -0
@@ -0,0 +1,13 @@
1
+ export declare enum CustomMoveType {
2
+ Pass = 1,
3
+ TrialSuccess = 2,
4
+ TrialFailure = 3,
5
+ PlayEffect = 4,
6
+ EndEffect = 5,
7
+ ChoosePlayer = 6,
8
+ ChooseMythology = 7
9
+ }
10
+ export type TrialSuccessData = {
11
+ trial: number;
12
+ reward: number;
13
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomMoveType = void 0;
4
+ var CustomMoveType;
5
+ (function (CustomMoveType) {
6
+ CustomMoveType[CustomMoveType["Pass"] = 1] = "Pass";
7
+ CustomMoveType[CustomMoveType["TrialSuccess"] = 2] = "TrialSuccess";
8
+ CustomMoveType[CustomMoveType["TrialFailure"] = 3] = "TrialFailure";
9
+ CustomMoveType[CustomMoveType["PlayEffect"] = 4] = "PlayEffect";
10
+ CustomMoveType[CustomMoveType["EndEffect"] = 5] = "EndEffect";
11
+ CustomMoveType[CustomMoveType["ChoosePlayer"] = 6] = "ChoosePlayer";
12
+ CustomMoveType[CustomMoveType["ChooseMythology"] = 7] = "ChooseMythology";
13
+ })(CustomMoveType = exports.CustomMoveType || (exports.CustomMoveType = {}));
@@ -0,0 +1,13 @@
1
+ export declare enum Memory {
2
+ KeepTokenPlaceSecret = 1,
3
+ TrialFailure = 2,
4
+ PendingEffects = 3,
5
+ PendingRule = 4,
6
+ OngoingEffect = 5,
7
+ OncePerTurn = 6,
8
+ OdinTargetMythology = 10,
9
+ FenrirPaid1 = 11,
10
+ AnubisInvoke1 = 12,
11
+ GarudaSacrificeCount = 13,
12
+ VetalaCount = 14
13
+ }
package/dist/Memory.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Memory = void 0;
4
+ var Memory;
5
+ (function (Memory) {
6
+ Memory[Memory["KeepTokenPlaceSecret"] = 1] = "KeepTokenPlaceSecret";
7
+ Memory[Memory["TrialFailure"] = 2] = "TrialFailure";
8
+ Memory[Memory["PendingEffects"] = 3] = "PendingEffects";
9
+ Memory[Memory["PendingRule"] = 4] = "PendingRule";
10
+ Memory[Memory["OngoingEffect"] = 5] = "OngoingEffect";
11
+ Memory[Memory["OncePerTurn"] = 6] = "OncePerTurn";
12
+ Memory[Memory["OdinTargetMythology"] = 10] = "OdinTargetMythology";
13
+ Memory[Memory["FenrirPaid1"] = 11] = "FenrirPaid1";
14
+ Memory[Memory["AnubisInvoke1"] = 12] = "AnubisInvoke1";
15
+ Memory[Memory["GarudaSacrificeCount"] = 13] = "GarudaSacrificeCount";
16
+ Memory[Memory["VetalaCount"] = 14] = "VetalaCount";
17
+ })(Memory = exports.Memory || (exports.Memory = {}));
@@ -0,0 +1,12 @@
1
+ import { OptionsSpec } from '@gamepark/rules-api';
2
+ import { Mythology } from './material/Mythology';
3
+ import { PlayerColor } from './PlayerColor';
4
+ type PlayerOptions = {
5
+ id: PlayerColor;
6
+ };
7
+ export type MythologiesOptions = {
8
+ players: PlayerOptions[];
9
+ mythologies?: Mythology[];
10
+ };
11
+ export declare const MythologiesOptionsSpec: OptionsSpec<MythologiesOptions>;
12
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MythologiesOptionsSpec = void 0;
4
+ var rules_api_1 = require("@gamepark/rules-api");
5
+ var PlayerColor_1 = require("./PlayerColor");
6
+ exports.MythologiesOptionsSpec = {
7
+ players: {
8
+ id: {
9
+ label: function (t) { return t('player.id'); },
10
+ values: (0, rules_api_1.getEnumValues)(PlayerColor_1.PlayerColor),
11
+ valueSpec: function (id) { return ({ label: function (t) { return t("player.".concat(id)); } }); }
12
+ }
13
+ }
14
+ };
@@ -0,0 +1,111 @@
1
+ import { CustomMove, FillGapStrategy, ItemMove, Material, MaterialGame, MaterialItem, MaterialMove, PositiveSequenceStrategy, SecretMaterialRules, StackingStrategy, TimeLimit } from '@gamepark/rules-api';
2
+ import { LocationType } from './material/LocationType';
3
+ import { MaterialType } from './material/MaterialType';
4
+ import { PlayerColor } from './PlayerColor';
5
+ import { ChooseDraftTokenRule } from './rules/ChooseDraftTokenRule';
6
+ import { DrawDestinyCardRule } from './rules/DrawDestinyCardRule';
7
+ import { AlfEffectRule } from './rules/effects/AlfEffectRule';
8
+ import { AnubisEffectRule } from './rules/effects/AnubisEffectRule';
9
+ import { AthenaEffectRule } from './rules/effects/AthenaEffectRule';
10
+ import { BabaiEffectRule } from './rules/effects/BabaiEffectRule';
11
+ import { BennuEffectRule } from './rules/effects/BennuEffectRule';
12
+ import { CentaurEffectRule, CentaurEffectSacrificeRule } from './rules/effects/CentaurEffectRule';
13
+ import { ChimeraEffectRule } from './rules/effects/ChimeraEffectRule';
14
+ import { CobraEffectRule, CobraInvokeEffect } from './rules/effects/CobraEffectRule';
15
+ import { CyclopsEffectRule } from './rules/effects/CyclopsEffectRule';
16
+ import { DraugrEffectRule } from './rules/effects/DraugrEffectRule';
17
+ import { FenrirChoiceRule, FenrirEffectRule } from './rules/effects/FenrirEffectRule';
18
+ import { GarudaEffectRule } from './rules/effects/GarudaEffectRule';
19
+ import { GorgonEffectRule } from './rules/effects/GorgonEffectRule';
20
+ import { GriffinEffectRule } from './rules/effects/GriffinEffectRule';
21
+ import { HadesEffectRule } from './rules/effects/HadesEffectRule';
22
+ import { KinnaraEffectRule, KinnaraPlaceEffectRule } from './rules/effects/KinnaraEffectRule';
23
+ import { MinotaurEffectRule } from './rules/effects/MinotaurEffectRule';
24
+ import { OdinEffectRule } from './rules/effects/OdinEffectRule';
25
+ import { RakshasaEffectRule } from './rules/effects/RakshasaEffectRule';
26
+ import { ResolveEffectsRule } from './rules/effects/ResolveEffectsRule';
27
+ import { ShivaEffectRule } from './rules/effects/ShivaEffectRule';
28
+ import { SphinxEffectRule } from './rules/effects/SphinxEffectRule';
29
+ import { ThorEffectRule } from './rules/effects/ThorEffectRule';
30
+ import { VetalaEffectRule } from './rules/effects/VetalaEffectRule';
31
+ import { EndGameRule } from './rules/EndGameRule';
32
+ import { PlaceCardsRule } from './rules/PlaceCardsRule';
33
+ import { PlaceTokenRule } from './rules/PlaceTokenRule';
34
+ import { RuleId } from './rules/RuleId';
35
+ import { UpkeepRule } from './rules/UpkeepRule';
36
+ export declare class MythologiesRules extends SecretMaterialRules<PlayerColor, MaterialType, LocationType> implements TimeLimit<MaterialGame<PlayerColor, MaterialType, LocationType>, MaterialMove<PlayerColor, MaterialType, LocationType>, PlayerColor> {
37
+ rules: {
38
+ 1: typeof DrawDestinyCardRule;
39
+ 2: typeof ChooseDraftTokenRule;
40
+ 3: typeof PlaceTokenRule;
41
+ 4: typeof PlaceCardsRule;
42
+ 5: typeof UpkeepRule;
43
+ 6: typeof EndGameRule;
44
+ 10: typeof ResolveEffectsRule;
45
+ 11: typeof AthenaEffectRule;
46
+ 12: typeof HadesEffectRule;
47
+ 13: typeof MinotaurEffectRule;
48
+ 14: typeof CentaurEffectRule;
49
+ 15: typeof CentaurEffectSacrificeRule;
50
+ 16: typeof GorgonEffectRule;
51
+ 17: typeof CyclopsEffectRule;
52
+ 18: typeof GriffinEffectRule;
53
+ 19: typeof ChimeraEffectRule;
54
+ 20: typeof OdinEffectRule;
55
+ 21: typeof ThorEffectRule;
56
+ 22: typeof DraugrEffectRule;
57
+ 23: typeof FenrirChoiceRule;
58
+ 24: typeof FenrirEffectRule;
59
+ 25: typeof AlfEffectRule;
60
+ 26: typeof AnubisEffectRule;
61
+ 27: typeof SphinxEffectRule;
62
+ 28: typeof CobraEffectRule;
63
+ 29: typeof CobraInvokeEffect;
64
+ 30: typeof BabaiEffectRule;
65
+ 31: typeof BennuEffectRule;
66
+ 32: typeof ShivaEffectRule;
67
+ 33: typeof RakshasaEffectRule;
68
+ 34: typeof GarudaEffectRule;
69
+ 35: typeof VetalaEffectRule;
70
+ 36: typeof KinnaraEffectRule;
71
+ 37: typeof KinnaraPlaceEffectRule;
72
+ };
73
+ locationsStrategies: {
74
+ 2: {
75
+ 2: PositiveSequenceStrategy<number, number, number>;
76
+ 3: PositiveSequenceStrategy<number, number, number>;
77
+ 6: FillGapStrategy<number, number, number>;
78
+ 19: StackingStrategy;
79
+ 22: PositiveSequenceStrategy<number, number, number>;
80
+ };
81
+ 4: {
82
+ 5: PositiveSequenceStrategy<number, number, number>;
83
+ };
84
+ 10: {
85
+ 15: PositiveSequenceStrategy<number, number, number>;
86
+ 16: PositiveSequenceStrategy<number, number, number>;
87
+ };
88
+ };
89
+ hidingStrategies: {
90
+ 2: {
91
+ 2: import("@gamepark/rules-api").HidingStrategy<number, number>;
92
+ 3: (item: MaterialItem) => string[];
93
+ 7: (item: MaterialItem, player?: PlayerColor) => string[];
94
+ 6: (item: MaterialItem, player?: PlayerColor) => string[];
95
+ };
96
+ 4: {
97
+ 5: import("@gamepark/rules-api").HidingStrategy<number, number>;
98
+ 17: (item: MaterialItem) => string[];
99
+ };
100
+ 10: {
101
+ 15: import("@gamepark/rules-api").HidingStrategy<number, number>;
102
+ };
103
+ };
104
+ keepMoveSecret(move: MaterialMove): boolean;
105
+ beforeItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
106
+ onEntitySacrificed(card: Material): void;
107
+ protected onCustomMove(move: CustomMove): import("@gamepark/rules-api").EndGame[] | import("@gamepark/rules-api").StartPlayerTurn<PlayerColor, RuleId.ResolveEffects>[] | (import("@gamepark/rules-api").StartPlayerTurn<number, RuleId.PlaceCards> | import("@gamepark/rules-api").StartRule<RuleId.PlaceCards>)[];
108
+ getAutomaticMoves(): import("@gamepark/rules-api").StartPlayerTurn<PlayerColor, RuleId.ResolveEffects>[];
109
+ startEffectsResolution(): import("@gamepark/rules-api").StartPlayerTurn<PlayerColor, RuleId.ResolveEffects>[];
110
+ giveTime(): number;
111
+ }
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.MythologiesRules = void 0;
19
+ var rules_api_1 = require("@gamepark/rules-api");
20
+ var CustomMoveType_1 = require("./CustomMoveType");
21
+ var Effect_1 = require("./material/entity/Effect");
22
+ var LocationType_1 = require("./material/LocationType");
23
+ var MaterialType_1 = require("./material/MaterialType");
24
+ var Pantheon_1 = require("./material/Pantheon");
25
+ var Memory_1 = require("./Memory");
26
+ var ChooseDraftTokenRule_1 = require("./rules/ChooseDraftTokenRule");
27
+ var DrawDestinyCardRule_1 = require("./rules/DrawDestinyCardRule");
28
+ var AlfEffectRule_1 = require("./rules/effects/AlfEffectRule");
29
+ var AnubisEffectRule_1 = require("./rules/effects/AnubisEffectRule");
30
+ var AthenaEffectRule_1 = require("./rules/effects/AthenaEffectRule");
31
+ var BabaiEffectRule_1 = require("./rules/effects/BabaiEffectRule");
32
+ var BennuEffectRule_1 = require("./rules/effects/BennuEffectRule");
33
+ var CentaurEffectRule_1 = require("./rules/effects/CentaurEffectRule");
34
+ var ChimeraEffectRule_1 = require("./rules/effects/ChimeraEffectRule");
35
+ var CobraEffectRule_1 = require("./rules/effects/CobraEffectRule");
36
+ var CyclopsEffectRule_1 = require("./rules/effects/CyclopsEffectRule");
37
+ var DraugrEffectRule_1 = require("./rules/effects/DraugrEffectRule");
38
+ var FenrirEffectRule_1 = require("./rules/effects/FenrirEffectRule");
39
+ var GarudaEffectRule_1 = require("./rules/effects/GarudaEffectRule");
40
+ var GorgonEffectRule_1 = require("./rules/effects/GorgonEffectRule");
41
+ var GriffinEffectRule_1 = require("./rules/effects/GriffinEffectRule");
42
+ var HadesEffectRule_1 = require("./rules/effects/HadesEffectRule");
43
+ var KinnaraEffectRule_1 = require("./rules/effects/KinnaraEffectRule");
44
+ var MinotaurEffectRule_1 = require("./rules/effects/MinotaurEffectRule");
45
+ var OdinEffectRule_1 = require("./rules/effects/OdinEffectRule");
46
+ var RakshasaEffectRule_1 = require("./rules/effects/RakshasaEffectRule");
47
+ var ResolveEffectsRule_1 = require("./rules/effects/ResolveEffectsRule");
48
+ var ShivaEffectRule_1 = require("./rules/effects/ShivaEffectRule");
49
+ var SphinxEffectRule_1 = require("./rules/effects/SphinxEffectRule");
50
+ var ThorEffectRule_1 = require("./rules/effects/ThorEffectRule");
51
+ var TriggerEffectsRule_1 = require("./rules/effects/TriggerEffectsRule");
52
+ var VetalaEffectRule_1 = require("./rules/effects/VetalaEffectRule");
53
+ var EndGameRule_1 = require("./rules/EndGameRule");
54
+ var PlaceCardsRule_1 = require("./rules/PlaceCardsRule");
55
+ var PlaceTokenRule_1 = require("./rules/PlaceTokenRule");
56
+ var RuleId_1 = require("./rules/RuleId");
57
+ var UpkeepRule_1 = require("./rules/UpkeepRule");
58
+ var MythologiesRules = (function (_super) {
59
+ __extends(MythologiesRules, _super);
60
+ function MythologiesRules() {
61
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
62
+ var _this = _super !== null && _super.apply(this, arguments) || this;
63
+ _this.rules = (_a = {},
64
+ _a[RuleId_1.RuleId.DrawDestinyCard] = DrawDestinyCardRule_1.DrawDestinyCardRule,
65
+ _a[RuleId_1.RuleId.ChooseDraftToken] = ChooseDraftTokenRule_1.ChooseDraftTokenRule,
66
+ _a[RuleId_1.RuleId.PlaceToken] = PlaceTokenRule_1.PlaceTokenRule,
67
+ _a[RuleId_1.RuleId.PlaceCards] = PlaceCardsRule_1.PlaceCardsRule,
68
+ _a[RuleId_1.RuleId.Upkeep] = UpkeepRule_1.UpkeepRule,
69
+ _a[RuleId_1.RuleId.EndGame] = EndGameRule_1.EndGameRule,
70
+ _a[RuleId_1.RuleId.ResolveEffects] = ResolveEffectsRule_1.ResolveEffectsRule,
71
+ _a[RuleId_1.RuleId.AthenaEffect] = AthenaEffectRule_1.AthenaEffectRule,
72
+ _a[RuleId_1.RuleId.HadesEffect] = HadesEffectRule_1.HadesEffectRule,
73
+ _a[RuleId_1.RuleId.MinotaurEffect] = MinotaurEffectRule_1.MinotaurEffectRule,
74
+ _a[RuleId_1.RuleId.CentaurEffect] = CentaurEffectRule_1.CentaurEffectRule,
75
+ _a[RuleId_1.RuleId.CentaurEffectSacrifice] = CentaurEffectRule_1.CentaurEffectSacrificeRule,
76
+ _a[RuleId_1.RuleId.GorgonEffect] = GorgonEffectRule_1.GorgonEffectRule,
77
+ _a[RuleId_1.RuleId.CyclopsEffect] = CyclopsEffectRule_1.CyclopsEffectRule,
78
+ _a[RuleId_1.RuleId.GriffinEffect] = GriffinEffectRule_1.GriffinEffectRule,
79
+ _a[RuleId_1.RuleId.ChimeraEffect] = ChimeraEffectRule_1.ChimeraEffectRule,
80
+ _a[RuleId_1.RuleId.OdinEffect] = OdinEffectRule_1.OdinEffectRule,
81
+ _a[RuleId_1.RuleId.ThorEffect] = ThorEffectRule_1.ThorEffectRule,
82
+ _a[RuleId_1.RuleId.DraugrEffect] = DraugrEffectRule_1.DraugrEffectRule,
83
+ _a[RuleId_1.RuleId.FenrirChoice] = FenrirEffectRule_1.FenrirChoiceRule,
84
+ _a[RuleId_1.RuleId.FenrirEffect] = FenrirEffectRule_1.FenrirEffectRule,
85
+ _a[RuleId_1.RuleId.AlfEffect] = AlfEffectRule_1.AlfEffectRule,
86
+ _a[RuleId_1.RuleId.AnubisEffect] = AnubisEffectRule_1.AnubisEffectRule,
87
+ _a[RuleId_1.RuleId.SphinxEffect] = SphinxEffectRule_1.SphinxEffectRule,
88
+ _a[RuleId_1.RuleId.CobraEffect] = CobraEffectRule_1.CobraEffectRule,
89
+ _a[RuleId_1.RuleId.CobraInvokeEffect] = CobraEffectRule_1.CobraInvokeEffect,
90
+ _a[RuleId_1.RuleId.BabaiEffect] = BabaiEffectRule_1.BabaiEffectRule,
91
+ _a[RuleId_1.RuleId.BennuEffect] = BennuEffectRule_1.BennuEffectRule,
92
+ _a[RuleId_1.RuleId.ShivaEffect] = ShivaEffectRule_1.ShivaEffectRule,
93
+ _a[RuleId_1.RuleId.RakshasaEffect] = RakshasaEffectRule_1.RakshasaEffectRule,
94
+ _a[RuleId_1.RuleId.GarudaEffect] = GarudaEffectRule_1.GarudaEffectRule,
95
+ _a[RuleId_1.RuleId.VetalaEffect] = VetalaEffectRule_1.VetalaEffectRule,
96
+ _a[RuleId_1.RuleId.KinnaraEffect] = KinnaraEffectRule_1.KinnaraEffectRule,
97
+ _a[RuleId_1.RuleId.KinnaraPlaceEffect] = KinnaraEffectRule_1.KinnaraPlaceEffectRule,
98
+ _a);
99
+ _this.locationsStrategies = (_b = {},
100
+ _b[MaterialType_1.MaterialType.EntityCard] = (_c = {},
101
+ _c[LocationType_1.LocationType.GodsDeck] = new rules_api_1.PositiveSequenceStrategy(),
102
+ _c[LocationType_1.LocationType.CreaturesDeck] = new rules_api_1.PositiveSequenceStrategy(),
103
+ _c[LocationType_1.LocationType.SanctuaryCreatureSpot] = new rules_api_1.FillGapStrategy(),
104
+ _c[LocationType_1.LocationType.Pantheon] = new rules_api_1.StackingStrategy(),
105
+ _c[LocationType_1.LocationType.PlayerDiscard] = new rules_api_1.PositiveSequenceStrategy(),
106
+ _c),
107
+ _b[MaterialType_1.MaterialType.DraftToken] = (_d = {},
108
+ _d[LocationType_1.LocationType.PlayerHand] = new rules_api_1.PositiveSequenceStrategy(),
109
+ _d),
110
+ _b[MaterialType_1.MaterialType.DestinyCard] = (_e = {},
111
+ _e[LocationType_1.LocationType.DestinyDeck] = new rules_api_1.PositiveSequenceStrategy(),
112
+ _e[LocationType_1.LocationType.CurrentDestiny] = new rules_api_1.PositiveSequenceStrategy(),
113
+ _e),
114
+ _b);
115
+ _this.hidingStrategies = (_f = {},
116
+ _f[MaterialType_1.MaterialType.EntityCard] = (_g = {},
117
+ _g[LocationType_1.LocationType.GodsDeck] = rules_api_1.hideFront,
118
+ _g[LocationType_1.LocationType.CreaturesDeck] = function (item) { return (item.location.rotation ? [] : ['id.front']); },
119
+ _g[LocationType_1.LocationType.SanctuaryGodSpot] = function (item, player) { var _a; return (((_a = item.location.rotation) !== null && _a !== void 0 ? _a : player) === player ? [] : ['id.front']); },
120
+ _g[LocationType_1.LocationType.SanctuaryCreatureSpot] = function (item, player) { var _a; return (((_a = item.location.rotation) !== null && _a !== void 0 ? _a : player) === player ? [] : ['id.front']); },
121
+ _g),
122
+ _f[MaterialType_1.MaterialType.DraftToken] = (_h = {},
123
+ _h[LocationType_1.LocationType.PlayerHand] = rules_api_1.hideFrontToOthers,
124
+ _h[LocationType_1.LocationType.PlayedTokenSpot] = function (item) { return (item.location.rotation ? ['id.front'] : []); },
125
+ _h),
126
+ _f[MaterialType_1.MaterialType.DestinyCard] = (_j = {},
127
+ _j[LocationType_1.LocationType.DestinyDeck] = rules_api_1.hideItemId,
128
+ _j),
129
+ _f);
130
+ return _this;
131
+ }
132
+ MythologiesRules.prototype.keepMoveSecret = function (move) {
133
+ return ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.DraftToken)(move) &&
134
+ this.remind(Memory_1.Memory.KeepTokenPlaceSecret, this.material(MaterialType_1.MaterialType.DraftToken).getItem(move.itemIndex).id.back) === true);
135
+ };
136
+ MythologiesRules.prototype.beforeItemMove = function (move) {
137
+ var _a;
138
+ if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move)) {
139
+ if (move.location.type === LocationType_1.LocationType.Pantheon) {
140
+ var location = this.material(MaterialType_1.MaterialType.EntityCard).getItem(move.itemIndex).location;
141
+ if (location.type !== LocationType_1.LocationType.Pantheon && location.type !== LocationType_1.LocationType.PlayerBufferArea) {
142
+ return new Pantheon_1.Pantheon(this.game, move.location.player).onCardPlaced(move);
143
+ }
144
+ }
145
+ else if (move.location.type === LocationType_1.LocationType.PlayerDiscard) {
146
+ var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
147
+ var location = card.getItem().location;
148
+ if (location.type === LocationType_1.LocationType.Pantheon) {
149
+ this.onEntitySacrificed(card);
150
+ }
151
+ }
152
+ }
153
+ if ((0, rules_api_1.isMoveItemTypeAtOnce)(MaterialType_1.MaterialType.EntityCard)(move)) {
154
+ if (move.location.type === LocationType_1.LocationType.PlayerDiscard) {
155
+ var pile = this.material(MaterialType_1.MaterialType.EntityCard).index(move.indexes);
156
+ if (((_a = pile.getItem()) === null || _a === void 0 ? void 0 : _a.location.type) === LocationType_1.LocationType.Pantheon) {
157
+ var topCard = pile.maxBy(function (item) { return item.location.z; });
158
+ this.onEntitySacrificed(topCard);
159
+ }
160
+ }
161
+ }
162
+ if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.GemToken)(move) && move.location.type === LocationType_1.LocationType.PlayerGems) {
163
+ var gem = this.material(MaterialType_1.MaterialType.GemToken).getItem(move.itemIndex);
164
+ var player = gem.location.player;
165
+ if (gem.location.type === LocationType_1.LocationType.PantheonLineBonus && player === move.location.player) {
166
+ new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.LineBonusGain, player: player, y: gem.location.y });
167
+ }
168
+ }
169
+ if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.FavorToken)(move) && move.location.type === LocationType_1.LocationType.PlayerFavor) {
170
+ var favor = this.material(MaterialType_1.MaterialType.FavorToken).getItem(move.itemIndex);
171
+ var player = favor.location.player;
172
+ if (favor.location.type === LocationType_1.LocationType.PantheonColumnBonus && player === move.location.player) {
173
+ new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.ColumnBonusGain, player: player, x: favor.location.x });
174
+ }
175
+ }
176
+ return [];
177
+ };
178
+ MythologiesRules.prototype.onEntitySacrificed = function (card) {
179
+ new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.EntitySacrificed, card: card.getItem(), cardIndex: card.getIndex() });
180
+ };
181
+ MythologiesRules.prototype.onCustomMove = function (move) {
182
+ var _a;
183
+ if (move.type === CustomMoveType_1.CustomMoveType.EndEffect) {
184
+ this.forget(Memory_1.Memory.OngoingEffect);
185
+ if (this.remind(Memory_1.Memory.PendingEffects).length) {
186
+ return this.startEffectsResolution();
187
+ }
188
+ else {
189
+ var _b = this.remind(Memory_1.Memory.PendingRule), id = _b.id, player = _b.player;
190
+ this.forget(Memory_1.Memory.PendingRule);
191
+ switch (id) {
192
+ case RuleId_1.RuleId.EndGame:
193
+ return [this.endGame()];
194
+ default:
195
+ return [player === ((_a = this.game.rule) === null || _a === void 0 ? void 0 : _a.player) ? this.startRule(RuleId_1.RuleId.PlaceCards) : this.startPlayerTurn(RuleId_1.RuleId.PlaceCards, player)];
196
+ }
197
+ }
198
+ }
199
+ return [];
200
+ };
201
+ MythologiesRules.prototype.getAutomaticMoves = function () {
202
+ var _a;
203
+ if (!this.remind(Memory_1.Memory.OngoingEffect) && ((_a = this.game.rule) === null || _a === void 0 ? void 0 : _a.id) !== RuleId_1.RuleId.ResolveEffects && this.remind(Memory_1.Memory.PendingEffects).length) {
204
+ return this.startEffectsResolution();
205
+ }
206
+ return [];
207
+ };
208
+ MythologiesRules.prototype.startEffectsResolution = function () {
209
+ var cardIndex = this.remind(Memory_1.Memory.PendingEffects)[0][0].cardIndex;
210
+ var player = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex).location.player;
211
+ return [this.startPlayerTurn(RuleId_1.RuleId.ResolveEffects, player)];
212
+ };
213
+ MythologiesRules.prototype.giveTime = function () {
214
+ return 60;
215
+ };
216
+ return MythologiesRules;
217
+ }(rules_api_1.SecretMaterialRules));
218
+ exports.MythologiesRules = MythologiesRules;
@@ -0,0 +1,17 @@
1
+ import { MaterialGameSetup } from '@gamepark/rules-api';
2
+ import { LocationType } from './material/LocationType';
3
+ import { MaterialType } from './material/MaterialType';
4
+ import { Mythology } from './material/Mythology';
5
+ import { MythologiesOptions } from './MythologiesOptions';
6
+ import { MythologiesRules } from './MythologiesRules';
7
+ import { PlayerColor } from './PlayerColor';
8
+ export declare class MythologiesSetup extends MaterialGameSetup<PlayerColor, MaterialType, LocationType, MythologiesOptions> {
9
+ Rules: typeof MythologiesRules;
10
+ setupMaterial(options: MythologiesOptions): void;
11
+ getMythologies(options: MythologiesOptions): Mythology[];
12
+ setupMythologies(mythologies: Mythology[]): void;
13
+ setupPlayers(): void;
14
+ dealCreatures(): void;
15
+ private createDestinyCards;
16
+ start(): void;
17
+ }
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __values = (this && this.__values) || function(o) {
18
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
19
+ if (m) return m.call(o);
20
+ if (o && typeof o.length === "number") return {
21
+ next: function () {
22
+ if (o && i >= o.length) o = void 0;
23
+ return { value: o && o[i++], done: !o };
24
+ }
25
+ };
26
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.MythologiesSetup = void 0;
30
+ var rules_api_1 = require("@gamepark/rules-api");
31
+ var lodash_1 = require("lodash");
32
+ var Entity_1 = require("./material/Entity");
33
+ var LocationType_1 = require("./material/LocationType");
34
+ var MaterialType_1 = require("./material/MaterialType");
35
+ var Mythology_1 = require("./material/Mythology");
36
+ var Memory_1 = require("./Memory");
37
+ var MythologiesRules_1 = require("./MythologiesRules");
38
+ var RuleId_1 = require("./rules/RuleId");
39
+ var MythologiesSetup = (function (_super) {
40
+ __extends(MythologiesSetup, _super);
41
+ function MythologiesSetup() {
42
+ var _this = _super !== null && _super.apply(this, arguments) || this;
43
+ _this.Rules = MythologiesRules_1.MythologiesRules;
44
+ return _this;
45
+ }
46
+ MythologiesSetup.prototype.setupMaterial = function (options) {
47
+ this.memorize(Memory_1.Memory.PendingEffects, []);
48
+ this.setupMythologies(this.getMythologies(options));
49
+ this.setupPlayers();
50
+ this.dealCreatures();
51
+ this.material(MaterialType_1.MaterialType.RoundToken).createItem({ location: { type: LocationType_1.LocationType.RoundSpace, id: 1 } });
52
+ this.createDestinyCards();
53
+ };
54
+ MythologiesSetup.prototype.getMythologies = function (options) {
55
+ var array = Array.isArray(options.mythologies) ? options.mythologies : [];
56
+ var mythologies = array.filter(function (item) { return typeof item === 'number' && Mythology_1.Mythology[item]; });
57
+ if (mythologies.length === 4) {
58
+ return mythologies;
59
+ }
60
+ else if (mythologies.length < 4) {
61
+ return mythologies.concat((0, lodash_1.sampleSize)((0, lodash_1.difference)(Mythology_1.availableMythologies, mythologies), 4 - mythologies.length));
62
+ }
63
+ else {
64
+ return (0, lodash_1.sampleSize)(mythologies, 4);
65
+ }
66
+ };
67
+ MythologiesSetup.prototype.setupMythologies = function (mythologies) {
68
+ var e_1, _a;
69
+ this.material(MaterialType_1.MaterialType.MythologyBoard).createItems(mythologies.map(function (mythology, index) { return ({
70
+ id: { mythology: mythology, side: index % 2 },
71
+ location: {
72
+ type: LocationType_1.LocationType.Sanctuary,
73
+ x: index % 2,
74
+ y: Math.floor(index / 2)
75
+ }
76
+ }); }));
77
+ var _loop_1 = function (mythology) {
78
+ this_1.material(MaterialType_1.MaterialType.EntityCard).createItems((0, lodash_1.shuffle)((0, lodash_1.range)(1, 5)).map(function (god) { return ({
79
+ id: { front: mythology * 10 + god, back: { mythology: mythology, entityType: Entity_1.EntityType.God } },
80
+ location: {
81
+ type: LocationType_1.LocationType.GodsDeck,
82
+ id: mythology
83
+ }
84
+ }); }));
85
+ this_1.material(MaterialType_1.MaterialType.EntityCard).createItems((0, lodash_1.shuffle)(Array(3).fill((0, lodash_1.range)(5, 11)).flat()).map(function (creature) { return ({
86
+ id: { front: mythology * 10 + creature, back: { mythology: mythology, entityType: Entity_1.EntityType.Creature } },
87
+ location: {
88
+ type: LocationType_1.LocationType.CreaturesDeck,
89
+ id: mythology
90
+ }
91
+ }); }));
92
+ };
93
+ var this_1 = this;
94
+ try {
95
+ for (var mythologies_1 = __values(mythologies), mythologies_1_1 = mythologies_1.next(); !mythologies_1_1.done; mythologies_1_1 = mythologies_1.next()) {
96
+ var mythology = mythologies_1_1.value;
97
+ _loop_1(mythology);
98
+ }
99
+ }
100
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
101
+ finally {
102
+ try {
103
+ if (mythologies_1_1 && !mythologies_1_1.done && (_a = mythologies_1.return)) _a.call(mythologies_1);
104
+ }
105
+ finally { if (e_1) throw e_1.error; }
106
+ }
107
+ };
108
+ MythologiesSetup.prototype.setupPlayers = function () {
109
+ var e_2, _a;
110
+ var _loop_2 = function (player) {
111
+ this_2.material(MaterialType_1.MaterialType.DraftToken).createItems((0, lodash_1.shuffle)([true, true, false]).map(function (front) { return ({
112
+ id: { front: front, back: player },
113
+ location: { type: LocationType_1.LocationType.PlayerHand, player: player }
114
+ }); }));
115
+ this_2.material(MaterialType_1.MaterialType.GemToken).createItems((0, lodash_1.range)(0, 3).map(function (y) { return ({ location: { type: LocationType_1.LocationType.PantheonLineBonus, player: player, y: y } }); }));
116
+ this_2.material(MaterialType_1.MaterialType.FavorToken).createItems((0, lodash_1.range)(0, 3).map(function (x) { return ({ location: { type: LocationType_1.LocationType.PantheonColumnBonus, player: player, x: x } }); }));
117
+ };
118
+ var this_2 = this;
119
+ try {
120
+ for (var _b = __values(this.players), _c = _b.next(); !_c.done; _c = _b.next()) {
121
+ var player = _c.value;
122
+ _loop_2(player);
123
+ }
124
+ }
125
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
126
+ finally {
127
+ try {
128
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
129
+ }
130
+ finally { if (e_2) throw e_2.error; }
131
+ }
132
+ this.material(MaterialType_1.MaterialType.FirstPlayerToken).createItem({ location: { type: LocationType_1.LocationType.FirstPlayerTokenSpot, player: this.players[0] } });
133
+ };
134
+ MythologiesSetup.prototype.dealCreatures = function () {
135
+ var e_3, _a;
136
+ var mythologyBoards = this.material(MaterialType_1.MaterialType.MythologyBoard);
137
+ try {
138
+ for (var _b = __values(mythologyBoards.getIndexes()), _c = _b.next(); !_c.done; _c = _b.next()) {
139
+ var index = _c.value;
140
+ var mythology = mythologyBoards.getItem(index).id.mythology;
141
+ var deck = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.CreaturesDeck).locationId(mythology).deck();
142
+ deck.deal({ type: LocationType_1.LocationType.SanctuaryCreatureSpot, parent: index }, 3);
143
+ }
144
+ }
145
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
146
+ finally {
147
+ try {
148
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
149
+ }
150
+ finally { if (e_3) throw e_3.error; }
151
+ }
152
+ };
153
+ MythologiesSetup.prototype.createDestinyCards = function () {
154
+ this.material(MaterialType_1.MaterialType.DestinyCard).createItems((0, lodash_1.shuffle)((0, lodash_1.range)(1, 5)).map(function (id) { return ({ id: id, location: { type: LocationType_1.LocationType.DestinyDeck } }); }));
155
+ };
156
+ MythologiesSetup.prototype.start = function () {
157
+ this.startRule(RuleId_1.RuleId.DrawDestinyCard);
158
+ };
159
+ return MythologiesSetup;
160
+ }(rules_api_1.MaterialGameSetup));
161
+ exports.MythologiesSetup = MythologiesSetup;
@@ -0,0 +1,10 @@
1
+ export declare enum PlayerColor {
2
+ Green = 1,
3
+ Red = 2,
4
+ Blue = 3,
5
+ Grey = 4
6
+ }
7
+ export type DraftTokenId = {
8
+ front?: boolean;
9
+ back: PlayerColor;
10
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlayerColor = void 0;
4
+ var PlayerColor;
5
+ (function (PlayerColor) {
6
+ PlayerColor[PlayerColor["Green"] = 1] = "Green";
7
+ PlayerColor[PlayerColor["Red"] = 2] = "Red";
8
+ PlayerColor[PlayerColor["Blue"] = 3] = "Blue";
9
+ PlayerColor[PlayerColor["Grey"] = 4] = "Grey";
10
+ })(PlayerColor = exports.PlayerColor || (exports.PlayerColor = {}));
@@ -0,0 +1,3 @@
1
+ export { MythologiesRules } from './MythologiesRules';
2
+ export { MythologiesOptionsSpec } from './MythologiesOptions';
3
+ export { MythologiesSetup } from './MythologiesSetup';
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MythologiesSetup = exports.MythologiesOptionsSpec = exports.MythologiesRules = void 0;
4
+ var MythologiesRules_1 = require("./MythologiesRules");
5
+ Object.defineProperty(exports, "MythologiesRules", { enumerable: true, get: function () { return MythologiesRules_1.MythologiesRules; } });
6
+ var MythologiesOptions_1 = require("./MythologiesOptions");
7
+ Object.defineProperty(exports, "MythologiesOptionsSpec", { enumerable: true, get: function () { return MythologiesOptions_1.MythologiesOptionsSpec; } });
8
+ var MythologiesSetup_1 = require("./MythologiesSetup");
9
+ Object.defineProperty(exports, "MythologiesSetup", { enumerable: true, get: function () { return MythologiesSetup_1.MythologiesSetup; } });
@@ -0,0 +1,9 @@
1
+ import { MaterialRulesPart } from '@gamepark/rules-api';
2
+ import { PlayerColor } from '../PlayerColor';
3
+ export declare class Destiny extends MaterialRulesPart {
4
+ getMythologyBoard(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
5
+ getMythology(player: PlayerColor): import("./Mythology").Mythology;
6
+ getDestinyMap(destiny: number): PlayerColor[][];
7
+ getAvailableEntities(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
8
+ getBoardsWithoutPlayer(): import("@gamepark/rules-api").Material<number, number, number>;
9
+ }