@gamepark/skyrift 0.4.1 → 0.4.3
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/material/decks/gravehurt/Doom.d.ts +1 -5
- package/dist/material/decks/gravehurt/Doom.js +2 -8
- package/dist/material/decks/highwave/BoardingPartyEffectRule.d.ts +0 -1
- package/dist/material/decks/highwave/BoardingPartyEffectRule.js +0 -6
- package/dist/rules/DestroyEffectRule.d.ts +1 -1
- package/dist/rules/DestroyEffectRule.js +8 -3
- package/package.json +2 -2
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { Material } from '@gamepark/rules-api';
|
|
2
1
|
import { CardRule } from '../../CardRule';
|
|
3
2
|
import { CardSuit } from '../../CardSuit';
|
|
4
3
|
import { CardType } from '../../CardType';
|
|
5
|
-
|
|
6
|
-
declare class DoomRule extends CardRule implements DestroyEffect {
|
|
4
|
+
declare class DoomRule extends CardRule {
|
|
7
5
|
onEnters(): void;
|
|
8
6
|
onLeaves(): import("@gamepark/rules-api").MaterialMove[];
|
|
9
|
-
getDestroyTargets(): Material;
|
|
10
|
-
isAutoDestroy(): boolean;
|
|
11
7
|
}
|
|
12
8
|
export declare const Doom: {
|
|
13
9
|
power: number;
|
|
@@ -10,15 +10,9 @@ class DoomRule extends CardRule {
|
|
|
10
10
|
this.addPendingEffect(RuleId.DoomEffect);
|
|
11
11
|
}
|
|
12
12
|
onLeaves() {
|
|
13
|
-
this.addPendingEffect(RuleId.DestroyEffect);
|
|
14
|
-
return super.onLeaves();
|
|
15
|
-
}
|
|
16
|
-
getDestroyTargets() {
|
|
17
13
|
const doomTokens = this.material(MaterialType.SpecialToken).id(SpecialTokenType.Doom).location(LocationType.CardSpecialTokens);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
isAutoDestroy() {
|
|
21
|
-
return true;
|
|
14
|
+
const doomedIndexes = doomTokens.getItems().map((item) => item.location.parent);
|
|
15
|
+
return [...this.playArea.index(doomedIndexes).moveItems((item) => ({ type: LocationType.PlayerDiscard, player: item.id.back })), ...super.onLeaves()];
|
|
22
16
|
}
|
|
23
17
|
}
|
|
24
18
|
export const Doom = {
|
|
@@ -7,5 +7,4 @@ export declare class BoardingPartyEffectRule extends DestroyEffectRule {
|
|
|
7
7
|
getTargets(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
8
|
onCardDestroyed(): import("@gamepark/rules-api").MaterialMove[];
|
|
9
9
|
onCustomMove(move: CustomMove): import("@gamepark/rules-api").MaterialMove[];
|
|
10
|
-
onRuleEnd(): never[];
|
|
11
10
|
}
|
|
@@ -35,10 +35,15 @@ export class DestroyEffectRule extends EffectRule {
|
|
|
35
35
|
}
|
|
36
36
|
onCardDestroyed() {
|
|
37
37
|
const remaining = this.memorize(Memory.EffectCount, (c) => c - 1);
|
|
38
|
-
|
|
38
|
+
if (remaining <= 0 || !this.getTargets().length) {
|
|
39
|
+
return this.endEffect();
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
|
-
|
|
45
|
+
onEndEffect() {
|
|
41
46
|
this.forget(Memory.EffectCount);
|
|
42
|
-
return
|
|
47
|
+
return super.onEndEffect();
|
|
43
48
|
}
|
|
44
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/skyrift",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "The rules of SkyRift adapted for Game Park",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"es-toolkit": "^1.43.0",
|
|
31
31
|
"vitest": "^4.0.15"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "3ba3141e89e6204dd3acf7351054af00ec9ee46d"
|
|
34
34
|
}
|