User:Xinhuan/Advanced rulebook (rewrite)

The purpose of this page is:


 * Add the basic gameplay rules to the current Advanced rulebook as written by User:Patashu to make it more complete.
 * Rewrite the advanced mechanics into something more palatable to the non-technical audience. This involves using more plain English text in paragraph form and less point-form. The old version by User:Taohinton was the complete opposite where it was much too verbose and the examples often lacked video proof.

- Xinhuan

=Advanced Rulebook=

While most rules in Hearthstone are fairly easy to ascertain, when several effects, each with their own behaviours, are brought into conflict, things can get a little more complicated. The advanced rulebook offers a comprehensive explanation of the game's underlying processes, complete with examples and video references.

For information on the game's basic mechanics, see Gameplay, Minion, Abilities and Character.

If you are looking for a specific bug, see Bugs.

Foreword
Because the advanced rulebook is written to document findings about how Hearthstone works, rather than the other way around, any given patch of Hearthstone may cause the advanced rulebook to have out-of-date information; Blizzard doesn't release a full changelog of bug/mechanic changes with each patch, and changes are often unintended. If you notice that something in the advanced rulebook is incorrect, please record what actually happens (such as by using https://obsproject.com/ ), upload the footage to Youtube and post a link on the talk page. Your contributions are always appreciated!

If you want to discuss advanced mechanics of Hearthstone in real time, join #hearthsim on http://irc.freenode.net/, where many scientists, bug testers and simulator writers hang out.

Card Types
Minions vs Weapons vs Spells

Class vs Neutral
Class specific vs Neutral cards

Card Rarity
Card rarities.

Hero and Hero Power
Discuss the heroes, and their hero power.

Forming a deck
In Hearthstone, every game involves 2 players, each of which brings a deck of 30 cards for a single Class. A deck may contain up to 2 copies of every card with the same name, except for cards of Legendary rarity where the limit is 1 per deck. Additionally, a deck may not include cards from a different Class.

In the Arena, the deck construction rules above for card limits are ignored. In Adventure mode and game tutorials where the opponent is a Boss controlled by the AI, the player may be presented with a deck that he or she must use; these decks may ignore the standard deck construction rules in order to make the Boss battle more or less challenging for the player.

Starting a game
At the beginning of a game, the server shuffles both player's decks and randomly picks one of the players to be the starting player. The starting player draws 3 cards from his deck while the second player draws 4 cards from his deck. The two players each have 60 seconds to select any, none or all of these initial cards to replace. The selected cards (if any are selected) are set aside, new cards are drawn from the deck to replace the selected cards, and the cards that are set aside are shuffled back into the remaining deck. This ensures that players cannot draw back the same cards that they opt to replace from their starting hand. This entire process of replacing cards in the starting hand is called the Mulligan. Players can mulligan into the second copy of the "same card" in the deck, but not the original card that was set aside.

If the player does not make a choice during the Mulligan after 60 seconds, the game will assume the player does not replace any cards. Once the Mulligan is complete, the second player receives a bonus card called The Coin which is automatically added to his or her hand.

Both players start with a Hero at 30 Health and the objective of the game is to bring the opponent's hero down to 0 or fewer Health.

Turn sequence
Once the game setup is over, each player takes turns to play his or her cards until the conclusion of the game. The following lists the steps of each turn.


 * 1) Ready Step
 * 2) Start of Turn Step
 * 3) Main Step
 * 4) End of Turn Step
 * 5) Cleanup Step

Temporary Technical Notes:

MAIN_NEXT
 * Headcrack is returned to your hand if comboed
 * Frozen Champion re-freezes himself
 * NUM_TURNS_LEFT is set (something to do with whether you AFK'd your last turn or not?)
 * The active player is changed (CURRENT_PLAYER changed from 0 to 1, and 1 to 0 for the two players)
 * TURN_START is set (timestamp of when the turn started)
 * TURN_TIMER_SLUSH is set (amount of extra time in seconds the player has)
 * TIMEOUT is updated (if it has changed from the default turn length of 75)
 * Game's TURN is incremented by 1 (game ends when this number reaches 90)
 * Active Player's hero's attack value is set to a value equal to his weapon (if there is one) (todo: how does this interact with the Naxx boss card Worshipper?)
 * Non-active player's hero's attack value is set to 0

MAIN_READY
 * Active player's RESOURCES incremented by 1 (if not already at MAXRESOURCES (default 10))
 * Active player's RESOURCES_USED set to 0
 * Active player's secrets are all flipped shut (EXHAUSTED = 1)
 * Active player's minions and hero power are all marked non-exhausted (EXHAUSTED = 0) (todo: if your minions aren't marked non-exhausted following your turn, then how come faceless manipulator/mind control on an enemy minion with charge works? obviously EXHAUSTED = 1 gets set but where does it happen?)
 * Active player's weapon flips open (EXHAUSTED = 0)
 * Active player's COMBO_ACTIVE is reset to 0
 * Active player's NUM_CARDS_PLAYED_THIS_TURN is reset to 0
 * Active player's NUM_OPTIONS_PLAYED_THIS_TURN is reset to 0
 * Active player's NUM_CARDS_DRAWN_THIS_TURN is reset to 0
 * Active player's NUM_TURNS_IN_PLAY is incremented for everything the player owns
 * Both player's NUM_FRIENDLY_MINIONS_THAT_DIED_THIS_TURN is reset to 0

MAIN_START_TRIGGERS
 * Start of turn triggers (todo: including Nightmare and Corruption?)

MAIN_START
 * Active player draws a card (NUM_CARDS_DRAWN_THIS_TURN updated)
 * Both player's NUM_MINIONS_PLAYER_KILLED_THIS_TURN is reset to 0 (todo: what if it was flame leviathan?)
 * Game's NUM_MINIONS_KILLED_THIS_TURN is reset to 0

MAIN_ACTION
 * Active player may play a spell
 * Active player may play a weapon
 * Active player may play a minion
 * Active player may use Hero Power
 * Active player may Attack with a Character
 * Active player may End Turn
 * All actions above except End Turn is followed by another MAIN_ACTION step.

MAIN_END
 * End of turn triggers (including Shadow Madness wearing off, but seemingly not other enchantments wearing off)

MAIN_CLEANUP
 * Active player's secrets flip open (EXHAUSTED = 0)
 * Active player's weapons flip shut (EXHAUSTED = 1)
 * Both player's JUST_PLAYED is set to 0 for all the cards that are put in play this turn (probably related to the zzz's shown)
 * Entities created for enchantments that wear off at the end of a turn (such as Ice Block's effect, Bloodlust's effect, Conceal's effect, Lock and Load's effect ) wear off (seemingly outside of a Phase, so visually everything updates on different frames) (seemingly dominant player first then in order of play)
 * Freeze is removed

Ending a game
The game ends when there are one or more losing players. There are several ways for a player to lose the game.


 * That player's Hero has 0 or fewer life. This is true even if the Hero has 1 or more Armor, or is Immune (https://www.youtube.com/watch?v=rkkn7Fm4wvU).
 * That player's Hero is destroyed. Currently, the only way for this to happen is by using Sacrificial Pact on a Hero Lord Jaraxxus.
 * That player opts to concede the game via the Game Menu, this can occur at any point in the game.

There are several ways for the game to end in a draw.


 * If both players lose at the same time, the game is a draw. Both players will see the defeat screen, but neither player will gain/lose a star in Ranked Play, nor be credited with a win/loss in the Arena.
 * At the start of the 90th turn, the game ends in a draw. This means that Player 1 has 45 complete turns (Turn 1, 3, 5... 87, 89), while Player 2 has 44 complete turns (Turn 2, 4, 6... 86, 88). Turn 90 does not occur for Player 2, start of turn triggers do not occur and he does not draw a card. Both players' heroes will explode simultaneously followed by the defeat screen. This cannot be prevented by Mal'Ganis.
 * Both players disconnect from the game and fail to reconnect back within 60 seconds. At the next login, there will be a prompt that informs the players that their last game ended in a draw.

The game only checks for win/lose/draw at specific points in the game, this is further explored in [Link to Death Phases].

Areas of play
At any given time, every card is located in one of the following areas of play, or zones. Each player has their own set of zones.

Each zone handles cards differently when their size limit is reached.

Deck
The Deck refers to the remaining cards that are not yet drawn. Each player has his own Deck to Draw cards from. Whenever a player is required to Draw a card and there are no cards left in his deck, that player instead suffers Fatigue damage. The first time this happens, 1 Fatigue damage is taken. Fatigue damage increases by 1 each time Fatigue damage is taken, so the next time that player is required to draw a card, 2 damage is taken, and then 3 and so on. Fatigue damage does not reset even if cards are later added to the Deck to make it non-empty. Fatigue damage is tracked separately for each player.

The Deck cannot be inspected by either player. Only the number of cards remaining in each player's Deck is public and can be viewed by moving the mouse (or holding a finger) over the Deck.

When cards are added to the Deck (by Malorne, Recycle or Gang Up), each card is inserted at a random position. The Deck has a maximum size of 60 cards. No cards are added to the Deck if an effect attempts to add more cards beyond the limit.

Hand
The Hand is where each player keeps the cards currently available to them. During a player's turn, he may play cards from his hand if he has sufficient remaining mana. The Hand cannot be viewed by the opponent player. The number of cards in each player's hand is public. A player can quickly count how many cards an opponent is holding in his Hand by moving the mouse (or holding a finger) over the opponent's Hand. When cards are added to the Hand, they are always added on the far right. Cards in the Hand cannot be reordered by the players. An observant player can keep track of cards in the opponent's hand such as the Turn number each card was added to his Hand.

The Hand has a maximum size of 10 cards. When the limit is reached, trying to add more cards to the Hand is handled differently depending on the originating zone of the card.


 * From Deck
 * When a card is drawn normally from the Deck by a Card draw effect while your Hand is full, that card is destroyed instead and visually burns up on the screen. The burnt card is revealed to both players. The history sidebar does not keep an entry for cards that are burnt this way. The same applies for Put into hand effects (Captain's Parrot and Sense Demons); if the selected Pirate and Demon(s) have no space to go in the Hand from the Deck, they are burnt instead. If a card is burnt in this manner, that card will not trigger any On-draw effects (Burrowing Mine and Flame Leviathan) because the card is not successfully drawn.


 * From Battlefield
 * If a Return effect tries to return a minion from the Battlefield to a player's Hand while his Hand is full (for example by Sap), that minion is destroyed instead. Any consequences such as Deathrattles and death-related triggered effects will take place as if the minion had died normally.


 * From nowhere (generated cards)
 * When an effect attempts to add a newly generated card to your hand via a Generate effect while your hand is full, that effect has no effect and is wasted. Examples of such effects include Duplicate and Thoughtsteal.

Battlefield
The Battlefield describes the area where cards enter play and are considered active. There can be up to 7 Minions, 5 Secrets and 1 Weapon in play per player. The game disallows players from playing Minion cards while they have 7 minions in play. The game also disallows players from playing Secret cards while they have 5 Secrets in play. However, a player can still play Weapon cards even if he already has a weapon in play. When this happens, the older weapon is destroyed (and its Deathrattle is run if any) and the new Weapon replaces it. Secrets have an additional restriction - no player may have more than 1 copy of any Secret in play. The game disallows players from playing a Secret if that same Secret is already in play.

The Battlefield is completely public to both players except for Secrets in play. Secrets may only be inspected by the player controlling it and is analogous to a "face down card" that is in play. The number of Secrets in play is public information.

When an effect tries to summon or put into play more Minions or Secrets while a player already has 7 Minions or 5 Secrets, that effect has no effect and is wasted. Mad Scientist is currently the only exception that can circumvent the 5 Secret restriction and is considered a bug.

When an effect tries to take control of an enemy Minion or Secret while the player already has 7 Minions or 5 Secrets, that Minion or Secret is instead destroyed. The Deathrattle on a Minion destroyed this way runs as though it is still controlled by the enemy. For Secrets, the stolen Secret is also destroyed if a copy of the same Secret it is already in play.

Graveyard
The Graveyard contains all the cards that have been played, destroyed or discarded. While no card explicitly refers to the Graveyard by name, some spells and abilities interact with minions in the Graveyard, specifically Resurrect and Kel'Thuzad.

The Graveyard currently cannot be inspected by either player. This feature was removed in early closed alpha along with cards that mentioned the Graveyard. The skull icons next to each player's Deck indicates where the Graveyard used to be in the game's battlefields.

Basic Game Mechanics
To discuss each game mechanic quickly. Taunt, Stealth, Immune, Spell Damage, Deathrattle, Counter, etc. There are 20+ of them.

To discuss the significance of the words "Play" vs "Summon".

Rest of Advanced Rulebook (to be edited in slowly)
This will start with explaining Sequences, Phases, Queues, Resolution, Death Phases.