From 8f8ee9127de1672076ce85ebfaa9866876db0bef Mon Sep 17 00:00:00 2001 From: GhostFlys Date: Mon, 20 May 2024 14:44:00 +0800 Subject: [PATCH 1/6] Update chinese config.ts (#1149) --- src/locales/zh_CN/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 89d8d628f0e..874d257f8d6 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -28,7 +28,7 @@ export const zhCnConfig = { abilityTriggers: abilityTriggers, battle: battle, commandUiHandler: commandUiHandler, - // egg: egg, + egg: egg, fightUiHandler: fightUiHandler, growth: growth, menu: menu, From 2894c8bfc3740a1b5168e4973990bf9eac49c9dc Mon Sep 17 00:00:00 2001 From: Madmadness65 Date: Mon, 20 May 2024 01:51:08 -0500 Subject: [PATCH 2/6] Revert "Update chinese config.ts (#1149)" This reverts commit 8f8ee9127de1672076ce85ebfaa9866876db0bef. --- src/locales/zh_CN/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 874d257f8d6..89d8d628f0e 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -28,7 +28,7 @@ export const zhCnConfig = { abilityTriggers: abilityTriggers, battle: battle, commandUiHandler: commandUiHandler, - egg: egg, + // egg: egg, fightUiHandler: fightUiHandler, growth: growth, menu: menu, From 60cbd636e68a1333c92605ea61d208f36081d9fc Mon Sep 17 00:00:00 2001 From: GhostFlys Date: Mon, 20 May 2024 15:18:01 +0800 Subject: [PATCH 3/6] update chinese conifg.ts and egg.ts (#1151) * Update chinese config.ts * Update chinese egg.ts --- src/locales/zh_CN/config.ts | 4 ++-- src/locales/zh_CN/egg.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 89d8d628f0e..2a01460b855 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -2,7 +2,7 @@ import { ability } from "./ability"; import { abilityTriggers } from "./ability-trigger"; import { battle } from "./battle"; import { commandUiHandler } from "./command-ui-handler"; -// import { egg } from "./egg"; +import { egg } from "./egg"; import { fightUiHandler } from "./fight-ui-handler"; import { growth } from "./growth"; import { menu } from "./menu"; @@ -28,7 +28,7 @@ export const zhCnConfig = { abilityTriggers: abilityTriggers, battle: battle, commandUiHandler: commandUiHandler, - // egg: egg, + egg: egg, fightUiHandler: fightUiHandler, growth: growth, menu: menu, diff --git a/src/locales/zh_CN/egg.ts b/src/locales/zh_CN/egg.ts index cc137d717aa..99916ab0778 100644 --- a/src/locales/zh_CN/egg.ts +++ b/src/locales/zh_CN/egg.ts @@ -6,16 +6,16 @@ export const egg: SimpleTranslationEntries = { "ultraTier": "史诗", "masterTier": "传说", "defaultTier": "普通", - "hatchWavesMessageSoon": "里面传来声音!似乎快要孵化了!", - "hatchWavesMessageClose": "有时好像会动一下。就快孵化了吧?", - "hatchWavesMessageNotClose": "会孵化出什么呢?看来还需要很长时间才能孵化。", - "hatchWavesMessageLongTime": "这个蛋需要很长时间才能孵化。", + "hatchWavesMessageSoon": "里面传来声音!\n似乎快要孵化了!", + "hatchWavesMessageClose": "有时好像会动一下。\n就快孵化了吧?", + "hatchWavesMessageNotClose": "会孵化出什么呢?\n看来还需要很长时\n间才能孵化。", + "hatchWavesMessageLongTime": "这个蛋需要很长时间\n才能孵化。", "gachaTypeLegendary": "传说概率上升", "gachaTypeMove": "稀有概率上升", "gachaTypeShiny": "闪光概率上升", "selectMachine": "选择一个机器。", "notEnoughVouchers": "你没有足够的兑换券!", "tooManyEggs": "你的蛋太多啦!", - "pull": "抽", - "pulls": "连抽" -} as const; \ No newline at end of file + "pull": "次", + "pulls": "次" +} as const; From f93f2bfca660af2facab21e8bdf5a7877cec2832 Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Mon, 20 May 2024 04:06:20 -0500 Subject: [PATCH 4/6] Reduce EXP Balance (#1128) * Set max to 4 --- src/modifier/modifier.ts | 2 +- src/system/game-data.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 0736831a01e..75f54296a20 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1423,7 +1423,7 @@ export class ExpBalanceModifier extends PersistentModifier { } getMaxStackCount(scene: BattleScene): integer { - return 5; + return 4; } } diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 2691e79be61..8b09fe8b910 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -867,8 +867,11 @@ export class GameData { const ret: PersistentModifierData[] = []; if (v === null) v = []; - for (let md of v) + for (let md of v) { + if(md?.className === 'ExpBalanceModifier') // Temporarily limit EXP Balance until it gets reworked + md.stackCount = Math.min(md.stackCount, 4); ret.push(new PersistentModifierData(md, player)); + } return ret; } From 9493f59a4e82894bfab159e23d5ad62dc91a37d8 Mon Sep 17 00:00:00 2001 From: JO <35469623+AJ2O@users.noreply.github.com> Date: Mon, 20 May 2024 08:30:45 -0400 Subject: [PATCH 5/6] Complete Psychic Fangs TM list (#1161) --- src/data/tms.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/data/tms.ts b/src/data/tms.ts index 0b2c2c93bc8..d8b22438c37 100644 --- a/src/data/tms.ts +++ b/src/data/tms.ts @@ -60026,10 +60026,14 @@ export const tmSpecies: TmSpecies = { Species.ARCANINE, Species.AERODACTYL, Species.MEW, + Species.CROCONAW, + Species.FERALIGATR, Species.ESPEON, Species.GIRAFARIG, Species.GLIGAR, Species.STEELIX, + Species.SNUBBULL, + Species.GRANBULL, Species.HOUNDOUR, Species.HOUNDOOM, Species.POOCHYENA, From d2e455cdadbe250bf02ab44b4b885f2cc750429e Mon Sep 17 00:00:00 2001 From: Greenlamp2 <44787002+Greenlamp2@users.noreply.github.com> Date: Mon, 20 May 2024 14:31:16 +0200 Subject: [PATCH 6/6] Tests - Check if something is wrong with the variant's sprite (#1162) * return a list of errors if something is wrong with the variant's sprite * reformat --- src/test/pokemonSprite.test.ts | 213 +++++++++++++++++++++++++++++++++ src/test/testUtils.ts | 10 ++ 2 files changed, 223 insertions(+) create mode 100644 src/test/pokemonSprite.test.ts create mode 100644 src/test/testUtils.ts diff --git a/src/test/pokemonSprite.test.ts b/src/test/pokemonSprite.test.ts new file mode 100644 index 00000000000..f1be5c0ca3c --- /dev/null +++ b/src/test/pokemonSprite.test.ts @@ -0,0 +1,213 @@ +import {beforeAll, describe, expect, it} from "vitest"; +import _masterlist from '../../public/images/pokemon/variant/_masterlist.json'; +import fs from 'fs'; +import path from 'path'; +import {getAppRootDir} from "#app/test/testUtils"; + +const deepCopy = (data) => { + return JSON.parse(JSON.stringify(data)); +} + + +describe("check if every variant's sprite are correctly set", () => { + let masterlist; + let expVariant; + let femaleVariant; + let backVariant; + let rootDir; + + beforeAll(() => { + rootDir = `${getAppRootDir()}${path.sep}public${path.sep}images${path.sep}pokemon${path.sep}variant${path.sep}` + masterlist = deepCopy(_masterlist); + expVariant = masterlist.exp; + femaleVariant = masterlist.female; + backVariant = masterlist.back; + delete masterlist.exp + delete masterlist.female + delete masterlist.back + }); + + it('data should not be undefined', () => { + expect(masterlist).not.toBeUndefined(); + expect(expVariant).not.toBeUndefined(); + expect(femaleVariant).not.toBeUndefined(); + expect(backVariant).not.toBeUndefined(); + }); + + function getMissingMasterlist(mlist, dirpath, excludes = []) { + const errors = []; + if (fs.existsSync(dirpath)) { + const files = fs.readdirSync(dirpath); + for (const filename of files) { + const filePath = `${dirpath}${filename}` + const ext = filename.split('.')[1]; + const name = filename.split('.')[0]; + if (excludes.includes(name)) continue; + if (name.includes('_')) { + const id = name.split('_')[0]; + const variant = name.split('_')[1]; + if (ext !== 'json') { + if (mlist.hasOwnProperty(id)) { + const urlJsonFile = `${dirpath}${id}.json`; + const jsonFileExists = fs.existsSync(urlJsonFile); + if (mlist[id].includes(1)) { + const msg = `MISSING JSON ${urlJsonFile}`; + if (!jsonFileExists && !errors.includes(msg)) errors.push(msg); + } + } + if (!mlist.hasOwnProperty(id)) errors.push(`missing key ${id} in masterlist for ${filePath}`); + else if (mlist[id][parseInt(variant, 10) - 1] !== 2) errors.push(`the value should be 2 for the index ${parseInt(variant, 10) - 1} - ${filePath}`); + } + } else if (!mlist.hasOwnProperty(name)) errors.push(`named - missing key ${name} in masterlist for ${filePath}`);else { + const raw = fs.readFileSync(filePath, {encoding: 'utf8', flag: 'r'}); + const data = JSON.parse(raw); + for (const key of Object.keys(data)) { + if (mlist[name][key] !== 1) errors.push(`the value should be 1 in the array ${filePath}`); + } + } + } + } + return errors; + } + + function getMissingFiles(keys, dirPath) { + const errors = []; + for (const key of Object.keys(keys)) { + const row = keys[key]; + for (const [index, elm] of row.entries()) { + let url; + if (elm === 0) continue + else if (elm === 1) { + url = `${key}.json` + let filePath = `${dirPath}${url}`; + const raw = fs.readFileSync(filePath, {encoding: 'utf8', flag: 'r'}); + const data = JSON.parse(raw); + if (!data.hasOwnProperty(index)) { + errors.push(`index: ${index} - ${filePath}`); + } + } else if (elm === 2) { + url = `${key}_${parseInt(index, 10) + 1}.png`; + let filePath = `${dirPath}${url}`; + if (!fs.existsSync(filePath)) { + errors.push(filePath) + } + + url = `${key}_${parseInt(index, 10) + 1}.json`; + filePath = `${dirPath}${url}`; + if (!fs.existsSync(filePath)) { + errors.push(filePath) + } + } + } + } + return errors; + } + + // chech presence of every files listed in masterlist + + it('check root variant files', () => { + const dirPath = rootDir; + const errors = getMissingFiles(masterlist, dirPath); + if (errors.length) console.log('errors', errors); + expect(errors.length).toBe(0); + }); + + it('check female variant files', () => { + const dirPath = `${rootDir}female${path.sep}`; + const errors = getMissingFiles(femaleVariant, dirPath); + if (errors.length) console.log('errors', errors); + expect(errors.length).toBe(0); + }); + + it('check back female variant files', () => { + const dirPath = `${rootDir}back${path.sep}female${path.sep}`; + const errors = getMissingFiles(backVariant.female, dirPath); + if (errors.length) console.log('errors', errors); + expect(errors.length).toBe(0); + }); + + it('check back male back variant files', () => { + const dirPath = `${rootDir}back${path.sep}`; + let backMaleVariant = deepCopy(backVariant); + delete backMaleVariant.female; + const errors = getMissingFiles(backMaleVariant, dirPath); + if (errors.length) console.log('errors', errors); + expect(errors.length).toBe(0); + }); + + it('check exp back variant files', () => { + const dirPath = `${rootDir}exp${path.sep}back${path.sep}`; + const errors = getMissingFiles(expVariant.back, dirPath); + if (errors.length) console.log('errors', errors); + expect(errors.length).toBe(0); + }); + + it('check exp female variant files', () => { + const dirPath = `${rootDir}exp${path.sep}female${path.sep}`; + const errors = getMissingFiles(expVariant.female, dirPath); + if (errors.length) console.log('errors', errors); + expect(errors.length).toBe(0); + }); + + it('check exp male variant files', () => { + const dirPath = `${rootDir}exp${path.sep}`; + let expMaleVariant = deepCopy(expVariant); + delete expMaleVariant.female; + delete expMaleVariant.back; + const errors = getMissingFiles(expMaleVariant, dirPath); + if (errors.length) console.log('errors', errors); + expect(errors.length).toBe(0); + }); + + // check over every file if it's correctly set in the masterlist + + it('look over every file in variant female and check if present in masterlist', () => { + const dirPath = `${rootDir}female${path.sep}`; + const errors = getMissingMasterlist(femaleVariant, dirPath); + if (errors.length) console.log('errors for ', dirPath, errors); + expect(errors.length).toBe(0); + }); + + it('look over every file in variant back female and check if present in masterlist', () => { + const dirPath = `${rootDir}back${path.sep}female${path.sep}`; + const errors = getMissingMasterlist(backVariant.female, dirPath); + if (errors.length) console.log('errors for ', dirPath, errors); + expect(errors.length).toBe(0); + }); + + it('look over every file in variant back male and check if present in masterlist', () => { + const dirPath = `${rootDir}back${path.sep}`; + let backMaleVariant = deepCopy(backVariant); + const errors = getMissingMasterlist(backMaleVariant, dirPath, ['female']); + if (errors.length) console.log('errors for ', dirPath, errors); + expect(errors.length).toBe(0); + }); + + it('look over every file in variant exp back and check if present in masterlist', () => { + const dirPath = `${rootDir}exp${path.sep}back${path.sep}`; + const errors = getMissingMasterlist(expVariant.back, dirPath); + if (errors.length) console.log('errors for ', dirPath, errors); + expect(errors.length).toBe(0); + }); + + it('look over every file in variant exp female and check if present in masterlist', () => { + const dirPath = `${rootDir}exp${path.sep}female${path.sep}`; + const errors = getMissingMasterlist(expVariant.female, dirPath); + if (errors.length) console.log('errors for ', dirPath, errors); + expect(errors.length).toBe(0); + }); + + it('look over every file in variant exp male and check if present in masterlist', () => { + const dirPath = `${rootDir}exp${path.sep}`; + const errors = getMissingMasterlist(expVariant, dirPath, ['back', 'female']); + if (errors.length) console.log('errors for ', dirPath, errors); + expect(errors.length).toBe(0); + }); + + it('look over every file in variant root and check if present in masterlist', () => { + const dirPath = `${rootDir}`; + const errors = getMissingMasterlist(masterlist, dirPath, ['back', 'female', 'exp', 'icons']); + if (errors.length) console.log('errors for ', dirPath, errors); + expect(errors.length).toBe(0); + }); +}); \ No newline at end of file diff --git a/src/test/testUtils.ts b/src/test/testUtils.ts new file mode 100644 index 00000000000..6d01afdb1bc --- /dev/null +++ b/src/test/testUtils.ts @@ -0,0 +1,10 @@ +const fs = require('fs') +const path = require('path') + +export function getAppRootDir () { + let currentDir = __dirname + while(!fs.existsSync(path.join(currentDir, 'package.json'))) { + currentDir = path.join(currentDir, '..') + } + return currentDir +} \ No newline at end of file