Commit Graph

1964 Commits

Author SHA1 Message Date
Guangcong Luo
b4a7475c40 Don't allow arbitrary HTML in |expired| 2016-01-01 19:45:27 -05:00
Guangcong Luo
95c7c4a257 Tooltips: Past gen support and better move descriptions 2016-01-01 18:36:58 -06:00
Guangcong Luo
7d44cc2caf Fix weird alignment in move tooltips 2016-01-01 18:36:58 -06:00
Guangcong Luo
33959c2cf9 Refactor BattleTooltips
We now move most tooltip logic to client-battle-tooltips.js.
2016-01-01 18:36:58 -06:00
The Immortal
fdd3d789f0 Teambuilder: Fix Rotom formes and Pumpkaboo-Super 2016-01-02 00:31:53 +04:00
Harshvardhan Kalra
52a0ed9fe7 Incorrect check in teambuilder 2016-01-01 21:53:22 +05:30
Harshvardhan Kalra
d70f484c89 Redundant checks in teambuilder 2016-01-01 21:14:07 +05:30
Marty-D
95a1995fcc Remove Flower from Floette Eternal's forme name 2015-12-31 20:34:10 -05:00
Guangcong Luo
b0dd435d8c Support specific room expiration message 2015-12-31 18:55:58 -05:00
Guangcong Luo
59824eaecf Teambuilder: Toxic is useless in gen 1 2015-12-31 00:44:13 -05:00
Guangcong Luo
6c1a5918fb Teambuilder: Fix old-gen stats appearing in gen 6 2015-12-31 00:35:15 -05:00
Guangcong Luo
dd4e9ae51c Support ladder resets
A lot of this stuff involves the website itself, but this part is
the part contained in the client.
2015-12-31 00:33:47 -05:00
Guangcong Luo
3eb3451213 Support protocol-relative URLs in the interstice 2015-12-31 00:31:21 -05:00
The Immortal
e8b75da191 Set Gyro Ball as viable for slow Pokemon only 2015-12-30 21:33:48 +04:00
urkerab
c091da039b Properly calculate DVs when calculating stats in Gen1/2 2015-12-30 17:32:05 +00:00
Guangcong Luo
2ecd45e900 Merge pull request #596 from urkerab/tooltip-item-power-fixes
Tooltip item power fixes
2015-12-30 16:36:38 +00:00
Guangcong Luo
f425444906 Merge pull request #597 from sirDonovan/storage
Avoid crashes from disabled cookies
2015-12-30 16:34:50 +00:00
Guangcong Luo
cbe5e0a60e Teambuilder: Change some move/item sections 2015-12-30 11:02:30 -05:00
sirDonovan
dd24ed5489 Avoid crashes from disabled cookies
Accessing localStorage when cookies are disabled throws a SecurityError in some browsers.
2015-12-30 03:57:30 -06:00
urkerab
7048d49db1 Use boost value function to simplify boost calculation code 2015-12-30 00:40:28 +00:00
urkerab
e28316d48d Create seperate function to return the boost value 2015-12-30 00:40:22 +00:00
urkerab
99d20f70ed Make item boost calculation check for item too, simplifies callers 2015-12-30 00:37:43 +00:00
urkerab
0b22081e7b Correctly apply Technician before item boost to Ball move 2015-12-30 00:37:43 +00:00
urkerab
73432847b4 Move some variables nearer to their use 2015-12-30 00:37:43 +00:00
urkerab
6e15608253 Simplify application of Technician and item to Ball type move 2015-12-30 00:37:43 +00:00
urkerab
630dfd311a Return the base power when affected by Magic Room or embargo 2015-12-30 00:37:42 +00:00
urkerab
818c367e5b Fix bug with interaction between gems and Pledge moves 2015-12-30 00:37:42 +00:00
urkerab
2368abeb49 Remove useless basePower check - basePower is always nonzero by now 2015-12-30 00:37:42 +00:00
urkerab
5ac9fdf6f8 Call getMoveType correctly 2015-12-30 00:37:28 +00:00
urkerab
24730fa2f5 Remove unused variables 2015-12-29 18:52:08 +00:00
Guangcong Luo
e7a5cada72 Teambuilder: Fix filtering learnsets
They now only apply to learnsets for the selected gen.
2015-12-29 11:34:03 -05:00
Guangcong Luo
29cc2dd0c6 Redesign ladders 2015-12-29 11:34:03 -05:00
Guangcong Luo
41ec617dbd Make Popup a bit more flexible 2015-12-29 11:34:03 -05:00
Guangcong Luo
d93473eb2d Redesign options menu slightly
A few options are reworded, it's been split into two sections, and
section headers are now slightly smaller.
2015-12-29 11:34:03 -05:00
Guangcong Luo
26c91d8134 Teambuilder: Improve sprites
We now show sprites corresponding with the gen in the teambuilder, and
for gen 6, we now show ORASdex sprites.
2015-12-29 11:33:26 -05:00
Guangcong Luo
f6e9f1ab79 Teambuilder: Fix gen 1-2 EV selection 2015-12-29 11:33:26 -05:00
Guangcong Luo
63a0b38202 Merge pull request #593 from panpawn/patch-2
Mouseovers for users/battle on joinroom page
2015-12-29 03:41:03 +00:00
panpawn
ae9868f06b Mouseovers for users/battle on joinroom page
For the users button, this adds the mouse-over message "Find a user online." and for the battle button, "Find an active battle.".
2015-12-29 03:20:02 +00:00
Guangcong Luo
8afb0d78f2 Merge pull request #574 from hvk3/master
Added gem-boosted powers to move description
2015-12-29 03:16:40 +00:00
Marty-D
8aecfc7364 Remove type changes when changing forme 2015-12-28 16:57:21 -05:00
urkerab
c05572e4f3 Don't unnecessarily update the tournament team selector 2015-12-28 12:54:34 +00:00
Harshvardhan
311acb8fcd Added support for all power-boosting items
Removed redundancy from code

Moved to tooltips file

Reduced code

Reduced code

Reduced code

Reduced globals to 1

Minor error corrections
2015-12-27 21:21:26 +05:30
hvk3
df4cc30de4 Added gem-boosted powers to move description 2015-12-27 19:30:01 +05:30
Guangcong Luo
3621eb4519 Correctly set Hidden Power DVs in Gen 2 2015-12-26 10:04:12 -05:00
Guangcong Luo
863cdcb962 Teambuilder: Don't change folder when dragging teams
This allows multiple pokemon to be more easily dragged from one folder
to another.
2015-12-26 10:00:37 -05:00
Guangcong Luo
77586e9d07 Hardcode more offsets for XY models in teambuilder 2015-12-26 09:58:38 -05:00
Guangcong Luo
b64dd64cd8 Track banned Pokemon for VGC 2015-12-26 09:57:14 -05:00
Guangcong Luo
69c4670d3d Merge pull request #587 from urkerab/closehide-medium-window
Properly close and hide the Rooms room when you click Hide
2015-12-25 20:38:21 +00:00
urkerab
6f040fcf76 Properly close and hide the Rooms room when you click Hide 2015-12-25 18:20:47 +00:00
Marty-D
4d75e9def2 Support Cosplay Pikachu icons 2015-12-25 12:32:50 -05:00
Guangcong Luo
d2bccb20de Use XY models in teambuilder
This removes some gradients and shadows, but it's totally worth it.
2015-12-25 10:48:09 -06:00
Guangcong Luo
a9ab52c9c8 Support pressing Up/Down in teambuilder lists
It should now be a bit easier to select pokemon/moves/etc with the
keyboard.
2015-12-25 10:45:00 -06:00
Guangcong Luo
3509b782f7 Use new-size pokemon icons in Switch menu
This also slightly redesigns the switch menu.
2015-12-24 17:07:29 -06:00
Guangcong Luo
7aaf8f3cdb Use new-size icons for team lists 2015-12-24 14:58:53 -06:00
Guangcong Luo
831df091fe Fix crash in Pokedex 2015-12-24 16:06:35 -05:00
Guangcong Luo
e529618c72 Fix Primal Groudon and Kyogre icons 2015-12-24 16:06:27 -05:00
Guangcong Luo
fa09ddcf8a Teambuilder: Use new icons in teambar 2015-12-24 12:38:30 -05:00
Guangcong Luo
fac99e2091 Teambuilder: Fix bug in remaining EV display 2015-12-24 12:38:11 -05:00
Guangcong Luo
97a4fe0f73 Fix new Hoopa-Unbound icon 2015-12-24 12:03:41 -05:00
Guangcong Luo
e3c6ee5bdf Teambuilder: Fix bug in filtering Pokemon by learnset 2015-12-24 11:52:38 -05:00
Guangcong Luo
5c96d91afc Teambuilder: Improve item and move ratings 2015-12-24 11:35:23 -05:00
Guangcong Luo
5c3fd929d1 Teambuilder: Use new XY pokemon icons 2015-12-24 11:33:26 -05:00
Guangcong Luo
74c57ab6af Teambuilder: Past gen pokemon/move/item descs
Past gen pokemon/moves/items in the teambuilder now display past gen
stats and descriptions.

This in theory completely finishes up past gen support for the teambuilder.
2015-12-24 11:33:26 -05:00
Guangcong Luo
4c3d1af539 Teambuilder: Fix gen 1-2 EV/IV display
- Gen 1-2 DVs are now shown properly as a 1-15 range.
- Gen 1-2 no longer display a total EV count.
- Fix an alignment issue with gen 1 calculated stats
2015-12-24 11:33:25 -05:00
Guangcong Luo
04a27253e3 Teambuilder: Properly support gen 1-2 learnsets
This also adds a cached learnset format to teambuilder-tables.js,
which replaces and is slightly smaller than learnsets.js and also
has slightly better performance.
2015-12-24 11:33:25 -05:00
Guangcong Luo
4ffd1034e0 Teambuilder: Item sections and past gen items 2015-12-24 11:33:25 -05:00
Guangcong Luo
dcea9e3cd0 Teambuilder: Past gen ability selection
The Ability menu now works correctly for past gen formats.
2015-12-24 11:33:25 -05:00
Guangcong Luo
4981a223b0 Teambuilder: Improve past gen support
This is a large collection of changes that greatly improve past gen
support in the teambuilder.

- Tier lists are now compiled separately from each gen (build-indexes
  is really slow about this, which isn't particularly surprising),
  as well as for Doubles.

- Learnsets are now compiled separately from each gen. TODO: make an
  optimized learnsets.js with gen 1-2 support for client.

- Types in the pokemon list now account for old gens.

- Abilities no longer display in the pokemon list in gen 1-2

- SpA/SpD are replaced by Spc in the pokemon list in gen 1

Also included: A small optimization to the number of DOM nodes for the
teambuilder display, which should improve performance.
2015-12-24 11:33:25 -05:00
Guangcong Luo
7ab1cfbbc4 Teambuilder: Fix scrolling on mobile 2015-12-24 11:33:25 -05:00
Guangcong Luo
b4d023801e Teambuilder search: Tweak on-demand rendering-to-DOM
Now faster and more on-demand!
2015-12-24 11:33:25 -05:00
Guangcong Luo
6e808839c3 Major rewrite to searching
The search.find() and search.all() functions have been merged.

search.find() now finds "all" results, not just the first 20. It's now
also much more thoroughly commented.

In addition to showing all results, this rewrite makes the following
changes:

- Search aliases! Acronyms can be used for anything (so typing in 'ao'
  matches "Adamant Orb"), and subwords can be searched (so typing in
  'berry' gives a list of all berries). Subwords and acronyms will
  always appear below prefix matches.

  Note: we have no plans to add back support for arbitrary substring
  matching. It's ridiculously esoteric and the acronym support should
  be enough.

- Instafilter! If you type enough characters to make it clear what you
  want to filter by, the filtered results will appear without you
  needing to press Enter or click the filter. This is useful because
  filters are no longer at the top of the list and can be annoying to
  click.

- Moves are now always above filters when searching moves. Legal moves
  are now always above illegal moves.

- On-demand rendering-to-DOM has been tweaked to be faster and more
  on-demand.

- Miscellaneous bugfixes to search results.
2015-12-24 11:33:25 -05:00
urkerab
6dfbb06c4b Properly calculate EV spreads for level 1 2015-12-24 00:50:22 +00:00
Guangcong Luo
579cf92fec Fix style error 2015-12-22 12:20:11 -05:00
Guangcong Luo
b7f5026b56 Teambuilder: Show OU on top for unofficial formats 2015-12-22 12:20:00 -05:00
Guangcong Luo
435b306ef9 Fix teambuilder crash in desktop client 2015-12-22 12:11:40 -05:00
Guangcong Luo
a76b0b95ef Build: Minify pokedex.js + formats-data.js, moves.js
The client-relevant parts of formats-data.js have been combined into
pokedex.js. pokedex.js and moves.js are now minified on the client.
2015-12-22 12:11:40 -05:00
Guangcong Luo
99bb786c55 Teambuilder: Add 'Remove folder' button 2015-12-22 12:11:40 -05:00
Guangcong Luo
e1ffede0f3 Teambuilder: Fix various bugs in search.js refactor
- Add pokemon list for CAP
- Add pokemon list for AG
- Add pokemon list for PU
- Make sure the move "Psychic" is above the type for move searches
- Fix bug in generating learnsets
- Fix move list for Smeargle
- Show tier instead of National dex number in pokemon charts
- Fix bug in pokemon field defocusing
2015-12-22 12:11:07 -05:00
Guangcong Luo
877239bcb4 Better fuzzy matching in teambuilder search
If no exact match is found, the matcher is now guaranteed to display
an approximate match with the most shared starting letters with the
query.

In other words, 'assv' will now show 'Assault Vest' as the first
option.

In addition, we still search for other matches when there's an
alias match. So 'zard'->'charizard' can match 'Charizard-Mega-Y',
but 'ferro'->'ferrothorn' can still match 'Ferroseed'.

This code is getting kind of messy, but oh well.
2015-12-22 12:10:43 -05:00
Guangcong Luo
9c5596a51d Fix loading teams with folders+tiers on desktop client 2015-12-22 08:13:11 -05:00
Guangcong Luo
bd0a80db5e Rename MovePopup to MoveSetPopup
'MovePopup' is too vague of a name.
2015-12-22 08:13:11 -05:00
Guangcong Luo
fa15819572 Teambuilder: Improve move selection
- Aerial Ace is only considered non-useless if you have Technician
- DynamicPunch is now considered non-useless if you have No Guard
- Icy Wind is now considered non-useless on Keldeo
- Focus Punch is now considered non-useless on Breloom
- Counter is now non-useless if you have Chansey, Skarmory, Clefable,
  or Wobbuffet
- Moves learned by prevos (mainly egg moves) are now properly shown
  as legal
2015-12-22 08:13:11 -05:00
Guangcong Luo
cfacf4d906 Teambuilder: Improve move deselection
Now, if you click a selected move, it will deselect the move, and then
rearrange all the other moves up, so that the empty move slots will
always be on the bottom.
2015-12-22 08:13:11 -05:00
Guangcong Luo
2ddeff9352 Teambuilder: Clicking a selected move deselects it 2015-12-22 00:17:34 -06:00
Guangcong Luo
7fa72c1d20 Convert teambuilder from utilichart.js to search.js
The teambuilder is now running on search.js! Not all new features I'd
like to be in are in, but we've now reached feature parity, and most
of the bugs I found during testing have been fixed.

New in search.js is on-demand DOM loading, which basically means
much faster performance because instead of trying to load every single
row of e.g. the pokemon list at once, we just load the part that's
visible, and load the rest only when you scroll it into view.

Also new in search.js is a dexsearch-like feature, replacing the old
details-search system. The new filter system is simpler and more powerful
and has the same API as /dexsearch, although not all the more advanced
dexsearch features are supported.

On-demand DOM loading makes teambuilder loading pretty much completely
instantaneous. There are other small differences in how selection of
pokemon/items/abilities/moves works, but it should overall make more
sense.
2015-12-22 00:06:27 -06:00
Guangcong Luo
bc43ed68b2 Support search filters in search.js
This is the main feature necessary to bring it up to parity with the
old teambuilder, and it's actually a bit beyond parity now, and is a
pretty nice feature right now.
2015-12-21 00:31:44 -05:00
Guangcong Luo
535ec50b1a Merge pull request #583 from urkerab/spread-move-effectiveness
Properly display effectiveness of spread moves
2015-12-20 21:55:09 +00:00
Guangcong Luo
ee72a96c1a Merge pull request #582 from Teremiare/Teremiare-patch-1
Change the tournament autostart off message
2015-12-20 21:47:27 +00:00
Teremiare
c27eb3abe3 Change "timeout" in the tournament messages 2015-12-20 12:45:00 +01:00
Guangcong Luo
d980ea78e6 Fix various style issues 2015-12-20 04:41:20 -05:00
Guangcong Luo
94f62e4ee4 Fix popups disappearing when resizing windows
This fixes issue #581
2015-12-20 04:28:15 -05:00
Guangcong Luo
11e3863aa7 Improve utilichart/search code
The utilichart-relevant code has been overhauled for simplicity.

Utilichart results and headers are now both 33 pixels tall, total.

Headers are slightly larger, to make them fill the space better. The
larger font size makes them more header-like, anyway.

Results are two pixels taller than before, giving them enough room for
gen 6 pokemon icons (not enabled in this commit), and in general
aiding performance slightly (fewer result rows on the screen at a
time).

Making them both 33 pixels allows height to be computed precisely
as 33*rows, which is relevant for result rows to be inserted into
the DOM on-demand.

On-demand DOM insertion has previously been implemented in pokedex.js,
but the new on-demand DOM code in search.js works slightly differently.
It makes stronger assumptions (that the only bottleneck is DOM
insertion speed, and that ctrl+f without scrolling to the bottom
doesn't need to be supported, and that result rows and result
headers are always 33 pixels tall), which makes for much simpler
code, and is presumably slightly faster because of this.

The new on-demand DOM code is surfaced by an "All results" button
in the pokedex (pokemonshowdown.com/dex/), for basic testing, but
the long-term plan is for it to be used in the teambuilder for
pokemon/etc selection, to massively increase performance.

Nearly two years after I wrote search.js to be a better utilichart
API than utilichart.js, we'll soon finally start using it in place of
utilichart.js in the main sim teambuilder!
2015-12-20 04:28:15 -05:00
Guangcong Luo
dd08a6fd43 Minor improvement to teambuilder greeting
Rock-paper-scissors scores now cycle, so you'll see every possible
score before they repeat.
2015-12-20 04:27:10 -05:00
Guangcong Luo
fd092edff9 Tools.getPokemonIcon
This introduces a new function to get an icon from an icon sheet
for gen 6 icons. The old gen 5 style icons are still available
in Tools.getIcon, allowing us to slowly convert icon styles over
at our leisure, without needing to convert everything at once.

This commit only introduces the function; it's not used anywhere
yet.
2015-12-20 04:27:10 -05:00
urkerab
581f10a404 Properly display effectiveness of spread moves 2015-12-20 00:44:32 +00:00
Guangcong Luo
4b21e3f125 Add a playable R-P-S game to Teambuilder greeting 2015-12-17 06:40:55 -05:00
Guangcong Luo
3fc38bb2c9 Support dragging teams from desktop to folder 2015-12-17 06:40:55 -05:00
Guangcong Luo
920e224fc3 Add Hide button to + room
The Hide button now hides the side panel until the next time you
open a room. The main use case is just so you can see more of your
(presumably lovely) main menu background, without having to leave
all the rooms you're in.
2015-12-17 06:40:55 -05:00
Guangcong Luo
42ddd81c68 Teambuilder folder feature
In addition to format folders, we now support regular folders that
behave as you'd expect. These folders even map to actual
directories in the downloadable client!

Folders are delimited by `/` in team names in all storage formats
(including export, and packed saving), and are stored in the
`.folder` field of team objects.

Because of this, `/` is no longer an acceptable character in team
names. This improves interoperability with teams and filesystems,
so we should probably have done this anyway.

I also added back a friendly message to the top of the teambuilder.
2015-12-17 06:40:55 -05:00
Guangcong Luo
486a272417 Fix detection of teambuilder formats
Challenge-only formats are now considered teambuilder formats - the
main exception being Custom Game formats.
2015-12-17 06:40:55 -05:00