Пример #1
0
 public override bool TakeAction()
 {
     if (_isCurr == 0)
     {
         var bossFirst = ServerEnvSet.Get(ServerEnvKey.FirstHalfBoss, 0);
         if (!string.IsNullOrEmpty(bossFirst))
         {
             int total;
             var tempList = JsonUtils.Deserialize<List<BossUser>>(bossFirst);
             if (tempList != null && tempList.Count > 0)
             {
                 _bossUserList = tempList.GetPaging(1, Top, out total);
                 _rankingNo = tempList.FindIndex(m => m.UserId == Uid) + 1;
                 var killUserId = ServerEnvSet.GetInt(ServerEnvKey.KillBossUserID, 0);
                 var killUser = tempList.Find(t => t.UserId == killUserId.ToString());
                 if (killUser != null)
                 {
                     _damageNum = killUser.DamageNum;
                     _nickName = killUser.NickName;
                     var userEntity = new GameDataCacheSet<GameUser>().FindKey(killUserId.ToString());
                     if (userEntity != null)
                     {
                         _userLv = userEntity.UserLv;
                     }
                 }
             }
         }
     }
     else if (_isCurr == 1)
     {
         BossCombat bossCombat = new BossCombat(_activeId);
         GameActive gameActive = bossCombat.GameActive;
         if (gameActive == null)
         {
             return true;
         }
         CombatStatus combatStatus = gameActive.CombatStatus;
         if (combatStatus == CombatStatus.Wait || combatStatus == CombatStatus.Combat)
         {
             int total;
             var tempList = bossCombat.RefreshRanking();
             _bossUserList = tempList.GetPaging(1, Top, out total);
             _rankingNo = tempList.FindIndex(m => m.UserId == Uid) + 1;
             var killUserId = ServerEnvSet.GetInt(ServerEnvKey.KillBossUserID, 0);
             var killUser = tempList.Find(t => t.UserId == killUserId.ToString());
             if (killUser != null)
             {
                 _damageNum = killUser.DamageNum;
                 _nickName = killUser.NickName;
                 var userEntity = new GameDataCacheSet<GameUser>().FindKey(killUserId.ToString());
                 if (userEntity != null)
                 {
                     _userLv = userEntity.UserLv;
                 }
             }
         }
     }
     return true;
 }