Commit Graph

24 Commits

Author SHA1 Message Date
Sergio Garcia
b81ff9a69a
Remove useless spreads (#11132) 2025-05-24 16:19:48 -07:00
André Bastos Dias
d25aba9aff
Fix: Terastallize Ogerpon and Terapagos with different Tera types (#10814) 2025-05-13 14:44:46 -07:00
pyuk-bot
f03dbef9ff
CGT: Add command to view winrates + misc. updates (#10917)
* CGT: Add command to view winrates + misc. updates

* Update data/cg-team-data.ts

* Update data/cg-teams.ts

* Apply suggestions from code review

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2025-02-26 14:55:43 -07:00
Guangcong Luo
78439b4a02
Update to ESLint 9 (#10926)
ESLint has a whole new config format, so I figure it's a good time to
make the config system saner.

- First, we no longer have separate eslint-no-types configs. Lint
  performance shouldn't be enough of a problem to justify the
  relevant maintenance complexity.

- Second, our base config should work out-of-the-box now. `npx eslint`
  will work as expected, without any CLI flags. You should still use
  `npm run lint` which adds the `--cached` flag for performance.

- Third, whatever updates I did fixed style linting, which apparently
  has been bugged for quite some time, considering all the obvious
  mixed-tabs-and-spaces issues I found in the upgrade.

Also here are some changes to our style rules. In particular:

- Curly brackets (for objects etc) now have spaces inside them. Sorry
  for the huge change. ESLint doesn't support our old style, and most
  projects use Prettier style, so we might as well match them in this way.
  See https://github.com/eslint-stylistic/eslint-stylistic/issues/415

- String + number concatenation is no longer allowed. We now
  consistently use template strings for this.
2025-02-25 20:03:46 -08:00
pyuk-bot
e97ea8c7fd
CGT: Count wins/losses in public-room tour-battles (#9999) 2025-02-09 23:34:45 -06:00
Guangcong Luo
fde2b1187f
PRNGSeed is now a string (#10826)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
This makes it so we no longer need to ad-hoc convert seeds from strings
to arrays when we get them from text protocols like the command line or
BattleStream's `reseed` command.

It also has the side benefit of making inputlogs very slightly smaller.
2025-01-15 15:51:28 -08:00
Mia
d3e60b31f7
Sim: Use a CSPRNG (#10806)
* Sim: Use a CSPRNG

* Add test

* fix test prng

* move prng test to others

* fix slight hack

* tf?

* Fuck this

* fucking lol

* fix crap

* i'm going to kill someone

* i hate state

* fix test

* Good work genius

* typo

* Fix exportinputlog

* Refactor for inputlog backwards compatibility

This is a pretty major refactor which is mostly unrelated to the
feature, but it does make the code a lot simpler.

* Readability pass

* Readability (again)

* Remove sodium-native dependency

* Refactor to serialize seeds in hex strings

(Also removes the Buffer dependency from PRNG, and slightly improves
comments.)

* Apparently << is 32-bit signed

* Readability

---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2025-01-11 13:56:34 -06:00
pyuk-bot
0c18c9c6b2
CGT: Improve Sleep Talk and boosting sets (#9998)
* CGT: Improve Sleep Talk and boosting sets

* Try harder not to have sets without an attack

* I don't know how to make this line fit

* Never mind I figured it out

* Add more exceptions to getting Toxic Orb

* Further improve Toxic and Flame Orb weights

* More self-status-immunity checks

* Update data/cg-teams.ts

* Update data/cg-teams.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-11-18 15:31:49 -07:00
Kris Johnson
63ca4e2c81 Use DexTypes#names() where applicable 2024-11-10 20:32:24 -07:00
Leonard Craft III
3256c1e410 Fix Computer-Generated Teams toID crash 2024-07-06 16:03:20 -05:00
Guangcong Luo
88be8d7b3c
Refactor types for Lowercase<string> (#10377)
TypeScript 4.8+ supports Lowercase for lowercase strings, which isn't
exactly what ID is, but can be used to type IDs in object keys and data
entries that previously required string. I'm calling it IDEntry in places
where it should be an ID but TypeScript doesn't support that.

Very conveniently, no additional casts will be needed when using ID
where IDEntry is expected.

It's caught at least a few bugs, which is also why I'm PRing: I didn't
write the code for the bugs it found, and don't know if it's the right
way to fix them.

This ballooned into several other type refactors.
2024-07-01 15:57:14 -07:00
pyuk-bot
578f80732f
Computer Generated Teams: DLC 1 & 2 update (#9795)
* Computer Generated Teams: Teal Mask update

* Dipplin

* Update data/cg-teams.ts

Co-authored-by: AnnikaCodes <annika@worldbrightening.net>

* Update data/cg-teams.ts

Co-authored-by: AnnikaCodes <annika@worldbrightening.net>

* Add a comment about quadratic level scaling

* Add weight to Tailwind plus extra for Wind Rider

* Add DLC2 support plus more tweaks

---------

Co-authored-by: AnnikaCodes <annika@worldbrightening.net>
2023-12-18 20:44:38 -08:00
Guangcong Luo
eb60769cd3
Refactor learnset checking (#9951)
After seeing fifty different ways we use `getLearnset`, most of which
are just "haphazardly assemble a movepool", I decided to write
`getFullLearnset` and `getMovePool`, which centralizes the
implementations and prevents weird bugs like 9713dc6db5 which
we spent two years trying to figure out.
2023-12-08 22:45:47 -06:00
pyuk-bot
4262053d2f
CGT: Update item generation (#9340)
* CGT: Update item generation

* Fix indent
2023-03-29 20:55:28 -07:00
Leonard Craft III
156a39405f
Refactor some move lists to move flags (#9396) 2023-03-18 22:21:00 -05:00
Leonard Craft III
5434a30631 Computer-Generated Teams: remove toID reference
thanks Annika!
2022-12-30 17:10:03 -06:00
pyuk-bot
f156b207e8
Update CC and CGT movepool generation (#9202) 2022-12-29 18:42:47 -08:00
Annika
4d5255c3f7 CG Teams updates 2022-12-16 15:01:50 -08:00
Annika
f183998692 CG Teams: Prevent duplicate moves
Fixes #9197
2022-12-16 13:47:33 -08:00
adrivrie
9d4f81a407
Computer-Generated Teams: Fix weakness counter incrementing too soon (#9191) 2022-12-15 19:51:57 -08:00
Annika
2a49eab3a5 CG Teams updates 2022-12-15 19:46:59 -08:00
Annika
9ede01a41b CG Teams: More fixes 2022-12-14 21:05:49 -08:00
Annika
589d0689ef Computer-Generated Teams: Initial fixes 2022-12-14 18:45:52 -08:00
Annika
06ad1838b4 Add [Gen 9] Computer-Generated Teams 2022-12-14 17:46:20 -08:00