Beispiel #1
0
        /// <summary>
        /// 获取技能的cd时间
        /// </summary>
        /// <param name="skill_id"></param>
        /// <returns></returns>
        public uint GetCD(uint skill_id)
        {
            uint cd_life_time = 0;

            if (m_SkillCDInfo.TryGetValue(skill_id, out cd_life_time))
            {
                return(cd_life_time);
            }
            else// 服务端数据中没有则从表格中获取
            {
                DBSkillSev skill_db = DBManager.GetInstance().GetDB <DBSkillSev>();
                if (skill_db == null)
                {
                    GameDebug.LogError("skill database not exsit!");
                    return(0);
                }

                DBSkillSev.SkillInfoSev skill_info = skill_db.GetSkillInfo(skill_id);
                if (skill_info == null)
                {
                    GameDebug.LogError("skillInfo is null! type_idx: " + skill_id);
                    return(0);
                }
                else
                {
                    return((uint)UnityEngine.Mathf.Max(skill_info.CDTime, 0));
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 根据技能选择表获取当前可用的技能
        /// </summary>
        public uint GetAvailableSkill()
        {
            if (mkSelfActor == null || mkSelfActor.IsDestroy)
            {
                return(0);
            }

            List <uint> skillIds = new List <uint>();

            skillIds.Clear();
            if (m_ShapeShifted)
            {//变身阶段
                if (mFitSkillIdPos.ContainsKey(m_ShiftFitIdx))
                {
                    foreach (var item in mFitSkillIdPos[m_ShiftFitIdx])
                    {
                        if (item.Value != null)
                        {
                            uint subSkillId = item.Value.Id;
                            if (subSkillId != 0)
                            {
                                TryAddSkillIds(skillIds, subSkillId);
                            }
                        }
                    }
                }
            }
            else
            {
                var        db_skill_info = DBManager.Instance.GetDB <DBDataAllSkill>();
                DBSkillSev dbSkillSev    = DBManager.Instance.GetDB <DBSkillSev>();
                if (RockCommandSystem.Instance.DataSkillsInfoArray != null)
                {
                    foreach (Net.PkgSkillsOne pkgSkillsOne in RockCommandSystem.Instance.DataSkillsInfoArray)
                    {
                        var skill_info = db_skill_info.GetOneAllSkillInfo(pkgSkillsOne.id);// 判断是否是主动技能
                        if (skill_info != null && skill_info.SkillType == DBDataAllSkill.SKILL_TYPE.Active)
                        {
                            uint subSkillId = db_skill_info.GetSubSkillIdByAllSkillId(pkgSkillsOne.id);
                            TryAddSkillIds(skillIds, skill_info, dbSkillSev.GetSkillInfo(subSkillId));
                        }
                    }
                }
            }

            DBSkillSelection dbSkillSelection = DBManager.GetInstance().GetDB <DBSkillSelection>();
            uint             skillId          = dbSkillSelection.SelectSkill(Game.Instance.GetLocalPlayer(), skillIds);

            return(skillId);
        }
Beispiel #3
0
            /// <summary>
            /// 从技能信息中获取cd时间
            /// </summary>
            public void Init(uint skill_id, float skillCDReduce)
            {
                type_idx = skill_id;
                time     = 0;

                DBSkillSev skill_db = DBManager.GetInstance().GetDB <DBSkillSev>();

                if (skill_db == null)
                {
                    GameDebug.LogError("skill database not exsit!");
                    return;
                }

                DBSkillSev.SkillInfoSev skill_info = skill_db.GetSkillInfo(type_idx);
                if (skill_info == null)
                {
                    GameDebug.LogError("skillInfo is null! type_idx: " + type_idx);
                }
                else
                {
                    life_time = (uint)(Mathf.Max(skill_info.CDTime, 0) * (1f - skillCDReduce));
                }
            }
Beispiel #4
0
 public DBSkillSev(string strName, string strPath) :
     base(strName, strPath)
 {
     mkInstance = this;
 }