Closed doshidak closed 2 years ago
Fixed by performing a "lookup" by instantiating a temporary SmogonMove
with the gen number as the first constructor parameter (instead of the global Dex
object) to pass along the following fields:
overrideDefensivePokemon
overrideDefensiveStat
overrideOffensivePokemon
overrideOffensiveStat
Will close this via reference on the next PR.
Also affects Psystrike.
Since in v1.0.3, the passed-in
Generation
object is now fully supplied by the globalDex
object available in Showdown, which is missing some key properties, most notablyoverrideDefensiveStat
, which is responsible for making sure Psyshock and Psystrike hits the defending Pokémon's DEF, not SPD.Using the global
Dex
object results in the followingSmogonMove
:Since
@smogon/calc
includes its ownGeneration
data in its owndata
directory, the fix is to supply these missing properties from@smogon/calc
's internaldata
to the data already supplied by Showdown's globalDex
object.Additionally, unlike
@pkmn/dex
, passing an invalidname
for the constructor parameter ofSmogonMove
won't returnundefined
, but rather, an instantiatedSmogonMove
with invalid properties:Thankfully, Photon Geyser is still working properly, using the corresponding defensive stat (either DEF or SPD) of the defending Pokémon determined by the higher attacking stat (either ATK or SPA) of the attacking Pokémon.