Commit Graph

154 Commits

Author SHA1 Message Date
Sergio
38b0d9475e Minor changes to the help boxes of /ds and /ms (#11094)
Some checks failed
Node.js CI / build (18.x) (push) Has been cancelled
* Minor changes to the help boxes of /ds and /ms

Removed parameters that do nothing (instruct, mimic), changed ssb examples (they were obsolete), added a couple more things. Would love to make the wall of mods you can use with both ds and ms smaller, since a lot of those don't actually change their behaviour, like randomroulette, but I'm not sure how to approach it. A hardcoded list of mods that change things is an option.

* Added "restricted" as a parameter
2025-07-15 21:11:15 -06:00
hammer798
fddbf8adb5 Fix item filters duplicating search terms (#11271) 2025-07-14 14:03:08 -07:00
Lucas
4536eee620 /dexsearch: Add support for sorting by (doubles) tier (#11150)
* ds: add tier sorting

* Add support for doubles and natdex tiers

* fix unnecessary nationalSearch passing

---------

Co-authored-by: Meijer,L. (Lucas) <l.meijer6@students.uu.nl>
2025-06-14 19:01:25 -06:00
Guangcong Luo
a1e9066f9e Use class="details" and class="gray" 2025-05-05 04:43:05 -07:00
WifiLatency
9c1457ee9b /ds: Collapsibles New Styling (#11041)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2025-04-21 05:07:44 -07:00
Sergio Garcia
fc23103de1 Fix random typos (#11020)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
2025-04-13 23:59:36 -07:00
WifiLatency
c4a5ed50e4 /ds: Param to expand collapsible datasearches by default (#11023)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
* Reimplement all as a param to automatically expand nonbroadcast results.

* Tests ensuring datasearches don't expand when broadcast with all
2025-04-08 23:53:40 -06:00
WifiLatency
7d989abe8e /ds: Add comparing stats (#10984)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
* Add comparing stats

* Fix duplicate comparison overwriting and error feedback

* Error on duplicates, invalid ranges, and muliple inequality operators

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2025-04-07 21:23:40 -06:00
WifiLatency
81b3471cae Datasearch: Make results collapsible (#10995)
* Make ds collapsible

* Make other search commands collapsible.

* Remove all as a parameter for searches

* use readmore element with content attrs defined

* Rework to support chrome due to details linebreak quirk

* Move the toggle button down to the results line for broadcast commands
2025-04-07 21:19:47 -06:00
Kris Johnson
9ff1398c69 Use Chat.ErrorMessage instead of errorReply in more places (#11017) 2025-04-07 21:15:27 -06:00
Alex "Mathy
9ba3752d50 Dexsearch: Allow sorting by Pokedex number (#11001)
* Dexsearch: Allow sorting by Pokedex number

* fix whitespace
2025-04-01 00:17:47 -06:00
WifiLatency
bdeb19f26a /ds: Add rule functionality (#10973)
* /ds metagame rules with moves compability.

* mon attributes compatibility

* pokedex rule compatibility.

* clean up. support convergencelegality

* updated dexsearchhelp. better error feedback.

* Fix negations for abilities and moves.

* Scrapped convergence, cleanup.

* Updated dshelp for the mapped rule param values.

* Fixed duplicate formes and tests reciving species.

* Support /ds stacking multiple rules

* Apply suggestions from code review

* tests for /ds rule functionality

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2025-03-18 00:50:32 -06:00
WifiLatency
232af5c19f /ds: Fix searching for trapping and partial trapping moves (#10962)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
* Adds trap as a search param to movesearch without modifying any moves.

* minor regex optimization.

* Implement in a less hacky manner.

* clean up adding both trapping statuses to the orgroup.

* Fixed conditional mixing trapped moves with other volatilestatuses.
2025-03-11 14:39:50 -06:00
WifiLatency
4346e3d34c Add Restricted as a /ds Parameter (#10952)
* added restricted as a param for /ds using the species tags.

* comply with max line length.
2025-03-09 12:03:15 -06:00
WifiLatency
7bf04ad1e1 Implement searching for tiers by inequality to /ds (#10949)
* Implemented tier searching using inequalities.

* Fixed the value of OU being higher than CAP.

* Fixed AND searching for tiers with inequalities.

* Update server/chat-plugins/datasearch.ts

* Update server/chat-plugins/datasearch.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2025-03-09 12:03:06 -06:00
WifiLatency
f1ba8179c0 Add Number Generation Aliases to /learn (#10955)
* learn command generation shorthand now matches other datasearch commands.

* Retain support for generational prefixes.
2025-03-09 12:00:02 -06:00
Guangcong Luo
d9557375a0 Introduce "NatDex Mod" (#10939)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
"Standard NatDex" is very weird compared to how OMs usually work.

See "TierShift Mod" and "Godly Gift Mod". NatDex now gets its own mod,
which can be mixed into any other format, instead of needing to start
with NatDex.

This would make Min Source Gen overriding annoying, so it now defaults
to the current gen in Gen 9+, if Obtainable is set and +Past isn't. So
now you don't need to manually set Min Source Gen to enforce Obtainable
in Gen 9.
2025-03-06 03:40:36 -08: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
larry-the-table-guy
b790eb8309 Remove dead code for dex initialization (#10793)
As of PR #10641, these are no longer necessary.
2025-01-04 13:14:22 -07:00
PartMan
8563a5658f Datasearch: Don't escape HTML for regular text messages (#10692) 2024-11-27 13:15:53 -07:00
Kris Johnson
512e3be804 Data commands: Gate Gigantamax information to Gen 8
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
2024-11-16 21:28:26 -07:00
Slayer95
34c0cb39e3 Fix bugs connected to format.exists (#10647) 2024-10-31 08:25:17 -05:00
Sergio Garcia
a0a6fed454 Fix oversights in & to ~ migration (#10595)
* Fix oversights in & to ~ migration

* It was just a symbol
2024-10-06 10:07:03 -06:00
Mia
e82c5fa161 Change references of & to ~ 2024-10-01 09:02:03 -05:00
dot-Comfey
6c29c905da Fix prevo/evo move incompatibilities (#10574) 2024-09-26 20:22:11 -05:00
larry-the-table-guy
ddf5848a38 Datasearch: Optimize runDexsearch (#10536)
* add crude profiling to runDexSearch

No behavioral changes (other than console.log spam), this commit is just to establish a baseline and pinpoint the slow portions

* optimize datasearch.ts - pull move filter prep out of loop

Based on preliminary benchmarks, most of the time was spent getting the move validator, even for queries that don't specify a move.
More importantly, the parameters for fetching the move validator are known very early in the function and don't change during the loop.
Pulling that portion out of the loop is an easy win.

* improve profiling for runDexSearch

- add subcategories for filtering on move (the next optimization target)
- report unaccounted time amounts ('known unknowns')
- make grand total stand out more

* optimize dexsearch - fetch move list in outer loop

Move list depends on 'alts', which does not change in the loop over mons. Minor win, but simple.

* optimize dexsearch - filter move list by gen in outer loop

Neither 'mod' nor 'altMoves' changes during the inner loop.

* log pokemonSource in runDexSearch - expose possible leak

pokemonSources, which appears to act as a set, grows with each iteration, adding seemingly redundant items.
Will need to look closely at TeamValidator to identify the problem. My guess is that it's putting object references into a Set,
which, for objects other than strings, only cares about object identity.

* profile runDexSearch - count checkCanLearn calls

Also, semi-fix issue identified in prior commit - the endless growth of the restrictiveMoves list.
Counting the calls to checkCanLearn helps us reason about whether the cost per call is reasonable.

* fix perf bug in TeamValidator.checkCanLearn

use the cached ruleTable, save 100x.

* optimize runDexSearch - only init move filters when needed

For queries that never mention a move, a considerable chunk of time is wasted getting the objects needed for
'checkCanLearn'. I measure ~1ms savings for the relevant queries, which is often a decent percentage.

* profile dexsearch - delete and format

This is to document that they are not the bottlenecks.

* remove nested profiling from dexsearch

We've gotten to the point where we actually *are* measuring microseconds, so the frequent calls
are too expensive. This is a good problem to have! What we can see from running npm test is
that 'filters' and 'unaccounted' still account for a majority of the time. So, there's still
room for improvement, if that's ever a serious concern.
Personally, I think working on the moves API would be more fruitful.

* remove all profiling code

No more console.log or performance.now() calls. Ready to merge.

* Update server/chat-plugins/datasearch.ts

Format the 'format' string in-line.

Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>

* Remove ts-expect-error from datasearch.ts

* Fix uninit lint in runDexSearch

---------

Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
2024-09-17 11:46:35 -06:00
Leonard Craft III
27557e5fdc Convert noSketch to move flag (#10407) 2024-07-14 23:45:10 -05:00
Karthik Bandagonda
fb5ba9b6ab Fix /nds showing certain illegal Pokemon (#10416) 2024-07-11 19:41:39 -05:00
singiamtel
ed62ad108b Fix itemsearch when specifying both gen and show all (#10113)
* Fix itemsearch when specifying both gen and show all

* Update server/chat-plugins/datasearch.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-01-14 11:25:12 -07:00
Karthik
73041e4137 Refactor noMetronome lists to metronome flag (#10110) 2024-01-13 14:00:19 -06:00
Karthik
1eed1b9f33 Show Unobtainable moves in /nms (#10105) 2024-01-11 07:59:47 -07:00
singiamtel
53cd6b5383 Fix /randpoke and /randmove not finding newer moves in old rooms (#10052) 2024-01-01 17:38:39 -07: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
Kris Johnson
48eeb35e4b Add December 2023 tier shifts 2023-12-01 10:44:36 -07:00
Kris Johnson
55a38d445e Add proper ZU support for old gens 2023-11-17 13:59:18 -07:00
Karthik
81b24c9e79 Default to min source gen 9 for /learn (#9875) 2023-11-02 20:46:52 -05:00
Kris Johnson
6239b39af3 Add November 2023 RoA Spotlight 2023-11-01 11:36:13 -06:00
pyuk-bot
9ca62ade6c Hide Ogerpon-Mask-Tera formes from searches (#9813)
* Hide -Tera formes from searches when appropriate

* Remove trailing space
2023-10-04 11:16:56 -06:00
Kris Johnson
4ab2c7b5b7 Datasearch: Don't group together Ogerpon forms 2023-09-17 12:26:56 -06:00
Leonard Craft III
5296a28b8d Implement cantusetwice move flag (#9740) 2023-09-06 20:12:30 -05:00
Kris Johnson
90640859b2 Fix /nds interaction with moves 2023-08-11 23:50:54 -06:00
Sergio
66824f09a6 Movesearch: Remove empty spaces from 'sheer force' before validating (#9688) 2023-07-31 09:25:55 -05:00
dot-Comfey
684e9ee2a2 Fix , all in /as and /is (#9657)
* Fix , all in /as and /is

* Update datasearch.ts
2023-07-26 23:38:23 -07:00
Lionyx
9787b7471a /learn: Add Gen 8 parameter alias (#9615) 2023-06-26 23:30:38 -05:00
malaow3
7948ef991a Add additional random commands (#9529)
* Add randability command

* Add randitem and randtype commands

* Update to use camelCase instead of snake_case for var names
2023-05-17 11:08:16 -07:00
Mia
bce759c5f1 Datasearch: Prevent users from running more than one query at a time 2023-05-10 20:52:03 -05:00
Leonard Craft III
156a39405f Refactor some move lists to move flags (#9396) 2023-03-18 22:21:00 -05:00
Alexander B
777a4eda19 Datasearch: Exclude Revival Blessing as pivot move (#9433) 2023-03-01 09:25:41 -06:00
Alexander B
61f1a4b29e Datasearch: Allow searching unreleased Pokemon (#9379) 2023-02-05 11:10:48 -05:00
Alexander B
ca8e17109b Datasearch: Show formes if sorted (#9190) 2022-12-15 19:52:42 -08:00