@gamepark/mythologies 0.9.0 → 0.9.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 +1 -1
- package/dist/CustomMoveType.js +1 -1
- package/dist/Memory.d.ts +1 -1
- package/dist/Memory.js +1 -1
- package/dist/MythologiesRules.d.ts +2 -1
- package/dist/MythologiesRules.js +1 -0
- package/dist/rules/RuleId.d.ts +1 -0
- package/dist/rules/RuleId.js +1 -0
- package/dist/rules/effects/GarudaEffectRule.d.ts +9 -3
- package/dist/rules/effects/GarudaEffectRule.js +31 -7
- package/dist/rules/effects/IllapaEffectRule.js +6 -6
- package/dist/rules/effects/MinotaurEffectRule.js +3 -3
- package/package.json +2 -2
package/dist/CustomMoveType.d.ts
CHANGED
package/dist/CustomMoveType.js
CHANGED
|
@@ -9,6 +9,6 @@ var CustomMoveType;
|
|
|
9
9
|
CustomMoveType[CustomMoveType["PlayEffect"] = 4] = "PlayEffect";
|
|
10
10
|
CustomMoveType[CustomMoveType["EndEffect"] = 5] = "EndEffect";
|
|
11
11
|
CustomMoveType[CustomMoveType["ChooseMythology"] = 6] = "ChooseMythology";
|
|
12
|
-
CustomMoveType[CustomMoveType["
|
|
12
|
+
CustomMoveType[CustomMoveType["ChoosePlan"] = 7] = "ChoosePlan";
|
|
13
13
|
CustomMoveType[CustomMoveType["ChooseEntityCard"] = 8] = "ChooseEntityCard";
|
|
14
14
|
})(CustomMoveType = exports.CustomMoveType || (exports.CustomMoveType = {}));
|
package/dist/Memory.d.ts
CHANGED
package/dist/Memory.js
CHANGED
|
@@ -13,6 +13,6 @@ var Memory;
|
|
|
13
13
|
Memory[Memory["EffectCount"] = 8] = "EffectCount";
|
|
14
14
|
Memory[Memory["EntityMoved"] = 9] = "EntityMoved";
|
|
15
15
|
Memory[Memory["TargetMythology"] = 10] = "TargetMythology";
|
|
16
|
-
Memory[Memory["
|
|
16
|
+
Memory[Memory["TargetPlan"] = 11] = "TargetPlan";
|
|
17
17
|
Memory[Memory["TargetLocations"] = 12] = "TargetLocations";
|
|
18
18
|
})(Memory = exports.Memory || (exports.Memory = {}));
|
|
@@ -20,7 +20,7 @@ import { DullahanEffectRule } from './rules/effects/DullahanEffectRule';
|
|
|
20
20
|
import { FairyEffectRule } from './rules/effects/FairyEffectRule';
|
|
21
21
|
import { FenghuangEffectRule } from './rules/effects/FenghuangEffectRule';
|
|
22
22
|
import { FenrirChoiceRule, FenrirEffectRule } from './rules/effects/FenrirEffectRule';
|
|
23
|
-
import { GarudaEffectRule } from './rules/effects/GarudaEffectRule';
|
|
23
|
+
import { GarudaEffectRule, GarudaSacrificeRule } from './rules/effects/GarudaEffectRule';
|
|
24
24
|
import { GorgonEffectRule } from './rules/effects/GorgonEffectRule';
|
|
25
25
|
import { GriffinEffectRule } from './rules/effects/GriffinEffectRule';
|
|
26
26
|
import { HadesEffectRule } from './rules/effects/HadesEffectRule';
|
|
@@ -88,6 +88,7 @@ export declare class MythologiesRules extends SecretMaterialRules<PlayerColor, M
|
|
|
88
88
|
33: typeof ShivaEffectRule;
|
|
89
89
|
34: typeof RakshasaEffectRule;
|
|
90
90
|
35: typeof GarudaEffectRule;
|
|
91
|
+
62: typeof GarudaSacrificeRule;
|
|
91
92
|
36: typeof VetalaEffectRule;
|
|
92
93
|
37: typeof KinnaraEffectRule;
|
|
93
94
|
38: typeof KinnaraPlaceEffectRule;
|
package/dist/MythologiesRules.js
CHANGED
|
@@ -115,6 +115,7 @@ var MythologiesRules = (function (_super) {
|
|
|
115
115
|
_a[RuleId_1.RuleId.ShivaEffect] = ShivaEffectRule_1.ShivaEffectRule,
|
|
116
116
|
_a[RuleId_1.RuleId.RakshasaEffect] = RakshasaEffectRule_1.RakshasaEffectRule,
|
|
117
117
|
_a[RuleId_1.RuleId.GarudaEffect] = GarudaEffectRule_1.GarudaEffectRule,
|
|
118
|
+
_a[RuleId_1.RuleId.GarudaSacrifice] = GarudaEffectRule_1.GarudaSacrificeRule,
|
|
118
119
|
_a[RuleId_1.RuleId.VetalaEffect] = VetalaEffectRule_1.VetalaEffectRule,
|
|
119
120
|
_a[RuleId_1.RuleId.KinnaraEffect] = KinnaraEffectRule_1.KinnaraEffectRule,
|
|
120
121
|
_a[RuleId_1.RuleId.KinnaraPlaceEffect] = KinnaraEffectRule_1.KinnaraPlaceEffectRule,
|
package/dist/rules/RuleId.d.ts
CHANGED
package/dist/rules/RuleId.js
CHANGED
|
@@ -61,6 +61,7 @@ var RuleId;
|
|
|
61
61
|
RuleId[RuleId["LeprechaunEffect"] = 59] = "LeprechaunEffect";
|
|
62
62
|
RuleId[RuleId["SelkieEffect"] = 60] = "SelkieEffect";
|
|
63
63
|
RuleId[RuleId["DullahanEffect"] = 61] = "DullahanEffect";
|
|
64
|
+
RuleId[RuleId["GarudaSacrifice"] = 62] = "GarudaSacrifice";
|
|
64
65
|
RuleId[RuleId["Mythology"] = 1000] = "Mythology";
|
|
65
66
|
RuleId[RuleId["Creature"] = 1001] = "Creature";
|
|
66
67
|
RuleId[RuleId["Divinity"] = 1002] = "Divinity";
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { MaterialMove } from '@gamepark/rules-api';
|
|
1
|
+
import { CustomMove, MaterialMove } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
|
|
2
3
|
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
3
4
|
import { RuleId } from '../RuleId';
|
|
4
|
-
export declare class GarudaEffectRule extends
|
|
5
|
+
export declare class GarudaEffectRule extends PlayerEffectRule {
|
|
6
|
+
ruleId: RuleId;
|
|
7
|
+
getPlayerMoves(): CustomMove<number>[];
|
|
8
|
+
onCustomMove(move: CustomMove): MaterialMove<number, number, number, number>[];
|
|
9
|
+
}
|
|
10
|
+
export declare class GarudaSacrificeRule extends SacrificeEffectRule {
|
|
5
11
|
ruleId: RuleId;
|
|
6
12
|
onRuleStart(): MaterialMove<number, number, number, number>[];
|
|
7
13
|
getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
|
-
onSacrifice():
|
|
14
|
+
onSacrifice(): CustomMove<number>[];
|
|
9
15
|
}
|
|
@@ -40,9 +40,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
40
40
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
41
41
|
};
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.GarudaEffectRule = void 0;
|
|
43
|
+
exports.GarudaSacrificeRule = exports.GarudaEffectRule = void 0;
|
|
44
|
+
var lodash_1 = require("lodash");
|
|
44
45
|
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
45
46
|
var Entity_1 = require("../../material/Entity");
|
|
47
|
+
var PlayerEffectRule_1 = require("../../material/entity/PlayerEffectRule");
|
|
46
48
|
var SacrificeEffectRule_1 = require("../../material/entity/SacrificeEffectRule");
|
|
47
49
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
48
50
|
var Memory_1 = require("../../Memory");
|
|
@@ -54,7 +56,28 @@ var GarudaEffectRule = (function (_super) {
|
|
|
54
56
|
_this.ruleId = RuleId_1.RuleId.GarudaEffect;
|
|
55
57
|
return _this;
|
|
56
58
|
}
|
|
57
|
-
GarudaEffectRule.prototype.
|
|
59
|
+
GarudaEffectRule.prototype.getPlayerMoves = function () {
|
|
60
|
+
var _this = this;
|
|
61
|
+
return (0, lodash_1.range)(0, 3).map(function (line) { return _this.customMove(CustomMoveType_1.CustomMoveType.ChoosePlan, line); });
|
|
62
|
+
};
|
|
63
|
+
GarudaEffectRule.prototype.onCustomMove = function (move) {
|
|
64
|
+
if (move.type === CustomMoveType_1.CustomMoveType.ChoosePlan) {
|
|
65
|
+
this.memorize(Memory_1.Memory.TargetPlan, move.data);
|
|
66
|
+
return [this.startRule(RuleId_1.RuleId.GarudaSacrifice)];
|
|
67
|
+
}
|
|
68
|
+
return _super.prototype.onCustomMove.call(this, move);
|
|
69
|
+
};
|
|
70
|
+
return GarudaEffectRule;
|
|
71
|
+
}(PlayerEffectRule_1.PlayerEffectRule));
|
|
72
|
+
exports.GarudaEffectRule = GarudaEffectRule;
|
|
73
|
+
var GarudaSacrificeRule = (function (_super) {
|
|
74
|
+
__extends(GarudaSacrificeRule, _super);
|
|
75
|
+
function GarudaSacrificeRule() {
|
|
76
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
_this.ruleId = RuleId_1.RuleId.GarudaSacrifice;
|
|
78
|
+
return _this;
|
|
79
|
+
}
|
|
80
|
+
GarudaSacrificeRule.prototype.onRuleStart = function () {
|
|
58
81
|
var count = this.getCardsToSacrifice().length;
|
|
59
82
|
if (!count)
|
|
60
83
|
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
@@ -66,11 +89,12 @@ var GarudaEffectRule = (function (_super) {
|
|
|
66
89
|
}
|
|
67
90
|
return moves;
|
|
68
91
|
};
|
|
69
|
-
|
|
92
|
+
GarudaSacrificeRule.prototype.getCardsToSacrifice = function () {
|
|
70
93
|
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
71
|
-
|
|
94
|
+
var plan = this.remind(Memory_1.Memory.TargetPlan);
|
|
95
|
+
return pantheon.visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front); }).location(function (l) { return l.y === plan; });
|
|
72
96
|
};
|
|
73
|
-
|
|
97
|
+
GarudaSacrificeRule.prototype.onSacrifice = function () {
|
|
74
98
|
var sacrificeLeft = this.memorize(Memory_1.Memory.EffectCount, function (count) { return count - 1; });
|
|
75
99
|
if (sacrificeLeft) {
|
|
76
100
|
return [];
|
|
@@ -80,6 +104,6 @@ var GarudaEffectRule = (function (_super) {
|
|
|
80
104
|
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
81
105
|
}
|
|
82
106
|
};
|
|
83
|
-
return
|
|
107
|
+
return GarudaSacrificeRule;
|
|
84
108
|
}(SacrificeEffectRule_1.SacrificeEffectRule));
|
|
85
|
-
exports.
|
|
109
|
+
exports.GarudaSacrificeRule = GarudaSacrificeRule;
|
|
@@ -33,14 +33,14 @@ var IllapaEffectRule = (function (_super) {
|
|
|
33
33
|
}
|
|
34
34
|
IllapaEffectRule.prototype.getPlayerMoves = function () {
|
|
35
35
|
var _this = this;
|
|
36
|
-
return (0, lodash_1.range)(0, 3).map(function (line) { return _this.customMove(CustomMoveType_1.CustomMoveType.
|
|
36
|
+
return (0, lodash_1.range)(0, 3).map(function (line) { return _this.customMove(CustomMoveType_1.CustomMoveType.ChoosePlan, line); });
|
|
37
37
|
};
|
|
38
38
|
IllapaEffectRule.prototype.onCustomMove = function (move) {
|
|
39
|
-
if (move.type === CustomMoveType_1.CustomMoveType.
|
|
40
|
-
this.memorize(Memory_1.Memory.
|
|
39
|
+
if (move.type === CustomMoveType_1.CustomMoveType.ChoosePlan) {
|
|
40
|
+
this.memorize(Memory_1.Memory.TargetPlan, move.data);
|
|
41
41
|
var moves = new IllapaSacrificeRule(this.game).playEffect();
|
|
42
42
|
if (!moves.some(rules_api_1.isStartSimultaneousRule)) {
|
|
43
|
-
this.forget(Memory_1.Memory.
|
|
43
|
+
this.forget(Memory_1.Memory.TargetPlan);
|
|
44
44
|
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
45
45
|
}
|
|
46
46
|
return moves;
|
|
@@ -62,13 +62,13 @@ var IllapaSacrificeRule = (function (_super) {
|
|
|
62
62
|
return this.game.players.filter(function (player) { return _this.isOpponent(player); });
|
|
63
63
|
};
|
|
64
64
|
IllapaSacrificeRule.prototype.getCardsToSacrifice = function (player) {
|
|
65
|
-
var line = this.remind(Memory_1.Memory.
|
|
65
|
+
var line = this.remind(Memory_1.Memory.TargetPlan);
|
|
66
66
|
return _super.prototype.getCardsToSacrifice.call(this, player)
|
|
67
67
|
.id(function (id) { return (0, Entity_1.isCreature)(id.front); })
|
|
68
68
|
.location(function (l) { return l.y === line; });
|
|
69
69
|
};
|
|
70
70
|
IllapaSacrificeRule.prototype.onRuleEnd = function () {
|
|
71
|
-
this.forget(Memory_1.Memory.
|
|
71
|
+
this.forget(Memory_1.Memory.TargetPlan);
|
|
72
72
|
return [];
|
|
73
73
|
};
|
|
74
74
|
return IllapaSacrificeRule;
|
|
@@ -29,19 +29,19 @@ var MinotaurEffectRule = (function (_super) {
|
|
|
29
29
|
return _this;
|
|
30
30
|
}
|
|
31
31
|
MinotaurEffectRule.prototype.onRuleStart = function () {
|
|
32
|
-
this.memorize(Memory_1.Memory.
|
|
32
|
+
this.memorize(Memory_1.Memory.TargetPlan, this.card.location.x);
|
|
33
33
|
return _super.prototype.onRuleStart.call(this);
|
|
34
34
|
};
|
|
35
35
|
MinotaurEffectRule.prototype.getMovingCards = function (player) {
|
|
36
36
|
var _a;
|
|
37
|
-
var column = (_a = this.remind(Memory_1.Memory.
|
|
37
|
+
var column = (_a = this.remind(Memory_1.Memory.TargetPlan)) !== null && _a !== void 0 ? _a : this.card.location.x;
|
|
38
38
|
return new Pantheon_1.Pantheon(this.game, player).visibleEntities.location(function (l) { return l.x === column; }).id(function (id) { return (0, Entity_1.isCreature)(id.front); });
|
|
39
39
|
};
|
|
40
40
|
MinotaurEffectRule.prototype.isLegalDestination = function (space, cardLocation) {
|
|
41
41
|
return space.y === cardLocation.y;
|
|
42
42
|
};
|
|
43
43
|
MinotaurEffectRule.prototype.onRuleEnd = function () {
|
|
44
|
-
this.forget(Memory_1.Memory.
|
|
44
|
+
this.forget(Memory_1.Memory.TargetPlan);
|
|
45
45
|
return [];
|
|
46
46
|
};
|
|
47
47
|
return MinotaurEffectRule;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/mythologies",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.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": "cdaa47a4987136923f50a43789aec7b595810d3a"
|
|
33
33
|
}
|