@gamepark/skyrift 0.5.0 → 0.6.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.
Files changed (103) hide show
  1. package/dist/CustomMoveType.d.ts +2 -1
  2. package/dist/CustomMoveType.js +1 -0
  3. package/dist/Deck.d.ts +1 -0
  4. package/dist/Deck.js +1 -0
  5. package/dist/SkyriftRules.d.ts +14 -6
  6. package/dist/SkyriftRules.js +10 -2
  7. package/dist/SkyriftSetup.js +2 -0
  8. package/dist/material/Card.d.ts +16 -0
  9. package/dist/material/Card.js +16 -0
  10. package/dist/material/CardProperties.js +32 -0
  11. package/dist/material/CardRule.d.ts +8 -4
  12. package/dist/material/CardRule.js +61 -20
  13. package/dist/material/Effect.d.ts +2 -0
  14. package/dist/material/EffectTraits.d.ts +7 -2
  15. package/dist/material/OngoingEffect.d.ts +9 -2
  16. package/dist/material/OngoingEffect.js +5 -1
  17. package/dist/material/decks/MoonDragon.d.ts +18 -0
  18. package/dist/material/decks/MoonDragon.js +19 -0
  19. package/dist/material/decks/blackhive/CarefulExcavation.d.ts +2 -1
  20. package/dist/material/decks/blackhive/CarefulExcavation.js +2 -2
  21. package/dist/material/decks/blackhive/CycleKeeperEffectRule.d.ts +3 -1
  22. package/dist/material/decks/gravehurt/CavernSkulkerEffectRule.js +1 -1
  23. package/dist/material/decks/gravehurt/Umbraboros.d.ts +1 -1
  24. package/dist/material/decks/gravehurt/Umbraboros.js +4 -3
  25. package/dist/material/decks/gravehurt/WitchingHour.d.ts +3 -3
  26. package/dist/material/decks/gravehurt/WitchingHour.js +3 -3
  27. package/dist/material/decks/heathblade/HedgeKnight.d.ts +1 -1
  28. package/dist/material/decks/heathblade/HedgeKnight.js +3 -4
  29. package/dist/material/decks/heathblade/PrincessLithaEffectRule.d.ts +2 -1
  30. package/dist/material/decks/moondragon/AkiraClearink.d.ts +13 -0
  31. package/dist/material/decks/moondragon/AkiraClearink.js +15 -0
  32. package/dist/material/decks/moondragon/AzureDragonsPeace.d.ts +13 -0
  33. package/dist/material/decks/moondragon/AzureDragonsPeace.js +18 -0
  34. package/dist/material/decks/moondragon/AzureDragonsPeaceEffectRule.d.ts +10 -0
  35. package/dist/material/decks/moondragon/AzureDragonsPeaceEffectRule.js +49 -0
  36. package/dist/material/decks/moondragon/CopyPlayEffectRule.d.ts +6 -0
  37. package/dist/material/decks/moondragon/CopyPlayEffectRule.js +33 -0
  38. package/dist/material/decks/moondragon/DartYusagi.d.ts +14 -0
  39. package/dist/material/decks/moondragon/DartYusagi.js +26 -0
  40. package/dist/material/decks/moondragon/DuelOfHonor.d.ts +19 -0
  41. package/dist/material/decks/moondragon/DuelOfHonor.js +35 -0
  42. package/dist/material/decks/moondragon/Embush.d.ts +17 -0
  43. package/dist/material/decks/moondragon/Embush.js +26 -0
  44. package/dist/material/decks/moondragon/EmbushEffectRule.d.ts +7 -0
  45. package/dist/material/decks/moondragon/EmbushEffectRule.js +26 -0
  46. package/dist/material/decks/moondragon/EmpressSama.d.ts +13 -0
  47. package/dist/material/decks/moondragon/EmpressSama.js +15 -0
  48. package/dist/material/decks/moondragon/EmpressSamaEffectRule.d.ts +7 -0
  49. package/dist/material/decks/moondragon/EmpressSamaEffectRule.js +29 -0
  50. package/dist/material/decks/moondragon/GardenProtector.d.ts +15 -0
  51. package/dist/material/decks/moondragon/GardenProtector.js +18 -0
  52. package/dist/material/decks/moondragon/ImperialBlade.d.ts +16 -0
  53. package/dist/material/decks/moondragon/ImperialBlade.js +19 -0
  54. package/dist/material/decks/moondragon/LotusMuse.d.ts +17 -0
  55. package/dist/material/decks/moondragon/LotusMuse.js +34 -0
  56. package/dist/material/decks/moondragon/LotusMuseEffectRule.d.ts +6 -0
  57. package/dist/material/decks/moondragon/LotusMuseEffectRule.js +24 -0
  58. package/dist/material/decks/moondragon/PortalOfTheAncestors.d.ts +16 -0
  59. package/dist/material/decks/moondragon/PortalOfTheAncestors.js +21 -0
  60. package/dist/material/decks/moondragon/RiteOfTastes.d.ts +15 -0
  61. package/dist/material/decks/moondragon/RiteOfTastes.js +18 -0
  62. package/dist/material/decks/moondragon/RoosterDance.d.ts +16 -0
  63. package/dist/material/decks/moondragon/RoosterDance.js +19 -0
  64. package/dist/material/decks/moondragon/ShardsAlchimist.d.ts +16 -0
  65. package/dist/material/decks/moondragon/ShardsAlchimist.js +22 -0
  66. package/dist/material/decks/moondragon/SpiritOracle.d.ts +16 -0
  67. package/dist/material/decks/moondragon/SpiritOracle.js +27 -0
  68. package/dist/material/decks/moondragon/SteppesColossus.d.ts +13 -0
  69. package/dist/material/decks/moondragon/SteppesColossus.js +15 -0
  70. package/dist/material/decks/moondragon/YoruNightink.d.ts +13 -0
  71. package/dist/material/decks/moondragon/YoruNightink.js +18 -0
  72. package/dist/material/decks/windsands/AbiSnakeCharmer.d.ts +4 -1
  73. package/dist/material/decks/windsands/AbiSnakeCharmer.js +14 -1
  74. package/dist/material/decks/windsands/DeathTrap.d.ts +2 -0
  75. package/dist/material/decks/windsands/DeathTrap.js +4 -0
  76. package/dist/material/decks/windsands/MalikShadowtracker.d.ts +3 -3
  77. package/dist/material/decks/windsands/MalikShadowtracker.js +4 -4
  78. package/dist/material/decks/windsands/OasisShaman.d.ts +3 -1
  79. package/dist/material/decks/windsands/OasisShaman.js +3 -0
  80. package/dist/rules/ChallengeEffectRule.d.ts +2 -1
  81. package/dist/rules/ChallengeResponseRule.d.ts +2 -1
  82. package/dist/rules/DiscardEffectRule.js +1 -1
  83. package/dist/rules/DrawEffectRule.js +1 -1
  84. package/dist/rules/EffectRule.js +6 -0
  85. package/dist/rules/EffectsHelper.d.ts +6 -0
  86. package/dist/rules/EffectsHelper.js +15 -0
  87. package/dist/rules/EndPlayerTurnRule.d.ts +2 -1
  88. package/dist/rules/EndRoundRule.d.ts +1 -1
  89. package/dist/rules/GainCrystalEffectRule.js +1 -1
  90. package/dist/rules/PlayCardEffectRule.d.ts +1 -0
  91. package/dist/rules/PlayCardEffectRule.js +9 -2
  92. package/dist/rules/PlayerHelper.d.ts +1 -1
  93. package/dist/rules/PlayerHelper.js +21 -19
  94. package/dist/rules/PrepareNextRoundRule.d.ts +5 -1
  95. package/dist/rules/PrepareNextRoundRule.js +6 -3
  96. package/dist/rules/RuleId.d.ts +5 -1
  97. package/dist/rules/RuleId.js +5 -1
  98. package/dist/rules/StartPlayerTurnRule.js +17 -2
  99. package/dist/rules/StashPowerTokensEffectRule.js +1 -1
  100. package/dist/rules/StealCrystalEffectRule.js +2 -2
  101. package/dist/rules/SwitchSideEffectRule.d.ts +3 -5
  102. package/dist/rules/SwitchSideEffectRule.js +2 -6
  103. package/package.json +3 -3
@@ -5,10 +5,10 @@ import { CardType } from '../../CardType';
5
5
  import { OngoingEffectType } from '../../OngoingEffect';
6
6
  class WitchingHourRule extends CardRule {
7
7
  onEnters() {
8
- this.addOngoingEffect(OngoingEffectType.PreventPlayCard);
8
+ this.addOngoingEffect(OngoingEffectType.PlayCardCondition);
9
9
  }
10
- preventPlayCard(card) {
11
- return cardProperties[card].suit === CardSuit.Twilight;
10
+ canPlayCard(card) {
11
+ return cardProperties[card].suit !== CardSuit.Twilight;
12
12
  }
13
13
  }
14
14
  export const WitchingHour = {
@@ -3,7 +3,7 @@ import { CardSuit } from '../../CardSuit';
3
3
  import { CardTag } from '../../CardTag';
4
4
  import { CardType } from '../../CardType';
5
5
  declare class HedgeKnightRule extends CardRule {
6
- getPowerIfNotStunned(): number;
6
+ onEnters(): void;
7
7
  }
8
8
  export declare const HedgeKnight: {
9
9
  power: number;
@@ -2,11 +2,10 @@ import { CardRule } from '../../CardRule';
2
2
  import { CardSuit } from '../../CardSuit';
3
3
  import { CardTag } from '../../CardTag';
4
4
  import { CardType } from '../../CardType';
5
- import { Memory } from '../../../Memory';
5
+ import { OngoingEffectType } from '../../OngoingEffect';
6
6
  class HedgeKnightRule extends CardRule {
7
- getPowerIfNotStunned() {
8
- const wasPlayedThisTurn = this.remind(Memory.CardsPlayed, this.player).includes(this.index);
9
- return super.getPowerIfNotStunned() + (wasPlayedThisTurn ? 3 : 0);
7
+ onEnters() {
8
+ this.addOngoingEffect(OngoingEffectType.PowerModifier, { value: 3, turnsLeft: 2 });
10
9
  }
11
10
  }
12
11
  export const HedgeKnight = {
@@ -1,6 +1,7 @@
1
1
  import { CustomMove } from '@gamepark/rules-api';
2
+ import { CustomMoveType } from '../../../CustomMoveType';
2
3
  import { EffectRule } from '../../../rules/EffectRule';
3
4
  export declare class PrincessLithaEffectRule extends EffectRule {
4
- getPlayerMoves(): CustomMove[];
5
+ getPlayerMoves(): CustomMove<CustomMoveType.ChoosePlayer, number>[];
5
6
  onCustomMove(move: CustomMove): import("@gamepark/rules-api").MaterialMove[];
6
7
  }
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class AkiraClearinkRule extends CardRule {
5
+ onEnters(): void;
6
+ }
7
+ export declare const AkiraClearink: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof AkiraClearinkRule;
12
+ };
13
+ export {};
@@ -0,0 +1,15 @@
1
+ import { RuleId } from '../../../rules/RuleId';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ class AkiraClearinkRule extends CardRule {
6
+ onEnters() {
7
+ this.addPendingEffect(RuleId.CopyPlayEffect);
8
+ }
9
+ }
10
+ export const AkiraClearink = {
11
+ power: 2,
12
+ type: CardType.Creature,
13
+ suit: CardSuit.Day,
14
+ rule: AkiraClearinkRule
15
+ };
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class AzureDragonsPeaceRule extends CardRule {
5
+ onEnters(): void;
6
+ }
7
+ export declare const AzureDragonsPeace: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof AzureDragonsPeaceRule;
12
+ };
13
+ export {};
@@ -0,0 +1,18 @@
1
+ import { RuleId } from '../../../rules/RuleId';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ class AzureDragonsPeaceRule extends CardRule {
6
+ onEnters() {
7
+ const playerCreatures = this.creatures.player(this.player);
8
+ if (playerCreatures.length > 0) {
9
+ this.addPendingEffect(RuleId.AzureDragonsPeaceEffect);
10
+ }
11
+ }
12
+ }
13
+ export const AzureDragonsPeace = {
14
+ power: 3,
15
+ type: CardType.Action,
16
+ suit: CardSuit.Night,
17
+ rule: AzureDragonsPeaceRule
18
+ };
@@ -0,0 +1,10 @@
1
+ import { CustomMove, MaterialMove } from '@gamepark/rules-api';
2
+ import { CustomMoveType } from '../../../CustomMoveType';
3
+ import { EffectRule } from '../../../rules/EffectRule';
4
+ export declare class AzureDragonsPeaceEffectRule extends EffectRule {
5
+ onRuleStart(): never[];
6
+ getPlayerMoves(): CustomMove<CustomMoveType.ChooseCard, number>[];
7
+ onCustomMove(move: CustomMove): MaterialMove[];
8
+ neutralize(targets: number[]): MaterialMove[];
9
+ onEndEffect(): MaterialMove[];
10
+ }
@@ -0,0 +1,49 @@
1
+ import { CustomMoveType } from '../../../CustomMoveType';
2
+ import { Memory } from '../../../Memory';
3
+ import { EffectRule } from '../../../rules/EffectRule';
4
+ import { OngoingEffectType } from '../../OngoingEffect';
5
+ export class AzureDragonsPeaceEffectRule extends EffectRule {
6
+ onRuleStart() {
7
+ this.memorize(Memory.EffectTargets, []);
8
+ return [];
9
+ }
10
+ getPlayerMoves() {
11
+ const targets = this.remind(Memory.EffectTargets);
12
+ if (targets.length === 0) {
13
+ return this.cardRule.creatures
14
+ .player(this.cardRule.player)
15
+ .getIndexes()
16
+ .map((index) => this.customMove(CustomMoveType.ChooseCard, index));
17
+ }
18
+ else {
19
+ return this.cardRule.creatures
20
+ .player(this.cardRule.foe)
21
+ .getIndexes()
22
+ .map((index) => this.customMove(CustomMoveType.ChooseCard, index));
23
+ }
24
+ }
25
+ onCustomMove(move) {
26
+ if (move.type === CustomMoveType.ChooseCard) {
27
+ const targets = this.remind(Memory.EffectTargets);
28
+ if (targets.length === 0) {
29
+ this.memorize(Memory.EffectTargets, [move.data]);
30
+ if (this.cardRule.creatures.player(this.cardRule.foe).length === 0) {
31
+ return this.neutralize([move.data]);
32
+ }
33
+ return [];
34
+ }
35
+ else {
36
+ return this.neutralize([...targets, move.data]);
37
+ }
38
+ }
39
+ return super.onCustomMove(move);
40
+ }
41
+ neutralize(targets) {
42
+ this.cardRule.addOngoingEffect(OngoingEffectType.Neutralized, { targets });
43
+ return this.endEffect();
44
+ }
45
+ onEndEffect() {
46
+ this.forget(Memory.EffectTargets);
47
+ return super.onEndEffect();
48
+ }
49
+ }
@@ -0,0 +1,6 @@
1
+ import { CustomMove, MaterialMove } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ export declare class CopyPlayEffectRule extends EffectRule {
4
+ getPlayerMoves(): MaterialMove[];
5
+ onCustomMove(move: CustomMove): MaterialMove[];
6
+ }
@@ -0,0 +1,33 @@
1
+ import { CustomMoveType } from '../../../CustomMoveType';
2
+ import { Memory } from '../../../Memory';
3
+ import { EffectRule } from '../../../rules/EffectRule';
4
+ import { cardProperties } from '../../CardProperties';
5
+ import { MaterialType } from '../../MaterialType';
6
+ export class CopyPlayEffectRule extends EffectRule {
7
+ getPlayerMoves() {
8
+ const moves = this.cardRule.playArea
9
+ .index((i) => i !== this.effectCardIndex)
10
+ .getIndexes()
11
+ .map((i) => this.customMove(CustomMoveType.ChooseCard, i));
12
+ moves.push(this.customMove(CustomMoveType.EndEffect));
13
+ return moves;
14
+ }
15
+ onCustomMove(move) {
16
+ if (move.type === CustomMoveType.ChooseCard) {
17
+ const targetIndex = move.data;
18
+ const targetCard = this.game.items[MaterialType.Card][targetIndex].id.front;
19
+ const TargetRule = cardProperties[targetCard].rule;
20
+ const proxyRule = new TargetRule(this.game, this.effectCardIndex);
21
+ proxyRule.addPendingEffect = (ruleId) => {
22
+ this.memorize(Memory.PendingEffects, (effects) => [
23
+ ...effects, { cardIndex: this.effectCardIndex, ruleId, sourceCard: targetCard }
24
+ ]);
25
+ };
26
+ const subsequentEffects = this.remind(Memory.PendingEffects).splice(1);
27
+ proxyRule.onEnters?.();
28
+ this.memorize(Memory.PendingEffects, (effects) => [...effects, ...subsequentEffects]);
29
+ return this.endEffect();
30
+ }
31
+ return super.onCustomMove(move);
32
+ }
33
+ }
@@ -0,0 +1,14 @@
1
+ import { Deck } from '../../../Deck';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ declare class DartYusagiRule extends CardRule {
6
+ getPlayerPowerModifier(player: Deck): number;
7
+ }
8
+ export declare const DartYusagi: {
9
+ power: number;
10
+ type: CardType;
11
+ suit: CardSuit;
12
+ rule: typeof DartYusagiRule;
13
+ };
14
+ export {};
@@ -0,0 +1,26 @@
1
+ import { cardProperties } from '../../CardProperties';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ import { createCardRule } from '../../createCardRule';
6
+ class DartYusagiRule extends CardRule {
7
+ getPlayerPowerModifier(player) {
8
+ const playerCreatures = this.playArea
9
+ .player(player)
10
+ .id((id) => cardProperties[id.front].type === CardType.Creature);
11
+ let modifier = 0;
12
+ for (const index of playerCreatures.getIndexes()) {
13
+ const power = createCardRule(this.game, index).getPower();
14
+ if (power >= 4) {
15
+ modifier -= power;
16
+ }
17
+ }
18
+ return modifier;
19
+ }
20
+ }
21
+ export const DartYusagi = {
22
+ power: 1,
23
+ type: CardType.Creature,
24
+ suit: CardSuit.Day,
25
+ rule: DartYusagiRule
26
+ };
@@ -0,0 +1,19 @@
1
+ import { Deck } from '../../../Deck';
2
+ import { Card } from '../../Card';
3
+ import { CardRule } from '../../CardRule';
4
+ import { CardSuit } from '../../CardSuit';
5
+ import { CardType } from '../../CardType';
6
+ import { PlayCardConditionEffect } from '../../EffectTraits';
7
+ declare class DuelOfHonorRule extends CardRule implements PlayCardConditionEffect {
8
+ onEnters(): void;
9
+ canPlayCard(card: Card, player: Deck): boolean;
10
+ onPlayCardCondition(card: Card): void;
11
+ getEffectPlayers(): Deck[];
12
+ }
13
+ export declare const DuelOfHonor: {
14
+ power: number;
15
+ type: CardType;
16
+ suit: CardSuit;
17
+ rule: typeof DuelOfHonorRule;
18
+ };
19
+ export {};
@@ -0,0 +1,35 @@
1
+ import { Memory } from '../../../Memory';
2
+ import { RuleId } from '../../../rules/RuleId';
3
+ import { cardProperties } from '../../CardProperties';
4
+ import { CardRule } from '../../CardRule';
5
+ import { CardSuit } from '../../CardSuit';
6
+ import { CardType } from '../../CardType';
7
+ import { LocationType } from '../../LocationType';
8
+ import { MaterialType } from '../../MaterialType';
9
+ import { OngoingEffectType } from '../../OngoingEffect';
10
+ class DuelOfHonorRule extends CardRule {
11
+ onEnters() {
12
+ this.addOngoingEffect(OngoingEffectType.PlayCardCondition);
13
+ }
14
+ canPlayCard(card, player) {
15
+ if (cardProperties[card].type === CardType.Creature) {
16
+ return this.material(MaterialType.Card).location(LocationType.PlayerHand).player(player).length >= 2;
17
+ }
18
+ return true;
19
+ }
20
+ onPlayCardCondition(card) {
21
+ if (cardProperties[card].type === CardType.Creature) {
22
+ this.addPendingEffect(RuleId.DiscardEffect);
23
+ }
24
+ }
25
+ getEffectPlayers() {
26
+ const currentPlayer = this.remind(Memory.CurrentPlayer);
27
+ return [currentPlayer];
28
+ }
29
+ }
30
+ export const DuelOfHonor = {
31
+ power: 2,
32
+ type: CardType.Action,
33
+ suit: CardSuit.Twilight,
34
+ rule: DuelOfHonorRule
35
+ };
@@ -0,0 +1,17 @@
1
+ import { Material } from '@gamepark/rules-api';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ import { ChallengeEffect, SwitchSideEffect } from '../../EffectTraits';
6
+ declare class EmbushRule extends CardRule implements ChallengeEffect, SwitchSideEffect {
7
+ onEnters(): void;
8
+ onChallengeAccepted(): void;
9
+ getSwitchSideTargets(): Material;
10
+ }
11
+ export declare const Embush: {
12
+ power: number;
13
+ type: CardType;
14
+ suit: CardSuit;
15
+ rule: typeof EmbushRule;
16
+ };
17
+ export {};
@@ -0,0 +1,26 @@
1
+ import { RuleId } from '../../../rules/RuleId';
2
+ import { CardRule } from '../../CardRule';
3
+ import { cardProperties } from '../../CardProperties';
4
+ import { CardSuit } from '../../CardSuit';
5
+ import { CardType } from '../../CardType';
6
+ import { LocationType } from '../../LocationType';
7
+ import { MaterialType } from '../../MaterialType';
8
+ class EmbushRule extends CardRule {
9
+ onEnters() {
10
+ this.addPendingEffect(RuleId.ChallengeEffect);
11
+ }
12
+ onChallengeAccepted() {
13
+ this.addPendingEffect(RuleId.SwitchSideEffect);
14
+ }
15
+ getSwitchSideTargets() {
16
+ return this.material(MaterialType.Card)
17
+ .location(LocationType.PlayArea)
18
+ .id((id) => cardProperties[id.front].type === CardType.Action);
19
+ }
20
+ }
21
+ export const Embush = {
22
+ power: 1,
23
+ type: CardType.Action,
24
+ suit: CardSuit.Night,
25
+ rule: EmbushRule
26
+ };
@@ -0,0 +1,7 @@
1
+ import { ItemMove, MaterialMove } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ export declare class EmbushEffectRule extends EffectRule {
4
+ getPlayerMoves(): MaterialMove[];
5
+ getTargets(): import("@gamepark/rules-api").Material<number, number, number>;
6
+ afterItemMove(move: ItemMove): MaterialMove[];
7
+ }
@@ -0,0 +1,26 @@
1
+ import { isMoveItemType } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ import { cardProperties } from '../../CardProperties';
4
+ import { CardType } from '../../CardType';
5
+ import { LocationType } from '../../LocationType';
6
+ import { MaterialType } from '../../MaterialType';
7
+ export class EmbushEffectRule extends EffectRule {
8
+ getPlayerMoves() {
9
+ return this.getTargets().moveItems((item) => ({
10
+ type: LocationType.PlayArea,
11
+ player: item.location.player === this.player ? this.nextPlayer : this.player,
12
+ id: CardType.Action
13
+ }));
14
+ }
15
+ getTargets() {
16
+ return this.material(MaterialType.Card)
17
+ .location(LocationType.PlayArea)
18
+ .id((id) => cardProperties[id.front].type === CardType.Action);
19
+ }
20
+ afterItemMove(move) {
21
+ if (isMoveItemType(MaterialType.Card)(move) && move.location.type === LocationType.PlayArea) {
22
+ return this.endEffect();
23
+ }
24
+ return [];
25
+ }
26
+ }
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class EmpressSamaRule extends CardRule {
5
+ onEnters(): void;
6
+ }
7
+ export declare const EmpressSama: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof EmpressSamaRule;
12
+ };
13
+ export {};
@@ -0,0 +1,15 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ import { OngoingEffectType } from '../../OngoingEffect';
5
+ class EmpressSamaRule extends CardRule {
6
+ onEnters() {
7
+ this.addOngoingEffect(OngoingEffectType.KeepActionCard);
8
+ }
9
+ }
10
+ export const EmpressSama = {
11
+ power: 3,
12
+ type: CardType.Creature,
13
+ suit: CardSuit.Twilight,
14
+ rule: EmpressSamaRule
15
+ };
@@ -0,0 +1,7 @@
1
+ import { CustomMove, MaterialMove, PlayerTurnRule } from '@gamepark/rules-api';
2
+ import { RuleId } from '../../../rules/RuleId';
3
+ export declare class EmpressSamaEffectRule extends PlayerTurnRule {
4
+ getPlayerMoves(): MaterialMove[];
5
+ getActionCards(): import("@gamepark/rules-api").Material<number, number, number>;
6
+ onCustomMove(move: CustomMove): import("@gamepark/rules-api").StartPlayerTurn<number, RuleId.StartPlayerTurn>[];
7
+ }
@@ -0,0 +1,29 @@
1
+ import { PlayerTurnRule } from '@gamepark/rules-api';
2
+ import { cardProperties } from '../../CardProperties';
3
+ import { CardType } from '../../CardType';
4
+ import { CustomMoveType } from '../../../CustomMoveType';
5
+ import { LocationType } from '../../LocationType';
6
+ import { MaterialType } from '../../MaterialType';
7
+ import { Memory } from '../../../Memory';
8
+ import { OngoingEffectType } from '../../OngoingEffect';
9
+ import { RuleId } from '../../../rules/RuleId';
10
+ export class EmpressSamaEffectRule extends PlayerTurnRule {
11
+ getPlayerMoves() {
12
+ return this.getActionCards().getIndexes()
13
+ .map((i) => this.customMove(CustomMoveType.ChooseCard, i));
14
+ }
15
+ getActionCards() {
16
+ return this.material(MaterialType.Card)
17
+ .location(LocationType.PlayArea)
18
+ .player(this.player)
19
+ .filter((card) => cardProperties[card.id.front].type === CardType.Action);
20
+ }
21
+ onCustomMove(move) {
22
+ if (move.type === CustomMoveType.ChooseCard) {
23
+ this.memorize(Memory.OngoingEffects, (effects) => effects.map((e) => e.type === OngoingEffectType.KeepActionCard && this.material(MaterialType.Card).getItem(e.cardIndex).location.player === this.player
24
+ ? { ...e, targets: [move.data] } : e));
25
+ return [this.startPlayerTurn(RuleId.StartPlayerTurn, this.player)];
26
+ }
27
+ return [];
28
+ }
29
+ }
@@ -0,0 +1,15 @@
1
+ import { Deck } from '../../../Deck';
2
+ import { Card } from '../../Card';
3
+ import { CardRule } from '../../CardRule';
4
+ import { CardSuit } from '../../CardSuit';
5
+ import { CardType } from '../../CardType';
6
+ declare class GardenProtectorRule extends CardRule {
7
+ onCardEnters(card: Card, side: Deck): void;
8
+ }
9
+ export declare const GardenProtector: {
10
+ power: number;
11
+ type: CardType;
12
+ suit: CardSuit;
13
+ rule: typeof GardenProtectorRule;
14
+ };
15
+ export {};
@@ -0,0 +1,18 @@
1
+ import { RuleId } from '../../../rules/RuleId';
2
+ import { cardProperties } from '../../CardProperties';
3
+ import { CardRule } from '../../CardRule';
4
+ import { CardSuit } from '../../CardSuit';
5
+ import { CardType } from '../../CardType';
6
+ class GardenProtectorRule extends CardRule {
7
+ onCardEnters(card, side) {
8
+ if (side === this.foe && cardProperties[card].type === CardType.Creature) {
9
+ this.addPendingEffect(RuleId.StashPowerTokensEffect);
10
+ }
11
+ }
12
+ }
13
+ export const GardenProtector = {
14
+ power: 1,
15
+ type: CardType.Creature,
16
+ suit: CardSuit.Day,
17
+ rule: GardenProtectorRule
18
+ };
@@ -0,0 +1,16 @@
1
+ import { Material } from '@gamepark/rules-api';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ import { DestroyEffect } from '../../EffectTraits';
6
+ declare class ImperialBladeRule extends CardRule implements DestroyEffect {
7
+ onEnters(): void;
8
+ getDestroyTargets(): Material;
9
+ }
10
+ export declare const ImperialBlade: {
11
+ power: number;
12
+ type: CardType;
13
+ suit: CardSuit;
14
+ rule: typeof ImperialBladeRule;
15
+ };
16
+ export {};
@@ -0,0 +1,19 @@
1
+ import { RuleId } from '../../../rules/RuleId';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ import { createCardRule } from '../../createCardRule';
6
+ class ImperialBladeRule extends CardRule {
7
+ onEnters() {
8
+ this.addPendingEffect(RuleId.DestroyEffect);
9
+ }
10
+ getDestroyTargets() {
11
+ return this.creatures.index((index) => createCardRule(this.game, index).getPower() >= 6);
12
+ }
13
+ }
14
+ export const ImperialBlade = {
15
+ power: 2,
16
+ type: CardType.Creature,
17
+ suit: CardSuit.Day,
18
+ rule: ImperialBladeRule
19
+ };
@@ -0,0 +1,17 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class LotusMuseRule extends CardRule {
5
+ get allCardsPowerTokens(): import("@gamepark/rules-api").Material<number, number, number>;
6
+ get allCardsStunTokens(): import("@gamepark/rules-api").Material<number, number, number>;
7
+ get allCardsSpecialTokens(): import("@gamepark/rules-api").Material<number, number, number>;
8
+ canActivate(): boolean;
9
+ activate(): void;
10
+ }
11
+ export declare const LotusMuse: {
12
+ power: number;
13
+ type: CardType;
14
+ suit: CardSuit;
15
+ rule: typeof LotusMuseRule;
16
+ };
17
+ export {};
@@ -0,0 +1,34 @@
1
+ import { RuleId } from '../../../rules/RuleId';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ import { LocationType } from '../../LocationType';
6
+ import { MaterialType } from '../../MaterialType';
7
+ class LotusMuseRule extends CardRule {
8
+ get allCardsPowerTokens() {
9
+ return this.material(MaterialType.PowerToken).location(LocationType.CardPowerTokens);
10
+ }
11
+ get allCardsStunTokens() {
12
+ return this.material(MaterialType.StunToken).location(LocationType.CardStunTokens);
13
+ }
14
+ get allCardsSpecialTokens() {
15
+ return this.material(MaterialType.SpecialToken).location(LocationType.CardSpecialTokens);
16
+ }
17
+ canActivate() {
18
+ if (!super.canActivate())
19
+ return false;
20
+ const creatureIndexes = this.creatures.getIndexes();
21
+ return (this.allCardsPowerTokens.getItems().some((i) => creatureIndexes.includes(i.location.parent)) ||
22
+ this.allCardsStunTokens.getItems().some((i) => creatureIndexes.includes(i.location.parent)) ||
23
+ this.allCardsSpecialTokens.getItems().some((i) => creatureIndexes.includes(i.location.parent)));
24
+ }
25
+ activate() {
26
+ this.addPendingEffect(RuleId.LotusMuseEffect);
27
+ }
28
+ }
29
+ export const LotusMuse = {
30
+ power: 1,
31
+ type: CardType.Creature,
32
+ suit: CardSuit.Twilight,
33
+ rule: LotusMuseRule
34
+ };
@@ -0,0 +1,6 @@
1
+ import { ItemMove, MaterialMove } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ export declare class LotusMuseEffectRule extends EffectRule {
4
+ getPlayerMoves(): MaterialMove[];
5
+ afterItemMove(move: ItemMove): MaterialMove[];
6
+ }
@@ -0,0 +1,24 @@
1
+ import { isMoveItemType } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ import { LocationType } from '../../LocationType';
4
+ import { MaterialType } from '../../MaterialType';
5
+ export class LotusMuseEffectRule extends EffectRule {
6
+ getPlayerMoves() {
7
+ const moves = [];
8
+ const creatures = this.cardRule.creatures.getIndexes();
9
+ const powerTokens = this.material(MaterialType.PowerToken).location(LocationType.CardPowerTokens);
10
+ const stunTokens = this.material(MaterialType.StunToken).location(LocationType.CardStunTokens);
11
+ const specialTokens = this.material(MaterialType.SpecialToken).location(LocationType.CardSpecialTokens);
12
+ for (const creature of creatures) {
13
+ const notOnTarget = (parent) => parent !== creature;
14
+ moves.push(...powerTokens.parent(notOnTarget).moveItems({ type: LocationType.CardPowerTokens, parent: creature }, 1), ...stunTokens.parent(notOnTarget).moveItems({ type: LocationType.CardStunTokens, parent: creature }, 1), ...specialTokens.parent(notOnTarget).moveItems({ type: LocationType.CardSpecialTokens, parent: creature }, 1));
15
+ }
16
+ return moves;
17
+ }
18
+ afterItemMove(move) {
19
+ if (isMoveItemType(MaterialType.PowerToken)(move) || isMoveItemType(MaterialType.StunToken)(move) || isMoveItemType(MaterialType.SpecialToken)(move)) {
20
+ return this.endEffect();
21
+ }
22
+ return [];
23
+ }
24
+ }
@@ -0,0 +1,16 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ import { ChallengeEffect, StashPowerTokenEffect } from '../../EffectTraits';
5
+ declare class PortalOfTheAncestorsRule extends CardRule implements ChallengeEffect, StashPowerTokenEffect {
6
+ onEnters(): void;
7
+ onChallengeAccepted(): void;
8
+ getStashPowerTokenCount(): number;
9
+ }
10
+ export declare const PortalOfTheAncestors: {
11
+ power: number;
12
+ type: CardType;
13
+ suit: CardSuit;
14
+ rule: typeof PortalOfTheAncestorsRule;
15
+ };
16
+ export {};