Beispiel #1
0
 public Weapon(IPoorWeaponHolder owner)
     : base("")
 {
     _owner = owner;
     _reloadTimer = new Stopwatch();
     _reloadTimer.Start();
 }
Beispiel #2
0
 public BombProjectile(Vector2 pos, Vector2 velocity, IPoorWeaponHolder origin)
     : base("bomb2", pos, velocity, origin)
 {
     Scale = new Vector2(0.13f, 0.13f);
     _invulnerableTime = 1.0f;
     _soundFX_id = SoundFxManager.AddInstance(SoundFxLibrary.GenerateInstance("bombwhistle"));
     SoundFxManager.GetByID(_soundFX_id).IsLooped = true;
     Damage = 10000;
 }
Beispiel #3
0
        public CannonProjectile(Vector2 pos, Vector2 velocity, float orientation, IPoorWeaponHolder origin)
            : base("bullet", pos, velocity, origin)
        {
            _orientation = orientation;
            float xFactor = (float)Math.Sin(CalcHelper.DegreeToRadian(_orientation));
            float yFactor = (float)-Math.Cos(CalcHelper.DegreeToRadian(_orientation));
            Vector2 boostFactor = new Vector2(xFactor*4, yFactor*4);

            _velocity = velocity + boostFactor;
            _invulnerableTime = 0.8f;
            Damage = 100;
        }
Beispiel #4
0
        public Projectile(string texture, Vector2 pos, Vector2 velocity, IPoorWeaponHolder origin)
            : base(texture)
        {
            Position = pos;
            _velocity = velocity;
            _orientation = 0f;

            Z = 1.5f;
            SpawnTime = 0.0;
            UsedInBoundingBoxCheck = true;
            _originator = origin;
            _invulnerableTime = 0;
        }
Beispiel #5
0
        public BulletProjectile(Vector2 pos, Vector2 velocity, float velocityBoost, float orientation, float spreadDegrees, IPoorWeaponHolder origin)
            : base("bullet", pos, velocity, origin)
        {
            Random rnd = new Random(Guid.NewGuid().GetHashCode());
            _spread = (rnd.NextDouble() * spreadDegrees) / 2.0;

            if (rnd.NextDouble() > 0.5)
            {
                _spread = -_spread;
            }
            _orientation = orientation + (float)_spread;
            float xFactor = (float)Math.Sin(CalcHelper.DegreeToRadian(_orientation));
            float yFactor = (float)-Math.Cos(CalcHelper.DegreeToRadian(_orientation));
            Vector2 boostFactor = new Vector2(xFactor * velocityBoost, yFactor * velocityBoost);

            _velocity = velocity + boostFactor;
            _invulnerableTime = 0.5f;
            Damage = 200;
        }
Beispiel #6
0
        public AntiAirCannon(IPoorWeaponHolder owner)
            : base(owner)
        {
            firstBurst = true;
            bulletsThisBurst = 0;
            _burstTimer = new Stopwatch();
            _burstTimer.Start();

            _muzzleFlashBig = new MuzzleFlashBig(EngineManager.Game, 4);
            EngineManager.Game.Components.Add(_muzzleFlashBig);
            _muzzleFlash = new MuzzleFlash(EngineManager.Game, 4);
            EngineManager.Game.Components.Add(_muzzleFlash);

            setGunLength(45f);

            /*
            gunOffset = new Vector2[4];
            gunOffset[0] = new Vector2(0, -3);
            gunOffset[1] = new Vector2(-3, 0);
            gunOffset[2] = new Vector2(-6, 3);
            gunOffset[3] = new Vector2(3, -6);
            GunLength = 45f;
            */
        }
Beispiel #7
0
 public Cannon(IPoorWeaponHolder owner)
     : base(owner)
 {
 }
Beispiel #8
0
 public BombWeapon(IPoorWeaponHolder owner)
     : base(owner)
 {
 }
Beispiel #9
0
 public ProjectileWeapon(IPoorWeaponHolder owner)
     : base(owner)
 {
     _muzzleFlash = new MuzzleFlashSmall(EngineManager.Game, 4);
     EngineManager.Game.Components.Add(_muzzleFlash);
 }