@gamepark/mythologies 0.3.1 → 0.4.1
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.
- package/dist/Memory.d.ts +3 -1
- package/dist/Memory.js +2 -0
- package/dist/MythologiesRules.d.ts +11 -0
- package/dist/MythologiesRules.js +11 -0
- package/dist/material/Destiny.d.ts +1 -0
- package/dist/material/Destiny.js +10 -6
- package/dist/material/Entity.d.ts +5 -1
- package/dist/material/Entity.js +1 -1
- package/dist/material/Mythology.js +1 -1
- package/dist/material/Pantheon.d.ts +11 -7
- package/dist/material/Pantheon.js +98 -54
- package/dist/material/entity/Effect.d.ts +29 -14
- package/dist/material/entity/Effect.js +7 -2
- package/dist/material/entity/EntityDescription.d.ts +2 -0
- package/dist/material/entity/EntityDescription.js +6 -3
- package/dist/material/entity/MoveEffectRule.js +29 -1
- package/dist/material/entity/SacrificeEffectRule.d.ts +1 -0
- package/dist/material/entity/SacrificeEffectRule.js +13 -36
- package/dist/material/entity/SimultaneousMoveEffectRule.js +9 -5
- package/dist/material/entity/SimultaneousSacrificeEffectRule.d.ts +1 -0
- package/dist/material/entity/SimultaneousSacrificeEffectRule.js +12 -35
- package/dist/material/entity/celtic/Banshee.js +33 -1
- package/dist/material/entity/celtic/Brigid.js +34 -1
- package/dist/material/entity/celtic/Cernunnos.js +37 -1
- package/dist/material/entity/celtic/Dagda.js +43 -1
- package/dist/material/entity/celtic/Fairy.d.ts +2 -0
- package/dist/material/entity/celtic/Fairy.js +12 -0
- package/dist/material/entity/celtic/Kelpie.js +33 -1
- package/dist/material/entity/celtic/Morrigan.js +6 -1
- package/dist/material/entity/chinese/SunWukong.js +1 -1
- package/dist/material/entity/egyptian/Beetle.js +19 -13
- package/dist/material/entity/hindu/Naga.js +36 -30
- package/dist/material/entity/hindu/Vishnu.js +2 -6
- package/dist/material/entity/norse/Troll.js +4 -1
- package/dist/material/entity/zulu/Idlozi.js +7 -1
- package/dist/material/entity/zulu/Impundulu.js +7 -1
- package/dist/material/entity/zulu/Inkanyamba.js +33 -1
- package/dist/material/entity/zulu/Inkosazana.js +7 -1
- package/dist/material/entity/zulu/Shembe.js +38 -1
- package/dist/material/entity/zulu/Tokoloshe.js +41 -1
- package/dist/material/entity/zulu/Umvelinqangi.js +39 -1
- package/dist/material/entity/zulu/Unkulunkulu.js +37 -1
- package/dist/material/entity/zulu/Unwabu.js +43 -1
- package/dist/material/entity/zulu/Werehyena.js +7 -1
- package/dist/rules/DrawDestinyCardRule.js +3 -4
- package/dist/rules/PlaceCardsRule.js +4 -2
- package/dist/rules/RuleId.d.ts +7 -1
- package/dist/rules/RuleId.js +6 -0
- package/dist/rules/effects/AthenaEffectRule.js +29 -1
- package/dist/rules/effects/CentaurEffectRule.js +29 -1
- package/dist/rules/effects/FairyEffectRule.d.ts +10 -0
- package/dist/rules/effects/FairyEffectRule.js +55 -0
- package/dist/rules/effects/IdloziEffectRule.d.ts +9 -0
- package/dist/rules/effects/IdloziEffectRule.js +43 -0
- package/dist/rules/effects/ImpunduluEffectRule.d.ts +7 -0
- package/dist/rules/effects/ImpunduluEffectRule.js +47 -0
- package/dist/rules/effects/InkosazanaEffectRule.d.ts +7 -0
- package/dist/rules/effects/InkosazanaEffectRule.js +46 -0
- package/dist/rules/effects/JiangshiEffectRule.js +5 -2
- package/dist/rules/effects/PermanentEffectsRule.d.ts +7 -0
- package/dist/rules/effects/PermanentEffectsRule.js +54 -0
- package/dist/rules/effects/QilinEffectRule.js +6 -5
- package/dist/rules/effects/ResolveEffectsRule.js +1 -1
- package/dist/rules/effects/ShivaEffectRule.d.ts +1 -1
- package/dist/rules/effects/ShivaEffectRule.js +14 -10
- package/dist/rules/effects/TriggerEffectsRule.d.ts +1 -1
- package/dist/rules/effects/TriggerEffectsRule.js +36 -18
- package/dist/rules/effects/WerehyenaEffectRule.d.ts +11 -0
- package/dist/rules/effects/WerehyenaEffectRule.js +54 -0
- package/package.json +2 -2
|
@@ -15,11 +15,13 @@ 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 = exports.isTriggeredEffect = 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");
|
|
22
22
|
var MaterialType_1 = require("../MaterialType");
|
|
23
|
+
var isTriggeredEffect = function (effect) { return typeof effect.trigger === 'function'; };
|
|
24
|
+
exports.isTriggeredEffect = isTriggeredEffect;
|
|
23
25
|
var PlayerEffectRule = (function (_super) {
|
|
24
26
|
__extends(PlayerEffectRule, _super);
|
|
25
27
|
function PlayerEffectRule() {
|
|
@@ -128,7 +130,8 @@ var TriggerEventType;
|
|
|
128
130
|
TriggerEventType[TriggerEventType["Infinite"] = 6] = "Infinite";
|
|
129
131
|
TriggerEventType[TriggerEventType["EntityCrushed"] = 7] = "EntityCrushed";
|
|
130
132
|
TriggerEventType[TriggerEventType["EntitySacrificed"] = 8] = "EntitySacrificed";
|
|
131
|
-
TriggerEventType[TriggerEventType["
|
|
133
|
+
TriggerEventType[TriggerEventType["EntitiesMoved"] = 9] = "EntitiesMoved";
|
|
134
|
+
TriggerEventType[TriggerEventType["EndOfTurn"] = 10] = "EndOfTurn";
|
|
132
135
|
})(TriggerEventType = exports.TriggerEventType || (exports.TriggerEventType = {}));
|
|
133
136
|
var isPlaced = function (event) { return event.type === TriggerEventType.SelfPlaced; };
|
|
134
137
|
exports.isPlaced = isPlaced;
|
|
@@ -149,3 +152,5 @@ var isSacrificed = function (event, card) {
|
|
|
149
152
|
return event.type === TriggerEventType.EntitySacrificed && event.cardIndex === card.getIndex();
|
|
150
153
|
};
|
|
151
154
|
exports.isSacrificed = isSacrificed;
|
|
155
|
+
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); };
|
|
156
|
+
exports.isEndOfMyTurn = isEndOfMyTurn;
|
|
@@ -3,7 +3,9 @@ import { Effect } from './Effect';
|
|
|
3
3
|
export type EntityDescription = {
|
|
4
4
|
invoke: [InvokeGain, InvokeGain, InvokeGain];
|
|
5
5
|
effect?: Effect;
|
|
6
|
+
effects?: Effect[];
|
|
6
7
|
};
|
|
8
|
+
export declare const getEffects: (entity?: Entity) => Effect[];
|
|
7
9
|
export type InvokeGain = {
|
|
8
10
|
gem?: number;
|
|
9
11
|
favor?: number;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.entities = void 0;
|
|
4
|
+
exports.entities = exports.getEffects = void 0;
|
|
5
5
|
var Entity_1 = require("../Entity");
|
|
6
6
|
var Banshee_1 = require("./celtic/Banshee");
|
|
7
7
|
var Brigid_1 = require("./celtic/Brigid");
|
|
8
8
|
var Cernunnos_1 = require("./celtic/Cernunnos");
|
|
9
9
|
var Dagda_1 = require("./celtic/Dagda");
|
|
10
|
-
var
|
|
10
|
+
var Fairy_1 = require("./celtic/Fairy");
|
|
11
11
|
var Dullahan_1 = require("./celtic/Dullahan");
|
|
12
12
|
var Kelpie_1 = require("./celtic/Kelpie");
|
|
13
13
|
var Leprechaun_1 = require("./celtic/Leprechaun");
|
|
@@ -83,6 +83,9 @@ var Umvelinqangi_1 = require("./zulu/Umvelinqangi");
|
|
|
83
83
|
var Unkulunkulu_1 = require("./zulu/Unkulunkulu");
|
|
84
84
|
var Unwabu_1 = require("./zulu/Unwabu");
|
|
85
85
|
var Werehyena_1 = require("./zulu/Werehyena");
|
|
86
|
+
var getEffects = function (entity) { return (entity ? getDescriptionEffects(exports.entities[entity]) : []); };
|
|
87
|
+
exports.getEffects = getEffects;
|
|
88
|
+
var getDescriptionEffects = function (description) { var _a; return (description.effect ? [description.effect] : ((_a = description.effects) !== null && _a !== void 0 ? _a : [])); };
|
|
86
89
|
exports.entities = (_a = {},
|
|
87
90
|
_a[Entity_1.Entity.Zeus] = Zeus_1.Zeus,
|
|
88
91
|
_a[Entity_1.Entity.Poseidon] = Poseidon_1.Poseidon,
|
|
@@ -160,7 +163,7 @@ exports.entities = (_a = {},
|
|
|
160
163
|
_a[Entity_1.Entity.Morrigan] = Morrigan_1.Morrigan,
|
|
161
164
|
_a[Entity_1.Entity.Kelpie] = Kelpie_1.Kelpie,
|
|
162
165
|
_a[Entity_1.Entity.Banshee] = Banshee_1.Banshee,
|
|
163
|
-
_a[Entity_1.Entity.
|
|
166
|
+
_a[Entity_1.Entity.Fairy] = Fairy_1.Fairy,
|
|
164
167
|
_a[Entity_1.Entity.Leprechaun] = Leprechaun_1.Leprechaun,
|
|
165
168
|
_a[Entity_1.Entity.Selkie] = Selkie_1.Selkie,
|
|
166
169
|
_a[Entity_1.Entity.Dullahan] = Dullahan_1.Dullahan,
|
|
@@ -14,10 +14,36 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
18
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
|
+
if (!m) return o;
|
|
20
|
+
var i = m.call(o), r, ar = [], e;
|
|
21
|
+
try {
|
|
22
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
23
|
+
}
|
|
24
|
+
catch (error) { e = { error: error }; }
|
|
25
|
+
finally {
|
|
26
|
+
try {
|
|
27
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
28
|
+
}
|
|
29
|
+
finally { if (e) throw e.error; }
|
|
30
|
+
}
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
34
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
35
|
+
if (ar || !(i in from)) {
|
|
36
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
37
|
+
ar[i] = from[i];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
41
|
+
};
|
|
17
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
43
|
exports.MoveEffectRule = void 0;
|
|
19
44
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
45
|
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
46
|
+
var TriggerEffectsRule_1 = require("../../rules/effects/TriggerEffectsRule");
|
|
21
47
|
var LocationType_1 = require("../LocationType");
|
|
22
48
|
var MaterialType_1 = require("../MaterialType");
|
|
23
49
|
var Pantheon_1 = require("../Pantheon");
|
|
@@ -75,9 +101,11 @@ var MoveEffectRule = (function (_super) {
|
|
|
75
101
|
return this.endEffect();
|
|
76
102
|
};
|
|
77
103
|
MoveEffectRule.prototype.onCustomMove = function (move) {
|
|
104
|
+
var _a;
|
|
78
105
|
if (move.type === CustomMoveType_1.CustomMoveType.EndEffect) {
|
|
79
106
|
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
80
|
-
|
|
107
|
+
(_a = new TriggerEffectsRule_1.TriggerEffectsRule(this.game)).triggerEffects.apply(_a, __spreadArray([], __read(pantheon.updateGrid()), false));
|
|
108
|
+
return pantheon.gainBonus();
|
|
81
109
|
}
|
|
82
110
|
return [];
|
|
83
111
|
};
|
|
@@ -4,6 +4,7 @@ export declare abstract class SacrificeEffectRule extends PlayerEffectRule {
|
|
|
4
4
|
canPlayEffect(_cardIndex: number): boolean;
|
|
5
5
|
playEffect(): MaterialMove[];
|
|
6
6
|
getPlayerMoves(): MoveItem<number, number, number>[];
|
|
7
|
+
private getCardsAbleToSacrifice;
|
|
7
8
|
getCardsToSacrifice(): Material;
|
|
8
9
|
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
9
10
|
onSacrifice(_move: MoveItem): MaterialMove<number, number, number, number>[];
|
|
@@ -14,35 +14,10 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
18
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
|
-
if (!m) return o;
|
|
20
|
-
var i = m.call(o), r, ar = [], e;
|
|
21
|
-
try {
|
|
22
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
23
|
-
}
|
|
24
|
-
catch (error) { e = { error: error }; }
|
|
25
|
-
finally {
|
|
26
|
-
try {
|
|
27
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
28
|
-
}
|
|
29
|
-
finally { if (e) throw e.error; }
|
|
30
|
-
}
|
|
31
|
-
return ar;
|
|
32
|
-
};
|
|
33
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
34
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
35
|
-
if (ar || !(i in from)) {
|
|
36
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
37
|
-
ar[i] = from[i];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
41
|
-
};
|
|
42
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
18
|
exports.SacrificeEffectRule = void 0;
|
|
44
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
45
|
-
var
|
|
20
|
+
var PermanentEffectsRule_1 = require("../../rules/effects/PermanentEffectsRule");
|
|
46
21
|
var LocationType_1 = require("../LocationType");
|
|
47
22
|
var MaterialType_1 = require("../MaterialType");
|
|
48
23
|
var Pantheon_1 = require("../Pantheon");
|
|
@@ -56,27 +31,29 @@ var SacrificeEffectRule = (function (_super) {
|
|
|
56
31
|
return this.getCardsToSacrifice().length > 0;
|
|
57
32
|
};
|
|
58
33
|
SacrificeEffectRule.prototype.playEffect = function () {
|
|
59
|
-
if (!this.
|
|
34
|
+
if (!this.getCardsAbleToSacrifice().length)
|
|
60
35
|
return [];
|
|
61
36
|
return _super.prototype.playEffect.call(this);
|
|
62
37
|
};
|
|
63
38
|
SacrificeEffectRule.prototype.getPlayerMoves = function () {
|
|
64
|
-
var
|
|
65
|
-
var moves =
|
|
66
|
-
var indexes =
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
39
|
+
var cards = this.getCardsAbleToSacrifice();
|
|
40
|
+
var moves = cards.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: this.player });
|
|
41
|
+
var indexes = cards.getIndexes();
|
|
42
|
+
var replaceSacrifice = new Pantheon_1.Pantheon(this.game, this.player).replaceSacrifice(cards.getItems()).index(function (index) { return !indexes.includes(index); });
|
|
43
|
+
return moves.concat(replaceSacrifice.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: this.player }));
|
|
44
|
+
};
|
|
45
|
+
SacrificeEffectRule.prototype.getCardsAbleToSacrifice = function () {
|
|
46
|
+
var rule = new PermanentEffectsRule_1.PermanentEffectsRule(this.game);
|
|
47
|
+
return this.getCardsToSacrifice().filter(function (card) { return rule.canSacrifice(card); });
|
|
71
48
|
};
|
|
72
49
|
SacrificeEffectRule.prototype.getCardsToSacrifice = function () {
|
|
73
50
|
return new Pantheon_1.Pantheon(this.game, this.player).visibleEntities;
|
|
74
51
|
};
|
|
75
52
|
SacrificeEffectRule.prototype.beforeItemMove = function (move) {
|
|
76
|
-
var _a;
|
|
77
53
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
78
54
|
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
|
|
79
|
-
|
|
55
|
+
new Pantheon_1.Pantheon(this.game, this.player).onEntitySacrificed(card);
|
|
56
|
+
return this.onSacrifice(move);
|
|
80
57
|
}
|
|
81
58
|
return [];
|
|
82
59
|
};
|
|
@@ -53,6 +53,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
54
|
exports.SimultaneousMoveEffectRule = void 0;
|
|
55
55
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
56
|
+
var TriggerEffectsRule_1 = require("../../rules/effects/TriggerEffectsRule");
|
|
56
57
|
var LocationType_1 = require("../LocationType");
|
|
57
58
|
var MaterialType_1 = require("../MaterialType");
|
|
58
59
|
var Pantheon_1 = require("../Pantheon");
|
|
@@ -97,22 +98,25 @@ var SimultaneousMoveEffectRule = (function (_super) {
|
|
|
97
98
|
return [this.endPlayerTurn(move.location.player)];
|
|
98
99
|
};
|
|
99
100
|
SimultaneousMoveEffectRule.prototype.getMovesAfterPlayersDone = function () {
|
|
100
|
-
var e_1, _a;
|
|
101
|
+
var e_1, _a, _b;
|
|
101
102
|
var moves = [];
|
|
103
|
+
var events = [];
|
|
102
104
|
try {
|
|
103
|
-
for (var
|
|
104
|
-
var player =
|
|
105
|
+
for (var _c = __values(this.game.players), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
106
|
+
var player = _d.value;
|
|
105
107
|
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
106
|
-
|
|
108
|
+
events.push.apply(events, __spreadArray([], __read(pantheon.updateGrid()), false));
|
|
109
|
+
moves.push.apply(moves, __spreadArray([], __read(pantheon.gainBonus()), false));
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
110
113
|
finally {
|
|
111
114
|
try {
|
|
112
|
-
if (
|
|
115
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
113
116
|
}
|
|
114
117
|
finally { if (e_1) throw e_1.error; }
|
|
115
118
|
}
|
|
119
|
+
(_b = new TriggerEffectsRule_1.TriggerEffectsRule(this.game)).triggerEffects.apply(_b, __spreadArray([], __read(events), false));
|
|
116
120
|
moves.push.apply(moves, __spreadArray([], __read(_super.prototype.getMovesAfterPlayersDone.call(this)), false));
|
|
117
121
|
return moves;
|
|
118
122
|
};
|
|
@@ -4,6 +4,7 @@ import { SimultaneousEffectRule } from './Effect';
|
|
|
4
4
|
export declare abstract class SimultaneousSacrificeEffectRule extends SimultaneousEffectRule {
|
|
5
5
|
getAffectedPlayers(): PlayerColor[];
|
|
6
6
|
getActivePlayerLegalMoves(player: PlayerColor): MaterialMove[];
|
|
7
|
+
private getCardsAbleToSacrifice;
|
|
7
8
|
getCardsToSacrifice(player: PlayerColor): Material;
|
|
8
9
|
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
9
10
|
onSacrifice(move: MoveItem): import("@gamepark/rules-api").EndPlayerTurn<number>[];
|
|
@@ -14,35 +14,10 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
18
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
|
-
if (!m) return o;
|
|
20
|
-
var i = m.call(o), r, ar = [], e;
|
|
21
|
-
try {
|
|
22
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
23
|
-
}
|
|
24
|
-
catch (error) { e = { error: error }; }
|
|
25
|
-
finally {
|
|
26
|
-
try {
|
|
27
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
28
|
-
}
|
|
29
|
-
finally { if (e) throw e.error; }
|
|
30
|
-
}
|
|
31
|
-
return ar;
|
|
32
|
-
};
|
|
33
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
34
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
35
|
-
if (ar || !(i in from)) {
|
|
36
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
37
|
-
ar[i] = from[i];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
41
|
-
};
|
|
42
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
18
|
exports.SimultaneousSacrificeEffectRule = void 0;
|
|
44
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
45
|
-
var
|
|
20
|
+
var PermanentEffectsRule_1 = require("../../rules/effects/PermanentEffectsRule");
|
|
46
21
|
var LocationType_1 = require("../LocationType");
|
|
47
22
|
var MaterialType_1 = require("../MaterialType");
|
|
48
23
|
var Pantheon_1 = require("../Pantheon");
|
|
@@ -57,22 +32,24 @@ var SimultaneousSacrificeEffectRule = (function (_super) {
|
|
|
57
32
|
return this.game.players.filter(function (player) { return _this.getCardsToSacrifice(player).length; });
|
|
58
33
|
};
|
|
59
34
|
SimultaneousSacrificeEffectRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
60
|
-
var
|
|
61
|
-
var moves =
|
|
62
|
-
var indexes =
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
35
|
+
var cards = this.getCardsAbleToSacrifice(player);
|
|
36
|
+
var moves = cards.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: player });
|
|
37
|
+
var indexes = cards.getIndexes();
|
|
38
|
+
var replaceSacrifice = new Pantheon_1.Pantheon(this.game, player).replaceSacrifice(cards.getItems()).index(function (index) { return !indexes.includes(index); });
|
|
39
|
+
return moves.concat(replaceSacrifice.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: player }));
|
|
40
|
+
};
|
|
41
|
+
SimultaneousSacrificeEffectRule.prototype.getCardsAbleToSacrifice = function (player) {
|
|
42
|
+
var rule = new PermanentEffectsRule_1.PermanentEffectsRule(this.game);
|
|
43
|
+
return this.getCardsToSacrifice(player).filter(function (card) { return rule.canSacrifice(card); });
|
|
67
44
|
};
|
|
68
45
|
SimultaneousSacrificeEffectRule.prototype.getCardsToSacrifice = function (player) {
|
|
69
46
|
return new Pantheon_1.Pantheon(this.game, player).visibleEntities;
|
|
70
47
|
};
|
|
71
48
|
SimultaneousSacrificeEffectRule.prototype.beforeItemMove = function (move) {
|
|
72
|
-
var _a;
|
|
73
49
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
74
50
|
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
|
|
75
|
-
|
|
51
|
+
new Pantheon_1.Pantheon(this.game, move.location.player).onEntitySacrificed(card);
|
|
52
|
+
return this.onSacrifice(move);
|
|
76
53
|
}
|
|
77
54
|
return [];
|
|
78
55
|
};
|
|
@@ -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.Banshee = void 0;
|
|
19
|
+
var Pantheon_1 = require("../../Pantheon");
|
|
20
|
+
var Effect_1 = require("../Effect");
|
|
4
21
|
exports.Banshee = {
|
|
5
|
-
invoke: [{ gem: 1 }, {}, { favor: 1 }]
|
|
22
|
+
invoke: [{ gem: 1 }, {}, { favor: 1 }],
|
|
23
|
+
effect: {
|
|
24
|
+
trigger: Effect_1.isPlaced,
|
|
25
|
+
rule: (function (_super) {
|
|
26
|
+
__extends(BansheeEffectRule, _super);
|
|
27
|
+
function BansheeEffectRule() {
|
|
28
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
+
}
|
|
30
|
+
BansheeEffectRule.prototype.playEffect = function () {
|
|
31
|
+
var _a = this.card.location, x = _a.x, y = _a.y, player = _a.player;
|
|
32
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
33
|
+
return pantheon.grid[y].every(function (entity, column) { return column !== x || !entity; }) ? [pantheon.gainFavor(1)] : [];
|
|
34
|
+
};
|
|
35
|
+
return BansheeEffectRule;
|
|
36
|
+
}(Effect_1.AutoEffectRule))
|
|
37
|
+
}
|
|
6
38
|
};
|
|
@@ -1,6 +1,39 @@
|
|
|
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.Brigid = void 0;
|
|
19
|
+
var Entity_1 = require("../../Entity");
|
|
20
|
+
var Pantheon_1 = require("../../Pantheon");
|
|
21
|
+
var Effect_1 = require("../Effect");
|
|
4
22
|
exports.Brigid = {
|
|
5
|
-
invoke: [{ favor: 2 }, { gem: 2 }, {}]
|
|
23
|
+
invoke: [{ favor: 2 }, { gem: 2 }, {}],
|
|
24
|
+
effect: {
|
|
25
|
+
trigger: Effect_1.isPlaced,
|
|
26
|
+
rule: (function (_super) {
|
|
27
|
+
__extends(BrigidEffectRule, _super);
|
|
28
|
+
function BrigidEffectRule() {
|
|
29
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
30
|
+
}
|
|
31
|
+
BrigidEffectRule.prototype.playEffect = function () {
|
|
32
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
33
|
+
var gain = pantheon.visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front); }).length;
|
|
34
|
+
return gain ? [pantheon.gainGems(gain)] : [];
|
|
35
|
+
};
|
|
36
|
+
return BrigidEffectRule;
|
|
37
|
+
}(Effect_1.PlayerEffectRule))
|
|
38
|
+
}
|
|
6
39
|
};
|
|
@@ -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.Cernunnos = void 0;
|
|
19
|
+
var Pantheon_1 = require("../../Pantheon");
|
|
20
|
+
var Effect_1 = require("../Effect");
|
|
4
21
|
exports.Cernunnos = {
|
|
5
|
-
invoke: [{}, { favor: 1 }, { gem: 2 }]
|
|
22
|
+
invoke: [{}, { favor: 1 }, { gem: 2 }],
|
|
23
|
+
effect: {
|
|
24
|
+
trigger: Effect_1.isEndOfGame,
|
|
25
|
+
rule: (function (_super) {
|
|
26
|
+
__extends(CernunnosEffectRule, _super);
|
|
27
|
+
function CernunnosEffectRule() {
|
|
28
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
+
}
|
|
30
|
+
CernunnosEffectRule.prototype.playEffect = function () {
|
|
31
|
+
var _this = this;
|
|
32
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
33
|
+
var gems = pantheon.gems;
|
|
34
|
+
var opponents = this.game.players.filter(function (player) { return player !== _this.player; });
|
|
35
|
+
var beatenOpponents = opponents.filter(function (opponent) { return new Pantheon_1.Pantheon(_this.game, opponent).gems < gems; });
|
|
36
|
+
var gain = beatenOpponents.length === opponents.length ? opponents.length + 2 : beatenOpponents.length;
|
|
37
|
+
return gain ? [pantheon.gainFavor(gain)] : [];
|
|
38
|
+
};
|
|
39
|
+
return CernunnosEffectRule;
|
|
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.Dagda = void 0;
|
|
19
|
+
var Pantheon_1 = require("../../Pantheon");
|
|
20
|
+
var Effect_1 = require("../Effect");
|
|
4
21
|
exports.Dagda = {
|
|
5
|
-
invoke: [{ gem: 2, favor: 1 }, { favor: 2 }, {}]
|
|
22
|
+
invoke: [{ gem: 2, favor: 1 }, { favor: 2 }, {}],
|
|
23
|
+
effect: {
|
|
24
|
+
trigger: function (event, dagda, game) {
|
|
25
|
+
var player = dagda.getItem().location.player;
|
|
26
|
+
switch (event.type) {
|
|
27
|
+
case Effect_1.TriggerEventType.EntitySacrificed:
|
|
28
|
+
case Effect_1.TriggerEventType.EntityCrushed:
|
|
29
|
+
return event.card.location.player === player && new Pantheon_1.Pantheon(game, player).isOpponentOngoingEffect();
|
|
30
|
+
case Effect_1.TriggerEventType.EntitiesMoved:
|
|
31
|
+
return event.player === player && new Pantheon_1.Pantheon(game, player).isOpponentOngoingEffect();
|
|
32
|
+
default:
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
rule: (function (_super) {
|
|
37
|
+
__extends(DagdaEffectRule, _super);
|
|
38
|
+
function DagdaEffectRule() {
|
|
39
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
+
}
|
|
41
|
+
DagdaEffectRule.prototype.playEffect = function () {
|
|
42
|
+
var player = this.card.location.player;
|
|
43
|
+
return [new Pantheon_1.Pantheon(this.game, player).gainFavor(1)];
|
|
44
|
+
};
|
|
45
|
+
return DagdaEffectRule;
|
|
46
|
+
}(Effect_1.AutoEffectRule))
|
|
47
|
+
}
|
|
6
48
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Fairy = void 0;
|
|
4
|
+
var FairyEffectRule_1 = require("../../../rules/effects/FairyEffectRule");
|
|
5
|
+
var Effect_1 = require("../Effect");
|
|
6
|
+
exports.Fairy = {
|
|
7
|
+
invoke: [{ favor: 1 }, { gem: 1 }, {}],
|
|
8
|
+
effect: {
|
|
9
|
+
trigger: Effect_1.isPlaced,
|
|
10
|
+
rule: FairyEffectRule_1.FairyEffectRule
|
|
11
|
+
}
|
|
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.Kelpie = void 0;
|
|
19
|
+
var Pantheon_1 = require("../../Pantheon");
|
|
20
|
+
var Effect_1 = require("../Effect");
|
|
4
21
|
exports.Kelpie = {
|
|
5
|
-
invoke: [{}, { gem: 1, favor: 1 }, { favor: 1 }]
|
|
22
|
+
invoke: [{}, { gem: 1, favor: 1 }, { favor: 1 }],
|
|
23
|
+
effect: {
|
|
24
|
+
trigger: Effect_1.isPlaced,
|
|
25
|
+
rule: (function (_super) {
|
|
26
|
+
__extends(KelpieEffectRule, _super);
|
|
27
|
+
function KelpieEffectRule() {
|
|
28
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
+
}
|
|
30
|
+
KelpieEffectRule.prototype.playEffect = function () {
|
|
31
|
+
var _a = this.card.location, x = _a.x, player = _a.player;
|
|
32
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
33
|
+
return pantheon.grid.every(function (line) { return line[x] !== undefined; }) ? [pantheon.gainGems(2)] : [];
|
|
34
|
+
};
|
|
35
|
+
return KelpieEffectRule;
|
|
36
|
+
}(Effect_1.AutoEffectRule))
|
|
37
|
+
}
|
|
6
38
|
};
|
|
@@ -2,5 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Morrigan = void 0;
|
|
4
4
|
exports.Morrigan = {
|
|
5
|
-
invoke: [{ favor: 1 }, {}, { favor: 2 }]
|
|
5
|
+
invoke: [{ favor: 1 }, {}, { favor: 2 }],
|
|
6
|
+
effect: {
|
|
7
|
+
preventSacrifice: function (card, effectCard) { return card.location.y === effectCard.location.y; },
|
|
8
|
+
preventMove: function (card, effectCard) { return card.location.y === effectCard.location.y; },
|
|
9
|
+
preventCrush: function (card, effectCard) { return card.location.y === effectCard.location.y; }
|
|
10
|
+
}
|
|
6
11
|
};
|
|
@@ -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.
|
|
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);
|
|
@@ -16,21 +16,27 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.Beetle = void 0;
|
|
19
|
+
var Entity_1 = require("../../Entity");
|
|
19
20
|
var Pantheon_1 = require("../../Pantheon");
|
|
20
21
|
var Effect_1 = require("../Effect");
|
|
21
22
|
exports.Beetle = {
|
|
22
23
|
invoke: [{ favor: 1 }, { gem: 1 }, {}],
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
effects: [
|
|
25
|
+
{
|
|
26
|
+
replaceSacrifice: function (card) { return (0, Entity_1.isCreature)(card.id.front); }
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
trigger: Effect_1.isSacrificed,
|
|
30
|
+
rule: (function (_super) {
|
|
31
|
+
__extends(BeetleEffectRule, _super);
|
|
32
|
+
function BeetleEffectRule() {
|
|
33
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
+
}
|
|
35
|
+
BeetleEffectRule.prototype.playEffect = function () {
|
|
36
|
+
return [new Pantheon_1.Pantheon(this.game, this.player).gainGems(2)];
|
|
37
|
+
};
|
|
38
|
+
return BeetleEffectRule;
|
|
39
|
+
}(Effect_1.PlayerEffectRule))
|
|
40
|
+
}
|
|
41
|
+
]
|
|
36
42
|
};
|