@gamepark/mythologies 1.0.11 → 1.0.13
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.js +3 -15
- package/dist/material/Pantheon.d.ts +1 -1
- package/dist/material/Pantheon.js +4 -2
- package/dist/material/entity/MoveEffectRule.js +1 -0
- package/dist/material/entity/SacrificeEffectRule.d.ts +1 -1
- package/dist/material/entity/SacrificeEffectRule.js +2 -1
- package/dist/material/entity/SimultaneousMoveEffectRule.d.ts +1 -1
- package/dist/material/entity/SimultaneousMoveEffectRule.js +1 -0
- package/dist/material/entity/SimultaneousSacrificeEffectRule.js +1 -0
- package/dist/rules/effects/CaimanEffectRule.d.ts +3 -3
- package/dist/rules/effects/CaimanEffectRule.js +4 -2
- package/dist/rules/effects/CobraEffectRule.js +2 -0
- package/dist/rules/effects/CondorEffectRule.js +1 -0
- package/dist/rules/effects/DullahanEffectRule.d.ts +2 -0
- package/dist/rules/effects/DullahanEffectRule.js +28 -3
- package/dist/rules/effects/FairyEffectRule.d.ts +2 -2
- package/dist/rules/effects/FairyEffectRule.js +2 -1
- package/dist/rules/effects/GarudaEffectRule.d.ts +2 -2
- package/dist/rules/effects/GarudaEffectRule.js +2 -1
- package/dist/rules/effects/GorgonEffectRule.d.ts +2 -1
- package/dist/rules/effects/GorgonEffectRule.js +2 -1
- package/dist/rules/effects/JiangshiEffectRule.js +1 -0
- package/dist/rules/effects/MultipleSimultaneousMoveEffectRule.d.ts +1 -0
- package/dist/rules/effects/MultipleSimultaneousMoveEffectRule.js +21 -4
- package/dist/rules/effects/NuwaEffectRule.js +1 -0
- package/dist/rules/effects/ShivaEffectRule.js +1 -0
- package/dist/rules/effects/TianlongEffectRule.js +1 -1
- package/dist/rules/effects/VetalaEffectRule.d.ts +2 -2
- package/dist/rules/effects/VetalaEffectRule.js +3 -1
- package/dist/rules/effects/ViracochaEffectRule.d.ts +2 -1
- package/dist/rules/effects/ViracochaEffectRule.js +2 -1
- package/package.json +2 -2
package/dist/MythologiesRules.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FillGapStrategy, hideFront, hideFrontToOthers, hideItemId, isMoveItemType,
|
|
1
|
+
import { FillGapStrategy, hideFront, hideFrontToOthers, hideItemId, isMoveItemType, PositiveSequenceStrategy, SecretMaterialRules, StackingStrategy } from '@gamepark/rules-api';
|
|
2
2
|
import { Destiny } from './material/Destiny';
|
|
3
3
|
import { isGod } from './material/Entity';
|
|
4
4
|
import { LineEventType, TriggerEventType } from './material/entity/Effect';
|
|
@@ -177,7 +177,7 @@ export class MythologiesRules extends SecretMaterialRules {
|
|
|
177
177
|
if (gem.type === LocationType.PantheonLineBonus && player === move.location.player) {
|
|
178
178
|
const firstEffect = this.remind(Memory.PendingEffects)[0];
|
|
179
179
|
new TriggerEffectsRule(this.game).triggerEffects({ type: TriggerEventType.LineEvent, eventType: LineEventType.BonusGain, player, y: gem.y });
|
|
180
|
-
if (this.remind(Memory.PendingEffects)[0] !== firstEffect) {
|
|
180
|
+
if (this.remind(Memory.PendingEffects)[0] !== firstEffect && this.game.rule?.id !== RuleId.ResolveEffects) {
|
|
181
181
|
consequences.push(...new ResolveEffectsRule(this.game).startEffectsResolution());
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -188,23 +188,11 @@ export class MythologiesRules extends SecretMaterialRules {
|
|
|
188
188
|
if (favor.type === LocationType.PantheonColumnBonus && player === move.location.player) {
|
|
189
189
|
const firstEffect = this.remind(Memory.PendingEffects)[0];
|
|
190
190
|
new TriggerEffectsRule(this.game).triggerEffects({ type: TriggerEventType.ColumnEvent, eventType: LineEventType.BonusGain, player, x: favor.x });
|
|
191
|
-
if (this.remind(Memory.PendingEffects)[0] !== firstEffect) {
|
|
191
|
+
if (this.remind(Memory.PendingEffects)[0] !== firstEffect && this.game.rule?.id !== RuleId.ResolveEffects) {
|
|
192
192
|
consequences.push(...new ResolveEffectsRule(this.game).startEffectsResolution());
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
if (isMoveItemType(MaterialType.EntityCard)(move) && move.location.type === LocationType.PlayerDiscard) {
|
|
197
|
-
const card = this.material(MaterialType.EntityCard).getItem(move.itemIndex);
|
|
198
|
-
if (card.location.type === LocationType.Pantheon) {
|
|
199
|
-
new Pantheon(this.game, card.location.player).onEntitySacrificed(move.itemIndex);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
if (isMoveItemTypeAtOnce(MaterialType.EntityCard)(move) && move.location.type === LocationType.PlayerDiscard) {
|
|
203
|
-
const firstCard = this.material(MaterialType.EntityCard).getItem(move.indexes[0]);
|
|
204
|
-
if (firstCard.location.type === LocationType.Pantheon) {
|
|
205
|
-
new Pantheon(this.game, firstCard.location.player).onPileSacrificed(move.indexes);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
196
|
return consequences;
|
|
209
197
|
}
|
|
210
198
|
getAutomaticMoves() {
|
|
@@ -42,7 +42,7 @@ export declare class Pantheon extends MaterialRulesPart {
|
|
|
42
42
|
isVisible(entity: EntityItem): boolean;
|
|
43
43
|
get mythologies(): import("./Mythology").Mythology[];
|
|
44
44
|
get missingMythologies(): import("./Mythology").Mythology[];
|
|
45
|
-
|
|
45
|
+
onCardSacrificed(cardIndex: number, updateGrid?: boolean): void;
|
|
46
46
|
onPileSacrificed(indexes: number[]): void;
|
|
47
47
|
isOpponentOngoingEffect(): boolean;
|
|
48
48
|
replaceSacrifice(cards: EntityItem[]): Material<number, number, number>;
|
|
@@ -274,14 +274,16 @@ export class Pantheon extends MaterialRulesPart {
|
|
|
274
274
|
get missingMythologies() {
|
|
275
275
|
return difference(new Destiny(this.game).mythologies, this.mythologies);
|
|
276
276
|
}
|
|
277
|
-
|
|
277
|
+
onCardSacrificed(cardIndex, updateGrid = true) {
|
|
278
278
|
const card = this.material(MaterialType.EntityCard).getItem(cardIndex);
|
|
279
279
|
const { x, y, z } = card.location;
|
|
280
280
|
const grid = this.indexGrid;
|
|
281
281
|
if (grid[y][x] === cardIndex) {
|
|
282
282
|
const cardUnder = this.allCards.location((l) => l.x === x && l.y === y && l.z !== z).maxBy((item) => item.location.z);
|
|
283
283
|
grid[y][x] = cardUnder.length ? cardUnder.getIndex() : null;
|
|
284
|
-
|
|
284
|
+
if (updateGrid) {
|
|
285
|
+
this.memorize(Memory.PlayerGrid, grid, this.player);
|
|
286
|
+
}
|
|
285
287
|
new TriggerEffectsRule(this.game).triggerEffects({ type: TriggerEventType.EntitySacrificed, card: card, cardIndex });
|
|
286
288
|
}
|
|
287
289
|
}
|
|
@@ -57,6 +57,7 @@ export class MoveEffectRule extends PlayerEffectRule {
|
|
|
57
57
|
}
|
|
58
58
|
onCardSacrificed(move) {
|
|
59
59
|
if (this.getSacrificeToPreventMove().some((sacrificeMove) => isEqual(move, sacrificeMove))) {
|
|
60
|
+
new Pantheon(this.game, this.player).onCardSacrificed(move.itemIndex, false);
|
|
60
61
|
return [this.customMove(CustomMoveType.EndEffect)];
|
|
61
62
|
}
|
|
62
63
|
return [];
|
|
@@ -7,5 +7,5 @@ export declare abstract class SacrificeEffectRule extends PlayerEffectRule {
|
|
|
7
7
|
private getCardsAbleToSacrifice;
|
|
8
8
|
getCardsToSacrifice(): Material;
|
|
9
9
|
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
10
|
-
onSacrifice(
|
|
10
|
+
onSacrifice(move: MoveItem): MaterialMove[];
|
|
11
11
|
}
|
|
@@ -34,7 +34,8 @@ export class SacrificeEffectRule extends PlayerEffectRule {
|
|
|
34
34
|
}
|
|
35
35
|
return [];
|
|
36
36
|
}
|
|
37
|
-
onSacrifice(
|
|
37
|
+
onSacrifice(move) {
|
|
38
|
+
new Pantheon(this.game, this.player).onCardSacrificed(move.itemIndex);
|
|
38
39
|
return [this.customMove(CustomMoveType.EndEffect)];
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -2,7 +2,7 @@ import { ItemMove, Location, Material, MaterialItem, MaterialMove, MoveItem, XYC
|
|
|
2
2
|
import { PlayerColor } from '../../PlayerColor';
|
|
3
3
|
import { SimultaneousEffectRule } from './SimultaneousEffectRule';
|
|
4
4
|
export declare abstract class SimultaneousMoveEffectRule extends SimultaneousEffectRule {
|
|
5
|
-
getActivePlayerLegalMoves(player: PlayerColor):
|
|
5
|
+
getActivePlayerLegalMoves(player: PlayerColor): MaterialMove[];
|
|
6
6
|
getSacrificeToPreventMove(player: PlayerColor): MoveItem<number, number, number>[];
|
|
7
7
|
getMovementMoves(player: PlayerColor): MoveItem<number, number, number>[];
|
|
8
8
|
private getCardsAbleToMove;
|
|
@@ -46,6 +46,7 @@ export class SimultaneousMoveEffectRule extends SimultaneousEffectRule {
|
|
|
46
46
|
return [this.endPlayerTurn(move.location.player)];
|
|
47
47
|
}
|
|
48
48
|
onCardSacrificed(move) {
|
|
49
|
+
new Pantheon(this.game, move.location.player).onCardSacrificed(move.itemIndex, false);
|
|
49
50
|
return [this.endPlayerTurn(move.location.player)];
|
|
50
51
|
}
|
|
51
52
|
getMovesAfterPlayersDone() {
|
|
@@ -26,6 +26,7 @@ export class SimultaneousSacrificeEffectRule extends SimultaneousEffectRule {
|
|
|
26
26
|
return [];
|
|
27
27
|
}
|
|
28
28
|
onSacrifice(move) {
|
|
29
|
+
new Pantheon(this.game, move.location.player).onCardSacrificed(move.itemIndex);
|
|
29
30
|
return [this.endPlayerTurn(move.location.player)];
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomMove, MaterialMove } from '@gamepark/rules-api';
|
|
1
|
+
import { CustomMove, MaterialMove, MoveItem } from '@gamepark/rules-api';
|
|
2
2
|
import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
|
|
3
3
|
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
4
4
|
import { RuleId } from '../RuleId';
|
|
@@ -9,8 +9,8 @@ export declare class CaimanEffectRule extends PlayerEffectRule {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class CaimanSacrificeEffectRule extends SacrificeEffectRule {
|
|
11
11
|
ruleId: RuleId;
|
|
12
|
-
onRuleStart(): CustomMove[] |
|
|
12
|
+
onRuleStart(): CustomMove[] | MoveItem<number, number, number>[];
|
|
13
13
|
getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
14
|
-
onSacrifice(): MaterialMove[];
|
|
14
|
+
onSacrifice(move: MoveItem): MaterialMove[];
|
|
15
15
|
onRuleEnd(): never[];
|
|
16
16
|
}
|
|
@@ -40,9 +40,11 @@ export class CaimanSacrificeEffectRule extends SacrificeEffectRule {
|
|
|
40
40
|
const indexes = this.remind(Memory.TargetEntities);
|
|
41
41
|
return this.material(MaterialType.EntityCard).index(indexes);
|
|
42
42
|
}
|
|
43
|
-
onSacrifice() {
|
|
43
|
+
onSacrifice(move) {
|
|
44
44
|
const moves = [];
|
|
45
|
-
|
|
45
|
+
const pantheon = new Pantheon(this.game, this.player);
|
|
46
|
+
pantheon.onCardSacrificed(move.itemIndex);
|
|
47
|
+
moves.push(pantheon.gainGems(1));
|
|
46
48
|
const remaining = this.memorize(Memory.EffectCount, (count) => count - 1);
|
|
47
49
|
if (!remaining) {
|
|
48
50
|
moves.push(this.customMove(CustomMoveType.EndEffect));
|
|
@@ -3,6 +3,7 @@ import { SummonEffectRule } from '../../material/entity/PlaceCardEffectRule';
|
|
|
3
3
|
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
4
4
|
import { LocationType } from '../../material/LocationType';
|
|
5
5
|
import { MaterialType } from '../../material/MaterialType';
|
|
6
|
+
import { Pantheon } from '../../material/Pantheon';
|
|
6
7
|
import { Memory } from '../../Memory';
|
|
7
8
|
import { RuleId } from '../RuleId';
|
|
8
9
|
export class CobraEffectRule extends SacrificeEffectRule {
|
|
@@ -12,6 +13,7 @@ export class CobraEffectRule extends SacrificeEffectRule {
|
|
|
12
13
|
return super.getCardsToSacrifice().location((l) => l.x === x && l.y !== y);
|
|
13
14
|
}
|
|
14
15
|
onSacrifice(move) {
|
|
16
|
+
new Pantheon(this.game, this.player).onCardSacrificed(move.itemIndex);
|
|
15
17
|
const cards = this.material(MaterialType.EntityCard);
|
|
16
18
|
const mythology = entityMythology(cards.getItem(move.itemIndex).id.front);
|
|
17
19
|
const creaturesDeck = cards.location(LocationType.CreaturesDeck).locationId(mythology).deck();
|
|
@@ -13,6 +13,7 @@ export class CondorEffectRule extends SacrificeEffectRule {
|
|
|
13
13
|
onSacrifice(move) {
|
|
14
14
|
const entity = this.material(MaterialType.EntityCard).getItem(move.itemIndex);
|
|
15
15
|
const pantheon = new Pantheon(this.game, this.player);
|
|
16
|
+
pantheon.onCardSacrificed(move.itemIndex);
|
|
16
17
|
const moves = pantheon.getSummonGains(entity.id.front, entity.location.y);
|
|
17
18
|
moves.push(this.customMove(CustomMoveType.EndEffect));
|
|
18
19
|
return moves;
|
|
@@ -6,6 +6,8 @@ export declare class DullahanEffectRule extends MoveEffectRule {
|
|
|
6
6
|
onRuleStart(): MaterialMove[];
|
|
7
7
|
getMovingCards(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
8
|
isLegalDestination(space: XYCoordinates, cardLocation: Location): boolean;
|
|
9
|
+
getPlayerMoves(): MaterialMove[];
|
|
9
10
|
onCardMoved(move: MoveItem): MaterialMove[];
|
|
11
|
+
onCardSacrificed(move: MoveItem): import("@gamepark/rules-api").CustomMove[];
|
|
10
12
|
onRuleEnd(): never[];
|
|
11
13
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isEqual } from 'es-toolkit';
|
|
1
2
|
import { CustomMoveType } from '../../CustomMoveType';
|
|
2
3
|
import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
|
|
3
4
|
import { Pantheon } from '../../material/Pantheon';
|
|
@@ -25,19 +26,43 @@ export class DullahanEffectRule extends MoveEffectRule {
|
|
|
25
26
|
isLegalDestination(space, cardLocation) {
|
|
26
27
|
return cardLocation.x === space.x && cardLocation.y === space.y - 1;
|
|
27
28
|
}
|
|
29
|
+
getPlayerMoves() {
|
|
30
|
+
const moves = super.getPlayerMoves();
|
|
31
|
+
if (!this.remind(Memory.EffectCount)) {
|
|
32
|
+
moves.push(this.customMove(CustomMoveType.EndEffect));
|
|
33
|
+
}
|
|
34
|
+
return moves;
|
|
35
|
+
}
|
|
28
36
|
onCardMoved(move) {
|
|
29
37
|
const moves = [];
|
|
30
38
|
const pantheon = new Pantheon(this.game, this.player);
|
|
31
39
|
if (pantheon.visibleEntities.location((l) => l.x === move.location.x && l.y === move.location.y).length > 0) {
|
|
32
40
|
moves.push(pantheon.gainGems(1));
|
|
33
41
|
}
|
|
34
|
-
this.memorize(Memory.TargetEntities, (entities) => entities.filter((index) => index !== move.itemIndex));
|
|
35
|
-
|
|
36
|
-
if (
|
|
42
|
+
const targetEntities = this.memorize(Memory.TargetEntities, (entities) => entities.filter((index) => index !== move.itemIndex));
|
|
43
|
+
this.memorize(Memory.EffectCount, (count) => Math.max(0, count - 1));
|
|
44
|
+
if (targetEntities.length === 0) {
|
|
37
45
|
moves.push(this.customMove(CustomMoveType.EndEffect));
|
|
38
46
|
}
|
|
39
47
|
return moves;
|
|
40
48
|
}
|
|
49
|
+
onCardSacrificed(move) {
|
|
50
|
+
if (this.getSacrificeToPreventMove().some((sacrificeMove) => isEqual(move, sacrificeMove))) {
|
|
51
|
+
new Pantheon(this.game, this.player).onCardSacrificed(move.itemIndex, false);
|
|
52
|
+
const targetEntities = this.remind(Memory.TargetEntities);
|
|
53
|
+
if (targetEntities.includes(move.itemIndex)) {
|
|
54
|
+
const remaining = this.memorize(Memory.TargetEntities, (entities) => entities.filter((index) => index !== move.itemIndex));
|
|
55
|
+
this.memorize(Memory.EffectCount, (count) => Math.max(0, count - 2));
|
|
56
|
+
if (remaining.length === 0) {
|
|
57
|
+
return [this.customMove(CustomMoveType.EndEffect)];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.memorize(Memory.EffectCount, (count) => Math.max(0, count - 1));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
41
66
|
onRuleEnd() {
|
|
42
67
|
this.forget(Memory.TargetEntities);
|
|
43
68
|
this.forget(Memory.EffectCount);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { MaterialMove } from '@gamepark/rules-api';
|
|
1
|
+
import { MaterialMove, MoveItem } from '@gamepark/rules-api';
|
|
2
2
|
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
3
3
|
import { RuleId } from '../RuleId';
|
|
4
4
|
export declare class FairyEffectRule extends SacrificeEffectRule {
|
|
5
5
|
ruleId: RuleId;
|
|
6
6
|
playEffect(): MaterialMove[];
|
|
7
7
|
getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
|
-
onSacrifice(): MaterialMove[];
|
|
8
|
+
onSacrifice(move: MoveItem): MaterialMove[];
|
|
9
9
|
onRuleEnd(): never[];
|
|
10
10
|
}
|
|
@@ -18,7 +18,8 @@ export class FairyEffectRule extends SacrificeEffectRule {
|
|
|
18
18
|
getCardsToSacrifice() {
|
|
19
19
|
return this.material(MaterialType.EntityCard).index(this.remind(Memory.TargetEntities)[0]);
|
|
20
20
|
}
|
|
21
|
-
onSacrifice() {
|
|
21
|
+
onSacrifice(move) {
|
|
22
|
+
new Pantheon(this.game, this.player).onCardSacrificed(move.itemIndex);
|
|
22
23
|
const moves = [new Pantheon(this.game, this.player).gainGems(2)];
|
|
23
24
|
const targets = this.memorize(Memory.TargetEntities, (targets) => targets.slice(1));
|
|
24
25
|
if (!targets.length) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomMove, MaterialMove } from '@gamepark/rules-api';
|
|
1
|
+
import { CustomMove, MaterialMove, MoveItem } from '@gamepark/rules-api';
|
|
2
2
|
import { PlayerEffectRule } from '../../material/entity/PlayerEffectRule';
|
|
3
3
|
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
4
4
|
import { RuleId } from '../RuleId';
|
|
@@ -11,6 +11,6 @@ export declare class GarudaSacrificeRule extends SacrificeEffectRule {
|
|
|
11
11
|
ruleId: RuleId;
|
|
12
12
|
onRuleStart(): MaterialMove[];
|
|
13
13
|
getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
14
|
-
onSacrifice(): CustomMove[];
|
|
14
|
+
onSacrifice(move: MoveItem): CustomMove[];
|
|
15
15
|
onRuleEnd(): never[];
|
|
16
16
|
}
|
|
@@ -38,7 +38,8 @@ export class GarudaSacrificeRule extends SacrificeEffectRule {
|
|
|
38
38
|
const plan = this.remind(Memory.TargetPlane);
|
|
39
39
|
return pantheon.visibleEntities.id((id) => isCreature(id.front)).location((l) => l.y === plan);
|
|
40
40
|
}
|
|
41
|
-
onSacrifice() {
|
|
41
|
+
onSacrifice(move) {
|
|
42
|
+
new Pantheon(this.game, this.player).onCardSacrificed(move.itemIndex);
|
|
42
43
|
const sacrificeLeft = this.memorize(Memory.EffectCount, (count) => count - 1);
|
|
43
44
|
if (sacrificeLeft) {
|
|
44
45
|
return [];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { MoveItem } from '@gamepark/rules-api';
|
|
1
2
|
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
2
3
|
import { RuleId } from '../RuleId';
|
|
3
4
|
export declare class GorgonEffectRule extends SacrificeEffectRule {
|
|
4
5
|
ruleId: RuleId;
|
|
5
6
|
getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
6
|
-
onSacrifice(): (import("@gamepark/rules-api").CustomMove | import("@gamepark/rules-api").CreateItem<number, number, number>)[];
|
|
7
|
+
onSacrifice(move: MoveItem): (import("@gamepark/rules-api").CustomMove | import("@gamepark/rules-api").CreateItem<number, number, number>)[];
|
|
7
8
|
}
|
|
@@ -8,8 +8,9 @@ export class GorgonEffectRule extends SacrificeEffectRule {
|
|
|
8
8
|
const { x, y } = this.card.location;
|
|
9
9
|
return super.getCardsToSacrifice().location((l) => l.x === x && l.y === y + 1);
|
|
10
10
|
}
|
|
11
|
-
onSacrifice() {
|
|
11
|
+
onSacrifice(move) {
|
|
12
12
|
const pantheon = new Pantheon(this.game, this.player);
|
|
13
|
+
pantheon.onCardSacrificed(move.itemIndex);
|
|
13
14
|
return [pantheon.gainGems(2), this.customMove(CustomMoveType.EndEffect)];
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -18,6 +18,7 @@ export class JiangshiEffectRule extends PlayerEffectRule {
|
|
|
18
18
|
beforeItemMove(move) {
|
|
19
19
|
if (isMoveItemTypeAtOnce(MaterialType.EntityCard)(move) && move.location.type === LocationType.PlayerDiscard) {
|
|
20
20
|
const pantheon = new Pantheon(this.game, this.player);
|
|
21
|
+
pantheon.onPileSacrificed(move.indexes);
|
|
21
22
|
return [pantheon.gainGems(2), this.customMove(CustomMoveType.EndEffect)];
|
|
22
23
|
}
|
|
23
24
|
return [];
|
|
@@ -7,6 +7,7 @@ export declare abstract class MultipleSimultaneousMoveEffectRule extends Simulta
|
|
|
7
7
|
getTargetEntities(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
8
|
getEffectCount(player: PlayerColor): number;
|
|
9
9
|
getMovingCards(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
10
|
+
getActivePlayerLegalMoves(player: PlayerColor): MaterialMove[];
|
|
10
11
|
onCardMoved(move: MoveItem): import("@gamepark/rules-api").EndPlayerTurn<number>[];
|
|
11
12
|
onCardSacrificed(move: MoveItem): MaterialMove[];
|
|
12
13
|
onRuleEnd(): never[];
|
|
@@ -50,13 +50,30 @@ export class MultipleSimultaneousMoveEffectRule extends SimultaneousMoveEffectRu
|
|
|
50
50
|
getMovingCards(player) {
|
|
51
51
|
return this.material(MaterialType.EntityCard).index(this.remind(Memory.TargetEntities, player));
|
|
52
52
|
}
|
|
53
|
+
getActivePlayerLegalMoves(player) {
|
|
54
|
+
const moves = super.getActivePlayerLegalMoves(player);
|
|
55
|
+
if (!this.remind(Memory.EffectCount, player)) {
|
|
56
|
+
moves.push(this.endPlayerTurn(player));
|
|
57
|
+
}
|
|
58
|
+
return moves;
|
|
59
|
+
}
|
|
53
60
|
onCardMoved(move) {
|
|
54
|
-
this.memorize(Memory.TargetEntities, (entities) => entities.filter((index) => index !== move.itemIndex), move.location.player);
|
|
55
|
-
|
|
56
|
-
return
|
|
61
|
+
const targetEntities = this.memorize(Memory.TargetEntities, (entities) => entities.filter((index) => index !== move.itemIndex), move.location.player);
|
|
62
|
+
this.memorize(Memory.EffectCount, (count) => Math.max(0, count - 1), move.location.player);
|
|
63
|
+
return targetEntities.length ? [] : [this.endPlayerTurn(move.location.player)];
|
|
57
64
|
}
|
|
58
65
|
onCardSacrificed(move) {
|
|
59
|
-
|
|
66
|
+
const player = move.location.player;
|
|
67
|
+
new Pantheon(this.game, player).onCardSacrificed(move.itemIndex, false);
|
|
68
|
+
const targetEntities = this.remind(Memory.TargetEntities, player);
|
|
69
|
+
if (targetEntities.includes(move.itemIndex)) {
|
|
70
|
+
this.memorize(Memory.TargetEntities, targetEntities.filter((index) => index !== move.itemIndex), player);
|
|
71
|
+
this.memorize(Memory.EffectCount, (count) => count - 2, player);
|
|
72
|
+
return targetEntities.length > 1 ? [] : [this.endPlayerTurn(player)];
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
return this.onCardMoved(move);
|
|
76
|
+
}
|
|
60
77
|
}
|
|
61
78
|
onRuleEnd() {
|
|
62
79
|
this.forget(Memory.TargetEntities);
|
|
@@ -38,6 +38,7 @@ export class NuwaEffectRule extends SimultaneousSacrificeEffectRule {
|
|
|
38
38
|
}
|
|
39
39
|
onSacrifice(move) {
|
|
40
40
|
const player = move.location.player;
|
|
41
|
+
new Pantheon(this.game, player).onCardSacrificed(move.itemIndex);
|
|
41
42
|
const creaturesLeft = this.memorize(Memory.TargetEntities, (creatures) => creatures.filter((c) => c !== move.itemIndex), player);
|
|
42
43
|
return creaturesLeft.length ? [] : [this.endPlayerTurn(player)];
|
|
43
44
|
}
|
|
@@ -28,6 +28,7 @@ export class ShivaEffectRule extends PlayerEffectRule {
|
|
|
28
28
|
beforeItemMove(move) {
|
|
29
29
|
if (isMoveItemTypeAtOnce(MaterialType.EntityCard)(move) && move.location.type === LocationType.PlayerDiscard) {
|
|
30
30
|
const pantheon = new Pantheon(this.game, this.player);
|
|
31
|
+
pantheon.onPileSacrificed(move.indexes);
|
|
31
32
|
return [pantheon.gainFavor(move.indexes.length), this.customMove(CustomMoveType.EndEffect)];
|
|
32
33
|
}
|
|
33
34
|
return [];
|
|
@@ -22,7 +22,7 @@ export class TianlongEffectRule extends MoveEffectRule {
|
|
|
22
22
|
{ x: move.location.x, y: move.location.y }
|
|
23
23
|
]);
|
|
24
24
|
const opponentsEffectRule = new TianlongOpponentsEffectRule(this.game);
|
|
25
|
-
return [new Pantheon(this.game, this.player).spendGems(1), ...opponentsEffectRule.playEffect()];
|
|
25
|
+
return [new Pantheon(this.game, this.player).spendGems(1), ...opponentsEffectRule.playEffect(), this.customMove(CustomMoveType.EndEffect)];
|
|
26
26
|
}
|
|
27
27
|
return [];
|
|
28
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MaterialItem, MaterialMove } from '@gamepark/rules-api';
|
|
1
|
+
import { MaterialItem, MaterialMove, MoveItem } from '@gamepark/rules-api';
|
|
2
2
|
import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
|
|
3
3
|
import { RuleId } from '../RuleId';
|
|
4
4
|
export declare class VetalaEffectRule extends MoveEffectRule {
|
|
@@ -7,6 +7,6 @@ export declare class VetalaEffectRule extends MoveEffectRule {
|
|
|
7
7
|
getPlayerMoves(): MaterialMove[];
|
|
8
8
|
getAvailableDestinations(card: MaterialItem, cardIndex: number): import("@gamepark/rules-api").XYCoordinates[];
|
|
9
9
|
onCardMoved(): import("@gamepark/rules-api").CustomMove[];
|
|
10
|
-
onCardSacrificed(): import("@gamepark/rules-api").CustomMove[];
|
|
10
|
+
onCardSacrificed(move: MoveItem): import("@gamepark/rules-api").CustomMove[];
|
|
11
11
|
onRuleEnd(): never[];
|
|
12
12
|
}
|
|
@@ -3,6 +3,7 @@ import { CustomMoveType } from '../../CustomMoveType';
|
|
|
3
3
|
import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
|
|
4
4
|
import { LocationType } from '../../material/LocationType';
|
|
5
5
|
import { MaterialType } from '../../material/MaterialType';
|
|
6
|
+
import { Pantheon } from '../../material/Pantheon';
|
|
6
7
|
import { Memory } from '../../Memory';
|
|
7
8
|
import { RuleId } from '../RuleId';
|
|
8
9
|
export class VetalaEffectRule extends MoveEffectRule {
|
|
@@ -27,7 +28,8 @@ export class VetalaEffectRule extends MoveEffectRule {
|
|
|
27
28
|
const count = this.memorize(Memory.EffectCount, (count) => count - 1);
|
|
28
29
|
return count > 0 ? [] : [this.customMove(CustomMoveType.EndEffect)];
|
|
29
30
|
}
|
|
30
|
-
onCardSacrificed() {
|
|
31
|
+
onCardSacrificed(move) {
|
|
32
|
+
new Pantheon(this.game, this.player).onCardSacrificed(move.itemIndex, false);
|
|
31
33
|
return this.onCardMoved();
|
|
32
34
|
}
|
|
33
35
|
onRuleEnd() {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { MoveItem } from '@gamepark/rules-api';
|
|
1
2
|
import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
|
|
2
3
|
import { RuleId } from '../RuleId';
|
|
3
4
|
export declare class ViracochaEffectRule extends SacrificeEffectRule {
|
|
4
5
|
ruleId: RuleId;
|
|
5
6
|
getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
6
|
-
onSacrifice(): (import("@gamepark/rules-api").CustomMove | import("@gamepark/rules-api").CreateItem<number, number, number>)[];
|
|
7
|
+
onSacrifice(move: MoveItem): (import("@gamepark/rules-api").CustomMove | import("@gamepark/rules-api").CreateItem<number, number, number>)[];
|
|
7
8
|
}
|
|
@@ -8,8 +8,9 @@ export class ViracochaEffectRule extends SacrificeEffectRule {
|
|
|
8
8
|
getCardsToSacrifice() {
|
|
9
9
|
return super.getCardsToSacrifice().id((id) => isCreature(id.front));
|
|
10
10
|
}
|
|
11
|
-
onSacrifice() {
|
|
11
|
+
onSacrifice(move) {
|
|
12
12
|
const pantheon = new Pantheon(this.game, this.player);
|
|
13
|
+
pantheon.onCardSacrificed(move.itemIndex);
|
|
13
14
|
return [pantheon.gainFavor(2), this.customMove(CustomMoveType.EndEffect)];
|
|
14
15
|
}
|
|
15
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/mythologies",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
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": "00fe0e867bb364ae75145ccd88016afa7988a3c1"
|
|
32
32
|
}
|