import { PropTypeKey , SubstatKey , SubStatPropTypeMap } from "../.." ; import { extrapolateFloat } from "../../extrapolateFloat" ; import { layeredAssignment } from "../../Util" ; type ReliquaryAffixExcelConfigData = { "Id" : number ; "DepotId" : number ; "GroupId" : number ; "PropType" : PropTypeKey ; "PropValue" : number ; "Weight" : number ; "UpgradeWeight" : number ; } ; const artifactSubstatDataSrc = require ( '../../GenshinData/ExcelBinOutput/ReliquaryAffixExcelConfigData.json' ) as ReliquaryAffixExcelConfigData [ ] ; type artifaceSubstatData = { [ Rarity ] : Record < SubstatKey , number [ ] > ; } ; const artifactSubstatData = { } as artifaceSubstatData ; Array . from ( { length : 5 } , ( _ , i ) => i + 1 ) . forEach ( rank => { Object . values ( SubStatPropTypeMap ) . forEach ( element => { layeredAssignment ( artifactSubstatData , [ rank , element ] , [ ] ) ; } ) ; } ) ; artifactSubstatDataSrc . forEach ( ( { DepotId , GroupId , PropType , PropValue } ) => { const rank = Math . round ( DepotId / 100 ) ; if ( rank > 5 ) return ; artifactSubstatData [ rank ] [ SubStatPropTypeMap [ PropType ] ] . push ( extrapolateFloat ( PropValue ) ) ; } ) ; export default artifactSubstatData ;