Thorough answers to common questions on rules and interactions
When does a "turn" begin and end?
A turn has 4 phases: Ready, Upkeep, Main, and Draw/Discard. Turns begin with the Ready phase and ends after the Draw/Discard phase. Each turn consists of only one player's actions. Player 1's turns are the 1st, 3rd, 5th, 7th, etc. of the game, and Player 2's turns are numbers 2,4,6,8, etc. Anything referencing "one turn" or "end of turn" is only one player's turn.
This ability says to do something to a unit, can I use it on my hero?
In Codex, Heroes are not units, and units are not heroes. If a spell or ability says it affects "units", that means it only affects units and not heroes. Similarly, if it says it affects "heroes", that means it only affects heroes and not units. If it affects "units or heroes", then it can affect either.
This is a pretty easy thing to misremember or skim over when you are reading a card. In fact, there's a running joke that instead of Codex: Card Time Strategy, the game should be called Codex: Heroes Aren't Units. Make sure to read your (and your opponent's) cards carefully to avoid getting tripped up!
When exactly do I tech cards from my Codex to my discard pile?
Just after your opponent's turn ends, and before your next turn begins. For example, if you start a new game the first cards you tech from your Codex will go into your discard pile right before you start your second turn. This means that anything that affects your draw/discard piles during your opponent's turn will happen before you tech cards in.
The most common situation where this comes up is when you have a patroller in the Technician slot and no cards in your draw pile. If your opponent kills your Technician, you will reshuffle your discard pile into your draw pile and your discard will be empty before you can tech your cards. Keep an eye on this, because it will affect how long it takes for you to draw the cards you teched.
To save time and make the game go faster, you should start thinking about what you want to tech while your opponent is taking their turn. Your plans usually won't change too much based on your opponent's turn anyways.
When do I get patrol zone bonuses?
Your units are only in the patrol zone during your opponent's turn. Putting units and heroes in the patrol zone is the act that ends your main phase, and the first thing that happens when your next turn starts is your units and heroes come back out of the patrol zone. This means you can't do things like attack during your turn with an Elite patroller for +1 attack. You might physically move the cards out of the patrol zone when your turn starts to help you remember.
How do Flying and Anti-Air work?
Flying works differently in Codex then in other card games (like Magic). It's more similar to a real time strategy game like Starcraft. The rulings sheet gives a pretty thorough explanation (look for Flying and Anti-Air under the general tab). Here are some examples that should help clarify the rules.
Attacking with a flying unit
In all cases, assume the defender has patrollers in the Squad Leader, Scavenger, and Lookout slots.
If none of the patrollers or other units/heroes has flying or anti-air
Your flyer can attack anything. It can attack the Squad Leader, fly over the Squad Leader to attack the Scavenger or Lookout, or fly over the entire patrol zone and attack any attackable thing behind the patrol zone. Your flyer deals its damage to its target, and takes no combat damage back. Flyers can only take damage from other flyers or from ground units with anti-air.
If the Squad Leader has flying, but none of their other units or heroes have flying or anti-air
Your flyer can only attack the Squad Leader. Since it's flying, it can "block your path", so you have to attack it first like any Squad Leader. Your unit and the Squad Leader each deal combat damage to each other.
If the Lookout has flying, but none of their other units or heroes have flying or anti-air
Your flyer can either attack the Squad Leader, or fly over it to attack the Scavenger or the Lookout. If you attack the Squad Leader or Scavenger, your flyer deals combat damage but does not take any in return. If it attacks the flying Lookout, both your flyer and the Lookout take damage. Your flyer can't attack anything behind the patrol zone, because the flying Lookout "blocks its path".
If the Lookout has flying, and the Squad Leader has anti-air
As in the previous situation, your flyer can either attack the Squad Leader, or fly over it to attack the Scavenger or the Lookout. If your flyer attacks the Squad Leader, they each deal damage to each other - the Squad Leader is able to hit back because it has anti-air. If your flyer flies over the Squad Leader to attack the Scavenger or Lookout, combat damage is dealt the same as above (the flying Lookout hits back but the grounded Scavenger can't), except that the Squad Leader also deals its attack as combat damage to the flyer. Imagine the Squad Leader shooting at the flyer as it flies overhead. Anti-air damage is dealt simultaneously with all other combat damage. Again your flyer can't attack anything behind the patrol zone, because the flying Lookout "blocks its path".
If the Squad Leader, Scavenger, and Lookout all have anti-air, and the defender also has an anti-air unit not patrolling
As in the first example, your flyer can attack anything (there are no flying units to block its path). It can attack the Squad Leader, fly over the Squad Leader to attack the Scavenger or Lookout, or fly over the entire patrol zone and attack any attackable thing behind the patrol zone. However, it will take anti-air damage from each of the patrollers it flies over. If it flies over the Squad Lead to attack the Scavenger or Lookout, it takes anti-air damage from the Squad Lead (but not from the other patroller it didn't attack - you don't have to fly over the Scavenger to hit the Lookout or vice versa). If you fly over the entire patrol zone to hit the defender's base, you take anti-air damage from all 3 patrollers.
Note that your flyer will never take damage from the non-patrolling anti-air unit unless you attack it directly. That anti-air unit wasn't patrolling, so your flyer never needs to fly over it on its way to attacking something else.
Attacking with a non-flying unit or hero
Assume the defender has patrollers in the Squad Lead and Technician slots
If your unit does not have anti-air, and their Squad Leader has flying
Your attacker must attack their Technician. Normally it would have to target the Squad Lead, but because the Squad Lead has flying your attacker can't attack it and has to attack other patrollers instead. In this case, that's the Technician. Imagine it just runs underneath the flying patroller. Note that if all of the defender's patrollers had flying, your attacker could run underneath all of them to attack something behind the patrol zone. Note also that flyers don't deal any damage to attackers that "run under" them.
If your unit does have anti-air, and their Squad Leader has flying.
Your attacker may attack either the flying Squad Leader or the Technician. Because it has anti-air, it can attack the flying Squad Lead, in which case they each deal their combat damage to each other. Or, it can decide to run underneath the flying Squad Lead and attack the Technician instead. Having anti-air is never a disadvantage - there is no situation where having anti-air forces you to attack something that you wouldn't have to attack otherwise.
Flying combined with other combat abilities
thanks @zhavier for suggesting this section
If you attack with a Patriot Gryphon (Flying, Unstoppable by units with 2 ATK or less, Resist 2). The defender has an Oversized Rhinoceros (7/8) in Squad Lead and a Fox Primus (2/2 with Anti-Air) in Technician.
Your flyer can attach the Squad Lead Rhino, fly over the Squad Lead to attack the Technician Primus, or fly over the Squad Lead and then use the Unstoppable ability to get past the Technician to attack anything behind the patrol zone.
If your Gryphon attacks the Rhino it won't take damage in return. If your Gryphon attacks the Fox Primus, the Primus will deal anti-air damage back. However, if your Gryphon attacks something behind the patrol zone, the Primus will not deal anti-air damage to it. Anti-air allows patrollers to deal damage to attackers that "fly over" it, but "Flying over" means that you had to use the Flying ability specifically to avoid the patroller. In this case, your Gryphon can use its Unstoppable ability to bypass the Primus instead of flying over it. Note that it can do this even though it used Flying to avoid the Rhino - it can use multiple abilities in the course of a single attack. The same principle applies with other combat abilities that allow you to bypass patrollers, such as Invisible, Stealth, or a patroller with Unattackable.
If you attack with a Void Star (5/4, Flying, Overpower). The defender has a non-flying unit without anti-air in Squad Lead, a Flying unit in Technician, and a non-flying unit with anti-air not patrolling. Each of their units has 2 HP and no damage.
The Void Star can attack either the Squad Lead, or fly over the Squad Lead to attack the flying Technician. You can't attack anything behind the patrol zone because the flying Technician blocks your path. If you attack the Squad Lead, the 3 overpower damage must be dealt to the Technician. Overpower damage must be dealt to another thing you "could have attacked", and because the Technician has flying it blocks your path to other targets. If you attacked the Technician instead, you could choose to deal the 3 overpower damage to the Squad Lead, the non-patrolling unit, or something else like a base or tech building. Any of those are things you "could have attacked" once the flying patroller was eliminated. Note that if you choose to deal the overpower damage to something with anti-air, you do not take anti-air damage back. That's part of the general rule that things hit by Overpower damage don't get to hit back.
If you attack with a Pirate Gunship (Flying, Haste, Long Range, Obliterate 2, Resist 2). The defender has a Fox Primus (2/2 with Anti-Air) in Squad Lead, a Skeleton Token in Technician (1/1) and Skeletal Archery in play, which gives Skeletons Anti-Air and Long Range. The defender also has two 0/1 Wisp tokens not patrolling.
The first thing that happens when the Gunship attacks is the Wisp tokens get destroyed by Obliterate. The Gunship can attack the Squad Lead Primus, fly over the Primus to attack the Skeleton Token, or fly over both to attack something behind the patrol zone.
If the Gunship attacks Primus, Primus does not deal damage to it - ordinarily it can hit flyers because of Anti-Air, but in this case it can't because of long range. If the Gunship flies over Primus to attack the Skeleton Token, the Skeleton Token does deal damage to it, because the Skeleton has both anti-air and long range. Fox Primus does deal anti-air damage as the Gunship flies over, (long range only matters for the target being directly attacked). And finally, if the Gunship flies over both patrollers to hit something else, both patrollers deal Anti-Air damage to it as it flies over.
For additional details on situations with multiple combat abilities in play, please read the next section
How does combat work when there are multiple abilities at play, like Overpower and Swift Strike? What happens when?
This very thorough answer was originally written by @sharpobject in February 2016, with some additions by me
Attacking works like this.
First, you say what you are attacking with and what you are attacking. You have to pick a legal target, so unless you have "flying" or "unstoppable" or "unstoppable by X" or "unstoppable while X" or blah blah, you have to choose patrollers if you can attack them.
If your attacker does not have Readiness, you exhaust your attacker. Your "Attacks: do stuff" triggers happen, including Cinderblast Dragon's free fire spell and Trojan Duck's obliterate. Any triggers that happen as a result of those also happen (like if you killed your opponent's scavenger or Blackhand Dozer) until there's nothing left to do.
When you're done with that stuff, if your attack target is no longer valid (probably because you just killed it!) and there are valid attack targets available, you MUST pick a new one.
Then, if you have an attack target, the attacker and defender deal combat damage to each other.
At this point, you have your unit or hero. And you have the enemy unit or hero or building that you are attacking. And if you have flying, you might also have the enemy patrollers with anti-air that you are flying over (A flier flies over an anti-air patroller if that patroller would have prevented the flyer from attacking the defender, if the patroller had flying.) And maybe the defender has a tower, that will do damage too. Damage dealt by towers is combat damage.
If any of that stuff has swift strike, swift strike damage happens first. If the enemy has a tower and the attacker has swift strike, the tower deals 1 damage to the attacker at the same time as swift strike damage. If the attacker has sparkshot and swift strike, sparkshot happens at the same time as swift strike damage. Sparkshot damage is combat damage. If the attacker has swift strike and overpower, the overpower damage will be dealt simultaneously with swift strike damage.
If some stuff involved in the combat doesn't have swift strike, and it's still alive*, it also gets to deal damage. This proceeds in the same way as the swift strike damage did, so you can pretty much skip this paragraph now. If the enemy has a tower and the attacker does NOT have swift strike, the tower deals 1 damage to the attacker at the same time as normal combat damage. If the attacker has sparkshot and not swift strike, sparkshot damage happens at the same time as normal combat damage (and is combat damage). If the attacker has overpower, the overpower damage will be dealt simultaneously with normal combat damage.
*stuff with Indestructible is still alive. If the swift strike damage was otherwise enough to kill the Indestructible thing, it exhausts has all damage tokens removed and loses any attachments when the swift strike damage is dealt. It still gets to deal its combat damage back afterwards, with its new post-attachment stats.
It's possible for a unit to have swift strike when swift strike damage happens, then NOT have swift strike when the other combat damage happens. In this case the thing does not get to hit a second time. Come on now. The tower will also hit the attacker only one per combat.
There are a bunch of other combat abilities or situations that will affect whether things get to hit each other but don't create any timing questions, so I didn't mention those.
What happens when multiple things are triggered simultaneously? In what order are they resolved?
Sometimes, when board states get complicated, a single action can trigger multiple other events, which may themselves trigger further events, and so on. In many cases it won't matter in what order you resolve these multiple events (the outcome will be the same either way), but in some cases it does. In those cases, the rules to resolve the events are as follows:
- Things are resolved in the order they are triggered. Think of them as going in a queue
- When multiple actions are triggered simultaneously, they go in the queue at the same time. The active player decides in what order to resolve them, but they really did happen at the same time
- If resolving one action triggers other actions, those actions are added to the queue in the order they were triggered
- In every case, you must resolve an action fully (along with any other actions it triggers) before you can take another action. You can't interrupt in the middle of the queue to play a spell, attack with a unit, build a worker, etc.
To spell out what this means, suppose one action (call it A) causes two abilities to trigger, call them ability B and ability C. B and C go "into the queue" simultaneously (they were both triggered by the same action), and the active player decides which one to resolve first. Say that resolving B causes another ability D to trigger. D then goes "into the queue", but it won't get resolved until after C, since C happened first. The order of resolution will be A --> B --> C --> D. If the active player had decided to resolve C first, it would have been A--> C --> B --> D.
Now make the situation even more complicated, and suppose that resolving C will trigger yet another ability E. If the active player resolves B first, D will get added to the queue. Then C will be resolved and E will get added to the queue. The final order of resolution will be A --> B --> C --> D --> E. If instead the active player chose to resolve C first, the order would be A --> C --> B --> E --> D. E will get resolved before D in this case, because it got added to the queue first.
Here are a few examples that should make this more concrete
Example 1: Your Lvl 2 Zane kills an opposing hero in the scavenger slot. Zane levels up to 4 as a result of this. Do you get a gold from Zane's midband ability?
Answer: No. Zane's midband reads "whenever Zane kills a scavenger, gain 1". At the moment that Zane killed the Scavenger, he was still Lvl 2 and therefore the ability didn't trigger. As a result of combat, Zane leveled up to 4, but that didn't happen until after combat was resolved.
Example 2: You have no units in play, and your opponent has 2x Captured Bugblatter and 8 Frog tokens. You play a Judgment Day. How much damage does your base take? (credit to @sharpobject for the original example)
Answer: 20 damage. Judgment Day kills all 10 units simultaneously, so each Bugblatter has its ability trigger 10 times. All 20 instances of "a unit dies and Bugblatter deals 1 damage to your base" are added to the queue simultaneously. As the active player you can decide in what order to take your 20 damage, but that's it. You can't choose to have the Bugblatters die first so they can't trigger when the frogs die, because all of them really did die at the same time.
Example 3: You have a Reteller of Truths along with 3 other illusions in play. You play Judgment Day. Can you decide which 2 illusions you return to your hand? (credit to @lettucemode for the original example)
Answer: Yes. Just as in the previous example, all of the units die simultaneously. 4 instances of the Retellers ability trigger simultaneously ("The first two times each turn one of your non-token Illusion units dies (including this one), return it to its owner's hand."). As the active player, you can decide the order in which to resolve those 4 abilities. Because of the way the ability is written, the first and second work but the 3rd and 4th fizzle because you no longer meet the criteria. Note that if your opponent was the active player and played the Judgment Day, they would decide the order in which to resolve the Reteller abilities and therefore which illusions returned to your hand.
What happens when multiple effects change the stats of a card? (attack/HP/abilities/etc.)
This answer originally written by @EricF
To determine the attributes (attack, defense, abilities, card types (eg illusion), and tech level) of a unit or hero, follow this ordering. Note that none of this applies to calculating Armor.
Start with the values actually printed on the card.
1a. If the unit is a token, start with the values as defined by the spell or ability that created it (this should match what is printed on the official tokens)
1b. If the unit was created as a Dancer token and has been "flipped over" its printed stats are 2 ATK, 1 DEF, Unstoppable, Neutral Tech 0 Token Unit.
1c. For a Hero, only the ATK and DEF values appropriate to their current level are considered to exist. Only the abilities at their current level or earlier levels exist.
If a Chaos Mirror, Polymorph: Squirrel, or a "copy" effect apply to the unit or hero, apply each instance of them in the order they were played.
2a. Being a Token or not can not be copied
2b. If the original was under the effects of Chaos Mirror and/or Polymorph Squirrel at the time of the copy effect, the printed attributes of the copy are considered to be the modified stats of the original
2c. Each effect overwrites the previous, where applicable
2d. Chaos Mirror creates two separate effect: Set the ATK of unit/hero #1 to be X, and set the ATK of unit/hero #2 to be Y; X and Y are the printed ATK (as modified by prior Step 2 effects) of #2 and #1, respectively.
Apply any effect that set attack and defense to specific values (ie Faerie Dragon)
Apply any effects that say a unit or hero "gains" or "has" an ability, if they are not dependent on the ATK or HP of that unit or hero.
4a. Being in the Scavenger, Technician, or Lookout patrol slot does not grant an ability
Apply bonuses or penalties to ATK or HP (from runes, cards in play, and resolved spells)
5a. The order doesn't matter
5b. Doubling Barbarian modifies this step for positive modifiers only
If ATK or HP is negative after all effects are applied, treat it as 0.
6a. Pestering Haunt re-sets its ATK to at most 1
Apply any effects that say a unit or hero with particular Attack or HP stats "gains" or "has" an ability
7a. Bluecoat Musketeer gains long-range if it has 1 ATK
7b. Behind the Ferns gives Stealth to anything with 3 ATK or less
After applying all the above steps, if a unit or hero has damage markers equal or greater than its HP, it is destroyed.
If a unit or hero exists in play with 0 HP and no damage markers on it, and destroying it does not change the game state at all, then leave it as is. This can happen to Indestructible units, or a Gilded Glaxx.
Key results of the above implementation:
If you level up a hero who is under the effects of a Chaos Mirror, neither unit/hero affected by Chaos Mirror will have its attack changed.
If you Chaos Mirror a Polymorphed unit and another unit, you swap 1 ATK with the other unit's attack
If you Polymorph something, it starts getting the bonus from Midori's Mid-band.
If you copy or Chaos Mirror something with a Feather Rune, you get the underlying stats, and the Faerie Dragon overwrites the effects if you use it on a copy or Polymorph target, regardless of the order of application.
Faerie Dragon always applies before Runes or other boosts, regardless of the order they were played in.