Skip to content

Commit

Permalink
refactor: make the blueprint format more consistant
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarTides committed Dec 4, 2023
1 parent 50a8948 commit 444192b
Show file tree
Hide file tree
Showing 137 changed files with 470 additions and 383 deletions.
7 changes: 4 additions & 3 deletions cards/1-sheep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
3 changes: 2 additions & 1 deletion cards/2-the-coin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
7 changes: 4 additions & 3 deletions cards/3-plant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
7 changes: 4 additions & 3 deletions cards/85-jade-golem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const blueprint: Blueprint = {
text: '<b>Battlecry:</b> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const blueprint: Blueprint = {
text: '<b>Dredge</b>. 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const blueprint: Blueprint = {
text: '<b>Choose One -</b> Summon a <b>Jade Golem</b>; 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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const blueprint: Blueprint = {
text: '<b>Discover</b> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const blueprint: Blueprint = {
text: '<b>Choose One -</b> 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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const blueprint: Blueprint = {
text: '<b>Choose Twice -</b> 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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const blueprint: Blueprint = {
text: 'Gain 6 Armor. <b>Recruit</b> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const blueprint: Blueprint = {
text: '<b>Choose One</b> - Summon a 6/6 Orca with <b>Taunt</b>; or six 1/1 Otters with <b>Rush</b>.',
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 <b>Taunt</b>', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export const blueprint: Blueprint = {
text: 'Fill your board with 2/1 Whelps with <b>Rush</b>.',
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);
Expand Down
7 changes: 4 additions & 3 deletions cards/Classes/Druid/Uncollectible/Minions/1-Cost/83-treant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
7 changes: 4 additions & 3 deletions cards/Classes/Druid/Uncollectible/Minions/1-Cost/95-otter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ export const blueprint: Blueprint = {
text: '<b>Rush</b>',
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');
Expand Down
7 changes: 4 additions & 3 deletions cards/Classes/Druid/Uncollectible/Minions/6-Cost/96-orca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ export const blueprint: Blueprint = {
text: '<b>Taunt</b>',
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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ export const blueprint: Blueprint = {
text: '<b>Choose One -</b> 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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ export const blueprint: Blueprint = {
text: 'Choose a character. Cast 4 random spells <i>(targeting it if possible)</i>.',
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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ export const blueprint: Blueprint = {
text: '<b>Battlecry:</b> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ export const blueprint: Blueprint = {
text: '<b>Battlecry:</b> Cast a random spell for each spell you\'ve cast this game <i>(targets chosen randomly)</i>.',
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;
Expand Down
Loading

0 comments on commit 444192b

Please sign in to comment.