Commit Graph

94 Commits

Author SHA1 Message Date
Waleed Hassan
7e37e510c6
Fix tools/set-import/index.js (#9865)
The `package.json` links to `build/` in various properties even though
all of those files are in the same flat directory and not in `build/`
2023-10-30 12:59:33 -05:00
Christopher Monsanto
383cc9de50 Set importer: Update for VGC2023 Regulation E 2023-10-28 00:29:11 -04:00
adrivrie
4045bd9658
Set Importer: Fix CAP Pokemon gens (#9683) 2023-07-27 01:13:11 -04:00
Leonard Craft III
bd27563a02 Fix build 2023-06-10 11:54:53 -05:00
Christopher Monsanto
92d6ef2e5a tools/set-import: Add national dex monotype 2023-06-08 21:40:13 -04:00
TomOfTomKat
19b64d4d60
Set Importer: Add Almost Any Ability (#9588) 2023-06-06 11:47:16 -06:00
Christopher Monsanto
afdd70d1f9 tools/set-import: Fix BSS 2023-04-21 09:06:17 -04:00
Christopher Monsanto
4e1b6976d3 build-utils: Add hack for logs and databases directories 2023-01-01 17:21:57 -05:00
Waleed Hassan
7d0c9fa753
Set import: Support tera types (#9267) 2022-12-31 22:24:09 -05:00
Christopher Monsanto
7a3882d3ad set-import: Fix import 2022-12-31 01:17:07 -05:00
Alexander B
e921c2b2b7
Build: Generate sourcemaps (#9228) 2022-12-29 18:41:15 -08:00
Mia
977caedf8e Build: Don't hardcode directories 2022-12-28 17:31:21 -06:00
Mia
f3065b888f Compile translations 2022-12-28 17:01:04 -06:00
Mia
2a666429cd Build: Use fs properly 2022-12-28 16:45:20 -06:00
Waleed Hassan
4b975d74a1
Set import: Update for Gen 9 (#9215) 2022-12-27 05:07:45 -05:00
Mia
d9f3aee70d Fix typo 2022-12-25 16:53:59 -06:00
Mia
bb1d405d01 Build: Use fs if command-line tools aren't available
This is meant for Windows users that don't have UNIX commands set up. I'm retaining support for compiling using command-line tools since that is consistently 4 seconds or less, whereas fs is frequently slower. That speed is desireable, especially on sim3, so it's worth the extra code.
2022-12-25 16:53:02 -06:00
Mia
1758101dfd Remove leftover console.log 2022-12-23 16:04:41 -06:00
Mia
522b156276 Ensure build works on Windows
Grep apparently is not installed by default, so this adds a rough approximation.
2022-12-23 15:49:32 -06:00
Mia
b11177d530
Migrate to esbuild for compilation (#9203) 2022-12-22 15:19:29 -06:00
Annika
06ad1838b4 Add [Gen 9] Computer-Generated Teams 2022-12-14 17:46:20 -08:00
ACakeWearingAHat
686a020e2c
Implement Gen 9 Random Battle (#9169)
* Move gen 8 rands code to gen8 folder

* Add test data file

* Remove hidden power from random-teams

* Remove BDSP

* Remove item selection for now

* Remove ability culling for now

* Remove move culling for now

* Obtain allowed pokemon from random-sets.json

* Add tera blast counter

* linting

* Remove Dynamax from random-teams

* Remove unnecessary check

* Add role and tera type + fix data format

* remove gmax

* Disable tier for now

* movePool should have move ids not names

* linting

* Add required moves

* Create an individual function for moveset generation

* Return moves early if <= 4 moves available

* Add counter for individual STABS, including tera

* Tera Blast is tera stab

* Add some moves (help with testing)

* Remove culling moves from moveset

* Add new hazard removing moves

* Test STAB and recovery moves

* Cull movepool each time a move is added

* Black Sludge only if tera type is Poison

* teratype and role to functions

* Test some 'High Priority' items

* Move ability selection to its own function

* Fix ability sorting/selection

* No need to go through the move adding process if number of moves in set + movepool is 4

* lint

* Remove some pokemon that aren't in gen 9 randbats

* Tera STAB example

* Allow for forcing abilities

* Silvally not in gen 9

* Move level calculation to getLevel

* Tier-based levelling and doubles coverage

* Sitrus Berry default item for doubles

* Avoid hard-coding for species frequency

* Linting + replace hail with snow

* Change a comment slightly

* Fix STAB moves: need to check that they do damage

* minor thing

* Comment out tera type requirement

* comments

* Add gen 9 randbats format

* STAB counter

* Remove setupType

* Add cullMutlaExclusive()

* Remove unnecessary functions

* Move CC/HC to the bottom

* Allow movesA and movesB to be overlapping

* Initialization of fill-out

* linting

* Setup moveEnforcementCheckers

* Type/STAB counter only updates for moves that aren't in noSTAB

* Account for type changing abilities earlier

* STAB enforcement

* Setup moves array

* linting

* Revert Setup change

* More fillout

* move tweaks

* Tera STAB enforcement

* Remove rest from recovery moves

* Enforce setup

* Add Facade if Guts

* Misc enforced moves

* Enforce more moves

* Enforce STAB priority

* Setup forced on tera blast user

* check if there are moves of the desired kind before sampling

* move tweaks

* Need to check if setupMoves is empty

* fix brute bonnet

* fix scream tail

* Finish up move incompatibilities

* fix scream tail harder

* Formatting

* Fix some things

* End culling early if movepool gets too small

* Paired moves: end culling early if movepool gets too small

* Remove 'stop cull' for testing purposes

* If 2/4 moves are filled, remove single unpaired move

* Remove now unnecessary hardcodes

* Use MovePairs instead of hardcoding pairs

* addMove function for adding moves to moveset

* Move updates

* Extra check is unnecessary, moves and movePool should never have moves in common

* Mach Punch required on Breloom

* lint

* Remove Synthesis from Brute Bonnet (5 enforced moves)

* adjust oranguru tera types

* finish up moves

* Force abilities

* Update my favorite pokemon

* linting

* Add shouldCullAbility

* fix setup counter

* Move sorting abilities below hardcoding

* minor change

* Add fields

* fix sawsbuck typo

* Improve the species generation + remove Basculegion and Houndstone as possible leads

* Fix Species frequency

* Linting

* veluza can actually run sharpness

* code all ability rejections

* Update random-sets.json

* EVs/IVs tinkering change

* fix capitalization error

* Perform small fixes

* fix moves that don't exist

* linting

* Magnezone hardcode

* Items

* Update random-teams.ts

* linting

* prep for leveling

* long list for ditto

* comment out a line of text

* finish individualizing levels and also melop sucks

* add lokix thing

* revavroom

* updates from testing

* komala probably shouldn't have dark as an option

* tropius fix

* intim mence is ok

* kleavor should not get sheer force

* why did we give hydre earth power lmao

* why did we put leech seed on toed

* forgot to sitrusify cheek pouch mons

* fix enamorus

* Syntax error

* Change Zoroark lastmon condition to level >= 72

* Fix Zoroark-level constraint to allow for level forcing

* Fix singles vs doubles definition

* Use species.id as much as possible for set generation

* updates from testing

* allow flash fire heatran

* additional sash parameters

* reject stakeout if the user has zero attacks

* fixes

* update pawmot abilities

* Change iron fist counter to a number

* Force Own Tempo on Petal Dance Lilligant

* Add T-wave to SD groudon set

* Slush Rush guaranteed with Snowscape + possible if team has snow

* Rework ability sorting: find list of non-culled abilities before sorting and selecting

* Move S/V rands to The Forefront

* fix regidrago

* Small fix to choosing allowed abilities

* update aliases

* Update Arcanines

* Change from forEach to for, since index is no longer being used

* first impression is bug stab now

* set updates from the randscord

* Update /randbats to gen 9

* Add Tera Type to /randbats output

* things to do with steel

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Move Battle Factory and BSS Factory to mods/gen8 folder

* Remove gen8 factory sets test

* Copy over random-sets.json when building

* add missing heatran-based incompatibility

* fix sableye not always getting Recover

* set updates

* start movin' cap 1v1

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* finish movin' cap 1v1

* Update random-battles.ts

* Update random-teams.ts

* Update random-teams.ts

Co-authored-by: livid washed <liuc.kelvin9901@hotmail.com>
Co-authored-by: livid washed <115855253+livid-washed@users.noreply.github.com>
Co-authored-by: Alexander B <4866817+MathyFurret@users.noreply.github.com>
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2022-12-13 17:56:29 -07:00
Annika
2f9af1ac36 Build: Include Battle Factory sets 2022-09-18 12:21:14 -07:00
Christopher Monsanto
08b8980daf set-import: Add pure hackmons 2022-07-29 23:39:11 -04:00
Mia
01ae28ce67 Fix Sucrase build script
We forgot to tell it to build TSX, so it's been failing to build & instead erroring out.
2021-11-13 12:33:19 -06:00
Guangcong Luo
57554dc283 Stop using fs.exists
`fs.exists` should in practice be replaced with try-catch (since the
latter isn't susceptible to race conditions).
2021-10-09 15:53:30 -04:00
Mr. Sableye
86c4de6513
Fix TypeScript declaration file generation (#8477) 2021-10-07 23:04:14 -07:00
Annika
055a01ab89 Modlog: Minor fixes from smogtours conversion 2021-09-06 17:54:30 -04:00
Mia
7811795344
Handle new TypeScript version (#8449)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-08-30 20:11:44 -07:00
Annika
633e061067 Modlog: Remove text logging code 2021-08-09 14:06:14 -07:00
Annika
bcbe100c41
Modlog: Use SQLite for searches (#8004) 2021-07-23 13:47:49 -07:00
Annika
74295cf506 Modlog Converter: Improve modernization
This now reaches 99.9% success rate on logs from January 2018-May 2021, and 94.6% success on logs from November 2014-May 2021. (Assuming one defines "success" as "modernizing the modlog entry without just spitting out an OLD MODLOG: entry".)
2021-07-18 21:07:29 -07:00
Annika
7bd70f8266 Modlog Converter: Fix issues with ts-node 2021-07-18 18:16:41 -07:00
Annika
33145f3fc8 Modlog Converter: Default to 0 if no time is found
This makes it clearer that no time was found, since PS didn't exist in 1970.
2021-07-17 21:21:32 -07:00
Annika
a4c1be6496 Modlog Converter: Fix bugs
The modlog converter now mostly works properly. There are some discrepancies (for example, Lobby gets 11,000 more modlog entries in SQLite than in text); I'm not sure if this is because of glitches in the previous system or a bug in my code. This script will need to be run after #8004 is merged.
2021-07-17 21:14:24 -07:00
Karthik
12abcd02c9
Fix bugs with Sucrase build process (#8393) 2021-07-14 09:50:01 -07:00
Annika
491ce58234 Fix dex-formats in Sucrase build 2021-07-10 14:37:16 -07:00
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Guangcong Luo
f47e38c5ad Support building TS declarations
`./build decl` now builds TS declarations for everything exported by
`sim/`. Unfortunately, the built TS declarations still refer to global
types, so some things still have `any` type, but it's much better than
nothing.
2021-06-09 17:51:49 -05:00
Guangcong Luo
55980d416c
Support value rules (#8267)
`teamLength`, `maxLevel`, `cupLevelLimit`, and `minSourceGen` no longer
exist as properties of `Format`. Instead, they're value rules that
become properties of `RuleTable`, and can be specified as custom rules
and inherited through rulesets like anything else.

See the PR for a full reckoning of changes:

https://github.com/smogon/pokemon-showdown/pull/8267
2021-05-06 01:16:16 -07:00
Guangcong Luo
c241941c61 Clear .config-dist when building
This fixes a bug where `.config-dist/custom-formats.js` wasn't getting
deleted when `config/custom-formats.ts` was deleted.

This also cleans up some other clutter in `.config-dist`.
2021-04-21 23:46:55 -07:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
This is the change that renames:

- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`

In addition, some other APIs have been updated:

- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
  - Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
  - Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`

Team functions have been split off into a new `sim/teams` package:

- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`

`Teams.export` has also been rewritten to better match how it works in client.

This implements #8178
2021-04-08 03:00:37 -07:00
Guangcong Luo
4f32736bdd Clean mods/ and chat-plugins/ when building
Previously, if you deleted a file from `data/mods/`, it wouldn't also
get deleted from `.data-dist/mods/`. This fixes that, and the
corresponding issue in `server/chat-plugins/`.

For reasons of performance and/or laziness, I've chosen to only clean
those two directories, not all built directories.
2021-04-07 01:33:10 -07:00
Annika
31605c36b3 Modlog: FIx converter bug in action-taker regex 2021-02-06 11:42:07 -08:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
LegoFigure11
cad1d25c4d
Add Gen 8 BSS Factory (#7843) 2020-12-31 02:09:29 +04:00
Guangcong Luo
6e281dbe31 Move build-utils from lib to tools
The current idea is for `lib` to contain shared libraries useful to
many projects. `build-utils` is specific to this repo and so doesn't go
there.
2020-12-26 10:08:30 -08:00
MacChaeger
da64d93765 Runners: Support 4P (and max games) (#7700) 2020-12-13 20:26:39 +00:00
Annika
66c043086e Modlog converter: Fix crash without SQLite library 2020-11-07 13:40:07 -08:00
Annika
ec0a92469a Modlog: Make tests work without SQLite 2020-11-05 22:40:53 -08:00