Commit Graph

295 Commits

Author SHA1 Message Date
whales
4b4543b2a1 Fix typo in mafia help 2019-10-13 21:41:10 +10:30
SuddenlyQ
7ba7e0264d Add /pl as an alias to /punishlog (#5875) 2019-10-12 04:25:20 +02:00
TheMezStrikes
45728784f7 Fix typo to make multi-line adduhtml work (#5864) 2019-10-10 12:33:00 +02:00
Guangcong Luo
7d99c740f9 Fix crash in /coverage and /effectiveness
Also update /data with the correct fix.
2019-10-10 00:49:44 -04:00
whales
ea2dea1283 Rooms: Rooms.get can return null (#5860) 2019-10-09 18:52:33 +11:00
Guangcong Luo
2adc80efe4
Improve egg validator (#5854)
Previously, we split gen 2-5 egg move validation into two phases,
`checkLearnset` where we searched for a valid father, and
`reconcileLearnset` where we made sure the father could learn the move
combination.

Egg move validation has now been completely moved out of these
functions and into `validateSource`, which calls `findEggMoveFathers`.

The new algorithm no longer requires `C` moves to be hardcoded into
`learnsets.js`, now doing a more thorough check validation for the
father's move combination. This should be slower than before, but
net performance should be massively improved due to two other
optimizations in this refactor:

- We no longer do any father-searching if the moveset can be obtained
  any other way - in particular, this means no more father validation
  in gen 6+ where all egg move combinations are legal anyway.

- We only check fully-evolved pokemon as fathers (because anything a
  prevo can learn, its evos can learn, too - yes, we remember to make
  exceptions for Salazzle, Combee, and future-gen evos)

In addition, `/learn` should now provide significantly better
information for egg move breeding, since it uses a more thorough check
instead of the validator's short-circuiting the moment it finds a valid
father.

This also improves some baby-only move validation, specifically fixing
the issue with Seismic Toss Charm Chansey.
2019-10-09 00:59:24 +11:00
Astrid Halberkamp
6e07bb1ad9
Add battle filter and evasion detection to chat monitor (#5842)
* Update chat monitor to include a battle filter, as well as evasion detection

* Forgot about the roomid rename thing

* Mitigate the first problem hopefully

* Mitigate the second problem in an extremely elegant way

* Precompile the substitutions

* Make this new filter not racist towards nigerians

* Totally not ghostwritten code because i'm really smart

* Small edit
2019-10-06 22:05:53 +02:00
Guangcong Luo
c1ecbc6522 Fix misc validator bugs
- Repealing rules now always works, regardless of rule order
  (Fixes AAA validation)
- Fix a check for egg move hidden ability validation
  (Fixes a Gen 4 Dragon Dance Charizard set)
- Always ban AG when banning Uber
  (Fixes allowing Rayquaza-Mega in lower tiers)
- Fix ability validation in Let's Go
- Fix valid-move-combo dexsearch
2019-10-06 17:21:01 +11:00
Guangcong Luo
71498d451d
New validator (#5840)
* Refactor validator

This is a major refactor intended to make the default rules easier to
understand, and also easier for OMs to bypass.

Removed rules:
- `Pokemon`: This is now `-Nonexistent`. Its previous name was intended
  to be interpreted as "simulate the Pokémon games exactly, and only
  allow what they allow". The new name should make it clearer that it
  mainly bans CAPs and other nonexistent Pokémon and functionality.
- `-Illegal`: This is now `Obtainable` (see below).
- `Allow CAP`: This is now `+CAP`. Instead of having a hardcoded rule,
  OMs can now be manually whitelist any pokemon/item/etc or group of
  them, overriding `-Nonexistent`.
- `Ignore Illegal Abilities`: This is now `!Obtainable Abilities` (see
  below).

`Obtainable` was previously `-Illegal`, and does the same thing: Makes
sure you have a regular Pokémon game with only Pokémon that can be
obtained without hacking.

But instead of being a ban, it's now a rule that does nothing by
itself, except contain more rules:
- `Obtainable Moves`
- `Obtainable Abilities`
- `Obtainable Formes`
- `Obtainable Misc`
- `-Nonexistent`
- `-Unreleased`

This allows OMs to piecemeal repeal and unban any of these individual
rules, instead of the previous approach of unbanning them all and
manually reimplementing every single validation you wanted to keep.

* Refactor PokemonSources into a class

This mostly just makes a lot of the weirder checks in the validator
substantially more readable.

This also renames `lsetData` to `setSources`, which should also help
readability.

* Validate Bottle Cap HP types

Fixes an issue reported here:

https://github.com/Zarel/Pokemon-Showdown/issues/5742#issuecomment-533850288

* Fix several move validation issues

Fixes #5742

We have a new MoveSource type: R for Restricted. R moves work like
level-up/tutor/TM moves, except you're limited to one R move.

- Shedinja move stolen from Ninjask in Gen 3-4 are now R moves instead
  of event moves. This allows them to coexist with Nincada egg moves.

- Necrozma-DW/DM now inherit moves/events from Necrozma (like Rotom,
  but with event validation). This allows them to be shiny.

- Pokemon can now get egg moves from their own evolutions. This fixes
  some Tyrogue, Charmander, and Treecko sets mentioned in #5742

- Some more C moves were added, fixing some Hitmontop and Chatot sets
  mentioned in #5742

* Improve ability/move compatibility validator
2019-10-06 04:21:30 +11:00
whales
d70b8d426e Helptickets: Fix bug in interface 2019-10-05 22:43:10 +09:30
whales
fb469aa3df Fix crash in trivia 2019-10-05 12:10:07 +09:30
whales
d52e57eebd Prevent non-staff from seeing their own IPs (#5845) 2019-10-05 02:38:07 +10:00
HoeenHero
6d070af2c6 userid -> id in scavengers 2019-10-03 21:37:36 -04:00
HoeenHero
b62f7a3e1f Use null over false for nullable syntax 2019-10-03 19:57:53 -04:00
Kirk Scheibelhut
678e548c80 Fix linter errors
eslint:recommended seems tohave gotten more sensitive.
require-atomic-updates was disabled because "I think this is
intentional behavior because that someObj object was read before
await expression and written after await expression." is wayyy
to aggressive: https://github.com/eslint/eslint/issues/11899
2019-10-03 14:26:58 -07:00
HoeenHero
58e2b1dd37 Fix issue with hotpatching minor activities 2019-10-03 14:19:36 -04:00
Spandan Punwatkar
c8873aeec9 Add Announcements (#5404)
(Announcements can't coexist with polls)
2019-10-04 01:21:38 +10:00
Waleed Hassan
da4b887054 Rename Room#id -> Room#roomid, User#userid -> User#id (#5826)
These should make it clearer that userids are IDs but roomids aren't.
2019-10-03 18:57:38 +10:00
urkerab
948257cce7 Change weight units to hectograms (#5765) 2019-10-03 14:00:16 +10:00
asgdf
f4fff94e2e Fix informational link for Snatch/Mirror Move (#5834) 2019-10-02 16:24:08 +04:00
ZestOfLife
69bd7ced2a Mafia: Fix IDEA data (#5831) 2019-10-02 07:54:20 -04:00
HoeenHero
b055697237 Fix more typing in preperation for TS 3.7.0 2019-10-01 21:44:09 -04:00
HoeenHero
9a2c2adf82 Fix bad typing 2019-10-01 19:55:09 -04:00
fart
2e8949b740 Fix typo in banwords reply (#5833)
Correct spelling not succesful
2019-10-01 04:24:30 +02:00
Lusamine
5244315932 Remove "[unregistered]" label on forcerename messages; shorten reused name message (#5832) 2019-09-30 20:00:45 +02:00
asgdf
3648e575a4 Use global modlog for queries in help tickets instead of failing (#5822) 2019-09-28 11:38:40 +09:30
Astrid Halberkamp
487932f04d TOTD: rename atlotd -> athotd 2019-09-25 13:27:08 +02:00
Lusamine
fc887b33e0 Add missing spaces to unticketban and unbattleban modlogging (#5804) 2019-09-21 22:11:26 +09:30
Kirk Scheibelhut
e4f845972b Allow locked players to set modchat in battle (#5803) 2019-09-21 13:02:09 +09:30
Lusamine
4e80031a26 Fix ticketbans logging reasons (#5802) 2019-09-21 12:31:47 +09:30
ayiadvance
6e76cd87ce Mafia Dead List (#5717) 2019-09-18 11:45:39 -04:00
HoeenHero
aac6ecf81b Fix issue with automatic ticket activation 2019-09-17 23:27:59 -04:00
whales
718096b680 Fix tickets with - in the title (#5792) 2019-09-18 09:49:33 +09:30
HoeenHero
05d3142aa2 Tickets: Use inputUsername when getting a ticket 2019-09-17 19:44:34 -04:00
HoeenHero
797e3d255c Empty ticket rooms should be marked as unresolved 2019-09-17 16:20:06 -04:00
HoeenHero
788a95aaa4 Tickets: pad close buttons for mobile & add a ticket stats button in the ticket list 2019-09-17 16:07:59 -04:00
HoeenHero
a5bbf3d0f8 Properly track ticket activations and unclaimed time 2019-09-17 15:49:57 -04:00
HoeenHero
010d2a8f43 Update ticket titles for stats 2019-09-17 14:16:54 -04:00
HoeenHero
7648ecfa4e
Record statistics for help tickets (#5574) 2019-09-17 13:29:16 -04:00
whales
79507c5b2f Helptickets: Improve navigation (#5785)
- Strip metadata when returning to top
- Handle invalid queries more elegantly
2019-09-15 20:11:42 -10:00
Charlie Kobayashi
4b351ed8e9 Add more hunt management options (#5777)
* Add more hunt management options

- Hints: add a command to display hints that can be recalled using /scav hint and /viewhunt for hunts that last several hours.  This allows previously given hints to still be visible even after it scrolls out of chat, or the user uses /clear after completing some difficult param question.  This command cannot be used until after 10 minutes of the hunt.
- /scav status is enhanced to show users who have tried to guess in the last 5 minutes in bold (<strong> for you HTML purists)

This has been approved by all 4 roomowners.
2019-09-15 22:28:05 +02:00
whales
56d2fdb19a Helptickets: Don't drop metadata when going back (#5784) 2019-09-15 01:37:43 -07:00
whales
000e162a09 Fix help tickets (#5782) 2019-09-15 01:21:16 -07:00
asgdf
320e92ab43 Linkify autoconfirmed alt display (#5779) 2019-09-15 01:20:36 -07:00
Ben Davies
a4dfc68526 Bump max room FAQ length to 8KB (#5719) 2019-09-15 06:30:33 +02:00
TheJetOU
f51a1f3742 Add CommandContext method for Chat#(status)filter (#5737)
* Add CommandContext method for Chat#(status)filter

* Don't use instanceof
2019-09-15 06:25:54 +02:00
whales
b8114fbae0 Improve username punishments (#5743)
* Improve username punishments

Track how many times a name has been forcerenamed, note differently for offline warns and forcerenames

* Hyperlink names, show trusted/ac/registered

* rebase

* pseudorank -> accountstatus
2019-09-15 06:25:15 +02:00
Astrid Halberkamp
8abd02cdb5 Poll: Make quizzes less terrible for colorblind people 2019-09-15 02:51:15 +02:00
Astrid Halberkamp
32268b80bf TOTD: Add athlete of the day 2019-09-15 02:19:19 +02:00
Astrid Halberkamp
2dc82f154d Poll: add support for quiz questions using + in options 2019-09-15 02:19:18 +02:00
Astrid Halberkamp
ffa478a9a2 TOTD: add missing page 2019-09-15 02:19:18 +02:00
Astrid Halberkamp
75960ed966 TOTD: anime -> animanga 2019-09-15 02:19:17 +02:00
whales
83e442959b Mafia: Sort rolelist (#5780) 2019-09-14 17:01:38 -04:00
whales
29ad859b10 Helptickets: Show the user or room being reported (#5761) 2019-09-14 11:55:06 -07:00
Guangcong Luo
fb6bb28bb1 Fix whitespace issue in #5772 2019-09-13 02:48:39 -07:00
fart
7af0d8ad77 Add IP lookup link to /alts (#5772) 2019-09-13 02:46:19 -07:00
Astrid Halberkamp
02a04e7c2e TOTD: add anotd for the anime and manga room 2019-09-11 17:28:13 +02:00
Jeremy Piemonte
985caee5ff Blackjack: Fix spacing typo in forceend modlog (#5721) 2019-09-10 22:59:56 -07:00
TheJetOU
f2783c642d Add a RoomID type (#5759) 2019-09-07 14:15:27 -05:00
TheJetOU
cc333f4fdf Improve Lottery (#5748)
- Anyone can now see the amount of participants
- Max winners can't go above `Number.MAX_SAFE_INTEGER`
- `/lottery edit` can be used to edit the lottery
- "Page unavailable" is not shown to guest users, instead the not "allowing guests to join" is deferred to `/lottery join`.
- Punished users are dropped before generating winners
2019-09-06 10:19:42 -04:00
asgdf
5b2f993b12 Fix some small oldgens dexsearch issues (#5750)
* Fix searching by BST with /ds1

* Use gen-appropriate type effectiveness in /ds
2019-09-03 09:58:54 +04:00
HoeenHero
44dcede8ff Fix crash in alts 2019-09-01 14:10:58 -04:00
Kirk Scheibelhut
f936d9d4be Remove extra <br /> in lottery display
This seemed desirable in tested, but probably because I hadn't
refreshed. Also, the creator can wrap their content in a div and
give it a margin-bottom.
2019-08-31 22:19:36 -07:00
Kirk Scheibelhut
92d0df80d9 Tweak lottery page display
Center header/button/results when there's a lottery taking place.
2019-08-31 22:07:49 -07:00
Guangcong Luo
7e58790121 Fix bugs when logging out during a RoomGame 2019-08-31 10:50:00 -05:00
TheJetOU
e476279ba5 /showpunishments: Fix sorting (#5741)
(Thanks to @DaWoblefet for the report)
2019-08-30 13:02:15 -05:00
whales
71f4c020c1 Show trusted status is whois (#5740) 2019-08-30 09:46:57 -05:00
whales
16551a7c5c Typescript lottery (#5739) 2019-08-30 09:12:49 -05:00
TheJetOU
79c42ccac4 Lottery improvements (#5736)
- Fix typos in help command
  - Link lottery in declare message
  - Don't delete lotteries when ended
  - Remove useless if-cond checks
2019-08-27 19:56:14 -07:00
TheJetOU
620fd82376 Add lottery plugin (#5722) 2019-08-26 09:56:01 -07:00
TheJetOU
2b28c9fd6b Refactor Rooms(), Users() to Rooms.get(), Users.get() (#5725) 2019-08-25 06:33:56 -07:00
ayiadvance
461583ee48 Role Clarifications in /mafia dt (#5705)
Created distinctions between:
Role Cop and Role Cop (Classic)
Red Goo and Red Goo (Cracking Idea)
Neapolitan and Vanilla Cop

Also clarified some roles and standardized how Idea Variant roles are listed.

Added a distinction between Silencer and Silencer (Greater Idea) and between Grey Goo and Grey Goo (Cracking Idea). Also added the (xxx Idea) tag to the roles in their respective ideas.
2019-08-23 07:40:07 -04:00
whales
ffcdadf3bb Mafia: Implement forced selflynch, disabling hammer (#5718) 2019-08-23 07:35:29 -04:00
HoeenHero
7bbec56c33 Allow moderators to view room faq sources 2019-08-20 15:54:58 -04:00
TheJetOU
8f02f0aab8 Revert "Add margin in helptickets (#5713)" (#5720)
This reverts commit f128b74276.
2019-08-19 11:40:39 -07:00
supermii2
c48ca2c8c5 Add mirror flag to movesearch. (#5716) 2019-08-18 15:59:02 +02:00
whales
7eee6b3489 Fix URL for snatch and mirror dex lists (#5715) 2019-08-18 09:12:48 -04:00
Jeremy Piemonte
5beddaa839 Blackjack: Various improvements and bug fixes (#5714)
- Ensure the first card of the dealer is on the top of the turnlog
- Don't allow people to use the command to start the game if the game has already started
- Use user names instead of user ids in the initial playerlist for join messages
- Modlog conditionally if the game was ended forcibly or not
2019-08-17 22:18:39 -07:00
TheJetOU
f128b74276 Add margin in helptickets (#5713) 2019-08-17 20:50:13 +02:00
supermii2
29655db703 Add descriptions for charge/recharge moves in /dt (#5712)
Charge moves and Recharge moves will have a tag when using /dt, similar to other tags like "Supressed by Gravity"
2019-08-17 10:37:02 +02:00
supermii2
5c45b6dca0 Added various flags to movesearch (#5707)
- added flags for charge, gravity, recharge and reflectable
2019-08-16 22:47:40 +02:00
RyotaMitaraiWeb
ee0575a6f3 Minor typo fix in /itemsearch help (#5709) 2019-08-16 21:57:32 +02:00
TheJetOU
f4e6fd7584 Implement a /showglobalpunishments command (#5703) 2019-08-15 20:25:30 +02:00
TheJetOU
5597916644 TypeScript Rooms and Roomlogs (#5699) 2019-08-14 20:44:57 +02:00
Nol
e016f6defa Fix typo when game of blackjack is ended (#5704) 2019-08-13 15:07:27 -07:00
ayiadvance
76af6c5a12 Updated /intro (#5698) 2019-08-13 14:49:02 -07:00
RyotaMitaraiWeb
239d354adf Update a link in the /intro command (#5697) 2019-08-12 16:09:30 -04:00
TheJetOU
4b0be1b5b4 TypeScript RoomGame and RoomBattle (#5692) 2019-08-11 17:03:36 +02:00
whales
a04f3dc7ad Rework enabling mafia to be more like other chatgames (#5689) 2019-08-10 16:59:54 -04:00
Jacob McLemore
91f81460cb Scavengers: Add Recycled Hunts functionality (#5666) 2019-08-09 09:33:21 +02:00
whales
90babd72b9 Fix disabling mafia (#5686) 2019-08-08 21:04:41 -07:00
Bär Halberkamp
3a278dd2a8 First batch of commands to make translatable 2019-08-09 02:53:11 +02:00
whales
0dd9e0813f Separate add and regexadd in /banword (#5687) 2019-08-08 14:26:18 -07:00
Jeremy Piemonte
83bb9a3180 Implement blackjack game (#3726) 2019-08-06 20:23:08 +02:00
maxalexandderpi
54a4baedaf Let users see who made a hangman/poll (#5680) 2019-08-05 23:59:59 -05:00
Guangcong Luo
00184f61b2 Fix modchat permission check
It was interacting badly with the new code to give drivers moderator
permissions in battles.
2019-08-05 17:23:26 -05:00
Kris Johnson
368cce2be6 OM: Add /crossevolve command for Cross Evolution (#5673)
* OM: Add a crossevolution command

* oops

* Add /crossevolve command for Cross Evolution
2019-08-05 12:13:14 +04:00
Slayer95
2989e653dd
Info: Fix target validation in /host 2019-08-03 23:26:05 -05:00
Kirk Scheibelhut
7f4dd13aec Update /punishlog tags 2019-08-03 12:52:27 +02:00
Kirk Scheibelhut
e8b3343ba4 Add MAFIAHOSTBAN to punishlog
Mafia specific, but still enough of a punishment to perhaps be
useful when viewing a user's punishment history.
2019-08-03 12:35:43 +02:00