@gamepark/mythologies 0.2.0 → 0.3.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.
- package/dist/CustomMoveType.d.ts +2 -1
- package/dist/CustomMoveType.js +1 -0
- package/dist/Memory.d.ts +4 -1
- package/dist/Memory.js +3 -0
- package/dist/MythologiesRules.d.ts +17 -5
- package/dist/MythologiesRules.js +36 -33
- package/dist/material/Mythology.js +1 -1
- package/dist/material/Pantheon.d.ts +6 -1
- package/dist/material/Pantheon.js +61 -25
- package/dist/material/entity/Effect.d.ts +21 -8
- package/dist/material/entity/Effect.js +34 -3
- package/dist/material/entity/EntityDescription.d.ts +0 -2
- package/dist/material/entity/EntityDescription.js +1 -7
- package/dist/material/entity/MoveEffectRule.d.ts +2 -2
- package/dist/material/entity/MoveEffectRule.js +7 -3
- package/dist/material/entity/PlaceCardEffectRule.d.ts +2 -2
- package/dist/material/entity/PlaceCardEffectRule.js +29 -3
- package/dist/material/entity/SacrificeEffectRule.d.ts +1 -1
- package/dist/material/entity/SacrificeEffectRule.js +29 -2
- package/dist/material/entity/SimultaneousSacrificeEffectRule.d.ts +1 -1
- package/dist/material/entity/SimultaneousSacrificeEffectRule.js +29 -2
- package/dist/material/entity/chinese/ChangE.js +39 -1
- package/dist/material/entity/chinese/Fenghuang.js +8 -1
- package/dist/material/entity/chinese/Jiangshi.js +7 -1
- package/dist/material/entity/chinese/Mogwai.js +38 -1
- package/dist/material/entity/chinese/Nian.js +36 -1
- package/dist/material/entity/chinese/Nuwa.js +7 -1
- package/dist/material/entity/chinese/Qilin.js +7 -1
- package/dist/material/entity/chinese/SunWukong.js +36 -1
- package/dist/material/entity/chinese/Tianlong.js +7 -1
- package/dist/material/entity/chinese/YanluoWang.js +7 -1
- package/dist/material/entity/egyptian/Beetle.js +1 -1
- package/dist/material/entity/egyptian/Sphinx.js +1 -1
- package/dist/material/entity/greek/Chimera.js +1 -1
- package/dist/material/entity/greek/Poseidon.js +3 -3
- package/dist/material/entity/norse/Draugr.js +1 -1
- package/dist/material/entity/norse/Jotunn.js +3 -2
- package/dist/rules/PlaceCardsRule.d.ts +3 -1
- package/dist/rules/PlaceCardsRule.js +18 -8
- package/dist/rules/PlaceTokenRule.js +3 -1
- package/dist/rules/RuleId.d.ts +8 -1
- package/dist/rules/RuleId.js +7 -0
- package/dist/rules/effects/AlfEffectRule.js +1 -1
- package/dist/rules/effects/ChimeraEffectRule.d.ts +1 -0
- package/dist/rules/effects/ChimeraEffectRule.js +4 -0
- package/dist/rules/effects/CondorEffectRule.d.ts +2 -2
- package/dist/rules/effects/CondorEffectRule.js +3 -7
- package/dist/rules/effects/DraugrEffectRule.d.ts +2 -1
- package/dist/rules/effects/DraugrEffectRule.js +8 -1
- package/dist/rules/effects/FenghuangEffectRule.d.ts +8 -0
- package/dist/rules/effects/FenghuangEffectRule.js +48 -0
- package/dist/rules/effects/HadesEffectRule.js +2 -12
- package/dist/rules/effects/JiangshiEffectRule.d.ts +8 -0
- package/dist/rules/effects/JiangshiEffectRule.js +76 -0
- package/dist/rules/effects/KinnaraEffectRule.js +7 -2
- package/dist/rules/effects/NuwaEffectRule.d.ts +12 -0
- package/dist/rules/effects/NuwaEffectRule.js +97 -0
- package/dist/rules/effects/QilinEffectRule.d.ts +8 -0
- package/dist/rules/effects/QilinEffectRule.js +113 -0
- package/dist/rules/effects/RaEffectRule.js +2 -12
- package/dist/rules/effects/ResolveEffectsRule.d.ts +2 -0
- package/dist/rules/effects/ResolveEffectsRule.js +17 -14
- package/dist/rules/effects/ShivaEffectRule.d.ts +1 -1
- package/dist/rules/effects/ShivaEffectRule.js +5 -2
- package/dist/rules/effects/SphinxEffectRule.js +2 -6
- package/dist/rules/effects/ThorEffectRule.d.ts +1 -1
- package/dist/rules/effects/ThorEffectRule.js +3 -1
- package/dist/rules/effects/TianlongEffectRule.d.ts +17 -0
- package/dist/rules/effects/TianlongEffectRule.js +148 -0
- package/dist/rules/effects/TriggerEffectsRule.js +4 -5
- package/dist/rules/effects/YanluoWangEffectRule.d.ts +9 -0
- package/dist/rules/effects/YanluoWangEffectRule.js +104 -0
- package/package.json +2 -2
|
@@ -17,6 +17,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.MoveEffectRule = void 0;
|
|
19
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
20
21
|
var LocationType_1 = require("../LocationType");
|
|
21
22
|
var MaterialType_1 = require("../MaterialType");
|
|
22
23
|
var Pantheon_1 = require("../Pantheon");
|
|
@@ -73,9 +74,12 @@ var MoveEffectRule = (function (_super) {
|
|
|
73
74
|
MoveEffectRule.prototype.onCardMoved = function (_move) {
|
|
74
75
|
return this.endEffect();
|
|
75
76
|
};
|
|
76
|
-
MoveEffectRule.prototype.
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
MoveEffectRule.prototype.onCustomMove = function (move) {
|
|
78
|
+
if (move.type === CustomMoveType_1.CustomMoveType.EndEffect) {
|
|
79
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
80
|
+
return pantheon.updateGrid();
|
|
81
|
+
}
|
|
82
|
+
return [];
|
|
79
83
|
};
|
|
80
84
|
return MoveEffectRule;
|
|
81
85
|
}(Effect_1.PlayerEffectRule));
|
|
@@ -6,8 +6,8 @@ export declare abstract class PlaceCardEffectRule extends PlayerEffectRule {
|
|
|
6
6
|
getPlayerMoves(cardIndex?: number): MaterialMove[];
|
|
7
7
|
abstract getCardsToPlace(cardIndex: number): Material;
|
|
8
8
|
getAvailableDestinations(_cardIndex: number): XYCoordinates[];
|
|
9
|
-
|
|
10
|
-
onCardPlaced(
|
|
9
|
+
beforeItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
|
|
10
|
+
onCardPlaced(move: MoveItem): MaterialMove[];
|
|
11
11
|
}
|
|
12
12
|
export declare abstract class InvokeEffectRule extends PlaceCardEffectRule {
|
|
13
13
|
isInvoke: boolean;
|
|
@@ -14,6 +14,31 @@ 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.InvokeEffectRule = exports.PlaceCardEffectRule = void 0;
|
|
19
44
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
@@ -48,14 +73,15 @@ var PlaceCardEffectRule = (function (_super) {
|
|
|
48
73
|
PlaceCardEffectRule.prototype.getAvailableDestinations = function (_cardIndex) {
|
|
49
74
|
return new Pantheon_1.Pantheon(this.game, this.player).legalSpaces;
|
|
50
75
|
};
|
|
51
|
-
PlaceCardEffectRule.prototype.
|
|
76
|
+
PlaceCardEffectRule.prototype.beforeItemMove = function (move) {
|
|
52
77
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.Pantheon) {
|
|
53
78
|
return this.onCardPlaced(move);
|
|
54
79
|
}
|
|
55
80
|
return [];
|
|
56
81
|
};
|
|
57
|
-
PlaceCardEffectRule.prototype.onCardPlaced = function (
|
|
58
|
-
|
|
82
|
+
PlaceCardEffectRule.prototype.onCardPlaced = function (move) {
|
|
83
|
+
var _a;
|
|
84
|
+
return (_a = new Pantheon_1.Pantheon(this.game, this.player).onCardPlaced(move)).concat.apply(_a, __spreadArray([], __read(this.endEffect()), false));
|
|
59
85
|
};
|
|
60
86
|
return PlaceCardEffectRule;
|
|
61
87
|
}(Effect_1.PlayerEffectRule));
|
|
@@ -5,6 +5,6 @@ export declare abstract class SacrificeEffectRule extends PlayerEffectRule {
|
|
|
5
5
|
playEffect(): MaterialMove[];
|
|
6
6
|
getPlayerMoves(): MoveItem<number, number, number>[];
|
|
7
7
|
getCardsToSacrifice(): Material;
|
|
8
|
-
|
|
8
|
+
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
9
9
|
onSacrifice(_move: MoveItem): MaterialMove<number, number, number, number>[];
|
|
10
10
|
}
|
|
@@ -14,6 +14,31 @@ 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.SacrificeEffectRule = void 0;
|
|
19
44
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
@@ -47,9 +72,11 @@ var SacrificeEffectRule = (function (_super) {
|
|
|
47
72
|
SacrificeEffectRule.prototype.getCardsToSacrifice = function () {
|
|
48
73
|
return new Pantheon_1.Pantheon(this.game, this.player).visibleEntities;
|
|
49
74
|
};
|
|
50
|
-
SacrificeEffectRule.prototype.
|
|
75
|
+
SacrificeEffectRule.prototype.beforeItemMove = function (move) {
|
|
76
|
+
var _a;
|
|
51
77
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
52
|
-
|
|
78
|
+
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
|
|
79
|
+
return (_a = new Pantheon_1.Pantheon(this.game, this.player).onEntitySacrificed(card)).concat.apply(_a, __spreadArray([], __read(this.onSacrifice(move)), false));
|
|
53
80
|
}
|
|
54
81
|
return [];
|
|
55
82
|
};
|
|
@@ -5,6 +5,6 @@ export declare abstract class SimultaneousSacrificeEffectRule extends Simultaneo
|
|
|
5
5
|
getAffectedPlayers(): PlayerColor[];
|
|
6
6
|
getActivePlayerLegalMoves(player: PlayerColor): MaterialMove[];
|
|
7
7
|
getCardsToSacrifice(player: PlayerColor): Material;
|
|
8
|
-
|
|
8
|
+
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
9
9
|
onSacrifice(move: MoveItem): import("@gamepark/rules-api").EndPlayerTurn<number>[];
|
|
10
10
|
}
|
|
@@ -14,6 +14,31 @@ 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.SimultaneousSacrificeEffectRule = void 0;
|
|
19
44
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
@@ -43,9 +68,11 @@ var SimultaneousSacrificeEffectRule = (function (_super) {
|
|
|
43
68
|
SimultaneousSacrificeEffectRule.prototype.getCardsToSacrifice = function (player) {
|
|
44
69
|
return new Pantheon_1.Pantheon(this.game, player).visibleEntities;
|
|
45
70
|
};
|
|
46
|
-
SimultaneousSacrificeEffectRule.prototype.
|
|
71
|
+
SimultaneousSacrificeEffectRule.prototype.beforeItemMove = function (move) {
|
|
72
|
+
var _a;
|
|
47
73
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
48
|
-
|
|
74
|
+
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
|
|
75
|
+
return (_a = new Pantheon_1.Pantheon(this.game, move.location.player).onEntitySacrificed(card)).concat.apply(_a, __spreadArray([], __read(this.onSacrifice(move)), false));
|
|
49
76
|
}
|
|
50
77
|
return [];
|
|
51
78
|
};
|
|
@@ -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.ChangE = void 0;
|
|
19
|
+
var LocationType_1 = require("../../LocationType");
|
|
20
|
+
var MaterialType_1 = require("../../MaterialType");
|
|
21
|
+
var Effect_1 = require("../Effect");
|
|
4
22
|
exports.ChangE = {
|
|
5
|
-
invoke: [{ gem: 1, favor: 2 }, { gem: 2 }, {}]
|
|
23
|
+
invoke: [{ gem: 1, favor: 2 }, { gem: 2 }, {}],
|
|
24
|
+
effect: {
|
|
25
|
+
trigger: function (event, card) {
|
|
26
|
+
return (event.type === Effect_1.TriggerEventType.EntityInvoked &&
|
|
27
|
+
card.getItem().location.player !== event.cardLocation.player &&
|
|
28
|
+
card.getItem().location.y === event.cardLocation.y);
|
|
29
|
+
},
|
|
30
|
+
rule: (function (_super) {
|
|
31
|
+
__extends(ChangeEEffectRule, _super);
|
|
32
|
+
function ChangeEEffectRule() {
|
|
33
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
+
}
|
|
35
|
+
ChangeEEffectRule.prototype.playEffect = function () {
|
|
36
|
+
var playerInvoked = this.getEffect().triggerEvent.cardLocation.player;
|
|
37
|
+
var gems = this.material(MaterialType_1.MaterialType.GemToken).location(LocationType_1.LocationType.PlayerGems).player(playerInvoked);
|
|
38
|
+
return gems.getQuantity() > 0 ? [gems.moveItem({ type: LocationType_1.LocationType.PlayerGems, player: this.player }, 1)] : [];
|
|
39
|
+
};
|
|
40
|
+
return ChangeEEffectRule;
|
|
41
|
+
}(Effect_1.AutoEffectRule)),
|
|
42
|
+
auto: true
|
|
43
|
+
}
|
|
6
44
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Fenghuang = void 0;
|
|
4
|
+
var FenghuangEffectRule_1 = require("../../../rules/effects/FenghuangEffectRule");
|
|
5
|
+
var PlaceCardsRule_1 = require("../../../rules/PlaceCardsRule");
|
|
6
|
+
var Effect_1 = require("../Effect");
|
|
4
7
|
exports.Fenghuang = {
|
|
5
|
-
invoke: [{ favor: 1 }, {}, { gem: 1 }]
|
|
8
|
+
invoke: [{ favor: 1 }, {}, { gem: 1 }],
|
|
9
|
+
effect: {
|
|
10
|
+
trigger: function (event, card, game) { return ((0, Effect_1.isCrushed)(event, card) || (0, Effect_1.isSacrificed)(event, card)) && new PlaceCardsRule_1.PlaceCardsRule(game).isOncePerTurnAvailable(card.getIndex()); },
|
|
11
|
+
rule: FenghuangEffectRule_1.FenghuangEffectRule
|
|
12
|
+
}
|
|
6
13
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Jiangshi = void 0;
|
|
4
|
+
var JiangshiEffectRule_1 = require("../../../rules/effects/JiangshiEffectRule");
|
|
5
|
+
var Effect_1 = require("../Effect");
|
|
4
6
|
exports.Jiangshi = {
|
|
5
|
-
invoke: [{ gem: 1 }, {}, { favor: 1 }]
|
|
7
|
+
invoke: [{ gem: 1 }, {}, { favor: 1 }],
|
|
8
|
+
effect: {
|
|
9
|
+
trigger: Effect_1.isPlaced,
|
|
10
|
+
rule: JiangshiEffectRule_1.JiangshiEffectRule
|
|
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.Mogwai = void 0;
|
|
19
|
+
var Pantheon_1 = require("../../Pantheon");
|
|
20
|
+
var Effect_1 = require("../Effect");
|
|
4
21
|
exports.Mogwai = {
|
|
5
|
-
invoke: [{}, { favor: 1 }, { gem: 1 }]
|
|
22
|
+
invoke: [{}, { favor: 1 }, { gem: 1 }],
|
|
23
|
+
effect: {
|
|
24
|
+
trigger: function (event, card) {
|
|
25
|
+
var mogwai = card.getItem();
|
|
26
|
+
return ((event.type === Effect_1.TriggerEventType.LineEvent && event.eventType === Effect_1.LineEventType.Completed && mogwai.location.y === event.y) ||
|
|
27
|
+
(event.type === Effect_1.TriggerEventType.ColumnEvent && event.eventType === Effect_1.LineEventType.Completed && mogwai.location.x === event.x));
|
|
28
|
+
},
|
|
29
|
+
rule: (function (_super) {
|
|
30
|
+
__extends(MogwaiEffectRule, _super);
|
|
31
|
+
function MogwaiEffectRule() {
|
|
32
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
+
}
|
|
34
|
+
MogwaiEffectRule.prototype.playEffect = function () {
|
|
35
|
+
var player = this.getEffect().triggerEvent.player;
|
|
36
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
37
|
+
return [player === this.card.location.player ? pantheon.gainFavor(1) : pantheon.gainGems(1)];
|
|
38
|
+
};
|
|
39
|
+
return MogwaiEffectRule;
|
|
40
|
+
}(Effect_1.AutoEffectRule)),
|
|
41
|
+
auto: true
|
|
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.Nian = void 0;
|
|
19
|
+
var lodash_1 = require("lodash");
|
|
20
|
+
var Pantheon_1 = require("../../Pantheon");
|
|
21
|
+
var Effect_1 = require("../Effect");
|
|
4
22
|
exports.Nian = {
|
|
5
|
-
invoke: [{}, { favor: 1 }, { gem: 1, favor: 1 }]
|
|
23
|
+
invoke: [{}, { favor: 1 }, { gem: 1, favor: 1 }],
|
|
24
|
+
effect: {
|
|
25
|
+
trigger: Effect_1.isPlaced,
|
|
26
|
+
rule: (function (_super) {
|
|
27
|
+
__extends(NianEffectRule, _super);
|
|
28
|
+
function NianEffectRule() {
|
|
29
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
30
|
+
}
|
|
31
|
+
NianEffectRule.prototype.playEffect = function () {
|
|
32
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
33
|
+
var coveredEntities = pantheon.coveredEntities.getItems();
|
|
34
|
+
var lines = (0, lodash_1.uniq)(coveredEntities.map(function (item) { return item.location.y; }));
|
|
35
|
+
var columns = (0, lodash_1.uniq)(coveredEntities.map(function (item) { return item.location.x; }));
|
|
36
|
+
return lines.flatMap(function (y) { return pantheon.gainLineBonus(y); }).concat(columns.flatMap(function (x) { return pantheon.gainColumnBonus(x); }));
|
|
37
|
+
};
|
|
38
|
+
return NianEffectRule;
|
|
39
|
+
}(Effect_1.PlayerEffectRule))
|
|
40
|
+
}
|
|
6
41
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Nuwa = void 0;
|
|
4
|
+
var NuwaEffectRule_1 = require("../../../rules/effects/NuwaEffectRule");
|
|
5
|
+
var Effect_1 = require("../Effect");
|
|
4
6
|
exports.Nuwa = {
|
|
5
|
-
invoke: [{ favor: 1 }, { favor: 1 }, {}]
|
|
7
|
+
invoke: [{ favor: 1 }, { favor: 1 }, {}],
|
|
8
|
+
effect: {
|
|
9
|
+
trigger: Effect_1.isPlaced,
|
|
10
|
+
rule: NuwaEffectRule_1.NuwaEffectRule
|
|
11
|
+
}
|
|
6
12
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Qilin = void 0;
|
|
4
|
+
var QilinEffectRule_1 = require("../../../rules/effects/QilinEffectRule");
|
|
5
|
+
var Effect_1 = require("../Effect");
|
|
4
6
|
exports.Qilin = {
|
|
5
|
-
invoke: [{}, { gem: 1 }, { favor: 1 }]
|
|
7
|
+
invoke: [{}, { gem: 1 }, { favor: 1 }],
|
|
8
|
+
effect: {
|
|
9
|
+
trigger: Effect_1.isPlaced,
|
|
10
|
+
rule: QilinEffectRule_1.QilinEffectRule
|
|
11
|
+
}
|
|
6
12
|
};
|
|
@@ -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.SunWukong = void 0;
|
|
19
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var Pantheon_1 = require("../../Pantheon");
|
|
21
|
+
var Effect_1 = require("../Effect");
|
|
4
22
|
exports.SunWukong = {
|
|
5
|
-
invoke: [{ gem: 1 }, { favor: 2 }, { gem: 1 }]
|
|
23
|
+
invoke: [{ gem: 1 }, { favor: 2 }, { gem: 1 }],
|
|
24
|
+
effect: {
|
|
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);
|
|
27
|
+
},
|
|
28
|
+
rule: (function (_super) {
|
|
29
|
+
__extends(SunWukongEffectRule, _super);
|
|
30
|
+
function SunWukongEffectRule() {
|
|
31
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
32
|
+
}
|
|
33
|
+
SunWukongEffectRule.prototype.playEffect = function () {
|
|
34
|
+
var player = this.card.location.player;
|
|
35
|
+
return [new Pantheon_1.Pantheon(this.game, player).gainFavor(1)];
|
|
36
|
+
};
|
|
37
|
+
return SunWukongEffectRule;
|
|
38
|
+
}(Effect_1.AutoEffectRule)),
|
|
39
|
+
auto: true
|
|
40
|
+
}
|
|
6
41
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Tianlong = void 0;
|
|
4
|
+
var TianlongEffectRule_1 = require("../../../rules/effects/TianlongEffectRule");
|
|
5
|
+
var Effect_1 = require("../Effect");
|
|
4
6
|
exports.Tianlong = {
|
|
5
|
-
invoke: [{ gem: 2 }, { favor: 1 }, {}]
|
|
7
|
+
invoke: [{ gem: 2 }, { favor: 1 }, {}],
|
|
8
|
+
effect: {
|
|
9
|
+
trigger: Effect_1.isPlaced,
|
|
10
|
+
rule: TianlongEffectRule_1.TianlongEffectRule
|
|
11
|
+
}
|
|
6
12
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.YanluoWang = void 0;
|
|
4
|
+
var YanluoWangEffectRule_1 = require("../../../rules/effects/YanluoWangEffectRule");
|
|
5
|
+
var Effect_1 = require("../Effect");
|
|
4
6
|
exports.YanluoWang = {
|
|
5
|
-
invoke: [{}, {}, { favor: 2 }]
|
|
7
|
+
invoke: [{}, {}, { favor: 2 }],
|
|
8
|
+
effect: {
|
|
9
|
+
trigger: Effect_1.isEndOfGame,
|
|
10
|
+
rule: YanluoWangEffectRule_1.YanluoWangEffectRule
|
|
11
|
+
}
|
|
6
12
|
};
|
|
@@ -21,7 +21,7 @@ var Effect_1 = require("../Effect");
|
|
|
21
21
|
exports.Beetle = {
|
|
22
22
|
invoke: [{ favor: 1 }, { gem: 1 }, {}],
|
|
23
23
|
effect: {
|
|
24
|
-
trigger:
|
|
24
|
+
trigger: Effect_1.isSacrificed,
|
|
25
25
|
rule: (function (_super) {
|
|
26
26
|
__extends(BeetleEffectRule, _super);
|
|
27
27
|
function BeetleEffectRule() {
|
|
@@ -25,7 +25,7 @@ exports.Poseidon = {
|
|
|
25
25
|
invoke: [{ gem: 1 }, { gem: 2, favor: 1 }, { favor: 1 }],
|
|
26
26
|
effect: {
|
|
27
27
|
trigger: function (event, card) {
|
|
28
|
-
return event.type === Effect_1.TriggerEventType.EntityInvoked && (0, Entity_1.isGod)(event.
|
|
28
|
+
return event.type === Effect_1.TriggerEventType.EntityInvoked && (0, Entity_1.isGod)(event.entity) && event.cardLocation.player === card.getItem().location.player;
|
|
29
29
|
},
|
|
30
30
|
rule: (function (_super) {
|
|
31
31
|
__extends(PoseidonEffectRule, _super);
|
|
@@ -33,9 +33,9 @@ exports.Poseidon = {
|
|
|
33
33
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
34
|
}
|
|
35
35
|
PoseidonEffectRule.prototype.playEffect = function () {
|
|
36
|
-
var
|
|
36
|
+
var cardLocation = this.remind(Memory_1.Memory.OngoingEffect).triggerEvent.cardLocation;
|
|
37
37
|
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
38
|
-
var gain = pantheon.visibleEntities.location(function (l) { return (0, rules_api_1.areAdjacentSquares)(l,
|
|
38
|
+
var gain = pantheon.visibleEntities.location(function (l) { return (0, rules_api_1.areAdjacentSquares)(l, cardLocation); }).length;
|
|
39
39
|
return gain > 0 ? [pantheon.gainFavor(gain)] : [];
|
|
40
40
|
};
|
|
41
41
|
return PoseidonEffectRule;
|
|
@@ -21,14 +21,15 @@ var Effect_1 = require("../Effect");
|
|
|
21
21
|
exports.Jotunn = {
|
|
22
22
|
invoke: [{ gem: 1 }, { gem: 1 }, {}],
|
|
23
23
|
effect: {
|
|
24
|
-
trigger: Effect_1.
|
|
24
|
+
trigger: Effect_1.isPlaced,
|
|
25
25
|
rule: (function (_super) {
|
|
26
26
|
__extends(JotunnEffectRule, _super);
|
|
27
27
|
function JotunnEffectRule() {
|
|
28
28
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
29
29
|
}
|
|
30
30
|
JotunnEffectRule.prototype.playEffect = function () {
|
|
31
|
-
|
|
31
|
+
var player = this.card.location.player;
|
|
32
|
+
return new Pantheon_1.Pantheon(this.game, player).hasCrushed(this.card) ? [new Pantheon_1.Pantheon(this.game, this.player).gainGems(2)] : [];
|
|
32
33
|
};
|
|
33
34
|
return JotunnEffectRule;
|
|
34
35
|
}(Effect_1.PlayerEffectRule))
|
|
@@ -4,8 +4,10 @@ export declare class PlaceCardsRule extends PlayerTurnRule {
|
|
|
4
4
|
isInvoke: boolean;
|
|
5
5
|
getPlayerMoves(): MaterialMove<number, number, number, number>[];
|
|
6
6
|
get infiniteEffects(): import("../material/entity/Effect").PendingEffect<import("../material/entity/Effect").TriggerEvent>[];
|
|
7
|
+
isOncePerTurnAvailable(cardIndex: number): boolean;
|
|
7
8
|
get tokens(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
|
-
|
|
9
|
+
beforeItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
|
|
10
|
+
afterItemMove(move: ItemMove): import("@gamepark/rules-api").Shuffle<number>[];
|
|
9
11
|
onCustomMove(move: CustomMove): MaterialMove<number, number, number, number>[];
|
|
10
12
|
onPass(): MaterialMove<number, number, number, number>[];
|
|
11
13
|
get nextRule(): import("@gamepark/rules-api").StartPlayerTurn<number, RuleId.PlaceCards> | import("@gamepark/rules-api").StartPlayerTurn<number, RuleId.Upkeep> | import("@gamepark/rules-api").StartPlayerTurn<number, RuleId.EndGame>;
|
|
@@ -103,21 +103,25 @@ var PlaceCardsRule = (function (_super) {
|
|
|
103
103
|
Object.defineProperty(PlaceCardsRule.prototype, "infiniteEffects", {
|
|
104
104
|
get: function () {
|
|
105
105
|
var _this = this;
|
|
106
|
-
var _a
|
|
106
|
+
var _a;
|
|
107
107
|
var pendingRule = (_a = this.remind(Memory_1.Memory.PendingRule)) !== null && _a !== void 0 ? _a : this.game.rule;
|
|
108
108
|
if ((pendingRule === null || pendingRule === void 0 ? void 0 : pendingRule.id) !== RuleId_1.RuleId.PlaceCards || pendingRule.player !== this.player)
|
|
109
109
|
return [];
|
|
110
110
|
var pendingEffect = new TriggerEffectsRule_1.TriggerEffectsRule(this.game).getPlayerEffects(this.player, { type: Effect_1.TriggerEventType.Infinite });
|
|
111
|
-
var oncePerTurnUsed = (_b = this.remind(Memory_1.Memory.OncePerTurn)) !== null && _b !== void 0 ? _b : [];
|
|
112
111
|
return pendingEffect.filter(function (pendingEffect) {
|
|
113
112
|
var card = _this.material(MaterialType_1.MaterialType.EntityCard).getItem(pendingEffect.cardIndex);
|
|
114
|
-
var effect =
|
|
115
|
-
return
|
|
113
|
+
var effect = EntityDescription_1.entities[card.id.front].effect;
|
|
114
|
+
return _this.isOncePerTurnAvailable(pendingEffect.cardIndex) && new effect.rule(_this.game).canPlayEffect(pendingEffect.cardIndex);
|
|
116
115
|
});
|
|
117
116
|
},
|
|
118
117
|
enumerable: false,
|
|
119
118
|
configurable: true
|
|
120
119
|
});
|
|
120
|
+
PlaceCardsRule.prototype.isOncePerTurnAvailable = function (cardIndex) {
|
|
121
|
+
var _a;
|
|
122
|
+
var oncePerTurnUsed = (_a = this.remind(Memory_1.Memory.OncePerTurn)) !== null && _a !== void 0 ? _a : [];
|
|
123
|
+
return !oncePerTurnUsed.includes(cardIndex);
|
|
124
|
+
};
|
|
121
125
|
Object.defineProperty(PlaceCardsRule.prototype, "tokens", {
|
|
122
126
|
get: function () {
|
|
123
127
|
var _this = this;
|
|
@@ -128,7 +132,7 @@ var PlaceCardsRule = (function (_super) {
|
|
|
128
132
|
enumerable: false,
|
|
129
133
|
configurable: true
|
|
130
134
|
});
|
|
131
|
-
PlaceCardsRule.prototype.
|
|
135
|
+
PlaceCardsRule.prototype.beforeItemMove = function (move) {
|
|
132
136
|
var moves = [];
|
|
133
137
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move)) {
|
|
134
138
|
var token = this.tokens.parent(move.itemIndex);
|
|
@@ -138,13 +142,19 @@ var PlaceCardsRule = (function (_super) {
|
|
|
138
142
|
if (move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
139
143
|
moves.push(pantheon.gainGems(2));
|
|
140
144
|
}
|
|
145
|
+
else if (move.location.type === LocationType_1.LocationType.Pantheon) {
|
|
146
|
+
moves.push.apply(moves, __spreadArray([], __read(pantheon.onCardPlaced(move)), false));
|
|
147
|
+
}
|
|
141
148
|
}
|
|
142
149
|
}
|
|
143
|
-
else if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.DraftToken)(move) && this.tokens.length === 0) {
|
|
144
|
-
moves.push(this.material(MaterialType_1.MaterialType.DraftToken).location(LocationType_1.LocationType.PlayerHand).player(this.player).shuffle());
|
|
145
|
-
}
|
|
146
150
|
return moves;
|
|
147
151
|
};
|
|
152
|
+
PlaceCardsRule.prototype.afterItemMove = function (move) {
|
|
153
|
+
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.DraftToken)(move) && this.tokens.length === 0) {
|
|
154
|
+
return [this.material(MaterialType_1.MaterialType.DraftToken).location(LocationType_1.LocationType.PlayerHand).player(this.player).shuffle()];
|
|
155
|
+
}
|
|
156
|
+
return [];
|
|
157
|
+
};
|
|
148
158
|
PlaceCardsRule.prototype.onCustomMove = function (move) {
|
|
149
159
|
if (move.type === CustomMoveType_1.CustomMoveType.Pass) {
|
|
150
160
|
return this.onPass();
|
|
@@ -75,6 +75,9 @@ var PlaceTokenRule = (function (_super) {
|
|
|
75
75
|
if (legalMoves.length === 1) {
|
|
76
76
|
moves.push(legalMoves[0]);
|
|
77
77
|
}
|
|
78
|
+
else {
|
|
79
|
+
this.memorize(Memory_1.Memory.KeepTokenPlaceSecret, true, player);
|
|
80
|
+
}
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -112,7 +115,6 @@ var PlaceTokenRule = (function (_super) {
|
|
|
112
115
|
PlaceTokenRule.prototype.afterItemMove = function (move) {
|
|
113
116
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.DraftToken)(move)) {
|
|
114
117
|
var player = this.material(MaterialType_1.MaterialType.DraftToken).getItem(move.itemIndex).id.back;
|
|
115
|
-
this.memorize(Memory_1.Memory.KeepTokenPlaceSecret, true, player);
|
|
116
118
|
return [this.endPlayerTurn(player)];
|
|
117
119
|
}
|
|
118
120
|
return [];
|