@gamepark/skyrift 0.2.9 → 0.3.0

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 (81) hide show
  1. package/dist/Deck.d.ts +1 -0
  2. package/dist/Deck.js +1 -0
  3. package/dist/Memory.d.ts +2 -1
  4. package/dist/Memory.js +1 -0
  5. package/dist/SkyriftRules.d.ts +21 -0
  6. package/dist/SkyriftRules.js +27 -0
  7. package/dist/SkyriftSetup.js +3 -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 +3 -2
  12. package/dist/material/CardRule.js +14 -0
  13. package/dist/material/OngoingEffect.d.ts +8 -0
  14. package/dist/material/OngoingEffect.js +5 -0
  15. package/dist/material/decks/WinSands.d.ts +18 -0
  16. package/dist/material/decks/WinSands.js +19 -0
  17. package/dist/material/decks/heathblade/OzmaTheMageEffectRule.js +1 -3
  18. package/dist/material/decks/heathblade/RobbinsMasterOfArmsEffectRule.js +1 -3
  19. package/dist/material/decks/winsands/AbiSnakeCharmer.d.ts +13 -0
  20. package/dist/material/decks/winsands/AbiSnakeCharmer.js +12 -0
  21. package/dist/material/decks/winsands/AbiSnakeCharmerEffectRule.d.ts +7 -0
  22. package/dist/material/decks/winsands/AbiSnakeCharmerEffectRule.js +33 -0
  23. package/dist/material/decks/winsands/AncientCurse.d.ts +16 -0
  24. package/dist/material/decks/winsands/AncientCurse.js +23 -0
  25. package/dist/material/decks/winsands/Catadjinn.d.ts +14 -0
  26. package/dist/material/decks/winsands/Catadjinn.js +24 -0
  27. package/dist/material/decks/winsands/CreatureBonusCardRule.d.ts +4 -0
  28. package/dist/material/decks/winsands/CreatureBonusCardRule.js +14 -0
  29. package/dist/material/decks/winsands/DeathTrap.d.ts +14 -0
  30. package/dist/material/decks/winsands/DeathTrap.js +16 -0
  31. package/dist/material/decks/winsands/DeathTrapEffectRule.d.ts +4 -0
  32. package/dist/material/decks/winsands/DeathTrapEffectRule.js +18 -0
  33. package/dist/material/decks/winsands/DesertRaider.d.ts +13 -0
  34. package/dist/material/decks/winsands/DesertRaider.js +12 -0
  35. package/dist/material/decks/winsands/DesertRaiderEffectRule.d.ts +4 -0
  36. package/dist/material/decks/winsands/DesertRaiderEffectRule.js +17 -0
  37. package/dist/material/decks/winsands/DuneWardrums.d.ts +12 -0
  38. package/dist/material/decks/winsands/DuneWardrums.js +22 -0
  39. package/dist/material/decks/winsands/ErgDeathslayer.d.ts +13 -0
  40. package/dist/material/decks/winsands/ErgDeathslayer.js +19 -0
  41. package/dist/material/decks/winsands/MalikShadowtracker.d.ts +14 -0
  42. package/dist/material/decks/winsands/MalikShadowtracker.js +16 -0
  43. package/dist/material/decks/winsands/MalikShadowtrackerEffectRule.d.ts +4 -0
  44. package/dist/material/decks/winsands/MalikShadowtrackerEffectRule.js +13 -0
  45. package/dist/material/decks/winsands/Metamorph.d.ts +14 -0
  46. package/dist/material/decks/winsands/Metamorph.js +15 -0
  47. package/dist/material/decks/winsands/MushaFakir.d.ts +15 -0
  48. package/dist/material/decks/winsands/MushaFakir.js +16 -0
  49. package/dist/material/decks/winsands/OasisShaman.d.ts +13 -0
  50. package/dist/material/decks/winsands/OasisShaman.js +12 -0
  51. package/dist/material/decks/winsands/OasisShamanEffectRule.d.ts +8 -0
  52. package/dist/material/decks/winsands/OasisShamanEffectRule.js +33 -0
  53. package/dist/material/decks/winsands/SandWalkers.d.ts +17 -0
  54. package/dist/material/decks/winsands/SandWalkers.js +26 -0
  55. package/dist/material/decks/winsands/SandWalkersEffectRule.d.ts +5 -0
  56. package/dist/material/decks/winsands/SandWalkersEffectRule.js +25 -0
  57. package/dist/material/decks/winsands/StarlightBazaar.d.ts +13 -0
  58. package/dist/material/decks/winsands/StarlightBazaar.js +12 -0
  59. package/dist/material/decks/winsands/StarlightBazaarEffectRule.d.ts +4 -0
  60. package/dist/material/decks/winsands/StarlightBazaarEffectRule.js +6 -0
  61. package/dist/material/decks/winsands/Vandals.d.ts +13 -0
  62. package/dist/material/decks/winsands/Vandals.js +12 -0
  63. package/dist/material/decks/winsands/VandalsEffectRule.d.ts +4 -0
  64. package/dist/material/decks/winsands/VandalsEffectRule.js +14 -0
  65. package/dist/material/decks/winsands/WindWrath.d.ts +13 -0
  66. package/dist/material/decks/winsands/WindWrath.js +12 -0
  67. package/dist/material/decks/winsands/WindWrathEffectRule.d.ts +5 -0
  68. package/dist/material/decks/winsands/WindWrathEffectRule.js +20 -0
  69. package/dist/material/decks/winsands/WishLamp.d.ts +13 -0
  70. package/dist/material/decks/winsands/WishLamp.js +12 -0
  71. package/dist/material/decks/winsands/WishLampEffectRule.d.ts +10 -0
  72. package/dist/material/decks/winsands/WishLampEffectRule.js +46 -0
  73. package/dist/rules/EffectRule.d.ts +1 -0
  74. package/dist/rules/EffectRule.js +4 -2
  75. package/dist/rules/PlayCardRule.js +4 -19
  76. package/dist/rules/PlayerHelper.d.ts +2 -1
  77. package/dist/rules/PlayerHelper.js +32 -0
  78. package/dist/rules/PrepareNextRoundRule.js +1 -0
  79. package/dist/rules/RuleId.d.ts +12 -0
  80. package/dist/rules/RuleId.js +12 -0
  81. package/package.json +2 -2
@@ -0,0 +1,12 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ class DesertRaiderRule extends CardRule {
5
+ entersEffect = true;
6
+ }
7
+ export const DesertRaider = {
8
+ power: 5,
9
+ type: CardType.Creature,
10
+ suit: CardSuit.Day,
11
+ rule: DesertRaiderRule
12
+ };
@@ -0,0 +1,4 @@
1
+ import { EffectRule } from '../../../rules/EffectRule';
2
+ export declare class DesertRaiderEffectRule extends EffectRule {
3
+ onRuleStart(): import("@gamepark/rules-api").MaterialMove[];
4
+ }
@@ -0,0 +1,17 @@
1
+ import { EffectRule } from '../../../rules/EffectRule';
2
+ import { LocationType } from '../../LocationType';
3
+ import { MaterialType } from '../../MaterialType';
4
+ export class DesertRaiderEffectRule extends EffectRule {
5
+ onRuleStart() {
6
+ return [
7
+ this.material(MaterialType.StunToken).createItem({
8
+ location: {
9
+ type: LocationType.CardStunTokens,
10
+ parent: this.effectCardIndex
11
+ },
12
+ quantity: 1
13
+ }),
14
+ ...this.endEffect()
15
+ ];
16
+ }
17
+ }
@@ -0,0 +1,12 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ export declare class DuneWardrumsRule extends CardRule {
5
+ getPowerIfNotStunned(): number;
6
+ }
7
+ export declare const DuneWardrums: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof DuneWardrumsRule;
12
+ };
@@ -0,0 +1,22 @@
1
+ import { cardProperties } from '../../CardProperties';
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
+ export class DuneWardrumsRule extends CardRule {
8
+ getPowerIfNotStunned() {
9
+ const myCreatures = this.material(MaterialType.Card)
10
+ .location(LocationType.PlayArea)
11
+ .player(this.player)
12
+ .id((id) => cardProperties[id.front].type === CardType.Creature);
13
+ const bonus = this.properties.type === CardType.Creature ? myCreatures.length - 1 : myCreatures.length;
14
+ return super.getPowerIfNotStunned() + bonus;
15
+ }
16
+ }
17
+ export const DuneWardrums = {
18
+ power: 2,
19
+ type: CardType.Action,
20
+ suit: CardSuit.Day,
21
+ rule: DuneWardrumsRule
22
+ };
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class ErgDeathslayerRule extends CardRule {
5
+ canBePlayed(): boolean;
6
+ }
7
+ export declare const ErgDeathslayer: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof ErgDeathslayerRule;
12
+ };
13
+ export {};
@@ -0,0 +1,19 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ import { LocationType } from '../../LocationType';
5
+ import { MaterialType } from '../../MaterialType';
6
+ class ErgDeathslayerRule extends CardRule {
7
+ canBePlayed() {
8
+ const otherCardsInPlay = this.material(MaterialType.Card)
9
+ .location(LocationType.PlayArea)
10
+ .player(this.player);
11
+ return otherCardsInPlay.length === 0 && super.canBePlayed();
12
+ }
13
+ }
14
+ export const ErgDeathslayer = {
15
+ power: 5,
16
+ type: CardType.Creature,
17
+ suit: CardSuit.Day,
18
+ rule: ErgDeathslayerRule
19
+ };
@@ -0,0 +1,14 @@
1
+ import { MaterialMove } from '@gamepark/rules-api';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ declare class MalikShadowtrackerRule extends CardRule {
6
+ onEnters(): MaterialMove[];
7
+ }
8
+ export declare const MalikShadowtracker: {
9
+ power: number;
10
+ type: CardType;
11
+ suit: CardSuit;
12
+ rule: typeof MalikShadowtrackerRule;
13
+ };
14
+ export {};
@@ -0,0 +1,16 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ import { OngoingEffectType } from '../../OngoingEffect';
5
+ class MalikShadowtrackerRule extends CardRule {
6
+ onEnters() {
7
+ this.addOngoingEffect(OngoingEffectType.ForcedSuit);
8
+ return [];
9
+ }
10
+ }
11
+ export const MalikShadowtracker = {
12
+ power: 2,
13
+ type: CardType.Creature,
14
+ suit: CardSuit.Twilight,
15
+ rule: MalikShadowtrackerRule
16
+ };
@@ -0,0 +1,4 @@
1
+ import { EffectRule } from '../../../rules/EffectRule';
2
+ export declare class MalikShadowtrackerEffectRule extends EffectRule {
3
+ onRuleStart(): import("@gamepark/rules-api").MaterialMove[];
4
+ }
@@ -0,0 +1,13 @@
1
+ import { Memory } from '../../../Memory';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { OngoingEffectType } from '../../OngoingEffect';
5
+ export class MalikShadowtrackerEffectRule extends EffectRule {
6
+ onRuleStart() {
7
+ this.memorize(Memory.OngoingEffects, (effects) => [
8
+ ...effects,
9
+ { type: OngoingEffectType.ForcedSuit, player: this.nextPlayer, suit: CardSuit.Twilight }
10
+ ]);
11
+ return this.endEffect();
12
+ }
13
+ }
@@ -0,0 +1,14 @@
1
+ import { MaterialMove } from '@gamepark/rules-api';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ import { DuneWardrumsRule } from './DuneWardrums';
5
+ declare class MetamorphRule extends DuneWardrumsRule {
6
+ onWinRound(): MaterialMove[];
7
+ }
8
+ export declare const Metamorph: {
9
+ power: number;
10
+ type: CardType;
11
+ suit: CardSuit;
12
+ rule: typeof MetamorphRule;
13
+ };
14
+ export {};
@@ -0,0 +1,15 @@
1
+ import { CardSuit } from '../../CardSuit';
2
+ import { CardType } from '../../CardType';
3
+ import { DuneWardrumsRule } from './DuneWardrums';
4
+ class MetamorphRule extends DuneWardrumsRule {
5
+ onWinRound() {
6
+ this.addPendingEffect();
7
+ return [];
8
+ }
9
+ }
10
+ export const Metamorph = {
11
+ power: 1,
12
+ type: CardType.Creature,
13
+ suit: CardSuit.Day,
14
+ rule: MetamorphRule
15
+ };
@@ -0,0 +1,15 @@
1
+ import { MaterialMove } from '@gamepark/rules-api';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ declare class MushaFakirRule extends CardRule {
6
+ entersEffect: boolean;
7
+ onLoseRound(): MaterialMove[];
8
+ }
9
+ export declare const MushaFakir: {
10
+ power: number;
11
+ type: CardType;
12
+ suit: CardSuit;
13
+ rule: typeof MushaFakirRule;
14
+ };
15
+ export {};
@@ -0,0 +1,16 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ class MushaFakirRule extends CardRule {
5
+ entersEffect = true;
6
+ onLoseRound() {
7
+ this.addPendingEffect();
8
+ return [];
9
+ }
10
+ }
11
+ export const MushaFakir = {
12
+ power: 2,
13
+ type: CardType.Creature,
14
+ suit: CardSuit.Night,
15
+ rule: MushaFakirRule
16
+ };
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class OasisShamanRule extends CardRule {
5
+ entersEffect: boolean;
6
+ }
7
+ export declare const OasisShaman: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof OasisShamanRule;
12
+ };
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ class OasisShamanRule extends CardRule {
5
+ entersEffect = true;
6
+ }
7
+ export const OasisShaman = {
8
+ power: 1,
9
+ type: CardType.Creature,
10
+ suit: CardSuit.Twilight,
11
+ rule: OasisShamanRule
12
+ };
@@ -0,0 +1,8 @@
1
+ import { ItemMove, MaterialMove } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ export declare class OasisShamanEffectRule extends EffectRule {
4
+ onRuleStart(): MaterialMove[];
5
+ getPlayerMoves(): MaterialMove[];
6
+ get handCards(): import("@gamepark/rules-api").Material<number, number, number>;
7
+ afterItemMove(move: ItemMove): MaterialMove[];
8
+ }
@@ -0,0 +1,33 @@
1
+ import { isMoveItemType } from '@gamepark/rules-api';
2
+ import { PlayerHelper } from '../../../rules/PlayerHelper';
3
+ import { EffectRule } from '../../../rules/EffectRule';
4
+ import { cardProperties } from '../../CardProperties';
5
+ import { LocationType } from '../../LocationType';
6
+ import { MaterialType } from '../../MaterialType';
7
+ export class OasisShamanEffectRule extends EffectRule {
8
+ onRuleStart() {
9
+ if (!this.handCards.length) {
10
+ return this.endEffect();
11
+ }
12
+ return [];
13
+ }
14
+ getPlayerMoves() {
15
+ return this.handCards.moveItems((item) => ({
16
+ type: LocationType.PlayArea,
17
+ player: this.player,
18
+ id: cardProperties[item.id.front].type
19
+ }));
20
+ }
21
+ get handCards() {
22
+ return this.material(MaterialType.Card)
23
+ .location(LocationType.PlayerHand)
24
+ .player(this.player);
25
+ }
26
+ afterItemMove(move) {
27
+ if (isMoveItemType(MaterialType.Card)(move) && move.location.type === LocationType.PlayArea) {
28
+ const moves = new PlayerHelper(this.game, this.player).onCardPlayed(move.itemIndex);
29
+ return [...moves, ...this.endEffect()];
30
+ }
31
+ return [];
32
+ }
33
+ }
@@ -0,0 +1,17 @@
1
+ import { MaterialMove } from '@gamepark/rules-api';
2
+ import { Deck } from '../../../Deck';
3
+ import { Card } from '../../Card';
4
+ import { CardRule } from '../../CardRule';
5
+ import { CardSuit } from '../../CardSuit';
6
+ import { CardType } from '../../CardType';
7
+ declare class SandWalkersRule extends CardRule {
8
+ entersEffect: boolean;
9
+ onCardEnters(card: Card, side: Deck): MaterialMove[];
10
+ }
11
+ export declare const SandWalkers: {
12
+ power: number;
13
+ type: CardType;
14
+ suit: CardSuit;
15
+ rule: typeof SandWalkersRule;
16
+ };
17
+ 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 { LocationType } from '../../LocationType';
6
+ import { MaterialType } from '../../MaterialType';
7
+ class SandWalkersRule extends CardRule {
8
+ entersEffect = true;
9
+ onCardEnters(card, side) {
10
+ if (side === this.player && cardProperties[card].type === CardType.Creature) {
11
+ return [
12
+ this.material(MaterialType.Card).index(this.index).moveItem({
13
+ type: LocationType.PlayerHand,
14
+ player: this.player
15
+ })
16
+ ];
17
+ }
18
+ return [];
19
+ }
20
+ }
21
+ export const SandWalkers = {
22
+ power: 1,
23
+ type: CardType.Action,
24
+ suit: CardSuit.Day,
25
+ rule: SandWalkersRule
26
+ };
@@ -0,0 +1,5 @@
1
+ import { MaterialMove } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ export declare class SandWalkersEffectRule extends EffectRule {
4
+ onRuleStart(): MaterialMove[];
5
+ }
@@ -0,0 +1,25 @@
1
+ import { EffectRule } from '../../../rules/EffectRule';
2
+ import { cardProperties } from '../../CardProperties';
3
+ import { CardType } from '../../CardType';
4
+ import { LocationType } from '../../LocationType';
5
+ import { MaterialType } from '../../MaterialType';
6
+ export class SandWalkersEffectRule extends EffectRule {
7
+ onRuleStart() {
8
+ const moves = [];
9
+ const myCreatures = this.material(MaterialType.Card)
10
+ .location(LocationType.PlayArea)
11
+ .player(this.player)
12
+ .id((id) => cardProperties[id.front].type === CardType.Creature);
13
+ for (const creatureIndex of myCreatures.getIndexes()) {
14
+ moves.push(this.material(MaterialType.PowerToken)
15
+ .location(LocationType.PowerTokenStock)
16
+ .createItem({
17
+ location: {
18
+ type: LocationType.CardPowerTokens,
19
+ parent: creatureIndex
20
+ }
21
+ }));
22
+ }
23
+ return [...moves, ...this.endEffect()];
24
+ }
25
+ }
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class StarlightBazaarRule extends CardRule {
5
+ entersEffect: boolean;
6
+ }
7
+ export declare const StarlightBazaar: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof StarlightBazaarRule;
12
+ };
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ class StarlightBazaarRule extends CardRule {
5
+ entersEffect = true;
6
+ }
7
+ export const StarlightBazaar = {
8
+ power: 1,
9
+ type: CardType.Action,
10
+ suit: CardSuit.Night,
11
+ rule: StarlightBazaarRule
12
+ };
@@ -0,0 +1,4 @@
1
+ import { DrawEffectRule } from '../../../rules/DrawEffectRule';
2
+ export declare class StarlightBazaarEffectRule extends DrawEffectRule {
3
+ getDrawCount(): number;
4
+ }
@@ -0,0 +1,6 @@
1
+ import { DrawEffectRule } from '../../../rules/DrawEffectRule';
2
+ export class StarlightBazaarEffectRule extends DrawEffectRule {
3
+ getDrawCount() {
4
+ return 3;
5
+ }
6
+ }
@@ -0,0 +1,13 @@
1
+ import { CardSuit } from '../../CardSuit';
2
+ import { CardType } from '../../CardType';
3
+ import { DuneWardrumsRule } from './DuneWardrums';
4
+ declare class VandalsRule extends DuneWardrumsRule {
5
+ oncePerTurnEffect: boolean;
6
+ }
7
+ export declare const Vandals: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof VandalsRule;
12
+ };
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { CardSuit } from '../../CardSuit';
2
+ import { CardType } from '../../CardType';
3
+ import { DuneWardrumsRule } from './DuneWardrums';
4
+ class VandalsRule extends DuneWardrumsRule {
5
+ oncePerTurnEffect = true;
6
+ }
7
+ export const Vandals = {
8
+ power: 1,
9
+ type: CardType.Creature,
10
+ suit: CardSuit.Night,
11
+ rule: VandalsRule
12
+ };
@@ -0,0 +1,4 @@
1
+ import { DrawEffectRule } from '../../../rules/DrawEffectRule';
2
+ export declare class VandalsEffectRule extends DrawEffectRule {
3
+ onRuleStart(): import("@gamepark/rules-api").MaterialMove[];
4
+ }
@@ -0,0 +1,14 @@
1
+ import { DrawEffectRule } from '../../../rules/DrawEffectRule';
2
+ import { LocationType } from '../../LocationType';
3
+ import { MaterialType } from '../../MaterialType';
4
+ export class VandalsEffectRule extends DrawEffectRule {
5
+ onRuleStart() {
6
+ return [
7
+ this.material(MaterialType.Card).index(this.effectCardIndex).moveItem({
8
+ type: LocationType.PlayerDiscard,
9
+ player: this.player
10
+ }),
11
+ ...super.onRuleStart()
12
+ ];
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class WindWrathRule extends CardRule {
5
+ entersEffect: boolean;
6
+ }
7
+ export declare const WindWrath: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof WindWrathRule;
12
+ };
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ class WindWrathRule extends CardRule {
5
+ entersEffect = true;
6
+ }
7
+ export const WindWrath = {
8
+ power: 2,
9
+ type: CardType.Action,
10
+ suit: CardSuit.Twilight,
11
+ rule: WindWrathRule
12
+ };
@@ -0,0 +1,5 @@
1
+ import { MaterialMove } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ export declare class WindWrathEffectRule extends EffectRule {
4
+ onRuleStart(): MaterialMove[];
5
+ }
@@ -0,0 +1,20 @@
1
+ import { CustomMoveType } from '../../../CustomMoveType';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ import { LocationType } from '../../LocationType';
4
+ import { MaterialType } from '../../MaterialType';
5
+ export class WindWrathEffectRule extends EffectRule {
6
+ onRuleStart() {
7
+ const moves = [];
8
+ const playerHand = this.material(MaterialType.Card).location(LocationType.PlayerHand).player(this.player);
9
+ const foeHand = this.material(MaterialType.Card).location(LocationType.PlayerHand).player(this.nextPlayer);
10
+ if (playerHand.length > 0) {
11
+ moves.push(playerHand.moveItemsAtOnce({ type: LocationType.PlayerDiscard, player: this.player }));
12
+ moves.push(this.customMove(CustomMoveType.Draw, { player: this.player, quantity: playerHand.length }));
13
+ }
14
+ if (foeHand.length > 0) {
15
+ moves.push(foeHand.moveItemsAtOnce({ type: LocationType.PlayerDiscard, player: this.nextPlayer }));
16
+ moves.push(this.customMove(CustomMoveType.Draw, { player: this.nextPlayer, quantity: foeHand.length }));
17
+ }
18
+ return [...moves, ...this.endEffect()];
19
+ }
20
+ }
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class WishLampRule extends CardRule {
5
+ entersEffect: boolean;
6
+ }
7
+ export declare const WishLamp: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof WishLampRule;
12
+ };
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ class WishLampRule extends CardRule {
5
+ entersEffect = true;
6
+ }
7
+ export const WishLamp = {
8
+ power: 2,
9
+ type: CardType.Action,
10
+ suit: CardSuit.Night,
11
+ rule: WishLampRule
12
+ };
@@ -0,0 +1,10 @@
1
+ import { ItemMove, Material } from '@gamepark/rules-api';
2
+ import { StunCardRule } from '../../../rules/StunCardRule';
3
+ export declare class WishLampEffectRule extends StunCardRule {
4
+ stunCount: number;
5
+ onRuleStart(): import("@gamepark/rules-api").MaterialMove[];
6
+ getTargets(): Material;
7
+ afterItemMove(move: ItemMove): import("@gamepark/rules-api").MaterialMove[];
8
+ get catadjinnCount(): number;
9
+ onRuleEnd(): never[];
10
+ }
@@ -0,0 +1,46 @@
1
+ import { isCreateItemType } from '@gamepark/rules-api';
2
+ import { Memory } from '../../../Memory';
3
+ import { StunCardRule } from '../../../rules/StunCardRule';
4
+ import { Card } from '../../Card';
5
+ import { cardProperties } from '../../CardProperties';
6
+ import { CardType } from '../../CardType';
7
+ import { LocationType } from '../../LocationType';
8
+ import { MaterialType } from '../../MaterialType';
9
+ export class WishLampEffectRule extends StunCardRule {
10
+ stunCount = 2;
11
+ onRuleStart() {
12
+ this.memorize(Memory.EffectCount, []);
13
+ if (!this.getTargets().length) {
14
+ return this.endEffect();
15
+ }
16
+ return [];
17
+ }
18
+ getTargets() {
19
+ const stunned = this.remind(Memory.EffectCount);
20
+ return this.material(MaterialType.Card)
21
+ .location(LocationType.PlayArea)
22
+ .id((id) => cardProperties[id.front].type === CardType.Creature)
23
+ .index((index) => !stunned.includes(index));
24
+ }
25
+ afterItemMove(move) {
26
+ if (isCreateItemType(MaterialType.StunToken)(move) && move.item.location.type === LocationType.CardStunTokens) {
27
+ const stunned = this.memorize(Memory.EffectCount, (s) => [...s, move.item.location.parent]);
28
+ if (stunned.length >= 1 + this.catadjinnCount || !this.getTargets().length) {
29
+ return this.endEffect();
30
+ }
31
+ return [];
32
+ }
33
+ return [];
34
+ }
35
+ get catadjinnCount() {
36
+ return this.material(MaterialType.Card)
37
+ .location(LocationType.PlayArea)
38
+ .player(this.player)
39
+ .id((id) => id.front === Card.Catadjinn)
40
+ .length;
41
+ }
42
+ onRuleEnd() {
43
+ this.forget(Memory.EffectCount);
44
+ return [];
45
+ }
46
+ }
@@ -1,5 +1,6 @@
1
1
  import { CustomMove, MaterialMove, PlayerTurnRule } from '@gamepark/rules-api';
2
2
  export declare class EffectRule extends PlayerTurnRule {
3
+ get effectCardIndex(): number;
3
4
  get cardRule(): import("../material/CardRule").CardRule;
4
5
  endEffect(): MaterialMove[];
5
6
  onCustomMove(move: CustomMove): MaterialMove[];
@@ -6,9 +6,11 @@ import { Memory } from '../Memory';
6
6
  import { PlayerHelper } from './PlayerHelper';
7
7
  import { RuleId } from './RuleId';
8
8
  export class EffectRule extends PlayerTurnRule {
9
+ get effectCardIndex() {
10
+ return this.remind(Memory.PendingEffects)[0].cardIndex;
11
+ }
9
12
  get cardRule() {
10
- const pendingEffects = this.remind(Memory.PendingEffects);
11
- return new PlayerHelper(this.game, this.player).getCardRule(pendingEffects[0].cardIndex);
13
+ return new PlayerHelper(this.game, this.player).getCardRule(this.effectCardIndex);
12
14
  }
13
15
  endEffect() {
14
16
  return [this.customMove(CustomMoveType.EndEffect)];