public override void Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { Dictionary<int, int> keyValues = new Dictionary<int, int>(); foreach(var buff in self.GetBuffIntParams(buffConfig).Skip(Key_Int_SummonId_BuffConfig+1)) { keyValues.Add(buff, buff); } bool bAddTime = false; foreach (var buff in self.GetBuffList(true)) { int buffId = self.GetBuffID(buff); if(keyValues.ContainsKey(buffId)) { bAddTime = true; break; } } if (bAddTime) { self.SetBuffTime(buffInfo, self.GetBuffTime(buffInfo) + self.GetDeltaTime()); self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) + self.GetDeltaTime()); self.NotifyBuffInfo(buffInfo, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd); } base.Tick(self, buffInfo, buffConfig); }
public override void Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { Dictionary <int, int> keyValues = new Dictionary <int, int>(); foreach (var buff in self.GetBuffIntParams(buffConfig).Skip(Key_Int_SummonId_BuffConfig + 1)) { keyValues.Add(buff, buff); } bool bAddTime = false; foreach (var buff in self.GetBuffList(true)) { int buffId = self.GetBuffID(buff); if (keyValues.ContainsKey(buffId)) { bAddTime = true; break; } } if (bAddTime) { self.SetBuffTime(buffInfo, self.GetBuffTime(buffInfo) + self.GetDeltaTime()); self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) + self.GetDeltaTime()); self.NotifyBuffInfo(buffInfo, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd); } base.Tick(self, buffInfo, buffConfig); }
public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig); if (ret == LogicStateTickRet.TimeFinish) { return(ret); } double effectTickTime = self.GetBuffStateDoubleParam(buffConfig, key_EffectTickTime, self.GetBuffStateIndex(buffInfo)); if (effectTickTime < 0) { self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Effect effectTickTime< 0".F(self.GetID(), self.GetBuffID(buffInfo))); return(LogicStateTickRet.TimeFinish); } self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime()); var leftTickTime = self.GetBuffStateDoubleParam(buffInfo, key_ticlLeftTime_BuffInfo); if (leftTickTime - self.GetBuffStateTime(buffInfo) >= effectTickTime) { self.SetBuffStateDoubleParam(buffInfo, key_ticlLeftTime_BuffInfo, leftTickTime - effectTickTime); self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Effect".F(self.GetID(), self.GetBuffID(buffInfo))); ret = LogicStateTickRet.OnEffect; } else if (self.GetBuffStateTime(buffInfo) <= 0) { ret = LogicStateTickRet.NextState; self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Finish".F(self.GetID(), self.GetBuffID(buffInfo))); } else { ret = LogicStateTickRet.None; } return(ret); }
public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig); if (ret == LogicStateTickRet.TimeFinish) { return(ret); } self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime()); //help harm 判断是否停留 int harmHelpType = self.GetBuffStateIntParam(buffConfig, Key_Int__BuffConfig, self.GetBuffStateIndex(buffInfo)); bool needNextState = false; switch (harmHelpType) { case 1: //这个是友好,没错 needNextState = self.GetCamp() != self.GetSrcCamp(buffInfo); break; case 2: //这个是友好,没错敌对 needNextState = self.GetCamp() == self.GetSrcCamp(buffInfo); break; } if (self.GetBuffStateTime(buffInfo) <= 0 || needNextState) { ret = LogicStateTickRet.NextState; self.LogInfo("ChargeState:buffObj[{0}] buff:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetBuffID(buffInfo))); } return(ret); }
public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig); if (ret == LogicStateTickRet.TimeFinish) { return ret; } double effectTickTime = self.GetBuffStateDoubleParam(buffConfig, key_EffectTickTime, self.GetBuffStateIndex(buffInfo)); if(effectTickTime < 0) { self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Effect effectTickTime< 0".F(self.GetID(), self.GetBuffID(buffInfo))); return LogicStateTickRet.TimeFinish; } self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime()); var leftTickTime = self.GetBuffDoubleParam(buffInfo, key_ticlLeftTime_BuffInfo); if (leftTickTime - self.GetBuffStateTime(buffInfo) >= effectTickTime) { self.SetBuffDoubleParam(buffInfo, leftTickTime - effectTickTime, key_ticlLeftTime_BuffInfo); self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Effect".F(self.GetID(), self.GetBuffID(buffInfo))); ret = LogicStateTickRet.OnEffect; } else if (self.GetBuffStateTime(buffInfo) <= 0) { ret = LogicStateTickRet.NextState; self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Finish".F(self.GetID(), self.GetBuffID(buffInfo))); } else { ret = LogicStateTickRet.None; } return ret; }
public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig); if (ret == LogicStateTickRet.TimeFinish) { return ret; } self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime()); //help harm 判断是否停留 int harmHelpType = self.GetBuffStateIntParam(buffConfig, Key_Int__BuffConfig, self.GetBuffStateIndex(buffInfo)); bool needNextState = false; switch(harmHelpType) { case 1: //这个是友好,没错 needNextState = self.GetCamp() != self.GetSrcCamp(buffInfo); break; case 2: //这个是友好,没错敌对 needNextState = self.GetCamp() == self.GetSrcCamp(buffInfo); break; } if (self.GetBuffStateTime(buffInfo) <= 0 || needNextState) { ret = LogicStateTickRet.NextState; self.LogInfo("ChargeState:buffObj[{0}] buff:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetBuffID(buffInfo))); } return ret; }
/// <summary> /// 单人技能的tick,这个需要手动调用 /// </summary> /// <param name="self"></param> public static void Tick_Battle(SkillObj self) { if (self.IsDead()) { return; } var skillList = self.GetSkillList(true); var buffList = self.GetBuffList(true); var CDKeyList = self.GetCDKeyList(); //buff if (buffList != null) { foreach (var buffInfo in buffList) { BuffLogic buffLogic = GetBuffLogic(buffInfo, self); if (buffLogic != null) { int buffId = self.GetBuffID(buffInfo); BuffConfig_New buffConfig = self.GetBuffConfig(buffId); buffLogic.Tick(self, buffInfo, buffConfig); } else { self.LogInfo("something error {0}".F(self.GetBuffID(buffInfo))); } } } //技能 if (skillList != null) { foreach (var skillInfo in skillList) { SkillLogic skillLogic = GetSkillLogic(skillInfo, self); if (skillLogic != null) { int skillId = self.GetSkillID(skillInfo); SkillConfig_New skillConfig = self.GetSkillConfig(skillId); skillLogic.Tick(self, skillInfo, skillConfig); } else { self.LogInfo("something error2 {0}".F(self.GetSkillID(skillInfo))); } } } //CD if (CDKeyList != null) { foreach (var key in CDKeyList) { self.SetCD(key, self.GetCD(key) - self.GetDeltaTime()); } } }
public override LogicStateTickRet Tick(SkillObj self, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { LogicStateTickRet ret = base.Tick(self, skillInfo, skillConfig); self.SetSkillTime(skillInfo, self.GetSkillTime(skillInfo) - self.GetDeltaTime()); if (self.GetSkillTime(skillInfo) <= 0) { ret = LogicStateTickRet.TimeFinish; self.LogInfo("SkillLogicState:skillObj[{0}] skill:[{1}] [{2}]".F(self.GetID(), self.GetSkillID(skillInfo), ret.ToString())); } return(ret); }
public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig); self.SetBuffTime(buffInfo, self.GetBuffTime(buffInfo) - self.GetDeltaTime()); if (self.GetBuffTime(buffInfo) <= 0) { ret = LogicStateTickRet.TimeFinish; self.LogInfo("BuffLogicState:buffObj[{0}] buff:[{1}] [{2}]".F(self.GetID(), self.GetBuffID(buffInfo), ret.ToString())); } return(ret); }
public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig); if (ret == LogicStateTickRet.TimeFinish) { return ret; } self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime()); if (self.GetBuffStateTime(buffInfo) <= 0) { ret = LogicStateTickRet.NextState; self.LogInfo("ChargeState:buffObj[{0}] buff:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetBuffID(buffInfo))); } return ret; }
public override LogicStateTickRet Tick(SkillObj self, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { LogicStateTickRet ret = base.Tick(self, skillInfo, skillConfig); if (ret == LogicStateTickRet.TimeFinish) { return ret; } self.SetSkillStateTime(skillInfo, self.GetSkillStateTime(skillInfo) - self.GetDeltaTime()); if (self.GetSkillStateTime(skillInfo) <= 0) { ret = LogicStateTickRet.NextState; self.LogInfo("ShowEffectSkillState:skillObj[{0}] skill:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetSkillID(skillInfo))); } return ret; }
public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig); if (ret == LogicStateTickRet.TimeFinish) { return(ret); } self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime()); if (self.GetBuffStateTime(buffInfo) <= 0) { ret = LogicStateTickRet.NextState; self.LogInfo("ChargeState:buffObj[{0}] buff:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetBuffID(buffInfo))); } return(ret); }
public override LogicStateTickRet Tick(SkillObj self, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { LogicStateTickRet ret = base.Tick(self, skillInfo, skillConfig); if (ret == LogicStateTickRet.TimeFinish) { return(ret); } self.SetSkillStateTime(skillInfo, self.GetSkillStateTime(skillInfo) - self.GetDeltaTime()); if (self.GetSkillStateTime(skillInfo) <= 0) { ret = LogicStateTickRet.NextState; self.LogInfo("ShowEffectSkillState:skillObj[{0}] skill:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetSkillID(skillInfo))); } return(ret); }
public override LogicStateTickRet Tick(SkillObj self, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { LogicStateTickRet ret = base.Tick(self, skillInfo, skillConfig); if(ret == LogicStateTickRet.TimeFinish) { return ret; } self.SetSkillStateTime(skillInfo, self.GetSkillStateTime(skillInfo) - self.GetDeltaTime()); //self.LogInfo("State [{0}] Time:[{1}]".F(self.GetSkillLogicStateName(skillInfo), self.GetSkillStateTime(skillInfo))); if (self.GetSkillStateTime(skillInfo) <= 0) { self.LogInfo("State [{0}] NowTime fINISH:[{1}]".F(self.GetSkillLogicStateName(skillInfo), self.GetNowTime())); ret = LogicStateTickRet.NextState; self.LogInfo("ChargeState:skillObj[{0}] skill:[{1}] Charge Finish".F(self.GetID(), self.GetSkillID(skillInfo))); } return ret; }
public override LogicStateTickRet Tick(SkillObj self, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { LogicStateTickRet ret = base.Tick(self, skillInfo, skillConfig); if (ret == LogicStateTickRet.TimeFinish) { return(ret); } self.SetSkillStateTime(skillInfo, self.GetSkillStateTime(skillInfo) - self.GetDeltaTime()); //self.LogInfo("State [{0}] Time:[{1}]".F(self.GetSkillLogicStateName(skillInfo), self.GetSkillStateTime(skillInfo))); if (self.GetSkillStateTime(skillInfo) <= 0) { self.LogInfo("State [{0}] NowTime fINISH:[{1}]".F(self.GetSkillLogicStateName(skillInfo), self.GetNowTime())); ret = LogicStateTickRet.NextState; self.LogInfo("ChargeState:skillObj[{0}] skill:[{1}] Charge Finish".F(self.GetID(), self.GetSkillID(skillInfo))); } return(ret); }
/// <summary> /// 单人技能的tick,这个需要手动调用 /// </summary> /// <param name="self"></param> public static void Tick_Battle(SkillObj self) { if (self.IsDead()) { return; } var skillList = self.GetSkillList(true); var buffList = self.GetBuffList(true); var CDKeyList = self.GetCDKeyList(); //buff if (buffList != null) { foreach (var buffInfo in buffList) { BuffLogic buffLogic = GetBuffLogic(buffInfo, self); if (buffLogic != null) { int buffId = self.GetBuffID(buffInfo); BuffConfig_New buffConfig = self.GetBuffConfig(buffId); buffLogic.Tick(self, buffInfo, buffConfig); } else { self.LogInfo("something error {0}".F(self.GetBuffID(buffInfo))); } } } //技能 if (skillList != null) { foreach (var skillInfo in skillList) { SkillLogic skillLogic = GetSkillLogic(skillInfo, self); if (skillLogic != null) { int skillId = self.GetSkillID(skillInfo); SkillConfig_New skillConfig = self.GetSkillConfig(skillId); skillLogic.Tick(self, skillInfo, skillConfig); } else { self.LogInfo("something error2 {0}".F(self.GetSkillID(skillInfo))); } } } //CD if(CDKeyList != null) { foreach (var key in CDKeyList) { self.SetCD(key, self.GetCD(key) - self.GetDeltaTime()); } } }