コード例 #1
0
 public PlayerFootStepR( SfxSystem sfxSystem, FXEvent fxEvent )
     : base(sfxSystem, fxEvent)
 {
     ShakeCamera(0,0,15);
     var name = "foot" + rand.Next(0,6);
     AddSoundStage( @"sound\character\" + name,	fxEvent.Origin, 4, false );
 }
コード例 #2
0
        public PlayerLanding( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            float fallSpeed = Math.Abs(fxEvent.Velocity.Y);
            ShakeCamera(0, -30 * fallSpeed, rand.GaussDistribution(0, 10*fallSpeed));

            AddSoundStage( @"sound\character\fall0", fxEvent.Origin, 4, false );
        }
コード例 #3
0
ファイル: Mist.cs プロジェクト: demiurghg/ShooterDemo
        public Mist( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            sparkDir = Matrix.RotationQuaternion(fxEvent.Rotation).Forward;

            AddParticleStage("railDot", 0, 0f, 0.1f,   100, true, EmitSpark );
            AddParticleStage("smoke"  , 0, 0f, 0.1f,   200, true, EmitPuff );

            AddLightStage( fxEvent.Origin + sparkDir * 0.1f	, GetRailColor(0.03f), 10.0f, 100f, 3f );
        }
コード例 #4
0
ファイル: RocketTrail.cs プロジェクト: demiurghg/ShooterDemo
        public RocketTrail( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            //AddParticleStage("bulletSpark",		0.00f, 0.1f, 0.0f,  150, true, EmitSpark );
            AddParticleStage("explosionFire",	0.00f, 0.2f, 0.0f,   90, true, EmitFire );
            AddParticleStage("smoke",	0.00f, 0.2f, 0.0f,   60, true, EmitSmoke );

            AddLightStage( fxEvent.Origin * 0.1f	, new Color4(100, 75, 50,1), 1, 100f, 3f );

            AddSoundStage( @"sound\weapon\rfly",	fxEvent.Origin, 1, true );
        }
コード例 #5
0
ファイル: PlasmaTrail.cs プロジェクト: demiurghg/ShooterDemo
        public PlasmaTrail( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            //AddParticleStage("bulletSpark",		0.00f, 0.1f, 0.0f,  150, true, EmitSpark );
            AddParticleStage("plasmaCore",	0.00f, 0.2f, 0.0f,   30, true, EmitFire );
            //AddParticleStage("smoke",	0.00f, 0.2f, 0.0f,   60, true, EmitSmoke );

            AddLightStage( fxEvent.Origin * 0.1f	, new Color4(195, 195, 250,1), 2, 100f, 3f );

            AddSoundStage( @"sound\weapon\rfly",	fxEvent.Origin, 1, true );
        }
コード例 #6
0
ファイル: BulletTrail.cs プロジェクト: demiurghg/ShooterDemo
        public ShotTrail( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            sparkDir = Matrix.RotationQuaternion(fxEvent.Rotation).Forward + rand.GaussRadialDistribution(0, 0.1f);
            sparkDir.Normalize();

            AddParticleStage("bulletSpark", 0, 0f, 0.1f, 10, false, EmitSpark );

            AddLightStage( fxEvent.Origin + sparkDir * 0.1f	, new Color4(125,110, 35,1), 0.5f, 100f, 3f );

            //AddSoundStage( @"sound\weapon\bulletHit",	fxEvent.Origin, 1, false );
        }
コード例 #7
0
ファイル: RailFX.cs プロジェクト: demiurghg/ShooterDemo
        public RailHit( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            sparkDir = Matrix.RotationQuaternion(fxEvent.Rotation).Forward;

            AddParticleStage("railDot", 0, 0f, 0.1f, 100, false, EmitSpark );
            //AddParticleStage("railDot", 0, 0f, 0.1f,  30, false, EmitPuff );

            AddLightStage( fxEvent.Origin + sparkDir * 0.1f	, GetRailColor(0.03f), 1.0f, 100f, 3f );

            AddSoundStage( @"sound\weapon\railshot",	fxEvent.Origin, 1, false );
        }
コード例 #8
0
        public PlasmaExplosion( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            sparkDir = Matrix.RotationQuaternion(fxEvent.Rotation).Forward;

            AddParticleStage("plasmaCore",		0.00f, 0.0f, 0.1f,  50, false, EmitSpark );
            AddParticleStage("plasmaCore",		0.00f, 0.1f, 1.0f,   5, false, EmitBall );
            //AddParticleStage("plasmaPuff",	0.10f, 0.1f, 1.0f,   15, false, EmitSmoke );
            AddParticleStage("plasmaFire",	0.05f, 0.1f, 1.0f,   15, false, EmitFire );

            AddLightStage( fxEvent.Origin - sparkDir * 0.1f	, new Color4(195, 195, 250,1), 2, 100f, 3f );

            AddSoundStage( @"sound\weapon\plasmaHit",	fxEvent.Origin, 1, false );
        }
コード例 #9
0
ファイル: Explosion.cs プロジェクト: demiurghg/ShooterDemo
        public Explosion( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            sparkDir = Matrix.RotationQuaternion(fxEvent.Rotation).Forward;

            AddParticleStage("bulletSpark",		0.00f, 0.0f, 0.1f,  150, false, EmitSpark );
            AddParticleStage("explosionSmoke",	0.10f, 0.1f, 1.0f,  15*3, false, EmitSmoke );
            AddParticleStage("explosionSmoke2",	0.10f, 0.1f, 1.0f,  15*3, false, EmitSmoke );
            AddParticleStage("explosionFire",	0.00f, 0.1f, 1.0f,  30*2, false, EmitFire );

            AddLightStage( fxEvent.Origin + sparkDir * 0.1f	, new Color4(200,150,100,1), 3, 100f, 3f );

            AddSoundStage( @"sound\weapon\explosion",	fxEvent.Origin, 1, false );
        }
コード例 #10
0
ファイル: PlayerPain.cs プロジェクト: demiurghg/ShooterDemo
        public GenericPain( SfxSystem sfxSystem, FXEvent fxEvent, string sound, float shake, int bloodAmount, int gibAmount=0 )
            : base(sfxSystem, fxEvent)
        {
            ShakeCamera( rand.GaussDistribution(0,shake), rand.GaussDistribution(0,shake), rand.GaussDistribution(0,shake) );

            AddParticleStage("bloodSpray04", 0, 0f, 0.1f, bloodAmount, false, EmitBlood );
            AddParticleStage("bloodSpray04", 0, 0f, 0.1f, gibAmount,   false, EmitGib );

            if (sfxSystem.world.IsPlayer(fxEvent.ParentID)) {
                AddSoundStage( sound,	false );
            } else {
                AddSoundStage( sound, fxEvent.Origin, 1, false );
            }
        }
コード例 #11
0
ファイル: TeleportFX.cs プロジェクト: demiurghg/ShooterDemo
        public TeleportOut( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            sparkDir = Matrix.RotationQuaternion(fxEvent.Rotation).Forward;

            AddParticleStage("teleportSpark", 0, 0f, 0.1f, 150, false, EmitSpark );

            AddLightStage( fxEvent.Origin + sparkDir * 0.1f	, GetRailColor(0.03f), 1.0f, 100f, 3f );

            if (sfxSystem.world.IsPlayer(fxEvent.ParentID)) {
                AddSoundStage( @"sound\misc\teleport",	false );
            } else {
                AddSoundStage( @"sound\misc\teleport", fxEvent.Origin, 1, false );
            }
        }
コード例 #12
0
ファイル: MZBlaster.cs プロジェクト: demiurghg/ShooterDemo
        public MZBlaster( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            ShakeCamera( rand.GaussDistribution(0,5), rand.GaussDistribution(5,5), rand.GaussDistribution(0,5) );

            sparkDir = Matrix.RotationQuaternion(fxEvent.Rotation).Forward;
            //AddParticleStage("bulletSpark", 0, 0f, 0.1f, 30, EmitSpark );

            AddLightStage( fxEvent.Origin + sparkDir * 0.1f	, new Color4(137,137,228,1), 1, 100f, 3f );

            if (sfxSystem.world.IsPlayer(fxEvent.ParentID)) {
                AddSoundStage( @"sound\weapon\plasma",	false );
            } else {
                AddSoundStage( @"sound\weapon\plasma", fxEvent.Origin, 1, false );
            }
        }
コード例 #13
0
ファイル: RailFX.cs プロジェクト: demiurghg/ShooterDemo
        public RailTrail( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            var p = new Particle();

            p.TimeLag		=	0;

            var m = Matrix.RotationQuaternion( fxEvent.Rotation );
            var up = m.Up;
            var rt = m.Right;

            int count = Math.Min((int)(fxEvent.Velocity.Length() * 20), 2000);

            //
            //	Overall color
            //

            //
            //	Beam :
            //
            p.ImageIndex	=	sfxSystem.GetSpriteIndex("railTrace");

            if (true) {
                var pos		=	fxEvent.Origin;
                var pos1	=	fxEvent.Origin + fxEvent.Velocity;

                SetupMotion	( ref p, pos, Vector3.Zero, Vector3.Zero, 0, 0 );
                SetupTiming	( ref p, 0.2f, 0.01f, 0.9f );
                SetupSize	( ref p, 0.1f, 0.0f );
                SetupAngles	( ref p, 160 );

                p.Color0		=	GetRailColor();
                p.Color1		=	GetRailColor();

                p.TailPosition	=	pos1;
                p.Effects	|=	ParticleFX.Beam;

                rw.ParticleSystem.InjectParticle( p );
            }

            //
            //	Spiral :
            //
            p.ImageIndex	=	sfxSystem.GetSpriteIndex("railDot");
            p.Effects		=	ParticleFX.None;

            for (int i=0; i<count; i++) {

                var t		=	i * 0.1f;
                var c		=	(float)Math.Cos(t);
                var s		=	(float)Math.Sin(t);

                #if true
                var pos		=	fxEvent.Origin + rt * c * 0.05f + up * s * 0.05f + fxEvent.Velocity * (i+0)/(float)count;
                var vel		=	rt * c * 0.15f + up * s * 0.15f + rand.GaussRadialDistribution(0,0.03f);
                #else
                var pos		=	fxEvent.Origin + rt * c * 0.01f + up * s * 0.01f + fxEvent.Velocity * (i+0)/(float)count;
                var vel		=	rt * c * 0.15f + up * s * 0.15f + rand.GaussRadialDistribution(0,0.02f);
                #endif

                var time	=	rand.GaussDistribution(1, 0.2f);

                SetupMotion	( ref p, pos, vel, Vector3.Zero, 0, 0 );
                SetupColor	( ref p, 1000, 1000, 1, 1 );
                SetupTiming	( ref p, time, 0.5f, 0.5f );
                SetupSize	( ref p, 0.03f, 0.0f );
                SetupAngles	( ref p, 160 );

                p.TimeLag		=	-0.1f;
                p.Color0		=	GetRailColor();
                p.Color1		=	GetRailColor();

                p.TailPosition	=	Vector3.Zero;

                //SfxInstance.rw.Debug.Trace( p.Position, 0.2f, Color.Yellow );
                rw.ParticleSystem.InjectParticle( p );
            }

            //
            //	Trace
            //
            p.ImageIndex	=	sfxSystem.GetSpriteIndex("railDot");
            p.Effects		=	ParticleFX.None;

            for (int i=0; i<count/3; i++) {

                var pos		=	fxEvent.Origin + fxEvent.Velocity * (i*3)/(float)count;
                var vel		=	rand.GaussRadialDistribution(0,0.1f);
                var time	=	rand.GaussDistribution(1, 0.2f);

                SetupMotion	( ref p, pos, vel, Vector3.Zero, 0, 0 );
                SetupColor	( ref p, 0, 200, 0, 1 );
                SetupTiming	( ref p, time, 0.5f, 0.5f );
                SetupSize	( ref p, 0.05f, 0.0f );
                SetupAngles	( ref p, 160 );

                p.TimeLag		=	-0.1f;
                p.Color0		=	GetRailColor();
                p.Color1		=	GetRailColor();

                p.TailPosition	=	Vector3.Zero;

                //SfxInstance.rw.Debug.Trace( p.Position, 0.2f, Color.Yellow );
                rw.ParticleSystem.InjectParticle( p );
            }
        }
コード例 #14
0
ファイル: RailFX.cs プロジェクト: demiurghg/ShooterDemo
        public RailMuzzle( SfxSystem sfxSystem, FXEvent fxEvent )
            : base(sfxSystem, fxEvent)
        {
            ShakeCamera( rand.GaussDistribution(0,20), rand.GaussDistribution(0,20), rand.GaussDistribution(0,20) );

            sparkDir = Matrix.RotationQuaternion(fxEvent.Rotation).Forward;
            //AddParticleStage("bulletSpark", 0, 0f, 0.1f, 30, EmitSpark );

            AddLightStage( fxEvent.Origin, GetRailColor(0.03f), 2.0f, 100f, 3f );

            if (sfxSystem.world.IsPlayer(fxEvent.ParentID)) {
                AddSoundStage( @"sound\weapon\railshot2",	false );
            } else {
                AddSoundStage( @"sound\weapon\railshot2", fxEvent.Origin, 1, false );
            }
        }
コード例 #15
0
ファイル: PlayerJump.cs プロジェクト: demiurghg/ShooterDemo
 public PlayerJump( SfxSystem sfxSystem, FXEvent fxEvent )
     : base(sfxSystem, fxEvent)
 {
     AddSoundStage( @"sound\character\jump",	fxEvent.Origin, 4, false );
 }
コード例 #16
0
ファイル: PlayerPain.cs プロジェクト: demiurghg/ShooterDemo
 public PlayerDeath( SfxSystem sfxSystem, FXEvent fxEvent )
     : base(sfxSystem, fxEvent, @"sound\character\death1", 0, 0, 150)
 {
 }
コード例 #17
0
ファイル: PlayerPain.cs プロジェクト: demiurghg/ShooterDemo
 public PlayerPain75( SfxSystem sfxSystem, FXEvent fxEvent )
     : base(sfxSystem, fxEvent, @"sound\character\pain75", 150, 50)
 {
 }