Commit Graph

1443 Commits

Author SHA1 Message Date
Kris Johnson
519fe2eb37 Add February 2025 rotational ladders 2025-02-01 00:27:11 -07:00
pyuk-bot
bafd84ff10
Don't let leftover handlers from consumed items call eatItem/useItem (#10853)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
2025-01-31 14:46:42 -06:00
André Bastos Dias
dd4f69c168
Fix Illusion Level Mod (#10850)
Some checks failed
Node.js CI / build (16.x) (push) Has been cancelled
2025-01-30 09:26:55 -07:00
Karthik Bandagonda
f36cc3aee8
Fix Illusion Level Mod (#10849)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
* Fix Illusion Level Mod

* go back to just sending the level as the argument
2025-01-30 00:25:20 -07:00
HiZo
fce693795c
Fix bug where Wish and Future Sight ignore fainted pokemon (#10847) 2025-01-29 08:17:02 -06:00
pyuk-bot
d286478fe0
OMs: Fix innate abilities and items when switching in (#10844) 2025-01-28 20:24:13 -06:00
pyuk-bot
98ce87e636
Fix improper duplication of cached dex data (#10843)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
2025-01-28 18:37:29 -06:00
pyuk-bot
7bb2fd1869
Overhaul 'SwitchIn' event for more accurate effect resolution order (#10766) 2025-01-28 16:51:17 -06: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
larry-the-table-guy
97e70cb13f
PRNG: Address 'TODO: benchmark' comment (#10822)
Some checks failed
Node.js CI / build (16.x) (push) Has been cancelled
The alternative big-endian read impl is indeed slower.
2025-01-25 14:20:36 -07:00
André Bastos Dias
ce76114c12
Implement fainted forme regression (#10810) 2025-01-25 14:06:40 -06:00
André Bastos Dias
1dbe4f8aef
Tera Shell doesn't activate if the move is already resisted (#10815)
* Don't activate Tera Shell if resisted

* Fix for Hackmons

Relevant if Terapagos-Terastal transforms and terastallizes, keeping Tera Shell

* Update comment
2025-01-25 11:39:18 -07:00
André Bastos Dias
6d5970829a
Fix inherit for in-game mods (#10834) 2025-01-25 11:38:30 -07:00
Mia
1bdecae604 PRNG: Ensure seeds are generated securely
Some checks failed
Node.js CI / build (16.x) (push) Has been cancelled
2025-01-19 21:32:49 -06:00
Guangcong Luo
fde2b1187f
PRNGSeed is now a string (#10826)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
This makes it so we no longer need to ad-hoc convert seeds from strings
to arrays when we get them from text protocols like the command line or
BattleStream's `reseed` command.

It also has the side benefit of making inputlogs very slightly smaller.
2025-01-15 15:51:28 -08:00
Guangcong Luo
ec7332b498 Import Utils from lib/utils
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
This mostly is just a step towards removing sim's dependency on Node's
stdlib.
2025-01-14 23:01:53 -08: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
André Bastos Dias
328e20dde1
Fix Gen 1 Substitute + Confusion interaction (#10802) 2025-01-10 13:49:11 -06:00
André Bastos Dias
dfcb64ec4c
Redo: Fix [from] message (#10798) 2025-01-10 00:36:13 -06:00
André Bastos Dias
041bf6a8b2
Fix Terastallization base power buff for priority moves called by Encore (#10808)
* Fix: Tera priority bump and Encore

* Line

* Fix check for multihit
2025-01-09 22:55:30 -07:00
Kris Johnson
392ab2df4a
Revert "Fix [from] message (#10796)" (#10797)
Some checks failed
Node.js CI / build (16.x) (push) Has been cancelled
This reverts commit 5468a36da1.
2025-01-05 22:24:11 -07:00
André Bastos Dias
5468a36da1
Fix [from] message (#10796) 2025-01-05 22:23:06 -07:00
larry-the-table-guy
b790eb8309
Remove dead code for dex initialization (#10793)
As of PR #10641, these are no longer necessary.
2025-01-04 13:14:22 -07:00
dot-Comfey
46309cf281
Fix illegality message for underleveled Pokemon (#10773)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
https://www.smogon.com/forums/threads/level-undefined-in-evolution-level-error.3756053/
2024-12-28 10:46:31 -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
bingingem
602e1d872f
/weakness: Add fuzzy matching (#10316)
* Weakness: add fuzzy matching to command

* fix linting errors

* removing `any` so TypeScript infers typing

* merge master branch properly

* push each species type individually instead  of string array
2024-12-16 22:30:54 -06:00
HiZo
f27bf860d3
Twisted Dimension: Fix Trick Room interaction (#10725)
Some checks failed
Node.js CI / build (16.x) (push) Has been cancelled
* Twisted Dimension: fix Trick Room interaction

* Update scripts.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-12-04 14:29:38 -07:00
Karthik Bandagonda
b68fc72b24
Add [Gen 9] Draft Factory (#10702)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
* Add [Gen 9] Draft Factory

* lint

* show tera types of captains

* fix tests

* why did it pass locally

* Update data/random-battles/gen9/teams.ts

* Update formats.ts

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-12-03 17:30:24 -07:00
Kris Johnson
acd4858aec MnM Doubles: Allow >1 Mega Evolution per turn 2024-12-01 09:59:19 -07:00
Kris Johnson
068890e5c2 Add December 2024 OMotM/LCotM 2024-12-01 09:37:48 -07:00
Leonard Craft III
a8cdef75c2
Implement turn counter overflow with Wish / Future moves (#10700)
* Implement turn overflow with Wish / Future moves

* Improve hints
2024-12-01 09:08:00 -07:00
dot-Comfey
b14054aafe
Properly validate Hidden Power type for events (#10701)
* Properly validate HP type for events

https://www.smogon.com/forums/threads/bug-report-validator.3754044/

* Update team-validator.ts

* Update team-validator.ts

* Update sim/team-validator.ts

Co-authored-by: urkerab <urkerab@users.noreply.github.com>

* Update team-validator.ts

Just some CamelCase...

* Prevent HP Stellar from being usable

https://www.smogon.com/forums/threads/bug-report-validator.3755718/

* Apply suggestions from code review

---------

Co-authored-by: urkerab <urkerab@users.noreply.github.com>
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2024-12-01 09:07:43 -07:00
larry-the-table-guy
a42cda37e3
Sim/DexSpecies: Deduplicate Species against parent mod (#10668)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
* PoC deduplicate `Species` against parent mod

Have to punt on the deep equals for now.

* `DexSpecies`: Tweak dedup logic to be faster

* `DexSpecies`: Improve comments around dedup logic

* `DexSpecies`: Use utils deepEquals function for dedup

Significantly faster than the `assert` equivalent
2024-11-30 10:36:07 -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
Alex "Mathy
cb5bbe819d
Fix Guard Dog / Mirror Armor / Clear Amulet event order (#10696) 2024-11-27 13:07:53 -07:00
Alex "Mathy
61f7b7fee8
Fix Acupressure target resolution (#10656) 2024-11-21 20:47:45 -05:00
larry-the-table-guy
38e464925e
Sim/DexItems: Deduplicate Item against parent mod (#10669)
* Sim/DexItems: Deduplicate `Item` against parent mod

* `DexItems`: Tweak dedup for perf and add comment
2024-11-18 15:20:10 -07:00
larry-the-table-guy
ff8c9a0414
Sim: Faster type coercion in toID (#10619) 2024-11-09 19:09:58 -08:00
larry-the-table-guy
06da2bed6f
Sim/DexMoves: Deduplicate DataMove against parent mod (#10658)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
2024-11-09 03:47:14 -08:00
larry-the-table-guy
a86d04342d
Data: Fix huge perf bugs in randbat tests, part 1 (#10616) 2024-11-09 03:45:18 -08:00
Alex "Mathy
5d014a8df7
Fix Morpeko form permanence (#10663)
Some checks failed
Node.js CI / build (16.x) (push) Has been cancelled
2024-11-06 22:45:01 -07:00
Alex "Mathy
0744e94360
Keep Morpeko's form while Terastallized (#10662) 2024-11-06 19:20:23 -07:00
Kris Johnson
b37edb2af5 Fix commands that have optional format args
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
2024-11-01 11:41:01 -06:00
larry-the-table-guy
12c1614eb5
Dex: Consistent field init order in constructors (#10608)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
2024-10-31 10:05:03 -07:00
Slayer95
34c0cb39e3
Fix bugs connected to format.exists (#10647) 2024-10-31 08:25:17 -05:00
Slayer95
36966fab3b
Preload data when using Dex.mod (#10641)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
* Preload data when using Dex.mod

With the initial introduction fo TypeScript at 3716f36,
``Dex.mod``, and ``Dex.format`` (nowadays ``Dex.forFormat``)
no longer ensured that the data cache has been filled.

Newer lazy-loading getter APIs were introduced, which were
intended to be used as a replacement for direct access to the
loaded data (``dataCache``).

However, these APIs were either not effective or not properly
used., as reflected by 43ef4d9, which reverted ``Dex.forFormat``
to its full capabilities.

Nevertheless, ``Dex.mod`` was left untouched, which results in a
footgun where ``Dex.forFormat('gen1randbats').gen == 1``, but
``Dex.mod('gen1').gen == 9``.

This commit brings back ``Dex.mod`` to its original behavior, so
that gen information is always there when it's needed.

* Add test for dex.mod(mod).gen

* Swap around test instructions

This is more reliable given the load order.
2024-10-30 22:27:31 -06:00
larry-the-table-guy
71fe7bdfcb
Test: Correct several format IDs (#10633) 2024-10-29 05:14:19 -07:00
larry-the-table-guy
13ee2443d2
Refactor dex.loadData w/ spread syntax (#10639)
Results in fewer object shapes
2024-10-29 05:07:40 -07:00
urkerab
bd3d94c79c
Simplify reuse of parent data cache when child gen has no override file (#10614)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
* Don't inherit init function from parent mod

* Simplify reuse of parent data cache when child gen has no override file
2024-10-13 12:23:15 -06:00