Esempio n. 1
0
        public SkillDataCsvData GetSkillData()
        {
            SkillCsv     skill       = CsvManager.Inst.GetCsv <SkillCsv>((int)eAllCSV.eAC_Skill);
            int          skillDataId = skill.GetSkillDataIdByLv(m_skillInfo.id, 1);
            SkillDataCsv dataCsv     = CsvManager.Inst.GetCsv <SkillDataCsv>((int)eAllCSV.eAC_SkillData);

            return(dataCsv.GetData(skillDataId));
        }
Esempio n. 2
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);
            });
        }
Esempio n. 3
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();
        }
Esempio n. 4
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;
            }
        }
Esempio n. 5
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
        }