@gamepark/mythologies 0.4.0 → 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 +2 -1
- package/dist/Memory.js +1 -0
- package/dist/MythologiesRules.d.ts +2 -0
- package/dist/MythologiesRules.js +2 -0
- package/dist/material/Entity.d.ts +5 -1
- package/dist/material/Entity.js +1 -1
- package/dist/material/Pantheon.d.ts +10 -6
- package/dist/material/Pantheon.js +92 -48
- package/dist/material/entity/Effect.d.ts +18 -10
- package/dist/material/entity/Effect.js +3 -1
- 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/egyptian/Beetle.js +19 -13
- package/dist/material/entity/hindu/Naga.js +36 -30
- package/dist/material/entity/norse/Troll.js +4 -1
- package/dist/material/entity/zulu/Tokoloshe.js +22 -17
- package/dist/rules/PlaceCardsRule.js +3 -2
- package/dist/rules/RuleId.d.ts +2 -1
- package/dist/rules/RuleId.js +1 -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/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/package.json +2 -2
|
@@ -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
|
};
|
|
@@ -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
|
};
|
|
@@ -27,42 +27,48 @@ var __values = (this && this.__values) || function(o) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.Naga = void 0;
|
|
30
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
30
31
|
var LocationType_1 = require("../../LocationType");
|
|
31
32
|
var MaterialType_1 = require("../../MaterialType");
|
|
32
33
|
var Effect_1 = require("../Effect");
|
|
33
34
|
exports.Naga = {
|
|
34
35
|
invoke: [{}, { gem: 2 }, { gem: 1 }],
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var moves = [];
|
|
46
|
-
var opponents = this.game.players.filter(function (player) { return player !== _this.player; });
|
|
47
|
-
try {
|
|
48
|
-
for (var opponents_1 = __values(opponents), opponents_1_1 = opponents_1.next(); !opponents_1_1.done; opponents_1_1 = opponents_1.next()) {
|
|
49
|
-
var opponent = opponents_1_1.value;
|
|
50
|
-
var favor = this.material(MaterialType_1.MaterialType.FavorToken).location(LocationType_1.LocationType.PlayerFavor).player(opponent);
|
|
51
|
-
if (favor.getQuantity()) {
|
|
52
|
-
moves.push(favor.deleteItem(1));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
36
|
+
effects: [
|
|
37
|
+
{
|
|
38
|
+
preventMove: function (card, naga) { return naga.location.player === card.location.player && (0, rules_api_1.areAdjacentSquares)(naga.location, card.location); }
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
trigger: Effect_1.isCrushed,
|
|
42
|
+
rule: (function (_super) {
|
|
43
|
+
__extends(NagaEffectRule, _super);
|
|
44
|
+
function NagaEffectRule() {
|
|
45
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
55
46
|
}
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
NagaEffectRule.prototype.playEffect = function () {
|
|
48
|
+
var e_1, _a;
|
|
49
|
+
var _this = this;
|
|
50
|
+
var moves = [];
|
|
51
|
+
var opponents = this.game.players.filter(function (player) { return player !== _this.player; });
|
|
58
52
|
try {
|
|
59
|
-
|
|
53
|
+
for (var opponents_1 = __values(opponents), opponents_1_1 = opponents_1.next(); !opponents_1_1.done; opponents_1_1 = opponents_1.next()) {
|
|
54
|
+
var opponent = opponents_1_1.value;
|
|
55
|
+
var favor = this.material(MaterialType_1.MaterialType.FavorToken).location(LocationType_1.LocationType.PlayerFavor).player(opponent);
|
|
56
|
+
if (favor.getQuantity()) {
|
|
57
|
+
moves.push(favor.deleteItem(1));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
62
|
+
finally {
|
|
63
|
+
try {
|
|
64
|
+
if (opponents_1_1 && !opponents_1_1.done && (_a = opponents_1.return)) _a.call(opponents_1);
|
|
65
|
+
}
|
|
66
|
+
finally { if (e_1) throw e_1.error; }
|
|
67
|
+
}
|
|
68
|
+
return moves;
|
|
69
|
+
};
|
|
70
|
+
return NagaEffectRule;
|
|
71
|
+
}(Effect_1.PlayerEffectRule))
|
|
72
|
+
}
|
|
73
|
+
]
|
|
68
74
|
};
|
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Troll = void 0;
|
|
4
4
|
exports.Troll = {
|
|
5
|
-
invoke: [{}, { gem: 1 }, { favor: 1 }]
|
|
5
|
+
invoke: [{}, { gem: 1 }, { favor: 1 }],
|
|
6
|
+
effect: {
|
|
7
|
+
favorTax: function (space, troll) { return (space.x === troll.location.x && space.y === troll.location.y ? 1 : 0); }
|
|
8
|
+
}
|
|
6
9
|
};
|
|
@@ -21,21 +21,26 @@ var Pantheon_1 = require("../../Pantheon");
|
|
|
21
21
|
var Effect_1 = require("../Effect");
|
|
22
22
|
exports.Tokoloshe = {
|
|
23
23
|
invoke: [{}, { gem: 3 }, { favor: 2 }],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
effects: [
|
|
25
|
+
{
|
|
26
|
+
trigger: Effect_1.isEndOfMyTurn,
|
|
27
|
+
rule: (function (_super) {
|
|
28
|
+
__extends(TokolosheEffectRule, _super);
|
|
29
|
+
function TokolosheEffectRule() {
|
|
30
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
+
}
|
|
32
|
+
TokolosheEffectRule.prototype.playEffect = function () {
|
|
33
|
+
var _a = this.card.location, x = _a.x, y = _a.y, player = _a.player;
|
|
34
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
35
|
+
var creatures = pantheon.visibleEntities.location(function (l) { return l.y === y && l.x !== x; }).id(function (id) { return (0, Entity_1.isCreature)(id.front); });
|
|
36
|
+
var loss = Math.min(pantheon.favor, creatures.length);
|
|
37
|
+
return loss ? [pantheon.loseFavor(loss)] : [];
|
|
38
|
+
};
|
|
39
|
+
return TokolosheEffectRule;
|
|
40
|
+
}(Effect_1.AutoEffectRule))
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
preventCrush: function (card) { return card.id.front === Entity_1.Entity.Tokoloshe; }
|
|
44
|
+
}
|
|
45
|
+
]
|
|
41
46
|
};
|
|
@@ -110,8 +110,9 @@ var PlaceCardsRule = (function (_super) {
|
|
|
110
110
|
var pendingEffect = new TriggerEffectsRule_1.TriggerEffectsRule(this.game).getPlayerEffects(this.player, { type: Effect_1.TriggerEventType.Infinite });
|
|
111
111
|
return pendingEffect.filter(function (pendingEffect) {
|
|
112
112
|
var card = _this.material(MaterialType_1.MaterialType.EntityCard).getItem(pendingEffect.cardIndex);
|
|
113
|
-
var effect = EntityDescription_1.
|
|
114
|
-
|
|
113
|
+
var effect = (0, EntityDescription_1.getEffects)(card.id.front)[pendingEffect.effectIndex];
|
|
114
|
+
var canPlayEffect = (0, Effect_1.isTriggeredEffect)(effect) && new effect.rule(_this.game).canPlayEffect(pendingEffect.cardIndex);
|
|
115
|
+
return canPlayEffect && _this.isOncePerTurnAvailable(pendingEffect.cardIndex);
|
|
115
116
|
});
|
|
116
117
|
},
|
|
117
118
|
enumerable: false,
|