Commit Graph

31 Commits

Author SHA1 Message Date
Ivo Julca
7fd8283600 Introduce requiredItems as an alternative to requiredItem
The list of acceptable items can always be retrieved from `requiredItems`.
2016-11-19 15:44:57 -05:00
Ivo Julca
00ced09ba3 Revert 4aaa3cb 2016-11-19 15:44:56 -05:00
Ivo Julca
4aaa3cb260 Move .templateRequiredItem to array everywhere 2016-11-19 15:23:42 -05:00
Marty-D
83acbc578d Add preliminary Gen 7 changes 2016-11-17 11:06:12 -06:00
Taylor Everding
1a1f64fe95 Remove .js extension from requires (#2725) 2016-08-30 00:04:40 -05:00
The Immortal
d1c510bdd3 Gen 5: Update Random Battle
- Fix Missingno
- Remove no longer needed Spiky-eared Pichu check
2016-05-16 18:12:50 +04:00
The Immortal
f1624cd83e Gen 5 Random Battle: Fix Air Balloon
And moved the speed manipulation to the bottom.
2016-03-08 23:00:11 +04:00
Guangcong Luo
b665660608 Refactor for more ES6 features
Now that nodejs/node#3072 is mostly fixed, we can finally start using
Node 4+ features.

This refactor:

- uses arrow functions where appropriate

  Note that arrow functions still aren't used in Mocha, where `this`
  is sometimes meaningful.

  This also removes the need for .bind() nearly everywhere, as well
  as the `self = this` trick.

- refactors Validator and Connection into ES6 classes

- no longer uses Array#forEach for iterating arrays

  We strongly prefer for (let i = 0; i < arr.length; i++) because of
  performance reasons. Most forEaches have been replaced with for..of,
  though, which is 5x slower than the long-form loop but 2x faster
  than forEach, which is good enough outside of most inner loops.

  The only exception is tournaments, which is due for a more invasive
  refactor soon anyway.
2016-02-10 17:40:21 -06:00
Guangcong Luo
8a8838552d Improve crashlogger
Crashlogger now supports passing in a dictionary of additional
information to report, so we no longer need to resort to making fake
errors.

The hadException parameter has now been removed entirely. I don't know
of a use case for it to be false.
2016-02-04 03:04:05 -06:00
Konrad Borowski
81f602b8d8 Always use trailing comma for multiline objects 2016-01-01 00:20:07 +01:00
The Immortal
9b1fd7ade9 Gen 5 Random Battle: Fix Plasmanta being allowed 2015-12-18 03:49:04 +04:00
The Immortal
437f99d80e Gen 5: Update Random Battle
Copied the gen 6 script updates, and some of the relevant Random Battle
improvements. Enabled the format for tournaments.
2015-12-18 03:23:30 +04:00
Ivo Julca
88c9902ebe Remove unused variables in old-gen random set builders
- Gen 2: `isSetup` is not even assigned a value.
- Gen 5: unmaintained.
2015-12-03 19:55:19 -05:00
Guangcong Luo
ded9f1cd5d Fix duplicate cases in random set generators 2015-11-07 23:12:19 -06:00
Ivo Julca
2c2a3bdf58 Fix misplaced cases in random sets generators 2015-11-07 16:50:51 -05: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
Ivo Julca
6d189221c0 Make BW random team builder fully deterministic
This was supposed to be done in baadd0a, but somehow most Math.random() calls remained unnoticed.
2015-07-16 12:36:05 -05:00
Ivo Julca
baadd0a92f Overhaul old-gen random team builders
Mainly follow-up for 1deedc595, but also fixes a few bugs.
- BW/GSC/RBY - randomSet: fixed and renamed slot argument.
- BW - randomTeam: crashlogger relative path was set incorrectly.
- BW - randomTeam: PotD Magikarp and Delibird used outdated randomBattleMoves data format.
- RBY - randomTeam: builder was too reject-happy regarding weaknesses (counters prematurely updated).

An improvement of 130% more op/s is observed for RBY randomCCTeam,
with no significative performance regression for randomTeam in any gen.
2015-07-16 12:03:14 -05:00
The Immortal
ca31b6edc5 Remove isPunchAttack property 2015-03-20 01:51:55 +04:00
The Immortal
db24264fae Change Lightningrod to Lightning Rod
It has been changed in ORAS.
2014-10-16 15:15:15 +04:00
小太
fe37f3b6a7 Apply jscs to the data files as well 2014-09-30 18:34:16 +10:00
Ivo Julca
b4ec88610f Properly load banlist tables for modded formats
They are no longer loaded in Tools.getFormat, which could be called from any modded tools and cached the bans.
2014-08-24 22:24:09 -05:00
Guangcong Luo
ac7f1d22b4 viableMoves are now randomBattleMoves
randomBattleMoves is now an array, and has been renamed from
viableMoves since it no longer is used for anything other than
random battles.

This commit also does some cleanup of some code relating to
random battle moves, including fixing gen 1's randomSet function,
which apparently has never worked.
2014-08-13 17:03:21 -04:00
Guangcong Luo
af2026436a More style fixes and Gulpfile updates
JSHint is now a fair bit stricter, and is now correctly checking
files in `mods/`.

The code has been fixed to match the new stricter standards.

JSHint has now caught its second actual bug: Gen 5 Pinap Berry
was Ice instead of Grass.
2014-08-10 20:43:53 -04:00
小太
5c8fc7b982 Space after function for anonymous functions 2014-04-22 01:58:16 +10:00
小太
6fb3bc332a Spaces around operators and === instead of == 2014-04-22 01:56:11 +10:00
Slayer95
75559362b4 Rename global config to Config 2014-04-17 01:12:28 -04:00
Slayer95
e419e7595a Declare ´damagingid´ and ´damagingType´ in randbats builder 2014-04-16 22:00:42 -05:00
Slayer95
5cb7093a55 Add Gen 5 randbats generator
According to scripts.js state in 71b357194b
2014-03-04 15:50:20 -05:00
Guangcong Luo
7b0a747fb2 More efficient learnset checking 2013-11-03 22:27:03 -08:00
Joimer
c2eefe12b9 Gen 5: Add init script
The init script will set the battle generation to 5 and delete mod the
Learnsets so no moves from gen 6 are used.
2013-10-11 09:59:27 +02:00