Example #1
0
        static void MakeItemClownPincherEdible(string path)
        {
            GameObject obj = Resources.Load <GameObject>(path);

            if (obj == null)
            {
                ECCLog.AddMessage("DE EXTINCTION: No prefab found at path " + path);
                return;
            }
            obj.AddComponent <EcoTarget>().type = clownPincherSpecialEdible;
        }
Example #2
0
        static void FixSpikeTrap()
        {
            GameObject obj = Resources.Load <GameObject>("WorldEntities/Doodads/Coral_reef_Light/coral_reef_spiky_trap");

            if (obj == null)
            {
                ECCLog.AddMessage("DE EXTINCTION: Spike trap found at path " + "WorldEntities/Doodads/Coral_reef_Light/coral_reef_spiky_trap");
                return;
            }
            obj.AddComponent <FreezeRigidbodyWhenFar>().freezeDist = 40f;
            obj.AddComponent <EcoTarget>().type = EcoTargetType.Trap;
            TechType spikeTrapTechType = TechTypeHandler.AddTechType("SpikyTrap", "Spikey trap", "A very spikey trap.");

            obj.AddComponent <TechTag>().type = spikeTrapTechType;
            PatchPlantPDAEntry(spikeTrapTechType, "SpikyTrap", "Spikey Trap", "A very large plant with obvious carnivorous adapations.\n\nBehavior:\nUnusually docile. The carnivorous parts may be vestigial, or this individual may have just eaten a large meal.");
        }
        private void GrabVehicle(Vehicle vehicle, VehicleType vehicleType)
        {
            vehicle.GetComponent <Rigidbody>().isKinematic = true;
            vehicle.collisionModel.SetActive(false);
            heldVehicle     = vehicle;
            heldVehicleType = vehicleType;
            if (heldVehicleType == VehicleType.Exosuit)
            {
                SafeAnimator.SetBool(vehicle.mainAnimator, "reaper_attack", true);
                Exosuit component = vehicle.GetComponent <Exosuit>();
                if (component != null)
                {
                    component.cinematicMode = true;
                }
            }
            timeVehicleGrabbed     = Time.time;
            vehicleInitialRotation = vehicle.transform.rotation;
            vehicleInitialPosition = vehicle.transform.position;
            if (heldVehicleType == VehicleType.GenericSub)
            {
                vehicleGrabSound.clip = seamothSounds.GetRandomClip();
            }
            else if (heldVehicleType == VehicleType.Exosuit)
            {
                vehicleGrabSound.clip = exosuitSounds.GetRandomClip();
            }
            else
            {
                ECCLog.AddMessage("Unknown Vehicle Type detected");
            }
            vehicleGrabSound.Play();
            InvokeRepeating("DamageVehicle", 1f, 1f);
            float attackLength = 6f + UnityEngine.Random.value;

            Invoke("ReleaseVehicle", attackLength);
            if (Player.main.GetVehicle() == heldVehicle)
            {
                MainCameraControl.main.ShakeCamera(4f, attackLength, MainCameraControl.ShakeMode.BuildUp, 1.2f);
            }
        }