Commit Graph

127 Commits

Author SHA1 Message Date
Guangcong Luo
8495dafe69 Make tools.js stand alone
tools.js no longer needs sugar and a toId definition included externally,
which should make using it in scripts a lot easier, as well as cut
down the repeated toId definitions in every PS process.
2015-12-24 02:55:52 -06:00
Guangcong Luo
cb83bf93c9 Fix level-up move breeding in team validator 2015-12-18 19:31:39 -05:00
The Immortal
4798edf931 STABmons: Add new bans 2015-12-15 02:29:02 +04:00
The Immortal
9d99142dd8 Update team validation error messages
- There’s no need to check for validation or report set problems if the
Pokemon is banned from the format.
- Improve the error message for event only hidden abilities.
2015-12-14 21:16:53 +04:00
The Immortal
1d7c356947 STABmons: Ban Belly Drum and Shell Smash 2015-12-13 03:28:17 +04:00
The Immortal
30a18d76e9 Fix event only Pokemon check 2015-12-13 01:34:37 +04:00
The Immortal
e35bcbbbc5 Prevent legendaries with less than 3 perfect IVs
Fixes #1342. The one in rulesets is the general check, and the one in
team-validator is the event check. I don’t think we can combine it into
a single check; duplication is needed.
2015-12-13 01:34:37 +04:00
The Immortal
147872d92c Implement event only Pokemon
This adds an `eventOnly` flag for Pokemon that can only be obtained via
an event. It also adds an `eventOnlyHidden` flag for Pokemon whose
hidden ability can only be obtained via an event. This removes the need
for the `dreamWorldPokeball` flag, and those events are added.

If a Pokemon can only be obtained via event, the team validator checks
if any of its events matches its current set.
2015-12-12 05:03:07 +04:00
The Immortal
58f013cc11 Update STABmons
It’s reverting back to its old rules.
2015-12-11 03:03:41 +04:00
Guangcong Luo
52698143de Small team validation update
- Fix the bug with self-breeding validation
- Rearrange and comment better
2015-11-25 20:13:00 -05:00
Guangcong Luo
27d19b4a98 Fix crash in team validation 2015-11-24 23:54:48 -05:00
Guangcong Luo
998c5d7e7e Refactor checkLearnset to alleviate indentation hell
checkLearnset has some ridiculous indentation; this commit alleviates
it, mostly by aggressively using early returns (well, early continues
in this case).
2015-11-24 10:00:37 -05:00
Guangcong Luo
1fc85dce48 Remove es6-shim dependency
We no longer support versions of Node so old they don't have the
level of ES6 support we used es6-shim for.
2015-11-07 22:51:44 -06:00
Juanma Serrano
c4ac8d6e2f Use strict mode and let and const instead of var
This commit also fixes some duplicated variable declarations.
2015-11-06 21:56:52 -05:00
Juanma Serrano
edb3e784f5 Fix Gen 2 Egg move validation crash
To put it simply, it was trying to check future Pokémon for egg moves in gen 2.
Since this condition is only checked in gen 2, the entry with which you are checking the move must be gen 2 as well.
2015-11-04 01:10:18 +01:00
Ivo Julca
7cefd67626 Reject illegal non-shiny sets rather than fixing
Closes #2197
2015-10-20 16:49:09 -05:00
Ivo Julca
488a54b5c2 Formats now declare their team length requirements as teamLength
E.g., to enforce players to bring teams with 4-6 Pokémon to Team Preview,
and make them choose 2 of them there to battle with:

```
teamLength: {
  validate: [4, 6],
  battle: 2
}
```
2015-10-19 15:44:09 -05:00
Guangcong Luo
dbe9a0ad74 Add more information to validator crashes 2015-10-01 18:09:30 -04:00
The Immortal
25491fdcdf Add new OMs of the Month 2015-10-01 22:21:03 +04:00
Ivo Julca
8cbfea7f69 Crashlogger: include whether the process had an uncaught exception in emails
This is relevant information as some crashes may only happen after some other crash
has created inconsistent state either in PS itself or in Node.js internals.
2015-09-10 22:41:53 -05:00
Ivo Julca
407be53178 Add a noSketch flag to unsketchable moves across gens 2015-09-09 22:32:49 -05:00
Ivo Julca
b267b0a6b5 Sketchmons: implement Move Clause
The hacks intensify
2015-09-09 22:01:14 -05:00
Guangcong Luo
5d5bb6b28a Better ability existence validation 2015-09-06 14:09:50 -04:00
Ivo Julca
4d025898cd Require ability and move existence in Custom Game 2015-09-05 20:24:26 -05:00
The Immortal
6c56ab8126 Sketchmons: Remove unnecessary check
It already checks if the move is unreleased right above this.
2015-09-03 16:11:49 +04:00
The Immortal
5613076d9f Sketchmons: Ban Gothitelle and fix validator 2015-09-03 02:52:46 +04:00
The Immortal
a79ce12710 Add new OMs of the Month 2015-09-01 20:31:45 +04:00
Ivo Julca
2797f8927d Update STABmons to new ruleset 2015-08-20 20:12:29 -05:00
Ivo Julca
1a5ce74794 Support formats' overriding validateTeam and validateSet 2015-08-20 17:25:05 -05:00
Ivo Julca
85d92a58f4 Rename validateSet|Team and changeSet: prefix with "on" 2015-08-20 17:24:26 -05:00
Guangcong Luo
77b6b66639 Refactor mega stone banning
The mega forme can now be banned/tiered separately. The old-style mega
stone bans are still supported, but megas can now also be tiered,
even below their base forme.
2015-08-20 02:59:15 -04:00
Ivo Julca
14af193c91 Fix Pokémon data corruption in old gens
Ensure that mods are loaded before any `Tools.getTemplate` call.
2015-08-09 07:17:41 -05:00
Ivo Julca
6800e497d9 Refactor Tools to support partial load 2015-08-06 00:58:36 -05:00
The Immortal
77d2cec157 STABmons: Fix 079e167 2015-07-28 16:34:31 +04:00
Ivo Julca
079e167fd8 STABmons: allow Hoopa to inherit from Hoopa-U 2015-07-27 21:52:46 -05:00
Ivo Julca
ed0f8ed614 Fix mutation of Shaymin typing in STABmons set validation 2015-07-26 01:32:37 -05:00
The Immortal
9981743363 Fix event Pokemon bug in validateSet
Any Pokemon with only one Ability in Gen 3 can get the new Gen 4 one by
evolving. Such as, Extreme Speed Zigzagoon has Pickup only in Gen 3 but
its evolution, Linoone, can have either Pickup or Gluttony in Gen 4 or
higher.
2015-07-19 23:07:49 +04:00
Guangcong Luo
caddeb6ac4 Baton Pass Clause update
We now ban boosting both Speed and non-Speed with Baton Pass.
To make this simpler, we introduce changeSet as separate from
validateSet, which allows us to pass setHas to validateSet
2015-07-13 04:18:28 -04:00
Ivo Julca
9cec432a99 Fix toId on numbers 2015-07-07 12:06:23 -05:00
Ivo Julca
e92bb1b07f Rename globals toName|toString to Tools.[getName|getString] 2015-07-06 00:34:44 -05:00
Guangcong Luo
aa2dad529d Add crash guard to team validator
Team validator crashes no longer stop battles from being created
until the next restart.

In theory, at least.
2015-06-23 23:14:58 -04:00
Ivo Julca
f18eef39ca Fix Travis build 2015-06-12 03:41:22 -05:00
Joimer
5409b3b99b Avoid team validator crash
Until I find the team that is causing this, I cannot do more.
2015-06-05 19:21:00 +02:00
Guangcong Luo
de9c3847fd Nicknames are not subject to namefilter 2015-05-27 14:40:07 -04:00
Joimer
4f2ee6a749 Gen 2: Fix crash in team validator 2015-05-25 00:33:58 +02:00
Juanma Serrano
d3ec7c55cc Gen 2: Fix problem in learnset check with Sketch 2015-05-22 11:04:58 +02:00
Ivo Julca
db4eec3e2a Fix support for Node 0.12
Update the detection of legacy engines, as Node 0.12 has native Map support enabled by default
2015-05-21 18:10:56 -05:00
Ivo Julca
723f4b5a4b Fix support for Node 0.10-0.12
Some child processes now use ES6 methods, so we got to make sure they are available with `es6-shim`
2015-05-21 01:07:08 -05:00
SolarisFox
29b961ff69 Style fix: indexOf() comparisons 2015-05-18 15:55:57 -07:00
Juanma Serrano
c3a28abc61 Gen 2: Proper chain breeding learnset check
This is quite complex.
In gen 2, the egg moves pass through father and species through mother.
Therefore, we must check that:
1. Two egg moves come from the same father or are learned in another way.
2. If two egg moves come from the same father, check if the father can learn those two as well.
Also, we must keep track of the state of egg and machine moves in the learnset in order to properly reject them when the problem is found.

Related commits: 17e8515486 and 33cc1e09eb
2015-05-13 16:45:23 +02:00