コード例 #1
0
        public static void DrawFlameGunNormal(LineSegmentF rayBarrel, int GunOffset)
        {
            if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) < 25 + 45)
            {
                Effects.RotateNormalsEffect(rayBarrel.ToAngle(), new Vector2(1, 1));
                Game1.SpriteBatchGlobal.Draw(Game1.Textures["flameThrowerNormal"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0, 8f * 2));
            }
            else if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) > 155 - 45)
            {
                Effects.RotateNormalsEffect(rayBarrel.ToAngle(), new Vector2(1, -1));
                Game1.SpriteBatchGlobal.Draw(Game1.Textures["flameThrowerNormal"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0, 16f * 2), effects: SpriteEffects.FlipVertically);
            }
            else if (rayBarrel.ToAngle() * (180 / Math.PI) > 25 + 45 && rayBarrel.ToAngle() * (180 / Math.PI) < 155 - 45)
            {
                Effects.RotateNormalsEffect(rayBarrel.ToAngle(), new Vector2(1, 1));
                Game1.SpriteBatchGlobal.Draw(Game1.Textures["flameThrowerUpNormal"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0, 5.5f * 2));
            }
            else
            {
                Effects.RotateNormalsEffect(rayBarrel.ToAngle(), new Vector2(1, -1));
                Game1.SpriteBatchGlobal.Draw(Game1.Textures["flameThrowerDownNormal"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0, 5.5f * 2));
            }

            Effects.ResetEffect3D();
        }
コード例 #2
0
 public static void DrawLaserGun(LineSegmentF rayBarrel, int GunOffset)
 {
     if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) < 25 + 45)
     {
         Game1.SpriteBatchGlobal.Draw(Game1.laserGun, rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0, 8.5f * 2));
     }
     else if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) > 155 - 45)
     {
         Game1.SpriteBatchGlobal.Draw(Game1.laserGun, rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0, 7.5f * 2), effects: SpriteEffects.FlipVertically);
     }
     else if (rayBarrel.ToAngle() * (180 / Math.PI) > 25 + 45 && rayBarrel.ToAngle() * (180 / Math.PI) < 155 - 45)
     {
         Game1.SpriteBatchGlobal.Draw(Game1.laserGunDown, rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0, 5.5f * 2));
     }
     else
     {
         Game1.SpriteBatchGlobal.Draw(Game1.laserGunUp, rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0, 5.5f * 2));
     }
 }
コード例 #3
0
 public static void DrawEnergyGun(LineSegmentF rayBarrel, int GunOffset)
 {
     if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) < 25 + 45)
     {
         Game1.SpriteBatchGlobal.Draw(Game1.energyLauncher, rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(64 + GunOffset, 12));
     }
     else if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) > 155 - 45)
     {
         Game1.SpriteBatchGlobal.Draw(Game1.energyLauncher, rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(64 + GunOffset, 26), effects: SpriteEffects.FlipVertically);
     }
     else if (rayBarrel.ToAngle() * (180 / Math.PI) > 25 + 45 && rayBarrel.ToAngle() * (180 / Math.PI) < 155 - 45)
     {
         Game1.SpriteBatchGlobal.Draw(Game1.energyLauncherDown, rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(64 + GunOffset, 7.5f * 2));
     }
     else
     {
         Game1.SpriteBatchGlobal.Draw(Game1.energyLauncherUp, rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(64 + GunOffset, 7.5f * 2));
     }
 }
コード例 #4
0
 public static void DrawRocketGun(LineSegmentF rayBarrel, int GunOffset)
 {
     if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) < 25 + 45)
     {
         Game1.SpriteBatchGlobal.Draw(Game1.Textures["RocketLauncher"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(64 + GunOffset, 6f * 2));
     }
     else if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) > 155 - 45)
     {
         Game1.SpriteBatchGlobal.Draw(Game1.Textures["RocketLauncher"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(64 + GunOffset, 12f * 2), effects: SpriteEffects.FlipVertically);
     }
     else if (rayBarrel.ToAngle() * (180 / Math.PI) > 25 + 45 && rayBarrel.ToAngle() * (180 / Math.PI) < 155 - 45)
     {
         Game1.SpriteBatchGlobal.Draw(Game1.Textures["RocketLauncherUp"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(64 + GunOffset, 6.5f * 2));
     }
     else
     {
         Game1.SpriteBatchGlobal.Draw(Game1.Textures["RocketLauncherDown"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(64 + GunOffset, 6.5f * 2));
     }
 }
コード例 #5
0
        public bool Fire(LineSegmentF rayEnlonged, Vector2Object destination)
        {
            Vector2 barrel = rayEnlonged.Start + rayEnlonged.NormalizedWithZeroSolution() * GunBarrel;

            if (destination != null && destination != null)
            {
                if (Owner is Player)
                {
                    _line = new LineSegmentF(rayEnlonged.Start, destination.Vector2);
                }
                if (Owner is Inpc)
                {
                    _line = new LineSegmentF((Owner as Inpc).Boundary.Origin, destination.Vector2);
                }
            }

            _rotation = rayEnlonged.ToAngle();

            if ((Ammo > 0 && GunTimer.Ready == true) || MaxAmmo == 0)
            {
                Ammo--;
                SetOn();
                fireRay(barrel, destination);

                GunTimer.Reset();

                if (destination != null && destination != null)
                {
                    if (Owner is Player)
                    {
                    }
                    if (Owner is Inpc)
                    {
                        //Game1.PlayerIns.Push(LineSegmentF.SegmentToNormalizedVector((Owner as Enemy).Ray) * 0.02f);
                    }
                }

                return(true);
            }

            return(false);
        }
コード例 #6
0
 public static void DrawPlasmaGunNormal(LineSegmentF rayBarrel, int GunOffset)
 {
     if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) < 25 + 45)
     {
         Effects.RotateNormalsEffect(rayBarrel.ToAngle(), new Vector2(1, 1));
         Game1.SpriteBatchGlobal.Draw(Game1.Textures["PlasmaGunNormal"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0 + GunOffset, 7.0f * 2));
     }
     else if (Math.Abs(rayBarrel.ToAngle() * (180 / Math.PI)) > 155 - 45)
     {
         Effects.RotateNormalsEffect(rayBarrel.ToAngle(), new Vector2(1, -1));
         Game1.SpriteBatchGlobal.Draw(Game1.Textures["PlasmaGunNormal"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0 + GunOffset, 10.0f * 2), effects: SpriteEffects.FlipVertically);
     }
     else if (rayBarrel.ToAngle() * (180 / Math.PI) > 25 + 45 && rayBarrel.ToAngle() * (180 / Math.PI) < 155 - 45)
     {
         Effects.RotateNormalsEffect(rayBarrel.ToAngle(), new Vector2(1, 1));
         Game1.SpriteBatchGlobal.Draw(Game1.Textures["PlasmaGunDownNormal"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0 + GunOffset, 4f * 2));
     }
     else
     {
         Effects.RotateNormalsEffect(rayBarrel.ToAngle(), new Vector2(1, 1));
         Game1.SpriteBatchGlobal.Draw(Game1.Textures["PlasmaGunUpNormal"], rayBarrel.Start, rotation: rayBarrel.ToAngle(), origin: new Vector2(0 + GunOffset, 4f * 2));
     }
 }
コード例 #7
0
 public void DrawLight(LineSegmentF rayBarrel)
 {
     Effects.ColorEffect(new Vector4(1f, 1f, 1f, Light));
     Game1.SpriteBatchGlobal.Draw(Game1.muzzleSimpleLight, rayBarrel.End, origin: new Vector2(40, 80f), rotation: rayBarrel.ToAngle());
     Effects.ResetEffect3D();
 }
コード例 #8
0
        public void Draw(LineSegmentF rayBarrel)
        {
            SimpleGunDrawModule.DrawSimpleGun(rayBarrel, (int)Kick);

            Effects.ColorEffect(new Vector4(1f, 1f, 1f, Light));
            Game1.SpriteBatchGlobal.Draw(Game1.muzzleSimple, rayBarrel.End, origin: new Vector2(0, 19f), rotation: rayBarrel.ToAngle());
            Effects.ResetEffect3D();
        }
コード例 #9
0
 new public void DrawLight(LineSegmentF rayBarrel)
 {
     Effects.ColorEffect(new Vector4(1f, 1f, 1f, _muzzleAlpha));
     Game1.SpriteBatchGlobal.Draw(Game1.muzzlePlasmaLight, rayBarrel.End, scale: new Vector2(1), origin: new Vector2(40, 80f), rotation: rayBarrel.ToAngle());
     Game1.EffectBaseColor.CurrentTechnique.Passes[0].Apply();
 }
コード例 #10
0
        new public void Draw(LineSegmentF rayBarrel)
        {
            SimpleGunDrawModule.DrawPlasmaGun(rayBarrel, (int)OffsetKick);

            Effects.ColorEffect(new Vector4(1f, 1f, 1f, _muzzleAlpha));
            Game1.SpriteBatchGlobal.Draw(Game1.muzzlePlasma, rayBarrel.End, scale: new Vector2(1), origin: new Vector2(0, 19f), rotation: rayBarrel.ToAngle());
            Game1.EffectBaseColor.CurrentTechnique.Passes[0].Apply();
        }
コード例 #11
0
ファイル: RocketLauncher.cs プロジェクト: BlueBananasaurus/BP
 new public void DrawLight(LineSegmentF rayBarrel)
 {
     Effects.ColorEffect(new Vector4(1f, 1f, 1f, _muzzleAlpha));
     Game1.SpriteBatchGlobal.Draw(Game1.rocketLauncherFlame, rayBarrel.Start.ShiftOverDistance(-64 - OffsetKick, rayBarrel.ToAngle()), scale: new Vector2((2 - _muzzleAlpha * 2), 1), origin: new Vector2(0, 22), rotation: (float)(rayBarrel.ToAngle() - Math.PI));
     Game1.EffectBaseColor.CurrentTechnique.Passes[0].Apply();
 }