Beispiel #1
0
        public override void Spawn()
        {
            SetModel("models/tank_rocket.vmdl");
            timeSinceLaunched = 0;
            Transmit          = TransmitType.Always;
            Tags.Add("rocket");

            using (Prediction.Off()) {
                TrailEffect = Particles.Create("particles/rocket_trail.vpcf");
                TrailEffect.SetEntity(0, this, CollisionBounds.Mins.WithZ(0).WithY(0));
            }
            Light = new SpotLightEntity {
                Position       = Position + Rotation.Forward * (CollisionBounds.Mins.x - 1),
                Rotation       = Rotation.LookAt(Rotation.Backward),
                DynamicShadows = true,
                Color          = new(1, 0.5f, 0),
                Brightness     = 2,
                Parent         = this,
                Range          = 96,
                InnerConeAngle = 15,
                OuterConeAngle = 70
            };

            //timeAlive = Rand.Float();
        }
Beispiel #2
0
    public override void CreateViewModel()
    {
        base.CreateViewModel();

        viewLight = CreateLight();
        viewLight.SetParent(ViewModelEntity, "light", new Transform(LightOffset));
        viewLight.EnableViewmodelRendering = true;
        viewLight.Enabled = LightEnabled;
    }
Beispiel #3
0
    public override void Spawn()
    {
        base.Spawn();

        SetModel("weapons/rust_pistol/rust_pistol.vmdl");

        worldLight = CreateLight();
        worldLight.SetParent(this, "slide", new Transform(LightOffset));
        worldLight.EnableHideInFirstPerson = true;
        worldLight.Enabled = LightEnabled;
    }
Beispiel #4
0
    private SpotLightEntity CreateLight()
    {
        var light = new SpotLightEntity
        {
            Enabled              = true,
            DynamicShadows       = true,
            Range                = 512,
            Falloff              = 1.0f,
            LinearAttenuation    = 0.0f,
            QuadraticAttenuation = 1.0f,
            Brightness           = 2,
            Color                = Color.White,
            InnerConeAngle       = 20,
            OuterConeAngle       = 40,
            FogStength           = 1.0f,
            Owner                = Owner,
            LightCookie          = Texture.Load("materials/effects/lightcookie.vtex")
        };

        return(light);
    }
Beispiel #5
0
    private SpotLightEntity CreateLight()
    {
        var light = new SpotLightEntity
        {
            Enabled              = true,
            DynamicShadows       = true,
            Range                = 512,
            Falloff              = 1.0f,
            LinearAttenuation    = 0.0f,
            QuadraticAttenuation = 1.0f,
            Brightness           = 2,
            Color                = Color.White,
            InnerConeAngle       = 20,
            OuterConeAngle       = 40,
            FogStength           = 1.0f,
            Owner                = Owner,
        };

        light.UseFog();

        return(light);
    }
Beispiel #6
0
 public override void WriteToFile(MemoryStream stream, bool isBigEndian)
 {
     base.WriteToFile(stream, isBigEndian);
     SpotLightEntity.WriteToFile(stream, isBigEndian);
     SpotLightTargetEntity.WriteToFile(stream, isBigEndian);
 }
Beispiel #7
0
 public override void ReadFromFile(MemoryStream stream, bool isBigEndian)
 {
     base.ReadFromFile(stream, isBigEndian);
     SpotLightEntity.ReadFromFile(stream, isBigEndian);
     SpotLightTargetEntity.ReadFromFile(stream, isBigEndian);
 }