Zarel/Pokemon-Showdown — pull request #262 by Jay2645 (2013-07-02 07:46:48+00:00)
Title: Tweaked statuses/ability generation/team generation

Lots of stuff in this one, feel free to use older commits if you'd like. Listing what was changed in each commit:

1. There was a case where Fire Blast and Lava Plume were legal together, even though they are fairly similar moves and both have a chance to burn.
2. Slightly adjusted rules governing conflicting statuses -- Toxic and Spore are now illegal together, for example. The case Toxic and Will-o-Wisp has a 50% chance to be rejected because some Pokemon like to run both in order to hit Steel-types.
3. The `randomSet` function can now take an optional `team` parameter consisting of an array of Pokemon on that team. This is used to determine if any other Pokemon on the team is a weather inducer, which affects the moves and abilities allowed to be used.
* Also in the above commit: things like `contraryMove` are no longer hardcoded, but instead determined at runtime: a move is considered a valid Contrary move, for example, when it drops stats, but does not raise any. Hopefully that'll ever-so-slightly ease the transition to Gen VI.
4. Small correction to the above commit.
5. The team generation now additionally looks for weaknesses to any one particular type. This was inspired after getting 2 Flying-types and 2 Water-types. Now, it *tries* to limit the number of Pokemon which are weak to any one type. How strict it is about removing Pokemon is determined by `if (typeWeaknesses[t] > i)`, where i is the maximum number of Pokemon that are allowed to be weak to that type. Typically, 0 is too strict and 2 rejects only the worst cases. It's currently set to 1; feel free to adjust it as you see fit.
6. The weakness generation used to avoid weather inducers; this made it so the weather inducers were no longer exempt.
7. There was a minor bug from a commit from the other day where the `types` array wasn't being sorted before the unique type combinations were logged; `Water/Flying` and `Flying/Water` were considered to be unique type combinations.
8. This commit was largely overwritten by the commit directly afterward.
9. Adjusted the ability generation to be more dependent on the moves a Pokemon has and -- to an extent -- its teammates. Abilities are now assigned a score similar to the one in `abilities.js`, only this score is based on the Pokemon's set.
* For example, a Pokemon with Chlorophyll will have a high score assigned to that ability if one of its teammates has Drought or Sunny Day, but a low score if it does not. A Pokemon with Poison Touch would have their score determined by how many contact moves they have -- if it's only 1 and they have another ability they can use better, they'll likely get the other ability.
* In the event that two scores are the same, there's a 50% chance of choosing either.