Commit Graph

33 Commits

Author SHA1 Message Date
Guangcong Luo
49cacba6cf Support !rebroadcast to bypass broadcast cooldown
The old system where only admins can bypass the broadcast cooldown
is weird, because it's wrong in both directions: Admins could
unintentionally re-broadcast, but other users couldn't intentionally
re-broadcast.

Now no one can unintentionally re-broadcast and everyone can
intentionally re-broadcast.
2021-05-23 19:41:07 -07:00
Guangcong Luo
4a716f1456 Use aliases for !formathelp broadcast cooldown
(This makes it so if someone uses `!om sketch` it will prevent use
of `!om sketchmons` for a while.)

Suggestion thread: https://www.smogon.com/forums/threads/make-the-broadcast-cooldown-for-commands-apply-to-aliases-of-that-command.3684569/
2021-05-23 18:23:52 -07:00
Guangcong Luo
509d0abad4 Refactor out some Object.keys invocations
If you need values, you should be using `Object.values` or
`Object.entries` directly.
2021-05-13 23:02:04 -07:00
Guangcong Luo
810aff74cd Namespace more server global types 2021-04-25 14:16:27 -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
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
Kris Johnson
b8cbee3944
Update OMotM/LCotM aliases (#8025) 2021-02-12 19:06:11 -07:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
The Immortal
3ae56399bd Label Pokemon banned from LC as NFE 2021-01-11 00:29:18 +04:00
Guangcong Luo
9b5217ab70
Split up dex-data into more files (#7634)
* Split up dex-data over individual files

This commit introduces:
- `dex-abilities.ts`
- `dex-conditions.ts`
- `dex-formats.ts`
- `dex-items.ts`
- `dex-moves.ts`
- `dex-species.ts`

These files centralize definitions from `dex-data` and `global-types`.

* Inherit ItemData from Item etc

Previously, Condition inherited from ConditionData. Now, ConditionData
inherits from Condition. The advantage of the new approach is that now,
Condition and DataCondition no longer need to be separate types, and
there should be much less duplication of type definitions in general.

This has also been done for

- ItemData/Item/DataItem
- AbilityData/Ability/DataAbility
- FormatData/Format/DataFormat

Species and DataSpecies was already merged, but this also reverses
their inheritance (saving a lot of duplicated definitions in the
process!)

The only one left is MoveData, which is just super complicated and
will need its own commit.
2020-11-05 05:00:13 -08:00
Kris Johnson
acbe53ba4a
Modernize the coding style of the OM chat plugin (#7643) 2020-11-05 04:50:05 -08:00
Kris Johnson
ab6e173e24
Move natures into their own file (#7601) 2020-10-29 08:38:03 -07:00
PartMan
d37b9486d7
Allow Pokemon names as arguments in /stone (#7490) 2020-10-08 19:20:27 +04:00
Kris Johnson
b7b609a205 Display BST properly in /crossevo and /showevo 2020-09-11 18:53:08 -06:00
Guangcong Luo
8d79bf9725 Rename Dex.deepClone to Utils.deepClone
`this.dex.deepClone` still exists as an alias to `Utils.deepClone` for
use in `data/`. I'll need to spend more time figuring out the correct
solution there.
2020-08-21 04:24:34 -07:00
Kris Johnson
5e255012bc
Add a 'bst' property to Species (#7138) 2020-08-12 12:06:09 -07:00
Kris Johnson
8c22d4ce97
Add /flipped command (#7139) 2020-08-05 05:40:31 +04:00
Spandan Punwatkar
fa5b90cba3
Add /showevo (#6957)
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2020-07-06 10:53:10 +04:00
Mia
4997a47314
Commands: Allow the room parameter to be null (#6948)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-07-05 14:25:09 -07:00
Kris Johnson
7010e0286f
Add OMotM and RoA Spotlight for July 2020 (#6936) 2020-07-01 12:59:10 +04:00
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -07:00
Annika
f4863a9444
Update references to Global Administrators post-flattening (#6815)
Co-authored-by: Charlie Kobayashi <sparkychildcharlie@gmail.com>
2020-06-08 09:41:03 -07:00
spixi
67d6ffb236
Fix /om chat command: wrong URL (#6722) (#6723) 2020-05-20 17:46:27 -07:00
The Immortal
634658a5ba Refactor unreleased Pokemon
Pokemon that are not available in-game are now consolidated into `isNonstandard`. 'Past' indicates that the Pokemon no longer works in the current generation. 'Unobtainable' indicates that the Pokemon works but can only be obtained through hacking.
2020-04-06 20:53:03 +04:00
Kris Johnson
adb4eed23b
Other Metas chat plugin: Remove Tier Shift check (#6504) 2020-03-30 19:08:16 +04:00
Kris Johnson
b90cae8dff
Other Metas chat plugin: Add past-gen support (#6499) 2020-03-30 18:28:01 +04:00
Kris Johnson
994fc60aed
Rename Template to Species (#6478) 2020-03-25 23:29:27 -07:00
Kris Johnson
ff0968bdc9
Scalemons: Move stat formula to rulesets (#6481) 2020-03-22 05:44:47 +04:00
Guangcong Luo
b21c9047e2
Migrate to typescript-eslint (#6342) 2020-03-05 08:33:06 -08:00
Kris Johnson
9aaab2c57b
Typescript Help Tickets and Modlog and fix warnings (#6352) 2020-02-12 21:48:03 -08:00
The Immortal
19cdf79821 Update OMs 2020-02-12 14:19:29 +04:00
Waleed Hassan
6714e14fc5 Fix max line length warnings (#6286) 2020-01-14 15:30:50 +04:00
Kris Johnson
649ac8ea6b Typescript uno/othermetas/hangman (#6229) 2019-12-31 17:52:26 +09:00