コード例 #1
0
 public void VerifyDead(CharacterEntity character, bool isPlayer)
 {
     if (character && character.isDead)
     {
         #region 超时强制从锁定列表移除
         if (_deadDic.ContainsKey(character.characterInfo.instanceID))
         {
             float deadTime = _deadDic[character.characterInfo.instanceID];
             if (Time.time - deadTime > FORCE_CLEAR_TIME)
             {
                 VirtualServerControllerUtil.RemoveFromDic(character.characterInfo.instanceID, beLcokedDic);
                 _deadDic.Remove(character.characterInfo.instanceID);
             }
         }
         else
         {
             _deadDic.Add(character.characterInfo.instanceID, Time.time);
         }
         #endregion
         ClearSkiller(character.characterInfo.instanceID, isPlayer);
         if (!VirtualServerControllerUtil.ExistInDic(character.characterInfo.instanceID, beLcokedDic))
         {
             DataMessageHandler.DataMessage_Dead(character.characterInfo.instanceID, isPlayer);
         }
     }
 }
コード例 #2
0
        private void FinishedMechanicsed(uint skillId, List <KeyValuePair <uint, uint> > targets, bool isPlayer)
        {
            SkillData     skillData     = SkillData.GetSkillDataById(skillId);
            MechanicsData mechanicsData = MechanicsData.GetMechanicsDataById(skillData.timeline.First().Value.First());//第一个作用效果

            switch (mechanicsData.targetType)
            {
            case TargetType.Ally:    //己方暂不用更新状态,因为己方给己方使用技能,状态未改变
                break;

            case TargetType.Enemy:
            {
                for (int i = 0, iCount = targets.Count; i < iCount; i++)
                {
                    KeyValuePair <uint, uint> kvp = targets[i];
                    uint characterId = kvp.Key;

                    if (!VirtualServerControllerUtil.ExistInDic(characterId, beLcokedDic))
                    {
                        FinishedMechanicsed(characterId, !isPlayer);
                    }
                }
            }
            break;
            }
        }