コード例 #1
0
        public ScrapStation()
        {
            Animation = Common.str2Tex("Ships/scrapStation");
            Shadow    = Common.str2Tex("Shadows/scrapStation");

            AABB = new Rectangle(0, 0, Animation.Width, Animation.Height);
            CollisionRects.Add(new Rectangle2(Common.InvalidVector2, new Rectangle(0, 39, 128, 95)));
            CollisionRects.Add(new Rectangle2(Common.InvalidVector2, new Rectangle(54, 134, 74, 34)));
            CollisionRects.Add(new Rectangle2(Common.InvalidVector2, new Rectangle(36, 10, 58, 29)));
        }
コード例 #2
0
 internal StraightEnemy() :
     base()
 {
     Animation  = BaseEnemy.Animations[0];
     Shadow     = BaseEnemy.Shadows[0];
     ScoreValue = 12;
     AABB       = new Rectangle(Location.Xi(), Location.Yi(), Animation.Width, Animation.Height);
     CollisionRects.Add(new Rectangle2(Common.InvalidVector2, new Rectangle(0, 0, Animation.Width, Animation.Height)));
     CollisionDamage   = 20;
     ReappearsOnTopCnt = 1;
 }
コード例 #3
0
        internal SuiciderEnemy() :
            base()
        {
            Animation  = BaseEnemy.Animations[2];
            Shadow     = BaseEnemy.Shadows[2];
            ScoreValue = 30;

            AABB = new Rectangle(Location.Xi(), Location.Yi(), Animation.Width, Animation.Height);
            CollisionRects.Add(new Rectangle2(Common.InvalidVector2, new Rectangle(0, 0, Animation.Width, Animation.Height)));
            Location          = Common.InvalidVector2;
            CollisionDamage   = 15;
            ReappearsOnTopCnt = 0;
        }
コード例 #4
0
        internal ZigZagEnemy() :
            base()
        {
            Animation  = BaseEnemy.Animations[3];
            Shadow     = BaseEnemy.Shadows[3];
            ScoreValue = 20;

            AABB = new Rectangle(Location.Xi(), Location.Yi(), Animation.Width, Animation.Height);
            CollisionRects.Add(new Rectangle2(Common.InvalidVector2, new Rectangle(0, 0, Animation.Width, Animation.Height)));
            CollisionDamage   = 15;
            MaxChange         = Maths.RandomNr(50, 250);
            ReappearsOnTopCnt = 0;
        }
コード例 #5
0
        internal SideEnemy()
        {
            Animation  = BaseEnemy.Animations[7];
            Shadow     = BaseEnemy.Shadows[7];
            ScoreValue = 45;

            AABB = new Rectangle(Location.Xi(), Location.Yi(), Animation.Width, Animation.Height);
            CollisionRects.Add(new Rectangle2(Common.InvalidVector2, new Rectangle(0, 0, Animation.Width, Animation.Height)));
            Location        = Common.InvalidVector2;
            CollisionDamage = 40;

            HP.MaxHP          = 45;
            HP.CurrentHP      = 45;
            ReappearsOnTopCnt = 0;
        }
コード例 #6
0
        internal ItemEnemy() :
            base()
        {
            Animation  = BaseEnemy.Animations[4];
            Shadow     = BaseEnemy.Shadows[4];
            ScoreValue = 120;

            AABB = new Rectangle(Location.Xi(), Location.Yi(), Animation.Width, Animation.Height);
            CollisionRects.Add(new Rectangle2(Common.InvalidVector2, new Rectangle(0, 0, Animation.Width, Animation.Height)));
            Location        = Common.InvalidVector2;
            CollisionDamage = 80;

            DropChance        = 100;
            HP.MaxHP          = 120;
            HP.CurrentHP      = 120;
            ReappearsOnTopCnt = 0;
        }
コード例 #7
0
        public void SetPlaneType(ePlaneType planeType, string shipName)
        {
            PlaneType = planeType;
            ShipName  = new StringBuilder(shipName);
            switch (planeType)
            {
            case ePlaneType.Normal:
                Animation = Common.str2Tex("Ships/player");
                Shadow    = Common.str2Tex("Shadows/player");
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(23, 0, 11, 20)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(8, 19, 41, 16)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(0, 35, 57, 9)));
                Owner.Score += 500;
                break;

            case ePlaneType.Dmg:
                Animation = Common.str2Tex("Ships/playerDmg");
                Shadow    = Common.str2Tex("Shadows/playerDmg");
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(5, 0, 47, 35)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(0, 17, 57, 18)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(14, 35, 30, 9)));

                Owner.DmgMod += 0.41f;
                MaxVelocity  -= 4f;
                Velocity     -= 0.7f;
                break;

            case ePlaneType.Speed:
                Animation = Common.str2Tex("Ships/playerVelocity");
                Shadow    = Common.str2Tex("Shadows/player");
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(23, 0, 11, 20)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(8, 19, 41, 16)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(0, 35, 57, 9)));

                Owner.DmgMod -= 0.05f;
                MaxVelocity  += 3.0f;
                Velocity     += 2.0f;

                HP.CurrentHP = HP.MaxHP -= 50;

                MaxShield   += 15;
                Shield.MaxHP = MaxShield;
                Shield.HealFull();
                Owner.Score += 1500;
                break;

            case ePlaneType.Regen:
                Animation = Common.str2Tex("Ships/playerRegen");
                Shadow    = Common.str2Tex("Shadows/player");
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(23, 0, 11, 20)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(8, 19, 41, 16)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(0, 35, 57, 9)));

                MaxShieldRegen += 0.4f;
                ShieldRegen    += 0.3f;
                MaxShield      += 15;
                Shield.MaxHP    = MaxShield;
                Shield.HealFull();
                HPRegen.MaxValue     += 0.4f;
                HPRegen.CurrentValue += 0.25f;
                break;

            case ePlaneType.Tough:
                Animation = Common.str2Tex("Ships/playerDmg");
                Shadow    = Common.str2Tex("Shadows/playerDmg");
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(5, 0, 47, 35)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(0, 17, 57, 18)));
                CollisionRects.Add(new Rectangle2(Location, new Rectangle(14, 35, 30, 9)));

                Owner.DmgMod -= 0.1f;
                HP.MaxHP      = 500;
                HP.HealFull();
                MaxShield    += 35;
                Shield.MaxHP += 10;
                Shield.HealFull();
                MaxVelocity          -= 3.5f;
                Velocity             -= 0.6f;
                HPRegen.MaxValue     += 0.15f;
                HPRegen.CurrentValue += 0.05f;
                GunLoseDamTakenLimit *= 3;
                break;

            default:
                throw new CaseStatementMissingException();
            }
        }