Exemple #1
0
        public BN(Vector2 scroll, String[] flags)
            : base(scroll)
        {
            //Source sprite
            sRect      = new Rectangle(0, 0, 300, 300);
            this.Scale = new Vector2(0.60f, 0.60f);

            location = new Vector2(TGPAContext.Instance.ScreenWidth, 200);
            ttl      = InfiniteTimeToLive;

            //Stats
            wpn      = new MiniBNCircularShield();
            wpn2     = new MiniBNMachineGun();
            wpn3     = new MiniBNMultidirectionnalGun();
            cooldown = 5000.0f;

            hp = basicHP;
            maxLifebarValue = hp;
            speed           = new Vector2(150.0f, 50.0f);

            frametime       = 0f;
            points          = 100000;
            go              = false;
            nShots          = 0;
            explosionsCount = 0;
            attacks         = AttackBoss1.Circluar;

            this.Flip         = SpriteEffects.FlipHorizontally;
            this.Weapon.Flip  = SpriteEffects.FlipHorizontally;
            this.flagsOnDeath = flags;

            this.DrawLifebar = true;
            this.DrawWarning = true;

            this.InfiniteMovePattern = true;
            this.Pattern             = new MovePattern();
            this.Pattern.AddPoint(TGPAContext.Instance.ScreenWidth - 300, 200);
        }
        public BN(Vector2 scroll, String[] flags)
            : base(scroll)
        {
            //Source sprite
            sRect = new Rectangle(0, 0, 300, 300);
            this.Scale = new Vector2(0.60f, 0.60f);

            location = new Vector2(TGPAContext.Instance.ScreenWidth, 200);
            ttl = InfiniteTimeToLive;

            //Stats
            wpn = new MiniBNCircularShield();
            wpn2 = new MiniBNMachineGun();
            wpn3 = new MiniBNMultidirectionnalGun();
            cooldown = 5000.0f;

            hp = basicHP;
            maxLifebarValue = hp;
            speed = new Vector2(150.0f, 50.0f);

            frametime = 0f;
            points = 100000;
            go = false;
            nShots = 0;
            explosionsCount = 0;
            attacks = AttackBoss1.Circluar;

            this.Flip = SpriteEffects.FlipHorizontally;
            this.Weapon.Flip = SpriteEffects.FlipHorizontally;
            this.flagsOnDeath = flags;

            this.DrawLifebar = true;
            this.DrawWarning = true;

            this.InfiniteMovePattern = true;
            this.Pattern = new MovePattern();
            this.Pattern.AddPoint(TGPAContext.Instance.ScreenWidth - 300,200);
        }
        public override List<Shot> Fire()
        {
            if (!go) return null;

            List<Shot> shots = new List<Shot>();

            if (cooldown != 0) return shots;

            switch (attacks)
            {
                case AttackBoss1.Circluar:

                    shots = wpn.Fire(Vectors.ConvertPointToVector2(DstRect.Center));
                    nShots += shots.Count;

                    if (nShots > 70)
                    {
                        int rand = RandomMachine.GetRandomInt(0, 5);

                        if (rand < 2)
                        {
                            attacks = AttackBoss1.OneShot;
                            wpn2.Direction = -wpn2.Direction;
                        }
                        else if (rand == 5)
                            attacks = AttackBoss1.Circluar;
                        else
                            attacks = AttackBoss1.Multidirectionnal;

                        cooldown = 1000f;
                        nShots = 0;
                    }
                    break;

                case AttackBoss1.OneShot:

                    shots = wpn2.Fire(Vectors.ConvertPointToVector2(DstRect.Center));
                    nShots += shots.Count;

                    if (nShots > 15)
                    {
                        int rand = RandomMachine.GetRandomInt(0, 5);

                        if (rand == 0)
                            attacks = AttackBoss1.Circluar;
                        else if (rand == 1)
                        {
                            attacks = AttackBoss1.OneShot;
                            wpn2.Direction = -wpn2.Direction;
                        }
                        else
                            attacks = AttackBoss1.Multidirectionnal;

                        cooldown = 600f;
                        nShots = 0;
                    }

                    break;

                case AttackBoss1.Multidirectionnal:

                    shots = wpn3.Fire(Vectors.ConvertPointToVector2(DstRect.Center));
                    nShots += shots.Count;

                    if (nShots > 15)
                    {
                        int rand = RandomMachine.GetRandomInt(0, 5);

                        if (rand == 1)
                            attacks = AttackBoss1.Circluar;
                        else if (rand == 2)
                            attacks = AttackBoss1.Multidirectionnal;
                        else
                        {
                            attacks = AttackBoss1.OneShot;
                            wpn2.Direction = -wpn2.Direction;
                        }

                        cooldown = 600f;
                        nShots = 0;
                    }

                    break;

            }

            return shots;
        }
Exemple #4
0
        public override List <Shot> Fire()
        {
            if (!go)
            {
                return(null);
            }

            List <Shot> shots = new List <Shot>();

            if (cooldown != 0)
            {
                return(shots);
            }

            switch (attacks)
            {
            case AttackBoss1.Circluar:

                shots   = wpn.Fire(Vectors.ConvertPointToVector2(DstRect.Center));
                nShots += shots.Count;

                if (nShots > 70)
                {
                    int rand = RandomMachine.GetRandomInt(0, 5);

                    if (rand < 2)
                    {
                        attacks        = AttackBoss1.OneShot;
                        wpn2.Direction = -wpn2.Direction;
                    }
                    else if (rand == 5)
                    {
                        attacks = AttackBoss1.Circluar;
                    }
                    else
                    {
                        attacks = AttackBoss1.Multidirectionnal;
                    }

                    cooldown = 1000f;
                    nShots   = 0;
                }
                break;


            case AttackBoss1.OneShot:

                shots   = wpn2.Fire(Vectors.ConvertPointToVector2(DstRect.Center));
                nShots += shots.Count;

                if (nShots > 15)
                {
                    int rand = RandomMachine.GetRandomInt(0, 5);

                    if (rand == 0)
                    {
                        attacks = AttackBoss1.Circluar;
                    }
                    else if (rand == 1)
                    {
                        attacks        = AttackBoss1.OneShot;
                        wpn2.Direction = -wpn2.Direction;
                    }
                    else
                    {
                        attacks = AttackBoss1.Multidirectionnal;
                    }

                    cooldown = 600f;
                    nShots   = 0;
                }

                break;

            case AttackBoss1.Multidirectionnal:

                shots   = wpn3.Fire(Vectors.ConvertPointToVector2(DstRect.Center));
                nShots += shots.Count;

                if (nShots > 15)
                {
                    int rand = RandomMachine.GetRandomInt(0, 5);

                    if (rand == 1)
                    {
                        attacks = AttackBoss1.Circluar;
                    }
                    else if (rand == 2)
                    {
                        attacks = AttackBoss1.Multidirectionnal;
                    }
                    else
                    {
                        attacks        = AttackBoss1.OneShot;
                        wpn2.Direction = -wpn2.Direction;
                    }

                    cooldown = 600f;
                    nShots   = 0;
                }

                break;
            }



            return(shots);
        }