Ejemplo n.º 1
0
        private static void AddEquipmentAction(List <EquipmentDef> equipmentDefinitions)
        {
            foreach (var customEquipment in EquipmentDefinitions)
            {
                equipmentDefinitions.Add(customEquipment.EquipmentDef);

                R2API.Logger.LogInfo($"Custom Equipment: {customEquipment.EquipmentDef.nameToken} added");
            }

            var equipments      = EquipmentDefinitions.Where(c => c.EquipmentDef.canDrop && !c.EquipmentDef.isLunar).Select(x => x.EquipmentDef.equipmentIndex).ToArray();
            var lunarEquipments = EquipmentDefinitions.Where(c => c.EquipmentDef.canDrop && c.EquipmentDef.isLunar).Select(x => x.EquipmentDef.equipmentIndex).ToList();

            ItemDropAPI.AddToDefaultEquipment(equipments);
            ItemDropAPI.AddDrops(ItemDropLocation.LunarChest, lunarEquipments.ToSelection());

            _equipmentCatalogInitialized = true;
        }