I want create a lite-version of Hearthstone in Javascript. Rules:
1) Each player starts the game with 30 Health and 0 Mana slots.
2) Each player starts with a deck of 20 Damage cards with the following Mana costs: 0,0,1,1,2,2,2,3,3,3,3,4,4,4,5,5,6,6,7,8
3) From the deck each player receives 3 random cards has his initial hand.
4) One player is randomly chosen to be the starting active player. The other player draws a 4th card from his deck to compensate him for not playing the first turn.
5) The active player receives 1 Mana slot up to a maximum of 10 total slots.
6) The active player’s empty Mana slots are refilled.
7) The active player draws a random card from his deck.
8) The active player can play as many cards as he can afford. Any played card empties Mana slots and deals immediate damage to the opponent player equal to its Mana cost.
9) If the opponent player’s Health drops to or below zero the active player wins the game.
10) If the active player can’t (by either having no cards left in his hand or lacking sufficient Mana to pay for any hand card) or simply doesn’t want to play another card, the opponent player becomes active.
11) If a player’s card deck is empty before the game is over he receives 1 damage instead of drawing a card when it’s his turn.
12) If a player draws a card that lets his hand size become >5 that card is discarded instead of being put into his hand.
13) Let players choose to play cards either as immediate damage Attacks (same as cards generally worked in the Basic Gameplay rules) or as Minions that are put on the board instead. Minions will use the mana cost of their card as Health and Damage value. Playing a 0 card will create a minion with 1 Health and 0 Damage.
14) Health has to be tracked when they receive damage.
15) Each player can have a maximum of 3 Minions on the board at any given time.
16) A Minion will sleep in the turn it was put on the board.
17) In any subsequent turn each Minion can be used once to deal damage to the opponent player or an opponent Minion.
18) A Minion fighting another Minion will result in them dealing their damage value to each other simultaneously.
19) Sleeping Minions will defend themselves in the same way when attacked by another Minion.
20) Players can choose to play an Attack against a Minion. The attacked Minion will not defend itself in this case, thus the attacking player receives no damage from it.
21) When a Minions health drops to or below zero it is removed from the board.
supplement code using there rules