Commit Graph

49 Commits

Author SHA1 Message Date
Guangcong Luo
313cd36337 Fix display bug in !learn 2017-02-23 14:43:47 -06:00
Guangcong Luo
427ff5061e Support virtual console moves in !learn 2017-02-23 14:41:24 -06:00
Spandan
7e5bb56a13 Fix Error in Z-Status move search (#3109) 2017-01-24 02:59:14 -05:00
Spandan
8bbd449dd2 movesearch: Add support for Z-status effects (#3105) 2017-01-22 05:03:30 -05:00
panpawn
670a499c2b Datasearch: Standardize help commands formatting (#3046) 2016-12-23 01:26:51 -08:00
Guangcong Luo
aeff92aac9 Fix other crash in dexsearch
Or is this movesearch? idk but it should probably be fixed some better
way, this is just a hack.
2016-12-20 03:54:21 -05:00
asgdf
eb8d2ab14a Fix crash in /dexsearch (#3030) 2016-12-15 20:40:42 -08:00
panpawn
9bf747f1e4 Datasearch: Replace deprecated font tags (#3025) 2016-12-14 21:05:06 -08:00
asgdf
97135a5897 Support egg groups as parameters in /dexsearch (#3023) 2016-12-14 12:56:55 -08:00
panpawn
51c6567975 Standardize using <br /> instead of variations (#3009)
Across PS, in most places we use <br /> - however, in some other places we used <br> and in some <br/>.  This standardizes that to simply be <br />, since that's what we use in the majority of places.
2016-12-11 04:34:07 -05:00
asgdf
6622c2d4ee Expand help entry for /learn (#3002)
Also remove /g6learn, which is now made redundant by /learn
pentagon,gen6,... and didn't work anymore anyway.
2016-12-07 10:40:00 -06:00
Guangcong Luo
ddc7e0412e Clarify /learn message for gen 6-7 egg moves 2016-12-07 05:20:22 -05:00
Guangcong Luo
6969290d67 Support passing format name to /learn 2016-12-06 20:31:32 -06:00
Guangcong Luo
0ed2071217 Improve /learn
It now accepts a generation parameter, as well as "pentagon", as
options before the pokemon species.

In addition to making it easier to remember the syntax and supporting
pentagon checks, this also allows /learnall to be used in past gens.

e.g.

`/learn pentagon, mence, dd`

will show:

> In Gen 7, Salamence can learn Dragon Dance only when obtained from:
> gen 7 egg: axew, dragonair, dragonite, dratini, ...

`/learn gen3, mence, dd`

will show:

> In Gen 3, Salamence can learn Dragon Dance only when obtained from:
> gen 3 egg: altaria, charmander, dragonair, dragonite, ...
> gen 3 event: 1 salamence
2016-12-06 19:33:51 -06:00
asgdf
1d6ac79158 Fix /ds not working for gen 7 mons with 2+ moves as argument (#2944) 2016-11-27 23:54:02 -06:00
urkerab
9f371b2953 Add Shore Up to the list of recovery moves searched by /dexsearch (#2939) 2016-11-23 22:37:46 -05:00
urkerab
27f0b82592 Actually make /oraslearn work (#2911) 2016-11-19 13:49:15 -06:00
urkerab
5e9d04e0aa Change default /learn gen and add /oraslearn (#2902) 2016-11-18 09:16:29 -06:00
HoeenCoder
cf1f723fa6 A few fixes (#2893) 2016-11-17 13:39:40 -06:00
Ivo Julca
4fa6c5499b Build: Fix issues reported by the latest Eslint version 2016-11-17 14:27:39 -05:00
Guangcong Luo
2604780ec5 Refactor Tools
Tools will be renamed to Dex soon, which is why the code inside Tools
is calling itself "Dex" now, but right now we're just refactoring its
internal code and not officially renaming it yet.

In the meantime, Tools is now an ES6 Class.

A long-standing bug in learnset loading order (the one
test/chat-plugins/datasearch.js tests for) has finally been fixed, so
Tools.includeMods() is no longer necessary to accurately access modded
data.

Tools.mod has been split into Tools.mod(modid) and
Tools.format(format). The issue of Tools.mod being ambiguous about
whether it's passed a mod or a format hasn't been a _bug_ for a while,
but this is still more readable.

Other renames include:

Tools#isLoaded -> Tools#dataLoaded
Tools.includeMods() -> Tools.includeModData()
Tools.preloadMods() -> Tools.includeMods()
Tools.preloadedMods -> Tools.modsLoaded
Tools.moddedTools -> Tools.dexes

Do not just rename your calls of Tools.includeMods() to
Tools.includeModData(). With the learnset loading bug fixed, there's
no reason to use it unless you need direct access to
Tools.dexes[...].data for some reason (you don't, just use
Tools.mod(...).data)
2016-10-21 13:23:21 -05:00
sirDonovan
fafb2c1099 Fix crashes in datasearch commands
Loading data on the main process was accidentally removed in
64fa2b9801
2016-10-02 15:08:03 -05:00
Guangcong Luo
d6f5404e7e Rename CommandParser to Chat
We had a lot of discussion in Dev and a somewhat-close poll, but in
the end "Chat" was a better name than "Messages", and also has the
advantage of being shorter (which is nice for Chat.html and
Chat.plural which should be short).
2016-09-30 18:31:15 -07:00
Guangcong Luo
da1b318707 Move text processing from Tools to CommandParser
The following functions have been renamed:

- Tools.html to CommandParser.html
- Tools.plural to CommandParser.plural
- Tools.escapeHTML to CommandParser.escapeHTML
- Tools.toDurationString to CommandParser.toDurationString
- Tools.toTimeStamp to CommandParser.toTimestamp
  (notice the lowercase 's')

This is in preparation for a rename of Tools to Dex (by removing the
non-dex-related functions) and a rename of CommandParser to either
Messages or Chat.
2016-09-30 18:04:13 -07:00
Guangcong Luo
3c5525c8b0 Fix more crashes in PM refactor 2016-09-25 16:22:28 -04:00
Guangcong Luo
5a16c884da Fix a variety of bugs in PM commands
Most of these were introduced in the PM refactor, but an honorable
mention goes to the global command regex.
2016-09-25 14:12:43 -04:00
Guangcong Luo
6b4eaf9422 REALLY support commands in PMs
These changes were supposed to be in de524c1a26 but got lost in my
Git stash...

Once again, this is very experimental code; please don't base any
serious changes on it.
2016-09-17 01:16:56 -07:00
Ben Davies
d9c6fe54b2 ProcessManager: subclass to extend ProcessManager, unit tests setup (#2739)
Before, an options object containing properties and values to be used
was how decorated instances of the class would be created. This meant
the constructor could assign anything you feel like to `this`. Rather
than that, the constructor now assigns a strict set of values, and
methods are redefined in subclasses.

Basic unit tests were added to test if they could be written for after
the final refactor to fix the other memory leak here.
2016-09-09 15:51:49 -05:00
Taylor Everding
1a1f64fe95 Remove .js extension from requires (#2725) 2016-08-30 00:04:40 -05:00
panpawn
36d7728b06 Update help commands to reflect new bot rank (#2634)
Also, give the bot rank the new addhtml permission in config/config-example.js

... And, we are going to fix promoting locked users to rank bot.
2016-07-20 19:50:47 -06:00
panpawn
737f19d67a Datasearch: fix error reply lag (#2621)
By having ``return`` in these instances, the line ``room.update();`` never happens, so it gives the illusion that the server is lagging when it's probably not.
2016-07-13 01:02:24 -04:00
Vacate
91d19f95d6 Minor wording fixes in /movesearch (#2551) 2016-05-08 03:05:26 +04:00
Guangcong Luo
4a995350bb Shim Array#includes
This also refactors everything to use Array#includes except data
and mods, which are large enough that I'll refactor them later
probably.
2016-05-04 02:55:18 -07:00
Ivo Julca
232785b1d1 DataSearch: handle exceptions in queries 2016-05-02 22:48:07 -05:00
Ivo Julca
22779102cc Lint: Add miscellaneous extra rules
Among the newly added rules, there are quite a few intended to enforce
compliance of CONTRIBUTING.md-blessed idioms, as well as ensure
safe usage of classes and constant bindings.

We are also now enforcing usage of early return in commands.js,
which has 100% compliance as of fd2c45c.
2016-04-25 21:52:21 -05:00
urkerab
7b292840aa Add contest conditions to move searches (#2519) 2016-04-17 06:37:09 -07:00
Caleb Young
4b50059d24 /dexsearch - Prevent LC Ubers being included in LC (#2506) 2016-04-14 04:30:14 +04:00
SolarisFox
e3b226f8f4 /dexsearch: improve tier seaches 2016-04-06 16:57:53 -07:00
Quinton Lee
0e12b8ae30 Dexsearch: fix input validation 2016-04-06 15:37:42 -05:00
SolarisFox
be8ab93e8a /dexsearch: improve input validation 2016-04-06 00:24:19 -07:00
SolarisFox
a9f67a3991 /dexsearch: add 'resists' parameter 2016-04-04 00:24:10 -07:00
Ivo Julca
10bb83bf3c Improvements to command broadcast API
- Method `this.runBroadcast()` has been split from `this.canBroadcast()`.
It's now the only method handling command-usage and intended as the main API
for synchronous commands. Async commands will execute both separately.
Note that the `suppressMessage` parameter is now passed to `runBroadcast`.

- The semantics of `broadcasting` have been similarly split.
`this,broadcastMessage` will be set to a truthy value when `this.canBroadcast` is run.
`this,broadcasting` will only be set to `true` once `this.runBroadcast` is executed.
2016-04-02 15:46:13 -05:00
Bär Halberkamp
84d6d328fc Fix another oversight in randpoke 2016-04-01 03:54:01 +02:00
Bär Halberkamp
a0caee2a07 Fix this.broadcasting not being set in the datasearch commands 2016-04-01 00:52:16 +02:00
Ivo Julca
87c982e2fe Fix misleading comment in datasearch header
The commands provided are never synchronous.
2016-03-31 16:53:09 -05:00
Ivo Julca
f901bfe31e Fix data load in informational plugins
- Single-process `datasearch` requires mods.
- `info` requires Gen 6 data.
2016-03-31 16:50:50 -05:00
Ivo Julca
bbb58d5a29 Add a test for old-gen /learn 2016-03-31 14:01:11 -05:00
Bär Halberkamp
4b326d75eb Fix /learn not working, and filter out more bogus input 2016-03-31 20:12:25 +02:00
Bär Halberkamp
0e206dcd42 Make /learn multiprocess using the same process as /ds 2016-03-31 15:59:36 +02:00