Beispiel #1
0
        /// <summary>
        /// 支持创建多个不同的触发器
        /// </summary>
        private void CreateSkill()
        {
            CFrameTimeMgr.Inst.RegisterEvent(m_buffData.IntervalTime, () => {
                m_caster.m_cmdFspSendSkill.m_skillId = m_buffData.ParamValue1;

                SkillCsv skillCsv        = CsvManager.Inst.GetCsv <SkillCsv>((int)eAllCSV.eAC_Skill);
                SkillCsvData m_skillInfo = skillCsv.GetData(m_buffData.ParamValue1);
                m_caster.StartSkill(m_skillInfo);
            });
        }
Beispiel #2
0
        public int GetSkillDataIdByLv(int skillId, int lv)
        {
            if (lv == 0)
            {
                return(0);
            }
            SkillCsvData data = GetData(skillId);

            if (data == null)
            {
                Debug.LogError("技能数据为空:" + skillId);
                return(0);
            }
            if (lv - 1 < data.levelList.Length)
            {
                return(data.levelList[lv - 1]);
            }
            return(data.levelList[0]);
        }
Beispiel #3
0
        public void EnterSkill()
        {
            CSkillInfo sInfo = GetSkillByIndex(m_cmdFspSendSkill.m_skillIndex);

            if (sInfo == null)
            {
                return;
            }

            // 如果存在引导技能,则不再创建
            SkillBase dSkill = CSkillMgr.GetDownUpSkill(GetUid());

            if (dSkill != null)
            {
                if (sInfo.m_skillInfo.skillType == (int)eSkillType.Down_Up)
                {
                    SkillDownUp dp = dSkill as SkillDownUp;
                    dp.SetCmd(m_cmdFspSendSkill);
                }
                return;
            }

            if (!m_logicSkillEnabled)
            {
                return;
            }


            //Debug.Log("技能流程:使用技能:" + sInfo.m_skillInfo.id + " "+ sInfo.m_skillInfo.name);
            if (!sInfo.IsCanUse())
            {
                return;
            }

            //Debug.Log("CD 正常进入技能:" + m_cmdFspSendSkill.m_skillIndex + " " + sInfo.m_skillDataInfo.name);

            SkillCsvData m_skillInfo = sInfo.m_skillInfo;

            StartSkill(m_skillInfo);
            sInfo.GetMainSkill().OnUseSkill();
        }
Beispiel #4
0
        protected override void _Load()
        {
            m_dicData.Clear();
            for (int i = 0; i < m_csv.GetRows(); i++)
            {
                SkillCsvData data = new SkillCsvData();
                data.id         = m_csv.GetIntData(i, (int)eSkillCsv.id);
                data.languageId = m_csv.GetData(i, (int)eSkillCsv.languageId);
                //data.name = m_csv.GetData(i, (int)eSkillCsv.name);
                data.icon        = m_csv.GetIntData(i, (int)eSkillCsv.icon);
                data.type        = m_csv.GetIntData(i, (int)eSkillCsv.type);
                data.needPointer = m_csv.GetBoolData(i, (int)eSkillCsv.needPointer);

                data.selectTargetType = m_csv.GetIntData(i, (int)eSkillCsv.selectTargetType);
                data.bRoleDir         = m_csv.GetBoolData(i, (int)eSkillCsv.bRoleDir);

                data.skillType = m_csv.GetIntData(i, (int)eSkillCsv.skillType);
                //data.checkTargetType = m_csv.GetIntData(i, (int)eSkillCsv.checkTargetType);
                data.distance   = m_csv.GetIntData(i, (int)eSkillCsv.distance);
                data.length     = m_csv.GetIntData(i, (int)eSkillCsv.length);
                data.width      = m_csv.GetIntData(i, (int)eSkillCsv.width);
                data.launchTime = m_csv.GetIntData(i, (int)eSkillCsv.launchTime);
                //data.hitTime = m_csv.GetIntData(i, (int)eSkillCsv.hitTime);
                data.flySpeed = m_csv.GetIntData(i, (int)eSkillCsv.flySpeed);
                //data.checkNum = m_csv.GetIntData(i, (int)eSkillCsv.checkNum);

                data.bMove = m_csv.GetBoolData(i, (int)eSkillCsv.bMove);
                data.bRota = m_csv.GetBoolData(i, (int)eSkillCsv.bRota);

                data.lifeTime = m_csv.GetIntData(i, (int)eSkillCsv.lifeTime);

                string lvList = m_csv.GetData(i, (int)eSkillCsv.levelList);
                data.levelList = StringHelper.GetIntList(lvList);
                //data.skillDes = m_csv.GetData(i, (int)eSkillCsv.skilldata);

                string subSkill = m_csv.GetData(i, (int)eSkillCsv.subSkill);
                data.subSkill = StringHelper.GetIntList(subSkill);
                m_dicData.Add(data.id, data);
            }
        }
Beispiel #5
0
        public void Init()
        {
            CCreature player = CCreatureMgr.Get(m_curSkillCmd.m_casterUid);

            if (m_curSkillCmd.m_skillId == 0)
            {
                m_skillInfo = player.GetSkillByIndex(m_curSkillCmd.m_skillIndex).m_skillInfo;
            }
            else
            {
                // 组合技能
                SkillCsv skillCsv = CsvManager.Inst.GetCsv <SkillCsv>((int)eAllCSV.eAC_Skill);
                m_skillInfo = skillCsv.GetData(m_curSkillCmd.m_skillId);
            }

            int skillId = m_skillInfo.id;

            SkillStepCsv step = CsvManager.Inst.GetCsv <SkillStepCsv>((int)eAllCSV.eAC_SkillStep);

            m_casterData = step.GetCasterData(skillId);


            //Debug.Log("播放施法动作" + m_casterData.animaName);
            if (player.m_vCreature == null)
            {
                return;
            }

            if (m_casterData == null)
            {
                Debug.LogError("技能子表 施法配置为空:" + skillId);
                return;
            }

            m_casterObject = player.GetVObject();
            m_casterObject.StartRotate(m_curSkillCmd.m_dir.ToVector3());

            Start();
        }
Beispiel #6
0
        public void StartSkill(SkillCsvData m_skillInfo)
        {
            switch (m_skillInfo.skillType)
            {
            case (int)eSkillType.None:
                VSkillBase nSkill = new VSkillBase();
                //nSkill.PushCommand(m_cmdFspSendSkill);

                m_curSkill = CSkillMgr.Create(eSkillType.None, nSkill);
                m_curSkill.PushCommand(m_cmdFspSendSkill);
                break;

            case (int)eSkillType.Near:
                VSkillNear vSkill = new VSkillNear();
                //vSkill.PushCommand(m_cmdFspSendSkill);

                m_curSkill = (SkillNear)CSkillMgr.Create(eSkillType.Near, vSkill);
                m_curSkill.PushCommand(m_cmdFspSendSkill);
                break;

            case (int)eSkillType.Jump:
                VSkillBase vjump = new VSkillBase();
                //vjump.PushCommand(m_cmdFspSendSkill);

                m_curSkill = (SkillJump)CSkillMgr.Create(eSkillType.Jump, vjump);
                m_curSkill.PushCommand(m_cmdFspSendSkill);
                break;

            case (int)eSkillType.Down_Up:

                VSkillDownUp vDp = new VSkillDownUp();
                //vDp.PushCommand(m_cmdFspSendSkill);

                m_curSkill = (SkillDownUp)CSkillMgr.Create(eSkillType.Down_Up, vDp);
                m_curSkill.PushCommand(m_cmdFspSendSkill);
                break;
            }
        }
Beispiel #7
0
        public virtual void Start()
        {
            if (m_curSkillCmd.m_skillId == 0)
            {
                m_skillInfo = GetCaster().GetSkillByIndex(m_curSkillCmd.m_skillIndex).m_skillInfo;
            }
            else
            {
                // 组合技能
                SkillCsv skillCsv = CsvManager.Inst.GetCsv <SkillCsv>((int)eAllCSV.eAC_Skill);
                m_skillInfo = skillCsv.GetData(m_curSkillCmd.m_skillId);
            }
            // 同步施法者方向
            GetCaster().SetDir(m_curSkillCmd.m_dir);

            // 注册最长生命周期
            if (m_skillInfo.lifeTime != 0)
            {
                m_skillLifeEventHid = CFrameTimeMgr.Inst.RegisterEvent(m_skillInfo.lifeTime, () =>
                {
                    Destory();
                });
            }

            // 释放技能,前摇时不可再操作技能
            // 至于能不能移动看技能配置
            SetLogicEnable(false);

            if (m_skillInfo.launchTime == 0)
            {
                Launch();
            }
            else
            {
                m_bLaunching = true;
            }
        }
Beispiel #8
0
        public CSkillInfo(CCreature creature, int index, int skillId, int lv, bool subSkill = false, CSkillInfo mainSkill = null)
        {
            m_creature   = creature;
            m_skillId    = skillId;
            m_skillIndex = index;
            SkillCsv skill = CsvManager.Inst.GetCsv <SkillCsv>((int)eAllCSV.eAC_Skill);

            m_skillInfo = skill.GetData(skillId);
            m_skillLv   = lv;

            int skillDataId = skill.GetSkillDataIdByLv(skillId, lv);

            SkillDataCsv dataCsv = CsvManager.Inst.GetCsv <SkillDataCsv>((int)eAllCSV.eAC_SkillData);

            m_skillDataInfo = dataCsv.GetData(skillDataId);
            if (m_skillDataInfo == null)
            {
                return;
            }
            if (GetCDType() == (int)eSkillCdType.Time)
            {
                m_curCdTime = m_skillDataInfo.cd;
            }
            // 技能附加击中BUFF
            for (int i = 0; i < m_skillDataInfo.atkBuffList.Length; i++)
            {
                if (m_skillDataInfo.atkBuffList[i] == 0)
                {
                    continue;
                }
                BuffBase buff = SkillBase.AddBuff(m_creature, m_creature, m_skillDataInfo.atkBuffList[i], Vector2d.zero, Vector2d.zero, Vector2d.zero, index);
                if (buff != null)
                {
                    buff.m_dieDestroy = false;
                    m_buffList.Add(buff);
                }
            }
            // 技能附加受击BUFF
            for (int i = 0; i < m_skillDataInfo.hitBuffList.Length; i++)
            {
                if (m_skillDataInfo.hitBuffList[i] == 0)
                {
                    continue;
                }
                BuffBase buff = SkillBase.AddBuff(m_creature, m_creature, m_skillDataInfo.hitBuffList[i], Vector2d.zero, Vector2d.zero, Vector2d.zero, index);
                if (buff != null)
                {
                    buff.m_dieDestroy = false;
                    m_buffList.Add(buff);
                }
            }

            #region 包含子技能的部分
            m_mainSkill = mainSkill;
            if (subSkill)
            {
                return;
            }
            if (m_skillInfo.subSkill != null &&
                m_skillInfo.subSkill.Length > 0 &&
                m_skillInfo.subSkill[0] != 0)
            {
                m_bCondiSubSkill = true;
                m_nearCommon     = new CSkillInfo[m_skillInfo.subSkill.Length];
                for (int i = 0; i < m_skillInfo.subSkill.Length; i++)
                {
                    int        sSkillId = m_skillInfo.subSkill[i];
                    CSkillInfo info     = new CSkillInfo(m_creature, index, sSkillId, 1, true, this);
                    m_nearCommon[i] = info;
                }
            }
            #endregion
        }