Beispiel #1
0
        };                                                                       //技能释放顺序表
        public bool SelectSpell()
        {
            if (mCurrSpellNode >= mSpellSNodes.Count())
            {
                mCurrSpellNode = 0;
            }

            int          spellId = SkillMgr.getElementByIndex(mSpellSNodes[mCurrSpellNode] - 1).ID;
            ASkillObject skbase  = mSkillMgr.GetSkill(spellId);

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

            var sk = skbase as SkillActive;

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

            if (!sk.SkillCD.IsCoolDown() || !SkillCD.IsCoolDown())
            {
                return(false);
            }

            mCurrentSpellID = spellId;
            CSTable.SkillActiveData skillTplData = sk.Data as CSTable.SkillActiveData;
            mCastSpellDistance = skillTplData.range;

            return(true);
        }
Beispiel #2
0
        public Action mAction; //当前行动

        public override bool Init(int tid, byte lv)
        {
            mData   = CSTable.StaticDataManager.SkillActive[tid];
            mLvData = CSTable.StaticDataManager.SkillLevel[tid, lv];

            if (null == mData || null == mLvData)
            {
                return(false);
            }

            BaseGameLogic <ISkillSelector> selectorLogic = (BaseGameLogic <ISkillSelector>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.SkillSelector, (short)mData.selector);

            if (null != selectorLogic)
            {
                mSelector = selectorLogic.Logic;
            }

            BaseGameLogic <ISkillChecker> checkerLogic = (BaseGameLogic <ISkillChecker>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.SkillChecker, (short)mData.checker);

            if (null != checkerLogic)
            {
                mChecker = checkerLogic.Logic;
            }

            BaseGameLogic <ISkillConsumer> consumerLogic = (BaseGameLogic <ISkillConsumer>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.SkillConsumer, (short)mData.consumer);

            if (null != consumerLogic)
            {
                mConsumer = consumerLogic.Logic;
            }

            InitActionGroup();

            //已学会技能
            mStatus = eSkillStatus.Valid;

            return(true);
        }