Пример #1
0
        private void SetupWheelPTFXs(string particleAssetName, string particleName, Vector3 wheelOffset, Vector3 wheelRot, float size = 3f, bool doLoopHandling = false)
        {
            foreach (var wheelName in Utils.WheelNames)
            {
                var worldPos = TimeCircuits.Vehicle.Bones[wheelName].Position;
                var offset   = TimeCircuits.Vehicle.GetPositionOffset(worldPos);

                offset += wheelOffset;

                var ptfx = new PtfxEntityPlayer(particleAssetName, particleName, TimeCircuits.Vehicle, offset, wheelRot, size, true, doLoopHandling);

                _wheelPtfxes.Add(ptfx);
            }
        }
Пример #2
0
        public WormholeAnimationPlayer(TimeCircuits circuits, int maxTime = 4350)
        {
            _wheelPtfxes = new List <PtfxEntityPlayer>();

            TimeCircuits = circuits;
            MaxTime      = maxTime;

            string wormholeScaleformName    = "bttf_wormhole_scaleform"; // default
            string wormholeRenderTargetName = "bttf_wormhole";           // default

            switch (circuits.DeloreanType)
            {
            case DeloreanType.BTTF1:

                SetupWheelPTFXs("veh_xs_vehicle_mods", "veh_nitrous", new Vector3(0, -0.25f, -0.15f), new Vector3(0, 0, 0), 1.3f);

                _wormholeModel           = ModelHandler.WormholeViolet;
                _wormholeNightModel      = ModelHandler.WormholeVioletNight;
                _sparkModel              = ModelHandler.SparkModel;
                _sparkNightModel         = ModelHandler.SparkNightModel;
                wormholeScaleformName    = "bttf_wormhole_scaleform";
                wormholeRenderTargetName = "bttf_wormhole";
                break;

            case DeloreanType.BTTF2:

                _wormholeModel           = ModelHandler.WormholeBlue;
                _wormholeNightModel      = ModelHandler.WormholeBlueNight;
                _sparkModel              = ModelHandler.SparkModel;
                _sparkNightModel         = ModelHandler.SparkNightModel;
                wormholeScaleformName    = "bttf_wormhole_scaleform_blue";
                wormholeRenderTargetName = "bttf_wormhole_blue";
                break;

            case DeloreanType.BTTF3:

                SetupWheelPTFXs("veh_xs_vehicle_mods", "veh_nitrous", new Vector3(0, -0.25f, -0.15f), new Vector3(0, 0, 0), 1.3f);
                SetupWheelPTFXs("des_bigjobdrill", "ent_ray_big_drill_start_sparks", new Vector3(0, 0, 0.18f), new Vector3(90f, 0, 0), 1f, true);

                _sparkProp = new AnimateProp(TimeCircuits.Vehicle, ModelHandler.InvisibleProp, new Vector3(0, 3.4f, -0.6f), new Vector3(0, 0, 180));
                _sparkProp.SpawnProp();

                _sparkPTFX = new PtfxEntityPlayer("scr_paletoscore", "scr_paleto_box_sparks", _sparkProp.Prop, Vector3.Zero, Vector3.Zero, 1.5f, true, true, 300);

                //_sparkPTFX = new PtfxEntityPlayer("scr_paletoscore", "scr_paleto_box_sparks", TimeCircuits.Vehicle, new Vector3(0, 3.4f, -0.6f), new Vector3(0, 0, 180), 1.5f, true, true, 300);
                //_sparkPTFX = new PtfxEntityBonePlayer("scr_reconstructionaccident", "scr_sparking_generator", TimeCircuits.Vehicle, "bonnet", new Vector3(0,-0.2f,0.2f), Vector3.Zero, 4f, true);

                //_sparkPTFX = new List<PtfxEntityBonePlayer>();

                //_sparkPTFX.Add(new PtfxEntityBonePlayer("core", "ent_amb_sparking_wires", TimeCircuits.Vehicle, "bonnet", new Vector3(-0.2f, -0.2f, 0.2f), new Vector3(0, -90, 0), 2f, true));
                //_sparkPTFX.Add(new PtfxEntityBonePlayer("core", "ent_amb_sparking_wires", TimeCircuits.Vehicle, "bonnet", new Vector3(0, -0.2f, 0.2f), new Vector3(0, 0, 0), 2f, true));
                //_sparkPTFX.Add(new PtfxEntityBonePlayer("core", "ent_amb_sparking_wires", TimeCircuits.Vehicle, "bonnet", new Vector3(0.2f, -0.2f, 0.2f), new Vector3(0, 90, 0), 2f, true));

                _wormholeModel           = ModelHandler.WormholeRed;
                _wormholeNightModel      = ModelHandler.WormholeRedNight;
                _sparkModel              = ModelHandler.SparkRedModel;
                _sparkNightModel         = ModelHandler.SparkRedNightModel;
                wormholeScaleformName    = "bttf_wormhole_scaleform_red";
                wormholeRenderTargetName = "bttf_wormhole_red";
                break;
            }

            _wormholeRT                        = new RenderTarget(_wormholeModel, wormholeRenderTargetName, TimeCircuits.Vehicle, "bttf_wormhole");
            _wormholeScaleform                 = new ScaleformGui(wormholeScaleformName);
            _wormholeRT.OnRenderTargetDraw    += OnRenderTargetDraw;
            _wormholeScaleform.DrawInPauseMenu = true;

            _coilsProp = new AnimateProp(TimeCircuits.Vehicle, ModelHandler.CoilsGlowing, Vector3.Zero, Vector3.Zero);

            _sparks = new List <SparkPlayer>();
            foreach (List <Vector3> sparks in Constants.SparkOffsets)
            {
                _sparks.Add(new SparkPlayer(TimeCircuits.Vehicle, sparks, _sparkModel));
            }
        }