import { nameToKey , TextMapEN } from "../../TextMapUtil" ; import { dumpFile } from "../../Util" ; export type MaterialTypeKey = null | "MATERIAL_FAKE_ABSORBATE" | "MATERIAL_ADSORBATE" | "MATERIAL_CONSUME" | "MATERIAL_TALENT" | "MATERIAL_AVATAR" | "MATERIAL_CHEST" | "MATERIAL_NOTICE_ADD_HP" | "MATERIAL_EXCHANGE" | "MATERIAL_WOOD" | "MATERIAL_HOME_SEED" | "MATERIAL_QUEST" | "MATERIAL_CRICKET" | "MATERIAL_WIDGET" | "MATERIAL_FOOD" | "MATERIAL_EXP_FRUIT" | "MATERIAL_WEAPON_EXP_STONE" | "MATERIAL_AVATAR_MATERIAL" | "MATERIAL_RELIQUARY_MATERIAL" | "MATERIAL_ELEM_CRYSTAL" | "MATERIAL_CONSUME_BATCH_USE" | "MATERIAL_FISH_BAIT" | "MATERIAL_CHEST_BATCH_USE" | "MATERIAL_SELECTABLE_CHEST" | "MATERIAL_FLYCLOAK" | "MATERIAL_SEA_LAMP" | "MATERIAL_CHANNELLER_SLAB_BUFF" | "MATERIAL_FISH_ROD" | "MATERIAL_NAMECARD" | "MATERIAL_COSTUME" | "MATERIAL_FURNITURE_SUITE_FORMULA" | "MATERIAL_FURNITURE_FORMULA" ; type MaterialExcelConfigData = { "InteractionTitleTextMapHash" : number ; "MaterialType" : MaterialTypeKey ; "StackLimit" : number ; "UseParam" : [ ] ; "EffectDescTextMapHash" : number ; "SpecialDescTextMapHash" : number ; "TypeDescTextMapHash" : number ; "EffectIcon" : string ; "EffectName" : string ; "SatiationParams" : [ ] ; "DestroyRule" : string ; "DestroyReturnMaterial" : [ ] ; "DestroyReturnMaterialCount" : [ ] ; "Id" : number ; "NameTextMapHash" : number ; "DescTextMapHash" : number ; "Icon" : string ; "ItemType" : string ; "Rank" : number ; } ; const materialExcelConfigDataSrc = require ( '../../GenshinData/ExcelBinOutput/MaterialExcelConfigData.json' ) as MaterialExcelConfigData [ ] ; const materialExcelConfigData = Object . fromEntries ( materialExcelConfigDataSrc . map ( data => [ data . Id , data ] ) ) as { [ AvatarId ] : MaterialExcelConfigData ; } ; const materialType = new Set ( materialExcelConfigDataSrc . map ( data => data . MaterialType ) ) ; dumpFile ( `${ __dirname }/MaterialExcelConfigData_MaterialType_gen.json` , [ ... materialType ] ) ; dumpFile ( `${ __dirname }/MaterialExcelConfigData_idmap_gen.json` , Object . fromEntries ( materialExcelConfigDataSrc . map ( data => [ data . Id , nameToKey ( TextMapEN [ data . NameTextMapHash ] ) ] ) ) ) ; export default materialExcelConfigData ;