import { DWeaponTypeKey } from "../.." ; import { nameToKey , TextMapEN } from "../../TextMapUtil" ; import { dumpFile } from "../../Util" ; type WeaponExcelConfigData = { "WeaponType" : DWeaponTypeKey ; "RankLevel" : 1 | 2 | 3 | 4 | 5 ; "WeaponBaseExp" : number ; "SkillAffix" : number [ ] ; "WeaponProp" : [ { "PropType" : "FIGHT_PROP_BASE_ATTACK" ; "InitValue" : 42.4010009765625 ; "Type" : "GROW_CURVE_ATTACK_201" ; } , { "PropType" : "FIGHT_PROP_DEFENSE_PERCENT" ; "InitValue" : 0.11259999871253967 ; "Type" : "GROW_CURVE_CRITICAL_201" ; } ] ; "AwakenTexture" : string ; "AwakenLightMapTexture" : string ; "AwakenIcon" : string ; "WeaponPromoteId" : number ; "StoryId" : number ; "AwakenCosts" : number [ ] ; "GachaCardNameHashSuffix" : number ; "GachaCardNameHashPre" : number ; "DestroyReturnMaterial" : number [ ] ; "DestroyReturnMaterialCount" : number [ ] ; "Weight" : number ; "Id" : number ; "NameTextMapHash" : number ; "DescTextMapHash" : number ; "Icon" : "UI_EquipIcon_Claymore_Exotic" ; "ItemType" : "ITEM_WEAPON" ; "Rank" : 10 ; "GadgetId" : 50012407 ; } ; const weaponExcelConfigDataSrc = require ( '../../GenshinData/ExcelBinOutput/WeaponExcelConfigData.json' ) as WeaponExcelConfigData [ ] ; const weaponExcelConfigData = Object . fromEntries ( weaponExcelConfigDataSrc . map ( data => [ data . Id , data ] ) ) ; dumpFile ( `${ __dirname }/WeaponExcelConfigData_idmap_gen.json` , Object . fromEntries ( weaponExcelConfigDataSrc . map ( data => [ data . Id , nameToKey ( TextMapEN [ data . NameTextMapHash ] ) ] ) ) ) ; export default weaponExcelConfigData ;