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
        /// <summary>
        /// 使用技能
        /// </summary>
        public bool CastSpell(int skillId, ulong targetId, ref eSkillResult result)
        {
            ASkillObject skbase = mSkillMgr.GetSkill(skillId);

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

            var skill = skbase as SkillActive;

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

            bool isCastSuccess = CastSpell(skill, targetId);

            result = skill.mResult;
            return(isCastSuccess);
        }