Closed vlin02 closed 1 year ago
Hi! The issue here is that Greninja does not actually exist in Generation 9 (yay Dexit!) so Ditto doesn't know what to copy types from. You need to change the exists
function (second argument to the Generations
constructor) in order to include unconventional Pokémon.
If you change:
const p1Bat = new Client.Battle(new Generations(Dex), toID("p1"));
to:
const p1Bat = new Client.Battle(new Generations(Dex, d => !!d.exists), toID("p1"));
(ie, a very lazy exists
function) then no error gets thrown.
Pokémon Showdown does not adhere to cartridge legality for some (most?) of its formats, so you will likely need to remember to customize the exists
function if you are using @pkmn/data
to interop Pokémon Showdown
Thanks! That works for what I need.
Having ditto on a team can cause the error below sometimes.
Here's a repro