@gamepark/mythologies 0.8.2 → 0.8.4

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 (98) hide show
  1. package/dist/MythologiesRules.d.ts +3 -4
  2. package/dist/MythologiesRules.js +6 -62
  3. package/dist/MythologiesSetup.js +1 -1
  4. package/dist/material/Pantheon.d.ts +1 -1
  5. package/dist/material/Pantheon.js +9 -7
  6. package/dist/material/Trial.js +0 -1
  7. package/dist/material/entity/AutoEffectRule.d.ts +11 -0
  8. package/dist/material/entity/AutoEffectRule.js +49 -0
  9. package/dist/material/entity/Effect.d.ts +3 -31
  10. package/dist/material/entity/Effect.js +1 -170
  11. package/dist/material/entity/MoveEffectRule.d.ts +4 -5
  12. package/dist/material/entity/MoveEffectRule.js +9 -16
  13. package/dist/material/entity/PlaceCardEffectRule.d.ts +1 -1
  14. package/dist/material/entity/PlaceCardEffectRule.js +2 -2
  15. package/dist/material/entity/PlayerEffectRule.d.ts +14 -0
  16. package/dist/material/entity/PlayerEffectRule.js +63 -0
  17. package/dist/material/entity/SacrificeEffectRule.d.ts +1 -1
  18. package/dist/material/entity/SacrificeEffectRule.js +2 -4
  19. package/dist/material/entity/SimultaneousEffectRule.d.ts +18 -0
  20. package/dist/material/entity/SimultaneousEffectRule.js +149 -0
  21. package/dist/material/entity/SimultaneousMoveEffectRule.d.ts +1 -2
  22. package/dist/material/entity/SimultaneousMoveEffectRule.js +3 -11
  23. package/dist/material/entity/SimultaneousSacrificeEffectRule.d.ts +1 -1
  24. package/dist/material/entity/SimultaneousSacrificeEffectRule.js +2 -4
  25. package/dist/material/entity/celtic/Banshee.js +2 -1
  26. package/dist/material/entity/celtic/Brigid.js +2 -1
  27. package/dist/material/entity/celtic/Cernunnos.js +2 -1
  28. package/dist/material/entity/celtic/Dagda.js +2 -1
  29. package/dist/material/entity/celtic/Kelpie.js +2 -1
  30. package/dist/material/entity/chinese/Mogwai.js +2 -1
  31. package/dist/material/entity/chinese/Nian.js +2 -1
  32. package/dist/material/entity/chinese/SunWukong.js +2 -1
  33. package/dist/material/entity/egyptian/Beetle.js +2 -1
  34. package/dist/material/entity/egyptian/Isis.js +2 -1
  35. package/dist/material/entity/egyptian/Mummy.js +2 -1
  36. package/dist/material/entity/egyptian/Osiris.js +2 -1
  37. package/dist/material/entity/greek/Poseidon.js +2 -1
  38. package/dist/material/entity/greek/Zeus.js +2 -1
  39. package/dist/material/entity/hindu/Asura.js +2 -1
  40. package/dist/material/entity/hindu/Brahma.js +2 -1
  41. package/dist/material/entity/hindu/Ganesh.js +3 -2
  42. package/dist/material/entity/hindu/Naga.js +2 -1
  43. package/dist/material/entity/hindu/Vishnu.js +2 -1
  44. package/dist/material/entity/inca/Amaru.js +2 -1
  45. package/dist/material/entity/inca/Inti.js +2 -1
  46. package/dist/material/entity/inca/MamaQucha.js +2 -1
  47. package/dist/material/entity/inca/Puma.js +2 -1
  48. package/dist/material/entity/norse/Freya.js +2 -1
  49. package/dist/material/entity/norse/Jotunn.js +2 -1
  50. package/dist/material/entity/norse/Loki.js +2 -1
  51. package/dist/material/entity/norse/Valkyrie.js +2 -1
  52. package/dist/material/entity/zulu/Inkanyamba.js +2 -1
  53. package/dist/material/entity/zulu/Shembe.js +2 -1
  54. package/dist/material/entity/zulu/Tokoloshe.js +2 -1
  55. package/dist/material/entity/zulu/Umvelinqangi.js +3 -2
  56. package/dist/material/entity/zulu/Unkulunkulu.js +2 -1
  57. package/dist/material/entity/zulu/Unwabu.js +2 -1
  58. package/dist/rules/effects/AthenaEffectRule.d.ts +5 -3
  59. package/dist/rules/effects/AthenaEffectRule.js +55 -20
  60. package/dist/rules/effects/CentaurEffectRule.d.ts +2 -5
  61. package/dist/rules/effects/CentaurEffectRule.js +1 -23
  62. package/dist/rules/effects/CyclopsEffectRule.d.ts +2 -1
  63. package/dist/rules/effects/CyclopsEffectRule.js +2 -1
  64. package/dist/rules/effects/DullahanEffectRule.js +1 -1
  65. package/dist/rules/effects/FenrirEffectRule.d.ts +2 -1
  66. package/dist/rules/effects/FenrirEffectRule.js +4 -3
  67. package/dist/rules/effects/IllapaEffectRule.d.ts +1 -1
  68. package/dist/rules/effects/IllapaEffectRule.js +3 -3
  69. package/dist/rules/effects/JiangshiEffectRule.d.ts +1 -1
  70. package/dist/rules/effects/JiangshiEffectRule.js +2 -6
  71. package/dist/rules/effects/KinnaraEffectRule.d.ts +1 -1
  72. package/dist/rules/effects/KinnaraEffectRule.js +3 -3
  73. package/dist/rules/effects/LeprechaunEffectRule.d.ts +1 -1
  74. package/dist/rules/effects/LeprechaunEffectRule.js +2 -2
  75. package/dist/rules/effects/MinotaurEffectRule.js +0 -1
  76. package/dist/rules/effects/MultipleSimultaneousMoveEffectRule.js +1 -36
  77. package/dist/rules/effects/QilinEffectRule.d.ts +1 -1
  78. package/dist/rules/effects/QilinEffectRule.js +3 -2
  79. package/dist/rules/effects/ResolveEffectsRule.d.ts +6 -3
  80. package/dist/rules/effects/ResolveEffectsRule.js +63 -0
  81. package/dist/rules/effects/SelkieEffectRule.d.ts +1 -1
  82. package/dist/rules/effects/SelkieEffectRule.js +2 -2
  83. package/dist/rules/effects/ShivaEffectRule.d.ts +1 -1
  84. package/dist/rules/effects/ShivaEffectRule.js +2 -6
  85. package/dist/rules/effects/SphinxEffectRule.d.ts +1 -1
  86. package/dist/rules/effects/SphinxEffectRule.js +3 -32
  87. package/dist/rules/effects/SupayEffectRule.d.ts +1 -1
  88. package/dist/rules/effects/SupayEffectRule.js +2 -2
  89. package/dist/rules/effects/TianlongEffectRule.js +1 -9
  90. package/dist/rules/effects/UkukuEffectRule.d.ts +1 -1
  91. package/dist/rules/effects/UkukuEffectRule.js +2 -2
  92. package/dist/rules/effects/VetalaEffectRule.d.ts +2 -2
  93. package/dist/rules/effects/VetalaEffectRule.js +1 -3
  94. package/dist/rules/effects/WerehyenaEffectRule.d.ts +1 -1
  95. package/dist/rules/effects/WerehyenaEffectRule.js +2 -2
  96. package/dist/rules/effects/YanluoWangEffectRule.d.ts +1 -1
  97. package/dist/rules/effects/YanluoWangEffectRule.js +2 -2
  98. package/package.json +2 -2
@@ -31,6 +31,7 @@ var rules_api_1 = require("@gamepark/rules-api");
31
31
  var LocationType_1 = require("../../LocationType");
32
32
  var MaterialType_1 = require("../../MaterialType");
33
33
  var Effect_1 = require("../Effect");
34
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
34
35
  exports.Naga = {
35
36
  invoke: [{}, { gem: 2 }, { gem: 1 }],
36
37
  effects: [
@@ -68,7 +69,7 @@ exports.Naga = {
68
69
  return moves;
69
70
  };
70
71
  return NagaEffectRule;
71
- }(Effect_1.PlayerEffectRule))
72
+ }(PlayerEffectRule_1.PlayerEffectRule))
72
73
  }
73
74
  ]
74
75
  };
@@ -45,6 +45,7 @@ var Destiny_1 = require("../../Destiny");
45
45
  var LocationType_1 = require("../../LocationType");
46
46
  var Pantheon_1 = require("../../Pantheon");
47
47
  var Effect_1 = require("../Effect");
48
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
48
49
  exports.Vishnu = {
49
50
  invoke: [{}, { gem: 1, favor: 1 }, { gem: 1 }],
50
51
  effect: {
@@ -62,6 +63,6 @@ exports.Vishnu = {
62
63
  return __spreadArray(__spreadArray([], __read(godsToExile.deleteItems()), false), [pantheon.gainFavor(godsToExile.length * 2)], false);
63
64
  };
64
65
  return VishnuEffectRule;
65
- }(Effect_1.PlayerEffectRule))
66
+ }(PlayerEffectRule_1.PlayerEffectRule))
66
67
  }
67
68
  };
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Amaru = void 0;
19
19
  var Pantheon_1 = require("../../Pantheon");
20
20
  var Effect_1 = require("../Effect");
21
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
21
22
  exports.Amaru = {
22
23
  invoke: [{ gem: 1 }, {}, { favor: 1 }],
23
24
  effect: {
@@ -32,6 +33,6 @@ exports.Amaru = {
32
33
  return [pantheon.gainGems(pantheon.mythologies.length)];
33
34
  };
34
35
  return AmaruEffectRule;
35
- }(Effect_1.PlayerEffectRule))
36
+ }(PlayerEffectRule_1.PlayerEffectRule))
36
37
  }
37
38
  };
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Inti = void 0;
19
19
  var Pantheon_1 = require("../../Pantheon");
20
20
  var Effect_1 = require("../Effect");
21
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
21
22
  exports.Inti = {
22
23
  invoke: [{ favor: 1 }, {}, {}],
23
24
  effect: {
@@ -33,6 +34,6 @@ exports.Inti = {
33
34
  return gain > 0 ? [pantheon.gainFavor(gain)] : [];
34
35
  };
35
36
  return IntiEffectRule;
36
- }(Effect_1.PlayerEffectRule))
37
+ }(PlayerEffectRule_1.PlayerEffectRule))
37
38
  }
38
39
  };
@@ -19,6 +19,7 @@ exports.MamaQucha = void 0;
19
19
  var Entity_1 = require("../../Entity");
20
20
  var Pantheon_1 = require("../../Pantheon");
21
21
  var Effect_1 = require("../Effect");
22
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
22
23
  exports.MamaQucha = {
23
24
  invoke: [{}, { favor: 1 }, { gem: 2 }],
24
25
  effect: {
@@ -37,6 +38,6 @@ exports.MamaQucha = {
37
38
  return hasCreature ? [] : [pantheon.gainFavor(3)];
38
39
  };
39
40
  return MamaQuchaEffectRule;
40
- }(Effect_1.PlayerEffectRule))
41
+ }(PlayerEffectRule_1.PlayerEffectRule))
41
42
  }
42
43
  };
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Puma = void 0;
19
19
  var Pantheon_1 = require("../../Pantheon");
20
20
  var Effect_1 = require("../Effect");
21
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
21
22
  exports.Puma = {
22
23
  invoke: [{}, { favor: 1 }, {}],
23
24
  effect: {
@@ -34,6 +35,6 @@ exports.Puma = {
34
35
  return [new Pantheon_1.Pantheon(this.game, this.player).gainGems(1)];
35
36
  };
36
37
  return PumaEffectRule;
37
- }(Effect_1.PlayerEffectRule))
38
+ }(PlayerEffectRule_1.PlayerEffectRule))
38
39
  }
39
40
  };
@@ -19,6 +19,7 @@ exports.Freya = void 0;
19
19
  var Entity_1 = require("../../Entity");
20
20
  var Pantheon_1 = require("../../Pantheon");
21
21
  var Effect_1 = require("../Effect");
22
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
22
23
  exports.Freya = {
23
24
  invoke: [{ gem: 2 }, { favor: 1 }, {}],
24
25
  effect: {
@@ -34,6 +35,6 @@ exports.Freya = {
34
35
  return gain > 0 ? [pantheon.gainFavor(gain)] : [];
35
36
  };
36
37
  return FreyaEffectRule;
37
- }(Effect_1.PlayerEffectRule))
38
+ }(PlayerEffectRule_1.PlayerEffectRule))
38
39
  }
39
40
  };
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Jotunn = void 0;
19
19
  var Pantheon_1 = require("../../Pantheon");
20
20
  var Effect_1 = require("../Effect");
21
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
21
22
  exports.Jotunn = {
22
23
  invoke: [{ gem: 1 }, { gem: 1 }, {}],
23
24
  effect: {
@@ -32,6 +33,6 @@ exports.Jotunn = {
32
33
  return new Pantheon_1.Pantheon(this.game, player).hasCrushed(this.card) ? [new Pantheon_1.Pantheon(this.game, this.player).gainGems(2)] : [];
33
34
  };
34
35
  return JotunnEffectRule;
35
- }(Effect_1.PlayerEffectRule))
36
+ }(PlayerEffectRule_1.PlayerEffectRule))
36
37
  }
37
38
  };
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Loki = void 0;
19
19
  var UpkeepRule_1 = require("../../../rules/UpkeepRule");
20
20
  var Effect_1 = require("../Effect");
21
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
21
22
  exports.Loki = {
22
23
  invoke: [{}, { gem: 2 }, { gem: 1, favor: 2 }],
23
24
  effect: {
@@ -31,6 +32,6 @@ exports.Loki = {
31
32
  return new UpkeepRule_1.UpkeepRule(this.game).completeSanctuary(this.player);
32
33
  };
33
34
  return LokiEffectRule;
34
- }(Effect_1.PlayerEffectRule))
35
+ }(PlayerEffectRule_1.PlayerEffectRule))
35
36
  }
36
37
  };
@@ -32,6 +32,7 @@ var LocationType_1 = require("../../LocationType");
32
32
  var MaterialType_1 = require("../../MaterialType");
33
33
  var Pantheon_1 = require("../../Pantheon");
34
34
  var Effect_1 = require("../Effect");
35
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
35
36
  exports.Valkyrie = {
36
37
  invoke: [{ gem: 1 }, { gem: 2 }, {}],
37
38
  effect: {
@@ -67,6 +68,6 @@ exports.Valkyrie = {
67
68
  return moves;
68
69
  };
69
70
  return ValkyrieEffectRule;
70
- }(Effect_1.PlayerEffectRule))
71
+ }(PlayerEffectRule_1.PlayerEffectRule))
71
72
  }
72
73
  };
@@ -17,6 +17,7 @@ var __extends = (this && this.__extends) || (function () {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Inkanyamba = void 0;
19
19
  var Pantheon_1 = require("../../Pantheon");
20
+ var AutoEffectRule_1 = require("../AutoEffectRule");
20
21
  var Effect_1 = require("../Effect");
21
22
  exports.Inkanyamba = {
22
23
  invoke: [{}, { favor: 1 }, { gem: 1 }],
@@ -35,7 +36,7 @@ exports.Inkanyamba = {
35
36
  return [new Pantheon_1.Pantheon(this.game, player).gainGems(1)];
36
37
  };
37
38
  return InkanyambaEffectRule;
38
- }(Effect_1.AutoEffectRule)),
39
+ }(AutoEffectRule_1.AutoEffectRule)),
39
40
  auto: true
40
41
  }
41
42
  };
@@ -20,6 +20,7 @@ var Entity_1 = require("../../Entity");
20
20
  var Mythology_1 = require("../../Mythology");
21
21
  var Pantheon_1 = require("../../Pantheon");
22
22
  var Effect_1 = require("../Effect");
23
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
23
24
  exports.Shembe = {
24
25
  invoke: [{ gem: 1 }, { gem: 2 }, {}],
25
26
  effect: {
@@ -38,6 +39,6 @@ exports.Shembe = {
38
39
  return mythologies.length > 0 ? [pantheon.gainFavor(mythologies.length * 2)] : [];
39
40
  };
40
41
  return ShembeEffectRule;
41
- }(Effect_1.PlayerEffectRule))
42
+ }(PlayerEffectRule_1.PlayerEffectRule))
42
43
  }
43
44
  };
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Tokoloshe = void 0;
19
19
  var Entity_1 = require("../../Entity");
20
20
  var Pantheon_1 = require("../../Pantheon");
21
+ var AutoEffectRule_1 = require("../AutoEffectRule");
21
22
  var Effect_1 = require("../Effect");
22
23
  exports.Tokoloshe = {
23
24
  invoke: [{}, { gem: 3 }, { favor: 2 }],
@@ -37,7 +38,7 @@ exports.Tokoloshe = {
37
38
  return loss ? [pantheon.loseFavor(loss)] : [];
38
39
  };
39
40
  return TokolosheEffectRule;
40
- }(Effect_1.AutoEffectRule))
41
+ }(AutoEffectRule_1.AutoEffectRule))
41
42
  },
42
43
  {
43
44
  preventCrush: function (card) { return card.id.front === Entity_1.Entity.Tokoloshe; }
@@ -21,6 +21,7 @@ var Entity_1 = require("../../Entity");
21
21
  var Mythology_1 = require("../../Mythology");
22
22
  var Pantheon_1 = require("../../Pantheon");
23
23
  var Effect_1 = require("../Effect");
24
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
24
25
  exports.Umvelinqangi = {
25
26
  invoke: [{ gem: 1, favor: 1 }, { gem: 1 }, {}],
26
27
  effect: {
@@ -35,10 +36,10 @@ exports.Umvelinqangi = {
35
36
  var _a = this.card.location, x = _a.x, y = _a.y;
36
37
  var covered = pantheon.coveredEntities.location(function (l) { return l.x === x && l.y === y; }).getItems();
37
38
  var mythologies = (0, lodash_1.uniq)(covered.map(function (card) { return (0, Entity_1.entityMythology)(card.id.front); })).filter(function (mythology) { return mythology !== Mythology_1.Mythology.Zulu; });
38
- var gain = mythologies.length === 3 ? 5 : mythologies.length;
39
+ var gain = mythologies.length === 3 ? 4 : mythologies.length;
39
40
  return gain > 0 ? [pantheon.gainFavor(gain)] : [];
40
41
  };
41
42
  return UmvelinqangiEffectRule;
42
- }(Effect_1.PlayerEffectRule))
43
+ }(PlayerEffectRule_1.PlayerEffectRule))
43
44
  }
44
45
  };
@@ -20,6 +20,7 @@ var lodash_1 = require("lodash");
20
20
  var Pantheon_1 = require("../../Pantheon");
21
21
  var Effect_1 = require("../Effect");
22
22
  var EntityDescription_1 = require("../EntityDescription");
23
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
23
24
  exports.Unkulunkulu = {
24
25
  invoke: [{ favor: 1 }, { favor: 2 }, {}],
25
26
  effect: {
@@ -37,6 +38,6 @@ exports.Unkulunkulu = {
37
38
  return gain > 0 ? [pantheon.gainFavor(gain)] : [];
38
39
  };
39
40
  return UnkulunkuluEffectRule;
40
- }(Effect_1.PlayerEffectRule))
41
+ }(PlayerEffectRule_1.PlayerEffectRule))
41
42
  }
42
43
  };
@@ -20,6 +20,7 @@ var Entity_1 = require("../../Entity");
20
20
  var MaterialType_1 = require("../../MaterialType");
21
21
  var Pantheon_1 = require("../../Pantheon");
22
22
  var Effect_1 = require("../Effect");
23
+ var PlayerEffectRule_1 = require("../PlayerEffectRule");
23
24
  exports.Unwabu = {
24
25
  invoke: [{ gem: 2 }, { favor: 1 }, {}],
25
26
  effect: {
@@ -43,6 +44,6 @@ exports.Unwabu = {
43
44
  return [pantheon.gainGems(this.getGain())];
44
45
  };
45
46
  return UnwabuEffectRule;
46
- }(Effect_1.PlayerEffectRule))
47
+ }(PlayerEffectRule_1.PlayerEffectRule))
47
48
  }
48
49
  };
@@ -1,9 +1,11 @@
1
- import { CustomMove, Material, MaterialMove } from '@gamepark/rules-api';
2
- import { PlayerEffectRule } from '../../material/entity/Effect';
1
+ import { Material, MaterialMove } from '@gamepark/rules-api';
2
+ import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
3
3
  import { RuleId } from '../RuleId';
4
4
  export declare class AthenaEffectRule extends PlayerEffectRule {
5
5
  ruleId: RuleId;
6
+ onRuleStart(): MaterialMove<number, number, number, number>[];
6
7
  getPlayerMoves(): MaterialMove[];
7
8
  getPiles(): Material<number, number, number>[];
8
- onCustomMove(move: CustomMove): MaterialMove<number, number, number, number>[];
9
+ onEndEffect(): MaterialMove<number, number, number, number>[];
10
+ onRuleEnd(): never[];
9
11
  }
@@ -53,10 +53,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
54
  exports.AthenaEffectRule = void 0;
55
55
  var CustomMoveType_1 = require("../../CustomMoveType");
56
- var Effect_1 = require("../../material/entity/Effect");
56
+ var PlayerEffectRule_1 = require("../../material/entity/PlayerEffectRule");
57
57
  var LocationType_1 = require("../../material/LocationType");
58
58
  var MaterialType_1 = require("../../material/MaterialType");
59
59
  var Pantheon_1 = require("../../material/Pantheon");
60
+ var Memory_1 = require("../../Memory");
60
61
  var RuleId_1 = require("../RuleId");
61
62
  var TriggerEffectsRule_1 = require("./TriggerEffectsRule");
62
63
  var AthenaEffectRule = (function (_super) {
@@ -66,41 +67,74 @@ var AthenaEffectRule = (function (_super) {
66
67
  _this.ruleId = RuleId_1.RuleId.AthenaEffect;
67
68
  return _this;
68
69
  }
70
+ AthenaEffectRule.prototype.onRuleStart = function () {
71
+ var e_1, _a;
72
+ var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
73
+ var lockedLocations = [];
74
+ try {
75
+ for (var _b = __values(pantheon.visibleEntities.getItems()), _c = _b.next(); !_c.done; _c = _b.next()) {
76
+ var card = _c.value;
77
+ if (!pantheon.isAbleToMove(card)) {
78
+ lockedLocations.push({ x: card.location.x, y: card.location.y });
79
+ }
80
+ }
81
+ }
82
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
83
+ finally {
84
+ try {
85
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
86
+ }
87
+ finally { if (e_1) throw e_1.error; }
88
+ }
89
+ this.memorize(Memory_1.Memory.TargetLocations, lockedLocations);
90
+ return _super.prototype.onRuleStart.call(this);
91
+ };
69
92
  AthenaEffectRule.prototype.getPlayerMoves = function () {
70
- var e_1, _a, e_2, _b;
93
+ var e_2, _a;
71
94
  var moves = [];
72
95
  var legalSpaces = new Pantheon_1.Pantheon(this.game, this.player).legalSpaces;
73
96
  var piles = this.getPiles();
74
- try {
75
- for (var piles_1 = __values(piles), piles_1_1 = piles_1.next(); !piles_1_1.done; piles_1_1 = piles_1.next()) {
76
- var pile = piles_1_1.value;
77
- var location = pile.getItem().location;
97
+ var lockedLocations = this.remind(Memory_1.Memory.TargetLocations);
98
+ var _loop_1 = function (pile) {
99
+ var e_3, _b;
100
+ var location = pile.getItem().location;
101
+ if (!lockedLocations.some(function (_a) {
102
+ var x = _a.x, y = _a.y;
103
+ return x === location.x && y === location.y;
104
+ })) {
78
105
  try {
79
- for (var legalSpaces_1 = (e_2 = void 0, __values(legalSpaces)), legalSpaces_1_1 = legalSpaces_1.next(); !legalSpaces_1_1.done; legalSpaces_1_1 = legalSpaces_1.next()) {
106
+ for (var legalSpaces_1 = (e_3 = void 0, __values(legalSpaces)), legalSpaces_1_1 = legalSpaces_1.next(); !legalSpaces_1_1.done; legalSpaces_1_1 = legalSpaces_1.next()) {
80
107
  var _c = legalSpaces_1_1.value, x = _c.x, y = _c.y;
81
108
  if (x !== location.x || y !== location.y) {
82
- moves.push(pile.moveItemsAtOnce({ type: LocationType_1.LocationType.Pantheon, player: this.player, x: x, y: y }));
109
+ moves.push(pile.moveItemsAtOnce({ type: LocationType_1.LocationType.Pantheon, player: this_1.player, x: x, y: y }));
83
110
  }
84
111
  }
85
112
  }
86
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
113
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
87
114
  finally {
88
115
  try {
89
116
  if (legalSpaces_1_1 && !legalSpaces_1_1.done && (_b = legalSpaces_1.return)) _b.call(legalSpaces_1);
90
117
  }
91
- finally { if (e_2) throw e_2.error; }
118
+ finally { if (e_3) throw e_3.error; }
92
119
  }
93
120
  if (location.type !== LocationType_1.LocationType.PlayerBufferArea) {
94
- moves.push(pile.moveItemsAtOnce({ type: LocationType_1.LocationType.PlayerBufferArea, player: this.player }));
121
+ moves.push(pile.moveItemsAtOnce({ type: LocationType_1.LocationType.PlayerBufferArea, player: this_1.player }));
95
122
  }
96
123
  }
124
+ };
125
+ var this_1 = this;
126
+ try {
127
+ for (var piles_1 = __values(piles), piles_1_1 = piles_1.next(); !piles_1_1.done; piles_1_1 = piles_1.next()) {
128
+ var pile = piles_1_1.value;
129
+ _loop_1(pile);
130
+ }
97
131
  }
98
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
132
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
99
133
  finally {
100
134
  try {
101
135
  if (piles_1_1 && !piles_1_1.done && (_a = piles_1.return)) _a.call(piles_1);
102
136
  }
103
- finally { if (e_1) throw e_1.error; }
137
+ finally { if (e_2) throw e_2.error; }
104
138
  }
105
139
  if (!piles.some(function (pile) { var _a; return ((_a = pile.getItem()) === null || _a === void 0 ? void 0 : _a.location.type) === LocationType_1.LocationType.PlayerBufferArea; })) {
106
140
  moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
@@ -118,15 +152,16 @@ var AthenaEffectRule = (function (_super) {
118
152
  }
119
153
  return piles;
120
154
  };
121
- AthenaEffectRule.prototype.onCustomMove = function (move) {
155
+ AthenaEffectRule.prototype.onEndEffect = function () {
122
156
  var _a;
123
- if (move.type === CustomMoveType_1.CustomMoveType.EndEffect) {
124
- var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
125
- (_a = new TriggerEffectsRule_1.TriggerEffectsRule(this.game)).triggerEffects.apply(_a, __spreadArray([], __read(pantheon.updateGrid()), false));
126
- return pantheon.gainBonus();
127
- }
157
+ var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
158
+ (_a = new TriggerEffectsRule_1.TriggerEffectsRule(this.game)).triggerEffects.apply(_a, __spreadArray([], __read(pantheon.updateGrid()), false));
159
+ return pantheon.gainBonus().concat(_super.prototype.onEndEffect.call(this));
160
+ };
161
+ AthenaEffectRule.prototype.onRuleEnd = function () {
162
+ this.forget(Memory_1.Memory.TargetLocations);
128
163
  return [];
129
164
  };
130
165
  return AthenaEffectRule;
131
- }(Effect_1.PlayerEffectRule));
166
+ }(PlayerEffectRule_1.PlayerEffectRule));
132
167
  exports.AthenaEffectRule = AthenaEffectRule;
@@ -1,4 +1,4 @@
1
- import { ItemMove, Location, Material, MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
1
+ import { Location, Material, MaterialMove, XYCoordinates } from '@gamepark/rules-api';
2
2
  import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
3
3
  import { SimultaneousSacrificeEffectRule } from '../../material/entity/SimultaneousSacrificeEffectRule';
4
4
  import { PlayerColor } from '../../PlayerColor';
@@ -7,10 +7,7 @@ export declare class CentaurEffectRule extends MoveEffectRule {
7
7
  ruleId: RuleId;
8
8
  getMovingCards(effectCardIndex?: number): Material;
9
9
  isLegalDestination(space: XYCoordinates, cardLocation: Location): boolean;
10
- onCardMoved(): never[];
11
- onCardSacrificed(move: MoveItem): MaterialMove<number, number, number, number>[];
12
- afterItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
13
- startSacrificeEffect(): MaterialMove<number, number, number, number>[];
10
+ onEndEffect(): MaterialMove<number, number, number, number>[];
14
11
  }
15
12
  export declare class CentaurEffectSacrificeRule extends SimultaneousSacrificeEffectRule {
16
13
  ruleId: RuleId;
@@ -42,11 +42,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.CentaurEffectSacrificeRule = exports.CentaurEffectRule = void 0;
44
44
  var rules_api_1 = require("@gamepark/rules-api");
45
- var CustomMoveType_1 = require("../../CustomMoveType");
46
45
  var Entity_1 = require("../../material/Entity");
47
46
  var MoveEffectRule_1 = require("../../material/entity/MoveEffectRule");
48
47
  var SimultaneousSacrificeEffectRule_1 = require("../../material/entity/SimultaneousSacrificeEffectRule");
49
- var LocationType_1 = require("../../material/LocationType");
50
48
  var MaterialType_1 = require("../../material/MaterialType");
51
49
  var Pantheon_1 = require("../../material/Pantheon");
52
50
  var Memory_1 = require("../../Memory");
@@ -66,32 +64,12 @@ var CentaurEffectRule = (function (_super) {
66
64
  CentaurEffectRule.prototype.isLegalDestination = function (space, cardLocation) {
67
65
  return (0, rules_api_1.areAdjacentSquares)(space, cardLocation);
68
66
  };
69
- CentaurEffectRule.prototype.onCardMoved = function () {
70
- return [];
71
- };
72
- CentaurEffectRule.prototype.onCardSacrificed = function (move) {
73
- _super.prototype.onCardSacrificed.call(this, move);
74
- if (!this.remind(Memory_1.Memory.EntityMoved, this.player)) {
75
- this.memorize(Memory_1.Memory.EntityMoved, true, this.player);
76
- return this.startSacrificeEffect();
77
- }
78
- return [];
79
- };
80
- CentaurEffectRule.prototype.afterItemMove = function (move) {
81
- if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.Pantheon) {
82
- return this.startSacrificeEffect();
83
- }
84
- return [];
85
- };
86
- CentaurEffectRule.prototype.startSacrificeEffect = function () {
67
+ CentaurEffectRule.prototype.onEndEffect = function () {
87
68
  var _a;
88
69
  var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
89
70
  (_a = new TriggerEffectsRule_1.TriggerEffectsRule(this.game)).triggerEffects.apply(_a, __spreadArray([], __read(pantheon.updateGrid()), false));
90
71
  var moves = pantheon.gainBonus();
91
72
  moves.push.apply(moves, __spreadArray([], __read(new CentaurEffectSacrificeRule(this.game).playEffect()), false));
92
- if (!moves.some(rules_api_1.isStartSimultaneousRule)) {
93
- moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
94
- }
95
73
  return moves;
96
74
  };
97
75
  return CentaurEffectRule;
@@ -1,5 +1,6 @@
1
1
  import { ItemMove, MaterialMove } from '@gamepark/rules-api';
2
- import { ColumnEvent, LineEvent, PlayerEffectRule } from '../../material/entity/Effect';
2
+ import { ColumnEvent, LineEvent } from '../../material/entity/Effect';
3
+ import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
3
4
  import { RuleId } from '../RuleId';
4
5
  export declare class CyclopsEffectRule extends PlayerEffectRule {
5
6
  ruleId: RuleId;
@@ -44,6 +44,7 @@ exports.CyclopsEffectRule = void 0;
44
44
  var rules_api_1 = require("@gamepark/rules-api");
45
45
  var CustomMoveType_1 = require("../../CustomMoveType");
46
46
  var Effect_1 = require("../../material/entity/Effect");
47
+ var PlayerEffectRule_1 = require("../../material/entity/PlayerEffectRule");
47
48
  var LocationType_1 = require("../../material/LocationType");
48
49
  var MaterialType_1 = require("../../material/MaterialType");
49
50
  var Pantheon_1 = require("../../material/Pantheon");
@@ -101,5 +102,5 @@ var CyclopsEffectRule = (function (_super) {
101
102
  }
102
103
  };
103
104
  return CyclopsEffectRule;
104
- }(Effect_1.PlayerEffectRule));
105
+ }(PlayerEffectRule_1.PlayerEffectRule));
105
106
  exports.CyclopsEffectRule = CyclopsEffectRule;
@@ -66,7 +66,7 @@ var DullahanEffectRule = (function (_super) {
66
66
  DullahanEffectRule.prototype.onRuleEnd = function () {
67
67
  this.forget(Memory_1.Memory.TargetEntities);
68
68
  this.forget(Memory_1.Memory.EffectCount);
69
- return _super.prototype.onRuleEnd.call(this);
69
+ return [];
70
70
  };
71
71
  return DullahanEffectRule;
72
72
  }(MoveEffectRule_1.MoveEffectRule));
@@ -1,5 +1,6 @@
1
1
  import { ItemMove, MaterialMove } from '@gamepark/rules-api';
2
- import { PlayerEffectRule, SimultaneousEffectRule } from '../../material/entity/Effect';
2
+ import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
3
+ import { SimultaneousEffectRule } from '../../material/entity/SimultaneousEffectRule';
3
4
  import { PlayerColor } from '../../PlayerColor';
4
5
  import { RuleId } from '../RuleId';
5
6
  export declare class FenrirChoiceRule extends PlayerEffectRule {
@@ -29,7 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.FenrirEffectRule = exports.FenrirChoiceRule = void 0;
30
30
  var rules_api_1 = require("@gamepark/rules-api");
31
31
  var CustomMoveType_1 = require("../../CustomMoveType");
32
- var Effect_1 = require("../../material/entity/Effect");
32
+ var PlayerEffectRule_1 = require("../../material/entity/PlayerEffectRule");
33
+ var SimultaneousEffectRule_1 = require("../../material/entity/SimultaneousEffectRule");
33
34
  var MaterialType_1 = require("../../material/MaterialType");
34
35
  var Pantheon_1 = require("../../material/Pantheon");
35
36
  var Memory_1 = require("../../Memory");
@@ -99,7 +100,7 @@ var FenrirChoiceRule = (function (_super) {
99
100
  return [];
100
101
  };
101
102
  return FenrirChoiceRule;
102
- }(Effect_1.PlayerEffectRule));
103
+ }(PlayerEffectRule_1.PlayerEffectRule));
103
104
  exports.FenrirChoiceRule = FenrirChoiceRule;
104
105
  var FenrirEffectRule = (function (_super) {
105
106
  __extends(FenrirEffectRule, _super);
@@ -134,5 +135,5 @@ var FenrirEffectRule = (function (_super) {
134
135
  return [];
135
136
  };
136
137
  return FenrirEffectRule;
137
- }(Effect_1.SimultaneousEffectRule));
138
+ }(SimultaneousEffectRule_1.SimultaneousEffectRule));
138
139
  exports.FenrirEffectRule = FenrirEffectRule;
@@ -1,5 +1,5 @@
1
1
  import { CustomMove, Material } from '@gamepark/rules-api';
2
- import { PlayerEffectRule } from '../../material/entity/Effect';
2
+ import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
3
3
  import { SimultaneousSacrificeEffectRule } from '../../material/entity/SimultaneousSacrificeEffectRule';
4
4
  import { PlayerColor } from '../../PlayerColor';
5
5
  import { RuleId } from '../RuleId';
@@ -20,7 +20,7 @@ var rules_api_1 = require("@gamepark/rules-api");
20
20
  var lodash_1 = require("lodash");
21
21
  var CustomMoveType_1 = require("../../CustomMoveType");
22
22
  var Entity_1 = require("../../material/Entity");
23
- var Effect_1 = require("../../material/entity/Effect");
23
+ var PlayerEffectRule_1 = require("../../material/entity/PlayerEffectRule");
24
24
  var SimultaneousSacrificeEffectRule_1 = require("../../material/entity/SimultaneousSacrificeEffectRule");
25
25
  var Memory_1 = require("../../Memory");
26
26
  var RuleId_1 = require("../RuleId");
@@ -45,10 +45,10 @@ var IllapaEffectRule = (function (_super) {
45
45
  }
46
46
  return moves;
47
47
  }
48
- return [];
48
+ return _super.prototype.onCustomMove.call(this, move);
49
49
  };
50
50
  return IllapaEffectRule;
51
- }(Effect_1.PlayerEffectRule));
51
+ }(PlayerEffectRule_1.PlayerEffectRule));
52
52
  exports.IllapaEffectRule = IllapaEffectRule;
53
53
  var IllapaSacrificeRule = (function (_super) {
54
54
  __extends(IllapaSacrificeRule, _super);
@@ -1,5 +1,5 @@
1
1
  import { ItemMove, MaterialMove } from '@gamepark/rules-api';
2
- import { PlayerEffectRule } from '../../material/entity/Effect';
2
+ import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
3
3
  import { RuleId } from '../RuleId';
4
4
  export declare class JiangshiEffectRule extends PlayerEffectRule {
5
5
  ruleId: RuleId;
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.JiangshiEffectRule = void 0;
19
19
  var rules_api_1 = require("@gamepark/rules-api");
20
20
  var CustomMoveType_1 = require("../../CustomMoveType");
21
- var Effect_1 = require("../../material/entity/Effect");
21
+ var PlayerEffectRule_1 = require("../../material/entity/PlayerEffectRule");
22
22
  var LocationType_1 = require("../../material/LocationType");
23
23
  var MaterialType_1 = require("../../material/MaterialType");
24
24
  var Pantheon_1 = require("../../material/Pantheon");
@@ -42,14 +42,10 @@ var JiangshiEffectRule = (function (_super) {
42
42
  JiangshiEffectRule.prototype.beforeItemMove = function (move) {
43
43
  if ((0, rules_api_1.isMoveItemTypeAtOnce)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
44
44
  var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
45
- var topCard = this.material(MaterialType_1.MaterialType.EntityCard)
46
- .index(move.indexes)
47
- .maxBy(function (item) { return item.location.z; });
48
- pantheon.onEntitySacrificed(topCard);
49
45
  return [pantheon.gainGems(2), this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
50
46
  }
51
47
  return [];
52
48
  };
53
49
  return JiangshiEffectRule;
54
- }(Effect_1.PlayerEffectRule));
50
+ }(PlayerEffectRule_1.PlayerEffectRule));
55
51
  exports.JiangshiEffectRule = JiangshiEffectRule;
@@ -1,6 +1,6 @@
1
1
  import { ItemMove, MaterialMove } from '@gamepark/rules-api';
2
- import { PlayerEffectRule } from '../../material/entity/Effect';
3
2
  import { PlaceCardEffectRule } from '../../material/entity/PlaceCardEffectRule';
3
+ import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
4
4
  import { RuleId } from '../RuleId';
5
5
  export declare class KinnaraEffectRule extends PlayerEffectRule {
6
6
  ruleId: RuleId;