import { BinaryStream } from "../../save-file/binary" ; import { Item } from "../types/Item" ; import { ARMORS , MISC , WEAPONS } from "../../../game-data" ; export function parseQuantified ( { read , readInt } , item ) { const baseArmor = ARMORS [ item . code ] ; const baseWeapon = WEAPONS [ item . code ] ; const baseMisc = MISC [ item . code ] ; if ( baseArmor ) { item . defense = readInt ( 11 ) - 10 ; } if ( baseArmor || baseWeapon ) { const maxDurability = readInt ( 8 ) ; if ( maxDurability ) { item . durability = [ readInt ( 8 ) , maxDurability ] ; read ( 1 ) ; } } if ( baseArmor ?. stackable || baseWeapon ?. stackable || baseMisc ?. stackable ) { item . quantity = readInt ( 9 ) ; } if ( item . socketed ) { item . sockets = readInt ( 4 ) ; } }