Commit Graph

5074 Commits

Author SHA1 Message Date
Guangcong Luo
3b5c541859 Support custom-rule challenge using /challenge
Challenges with custom rules previously required bypassing the
console commands. Now you can just do them with:

    /challenge USERNAME, gen8randombattle@@@teampreview
2020-03-20 23:53:18 -07:00
Guangcong Luo
9e80ee72b5 Make overrideTypeChart builder more readable 2020-03-20 23:53:18 -07:00
Kris Johnson
b1282465c5
Add teambuilder support for (NU) (#1483) 2020-03-20 20:49:51 -07:00
Kirk Scheibelhut
81c99f66c6
Add getType to ModdedDex and populate correctly (#1478) 2020-03-20 16:06:54 -07:00
The Immortal
50458b3466 Clean up battleOnly and inheritsFrom 2020-03-21 01:17:55 +04:00
The Immortal
f1d21b8853 Teambuilder: Fix empty moves 2020-03-21 01:17:24 +04:00
Guangcong Luo
a44a2d5b48 Fix crash in Beat Up 2020-03-19 22:57:42 -07:00
fart
cc5ac46210
Support /hidetext linecount client-side (#1482) 2020-03-19 21:28:43 -07:00
Guangcong Luo
d75ef3c6ae Support |tempnotify|
After a long time struggling to decide how to implement this, I ended
up unifying line parsing.

Advantage: No need to call `BattleTextParser.parseLine` every time you
want to inspect a line. It's parsed into args by `PS.receive` and
everything else gets tokens.

Disadvantage: Battle rooms need to reassemble the original line to put
in their history buffer (`battle.activityQueue`). The lines are getting
parsed twice, anyway, and reassembly is a small price to pay for how
readable everything else is now.
2020-03-19 21:28:18 -07:00
Guangcong Luo
71495d7faf Improve testclient key documentation 2020-03-19 21:28:18 -07:00
Guangcong Luo
045eeded9e Fix bad tooltips during instant replay 2020-03-19 21:28:18 -07:00
Guangcong Luo
2af424ef04 Update for CSS changes 2020-03-19 21:28:18 -07:00
Kris Johnson
014d2d01dc
Make burn tooltips more accurate (#1481) 2020-03-18 21:46:26 -07:00
The Immortal
83f49ecba3 Correct previous commit 2020-03-18 15:56:49 +04:00
The Immortal
29c12d4cc5 Update battleOnly usage 2020-03-18 15:46:34 +04:00
Guangcong Luo
25a2d5e2ab Fix crash in getPokemon 2020-03-17 20:41:38 -07:00
Guangcong Luo
64e451fa61 Stop tracking past learnsets-g6
`learnsets-g6` has always been versioned because in Gen 6, it contained
START move order.

For instance, Clefairy in BW2 has the following level-up moveset:

- START: Pound
- START: Growl
- L4: Encore
- L7: Sing
- L10: Double Slap

If you catch a wild level-10 Clefairy, its moveset will be: Growl,
Encore, Sing, Double Slap. A level-10 wild Clefairy will always have
Growl and never have Pound, because the order of its first two moves
matters.

PS's regular learnsets file doesn't take this into account, so we
tracked a `learnsets-g6` file that did, but also needed to keep in sync
with new game updates.

Well, these are no longer necessary. We've updated to Gen 7 and now
Gen 8, and we've never had START ordering for any of them. Anyone who
wants START ordering for Gen 6 can find it here:

https://github.com/Zarel/Pokemon-Gen-6-Learnsets

For this repo, though, `learnsets-g6` is still around (used only by
PSdex), but it can now be automatically built from `learnsets` without
losing anything, and so it can finally be `.gitignore`d.
2020-03-17 16:55:25 -07:00
josephjoestar
74341eafbe
Add support for modded battle cries (#1463)
(Specifically for the Digimon mod.)
2020-03-17 15:10:55 -07:00
Kirk Scheibelhut
a8561b176c
Remove getTemplate call from Pokemon constructor (#1479) 2020-03-16 10:41:22 -07:00
Guangcong Luo
a176317913 Refactor CSS, add CSS guide
`style/STYLING.html` is now a guide of generic CSS classes that can be
used by bots and chat plugins.

CSS classes that can be used by bots and chat plugins are now in a new
`battle-log.css` (previously just a section of `battle.css`)

Several PS styling patterns (specifically, `message-log`, `option`, and
`blocklink`) have been refactored into CSS classes, so that they can
be used by bots and chat plugins (why yes, I do plan on using 2/3 of
them in the log viewer).

Past CSS has been super messy. This refactor tries to make it neater
by adhering to these rules:

- Instead of trying to use e.g. `.setmenu button` selectors (to save
  `class=` on every individual list item), give up and just put
  `.option` directly on list items. This drastically cuts down on all
  the hacks necessary to have `.button` work inside `.setmenu`.

...That's it. That's the only change. It massively cuts down on CSS
complexity. It does slightly complicate the DOM, which I'm not a _huge_
fan of, but CSS unpredictability is nearly impossible to catch and
debug, so it's massively worth it.
2020-03-15 22:49:36 -07:00
Kirk Scheibelhut
9714d936a5
Begin adding sprite tests (#1476) 2020-03-15 22:34:44 -07:00
Guangcong Luo
c4ea15d1b5 Fix build error 2020-03-15 19:43:28 -07:00
Guangcong Luo
95d3d3a95d Support /debug nw
This opens the desktop client's debugger, which for some reason doesn't
open the way NW.js's documentation says it should.
2020-03-13 22:38:55 -04:00
Guangcong Luo
e452b1b730 Correctly escape names in PMs 2020-03-13 22:38:27 -04:00
Kris Johnson
6ffe19c254
Fix NFE tiers (#1477) 2020-03-13 12:53:54 -04:00
Peach
03f6f5e5b7
Attribute /raw messages, fix /uhtml in chat (#1475) 2020-03-12 10:03:00 -04:00
Guangcong Luo
7fe8ac794b Fix rendering of pokemon gender
Now that `pokemon.gender` matches what it says it does (genderless is
now 'N' and not ''), all the rendering code needs to be updated. I made
them all pixelated while I was at it.
2020-03-12 00:25:25 -04:00
Guangcong Luo
5e3ea5174e Refactor getPokemon
`Battle#getPokemon` has always been a huge mess, due to being designed
to get Pokemon in a variety of situations with different levels of
incomplete information provided by a PO replay.

For context: we haven't supported PO replays in around 9 years.

So today, I finally tracked down all the current uses of `getPokemon`.

They are now four different functions:

1. `getSwitchedPokemon`
   - Get or create a Pokemon when one switches in.
2. `rememberTeamPreviewPokemon`
   - Create a Pokemon because it was revealed during Team Preview.
3. `getPokemon`
   - Get a Pokemon that did something recently
4. `findCorrespondingPokemon`
   - Find a Pokemon to track PP use for a switch-in option tooltip

They share basically zero code and should never have been the same
function in the first place.

Now that `getPokemon` is no longer a mess, `newPokemon` and the
`Pokemon` constructor can be rearranged and more strongly typed. One
fewer `Object.assign`!
2020-03-11 23:32:32 -04:00
Peach
8073ff6765
Don't automatically log back into forcerenamed names (#1474) 2020-03-11 13:30:02 -07:00
The Immortal
367b9a0580 Update text for Darmanitan-Galar and Eiscue 2020-03-11 12:35:25 +04:00
Marty-D
081142f3e8
Icons: Add Alcremie form indices 2020-03-08 17:40:29 -04:00
Kris Johnson
5c8cae263d
Add Sinistea and Polteageist minisprite indexes (#1473) 2020-03-08 13:26:42 -07:00
Kirk Scheibelhut
6b3820f523
Backport the Preact testclient's login method (#1471) 2020-03-07 20:45:25 -08:00
Guangcong Luo
7ceb394796
Test pull requests with GitHub Actions 2020-03-07 20:31:09 -08:00
HoeenHero
03f72aae96
Fix Miror B Easter Egg Themes (#1472)
The themes would not play because we were tracking what theme to set
to with BattleSound.bgmNum. When loading a new bgm, BattleSound.setBgm
will simply return if the existing bgm (BattleSound.bgm) is the same
as the one were trying to set the bgm to.
2020-03-07 18:29:31 -08:00
Guangcong Luo
a36e3ab6fb Remove Travis CI
(It's been superseded by GITHUB ACTIONS)
2020-03-07 15:51:54 -08:00
Guangcong Luo
796091b381 Try GitHub Actions again 2020-03-07 14:01:09 -08:00
Guangcong Luo
ba86685a4d Refactor Flower Veil boost blocking message 2020-03-06 11:44:41 -08:00
Guangcong Luo
e85cb9d0a6
Simplify the NFE teambuilder and fix bugs (#1470) 2020-03-05 15:51:47 -08:00
Kirk Scheibelhut
aea517e655 Avoid redundant checks in guessEVs
ensureMinEVs doesn't mutate template.id (template is immutable) so
there's no reason to continue checking it. While this is hardly a
huge efficiency boost the compactness of the previous code is hardly
worth preserving over it (though this whole block could be turned
into a method and then `return` could be used to retain the
compactness).
2020-03-01 14:15:35 -08:00
Kirk Scheibelhut
07d93e0866 Add missing gen 8 support to AltFormPopup 2020-03-01 14:15:31 -08:00
Kris Johnson
7c68a659f8
Add isMax property to moves (#1469) 2020-02-29 18:07:20 -08:00
The Immortal
1fbd603637 Add Octolock text and status 2020-03-01 00:55:05 +04:00
Kirk Scheibelhut
0b4623a389
Add link back to Smogon analysis for sample sets (#1468)
Closes #1357
2020-02-26 00:24:05 -08:00
Ben Davies
e3fcaa492c
Properly set the encoding to UTF-8 on all HTML pages (#1467)
This adds the BOM to all HTTP pages as per the HTML5 spec and ensures
all pages use UTF-8 as their meta charset (which is still kept for
compatibility with older browsers).
2020-02-23 00:13:56 -08:00
The Immortal
e4e55fbeb9
Room Service is not a great item 2020-02-21 04:08:36 +04:00
petuuuhhh
326bad861c
Add Heavy Duty Boots, Expert Belt, and Room Service to Popular items (#1466) 2020-02-20 16:00:17 -08:00
Kris Johnson
ad5b8abd2e
Add teambuilder support for Metronome Battle (#1443) 2020-02-19 16:11:50 -08:00
The Immortal
9d561a987a
Teambuilder: Move TRs to bad items 2020-02-18 01:13:35 +04:00
Kris Johnson
4033a75f50
Add teambuilder support for NFE (#1464) 2020-02-15 08:23:20 -08:00