Commit Graph

147 Commits

Author SHA1 Message Date
Joimer
1b0895f231 Tools: Add Gen 6 automatic categorisation
In order to allow current Gen 6 OMs and ease the process, add the
numbering for gen 6.
2013-08-19 11:46:50 +02:00
Guangcong Luo
708cc3ae0b Formats overhaul
Formats are now stored by default in config/formats.js
2013-08-18 14:55:14 -07:00
Guangcong Luo
3e15406a39 canUseRandomTeam is now implied for randbat formats 2013-08-18 14:27:36 -07:00
小太
f2f973fe29 Obliterate trailing whitespace 2013-08-18 21:33:15 +10:00
Guangcong Luo
2e1ab04eb6 Workaround for Smeargle learnset checker
To do: Properly fix Sketch checking
2013-08-16 22:37:29 -07:00
Joimer
3f686d7d51 Implement STABmons using a Tools hack
Due to how validateSet and scopes work, STABmons needs either this 2 line hack or to copy basically all moveset check to formats, duplicating code, for it to work.
2013-08-01 13:56:35 +02:00
Guangcong Luo
c9a6d5d809 Crashes written to the console now specify crash type 2013-07-26 13:45:50 -07:00
Guangcong Luo
562d1edbba Refactor: Data is no longer a global
It can still be accessed with Tools.data or Tools.mod(mod).data
2013-07-14 11:37:01 -07:00
Marty-D
e870e6e3f6 Clarify the event restriction messages. 2013-06-13 15:45:53 -04:00
Cathy J. Fitzpatrick
a67f412729 Fix accidental global clause 2013-06-11 15:49:27 -06:00
Guangcong Luo
27be062395 Tons of documentation 2013-05-24 14:59:29 -07:00
Guangcong Luo
8c8cb9e58a Better error messages for invalid team data 2013-05-20 17:04:35 -07:00
Guangcong Luo
d4079844d1 Ability checking fixes
- Gen 1-2 work with no ability set.
- Not having a listed ability gives a readable error message now.
2013-05-14 15:31:59 -07:00
Guangcong Luo
82312d55f4 Make sure custom games don't accidentally set level 1000 2013-05-11 20:46:15 -07:00
Guangcong Luo
9ee457cad9 Fix toName sanitization 2013-05-04 17:58:17 -07:00
Cathy J. Fitzpatrick
d69bde3fa0 Fix bug in EV validation
Using a specially crafted `evs` array of the form

    set.evs = [255, 255, ..., "a"]

a user could have used a pokemon with 255 EVs in every stat, because the
expression '...a' > 510 evaluates to false.
2013-05-04 03:57:46 -06:00
Guangcong Luo
7ec8044b9c Fix crash when using Gen 1 Amnesia Psyduck/Golduck 2013-05-01 16:37:13 -07:00
Guangcong Luo
01fd92c404 Fix crash when starting a battle 2013-04-27 20:58:23 -07:00
Guangcong Luo
b263daeea0 Lazily copy data for mods, rather than eagerly 2013-04-27 11:21:25 -07:00
Guangcong Luo
68fd57131c Memory optimisation in Tools data
During initialisation of Tools, each new mod no longer makes a copy
of every data object from the parent mod. Instead, a new object is
created when and only when the mod actually makes changes to a
particular object. In other words, this is a "copy-on-write" system.
2013-04-27 04:50:37 -07:00
Joim
61590b201e Add item generation
Add an automatic way to decide the generation an item comes from.
The items have been numbered the same way in the generations 3, 4, and 5. Generation 2 items need to specify its gen in its item.js specifically.
2013-04-25 20:14:10 +03:00
Cathy J. Fitzpatrick
5854da2c62 Move crash logging to new file: crashlogger.js 2013-04-25 00:14:36 -06:00
Cathy J. Fitzpatrick
387b7974f3 Revisions to crash logging
- crash logging is now handled by `Tools.logCrash`
- simulator processes now send crash emails as well
- emails are now rate limited to 1 email per 5 minutes per process
2013-04-24 23:53:47 -06:00
Guangcong Luo
34b2b937c9 Learnset checker support breeding DW with past gens
The learnset checker now allows DW mons to be bred with a mon of the
same species moved from a past generation.

Specifically, this supports DW Sableye with Sucker Punch and Recover
is now supported.
2013-04-07 14:46:19 -07:00
Marty-D
f016041a73 Give 'moves' with no priority a default of 0. 2013-03-16 23:07:53 -04:00
Guangcong Luo
738804c1f9 Refactor gen 1
This is simple stuff to bring it in line with PS's coding style.

Mod-specific rules are getting moved to mods/gen1/formats.js and
formats are condensed into one Custom Game format.
2013-03-08 08:59:17 -08:00
Joimer
0441a929c8 Allow an Illegal check without abilities.
Add callback for getStat.
2013-03-06 12:53:27 +01:00
Guangcong Luo
3bf7e226d7 Make sure custom games default to level 100
this way, even if it allows higher levels, the default won't be
higher than 100
2013-03-04 18:08:30 -08:00
Cathy J. Fitzpatrick
5bee686bb2 Refactor Battle to use prototypes 2013-02-26 22:49:10 -07:00
Bill Meltsner
dc355cd734 Prevent Smeargle from having Chatter or Struggle in its moveset, as neither can be Sketched. 2013-02-20 22:45:34 -08:00
Guangcong Luo
37b0cc44e3 Fix Tools-modifying Scripts
Specifically, this fixes init scripts as well as command-line random team
generation
2013-02-20 12:54:53 -08:00
Guangcong Luo
d5c8ac1d88 Fix more chainbreeding learnset check bugs
- Level-up moves can always be chainbred
2013-02-19 20:12:29 -08:00
Guangcong Luo
c77afcbe85 Scripts can now override the Battle prototype
(well, pseudo-prototype, I've yet to refactor Battle to actually use
prototypes)
2013-02-18 23:44:39 -08:00
Cathy J. Fitzpatrick
5f78f746c9 Better error messages in tools.js 2013-02-18 17:26:55 -07:00
Guangcong Luo
b39ff77883 Support for config/formats.js 2013-02-18 11:33:05 -08:00
Guangcong Luo
618868b50c Better error messages for the learnset checker 2013-02-17 13:22:32 -08:00
Guangcong Luo
72ffbc0359 Really fix level forcing 2013-02-17 01:08:38 -08:00
Guangcong Luo
abde83ddae Fix validation bug with maxLevel
(affects LC)
2013-02-17 00:15:58 -08:00
Guangcong Luo
2ef0a42b9d Learnset checker is more forgiving for VGC
- if you bring a level 50 pokemon to VGC, it'll be treated as level 100
  for the purposes of checking level-up moves
- we introduce a new flag 'maxForcedLevel' for this
2013-02-16 21:34:30 -08:00
Guangcong Luo
2e6926f22f Genderless pokemon can't pass egg moves
(Fix learnset checker suggesting otherwise
2013-02-15 19:31:20 -08:00
Cathy J. Fitzpatrick
2518f779f3 Remove buggy debug string 2013-02-14 23:58:12 -07:00
Cathy J. Fitzpatrick
a51b66b5e7 Fix debug message for overriding Battle properties 2013-02-14 13:34:43 -07:00
Cathy J. Fitzpatrick
0fdb3fdec9 Allow BattleScripts to override properties of Battle
This allows functions defined as properties of `BattleScripts`
(i.e. in scripts.js) to override properties of a `Battle` object.
2013-02-14 13:26:52 -07:00
Cathy J. Fitzpatrick
6506f492f9 Add better error message when mod file fails to load 2013-02-14 12:30:20 -07:00
Guangcong Luo
0dfc2c9b23 More learnset checking for egg moves
- instead of a free pass, level-up moves from a level higher than the
  current level is checked as an egg move
(other ways of learning a level-up move are still available)
2013-02-12 20:30:28 -08:00
Guangcong Luo
08eee348ae Learnset checker: LC fixes
- pokemon can only learn level-up moves before their current level
  if they can breed
- gen 3 pomeg glitch implemented
- gen 3 pomeg glitch (and any other gen 3 trick) disallowed for gen 4
  abilities on pokemon that haven't evolved
2013-02-12 20:16:08 -08:00
Guangcong Luo
b67454743b Hidden Power fix:
- Random battles and automatic detection sets Hidden Power IVs correctly
- Hidden Power now always does damage based on user's IVs
- User's Hidden Power base power is now reported
2013-01-24 15:03:04 -08:00
TheImmortal
f70ce8b12c Fix LC bug with DW moves
- No LC Pokemon can legally use its moves that are exclusively obtained from the Dream World

In other words, the Pokemon has to be above level 10 with it's DW ability + DW exclusive move
2013-01-15 01:51:34 +04:00
TheImmortal
65e0cebf6f Set level before set is validated- maxLevel for LC 2013-01-11 14:03:52 +04:00
Guangcong Luo
39c33e409c Fix the learnset checker to handle chainbreeding better
Specifically, Spikes + Sleep Powder Roserade is no longer legal
Also add more comments to checkLearnset
2013-01-11 01:42:47 -08:00