diff --git a/cards/1-sheep.ts b/cards/1-sheep.ts index eb118111..5d5cf63f 100644 --- a/cards/1-sheep.ts +++ b/cards/1-sheep.ts @@ -7,11 +7,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'Beast', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 1, + + attack: 1, + health: 1, + tribe: 'Beast', }; diff --git a/cards/2-the-coin.ts b/cards/2-the-coin.ts index eca0aea3..c6ca301e 100644 --- a/cards/2-the-coin.ts +++ b/cards/2-the-coin.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Gain 1 Mana Crystal this turn only.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 2, + spellSchool: 'None', + cast(plr, self) { // Gain 1 Mana Crystal this turn only. diff --git a/cards/3-plant.ts b/cards/3-plant.ts index 00074a4c..36fcda34 100644 --- a/cards/3-plant.ts +++ b/cards/3-plant.ts @@ -9,11 +9,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 3, + + attack: 1, + health: 1, + tribe: 'None', }; diff --git a/cards/85-jade-golem.ts b/cards/85-jade-golem.ts index 42f620da..b59df4e2 100644 --- a/cards/85-jade-golem.ts +++ b/cards/85-jade-golem.ts @@ -8,11 +8,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 85, + + attack: 1, + health: 1, + tribe: 'None', }; diff --git a/cards/Classes/Druid/Collectible/Heroes/5-Cost/89-wildheart-guff.ts b/cards/Classes/Druid/Collectible/Heroes/5-Cost/89-wildheart-guff.ts index c0b5afeb..4c767e6c 100644 --- a/cards/Classes/Druid/Collectible/Heroes/5-Cost/89-wildheart-guff.ts +++ b/cards/Classes/Druid/Collectible/Heroes/5-Cost/89-wildheart-guff.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Battlecry: Set your maximum Mana to 20. Gain an empty Mana Crystal. Draw a card.', cost: 5, type: 'Hero', - heropowerId: 113, classes: ['Druid'], rarity: 'Legendary', + collectible: true, id: 89, + heropowerId: 113, + battlecry(plr, self) { // Set your maximum Mana to 20. Gain an empty Mana Crystal. Draw a card. plr.maxMana = 20; diff --git a/cards/Classes/Druid/Collectible/Spells/0-Cost/93-aquatic-form.ts b/cards/Classes/Druid/Collectible/Spells/0-Cost/93-aquatic-form.ts index 8b88c272..436af766 100644 --- a/cards/Classes/Druid/Collectible/Spells/0-Cost/93-aquatic-form.ts +++ b/cards/Classes/Druid/Collectible/Spells/0-Cost/93-aquatic-form.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Dredge. If you have the Mana to play the card this turn, draw it.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Druid'], rarity: 'Rare', + collectible: true, id: 93, + spellSchool: 'None', + cast(plr, self) { // Dredge. If you have the Mana to play the card this turn, draw it. const card = game.interact.card.dredge(); diff --git a/cards/Classes/Druid/Collectible/Spells/1-Cost/101-floops-glorious-gloop.ts b/cards/Classes/Druid/Collectible/Spells/1-Cost/101-floops-glorious-gloop.ts index 5ad11b02..d745c849 100644 --- a/cards/Classes/Druid/Collectible/Spells/1-Cost/101-floops-glorious-gloop.ts +++ b/cards/Classes/Druid/Collectible/Spells/1-Cost/101-floops-glorious-gloop.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Whenever a minion dies this turn, gain 1 Mana Crystal this turn only.', cost: 1, type: 'Spell', - spellSchool: 'Nature', classes: ['Druid'], rarity: 'Legendary', + collectible: true, id: 101, + spellSchool: 'Nature', + cast(plr, self) { // Whenever a minion dies this turn, gain 1 Mana Crystal this turn only. const destroy = game.functions.event.addListener('KillMinion', () => { diff --git a/cards/Classes/Druid/Collectible/Spells/1-Cost/84-jade-idol.ts b/cards/Classes/Druid/Collectible/Spells/1-Cost/84-jade-idol.ts index 49674641..7aa8acc0 100644 --- a/cards/Classes/Druid/Collectible/Spells/1-Cost/84-jade-idol.ts +++ b/cards/Classes/Druid/Collectible/Spells/1-Cost/84-jade-idol.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Choose One - Summon a Jade Golem; or Shuffle 3 copies of this card into your deck.', cost: 1, type: 'Spell', - spellSchool: 'None', classes: ['Druid'], rarity: 'Rare', + collectible: true, id: 84, + spellSchool: 'None', + cast(plr, self) { // Choose One - Summon a Jade Golem; or Shuffle 3 copies of this card into your deck. game.interact.chooseOne(1, ['Summon a Jade Golem', () => { diff --git a/cards/Classes/Druid/Collectible/Spells/2-Cost/90-moonlit-guidance.ts b/cards/Classes/Druid/Collectible/Spells/2-Cost/90-moonlit-guidance.ts index 97c8c7b2..3ed31b4b 100644 --- a/cards/Classes/Druid/Collectible/Spells/2-Cost/90-moonlit-guidance.ts +++ b/cards/Classes/Druid/Collectible/Spells/2-Cost/90-moonlit-guidance.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Discover a copy of a card in your deck. If you play it this turn, draw the original.', cost: 2, type: 'Spell', - spellSchool: 'Arcane', classes: ['Druid'], rarity: 'Rare', + collectible: true, id: 90, + spellSchool: 'Arcane', + cast(plr, self) { // Discover a copy of a card in your deck. If you play it this turn, draw the original. const original = game.interact.card.discover(self.text, plr.deck, false); diff --git a/cards/Classes/Druid/Collectible/Spells/2-Cost/91-dew-process.ts b/cards/Classes/Druid/Collectible/Spells/2-Cost/91-dew-process.ts index 9519feec..9b0f381c 100644 --- a/cards/Classes/Druid/Collectible/Spells/2-Cost/91-dew-process.ts +++ b/cards/Classes/Druid/Collectible/Spells/2-Cost/91-dew-process.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'For the rest of the game, players draw an extra card at the start of their turn.', cost: 2, type: 'Spell', - spellSchool: 'Nature', classes: ['Druid'], rarity: 'Rare', + collectible: true, id: 91, + spellSchool: 'Nature', + cast(plr, self) { // For the rest of the game, players draw an extra card at the start of their turn. game.functions.event.addListener('StartTurn', (_unknownValue, eventPlayer) => { diff --git a/cards/Classes/Druid/Collectible/Spells/2-Cost/92-invigorate.ts b/cards/Classes/Druid/Collectible/Spells/2-Cost/92-invigorate.ts index f838ea6f..45c331b2 100644 --- a/cards/Classes/Druid/Collectible/Spells/2-Cost/92-invigorate.ts +++ b/cards/Classes/Druid/Collectible/Spells/2-Cost/92-invigorate.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Choose One - Gain an empty Mana Crystal; or Draw a card.', cost: 2, type: 'Spell', - spellSchool: 'Nature', classes: ['Druid'], rarity: 'Rare', + collectible: true, id: 92, + spellSchool: 'Nature', + cast(plr, self) { // Choose One - Gain an empty Mana Crystal; or Draw a card. game.interact.chooseOne(1, ['Gain an empty Mana Crystal', () => { diff --git a/cards/Classes/Druid/Collectible/Spells/3-Cost/94-frost-lotus-seedling.ts b/cards/Classes/Druid/Collectible/Spells/3-Cost/94-frost-lotus-seedling.ts index 4ee5d03a..2c2d2edc 100644 --- a/cards/Classes/Druid/Collectible/Spells/3-Cost/94-frost-lotus-seedling.ts +++ b/cards/Classes/Druid/Collectible/Spells/3-Cost/94-frost-lotus-seedling.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: '{placeholder}', cost: 3, type: 'Spell', - spellSchool: 'Nature', classes: ['Druid'], rarity: 'Rare', + collectible: true, id: 94, + spellSchool: 'Nature', + create(plr, self) { // Initialize storage self.storage.blossom = 0; diff --git a/cards/Classes/Druid/Collectible/Spells/4-Cost/82-poison-seeds.ts b/cards/Classes/Druid/Collectible/Spells/4-Cost/82-poison-seeds.ts index 5fe4361f..f367c9df 100644 --- a/cards/Classes/Druid/Collectible/Spells/4-Cost/82-poison-seeds.ts +++ b/cards/Classes/Druid/Collectible/Spells/4-Cost/82-poison-seeds.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Destroy all minions and summon 2/2 Treants to replace them.', cost: 4, type: 'Spell', - spellSchool: 'Nature', classes: ['Druid'], rarity: 'Common', + collectible: true, id: 82, + spellSchool: 'Nature', + cast(plr, self) { // Destroy all minions and summon 2/2 Treants to replace them. for (const [id, side] of game.board.entries()) { diff --git a/cards/Classes/Druid/Collectible/Spells/4-Cost/86-branching-paths.ts b/cards/Classes/Druid/Collectible/Spells/4-Cost/86-branching-paths.ts index f208fc20..92a8005d 100644 --- a/cards/Classes/Druid/Collectible/Spells/4-Cost/86-branching-paths.ts +++ b/cards/Classes/Druid/Collectible/Spells/4-Cost/86-branching-paths.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Choose Twice - Draw a card; Give your minions +1 Attack; Gain 6 Armor.', cost: 4, type: 'Spell', - spellSchool: 'None', classes: ['Druid'], rarity: 'Epic', + collectible: true, id: 86, + spellSchool: 'None', + cast(plr, self) { // Choose Twice - Draw a card; Give your minions +1 Attack; Gain 6 Armor. game.interact.chooseOne(2, ['Draw a card', () => { diff --git a/cards/Classes/Druid/Collectible/Spells/4-Cost/87-oaken-summons.ts b/cards/Classes/Druid/Collectible/Spells/4-Cost/87-oaken-summons.ts index 29075544..2dbada7f 100644 --- a/cards/Classes/Druid/Collectible/Spells/4-Cost/87-oaken-summons.ts +++ b/cards/Classes/Druid/Collectible/Spells/4-Cost/87-oaken-summons.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Gain 6 Armor. Recruit a minion that costs (4) or less.', cost: 4, type: 'Spell', - spellSchool: 'Nature', classes: ['Druid'], rarity: 'Common', + collectible: true, id: 87, + spellSchool: 'Nature', + cast(plr, self) { // Gain 6 Armor. Recruit a minion that costs (4) or less. plr.addArmor(6); diff --git a/cards/Classes/Druid/Collectible/Spells/5-Cost/97-flipper-friends.ts b/cards/Classes/Druid/Collectible/Spells/5-Cost/97-flipper-friends.ts index 883fc925..9ada9c24 100644 --- a/cards/Classes/Druid/Collectible/Spells/5-Cost/97-flipper-friends.ts +++ b/cards/Classes/Druid/Collectible/Spells/5-Cost/97-flipper-friends.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Choose One - Summon a 6/6 Orca with Taunt; or six 1/1 Otters with Rush.', cost: 5, type: 'Spell', - spellSchool: 'Nature', classes: ['Druid'], rarity: 'Common', + collectible: true, id: 97, + spellSchool: 'Nature', + cast(plr, self) { // Choose One - Summon a 6/6 Orca with Taunt; or six 1/1 Otters with Rush. game.interact.chooseOne(1, ['Summon a 6/6 Orca with Taunt', () => { diff --git a/cards/Classes/Druid/Collectible/Spells/7-Cost/100-scale-of-onyxia.ts b/cards/Classes/Druid/Collectible/Spells/7-Cost/100-scale-of-onyxia.ts index 37d43cba..e9f345c8 100644 --- a/cards/Classes/Druid/Collectible/Spells/7-Cost/100-scale-of-onyxia.ts +++ b/cards/Classes/Druid/Collectible/Spells/7-Cost/100-scale-of-onyxia.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Fill your board with 2/1 Whelps with Rush.', cost: 7, type: 'Spell', - spellSchool: 'None', classes: ['Druid'], rarity: 'Common', + collectible: true, id: 100, + spellSchool: 'None', + cast(plr, self) { // Fill your board with 2/1 Whelps with Rush. const remainingBoardSpace = game.functions.util.getRemainingBoardSpace(plr); diff --git a/cards/Classes/Druid/Uncollectible/Minions/1-Cost/83-treant.ts b/cards/Classes/Druid/Uncollectible/Minions/1-Cost/83-treant.ts index 3b5a17a4..d7ccc3f7 100644 --- a/cards/Classes/Druid/Uncollectible/Minions/1-Cost/83-treant.ts +++ b/cards/Classes/Druid/Uncollectible/Minions/1-Cost/83-treant.ts @@ -7,11 +7,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 2, - health: 2, - tribe: 'None', classes: ['Druid'], rarity: 'Free', collectible: false, id: 83, + + attack: 2, + health: 2, + tribe: 'None', }; diff --git a/cards/Classes/Druid/Uncollectible/Minions/1-Cost/95-otter.ts b/cards/Classes/Druid/Uncollectible/Minions/1-Cost/95-otter.ts index 8209cc05..cb10b811 100644 --- a/cards/Classes/Druid/Uncollectible/Minions/1-Cost/95-otter.ts +++ b/cards/Classes/Druid/Uncollectible/Minions/1-Cost/95-otter.ts @@ -9,14 +9,15 @@ export const blueprint: Blueprint = { text: 'Rush', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'Beast', classes: ['Druid'], rarity: 'Free', collectible: false, id: 95, + attack: 1, + health: 1, + tribe: 'Beast', + create(plr, self) { // Add additional fields here self.addKeyword('Rush'); diff --git a/cards/Classes/Druid/Uncollectible/Minions/6-Cost/96-orca.ts b/cards/Classes/Druid/Uncollectible/Minions/6-Cost/96-orca.ts index 32735d0a..5aae5bc5 100644 --- a/cards/Classes/Druid/Uncollectible/Minions/6-Cost/96-orca.ts +++ b/cards/Classes/Druid/Uncollectible/Minions/6-Cost/96-orca.ts @@ -9,14 +9,15 @@ export const blueprint: Blueprint = { text: 'Taunt', cost: 6, type: 'Minion', - attack: 6, - health: 6, - tribe: 'Beast', classes: ['Druid'], rarity: 'Free', collectible: false, id: 96, + attack: 6, + health: 6, + tribe: 'Beast', + create(plr, self) { // Add additional fields here self.addKeyword('Taunt'); diff --git a/cards/Classes/Druid/Uncollectible/Spells/2-Cost/113-nurture.ts b/cards/Classes/Druid/Uncollectible/Spells/2-Cost/113-nurture.ts index 1d6affdd..807b05a6 100644 --- a/cards/Classes/Druid/Uncollectible/Spells/2-Cost/113-nurture.ts +++ b/cards/Classes/Druid/Uncollectible/Spells/2-Cost/113-nurture.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Choose One - Draw a card; or Gain an empty Mana Crystal.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Druid'], rarity: 'Free', collectible: false, id: 113, + spellSchool: 'None', + cast(plr, self) { // Choose One - Draw a card; or Gain an empty Mana Crystal. game.interact.chooseOne(1, ['Draw a card', () => { diff --git a/cards/Classes/Mage/Collectible/Spells/10-Cost/105-pyroblast.ts b/cards/Classes/Mage/Collectible/Spells/10-Cost/105-pyroblast.ts index 72905473..98762bfc 100644 --- a/cards/Classes/Mage/Collectible/Spells/10-Cost/105-pyroblast.ts +++ b/cards/Classes/Mage/Collectible/Spells/10-Cost/105-pyroblast.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Deal $10 damage.', cost: 10, type: 'Spell', - spellSchool: 'Fire', classes: ['Mage'], rarity: 'Epic', + collectible: true, id: 105, + spellSchool: 'Fire', + cast(plr, self) { // Deal $10 damage. const target = game.interact.selectTarget(self.text, self, 'any', 'any'); diff --git a/cards/Classes/Neutral/Collectible/Locations/7-Cost/102-prison-of-yogg-saron.ts b/cards/Classes/Neutral/Collectible/Locations/7-Cost/102-prison-of-yogg-saron.ts index 30f24c00..ba5f601c 100644 --- a/cards/Classes/Neutral/Collectible/Locations/7-Cost/102-prison-of-yogg-saron.ts +++ b/cards/Classes/Neutral/Collectible/Locations/7-Cost/102-prison-of-yogg-saron.ts @@ -8,12 +8,14 @@ export const blueprint: Blueprint = { text: 'Choose a character. Cast 4 random spells (targeting it if possible).', cost: 7, type: 'Location', - durability: 3, - cooldown: 2, classes: ['Neutral'], rarity: 'Legendary', + collectible: true, id: 102, + durability: 3, + cooldown: 2, + use(plr, self) { // Choose a character. Cast 4 random spells (targeting it if possible). const target = game.interact.selectTarget(self.text, self, 'any', 'any'); diff --git a/cards/Classes/Neutral/Collectible/Minions/1-Cost/110-chaotic-tendril.ts b/cards/Classes/Neutral/Collectible/Minions/1-Cost/110-chaotic-tendril.ts index fe878d23..8c91890a 100644 --- a/cards/Classes/Neutral/Collectible/Minions/1-Cost/110-chaotic-tendril.ts +++ b/cards/Classes/Neutral/Collectible/Minions/1-Cost/110-chaotic-tendril.ts @@ -8,13 +8,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Cast a random 1-Cost spell. Improve your future Chaotic Tendrils.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Common', + collectible: true, id: 110, + attack: 1, + health: 1, + tribe: 'None', + battlecry(plr, self) { // Cast a random 1-Cost spell. Improve your future Chaotic Tendrils. const pool = game.functions.card.getAll().filter(card => card.type === 'Spell' && card.cost === 1); diff --git a/cards/Classes/Neutral/Collectible/Minions/10-Cost/103-yogg-saron-hopes-end.ts b/cards/Classes/Neutral/Collectible/Minions/10-Cost/103-yogg-saron-hopes-end.ts index 32c538c2..72535f7b 100644 --- a/cards/Classes/Neutral/Collectible/Minions/10-Cost/103-yogg-saron-hopes-end.ts +++ b/cards/Classes/Neutral/Collectible/Minions/10-Cost/103-yogg-saron-hopes-end.ts @@ -9,13 +9,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Cast a random spell for each spell you\'ve cast this game (targets chosen randomly).', cost: 10, type: 'Minion', - attack: 7, - health: 5, - tribe: 'None', classes: ['Neutral'], rarity: 'Legendary', + collectible: true, id: 103, + attack: 7, + health: 5, + tribe: 'None', + battlecry(plr, self) { // Cast a random spell for each spell you've cast this game (targets chosen randomly). const amount = game.events.events.PlayCard?.[plr.id].filter(object => object[0] instanceof Card && object[0].type === 'Spell').length; diff --git a/cards/Classes/Neutral/Collectible/Minions/10-Cost/104-yogg-saron-master-of-fate.ts b/cards/Classes/Neutral/Collectible/Minions/10-Cost/104-yogg-saron-master-of-fate.ts index 5071d905..12b824e6 100644 --- a/cards/Classes/Neutral/Collectible/Minions/10-Cost/104-yogg-saron-master-of-fate.ts +++ b/cards/Classes/Neutral/Collectible/Minions/10-Cost/104-yogg-saron-master-of-fate.ts @@ -9,13 +9,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: If you\'ve cast 10 spells this game, spin the Wheel of Yogg-Saron.{left}', cost: 10, type: 'Minion', - attack: 7, - health: 5, - tribe: 'None', classes: ['Neutral'], rarity: 'Legendary', + collectible: true, id: 104, + attack: 7, + health: 5, + tribe: 'None', + // eslint-disable-next-line complexity battlecry(plr, self) { // If you've cast 10 spells this game, spin the Wheel of Yogg-Saron. ({amount} left!) diff --git a/cards/Classes/Neutral/Collectible/Minions/4-Cost/88-injured-marauder.ts b/cards/Classes/Neutral/Collectible/Minions/4-Cost/88-injured-marauder.ts index bdf968d9..a225343a 100644 --- a/cards/Classes/Neutral/Collectible/Minions/4-Cost/88-injured-marauder.ts +++ b/cards/Classes/Neutral/Collectible/Minions/4-Cost/88-injured-marauder.ts @@ -8,13 +8,15 @@ export const blueprint: Blueprint = { text: 'Taunt. Battlecry: Deal 6 damage to this minion.', cost: 4, type: 'Minion', - attack: 5, - health: 10, - tribe: 'None', classes: ['Neutral'], rarity: 'Common', + collectible: true, id: 88, + attack: 5, + health: 10, + tribe: 'None', + create(plr, self) { // Add additional fields here self.addKeyword('Taunt'); diff --git a/cards/Classes/Neutral/Collectible/Minions/4-Cost/98-archmage-vargoth.ts b/cards/Classes/Neutral/Collectible/Minions/4-Cost/98-archmage-vargoth.ts index d5c45baf..f837ca82 100644 --- a/cards/Classes/Neutral/Collectible/Minions/4-Cost/98-archmage-vargoth.ts +++ b/cards/Classes/Neutral/Collectible/Minions/4-Cost/98-archmage-vargoth.ts @@ -9,13 +9,15 @@ export const blueprint: Blueprint = { text: 'At the end of your turn, cast a spell you\'ve cast this turn (targets are random).', cost: 4, type: 'Minion', - attack: 2, - health: 6, - tribe: 'None', classes: ['Neutral'], rarity: 'Legendary', + collectible: true, id: 98, + attack: 2, + health: 6, + tribe: 'None', + passive(plr, self, key, _unknownValue) { // At the end of your turn, cast a spell you've cast this turn (targets are random). diff --git a/cards/Classes/Neutral/Collectible/Minions/9-Cost/106-yogg-saron-unleashed.ts b/cards/Classes/Neutral/Collectible/Minions/9-Cost/106-yogg-saron-unleashed.ts index 8188e9ea..00333b41 100644 --- a/cards/Classes/Neutral/Collectible/Minions/9-Cost/106-yogg-saron-unleashed.ts +++ b/cards/Classes/Neutral/Collectible/Minions/9-Cost/106-yogg-saron-unleashed.ts @@ -8,13 +8,15 @@ export const blueprint: Blueprint = { text: 'Titan After this uses an ability, cast two random spells.', cost: 9, type: 'Minion', - attack: 7, - health: 5, - tribe: 'None', classes: ['Neutral'], rarity: 'Legendary', + collectible: true, id: 106, + attack: 7, + health: 5, + tribe: 'None', + create(plr, self) { // Add additional fields here self.addKeyword('Titan', [107, 108, 109]); diff --git a/cards/Classes/Neutral/Uncollectible/Minions/1-Cost/99-onyxian-whelp.ts b/cards/Classes/Neutral/Uncollectible/Minions/1-Cost/99-onyxian-whelp.ts index ee10f504..79da7d23 100644 --- a/cards/Classes/Neutral/Uncollectible/Minions/1-Cost/99-onyxian-whelp.ts +++ b/cards/Classes/Neutral/Uncollectible/Minions/1-Cost/99-onyxian-whelp.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Rush', cost: 1, type: 'Minion', - attack: 2, - health: 1, - tribe: 'Dragon', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 99, + attack: 2, + health: 1, + tribe: 'Dragon', + create(plr, self) { // Add additional fields here self.addKeyword('Rush'); diff --git a/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/107-induce-insanity.ts b/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/107-induce-insanity.ts index 7e06f998..06d59d98 100644 --- a/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/107-induce-insanity.ts +++ b/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/107-induce-insanity.ts @@ -10,12 +10,13 @@ export const blueprint: Blueprint = { text: 'Force each enemy minion to attack a random enemy minion.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 107, + spellSchool: 'None', + cast(plr, self) { // Force each enemy minion to attack a random enemy minion. for (const enemyMinion of game.board[plr.getOpponent().id]) { diff --git a/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/108-reign-of-chaos.ts b/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/108-reign-of-chaos.ts index e60fb24c..7cb0e83c 100644 --- a/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/108-reign-of-chaos.ts +++ b/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/108-reign-of-chaos.ts @@ -10,12 +10,13 @@ export const blueprint: Blueprint = { text: 'Take control of an enemy minion.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 108, + spellSchool: 'None', + cast(plr, self) { // Take control of an enemy minion. const card = game.interact.selectCardTarget(self.text, self, 'enemy'); diff --git a/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/109-tentacle-swarm.ts b/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/109-tentacle-swarm.ts index e17c5c20..1a74859c 100644 --- a/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/109-tentacle-swarm.ts +++ b/cards/Classes/Neutral/Uncollectible/Spells/0-Cost/109-tentacle-swarm.ts @@ -10,12 +10,13 @@ export const blueprint: Blueprint = { text: 'Fill your hand with 1/1 Chaotic Tendrils.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 109, + spellSchool: 'None', + cast(plr, self) { // Fill your hand with 1/1 Chaotic Tendrils. const remaining = game.functions.util.getRemainingHandSize(plr); diff --git a/cards/Debug/65-10-mana.ts b/cards/Debug/65-10-mana.ts index ba7119ca..563c9b85 100644 --- a/cards/Debug/65-10-mana.ts +++ b/cards/Debug/65-10-mana.ts @@ -9,12 +9,13 @@ export const blueprint: Blueprint = { text: 'Gain 10 Mana.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 65, + spellSchool: 'None', + cast(plr, self) { // Gain 10 Mana. plr.addMana(10); diff --git a/cards/Debug/66-inf-mana.ts b/cards/Debug/66-inf-mana.ts index adf890bc..7d2163ea 100644 --- a/cards/Debug/66-inf-mana.ts +++ b/cards/Debug/66-inf-mana.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Fill up your mana. For the rest of the game, your mana never decreases.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 66, + spellSchool: 'None', + cast(plr, self) { // Fill up your mana. For the rest of the game, your mana never decreases. diff --git a/cards/Examples/1/1-minion.ts b/cards/Examples/1/1-minion.ts index 561cebf3..6e009f78 100644 --- a/cards/Examples/1/1-minion.ts +++ b/cards/Examples/1/1-minion.ts @@ -7,6 +7,8 @@ export const blueprint: Blueprint = { // A blueprint only has ESSENTIAL properties, and type-specific properties (like stats or tribe) // Other properties, like keywords, has to be added in the 'create' ability. More on that in `1-4`. + // Essential properties first (all cards have these) + // The name of the card. name: 'Minion Example', @@ -19,15 +21,6 @@ export const blueprint: Blueprint = { // The type of the card. E.g. "Minion", "Spell", "Weapon", etc... type: 'Minion', - // The amount of attack the card has. - attack: 2, - - // The amount of health the card has. - health: 1, - - // The tribe of the minion. E.g. "Undead", "Naga", "Beast", etc... - tribe: 'None', - // The classes of the card. E.g. "Neutral", "Warrior", "Hunter", etc... classes: ['Neutral'], @@ -42,4 +35,16 @@ export const blueprint: Blueprint = { // The ID of the card. This is used in deckcodes, and should be unique per blueprint. This gets generated automatically by the card creator. // If you have debug mode enabled, you can type `/give (id)` to give yourself the card with that id. id: 29, + + // After the id property, all properties below (except for abilties) are type-specific + + // The amount of attack the minion has. + attack: 2, + + // The amount of health the minion has. + health: 1, + + // The tribe of the minion. E.g. "Undead", "Naga", "Beast", etc... + tribe: 'None', + }; diff --git a/cards/Examples/1/2-spell.ts b/cards/Examples/1/2-spell.ts index d7d0f238..285d4414 100644 --- a/cards/Examples/1/2-spell.ts +++ b/cards/Examples/1/2-spell.ts @@ -7,12 +7,11 @@ export const blueprint: Blueprint = { text: 'Just an example card (Does nothing)', cost: 1, type: 'Spell', - - // The spell school of the spell. - spellSchool: 'Shadow', - classes: ['Neutral'], rarity: 'Free', collectible: false, id: 30, + + // The spell school of the spell. + spellSchool: 'Shadow', }; diff --git a/cards/Examples/1/3-weapon.ts b/cards/Examples/1/3-weapon.ts index afc3cc23..ce7bf034 100644 --- a/cards/Examples/1/3-weapon.ts +++ b/cards/Examples/1/3-weapon.ts @@ -3,15 +3,16 @@ import { type Blueprint } from '@Game/types.js'; export const blueprint: Blueprint = { - // This looks like a minion card except for the type. + // This looks like a minion card except for the type and no tribe. name: 'Weapon Example', text: 'Just an example card (Does nothing)', cost: 1, type: 'Weapon', - attack: 5, - health: 3, classes: ['Neutral'], rarity: 'Free', collectible: false, id: 31, + + attack: 5, + health: 3, }; diff --git a/cards/Examples/1/4-taunt.ts b/cards/Examples/1/4-taunt.ts index 3fff506c..13f6a9c8 100644 --- a/cards/Examples/1/4-taunt.ts +++ b/cards/Examples/1/4-taunt.ts @@ -13,15 +13,15 @@ export const blueprint: Blueprint = { cost: 1, type: 'Minion', - attack: 2, - health: 3, tribe: 'None', classes: ['Neutral'], rarity: 'Free', - collectible: false, id: 32, + attack: 2, + health: 3, + // This is an ability. More on abilities in `1-5`. // Be careful when interacting with `plr` or `self.plr` in the create ability, it might not always be the player you're expecting. create(plr, self) { diff --git a/cards/Examples/1/5-battlecry.ts b/cards/Examples/1/5-battlecry.ts index f0cd585a..cb3f673c 100644 --- a/cards/Examples/1/5-battlecry.ts +++ b/cards/Examples/1/5-battlecry.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Give this minion +1/+1.', cost: 1, type: 'Minion', - attack: 1, - health: 2, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 33, + attack: 1, + health: 2, + tribe: 'None', + // Here we put the name of the ability we want to add. // The card creator should be able to automatically add the correct ability // but so far, it can only add a single ability per card, so if you want to add multiple abilities, you'll have to do it manually. diff --git a/cards/Examples/1/6-dredge.ts b/cards/Examples/1/6-dredge.ts index baee46d0..994de206 100644 --- a/cards/Examples/1/6-dredge.ts +++ b/cards/Examples/1/6-dredge.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'This example card shows you how to use keywords like dredge. Battlecry: Dredge.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 34, + attack: 1, + health: 1, + tribe: 'None', + battlecry(plr, self) { // Dredge. diff --git a/cards/Examples/1/7-another-ability.ts b/cards/Examples/1/7-another-ability.ts index 98459dd0..25ad2d7e 100644 --- a/cards/Examples/1/7-another-ability.ts +++ b/cards/Examples/1/7-another-ability.ts @@ -22,14 +22,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Give this minion +1/+1.', cost: 1, type: 'Minion', - attack: 1, - health: 2, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 77, + attack: 1, + health: 2, + tribe: 'None', + // If the function is named correctly, you can just write the name of the ability battlecry, diff --git a/cards/Examples/1/last-combined.ts b/cards/Examples/1/last-combined.ts index 925d3113..1d5c5b54 100644 --- a/cards/Examples/1/last-combined.ts +++ b/cards/Examples/1/last-combined.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Taunt, Divine Shield. Battlecry: Dredge. Gain +1/+1. (This example card combines everything you\'ve learned in stage 1 into this card.)', cost: 1, type: 'Minion', - attack: 4, - health: 4, - tribe: 'All', classes: ['Priest', 'Paladin'], rarity: 'Legendary', collectible: false, id: 35, + attack: 4, + health: 4, + tribe: 'All', + create(plr, self) { self.addKeyword('Taunt'); self.addKeyword('Divine Shield'); diff --git a/cards/Examples/2/1-location.ts b/cards/Examples/2/1-location.ts index e19ada01..52014731 100644 --- a/cards/Examples/2/1-location.ts +++ b/cards/Examples/2/1-location.ts @@ -10,6 +10,8 @@ export const blueprint: Blueprint = { type: 'Location', classes: ['Neutral'], rarity: 'Free', + collectible: false, + id: 36, // This is the amount of times you can trigger the location card before it breaking. durability: 3, @@ -18,9 +20,6 @@ export const blueprint: Blueprint = { // Afaik, in hearthstone, this is always 2. cooldown: 2, - collectible: false, - id: 36, - // Remember to use the correct ability // For spells, the ability is `cast`. // And for location cards, the ability is `use`. diff --git a/cards/Examples/2/2-Hero/2-hero.ts b/cards/Examples/2/2-Hero/2-hero.ts index 9ba20491..15fabb4c 100644 --- a/cards/Examples/2/2-Hero/2-hero.ts +++ b/cards/Examples/2/2-Hero/2-hero.ts @@ -10,14 +10,13 @@ export const blueprint: Blueprint = { type: 'Hero', classes: ['Neutral'], rarity: 'Free', + collectible: false, + id: 37, // The id of the hero power card. // The hero power card can be any spell. Here we use the 2-heropower.ts card. heropowerId: 130, - collectible: false, - id: 37, - battlecry(plr, self) { // Restore your hero to full health. diff --git a/cards/Examples/2/2-Hero/2-heropower.ts b/cards/Examples/2/2-Hero/2-heropower.ts index 771c2190..c9b554f7 100644 --- a/cards/Examples/2/2-Hero/2-heropower.ts +++ b/cards/Examples/2/2-Hero/2-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Restore 2 Health to your hero.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 130, + spellSchool: 'None', + // This gets triggered when the player uses their hero power. cast(plr, self) { // Restore 2 Health to your hero. diff --git a/cards/Examples/2/3-dormant.ts b/cards/Examples/2/3-dormant.ts index 1d0d9682..65a23860 100644 --- a/cards/Examples/2/3-dormant.ts +++ b/cards/Examples/2/3-dormant.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Dormant for 2 turns. Battlecry: Dredge.', cost: 1, type: 'Minion', - attack: 8, - health: 8, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 38, + attack: 8, + health: 8, + tribe: 'None', + create(plr, self) { // The 2 is how many turns this minion should be dormant for. // Full disclosure: The dormant system is one of the most untested parts of this game. diff --git a/cards/Examples/2/4-runes.ts b/cards/Examples/2/4-runes.ts index 29ff1006..b0003628 100644 --- a/cards/Examples/2/4-runes.ts +++ b/cards/Examples/2/4-runes.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'This is an example card to show how runes work.', cost: 1, type: 'Minion', - attack: 1, - health: 2, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 39, + attack: 1, + health: 2, + tribe: 'None', + create(plr, self) { // You need 2 frost runes and 1 blood rune to use this card. self.runes = 'FFB'; diff --git a/cards/Examples/2/5-corrupt.ts b/cards/Examples/2/5-corrupt.ts index 72d47e05..dc6933ad 100644 --- a/cards/Examples/2/5-corrupt.ts +++ b/cards/Examples/2/5-corrupt.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Corrupt.', cost: 0, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 40, + attack: 1, + health: 1, + tribe: 'None', + create(plr, self) { // Put the id of the corrupted counterpart here. This is the id of 5-corrupted.ts // Corrupted is another system that is very untested and might get a rewrite. diff --git a/cards/Examples/2/5-corrupted.ts b/cards/Examples/2/5-corrupted.ts index 1d84643f..aaa7756b 100644 --- a/cards/Examples/2/5-corrupted.ts +++ b/cards/Examples/2/5-corrupted.ts @@ -9,11 +9,12 @@ export const blueprint: Blueprint = { text: 'Corrupted.', cost: 0, type: 'Minion', - attack: 2, - health: 2, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 41, + + attack: 2, + health: 2, + tribe: 'None', }; diff --git a/cards/Examples/2/6-forge.ts b/cards/Examples/2/6-forge.ts index fddac587..1a46eee3 100644 --- a/cards/Examples/2/6-forge.ts +++ b/cards/Examples/2/6-forge.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Forge: Gain +1/+1.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 75, + attack: 1, + health: 1, + tribe: 'None', + create(plr, self) { // Put the id of the forged counterpart, like in corrupt. self.addKeyword('Forge', 76); diff --git a/cards/Examples/2/6-forged.ts b/cards/Examples/2/6-forged.ts index a5833508..8c6b20e5 100644 --- a/cards/Examples/2/6-forged.ts +++ b/cards/Examples/2/6-forged.ts @@ -9,11 +9,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 2, - health: 2, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 76, + + attack: 2, + health: 2, + tribe: 'None', }; diff --git a/cards/Examples/2/7-Titan/7-ability1.ts b/cards/Examples/2/7-Titan/7-ability1.ts index 8d192d2e..b532bc95 100644 --- a/cards/Examples/2/7-Titan/7-ability1.ts +++ b/cards/Examples/2/7-Titan/7-ability1.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Destroy an enemy minion.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 79, + spellSchool: 'None', + cast(plr, self) { // Destroy an enemy minion. diff --git a/cards/Examples/2/7-Titan/7-ability2.ts b/cards/Examples/2/7-Titan/7-ability2.ts index 97b07d4e..e93af09a 100644 --- a/cards/Examples/2/7-Titan/7-ability2.ts +++ b/cards/Examples/2/7-Titan/7-ability2.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Heal 3 damage.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 80, + spellSchool: 'None', + cast(plr, self) { // Heal 3 damage. diff --git a/cards/Examples/2/7-Titan/7-ability3.ts b/cards/Examples/2/7-Titan/7-ability3.ts index 47960432..a7877f49 100644 --- a/cards/Examples/2/7-Titan/7-ability3.ts +++ b/cards/Examples/2/7-Titan/7-ability3.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Restore 2 mana.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 81, + spellSchool: 'None', + cast(plr, self) { // Restore 2 mana. diff --git a/cards/Examples/2/7-Titan/7-titan.ts b/cards/Examples/2/7-Titan/7-titan.ts index 301b77d1..bd75a343 100644 --- a/cards/Examples/2/7-Titan/7-titan.ts +++ b/cards/Examples/2/7-Titan/7-titan.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Titan.', cost: 1, type: 'Minion', - attack: 10, - health: 10, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 78, + attack: 10, + health: 10, + tribe: 'None', + create(plr, self) { // Put the ids of the titan ability cards, like in corrupt, but a list. self.addKeyword('Titan', [79, 80, 81]); diff --git a/cards/Examples/2/8-spelldamage.ts b/cards/Examples/2/8-spelldamage.ts index dc7f854b..bc989e8f 100644 --- a/cards/Examples/2/8-spelldamage.ts +++ b/cards/Examples/2/8-spelldamage.ts @@ -13,12 +13,13 @@ export const blueprint: Blueprint = { cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 42, + spellSchool: 'None', + cast(plr, self) { // Deal $3 damage to the enemy hero. diff --git a/cards/Examples/2/9-Colossal/left.ts b/cards/Examples/2/9-Colossal/left.ts index 4abd0694..29d2adf4 100644 --- a/cards/Examples/2/9-Colossal/left.ts +++ b/cards/Examples/2/9-Colossal/left.ts @@ -9,11 +9,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 2, - health: 1, - tribe: 'Beast', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 43, + + attack: 2, + health: 1, + tribe: 'Beast', }; diff --git a/cards/Examples/2/9-Colossal/main.ts b/cards/Examples/2/9-Colossal/main.ts index 364a8c32..6df37420 100644 --- a/cards/Examples/2/9-Colossal/main.ts +++ b/cards/Examples/2/9-Colossal/main.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Colossal +2.', cost: 2, type: 'Minion', - attack: 5, - health: 3, - tribe: 'Beast', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 45, + attack: 5, + health: 3, + tribe: 'Beast', + create(plr, self) { // Put the names of the cards here. The 0 is this card. // diff --git a/cards/Examples/2/9-Colossal/right.ts b/cards/Examples/2/9-Colossal/right.ts index 8bc06364..abe36083 100644 --- a/cards/Examples/2/9-Colossal/right.ts +++ b/cards/Examples/2/9-Colossal/right.ts @@ -9,11 +9,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 1, - health: 2, - tribe: 'Beast', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 44, + + attack: 1, + health: 2, + tribe: 'Beast', }; diff --git a/cards/Examples/2/last-Combined/left.ts b/cards/Examples/2/last-Combined/left.ts index 05e4ed8e..19e764f4 100644 --- a/cards/Examples/2/last-Combined/left.ts +++ b/cards/Examples/2/last-Combined/left.ts @@ -7,11 +7,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 3, - health: 3, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 46, + + attack: 3, + health: 3, + tribe: 'None', }; diff --git a/cards/Examples/2/last-Combined/main-corrupted.ts b/cards/Examples/2/last-Combined/main-corrupted.ts index 030f7d39..49c89293 100644 --- a/cards/Examples/2/last-Combined/main-corrupted.ts +++ b/cards/Examples/2/last-Combined/main-corrupted.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Colossal +2. Dormant. Corrupted. Battlecry: Dredge.', cost: 0, type: 'Minion', - attack: 9, - health: 9, - tribe: 'None', classes: ['Neutral'], rarity: 'Legendary', collectible: false, id: 49, + attack: 9, + health: 9, + tribe: 'None', + create(plr, self) { self.addKeyword('Colossal', [46, 0, 47]); self.addKeyword('Dormant', 2); diff --git a/cards/Examples/2/last-Combined/main.ts b/cards/Examples/2/last-Combined/main.ts index abeb0fb7..089a5098 100644 --- a/cards/Examples/2/last-Combined/main.ts +++ b/cards/Examples/2/last-Combined/main.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Colossal +2. Dormant. Corrupt.', cost: 0, type: 'Minion', - attack: 5, - health: 3, - tribe: 'None', classes: ['Neutral'], rarity: 'Legendary', collectible: false, id: 48, + attack: 5, + health: 3, + tribe: 'None', + create(plr, self) { self.runes = 'BBB'; diff --git a/cards/Examples/2/last-Combined/right.ts b/cards/Examples/2/last-Combined/right.ts index b23601ae..6b594a0d 100644 --- a/cards/Examples/2/last-Combined/right.ts +++ b/cards/Examples/2/last-Combined/right.ts @@ -7,11 +7,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 1, - health: 2, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 47, + + attack: 1, + health: 2, + tribe: 'None', }; diff --git a/cards/Examples/3/1-manathirst.ts b/cards/Examples/3/1-manathirst.ts index bd9aafb5..f6f005a9 100644 --- a/cards/Examples/3/1-manathirst.ts +++ b/cards/Examples/3/1-manathirst.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Freeze an enemy minion. Manathirst (6): Silence it first.', cost: 1, type: 'Minion', - attack: 1, - health: 2, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 50, + attack: 1, + health: 2, + tribe: 'None', + battlecry(plr, self) { const returnValue = self.manathirst(6); diff --git a/cards/Examples/3/2-discover.ts b/cards/Examples/3/2-discover.ts index 22a2ebd9..4802415b 100644 --- a/cards/Examples/3/2-discover.ts +++ b/cards/Examples/3/2-discover.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Discover a spell.', cost: 1, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 51, + spellSchool: 'None', + cast(plr, self) { // Discover a spell. diff --git a/cards/Examples/3/3-condition.ts b/cards/Examples/3/3-condition.ts index dffa496f..78873dc5 100644 --- a/cards/Examples/3/3-condition.ts +++ b/cards/Examples/3/3-condition.ts @@ -11,14 +11,15 @@ export const blueprint: Blueprint = { cost: 1, type: 'Minion', - attack: 5, - health: 2, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 52, + attack: 5, + health: 2, + tribe: 'None', + battlecry(plr, self) { // If your deck has no duplicates, draw a card. diff --git a/cards/Examples/3/4-placeholder.ts b/cards/Examples/3/4-placeholder.ts index f131a1af..af9a6d5c 100644 --- a/cards/Examples/3/4-placeholder.ts +++ b/cards/Examples/3/4-placeholder.ts @@ -11,12 +11,13 @@ export const blueprint: Blueprint = { cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 53, + spellSchool: 'None', + cast(plr, self) { // Gain mana equal to the turn counter. const turns = game.functions.util.getTraditionalTurnCounter(); diff --git a/cards/Examples/3/last-combined.ts b/cards/Examples/3/last-combined.ts index cdfcdd12..4ebdf83b 100644 --- a/cards/Examples/3/last-combined.ts +++ b/cards/Examples/3/last-combined.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'If the turn counter is an even number, gain mana equal to the turn counter (up to 10). Manathirst (7): Remove the condition. (Currently: {turns})', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Legendary', collectible: false, id: 54, + spellSchool: 'None', + cast(plr, self) { if (!self.condition()) { return; diff --git a/cards/Examples/4/1-passive.ts b/cards/Examples/4/1-passive.ts index 9a6e4aaf..47fd35e1 100644 --- a/cards/Examples/4/1-passive.ts +++ b/cards/Examples/4/1-passive.ts @@ -11,14 +11,15 @@ export const blueprint: Blueprint = { cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 55, + attack: 1, + health: 1, + tribe: 'None', + // Note the new `key` and `_unknownVal` arguments. // These are only used in the `passive` and `handpassive` abilities. passive(plr, self, key, _unknownValue, eventPlayer) { diff --git a/cards/Examples/4/2-enchantments.ts b/cards/Examples/4/2-enchantments.ts index f41338a9..07ddb689 100644 --- a/cards/Examples/4/2-enchantments.ts +++ b/cards/Examples/4/2-enchantments.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Your cards cost 1 less.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 56, + attack: 1, + health: 1, + tribe: 'None', + // `tick` works the same as passive, except it's called more often, and isn't dependent on events. // More on ticks in '4-5' tick(plr, self, key, value) { diff --git a/cards/Examples/4/3-event-listener.ts b/cards/Examples/4/3-event-listener.ts index 9c99e78a..723e8311 100644 --- a/cards/Examples/4/3-event-listener.ts +++ b/cards/Examples/4/3-event-listener.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: For the rest of the game, your battlecries trigger twice.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 57, + attack: 1, + health: 1, + tribe: 'None', + battlecry(plr, self) { // For the rest of the game, your battlecries trigger twice. diff --git a/cards/Examples/4/4-quest.ts b/cards/Examples/4/4-quest.ts index 2e628668..0c8b59a0 100644 --- a/cards/Examples/4/4-quest.ts +++ b/cards/Examples/4/4-quest.ts @@ -12,12 +12,13 @@ export const blueprint: Blueprint = { cost: 1, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 58, + spellSchool: 'None', + cast(plr, self) { // Quest: Play 3 cards. Reward: Return those cards back to your hand. diff --git a/cards/Examples/4/5-tick-hooks.ts b/cards/Examples/4/5-tick-hooks.ts index 556c9d2b..27f7058f 100644 --- a/cards/Examples/4/5-tick-hooks.ts +++ b/cards/Examples/4/5-tick-hooks.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Your cards cost (1) less.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 59, + attack: 1, + health: 1, + tribe: 'None', + battlecry(plr, self) { // Your cards cost (1) less. diff --git a/cards/Examples/4/last-combined.ts b/cards/Examples/4/last-combined.ts index 00e94889..78c4e993 100644 --- a/cards/Examples/4/last-combined.ts +++ b/cards/Examples/4/last-combined.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Quest: Play 3 cards. Reward: Reduce the cost of the next 10 Minions you play by 1.', cost: 1, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Legendary', collectible: false, id: 60, + spellSchool: 'None', + cast(plr, self) { plr.addQuest('Quest', self, 'PlayCard', 3, (_unknownValue, done) => { const value = _unknownValue as EventValue<'PlayCard'>; diff --git a/cards/Examples/DIY/1.ts b/cards/Examples/DIY/1.ts index d1fa54bf..82781169 100644 --- a/cards/Examples/DIY/1.ts +++ b/cards/Examples/DIY/1.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'This is a DIY card, it does not work by default. Battlecry: Give this minion +1/+1.', cost: 0, type: 'Minion', - attack: 0, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 61, + attack: 0, + health: 1, + tribe: 'None', + battlecry(plr, self) { // Give this minion +1/+1. diff --git a/cards/Examples/DIY/2.ts b/cards/Examples/DIY/2.ts index 51431980..cbdebe4a 100644 --- a/cards/Examples/DIY/2.ts +++ b/cards/Examples/DIY/2.ts @@ -7,12 +7,13 @@ export const blueprint: Blueprint = { text: 'This is a DIY card, it does not work by default. Restore 3 health to your hero.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 62, + spellSchool: 'None', + cast(plr, self) { // Restore 3 health to the hero. diff --git a/cards/Examples/DIY/3.ts b/cards/Examples/DIY/3.ts index df754c02..1fb78e25 100644 --- a/cards/Examples/DIY/3.ts +++ b/cards/Examples/DIY/3.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'This is a DIY card, it does not work by default. Choose a minion to kill.', cost: 0, type: 'Spell', - spellSchool: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 63, + spellSchool: 'None', + cast(plr, self) { // Choose a minion to kill. diff --git a/cards/Examples/DIY/4.ts b/cards/Examples/DIY/4.ts index d4b4c537..bc896b15 100644 --- a/cards/Examples/DIY/4.ts +++ b/cards/Examples/DIY/4.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'This is a DIY card, it does not work by default. Whenever a friendly minion dies, Resurrect it with 1/1 stats.', cost: 0, type: 'Minion', - attack: 0, - health: 10, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 64, + attack: 0, + health: 10, + tribe: 'None', + passive(plr, self, key, _unknownValue, eventPlayer) { // Whenever a minion dies, Resurrect it with 1/1 stats. diff --git a/cards/Examples/Test/deathrattle.ts b/cards/Examples/Test/deathrattle.ts index 9194463f..7bd637a7 100644 --- a/cards/Examples/Test/deathrattle.ts +++ b/cards/Examples/Test/deathrattle.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Deathrattle: Summon two 1/1 Sheep.', cost: 1, type: 'Minion', - attack: 1, - health: 2, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 72, + attack: 1, + health: 2, + tribe: 'None', + deathrattle(plr, self) { // Summon two 1/1 Sheep. diff --git a/cards/Examples/Test/divine-shield.ts b/cards/Examples/Test/divine-shield.ts index 0a1af1fa..d07a2411 100644 --- a/cards/Examples/Test/divine-shield.ts +++ b/cards/Examples/Test/divine-shield.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Divine Shield', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 73, + attack: 1, + health: 1, + tribe: 'None', + create(plr, self) { self.addKeyword('Divine Shield'); }, diff --git a/cards/Examples/Test/frozen.ts b/cards/Examples/Test/frozen.ts index 761fc993..c924b932 100644 --- a/cards/Examples/Test/frozen.ts +++ b/cards/Examples/Test/frozen.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'This is forever Frozen', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 74, + attack: 1, + health: 1, + tribe: 'None', + create(plr, self) { self.freeze(); }, diff --git a/cards/Examples/Unordered/Card References/131-simple.ts b/cards/Examples/Unordered/Card References/131-simple.ts index c432c4ee..f1c27853 100644 --- a/cards/Examples/Unordered/Card References/131-simple.ts +++ b/cards/Examples/Unordered/Card References/131-simple.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'The Coin: {coin}', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 131, + attack: 1, + health: 1, + tribe: 'None', + placeholders(plr, self) { // You can reference entire cards in placeholders. // Go in-game, give yourself this card, and type 'detail' to see how it works. diff --git a/cards/Examples/Unordered/Card References/132-circular.ts b/cards/Examples/Unordered/Card References/132-circular.ts index ae36369f..0baf69e1 100644 --- a/cards/Examples/Unordered/Card References/132-circular.ts +++ b/cards/Examples/Unordered/Card References/132-circular.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Circular card reference: {card}', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 132, + attack: 1, + health: 1, + tribe: 'None', + placeholders(plr, self) { // You can reference this card in placeholders. // Go in-game, give yourself this card, and type 'detail' to see how it works. diff --git a/cards/Galakrond/111-dragon-claw.ts b/cards/Galakrond/111-dragon-claw.ts index 4d2ca507..7427e161 100644 --- a/cards/Galakrond/111-dragon-claw.ts +++ b/cards/Galakrond/111-dragon-claw.ts @@ -7,10 +7,11 @@ export const blueprint: Blueprint = { text: '', cost: 5, type: 'Weapon', - attack: 5, - health: 2, classes: ['Neutral'], rarity: 'Free', collectible: false, id: 111, + + attack: 5, + health: 2, }; diff --git a/cards/Galakrond/112-brewing-storm.ts b/cards/Galakrond/112-brewing-storm.ts index 8079a399..370416c4 100644 --- a/cards/Galakrond/112-brewing-storm.ts +++ b/cards/Galakrond/112-brewing-storm.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Rush', cost: 2, type: 'Minion', - attack: 2, - health: 2, - tribe: 'Elemental', classes: ['Shaman'], rarity: 'Free', collectible: false, id: 112, + attack: 2, + health: 2, + tribe: 'Elemental', + create(plr, self) { // Add additional fields here self.addKeyword('Rush'); diff --git a/cards/Galakrond/Priest/128-heropower.ts b/cards/Galakrond/Priest/128-heropower.ts index 98a6de61..88b76cd4 100644 --- a/cards/Galakrond/Priest/128-heropower.ts +++ b/cards/Galakrond/Priest/128-heropower.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Add a random Priest minion to your hand.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Priest'], rarity: 'Legendary', + collectible: true, id: 128, + spellSchool: 'None', + cast(plr, self) { // Add a random Priest minion to your hand. const possibleCards = game.functions.card.getAll().filter(c => c.type === 'Minion' && game.functions.card.validateClasses(c.classes, 'Priest')); diff --git a/cards/Galakrond/Priest/70-hero.ts b/cards/Galakrond/Priest/70-hero.ts index ce6d1c34..6c5c3d8d 100644 --- a/cards/Galakrond/Priest/70-hero.ts +++ b/cards/Galakrond/Priest/70-hero.ts @@ -9,9 +9,11 @@ export const blueprint: Blueprint = { type: 'Hero', classes: ['Priest'], rarity: 'Legendary', - heropowerId: 128, + collectible: true, id: 70, + heropowerId: 128, + battlecry(plr, self) { // Destroy 1 random enemy minion. const amount = game.functions.card.galakrondFormula(self.storage.invokeCount as number); diff --git a/cards/Galakrond/Rogue/125-heropower.ts b/cards/Galakrond/Rogue/125-heropower.ts index 76216349..cc311b5e 100644 --- a/cards/Galakrond/Rogue/125-heropower.ts +++ b/cards/Galakrond/Rogue/125-heropower.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Add a Lackey to your hand.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Rogue'], rarity: 'Legendary', + collectible: true, id: 125, + spellSchool: 'None', + cast(plr, self) { // Add a lacky to your hand. const lackeyId = game.lodash.sample(game.cardCollections.lackeys); diff --git a/cards/Galakrond/Rogue/67-hero.ts b/cards/Galakrond/Rogue/67-hero.ts index db2324c4..132b1267 100644 --- a/cards/Galakrond/Rogue/67-hero.ts +++ b/cards/Galakrond/Rogue/67-hero.ts @@ -10,9 +10,11 @@ export const blueprint: Blueprint = { type: 'Hero', classes: ['Rogue'], rarity: 'Legendary', - heropowerId: 125, + collectible: true, id: 67, + heropowerId: 125, + battlecry(plr, self) { // Draw {amount} cards. They cost (0). diff --git a/cards/Galakrond/Shaman/126-heropower.ts b/cards/Galakrond/Shaman/126-heropower.ts index 2b207eaf..999a2e59 100644 --- a/cards/Galakrond/Shaman/126-heropower.ts +++ b/cards/Galakrond/Shaman/126-heropower.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Summon a 2/1 Elemental with Rush.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Shaman'], rarity: 'Legendary', + collectible: true, id: 126, + spellSchool: 'None', + cast(plr, self) { // Summon a 2/1 Elemental with Rush. const card = game.createCard(19, plr); diff --git a/cards/Galakrond/Shaman/68-hero.ts b/cards/Galakrond/Shaman/68-hero.ts index cf25032d..9b4de641 100644 --- a/cards/Galakrond/Shaman/68-hero.ts +++ b/cards/Galakrond/Shaman/68-hero.ts @@ -7,11 +7,13 @@ export const blueprint: Blueprint = { text: 'Battlecry: Summon two {amount}/{amount} Storms with Rush.{weapon}', cost: 7, type: 'Hero', - heropowerId: 126, classes: ['Shaman'], rarity: 'Legendary', + collectible: true, id: 68, + heropowerId: 126, + battlecry(plr, self) { // Summon two 1/1 Storms with Rush. (Equip a 5/2 Claw.) diff --git a/cards/Galakrond/Warlock/129-heropower.ts b/cards/Galakrond/Warlock/129-heropower.ts index 5d2f99fa..760d4538 100644 --- a/cards/Galakrond/Warlock/129-heropower.ts +++ b/cards/Galakrond/Warlock/129-heropower.ts @@ -9,11 +9,13 @@ export const blueprint: Blueprint = { text: 'Summon two 1/1 Imps.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Warlock'], rarity: 'Legendary', + collectible: true, id: 129, + spellSchool: 'None', + cast(plr, self) { // Summon two 1/1 Imps. for (let i = 0; i < 2; i++) { diff --git a/cards/Galakrond/Warlock/71-hero.ts b/cards/Galakrond/Warlock/71-hero.ts index 387c36a2..c80deaff 100644 --- a/cards/Galakrond/Warlock/71-hero.ts +++ b/cards/Galakrond/Warlock/71-hero.ts @@ -10,9 +10,11 @@ export const blueprint: Blueprint = { type: 'Hero', classes: ['Warlock'], rarity: 'Legendary', - heropowerId: 129, + collectible: true, id: 71, + heropowerId: 129, + battlecry(plr, self) { // Summon 1 random Demon. const amount = game.functions.card.galakrondFormula(self.storage.invokeCount as number); diff --git a/cards/Galakrond/Warrior/127-heropower.ts b/cards/Galakrond/Warrior/127-heropower.ts index 62b7773d..488d1f2c 100644 --- a/cards/Galakrond/Warrior/127-heropower.ts +++ b/cards/Galakrond/Warrior/127-heropower.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Give your hero +3 Attack this turn.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Warrior'], rarity: 'Legendary', + collectible: true, id: 127, + spellSchool: 'None', + cast(plr, self) { // Give your hero +3 Attack this turn. diff --git a/cards/Galakrond/Warrior/69-hero.ts b/cards/Galakrond/Warrior/69-hero.ts index 154ed16a..20393f31 100644 --- a/cards/Galakrond/Warrior/69-hero.ts +++ b/cards/Galakrond/Warrior/69-hero.ts @@ -8,11 +8,13 @@ export const blueprint: Blueprint = { text: 'Battlecry: Draw {amount} minion{plural}. Give {plural2} +4/+4.', cost: 7, type: 'Hero', - heropowerId: 127, classes: ['Warrior'], rarity: 'Legendary', + collectible: true, id: 69, + heropowerId: 127, + battlecry(plr, self) { // Draw 1 minion. Give them +4/+4. const amount = game.functions.card.galakrondFormula(self.storage.invokeCount as number); diff --git a/cards/HeroPower/Death Knight/23-frail-ghoul.ts b/cards/HeroPower/Death Knight/23-frail-ghoul.ts index 012d92d5..182752ee 100644 --- a/cards/HeroPower/Death Knight/23-frail-ghoul.ts +++ b/cards/HeroPower/Death Knight/23-frail-ghoul.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Charge At the end of your turn, this minion dies.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'Undead', classes: ['Death Knight'], rarity: 'Free', collectible: false, id: 23, + attack: 1, + health: 1, + tribe: 'Undead', + create(plr, self) { self.addKeyword('Charge'); }, diff --git a/cards/HeroPower/Paladin/20-silver-hand-recruit.ts b/cards/HeroPower/Paladin/20-silver-hand-recruit.ts index 1f3ed0a5..83e374a1 100644 --- a/cards/HeroPower/Paladin/20-silver-hand-recruit.ts +++ b/cards/HeroPower/Paladin/20-silver-hand-recruit.ts @@ -7,11 +7,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Paladin'], rarity: 'Free', collectible: false, id: 20, + + attack: 1, + health: 1, + tribe: 'None', }; diff --git a/cards/HeroPower/Rogue/22-wicked-knife.ts b/cards/HeroPower/Rogue/22-wicked-knife.ts index 7b11defd..6d504c76 100644 --- a/cards/HeroPower/Rogue/22-wicked-knife.ts +++ b/cards/HeroPower/Rogue/22-wicked-knife.ts @@ -7,10 +7,11 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Weapon', - attack: 1, - health: 2, classes: ['Rogue'], rarity: 'Free', collectible: false, id: 22, + + attack: 1, + health: 2, }; diff --git a/cards/HeroPower/Shaman/19-windswept-elemental.ts b/cards/HeroPower/Shaman/19-windswept-elemental.ts index ab7162e4..31d40e6f 100644 --- a/cards/HeroPower/Shaman/19-windswept-elemental.ts +++ b/cards/HeroPower/Shaman/19-windswept-elemental.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Rush', cost: 2, type: 'Minion', - attack: 2, - health: 1, - tribe: 'Totem', classes: ['Shaman'], rarity: 'Free', collectible: false, id: 19, + attack: 2, + health: 1, + tribe: 'Totem', + create(plr, self) { self.addKeyword('Rush'); }, diff --git a/cards/HeroPower/Shaman/Basic/15-healing-totem.ts b/cards/HeroPower/Shaman/Basic/15-healing-totem.ts index 381b6769..262e4404 100644 --- a/cards/HeroPower/Shaman/Basic/15-healing-totem.ts +++ b/cards/HeroPower/Shaman/Basic/15-healing-totem.ts @@ -9,14 +9,15 @@ export const blueprint: Blueprint = { text: 'At the end of your turn, restore #1 Health to all friendly minions.', cost: 1, type: 'Minion', - attack: 0, - health: 2, - tribe: 'Totem', classes: ['Shaman'], rarity: 'Free', collectible: false, id: 15, + attack: 0, + health: 2, + tribe: 'Totem', + passive(plr, self, key, value, eventPlayer) { // At the end of your turn, restore 1 Health to all friendly minions. diff --git a/cards/HeroPower/Shaman/Basic/16-searing-totem.ts b/cards/HeroPower/Shaman/Basic/16-searing-totem.ts index eb6d6e39..4ebb405b 100644 --- a/cards/HeroPower/Shaman/Basic/16-searing-totem.ts +++ b/cards/HeroPower/Shaman/Basic/16-searing-totem.ts @@ -7,11 +7,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'Totem', classes: ['Shaman'], rarity: 'Free', collectible: false, id: 16, + + attack: 1, + health: 1, + tribe: 'Totem', }; diff --git a/cards/HeroPower/Shaman/Basic/17-stoneclaw-totem.ts b/cards/HeroPower/Shaman/Basic/17-stoneclaw-totem.ts index 2f52f507..1595a4aa 100644 --- a/cards/HeroPower/Shaman/Basic/17-stoneclaw-totem.ts +++ b/cards/HeroPower/Shaman/Basic/17-stoneclaw-totem.ts @@ -7,14 +7,15 @@ export const blueprint: Blueprint = { text: 'Taunt', cost: 1, type: 'Minion', - attack: 0, - health: 2, - tribe: 'Totem', classes: ['Shaman'], rarity: 'Free', collectible: false, id: 17, + attack: 0, + health: 2, + tribe: 'Totem', + create(plr, self) { self.addKeyword('Taunt'); }, diff --git a/cards/HeroPower/Shaman/Basic/18-strength-totem.ts b/cards/HeroPower/Shaman/Basic/18-strength-totem.ts index 7de5a133..3ee809db 100644 --- a/cards/HeroPower/Shaman/Basic/18-strength-totem.ts +++ b/cards/HeroPower/Shaman/Basic/18-strength-totem.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'At the end of your turn, give another friendly minion +1 Attack.', cost: 1, type: 'Minion', - attack: 0, - health: 2, - tribe: 'Totem', classes: ['Shaman'], rarity: 'Free', collectible: false, id: 18, + attack: 0, + health: 2, + tribe: 'Totem', + passive(plr, self, key, value, eventPlayer) { // At the end of your turn, give another friendly minion +1 Attack. diff --git a/cards/HeroPower/Warlock/21-draconic-imp.ts b/cards/HeroPower/Warlock/21-draconic-imp.ts index 279fa044..e92fe835 100644 --- a/cards/HeroPower/Warlock/21-draconic-imp.ts +++ b/cards/HeroPower/Warlock/21-draconic-imp.ts @@ -7,11 +7,12 @@ export const blueprint: Blueprint = { text: '', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'Demon', classes: ['Warlock'], rarity: 'Free', collectible: false, id: 21, + + attack: 1, + health: 1, + tribe: 'Demon', }; diff --git a/cards/Lackeys/24-ethereal.ts b/cards/Lackeys/24-ethereal.ts index 2e40f6ee..c1afa2c6 100644 --- a/cards/Lackeys/24-ethereal.ts +++ b/cards/Lackeys/24-ethereal.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Discover a spell.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 24, + attack: 1, + health: 1, + tribe: 'None', + battlecry(plr, self) { // Discover a spell. diff --git a/cards/Lackeys/25-faceless.ts b/cards/Lackeys/25-faceless.ts index 5250b84a..bea01a2c 100644 --- a/cards/Lackeys/25-faceless.ts +++ b/cards/Lackeys/25-faceless.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Summon a random 2-Cost minion.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 25, + attack: 1, + health: 1, + tribe: 'None', + battlecry(plr, self) { // Summon a random 2-Cost minion. diff --git a/cards/Lackeys/26-goblin.ts b/cards/Lackeys/26-goblin.ts index 51caf50b..ca3e322d 100644 --- a/cards/Lackeys/26-goblin.ts +++ b/cards/Lackeys/26-goblin.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Give a friendly minion +1 Attack and Rush.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 26, + attack: 1, + health: 1, + tribe: 'None', + battlecry(plr, self) { // Give a friendly minion +1 Attack and Rush. diff --git a/cards/Lackeys/27-kobold.ts b/cards/Lackeys/27-kobold.ts index fb8eeed6..6c30cfb0 100644 --- a/cards/Lackeys/27-kobold.ts +++ b/cards/Lackeys/27-kobold.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Deal 2 damage.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 27, + attack: 1, + health: 1, + tribe: 'None', + battlecry(plr, self) { // Deal 2 damage. diff --git a/cards/Lackeys/28-witchy.ts b/cards/Lackeys/28-witchy.ts index 8b5a05de..e6992e16 100644 --- a/cards/Lackeys/28-witchy.ts +++ b/cards/Lackeys/28-witchy.ts @@ -8,14 +8,15 @@ export const blueprint: Blueprint = { text: 'Battlecry: Transform a friendly minion into one that costs (1) more.', cost: 1, type: 'Minion', - attack: 1, - health: 1, - tribe: 'None', classes: ['Neutral'], rarity: 'Free', collectible: false, id: 28, + attack: 1, + health: 1, + tribe: 'None', + battlecry(plr, self) { // Transform a friendly minion into one that costs (1) more. diff --git a/cards/StartingHeroes/Death Knight/124-heropower.ts b/cards/StartingHeroes/Death Knight/124-heropower.ts index d3cc77c5..158eeba0 100644 --- a/cards/StartingHeroes/Death Knight/124-heropower.ts +++ b/cards/StartingHeroes/Death Knight/124-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Summon a 1/1 Ghoul with Charge. It dies at end of turn.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Death Knight'], rarity: 'Free', collectible: false, id: 124, + spellSchool: 'None', + cast(plr, self) { // Summon a 1/1 Ghoul with Charge. It dies at end of turn. diff --git a/cards/StartingHeroes/Death Knight/14-hero.ts b/cards/StartingHeroes/Death Knight/14-hero.ts index 98d757de..129f7d7a 100644 --- a/cards/StartingHeroes/Death Knight/14-hero.ts +++ b/cards/StartingHeroes/Death Knight/14-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Death knight starting hero', cost: 0, type: 'Hero', - heropowerId: 124, classes: ['Death Knight'], rarity: 'Free', collectible: false, id: 14, + + heropowerId: 124, }; diff --git a/cards/StartingHeroes/Demon Hunter/123-heropower.ts b/cards/StartingHeroes/Demon Hunter/123-heropower.ts index b98541e2..32bf6c34 100644 --- a/cards/StartingHeroes/Demon Hunter/123-heropower.ts +++ b/cards/StartingHeroes/Demon Hunter/123-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: '+1 Attack this turn.', cost: 1, type: 'Spell', - spellSchool: 'None', classes: ['Demon Hunter'], rarity: 'Free', collectible: false, id: 123, + spellSchool: 'None', + cast(plr, self) { // +1 Attack this turn. diff --git a/cards/StartingHeroes/Demon Hunter/13-hero.ts b/cards/StartingHeroes/Demon Hunter/13-hero.ts index 5bd9d220..b8e12965 100644 --- a/cards/StartingHeroes/Demon Hunter/13-hero.ts +++ b/cards/StartingHeroes/Demon Hunter/13-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Demon hunter starting hero', cost: 0, type: 'Hero', - heropowerId: 123, classes: ['Demon Hunter'], rarity: 'Free', collectible: false, id: 13, + + heropowerId: 123, }; diff --git a/cards/StartingHeroes/Druid/115-heropower.ts b/cards/StartingHeroes/Druid/115-heropower.ts index 77875826..8c8e83dc 100644 --- a/cards/StartingHeroes/Druid/115-heropower.ts +++ b/cards/StartingHeroes/Druid/115-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: '+1 Attack this turn. +1 Armor.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Druid'], rarity: 'Free', collectible: false, id: 115, + spellSchool: 'None', + cast(plr, self) { // +1 Attack this turn. +1 Armor. diff --git a/cards/StartingHeroes/Druid/5-hero.ts b/cards/StartingHeroes/Druid/5-hero.ts index d5d61df2..a046596c 100644 --- a/cards/StartingHeroes/Druid/5-hero.ts +++ b/cards/StartingHeroes/Druid/5-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Druid starting hero', cost: 0, type: 'Hero', - heropowerId: 115, classes: ['Druid'], rarity: 'Free', collectible: false, id: 5, + + heropowerId: 115, }; diff --git a/cards/StartingHeroes/Hunter/116-heropower.ts b/cards/StartingHeroes/Hunter/116-heropower.ts index 8f2aadd7..2768a22d 100644 --- a/cards/StartingHeroes/Hunter/116-heropower.ts +++ b/cards/StartingHeroes/Hunter/116-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Deal 2 damage to the enemy hero.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Hunter'], rarity: 'Free', collectible: false, id: 116, + spellSchool: 'None', + cast(plr, self) { // Deal 2 damage to the enemy hero. game.attack(2, plr.getOpponent()); diff --git a/cards/StartingHeroes/Hunter/6-hero.ts b/cards/StartingHeroes/Hunter/6-hero.ts index 1659d43c..183924ed 100644 --- a/cards/StartingHeroes/Hunter/6-hero.ts +++ b/cards/StartingHeroes/Hunter/6-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Hunter starting hero', cost: 0, type: 'Hero', - heropowerId: 116, classes: ['Hunter'], rarity: 'Free', collectible: false, id: 6, + + heropowerId: 116, }; diff --git a/cards/StartingHeroes/Mage/114-heropower.ts b/cards/StartingHeroes/Mage/114-heropower.ts index 58047255..ce8dd7ed 100644 --- a/cards/StartingHeroes/Mage/114-heropower.ts +++ b/cards/StartingHeroes/Mage/114-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Deal 1 damage.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Mage'], rarity: 'Free', collectible: false, id: 114, + spellSchool: 'None', + cast(plr, self) { // Deal 1 damage. diff --git a/cards/StartingHeroes/Mage/4-hero.ts b/cards/StartingHeroes/Mage/4-hero.ts index fe07208c..0157f303 100644 --- a/cards/StartingHeroes/Mage/4-hero.ts +++ b/cards/StartingHeroes/Mage/4-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Mage starting hero', cost: 0, type: 'Hero', - heropowerId: 114, classes: ['Mage'], rarity: 'Free', collectible: false, id: 4, + + heropowerId: 114, }; diff --git a/cards/StartingHeroes/Paladin/10-hero.ts b/cards/StartingHeroes/Paladin/10-hero.ts index 484562ad..9c2082e2 100644 --- a/cards/StartingHeroes/Paladin/10-hero.ts +++ b/cards/StartingHeroes/Paladin/10-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Paladin starting hero', cost: 0, type: 'Hero', - heropowerId: 120, classes: ['Paladin'], rarity: 'Free', collectible: false, id: 10, + + heropowerId: 120, }; diff --git a/cards/StartingHeroes/Paladin/120-heropower.ts b/cards/StartingHeroes/Paladin/120-heropower.ts index 8cf28aa7..82fdee46 100644 --- a/cards/StartingHeroes/Paladin/120-heropower.ts +++ b/cards/StartingHeroes/Paladin/120-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Summon a 1/1 Silver Hand Recruit.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Paladin'], rarity: 'Free', collectible: false, id: 120, + spellSchool: 'None', + cast(plr, self) { // Summon a 1/1 Silver Hand Recruit. diff --git a/cards/StartingHeroes/Priest/118-heropower.ts b/cards/StartingHeroes/Priest/118-heropower.ts index e0611f52..802c0ea7 100644 --- a/cards/StartingHeroes/Priest/118-heropower.ts +++ b/cards/StartingHeroes/Priest/118-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Restore 2 Health.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Priest'], rarity: 'Free', collectible: false, id: 118, + spellSchool: 'None', + cast(plr, self) { // Restore 2 Health. diff --git a/cards/StartingHeroes/Priest/8-hero.ts b/cards/StartingHeroes/Priest/8-hero.ts index 5ace6681..f2bf0c4c 100644 --- a/cards/StartingHeroes/Priest/8-hero.ts +++ b/cards/StartingHeroes/Priest/8-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Priest starting hero', cost: 0, type: 'Hero', - heropowerId: 118, classes: ['Priest'], rarity: 'Free', collectible: false, id: 8, + + heropowerId: 118, }; diff --git a/cards/StartingHeroes/Rogue/12-hero.ts b/cards/StartingHeroes/Rogue/12-hero.ts index cea7b57b..207f0620 100644 --- a/cards/StartingHeroes/Rogue/12-hero.ts +++ b/cards/StartingHeroes/Rogue/12-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Rogue starting hero', cost: 0, type: 'Hero', - heropowerId: 122, classes: ['Rogue'], rarity: 'Free', collectible: false, id: 12, + + heropowerId: 122, }; diff --git a/cards/StartingHeroes/Rogue/122-heropower.ts b/cards/StartingHeroes/Rogue/122-heropower.ts index b01af90a..48aee431 100644 --- a/cards/StartingHeroes/Rogue/122-heropower.ts +++ b/cards/StartingHeroes/Rogue/122-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Equip a 1/2 Dagger.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Rogue'], rarity: 'Free', collectible: false, id: 122, + spellSchool: 'None', + cast(plr, self) { // Equip a 1/2 Dagger. diff --git a/cards/StartingHeroes/Shaman/119-heropower.ts b/cards/StartingHeroes/Shaman/119-heropower.ts index 96892362..5b081fe6 100644 --- a/cards/StartingHeroes/Shaman/119-heropower.ts +++ b/cards/StartingHeroes/Shaman/119-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Summon a random basic Totem.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Shaman'], rarity: 'Free', collectible: false, id: 119, + spellSchool: 'None', + cast(plr, self) { // Filter away totem cards that is already on the player's side of the board. const filteredTotemCardNames = game.cardCollections.totems.filter(id => !game.board[plr.id].some(m => m.id === id)); diff --git a/cards/StartingHeroes/Shaman/9-hero.ts b/cards/StartingHeroes/Shaman/9-hero.ts index 4a50508a..58c22b7f 100644 --- a/cards/StartingHeroes/Shaman/9-hero.ts +++ b/cards/StartingHeroes/Shaman/9-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Shaman starting hero', cost: 0, type: 'Hero', - heropowerId: 119, classes: ['Shaman'], rarity: 'Free', collectible: false, id: 9, + + heropowerId: 119, }; diff --git a/cards/StartingHeroes/Warlock/11-hero.ts b/cards/StartingHeroes/Warlock/11-hero.ts index 811c6462..ebe1bf95 100644 --- a/cards/StartingHeroes/Warlock/11-hero.ts +++ b/cards/StartingHeroes/Warlock/11-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Warlock starting hero', cost: 0, type: 'Hero', - heropowerId: 121, classes: ['Warlock'], rarity: 'Free', collectible: false, id: 11, + + heropowerId: 121, }; diff --git a/cards/StartingHeroes/Warlock/121-heropower.ts b/cards/StartingHeroes/Warlock/121-heropower.ts index 6b7a5820..5787fc7a 100644 --- a/cards/StartingHeroes/Warlock/121-heropower.ts +++ b/cards/StartingHeroes/Warlock/121-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Draw a card and take 2 damage.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Warlock'], rarity: 'Free', collectible: false, id: 121, + spellSchool: 'None', + cast(plr, self) { // Draw a card and take 2 damage. diff --git a/cards/StartingHeroes/Warrior/117-heropower.ts b/cards/StartingHeroes/Warrior/117-heropower.ts index e3d54756..2c770283 100644 --- a/cards/StartingHeroes/Warrior/117-heropower.ts +++ b/cards/StartingHeroes/Warrior/117-heropower.ts @@ -8,12 +8,13 @@ export const blueprint: Blueprint = { text: 'Gain 2 Armor.', cost: 2, type: 'Spell', - spellSchool: 'None', classes: ['Warrior'], rarity: 'Free', collectible: false, id: 117, + spellSchool: 'None', + cast(plr, self) { // Gain 2 Armor. diff --git a/cards/StartingHeroes/Warrior/7-hero.ts b/cards/StartingHeroes/Warrior/7-hero.ts index 6d4bc8e4..431b52c5 100644 --- a/cards/StartingHeroes/Warrior/7-hero.ts +++ b/cards/StartingHeroes/Warrior/7-hero.ts @@ -7,9 +7,10 @@ export const blueprint: Blueprint = { text: 'Warrior starting hero', cost: 0, type: 'Hero', - heropowerId: 117, classes: ['Warrior'], rarity: 'Free', collectible: false, id: 7, + + heropowerId: 117, }; diff --git a/src/core/functions/color.ts b/src/core/functions/color.ts index 9c421582..44cb1321 100644 --- a/src/core/functions/color.ts +++ b/src/core/functions/color.ts @@ -216,8 +216,6 @@ export const colorFunctions = { const callback = chalk[tagFuncString as keyof ChalkInstance] as unknown; if (callback instanceof Function) { returnValue = (callback as (...text: any) => string)(returnValue); - } else { - throw new TypeError(`"${tag}" is not a valid color tag. "${tag}" results in 'chalk.${tagFuncString}' which is not a function.`); } return returnValue; diff --git a/src/types/card.ts b/src/types/card.ts index 37491c2c..cfadcbf7 100644 --- a/src/types/card.ts +++ b/src/types/card.ts @@ -194,23 +194,22 @@ export type Blueprint = { text: string; cost: number; type: CardType; + classes: CardClass[]; + rarity: CardRarity; + collectible: boolean; + id: number; // Type specific attack?: number; health?: number; tribe?: MinionTribe; + spellSchool?: SpellSchool; + durability?: number; cooldown?: number; - heropowerId?: number; - // Less important - classes: CardClass[]; - rarity: CardRarity; - - // Last - collectible?: boolean; - id: number; + heropowerId?: number; } & BlueprintAbilities; export type BlueprintWithOptional = Blueprint & { diff --git a/tools/cardcreator/custom.ts b/tools/cardcreator/custom.ts index c9a078b6..632998b2 100644 --- a/tools/cardcreator/custom.ts +++ b/tools/cardcreator/custom.ts @@ -42,11 +42,11 @@ function applyCard(_card: BlueprintWithOptional): Blueprint { cost: 0, classes: ['Neutral'], rarity: 'Free', - stats: [1, 1], + attack: 1, + health: 1, tribe: 'None', spellSchool: 'None', - hpText: 'CHANGE THIS', - hpCost: 2, + heropowerId: 0, durability: 2, cooldown: 2, }; @@ -104,9 +104,10 @@ function common(): BlueprintWithOptional { type, classes: [classes], rarity, - id: 0, runes, keywords: realKeywords, + collectible: true, + id: 0, }; } @@ -119,18 +120,10 @@ const cardTypeFunctions: { [x in CardType]: () => Blueprint } = { const tribe = input('Tribe: ') as MinionTribe; return applyCard({ - name: card.name, - text: card.text, - cost: card.cost, - type: card.type, + ...card, attack, health, tribe, - classes: card.classes, - rarity: card.rarity, - runes: card.runes, - keywords: card.keywords, - id: 0, }); }, @@ -140,16 +133,8 @@ const cardTypeFunctions: { [x in CardType]: () => Blueprint } = { const spellSchool = input('Spell School: ') as SpellSchool; return applyCard({ - name: card.name, - text: card.text, - cost: card.cost, - type: card.type, + ...card, spellSchool, - classes: card.classes, - rarity: card.rarity, - runes: card.runes, - keywords: card.keywords, - id: 0, }); }, @@ -160,17 +145,9 @@ const cardTypeFunctions: { [x in CardType]: () => Blueprint } = { const health = game.lodash.parseInt(input('Health: ')); return applyCard({ - name: card.name, - text: card.text, - cost: card.cost, - type: card.type, + ...card, attack, health, - classes: card.classes, - rarity: card.rarity, - runes: card.runes, - keywords: card.keywords, - id: 0, }); }, @@ -183,16 +160,8 @@ const cardTypeFunctions: { [x in CardType]: () => Blueprint } = { } return applyCard({ - name: card.name, - text: card.text, - cost: card.cost, - type: card.type, + ...card, heropowerId: lib.getLatestId(), - classes: card.classes, - rarity: card.rarity, - runes: card.runes, - keywords: card.keywords, - id: 0, }); }, @@ -203,17 +172,9 @@ const cardTypeFunctions: { [x in CardType]: () => Blueprint } = { const cooldown = game.lodash.parseInt(input('Cooldown (Default: 2): ')) ?? 2; return applyCard({ - name: card.name, - text: card.text, - cost: card.cost, - type: card.type, + ...card, durability, cooldown, - classes: card.classes, - rarity: card.rarity, - runes: card.runes, - keywords: card.keywords, - id: 0, }); }, diff --git a/tools/cardcreator/lib.ts b/tools/cardcreator/lib.ts index 50a8fd8f..448f20d7 100644 --- a/tools/cardcreator/lib.ts +++ b/tools/cardcreator/lib.ts @@ -194,7 +194,6 @@ ${runes}${keywords} // Get the latest card-id const id = getLatestId() + 1; - const fileId = `\n id: ${id},`; // Create a path to put the card in. let path = generateCardPath(card.classes, type).replaceAll('\\', '/'); @@ -249,7 +248,7 @@ ${runes}${keywords} const passiveImport = isPassive ? ', type EventValue' : ''; // Add the key/value pairs to the content - const contentArray = Object.entries(card).filter(c => c[0] !== 'id').map(c => `${c[0]}: ${getTypeValue(c[1])}`); + const contentArray = Object.entries(card).map(c => `${c[0]}: ${getTypeValue(c[1])},\n `); // Add the content const content = `// Created by the ${creatorType} Card Creator @@ -258,7 +257,7 @@ import assert from 'node:assert'; import { type Blueprint${passiveImport} } from '@Game/types.js'; export const blueprint: Blueprint = { - ${contentArray.join(',\n ')},${fileId}${createAbility}${ability} + ${contentArray.join('').replace(/ {4}id: .*?,/, ` id: ${id},\n`)}${createAbility}${ability} }; `; diff --git a/tools/cardcreator/vanilla.ts b/tools/cardcreator/vanilla.ts index c2b78c12..4bfbbf2a 100644 --- a/tools/cardcreator/vanilla.ts +++ b/tools/cardcreator/vanilla.ts @@ -5,7 +5,7 @@ import rl from 'readline-sync'; import { type Card as VanillaCard } from '@hearthstonejs/vanillatypes'; -import { type Blueprint, type CardClass, type CardRarity, type MinionTribe, type SpellSchool } from '../../src/types.js'; +import { type CardType, type Blueprint, type CardClass, type CardRarity, type MinionTribe, type SpellSchool } from '../../src/types.js'; import { createGame } from '../../src/internal.js'; import * as lib from './lib.js'; @@ -75,85 +75,59 @@ export function create(card: VanillaCard, debug: boolean, overrideType?: lib.CcT create(heroPower, debug); } - let blueprint: Blueprint; + let blueprint: Blueprint = { + name, + text, + cost, + type: type as CardType, + classes: [cardClass], + rarity, + collectible, + id: 0, + }; switch (type) { case 'Minion': { - blueprint = { - name, - text, - cost, - type, + blueprint = Object.assign(blueprint, { attack, health, // TODO: Add support for more than 1 tribe. #334 tribe: races[0] || 'None', - classes: [cardClass], - rarity, - id: 0, - }; + }); break; } case 'Spell': { - blueprint = { - name, - text, - cost, - type, + blueprint = Object.assign(blueprint, { spellSchool, - classes: [cardClass], - rarity, - id: 0, - }; + }); break; } case 'Weapon': { - blueprint = { - name, - text, - cost, - type, + blueprint = Object.assign(blueprint, { attack, health: durability, - classes: [cardClass], - rarity, - id: 0, - }; + }); break; } case 'Hero': { - blueprint = { - name, - text, - cost, - type, + blueprint = Object.assign(blueprint, { heropowerId: lib.getLatestId(), - classes: [cardClass], - rarity, - id: 0, - }; + }); break; } case 'Location': { - blueprint = { - name, - text, - cost, - type, + blueprint = Object.assign(blueprint, { durability: health, cooldown: 2, - classes: [cardClass], - rarity, - id: 0, - }; + }); break; } @@ -163,10 +137,6 @@ export function create(card: VanillaCard, debug: boolean, overrideType?: lib.CcT } } - if (!collectible) { - blueprint.collectible = false; - } - let cctype: lib.CcType = 'Vanilla'; if (overrideType) { cctype = overrideType;