@gamepark/mythologies 0.1.0 → 0.2.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 +3 -1
- package/dist/Memory.js +2 -0
- package/dist/MythologiesRules.d.ts +18 -3
- package/dist/MythologiesRules.js +40 -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 +32 -5
- 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/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 +9 -1
- package/dist/rules/RuleId.js +8 -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/IllapaEffectRule.d.ts +14 -0
- package/dist/rules/effects/IllapaEffectRule.js +71 -0
- 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/package.json +2 -2
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/mythologies",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
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": "a9d4070ed2adea2a03d0e61312b0b947c70341c9"
|
|
33
33
|
}
|