@gamepark/mythologies 1.0.0 → 1.0.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
CHANGED
package/dist/CustomMoveType.js
CHANGED
|
@@ -8,4 +8,5 @@ export var CustomMoveType;
|
|
|
8
8
|
CustomMoveType[CustomMoveType["ChooseMythology"] = 6] = "ChooseMythology";
|
|
9
9
|
CustomMoveType[CustomMoveType["ChoosePlan"] = 7] = "ChoosePlan";
|
|
10
10
|
CustomMoveType[CustomMoveType["ChooseEntityCard"] = 8] = "ChooseEntityCard";
|
|
11
|
+
CustomMoveType[CustomMoveType["EffectTriggered"] = 9] = "EffectTriggered";
|
|
11
12
|
})(CustomMoveType || (CustomMoveType = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CustomMoveType } from '../../../CustomMoveType';
|
|
1
2
|
import { Entity, isCreature } from '../../Entity';
|
|
2
3
|
import { Pantheon } from '../../Pantheon';
|
|
3
4
|
import { AutoEffectRule } from '../AutoEffectRule';
|
|
@@ -9,11 +10,11 @@ export const Tokoloshe = {
|
|
|
9
10
|
trigger: isEndOfMyTurn,
|
|
10
11
|
rule: class TokolosheEffectRule extends AutoEffectRule {
|
|
11
12
|
playEffect() {
|
|
12
|
-
const { x, y
|
|
13
|
-
const pantheon = new Pantheon(this.game, player);
|
|
13
|
+
const { x, y } = this.card.location;
|
|
14
|
+
const pantheon = new Pantheon(this.game, this.player);
|
|
14
15
|
const creatures = pantheon.visibleEntities.location((l) => l.y === y && l.x !== x).id((id) => isCreature(id.front));
|
|
15
16
|
const loss = Math.min(pantheon.favor, creatures.length);
|
|
16
|
-
return loss ? [pantheon.loseFavor(loss)] : [];
|
|
17
|
+
return loss ? [this.customMove(CustomMoveType.EffectTriggered, this.getEffect()), pantheon.loseFavor(loss)] : [];
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Location, Material, XYCoordinates } from '@gamepark/rules-api';
|
|
1
|
+
import { Location, Material, MoveItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
2
|
import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
|
|
3
3
|
import { SimultaneousSacrificeEffectRule } from '../../material/entity/SimultaneousSacrificeEffectRule';
|
|
4
4
|
import { PlayerColor } from '../../PlayerColor';
|
|
@@ -8,6 +8,8 @@ export declare class CentaurEffectRule extends MoveEffectRule {
|
|
|
8
8
|
getMovingCards(effectCardIndex?: number): Material;
|
|
9
9
|
isLegalDestination(space: XYCoordinates, cardLocation: Location): boolean;
|
|
10
10
|
onEndEffect(): import("@gamepark/rules-api").MaterialMove[];
|
|
11
|
+
onCardSacrificed(move: MoveItem): import("@gamepark/rules-api").MaterialMove[];
|
|
12
|
+
onRuleEnd(): never[];
|
|
11
13
|
}
|
|
12
14
|
export declare class CentaurEffectSacrificeRule extends SimultaneousSacrificeEffectRule {
|
|
13
15
|
ruleId: RuleId;
|
|
@@ -3,6 +3,7 @@ import { isCreature } from '../../material/Entity';
|
|
|
3
3
|
import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
|
|
4
4
|
import { SimultaneousSacrificeEffectRule } from '../../material/entity/SimultaneousSacrificeEffectRule';
|
|
5
5
|
import { MaterialType } from '../../material/MaterialType';
|
|
6
|
+
import { Memory } from '../../Memory';
|
|
6
7
|
import { RuleId } from '../RuleId';
|
|
7
8
|
export class CentaurEffectRule extends MoveEffectRule {
|
|
8
9
|
ruleId = RuleId.CentaurEffect;
|
|
@@ -13,9 +14,20 @@ export class CentaurEffectRule extends MoveEffectRule {
|
|
|
13
14
|
return areAdjacentSquares(space, cardLocation);
|
|
14
15
|
}
|
|
15
16
|
onEndEffect() {
|
|
17
|
+
this.memorize(Memory.EntityMoved, true);
|
|
16
18
|
this.updateGridAfterMoves();
|
|
17
19
|
return new CentaurEffectSacrificeRule(this.game).playEffect();
|
|
18
20
|
}
|
|
21
|
+
onCardSacrificed(move) {
|
|
22
|
+
if (this.remind(Memory.EntityMoved)) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
return super.onCardSacrificed(move);
|
|
26
|
+
}
|
|
27
|
+
onRuleEnd() {
|
|
28
|
+
this.forget(Memory.EntityMoved);
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
19
31
|
}
|
|
20
32
|
export class CentaurEffectSacrificeRule extends SimultaneousSacrificeEffectRule {
|
|
21
33
|
ruleId = RuleId.CentaurEffectSacrifice;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/mythologies",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "The rules of Mythologies adapted for Game Park",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -27,5 +27,6 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@gamepark/rules-api": "~7.2.0",
|
|
29
29
|
"es-toolkit": "^1.44.0"
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"gitHead": "624406ecd16bb8dbc98345789e5d767fdf49f1f8"
|
|
31
32
|
}
|