Quoting the old CtP thread...
Originally Posted by Fat NixHex
To be considered a counter
, a Pokemon must be able to switch into any of the opponent's moves under normal battle conditions*, including taking damage from Stealth Rock, and reliably KO the opponent before the counter is KOed itself. (props to Woodchuck)
-To be considered a check
, a Pokemon must be able to switch into at least one but not all of the opponent's moves under normal battle conditions, including taking damage from Stealth Rock, and reliably KO the opponent before the check is KOed itself.
*Normal Battle Conditions consist of the following:
- Stealth Rock is up on the counter's (your) side of the field.
- Stealth Rock is not up on the featured Pokemon's (opponent's) side of the field.
- The weather is handled as follows:
- If no weather is listed, the weather is assumed to be clear skies unless the counter has the ability Sand Stream, Snow Warning, Drizzle, or Drought.
- If the Pokemon to be countered can change the weather when a counter with a weather-changing ability comes in, the weather is situational and should be analyzed as such. For example, if the featured Pokemon is Drought Ninetales with Sunny Day and you list Politoed as your counter, you should evaluate the situation with two possiblities, rain or sun.
The definition of normal battle conditions is indeed arbitrary, but it seems reasonable to assume Stealth Rock is in play. For the weather issue, well it was explicitly stated in the CtP thread, but you'll need a different way to handle it here - for example by observing if weather is up or not in the actual battle. However I don't want to go too much into detail, since minor issues can be fixed later when you actually implement the algorithm; however I think that NixHex's definition is accurate enough to be utilized in such a setting.
However, there are some extreme cases in which the definition of counter can be less strict. Let me do a basic example: Offensive Heatran is indeed a counter to Specially Defensive Heatran, since it can smack it with Earth Power while taking literally nothing from the opponent. However, since SpD Heatran can take an Earth Power and Roar out the opposition, NixHex's definition is not clear on this case, since none of the two is actually KOed. So, a possible extension is that if a poke can deal heavy damage to the opposition without being crippled significantly in return, or being set-up on in some way, it is indeed a counter to that poke, even if it actually fails to KO it. FOr many (almost all) other cases, that definition should work. If there's some other case that's left out, we can discuss it here.
Hope it helped.