@gamepark/mythologies 0.2.1 → 0.3.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/CustomMoveType.d.ts +2 -1
- package/dist/CustomMoveType.js +1 -0
- package/dist/Memory.d.ts +9 -8
- package/dist/Memory.js +8 -7
- package/dist/MythologiesRules.d.ts +17 -6
- package/dist/MythologiesRules.js +43 -34
- package/dist/material/Mythology.js +1 -1
- package/dist/material/Pantheon.d.ts +6 -1
- package/dist/material/Pantheon.js +59 -24
- 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/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/ChooseDraftTokenRule.js +1 -1
- package/dist/rules/PlaceCardsRule.d.ts +3 -1
- package/dist/rules/PlaceCardsRule.js +18 -8
- package/dist/rules/PlaceTokenRule.d.ts +0 -1
- package/dist/rules/PlaceTokenRule.js +1 -6
- package/dist/rules/RuleId.d.ts +7 -1
- package/dist/rules/RuleId.js +6 -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/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/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/SupayEffectRule.d.ts +1 -0
- package/dist/rules/effects/SupayEffectRule.js +3 -0
- 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/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.entities =
|
|
4
|
+
exports.entities = 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");
|
|
@@ -83,12 +83,6 @@ 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
|
-
function getEffects(entity) {
|
|
87
|
-
var _a;
|
|
88
|
-
var description = exports.entities[entity];
|
|
89
|
-
return (_a = description.effects) !== null && _a !== void 0 ? _a : (description.effect ? [description.effect] : []);
|
|
90
|
-
}
|
|
91
|
-
exports.getEffects = getEffects;
|
|
92
86
|
exports.entities = (_a = {},
|
|
93
87
|
_a[Entity_1.Entity.Zeus] = Zeus_1.Zeus,
|
|
94
88
|
_a[Entity_1.Entity.Poseidon] = Poseidon_1.Poseidon,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemMove, Location, Material, MaterialItem, MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
|
|
1
|
+
import { CustomMove, ItemMove, Location, Material, MaterialItem, MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
2
|
import { PlayerEffectRule } from './Effect';
|
|
3
3
|
export declare abstract class MoveEffectRule extends PlayerEffectRule {
|
|
4
4
|
canPlayEffect(cardIndex: number): boolean;
|
|
@@ -11,5 +11,5 @@ export declare abstract class MoveEffectRule extends PlayerEffectRule {
|
|
|
11
11
|
isLegalDestination(_space: XYCoordinates, _cardLocation: Location): boolean;
|
|
12
12
|
afterItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
|
|
13
13
|
onCardMoved(_move: MoveItem): MaterialMove[];
|
|
14
|
-
|
|
14
|
+
onCustomMove(move: CustomMove): MaterialMove<number, number, number, number>[];
|
|
15
15
|
}
|
|
@@ -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
|
};
|
|
@@ -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))
|
|
@@ -58,7 +58,7 @@ var ChooseDraftTokenRule = (function (_super) {
|
|
|
58
58
|
.location(LocationType_1.LocationType.PlayerHand)
|
|
59
59
|
.id(function (id) { return id.front === true; });
|
|
60
60
|
var playersHavingToTake = this.game.players.filter(function (player) { return takeTokens.player(player).length > destinyLeft; });
|
|
61
|
-
return playersHavingToTake.map(function (player) { return takeTokens.player(player).
|
|
61
|
+
return playersHavingToTake.map(function (player) { return takeTokens.player(player).moveItem(_this.getTokenDestination(player)); });
|
|
62
62
|
};
|
|
63
63
|
ChooseDraftTokenRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
64
64
|
return this.material(MaterialType_1.MaterialType.DraftToken).location(LocationType_1.LocationType.PlayerHand).player(player).moveItems(this.getTokenDestination(player));
|
|
@@ -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>;
|