private bool IsAllowedToAdd(Pickupable pickupable, bool verbose)
        {
            bool flag = false;

            if (pickupable != null)
            {
                var filter = pickupable.gameObject.GetComponent <FCSTechFabricatorTag>();
                if (filter != null)
                {
                    if (pickupable.GetTechType() == TechTypeHelpers.AlienFecesTechType())
                    {
                        flag = true;
                    }
                    if (pickupable.GetTechType() == TechTypeHelpers.GasTankTechType())
                    {
                        flag = true;
                    }
                }
            }

            QuickLogger.Debug($"Adding Item {flag} || {verbose}");

            if (!flag && verbose)
            {
                ErrorMessage.AddMessage("Alterra Refrigeration Freon allowed only");
            }
            return(flag);
        }
Ejemplo n.º 2
0
        private void Initialize()
        {
            TechTypeHelpers.Initialize();
            ARSeaBreezeFCS32Awake_Patcher.AddEventHandlerIfMissing(AlertedNewSeaBreezePlaced);
            ARSeaBreezeFCS32Destroy_Patcher.AddEventHandlerIfMissing(AlertedSeaBreezeDestroyed);
            if (FoodManager == null)
            {
                FoodManager = gameObject.AddComponent <FoodManager>();
                FoodManager.Initialize(this);
            }

            if (StorageManager == null)
            {
                StorageManager = new SCStorageManager();
                StorageManager.Initialize(this);
            }

            if (GasManager == null)
            {
                GasManager = new GasManager();
                GasManager.Initialize(this);
            }

            if (PowerManager == null)
            {
                PowerManager = new PowerManager();
                PowerManager.Initialize(this);
                StartCoroutine(UpdatePowerState());
            }

            AnimationManager = gameObject.GetComponent <AnimationManager>();

            if (DisplayManager == null)
            {
                DisplayManager = gameObject.AddComponent <SCDisplayManager>();
            }

            if (ColorManager == null)
            {
                ColorManager = gameObject.AddComponent <ColorManager>();
                ColorManager.Initialize(gameObject, SeaCookerBuildable.BodyMaterial);
            }

            if (AudioManager == null)
            {
                AudioManager = new AudioManager(gameObject.GetComponent <FMOD_CustomLoopingEmitter>());
                //InvokeRepeating(nameof(UpdateAudio), 0, 1);
            }

            if (PlayerInteraction == null)
            {
                PlayerInteraction = gameObject.GetComponent <PlayerInteraction>();
            }

            PlayerInteraction.Initialize(this);

            //FindHabitat();

            IsInitialized = true;
        }
        private void OnEquipmentAdded(string slot, InventoryItem item)
        {
            if (item.item.GetTechType() == TechTypeHelpers.GasTankTechType())
            {
                AddFuel(FuelType.Gas);
                return;
            }

            if (item.item.GetTechType() == TechTypeHelpers.AlienFecesTechType())
            {
                AddFuel(FuelType.AlienFeces);
                return;
            }
        }
        protected override TechData GetBlueprintRecipe()
        {
            QuickLogger.Debug($"Creating recipe...");
            // Create and associate recipe to the new TechType
            var customFabRecipe = new TechData()
            {
                craftAmount = 1,
                Ingredients = new List <Ingredient>()
                {
                    new Ingredient(TechTypeHelpers.GetTechType("HabitatSystemPanelKit_HSP"), 1)
                }
            };

            return(customFabRecipe);
        }
        internal void SetEquipment(FuelType tank)
        {
            var techType = TechTypeHelpers.GetTechType(tank);

            if (techType == TechType.None)
            {
                return;
            }

            var getTank = CraftData.GetPrefabForTechType(techType);

#if SUBNAUTICA
            _equipment.AddItem(Configuration.Configuration.SlotIDs[0],
                               new InventoryItem(getTank.GetComponent <Pickupable>().Pickup(false)));
#elif BELOWZERO
            Pickupable pickupable = getTank.GetComponent <Pickupable>();
            pickupable.Pickup(false);
            _equipment.AddItem(Configuration.Configuration.SlotIDs[0],
                               new InventoryItem(pickupable));
#endif
        }