Commit Graph

223 Commits

Author SHA1 Message Date
Kris Johnson
ebf61ab347 SSB: Fix Theia's username 2023-07-25 23:39:38 -06:00
Kris Johnson
751c804905 Super Staff Bros: Remove a set 2023-07-25 23:19:22 -06:00
Karthik
e218cb9dbb
Properly implement Chloroblast recoil (#9648) 2023-07-15 14:54:49 -05:00
Leonard Craft III
156a39405f
Refactor some move lists to move flags (#9396) 2023-03-18 22:21:00 -05:00
pyuk-bot
e3b791f310
Fix changing, blocking, and reacting to stat boosts (#9322) 2023-01-21 12:17:22 -05:00
Karthik
924917ba73
Use onTryImmunity event for Attract failure (#9332) 2023-01-15 21:16:34 -05:00
pyuk-bot
2bc2100a7b
Make -Ate abilities share a ...Boosted property (#9174) 2022-12-13 21:43:52 -06:00
ACakeWearingAHat
686a020e2c
Implement Gen 9 Random Battle (#9169)
* Move gen 8 rands code to gen8 folder

* Add test data file

* Remove hidden power from random-teams

* Remove BDSP

* Remove item selection for now

* Remove ability culling for now

* Remove move culling for now

* Obtain allowed pokemon from random-sets.json

* Add tera blast counter

* linting

* Remove Dynamax from random-teams

* Remove unnecessary check

* Add role and tera type + fix data format

* remove gmax

* Disable tier for now

* movePool should have move ids not names

* linting

* Add required moves

* Create an individual function for moveset generation

* Return moves early if <= 4 moves available

* Add counter for individual STABS, including tera

* Tera Blast is tera stab

* Add some moves (help with testing)

* Remove culling moves from moveset

* Add new hazard removing moves

* Test STAB and recovery moves

* Cull movepool each time a move is added

* Black Sludge only if tera type is Poison

* teratype and role to functions

* Test some 'High Priority' items

* Move ability selection to its own function

* Fix ability sorting/selection

* No need to go through the move adding process if number of moves in set + movepool is 4

* lint

* Remove some pokemon that aren't in gen 9 randbats

* Tera STAB example

* Allow for forcing abilities

* Silvally not in gen 9

* Move level calculation to getLevel

* Tier-based levelling and doubles coverage

* Sitrus Berry default item for doubles

* Avoid hard-coding for species frequency

* Linting + replace hail with snow

* Change a comment slightly

* Fix STAB moves: need to check that they do damage

* minor thing

* Comment out tera type requirement

* comments

* Add gen 9 randbats format

* STAB counter

* Remove setupType

* Add cullMutlaExclusive()

* Remove unnecessary functions

* Move CC/HC to the bottom

* Allow movesA and movesB to be overlapping

* Initialization of fill-out

* linting

* Setup moveEnforcementCheckers

* Type/STAB counter only updates for moves that aren't in noSTAB

* Account for type changing abilities earlier

* STAB enforcement

* Setup moves array

* linting

* Revert Setup change

* More fillout

* move tweaks

* Tera STAB enforcement

* Remove rest from recovery moves

* Enforce setup

* Add Facade if Guts

* Misc enforced moves

* Enforce more moves

* Enforce STAB priority

* Setup forced on tera blast user

* check if there are moves of the desired kind before sampling

* move tweaks

* Need to check if setupMoves is empty

* fix brute bonnet

* fix scream tail

* Finish up move incompatibilities

* fix scream tail harder

* Formatting

* Fix some things

* End culling early if movepool gets too small

* Paired moves: end culling early if movepool gets too small

* Remove 'stop cull' for testing purposes

* If 2/4 moves are filled, remove single unpaired move

* Remove now unnecessary hardcodes

* Use MovePairs instead of hardcoding pairs

* addMove function for adding moves to moveset

* Move updates

* Extra check is unnecessary, moves and movePool should never have moves in common

* Mach Punch required on Breloom

* lint

* Remove Synthesis from Brute Bonnet (5 enforced moves)

* adjust oranguru tera types

* finish up moves

* Force abilities

* Update my favorite pokemon

* linting

* Add shouldCullAbility

* fix setup counter

* Move sorting abilities below hardcoding

* minor change

* Add fields

* fix sawsbuck typo

* Improve the species generation + remove Basculegion and Houndstone as possible leads

* Fix Species frequency

* Linting

* veluza can actually run sharpness

* code all ability rejections

* Update random-sets.json

* EVs/IVs tinkering change

* fix capitalization error

* Perform small fixes

* fix moves that don't exist

* linting

* Magnezone hardcode

* Items

* Update random-teams.ts

* linting

* prep for leveling

* long list for ditto

* comment out a line of text

* finish individualizing levels and also melop sucks

* add lokix thing

* revavroom

* updates from testing

* komala probably shouldn't have dark as an option

* tropius fix

* intim mence is ok

* kleavor should not get sheer force

* why did we give hydre earth power lmao

* why did we put leech seed on toed

* forgot to sitrusify cheek pouch mons

* fix enamorus

* Syntax error

* Change Zoroark lastmon condition to level >= 72

* Fix Zoroark-level constraint to allow for level forcing

* Fix singles vs doubles definition

* Use species.id as much as possible for set generation

* updates from testing

* allow flash fire heatran

* additional sash parameters

* reject stakeout if the user has zero attacks

* fixes

* update pawmot abilities

* Change iron fist counter to a number

* Force Own Tempo on Petal Dance Lilligant

* Add T-wave to SD groudon set

* Slush Rush guaranteed with Snowscape + possible if team has snow

* Rework ability sorting: find list of non-culled abilities before sorting and selecting

* Move S/V rands to The Forefront

* fix regidrago

* Small fix to choosing allowed abilities

* update aliases

* Update Arcanines

* Change from forEach to for, since index is no longer being used

* first impression is bug stab now

* set updates from the randscord

* Update /randbats to gen 9

* Add Tera Type to /randbats output

* things to do with steel

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Move Battle Factory and BSS Factory to mods/gen8 folder

* Remove gen8 factory sets test

* Copy over random-sets.json when building

* add missing heatran-based incompatibility

* fix sableye not always getting Recover

* set updates

* start movin' cap 1v1

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* finish movin' cap 1v1

* Update random-battles.ts

* Update random-teams.ts

* Update random-teams.ts

Co-authored-by: livid washed <liuc.kelvin9901@hotmail.com>
Co-authored-by: livid washed <115855253+livid-washed@users.noreply.github.com>
Co-authored-by: Alexander B <4866817+MathyFurret@users.noreply.github.com>
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2022-12-13 17:56:29 -07:00
pyuk-bot
7a6a8441cc
Fix Protosynthesis/Quark Drive/Booster Energy (#9118) 2022-12-04 16:20:21 -05:00
Kris Johnson
d50c8c249b
Add Gen 9 (#8997) 2022-11-17 20:46:29 -05:00
Karthik
22f7ad5450
SSB: Fix Bane Terrain crash (#8809)
* SSB: Fix Bane Terrain crash

* lint
2022-06-12 18:41:10 -06:00
Hisuian Zoroark
9eebb0f0b2
SSB: Prevent Sectonia from having infinite PP (#8801)
Also adds an easter egg.
2022-06-01 10:50:27 -04:00
Karthik
8e086c765e
Fix Healing Wish setting up slot condition on failure (#8784) 2022-05-24 21:28:59 -05:00
Alexander B
56f8c3144d
Proc hazards in the order they were set (#8730) 2022-05-19 19:05:32 -05:00
Karthik
42333b392b
Fix self-KO timing for Memento/Healing Wish/Lunar Dance (#8750) 2022-05-04 17:32:37 -04:00
Annika
4d73b897b6 Random Battles: Support more value rules
This adds support for `Max Move Count` and `Adjust Level`
2022-03-30 21:56:43 -07:00
Karthik
e9c8a1ce3f
Improve check for Sky Drop preventing Mega Evolution (#8680) 2022-03-03 21:55:33 -06:00
Annika
99fffe2e4b Remove unnecessary code
Found these thanks to LGTM.com
2022-03-02 20:02:29 -08:00
Leonard Craft III
a6d321e5d1
Fix Bird-type crashes (#8639)
* Fix crash with Bird type in Revelationmons Mod

* Fix Wild Magic Surge and Bird type
2022-01-24 19:07:37 -07:00
WeWuzNidokangz
7097a9ac75
Hackmons Cup: Support custom team bans/unbans (#8607) 2022-01-09 14:46:41 -08:00
EvGym
5d8117302c
Refactor overriding stats used for damaging moves (#8373) 2021-11-08 13:48:26 -08:00
Kris Johnson
9140510dfa SSB: Change quotes to use |c:| 2021-11-07 19:55:01 -07:00
Guangcong Luo
d0ea290992 Rename pokemon to source in getDamage
This has been split off from #8373 to improve diff readability.
2021-11-02 18:05:53 -04:00
pacmanboss256
23b35498f6
Rename the "mystery" and "authentic" move flags (#8445)
* mystery -> allyanim
* authentic -> bypasssub
2021-08-30 23:07:50 -07:00
Kris Johnson
ca37942f5c SSB: Fix infinite loop with Shared Power 2021-07-01 12:39:44 -06:00
Kris Johnson
32de43c7ce SSB: Remove quadrophenic 2021-06-08 00:10:14 -06:00
Instruct
d50c77fb4d
SSB: Bugfixes and Cosmetic Updates (#8318) 2021-05-26 14:23:09 -07:00
pacmanboss256
4186ef5f4f
Refactor Mold Breaker effect (#8291) 2021-05-14 08:32:41 -04:00
Guangcong Luo
509d0abad4 Refactor out some Object.keys invocations
If you need values, you should be using `Object.values` or
`Object.entries` directly.
2021-05-13 23:02:04 -07:00
Annika
5d177a8384 Random Battles: Remove wrongly-implemented rules 2021-05-07 10:19:45 -07:00
Annika
2b3741ec2f Random Battles: Support more Value Rules
Specifically, randomized formats will now support Max Team Size, Min Source Gen, Adjust Level, Adjust Level Down, and Force Monotype.

This fixes the issue with randomly-generated Multi Battle teams containing six Pokémon, instead of three as desired.
2021-05-06 22:45:08 -07:00
Instruct
df2cb402b4
SSB: Fix fart's signature move from refactor (#8245) 2021-04-30 21:39:39 -07:00
pyuk-bot
fa974427ef
Migrate terrains from onTerrain to onResidual (#8232) 2021-04-25 13:00:37 -07:00
Guangcong Luo
f513c619b0 Fix bugs from Residual refactor 2021-04-25 12:14:03 -07:00
Instruct
a84ab6cc04
SSB: Refactor Ic3peak's echoed voice modifier (#8231) 2021-04-25 11:35:39 -07:00
Guangcong Luo
f9fdc73133
Support per-pokemon Residual handlers in Side/Field conditions (#8222)
For side conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onSideStart`/`onSideRestart`/`onSideResidual`/`onSideEnd`,
with the `onResidualOrder` properties renamed `onSideResidualOrder`.

For field conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onFieldStart`/`onFieldRestart`/`onFieldResidual`/`onFieldEnd`,
with the `onResidualOrder` properties renamed `onFieldResidualOrder`.

(The `onField` and `onSide` part helps make it clear to the type system
that the first argument is a Field or Side, not a Pokemon.)

Side and field conditions can now use `onResidual` to tick separately
on each pokemon in Speed order. `onResidualOrder` (the per-pokemon
tick) can be timed separate from `onSideResidualOrder` (the
per-condition tick), allowing conditions to end at a different priority
than they tick per-pokemon.

Relatedly, `onTeamPreview` and `onStart` in formats now need to be
`onFieldTeamPreview` and `onFieldStart`.

Unrelatedly, `effectData` has been renamed `effectState`, and the
corresponding state containers (`pokemon.statusData`,
`pokemon.speciesData`, `pokemon.itemData`, `pokemon.abilityData`,
`field.weatherData`, `field.terrainData`) have been similarly renamed. I
renamed the types a while ago, but I was holding off renaming the fields
because it would be a breaking change. But this is a breaking change
anyway, so we might as well do it now.

Note: `onResidual` will tick even on `onSideEnd` turns, although
`onSideResidual` won't. When refactoring weather, remember to
check `this.state.duration` so you don't deal weather damage on the
ending turn.

Intended as a better fix for #8216
2021-04-25 10:55:54 -07:00
Kris Johnson
a1bdafbfe8
Add room sections (#8205) 2021-04-23 22:39:56 -07:00
Instruct
7f856ac3a4
SSB4: Support Same Type Clause (#8210) 2021-04-21 09:02:54 -07:00
pyuk-bot
3639079d1f
Protective Pads should not apply to Gulp Missile (#8207)
Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>
2021-04-19 12:39:33 -04:00
Guangcong Luo
5233559183 Refactor Dex types 2021-04-08 07:08:56 -07:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
This is the change that renames:

- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`

In addition, some other APIs have been updated:

- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
  - Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
  - Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`

Team functions have been split off into a new `sim/teams` package:

- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`

`Teams.export` has also been rewritten to better match how it works in client.

This implements #8178
2021-04-08 03:00:37 -07:00
Instruct
c61999b5b7
SSB4: Clean up files to remove AFD stuff (#8160)
* Update random-teams.ts

* bye bye

* a
2021-04-01 23:40:25 -06:00
Guangcong Luo
622645cd04 Fix crash in addSideCondition 2021-03-31 22:38:24 -07:00
Guangcong Luo
3b5e8cbfc2
Refactor for multi battles (#8152) 2021-03-31 20:27:07 -07:00
HoeenHero
4d29897b42 SSB: Simplify line missed during review 2021-03-31 23:25:47 -04:00
Instruct
1f7bf2deed
Add Super Staff Bros 4 Wii U (April Fools' prank) (#8148)
* Add new SSB meta

* Update random-teams.ts

* Fix issues

* Complete the meta

* Fix links

* fix

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* review

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/random-teams.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* Update data/mods/ssb/moves.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

* simplify code

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2021-03-31 20:21:43 -07:00
Instruct
ea9ea5c16f
SSB: Small tweaks (#8143)
* SSB: Small tweaks

Boat's move should bypass mbounce. Perish gets meme text.

* uwu

* Cake should no longer get refresh

* Thanks Freudian Slip
2021-03-30 12:31:21 -06:00
Guangcong Luo
d18c0a4e1f Refactor more things to use pokemon.allies/foes
(This will make multi battles easier to implement.)
2021-03-28 20:06:18 -07:00
Guangcong Luo
ed454ef76a
Refactor scripts to battle-actions (#8138)
This introduces a new class, BattleActions, available as `battle.actions`,
moving all functions from `data/scripts.ts` to `sim/battle-actions.ts`.

This makes it so that "go to definition" will now work correctly for
functions previously in scripts; we no longer need UnimplementedError,
and there's now a clean conceptual separation between `battle` and
`battle-actions` (whereas the previous distinction between `battle` and
`scripts` was basically nonexistent).

This will be a difficult migration if you maintain a fork with custom
scripted mods. I'm sorry! Migration instructions are here:

https://github.com/smogon/pokemon-showdown/pull/8138
2021-03-28 12:01:38 -07:00
Annika
0c2563ddc2
SSB: Give Lilypad Overflow 62 BP
Requested by instruct.
2021-03-24 23:11:56 -07:00