Skip to content

Commit

Permalink
fix: fixed some of the abilities, items and moves data
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Nov 27, 2023
1 parent 5dbd079 commit 9fa63e8
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 109 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
isNonstandard: 'Past' -> isNonstandard: IsNonStandard.Past
isNonstandard: 'Unobtainable' -> isNonstandard: IsNonStandard.Unobtainable
isNonstandard: 'CAP' -> isNonstandard: IsNonStandard.Cap
isNonstandard: 'Gigantamax' -> isNonstandard: IsNonStandard.Gigantamax
isNonstandard: 'LetsGoPikachuEevee' -> isNonstandard: IsNonStandard.LetsGoPikachuEevee
"?isNonstandard"?: ['"]Past['"] -> isNonstandard: IsNonStandard.Past
"?isNonstandard"?: ['"]Unobtainable['"] -> isNonstandard: IsNonStandard.Unobtainable
"?isNonstandard"?: ['"]CAP['"] -> isNonstandard: IsNonStandard.Cap
"?isNonstandard"?: ['"]Gigantamax['"] -> isNonstandard: IsNonStandard.Gigantamax
"?isNonstandard"?: ['"]LetsGoPikachuEevee['"] -> isNonstandard: IsNonStandard.LetsGoPikachuEevee
14 changes: 7 additions & 7 deletions scripts/data-gen-scripts/manual-updaters/abilities-updater.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { abilities as currentAbilities } from '#assets/abilities.js';
import type { PokemonTypes } from '#assets/pokemon-source.js';
import { importFileFromWeb } from '../../utils.js';
import { IsNonStandard } from '#utils/isNonStandardEnum.js';
import { abilities as currentAbilities } from '#assets/abilities.js';
import { objectEntries } from '@sapphire/utilities';
import { importFileFromWeb, replacePokeWithAccentedPoke } from '../../utils.js';
import { dataToClipboard } from '../data-to-clipboard.js';
import { sortObjectByKey } from '../map-data-key-sorter.js';
import { objectEntries } from '@sapphire/utilities';

const { Abilities } = await importFileFromWeb<{ Abilities: { [abilityName: string]: AbilityData } }>({
url: 'https://raw.githubusercontent.com/smogon/pokemon-showdown/master/data/abilities.ts',
Expand Down Expand Up @@ -46,10 +46,10 @@ for (const [key, data] of currentAbilities.entries()) {
}

if (abilityFromText) {
data.shortDesc = abilityFromText.shortDesc;
data.shortDesc = replacePokeWithAccentedPoke(abilityFromText.shortDesc);

if (abilityFromText.desc) {
data.desc = abilityFromText.desc;
data.desc = replacePokeWithAccentedPoke(abilityFromText.desc);
}
}

Expand All @@ -68,7 +68,7 @@ for (const [key, abilityFromData] of abilitiesDataEntries) {
}

const data: PokemonTypes.Ability = {
shortDesc: abilityFromText.shortDesc,
shortDesc: replacePokeWithAccentedPoke(abilityFromText.shortDesc),
name: abilityFromData.name
};

Expand All @@ -85,7 +85,7 @@ for (const [key, abilityFromData] of abilitiesDataEntries) {
}

if (abilityFromText.desc) {
data.desc = abilityFromText.desc;
data.desc = replacePokeWithAccentedPoke(abilityFromText.desc);
}

newMap.set(key, sortObjectByKey(data));
Expand Down
12 changes: 6 additions & 6 deletions scripts/data-gen-scripts/manual-updaters/items-updater.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { items as currentItems } from '#assets/items.js';
import type { PokemonTypes } from '#assets/pokemon-source.js';
import { importFileFromWeb } from '../../utils.js';
import { IsNonStandard } from '#utils/isNonStandardEnum.js';
import { items as currentItems } from '#assets/items.js';
import { importFileFromWeb, replacePokeWithAccentedPoke } from '../../utils.js';
import { dataToClipboard } from '../data-to-clipboard.js';
import { sortObjectByKey } from '../map-data-key-sorter.js';

Expand Down Expand Up @@ -46,9 +46,9 @@ for (const [key, data] of currentItems.entries()) {
}

if (itemFromText) {
data.desc = itemFromText.desc;
data.desc = replacePokeWithAccentedPoke(itemFromText.desc);
if (itemFromText.shortDesc) {
data.shortDesc = itemFromText.shortDesc;
data.shortDesc = replacePokeWithAccentedPoke(itemFromText.shortDesc);
}
}

Expand All @@ -75,7 +75,7 @@ for (const [key, itemFromData] of itemsDataEntries) {
}

const data: PokemonTypes.Item = {
desc: itemFromText.desc,
desc: replacePokeWithAccentedPoke(itemFromText.desc),
gen: itemFromData.gen,
name: itemFromData.name
};
Expand All @@ -93,7 +93,7 @@ for (const [key, itemFromData] of itemsDataEntries) {
}

if (itemFromText.shortDesc) {
data.shortDesc = itemFromText.shortDesc;
data.shortDesc = replacePokeWithAccentedPoke(itemFromText.shortDesc);
}

newMap.set(key, sortObjectByKey(data));
Expand Down
12 changes: 6 additions & 6 deletions scripts/data-gen-scripts/manual-updaters/moves-updater.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { moves as currentMoves } from '#assets/moves.js';
import type { PokemonTypes } from '#assets/pokemon-source.js';
import { importFileFromWeb } from '../../utils.js';
import { IsNonStandard } from '#utils/isNonStandardEnum.js';
import { moves as currentMoves } from '#assets/moves.js';
import { importFileFromWeb, replacePokeWithAccentedPoke } from '../../utils.js';
import { dataToClipboard } from '../data-to-clipboard.js';
import { sortObjectByKey } from '../map-data-key-sorter.js';

Expand Down Expand Up @@ -64,11 +64,11 @@ for (const [key, data] of currentMoves.entries()) {
if (key.startsWith('hiddenpower')) {
data.shortDesc = "Varies in type based on the user's IVs.";
} else {
data.shortDesc = moveFromText.shortDesc;
data.shortDesc = replacePokeWithAccentedPoke(moveFromText.shortDesc);
}

if (moveFromText.desc) {
data.desc = moveFromText.desc;
data.desc = replacePokeWithAccentedPoke(moveFromText.desc);
}
}

Expand All @@ -87,7 +87,7 @@ for (const [key, moveFromData] of movesDataEntries) {
}

const data: PokemonTypes.Move = {
shortDesc: moveFromText.shortDesc,
shortDesc: replacePokeWithAccentedPoke(moveFromText.shortDesc),
name: moveFromData.name,
category: moveFromData.category,
pp: moveFromData.pp,
Expand Down Expand Up @@ -118,7 +118,7 @@ for (const [key, moveFromData] of movesDataEntries) {
}

if (moveFromText.desc) {
data.desc = moveFromText.desc;
data.desc = replacePokeWithAccentedPoke(moveFromText.desc);
}

newMap.set(key, sortObjectByKey(data));
Expand Down
11 changes: 11 additions & 0 deletions scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ export async function importFileFromWeb<T extends object>({ url, temporaryFileNa
return tiersData;
}

/**
* Replaces occurrences of "Poke Ball" with "Poké Ball" and "Pokemon" with "Pokémon" in the input string.
* @param input - The input string to be processed.
* @returns The input string with the replacements made.
*/
export function replacePokeWithAccentedPoke(input: string) {
return input //
.replaceAll('Poke Ball', 'Poké Ball')
.replaceAll('Pokemon', 'Pokémon');
}

export interface GitCommit {
sha: string;
}
116 changes: 58 additions & 58 deletions src/lib/assets/abilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,34 @@ export const abilities = new Collection<string, PokemonTypes.Ability>([
shortDesc: 'This Pokémon gains the Charge effect when it takes a hit from an attack.'
}
],
[
'embodyaspectcornerstone',
{
name: 'Embody Aspect (Cornerstone)',
shortDesc: "On switch-in, this Pokémon's Defense is raised by 1 stage."
}
],
[
'embodyaspecthearthflame',
{
name: 'Embody Aspect (Hearthflame)',
shortDesc: "On switch-in, this Pokémon's Attack is raised by 1 stage."
}
],
[
'embodyaspectteal',
{
name: 'Embody Aspect (Teal)',
shortDesc: "On switch-in, this Pokémon's Speed is raised by 1 stage."
}
],
[
'embodyaspectwellspring',
{
name: 'Embody Aspect (Wellspring)',
shortDesc: "On switch-in, this Pokémon's Special Defense is raised by 1 stage."
}
],
[
'emergencyexit',
{
Expand Down Expand Up @@ -754,6 +782,13 @@ export const abilities = new Collection<string, PokemonTypes.Ability>([
shortDesc: 'No competitive use.'
}
],
[
'hospitality',
{
name: 'Hospitality',
shortDesc: "On switch-in, this Pokémon restores 1/4 of its ally's maximum HP, rounded down."
}
],
[
'hugepower',
{
Expand Down Expand Up @@ -1095,6 +1130,14 @@ export const abilities = new Collection<string, PokemonTypes.Ability>([
shortDesc: "This Pokémon's types change to match the Terrain. Type reverts when Terrain ends."
}
],
[
'mindseye',
{
desc: "This Pokémon can hit Ghost types with Normal- and Fighting-type moves. Prevents other Pokémon from lowering this Pokémon's accuracy stat stage. This Pokémon ignores a target's evasiveness stat stage.",
name: "Mind's Eye",
shortDesc: "Fighting, Normal moves hit Ghost. Accuracy can't be lowered, ignores evasiveness."
}
],
[
'minus',
{
Expand Down Expand Up @@ -2001,6 +2044,13 @@ export const abilities = new Collection<string, PokemonTypes.Ability>([
shortDesc: "This Pokémon's critical hit ratio is raised by 1 stage."
}
],
[
'supersweetsyrup',
{
name: 'Supersweet Syrup',
shortDesc: 'On switch-in, this Pokémon lowers the evasiveness of opponents 1 stage. Once per battle.'
}
],
[
'supremeoverlord',
{
Expand Down Expand Up @@ -2156,6 +2206,14 @@ export const abilities = new Collection<string, PokemonTypes.Ability>([
shortDesc: 'While this Pokémon is poisoned, its physical attacks have 1.5x power.'
}
],
[
'toxicchain',
{
desc: "This Pokémon's moves have a 30% chance of badly poisoning. This effect comes after a move's inherent secondary effect chance.",
name: 'Toxic Chain',
shortDesc: "This Pokémon's moves have a 30% chance of badly poisoning."
}
],
[
'toxicdebris',
{
Expand Down Expand Up @@ -2380,64 +2438,6 @@ export const abilities = new Collection<string, PokemonTypes.Ability>([
name: 'Zero to Hero',
shortDesc: 'If this Pokémon is a Palafin in Zero Form, switching out has it change to Hero Form.'
}
],
[
'embodyaspectcornerstone',
{
name: 'Embody Aspect (Cornerstone)',
shortDesc: "On switch-in, this Pokémon's Defense is raised by 1 stage."
}
],
[
'embodyaspecthearthflame',
{
name: 'Embody Aspect (Hearthflame)',
shortDesc: "On switch-in, this Pokémon's Attack is raised by 1 stage."
}
],
[
'embodyaspectteal',
{
name: 'Embody Aspect (Teal)',
shortDesc: "On switch-in, this Pokémon's Speed is raised by 1 stage."
}
],
[
'embodyaspectwellspring',
{
name: 'Embody Aspect (Wellspring)',
shortDesc: "On switch-in, this Pokémon's Special Defense is raised by 1 stage."
}
],
[
'hospitality',
{
name: 'Hospitality',
shortDesc: "On switch-in, this Pokémon restores 1/4 of its ally's maximum HP, rounded down."
}
],
[
'mindseye',
{
desc: "This Pokémon can hit Ghost types with Normal- and Fighting-type moves. Prevents other Pokémon from lowering this Pokémon's accuracy stat stage. This Pokémon ignores a target's evasiveness stat stage.",
name: "Mind's Eye",
shortDesc: "Fighting, Normal moves hit Ghost. Accuracy can't be lowered, ignores evasiveness."
}
],
[
'supersweetsyrup',
{
name: 'Supersweet Syrup',
shortDesc: 'On switch-in, this Pokémon lowers the evasiveness of opponents 1 stage. Once per battle.'
}
],
[
'toxicchain',
{
desc: "This Pokémon's moves have a 30% chance of badly poisoning. This effect comes after a move's inherent secondary effect chance.",
name: 'Toxic Chain',
shortDesc: "This Pokémon's moves have a 30% chance of badly poisoning."
}
]
]);

Expand Down
Loading

0 comments on commit 9fa63e8

Please sign in to comment.