@gamepark/mythologies 0.1.0 → 0.2.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 +4 -1
- package/dist/Memory.js +3 -0
- package/dist/MythologiesRules.d.ts +20 -3
- package/dist/MythologiesRules.js +42 -13
- package/dist/material/Destiny.d.ts +1 -0
- package/dist/material/Destiny.js +17 -0
- package/dist/material/Mythology.js +1 -1
- package/dist/material/Pantheon.d.ts +3 -1
- package/dist/material/Pantheon.js +34 -6
- package/dist/material/entity/Effect.d.ts +13 -7
- package/dist/material/entity/Effect.js +8 -3
- package/dist/material/entity/MoveEffectRule.d.ts +2 -2
- package/dist/material/entity/MoveEffectRule.js +3 -7
- package/dist/material/entity/SacrificeEffectRule.d.ts +1 -0
- package/dist/material/entity/SacrificeEffectRule.js +3 -0
- package/dist/material/entity/SimultaneousMoveEffectRule.d.ts +2 -2
- package/dist/material/entity/SimultaneousMoveEffectRule.js +15 -18
- package/dist/material/entity/chinese/YanluoWang.js +7 -1
- package/dist/material/entity/greek/Cyclops.js +5 -7
- package/dist/material/entity/inca/Amaru.js +32 -1
- package/dist/material/entity/inca/Caiman.js +7 -1
- package/dist/material/entity/inca/Condor.js +7 -1
- package/dist/material/entity/inca/Illapa.js +7 -1
- package/dist/material/entity/inca/Inti.js +33 -1
- package/dist/material/entity/inca/MamaQucha.js +37 -1
- package/dist/material/entity/inca/Pumapunku.js +31 -1
- package/dist/material/entity/inca/Supay.js +7 -1
- package/dist/material/entity/inca/Ukuku.js +13 -1
- package/dist/material/entity/inca/Viracocha.js +7 -1
- package/dist/rules/RuleId.d.ts +10 -1
- package/dist/rules/RuleId.js +9 -0
- package/dist/rules/effects/AthenaEffectRule.js +1 -1
- package/dist/rules/effects/CaimanEffectRule.d.ts +8 -0
- package/dist/rules/effects/CaimanEffectRule.js +76 -0
- package/dist/rules/effects/CentaurEffectRule.js +1 -1
- package/dist/rules/effects/ChimeraEffectRule.js +2 -13
- package/dist/rules/effects/CondorEffectRule.d.ts +8 -0
- package/dist/rules/effects/CondorEffectRule.js +45 -0
- package/dist/rules/effects/CyclopsEffectRule.js +2 -2
- package/dist/rules/effects/GorgonEffectRule.d.ts +0 -4
- package/dist/rules/effects/GorgonEffectRule.js +1 -15
- package/dist/rules/effects/HadesEffectRule.js +2 -12
- package/dist/rules/effects/IllapaEffectRule.d.ts +14 -0
- package/dist/rules/effects/IllapaEffectRule.js +71 -0
- package/dist/rules/effects/RaEffectRule.js +2 -12
- package/dist/rules/effects/SupayEffectRule.d.ts +19 -0
- package/dist/rules/effects/SupayEffectRule.js +78 -0
- package/dist/rules/effects/UkukuEffectRule.d.ts +13 -0
- package/dist/rules/effects/UkukuEffectRule.js +60 -0
- package/dist/rules/effects/ViracochaEffectRule.d.ts +7 -0
- package/dist/rules/effects/ViracochaEffectRule.js +64 -0
- package/dist/rules/effects/YanluoWangEffectRule.d.ts +9 -0
- package/dist/rules/effects/YanluoWangEffectRule.js +104 -0
- package/package.json +2 -2
|
@@ -0,0 +1,71 @@
|
|
|
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.IllapaSacrificeRule = exports.IllapaEffectRule = void 0;
|
|
19
|
+
var lodash_1 = require("lodash");
|
|
20
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
21
|
+
var Entity_1 = require("../../material/Entity");
|
|
22
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
23
|
+
var SimultaneousSacrificeEffectRule_1 = require("../../material/entity/SimultaneousSacrificeEffectRule");
|
|
24
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
25
|
+
var Memory_1 = require("../../Memory");
|
|
26
|
+
var RuleId_1 = require("../RuleId");
|
|
27
|
+
var IllapaEffectRule = (function (_super) {
|
|
28
|
+
__extends(IllapaEffectRule, _super);
|
|
29
|
+
function IllapaEffectRule() {
|
|
30
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
+
_this.ruleId = RuleId_1.RuleId.IllapaEffect;
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
IllapaEffectRule.prototype.getPlayerMoves = function () {
|
|
35
|
+
var _this = this;
|
|
36
|
+
return (0, lodash_1.range)(0, 3).map(function (line) { return _this.customMove(CustomMoveType_1.CustomMoveType.ChooseLine, line); });
|
|
37
|
+
};
|
|
38
|
+
IllapaEffectRule.prototype.onCustomMove = function (move) {
|
|
39
|
+
if (move.type === CustomMoveType_1.CustomMoveType.ChooseLine) {
|
|
40
|
+
this.memorize(Memory_1.Memory.IllapaLine, move.data);
|
|
41
|
+
var players = this.getPlayersHavingToSacrifice(move.data);
|
|
42
|
+
if (players.length) {
|
|
43
|
+
return [this.startSimultaneousRule(RuleId_1.RuleId.IllapaSacrifice, players)];
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return _super.prototype.endEffect.call(this);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return [];
|
|
50
|
+
};
|
|
51
|
+
IllapaEffectRule.prototype.getPlayersHavingToSacrifice = function (line) {
|
|
52
|
+
var _this = this;
|
|
53
|
+
return this.game.players.filter(function (player) { return player !== _this.player && new Pantheon_1.Pantheon(_this.game, player).grid[line].filter(Entity_1.isCreature).length > 0; });
|
|
54
|
+
};
|
|
55
|
+
return IllapaEffectRule;
|
|
56
|
+
}(Effect_1.PlayerEffectRule));
|
|
57
|
+
exports.IllapaEffectRule = IllapaEffectRule;
|
|
58
|
+
var IllapaSacrificeRule = (function (_super) {
|
|
59
|
+
__extends(IllapaSacrificeRule, _super);
|
|
60
|
+
function IllapaSacrificeRule() {
|
|
61
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
62
|
+
}
|
|
63
|
+
IllapaSacrificeRule.prototype.getCardsToSacrifice = function (player) {
|
|
64
|
+
var line = this.remind(Memory_1.Memory.IllapaLine);
|
|
65
|
+
return _super.prototype.getCardsToSacrifice.call(this, player)
|
|
66
|
+
.id(function (id) { return (0, Entity_1.isCreature)(id.front); })
|
|
67
|
+
.location(function (l) { return l.y === line; });
|
|
68
|
+
};
|
|
69
|
+
return IllapaSacrificeRule;
|
|
70
|
+
}(SimultaneousSacrificeEffectRule_1.SimultaneousSacrificeEffectRule));
|
|
71
|
+
exports.IllapaSacrificeRule = IllapaSacrificeRule;
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ItemMove, Material, MaterialMove } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerEffectRule } from '../../material/entity/Effect';
|
|
3
|
+
import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
|
|
4
|
+
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
5
|
+
import { RuleId } from '../RuleId';
|
|
6
|
+
export declare class SupayEffectRule extends PlayerEffectRule {
|
|
7
|
+
ruleId: RuleId;
|
|
8
|
+
playEffect(): MaterialMove[];
|
|
9
|
+
getCreaturesInLine(): Material<number, number, number>;
|
|
10
|
+
getRules(): (SupayMoveRule | SupaySacrificeRule)[];
|
|
11
|
+
getPlayerMoves(): MaterialMove[];
|
|
12
|
+
afterItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
|
|
13
|
+
}
|
|
14
|
+
export declare class SupaySacrificeRule extends SacrificeEffectRule {
|
|
15
|
+
getCardsToSacrifice(): Material;
|
|
16
|
+
}
|
|
17
|
+
export declare class SupayMoveRule extends MoveEffectRule {
|
|
18
|
+
getMovingCards(): Material;
|
|
19
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
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.SupayMoveRule = exports.SupaySacrificeRule = exports.SupayEffectRule = void 0;
|
|
19
|
+
var Entity_1 = require("../../material/Entity");
|
|
20
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
21
|
+
var MoveEffectRule_1 = require("../../material/entity/MoveEffectRule");
|
|
22
|
+
var SacrificeEffectRule_1 = require("../../material/entity/SacrificeEffectRule");
|
|
23
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
24
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
25
|
+
var RuleId_1 = require("../RuleId");
|
|
26
|
+
var SupayEffectRule = (function (_super) {
|
|
27
|
+
__extends(SupayEffectRule, _super);
|
|
28
|
+
function SupayEffectRule() {
|
|
29
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
30
|
+
_this.ruleId = RuleId_1.RuleId.SupayEffect;
|
|
31
|
+
return _this;
|
|
32
|
+
}
|
|
33
|
+
SupayEffectRule.prototype.playEffect = function () {
|
|
34
|
+
return this.getCreaturesInLine().length ? _super.prototype.playEffect.call(this) : [];
|
|
35
|
+
};
|
|
36
|
+
SupayEffectRule.prototype.getCreaturesInLine = function () {
|
|
37
|
+
var supayIndex = this.getEffect().cardIndex;
|
|
38
|
+
var card = this.material(MaterialType_1.MaterialType.EntityCard).getItem(supayIndex);
|
|
39
|
+
var player = card.location.player;
|
|
40
|
+
return new Pantheon_1.Pantheon(this.game, player).visibleEntities
|
|
41
|
+
.location(function (l) { return l.y === card.location.y; })
|
|
42
|
+
.index(function (index) { return index !== supayIndex; })
|
|
43
|
+
.id(function (id) { return (0, Entity_1.isCreature)(id.front); });
|
|
44
|
+
};
|
|
45
|
+
SupayEffectRule.prototype.getRules = function () {
|
|
46
|
+
return [new SupayMoveRule(this.game), new SupaySacrificeRule(this.game)];
|
|
47
|
+
};
|
|
48
|
+
SupayEffectRule.prototype.getPlayerMoves = function () {
|
|
49
|
+
return this.getRules().flatMap(function (rule) { return rule.getPlayerMoves(); });
|
|
50
|
+
};
|
|
51
|
+
SupayEffectRule.prototype.afterItemMove = function (move) {
|
|
52
|
+
return this.getRules().flatMap(function (rule) { return rule.afterItemMove(move); });
|
|
53
|
+
};
|
|
54
|
+
return SupayEffectRule;
|
|
55
|
+
}(Effect_1.PlayerEffectRule));
|
|
56
|
+
exports.SupayEffectRule = SupayEffectRule;
|
|
57
|
+
var SupaySacrificeRule = (function (_super) {
|
|
58
|
+
__extends(SupaySacrificeRule, _super);
|
|
59
|
+
function SupaySacrificeRule() {
|
|
60
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
61
|
+
}
|
|
62
|
+
SupaySacrificeRule.prototype.getCardsToSacrifice = function () {
|
|
63
|
+
return new SupayEffectRule(this.game).getCreaturesInLine();
|
|
64
|
+
};
|
|
65
|
+
return SupaySacrificeRule;
|
|
66
|
+
}(SacrificeEffectRule_1.SacrificeEffectRule));
|
|
67
|
+
exports.SupaySacrificeRule = SupaySacrificeRule;
|
|
68
|
+
var SupayMoveRule = (function (_super) {
|
|
69
|
+
__extends(SupayMoveRule, _super);
|
|
70
|
+
function SupayMoveRule() {
|
|
71
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
72
|
+
}
|
|
73
|
+
SupayMoveRule.prototype.getMovingCards = function () {
|
|
74
|
+
return new SupayEffectRule(this.game).getCreaturesInLine();
|
|
75
|
+
};
|
|
76
|
+
return SupayMoveRule;
|
|
77
|
+
}(MoveEffectRule_1.MoveEffectRule));
|
|
78
|
+
exports.SupayMoveRule = SupayMoveRule;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ItemMove } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerEffectRule } from '../../material/entity/Effect';
|
|
3
|
+
import { PlaceCardEffectRule } from '../../material/entity/PlaceCardEffectRule';
|
|
4
|
+
import { RuleId } from '../RuleId';
|
|
5
|
+
export declare class UkukuEffectRule extends PlayerEffectRule {
|
|
6
|
+
ruleId: RuleId;
|
|
7
|
+
getPlayerMoves(): import("@gamepark/rules-api").MoveItem<number, number, number>[];
|
|
8
|
+
afterItemMove(move: ItemMove): import("@gamepark/rules-api").StartRule<RuleId.UkukuPlaceEffect>[];
|
|
9
|
+
}
|
|
10
|
+
export declare class UkukuPlaceEffectRule extends PlaceCardEffectRule {
|
|
11
|
+
getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
12
|
+
getAvailableDestinations(cardIndex: number): import("@gamepark/rules-api").XYCoordinates[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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.UkukuPlaceEffectRule = exports.UkukuEffectRule = void 0;
|
|
19
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var Destiny_1 = require("../../material/Destiny");
|
|
21
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
22
|
+
var PlaceCardEffectRule_1 = require("../../material/entity/PlaceCardEffectRule");
|
|
23
|
+
var LocationType_1 = require("../../material/LocationType");
|
|
24
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
25
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
26
|
+
var RuleId_1 = require("../RuleId");
|
|
27
|
+
var UkukuEffectRule = (function (_super) {
|
|
28
|
+
__extends(UkukuEffectRule, _super);
|
|
29
|
+
function UkukuEffectRule() {
|
|
30
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
+
_this.ruleId = RuleId_1.RuleId.UkukuEffect;
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
UkukuEffectRule.prototype.getPlayerMoves = function () {
|
|
35
|
+
return new Destiny_1.Destiny(this.game).creaturesOnTopOfDecks.moveItems({ type: LocationType_1.LocationType.PlayerBufferArea, player: this.player });
|
|
36
|
+
};
|
|
37
|
+
UkukuEffectRule.prototype.afterItemMove = function (move) {
|
|
38
|
+
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerBufferArea) {
|
|
39
|
+
return [this.startRule(RuleId_1.RuleId.UkukuPlaceEffect)];
|
|
40
|
+
}
|
|
41
|
+
return [];
|
|
42
|
+
};
|
|
43
|
+
return UkukuEffectRule;
|
|
44
|
+
}(Effect_1.PlayerEffectRule));
|
|
45
|
+
exports.UkukuEffectRule = UkukuEffectRule;
|
|
46
|
+
var UkukuPlaceEffectRule = (function (_super) {
|
|
47
|
+
__extends(UkukuPlaceEffectRule, _super);
|
|
48
|
+
function UkukuPlaceEffectRule() {
|
|
49
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
50
|
+
}
|
|
51
|
+
UkukuPlaceEffectRule.prototype.getCardsToPlace = function () {
|
|
52
|
+
return this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.PlayerBufferArea).player(this.player);
|
|
53
|
+
};
|
|
54
|
+
UkukuPlaceEffectRule.prototype.getAvailableDestinations = function (cardIndex) {
|
|
55
|
+
var ukuku = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex);
|
|
56
|
+
return new Pantheon_1.Pantheon(this.game, this.player).legalSpaces.filter(function (space) { return space.x === ukuku.location.x; });
|
|
57
|
+
};
|
|
58
|
+
return UkukuPlaceEffectRule;
|
|
59
|
+
}(PlaceCardEffectRule_1.PlaceCardEffectRule));
|
|
60
|
+
exports.UkukuPlaceEffectRule = UkukuPlaceEffectRule;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
2
|
+
import { RuleId } from '../RuleId';
|
|
3
|
+
export declare class ViracochaEffectRule extends SacrificeEffectRule {
|
|
4
|
+
ruleId: RuleId;
|
|
5
|
+
getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
6
|
+
onSacrifice(): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.ViracochaEffectRule = void 0;
|
|
44
|
+
var Entity_1 = require("../../material/Entity");
|
|
45
|
+
var SacrificeEffectRule_1 = require("../../material/entity/SacrificeEffectRule");
|
|
46
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
47
|
+
var RuleId_1 = require("../RuleId");
|
|
48
|
+
var ViracochaEffectRule = (function (_super) {
|
|
49
|
+
__extends(ViracochaEffectRule, _super);
|
|
50
|
+
function ViracochaEffectRule() {
|
|
51
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
52
|
+
_this.ruleId = RuleId_1.RuleId.ViracochaEffect;
|
|
53
|
+
return _this;
|
|
54
|
+
}
|
|
55
|
+
ViracochaEffectRule.prototype.getCardsToSacrifice = function () {
|
|
56
|
+
return _super.prototype.getCardsToSacrifice.call(this).id(function (id) { return (0, Entity_1.isCreature)(id.front); });
|
|
57
|
+
};
|
|
58
|
+
ViracochaEffectRule.prototype.onSacrifice = function () {
|
|
59
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
60
|
+
return __spreadArray([pantheon.gainGems(2)], __read(this.endEffect()), false);
|
|
61
|
+
};
|
|
62
|
+
return ViracochaEffectRule;
|
|
63
|
+
}(SacrificeEffectRule_1.SacrificeEffectRule));
|
|
64
|
+
exports.ViracochaEffectRule = ViracochaEffectRule;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ItemMove, MaterialMove } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerEffectRule } from '../../material/entity/Effect';
|
|
3
|
+
import { RuleId } from '../RuleId';
|
|
4
|
+
export declare class YanluoWangEffectRule extends PlayerEffectRule {
|
|
5
|
+
ruleId: RuleId;
|
|
6
|
+
onRuleStart(): import("@gamepark/rules-api").CustomMove<number>[];
|
|
7
|
+
getPlayerMoves(): MaterialMove<number, number, number, number>[];
|
|
8
|
+
afterItemMove(move: ItemMove): import("@gamepark/rules-api").MoveItem<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.YanluoWangEffectRule = void 0;
|
|
30
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
31
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
32
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
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 YanluoWangEffectRule = (function (_super) {
|
|
39
|
+
__extends(YanluoWangEffectRule, _super);
|
|
40
|
+
function YanluoWangEffectRule() {
|
|
41
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
42
|
+
_this.ruleId = RuleId_1.RuleId.YanluoWangEffect;
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
YanluoWangEffectRule.prototype.onRuleStart = function () {
|
|
46
|
+
var e_1, _a;
|
|
47
|
+
if (new Pantheon_1.Pantheon(this.game, this.player).gems) {
|
|
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 (player !== this.player) {
|
|
52
|
+
var emptySpace = new Pantheon_1.Pantheon(this.game, player).grid[2].filter(function (space) { return space === undefined; }).length;
|
|
53
|
+
this.memorize(Memory_1.Memory.YanluoWangCount, emptySpace, player);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
58
|
+
finally {
|
|
59
|
+
try {
|
|
60
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
61
|
+
}
|
|
62
|
+
finally { if (e_1) throw e_1.error; }
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
YanluoWangEffectRule.prototype.getPlayerMoves = function () {
|
|
71
|
+
var e_2, _a;
|
|
72
|
+
var moves = [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
73
|
+
var gems = this.material(MaterialType_1.MaterialType.GemToken).location(LocationType_1.LocationType.PlayerGems).player(this.player);
|
|
74
|
+
if (gems.getQuantity() > 0) {
|
|
75
|
+
try {
|
|
76
|
+
for (var _b = __values(this.game.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
77
|
+
var player = _c.value;
|
|
78
|
+
if (this.remind(Memory_1.Memory.YanluoWangCount, player) && new Pantheon_1.Pantheon(this.game, player).favor) {
|
|
79
|
+
moves.push(gems.moveItem({ type: LocationType_1.LocationType.PlayerGems, player: player }, 1));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
84
|
+
finally {
|
|
85
|
+
try {
|
|
86
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
87
|
+
}
|
|
88
|
+
finally { if (e_2) throw e_2.error; }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return moves;
|
|
92
|
+
};
|
|
93
|
+
YanluoWangEffectRule.prototype.afterItemMove = function (move) {
|
|
94
|
+
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.GemToken)(move)) {
|
|
95
|
+
var player = move.location.player;
|
|
96
|
+
this.memorize(Memory_1.Memory.YanluoWangCount, function (count) { return count - 1; }, player);
|
|
97
|
+
var favor = this.material(MaterialType_1.MaterialType.FavorToken).location(LocationType_1.LocationType.PlayerFavor).player(player);
|
|
98
|
+
return [favor.moveItem({ type: LocationType_1.LocationType.PlayerFavor, player: this.player }, 1)];
|
|
99
|
+
}
|
|
100
|
+
return [];
|
|
101
|
+
};
|
|
102
|
+
return YanluoWangEffectRule;
|
|
103
|
+
}(Effect_1.PlayerEffectRule));
|
|
104
|
+
exports.YanluoWangEffectRule = YanluoWangEffectRule;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/mythologies",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "The rules of Mythologies adapted for Game Park",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"i18next": "^22.0.3",
|
|
30
30
|
"lodash": "^4.17.21"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "de5a3ab0f3d679595718820f22bac06791fb7eb9"
|
|
33
33
|
}
|