@gamepark/mythologies 1.0.4 → 1.0.5
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/MythologiesRules.d.ts +3 -2
- package/dist/MythologiesRules.js +12 -2
- package/dist/material/entity/greek/Cyclops.js +4 -2
- package/dist/rules/RuleId.d.ts +2 -1
- package/dist/rules/RuleId.js +1 -0
- package/dist/rules/effects/CaimanEffectRule.d.ts +11 -3
- package/dist/rules/effects/CaimanEffectRule.js +43 -17
- package/dist/rules/effects/ResolveEffectsRule.js +2 -3
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ import { AmmoutEffectRule } from './rules/effects/AmmoutEffectRule';
|
|
|
9
9
|
import { AnubisEffectRule } from './rules/effects/AnubisEffectRule';
|
|
10
10
|
import { AthenaEffectRule } from './rules/effects/AthenaEffectRule';
|
|
11
11
|
import { BennuEffectRule } from './rules/effects/BennuEffectRule';
|
|
12
|
-
import { CaimanEffectRule } from './rules/effects/CaimanEffectRule';
|
|
12
|
+
import { CaimanEffectRule, CaimanSacrificeEffectRule } from './rules/effects/CaimanEffectRule';
|
|
13
13
|
import { CentaurEffectRule, CentaurEffectSacrificeRule } from './rules/effects/CentaurEffectRule';
|
|
14
14
|
import { ChimeraEffectRule } from './rules/effects/ChimeraEffectRule';
|
|
15
15
|
import { CobraEffectRule, CobraSummonEffect } from './rules/effects/CobraEffectRule';
|
|
@@ -98,6 +98,7 @@ export declare class MythologiesRules extends SecretMaterialRules<PlayerColor, M
|
|
|
98
98
|
41: typeof IllapaEffectRule;
|
|
99
99
|
42: typeof IllapaSacrificeRule;
|
|
100
100
|
43: typeof CaimanEffectRule;
|
|
101
|
+
64: typeof CaimanSacrificeEffectRule;
|
|
101
102
|
44: typeof CondorEffectRule;
|
|
102
103
|
45: typeof SupayEffectRule;
|
|
103
104
|
46: typeof UkukuEffectRule;
|
|
@@ -143,7 +144,7 @@ export declare class MythologiesRules extends SecretMaterialRules<PlayerColor, M
|
|
|
143
144
|
6: (item: MaterialItem, player?: PlayerColor) => string[];
|
|
144
145
|
};
|
|
145
146
|
4: {
|
|
146
|
-
5: import("@gamepark/rules-api").HidingStrategy
|
|
147
|
+
5: import("@gamepark/rules-api").HidingStrategy;
|
|
147
148
|
17: (item: MaterialItem) => string[];
|
|
148
149
|
};
|
|
149
150
|
10: {
|
package/dist/MythologiesRules.js
CHANGED
|
@@ -13,7 +13,7 @@ import { AmmoutEffectRule } from './rules/effects/AmmoutEffectRule';
|
|
|
13
13
|
import { AnubisEffectRule } from './rules/effects/AnubisEffectRule';
|
|
14
14
|
import { AthenaEffectRule } from './rules/effects/AthenaEffectRule';
|
|
15
15
|
import { BennuEffectRule } from './rules/effects/BennuEffectRule';
|
|
16
|
-
import { CaimanEffectRule } from './rules/effects/CaimanEffectRule';
|
|
16
|
+
import { CaimanEffectRule, CaimanSacrificeEffectRule } from './rules/effects/CaimanEffectRule';
|
|
17
17
|
import { CentaurEffectRule, CentaurEffectSacrificeRule } from './rules/effects/CentaurEffectRule';
|
|
18
18
|
import { ChimeraEffectRule } from './rules/effects/ChimeraEffectRule';
|
|
19
19
|
import { CobraEffectRule, CobraSummonEffect } from './rules/effects/CobraEffectRule';
|
|
@@ -103,6 +103,7 @@ export class MythologiesRules extends SecretMaterialRules {
|
|
|
103
103
|
[RuleId.IllapaEffect]: IllapaEffectRule,
|
|
104
104
|
[RuleId.IllapaSacrifice]: IllapaSacrificeRule,
|
|
105
105
|
[RuleId.CaimanEffect]: CaimanEffectRule,
|
|
106
|
+
[RuleId.CaimanSacrificeEffect]: CaimanSacrificeEffectRule,
|
|
106
107
|
[RuleId.CondorEffect]: CondorEffectRule,
|
|
107
108
|
[RuleId.SupayEffect]: SupayEffectRule,
|
|
108
109
|
[RuleId.UkukuEffect]: UkukuEffectRule,
|
|
@@ -169,18 +170,27 @@ export class MythologiesRules extends SecretMaterialRules {
|
|
|
169
170
|
beforeItemMove(move) {
|
|
170
171
|
if (!this.game.rule)
|
|
171
172
|
return [];
|
|
173
|
+
const consequences = super.beforeItemMove(move);
|
|
172
174
|
if (isMoveItemType(MaterialType.GemToken)(move) && move.location.type === LocationType.PlayerGems) {
|
|
173
175
|
const gem = this.material(MaterialType.GemToken).getItem(move.itemIndex).location;
|
|
174
176
|
const player = gem.player;
|
|
175
177
|
if (gem.type === LocationType.PantheonLineBonus && player === move.location.player) {
|
|
178
|
+
const firstEffect = this.remind(Memory.PendingEffects)[0];
|
|
176
179
|
new TriggerEffectsRule(this.game).triggerEffects({ type: TriggerEventType.LineEvent, eventType: LineEventType.BonusGain, player, y: gem.y });
|
|
180
|
+
if (this.remind(Memory.PendingEffects)[0] !== firstEffect) {
|
|
181
|
+
consequences.push(...new ResolveEffectsRule(this.game).startEffectsResolution());
|
|
182
|
+
}
|
|
177
183
|
}
|
|
178
184
|
}
|
|
179
185
|
if (isMoveItemType(MaterialType.FavorToken)(move) && move.location.type === LocationType.PlayerFavor) {
|
|
180
186
|
const favor = this.material(MaterialType.FavorToken).getItem(move.itemIndex).location;
|
|
181
187
|
const player = favor.player;
|
|
182
188
|
if (favor.type === LocationType.PantheonColumnBonus && player === move.location.player) {
|
|
189
|
+
const firstEffect = this.remind(Memory.PendingEffects)[0];
|
|
183
190
|
new TriggerEffectsRule(this.game).triggerEffects({ type: TriggerEventType.ColumnEvent, eventType: LineEventType.BonusGain, player, x: favor.x });
|
|
191
|
+
if (this.remind(Memory.PendingEffects)[0] !== firstEffect) {
|
|
192
|
+
consequences.push(...new ResolveEffectsRule(this.game).startEffectsResolution());
|
|
193
|
+
}
|
|
184
194
|
}
|
|
185
195
|
}
|
|
186
196
|
if (isMoveItemType(MaterialType.EntityCard)(move) && move.location.type === LocationType.PlayerDiscard) {
|
|
@@ -195,7 +205,7 @@ export class MythologiesRules extends SecretMaterialRules {
|
|
|
195
205
|
new Pantheon(this.game, firstCard.location.player).onPileSacrificed(move.indexes);
|
|
196
206
|
}
|
|
197
207
|
}
|
|
198
|
-
return
|
|
208
|
+
return consequences;
|
|
199
209
|
}
|
|
200
210
|
getAutomaticMoves() {
|
|
201
211
|
if (!this.remind(Memory.OngoingEffect) &&
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { CyclopsEffectRule } from '../../../rules/effects/CyclopsEffectRule';
|
|
2
|
+
import { PlaceCardsRule } from '../../../rules/PlaceCardsRule';
|
|
2
3
|
import { LineEventType, TriggerEventType } from '../Effect';
|
|
3
4
|
export const Cyclops = {
|
|
4
5
|
summon: [{ favor: 1 }, { gem: 1 }, {}],
|
|
5
6
|
effect: {
|
|
6
|
-
trigger: (event, { cardLocation, game }) => {
|
|
7
|
+
trigger: (event, { cardLocation, game, cardIndex }) => {
|
|
7
8
|
const { x, y, player } = cardLocation;
|
|
8
9
|
return (((event.type === TriggerEventType.ColumnEvent && event.x === x) || (event.type === TriggerEventType.LineEvent && event.y === y)) &&
|
|
9
10
|
event.eventType === LineEventType.BonusGain &&
|
|
10
11
|
event.player === player &&
|
|
11
|
-
new CyclopsEffectRule(game).getBonus(event).length > 0
|
|
12
|
+
new CyclopsEffectRule(game).getBonus(event).length > 0 &&
|
|
13
|
+
new PlaceCardsRule(game).isOncePerTurnAvailable(cardIndex));
|
|
12
14
|
},
|
|
13
15
|
rule: CyclopsEffectRule
|
|
14
16
|
}
|
package/dist/rules/RuleId.d.ts
CHANGED
package/dist/rules/RuleId.js
CHANGED
|
@@ -60,4 +60,5 @@ export var RuleId;
|
|
|
60
60
|
RuleId[RuleId["SelkieEffect"] = 61] = "SelkieEffect";
|
|
61
61
|
RuleId[RuleId["DullahanEffect"] = 62] = "DullahanEffect";
|
|
62
62
|
RuleId[RuleId["GarudaSacrifice"] = 63] = "GarudaSacrifice";
|
|
63
|
+
RuleId[RuleId["CaimanSacrificeEffect"] = 64] = "CaimanSacrificeEffect";
|
|
63
64
|
})(RuleId || (RuleId = {}));
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import {
|
|
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 CaimanEffectRule extends
|
|
5
|
+
export declare class CaimanEffectRule extends PlayerEffectRule {
|
|
5
6
|
ruleId: RuleId;
|
|
6
|
-
|
|
7
|
+
getPlayerMoves(): CustomMove[];
|
|
8
|
+
onCustomMove(move: CustomMove): MaterialMove[];
|
|
9
|
+
}
|
|
10
|
+
export declare class CaimanSacrificeEffectRule extends SacrificeEffectRule {
|
|
11
|
+
ruleId: RuleId;
|
|
12
|
+
onRuleStart(): CustomMove[] | import("@gamepark/rules-api").MoveItem<number, number, number>[];
|
|
13
|
+
getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
14
|
+
onSacrifice(): MaterialMove[];
|
|
7
15
|
onRuleEnd(): never[];
|
|
8
16
|
}
|
|
@@ -1,32 +1,58 @@
|
|
|
1
1
|
import { CustomMoveType } from '../../CustomMoveType';
|
|
2
2
|
import { entityMythology } from '../../material/Entity';
|
|
3
|
+
import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
|
|
3
4
|
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
4
|
-
import { LocationType } from '../../material/LocationType';
|
|
5
5
|
import { MaterialType } from '../../material/MaterialType';
|
|
6
6
|
import { Pantheon } from '../../material/Pantheon';
|
|
7
7
|
import { Memory } from '../../Memory';
|
|
8
8
|
import { RuleId } from '../RuleId';
|
|
9
|
-
export class CaimanEffectRule extends
|
|
9
|
+
export class CaimanEffectRule extends PlayerEffectRule {
|
|
10
10
|
ruleId = RuleId.CaimanEffect;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
getPlayerMoves() {
|
|
12
|
+
return this.material(MaterialType.MythologyBoard)
|
|
13
|
+
.getItems()
|
|
14
|
+
.map((item) => this.customMove(CustomMoveType.ChooseMythology, item.id.mythology));
|
|
15
|
+
}
|
|
16
|
+
onCustomMove(move) {
|
|
17
|
+
if (move.type === CustomMoveType.ChooseMythology) {
|
|
18
|
+
this.memorize(Memory.TargetMythology, move.data);
|
|
19
|
+
return [this.startRule(RuleId.CaimanSacrificeEffect)];
|
|
20
|
+
}
|
|
21
|
+
return super.onCustomMove(move);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class CaimanSacrificeEffectRule extends SacrificeEffectRule {
|
|
25
|
+
ruleId = RuleId.CaimanSacrificeEffect;
|
|
26
|
+
onRuleStart() {
|
|
27
|
+
const mythology = this.remind(Memory.TargetMythology);
|
|
28
|
+
const indexes = new Pantheon(this.game, this.player).visibleEntities.id((id) => entityMythology(id.front) === mythology).getIndexes();
|
|
29
|
+
if (!indexes.length)
|
|
30
|
+
return [this.customMove(CustomMoveType.EndEffect)];
|
|
31
|
+
this.memorize(Memory.TargetEntities, indexes);
|
|
32
|
+
this.memorize(Memory.EffectCount, indexes.length);
|
|
33
|
+
const moves = this.getPlayerMoves();
|
|
34
|
+
if (moves.length === indexes.length) {
|
|
35
|
+
return moves;
|
|
36
|
+
}
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
getCardsToSacrifice() {
|
|
40
|
+
const indexes = this.remind(Memory.TargetEntities);
|
|
41
|
+
return this.material(MaterialType.EntityCard).index(indexes);
|
|
42
|
+
}
|
|
43
|
+
onSacrifice() {
|
|
44
|
+
const moves = [];
|
|
45
|
+
moves.push(new Pantheon(this.game, this.player).gainGems(1));
|
|
46
|
+
const remaining = this.memorize(Memory.EffectCount, (count) => count - 1);
|
|
47
|
+
if (!remaining) {
|
|
48
|
+
moves.push(this.customMove(CustomMoveType.EndEffect));
|
|
14
49
|
}
|
|
15
|
-
|
|
16
|
-
const mythology = entityMythology(card.id.front);
|
|
17
|
-
const pantheon = new Pantheon(this.game, this.player);
|
|
18
|
-
const others = pantheon.visibleEntities
|
|
19
|
-
.location((l) => l.x !== card.location.x || l.y !== card.location.y)
|
|
20
|
-
.id((id) => entityMythology(id.front) === mythology);
|
|
21
|
-
this.memorize(Memory.EffectCount, 1 + others.length);
|
|
22
|
-
return [
|
|
23
|
-
...others.moveItems({ type: LocationType.PlayerDiscard, player: this.player }),
|
|
24
|
-
pantheon.gainGems(1 + others.length),
|
|
25
|
-
this.customMove(CustomMoveType.EndEffect)
|
|
26
|
-
];
|
|
50
|
+
return moves;
|
|
27
51
|
}
|
|
28
52
|
onRuleEnd() {
|
|
53
|
+
this.forget(Memory.TargetEntities);
|
|
29
54
|
this.forget(Memory.EffectCount);
|
|
55
|
+
this.forget(Memory.TargetMythology);
|
|
30
56
|
return [];
|
|
31
57
|
}
|
|
32
58
|
}
|
|
@@ -39,6 +39,7 @@ export class ResolveEffectsRule extends PlayerTurnRule {
|
|
|
39
39
|
throw new Error('Unexpected state: start ResolveEffectsRule without pending effects');
|
|
40
40
|
}
|
|
41
41
|
if (pendingEffects.type === PendingEffectsType.SummonGain) {
|
|
42
|
+
this.memorize(Memory.PendingEffects, (effects) => effects.slice(1));
|
|
42
43
|
return [...new Pantheon(this.game, this.player).getSummonGains(pendingEffects.entity, pendingEffects.line), this.customMove(CustomMoveType.EndEffect)];
|
|
43
44
|
}
|
|
44
45
|
const moves = this.getPlayerMoves();
|
|
@@ -93,6 +94,7 @@ export class ResolveEffectsRule extends PlayerTurnRule {
|
|
|
93
94
|
pendingEffects.lines = pendingEffects.lines.filter((line) => line !== item.location.y);
|
|
94
95
|
}
|
|
95
96
|
if (this.getPlayerMoves().length === 0) {
|
|
97
|
+
this.memorize(Memory.PendingEffects, (effects) => effects.slice(1));
|
|
96
98
|
return [this.customMove(CustomMoveType.EndEffect)];
|
|
97
99
|
}
|
|
98
100
|
}
|
|
@@ -136,9 +138,6 @@ export class ResolveEffectsRule extends PlayerTurnRule {
|
|
|
136
138
|
if (this.remind(Memory.OngoingEffect) !== undefined) {
|
|
137
139
|
this.forget(Memory.OngoingEffect);
|
|
138
140
|
}
|
|
139
|
-
else {
|
|
140
|
-
this.memorize(Memory.PendingEffects, (effects) => effects.slice(1));
|
|
141
|
-
}
|
|
142
141
|
if (this.remind(Memory.PendingEffects).length) {
|
|
143
142
|
moves.push(...this.startEffectsResolution());
|
|
144
143
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/mythologies",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "The rules of Mythologies adapted for Game Park",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"@gamepark/rules-api": "~7.2.0",
|
|
29
29
|
"es-toolkit": "^1.44.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "806e4b2d4bb686c0216d8629056df3dbb6008d08"
|
|
32
32
|
}
|