Exemple #1
0
        public override void Kill(bool giveXP = true)
        {
            m_levelScreen.PhysicsManager.RemoveObject(BallAndChain);
            var enemyObj_BouncySpike = new EnemyObj_BouncySpike(m_target, null, m_levelScreen,
                                                                Difficulty);

            enemyObj_BouncySpike.SavedStartingPos = Position;
            enemyObj_BouncySpike.Position         = Position;
            m_levelScreen.AddEnemyToCurrentRoom(enemyObj_BouncySpike);
            enemyObj_BouncySpike.Position = BallAndChain.Position;
            enemyObj_BouncySpike.Speed    = ChainSpeed * 200f / m_BallSpeedDivider;
            enemyObj_BouncySpike.HeadingX =
                (float)Math.Cos(MathHelper.WrapAngle(MathHelper.ToRadians(m_ballAngle + 90f)));
            enemyObj_BouncySpike.HeadingY =
                (float)Math.Sin(MathHelper.WrapAngle(MathHelper.ToRadians(m_ballAngle + 90f)));
            if (Difficulty > GameTypes.EnemyDifficulty.BASIC)
            {
                m_levelScreen.PhysicsManager.RemoveObject(BallAndChain2);
                var enemyObj_BouncySpike2 = new EnemyObj_BouncySpike(m_target, null, m_levelScreen,
                                                                     Difficulty);
                enemyObj_BouncySpike2.SavedStartingPos = Position;
                enemyObj_BouncySpike2.Position         = Position;
                m_levelScreen.AddEnemyToCurrentRoom(enemyObj_BouncySpike2);
                enemyObj_BouncySpike2.Position = BallAndChain2.Position;
                enemyObj_BouncySpike2.Speed    = ChainSpeed * 200f * ChainSpeed2Modifier / m_BallSpeedDivider;
                if (Difficulty == GameTypes.EnemyDifficulty.ADVANCED)
                {
                    enemyObj_BouncySpike2.HeadingX =
                        (float)
                        Math.Cos(MathHelper.WrapAngle(MathHelper.ToRadians(m_ballAngle * ChainSpeed2Modifier + 90f)));
                    enemyObj_BouncySpike2.HeadingY =
                        (float)
                        Math.Sin(MathHelper.WrapAngle(MathHelper.ToRadians(m_ballAngle * ChainSpeed2Modifier + 90f)));
                }
                else if (Difficulty == GameTypes.EnemyDifficulty.EXPERT)
                {
                    enemyObj_BouncySpike2.HeadingX =
                        (float)
                        Math.Cos(MathHelper.WrapAngle(MathHelper.ToRadians(-m_ballAngle * ChainSpeed2Modifier + 90f)));
                    enemyObj_BouncySpike2.HeadingY =
                        (float)
                        Math.Sin(MathHelper.WrapAngle(MathHelper.ToRadians(-m_ballAngle * ChainSpeed2Modifier + 90f)));
                }
                enemyObj_BouncySpike2.SpawnRoom  = m_levelScreen.CurrentRoom;
                enemyObj_BouncySpike2.SaveToFile = false;
                if (IsPaused)
                {
                    enemyObj_BouncySpike2.PauseEnemy();
                }
            }
            enemyObj_BouncySpike.SpawnRoom  = m_levelScreen.CurrentRoom;
            enemyObj_BouncySpike.SaveToFile = false;
            if (IsPaused)
            {
                enemyObj_BouncySpike.PauseEnemy();
            }
            base.Kill(giveXP);
        }
 public override void Kill(bool giveXP = true)
 {
     this.m_levelScreen.PhysicsManager.RemoveObject(this.m_ballAndChain);
     EnemyObj_BouncySpike enemyObj_BouncySpike = new EnemyObj_BouncySpike(this.m_target, null, this.m_levelScreen, base.Difficulty);
     enemyObj_BouncySpike.SavedStartingPos = base.Position;
     enemyObj_BouncySpike.Position = base.Position;
     this.m_levelScreen.AddEnemyToCurrentRoom(enemyObj_BouncySpike);
     enemyObj_BouncySpike.Position = this.m_ballAndChain.Position;
     enemyObj_BouncySpike.Speed = this.ChainSpeed * 200f / this.m_BallSpeedDivider;
     enemyObj_BouncySpike.HeadingX = (float)Math.Cos((double)MathHelper.WrapAngle(MathHelper.ToRadians(this.m_ballAngle + 90f)));
     enemyObj_BouncySpike.HeadingY = (float)Math.Sin((double)MathHelper.WrapAngle(MathHelper.ToRadians(this.m_ballAngle + 90f)));
     if (base.Difficulty > GameTypes.EnemyDifficulty.BASIC)
     {
         this.m_levelScreen.PhysicsManager.RemoveObject(this.m_ballAndChain2);
         EnemyObj_BouncySpike enemyObj_BouncySpike2 = new EnemyObj_BouncySpike(this.m_target, null, this.m_levelScreen, base.Difficulty);
         enemyObj_BouncySpike2.SavedStartingPos = base.Position;
         enemyObj_BouncySpike2.Position = base.Position;
         this.m_levelScreen.AddEnemyToCurrentRoom(enemyObj_BouncySpike2);
         enemyObj_BouncySpike2.Position = this.m_ballAndChain2.Position;
         enemyObj_BouncySpike2.Speed = this.ChainSpeed * 200f * this.ChainSpeed2Modifier / this.m_BallSpeedDivider;
         if (base.Difficulty == GameTypes.EnemyDifficulty.ADVANCED)
         {
             enemyObj_BouncySpike2.HeadingX = (float)Math.Cos((double)MathHelper.WrapAngle(MathHelper.ToRadians(this.m_ballAngle * this.ChainSpeed2Modifier + 90f)));
             enemyObj_BouncySpike2.HeadingY = (float)Math.Sin((double)MathHelper.WrapAngle(MathHelper.ToRadians(this.m_ballAngle * this.ChainSpeed2Modifier + 90f)));
         }
         else if (base.Difficulty == GameTypes.EnemyDifficulty.EXPERT)
         {
             enemyObj_BouncySpike2.HeadingX = (float)Math.Cos((double)MathHelper.WrapAngle(MathHelper.ToRadians(-this.m_ballAngle * this.ChainSpeed2Modifier + 90f)));
             enemyObj_BouncySpike2.HeadingY = (float)Math.Sin((double)MathHelper.WrapAngle(MathHelper.ToRadians(-this.m_ballAngle * this.ChainSpeed2Modifier + 90f)));
         }
         enemyObj_BouncySpike2.SpawnRoom = this.m_levelScreen.CurrentRoom;
         enemyObj_BouncySpike2.SaveToFile = false;
         if (base.IsPaused)
         {
             enemyObj_BouncySpike2.PauseEnemy(false);
         }
     }
     enemyObj_BouncySpike.SpawnRoom = this.m_levelScreen.CurrentRoom;
     enemyObj_BouncySpike.SaveToFile = false;
     if (base.IsPaused)
     {
         enemyObj_BouncySpike.PauseEnemy(false);
     }
     base.Kill(giveXP);
 }
Exemple #3
0
        public static EnemyObj BuildEnemy(int enemyType, PlayerObj player, PhysicsManager physicsManager,
                                          ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty, bool doNotInitialize = false)
        {
            EnemyObj enemyObj = null;

            switch (enemyType)
            {
            case 1:
                enemyObj = new EnemyObj_BallAndChain(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 2:
                enemyObj = new EnemyObj_Blob(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 3:
                enemyObj = new EnemyObj_BouncySpike(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 4:
                enemyObj = new EnemyObj_Eagle(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 5:
                enemyObj = new EnemyObj_EarthWizard(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 6:
                enemyObj = new EnemyObj_Eyeball(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 7:
                enemyObj = new EnemyObj_Fairy(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 8:
                enemyObj = new EnemyObj_Fireball(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 9:
                enemyObj = new EnemyObj_FireWizard(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 10:
                enemyObj = new EnemyObj_Horse(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 11:
                enemyObj = new EnemyObj_IceWizard(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 12:
                enemyObj = new EnemyObj_Knight(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 13:
                enemyObj = new EnemyObj_Ninja(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 14:
                enemyObj = new EnemyObj_ShieldKnight(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 15:
                enemyObj = new EnemyObj_Skeleton(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 16:
                enemyObj = new EnemyObj_SwordKnight(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 17:
                enemyObj = new EnemyObj_Turret(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 18:
                enemyObj = new EnemyObj_Wall(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 19:
                enemyObj = new EnemyObj_Wolf(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 20:
                enemyObj = new EnemyObj_Zombie(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 21:
                enemyObj = new EnemyObj_SpikeTrap(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 22:
                enemyObj = new EnemyObj_Plant(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 23:
                enemyObj = new EnemyObj_Energon(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 24:
                enemyObj = new EnemyObj_Spark(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 25:
                enemyObj = new EnemyObj_SkeletonArcher(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 26:
                enemyObj = new EnemyObj_Chicken(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 27:
                enemyObj = new EnemyObj_Platform(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 28:
                enemyObj = new EnemyObj_HomingTurret(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 29:
                enemyObj = new EnemyObj_LastBoss(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 30:
                enemyObj = new EnemyObj_Dummy(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 31:
                enemyObj = new EnemyObj_Starburst(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 32:
                enemyObj = new EnemyObj_Portrait(player, physicsManager, levelToAttachTo, difficulty);
                break;

            case 33:
                enemyObj = new EnemyObj_Mimic(player, physicsManager, levelToAttachTo, difficulty);
                break;
            }
            if (player == null && !doNotInitialize)
            {
                enemyObj.Initialize();
            }
            return(enemyObj);
        }
Exemple #4
0
 public static EnemyObj BuildEnemy(int enemyType, PlayerObj player, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty, bool doNotInitialize = false)
 {
     EnemyObj enemyObj = null;
     switch (enemyType)
     {
     case 1:
         enemyObj = new EnemyObj_BallAndChain(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 2:
         enemyObj = new EnemyObj_Blob(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 3:
         enemyObj = new EnemyObj_BouncySpike(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 4:
         enemyObj = new EnemyObj_Eagle(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 5:
         enemyObj = new EnemyObj_EarthWizard(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 6:
         enemyObj = new EnemyObj_Eyeball(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 7:
         enemyObj = new EnemyObj_Fairy(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 8:
         enemyObj = new EnemyObj_Fireball(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 9:
         enemyObj = new EnemyObj_FireWizard(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 10:
         enemyObj = new EnemyObj_Horse(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 11:
         enemyObj = new EnemyObj_IceWizard(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 12:
         enemyObj = new EnemyObj_Knight(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 13:
         enemyObj = new EnemyObj_Ninja(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 14:
         enemyObj = new EnemyObj_ShieldKnight(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 15:
         enemyObj = new EnemyObj_Skeleton(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 16:
         enemyObj = new EnemyObj_SwordKnight(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 17:
         enemyObj = new EnemyObj_Turret(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 18:
         enemyObj = new EnemyObj_Wall(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 19:
         enemyObj = new EnemyObj_Wolf(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 20:
         enemyObj = new EnemyObj_Zombie(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 21:
         enemyObj = new EnemyObj_SpikeTrap(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 22:
         enemyObj = new EnemyObj_Plant(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 23:
         enemyObj = new EnemyObj_Energon(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 24:
         enemyObj = new EnemyObj_Spark(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 25:
         enemyObj = new EnemyObj_SkeletonArcher(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 26:
         enemyObj = new EnemyObj_Chicken(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 27:
         enemyObj = new EnemyObj_Platform(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 28:
         enemyObj = new EnemyObj_HomingTurret(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 29:
         enemyObj = new EnemyObj_LastBoss(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 30:
         enemyObj = new EnemyObj_Dummy(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 31:
         enemyObj = new EnemyObj_Starburst(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 32:
         enemyObj = new EnemyObj_Portrait(player, physicsManager, levelToAttachTo, difficulty);
         break;
     case 33:
         enemyObj = new EnemyObj_Mimic(player, physicsManager, levelToAttachTo, difficulty);
         break;
     }
     if (player == null && !doNotInitialize)
     {
         enemyObj.Initialize();
     }
     return enemyObj;
 }