/// <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); }
/// /// 调用CD /// public void Update(float deltatime) { int len = AllSkill.Count; for (int i = 0; i < len; ++i) { RtSkData sk = AllSkill[i]; if (sk != null && sk.canCast == false) { sk.coolDown -= deltatime; } //记录中间技能的时间 if (sk != null && sk.isAliveSk) { RtFakeSkData fakeSk = (RtFakeSkData)sk; fakeSk.aliveDur += deltatime; ConCastor.EnterIncite(fakeSk); } } }