Commit Graph

270 Commits

Author SHA1 Message Date
Slayer95
2b32c8f57c Send teampreview request after Tera Type info (#11238)
Refs #8546
2025-07-11 01:33:12 -06:00
André Bastos Dias
9bcca73a33 Modify HP after forme regression (#11261)
* Modify HP after forme regression

* Clip negative HP

* Change method name

* Don't reveal illusion

Should be redundant

* Move message timing

* Fix dynamax

* Clip HP for possible OMs

* Check using baseMaxHp

* Conditions.........

* Use ternary operation

* Fix comment
2025-07-11 01:32:43 -06:00
Kris Johnson
4edd58a832 Fix Baton Pass Trap Clause validation 2025-07-06 11:15:18 -06:00
Sergio
2ce41f17f3 Fix typos in Alola and Unova Dex rulesets (#11248)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
2025-07-05 08:28:12 -05:00
André Bastos Dias
ac19dbb9e5 Move the gender logic to the validator (#11198)
* Move the gender logic to the validator

* Modify test seed

* Modify seed for other test

* Fix for RandBats

* Remove gender enforcement

* Revert "Remove gender enforcement"

This reverts commit c9c66a3725.

* Allow choosing genderless Pokemon

Without this, genders will always default to '' and never to 'N'
2025-07-01 01:26:42 -06:00
Karthik Bandagonda
d3d834c91a Allow Picked Team Size to be used without Team Preview (#11224)
* Add Pick Team rule

* Make Team Preview and Pick Team mutually exclusive

* Automatically apply rule if Picked Team Size exists without preview

* Remove mutually exclusive part

* Move teamsize to start action
2025-07-01 01:20:57 -06:00
Leonard Craft III
6e41ce15e3 Add Nickname Clause to Standard Draft
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
2025-06-29 22:42:46 -05:00
skymin3
edd2068e23 Add Acupressure to Evasion Moves Clause (#11181)
https://www.smogon.com/forums/threads/include-acupressure-in-evasion-clause.3738246/post-10583328
2025-06-06 16:56:58 -07:00
Guangcong Luo
80996b1a3b Allow multiple empty moveslots 2025-06-02 08:43:32 -07:00
Dieter Reinert
2815ce3d62 Info commands: Fix crash when using /data with Tier Shift Mod (#11149)
* Info commands: Fix crash when using /data with Tier Shift Mod

Fixes a crash that occurred when using the `/data` command (or its aliases like `/dt`) with a format that includes the "Tier Shift Mod" rule.

### The Bug
When users tried to view Pokémon data in a format with Tier Shift Mod, the command would crash with:
```TS
TypeError: Cannot read properties of undefined (reading 'has')
at Object.onModifySpecies (/home/ps/main/data/rulesets.ts:2260:45)```


### Root Cause
The info command was calling `format.onModifySpecies` with a mock Battle context that was missing the `ruleTable` property. The Tier Shift Mod's `onModifySpecies` function needs to check `this.ruleTable.has("standardnatdex")` to determine whether to use National Dex tiers.

### The Fix
Added the missing `ruleTable` property to the mock Battle context in `server/chat-commands/info.ts`. The mock context now includes:
- `dex`
- `clampIntRange`
- `toID`
- `ruleTable` (newly added)

This ensures that any format modifier that needs to access the rule table won't crash when called from the data command.

* Use optional chaning instead of constructing a full rule table.

* Fix: formatting

* More formatting

* formatting due to merge

* Update data/rulesets.ts

* ESLint: Resolve "Type boolean trivially inferred from a boolean literal, remove type annotation"

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2025-06-02 01:20:34 -06:00
Kris Johnson
64b80ca9f5 Add June 2025 rotational formats 2025-06-01 01:51:17 -06:00
Lucas
fc3ab2cf61 Add rule to automatically display Pokemon information (#11122)
---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2025-05-19 10:53:43 -07:00
Guangcong Luo
417a9183f8 Revert "Add rule to automatically display Pokemon information (#11097)"
You can't import chat from rulesets.

This reverts commit c4e1a4b154.
2025-05-18 14:44:13 -07:00
Lucas
c4e1a4b154 Add rule to automatically display Pokemon information (#11097)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
Pet Mods requested a Data Mod that automatically shows information for formats that have many custom changes (currently CCAPM2024 Random Battle).
2025-05-18 08:17:13 -07:00
Kris Johnson
671f4edfad Update [Gen 3] Draft ruleset 2025-05-01 16:15:44 -06:00
HiZo
6668106730 Godly Gift Mod: Don't automatically assume Zygarde-Complete is a god (#11063)
* Godly Gift Mod: Don't automatically assume Zygarde-Complete is a god

* Also add a validation check here

* Add suggestion from code review

* oops
2025-04-30 23:32:28 -06:00
Sergio Garcia
fc23103de1 Fix random typos (#11020)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
2025-04-13 23:59:36 -07:00
Chessking345
40f4915925 Add LGPE Starter Formes support for select formats (#11018)
* Add LGPE Starter formes to Hackmons Forme Legality

* Add LGPE Starter formes to Formemons
Add LGPE Starter formes learnset in SV

* Floette-Eternal SV learnset
2025-04-07 21:13:30 -06:00
Guangcong Luo
ae22234ed0 Add Guaranteed Secondary Mod
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
This is currently for tests, but does have the side effect of plausibly
being fun as an actual mod to add to games.
2025-03-13 15:34:47 -07:00
Yoshiblaze
917bb0dd32 Add New Pet Mod of the Season (Bad 'n Boosted) (#10947)
* Add Bad 'n Boosted

* Add Mod Folder for Bad 'n Boosted so /dt works with it

* Fix indents

* Fix indents

* Remove Little Colosseum

* Change Bad 'n Boosted to a mod rather than a folder

* Apply suggestions from code review

* Update config/formats.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2025-03-09 11:59:50 -06:00
Vertigo
ef4029ce57 Add boosting effects to Baton Pass Stat Clause (#10948) 2025-03-09 11:44:15 -06:00
Guangcong Luo
d9557375a0 Introduce "NatDex Mod" (#10939)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
"Standard NatDex" is very weird compared to how OMs usually work.

See "TierShift Mod" and "Godly Gift Mod". NatDex now gets its own mod,
which can be mixed into any other format, instead of needing to start
with NatDex.

This would make Min Source Gen overriding annoying, so it now defaults
to the current gen in Gen 9+, if Obtainable is set and +Past isn't. So
now you don't need to manually set Min Source Gen to enforce Obtainable
in Gen 9.
2025-03-06 03:40:36 -08:00
Guangcong Luo
0cb51158aa Make "All Pokemon" rules more convenient (#10932)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
* Make "All Pokemon" rules more convenient

Previously, "+All Pokemon" did nothing except override "-All Pokemon",
which switched from a default-allow to default-deny system.

They still do that, but they now also override all previous pokemon
bans/unbans. This makes it easier to replace a banlist/whitelist
from an inherited ruleset without needing to reverse every previous
ban/unban.

This also adds an error if you use `+All Pokemon` in a ruleset where
it doesn't do anything.

Fixes #10772
2025-03-02 14:47:30 -08:00
Guangcong Luo
78439b4a02 Update to ESLint 9 (#10926)
ESLint has a whole new config format, so I figure it's a good time to
make the config system saner.

- First, we no longer have separate eslint-no-types configs. Lint
  performance shouldn't be enough of a problem to justify the
  relevant maintenance complexity.

- Second, our base config should work out-of-the-box now. `npx eslint`
  will work as expected, without any CLI flags. You should still use
  `npm run lint` which adds the `--cached` flag for performance.

- Third, whatever updates I did fixed style linting, which apparently
  has been bugged for quite some time, considering all the obvious
  mixed-tabs-and-spaces issues I found in the upgrade.

Also here are some changes to our style rules. In particular:

- Curly brackets (for objects etc) now have spaces inside them. Sorry
  for the huge change. ESLint doesn't support our old style, and most
  projects use Prettier style, so we might as well match them in this way.
  See https://github.com/eslint-stylistic/eslint-stylistic/issues/415

- String + number concatenation is no longer allowed. We now
  consistently use template strings for this.
2025-02-25 20:03:46 -08:00
HiZo
d5c4fb5730 Remove Crazyhouse Rule (#10841)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
* Remove Crazyhouse

Causes too many problems/crashes when mashed up.

* lint
2025-01-27 17:50:29 -07:00
Mia
d3e60b31f7 Sim: Use a CSPRNG (#10806)
* Sim: Use a CSPRNG

* Add test

* fix test prng

* move prng test to others

* fix slight hack

* tf?

* Fuck this

* fucking lol

* fix crap

* i'm going to kill someone

* i hate state

* fix test

* Good work genius

* typo

* Fix exportinputlog

* Refactor for inputlog backwards compatibility

This is a pretty major refactor which is mostly unrelated to the
feature, but it does make the code a lot simpler.

* Readability pass

* Readability (again)

* Remove sodium-native dependency

* Refactor to serialize seeds in hex strings

(Also removes the Buffer dependency from PRNG, and slightly improves
comments.)

* Apparently << is 32-bit signed

* Readability

---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2025-01-11 13:56:34 -06:00
Karthik Bandagonda
8f2e1cb0d2 Always show OTS to spectators (#10767)
Some checks failed
Node.js CI / build (16.x) (push) Has been cancelled
2024-12-18 23:45:43 -06:00
Kris Johnson
2b03102954 Mix and Mega: Make Aggronite great again 2024-12-12 11:07:52 -07:00
Kris Johnson
068890e5c2 Add December 2024 OMotM/LCotM 2024-12-01 09:37:48 -07:00
TwiSteorra
bbea81daa8 Update Sketch Post-Gen 7 Moves rule description (#10709)
https://www.smogon.com/forums/threads/sketch-post-gen-7-moves-rule-has-outdated-description.3755629/
2024-11-30 10:30:16 -07:00
urkerab
a08348ed43 Fix ability selection for Fervent Impersonation (#10712) 2024-11-30 10:29:57 -07:00
urkerab
92a3264e77 Improve signature of getValidationSpecies (#10711) 2024-11-30 10:29:47 -07:00
Karthik Bandagonda
a893791792 Fix interaction between Mega Rayquaza/Terastal Clauses (#9936) 2024-11-18 15:32:46 -07:00
urkerab
ae14c6f90c Allow Tera Shell to work in Inverse battles (#10599)
Some checks failed
Node.js CI / build (16.x) (push) Has been cancelled
2024-10-04 19:48:36 -05:00
Kris Johnson
47e805bf91 Add missing items to Baton Pass Stat Trap Clause 2024-10-01 18:07:40 -06:00
Kris Johnson
16bb6c2b77 Add October 2024 National Dex spotlight 2024-10-01 01:04:09 -06:00
Karthik Bandagonda
4ba7f6e8fc Use value rules for timer (#10194)
* Use value rules for timer

* lint

* fix rule overrides

* fix the "boolean" value rules

* add limits for number based rules

* Realized that you don't need boolean value rules

* oops

* fix checks for lower bounds
2024-09-29 19:10:49 -06:00
urkerab
1f56611716 Test cosmetic formes (#10579)
* Add tests for cosmetic formes

* Fix aliases of Pokestar F to use its actual name

* Revert "BH: Fix weird validation edge case"

This reverts commit e71619135a.

* Remove invalid tiers of cosmetic formes of Pokestar Giant
2024-09-28 11:38:56 -06:00
Kris Johnson
e71619135a BH: Fix weird validation edge case 2024-09-27 00:46:17 -06:00
Leonard Craft III
27160e8374 Add description to Fervant Impersonation Mod 2024-09-12 20:19:27 -05:00
urkerab
dbd0ccba19 Use base forme names in banlists where possible (#10515)
* Use base forme names in banlists where possible

This allows you use e.g. 'Arceus-Normal' instead of 'Arceus-Base'.

Also includes some aliases so that all known base forme names actually work.

* Update formats.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-09-01 14:43:07 -06:00
Mia
ada9f31ef3 Revert "Use base forme names in banlists where possible (#10496)"
This reverts commit 8438ec1890.
2024-08-26 23:15:59 -05:00
urkerab
8438ec1890 Use base forme names in banlists where possible (#10496)
* Use base forme names in banlists where possible

This allows you use e.g. 'Arceus-Normal' instead of 'Arceus-Base'.

Also includes some aliases so that all known base forme names actually work.

* Update formats.ts

* Update config/formats.ts

* Update config/formats.ts

* Update config/formats.ts

* Apply suggestions from code review

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-08-26 19:20:28 -06:00
Kris Johnson
80ed6df5fc Refactor Item Clause into a value rule 2024-08-08 13:13:33 -06:00
Kris Johnson
63d191aeef Make Force Monotype return its value rule 2024-08-08 12:23:39 -06:00
Kris Johnson
27001b0888 Pokemoves: Convert some validation into value rules 2024-08-08 12:22:54 -06:00
Yoshiblaze
d71cb04ae5 Agg August-November 2024 PMotS (#10450)
* PMOTS

* Update learnsets.ts

* Update pokedex.ts

* Update rulesets.ts

* Update moves.ts

* Update data/mods/gen6megasrevisited/abilities.ts

* Update data/mods/gen6megasrevisited/abilities.ts

* Update data/mods/gen6megasrevisited/abilities.ts

* Update data/mods/gen6megasrevisited/abilities.ts

* Update data/mods/gen6megasrevisited/abilities.ts

* Update data/mods/gen6megasrevisited/abilities.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-08-04 12:20:55 -06:00
Guangcong Luo
88be8d7b3c Refactor types for Lowercase<string> (#10377)
TypeScript 4.8+ supports Lowercase for lowercase strings, which isn't
exactly what ID is, but can be used to type IDs in object keys and data
entries that previously required string. I'm calling it IDEntry in places
where it should be an ID but TypeScript doesn't support that.

Very conveniently, no additional casts will be needed when using ID
where IDEntry is expected.

It's caught at least a few bugs, which is also why I'm PRing: I didn't
write the code for the bugs it found, and don't know if it's the right
way to fix them.

This ballooned into several other type refactors.
2024-07-01 15:57:14 -07:00
Guangcong Luo
973b01c1e4 Refactor Crazyhouse rule implementation
Previous implementation was quite wonky and doesn't really need to be.
2024-07-01 01:01:40 -07:00
Kris Johnson
89128dee97 Utils#Multiset: Redefine get to remove undefined return (#10329) 2024-06-06 17:16:59 -06:00