예제 #1
0
        /* readonly Dictionary<MaterialGroup, List<string>> materialDebrisMap = new Dictionary<MaterialGroup, List<string>>
         * {
         *   { MaterialGroup.countryside, // countryside debris objects
         *       new List<string> {
         *           "prop_bush_med_02",
         *           "prop_bush_med_05",
         *           "prop_fncwood_16d",
         *           "prop_fncwood_16e",
         *           "prop_fnclog_02b",
         *           "prop_railsleepers01", }
         *   },
         *
         *    { MaterialGroup.desert, // desert debris objects
         *       new List<string> {
         *           "prop_joshua_tree_01d",
         *           "prop_bush_med_02",
         *                                    }
         *   },
         *
         *    { MaterialGroup.urban, // debris objects found in urban areas (downtown etc.)
         *       new List<string> {
         *           "prop_wallbrick_01",
         *           "prop_fncwood_16d",
         *           "prop_fncwood_16e",
         *           "prop_railsleepers01",
         *           "ng_proc_food_burg02a",
         *           "ng_proc_sodacub_03a",
         *           "prop_fire_hydrant_1",
         *           "prop_fnclink_03c",
         *           "prop_dumpster_02a",
         *           "prop_dumpster_01a",
         *           "ng_proc_block_02a",
         *           "ng_proc_brick_01a",
         *           "prop_bin_01a",
         *           "prop_postbox_01a",
         *           "prop_cablespool_02",
         *           "prop_barrier_work06a",
         *           "prop_roadcone02a",
         *           "prop_sign_road_03g",
         *           "prop_lawnmower_01",
         *           "prop_table_04",
         *           "prop_chair_01a",
         *           "prop_chair_01b",
         *           "prop_table_03_chr",
         *           "prop_rub_binbag_04",
         *           "prop_rub_binbag_05",
         *           "prop_sacktruck_02a" }
         *   }
         * };*/

        public TDebris(TornadoVortex vortex, Vector3 position, float radius)
            : base(Setup(position))
        {
            Parent     = vortex;
            _radius    = radius;
            _spawnTime = Game.GameTime;
            PostSetup();
        }
예제 #2
0
 /// <summary>
 /// Instantiate the class.
 /// </summary>
 /// <param name="vortex"></param>
 /// <param name="fxAsset"></param>
 /// <param name="fxName"></param>
 /// <param name="position"></param>
 /// <param name="angle"></param>
 /// <param name="radius"></param>
 /// <param name="layerIdx"></param>
 public TornadoParticle(TornadoVortex vortex, Vector3 position, Vector3 angle, string fxAsset, string fxName, float radius, int layerIdx)
     : base(Setup(position))
 {
     Parent     = vortex;
     _centerPos = position;
     _rotation  = MathEx.Euler(angle);
     _ptfx      = new LoopedParticle(fxAsset, fxName);
     _radius    = radius;
     _offset    = new Vector3(0, 0, ScriptThread.GetVar <float>("vortexLayerSeperationScale") * layerIdx);
     LayerIndex = layerIdx;
     PostSetup();
 }
예제 #3
0
        /// <summary>
        /// Create a vortex at the given position.
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public TornadoVortex CreateVortex(Vector3 position)
        {
            if (spawnInProgress) // tornado already spawning in
            {
                return(null);
            }

            for (var i = _activeVortexList.Length - 1; i > 0; i--)
            {
                _activeVortexList[i] = _activeVortexList[i - 1];
            }

            position.Z = World.GetGroundHeight(position) - 10.0f;

            var tVortex = new TornadoVortex(position, false);

            tVortex.Build();

            _activeVortexList[0] = tVortex;

            ActiveVortexCount = Math.Min(ActiveVortexCount + 1, _activeVortexList.Length);

            if (soundEnabled)
            {
                if (_tornadoLowRumble != null)
                {
                    _tornadoLowRumble.SetVolume(0.0f);

                    var volumeLevel = 1.0f - (1.0f / 300.0f * Vector3.Distance2D(position, GameplayCamera.Position));

                    volumeLevel = volumeLevel <0.0f ? 0.0f : volumeLevel> 1.0f ? 1.0f : volumeLevel;

                    _tornadoLowRumble.DoFadeIn(5000, volumeLevel);
                }
            }

            if (ScriptThread.GetVar <bool>("notifications"))
            {
                UI.Notify("Tornado spawned nearby.");
            }

            spawnInProgress = true;

            return(null);
        }
예제 #4
0
        /// <summary>
        /// Create a vortex at the given position.
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public TornadoVortex CreateVortex(Vector3 position)
        {
            for (int i = _activeVortexList.Length - 1; i > 0; i--)
            {
                _activeVortexList[i] = _activeVortexList[i - 1];
            }

            position.Z = World.GetGroundHeight(position) - 10.0f;

            var tVortex = new TornadoVortex(position);

            tVortex.Build();

            _activeVortexList[0] = tVortex;

            ActiveVortexCount = Math.Min(ActiveVortexCount + 1, _activeVortexList.Length);

            if (ScriptThread.GetVar <bool>("notifications"))
            {
                UI.Notify("Tornado spawned nearby.");
            }

            return(tVortex);
        }