Commit Graph

23714 Commits

Author SHA1 Message Date
Guangcong Luo
1c62891008 Document new Sim API 2018-01-28 21:23:06 -06:00
Guangcong Luo
4c0699abc6 Implement inputLog
A battle's inputLog is now stored separately from the output log. It's
not an exact log of inputs, but rather just a collection of the inputs
that resulted in the battle: a default choice expands to the choice
that was actually used, and the starting seed is logged whether or not
it was explicitly passed into the battle stream.

Fixes #4348

Fixes #3201
2018-01-28 21:23:06 -06:00
Guangcong Luo
1531b662c6 Refactor battle stream system
This contains a lot of minor refactors, but the main thing that's going
on here is that battle stream writes have been streamlined to be a lot
easier for others to use.

We even support:

    ./pokemon-showdown simulate-battle

which provides a stdio interface for anyone using any programming
language to simulate a battle.
2018-01-28 21:06:49 -06:00
Guangcong Luo
a0da191024 Improve ./pokemon-showdown commands
./pokemon-showdown help

will now display all the possible ways to use PS on the command-line,
of which there are several new ones:

    ./pokemon-showdown validate-team
    ./pokemon-showdown unpack-team
    ./pokemon-showdown pack-team
2018-01-28 21:06:49 -06:00
Guangcong Luo
b9aba16b52 BattleStream: Refactor message types
The previous complement of way too many message types:

- update, winupdate, sideupdate, request, score, log

are now only:

- update, sideupdate, end

`score` was removed in the previous commit, and this commit adds a new
message type `end`. `end` replaces the previous `log`, and also
contains the data for `winupdate` and `score`.

`request` was also folded into `sideupdate`.
2018-01-28 21:06:49 -06:00
Guangcong Luo
6f2b1c0cd8 Battle protocol: Remove score message
score sending is now combined with the log message.
2018-01-28 21:06:49 -06:00
Guangcong Luo
f756b22dc7 Implement |bigerror|
Battles now send their errors using |bigerror|, which requires less
escaping and also correctly reports errors.
2018-01-28 21:06:49 -06:00
Guangcong Luo
9c037b17fe Refactor Battle constructor
`Sim.construct` no longer exists. Battles are now constructed directly
with `new Battle()`. Parameters other than formatid are now passed as
`options`.
2018-01-28 21:06:49 -06:00
urkerab
cdb12bd696 Fix last item handling (#4383) 2018-01-28 20:05:44 -06:00
Guangcong Luo
de7c58aad7 Validator: Fix egg move checking 2018-01-28 15:37:18 -05:00
Guangcong Luo
06bc0651b9 Fix room detection for doubles tier /data 2018-01-28 15:36:58 -05:00
Guangcong Luo
b19e1b819e
Fix typo in previous commit 2018-01-28 13:30:00 -06:00
Guangcong Luo
bf67a69606
Team Validator: Fix babyOnly check 2018-01-28 13:29:03 -06:00
Guangcong Luo
cd946a0a41
Correctly refactor Mew/Celebi checks 2018-01-28 12:24:42 -06:00
Marty-D
f0e180db0b
Validator: Refactor Mew/Celebi checks 2018-01-28 18:20:34 +00:00
Marty-D
ed519524b1
Gen V LC: Unban Carvanha 2018-01-28 17:22:23 +00:00
Marty-D
a9d9e199b3
Validator: Add VC level and Ball requirements 2018-01-28 17:17:30 +00:00
Guangcong Luo
f7c5f667ba Gligar is LC in Gen 4 2018-01-28 10:45:28 -06:00
Guangcong Luo
4f64074b6c Improve evolution move validation
This is specifically made to fix Nasty Plot + Surf Raichu.

Specifically, prevo moves are no longer compatible with evo event
moves.

Other incompatibilities (specifically, modern prevo moves with old-gen
evo moves) will be harder to fix, unfortunately.
2018-01-28 10:37:43 -06:00
Guangcong Luo
74143b652d Workaround for Celebi VC validation 2018-01-27 22:38:56 -06:00
urkerab
33c6033a5b Targets of the wrong type are immune to Synchronoise (#4381) 2018-01-27 18:10:11 -06:00
Marty-D
878060795f
Update modlog permission check 2018-01-27 22:12:46 +00:00
Marty-D
27dc108d6c
Fix forme tiering in past gens 2018-01-27 04:22:50 +00:00
KrisXV
85a6df66f4 Add UU Suspect Test (#4378)
http://www.smogon.com/forums/threads/3627043/
2018-01-26 19:45:02 -06:00
Guangcong Luo
a22d1d7b20 Fix doublesTier
Should now correctly display NFE and LC tiers.
2018-01-26 18:40:24 -06:00
Bär Halberkamp
9d8bb36081 Wifi: update wording 2018-01-27 00:49:55 +01:00
Guangcong Luo
c9b075ce1f Fix Doubles tiers 2018-01-26 14:26:09 -06:00
Guangcong Luo
2874492f94 Don't overwrite tier 2018-01-26 14:24:54 -06:00
KrisXV
aefa8c986a Add doublesTier (#4339) 2018-01-26 14:23:38 -06:00
cant say
28a5e005c0 Add UB aliases (#4379) 2018-01-26 08:51:53 -05:00
KrisXV
d31fd3e353 UU: Unban Mega Houndoom and ban Drought (#4377)
http://www.smogon.com/forums/threads/3627043/
RU doesn't want Drought banned:
http://www.smogon.com/forums/threads/3625382/#post-7664690
2018-01-25 22:11:10 -06:00
Marty-D
16b0dbfa71 Revert "Learnsets: Remove Crystal-only VC egg moves"
This reverts commit aebe3634cc.
2018-01-25 21:55:27 -05:00
Marty-D
a9e694e909 Revert "Learnsets: VC Celebi is unreleased"
This reverts commit 5be3eb4ac4.
2018-01-25 21:44:15 -05:00
Jeremy Piemonte
22f6452849 Log when a room is deregistered and by who (#4376)
(Like the behavior of /deleteroom)
2018-01-25 18:34:36 -06:00
Lycanium-Z
7ff401439c Block making polls in battles (#4375) 2018-01-25 08:43:16 -06:00
Guangcong Luo
4ef1c58606 Refactor various files for modern string standards 2018-01-24 15:47:18 -06:00
ABC-Dragon-Buster
9a6a5fba3b Improve descriptions for various formats (#4294) 2018-01-24 15:14:00 -06:00
KrisXV
ebd832a91c Dexsearch: Fix "!weak" (#4374) 2018-01-24 15:12:57 -06:00
Guangcong Luo
d8d75d0453 Refactor /deleteroom 2018-01-24 15:12:36 -06:00
Hidden50
526bf3e2e8 /deletegroupchat: Simplify usage (#4359)
To avoid deleting the wrong room by accident, deleteroom requires typing out the full room name.

This PR removes that requirement for personal rooms. It also addresses the following issues with the permission check:

(1) The auth check looks at ``room.isPersonal`` instead of ``targetRoom.isPersonal``.

This should allow any room owner to delete their room if they do it from a groupchat, even if they do not have the makeroom permission.

(2) The room is searched for before permissions are checked. That creates an information leak. Any user can do the following:
- Use on an existing room: /deleteroom - Access denied.
- Use on a non-existing room: The room 'yxxyxyxyxxyy' doesn't exist.
2018-01-24 15:04:06 -06:00
Ricky Amparo
8e12a7ffd0 Tests: Refactor more tests to use makeChoices() (#4325) 2018-01-24 14:56:58 -06:00
Dan Huang
9c37960ab6 Use PRNG in sim/ files (#4365) 2018-01-24 12:27:07 -06:00
Bär Halberkamp
1656ef5429 TOTD: fix automatic ending of nominations 2018-01-24 16:40:19 +01:00
Bär Halberkamp
25d593debf TOTD: correctly reset voting to false 2018-01-24 16:29:38 +01:00
Marty-D
cdd0249cbb
Add Gen 3 UU challenge format 2018-01-24 14:45:44 +00:00
HoeenHero
323a54eac5 Allow room staff to post more lines at once (#4368) 2018-01-24 07:45:27 -06:00
KrisXV
43c209155c Dexsearch: Add "weak" parameter (#4370) 2018-01-23 19:27:08 -06:00
HoeenHero
f59912a56a Fix /evalbattle (#4372) 2018-01-23 19:25:18 -06:00
HoeenHero
cba84970ed Fix crash in thing-of-the-day (#4371) 2018-01-23 20:25:00 -05:00
Marty-D
d622166c65 Revert "Update credits (#4369)"
This reverts commit 7f857b575e.
2018-01-23 16:44:57 -05:00