Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/i18n/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
*/

import type { LanguageLayer } from './layer';
import { ENGLISH_ITEM_NAMES } from './itemNames';

export const englishLayer: LanguageLayer = {
name: 'english',
code: 'en',
aliases: ['en-US', 'en-GB', 'en-AU', 'en-CA'],
label: 'English',
region: 'GB',
dataPack: { folder: 'Eng', suffix: 'eng' },
dataPack: { folder: 'Eng', suffix: 'eng', itemNames: ENGLISH_ITEM_NAMES },
};
27 changes: 26 additions & 1 deletion src/i18n/itemNames.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { existsSync, readFileSync } from 'fs';
import { beforeEach, describe, expect, it } from 'vitest';
import { i18n } from './index';
import { SPANISH_ITEM_NAMES } from './itemNames';
import { ENGLISH_ITEM_NAMES, PORTUGUESE_ITEM_NAMES, SPANISH_ITEM_NAMES } from './itemNames';
import { englishLayer } from './english';
import { portugueseLayer } from './portuguese';
import { spanishLayer } from './spanish';
import { localisedItemName, parseItemNames } from '../controllers/assets/mu/itemNameFile';

Expand Down Expand Up @@ -68,3 +70,26 @@ describe('Spanish item names', () => {
expect(localisedItemName(15, 0)).toBe('Pergamino de Veneno');
});
});

describe('the Destroy set and the Guardian Shield', () => {
const packs = [
['Eng', 'item_eng.bmd', ENGLISH_ITEM_NAMES, englishLayer],
['Por', 'item_por.bmd', PORTUGUESE_ITEM_NAMES, portugueseLayer],
['Spn', 'item_spn.bmd', SPANISH_ITEM_NAMES, spanishLayer],
] as const;

for (const [folder, file, fixes, layer] of packs) {
const url = new URL(`../../Data/Local/${folder}/${file}`, import.meta.url);

it(`${folder}: is wired into the layer`, () => {
expect(layer.dataPack?.itemNames).toBe(fixes);
});

it.skipIf(!existsSync(url))(`${folder}: no name is spelled "Destory" or "Shiled" once fixed`, () => {
const names = parseItemNames(new Uint8Array(readFileSync(url)));
for (const [key, name] of Object.entries(fixes)) names.set(code(key), name);
const left = [...names.values()].filter(name => /Destory|Shiled/i.test(name));
expect(left).toEqual([]);
});
}
});
28 changes: 28 additions & 0 deletions src/i18n/itemNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,32 @@ export const SPANISH_ITEM_NAMES: ItemNameFixes = {
'9/53': 'Pantalones de la Reina',
'10/53': 'Guantes de la Reina',
'11/53': 'Botas de la Reina',

// --- typo in the pack ---------------------------------------------------
// The pack spells the set "Destory"; it is Destroy.
'8/47': 'Destroy Armor',
'9/47': 'Destroy Pants',
'10/47': 'Destroy Gloves',
'11/47': 'Destroy Boots',
};

// ---- Portuguese (`Data/Local/Por`) -----------------------------------------

export const PORTUGUESE_ITEM_NAMES: ItemNameFixes = {
// The pack spells the set "Destory"; it is Destroy.
'8/47': 'Destroy Armor',
'9/47': 'Destroy Pants',
'10/47': 'Destroy Gloves',
'11/47': 'Destroy Boots',
};

// ---- English (`Data/Local/Eng`) --------------------------------------------

export const ENGLISH_ITEM_NAMES: ItemNameFixes = {
// The pack spells the set "Destory"; it is Destroy.
'8/47': 'Destroy Armor',
'9/47': 'Destroy Pants',
'10/47': 'Destroy Gloves',
'11/47': 'Destroy Boots',
'6/20': 'Guardian Shield',
};
2 changes: 2 additions & 0 deletions src/i18n/portuguese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import type { LanguageLayer } from './layer';
import { PORTUGUESE_PACK_REPAIRS } from './packRepairs';
import { PORTUGUESE_ITEM_NAMES } from './itemNames';
import { PORTUGUESE_DIALOG_PAGES } from './dialogPages';

export const portugueseLayer: LanguageLayer = {
Expand All @@ -21,6 +22,7 @@ export const portugueseLayer: LanguageLayer = {
suffix: 'por',
encoding: 'windows-1252',
repairs: PORTUGUESE_PACK_REPAIRS,
itemNames: PORTUGUESE_ITEM_NAMES,
dialogPages: PORTUGUESE_DIALOG_PAGES,
},
};
4 changes: 2 additions & 2 deletions src/i18n/text.golden.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('text golden', () => {

expect(KEYS.length).toBe(2640);
expect(hashes).toEqual({
en: '544ced3d91139801',
en: '1b38c602d1ff9e2b',
bg: 'd194a222bfa64797',
zh: '7648439d402221ae',
fr: '9250ef047d39ae17',
Expand All @@ -44,7 +44,7 @@ describe('text golden', () => {
ja: '135032b994caaedb',
ko: 'e146b1e309cb8764',
pl: 'ab1b7bfe910457e2',
pt: '819a0071da3588f5',
pt: '8ab4168985f923c7',
ro: '37b74292d7196cab',
ru: 'ed68556919de2831',
es: 'fd92ec6a364869ec',
Expand Down
10 changes: 5 additions & 5 deletions tools/Item.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ end
17 1 18 2 2 1 1 1 "Crimson Glory Shield" 104 19 90 51 380 95 48 0 0 0 4 0 2 0 0 0 0
18 1 18 2 2 1 1 1 "Salamander Shield" 102 20 96 51 380 80 61 0 0 0 4 0 0 0 1 0 0
19 1 0 2 2 1 1 1 "Frost Barrier Shield" 99 14 58 51 380 26 53 26 0 0 4 0 0 2 0 0 0
20 1 18 2 2 1 1 1 "Guardian Shiled" 106 12 30 51 380 54 18 0 0 0 4 2 0 0 0 0 0
20 1 18 2 2 1 1 1 "Guardian Shield" 106 12 30 51 380 54 18 0 0 0 4 2 0 0 0 0 0
21 1 18 2 2 1 1 1 "Cross Shield" 70 16 75 65 0 140 55 0 0 0 4 0 0 0 0 1 0
end

Expand Down Expand Up @@ -282,7 +282,7 @@ end
44 3 0 2 2 1 1 1 "Lilium Armor" 113 71 0 84 0 110 50 0 0 0 0 2 0 0 0 0 2
45 3 0 2 3 1 1 1 "Titan Armor" 132 81 0 86 380 222 32 0 0 0 0 0 1 0 0 0 0
46 3 0 2 3 1 1 1 "Brave Armor" 128 62 0 86 380 74 162 0 0 0 0 0 1 0 0 0 0
47 3 0 2 3 1 1 1 "Destory Armor" 131 80 0 86 380 212 57 0 0 0 0 0 0 0 1 0 0
47 3 0 2 3 1 1 1 "Destroy Armor" 131 80 0 86 380 212 57 0 0 0 0 0 0 0 1 0 0
48 3 0 2 3 1 1 1 "Phantom Armor" 125 66 0 86 380 62 19 165 0 0 0 0 0 0 1 0 0
49 3 0 2 2 1 1 1 "Seraphim Armor" 129 60 0 86 380 55 197 0 0 0 0 0 0 1 0 0 0
50 3 0 2 2 1 1 1 "Faith Armor" 122 52 0 86 380 32 29 138 0 0 0 0 0 1 0 0 0
Expand Down Expand Up @@ -341,7 +341,7 @@ end
44 4 0 2 2 1 1 1 "Lilium Pants" 120 52 0 82 0 75 30 0 0 0 0 2 0 0 0 0 2
45 4 0 2 2 1 1 1 "Titan Pants" 116 74 0 86 380 222 32 0 0 0 0 0 1 0 0 0 0
46 4 0 2 2 1 1 1 "Brave Pants" 112 58 0 86 380 74 162 0 0 0 0 0 1 0 0 0 0
47 4 0 2 2 1 1 1 "Destory Pants" 115 66 0 86 380 212 57 0 0 0 0 0 0 0 1 0 0
47 4 0 2 2 1 1 1 "Destroy Pants" 115 66 0 86 380 212 57 0 0 0 0 0 0 0 1 0 0
48 4 0 2 2 1 1 1 "Phantom Pants" 113 51 0 86 380 62 19 165 0 0 0 0 0 0 1 0 0
49 4 0 2 2 1 1 1 "Seraphim Pants" 116 53 0 86 380 55 197 0 0 0 0 0 0 1 0 0 0
50 4 0 2 2 1 1 1 "Faith Pants" 109 46 0 86 380 32 29 138 0 0 0 0 0 1 0 0 0
Expand Down Expand Up @@ -400,7 +400,7 @@ end
44 5 0 2 2 1 1 1 "Lilium Gloves" 82 45 7 80 0 75 20 0 0 0 0 2 0 0 0 0 2
45 5 0 2 2 1 1 1 "Titan Gloves" 100 56 7 86 380 222 32 0 0 0 0 0 1 0 0 0 0
46 5 0 2 2 1 1 1 "Brave Gloves" 97 42 7 86 380 74 162 0 0 0 0 0 1 0 0 0 0
47 5 0 2 2 1 1 1 "Destory Gloves" 101 49 7 86 380 212 57 0 0 0 0 0 0 0 1 0 0
47 5 0 2 2 1 1 1 "Destroy Gloves" 101 49 7 86 380 212 57 0 0 0 0 0 0 0 1 0 0
48 5 0 2 2 1 1 1 "Phantom Gloves" 99 40 7 86 380 62 19 165 0 0 0 0 0 0 1 0 0
49 5 0 2 2 1 1 1 "Seraphim Gloves" 100 43 7 86 380 55 197 0 0 0 0 0 0 1 0 0 0
50 5 0 2 2 1 1 1 "Faith Gloves" 95 36 7 86 380 32 29 138 0 0 0 0 0 1 0 0 0
Expand Down Expand Up @@ -459,7 +459,7 @@ end
44 6 0 2 2 1 1 1 "Lilium Boots" 90 50 0 85 0 150 30 0 0 0 0 2 0 0 0 0 2
45 6 0 2 2 1 1 1 "Titan Boots" 96 57 0 86 380 222 32 0 0 0 0 0 1 0 0 0 0
46 6 0 2 2 1 1 1 "Brave Boots" 93 45 0 86 380 74 162 0 0 0 0 0 1 0 0 0 0
47 6 0 2 2 1 1 1 "Destory Boots" 97 54 0 86 380 212 57 0 0 0 0 0 0 0 1 0 0
47 6 0 2 2 1 1 1 "Destroy Boots" 97 54 0 86 380 212 57 0 0 0 0 0 0 0 1 0 0
48 6 0 2 2 1 1 1 "Phantom Boots" 94 44 0 86 380 62 19 165 0 0 0 0 0 0 1 0 0
49 6 0 2 2 1 1 1 "Seraphim Boots" 97 42 0 86 380 55 197 0 0 0 0 0 0 1 0 0 0
50 6 0 2 2 1 1 1 "Faith Boots" 92 35 0 86 380 32 29 138 0 0 0 0 0 1 0 0 0
Expand Down
2 changes: 1 addition & 1 deletion versions/shared/items/armors/destory_armor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineItem({
Serial: 1,
Opt: 1,
Drop: 1,
ItemName: 'Destory Armor',
ItemName: 'Destroy Armor',
ItemLvl: 131,
Def: 80,
DefRate: 0,
Expand Down
2 changes: 1 addition & 1 deletion versions/shared/items/boots/destory_boots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineItem({
Serial: 1,
Opt: 1,
Drop: 1,
ItemName: 'Destory Boots',
ItemName: 'Destroy Boots',
ItemLvl: 97,
Def: 54,
DefRate: 0,
Expand Down
2 changes: 1 addition & 1 deletion versions/shared/items/gloves/destory_gloves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineItem({
Serial: 1,
Opt: 1,
Drop: 1,
ItemName: 'Destory Gloves',
ItemName: 'Destroy Gloves',
ItemLvl: 101,
Def: 49,
DefRate: 7,
Expand Down
2 changes: 1 addition & 1 deletion versions/shared/items/items.golden.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { items } from './all';
* The item files are the old items.json split one per item. This hash is that table's, in (group, index)
* order, so any change to an item's data shows here: update it on purpose, in the same commit.
*/
const ITEMS_HASH = '3fead1832bf8437df8dbd5a9ed4c3ce3369bb5a608ba3d4ae7d1bee8b210d19d';
const ITEMS_HASH = 'd4b6964dfa165889bd0ce9826a40fd3987cdbf08c2ec49ac249f6cb3a9562e93';

describe('item files', () => {
it('hold every item, unchanged', () => {
Expand Down
2 changes: 1 addition & 1 deletion versions/shared/items/pants/destory_pants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineItem({
Serial: 1,
Opt: 1,
Drop: 1,
ItemName: 'Destory Pants',
ItemName: 'Destroy Pants',
ItemLvl: 115,
Def: 66,
DefRate: 0,
Expand Down
2 changes: 1 addition & 1 deletion versions/shared/items/shields/guardian_shiled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineItem({
Serial: 1,
Opt: 1,
Drop: 1,
ItemName: 'Guardian Shiled',
ItemName: 'Guardian Shield',
ItemLvl: 106,
Def: 12,
DefRate: 30,
Expand Down
Loading