Ejemplo n.º 1
0
        //创建技能
        private GSkillSpellLogic CreateSkill(GSkillInitParam initParam)
        {
            if (!Owner)
            {
                return(null);
            }

            if (initParam == null ||
                initParam.m_pOwner == null ||
                initParam.m_pSkillData == null)
            {
                return(null);
            }

            int nLogicID = initParam.m_pSkillData.MSV_SpellLogic;
            GSkillSpellLogic pSpellLogic = GSkillLogicManager.Instance.CreateSpellLogic(nLogicID);

            if (pSpellLogic == null)
            {
                return(null);
            }

            if (!pSpellLogic.Init(initParam))
            {
                ReferencePool.Release(pSpellLogic);
                return(null);
            }
            return(pSpellLogic);
        }
Ejemplo n.º 2
0
        //记录挂载自己的buff
        //public GBuff m_pBuff;

        public override bool Init(GSkillInitParam param)
        {
            if (!base.Init(param))
            {
                return(false);
            }

            //m_pBuff = param.pBuff;
            return(true);
        }
Ejemplo n.º 3
0
        public override bool Init(GSkillInitParam param)
        {
            if (!base.Init(param))
            {
                return(false);
            }

            m_nChannelAnim = m_pSkillData.MSV_SpellParam1;
            m_fChannelTime = m_pSkillData.MSV_SpellParam2 / 1000f;
            m_fEffectTime += m_fChannelTime;
            return(true);
        }
Ejemplo n.º 4
0
        public override bool Init(GSkillInitParam param)
        {
            if (!base.Init(param))
            {
                return(false);
            }

            m_nEffectCount     = m_pSkillData.MSV_EffectCount;
            m_fEffectTime      = m_pSkillData.MSV_EffectTime;
            m_fFirstEffectTime = m_pSkillData.MSV_FirstEffectTime;

            m_nCurEffectCount = 0;
            m_fCurEffectTime  = m_fEffectTime - m_fFirstEffectTime;
            return(true);
        }
Ejemplo n.º 5
0
        //增加技能
        public bool AddSkill(int nSkillID /*, int nSlots = 0*/)
        {
            if (!Owner)
            {
                return(false);
            }
            DRSkillData pSkillData = GameEntry.DataTable.GetDataTable <DRSkillData>().GetDataRow(nSkillID);

            if (pSkillData == null)
            {
                return(false);
            }

            if (HasSkill(nSkillID))
            {
                return(false);
            }

            GTargetInfo sTarInfo = new GTargetInfo();

            sTarInfo.m_nTargetID = Owner.Id;
            sTarInfo.m_vSrcPos   = Owner.GetPos();
            sTarInfo.m_vAimDir   = Owner.GetDir();
            sTarInfo.m_vTarPos   = Owner.GetPos();

            GSkillInitParam  param       = new GSkillInitParam(Owner, sTarInfo, pSkillData);
            GSkillSpellLogic pSpellLogic = CreateSkill(param);

            if (pSpellLogic == null)
            {
                return(false);
            }

            m_SkillLogicDict.Add(nSkillID, pSpellLogic);
            if (pSkillData.IsPassiveSkill() && !pSkillData.IsBuffSkill())
            {
                AddPassiveSkill(pSpellLogic);
                TryCalculateAttribute(pSpellLogic);
            }

            AddSubSkill(pSpellLogic);
            return(true);
        }
Ejemplo n.º 6
0
        // todo 添加 技能属性集与玩家合并接口及数据类型
        //protected XXX m_pXXXX;

        public virtual bool Init(GSkillInitParam param)
        {
            if (param.m_pOwner == null ||
                param.m_pSkillData == null ||
                param.m_TargetInfo == null)
            {
                return(false);
            }

            m_pOwner     = param.m_pOwner;
            m_TargetInfo = param.m_TargetInfo;
            m_pSkillData = param.m_pSkillData;

            m_nCasterID = m_pOwner.Id;

            ////属性转换
            //int nTransfromID = MSV_EffectTransform;
            //m_pXXXX = data.get(MSV_EffectTransform)
            return(true);
        }