@gamepark/skyrift 0.2.2 → 0.2.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/CardRule.js +1 -1
- package/dist/material/decks/heathblade/OzmaTheMage.d.ts +1 -1
- package/dist/material/decks/heathblade/OzmaTheMage.js +3 -8
- package/dist/rules/EndRoundRule.js +2 -6
- package/dist/rules/PlayCardRule.js +2 -4
- package/dist/rules/StartPlayerTurnRule.js +2 -6
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { CardSuit } from '../../CardSuit';
|
|
|
6
6
|
import { CardType } from '../../CardType';
|
|
7
7
|
declare class OzmaTheMageRule extends CardRule {
|
|
8
8
|
onCardEnters(card: Card, side: Deck): MaterialMove[];
|
|
9
|
-
onLeave():
|
|
9
|
+
onLeave(): import("@gamepark/rules-api").MoveItem<number, number, number>[];
|
|
10
10
|
}
|
|
11
11
|
export declare const OzmaTheMage: {
|
|
12
12
|
power: number;
|
|
@@ -6,19 +6,14 @@ import { LocationType } from '../../LocationType';
|
|
|
6
6
|
import { MaterialType } from '../../MaterialType';
|
|
7
7
|
class OzmaTheMageRule extends CardRule {
|
|
8
8
|
onCardEnters(card, side) {
|
|
9
|
-
if (side
|
|
9
|
+
if (side === this.player && cardProperties[card].type === CardType.Action) {
|
|
10
10
|
this.addPendingEffect();
|
|
11
11
|
}
|
|
12
12
|
return [];
|
|
13
13
|
}
|
|
14
14
|
onLeave() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
const powerTokens = this.material(MaterialType.PowerToken).location(LocationType.CardPowerTokens).parent(this.index);
|
|
20
|
-
return [powerTokens.moveItem({ type: LocationType.PlayerStash, player: this.player }, powerTokens.getQuantity())];
|
|
21
|
-
}
|
|
15
|
+
const powerTokens = this.material(MaterialType.PowerToken).location(LocationType.CardPowerTokens).parent(this.index);
|
|
16
|
+
return [powerTokens.moveItem({ type: LocationType.PlayerStash, player: this.player }, powerTokens.getQuantity())];
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
19
|
export const OzmaTheMage = {
|
|
@@ -25,15 +25,11 @@ export class EndRoundRule extends PlayerTurnRule {
|
|
|
25
25
|
.getIndexes();
|
|
26
26
|
for (const cardIndex of loserCards) {
|
|
27
27
|
const cardRule = new PlayerHelper(this.game, loser).getCardRule(cardIndex);
|
|
28
|
-
|
|
29
|
-
moves.push(...cardRule.onRoundEnd(false));
|
|
30
|
-
}
|
|
28
|
+
moves.push(...cardRule.onRoundEnd(false));
|
|
31
29
|
}
|
|
32
30
|
for (const cardIndex of winnerCards) {
|
|
33
31
|
const cardRule = new PlayerHelper(this.game, winner).getCardRule(cardIndex);
|
|
34
|
-
|
|
35
|
-
moves.push(...cardRule.onRoundEnd(true));
|
|
36
|
-
}
|
|
32
|
+
moves.push(...cardRule.onRoundEnd(true));
|
|
37
33
|
}
|
|
38
34
|
const pendingEffects = this.remind(Memory.PendingEffects);
|
|
39
35
|
if (pendingEffects.length === 0) {
|
|
@@ -27,7 +27,7 @@ export class PlayCardRule extends PlayerTurnRule {
|
|
|
27
27
|
}
|
|
28
28
|
const usedEffects = this.remind(Memory.OncePerTurnEffects);
|
|
29
29
|
for (const cardRule of playerHelper.cardRules) {
|
|
30
|
-
if (cardRule.oncePerTurnEffect && !
|
|
30
|
+
if (cardRule.oncePerTurnEffect && !usedEffects.some((effect) => effect.cardIndex === cardRule.index)) {
|
|
31
31
|
moves.push(this.customMove(CustomMoveType.ActivateCard, cardRule.index));
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -56,9 +56,7 @@ export class PlayCardRule extends PlayerTurnRule {
|
|
|
56
56
|
for (const cardIndex of cardsInPlay.getIndexes()) {
|
|
57
57
|
if (cardIndex !== move.itemIndex) {
|
|
58
58
|
const otherCardRule = new PlayerHelper(this.game, this.player).getCardRule(cardIndex);
|
|
59
|
-
|
|
60
|
-
moves.push(...otherCardRule.onCardEnters(cardRule.card, move.location.player));
|
|
61
|
-
}
|
|
59
|
+
moves.push(...otherCardRule.onCardEnters(cardRule.card, move.location.player));
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
62
|
moves.push(...cardRule.onEnters());
|
|
@@ -19,14 +19,10 @@ export class StartPlayerTurnRule extends PlayerTurnRule {
|
|
|
19
19
|
.filter((card) => cardProperties[card.id.front].type === CardType.Action);
|
|
20
20
|
moves.push(...actionCards.moveItems({ type: LocationType.PlayerDiscard, player: this.player }));
|
|
21
21
|
for (const cardRule of new PlayerHelper(this.game, this.player).cardRules) {
|
|
22
|
-
|
|
23
|
-
moves.push(...cardRule.onPlayerTurnStart(this.player));
|
|
24
|
-
}
|
|
22
|
+
moves.push(...cardRule.onPlayerTurnStart(this.player));
|
|
25
23
|
}
|
|
26
24
|
for (const cardRule of new PlayerHelper(this.game, this.nextPlayer).cardRules) {
|
|
27
|
-
|
|
28
|
-
moves.push(...cardRule.onPlayerTurnStart(this.player));
|
|
29
|
-
}
|
|
25
|
+
moves.push(...cardRule.onPlayerTurnStart(this.player));
|
|
30
26
|
}
|
|
31
27
|
const stunTokens = this.material(MaterialType.StunToken).location(LocationType.CardStunTokens);
|
|
32
28
|
moves.push(...stunTokens.deleteItems(1));
|