Shooter.Controls.Weapon.Shoot C# (CSharp) Method

Shoot() public method

public Shoot ( Microsoft.Xna.Framework.Content.ContentManager content, Character p, Camera c, int tileSize, Character e ) : Projectile
content Microsoft.Xna.Framework.Content.ContentManager
p Shooter.Entities.Character
c Camera
tileSize int
e Shooter.Entities.Character
return Shooter.Entities.Projectile
        public virtual Projectile Shoot(ContentManager content, Character p, Camera c, int tileSize, Character e) {
            timeSinceLastShot = 0;
            if (CheckAmmo()) {
                Projectile proj = null;
                if (name.Equals("Rifle")) {
                    proj = new Projectile(content, p.Loc.X, p.Loc.Y, p.Direction + GetSpread() * (Math.PI / 180.0), 3, "BulletTwo", true,
                                                   new Rectangle((int)((c.camPos.X + p.Loc.X) * tileSize), (int)((c.camPos.Y + p.Loc.Y) * tileSize), tileSize, tileSize), range, true, e.IsPlayer);
                } else if (name.Equals("Pistol")) {
                    proj = new Projectile(content, p.Loc.X, p.Loc.Y, p.Direction + GetSpread() * (Math.PI / 180.0), 3, "Bullet", true,
                                                   new Rectangle((int)((c.camPos.X + p.Loc.X) * tileSize), (int)((c.camPos.Y + p.Loc.Y) * tileSize), tileSize, tileSize), range, false, e.IsPlayer);
                } else {
                    proj = new Projectile(content, p.Loc.X, p.Loc.Y, p.Direction + GetSpread() * (Math.PI / 180.0), 3, "BulletTwo", true,
                                                    new Rectangle((int)((c.camPos.X + p.Loc.X) * tileSize), (int)((c.camPos.Y + p.Loc.Y) * tileSize), tileSize, tileSize), range, false, e.IsPlayer);
                }
                ammo[0]--;
                return proj;
            } else {
                return null;
            }
        }
        //Reloads gun