protected override void ApplyPowerup(Ship ship)
        {
            PlayerShip applyShip;
            EnemyPlayerShip applyAIShip;

            if (ship == Player.Ship)
            {
                //if (Config.SoundFXOn)
                //    GameStateManagementGame.Instance.soundManager.PlaySound("FX1", 0.7f);  
                Sounds.PlaySound("powerup");
 
                applyShip = ship.GetRoot() as PlayerShip;

                if (applyShip.Shield.Health < Config.ShieldHealth)
                {
                    if (Config.ship1Active)
                        applyShip.Shield.ShieldRegen(Config.ShieldsPowerupValue + 5);
                    else
                        applyShip.Shield.ShieldRegen(Config.ShieldsPowerupValue);
                }
            }

            if (ship == Player.EnemyPlayer)
            {
                applyAIShip = ship.GetRoot() as EnemyPlayerShip;

                if (applyAIShip.Shield.Health < Config.ShieldHealth)
                    applyAIShip.Shield.ShieldRegen(Config.ShieldsPowerupValue);
            }
        }
예제 #2
0
 public WeaponAuto(Ship ship, double fireInterval)
     : base(ship)
 {
     this.FireInterval = fireInterval;
     this.timer = new Timer();
     this.timer.Fire += new NotifyHandler(timer_Fire);
 }
예제 #3
0
        public Sidearm(SpriteSheet spriteSheet, Ship ship, Vector2 offset) 
            : base(spriteSheet) 
        {
            //add to playership list so that sidearm can collision and be shot at by enemies
            //PlayerShip.PlayerShips.Add(this);
            this.ship = ship;
            this.Speed = Config.BuddySpeed;
            this.WeaponOffset = offset;
            //timer = new Timer();
            //interval = 30;
            //timer.Start(interval);
            //timer.Fire += new NotifyHandler(timer_Fire);

            this.Sprite.Origin -= offset;
            //this.Rotation += (float)(Math.PI / 4d);
            //this.Position = Player.Ship.Position;
            this.Health = 500;
            //this.ExplosionSpriteSheet = Config.ProjectileExplosion;

            //this.FireAction = new FireAction(ProjectileBullet.FireBullet);
            //this.Weapon = new WeaponAuto(this, Config.SidearmFireInterval);
            this.FireAction = new FireAction(queueBullet.FireBullet);
            this.Weapon = new WeaponAuto(this, Config.PlayerFireInterval);
                        //this.Weapon.Position = this.ship.Position;
            //this.Weapon.Offset = offset;
        }
예제 #4
0
 protected override void ApplyPowerup(Ship ship)
 {
     if (ship == Player.Ship || ship == Player.EnemyPlayer)
     {
         if (ship.Health < Config.ShipHealth)
         {
             ship.Health = Math.Min(ship.Health + Config.HealthPowerupValue, Config.ShipHealth);
             //new EffectNode(Config.Heal, ship.Position);
         }
     }
 }
        protected override void ApplyPowerup(Ship ship)
        {
            PlayerShip applyShip;
            EnemyPlayerShip applyAIShip;

            if (ship == Player.Ship)
            {
                //if (Config.SoundFXOn)
                //    GameStateManagementGame.Instance.soundManager.PlaySound("FX1", 0.7f);  
                Sounds.PlaySound("powerup");
 
                applyShip = ship.GetRoot() as PlayerShip;

                applyShip.Weapon.StopFire();
                applyShip.FireInterval = Config.PlayerFireInterval / 1.5f;
                applyShip.Weapon.FireInterval = Config.PlayerFireInterval / 1.5f;

                if (Config.ship2Active)
                    applyShip.ProjectileSpeedTimer.Start(18);
                else
                    applyShip.ProjectileSpeedTimer.Start(15);

                if (applyShip.ProjectileSpeedBar != null)
                {
                    applyShip.ProjectileSpeedBar.Percent = 0f;
                    applyShip.ProjectileSpeedBar = null;
                }
                applyShip.ProjectileSpeedBar = new Bar(100, 20, new Color(128, 0, 128, 5));
                applyShip.ProjectileSpeedBar.Position = new Vector2(5, 200);

                //Player.NotFiring = true;
                applyShip.Weapon.StartFire();
            }

            if (ship == Player.EnemyPlayer)
            {
                applyAIShip = ship.GetRoot() as EnemyPlayerShip;

                applyAIShip.Weapon.StopFire();
                applyAIShip.FireInterval = Config.PlayerFireInterval / 1.5f;
                applyAIShip.Weapon.FireInterval = Config.PlayerFireInterval / 1.5f;

                applyAIShip.ProjectileSpeedTimer.Start(15);

                //if (applyAIShip.ProjectileSpeedBar != null)
                //{
                //    applyAIShip.ProjectileSpeedBar.Percent = 0f;
                //    applyAIShip.ProjectileSpeedBar = null;
                //}
                //applyAIShip.ProjectileSpeedBar = new Bar(100, 20, new Color(128, 0, 128, 5));
                //applyAIShip.ProjectileSpeedBar.Position = new Vector2(5, 200);
                applyAIShip.Weapon.StartFire();
            }
        }
        protected override void ApplyPowerup(Ship ship)
        {
            PlayerShip applyShip;
            EnemyPlayerShip applyAIShip;

            if (ship == Player.Ship)
            {
                //if (Config.SoundFXOn)
                //    GameStateManagementGame.Instance.soundManager.PlaySound("FX1", 0.7f);   
                Sounds.PlaySound("powerup");

                applyShip = ship.GetRoot() as PlayerShip;

                applyShip.Weapon.StopFire();

                applyShip.FireAction = new FireAction(ProjectileMissile.FireMissile);

                applyShip.HomingMissileTimer.Start(5);

                if (applyShip.HomingMissileBar != null)
                {
                    applyShip.HomingMissileBar.Percent = 0f;
                    applyShip.HomingMissileBar = null;
                }
                applyShip.HomingMissileBar = new Bar(100, 20, new Color(255, 165, 0, 5));
                applyShip.HomingMissileBar.Position = new Vector2(5, 260);

                //Player.NotFiring = true;
                applyShip.Weapon.StartFire();
            }

            if (ship == Player.EnemyPlayer)
            {
                applyAIShip = ship.GetRoot() as EnemyPlayerShip;

                applyAIShip.Weapon.StopFire();

                applyAIShip.FireAction = new FireAction(AIProjectileMissile.FireMissile);

                applyAIShip.HomingMissileTimer.Start(5);

                //if (applyAIShip.HomingMissileBar != null)
                //{
                //    applyAIShip.HomingMissileBar.Percent = 0f;
                //    applyAIShip.HomingMissileBar = null;
                //}
                //applyAIShip.HomingMissileBar = new Bar(100, 20, new Color(255, 165, 0, 5));
                //applyAIShip.HomingMissileBar.Position = new Vector2(5, 260);

                applyAIShip.Weapon.StartFire();
            }
        }
        protected override void ApplyPowerup(Ship ship)
        {
            PlayerShip applyShip;

            if (ship == Player.Ship)
            {
                applyShip = ship.GetRoot() as PlayerShip;

                Node.Fps = 120;
                applyShip.SlowAllTimer.Start(1);
                GamePage.levelTime += 1;
                //Timer.TimerSpeedModifier = 0.25f;
            }
        }
예제 #8
0
        public PlayerShield(SpriteSheet spriteSheet, Ship parentShip)
            : base(spriteSheet)
        {
            this.Health = Config.ShieldHealth;

            this.CollisionList = Enemy.Enemies;
            //this.CollisionList2 = EnemyPlayerShip.EnemyPlayerShips;

            shieldVisibleTimer = new Timer();
            shieldVisibleTimer.Fire += new NotifyHandler(shieldVisibleTimer_Fire);

            shieldRegenTick = new Timer();
            shieldRegenTick.Fire += new NotifyHandler(shieldRegenTick_Fire);
            this.parentShip = parentShip;
        }
예제 #9
0
 protected override void ApplyPowerup(Ship ship)
 {
     //GameStateManagementGame.Instance.soundManager.PlaySound("coin", 0.5f);
     if (Config.Level == LevelSelect.Practise)
     {
         Config.Multi += 0.01;
     }
     else if (ship == Player.Ship)
     {
         Config.Multi += 0.01;
         //Config.Coins += 1;
         Config.CoinsCollected += 1;
         //GameStateManagementGame.Instance.soundManager.PlaySound("coin", 0.5f);   
         //GameStateManagementGame.Instance.soundManager.PlaySound("hat2");       
     }
     else if (ship == Player.EnemyPlayer)
         Config.AIMulti += 0.01;
 }
        protected override void ApplyPowerup(Ship ship)
        {
            PlayerShip applyShip;
            //EnemyPlayerShip applyAIShip;

            if (ship == Player.Ship)
            {
                //if (Config.SoundFXOn)
                //    GameStateManagementGame.Instance.soundManager.PlaySound("FX1", 0.7f);   
                Sounds.PlaySound("powerup");

                applyShip = ship.GetRoot() as PlayerShip;

                applyShip.laserDefence += 5;
            }

            if (ship == Player.EnemyPlayer)
            {

            }
        }
        protected override void ApplyPowerup(Ship ship)
        {
            PlayerShip applyShip;
            EnemyPlayerShip applyAIShip;

            if (ship == Player.Ship)
            {
                if (Config.SoundFXOn)
                    GameStateManagementGame.Instance.soundManager.PlaySound("FX1", 0.7f);   

                applyShip = ship.GetRoot() as PlayerShip;

                ship.Weapon.RemoveWeapon();
                applyShip.weaponBurstTotal += 1;

                //switch(Config.Rand.Next(1, 6))
                //{
                //    case 1:
                //        Config.CurrentProjectile = Config.BulletSheetBlueLaserDouble;
                //        break;
                //    case 2:
                //        Config.CurrentProjectile = Config.BulletSheetEnergyPurple;
                //         break;
                //    case 3:
                //        Config.CurrentProjectile = Config.BulletSheetMelter;
                //        break;
                //    case 4:
                //        Config.CurrentProjectile = Config.BulletSheetWave;
                //        break;
                //    case 5:
                //        Config.CurrentProjectile = Config.BulletSheetGreenLaser;
                //        break;
                //}

                float spread = 0.14f;
                if (applyShip.weaponBurstTotal > 1)
                    spread = 0.28f;

                //ship.Weapon = null;

                //WeaponBurst burstWeapon = new WeaponBurstWave(applyShip, 0, Math.Min(applyShip.weaponBurstTotal, 5), spread);
                WeaponBurst burstWeapon = new WeaponBurstWave(applyShip, 0, Math.Min(applyShip.weaponBurstTotal, 2), spread);
                //WeaponBurst burstWeapon = new WeaponBurstWave(applyShip, 0, applyShip.weaponBurstTotal, spread);
                applyShip.Weapon = new WeaponAutoBurst(applyShip, applyShip.FireInterval, burstWeapon);

                //ship.FireAction = new FireAction(ProjectileBulletGreenBeam.FireBullet);

                applyShip.AddProjectileTimer.Start(15);

                if (applyShip.AddProjectileBar != null)
                {
                    applyShip.AddProjectileBar.Percent = 0f;
                    applyShip.AddProjectileBar = null;
                }
                applyShip.AddProjectileBar = new Bar(100, 20, new Color(106, 90, 205, 5));
                applyShip.AddProjectileBar.Position = new Vector2(5, 230);

                //Player.NotFiring = true;
                applyShip.Weapon.StartFire();
            }

            if (ship == Player.EnemyPlayer)
            {
                applyAIShip = ship.GetRoot() as EnemyPlayerShip;

                applyAIShip.Weapon.RemoveWeapon();
                applyAIShip.weaponBurstTotal += 1;

                float spread = 0.14f;
                if (applyAIShip.weaponBurstTotal > 1)
                    spread = 0.28f;

                //ship.Weapon = null;

                WeaponBurst burstWeapon = new WeaponBurstWave(applyAIShip, 0, Math.Min(applyAIShip.weaponBurstTotal, 2), spread);
                //WeaponBurst burstWeapon = new WeaponBurstWave(applyAIShip, 0, applyAIShip.weaponBurstTotal, spread);
                applyAIShip.Weapon = new WeaponAutoBurst(applyAIShip, applyAIShip.FireInterval, burstWeapon);

                //ship.FireAction = new FireAction(ProjectileBulletGreenBeam.FireBullet);

                applyAIShip.AddProjectileTimer.Start(15);

                //if (applyAIShip.AddProjectileBar != null)
                //{
                //    applyAIShip.AddProjectileBar.Percent = 0f;
                //    applyAIShip.AddProjectileBar = null;
                //}
                //applyAIShip.AddProjectileBar = new Bar(100, 20, new Color(106, 90, 205, 5));
                //applyAIShip.AddProjectileBar.Position = new Vector2(5, 230);

                applyAIShip.Weapon.StartFire();
            }
        }
 public WeaponAutoWave(Ship ship, double fireInterval, int waveTotal, float waveSpread)
     : base(ship, fireInterval)
 {
     this.waveTotal = waveTotal;
     this.waveSpread = waveSpread;
 }
 public WeaponBurstWave(Ship ship, double fireInterval, int burstTotal, float waveSpread)
     : base(ship, fireInterval, burstTotal)
 {
     this.waveSpread = waveSpread;
 }
예제 #14
0
 protected virtual void ApplyPowerup(Ship ship) { }
예제 #15
0
 public virtual void RemoveWeapon()
 {
     this.StopFire();
     this.Ship = null;
 }
예제 #16
0
 public Weapon(Ship ship)
 {
     this.Ship = ship;
     //this.Offset = new Vector2(this.Ship.Position.X, this.Ship.Position.Y);
     this.Direction = new Vector2(0, -1);
 }