@gamepark/mythologies 0.3.1 → 0.4.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 (37) hide show
  1. package/dist/Memory.d.ts +2 -1
  2. package/dist/Memory.js +1 -0
  3. package/dist/MythologiesRules.d.ts +9 -0
  4. package/dist/MythologiesRules.js +9 -0
  5. package/dist/material/Destiny.d.ts +1 -0
  6. package/dist/material/Destiny.js +10 -6
  7. package/dist/material/Mythology.js +1 -1
  8. package/dist/material/Pantheon.d.ts +1 -1
  9. package/dist/material/Pantheon.js +10 -10
  10. package/dist/material/entity/Effect.d.ts +11 -4
  11. package/dist/material/entity/Effect.js +5 -2
  12. package/dist/material/entity/chinese/SunWukong.js +1 -1
  13. package/dist/material/entity/hindu/Vishnu.js +2 -6
  14. package/dist/material/entity/zulu/Idlozi.js +7 -1
  15. package/dist/material/entity/zulu/Impundulu.js +7 -1
  16. package/dist/material/entity/zulu/Inkanyamba.js +33 -1
  17. package/dist/material/entity/zulu/Inkosazana.js +7 -1
  18. package/dist/material/entity/zulu/Shembe.js +38 -1
  19. package/dist/material/entity/zulu/Tokoloshe.js +36 -1
  20. package/dist/material/entity/zulu/Umvelinqangi.js +39 -1
  21. package/dist/material/entity/zulu/Unkulunkulu.js +37 -1
  22. package/dist/material/entity/zulu/Unwabu.js +43 -1
  23. package/dist/material/entity/zulu/Werehyena.js +7 -1
  24. package/dist/rules/DrawDestinyCardRule.js +3 -4
  25. package/dist/rules/PlaceCardsRule.js +1 -0
  26. package/dist/rules/RuleId.d.ts +6 -1
  27. package/dist/rules/RuleId.js +5 -0
  28. package/dist/rules/effects/IdloziEffectRule.d.ts +9 -0
  29. package/dist/rules/effects/IdloziEffectRule.js +43 -0
  30. package/dist/rules/effects/ImpunduluEffectRule.d.ts +7 -0
  31. package/dist/rules/effects/ImpunduluEffectRule.js +47 -0
  32. package/dist/rules/effects/InkosazanaEffectRule.d.ts +7 -0
  33. package/dist/rules/effects/InkosazanaEffectRule.js +46 -0
  34. package/dist/rules/effects/QilinEffectRule.js +1 -1
  35. package/dist/rules/effects/WerehyenaEffectRule.d.ts +11 -0
  36. package/dist/rules/effects/WerehyenaEffectRule.js +54 -0
  37. package/package.json +2 -2
package/dist/Memory.d.ts CHANGED
@@ -13,5 +13,6 @@ export declare enum Memory {
13
13
  IllapaLine = 15,
14
14
  YanluoWangCount = 16,
15
15
  NuwaPlayerCreatures = 17,
16
- TianlongVector = 18
16
+ TianlongVector = 18,
17
+ InkosazanaInvoke1 = 19
17
18
  }
package/dist/Memory.js CHANGED
@@ -18,4 +18,5 @@ var Memory;
18
18
  Memory[Memory["YanluoWangCount"] = 16] = "YanluoWangCount";
19
19
  Memory[Memory["NuwaPlayerCreatures"] = 17] = "NuwaPlayerCreatures";
20
20
  Memory[Memory["TianlongVector"] = 18] = "TianlongVector";
21
+ Memory[Memory["InkosazanaInvoke1"] = 19] = "InkosazanaInvoke1";
21
22
  })(Memory = exports.Memory || (exports.Memory = {}));
@@ -22,7 +22,10 @@ import { GarudaEffectRule } from './rules/effects/GarudaEffectRule';
22
22
  import { GorgonEffectRule } from './rules/effects/GorgonEffectRule';
23
23
  import { GriffinEffectRule } from './rules/effects/GriffinEffectRule';
24
24
  import { HadesEffectRule } from './rules/effects/HadesEffectRule';
25
+ import { IdloziEffectRule } from './rules/effects/IdloziEffectRule';
25
26
  import { IllapaEffectRule, IllapaSacrificeRule } from './rules/effects/IllapaEffectRule';
27
+ import { ImpunduluEffectRule } from './rules/effects/ImpunduluEffectRule';
28
+ import { InkosazanaEffectRule } from './rules/effects/InkosazanaEffectRule';
26
29
  import { JiangshiEffectRule } from './rules/effects/JiangshiEffectRule';
27
30
  import { KinnaraEffectRule, KinnaraPlaceEffectRule } from './rules/effects/KinnaraEffectRule';
28
31
  import { MinotaurEffectRule } from './rules/effects/MinotaurEffectRule';
@@ -39,6 +42,7 @@ import { TianlongEffectRule, TianlongOpponentsEffectRule } from './rules/effects
39
42
  import { UkukuEffectRule, UkukuPlaceEffectRule } from './rules/effects/UkukuEffectRule';
40
43
  import { VetalaEffectRule } from './rules/effects/VetalaEffectRule';
41
44
  import { ViracochaEffectRule } from './rules/effects/ViracochaEffectRule';
45
+ import { WerehyenaCallEffectRule, WerehyenaEffectRule } from './rules/effects/WerehyenaEffectRule';
42
46
  import { YanluoWangEffectRule } from './rules/effects/YanluoWangEffectRule';
43
47
  import { EndGameRule } from './rules/EndGameRule';
44
48
  import { PlaceCardsRule } from './rules/PlaceCardsRule';
@@ -95,6 +99,11 @@ export declare class MythologiesRules extends SecretMaterialRules<PlayerColor, M
95
99
  50: typeof QilinEffectRule;
96
100
  51: typeof FenghuangEffectRule;
97
101
  52: typeof JiangshiEffectRule;
102
+ 53: typeof InkosazanaEffectRule;
103
+ 54: typeof ImpunduluEffectRule;
104
+ 55: typeof WerehyenaEffectRule;
105
+ 56: typeof WerehyenaCallEffectRule;
106
+ 57: typeof IdloziEffectRule;
98
107
  };
99
108
  locationsStrategies: {
100
109
  2: {
@@ -45,7 +45,10 @@ var GarudaEffectRule_1 = require("./rules/effects/GarudaEffectRule");
45
45
  var GorgonEffectRule_1 = require("./rules/effects/GorgonEffectRule");
46
46
  var GriffinEffectRule_1 = require("./rules/effects/GriffinEffectRule");
47
47
  var HadesEffectRule_1 = require("./rules/effects/HadesEffectRule");
48
+ var IdloziEffectRule_1 = require("./rules/effects/IdloziEffectRule");
48
49
  var IllapaEffectRule_1 = require("./rules/effects/IllapaEffectRule");
50
+ var ImpunduluEffectRule_1 = require("./rules/effects/ImpunduluEffectRule");
51
+ var InkosazanaEffectRule_1 = require("./rules/effects/InkosazanaEffectRule");
49
52
  var JiangshiEffectRule_1 = require("./rules/effects/JiangshiEffectRule");
50
53
  var KinnaraEffectRule_1 = require("./rules/effects/KinnaraEffectRule");
51
54
  var MinotaurEffectRule_1 = require("./rules/effects/MinotaurEffectRule");
@@ -63,6 +66,7 @@ var TriggerEffectsRule_1 = require("./rules/effects/TriggerEffectsRule");
63
66
  var UkukuEffectRule_1 = require("./rules/effects/UkukuEffectRule");
64
67
  var VetalaEffectRule_1 = require("./rules/effects/VetalaEffectRule");
65
68
  var ViracochaEffectRule_1 = require("./rules/effects/ViracochaEffectRule");
69
+ var WerehyenaEffectRule_1 = require("./rules/effects/WerehyenaEffectRule");
66
70
  var YanluoWangEffectRule_1 = require("./rules/effects/YanluoWangEffectRule");
67
71
  var EndGameRule_1 = require("./rules/EndGameRule");
68
72
  var PlaceCardsRule_1 = require("./rules/PlaceCardsRule");
@@ -124,6 +128,11 @@ var MythologiesRules = (function (_super) {
124
128
  _a[RuleId_1.RuleId.QilinEffect] = QilinEffectRule_1.QilinEffectRule,
125
129
  _a[RuleId_1.RuleId.FenghuangEffect] = FenghuangEffectRule_1.FenghuangEffectRule,
126
130
  _a[RuleId_1.RuleId.JiangshiEffect] = JiangshiEffectRule_1.JiangshiEffectRule,
131
+ _a[RuleId_1.RuleId.InkosazanaEffect] = InkosazanaEffectRule_1.InkosazanaEffectRule,
132
+ _a[RuleId_1.RuleId.ImpunduluEffect] = ImpunduluEffectRule_1.ImpunduluEffectRule,
133
+ _a[RuleId_1.RuleId.WerehyenaEffect] = WerehyenaEffectRule_1.WerehyenaEffectRule,
134
+ _a[RuleId_1.RuleId.WerehyenaCallEffect] = WerehyenaEffectRule_1.WerehyenaCallEffectRule,
135
+ _a[RuleId_1.RuleId.IdloziEffect] = IdloziEffectRule_1.IdloziEffectRule,
127
136
  _a);
128
137
  _this.locationsStrategies = (_b = {},
129
138
  _b[MaterialType_1.MaterialType.EntityCard] = (_c = {},
@@ -4,6 +4,7 @@ export declare class Destiny extends MaterialRulesPart {
4
4
  getMythologyBoard(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
5
5
  getMythology(player: PlayerColor): import("./Mythology").Mythology;
6
6
  getDestinyMap(destiny: number): PlayerColor[][];
7
+ get cardsWithoutToken(): import("@gamepark/rules-api").Material<number, number, number>;
7
8
  getAvailableEntities(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
8
9
  getBoardsWithoutPlayer(): import("@gamepark/rules-api").Material<number, number, number>;
9
10
  get creaturesOnTopOfDecks(): import("@gamepark/rules-api").Material<number, number, number>;
@@ -64,14 +64,18 @@ var Destiny = (function (_super) {
64
64
  throw new Error("Unknown destiny card: ".concat(destiny));
65
65
  }
66
66
  };
67
+ Object.defineProperty(Destiny.prototype, "cardsWithoutToken", {
68
+ get: function () {
69
+ var tokensOnCards = this.material(MaterialType_1.MaterialType.DraftToken).location(LocationType_1.LocationType.OnEntityCard).getItems();
70
+ var cardsWithToken = tokensOnCards.map(function (item) { return item.location.parent; });
71
+ return this.material(MaterialType_1.MaterialType.EntityCard).index(function (index) { return !cardsWithToken.includes(index); });
72
+ },
73
+ enumerable: false,
74
+ configurable: true
75
+ });
67
76
  Destiny.prototype.getAvailableEntities = function (player) {
68
- var tokensOnCards = this.material(MaterialType_1.MaterialType.DraftToken).location(LocationType_1.LocationType.OnEntityCard).getItems();
69
- var cardsWithToken = tokensOnCards.map(function (item) { return item.location.parent; });
70
77
  var mythology = this.getMythologyBoard(player).getIndex();
71
- return this.material(MaterialType_1.MaterialType.EntityCard)
72
- .location(function (l) { return l.type === LocationType_1.LocationType.SanctuaryGodSpot || l.type === LocationType_1.LocationType.SanctuaryCreatureSpot; })
73
- .parent(mythology)
74
- .index(function (index) { return !cardsWithToken.includes(index); });
78
+ return this.cardsWithoutToken.location(function (l) { return l.type === LocationType_1.LocationType.SanctuaryGodSpot || l.type === LocationType_1.LocationType.SanctuaryCreatureSpot; }).parent(mythology);
75
79
  };
76
80
  Destiny.prototype.getBoardsWithoutPlayer = function () {
77
81
  var _this = this;
@@ -13,7 +13,7 @@ var Mythology;
13
13
  Mythology[Mythology["Zulu"] = 6] = "Zulu";
14
14
  Mythology[Mythology["Celtic"] = 7] = "Celtic";
15
15
  })(Mythology = exports.Mythology || (exports.Mythology = {}));
16
- exports.availableMythologies = (0, rules_api_1.getEnumValues)(Mythology).filter(function (mythology) { return mythology < 6; });
16
+ exports.availableMythologies = (0, rules_api_1.getEnumValues)(Mythology).filter(function (mythology) { return mythology < 7; });
17
17
  var SanctuarySide;
18
18
  (function (SanctuarySide) {
19
19
  SanctuarySide[SanctuarySide["Left"] = 0] = "Left";
@@ -25,7 +25,7 @@ export declare class Pantheon extends MaterialRulesPart {
25
25
  onCardPlaced(move: MoveItem): MaterialMove<number, number, number, number>[];
26
26
  get isInvoke(): boolean;
27
27
  updateGrid(gridAfter?: (number | null)[][]): MaterialMove<number, number, number, number>[];
28
- private entityMoved;
28
+ private getEntitiesMoved;
29
29
  private gainBonus;
30
30
  gainLineBonus(y: number): MoveItem<number, number, number>[];
31
31
  gainColumnBonus(x: number): MoveItem<number, number, number>[];
@@ -92,7 +92,7 @@ var Pantheon = (function (_super) {
92
92
  var allCards = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.Pantheon).player(this.player);
93
93
  return allCards.location(function (_a) {
94
94
  var x = _a.x, y = _a.y, z = _a.z;
95
- return z < allCards.location(function (l) { return l.x === x && l.y === y; }).length;
95
+ return z < allCards.location(function (l) { return l.x === x && l.y === y; }).length - 1;
96
96
  });
97
97
  },
98
98
  enumerable: false,
@@ -154,7 +154,7 @@ var Pantheon = (function (_super) {
154
154
  Pantheon.prototype.isLegalSpace = function (_a, grid) {
155
155
  var x = _a.x, y = _a.y;
156
156
  if (grid === void 0) { grid = this.grid; }
157
- return !(0, Entity_1.isGod)(grid[y][x]);
157
+ return !(0, Entity_1.isGod)(grid[y][x]) && grid[y][x] !== Entity_1.Entity.Tokoloshe;
158
158
  };
159
159
  Pantheon.prototype.isFreeSpace = function (_a) {
160
160
  var x = _a.x, y = _a.y;
@@ -238,8 +238,9 @@ var Pantheon = (function (_super) {
238
238
  if (gridAfter === void 0) { gridAfter = this.indexGrid; }
239
239
  var gridBefore = (_a = this.remind(Memory_1.Memory.PlayerGrid, this.player)) !== null && _a !== void 0 ? _a : this.indexGrid;
240
240
  this.memorize(Memory_1.Memory.PlayerGrid, gridAfter, this.player);
241
- if (this.entityMoved(gridBefore, gridAfter)) {
242
- new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.EntityMoved, player: this.player });
241
+ var entities = this.getEntitiesMoved(gridBefore, gridAfter);
242
+ if (entities.length) {
243
+ new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.EntitiesMoved, player: this.player, entities: entities });
243
244
  }
244
245
  for (var y = 0; y < 3; y++) {
245
246
  if (gridBefore[y].some(function (item) { return item === null; }) && gridAfter[y].every(function (item) { return item !== null; })) {
@@ -257,21 +258,20 @@ var Pantheon = (function (_super) {
257
258
  }
258
259
  return this.gainBonus(gridAfter);
259
260
  };
260
- Pantheon.prototype.entityMoved = function (before, after) {
261
+ Pantheon.prototype.getEntitiesMoved = function (before, after) {
262
+ var entities = [];
261
263
  for (var y = 0; y < 3; y++) {
262
264
  var _loop_2 = function (x) {
263
265
  var cardIndex = before[y][x];
264
266
  if (cardIndex !== null && cardIndex !== after[y][x] && after.some(function (line) { return line.includes(cardIndex); })) {
265
- return { value: true };
267
+ entities.push(cardIndex);
266
268
  }
267
269
  };
268
270
  for (var x = 0; x < 3; x++) {
269
- var state_1 = _loop_2(x);
270
- if (typeof state_1 === "object")
271
- return state_1.value;
271
+ _loop_2(x);
272
272
  }
273
273
  }
274
- return false;
274
+ return entities;
275
275
  };
276
276
  Pantheon.prototype.gainBonus = function (grid) {
277
277
  var e_1, _a, e_2, _b;
@@ -48,7 +48,8 @@ export declare enum TriggerEventType {
48
48
  Infinite = 6,
49
49
  EntityCrushed = 7,
50
50
  EntitySacrificed = 8,
51
- EntityMoved = 9
51
+ EntitiesMoved = 9,
52
+ EndOfTurn = 10
52
53
  }
53
54
  export type SelfPlaced = {
54
55
  type: TriggerEventType.SelfPlaced;
@@ -97,11 +98,17 @@ export type EntitySacrificed = {
97
98
  cardIndex: number;
98
99
  };
99
100
  export declare const isSacrificed: (event: TriggerEvent, card: Material) => event is EntityCrushed;
100
- export type EntityMoved = {
101
- type: TriggerEventType.EntityMoved;
101
+ export type EntitiesMoved = {
102
+ type: TriggerEventType.EntitiesMoved;
102
103
  player: PlayerColor;
104
+ entities: number[];
103
105
  };
104
- export type TriggerEvent = EndOfGameEvent | SelfPlaced | EntityInvoked | LineEvent | ColumnEvent | Infinite | EntityCrushed | EntitySacrificed | EntityMoved;
106
+ export type EndOfTurn = {
107
+ type: TriggerEventType.EndOfTurn;
108
+ player: PlayerColor;
109
+ };
110
+ export declare const isEndOfMyTurn: (event: TriggerEvent, card: Material) => event is EndOfTurn;
111
+ export type TriggerEvent = EndOfGameEvent | SelfPlaced | EntityInvoked | LineEvent | ColumnEvent | Infinite | EntityCrushed | EntitySacrificed | EntitiesMoved | EndOfTurn;
105
112
  export type PendingEffect<Event extends TriggerEvent = TriggerEvent> = {
106
113
  cardIndex: number;
107
114
  triggerEvent: Event;
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
15
15
  };
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.isSacrificed = exports.isCrushed = exports.oncePerTurn = exports.LineEventType = exports.isEndOfGame = exports.isPlaced = exports.TriggerEventType = exports.AutoEffectRule = exports.SimultaneousEffectRule = exports.PlayerEffectRule = void 0;
18
+ exports.isEndOfMyTurn = exports.isSacrificed = exports.isCrushed = exports.oncePerTurn = exports.LineEventType = exports.isEndOfGame = exports.isPlaced = exports.TriggerEventType = exports.AutoEffectRule = exports.SimultaneousEffectRule = exports.PlayerEffectRule = void 0;
19
19
  var rules_api_1 = require("@gamepark/rules-api");
20
20
  var CustomMoveType_1 = require("../../CustomMoveType");
21
21
  var Memory_1 = require("../../Memory");
@@ -128,7 +128,8 @@ var TriggerEventType;
128
128
  TriggerEventType[TriggerEventType["Infinite"] = 6] = "Infinite";
129
129
  TriggerEventType[TriggerEventType["EntityCrushed"] = 7] = "EntityCrushed";
130
130
  TriggerEventType[TriggerEventType["EntitySacrificed"] = 8] = "EntitySacrificed";
131
- TriggerEventType[TriggerEventType["EntityMoved"] = 9] = "EntityMoved";
131
+ TriggerEventType[TriggerEventType["EntitiesMoved"] = 9] = "EntitiesMoved";
132
+ TriggerEventType[TriggerEventType["EndOfTurn"] = 10] = "EndOfTurn";
132
133
  })(TriggerEventType = exports.TriggerEventType || (exports.TriggerEventType = {}));
133
134
  var isPlaced = function (event) { return event.type === TriggerEventType.SelfPlaced; };
134
135
  exports.isPlaced = isPlaced;
@@ -149,3 +150,5 @@ var isSacrificed = function (event, card) {
149
150
  return event.type === TriggerEventType.EntitySacrificed && event.cardIndex === card.getIndex();
150
151
  };
151
152
  exports.isSacrificed = isSacrificed;
153
+ var isEndOfMyTurn = function (event, card) { var _a; return event.type === TriggerEventType.EndOfTurn && event.player === ((_a = card.getItem()) === null || _a === void 0 ? void 0 : _a.location.player); };
154
+ exports.isEndOfMyTurn = isEndOfMyTurn;
@@ -23,7 +23,7 @@ exports.SunWukong = {
23
23
  invoke: [{ gem: 1 }, { favor: 2 }, { gem: 1 }],
24
24
  effect: {
25
25
  trigger: function (effect, card, game) {
26
- return effect.type === Effect_1.TriggerEventType.EntityMoved && (0, rules_api_1.areNeighbors)(effect.player, card.getItem().location.player, game.players);
26
+ return effect.type === Effect_1.TriggerEventType.EntitiesMoved && (0, rules_api_1.areNeighbors)(effect.player, card.getItem().location.player, game.players);
27
27
  },
28
28
  rule: (function (_super) {
29
29
  __extends(SunWukongEffectRule, _super);
@@ -41,8 +41,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
41
41
  };
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.Vishnu = void 0;
44
+ var Destiny_1 = require("../../Destiny");
44
45
  var LocationType_1 = require("../../LocationType");
45
- var MaterialType_1 = require("../../MaterialType");
46
46
  var Pantheon_1 = require("../../Pantheon");
47
47
  var Effect_1 = require("../Effect");
48
48
  exports.Vishnu = {
@@ -55,11 +55,7 @@ exports.Vishnu = {
55
55
  return _super !== null && _super.apply(this, arguments) || this;
56
56
  }
57
57
  VishnuEffectRule.prototype.playEffect = function () {
58
- var tokensOnCards = this.material(MaterialType_1.MaterialType.DraftToken).location(LocationType_1.LocationType.OnEntityCard).getItems();
59
- var cardsWithToken = tokensOnCards.map(function (item) { return item.location.parent; });
60
- var godsToExile = this.material(MaterialType_1.MaterialType.EntityCard)
61
- .location(LocationType_1.LocationType.SanctuaryGodSpot)
62
- .index(function (index) { return !cardsWithToken.includes(index); });
58
+ var godsToExile = new Destiny_1.Destiny(this.game).cardsWithoutToken.location(LocationType_1.LocationType.SanctuaryGodSpot);
63
59
  if (!godsToExile.length)
64
60
  return [];
65
61
  var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Idlozi = void 0;
4
+ var IdloziEffectRule_1 = require("../../../rules/effects/IdloziEffectRule");
5
+ var Effect_1 = require("../Effect");
4
6
  exports.Idlozi = {
5
- invoke: [{ gem: 1 }, {}, { gem: 1 }]
7
+ invoke: [{ gem: 1 }, {}, { gem: 1 }],
8
+ effect: {
9
+ trigger: Effect_1.isPlaced,
10
+ rule: IdloziEffectRule_1.IdloziEffectRule
11
+ }
6
12
  };
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Impundulu = void 0;
4
+ var ImpunduluEffectRule_1 = require("../../../rules/effects/ImpunduluEffectRule");
5
+ var Effect_1 = require("../Effect");
4
6
  exports.Impundulu = {
5
- invoke: [{ favor: 1 }, {}, {}]
7
+ invoke: [{ favor: 1 }, {}, {}],
8
+ effect: {
9
+ trigger: Effect_1.isPlaced,
10
+ rule: ImpunduluEffectRule_1.ImpunduluEffectRule
11
+ }
6
12
  };
@@ -1,6 +1,38 @@
1
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
+ })();
2
17
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.Inkanyamba = void 0;
19
+ var Pantheon_1 = require("../../Pantheon");
20
+ var Effect_1 = require("../Effect");
4
21
  exports.Inkanyamba = {
5
- invoke: [{}, { favor: 1 }, { gem: 1 }]
22
+ invoke: [{}, { favor: 1 }, { gem: 1 }],
23
+ effect: {
24
+ trigger: function (effect, card) { return effect.type === Effect_1.TriggerEventType.EntitiesMoved && effect.entities.includes(card.getIndex()); },
25
+ rule: (function (_super) {
26
+ __extends(InkanyambaEffectRule, _super);
27
+ function InkanyambaEffectRule() {
28
+ return _super !== null && _super.apply(this, arguments) || this;
29
+ }
30
+ InkanyambaEffectRule.prototype.playEffect = function () {
31
+ var player = this.card.location.player;
32
+ return [new Pantheon_1.Pantheon(this.game, player).gainGems(1)];
33
+ };
34
+ return InkanyambaEffectRule;
35
+ }(Effect_1.AutoEffectRule)),
36
+ auto: true
37
+ }
6
38
  };
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Inkosazana = void 0;
4
+ var InkosazanaEffectRule_1 = require("../../../rules/effects/InkosazanaEffectRule");
5
+ var Effect_1 = require("../Effect");
4
6
  exports.Inkosazana = {
5
- invoke: [{}, { gem: 1, favor: 1 }, { favor: 1 }]
7
+ invoke: [{}, { gem: 1, favor: 1 }, { favor: 1 }],
8
+ effect: {
9
+ trigger: Effect_1.isPlaced,
10
+ rule: InkosazanaEffectRule_1.InkosazanaEffectRule
11
+ }
6
12
  };
@@ -1,6 +1,43 @@
1
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
+ })();
2
17
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.Shembe = void 0;
19
+ var lodash_1 = require("lodash");
20
+ var Entity_1 = require("../../Entity");
21
+ var Mythology_1 = require("../../Mythology");
22
+ var Pantheon_1 = require("../../Pantheon");
23
+ var Effect_1 = require("../Effect");
4
24
  exports.Shembe = {
5
- invoke: [{ gem: 1 }, { gem: 2 }, {}]
25
+ invoke: [{ gem: 1 }, { gem: 2 }, {}],
26
+ effect: {
27
+ trigger: Effect_1.isEndOfGame,
28
+ rule: (function (_super) {
29
+ __extends(ShembeEffectRule, _super);
30
+ function ShembeEffectRule() {
31
+ return _super !== null && _super.apply(this, arguments) || this;
32
+ }
33
+ ShembeEffectRule.prototype.playEffect = function () {
34
+ var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
35
+ var creatures = pantheon.visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front) && (0, Entity_1.entityMythology)(id.front) !== Mythology_1.Mythology.Zulu; });
36
+ var groups = (0, lodash_1.groupBy)(creatures.getItems(), function (creature) { return (0, Entity_1.entityMythology)(creature.id.front); });
37
+ var pairs = (0, lodash_1.sumBy)((0, lodash_1.values)(groups), function (group) { return Math.floor(group.length / 2); });
38
+ return pairs > 0 ? [pantheon.gainFavor(pairs * 2)] : [];
39
+ };
40
+ return ShembeEffectRule;
41
+ }(Effect_1.PlayerEffectRule))
42
+ }
6
43
  };
@@ -1,6 +1,41 @@
1
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
+ })();
2
17
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.Tokoloshe = void 0;
19
+ var Entity_1 = require("../../Entity");
20
+ var Pantheon_1 = require("../../Pantheon");
21
+ var Effect_1 = require("../Effect");
4
22
  exports.Tokoloshe = {
5
- invoke: [{}, { gem: 3 }, { favor: 2 }]
23
+ invoke: [{}, { gem: 3 }, { favor: 2 }],
24
+ effect: {
25
+ trigger: Effect_1.isEndOfMyTurn,
26
+ rule: (function (_super) {
27
+ __extends(TokolosheEffectRule, _super);
28
+ function TokolosheEffectRule() {
29
+ return _super !== null && _super.apply(this, arguments) || this;
30
+ }
31
+ TokolosheEffectRule.prototype.playEffect = function () {
32
+ var _a = this.card.location, x = _a.x, y = _a.y, player = _a.player;
33
+ var pantheon = new Pantheon_1.Pantheon(this.game, player);
34
+ var creatures = pantheon.visibleEntities.location(function (l) { return l.y === y && l.x !== x; }).id(function (id) { return (0, Entity_1.isCreature)(id.front); });
35
+ var loss = Math.min(pantheon.favor, creatures.length);
36
+ return loss ? [pantheon.loseFavor(loss)] : [];
37
+ };
38
+ return TokolosheEffectRule;
39
+ }(Effect_1.AutoEffectRule))
40
+ }
6
41
  };
@@ -1,6 +1,44 @@
1
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
+ })();
2
17
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.Umvelinqangi = void 0;
19
+ var lodash_1 = require("lodash");
20
+ var Entity_1 = require("../../Entity");
21
+ var Mythology_1 = require("../../Mythology");
22
+ var Pantheon_1 = require("../../Pantheon");
23
+ var Effect_1 = require("../Effect");
4
24
  exports.Umvelinqangi = {
5
- invoke: [{ gem: 1, favor: 1 }, { gem: 1 }, {}]
25
+ invoke: [{ gem: 1, favor: 1 }, { gem: 1 }, {}],
26
+ effect: {
27
+ trigger: Effect_1.isEndOfGame,
28
+ rule: (function (_super) {
29
+ __extends(UmvelinqangiEffectRule, _super);
30
+ function UmvelinqangiEffectRule() {
31
+ return _super !== null && _super.apply(this, arguments) || this;
32
+ }
33
+ UmvelinqangiEffectRule.prototype.playEffect = function () {
34
+ var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
35
+ var _a = this.card.location, x = _a.x, y = _a.y;
36
+ var covered = pantheon.coveredEntities.location(function (l) { return l.x === x && l.y === y; }).getItems();
37
+ 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
+ return gain > 0 ? [pantheon.gainFavor(gain)] : [];
40
+ };
41
+ return UmvelinqangiEffectRule;
42
+ }(Effect_1.PlayerEffectRule))
43
+ }
6
44
  };
@@ -1,6 +1,42 @@
1
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
+ })();
2
17
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.Unkulunkulu = void 0;
19
+ var lodash_1 = require("lodash");
20
+ var Pantheon_1 = require("../../Pantheon");
21
+ var Effect_1 = require("../Effect");
22
+ var EntityDescription_1 = require("../EntityDescription");
4
23
  exports.Unkulunkulu = {
5
- invoke: [{ favor: 1 }, { favor: 2 }, {}]
24
+ invoke: [{ favor: 1 }, { favor: 2 }, {}],
25
+ effect: {
26
+ trigger: Effect_1.isEndOfGame,
27
+ rule: (function (_super) {
28
+ __extends(UnkulunkuluEffectRule, _super);
29
+ function UnkulunkuluEffectRule() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ UnkulunkuluEffectRule.prototype.playEffect = function () {
33
+ var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
34
+ var _a = this.card.location, x = _a.x, y = _a.y;
35
+ var cards = pantheon.visibleEntities.location(function (l) { return (l.x === x && l.y !== y) || (l.y === y && l.x !== x); }).getItems();
36
+ var gain = (0, lodash_1.sumBy)(cards, function (card) { var _a; return (_a = EntityDescription_1.entities[card.id.front].invoke[card.location.y].favor) !== null && _a !== void 0 ? _a : 0; });
37
+ return gain > 0 ? [pantheon.gainFavor(gain)] : [];
38
+ };
39
+ return UnkulunkuluEffectRule;
40
+ }(Effect_1.PlayerEffectRule))
41
+ }
6
42
  };
@@ -1,6 +1,48 @@
1
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
+ })();
2
17
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.Unwabu = void 0;
19
+ var Entity_1 = require("../../Entity");
20
+ var MaterialType_1 = require("../../MaterialType");
21
+ var Pantheon_1 = require("../../Pantheon");
22
+ var Effect_1 = require("../Effect");
4
23
  exports.Unwabu = {
5
- invoke: [{ gem: 2 }, { favor: 1 }, {}]
24
+ invoke: [{ gem: 2 }, { favor: 1 }, {}],
25
+ effect: {
26
+ trigger: Effect_1.oncePerTurn,
27
+ rule: (function (_super) {
28
+ __extends(UnwabuEffectRule, _super);
29
+ function UnwabuEffectRule() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ UnwabuEffectRule.prototype.canPlayEffect = function (cardIndex) {
33
+ return this.getGain(cardIndex) > 0;
34
+ };
35
+ UnwabuEffectRule.prototype.getGain = function (cardIndex) {
36
+ if (cardIndex === void 0) { cardIndex = this.getEffect().cardIndex; }
37
+ var _a = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex).location, y = _a.y, player = _a.player;
38
+ var pantheon = new Pantheon_1.Pantheon(this.game, player);
39
+ return pantheon.visibleEntities.location(function (l) { return l.y === y; }).id(function (id) { return (0, Entity_1.isGod)(id.front); }).length;
40
+ };
41
+ UnwabuEffectRule.prototype.playEffect = function () {
42
+ var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
43
+ return [pantheon.gainGems(this.getGain())];
44
+ };
45
+ return UnwabuEffectRule;
46
+ }(Effect_1.PlayerEffectRule))
47
+ }
6
48
  };
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Werehyena = void 0;
4
+ var WerehyenaEffectRule_1 = require("../../../rules/effects/WerehyenaEffectRule");
5
+ var Effect_1 = require("../Effect");
4
6
  exports.Werehyena = {
5
- invoke: [{}, { gem: 1 }, { gem: 2 }]
7
+ invoke: [{}, { gem: 1 }, { gem: 2 }],
8
+ effect: {
9
+ trigger: Effect_1.isPlaced,
10
+ rule: WerehyenaEffectRule_1.WerehyenaEffectRule
11
+ }
6
12
  };
@@ -83,11 +83,10 @@ var DrawDestinyCardRule = (function (_super) {
83
83
  DrawDestinyCardRule.prototype.exileCards = function () {
84
84
  var e_1, _a;
85
85
  var moves = [];
86
- var boards = new Destiny_1.Destiny(this.game).getBoardsWithoutPlayer();
86
+ var destiny = new Destiny_1.Destiny(this.game);
87
+ var boards = destiny.getBoardsWithoutPlayer();
87
88
  var count = this.material(MaterialType_1.MaterialType.DestinyCard).location(LocationType_1.LocationType.CurrentDestiny).length;
88
- var tokensOnCards = this.material(MaterialType_1.MaterialType.DraftToken).location(LocationType_1.LocationType.OnEntityCard).getItems();
89
- var cardsWithToken = tokensOnCards.map(function (item) { return item.location.parent; });
90
- var entities = this.material(MaterialType_1.MaterialType.EntityCard).index(function (index) { return !cardsWithToken.includes(index); });
89
+ var entities = destiny.cardsWithoutToken;
91
90
  var creatures = entities.location(LocationType_1.LocationType.SanctuaryCreatureSpot);
92
91
  var gods = entities.location(LocationType_1.LocationType.SanctuaryGodSpot);
93
92
  try {
@@ -173,6 +173,7 @@ var PlaceCardsRule = (function (_super) {
173
173
  return [];
174
174
  };
175
175
  PlaceCardsRule.prototype.onPass = function () {
176
+ new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.EndOfTurn, player: this.player });
176
177
  return __spreadArray(__spreadArray([], __read(new Trial_1.Trial(this.game).passTrials(this.player)), false), [this.nextRule], false);
177
178
  };
178
179
  Object.defineProperty(PlaceCardsRule.prototype, "nextRule", {
@@ -47,5 +47,10 @@ export declare enum RuleId {
47
47
  TianlongOpponentsEffect = 49,
48
48
  QilinEffect = 50,
49
49
  FenghuangEffect = 51,
50
- JiangshiEffect = 52
50
+ JiangshiEffect = 52,
51
+ InkosazanaEffect = 53,
52
+ ImpunduluEffect = 54,
53
+ WerehyenaEffect = 55,
54
+ WerehyenaCallEffect = 56,
55
+ IdloziEffect = 57
51
56
  }
@@ -52,4 +52,9 @@ var RuleId;
52
52
  RuleId[RuleId["QilinEffect"] = 50] = "QilinEffect";
53
53
  RuleId[RuleId["FenghuangEffect"] = 51] = "FenghuangEffect";
54
54
  RuleId[RuleId["JiangshiEffect"] = 52] = "JiangshiEffect";
55
+ RuleId[RuleId["InkosazanaEffect"] = 53] = "InkosazanaEffect";
56
+ RuleId[RuleId["ImpunduluEffect"] = 54] = "ImpunduluEffect";
57
+ RuleId[RuleId["WerehyenaEffect"] = 55] = "WerehyenaEffect";
58
+ RuleId[RuleId["WerehyenaCallEffect"] = 56] = "WerehyenaCallEffect";
59
+ RuleId[RuleId["IdloziEffect"] = 57] = "IdloziEffect";
55
60
  })(RuleId = exports.RuleId || (exports.RuleId = {}));
@@ -0,0 +1,9 @@
1
+ import { Location, Material, MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
2
+ import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
3
+ import { RuleId } from '../RuleId';
4
+ export declare class IdloziEffectRule extends MoveEffectRule {
5
+ ruleId: RuleId;
6
+ getMovingCards(effectCardIndex: number): Material;
7
+ isLegalDestination(space: XYCoordinates, cardLocation: Location): boolean;
8
+ onCardMoved(move: MoveItem): MaterialMove[];
9
+ }
@@ -0,0 +1,43 @@
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.IdloziEffectRule = void 0;
19
+ var Entity_1 = require("../../material/Entity");
20
+ var MoveEffectRule_1 = require("../../material/entity/MoveEffectRule");
21
+ var MaterialType_1 = require("../../material/MaterialType");
22
+ var Pantheon_1 = require("../../material/Pantheon");
23
+ var RuleId_1 = require("../RuleId");
24
+ var IdloziEffectRule = (function (_super) {
25
+ __extends(IdloziEffectRule, _super);
26
+ function IdloziEffectRule() {
27
+ var _this = _super !== null && _super.apply(this, arguments) || this;
28
+ _this.ruleId = RuleId_1.RuleId.IdloziEffect;
29
+ return _this;
30
+ }
31
+ IdloziEffectRule.prototype.getMovingCards = function (effectCardIndex) {
32
+ return _super.prototype.getMovingCards.call(this, effectCardIndex).id(function (id) { return (0, Entity_1.isCreature)(id.front); });
33
+ };
34
+ IdloziEffectRule.prototype.isLegalDestination = function (space, cardLocation) {
35
+ return space.y !== cardLocation.y;
36
+ };
37
+ IdloziEffectRule.prototype.onCardMoved = function (move) {
38
+ var entity = this.material(MaterialType_1.MaterialType.EntityCard).getItem(move.itemIndex).id.front;
39
+ return new Pantheon_1.Pantheon(this.game, this.player).getInvokeGains(entity, move.location.y).concat(this.endEffect());
40
+ };
41
+ return IdloziEffectRule;
42
+ }(MoveEffectRule_1.MoveEffectRule));
43
+ exports.IdloziEffectRule = IdloziEffectRule;
@@ -0,0 +1,7 @@
1
+ import { InvokeEffectRule } from '../../material/entity/PlaceCardEffectRule';
2
+ import { RuleId } from '../RuleId';
3
+ export declare class ImpunduluEffectRule extends InvokeEffectRule {
4
+ ruleId: RuleId;
5
+ playEffect(): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
6
+ getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
7
+ }
@@ -0,0 +1,47 @@
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.ImpunduluEffectRule = void 0;
19
+ var Destiny_1 = require("../../material/Destiny");
20
+ var Entity_1 = require("../../material/Entity");
21
+ var PlaceCardEffectRule_1 = require("../../material/entity/PlaceCardEffectRule");
22
+ var LocationType_1 = require("../../material/LocationType");
23
+ var MaterialType_1 = require("../../material/MaterialType");
24
+ var Pantheon_1 = require("../../material/Pantheon");
25
+ var RuleId_1 = require("../RuleId");
26
+ var ImpunduluEffectRule = (function (_super) {
27
+ __extends(ImpunduluEffectRule, _super);
28
+ function ImpunduluEffectRule() {
29
+ var _this = _super !== null && _super.apply(this, arguments) || this;
30
+ _this.ruleId = RuleId_1.RuleId.ImpunduluEffect;
31
+ return _this;
32
+ }
33
+ ImpunduluEffectRule.prototype.playEffect = function () {
34
+ var player = this.card.location.player;
35
+ return new Pantheon_1.Pantheon(this.game, player).hasCrushed(this.card) ? _super.prototype.playEffect.call(this) : [];
36
+ };
37
+ ImpunduluEffectRule.prototype.getCardsToPlace = function () {
38
+ var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
39
+ var _a = this.card.location, x = _a.x, y = _a.y;
40
+ var crushed = pantheon.coveredEntities.location(function (l) { return l.x === x && l.y === y; }).maxBy(function (item) { return item.location.z; });
41
+ var mythology = (0, Entity_1.entityMythology)(crushed.getItem().id.front);
42
+ var board = this.material(MaterialType_1.MaterialType.MythologyBoard).id(function (id) { return id.mythology === mythology; });
43
+ return new Destiny_1.Destiny(this.game).cardsWithoutToken.location(LocationType_1.LocationType.SanctuaryCreatureSpot).parent(board.getIndex());
44
+ };
45
+ return ImpunduluEffectRule;
46
+ }(PlaceCardEffectRule_1.InvokeEffectRule));
47
+ exports.ImpunduluEffectRule = ImpunduluEffectRule;
@@ -0,0 +1,7 @@
1
+ import { InvokeEffectRule } from '../../material/entity/PlaceCardEffectRule';
2
+ import { RuleId } from '../RuleId';
3
+ export declare class InkosazanaEffectRule extends InvokeEffectRule {
4
+ ruleId: RuleId;
5
+ onRuleStart(): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
6
+ getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
7
+ }
@@ -0,0 +1,46 @@
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.InkosazanaEffectRule = void 0;
19
+ var PlaceCardEffectRule_1 = require("../../material/entity/PlaceCardEffectRule");
20
+ var LocationType_1 = require("../../material/LocationType");
21
+ var MaterialType_1 = require("../../material/MaterialType");
22
+ var Memory_1 = require("../../Memory");
23
+ var RuleId_1 = require("../RuleId");
24
+ var InkosazanaEffectRule = (function (_super) {
25
+ __extends(InkosazanaEffectRule, _super);
26
+ function InkosazanaEffectRule() {
27
+ var _this = _super !== null && _super.apply(this, arguments) || this;
28
+ _this.ruleId = RuleId_1.RuleId.InkosazanaEffect;
29
+ return _this;
30
+ }
31
+ InkosazanaEffectRule.prototype.onRuleStart = function () {
32
+ if (!this.remind(Memory_1.Memory.InkosazanaInvoke1)) {
33
+ this.remind(Memory_1.Memory.PendingEffects).unshift([this.getEffect()]);
34
+ this.memorize(Memory_1.Memory.InkosazanaInvoke1, true);
35
+ }
36
+ else {
37
+ this.forget(Memory_1.Memory.InkosazanaInvoke1);
38
+ }
39
+ return _super.prototype.onRuleStart.call(this);
40
+ };
41
+ InkosazanaEffectRule.prototype.getCardsToPlace = function () {
42
+ return this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.PlayerDiscard).player(this.player);
43
+ };
44
+ return InkosazanaEffectRule;
45
+ }(PlaceCardEffectRule_1.InvokeEffectRule));
46
+ exports.InkosazanaEffectRule = InkosazanaEffectRule;
@@ -81,7 +81,7 @@ var QilinEffectRule = (function (_super) {
81
81
  var _a;
82
82
  var entity = id.front;
83
83
  var trigger = (_a = EntityDescription_1.entities[entity].effect) === null || _a === void 0 ? void 0 : _a.trigger;
84
- return (0, Entity_1.isCreature)(entity) && trigger === Effect_1.isPlaced;
84
+ return (0, Entity_1.isCreature)(entity) && trigger === Effect_1.isPlaced && entity !== Entity_1.Entity.Qilin;
85
85
  })
86
86
  .getIndexes()), false));
87
87
  }
@@ -0,0 +1,11 @@
1
+ import { PlaceCardEffectRule } from '../../material/entity/PlaceCardEffectRule';
2
+ import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
3
+ import { RuleId } from '../RuleId';
4
+ export declare class WerehyenaEffectRule extends SacrificeEffectRule {
5
+ ruleId: RuleId;
6
+ getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
7
+ onSacrifice(): import("@gamepark/rules-api").StartRule<RuleId.WerehyenaCallEffect>[];
8
+ }
9
+ export declare class WerehyenaCallEffectRule extends PlaceCardEffectRule {
10
+ getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
11
+ }
@@ -0,0 +1,54 @@
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.WerehyenaCallEffectRule = exports.WerehyenaEffectRule = void 0;
19
+ var Entity_1 = require("../../material/Entity");
20
+ var PlaceCardEffectRule_1 = require("../../material/entity/PlaceCardEffectRule");
21
+ var SacrificeEffectRule_1 = require("../../material/entity/SacrificeEffectRule");
22
+ var LocationType_1 = require("../../material/LocationType");
23
+ var MaterialType_1 = require("../../material/MaterialType");
24
+ var RuleId_1 = require("../RuleId");
25
+ var WerehyenaEffectRule = (function (_super) {
26
+ __extends(WerehyenaEffectRule, _super);
27
+ function WerehyenaEffectRule() {
28
+ var _this = _super !== null && _super.apply(this, arguments) || this;
29
+ _this.ruleId = RuleId_1.RuleId.WerehyenaEffect;
30
+ return _this;
31
+ }
32
+ WerehyenaEffectRule.prototype.getCardsToSacrifice = function () {
33
+ return _super.prototype.getCardsToSacrifice.call(this).id(function (id) { return (0, Entity_1.isCreature)(id.front); });
34
+ };
35
+ WerehyenaEffectRule.prototype.onSacrifice = function () {
36
+ return [this.startRule(RuleId_1.RuleId.WerehyenaCallEffect)];
37
+ };
38
+ return WerehyenaEffectRule;
39
+ }(SacrificeEffectRule_1.SacrificeEffectRule));
40
+ exports.WerehyenaEffectRule = WerehyenaEffectRule;
41
+ var WerehyenaCallEffectRule = (function (_super) {
42
+ __extends(WerehyenaCallEffectRule, _super);
43
+ function WerehyenaCallEffectRule() {
44
+ return _super !== null && _super.apply(this, arguments) || this;
45
+ }
46
+ WerehyenaCallEffectRule.prototype.getCardsToPlace = function () {
47
+ var _this = this;
48
+ return this.material(MaterialType_1.MaterialType.EntityCard)
49
+ .location(LocationType_1.LocationType.PlayerDiscard)
50
+ .player(function (player) { return player !== _this.player; });
51
+ };
52
+ return WerehyenaCallEffectRule;
53
+ }(PlaceCardEffectRule_1.PlaceCardEffectRule));
54
+ exports.WerehyenaCallEffectRule = WerehyenaCallEffectRule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/mythologies",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "The rules of Mythologies adapted for Game Park",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",
@@ -29,5 +29,5 @@
29
29
  "i18next": "^22.0.3",
30
30
  "lodash": "^4.17.21"
31
31
  },
32
- "gitHead": "9e3481a061f2f707eb6ed6c340dd043ae264d6ad"
32
+ "gitHead": "d1fe28d9163e93c887671815f4d48d64776adb30"
33
33
  }