Commit Graph

23714 Commits

Author SHA1 Message Date
Guangcong Luo
4052b28cec Refactor event validator
This is a huge refactor that consolidates many different places event,
DW, and VC moves are validated, so that they're now validated in the
single place Validator#validateEvent. DW and VC moves are now treated
as special cases of events.

Validator#checkLearnset now does zero validation of event, DW, and VC
moves; it now simply passes the list of possible sources back to
Validator#validateSet, and it's validateSet's job to determine if the
Pokemon meets the requirements for any of those sources.

(In addition to simplifying checkLearnset, this also means more
useful error messages if you fail to meet the requirements for an
event move or DW move.)

validateSet should also be a decent margin simpler, due to a lot of
its code being folded into validateEvent.
2017-02-24 00:38:47 -06:00
PainterEspeon
59a9d8bd8c Change to /scavengerhelp (#3033)
Changed "/scavenge <em>guess</em>" to "/scavenge _______" in the /scavengerhelp command. Especially considering UGM is beginning effective today-ish, helps make the command more clear to new users and get them acclimatized to the room. There has been recurring issue for a long time of new users believing that they need to type "/scavenge guess [their answer]" instead of "/scavenge [their answer]," the latter of which is correct.
2017-02-24 00:33:19 -06:00
Kris Johnson
621b737ca3 info.js: add Ash-Greninja exception (#3282) 2017-02-23 18:25:58 -06:00
Guangcong Luo
e7e3520d99 Fix Virtual Console validation
Virtual Console validation wasn't happening for Pokemon who learn a
move from Virtual Console from multiple Pokemon in its evo family.

This is most relevant for No Guard Fissure Machamp, which shouldn't
be legal.
2017-02-23 17:32:32 -06:00
Guangcong Luo
4d2e36e30c Fix crash in validator 2017-02-23 17:23:54 -06:00
Guangcong Luo
f2319da74e Fix Hidden Power Dark validation 2017-02-23 18:31:13 -05:00
Guangcong Luo
97b0652b0d Unban Soul Dew in Gen 7 BS/VGC 2017-02-23 18:22:46 -05:00
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
Guangcong Luo
d7f180954f Comment out unused Gen 1 setupType 2017-02-23 05:24:45 -06:00
Guangcong Luo
54df5c857d Validator: Support Gen 1 Virtual Console moves
This adds validator support for Gen 1 Virtual Console moves.

Fixes #3208

If anyone wants the quick-and-dirty eval script I used to update
Learnsets:

```
Object.entries(Tools.mod('gen1').data.Learnsets).forEach(([speciesid, lset]) => {
	Object.entries(lset.learnset).forEach(([moveid, sources]) => {
		if (sources.some(s => s.startsWith('1L') || s.startsWith('1M'))) {
			let newLset = Tools.data.Learnsets[speciesid].learnset;
			if (!newLset[moveid]) newLset[moveid] = [];
			let i = 0;
			while (i < newLset[moveid].length && newLset[moveid][i].startsWith('7')) i++;
			newLset[moveid].splice(i, 0, '7V');
		}
	})
})
```
2017-02-23 05:23:14 -06:00
Guangcong Luo
d8d56163a6 Fix /savelearnsets
No one has reported its brokenness in ever! I guess I'm the only one
who scripts learnset changes with /eval...

Coming up next: A learnset change scripted using /eval!
2017-02-23 05:13:00 -06:00
panpawn
66c38b7430 Change Player rank from ★ to ☆ (#3240)
There is a client-side counterpart to this.
2017-02-23 05:03:45 -06:00
Kevin Lau
50795768e8 Add various Z-Status Move tests (#3279) 2017-02-23 04:54:04 -06:00
Kevin Lau
05f34da175 Random Battle: Reject Sheer Force Conkeldurr (#3277)
Sheer Force only boosting one of its moves is rather mediocre compared to
Iron Fist boosting most of its moves, or Guts for even more raw power.
2017-02-23 02:04:28 -06:00
sparktrain
ee5f31bc71 Fix /caphelp (#3275)
Switch the HTML to unicode so the é displays correctly
2017-02-22 22:37:45 -06:00
Dan Pantry
9c65c5b84a add mock for battle tests that can reset the RNG
This enables battles in tests to reset their RNG to what it originally
was when they were created. A number of tests do this already by
breaking encapsulating and modifying the prng variable directly. This
should fix that.

We also remove createBattleWithPRNG and min/maxSeed properties.

Firstly, the tests that were still using the maxSeed property were
setting it to Battle.seed which has no effect since the PRNG class does
not look at this property any more - so these were no-ops.

After removing this property from tests, maxRollSeed was never used, so
I removed it and renamed minRollSeed to DEFAULT_ROLL_SEED (since it's
constant).

The places that were still using minRollSeed also were no-ops or were
using createBattleWithPRNG. Since every single instance was actually
just using the same code, I removed createBattleWithPRNG and made
createBattle default to giving you a seed with DEFAULT_ROLL_SEED and
removed the minRollSeed property too.

This makes tests much simpler and reduces the usage surface of
TestTools; now, you must define your *own* seed if you're making a PRNG
for a test, or you use one that TestTools gives you; you may not use a
public property that TestTools gives you.

We also remove the code that removes a listener in the Battle Engine.
This was rendered obsolete by f6a7c4b (see more info [in the discussion
on github][disc]

[disc]:
https://github.com/Zarel/Pokemon-Showdown/pull/3272#discussion_r102414795
2017-02-22 20:44:20 -05:00
Dan Pantry
89d4265be8 don't rely on global BattleEngine in tests
This is necessary for us to introduce a mock object.
2017-02-22 20:44:20 -05:00
Dan Pantry
56ba782966 refactor PRNG to its own class
This removes the 'deterministic test' tools by preventing action at a
distance (namely, preventing the modification of the `init` method in
`Battle` during tests). This action at a distance is incredibly
confusing.

All this action at a distance did was discard any parameters that were
passed to `Battle` that weren't the first three (which was probably a
mistake by the original author) and also hard code `this.seed` and
`this.startingSeed` in `Battle`.

This functionality has now been moved to the `PRNG` class, so instead
users should pass a `PRNG` to `Battle` as the 5th constructor argument.
Users can also pass one as the third argument to `common.createBattle`
or use `common.createBattleWithPRNG` with the PRNG as the first
argument.

The PRNG is just an encapsulation of the pseudo-random algorithm in a
class. It is stateful, so make sure to take a `clone()` of the PRNG if
you want to re-use it.
2017-02-22 20:44:20 -05:00
CheeseMuffin
b0278d59f9 Fix typo in chat.js (#3274) 2017-02-22 16:47:00 -06:00
xCrystal
2abd1dbef5 Gen 1 Random Battles: Improve movesets and balance (#3210) 2017-02-22 16:46:32 -06:00
Spandan Punwatkar
17665eb1e2 Update Ability Clause to also check for Variants (#3269) 2017-02-22 23:48:55 +04:00
Guangcong Luo
151bbf5b41 Slightly refactor event validation
Now with slightly less redundant code!
2017-02-22 05:06:39 -06:00
Guangcong Luo
2d6bd87c0b Improve Hidden Power validator
Now that we now store Hidden Power type separately from IVs, we can
make some major changes to how Hidden Power is validated.

Instead of Hidden Power type being calculated from the IVs, it's now
sent separately as part of the set. This allows us to warn in the
validator if the Hidden Power type specified by the moveset is
different from the one calculated from the IVs, and give a validation
error if so.

This also allows us to validate the Hidden Power type (pre-bottle-cap
IVs) separately from the set IVs (post-bottle-cap IVs) when doing
event validation, which fixes some validation issues relating to
Hidden Power.
2017-02-22 04:39:03 -06:00
Guangcong Luo
e99104b064 Refactor Hidden Power calculation to Tools
Hidden Power was previously in BattlePokemon's constructor, but it's
been moved to Tools where the calculation can be accessed externally
(relevant for team-validator).
2017-02-22 02:59:51 -06:00
MacChaeger
d30b75c9f0 Fix Typo (#3273) 2017-02-21 23:21:25 +04:00
TheRealQuote
7c7928d7c3 UU Changes (#3270)
Banning Victini and dropping down Staraptor as per this post: http://www.smogon.com/forums/threads/np-sumo-uu-stage-1-feels-like-we-only-go-backwards.3595341/page-2#post-7241566
2017-02-21 19:48:59 +04:00
Bär Halberkamp
ce2e82adfc FAQs: sort /roomfaq topic list alphabetically 2017-02-21 14:50:19 +01:00
Guangcong Luo
5c97a0a1a6 Improve fastUnpackTeam error handling
We now add split limits to the uses of String#split in fastUnpackTeam.

This helps slightly improve performance in certain weird scenarios, but
mostly isn't particularly consequential.
2017-02-21 01:24:44 -06:00
Guangcong Luo
0c98319d2b Don't add "Z-" to "Extreme Evoboost"
This uses a better rule for detecting for whether or not a move is a
status Z-move.

Closes #3268
2017-02-21 01:12:11 -06:00
The Immortal
6e64958115 Inheritance: Ban Pheromosa 2017-02-20 18:30:36 +04:00
Guangcong Luo
6e4f1cfb35 Remove Pokestar learnsets
The Pokestar learnsets cause client build errors because they refer to
nonexistent Pokedex entries, so they need to be removed.
2017-02-20 03:21:40 -06:00
Kevin Lau
b8d1f0b45e Random Doubles: Use Wishiwashi-School for calculating Wishiwashi level (#3266) 2017-02-20 02:34:32 -06:00
Guangcong Luo
402bb7bd84 Support HP type and Pokeball in packed teams
This is a refactor that doesn't really do much by itself. In the long
term, though, this will allow us to better support these things.
2017-02-20 02:13:28 -06:00
Quinton Lee
b88b9a19cc Fix Smeargle forme name 2017-02-19 20:56:35 -06:00
Kris Johnson
7fd960be50 Formats: Update OM descriptions (#3249)
* Formats: Update OM descriptions

* Update formats.js
2017-02-20 02:37:16 +04:00
Marty-D
fc708a675e Doubles Ubers: Ban Dark Void 2017-02-19 17:20:09 -05:00
MacChaeger
05a140b671 Add Pokestar Studios SFX props and actors (#3205) 2017-02-19 16:17:06 -06:00
HoeenHero
774427d8d0 Gen 6: Keep old pokedex colors (#3248) 2017-02-19 14:38:28 -06:00
MacChaeger
25b0e0aae3 Challenge Cup: Fix Wishiwashi's level (#3246) 2017-02-19 01:26:51 -06:00
Marty-D
8a3e4e5ac1 Fix Trace 2017-02-18 23:04:28 -05:00
HoeenHero
86f934f893 Update Pokedex colors (#3244) 2017-02-18 09:56:00 -05:00
Marty-D
cbfd339e0e Update move descriptions 2017-02-17 19:48:31 -05:00
panpawn
4b55306043 Promote: String standards (#3051) 2017-02-17 14:12:47 -06:00
Marty-D
c66ebaed3c Update Ability descriptions 2017-02-17 15:08:48 -05:00
Spandan Punwatkar
eb08d10522 Remove unused Tier Shift mod (#3056) 2017-02-16 22:12:15 -06:00
Ben Davies
93357df2dc Add /man alias for /help (#3094) 2017-02-16 22:06:58 -06:00
Guangcong Luo
2b75907975 Validator: Allow Gen 6 Pokemon in Battle Spot
Previously, "requirePentagon" meant "only allow current-gen Pokemon".

Now, "requirePentagon" means "allow Gen 6 Pokemon and later", and
"requirePlus" means "allow Gen 7 Pokemon and later".
2017-02-16 01:17:54 -06:00
Guangcong Luo
0bcad8de6c Validator: Refactor and comment validator flags 2017-02-16 01:17:54 -06:00
Guangcong Luo
6423c3f1e4 Validator: Pokebank has been released 2017-02-16 01:17:54 -06:00