Commit Graph

13 Commits

Author SHA1 Message Date
Waleed Hassan
c88dfba1d1 Server: Reorganize TypeScript globals (#5903) 2019-10-21 14:39:59 +10:30
Guangcong Luo
2adc80efe4
Improve egg validator (#5854)
Previously, we split gen 2-5 egg move validation into two phases,
`checkLearnset` where we searched for a valid father, and
`reconcileLearnset` where we made sure the father could learn the move
combination.

Egg move validation has now been completely moved out of these
functions and into `validateSource`, which calls `findEggMoveFathers`.

The new algorithm no longer requires `C` moves to be hardcoded into
`learnsets.js`, now doing a more thorough check validation for the
father's move combination. This should be slower than before, but
net performance should be massively improved due to two other
optimizations in this refactor:

- We no longer do any father-searching if the moveset can be obtained
  any other way - in particular, this means no more father validation
  in gen 6+ where all egg move combinations are legal anyway.

- We only check fully-evolved pokemon as fathers (because anything a
  prevo can learn, its evos can learn, too - yes, we remember to make
  exceptions for Salazzle, Combee, and future-gen evos)

In addition, `/learn` should now provide significantly better
information for egg move breeding, since it uses a more thorough check
instead of the validator's short-circuiting the moment it finds a valid
father.

This also improves some baby-only move validation, specifically fixing
the issue with Seismic Toss Charm Chansey.
2019-10-09 00:59:24 +11:00
Guangcong Luo
e1c364fb79 Refactor DNSBL -> IPTools
This is mostly a TypeScript refactor, but it does come with several
renames:

Dnsbl -> IPTools
Dnsbl.query -> IPTools.queryDnsbl
Dnsbl.reverse -> IPTools.getHost
2019-05-14 10:57:08 +10:00
Kirk Scheibelhut
3bc88f4851 Add Chat.html to ignore-pattern for long lines 2019-05-10 09:38:19 -07:00
Kirk Scheibelhut
6fea91ee56 Split dev-tools/globals* into sim and server (#5450) 2019-04-18 04:17:54 +09:30
Kirk Scheibelhut
e689913084
Unify dev-tools runners and convert to Typescript (#5441)
- Refactor dev-tools/harness.js and dev-tools/smokes.js to separate
  out the script/CLI code and implementation code into separate
  files.
- Rename 'smoke' to 'exhaustive' ('multi' mode can also be used
  for "smoke testing") to better describe its behavior.
- Rewrite the runners in Typescript for type safety.
- Refactor common build utilities into dev-tools/build.js and
  introduce the notion of a 'full' build analogous to 'full' tests.
2019-04-15 15:22:37 -07:00
Kirk Scheibelhut
a0cde60d17 Turn on more tslint checks (#5379) 2019-03-30 11:55:18 +08:00
Kirk Scheibelhut
c075cad379 Turn on no-for-in-array in tslint config (#5377) 2019-03-30 00:31:08 +08:00
Kirk Scheibelhut
c911ee6fa6 Move sim/battle-stream-example.ts to sim/examples subdir 2019-03-22 02:42:05 -05:00
Kirk Scheibelhut
2b1c278c42 Fix 'floating' promises and enable lint errors going forward (#5297) 2019-03-22 02:21:17 +09:00
Kirk Scheibelhut
0e1708bf9f Enable prefer-const and max 120 character lines for .ts files (#5292) 2019-03-16 07:14:04 +09:00
Kirk Scheibelhut
6e122d5d74 Refactor lib/ to be native Typescript (#5217) 2019-03-02 11:12:24 -06:00
Kirk Scheibelhut
b09fd63377 Refactor sim/ to be native Typescript (#5210) 2019-02-26 11:03:30 -06:00