Example #1
0
        private void FireTrig(int trig, Vector2 loc, ParticleManager pMan)
        {
            switch (trig)
            {
                case TrigPistolAcross:
                    pMan.MakeBullet(loc, new Vector2(2000, 0), Face, Id);
                    Sound.PlayCue("revol");
                    break;
                case TrigPistolDown:
                    pMan.MakeBullet(loc, new Vector2(1400, 1400), Face, Id);
                    Sound.PlayCue("revol");
                    break;
                case TrigPistolUp:
                    pMan.MakeBullet(loc, new Vector2(1400, -1400), Face, Id);
                    Sound.PlayCue("revol");
                    break;
                case TrigBloodSquirtBack:
                case TrigBloodSquirtDown:
                case TrigBloodSquirtDownBack:
                case TrigBloodSquirtDownForward:
                case TrigBloodSquirtForward:
                case TrigBloodSquirtUp:
                case TrigBloodSquirtUpBack:
                case TrigBloodSquirtUpForward:
                    var r = 0.0;
                    switch (trig)
                    {
                        case TrigBloodSquirtForward:
                            r = 0.0;
                            break;
                        case TrigBloodSquirtDownForward:
                            r = Math.PI * .25;
                            break;
                        case TrigBloodSquirtDown:
                            r = Math.PI * .5;
                            break;
                        case TrigBloodSquirtDownBack:
                            r = Math.PI * .75;
                            break;
                        case TrigBloodSquirtBack:
                            r = Math.PI;
                            break;
                        case TrigBloodSquirtUpBack:
                            r = Math.PI * 1.25;
                            break;
                        case TrigBloodSquirtUp:
                            r = Math.PI * 1.5;
                            break;
                        case TrigBloodSquirtUpForward:
                            r = Math.PI * 1.75;
                            break;
                    }

                    for (var i = 0; i < 7; i++)
                    {
                        pMan.AddParticle(new Blood(loc,
                            new Vector2((float)Math.Cos(r) * (Face == CharDir.Right ? 1f : -1f), (float)Math.Sin(r)) *
                            Rand.GetRandomFloat(10f, 500f) + Rand.GetRandomVector2(-90f, 90f, -90f, 90f), 1f, 0f, 0f, 1f,
                            Rand.GetRandomFloat(0.1f, 0.5f), Rand.GetRandomInt(0, 4)));
                    }
                    pMan.AddParticle(new BloodDust(loc, Rand.GetRandomVector2(-30f, 30f, -30f, 30f), 1f, 0f, 0f, .2f,
                        Rand.GetRandomFloat(.25f, .5f), Rand.GetRandomInt(0, 4)));
                    break;
                case TrigBloodCloud:
                    pMan.AddParticle(new BloodDust(loc, Rand.GetRandomVector2(-30f, 30f, -30f, 30f), 1f, 0f, 0f, .4f,
                        Rand.GetRandomFloat(.25f, .75f), Rand.GetRandomInt(0, 4)));
                    break;
                case TrigBloodSplat:
                    for (var i = 0; i < 6; i++)
                    {
                        pMan.AddParticle(new BloodDust(loc, Rand.GetRandomVector2(-30f, 30f, -30f, 30f), 1f, 0f, 0f, .4f,
                            Rand.GetRandomFloat(.025f, .125f), Rand.GetRandomInt(0, 4)));
                    }
                    break;

                default:
                    pMan.AddParticle(new Hit(loc, new Vector2(200f * (float)Face - 100f, 0f), Id, trig));
                    break;
            }

            switch (trig)
            {
                case TrigPistolAcross:
                case TrigPistolUp:
                case TrigPistolDown:
                    if (Team == TeamGoodGuys && Id < 4)
                    {
                        QuakeManager.SetRumble(Id, 1, .5f);
                        QuakeManager.SetRumble(Id, 0, .3f);
                    }
                    break;
            }
        }
Example #2
0
 private void FireTrig(int trig, Vector2 loc, ParticleManager pMan)
 {
     switch (trig)
     {
         case TRIG_PISTOL_ACROSS:
         case TRIG_PISTOL_UP:
         case TRIG_PISTOL_DOWN:
             if (Team == TEAM_GOOD_GUYS && ID < 4)
             {
                 QuakeManager.SetRumble(ID, 1, .5f);
                 QuakeManager.SetRumble(ID, 0, .3f);
             }
             break;
     }
     switch (trig)
     {
         case TRIG_FIRE_DIE:
             for (int i = 0; i < 5; i++)
             {
                 pMan.AddParticle(new Fire(loc +
                     Rand.GetRandomVector2(-30f, 30f, -30f, 30f),
                     Rand.GetRandomVector2(-5f, 60f, -150f, -20f),
                     Rand.GetRandomFloat(.3f, .8f), Rand.GetRandomInt(0, 4),
                     Rand.GetRandomFloat(.5f, .8f)));
             }
             pMan.AddParticle(new Smoke(loc,
                 Rand.GetRandomVector2(-10f, 10f, -60f, 10f),
                 1f, .8f, .6f, 1f, Rand.GetRandomFloat(.5f, 1.2f),
                 Rand.GetRandomInt(0, 4)));
             pMan.AddParticle(new Heat(loc,
                 Rand.GetRandomVector2(-50f, 50f, -100f, 0f),
                 Rand.GetRandomFloat(1f, 2f)));
             break;
         case TRIG_ROCKET:
             pMan.AddParticle(new Rocket(loc, new Vector2((Face == CharDir.Right ? 350f : -350f),
                 100f), ID));
             break;
         case TRIG_PISTOL_ACROSS:
             pMan.MakeBullet(loc, new Vector2(2000f, 0f), Face, ID);
             Sound.PlayCue("revol");
             //QuakeManager.SetQuake(0.3f);
             break;
         case TRIG_PISTOL_DOWN:
             pMan.MakeBullet(loc, new Vector2(1400f, 1400f), Face, ID);
             Sound.PlayCue("revol");
             //QuakeManager.SetQuake(0.3f);
             break;
         case TRIG_PISTOL_UP:
             pMan.MakeBullet(loc, new Vector2(1400f, -1400f), Face, ID);
             Sound.PlayCue("revol");
             //QuakeManager.SetQuake(0.3f);
             break;
         case TRIG_BLOOD_SQUIRT_BACK:
         case TRIG_BLOOD_SQUIRT_DOWN:
         case TRIG_BLOOD_SQUIRT_DOWN_BACK:
         case TRIG_BLOOD_SQUIRT_DOWN_FORNWARD:
         case TRIG_BLOOD_SQUIRT_FORWARD:
         case TRIG_BLOOD_SQUIRT_UP:
         case TRIG_BLOOD_SQUIRT_UP_BACK:
         case TRIG_BLOOD_SQUIRT_UP_FORWARD:
             double r = 0.0;
             switch (trig)
             {
                 case TRIG_BLOOD_SQUIRT_FORWARD:
                     r = 0.0;
                     break;
                 case TRIG_BLOOD_SQUIRT_DOWN_FORNWARD:
                     r = Math.PI * .25;
                     break;
                 case TRIG_BLOOD_SQUIRT_DOWN:
                     r = Math.PI * .5;
                     break;
                 case TRIG_BLOOD_SQUIRT_DOWN_BACK:
                     r = Math.PI * .75;
                     break;
                 case TRIG_BLOOD_SQUIRT_BACK:
                     r = Math.PI;
                     break;
                 case TRIG_BLOOD_SQUIRT_UP_BACK:
                     r = Math.PI * 1.25;
                     break;
                 case TRIG_BLOOD_SQUIRT_UP:
                     r = Math.PI * 1.5;
                     break;
                 case TRIG_BLOOD_SQUIRT_UP_FORWARD:
                     r = Math.PI * 1.75;
                     break;
             }
             for (int i = 0; i < 7; i++)
             {
                 pMan.AddParticle(new Blood(loc, new Vector2(
                     (float)Math.Cos(r) * (Face == CharDir.Right ? 1f : -1f),
                     (float)Math.Sin(r)
                     ) * Rand.GetRandomFloat(10f, 500f) +
                     Rand.GetRandomVector2(-90f, 90f, -90f, 90f),
                     1f, 0f, 0f, 1f, Rand.GetRandomFloat(0.1f, 0.5f),
                     Rand.GetRandomInt(0, 4)));
             }
             pMan.AddParticle(new BloodDust(loc,
                 Rand.GetRandomVector2(-30f, 30f, -30f, 30f),
                 1f, 0f, 0f, .2f,
                 Rand.GetRandomFloat(.25f, .5f),
                 Rand.GetRandomInt(0, 4)));
             break;
         case TRIG_BLOOD_CLOUD:
             pMan.AddParticle(new BloodDust(loc,
                 Rand.GetRandomVector2(-30f, 30f, -30f, 30f),
                 1f, 0f, 0f, .4f,
                 Rand.GetRandomFloat(.25f, .75f),
                 Rand.GetRandomInt(0, 4)));
             break;
         case TRIG_BLOOD_SPLAT:
             for (int i = 0; i < 6; i++)
             {
                 pMan.AddParticle(new BloodDust(loc,
                 Rand.GetRandomVector2(-30f, 30f, -30f, 30f),
                 1f, 0f, 0f, .4f,
                 Rand.GetRandomFloat(.025f, .125f),
                 Rand.GetRandomInt(0, 4)));
             }
             break;
         default:
             pMan.AddParticle(new Hit(loc, new Vector2(
                 200f * (float)Face - 100f, 0f),
                 ID, trig));
             break;
     }
 }