예제 #1
0
        private void OnEquipmentAdded(string slot, InventoryItem item)
        {
            QuickLogger.Debug($"ModuleContainerOnAddItem Item Name {item.item.name}");

            if (item.item.GetTechType() == TechTypeHelper.BatteryAttachmentTechType())
            {
                _mono.AddAttachment(DeepDrillModules.Battery);
                _powerModuleAttached = true;
            }
            else if (item.item.GetTechType() == TechTypeHelper.SolarAttachmentTechType())
            {
                _mono.AddAttachment(DeepDrillModules.Solar);
                _powerModuleAttached = true;
            }
            else if (item.item.GetTechType() == TechTypeHelper.FocusAttachmentTechType())
            {
                _mono.AddAttachment(DeepDrillModules.Focus);
            }
            else if (item.item.GetTechType() == TechTypeHelper.DrillerMK1TechType())
            {
                _mono.OreGenerator.SetOresPerDay(QPatch.Configuration.Mk1OrePerDay);
                _upgradeAttached = true;
            }
            else if (item.item.GetTechType() == TechTypeHelper.DrillerMK2TechType())
            {
                _mono.OreGenerator.SetOresPerDay(QPatch.Configuration.Mk2OrePerDay);
                _upgradeAttached = true;
            }
            else if (item.item.GetTechType() == TechTypeHelper.DrillerMK3TechType())
            {
                _mono.OreGenerator.SetOresPerDay(QPatch.Configuration.Mk3OrePerDay);
                _upgradeAttached = true;
            }
        }
예제 #2
0
        private bool IsAllowedToAdd(Pickupable pickupable, bool verbose)
        {
            if (pickupable.gameObject.GetComponent <FCSTechFabricatorTag>() != null)
            {
                if (pickupable.GetTechType() == TechTypeHelper.BatteryAttachmentTechType() || pickupable.GetTechType() == TechTypeHelper.SolarAttachmentTechType())
                {
                    if (_powerModuleAttached)
                    {
                        QuickLogger.Message(FCSDeepDrillerBuildable.OnePowerAttachmentAllowed(), true);
                        return(false);
                    }
                }
                else if (pickupable.GetTechType() == TechTypeHelper.DrillerMK1TechType() ||
                         pickupable.GetTechType() == TechTypeHelper.DrillerMK2TechType() ||
                         pickupable.GetTechType() == TechTypeHelper.DrillerMK3TechType())
                {
                    if (_upgradeAttached)
                    {
                        QuickLogger.Message(FCSDeepDrillerBuildable.OneUpgradeAllowed(), true);
                        return(false);
                    }
                }

                return(true);
            }

            QuickLogger.Message(FCSDeepDrillerBuildable.DDAttachmentsOnly(), true);
            return(false);
        }
예제 #3
0
        private void OnEquipmentRemoved(string slot, InventoryItem item)
        {
            if (item.item.GetTechType() == TechTypeHelper.BatteryAttachmentTechType())
            {
                _powerModuleAttached = false;
            }
            else if (item.item.GetTechType() == TechTypeHelper.SolarAttachmentTechType())
            {
                _powerModuleAttached = false;
            }
            else if (item.item.GetTechType() == TechTypeHelper.DrillerMK1TechType() ||
                     item.item.GetTechType() == TechTypeHelper.DrillerMK2TechType() ||
                     item.item.GetTechType() == TechTypeHelper.DrillerMK3TechType())
            {
                _mono.OreGenerator.SetOresPerDay(QPatch.Configuration.DrillOrePerDay);
                _upgradeAttached = false;
            }

            _mono.RemoveAttachment(TechTypeHelper.GetDeepModule(item.item.GetTechType()));
        }