Beispiel #1
0
        public override List <GamePlayer> GetCanChooseTarget()
        {
            CampType m_camp    = self_player.CampType;
            CampType oppo_camp = GameFacade.GetCurrentCardGame().GetOppoType(m_camp);

            return(GameFacade.GetCurrentCardGame().GetGamePlayersByCamp(oppo_camp));
        }
Beispiel #2
0
        public IEnumerator StartGetTarget(GamePlayer player, GameTargetType tartget)
        {
            ChoosingTarget = true;
            Interface_Target I_target = null;

            if (m_tartgetDic.TryGetValue(tartget, out I_target))
            {
                m_CurrentTarget = I_target;
                m_CurrentTarget.Reset();
                m_CurrentTarget.SetGameTarget(player);
                if (!I_target.NeedChooseTarget())
                {
                    ChoosingTarget = false;
                }
                else
                {
                    List <GamePlayer> alternate_target = I_target.GetCanChooseTarget();
                    GameFacade.GetCurrentCardGame().GameEventDispatcher.DispatchEvent((uint)EventID.INPUT_TARGET_ADD_REQUEST, alternate_target);

                    while (ChoosingTarget)
                    {
                        yield return(null);
                    }
                }
            }
        }
Beispiel #3
0
 public override void OnStartProgress()
 {
     if (GameFacade.GetCurrentCardGame().GetCurrentAuthorizationPlayer() == GamePlayer.GAME_MANAGER)
     {
         CalculateSpeedEffect();
     }
 }
Beispiel #4
0
        public override void SetGameTarget(GamePlayer player)
        {
            base.SetGameTarget(player);
            CampType m_camp    = self_player.CampType;
            CampType oppo_camp = GameFacade.GetCurrentCardGame().GetOppoType(m_camp);

            m_gameplayer = GameFacade.GetCurrentCardGame().GetGamePlayersByCamp(oppo_camp);
        }
Beispiel #5
0
        public override void OnStartProgress()
        {
            GamePlayer authorization_player = GameFacade.GetCurrentCardGame().GetCurrentAuthorizationPlayer();

            if (authorization_player != GamePlayer.GAME_MANAGER)
            {
                //GameManager.Instance.StartCoroutine(UseCardTimeCounting());
            }
        }
Beispiel #6
0
        private void CalculateSpeedEffect()
        {
            float temp_load     = 0;
            float temp_min_time = float.MaxValue;

            PlayerID          get_round_id   = 0;
            GamePlayer        getRoundPlayer = null;
            List <GamePlayer> PlayerList     = GameFacade.GetCurrentCardGame().GetAllGamePlayers();

            m_need_time_list.Clear();


            foreach (var player in PlayerList)
            {
                if (m_players_race_flag[player.PlayerID] >= 100)
                {
                    m_players_race_flag[player.PlayerID] = 0;
                    getRoundPlayer = player;

                    m_getRoundPlayer = getRoundPlayer;
                    SetProgressEnd();
                    return;
                }

                temp_load = RACE_LOAD_LENGTH - m_players_race_flag[player.PlayerID];
                m_need_time_list.Add(player.PlayerID, temp_load / player.Role.CurrentSpeed);
            }


            foreach (var number in m_need_time_list)
            {
                if (number.Value <= temp_min_time)
                {
                    temp_min_time = number.Value;
                    get_round_id  = number.Key;
                }
            }

            foreach (var player in PlayerList)
            {
                if (get_round_id == player.PlayerID)
                {
                    m_players_race_flag[player.PlayerID] = 0;
                    getRoundPlayer = player;
                }
                else
                {
                    m_players_race_flag[player.PlayerID] += temp_min_time * player.Role.CurrentSpeed;
                }
            }

            m_getRoundPlayer = getRoundPlayer;
            SetProgressEnd();
        }
Beispiel #7
0
 // 更改这个角色的当前进度
 public void ChangeActProgress(float percent)
 {
     if (GameFacade.GetCurrentCardGame() != null)
     {
         GameFacade.GetCurrentCardGame().GetSpeedProgress().SetProgressPercentByPlayer(PlayerID, percent);
     }
     else
     {
         Debug.LogError("Cant find the CurrentGame");
     }
 }
Beispiel #8
0
 // ---------------------------------------------------------
 // 进度条百分比
 public float GetActProgress()
 {
     if (GameFacade.GetCurrentCardGame() != null)
     {
         return(GameFacade.GetCurrentCardGame().GetSpeedProgress().GetProgressPercentByPlayer(PlayerID));
     }
     else
     {
         Debug.LogError("Cant find the CurrentGame");
     }
     return(0);
 }
 public override void OnStartProgress()
 {
     if (GameFacade.GetCurrentCardGame().GetCurrentAuthorizationPlayer() != GamePlayer.GAME_MANAGER)
     {
         GamePlayer player = GameFacade.GetCurrentCardGame().GetCurrentAuthorizationPlayer();
         //deal with Get Card
         if (player.Role != null)
         {
             player.Role.GetCard(3);
         }
     }
     SetProgressEnd();
 }
Beispiel #10
0
        public override List <GamePlayer> GetCanChooseTarget()
        {
            List <GamePlayer> players = new List <GamePlayer>();

            foreach (var player in GameFacade.GetCurrentCardGame().GetGamePlayersByCamp(self_player.CampType))
            {
                if (player != GameFacade.GetCurrentCardGame().GetMyPlayer())
                {
                    players.Add(player);
                }
            }
            return(players);
        }
Beispiel #11
0
        public override void SetGameTarget(GamePlayer player)
        {
            base.SetGameTarget(player);
            List <GamePlayer> players = new List <GamePlayer>();

            foreach (var player_target in GameFacade.GetCurrentCardGame().GetAllGamePlayers())
            {
                if (player != GameFacade.GetCurrentCardGame().GetMyPlayer())
                {
                    players.Add(player);
                }
            }
            m_gameplayer = players;
        }
Beispiel #12
0
 public override void OnInitProgress()
 {
     if (GameFacade.GetCurrentCardGame().GetAllGamePlayers() != null)
     {
         foreach (var player in GameFacade.GetCurrentCardGame().GetAllGamePlayers())
         {
             m_players_race_flag.Add(player.PlayerID, 0);
         }
     }
     else
     {
         Debug.LogError("CalculateSpeedProgress:playerList is null,InitProgress faild");
     }
 }
Beispiel #13
0
 public override void OnEndProgress()
 {
     GameFacade.GetCurrentCardGame().GetBackAuthorization();
 }
Beispiel #14
0
 public void KillCurrentRound()
 {
     OnClearGameProgress();
     GameFacade.GetCurrentCardGame().JumpToLastProgress();
 }
Beispiel #15
0
 protected void EndProgress()
 {
     OnEndProgress();
     GameFacade.GetCurrentCardGame().StartNextProgress();
 }
Beispiel #16
0
 public override void SetGameTarget(GamePlayer player)
 {
     base.SetGameTarget(player);
     m_gameplayer = GameFacade.GetCurrentCardGame().GetAllGamePlayers();
 }
Beispiel #17
0
 public override void SetGameTarget(GamePlayer player)
 {
     base.SetGameTarget(player);
     m_gameplayer = GameFacade.GetCurrentCardGame().GetGamePlayersByCamp(self_player.CampType);
 }
Beispiel #18
0
 public override void OnEndProgress()
 {
     GameFacade.GetCurrentCardGame().SetAuthorization(m_getRoundPlayer);
 }
Beispiel #19
0
 public override List <GamePlayer> GetCanChooseTarget()
 {
     return(GameFacade.GetCurrentCardGame().GetGamePlayersByCamp(self_player.CampType));
 }