feat: give additionalItems for weapons (#1011)
Closes #1002 Reviewed-on: #1011 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>
This commit is contained in:
		
							parent
							
								
									39f0f7de9a
								
							
						
					
					
						commit
						3d82fee99e
					
				@ -292,6 +292,11 @@ export const addItem = async (
 | 
				
			|||||||
        const weapon = ExportWeapons[typeName];
 | 
					        const weapon = ExportWeapons[typeName];
 | 
				
			||||||
        if (weapon.totalDamage != 0) {
 | 
					        if (weapon.totalDamage != 0) {
 | 
				
			||||||
            const inventoryChanges = addEquipment(inventory, weapon.productCategory, typeName);
 | 
					            const inventoryChanges = addEquipment(inventory, weapon.productCategory, typeName);
 | 
				
			||||||
 | 
					            if (weapon.additionalItems) {
 | 
				
			||||||
 | 
					                for (const item of weapon.additionalItems) {
 | 
				
			||||||
 | 
					                    combineInventoryChanges(inventoryChanges, await addItem(inventory, item, 1));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            updateSlots(inventory, InventorySlot.WEAPONS, 0, 1);
 | 
					            updateSlots(inventory, InventorySlot.WEAPONS, 0, 1);
 | 
				
			||||||
            return {
 | 
					            return {
 | 
				
			||||||
                InventoryChanges: {
 | 
					                InventoryChanges: {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user