@gamepark/mythologies 0.1.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 +13 -0
- package/dist/CustomMoveType.js +13 -0
- package/dist/Memory.d.ts +13 -0
- package/dist/Memory.js +17 -0
- package/dist/MythologiesOptions.d.ts +12 -0
- package/dist/MythologiesOptions.js +14 -0
- package/dist/MythologiesRules.d.ts +111 -0
- package/dist/MythologiesRules.js +218 -0
- package/dist/MythologiesSetup.d.ts +17 -0
- package/dist/MythologiesSetup.js +161 -0
- package/dist/PlayerColor.d.ts +10 -0
- package/dist/PlayerColor.js +10 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/material/Destiny.d.ts +9 -0
- package/dist/material/Destiny.js +87 -0
- package/dist/material/Entity.d.ts +98 -0
- package/dist/material/Entity.js +99 -0
- package/dist/material/LocationType.d.ts +26 -0
- package/dist/material/LocationType.js +31 -0
- package/dist/material/MaterialType.d.ts +12 -0
- package/dist/material/MaterialType.js +16 -0
- package/dist/material/Mythology.d.ts +19 -0
- package/dist/material/Mythology.js +21 -0
- package/dist/material/Pantheon.d.ts +36 -0
- package/dist/material/Pantheon.js +357 -0
- package/dist/material/Trial.d.ts +22 -0
- package/dist/material/Trial.js +184 -0
- package/dist/material/entity/Effect.d.ts +91 -0
- package/dist/material/entity/Effect.js +115 -0
- package/dist/material/entity/EntityDescription.d.ts +13 -0
- package/dist/material/entity/EntityDescription.js +173 -0
- package/dist/material/entity/MoveEffectRule.d.ts +15 -0
- package/dist/material/entity/MoveEffectRule.js +86 -0
- package/dist/material/entity/PlaceCardEffectRule.d.ts +15 -0
- package/dist/material/entity/PlaceCardEffectRule.js +75 -0
- package/dist/material/entity/SacrificeEffectRule.d.ts +9 -0
- package/dist/material/entity/SacrificeEffectRule.js +58 -0
- package/dist/material/entity/SimultaneousMoveEffectRule.d.ts +13 -0
- package/dist/material/entity/SimultaneousMoveEffectRule.js +124 -0
- package/dist/material/entity/SimultaneousSacrificeEffectRule.d.ts +10 -0
- package/dist/material/entity/SimultaneousSacrificeEffectRule.js +57 -0
- package/dist/material/entity/celtic/Banshee.d.ts +2 -0
- package/dist/material/entity/celtic/Banshee.js +6 -0
- package/dist/material/entity/celtic/Brigid.d.ts +2 -0
- package/dist/material/entity/celtic/Brigid.js +6 -0
- package/dist/material/entity/celtic/Cernunnos.d.ts +2 -0
- package/dist/material/entity/celtic/Cernunnos.js +6 -0
- package/dist/material/entity/celtic/Dagda.d.ts +2 -0
- package/dist/material/entity/celtic/Dagda.js +6 -0
- package/dist/material/entity/celtic/Dryad.d.ts +2 -0
- package/dist/material/entity/celtic/Dryad.js +6 -0
- package/dist/material/entity/celtic/Dullahan.d.ts +2 -0
- package/dist/material/entity/celtic/Dullahan.js +6 -0
- package/dist/material/entity/celtic/Kelpie.d.ts +2 -0
- package/dist/material/entity/celtic/Kelpie.js +6 -0
- package/dist/material/entity/celtic/Leprechaun.d.ts +2 -0
- package/dist/material/entity/celtic/Leprechaun.js +6 -0
- package/dist/material/entity/celtic/Morrigan.d.ts +2 -0
- package/dist/material/entity/celtic/Morrigan.js +6 -0
- package/dist/material/entity/celtic/Selkie.d.ts +2 -0
- package/dist/material/entity/celtic/Selkie.js +6 -0
- package/dist/material/entity/chinese/ChangE.d.ts +2 -0
- package/dist/material/entity/chinese/ChangE.js +6 -0
- package/dist/material/entity/chinese/Fenghuang.d.ts +2 -0
- package/dist/material/entity/chinese/Fenghuang.js +6 -0
- package/dist/material/entity/chinese/Jiangshi.d.ts +2 -0
- package/dist/material/entity/chinese/Jiangshi.js +6 -0
- package/dist/material/entity/chinese/Mogwai.d.ts +2 -0
- package/dist/material/entity/chinese/Mogwai.js +6 -0
- package/dist/material/entity/chinese/Nian.d.ts +2 -0
- package/dist/material/entity/chinese/Nian.js +6 -0
- package/dist/material/entity/chinese/Nuwa.d.ts +2 -0
- package/dist/material/entity/chinese/Nuwa.js +6 -0
- package/dist/material/entity/chinese/Qilin.d.ts +2 -0
- package/dist/material/entity/chinese/Qilin.js +6 -0
- package/dist/material/entity/chinese/SunWukong.d.ts +2 -0
- package/dist/material/entity/chinese/SunWukong.js +6 -0
- package/dist/material/entity/chinese/Tianlong.d.ts +2 -0
- package/dist/material/entity/chinese/Tianlong.js +6 -0
- package/dist/material/entity/chinese/YanluoWang.d.ts +2 -0
- package/dist/material/entity/chinese/YanluoWang.js +6 -0
- package/dist/material/entity/egyptian/Anubis.d.ts +2 -0
- package/dist/material/entity/egyptian/Anubis.js +12 -0
- package/dist/material/entity/egyptian/Babai.d.ts +2 -0
- package/dist/material/entity/egyptian/Babai.js +12 -0
- package/dist/material/entity/egyptian/Beetle.d.ts +2 -0
- package/dist/material/entity/egyptian/Beetle.js +36 -0
- package/dist/material/entity/egyptian/Bennu.d.ts +2 -0
- package/dist/material/entity/egyptian/Bennu.js +12 -0
- package/dist/material/entity/egyptian/Cobra.d.ts +2 -0
- package/dist/material/entity/egyptian/Cobra.js +12 -0
- package/dist/material/entity/egyptian/Isis.d.ts +2 -0
- package/dist/material/entity/egyptian/Isis.js +39 -0
- package/dist/material/entity/egyptian/Mummy.d.ts +2 -0
- package/dist/material/entity/egyptian/Mummy.js +39 -0
- package/dist/material/entity/egyptian/Osiris.d.ts +2 -0
- package/dist/material/entity/egyptian/Osiris.js +71 -0
- package/dist/material/entity/egyptian/Ra.d.ts +2 -0
- package/dist/material/entity/egyptian/Ra.js +12 -0
- package/dist/material/entity/egyptian/Sphinx.d.ts +2 -0
- package/dist/material/entity/egyptian/Sphinx.js +12 -0
- package/dist/material/entity/greek/Athena.d.ts +2 -0
- package/dist/material/entity/greek/Athena.js +12 -0
- package/dist/material/entity/greek/Centaur.d.ts +2 -0
- package/dist/material/entity/greek/Centaur.js +12 -0
- package/dist/material/entity/greek/Chimera.d.ts +2 -0
- package/dist/material/entity/greek/Chimera.js +12 -0
- package/dist/material/entity/greek/Cyclops.d.ts +2 -0
- package/dist/material/entity/greek/Cyclops.js +21 -0
- package/dist/material/entity/greek/Gorgon.d.ts +2 -0
- package/dist/material/entity/greek/Gorgon.js +12 -0
- package/dist/material/entity/greek/Griffin.d.ts +2 -0
- package/dist/material/entity/greek/Griffin.js +12 -0
- package/dist/material/entity/greek/Hades.d.ts +2 -0
- package/dist/material/entity/greek/Hades.js +12 -0
- package/dist/material/entity/greek/Minotaur.d.ts +2 -0
- package/dist/material/entity/greek/Minotaur.js +12 -0
- package/dist/material/entity/greek/Poseidon.d.ts +2 -0
- package/dist/material/entity/greek/Poseidon.js +44 -0
- package/dist/material/entity/greek/Zeus.d.ts +2 -0
- package/dist/material/entity/greek/Zeus.js +39 -0
- package/dist/material/entity/hindu/Asura.d.ts +2 -0
- package/dist/material/entity/hindu/Asura.js +66 -0
- package/dist/material/entity/hindu/Brahma.d.ts +2 -0
- package/dist/material/entity/hindu/Brahma.js +36 -0
- package/dist/material/entity/hindu/Ganesh.d.ts +2 -0
- package/dist/material/entity/hindu/Ganesh.js +44 -0
- package/dist/material/entity/hindu/Garuda.d.ts +2 -0
- package/dist/material/entity/hindu/Garuda.js +12 -0
- package/dist/material/entity/hindu/Kinnara.d.ts +2 -0
- package/dist/material/entity/hindu/Kinnara.js +12 -0
- package/dist/material/entity/hindu/Naga.d.ts +2 -0
- package/dist/material/entity/hindu/Naga.js +68 -0
- package/dist/material/entity/hindu/Rakshasa.d.ts +2 -0
- package/dist/material/entity/hindu/Rakshasa.js +12 -0
- package/dist/material/entity/hindu/Shiva.d.ts +2 -0
- package/dist/material/entity/hindu/Shiva.js +12 -0
- package/dist/material/entity/hindu/Vetala.d.ts +2 -0
- package/dist/material/entity/hindu/Vetala.js +12 -0
- package/dist/material/entity/hindu/Vishnu.d.ts +2 -0
- package/dist/material/entity/hindu/Vishnu.js +71 -0
- package/dist/material/entity/inca/Amaru.d.ts +2 -0
- package/dist/material/entity/inca/Amaru.js +6 -0
- package/dist/material/entity/inca/Caiman.d.ts +2 -0
- package/dist/material/entity/inca/Caiman.js +6 -0
- package/dist/material/entity/inca/Condor.d.ts +2 -0
- package/dist/material/entity/inca/Condor.js +6 -0
- package/dist/material/entity/inca/Illapa.d.ts +2 -0
- package/dist/material/entity/inca/Illapa.js +6 -0
- package/dist/material/entity/inca/Inti.d.ts +2 -0
- package/dist/material/entity/inca/Inti.js +6 -0
- package/dist/material/entity/inca/MamaQucha.d.ts +2 -0
- package/dist/material/entity/inca/MamaQucha.js +6 -0
- package/dist/material/entity/inca/Pumapunku.d.ts +2 -0
- package/dist/material/entity/inca/Pumapunku.js +6 -0
- package/dist/material/entity/inca/Supay.d.ts +2 -0
- package/dist/material/entity/inca/Supay.js +6 -0
- package/dist/material/entity/inca/Ukuku.d.ts +2 -0
- package/dist/material/entity/inca/Ukuku.js +6 -0
- package/dist/material/entity/inca/Viracocha.d.ts +2 -0
- package/dist/material/entity/inca/Viracocha.js +6 -0
- package/dist/material/entity/norse/Alf.d.ts +2 -0
- package/dist/material/entity/norse/Alf.js +12 -0
- package/dist/material/entity/norse/Draugr.d.ts +2 -0
- package/dist/material/entity/norse/Draugr.js +12 -0
- package/dist/material/entity/norse/Fenrir.d.ts +2 -0
- package/dist/material/entity/norse/Fenrir.js +12 -0
- package/dist/material/entity/norse/Freya.d.ts +2 -0
- package/dist/material/entity/norse/Freya.js +39 -0
- package/dist/material/entity/norse/Jotunn.d.ts +2 -0
- package/dist/material/entity/norse/Jotunn.js +36 -0
- package/dist/material/entity/norse/Loki.d.ts +2 -0
- package/dist/material/entity/norse/Loki.js +36 -0
- package/dist/material/entity/norse/Odin.d.ts +2 -0
- package/dist/material/entity/norse/Odin.js +6 -0
- package/dist/material/entity/norse/Thor.d.ts +2 -0
- package/dist/material/entity/norse/Thor.js +12 -0
- package/dist/material/entity/norse/Troll.d.ts +2 -0
- package/dist/material/entity/norse/Troll.js +6 -0
- package/dist/material/entity/norse/Valkyrie.d.ts +2 -0
- package/dist/material/entity/norse/Valkyrie.js +72 -0
- package/dist/material/entity/zulu/Idlozi.d.ts +2 -0
- package/dist/material/entity/zulu/Idlozi.js +6 -0
- package/dist/material/entity/zulu/Impundulu.d.ts +2 -0
- package/dist/material/entity/zulu/Impundulu.js +6 -0
- package/dist/material/entity/zulu/Inkanyamba.d.ts +2 -0
- package/dist/material/entity/zulu/Inkanyamba.js +6 -0
- package/dist/material/entity/zulu/Inkosazana.d.ts +2 -0
- package/dist/material/entity/zulu/Inkosazana.js +6 -0
- package/dist/material/entity/zulu/Shembe.d.ts +2 -0
- package/dist/material/entity/zulu/Shembe.js +6 -0
- package/dist/material/entity/zulu/Tokoloshe.d.ts +2 -0
- package/dist/material/entity/zulu/Tokoloshe.js +6 -0
- package/dist/material/entity/zulu/Umvelinqangi.d.ts +2 -0
- package/dist/material/entity/zulu/Umvelinqangi.js +6 -0
- package/dist/material/entity/zulu/Unkulunkulu.d.ts +2 -0
- package/dist/material/entity/zulu/Unkulunkulu.js +6 -0
- package/dist/material/entity/zulu/Unwabu.d.ts +2 -0
- package/dist/material/entity/zulu/Unwabu.js +6 -0
- package/dist/material/entity/zulu/Werehyena.d.ts +2 -0
- package/dist/material/entity/zulu/Werehyena.js +6 -0
- package/dist/rules/ChooseDraftTokenRule.d.ts +15 -0
- package/dist/rules/ChooseDraftTokenRule.js +103 -0
- package/dist/rules/DrawDestinyCardRule.d.ts +7 -0
- package/dist/rules/DrawDestinyCardRule.js +116 -0
- package/dist/rules/EndGameRule.d.ts +5 -0
- package/dist/rules/EndGameRule.js +44 -0
- package/dist/rules/PlaceCardsRule.d.ts +13 -0
- package/dist/rules/PlaceCardsRule.js +192 -0
- package/dist/rules/PlaceTokenRule.d.ts +13 -0
- package/dist/rules/PlaceTokenRule.js +139 -0
- package/dist/rules/RuleId.d.ts +36 -0
- package/dist/rules/RuleId.js +40 -0
- package/dist/rules/UpkeepRule.d.ts +9 -0
- package/dist/rules/UpkeepRule.js +140 -0
- package/dist/rules/effects/AlfEffectRule.d.ts +10 -0
- package/dist/rules/effects/AlfEffectRule.js +59 -0
- package/dist/rules/effects/AnubisEffectRule.d.ts +9 -0
- package/dist/rules/effects/AnubisEffectRule.js +49 -0
- package/dist/rules/effects/AthenaEffectRule.d.ts +9 -0
- package/dist/rules/effects/AthenaEffectRule.js +104 -0
- package/dist/rules/effects/BabaiEffectRule.d.ts +6 -0
- package/dist/rules/effects/BabaiEffectRule.js +40 -0
- package/dist/rules/effects/BennuEffectRule.d.ts +6 -0
- package/dist/rules/effects/BennuEffectRule.js +35 -0
- package/dist/rules/effects/CentaurEffectRule.d.ts +15 -0
- package/dist/rules/effects/CentaurEffectRule.js +77 -0
- package/dist/rules/effects/ChimeraEffectRule.d.ts +8 -0
- package/dist/rules/effects/ChimeraEffectRule.js +51 -0
- package/dist/rules/effects/CobraEffectRule.d.ts +12 -0
- package/dist/rules/effects/CobraEffectRule.js +55 -0
- package/dist/rules/effects/CyclopsEffectRule.d.ts +8 -0
- package/dist/rules/effects/CyclopsEffectRule.js +87 -0
- package/dist/rules/effects/DraugrEffectRule.d.ts +11 -0
- package/dist/rules/effects/DraugrEffectRule.js +56 -0
- package/dist/rules/effects/FenrirEffectRule.d.ts +15 -0
- package/dist/rules/effects/FenrirEffectRule.js +132 -0
- package/dist/rules/effects/GarudaEffectRule.d.ts +9 -0
- package/dist/rules/effects/GarudaEffectRule.js +84 -0
- package/dist/rules/effects/GorgonEffectRule.d.ts +11 -0
- package/dist/rules/effects/GorgonEffectRule.js +78 -0
- package/dist/rules/effects/GriffinEffectRule.d.ts +9 -0
- package/dist/rules/effects/GriffinEffectRule.js +41 -0
- package/dist/rules/effects/HadesEffectRule.d.ts +5 -0
- package/dist/rules/effects/HadesEffectRule.js +87 -0
- package/dist/rules/effects/KinnaraEffectRule.d.ts +12 -0
- package/dist/rules/effects/KinnaraEffectRule.js +84 -0
- package/dist/rules/effects/MinotaurEffectRule.d.ts +9 -0
- package/dist/rules/effects/MinotaurEffectRule.js +39 -0
- package/dist/rules/effects/OdinEffectRule.d.ts +11 -0
- package/dist/rules/effects/OdinEffectRule.js +52 -0
- package/dist/rules/effects/RaEffectRule.d.ts +5 -0
- package/dist/rules/effects/RaEffectRule.js +87 -0
- package/dist/rules/effects/RakshasaEffectRule.d.ts +13 -0
- package/dist/rules/effects/RakshasaEffectRule.js +48 -0
- package/dist/rules/effects/ResolveEffectsRule.d.ts +6 -0
- package/dist/rules/effects/ResolveEffectsRule.js +73 -0
- package/dist/rules/effects/ShivaEffectRule.d.ts +10 -0
- package/dist/rules/effects/ShivaEffectRule.js +82 -0
- package/dist/rules/effects/SphinxEffectRule.d.ts +9 -0
- package/dist/rules/effects/SphinxEffectRule.js +47 -0
- package/dist/rules/effects/ThorEffectRule.d.ts +11 -0
- package/dist/rules/effects/ThorEffectRule.js +56 -0
- package/dist/rules/effects/TriggerEffectsRule.d.ts +11 -0
- package/dist/rules/effects/TriggerEffectsRule.js +159 -0
- package/dist/rules/effects/VetalaEffectRule.d.ts +11 -0
- package/dist/rules/effects/VetalaEffectRule.js +59 -0
- package/package.json +33 -0
|
@@ -0,0 +1,139 @@
|
|
|
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.PlaceTokenRule = void 0;
|
|
55
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
56
|
+
var Destiny_1 = require("../material/Destiny");
|
|
57
|
+
var Entity_1 = require("../material/Entity");
|
|
58
|
+
var LocationType_1 = require("../material/LocationType");
|
|
59
|
+
var MaterialType_1 = require("../material/MaterialType");
|
|
60
|
+
var Pantheon_1 = require("../material/Pantheon");
|
|
61
|
+
var Memory_1 = require("../Memory");
|
|
62
|
+
var RuleId_1 = require("./RuleId");
|
|
63
|
+
var PlaceTokenRule = (function (_super) {
|
|
64
|
+
__extends(PlaceTokenRule, _super);
|
|
65
|
+
function PlaceTokenRule() {
|
|
66
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
67
|
+
}
|
|
68
|
+
PlaceTokenRule.prototype.onRuleStart = function () {
|
|
69
|
+
var e_1, _a;
|
|
70
|
+
var moves = [];
|
|
71
|
+
try {
|
|
72
|
+
for (var _b = __values(this.activePlayers), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
73
|
+
var player = _c.value;
|
|
74
|
+
var legalMoves = this.getActivePlayerLegalMoves(player);
|
|
75
|
+
if (legalMoves.length === 1) {
|
|
76
|
+
moves.push(legalMoves[0]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
81
|
+
finally {
|
|
82
|
+
try {
|
|
83
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
84
|
+
}
|
|
85
|
+
finally { if (e_1) throw e_1.error; }
|
|
86
|
+
}
|
|
87
|
+
return moves;
|
|
88
|
+
};
|
|
89
|
+
PlaceTokenRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
90
|
+
var token = this.material(MaterialType_1.MaterialType.DraftToken)
|
|
91
|
+
.id(function (id) { return id.back === player; })
|
|
92
|
+
.location(LocationType_1.LocationType.PlayedTokenSpot);
|
|
93
|
+
if (!token.length)
|
|
94
|
+
return [];
|
|
95
|
+
return this.getAvailableCards(player).map(function (parent) { return token.moveItem({ type: LocationType_1.LocationType.OnEntityCard, parent: parent }); });
|
|
96
|
+
};
|
|
97
|
+
PlaceTokenRule.prototype.getAvailableCards = function (player) {
|
|
98
|
+
var destiny = new Destiny_1.Destiny(this.game);
|
|
99
|
+
var mythology = destiny.getMythology(player);
|
|
100
|
+
if (this.remind(Memory_1.Memory.OdinTargetMythology) === mythology && !new Pantheon_1.Pantheon(this.game, player).hasEntity(Entity_1.Entity.Odin)) {
|
|
101
|
+
return [this.getTopDeckCreature(mythology)];
|
|
102
|
+
}
|
|
103
|
+
var entities = destiny.getAvailableEntities(player);
|
|
104
|
+
if (!entities.getItems().some(function (item) { return (0, Entity_1.isCreature)(item.id.front); })) {
|
|
105
|
+
return entities.getIndexes().concat(this.getTopDeckCreature(mythology));
|
|
106
|
+
}
|
|
107
|
+
return entities.getIndexes();
|
|
108
|
+
};
|
|
109
|
+
PlaceTokenRule.prototype.getTopDeckCreature = function (mythology) {
|
|
110
|
+
return this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.CreaturesDeck).locationId(mythology).deck().getIndex();
|
|
111
|
+
};
|
|
112
|
+
PlaceTokenRule.prototype.afterItemMove = function (move) {
|
|
113
|
+
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.DraftToken)(move)) {
|
|
114
|
+
var player = this.material(MaterialType_1.MaterialType.DraftToken).getItem(move.itemIndex).id.back;
|
|
115
|
+
this.memorize(Memory_1.Memory.KeepTokenPlaceSecret, true, player);
|
|
116
|
+
return [this.endPlayerTurn(player)];
|
|
117
|
+
}
|
|
118
|
+
return [];
|
|
119
|
+
};
|
|
120
|
+
PlaceTokenRule.prototype.getMovesAfterPlayersDone = function () {
|
|
121
|
+
var tokensPlaced = this.material(MaterialType_1.MaterialType.DraftToken).location(LocationType_1.LocationType.OnEntityCard);
|
|
122
|
+
if (tokensPlaced.length < this.game.players.length * 2) {
|
|
123
|
+
return [this.startRule(RuleId_1.RuleId.DrawDestinyCard)];
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
var cardsSelected = tokensPlaced.getItems().map(function (item) { return item.location.parent; });
|
|
127
|
+
var cardsToReveal = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.CreaturesDeck).index(cardsSelected);
|
|
128
|
+
return __spreadArray(__spreadArray([], __read(cardsToReveal.rotateItems(true)), false), [
|
|
129
|
+
this.startPlayerTurn(RuleId_1.RuleId.PlaceCards, this.material(MaterialType_1.MaterialType.FirstPlayerToken).getItem().location.player)
|
|
130
|
+
], false);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
PlaceTokenRule.prototype.onRuleEnd = function () {
|
|
134
|
+
this.forget(Memory_1.Memory.KeepTokenPlaceSecret);
|
|
135
|
+
return [];
|
|
136
|
+
};
|
|
137
|
+
return PlaceTokenRule;
|
|
138
|
+
}(rules_api_1.SimultaneousRule));
|
|
139
|
+
exports.PlaceTokenRule = PlaceTokenRule;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare enum RuleId {
|
|
2
|
+
DrawDestinyCard = 1,
|
|
3
|
+
ChooseDraftToken = 2,
|
|
4
|
+
PlaceToken = 3,
|
|
5
|
+
PlaceCards = 4,
|
|
6
|
+
Upkeep = 5,
|
|
7
|
+
EndGame = 6,
|
|
8
|
+
ResolveEffects = 10,
|
|
9
|
+
AthenaEffect = 11,
|
|
10
|
+
HadesEffect = 12,
|
|
11
|
+
MinotaurEffect = 13,
|
|
12
|
+
CentaurEffect = 14,
|
|
13
|
+
CentaurEffectSacrifice = 15,
|
|
14
|
+
GorgonEffect = 16,
|
|
15
|
+
CyclopsEffect = 17,
|
|
16
|
+
GriffinEffect = 18,
|
|
17
|
+
ChimeraEffect = 19,
|
|
18
|
+
OdinEffect = 20,
|
|
19
|
+
ThorEffect = 21,
|
|
20
|
+
DraugrEffect = 22,
|
|
21
|
+
FenrirChoice = 23,
|
|
22
|
+
FenrirEffect = 24,
|
|
23
|
+
AlfEffect = 25,
|
|
24
|
+
AnubisEffect = 26,
|
|
25
|
+
SphinxEffect = 27,
|
|
26
|
+
CobraEffect = 28,
|
|
27
|
+
CobraInvokeEffect = 29,
|
|
28
|
+
BabaiEffect = 30,
|
|
29
|
+
BennuEffect = 31,
|
|
30
|
+
ShivaEffect = 32,
|
|
31
|
+
RakshasaEffect = 33,
|
|
32
|
+
GarudaEffect = 34,
|
|
33
|
+
VetalaEffect = 35,
|
|
34
|
+
KinnaraEffect = 36,
|
|
35
|
+
KinnaraPlaceEffect = 37
|
|
36
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuleId = void 0;
|
|
4
|
+
var RuleId;
|
|
5
|
+
(function (RuleId) {
|
|
6
|
+
RuleId[RuleId["DrawDestinyCard"] = 1] = "DrawDestinyCard";
|
|
7
|
+
RuleId[RuleId["ChooseDraftToken"] = 2] = "ChooseDraftToken";
|
|
8
|
+
RuleId[RuleId["PlaceToken"] = 3] = "PlaceToken";
|
|
9
|
+
RuleId[RuleId["PlaceCards"] = 4] = "PlaceCards";
|
|
10
|
+
RuleId[RuleId["Upkeep"] = 5] = "Upkeep";
|
|
11
|
+
RuleId[RuleId["EndGame"] = 6] = "EndGame";
|
|
12
|
+
RuleId[RuleId["ResolveEffects"] = 10] = "ResolveEffects";
|
|
13
|
+
RuleId[RuleId["AthenaEffect"] = 11] = "AthenaEffect";
|
|
14
|
+
RuleId[RuleId["HadesEffect"] = 12] = "HadesEffect";
|
|
15
|
+
RuleId[RuleId["MinotaurEffect"] = 13] = "MinotaurEffect";
|
|
16
|
+
RuleId[RuleId["CentaurEffect"] = 14] = "CentaurEffect";
|
|
17
|
+
RuleId[RuleId["CentaurEffectSacrifice"] = 15] = "CentaurEffectSacrifice";
|
|
18
|
+
RuleId[RuleId["GorgonEffect"] = 16] = "GorgonEffect";
|
|
19
|
+
RuleId[RuleId["CyclopsEffect"] = 17] = "CyclopsEffect";
|
|
20
|
+
RuleId[RuleId["GriffinEffect"] = 18] = "GriffinEffect";
|
|
21
|
+
RuleId[RuleId["ChimeraEffect"] = 19] = "ChimeraEffect";
|
|
22
|
+
RuleId[RuleId["OdinEffect"] = 20] = "OdinEffect";
|
|
23
|
+
RuleId[RuleId["ThorEffect"] = 21] = "ThorEffect";
|
|
24
|
+
RuleId[RuleId["DraugrEffect"] = 22] = "DraugrEffect";
|
|
25
|
+
RuleId[RuleId["FenrirChoice"] = 23] = "FenrirChoice";
|
|
26
|
+
RuleId[RuleId["FenrirEffect"] = 24] = "FenrirEffect";
|
|
27
|
+
RuleId[RuleId["AlfEffect"] = 25] = "AlfEffect";
|
|
28
|
+
RuleId[RuleId["AnubisEffect"] = 26] = "AnubisEffect";
|
|
29
|
+
RuleId[RuleId["SphinxEffect"] = 27] = "SphinxEffect";
|
|
30
|
+
RuleId[RuleId["CobraEffect"] = 28] = "CobraEffect";
|
|
31
|
+
RuleId[RuleId["CobraInvokeEffect"] = 29] = "CobraInvokeEffect";
|
|
32
|
+
RuleId[RuleId["BabaiEffect"] = 30] = "BabaiEffect";
|
|
33
|
+
RuleId[RuleId["BennuEffect"] = 31] = "BennuEffect";
|
|
34
|
+
RuleId[RuleId["ShivaEffect"] = 32] = "ShivaEffect";
|
|
35
|
+
RuleId[RuleId["RakshasaEffect"] = 33] = "RakshasaEffect";
|
|
36
|
+
RuleId[RuleId["GarudaEffect"] = 34] = "GarudaEffect";
|
|
37
|
+
RuleId[RuleId["VetalaEffect"] = 35] = "VetalaEffect";
|
|
38
|
+
RuleId[RuleId["KinnaraEffect"] = 36] = "KinnaraEffect";
|
|
39
|
+
RuleId[RuleId["KinnaraPlaceEffect"] = 37] = "KinnaraPlaceEffect";
|
|
40
|
+
})(RuleId = exports.RuleId || (exports.RuleId = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ItemMove, MaterialMove, PlayerTurnRule } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerColor } from '../PlayerColor';
|
|
3
|
+
import { RuleId } from './RuleId';
|
|
4
|
+
export declare class UpkeepRule extends PlayerTurnRule {
|
|
5
|
+
onRuleStart(): MaterialMove<number, number, number, number>[];
|
|
6
|
+
completeSanctuary(loki?: PlayerColor): MaterialMove<number, number, number, number>[];
|
|
7
|
+
afterItemMove(move: ItemMove): import("@gamepark/rules-api").Shuffle<number>[];
|
|
8
|
+
get nextRule(): import("@gamepark/rules-api").StartPlayerTurn<number, RuleId.OdinEffect> | import("@gamepark/rules-api").StartRule<RuleId.DrawDestinyCard>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
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 __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
|
+
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
|
+
var __values = (this && this.__values) || function(o) {
|
|
54
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
55
|
+
if (m) return m.call(o);
|
|
56
|
+
if (o && typeof o.length === "number") return {
|
|
57
|
+
next: function () {
|
|
58
|
+
if (o && i >= o.length) o = void 0;
|
|
59
|
+
return { value: o && o[i++], done: !o };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
63
|
+
};
|
|
64
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
+
exports.UpkeepRule = void 0;
|
|
66
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
67
|
+
var Entity_1 = require("../material/Entity");
|
|
68
|
+
var LocationType_1 = require("../material/LocationType");
|
|
69
|
+
var MaterialType_1 = require("../material/MaterialType");
|
|
70
|
+
var Pantheon_1 = require("../material/Pantheon");
|
|
71
|
+
var Memory_1 = require("../Memory");
|
|
72
|
+
var RuleId_1 = require("./RuleId");
|
|
73
|
+
var UpkeepRule = (function (_super) {
|
|
74
|
+
__extends(UpkeepRule, _super);
|
|
75
|
+
function UpkeepRule() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
UpkeepRule.prototype.onRuleStart = function () {
|
|
79
|
+
this.forget(Memory_1.Memory.OncePerTurn);
|
|
80
|
+
var moves = [
|
|
81
|
+
this.material(MaterialType_1.MaterialType.RoundToken).moveItem(function (item) { return (__assign(__assign({}, item.location), { id: item.location.id + 1 })); }),
|
|
82
|
+
this.material(MaterialType_1.MaterialType.FirstPlayerToken).moveItem({ type: LocationType_1.LocationType.FirstPlayerTokenSpot, player: this.nextPlayer })
|
|
83
|
+
];
|
|
84
|
+
moves.push.apply(moves, __spreadArray([], __read(this.completeSanctuary()), false));
|
|
85
|
+
moves.push(this.material(MaterialType_1.MaterialType.DestinyCard).location(LocationType_1.LocationType.CurrentDestiny).moveItemsAtOnce({ type: LocationType_1.LocationType.DestinyDeck }));
|
|
86
|
+
moves.push(this.nextRule);
|
|
87
|
+
return moves;
|
|
88
|
+
};
|
|
89
|
+
UpkeepRule.prototype.completeSanctuary = function (loki) {
|
|
90
|
+
var e_1, _a;
|
|
91
|
+
var moves = [];
|
|
92
|
+
var mythologyBoards = this.material(MaterialType_1.MaterialType.MythologyBoard);
|
|
93
|
+
try {
|
|
94
|
+
for (var _b = __values(mythologyBoards.getIndexes()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
95
|
+
var index = _c.value;
|
|
96
|
+
var mythology = mythologyBoards.getItem(index).id.mythology;
|
|
97
|
+
var godOnBoard = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.SanctuaryGodSpot).parent(index).length;
|
|
98
|
+
if (!godOnBoard) {
|
|
99
|
+
var deck = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.GodsDeck).locationId(mythology).deck();
|
|
100
|
+
moves.push(deck.dealOne({ type: LocationType_1.LocationType.SanctuaryGodSpot, parent: index, rotation: loki }));
|
|
101
|
+
}
|
|
102
|
+
var creaturesOnBoard = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.SanctuaryCreatureSpot).parent(index).length;
|
|
103
|
+
if (creaturesOnBoard < 3) {
|
|
104
|
+
var deck = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.CreaturesDeck).locationId(mythology).deck();
|
|
105
|
+
moves.push.apply(moves, __spreadArray([], __read(deck.deal({ type: LocationType_1.LocationType.SanctuaryCreatureSpot, parent: index, rotation: loki }, 3 - creaturesOnBoard)), false));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
110
|
+
finally {
|
|
111
|
+
try {
|
|
112
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
113
|
+
}
|
|
114
|
+
finally { if (e_1) throw e_1.error; }
|
|
115
|
+
}
|
|
116
|
+
return moves;
|
|
117
|
+
};
|
|
118
|
+
UpkeepRule.prototype.afterItemMove = function (move) {
|
|
119
|
+
if ((0, rules_api_1.isMoveItemTypeAtOnce)(MaterialType_1.MaterialType.DestinyCard)(move)) {
|
|
120
|
+
return [this.material(MaterialType_1.MaterialType.DestinyCard).shuffle()];
|
|
121
|
+
}
|
|
122
|
+
return [];
|
|
123
|
+
};
|
|
124
|
+
Object.defineProperty(UpkeepRule.prototype, "nextRule", {
|
|
125
|
+
get: function () {
|
|
126
|
+
var _this = this;
|
|
127
|
+
var odinOwner = this.game.players.find(function (player) { return new Pantheon_1.Pantheon(_this.game, player).hasEntity(Entity_1.Entity.Odin); });
|
|
128
|
+
if (odinOwner) {
|
|
129
|
+
return this.startPlayerTurn(RuleId_1.RuleId.OdinEffect, odinOwner);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
return this.startRule(RuleId_1.RuleId.DrawDestinyCard);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
enumerable: false,
|
|
136
|
+
configurable: true
|
|
137
|
+
});
|
|
138
|
+
return UpkeepRule;
|
|
139
|
+
}(rules_api_1.PlayerTurnRule));
|
|
140
|
+
exports.UpkeepRule = UpkeepRule;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Material, XYCoordinates } from '@gamepark/rules-api';
|
|
2
|
+
import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
|
|
3
|
+
import { RuleId } from '../RuleId';
|
|
4
|
+
export declare class AlfEffectRule extends MoveEffectRule {
|
|
5
|
+
ruleId: RuleId;
|
|
6
|
+
canPlayEffect(cardIndex: number): boolean;
|
|
7
|
+
getMovingCards(alfIndex?: number): Material;
|
|
8
|
+
getAvailableDestinations(): XYCoordinates[];
|
|
9
|
+
getFreeDiagonals(alfIndex?: number): XYCoordinates[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.AlfEffectRule = void 0;
|
|
19
|
+
var Entity_1 = require("../../material/Entity");
|
|
20
|
+
var MoveEffectRule_1 = require("../../material/entity/MoveEffectRule");
|
|
21
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
22
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
23
|
+
var RuleId_1 = require("../RuleId");
|
|
24
|
+
var AlfEffectRule = (function (_super) {
|
|
25
|
+
__extends(AlfEffectRule, _super);
|
|
26
|
+
function AlfEffectRule() {
|
|
27
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
28
|
+
_this.ruleId = RuleId_1.RuleId.AlfEffect;
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
AlfEffectRule.prototype.canPlayEffect = function (cardIndex) {
|
|
32
|
+
return this.getCardsAbleToMove(cardIndex).length > 0 && this.getFreeDiagonals(cardIndex).length > 0;
|
|
33
|
+
};
|
|
34
|
+
AlfEffectRule.prototype.getMovingCards = function (alfIndex) {
|
|
35
|
+
if (alfIndex === void 0) { alfIndex = this.getEffect().cardIndex; }
|
|
36
|
+
return _super.prototype.getMovingCards.call(this, alfIndex)
|
|
37
|
+
.id(function (id) { return (0, Entity_1.isCreature)(id.front); })
|
|
38
|
+
.index(function (index) { return index !== alfIndex; });
|
|
39
|
+
};
|
|
40
|
+
AlfEffectRule.prototype.getAvailableDestinations = function () {
|
|
41
|
+
return this.getFreeDiagonals();
|
|
42
|
+
};
|
|
43
|
+
AlfEffectRule.prototype.getFreeDiagonals = function (alfIndex) {
|
|
44
|
+
if (alfIndex === void 0) { alfIndex = this.getEffect().cardIndex; }
|
|
45
|
+
var freeDiagonals = [];
|
|
46
|
+
var grid = new Pantheon_1.Pantheon(this.game, this.player).grid;
|
|
47
|
+
var alf = this.material(MaterialType_1.MaterialType.EntityCard).getItem(alfIndex).location;
|
|
48
|
+
for (var y = 0; y < 3; y++) {
|
|
49
|
+
for (var x = 0; x < 3; x++) {
|
|
50
|
+
if (!grid[y][x] && Math.abs(alf.x - x) === 1 && Math.abs(alf.y - y) === 1) {
|
|
51
|
+
freeDiagonals.push({ x: x, y: y });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return freeDiagonals;
|
|
56
|
+
};
|
|
57
|
+
return AlfEffectRule;
|
|
58
|
+
}(MoveEffectRule_1.MoveEffectRule));
|
|
59
|
+
exports.AlfEffectRule = AlfEffectRule;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Material } from '@gamepark/rules-api';
|
|
2
|
+
import { InvokeEffectRule } from '../../material/entity/PlaceCardEffectRule';
|
|
3
|
+
import { RuleId } from '../RuleId';
|
|
4
|
+
export declare class AnubisEffectRule extends InvokeEffectRule {
|
|
5
|
+
ruleId: RuleId;
|
|
6
|
+
onRuleStart(): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
7
|
+
getCardsToPlace(): Material;
|
|
8
|
+
getAvailableDestinations(): import("@gamepark/rules-api").XYCoordinates[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.AnubisEffectRule = void 0;
|
|
19
|
+
var PlaceCardEffectRule_1 = require("../../material/entity/PlaceCardEffectRule");
|
|
20
|
+
var LocationType_1 = require("../../material/LocationType");
|
|
21
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
22
|
+
var Memory_1 = require("../../Memory");
|
|
23
|
+
var RuleId_1 = require("../RuleId");
|
|
24
|
+
var AnubisEffectRule = (function (_super) {
|
|
25
|
+
__extends(AnubisEffectRule, _super);
|
|
26
|
+
function AnubisEffectRule() {
|
|
27
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
28
|
+
_this.ruleId = RuleId_1.RuleId.AnubisEffect;
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
AnubisEffectRule.prototype.onRuleStart = function () {
|
|
32
|
+
if (!this.remind(Memory_1.Memory.AnubisInvoke1)) {
|
|
33
|
+
this.remind(Memory_1.Memory.PendingEffects).unshift([this.getEffect()]);
|
|
34
|
+
this.memorize(Memory_1.Memory.AnubisInvoke1, true);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.forget(Memory_1.Memory.AnubisInvoke1);
|
|
38
|
+
}
|
|
39
|
+
return _super.prototype.onRuleStart.call(this);
|
|
40
|
+
};
|
|
41
|
+
AnubisEffectRule.prototype.getCardsToPlace = function () {
|
|
42
|
+
return this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.PlayerDiscard);
|
|
43
|
+
};
|
|
44
|
+
AnubisEffectRule.prototype.getAvailableDestinations = function () {
|
|
45
|
+
return _super.prototype.getAvailableDestinations.call(this).filter(function (space) { return space.y === 2; });
|
|
46
|
+
};
|
|
47
|
+
return AnubisEffectRule;
|
|
48
|
+
}(PlaceCardEffectRule_1.InvokeEffectRule));
|
|
49
|
+
exports.AnubisEffectRule = AnubisEffectRule;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CustomMove, Material, MaterialMove } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerEffectRule } from '../../material/entity/Effect';
|
|
3
|
+
import { RuleId } from '../RuleId';
|
|
4
|
+
export declare class AthenaEffectRule extends PlayerEffectRule {
|
|
5
|
+
ruleId: RuleId;
|
|
6
|
+
getPlayerMoves(): MaterialMove[];
|
|
7
|
+
getPiles(): Material<number, number, number>[];
|
|
8
|
+
onCustomMove(move: CustomMove): MaterialMove<number, number, number, number>[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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.AthenaEffectRule = void 0;
|
|
30
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
31
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
32
|
+
var LocationType_1 = require("../../material/LocationType");
|
|
33
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
34
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
35
|
+
var RuleId_1 = require("../RuleId");
|
|
36
|
+
var AthenaEffectRule = (function (_super) {
|
|
37
|
+
__extends(AthenaEffectRule, _super);
|
|
38
|
+
function AthenaEffectRule() {
|
|
39
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
+
_this.ruleId = RuleId_1.RuleId.AthenaEffect;
|
|
41
|
+
return _this;
|
|
42
|
+
}
|
|
43
|
+
AthenaEffectRule.prototype.getPlayerMoves = function () {
|
|
44
|
+
var e_1, _a, e_2, _b;
|
|
45
|
+
var moves = [];
|
|
46
|
+
var legalSpaces = new Pantheon_1.Pantheon(this.game, this.player).legalSpaces;
|
|
47
|
+
var piles = this.getPiles();
|
|
48
|
+
try {
|
|
49
|
+
for (var piles_1 = __values(piles), piles_1_1 = piles_1.next(); !piles_1_1.done; piles_1_1 = piles_1.next()) {
|
|
50
|
+
var pile = piles_1_1.value;
|
|
51
|
+
var location = pile.getItem().location;
|
|
52
|
+
try {
|
|
53
|
+
for (var legalSpaces_1 = (e_2 = void 0, __values(legalSpaces)), legalSpaces_1_1 = legalSpaces_1.next(); !legalSpaces_1_1.done; legalSpaces_1_1 = legalSpaces_1.next()) {
|
|
54
|
+
var _c = legalSpaces_1_1.value, x = _c.x, y = _c.y;
|
|
55
|
+
if (x !== location.x || y !== location.y) {
|
|
56
|
+
moves.push(pile.moveItemsAtOnce({ type: LocationType_1.LocationType.Pantheon, player: this.player, x: x, y: y }));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
61
|
+
finally {
|
|
62
|
+
try {
|
|
63
|
+
if (legalSpaces_1_1 && !legalSpaces_1_1.done && (_b = legalSpaces_1.return)) _b.call(legalSpaces_1);
|
|
64
|
+
}
|
|
65
|
+
finally { if (e_2) throw e_2.error; }
|
|
66
|
+
}
|
|
67
|
+
if (location.type !== LocationType_1.LocationType.PlayerBufferArea) {
|
|
68
|
+
moves.push(pile.moveItemsAtOnce({ type: LocationType_1.LocationType.PlayerBufferArea, player: this.player }));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
73
|
+
finally {
|
|
74
|
+
try {
|
|
75
|
+
if (piles_1_1 && !piles_1_1.done && (_a = piles_1.return)) _a.call(piles_1);
|
|
76
|
+
}
|
|
77
|
+
finally { if (e_1) throw e_1.error; }
|
|
78
|
+
}
|
|
79
|
+
if (!piles.some(function (pile) { var _a; return ((_a = pile.getItem()) === null || _a === void 0 ? void 0 : _a.location.type) === LocationType_1.LocationType.PlayerBufferArea; })) {
|
|
80
|
+
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
81
|
+
}
|
|
82
|
+
return moves;
|
|
83
|
+
};
|
|
84
|
+
AthenaEffectRule.prototype.getPiles = function () {
|
|
85
|
+
var piles = new Pantheon_1.Pantheon(this.game, this.player).getPiles();
|
|
86
|
+
var bufferAreaPile = this.material(MaterialType_1.MaterialType.EntityCard)
|
|
87
|
+
.player(this.player)
|
|
88
|
+
.location(LocationType_1.LocationType.PlayerBufferArea)
|
|
89
|
+
.sort(function (item) { return item.location.z; });
|
|
90
|
+
if (bufferAreaPile.length > 0) {
|
|
91
|
+
piles.push(bufferAreaPile);
|
|
92
|
+
}
|
|
93
|
+
return piles;
|
|
94
|
+
};
|
|
95
|
+
AthenaEffectRule.prototype.onCustomMove = function (move) {
|
|
96
|
+
if (move.type === CustomMoveType_1.CustomMoveType.EndEffect) {
|
|
97
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
98
|
+
return pantheon.gainBonus();
|
|
99
|
+
}
|
|
100
|
+
return [];
|
|
101
|
+
};
|
|
102
|
+
return AthenaEffectRule;
|
|
103
|
+
}(Effect_1.PlayerEffectRule));
|
|
104
|
+
exports.AthenaEffectRule = AthenaEffectRule;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InvokeEffectRule } from '../../material/entity/PlaceCardEffectRule';
|
|
2
|
+
import { RuleId } from '../RuleId';
|
|
3
|
+
export declare class BabaiEffectRule extends InvokeEffectRule {
|
|
4
|
+
ruleId: RuleId;
|
|
5
|
+
getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.BabaiEffectRule = void 0;
|
|
19
|
+
var Entity_1 = require("../../material/Entity");
|
|
20
|
+
var PlaceCardEffectRule_1 = require("../../material/entity/PlaceCardEffectRule");
|
|
21
|
+
var LocationType_1 = require("../../material/LocationType");
|
|
22
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
23
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
24
|
+
var RuleId_1 = require("../RuleId");
|
|
25
|
+
var BabaiEffectRule = (function (_super) {
|
|
26
|
+
__extends(BabaiEffectRule, _super);
|
|
27
|
+
function BabaiEffectRule() {
|
|
28
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
+
_this.ruleId = RuleId_1.RuleId.BabaiEffect;
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
BabaiEffectRule.prototype.getCardsToPlace = function () {
|
|
33
|
+
var mythologies = new Pantheon_1.Pantheon(this.game, this.player).missingMythologies;
|
|
34
|
+
return this.material(MaterialType_1.MaterialType.EntityCard)
|
|
35
|
+
.location(LocationType_1.LocationType.PlayerDiscard)
|
|
36
|
+
.id(function (id) { return mythologies.includes((0, Entity_1.entityMythology)(id.front)); });
|
|
37
|
+
};
|
|
38
|
+
return BabaiEffectRule;
|
|
39
|
+
}(PlaceCardEffectRule_1.InvokeEffectRule));
|
|
40
|
+
exports.BabaiEffectRule = BabaiEffectRule;
|