Exemple #1
0
        /// <summary>
        /// 激活其他技能
        /// </summary>
        /// <returns>The to skill.</returns>
        /// <param name="pos">Position.</param>
        public RtSkData switchToSkill(short pos, int skillId, bool isRest)
        {
            SkillModel      skMo     = Core.Data.getIModelConfig <SkillModel>();
            SkillConfigData skillCfg = skMo.get(skillId);

            //被激活的技能
            RtSkData InciteSk = null;

            if (skillCfg.IsAlive == 1)
            {
                InciteSk = new RtFakeSkData(skillId, pos);
                ((RtFakeSkData)InciteSk).lifeNpcId = this.NpcId;
                ///
                /// 判定是否是重置的技能
                ///
                int curCnt = -1;
                if (isRest)
                {
                    RtFakeSkData oldSk = AllSkill[pos] as RtFakeSkData;
                    curCnt = oldSk.curCounting;
                    ((RtFakeSkData)InciteSk).curCounting = curCnt;
                }

                ConsoleEx.DebugLog("--incide RtFakeSkData -", ConsoleEx.RED);
            }
            else
            {
                InciteSk = new RtSkData(skillId, pos);
                ConsoleEx.DebugLog("--incide RtSkData -", ConsoleEx.RED);
            }

            if (InciteSk == null)
            {
                ConsoleEx.DebugLog("Can't find Skill. Skill ID = " + skillId);
            }
            else
            {
                //设置技能CD
                InciteSk.coolDown = InciteSk.skillCfg.BaseCD;
                AllSkill[pos]     = InciteSk;
            }

            return(InciteSk);
        }
Exemple #2
0
        //Level is ignore now
        //索引值index 如果是人物身上的技能,则填写响应的位置,否则可以填写-1,
        public RtSkData(int skId, short index, int level = 0)
        {
            SkillModel    skMo = Core.Data.getIModelConfig <SkillModel>();
            EffectModel   efMo = Core.Data.getIModelConfig <EffectModel>();
            SkBufferModel buMo = Core.Data.getIModelConfig <SkBufferModel>();

            skillCfg = skMo.get(skId);
            Utils.Assert(skillCfg == null, "Can't find skill configure. Skill Id = " + skId);

            effectCfgDic = new Dictionary <int, EffectConfigData>();
            if (skillCfg.EffectID != null)
            {
                int length = skillCfg.EffectID.Length;
                for (int i = 0; i < length; ++i)
                {
                    int EffectId = skillCfg.EffectID[i];
                    if (EffectId <= 0)
                    {
                        continue;
                    }

                    EffectConfigData ecd = efMo.get(EffectId);
                    Utils.Assert(ecd == null, "Can't find effect configure. Effect Id = " + EffectId + ". Skill Id = " + skillCfg.ID);
                    effectCfgDic[ecd.ID] = ecd;
                }
            }
            else
            {
                ConsoleEx.DebugLog("Can't find skill effect. Skill Id = " + skId, ConsoleEx.YELLOW);
            }

            ChannelBuff = buMo.get(skillCfg.ChannelBuff);
            PassiveBuff = buMo.get(skillCfg.PassiveBuff);

            coolDown = 0F;
            //UI 的索引值
            pos = index;
        }