コード例 #1
0
        private void TickArenaLogic()
        {
            if (!IsPvapScene())
            {
                return;
            }
            RoleInfo roleself = LobbyClient.Instance.CurrentRole;

            if (roleself == null)
            {
                return;
            }
            ArenaStateInfo arena_state = roleself.ArenaStateInfo;

            if (arena_state.IsBattleStarted && !arena_state.IsEntityCreated)
            {
                roleself.ArenaStateInfo.IsEntityCreated = true;
                CreatePlayerSelfParters();
                arena_state.TargetInfo = CreateArenaTarget(arena_state.ChallengeTarget);
            }
            if (!arena_state.IsChallengeOver && arena_state.IsBeginFight)
            {
                m_AiSystem.Tick();
            }
            ClientScriptSystem.Instance.Tick();
            CameraChangeCheck(arena_state, roleself);
            OverCheck(arena_state);
            TimeOutCheck(arena_state);
            if (arena_state.IsChallengeOver && arena_state.IsBeginFight)
            {
                arena_state.CheckChallengeResult();
            }
        }
コード例 #2
0
        private void OverCheck(ArenaStateInfo state)
        {
            if (!state.IsBattleStarted || !state.IsEntityCreated)
            {
                return;
            }
            if (state.IsChallengeOver)
            {
                return;
            }
            bool isScuccess = false;

            if (IsPlayerAndPartnerAllDead(GetPlayerSelf(), state.CreatedPartners))
            {
                isScuccess            = false;
                state.IsChallengeOver = true;
            }
            else if (IsPlayerAndPartnerAllDead(state.TargetInfo, state.ChallengeTarget.CreatedPartners))
            {
                isScuccess            = true;
                state.IsChallengeOver = true;
            }
            if (state.IsChallengeOver)
            {
                state.IsChallengeSuccess = isScuccess;
                ClientScriptSystem.Instance.SendMessage("onenemykilled");
                //LobbyNetworkSystem.Instance.OnChallengeOver(isScuccess);
            }
        }
コード例 #3
0
 private void TimeOutCheck(ArenaStateInfo state)
 {
     if (state.IsChallengeOver || !state.IsBeginFight)
     {
         return;
     }
     if (DateTime.Now >= state.EndFightLocalTime)
     {
         state.IsChallengeOver    = true;
         state.IsChallengeSuccess = false;
         ClientScriptSystem.Instance.SendMessage("timeout");
     }
 }
コード例 #4
0
        private void ChangeCameraToPartner(ArenaStateInfo state)
        {
            NpcInfo not_dead_partner = FindNotdeadPartner(state.CreatedPartners);

            if (not_dead_partner != null)
            {
                NpcView view = EntityManager.Instance.GetNpcViewById(not_dead_partner.GetId());
                if (view != null)
                {
                    GfxSystem.SendMessage("GfxGameRoot", "CameraFollow", view.Actor);
                    state.CurCameraTargetPartner = not_dead_partner.GetId();
                }
            }
        }
コード例 #5
0
        private void SetArenaCharacterCoefficient(CharacterInfo character)
        {
            ArenaStateInfo state = LobbyClient.Instance.CurrentRole.ArenaStateInfo;

            if (GetPlayerSelf() == null || state == null || state.ChallengeTarget == null)
            {
                return;
            }
            int level_self   = GetPlayerSelf().GetLevel();
            int level_target = state.ChallengeTarget.Level;

            character.HpMaxCoefficient     = CalcPvpCoefficient(level_self, level_target);
            character.EnergyMaxCoefficient = character.HpMaxCoefficient;
        }
コード例 #6
0
 private void CameraChangeCheck(ArenaStateInfo state, RoleInfo self)
 {
     if (state.IsChallengeOver)
     {
         return;
     }
     if (self.GetPlayerSelfInfo().IsDead() && state.CurCameraTargetPartner == -1)
     {
         ChangeCameraToPartner(state);
     }
     if (state.CurCameraTargetPartner >= 0)
     {
         CharacterInfo npc = WorldSystem.Instance.GetCharacterById(state.CurCameraTargetPartner);
         if (npc != null && npc.IsDead())
         {
             ChangeCameraToPartner(state);
         }
     }
 }