import { MainPropMap , MainStatKey , PropTypeKey , propTypeMap , StatKey } from "../.." ; import { extrapolateFloat } from "../../extrapolateFloat" ; import { layeredAssignment } from "../../Util" ; type ReliquaryLevelExcelConfigData = { "Rank" : number ; "Level" : number ; "Exp" : number ; "AddProps" : { "PropType" : PropTypeKey ; "Value" : number ; } [ ] ; } ; const artifactMainstatDataSrc = require ( '../../GenshinData/ExcelBinOutput/ReliquaryLevelExcelConfigData.json' ) as ReliquaryLevelExcelConfigData [ ] ; export type artifaceMainstatData = { [ rank ] : Record < MainStatKey , number [ ] > ; } ; const artifactMainstatData = { } as artifaceMainstatData ; Array . from ( { length : 5 } , ( _ , i ) => i + 1 ) . forEach ( rank => { Object . values ( MainPropMap ) . forEach ( element => { layeredAssignment ( artifactMainstatData , [ rank , element ] , [ ] ) ; } ) ; } ) ; artifactMainstatDataSrc . forEach ( ( { Rank = 0 , Level , AddProps } ) => { if ( ! Rank ) return ; if ( ( Level - 1 ) > Rank * 4 ) return ; AddProps . forEach ( ( { PropType , Value } ) => { if ( [ "FIGHT_PROP_FIRE_SUB_HURT" , "FIGHT_PROP_GRASS_ADD_HURT" , "FIGHT_PROP_DEFENSE" ] . includes ( PropType ) ) return ; if ( Object . keys ( MainPropMap ) . includes ( PropType ) ) layeredAssignment ( artifactMainstatData , [ Rank , propTypeMap [ PropType ] , Level - 1 ] , extrapolateFloat ( Value ) ) ; else console . warn ( `MainPropMap.${ PropType } is not a valid key.` ) ; } ) ; } ) ; export default artifactMainstatData ;