@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
package/dist/Deck.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export declare enum Deck {
2
2
  HearthBlade = 1,
3
+ WinSands = 2,
3
4
  HighWave = 6
4
5
  }
package/dist/Deck.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export var Deck;
2
2
  (function (Deck) {
3
3
  Deck[Deck["HearthBlade"] = 1] = "HearthBlade";
4
+ Deck[Deck["WinSands"] = 2] = "WinSands";
4
5
  Deck[Deck["HighWave"] = 6] = "HighWave";
5
6
  })(Deck || (Deck = {}));
package/dist/Memory.d.ts CHANGED
@@ -7,5 +7,6 @@ export declare enum Memory {
7
7
  CurrentPlayer = 6,
8
8
  NextRoundStartPlayer = 7,
9
9
  EffectCount = 8,
10
- ChallengeConceded = 9
10
+ ChallengeConceded = 9,
11
+ OngoingEffects = 10
11
12
  }
package/dist/Memory.js CHANGED
@@ -9,4 +9,5 @@ export var Memory;
9
9
  Memory[Memory["NextRoundStartPlayer"] = 7] = "NextRoundStartPlayer";
10
10
  Memory[Memory["EffectCount"] = 8] = "EffectCount";
11
11
  Memory[Memory["ChallengeConceded"] = 9] = "ChallengeConceded";
12
+ Memory[Memory["OngoingEffects"] = 10] = "OngoingEffects";
12
13
  })(Memory || (Memory = {}));
@@ -20,6 +20,15 @@ import { TideRoverEffectRule } from './material/decks/highwave/TideRoverEffectRu
20
20
  import { RiggingRaidersEffectRule } from './material/decks/highwave/RiggingRaidersEffectRule';
21
21
  import { OscarScullionEffectRule } from './material/decks/highwave/OscarScullionEffectRule';
22
22
  import { SurpriseLootEffectRule } from './material/decks/highwave/SurpriseLootEffectRule';
23
+ import { AbiSnakeCharmerEffectRule } from './material/decks/winsands/AbiSnakeCharmerEffectRule';
24
+ import { DeathTrapEffectRule } from './material/decks/winsands/DeathTrapEffectRule';
25
+ import { DesertRaiderEffectRule } from './material/decks/winsands/DesertRaiderEffectRule';
26
+ import { OasisShamanEffectRule } from './material/decks/winsands/OasisShamanEffectRule';
27
+ import { SandWalkersEffectRule } from './material/decks/winsands/SandWalkersEffectRule';
28
+ import { StarlightBazaarEffectRule } from './material/decks/winsands/StarlightBazaarEffectRule';
29
+ import { VandalsEffectRule } from './material/decks/winsands/VandalsEffectRule';
30
+ import { WindWrathEffectRule } from './material/decks/winsands/WindWrathEffectRule';
31
+ import { WishLampEffectRule } from './material/decks/winsands/WishLampEffectRule';
23
32
  import { LocationType } from './material/LocationType';
24
33
  import { MaterialType } from './material/MaterialType';
25
34
  import { ChallengeRule } from './rules/ChallengeRule';
@@ -55,6 +64,18 @@ export declare class SkyriftRules extends SecretMaterialRules<Deck, MaterialType
55
64
  114: typeof WatchTowerEffectRule;
56
65
  115: typeof DrawEffectRule;
57
66
  116: typeof HarvestEffectRule;
67
+ 201: typeof DesertRaiderEffectRule;
68
+ 202: typeof DrawEffectRule;
69
+ 204: typeof AbiSnakeCharmerEffectRule;
70
+ 206: typeof VandalsEffectRule;
71
+ 207: typeof DrawEffectRule;
72
+ 208: typeof OasisShamanEffectRule;
73
+ 211: typeof SandWalkersEffectRule;
74
+ 212: typeof WishLampEffectRule;
75
+ 213: typeof StarlightBazaarEffectRule;
76
+ 214: typeof DrawEffectRule;
77
+ 215: typeof WindWrathEffectRule;
78
+ 216: typeof DeathTrapEffectRule;
58
79
  601: typeof SeaScorcherEffectRule;
59
80
  602: typeof DrawEffectRule;
60
81
  603: typeof EyeOfSkyEffectRule;
@@ -20,6 +20,15 @@ import { TideRoverEffectRule } from './material/decks/highwave/TideRoverEffectRu
20
20
  import { RiggingRaidersEffectRule } from './material/decks/highwave/RiggingRaidersEffectRule';
21
21
  import { OscarScullionEffectRule } from './material/decks/highwave/OscarScullionEffectRule';
22
22
  import { SurpriseLootEffectRule } from './material/decks/highwave/SurpriseLootEffectRule';
23
+ import { AbiSnakeCharmerEffectRule } from './material/decks/winsands/AbiSnakeCharmerEffectRule';
24
+ import { DeathTrapEffectRule } from './material/decks/winsands/DeathTrapEffectRule';
25
+ import { DesertRaiderEffectRule } from './material/decks/winsands/DesertRaiderEffectRule';
26
+ import { OasisShamanEffectRule } from './material/decks/winsands/OasisShamanEffectRule';
27
+ import { SandWalkersEffectRule } from './material/decks/winsands/SandWalkersEffectRule';
28
+ import { StarlightBazaarEffectRule } from './material/decks/winsands/StarlightBazaarEffectRule';
29
+ import { VandalsEffectRule } from './material/decks/winsands/VandalsEffectRule';
30
+ import { WindWrathEffectRule } from './material/decks/winsands/WindWrathEffectRule';
31
+ import { WishLampEffectRule } from './material/decks/winsands/WishLampEffectRule';
23
32
  import { LocationType } from './material/LocationType';
24
33
  import { MaterialType } from './material/MaterialType';
25
34
  import { Memory } from './Memory';
@@ -58,6 +67,18 @@ export class SkyriftRules extends SecretMaterialRules {
58
67
  [RuleId.WatchTowerEffect]: WatchTowerEffectRule,
59
68
  [RuleId.ConfluenceEffect]: DrawEffectRule,
60
69
  [RuleId.HarvestEffect]: HarvestEffectRule,
70
+ [RuleId.DesertRaiderEffect]: DesertRaiderEffectRule,
71
+ [RuleId.MetamorphEffect]: DrawEffectRule,
72
+ [RuleId.AbiSnakeCharmerEffect]: AbiSnakeCharmerEffectRule,
73
+ [RuleId.VandalsEffect]: VandalsEffectRule,
74
+ [RuleId.MushaFakirEffect]: DrawEffectRule,
75
+ [RuleId.OasisShamanEffect]: OasisShamanEffectRule,
76
+ [RuleId.SandWalkersEffect]: SandWalkersEffectRule,
77
+ [RuleId.WishLampEffect]: WishLampEffectRule,
78
+ [RuleId.StarlightBazaarEffect]: StarlightBazaarEffectRule,
79
+ [RuleId.AncientCurseEffect]: DrawEffectRule,
80
+ [RuleId.WindWrathEffect]: WindWrathEffectRule,
81
+ [RuleId.DeathTrapEffect]: DeathTrapEffectRule,
61
82
  [RuleId.SeaScorcherEffect]: SeaScorcherEffectRule,
62
83
  [RuleId.AeliaSteadyHandEffect]: DrawEffectRule,
63
84
  [RuleId.EyeOfSkyEffect]: EyeOfSkyEffectRule,
@@ -100,16 +121,22 @@ export class SkyriftRules extends SecretMaterialRules {
100
121
  if (origin.type === LocationType.PlayArea && move.location.type !== LocationType.PlayArea) {
101
122
  const cardRule = new PlayerHelper(this.game).getCardRule(move.itemIndex);
102
123
  moves.push(...cardRule.onLeave());
124
+ this.memorize(Memory.OngoingEffects, (effects) => effects.filter((e) => e.cardIndex !== move.itemIndex));
103
125
  }
104
126
  }
105
127
  else if (isMoveItemTypeAtOnce(MaterialType.Card)(move)) {
128
+ const leavingIndexes = [];
106
129
  for (const itemIndex of move.indexes) {
107
130
  const origin = this.material(MaterialType.Card).getItem(itemIndex).location;
108
131
  if (origin.type === LocationType.PlayArea && move.location.type !== LocationType.PlayArea) {
109
132
  const cardRule = new PlayerHelper(this.game).getCardRule(itemIndex);
110
133
  moves.push(...cardRule.onLeave());
134
+ leavingIndexes.push(itemIndex);
111
135
  }
112
136
  }
137
+ if (leavingIndexes.length > 0) {
138
+ this.memorize(Memory.OngoingEffects, (effects) => effects.filter((e) => !leavingIndexes.includes(e.cardIndex)));
139
+ }
113
140
  }
114
141
  return moves;
115
142
  }
@@ -3,6 +3,7 @@ import { shuffle } from 'es-toolkit';
3
3
  import { Deck } from './Deck';
4
4
  import { HearthBlade } from './material/decks/HearthBlade';
5
5
  import { HighWave } from './material/decks/HighWave';
6
+ import { WinSands } from './material/decks/WinSands';
6
7
  import { LocationType } from './material/LocationType';
7
8
  import { MaterialType } from './material/MaterialType';
8
9
  import { Memory } from './Memory';
@@ -10,6 +11,7 @@ import { RuleId } from './rules/RuleId';
10
11
  import { SkyriftRules } from './SkyriftRules';
11
12
  const deckConfigurations = {
12
13
  [Deck.HearthBlade]: HearthBlade,
14
+ [Deck.WinSands]: WinSands,
13
15
  [Deck.HighWave]: HighWave
14
16
  };
15
17
  export class SkyriftSetup extends MaterialGameSetup {
@@ -17,6 +19,7 @@ export class SkyriftSetup extends MaterialGameSetup {
17
19
  setupMaterial(_options) {
18
20
  this.setupDecks();
19
21
  this.memorize(Memory.PendingEffects, []);
22
+ this.memorize(Memory.OngoingEffects, []);
20
23
  this.memorize(Memory.CrystalsToWin, 6);
21
24
  }
22
25
  setupDecks() {
@@ -16,6 +16,22 @@ export declare enum Card {
16
16
  WatchTower = 114,
17
17
  Confluence = 115,
18
18
  Harvest = 116,
19
+ DesertRaider = 201,
20
+ Metamorph = 202,
21
+ ErgDeathslayer = 203,
22
+ AbiSnakeCharmer = 204,
23
+ Catadjinn = 205,
24
+ Vandals = 206,
25
+ MushaFakir = 207,
26
+ OasisShaman = 208,
27
+ MalikShadowtracker = 209,
28
+ DuneWardrums = 210,
29
+ SandWalkers = 211,
30
+ WishLamp = 212,
31
+ StarlightBazaar = 213,
32
+ AncientCurse = 214,
33
+ WindWrath = 215,
34
+ DeathTrap = 216,
19
35
  SeaScorcher = 601,
20
36
  AeliaSteadyHand = 602,
21
37
  EyeOfSky = 603,
@@ -16,6 +16,22 @@ export var Card;
16
16
  Card[Card["WatchTower"] = 114] = "WatchTower";
17
17
  Card[Card["Confluence"] = 115] = "Confluence";
18
18
  Card[Card["Harvest"] = 116] = "Harvest";
19
+ Card[Card["DesertRaider"] = 201] = "DesertRaider";
20
+ Card[Card["Metamorph"] = 202] = "Metamorph";
21
+ Card[Card["ErgDeathslayer"] = 203] = "ErgDeathslayer";
22
+ Card[Card["AbiSnakeCharmer"] = 204] = "AbiSnakeCharmer";
23
+ Card[Card["Catadjinn"] = 205] = "Catadjinn";
24
+ Card[Card["Vandals"] = 206] = "Vandals";
25
+ Card[Card["MushaFakir"] = 207] = "MushaFakir";
26
+ Card[Card["OasisShaman"] = 208] = "OasisShaman";
27
+ Card[Card["MalikShadowtracker"] = 209] = "MalikShadowtracker";
28
+ Card[Card["DuneWardrums"] = 210] = "DuneWardrums";
29
+ Card[Card["SandWalkers"] = 211] = "SandWalkers";
30
+ Card[Card["WishLamp"] = 212] = "WishLamp";
31
+ Card[Card["StarlightBazaar"] = 213] = "StarlightBazaar";
32
+ Card[Card["AncientCurse"] = 214] = "AncientCurse";
33
+ Card[Card["WindWrath"] = 215] = "WindWrath";
34
+ Card[Card["DeathTrap"] = 216] = "DeathTrap";
19
35
  Card[Card["SeaScorcher"] = 601] = "SeaScorcher";
20
36
  Card[Card["AeliaSteadyHand"] = 602] = "AeliaSteadyHand";
21
37
  Card[Card["EyeOfSky"] = 603] = "EyeOfSky";
@@ -15,6 +15,22 @@ import { OscarScullion } from './decks/highwave/OscarScullion';
15
15
  import { SurpriseLoot } from './decks/highwave/SurpriseLoot';
16
16
  import { FortunesCourse } from './decks/highwave/FortunesCourse';
17
17
  import { TropicalRuffian } from './decks/highwave/TropicalRuffian';
18
+ import { AbiSnakeCharmer } from './decks/winsands/AbiSnakeCharmer';
19
+ import { AncientCurse } from './decks/winsands/AncientCurse';
20
+ import { Catadjinn } from './decks/winsands/Catadjinn';
21
+ import { DeathTrap } from './decks/winsands/DeathTrap';
22
+ import { DesertRaider } from './decks/winsands/DesertRaider';
23
+ import { DuneWardrums } from './decks/winsands/DuneWardrums';
24
+ import { ErgDeathslayer } from './decks/winsands/ErgDeathslayer';
25
+ import { MalikShadowtracker } from './decks/winsands/MalikShadowtracker';
26
+ import { Metamorph } from './decks/winsands/Metamorph';
27
+ import { MushaFakir } from './decks/winsands/MushaFakir';
28
+ import { OasisShaman } from './decks/winsands/OasisShaman';
29
+ import { SandWalkers } from './decks/winsands/SandWalkers';
30
+ import { StarlightBazaar } from './decks/winsands/StarlightBazaar';
31
+ import { Vandals } from './decks/winsands/Vandals';
32
+ import { WindWrath } from './decks/winsands/WindWrath';
33
+ import { WishLamp } from './decks/winsands/WishLamp';
18
34
  import { Armada } from './decks/heathblade/Armada';
19
35
  import { Confluence } from './decks/heathblade/Confluence';
20
36
  import { CoverOfNight } from './decks/heathblade/CoverOfNight';
@@ -48,6 +64,22 @@ export const cardProperties = {
48
64
  [Card.WatchTower]: WatchTower,
49
65
  [Card.Confluence]: Confluence,
50
66
  [Card.Harvest]: Harvest,
67
+ [Card.DesertRaider]: DesertRaider,
68
+ [Card.Metamorph]: Metamorph,
69
+ [Card.ErgDeathslayer]: ErgDeathslayer,
70
+ [Card.AbiSnakeCharmer]: AbiSnakeCharmer,
71
+ [Card.Catadjinn]: Catadjinn,
72
+ [Card.Vandals]: Vandals,
73
+ [Card.MushaFakir]: MushaFakir,
74
+ [Card.OasisShaman]: OasisShaman,
75
+ [Card.MalikShadowtracker]: MalikShadowtracker,
76
+ [Card.DuneWardrums]: DuneWardrums,
77
+ [Card.SandWalkers]: SandWalkers,
78
+ [Card.WishLamp]: WishLamp,
79
+ [Card.StarlightBazaar]: StarlightBazaar,
80
+ [Card.AncientCurse]: AncientCurse,
81
+ [Card.WindWrath]: WindWrath,
82
+ [Card.DeathTrap]: DeathTrap,
51
83
  [Card.SeaScorcher]: SeaScorcher,
52
84
  [Card.AeliaSteadyHand]: AeliaSteadyHand,
53
85
  [Card.EyeOfSky]: EyeOfSky,
@@ -1,8 +1,8 @@
1
1
  import { MaterialGame, MaterialMove, MaterialRulesPart } from '@gamepark/rules-api';
2
2
  import { Deck } from '../Deck';
3
- import { RuleId } from '../rules/RuleId';
4
3
  import { Card, CardId } from './Card';
5
4
  import { CardTag } from './CardTag';
5
+ import { OngoingEffectType } from './OngoingEffect';
6
6
  export declare class CardRule extends MaterialRulesPart {
7
7
  index: number;
8
8
  constructor(game: MaterialGame, index: number);
@@ -16,7 +16,7 @@ export declare class CardRule extends MaterialRulesPart {
16
16
  entersEffect: boolean;
17
17
  challenge: boolean;
18
18
  onChallengeAccepted(): import("@gamepark/rules-api").CustomMove[];
19
- onChallengeDeclined(): import("@gamepark/rules-api").StartPlayerTurn<number, RuleId.EndRound>[];
19
+ onChallengeDeclined(): MaterialMove[];
20
20
  onLeave(): MaterialMove[];
21
21
  removePowerTokens(): import("@gamepark/rules-api").DeleteItem<number>[];
22
22
  removeStunTokens(): import("@gamepark/rules-api").DeleteItem<number>[];
@@ -27,6 +27,7 @@ export declare class CardRule extends MaterialRulesPart {
27
27
  getPower(): number;
28
28
  getPowerIfNotStunned(): number;
29
29
  addPendingEffect(): void;
30
+ addOngoingEffect(type: OngoingEffectType): void;
30
31
  get player(): number;
31
32
  get opponent(): number;
32
33
  startEffect(): MaterialMove[];
@@ -6,6 +6,7 @@ import { cardProperties } from './CardProperties';
6
6
  import { CardSuit } from './CardSuit';
7
7
  import { LocationType } from './LocationType';
8
8
  import { MaterialType } from './MaterialType';
9
+ import { OngoingEffectType } from './OngoingEffect';
9
10
  export class CardRule extends MaterialRulesPart {
10
11
  index;
11
12
  constructor(game, index) {
@@ -83,6 +84,9 @@ export class CardRule extends MaterialRulesPart {
83
84
  addPendingEffect() {
84
85
  this.memorize(Memory.PendingEffects, (effects) => [...effects, { cardIndex: this.index }]);
85
86
  }
87
+ addOngoingEffect(type) {
88
+ this.memorize(Memory.OngoingEffects, (effects) => [...effects, { type, cardIndex: this.index }]);
89
+ }
86
90
  get player() {
87
91
  return this.item.location.player;
88
92
  }
@@ -103,6 +107,16 @@ export class CardRule extends MaterialRulesPart {
103
107
  }
104
108
  }
105
109
  canBePlayed() {
110
+ const ongoingEffects = this.remind(Memory.OngoingEffects);
111
+ const forcedSuit = ongoingEffects.find((e) => e.type === OngoingEffectType.ForcedSuit);
112
+ if (forcedSuit) {
113
+ const sourceCard = this.material(MaterialType.Card).getItem(forcedSuit.cardIndex);
114
+ if (sourceCard.location.player !== this.player) {
115
+ const forcedSuitValue = cardProperties[sourceCard.id.front].suit;
116
+ if (this.properties.suit !== forcedSuitValue)
117
+ return false;
118
+ }
119
+ }
106
120
  const currentSuit = this.remind(Memory.Suit);
107
121
  const cardSuit = this.properties.suit;
108
122
  return !(cardSuit === CardSuit.Night && currentSuit === CardSuit.Day) && !(cardSuit === CardSuit.Day && currentSuit === CardSuit.Night);
@@ -0,0 +1,8 @@
1
+ export declare enum OngoingEffectType {
2
+ ForcedSuit = 1,
3
+ DeathTrap = 2
4
+ }
5
+ export type OngoingEffect = {
6
+ type: OngoingEffectType;
7
+ cardIndex: number;
8
+ };
@@ -0,0 +1,5 @@
1
+ export var OngoingEffectType;
2
+ (function (OngoingEffectType) {
3
+ OngoingEffectType[OngoingEffectType["ForcedSuit"] = 1] = "ForcedSuit";
4
+ OngoingEffectType[OngoingEffectType["DeathTrap"] = 2] = "DeathTrap";
5
+ })(OngoingEffectType || (OngoingEffectType = {}));
@@ -0,0 +1,18 @@
1
+ export declare const WinSands: {
2
+ 201: number;
3
+ 202: number;
4
+ 203: number;
5
+ 204: number;
6
+ 205: number;
7
+ 206: number;
8
+ 207: number;
9
+ 208: number;
10
+ 209: number;
11
+ 210: number;
12
+ 211: number;
13
+ 212: number;
14
+ 213: number;
15
+ 214: number;
16
+ 215: number;
17
+ 216: number;
18
+ };
@@ -0,0 +1,19 @@
1
+ import { Card } from '../Card';
2
+ export const WinSands = {
3
+ [Card.DesertRaider]: 2,
4
+ [Card.Metamorph]: 2,
5
+ [Card.ErgDeathslayer]: 1,
6
+ [Card.AbiSnakeCharmer]: 1,
7
+ [Card.Catadjinn]: 2,
8
+ [Card.Vandals]: 2,
9
+ [Card.MushaFakir]: 1,
10
+ [Card.OasisShaman]: 2,
11
+ [Card.MalikShadowtracker]: 1,
12
+ [Card.DuneWardrums]: 2,
13
+ [Card.SandWalkers]: 1,
14
+ [Card.WishLamp]: 2,
15
+ [Card.StarlightBazaar]: 1,
16
+ [Card.AncientCurse]: 1,
17
+ [Card.WindWrath]: 1,
18
+ [Card.DeathTrap]: 2
19
+ };
@@ -1,17 +1,15 @@
1
1
  import { EffectRule } from '../../../rules/EffectRule';
2
- import { Memory } from '../../../Memory';
3
2
  import { LocationType } from '../../LocationType';
4
3
  import { MaterialType } from '../../MaterialType';
5
4
  export class OzmaTheMageEffectRule extends EffectRule {
6
5
  onRuleStart() {
7
- const ozmaIndex = this.remind(Memory.PendingEffects)[0].cardIndex;
8
6
  return [
9
7
  this.material(MaterialType.PowerToken)
10
8
  .location(LocationType.PowerTokenStock)
11
9
  .createItem({
12
10
  location: {
13
11
  type: LocationType.CardPowerTokens,
14
- parent: ozmaIndex
12
+ parent: this.effectCardIndex
15
13
  }
16
14
  }),
17
15
  ...this.endEffect()
@@ -1,4 +1,3 @@
1
- import { Memory } from '../../../Memory';
2
1
  import { cardProperties } from '../../CardProperties';
3
2
  import { CardType } from '../../CardType';
4
3
  import { LocationType } from '../../LocationType';
@@ -7,13 +6,12 @@ import { EffectRule } from '../../../rules/EffectRule';
7
6
  export class RobbinsMasterOfArmsEffectRule extends EffectRule {
8
7
  onRuleStart() {
9
8
  const moves = [];
10
- const robbinsIndex = this.remind(Memory.PendingEffects)[0].cardIndex;
11
9
  const otherCreatures = this.material(MaterialType.Card)
12
10
  .location(LocationType.PlayArea)
13
11
  .player(this.player)
14
12
  .id((id) => cardProperties[id.front].type === CardType.Creature)
15
13
  .getIndexes()
16
- .filter(index => index !== robbinsIndex);
14
+ .filter(index => index !== this.effectCardIndex);
17
15
  for (const creatureIndex of otherCreatures) {
18
16
  moves.push(this.material(MaterialType.PowerToken)
19
17
  .location(LocationType.PowerTokenStock)
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class AbiSnakeCharmerRule extends CardRule {
5
+ entersEffect: boolean;
6
+ }
7
+ export declare const AbiSnakeCharmer: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof AbiSnakeCharmerRule;
12
+ };
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ class AbiSnakeCharmerRule extends CardRule {
5
+ entersEffect = true;
6
+ }
7
+ export const AbiSnakeCharmer = {
8
+ power: 1,
9
+ type: CardType.Creature,
10
+ suit: CardSuit.Day,
11
+ rule: AbiSnakeCharmerRule
12
+ };
@@ -0,0 +1,7 @@
1
+ import { ItemMove, MaterialMove } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ export declare class AbiSnakeCharmerEffectRule extends EffectRule {
4
+ onRuleStart(): MaterialMove[];
5
+ getPlayerMoves(): MaterialMove[];
6
+ afterItemMove(move: ItemMove): MaterialMove[];
7
+ }
@@ -0,0 +1,33 @@
1
+ import { isMoveItemType } from '@gamepark/rules-api';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ import { PlayerHelper } from '../../../rules/PlayerHelper';
4
+ import { cardProperties } from '../../CardProperties';
5
+ import { CardType } from '../../CardType';
6
+ import { LocationType } from '../../LocationType';
7
+ import { MaterialType } from '../../MaterialType';
8
+ export class AbiSnakeCharmerEffectRule extends EffectRule {
9
+ onRuleStart() {
10
+ const playerHelper = new PlayerHelper(this.game, this.player);
11
+ const foeHelper = new PlayerHelper(this.game, this.nextPlayer);
12
+ if (foeHelper.getPower() < playerHelper.getPower() + 7) {
13
+ return this.endEffect();
14
+ }
15
+ return [];
16
+ }
17
+ getPlayerMoves() {
18
+ return this.material(MaterialType.Card)
19
+ .location(LocationType.PlayArea)
20
+ .id((id) => cardProperties[id.front].type === CardType.Creature)
21
+ .moveItems((item) => ({
22
+ type: LocationType.PlayArea,
23
+ player: item.location.player === this.player ? this.nextPlayer : this.player,
24
+ id: cardProperties[item.id.front].type
25
+ }));
26
+ }
27
+ afterItemMove(move) {
28
+ if (isMoveItemType(MaterialType.Card)(move) && move.location.type === LocationType.PlayArea) {
29
+ return this.endEffect();
30
+ }
31
+ return [];
32
+ }
33
+ }
@@ -0,0 +1,16 @@
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 AncientCurseRule extends CardRule {
6
+ challenge: boolean;
7
+ onChallengeAccepted(): import("@gamepark/rules-api").CustomMove[];
8
+ onChallengeDeclined(): MaterialMove[];
9
+ }
10
+ export declare const AncientCurse: {
11
+ power: number;
12
+ type: CardType;
13
+ suit: CardSuit;
14
+ rule: typeof AncientCurseRule;
15
+ };
16
+ export {};
@@ -0,0 +1,23 @@
1
+ import { CustomMoveType } from '../../../CustomMoveType';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardSuit } from '../../CardSuit';
4
+ import { CardType } from '../../CardType';
5
+ class AncientCurseRule extends CardRule {
6
+ challenge = true;
7
+ onChallengeAccepted() {
8
+ this.addPendingEffect();
9
+ return super.onChallengeAccepted();
10
+ }
11
+ onChallengeDeclined() {
12
+ return [
13
+ this.customMove(CustomMoveType.Draw, { player: this.opponent, quantity: 1 }),
14
+ ...super.onChallengeDeclined()
15
+ ];
16
+ }
17
+ }
18
+ export const AncientCurse = {
19
+ power: 3,
20
+ type: CardType.Action,
21
+ suit: CardSuit.Night,
22
+ rule: AncientCurseRule
23
+ };
@@ -0,0 +1,14 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class CatadjinnRule extends CardRule {
5
+ challenge: boolean;
6
+ getPowerIfNotStunned(): number;
7
+ }
8
+ export declare const Catadjinn: {
9
+ power: number;
10
+ type: CardType;
11
+ suit: CardSuit;
12
+ rule: typeof CatadjinnRule;
13
+ };
14
+ export {};
@@ -0,0 +1,24 @@
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 CatadjinnRule extends CardRule {
8
+ challenge = true;
9
+ getPowerIfNotStunned() {
10
+ const nonNightCards = this.material(MaterialType.Card)
11
+ .location(LocationType.PlayArea)
12
+ .id((id) => {
13
+ const suit = cardProperties[id.front].suit;
14
+ return suit === CardSuit.Twilight || suit === CardSuit.Day;
15
+ });
16
+ return Math.max(0, super.getPowerIfNotStunned() - nonNightCards.length);
17
+ }
18
+ }
19
+ export const Catadjinn = {
20
+ power: 6,
21
+ type: CardType.Creature,
22
+ suit: CardSuit.Night,
23
+ rule: CatadjinnRule
24
+ };
@@ -0,0 +1,4 @@
1
+ import { CardRule } from '../../CardRule';
2
+ export declare class CreatureBonusCardRule extends CardRule {
3
+ getPowerIfNotStunned(): number;
4
+ }
@@ -0,0 +1,14 @@
1
+ import { cardProperties } from '../../CardProperties';
2
+ import { CardRule } from '../../CardRule';
3
+ import { CardType } from '../../CardType';
4
+ import { LocationType } from '../../LocationType';
5
+ import { MaterialType } from '../../MaterialType';
6
+ export class CreatureBonusCardRule extends CardRule {
7
+ getPowerIfNotStunned() {
8
+ const myCreatures = this.material(MaterialType.Card)
9
+ .location(LocationType.PlayArea)
10
+ .player(this.player)
11
+ .id((id) => cardProperties[id.front].type === CardType.Creature);
12
+ return super.getPowerIfNotStunned() + myCreatures.length - 1;
13
+ }
14
+ }
@@ -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 DeathTrapRule extends CardRule {
6
+ onEnters(): MaterialMove[];
7
+ }
8
+ export declare const DeathTrap: {
9
+ power: number;
10
+ type: CardType;
11
+ suit: CardSuit;
12
+ rule: typeof DeathTrapRule;
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 DeathTrapRule extends CardRule {
6
+ onEnters() {
7
+ this.addOngoingEffect(OngoingEffectType.DeathTrap);
8
+ return [];
9
+ }
10
+ }
11
+ export const DeathTrap = {
12
+ power: 2,
13
+ type: CardType.Action,
14
+ suit: CardSuit.Twilight,
15
+ rule: DeathTrapRule
16
+ };
@@ -0,0 +1,4 @@
1
+ import { EffectRule } from '../../../rules/EffectRule';
2
+ export declare class DeathTrapEffectRule extends EffectRule {
3
+ onRuleStart(): import("@gamepark/rules-api").MaterialMove[];
4
+ }
@@ -0,0 +1,18 @@
1
+ import { Memory } from '../../../Memory';
2
+ import { EffectRule } from '../../../rules/EffectRule';
3
+ import { LocationType } from '../../LocationType';
4
+ import { MaterialType } from '../../MaterialType';
5
+ export class DeathTrapEffectRule extends EffectRule {
6
+ onRuleStart() {
7
+ const currentPlayer = this.remind(Memory.CurrentPlayer);
8
+ const cardsPlayed = this.remind(Memory.CardsPlayed, currentPlayer);
9
+ const targetIndex = cardsPlayed[cardsPlayed.length - 1];
10
+ return [
11
+ this.material(MaterialType.Card).index(targetIndex).moveItem({
12
+ type: LocationType.PlayerDiscard,
13
+ player: currentPlayer
14
+ }),
15
+ ...this.endEffect()
16
+ ];
17
+ }
18
+ }
@@ -0,0 +1,13 @@
1
+ import { CardRule } from '../../CardRule';
2
+ import { CardSuit } from '../../CardSuit';
3
+ import { CardType } from '../../CardType';
4
+ declare class DesertRaiderRule extends CardRule {
5
+ entersEffect: boolean;
6
+ }
7
+ export declare const DesertRaider: {
8
+ power: number;
9
+ type: CardType;
10
+ suit: CardSuit;
11
+ rule: typeof DesertRaiderRule;
12
+ };
13
+ export {};