mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-11 20:35:18 +01:00
* Removed cases of `if (a) {return true}' return false`
* Removed useless `super.xyz` calls from functions
* Fixde missing issur
* Use early return in `Pokemon#isOffsetBySubstitute`
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
26 lines
505 B
TypeScript
26 lines
505 B
TypeScript
import { expSpriteKeys } from "#app/sprites/sprite-keys";
|
|
|
|
const expKeyRegex = /^pkmn__?(back__)?(shiny__)?(female__)?(\d+)(\-.*?)?(?:_[1-3])?$/;
|
|
|
|
export function hasExpSprite(key: string): boolean {
|
|
const keyMatch = expKeyRegex.exec(key);
|
|
if (!keyMatch) {
|
|
return false;
|
|
}
|
|
|
|
let k = keyMatch[4]!;
|
|
if (keyMatch[2]) {
|
|
k += "s";
|
|
}
|
|
if (keyMatch[1]) {
|
|
k += "b";
|
|
}
|
|
if (keyMatch[3]) {
|
|
k += "f";
|
|
}
|
|
if (keyMatch[5]) {
|
|
k += keyMatch[5];
|
|
}
|
|
return expSpriteKeys.has(k);
|
|
}
|