@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
package/dist/rules/RuleId.d.ts
CHANGED
|
@@ -40,5 +40,12 @@ export declare enum RuleId {
|
|
|
40
40
|
CondorEffect = 42,
|
|
41
41
|
SupayEffect = 43,
|
|
42
42
|
UkukuEffect = 44,
|
|
43
|
-
UkukuPlaceEffect = 45
|
|
43
|
+
UkukuPlaceEffect = 45,
|
|
44
|
+
YanluoWangEffect = 46,
|
|
45
|
+
NuwaEffect = 47,
|
|
46
|
+
TianlongEffect = 48,
|
|
47
|
+
TianlongOpponentsEffect = 49,
|
|
48
|
+
QilinEffect = 50,
|
|
49
|
+
FenghuangEffect = 51,
|
|
50
|
+
JiangshiEffect = 52
|
|
44
51
|
}
|
package/dist/rules/RuleId.js
CHANGED
|
@@ -45,4 +45,11 @@ var RuleId;
|
|
|
45
45
|
RuleId[RuleId["SupayEffect"] = 43] = "SupayEffect";
|
|
46
46
|
RuleId[RuleId["UkukuEffect"] = 44] = "UkukuEffect";
|
|
47
47
|
RuleId[RuleId["UkukuPlaceEffect"] = 45] = "UkukuPlaceEffect";
|
|
48
|
+
RuleId[RuleId["YanluoWangEffect"] = 46] = "YanluoWangEffect";
|
|
49
|
+
RuleId[RuleId["NuwaEffect"] = 47] = "NuwaEffect";
|
|
50
|
+
RuleId[RuleId["TianlongEffect"] = 48] = "TianlongEffect";
|
|
51
|
+
RuleId[RuleId["TianlongOpponentsEffect"] = 49] = "TianlongOpponentsEffect";
|
|
52
|
+
RuleId[RuleId["QilinEffect"] = 50] = "QilinEffect";
|
|
53
|
+
RuleId[RuleId["FenghuangEffect"] = 51] = "FenghuangEffect";
|
|
54
|
+
RuleId[RuleId["JiangshiEffect"] = 52] = "JiangshiEffect";
|
|
48
55
|
})(RuleId = exports.RuleId || (exports.RuleId = {}));
|
|
@@ -47,7 +47,7 @@ var AlfEffectRule = (function (_super) {
|
|
|
47
47
|
var alf = this.material(MaterialType_1.MaterialType.EntityCard).getItem(alfIndex).location;
|
|
48
48
|
for (var y = 0; y < 3; y++) {
|
|
49
49
|
for (var x = 0; x < 3; x++) {
|
|
50
|
-
if (!grid[y][x] && Math.abs(alf.x - x) ===
|
|
50
|
+
if (!grid[y][x] && Math.abs(alf.x - x) === Math.abs(alf.y - y)) {
|
|
51
51
|
freeDiagonals.push({ x: x, y: y });
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -3,6 +3,7 @@ import { InvokeEffectRule } from '../../material/entity/PlaceCardEffectRule';
|
|
|
3
3
|
import { RuleId } from '../RuleId';
|
|
4
4
|
export declare class ChimeraEffectRule extends InvokeEffectRule {
|
|
5
5
|
ruleId: RuleId;
|
|
6
|
+
playEffect(): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
6
7
|
getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
7
8
|
getAvailableDestinations(): XYCoordinates[];
|
|
8
9
|
}
|
|
@@ -27,6 +27,10 @@ var ChimeraEffectRule = (function (_super) {
|
|
|
27
27
|
_this.ruleId = RuleId_1.RuleId.ChimeraEffect;
|
|
28
28
|
return _this;
|
|
29
29
|
}
|
|
30
|
+
ChimeraEffectRule.prototype.playEffect = function () {
|
|
31
|
+
var player = this.card.location.player;
|
|
32
|
+
return new Pantheon_1.Pantheon(this.game, player).hasCrushed(this.card) ? _super.prototype.playEffect.call(this) : [];
|
|
33
|
+
};
|
|
30
34
|
ChimeraEffectRule.prototype.getCardsToPlace = function () {
|
|
31
35
|
return new Destiny_1.Destiny(this.game).creaturesOnTopOfDecks;
|
|
32
36
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MaterialMove, MoveItem } from '@gamepark/rules-api';
|
|
2
2
|
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
3
3
|
import { RuleId } from '../RuleId';
|
|
4
4
|
export declare class CondorEffectRule extends SacrificeEffectRule {
|
|
5
5
|
ruleId: RuleId;
|
|
6
6
|
getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
7
|
-
|
|
7
|
+
onSacrifice(move: MoveItem): MaterialMove[];
|
|
8
8
|
}
|
|
@@ -18,7 +18,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.CondorEffectRule = void 0;
|
|
19
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
20
|
var SacrificeEffectRule_1 = require("../../material/entity/SacrificeEffectRule");
|
|
21
|
-
var LocationType_1 = require("../../material/LocationType");
|
|
22
21
|
var MaterialType_1 = require("../../material/MaterialType");
|
|
23
22
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
24
23
|
var RuleId_1 = require("../RuleId");
|
|
@@ -33,12 +32,9 @@ var CondorEffectRule = (function (_super) {
|
|
|
33
32
|
var location = this.card.location;
|
|
34
33
|
return _super.prototype.getCardsToSacrifice.call(this).location(function (l) { return (0, rules_api_1.areAdjacentSquares)(l, location); });
|
|
35
34
|
};
|
|
36
|
-
CondorEffectRule.prototype.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return new Pantheon_1.Pantheon(this.game, this.player).getInvokeGains(entity.id.front, entity.location.y);
|
|
40
|
-
}
|
|
41
|
-
return [];
|
|
35
|
+
CondorEffectRule.prototype.onSacrifice = function (move) {
|
|
36
|
+
var entity = this.material(MaterialType_1.MaterialType.EntityCard).getItem(move.itemIndex);
|
|
37
|
+
return new Pantheon_1.Pantheon(this.game, this.player).getInvokeGains(entity.id.front, entity.location.y).concat(this.endEffect());
|
|
42
38
|
};
|
|
43
39
|
return CondorEffectRule;
|
|
44
40
|
}(SacrificeEffectRule_1.SacrificeEffectRule));
|
|
@@ -4,8 +4,9 @@ import { PlayerColor } from '../../PlayerColor';
|
|
|
4
4
|
import { RuleId } from '../RuleId';
|
|
5
5
|
export declare class DraugrEffectRule extends SimultaneousSacrificeEffectRule {
|
|
6
6
|
ruleId: RuleId;
|
|
7
|
+
playEffect(): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
7
8
|
getAffectedPlayers(): PlayerColor[];
|
|
8
9
|
getActivePlayerLegalMoves(player: PlayerColor): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
9
10
|
getCardsToSacrifice(player: PlayerColor): Material;
|
|
10
|
-
beforeItemMove(move: ItemMove): import("@gamepark/rules-api").
|
|
11
|
+
beforeItemMove(move: ItemMove): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
11
12
|
}
|
|
@@ -21,6 +21,7 @@ var Entity_1 = require("../../material/Entity");
|
|
|
21
21
|
var SimultaneousSacrificeEffectRule_1 = require("../../material/entity/SimultaneousSacrificeEffectRule");
|
|
22
22
|
var LocationType_1 = require("../../material/LocationType");
|
|
23
23
|
var MaterialType_1 = require("../../material/MaterialType");
|
|
24
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
24
25
|
var RuleId_1 = require("../RuleId");
|
|
25
26
|
var DraugrEffectRule = (function (_super) {
|
|
26
27
|
__extends(DraugrEffectRule, _super);
|
|
@@ -29,6 +30,10 @@ var DraugrEffectRule = (function (_super) {
|
|
|
29
30
|
_this.ruleId = RuleId_1.RuleId.DraugrEffect;
|
|
30
31
|
return _this;
|
|
31
32
|
}
|
|
33
|
+
DraugrEffectRule.prototype.playEffect = function () {
|
|
34
|
+
var player = this.card.location.player;
|
|
35
|
+
return new Pantheon_1.Pantheon(this.game, player).hasCrushed(this.card) ? _super.prototype.playEffect.call(this) : [];
|
|
36
|
+
};
|
|
32
37
|
DraugrEffectRule.prototype.getAffectedPlayers = function () {
|
|
33
38
|
var _this = this;
|
|
34
39
|
return _super.prototype.getAffectedPlayers.call(this).filter(function (player) { return _this.isOpponent(player); });
|
|
@@ -49,7 +54,9 @@ var DraugrEffectRule = (function (_super) {
|
|
|
49
54
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.GemToken)(move)) {
|
|
50
55
|
return [this.endPlayerTurn(this.material(MaterialType_1.MaterialType.GemToken).getItem(move.itemIndex).location.player)];
|
|
51
56
|
}
|
|
52
|
-
|
|
57
|
+
else {
|
|
58
|
+
return _super.prototype.beforeItemMove.call(this, move);
|
|
59
|
+
}
|
|
53
60
|
};
|
|
54
61
|
return DraugrEffectRule;
|
|
55
62
|
}(SimultaneousSacrificeEffectRule_1.SimultaneousSacrificeEffectRule));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PlaceCardEffectRule } from '../../material/entity/PlaceCardEffectRule';
|
|
2
|
+
import { RuleId } from '../RuleId';
|
|
3
|
+
export declare class FenghuangEffectRule extends PlaceCardEffectRule {
|
|
4
|
+
ruleId: RuleId;
|
|
5
|
+
onRuleStart(): never[];
|
|
6
|
+
getPlayerMoves(cardIndex?: number): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
7
|
+
getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.FenghuangEffectRule = void 0;
|
|
19
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
20
|
+
var PlaceCardEffectRule_1 = require("../../material/entity/PlaceCardEffectRule");
|
|
21
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
22
|
+
var Memory_1 = require("../../Memory");
|
|
23
|
+
var RuleId_1 = require("../RuleId");
|
|
24
|
+
var FenghuangEffectRule = (function (_super) {
|
|
25
|
+
__extends(FenghuangEffectRule, _super);
|
|
26
|
+
function FenghuangEffectRule() {
|
|
27
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
28
|
+
_this.ruleId = RuleId_1.RuleId.FenghuangEffect;
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
FenghuangEffectRule.prototype.onRuleStart = function () {
|
|
32
|
+
var _this = this;
|
|
33
|
+
this.memorize(Memory_1.Memory.OncePerTurn, function (indexes) {
|
|
34
|
+
if (indexes === void 0) { indexes = []; }
|
|
35
|
+
return indexes.concat(_this.getEffect().cardIndex);
|
|
36
|
+
});
|
|
37
|
+
return [];
|
|
38
|
+
};
|
|
39
|
+
FenghuangEffectRule.prototype.getPlayerMoves = function (cardIndex) {
|
|
40
|
+
if (cardIndex === void 0) { cardIndex = this.getEffect().cardIndex; }
|
|
41
|
+
return _super.prototype.getPlayerMoves.call(this, cardIndex).concat(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
42
|
+
};
|
|
43
|
+
FenghuangEffectRule.prototype.getCardsToPlace = function () {
|
|
44
|
+
return this.material(MaterialType_1.MaterialType.EntityCard).index(this.getEffect().cardIndex);
|
|
45
|
+
};
|
|
46
|
+
return FenghuangEffectRule;
|
|
47
|
+
}(PlaceCardEffectRule_1.PlaceCardEffectRule));
|
|
48
|
+
exports.FenghuangEffectRule = FenghuangEffectRule;
|
|
@@ -14,17 +14,6 @@ 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 __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
17
|
var __values = (this && this.__values) || function(o) {
|
|
29
18
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
30
19
|
if (m) return m.call(o);
|
|
@@ -40,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
29
|
exports.HadesEffectRule = void 0;
|
|
41
30
|
var Entity_1 = require("../../material/Entity");
|
|
42
31
|
var SimultaneousMoveEffectRule_1 = require("../../material/entity/SimultaneousMoveEffectRule");
|
|
32
|
+
var LocationType_1 = require("../../material/LocationType");
|
|
43
33
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
44
34
|
var HadesEffectRule = (function (_super) {
|
|
45
35
|
__extends(HadesEffectRule, _super);
|
|
@@ -60,7 +50,7 @@ var HadesEffectRule = (function (_super) {
|
|
|
60
50
|
var entity = entities.getItem(index);
|
|
61
51
|
var _g = entity.location, x = _g.x, y = _g.y;
|
|
62
52
|
if (y !== 2 && !(0, Entity_1.isGod)(entity.id.front) && pantheon.isFreeSpace({ x: x, y: y + 1 })) {
|
|
63
|
-
moves.push(entities.index(index).moveItem(
|
|
53
|
+
moves.push(entities.index(index).moveItem({ type: LocationType_1.LocationType.Pantheon, player: player, x: x, y: y + 1 }));
|
|
64
54
|
}
|
|
65
55
|
}
|
|
66
56
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ItemMove, MaterialMove } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerEffectRule } from '../../material/entity/Effect';
|
|
3
|
+
import { RuleId } from '../RuleId';
|
|
4
|
+
export declare class JiangshiEffectRule extends PlayerEffectRule {
|
|
5
|
+
ruleId: RuleId;
|
|
6
|
+
getPlayerMoves(): MaterialMove[];
|
|
7
|
+
beforeItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.JiangshiEffectRule = void 0;
|
|
44
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
45
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
46
|
+
var LocationType_1 = require("../../material/LocationType");
|
|
47
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
48
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
49
|
+
var RuleId_1 = require("../RuleId");
|
|
50
|
+
var JiangshiEffectRule = (function (_super) {
|
|
51
|
+
__extends(JiangshiEffectRule, _super);
|
|
52
|
+
function JiangshiEffectRule() {
|
|
53
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
54
|
+
_this.ruleId = RuleId_1.RuleId.JiangshiEffect;
|
|
55
|
+
return _this;
|
|
56
|
+
}
|
|
57
|
+
JiangshiEffectRule.prototype.getPlayerMoves = function () {
|
|
58
|
+
var _this = this;
|
|
59
|
+
var location = this.card.location;
|
|
60
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
61
|
+
var piles = pantheon.getPiles(function (space) { return space.y === location.y; });
|
|
62
|
+
return piles.map(function (pile) { return pile.moveItemsAtOnce({ type: LocationType_1.LocationType.PlayerDiscard, player: _this.player }); });
|
|
63
|
+
};
|
|
64
|
+
JiangshiEffectRule.prototype.beforeItemMove = function (move) {
|
|
65
|
+
if ((0, rules_api_1.isMoveItemTypeAtOnce)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
66
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
67
|
+
var topCard = this.material(MaterialType_1.MaterialType.EntityCard)
|
|
68
|
+
.index(move.indexes)
|
|
69
|
+
.maxBy(function (item) { return item.location.z; });
|
|
70
|
+
return __spreadArray(__spreadArray([pantheon.gainGems(2)], __read(pantheon.onEntitySacrificed(topCard)), false), __read(this.endEffect()), false);
|
|
71
|
+
}
|
|
72
|
+
return [];
|
|
73
|
+
};
|
|
74
|
+
return JiangshiEffectRule;
|
|
75
|
+
}(Effect_1.PlayerEffectRule));
|
|
76
|
+
exports.JiangshiEffectRule = JiangshiEffectRule;
|
|
@@ -44,13 +44,18 @@ var KinnaraEffectRule = (function (_super) {
|
|
|
44
44
|
KinnaraEffectRule.prototype.getPlayerMoves = function () {
|
|
45
45
|
var e_1, _a;
|
|
46
46
|
var moves = [];
|
|
47
|
-
var
|
|
47
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
48
|
+
var mythologies = pantheon.missingMythologies;
|
|
48
49
|
var creaturesDecks = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.CreaturesDeck);
|
|
49
50
|
var godsDecks = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.GodsDeck);
|
|
51
|
+
var gems = pantheon.gems;
|
|
50
52
|
try {
|
|
51
53
|
for (var mythologies_1 = __values(mythologies), mythologies_1_1 = mythologies_1.next(); !mythologies_1_1.done; mythologies_1_1 = mythologies_1.next()) {
|
|
52
54
|
var mythology = mythologies_1_1.value;
|
|
53
|
-
moves.push(creaturesDecks.locationId(mythology).deck().moveItem({ type: LocationType_1.LocationType.PlayerBufferArea, player: this.player })
|
|
55
|
+
moves.push(creaturesDecks.locationId(mythology).deck().moveItem({ type: LocationType_1.LocationType.PlayerBufferArea, player: this.player }));
|
|
56
|
+
if (gems >= 4) {
|
|
57
|
+
godsDecks.locationId(mythology).deck().moveItem({ type: LocationType_1.LocationType.PlayerBufferArea, player: this.player });
|
|
58
|
+
}
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ItemMove, Material, MoveItem } from '@gamepark/rules-api';
|
|
2
|
+
import { SimultaneousSacrificeEffectRule } from '../../material/entity/SimultaneousSacrificeEffectRule';
|
|
3
|
+
import { PlayerColor } from '../../PlayerColor';
|
|
4
|
+
import { RuleId } from '../RuleId';
|
|
5
|
+
export declare class NuwaEffectRule extends SimultaneousSacrificeEffectRule {
|
|
6
|
+
ruleId: RuleId;
|
|
7
|
+
getAffectedPlayers(): PlayerColor[];
|
|
8
|
+
getActivePlayerLegalMoves(player: PlayerColor): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
9
|
+
getCardsToSacrifice(player: PlayerColor): Material;
|
|
10
|
+
onSacrifice(move: MoveItem): import("@gamepark/rules-api").EndPlayerTurn<number>[];
|
|
11
|
+
beforeItemMove(move: ItemMove): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __values = (this && this.__values) || function(o) {
|
|
18
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
19
|
+
if (m) return m.call(o);
|
|
20
|
+
if (o && typeof o.length === "number") return {
|
|
21
|
+
next: function () {
|
|
22
|
+
if (o && i >= o.length) o = void 0;
|
|
23
|
+
return { value: o && o[i++], done: !o };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.NuwaEffectRule = void 0;
|
|
30
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
31
|
+
var Entity_1 = require("../../material/Entity");
|
|
32
|
+
var SimultaneousSacrificeEffectRule_1 = require("../../material/entity/SimultaneousSacrificeEffectRule");
|
|
33
|
+
var LocationType_1 = require("../../material/LocationType");
|
|
34
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
35
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
36
|
+
var Memory_1 = require("../../Memory");
|
|
37
|
+
var RuleId_1 = require("../RuleId");
|
|
38
|
+
var NuwaEffectRule = (function (_super) {
|
|
39
|
+
__extends(NuwaEffectRule, _super);
|
|
40
|
+
function NuwaEffectRule() {
|
|
41
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
42
|
+
_this.ruleId = RuleId_1.RuleId.NuwaEffect;
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
NuwaEffectRule.prototype.getAffectedPlayers = function () {
|
|
46
|
+
var e_1, _a;
|
|
47
|
+
var players = [];
|
|
48
|
+
try {
|
|
49
|
+
for (var _b = __values(this.game.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
50
|
+
var player = _c.value;
|
|
51
|
+
if (this.isOpponent(player)) {
|
|
52
|
+
var creatures = new Pantheon_1.Pantheon(this.game, player).visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front); }).getIndexes();
|
|
53
|
+
if (creatures.length > 0) {
|
|
54
|
+
this.memorize(Memory_1.Memory.NuwaPlayerCreatures, creatures, player);
|
|
55
|
+
players.push(player);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
61
|
+
finally {
|
|
62
|
+
try {
|
|
63
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
64
|
+
}
|
|
65
|
+
finally { if (e_1) throw e_1.error; }
|
|
66
|
+
}
|
|
67
|
+
return players;
|
|
68
|
+
};
|
|
69
|
+
NuwaEffectRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
70
|
+
var moves = _super.prototype.getActivePlayerLegalMoves.call(this, player);
|
|
71
|
+
var gems = this.material(MaterialType_1.MaterialType.GemToken).location(LocationType_1.LocationType.PlayerGems).player(player);
|
|
72
|
+
var creatures = this.remind(Memory_1.Memory.NuwaPlayerCreatures, player);
|
|
73
|
+
if (gems.getQuantity() >= creatures.length) {
|
|
74
|
+
moves.push(gems.moveItem({ type: LocationType_1.LocationType.PlayerGems, player: this.card.location.player }, creatures.length));
|
|
75
|
+
}
|
|
76
|
+
return moves;
|
|
77
|
+
};
|
|
78
|
+
NuwaEffectRule.prototype.getCardsToSacrifice = function (player) {
|
|
79
|
+
return _super.prototype.getCardsToSacrifice.call(this, player).index(this.remind(Memory_1.Memory.NuwaPlayerCreatures, player));
|
|
80
|
+
};
|
|
81
|
+
NuwaEffectRule.prototype.onSacrifice = function (move) {
|
|
82
|
+
var player = move.location.player;
|
|
83
|
+
var creaturesLeft = this.memorize(Memory_1.Memory.NuwaPlayerCreatures, function (creatures) { return creatures.filter(function (c) { return c !== move.itemIndex; }); }, player);
|
|
84
|
+
return creaturesLeft.length ? [] : [this.endPlayerTurn(player)];
|
|
85
|
+
};
|
|
86
|
+
NuwaEffectRule.prototype.beforeItemMove = function (move) {
|
|
87
|
+
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.GemToken)(move)) {
|
|
88
|
+
var player = this.material(MaterialType_1.MaterialType.GemToken).getItem(move.itemIndex).location.player;
|
|
89
|
+
return [this.endPlayerTurn(player)];
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
return _super.prototype.beforeItemMove.call(this, move);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return NuwaEffectRule;
|
|
96
|
+
}(SimultaneousSacrificeEffectRule_1.SimultaneousSacrificeEffectRule));
|
|
97
|
+
exports.NuwaEffectRule = NuwaEffectRule;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CustomMove } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerEffectRule } from '../../material/entity/Effect';
|
|
3
|
+
import { RuleId } from '../RuleId';
|
|
4
|
+
export declare class QilinEffectRule extends PlayerEffectRule {
|
|
5
|
+
ruleId: RuleId;
|
|
6
|
+
getPlayerMoves(): CustomMove<number>[];
|
|
7
|
+
onCustomMove(move: CustomMove): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __values = (this && this.__values) || function(o) {
|
|
18
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
19
|
+
if (m) return m.call(o);
|
|
20
|
+
if (o && typeof o.length === "number") return {
|
|
21
|
+
next: function () {
|
|
22
|
+
if (o && i >= o.length) o = void 0;
|
|
23
|
+
return { value: o && o[i++], done: !o };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
27
|
+
};
|
|
28
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
29
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
30
|
+
if (!m) return o;
|
|
31
|
+
var i = m.call(o), r, ar = [], e;
|
|
32
|
+
try {
|
|
33
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
34
|
+
}
|
|
35
|
+
catch (error) { e = { error: error }; }
|
|
36
|
+
finally {
|
|
37
|
+
try {
|
|
38
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
39
|
+
}
|
|
40
|
+
finally { if (e) throw e.error; }
|
|
41
|
+
}
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
45
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
46
|
+
if (ar || !(i in from)) {
|
|
47
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
48
|
+
ar[i] = from[i];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.QilinEffectRule = void 0;
|
|
55
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
56
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
57
|
+
var Entity_1 = require("../../material/Entity");
|
|
58
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
59
|
+
var EntityDescription_1 = require("../../material/entity/EntityDescription");
|
|
60
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
61
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
62
|
+
var RuleId_1 = require("../RuleId");
|
|
63
|
+
var QilinEffectRule = (function (_super) {
|
|
64
|
+
__extends(QilinEffectRule, _super);
|
|
65
|
+
function QilinEffectRule() {
|
|
66
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
67
|
+
_this.ruleId = RuleId_1.RuleId.QilinEffect;
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
QilinEffectRule.prototype.getPlayerMoves = function () {
|
|
71
|
+
var e_1, _a;
|
|
72
|
+
var _this = this;
|
|
73
|
+
var cardsToCopy = [];
|
|
74
|
+
try {
|
|
75
|
+
for (var _b = __values(this.game.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
76
|
+
var player = _c.value;
|
|
77
|
+
if (player !== this.player) {
|
|
78
|
+
cardsToCopy.push.apply(cardsToCopy, __spreadArray([], __read(new Pantheon_1.Pantheon(this.game, player).visibleEntities
|
|
79
|
+
.location(function (l) { return l.x === _this.card.location.x; })
|
|
80
|
+
.id(function (id) {
|
|
81
|
+
var _a;
|
|
82
|
+
var entity = id.front;
|
|
83
|
+
var trigger = (_a = EntityDescription_1.entities[entity].effect) === null || _a === void 0 ? void 0 : _a.trigger;
|
|
84
|
+
return (0, Entity_1.isCreature)(entity) && trigger === Effect_1.isPlaced;
|
|
85
|
+
})
|
|
86
|
+
.getIndexes()), false));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
91
|
+
finally {
|
|
92
|
+
try {
|
|
93
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
94
|
+
}
|
|
95
|
+
finally { if (e_1) throw e_1.error; }
|
|
96
|
+
}
|
|
97
|
+
return cardsToCopy.map(function (index) { return _this.customMove(CustomMoveType_1.CustomMoveType.ChooseEntityCard, index); });
|
|
98
|
+
};
|
|
99
|
+
QilinEffectRule.prototype.onCustomMove = function (move) {
|
|
100
|
+
if (move.type === CustomMoveType_1.CustomMoveType.ChooseEntityCard) {
|
|
101
|
+
var card = this.material(MaterialType_1.MaterialType.EntityCard).getItem(move.data);
|
|
102
|
+
var effect = EntityDescription_1.entities[card.id.front].effect;
|
|
103
|
+
var moves = new effect.rule(this.game).playEffect();
|
|
104
|
+
if (!moves.some(function (move) { return move.kind === rules_api_1.MoveKind.RulesMove; })) {
|
|
105
|
+
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
106
|
+
}
|
|
107
|
+
return moves;
|
|
108
|
+
}
|
|
109
|
+
return [];
|
|
110
|
+
};
|
|
111
|
+
return QilinEffectRule;
|
|
112
|
+
}(Effect_1.PlayerEffectRule));
|
|
113
|
+
exports.QilinEffectRule = QilinEffectRule;
|
|
@@ -14,17 +14,6 @@ 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 __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
17
|
var __values = (this && this.__values) || function(o) {
|
|
29
18
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
30
19
|
if (m) return m.call(o);
|
|
@@ -40,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
29
|
exports.RaEffectRule = void 0;
|
|
41
30
|
var Entity_1 = require("../../material/Entity");
|
|
42
31
|
var SimultaneousMoveEffectRule_1 = require("../../material/entity/SimultaneousMoveEffectRule");
|
|
32
|
+
var LocationType_1 = require("../../material/LocationType");
|
|
43
33
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
44
34
|
var RaEffectRule = (function (_super) {
|
|
45
35
|
__extends(RaEffectRule, _super);
|
|
@@ -60,7 +50,7 @@ var RaEffectRule = (function (_super) {
|
|
|
60
50
|
var entity = entities.getItem(index);
|
|
61
51
|
var _g = entity.location, x = _g.x, y = _g.y;
|
|
62
52
|
if (y !== 0 && !(0, Entity_1.isGod)(entity.id.front) && pantheon.isFreeSpace({ x: x, y: y - 1 })) {
|
|
63
|
-
moves.push(entities.index(index).moveItem(
|
|
53
|
+
moves.push(entities.index(index).moveItem({ type: LocationType_1.LocationType.Pantheon, player: player, x: x, y: y - 1 }));
|
|
64
54
|
}
|
|
65
55
|
}
|
|
66
56
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CustomMove, PlayerTurnRule, RuleMove, RuleStep } from '@gamepark/rules-api';
|
|
2
|
+
import { PendingEffect } from '../../material/entity/Effect';
|
|
2
3
|
export declare class ResolveEffectsRule extends PlayerTurnRule {
|
|
3
4
|
onRuleStart(_move: RuleMove, previousRule: RuleStep): CustomMove<number>[];
|
|
4
5
|
getPlayerMoves(): CustomMove<number>[];
|
|
5
6
|
onCustomMove(move: CustomMove): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
7
|
+
playEffect(pendingEffect: PendingEffect): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
6
8
|
}
|