예제 #1
0
        public override bool CanGameOver()
        {
            base.CanGameOver();
            //回合数到100的时候结束游戏
            if (Game.TurnIndex > Game.MissionInfo.TotalTurn - 1)
            {
                return true;
            }

            if (m_king.IsLiving == false)
            {
                if (m_state == firstBossID)
                {
                    m_state++;
                }
            }

            if (m_state == secondBossID && m_secondKing == null)
            {
                m_kingMoive = Game.Createlayer(0, 0, "moive", "game.asset.living.BossBgAsset", "out", 1, 0);
                m_secondKing = Game.CreateBoss(m_state, m_king.X, m_king.Y, m_king.Direction, 1);
                Game.RemoveLiving(m_king.Id);

                if (m_secondKing.Direction == -1)
                {
                    m_secondKing.SetRectBomb(24, -159, 66, 38);
                    m_secondKing.SetRelateDemagemRect(58, -142, 5, 3);
                }
                else
                {
                    m_secondKing.SetRectBomb(-90, -159, 66, 38);
                    m_secondKing.SetRelateDemagemRect(-63, -142, 5, 3);
                }

                m_secondKing.Say("<span class='red'>你们把我激怒了,我饶不了你们!</span>", 0, 3000);
                m_kingMoive.PlayMovie("in", 5000, 0);
                m_secondKing.PlayMovie("weakness", 6100, 0);
                m_kingMoive.PlayMovie("out", 12000, 0);

                List<Player> players = Game.GetAllFightPlayers();
                int minDelay = Game.FindRandomPlayer().Delay;
                foreach (Player player in players)
                {
                    if (player.Delay < minDelay)
                    {
                        minDelay = player.Delay;
                    }
                }

                m_secondKing.AddDelay(minDelay - 2000);
                turn = Game.TurnIndex;
            }

            if (m_secondKing != null && m_secondKing.IsLiving == false)
            {
                m_leftWall = Game.FindPhysicalObjByName("wallLeft", false);
                m_rightWall = Game.FindPhysicalObjByName("wallRight", false);

                if (m_leftWall != null)
                {
                    Game.RemovePhysicalObj(m_leftWall[0], true);
                }

                if (m_rightWall != null)
                {
                    Game.RemovePhysicalObj(m_rightWall[0], true);
                }
                Game.CreatePhysicalObj(m_secondKing.X, m_secondKing.Y, "king", "game.living.LivingRecover005", "0", 0, 0);
                m_kill++;
                return true;
            }

            return false;
        }