@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,115 @@
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.isCrushed = exports.isPlacedCrush = exports.oncePerTurn = exports.isEndOfGame = exports.isPlaced = exports.TriggerEventType = exports.SimultaneousEffectRule = exports.PlayerEffectRule = void 0;
19
+ var rules_api_1 = require("@gamepark/rules-api");
20
+ var CustomMoveType_1 = require("../../CustomMoveType");
21
+ var Memory_1 = require("../../Memory");
22
+ var MaterialType_1 = require("../MaterialType");
23
+ var PlayerEffectRule = (function (_super) {
24
+ __extends(PlayerEffectRule, _super);
25
+ function PlayerEffectRule() {
26
+ return _super !== null && _super.apply(this, arguments) || this;
27
+ }
28
+ PlayerEffectRule.prototype.canPlayEffect = function (_cardIndex) {
29
+ return true;
30
+ };
31
+ PlayerEffectRule.prototype.playEffect = function () {
32
+ return this.ruleId ? [this.startRule(this.ruleId)] : [];
33
+ };
34
+ PlayerEffectRule.prototype.onRuleStart = function () {
35
+ if (!this.getPlayerMoves().length) {
36
+ return this.endEffect();
37
+ }
38
+ return [];
39
+ };
40
+ Object.defineProperty(PlayerEffectRule.prototype, "card", {
41
+ get: function () {
42
+ var index = this.getEffect().cardIndex;
43
+ return this.material(MaterialType_1.MaterialType.EntityCard).getItem(index);
44
+ },
45
+ enumerable: false,
46
+ configurable: true
47
+ });
48
+ PlayerEffectRule.prototype.getEffect = function () {
49
+ return this.remind(Memory_1.Memory.OngoingEffect);
50
+ };
51
+ PlayerEffectRule.prototype.endEffect = function () {
52
+ return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
53
+ };
54
+ return PlayerEffectRule;
55
+ }(rules_api_1.PlayerTurnRule));
56
+ exports.PlayerEffectRule = PlayerEffectRule;
57
+ var SimultaneousEffectRule = (function (_super) {
58
+ __extends(SimultaneousEffectRule, _super);
59
+ function SimultaneousEffectRule() {
60
+ return _super !== null && _super.apply(this, arguments) || this;
61
+ }
62
+ SimultaneousEffectRule.prototype.canPlayEffect = function (_cardIndex) {
63
+ return true;
64
+ };
65
+ SimultaneousEffectRule.prototype.playEffect = function () {
66
+ var players = this.getAffectedPlayers();
67
+ return players.length && this.ruleId ? [this.startSimultaneousRule(this.ruleId, players)] : [];
68
+ };
69
+ SimultaneousEffectRule.prototype.getAffectedPlayers = function () {
70
+ var _this = this;
71
+ return this.game.players.filter(function (player) { return _this.getActivePlayerLegalMoves(player).length > 0; });
72
+ };
73
+ SimultaneousEffectRule.prototype.isOpponent = function (player) {
74
+ return player !== this.card.location.player;
75
+ };
76
+ Object.defineProperty(SimultaneousEffectRule.prototype, "card", {
77
+ get: function () {
78
+ var index = this.getEffect().cardIndex;
79
+ return this.material(MaterialType_1.MaterialType.EntityCard).getItem(index);
80
+ },
81
+ enumerable: false,
82
+ configurable: true
83
+ });
84
+ SimultaneousEffectRule.prototype.getEffect = function () {
85
+ return this.remind(Memory_1.Memory.OngoingEffect);
86
+ };
87
+ SimultaneousEffectRule.prototype.getMovesAfterPlayersDone = function () {
88
+ return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
89
+ };
90
+ return SimultaneousEffectRule;
91
+ }(rules_api_1.SimultaneousRule));
92
+ exports.SimultaneousEffectRule = SimultaneousEffectRule;
93
+ var TriggerEventType;
94
+ (function (TriggerEventType) {
95
+ TriggerEventType[TriggerEventType["EndOfGame"] = 1] = "EndOfGame";
96
+ TriggerEventType[TriggerEventType["SelfPlaced"] = 2] = "SelfPlaced";
97
+ TriggerEventType[TriggerEventType["EntityInvoked"] = 3] = "EntityInvoked";
98
+ TriggerEventType[TriggerEventType["LineBonusGain"] = 4] = "LineBonusGain";
99
+ TriggerEventType[TriggerEventType["ColumnBonusGain"] = 5] = "ColumnBonusGain";
100
+ TriggerEventType[TriggerEventType["Infinite"] = 6] = "Infinite";
101
+ TriggerEventType[TriggerEventType["EntityCrushed"] = 7] = "EntityCrushed";
102
+ TriggerEventType[TriggerEventType["EntitySacrificed"] = 8] = "EntitySacrificed";
103
+ })(TriggerEventType = exports.TriggerEventType || (exports.TriggerEventType = {}));
104
+ var isPlaced = function (event) { return event.type === TriggerEventType.SelfPlaced; };
105
+ exports.isPlaced = isPlaced;
106
+ var isEndOfGame = function (event) { return event.type === TriggerEventType.EndOfGame; };
107
+ exports.isEndOfGame = isEndOfGame;
108
+ var oncePerTurn = function (event) { return event.type === TriggerEventType.Infinite; };
109
+ exports.oncePerTurn = oncePerTurn;
110
+ var isPlacedCrush = function (event) { return (0, exports.isPlaced)(event) && event.crush; };
111
+ exports.isPlacedCrush = isPlacedCrush;
112
+ var isCrushed = function (event, card) {
113
+ return event.type === TriggerEventType.EntityCrushed && event.cardIndex === card.getIndex();
114
+ };
115
+ exports.isCrushed = isCrushed;
@@ -0,0 +1,13 @@
1
+ import { Entity } from '../Entity';
2
+ import { Effect } from './Effect';
3
+ export type EntityDescription = {
4
+ invoke: [InvokeGain, InvokeGain, InvokeGain];
5
+ effect?: Effect;
6
+ effects?: Effect[];
7
+ };
8
+ export type InvokeGain = {
9
+ gem?: number;
10
+ favor?: number;
11
+ };
12
+ export declare function getEffects(entity: Entity): Effect[];
13
+ export declare const entities: Record<Entity, EntityDescription>;
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.entities = exports.getEffects = void 0;
5
+ var Entity_1 = require("../Entity");
6
+ var Banshee_1 = require("./celtic/Banshee");
7
+ var Brigid_1 = require("./celtic/Brigid");
8
+ var Cernunnos_1 = require("./celtic/Cernunnos");
9
+ var Dagda_1 = require("./celtic/Dagda");
10
+ var Dryad_1 = require("./celtic/Dryad");
11
+ var Dullahan_1 = require("./celtic/Dullahan");
12
+ var Kelpie_1 = require("./celtic/Kelpie");
13
+ var Leprechaun_1 = require("./celtic/Leprechaun");
14
+ var Morrigan_1 = require("./celtic/Morrigan");
15
+ var Selkie_1 = require("./celtic/Selkie");
16
+ var ChangE_1 = require("./chinese/ChangE");
17
+ var Fenghuang_1 = require("./chinese/Fenghuang");
18
+ var Jiangshi_1 = require("./chinese/Jiangshi");
19
+ var Mogwai_1 = require("./chinese/Mogwai");
20
+ var Nian_1 = require("./chinese/Nian");
21
+ var Nuwa_1 = require("./chinese/Nuwa");
22
+ var Qilin_1 = require("./chinese/Qilin");
23
+ var SunWukong_1 = require("./chinese/SunWukong");
24
+ var Tianlong_1 = require("./chinese/Tianlong");
25
+ var YanluoWang_1 = require("./chinese/YanluoWang");
26
+ var Anubis_1 = require("./egyptian/Anubis");
27
+ var Babai_1 = require("./egyptian/Babai");
28
+ var Beetle_1 = require("./egyptian/Beetle");
29
+ var Bennu_1 = require("./egyptian/Bennu");
30
+ var Cobra_1 = require("./egyptian/Cobra");
31
+ var Isis_1 = require("./egyptian/Isis");
32
+ var Mummy_1 = require("./egyptian/Mummy");
33
+ var Osiris_1 = require("./egyptian/Osiris");
34
+ var Ra_1 = require("./egyptian/Ra");
35
+ var Sphinx_1 = require("./egyptian/Sphinx");
36
+ var Athena_1 = require("./greek/Athena");
37
+ var Centaur_1 = require("./greek/Centaur");
38
+ var Chimera_1 = require("./greek/Chimera");
39
+ var Cyclops_1 = require("./greek/Cyclops");
40
+ var Gorgon_1 = require("./greek/Gorgon");
41
+ var Griffin_1 = require("./greek/Griffin");
42
+ var Hades_1 = require("./greek/Hades");
43
+ var Minotaur_1 = require("./greek/Minotaur");
44
+ var Poseidon_1 = require("./greek/Poseidon");
45
+ var Zeus_1 = require("./greek/Zeus");
46
+ var Asura_1 = require("./hindu/Asura");
47
+ var Brahma_1 = require("./hindu/Brahma");
48
+ var Ganesh_1 = require("./hindu/Ganesh");
49
+ var Garuda_1 = require("./hindu/Garuda");
50
+ var Kinnara_1 = require("./hindu/Kinnara");
51
+ var Naga_1 = require("./hindu/Naga");
52
+ var Rakshasa_1 = require("./hindu/Rakshasa");
53
+ var Shiva_1 = require("./hindu/Shiva");
54
+ var Vetala_1 = require("./hindu/Vetala");
55
+ var Vishnu_1 = require("./hindu/Vishnu");
56
+ var Amaru_1 = require("./inca/Amaru");
57
+ var Caiman_1 = require("./inca/Caiman");
58
+ var Condor_1 = require("./inca/Condor");
59
+ var Illapa_1 = require("./inca/Illapa");
60
+ var Inti_1 = require("./inca/Inti");
61
+ var MamaQucha_1 = require("./inca/MamaQucha");
62
+ var Pumapunku_1 = require("./inca/Pumapunku");
63
+ var Supay_1 = require("./inca/Supay");
64
+ var Ukuku_1 = require("./inca/Ukuku");
65
+ var Viracocha_1 = require("./inca/Viracocha");
66
+ var Alf_1 = require("./norse/Alf");
67
+ var Draugr_1 = require("./norse/Draugr");
68
+ var Fenrir_1 = require("./norse/Fenrir");
69
+ var Freya_1 = require("./norse/Freya");
70
+ var Jotunn_1 = require("./norse/Jotunn");
71
+ var Loki_1 = require("./norse/Loki");
72
+ var Odin_1 = require("./norse/Odin");
73
+ var Thor_1 = require("./norse/Thor");
74
+ var Troll_1 = require("./norse/Troll");
75
+ var Valkyrie_1 = require("./norse/Valkyrie");
76
+ var Idlozi_1 = require("./zulu/Idlozi");
77
+ var Impundulu_1 = require("./zulu/Impundulu");
78
+ var Inkanyamba_1 = require("./zulu/Inkanyamba");
79
+ var Inkosazana_1 = require("./zulu/Inkosazana");
80
+ var Shembe_1 = require("./zulu/Shembe");
81
+ var Tokoloshe_1 = require("./zulu/Tokoloshe");
82
+ var Umvelinqangi_1 = require("./zulu/Umvelinqangi");
83
+ var Unkulunkulu_1 = require("./zulu/Unkulunkulu");
84
+ var Unwabu_1 = require("./zulu/Unwabu");
85
+ var Werehyena_1 = require("./zulu/Werehyena");
86
+ function getEffects(entity) {
87
+ var _a;
88
+ var description = exports.entities[entity];
89
+ return (_a = description.effects) !== null && _a !== void 0 ? _a : (description.effect ? [description.effect] : []);
90
+ }
91
+ exports.getEffects = getEffects;
92
+ exports.entities = (_a = {},
93
+ _a[Entity_1.Entity.Zeus] = Zeus_1.Zeus,
94
+ _a[Entity_1.Entity.Poseidon] = Poseidon_1.Poseidon,
95
+ _a[Entity_1.Entity.Athena] = Athena_1.Athena,
96
+ _a[Entity_1.Entity.Hades] = Hades_1.Hades,
97
+ _a[Entity_1.Entity.Minotaur] = Minotaur_1.Minotaur,
98
+ _a[Entity_1.Entity.Centaur] = Centaur_1.Centaur,
99
+ _a[Entity_1.Entity.Gorgon] = Gorgon_1.Gorgon,
100
+ _a[Entity_1.Entity.Cyclops] = Cyclops_1.Cyclops,
101
+ _a[Entity_1.Entity.Griffin] = Griffin_1.Griffin,
102
+ _a[Entity_1.Entity.Chimera] = Chimera_1.Chimera,
103
+ _a[Entity_1.Entity.Odin] = Odin_1.Odin,
104
+ _a[Entity_1.Entity.Thor] = Thor_1.Thor,
105
+ _a[Entity_1.Entity.Loki] = Loki_1.Loki,
106
+ _a[Entity_1.Entity.Freya] = Freya_1.Freya,
107
+ _a[Entity_1.Entity.Draugr] = Draugr_1.Draugr,
108
+ _a[Entity_1.Entity.Jotunn] = Jotunn_1.Jotunn,
109
+ _a[Entity_1.Entity.Valkyrie] = Valkyrie_1.Valkyrie,
110
+ _a[Entity_1.Entity.Troll] = Troll_1.Troll,
111
+ _a[Entity_1.Entity.Fenrir] = Fenrir_1.Fenrir,
112
+ _a[Entity_1.Entity.Alf] = Alf_1.Alf,
113
+ _a[Entity_1.Entity.Ra] = Ra_1.Ra,
114
+ _a[Entity_1.Entity.Osiris] = Osiris_1.Osiris,
115
+ _a[Entity_1.Entity.Anubis] = Anubis_1.Anubis,
116
+ _a[Entity_1.Entity.Isis] = Isis_1.Isis,
117
+ _a[Entity_1.Entity.Beetle] = Beetle_1.Beetle,
118
+ _a[Entity_1.Entity.Mummy] = Mummy_1.Mummy,
119
+ _a[Entity_1.Entity.Sphinx] = Sphinx_1.Sphinx,
120
+ _a[Entity_1.Entity.Cobra] = Cobra_1.Cobra,
121
+ _a[Entity_1.Entity.Babai] = Babai_1.Babai,
122
+ _a[Entity_1.Entity.Bennu] = Bennu_1.Bennu,
123
+ _a[Entity_1.Entity.Brahma] = Brahma_1.Brahma,
124
+ _a[Entity_1.Entity.Vishnu] = Vishnu_1.Vishnu,
125
+ _a[Entity_1.Entity.Shiva] = Shiva_1.Shiva,
126
+ _a[Entity_1.Entity.Ganesh] = Ganesh_1.Ganesh,
127
+ _a[Entity_1.Entity.Asura] = Asura_1.Asura,
128
+ _a[Entity_1.Entity.Naga] = Naga_1.Naga,
129
+ _a[Entity_1.Entity.Rakshasa] = Rakshasa_1.Rakshasa,
130
+ _a[Entity_1.Entity.Garuda] = Garuda_1.Garuda,
131
+ _a[Entity_1.Entity.Vetala] = Vetala_1.Vetala,
132
+ _a[Entity_1.Entity.Kinnara] = Kinnara_1.Kinnara,
133
+ _a[Entity_1.Entity.Viracocha] = Viracocha_1.Viracocha,
134
+ _a[Entity_1.Entity.MamaQucha] = MamaQucha_1.MamaQucha,
135
+ _a[Entity_1.Entity.Illapa] = Illapa_1.Illapa,
136
+ _a[Entity_1.Entity.Inti] = Inti_1.Inti,
137
+ _a[Entity_1.Entity.Pumapunku] = Pumapunku_1.Pumapunku,
138
+ _a[Entity_1.Entity.Amaru] = Amaru_1.Amaru,
139
+ _a[Entity_1.Entity.Caiman] = Caiman_1.Caiman,
140
+ _a[Entity_1.Entity.Condor] = Condor_1.Condor,
141
+ _a[Entity_1.Entity.Supay] = Supay_1.Supay,
142
+ _a[Entity_1.Entity.Ukuku] = Ukuku_1.Ukuku,
143
+ _a[Entity_1.Entity.YanluoWang] = YanluoWang_1.YanluoWang,
144
+ _a[Entity_1.Entity.SunWukong] = SunWukong_1.SunWukong,
145
+ _a[Entity_1.Entity.Nuwa] = Nuwa_1.Nuwa,
146
+ _a[Entity_1.Entity.ChangE] = ChangE_1.ChangE,
147
+ _a[Entity_1.Entity.Tianlong] = Tianlong_1.Tianlong,
148
+ _a[Entity_1.Entity.Qilin] = Qilin_1.Qilin,
149
+ _a[Entity_1.Entity.Fenghuang] = Fenghuang_1.Fenghuang,
150
+ _a[Entity_1.Entity.Mogwai] = Mogwai_1.Mogwai,
151
+ _a[Entity_1.Entity.Jiangshi] = Jiangshi_1.Jiangshi,
152
+ _a[Entity_1.Entity.Nian] = Nian_1.Nian,
153
+ _a[Entity_1.Entity.Unkulunkulu] = Unkulunkulu_1.Unkulunkulu,
154
+ _a[Entity_1.Entity.Inkosazana] = Inkosazana_1.Inkosazana,
155
+ _a[Entity_1.Entity.Shembe] = Shembe_1.Shembe,
156
+ _a[Entity_1.Entity.Umvelinqangi] = Umvelinqangi_1.Umvelinqangi,
157
+ _a[Entity_1.Entity.Inkanyamba] = Inkanyamba_1.Inkanyamba,
158
+ _a[Entity_1.Entity.Unwabu] = Unwabu_1.Unwabu,
159
+ _a[Entity_1.Entity.Tokoloshe] = Tokoloshe_1.Tokoloshe,
160
+ _a[Entity_1.Entity.Impundulu] = Impundulu_1.Impundulu,
161
+ _a[Entity_1.Entity.Werehyena] = Werehyena_1.Werehyena,
162
+ _a[Entity_1.Entity.Idlozi] = Idlozi_1.Idlozi,
163
+ _a[Entity_1.Entity.Dagda] = Dagda_1.Dagda,
164
+ _a[Entity_1.Entity.Brigid] = Brigid_1.Brigid,
165
+ _a[Entity_1.Entity.Cernunnos] = Cernunnos_1.Cernunnos,
166
+ _a[Entity_1.Entity.Morrigan] = Morrigan_1.Morrigan,
167
+ _a[Entity_1.Entity.Kelpie] = Kelpie_1.Kelpie,
168
+ _a[Entity_1.Entity.Banshee] = Banshee_1.Banshee,
169
+ _a[Entity_1.Entity.Dryad] = Dryad_1.Dryad,
170
+ _a[Entity_1.Entity.Leprechaun] = Leprechaun_1.Leprechaun,
171
+ _a[Entity_1.Entity.Selkie] = Selkie_1.Selkie,
172
+ _a[Entity_1.Entity.Dullahan] = Dullahan_1.Dullahan,
173
+ _a);
@@ -0,0 +1,15 @@
1
+ import { CustomMove, ItemMove, Location, Material, MaterialItem, MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
2
+ import { PlayerEffectRule } from './Effect';
3
+ export declare abstract class MoveEffectRule extends PlayerEffectRule {
4
+ canPlayEffect(cardIndex: number): boolean;
5
+ playEffect(): MaterialMove[];
6
+ getPlayerMoves(): MaterialMove[];
7
+ getMoveCardsMoves(effectCardIndex?: number): MoveItem<number, number, number>[];
8
+ getCardsAbleToMove(effectCardIndex: number): Material<number, number, number>;
9
+ getMovingCards(effectCardIndex: number): Material;
10
+ getAvailableDestinations(card: MaterialItem, _cardIndex: number): XYCoordinates[];
11
+ isLegalDestination(_space: XYCoordinates, _cardLocation: Location): boolean;
12
+ afterItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
13
+ onCardMoved(_move: MoveItem): MaterialMove[];
14
+ onCustomMove(move: CustomMove): MaterialMove<number, number, number, number>[];
15
+ }
@@ -0,0 +1,86 @@
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.MoveEffectRule = void 0;
19
+ var rules_api_1 = require("@gamepark/rules-api");
20
+ var CustomMoveType_1 = require("../../CustomMoveType");
21
+ var LocationType_1 = require("../LocationType");
22
+ var MaterialType_1 = require("../MaterialType");
23
+ var Pantheon_1 = require("../Pantheon");
24
+ var Effect_1 = require("./Effect");
25
+ var MoveEffectRule = (function (_super) {
26
+ __extends(MoveEffectRule, _super);
27
+ function MoveEffectRule() {
28
+ return _super !== null && _super.apply(this, arguments) || this;
29
+ }
30
+ MoveEffectRule.prototype.canPlayEffect = function (cardIndex) {
31
+ return this.getMoveCardsMoves(cardIndex).length > 0;
32
+ };
33
+ MoveEffectRule.prototype.playEffect = function () {
34
+ if (!this.getMoveCardsMoves().length)
35
+ return [];
36
+ return _super.prototype.playEffect.call(this);
37
+ };
38
+ MoveEffectRule.prototype.getPlayerMoves = function () {
39
+ return this.getMoveCardsMoves();
40
+ };
41
+ MoveEffectRule.prototype.getMoveCardsMoves = function (effectCardIndex) {
42
+ var _this = this;
43
+ if (effectCardIndex === void 0) { effectCardIndex = this.getEffect().cardIndex; }
44
+ var cards = this.getCardsAbleToMove(effectCardIndex);
45
+ return cards.getIndexes().flatMap(function (cardIndex) {
46
+ var card = cards.index(cardIndex);
47
+ return _this.getAvailableDestinations(card.getItem(), cardIndex).map(function (_a) {
48
+ var x = _a.x, y = _a.y;
49
+ return card.moveItem({ type: LocationType_1.LocationType.Pantheon, player: _this.player, x: x, y: y });
50
+ });
51
+ });
52
+ };
53
+ MoveEffectRule.prototype.getCardsAbleToMove = function (effectCardIndex) {
54
+ var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
55
+ return this.getMovingCards(effectCardIndex).filter(function (item) { return pantheon.isAbleToMove(item); });
56
+ };
57
+ MoveEffectRule.prototype.getMovingCards = function (effectCardIndex) {
58
+ var player = this.material(MaterialType_1.MaterialType.EntityCard).getItem(effectCardIndex).location.player;
59
+ return new Pantheon_1.Pantheon(this.game, player).visibleEntities;
60
+ };
61
+ MoveEffectRule.prototype.getAvailableDestinations = function (card, _cardIndex) {
62
+ var _this = this;
63
+ return new Pantheon_1.Pantheon(this.game, this.player).legalSpaces.filter(function (space) { return (space.y !== card.location.y || space.x !== card.location.x) && _this.isLegalDestination(space, card.location); });
64
+ };
65
+ MoveEffectRule.prototype.isLegalDestination = function (_space, _cardLocation) {
66
+ return true;
67
+ };
68
+ MoveEffectRule.prototype.afterItemMove = function (move) {
69
+ if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.Pantheon) {
70
+ return this.onCardMoved(move);
71
+ }
72
+ return [];
73
+ };
74
+ MoveEffectRule.prototype.onCardMoved = function (_move) {
75
+ return this.endEffect();
76
+ };
77
+ MoveEffectRule.prototype.onCustomMove = function (move) {
78
+ if (move.type === CustomMoveType_1.CustomMoveType.EndEffect) {
79
+ var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
80
+ return pantheon.gainBonus();
81
+ }
82
+ return [];
83
+ };
84
+ return MoveEffectRule;
85
+ }(Effect_1.PlayerEffectRule));
86
+ exports.MoveEffectRule = MoveEffectRule;
@@ -0,0 +1,15 @@
1
+ import { ItemMove, Material, MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
2
+ import { PlayerEffectRule } from './Effect';
3
+ export declare abstract class PlaceCardEffectRule extends PlayerEffectRule {
4
+ canPlayEffect(cardIndex: number): boolean;
5
+ playEffect(): MaterialMove[];
6
+ getPlayerMoves(cardIndex?: number): MaterialMove[];
7
+ abstract getCardsToPlace(cardIndex: number): Material;
8
+ getAvailableDestinations(_cardIndex: number): XYCoordinates[];
9
+ afterItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
10
+ onCardPlaced(_move: MoveItem): MaterialMove[];
11
+ }
12
+ export declare abstract class InvokeEffectRule extends PlaceCardEffectRule {
13
+ isInvoke: boolean;
14
+ getAvailableDestinations(): XYCoordinates[];
15
+ }
@@ -0,0 +1,75 @@
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.InvokeEffectRule = exports.PlaceCardEffectRule = void 0;
19
+ var rules_api_1 = require("@gamepark/rules-api");
20
+ var Entity_1 = require("../Entity");
21
+ var LocationType_1 = require("../LocationType");
22
+ var MaterialType_1 = require("../MaterialType");
23
+ var Pantheon_1 = require("../Pantheon");
24
+ var Effect_1 = require("./Effect");
25
+ var PlaceCardEffectRule = (function (_super) {
26
+ __extends(PlaceCardEffectRule, _super);
27
+ function PlaceCardEffectRule() {
28
+ return _super !== null && _super.apply(this, arguments) || this;
29
+ }
30
+ PlaceCardEffectRule.prototype.canPlayEffect = function (cardIndex) {
31
+ return this.getPlayerMoves(cardIndex).length > 0;
32
+ };
33
+ PlaceCardEffectRule.prototype.playEffect = function () {
34
+ if (!this.getPlayerMoves().length)
35
+ return [];
36
+ return _super.prototype.playEffect.call(this);
37
+ };
38
+ PlaceCardEffectRule.prototype.getPlayerMoves = function (cardIndex) {
39
+ if (cardIndex === void 0) { cardIndex = this.getEffect().cardIndex; }
40
+ var player = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex).location.player;
41
+ var cards = this.getCardsToPlace(cardIndex);
42
+ var cardsICanPlace = new Pantheon_1.Pantheon(this.game, player).gems < 4 ? cards.id(function (id) { return !(0, Entity_1.isGod)(id.front); }) : cards;
43
+ return this.getAvailableDestinations(cardIndex).flatMap(function (_a) {
44
+ var x = _a.x, y = _a.y;
45
+ return cardsICanPlace.moveItems({ type: LocationType_1.LocationType.Pantheon, player: player, x: x, y: y });
46
+ });
47
+ };
48
+ PlaceCardEffectRule.prototype.getAvailableDestinations = function (_cardIndex) {
49
+ return new Pantheon_1.Pantheon(this.game, this.player).legalSpaces;
50
+ };
51
+ PlaceCardEffectRule.prototype.afterItemMove = function (move) {
52
+ if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.Pantheon) {
53
+ return this.onCardPlaced(move);
54
+ }
55
+ return [];
56
+ };
57
+ PlaceCardEffectRule.prototype.onCardPlaced = function (_move) {
58
+ return this.endEffect();
59
+ };
60
+ return PlaceCardEffectRule;
61
+ }(Effect_1.PlayerEffectRule));
62
+ exports.PlaceCardEffectRule = PlaceCardEffectRule;
63
+ var InvokeEffectRule = (function (_super) {
64
+ __extends(InvokeEffectRule, _super);
65
+ function InvokeEffectRule() {
66
+ var _this = _super !== null && _super.apply(this, arguments) || this;
67
+ _this.isInvoke = true;
68
+ return _this;
69
+ }
70
+ InvokeEffectRule.prototype.getAvailableDestinations = function () {
71
+ return new Pantheon_1.Pantheon(this.game, this.player).legalSpacesToInvoke;
72
+ };
73
+ return InvokeEffectRule;
74
+ }(PlaceCardEffectRule));
75
+ exports.InvokeEffectRule = InvokeEffectRule;
@@ -0,0 +1,9 @@
1
+ import { ItemMove, Material, MaterialMove, MoveItem } from '@gamepark/rules-api';
2
+ import { PlayerEffectRule } from './Effect';
3
+ export declare abstract class SacrificeEffectRule extends PlayerEffectRule {
4
+ playEffect(): MaterialMove[];
5
+ getPlayerMoves(): MoveItem<number, number, number>[];
6
+ getCardsToSacrifice(): Material;
7
+ afterItemMove(move: ItemMove): MaterialMove[];
8
+ onSacrifice(_move: MoveItem): MaterialMove<number, number, number, number>[];
9
+ }
@@ -0,0 +1,58 @@
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.SacrificeEffectRule = void 0;
19
+ var rules_api_1 = require("@gamepark/rules-api");
20
+ var Entity_1 = require("../Entity");
21
+ var LocationType_1 = require("../LocationType");
22
+ var MaterialType_1 = require("../MaterialType");
23
+ var Pantheon_1 = require("../Pantheon");
24
+ var Effect_1 = require("./Effect");
25
+ var SacrificeEffectRule = (function (_super) {
26
+ __extends(SacrificeEffectRule, _super);
27
+ function SacrificeEffectRule() {
28
+ return _super !== null && _super.apply(this, arguments) || this;
29
+ }
30
+ SacrificeEffectRule.prototype.playEffect = function () {
31
+ if (!this.getCardsToSacrifice().length)
32
+ return [];
33
+ return _super.prototype.playEffect.call(this);
34
+ };
35
+ SacrificeEffectRule.prototype.getPlayerMoves = function () {
36
+ var cardsToSacrifice = this.getCardsToSacrifice();
37
+ var moves = cardsToSacrifice.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: this.player });
38
+ var indexes = cardsToSacrifice.getIndexes();
39
+ var playerBeetles = new Pantheon_1.Pantheon(this.game, this.player).visibleEntities
40
+ .id(function (id) { return id.front === Entity_1.Entity.Beetle; })
41
+ .index(function (index) { return !indexes.includes(index); });
42
+ return moves.concat(playerBeetles.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: this.player }));
43
+ };
44
+ SacrificeEffectRule.prototype.getCardsToSacrifice = function () {
45
+ return new Pantheon_1.Pantheon(this.game, this.player).visibleEntities;
46
+ };
47
+ SacrificeEffectRule.prototype.afterItemMove = function (move) {
48
+ if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
49
+ return this.onSacrifice(move);
50
+ }
51
+ return [];
52
+ };
53
+ SacrificeEffectRule.prototype.onSacrifice = function (_move) {
54
+ return this.endEffect();
55
+ };
56
+ return SacrificeEffectRule;
57
+ }(Effect_1.PlayerEffectRule));
58
+ exports.SacrificeEffectRule = SacrificeEffectRule;
@@ -0,0 +1,13 @@
1
+ import { CustomMove, ItemMove, Location, Material, MaterialItem, MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
2
+ import { PlayerColor } from '../../PlayerColor';
3
+ import { SimultaneousEffectRule } from './Effect';
4
+ export declare abstract class SimultaneousMoveEffectRule extends SimultaneousEffectRule {
5
+ getActivePlayerLegalMoves(player: PlayerColor): MoveItem<number, number, number>[];
6
+ private getCardsAbleToMove;
7
+ getMovingCards(player: PlayerColor): Material;
8
+ getAvailableDestinations(player: PlayerColor, card: MaterialItem, _cardIndex: number): XYCoordinates[];
9
+ isLegalDestination(_space: XYCoordinates, _cardLocation: Location): boolean;
10
+ afterItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
11
+ onCardMoved(move: MoveItem): MaterialMove[];
12
+ onCustomMove(move: CustomMove): MaterialMove<number, number, number, number>[];
13
+ }