//public override void OnAttachBuff(SkillObj self, SkillObj srcObj, BuffInfo_New newBuff, BuffInfo_New buffInfo, BuffConfig_New buffConfig) //{ // if(self is Object.Tank) // { // Object.Tank tank = self as Object.Tank; // //double pValue = tank.Spd2011; // int speedChangeType = self.GetBuffIntParam(buffConfig, Key_Int_SpeedChangeType_SkillConfig); // switch(speedChangeType) // { // case 1: // tank.SpdAdd2010 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_SkillConfig); // break; // case 2: // if(1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_SkillConfig) != 0) // { // tank.SpdMult2009 *= 1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_SkillConfig); // } // break; // } // } //} public override void OnDetach(SkillObj self, SkillObj srcObj, BuffInfo_New buff, BuffConfig_New buffConfig) { if (self is Object.Tank) { Object.Tank tank = self as Object.Tank; //double pValue = tank.Spd2011; int speedChangeType = self.GetBuffIntParam(buffConfig, Key_Int_SpeedChangeType_BuffConfig); int bSpeedChanged = self.GetBuffIntParam(buff, Key_Int_SpeedChanged_BuffInfo); if (bSpeedChanged == 1) { switch (speedChangeType) { case 1: tank.SpdAdd2010 -= (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_BuffConfig); break; case 2: //if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_BuffConfig) != 0) { tank.SpdMult2009 -= (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_BuffConfig); } break; } } } }
public override void OnAttach(SkillObj self, SkillObj srcObj, BuffInfo_New buff, BuffConfig_New buffConfig) //public override double OnDataFix(SkillObj self, PropertyType pType, double pValue, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { if (self is Object.Tank) { Object.Tank tank = self as Object.Tank; //double pValue = tank.Spd2011; int speedChangeType = self.GetBuffIntParam(buffConfig, Key_Int_SpeedChangeType_BuffConfig); int bSpeedChanged = self.GetBuffIntParam(buff, Key_Int_SpeedChanged_BuffInfo); if (bSpeedChanged == 0) { self.SetBuffIntParam(buff, Key_Int_SpeedChanged_BuffInfo, 1); switch (speedChangeType) { case 1: tank.SpdAdd2010 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_BuffConfig); break; case 2: //if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_BuffConfig) != 0) { tank.SpdMult2009 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_BuffConfig); } break; } } } return; }
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 void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { int damageType = self.GetBuffIntParam(buffConfig, Key_Int_DamageType_SkillConfig); double damageValue = self.GetBuffDoubleParam(buffConfig, Key_Double_DamageValue_SkillConfig); switch (damageType) { case 1: if (damageValue > 0) { Damage damage = BattleModule.CreateDamage((int)damageValue, self.GetSrcID(buffInfo), eReason: BattleReason.Buff); BattleModule.DamageTarget(tarObj, self, damage); } break; case 2: if (damageValue > 0) { Damage damage = BattleModule.CreateDamage((int)damageValue * tarObj.GetMaxHP() / 10000, self.GetSrcID(buffInfo), eReason: BattleReason.Buff); BattleModule.DamageTarget(tarObj, self, damage); } break; } // Damage damage = BattleModule.CreateDamage((int)damageType, self.GetSrcID(buffInfo), eReason: BattleReason.Buff); // BattleModule.DamageTarget(tarObj, self, damage); }
public override void OnDamageTarget(SkillObj self, SkillObj target, Damage damage, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { if (damage.value > 0 && self != target) { double addTime = self.GetBuffDoubleParam(buffConfig, Key_Double_AddTime_BuffConfig); self.SetBuffTime(buffInfo, self.GetBuffTime(buffInfo) + addTime); self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) + addTime); self.NotifyBuffInfo(buffInfo, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd); } }
public override void OnDamageTarget(SkillObj self, SkillObj target, Damage damage, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { if(damage.value > 0 && self != target) { double addTime = self.GetBuffDoubleParam(buffConfig, Key_Double_AddTime_BuffConfig); self.SetBuffTime(buffInfo, self.GetBuffTime(buffInfo) + addTime); self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) + addTime); self.NotifyBuffInfo(buffInfo, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd); } }
public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { int key = Key_Double_AddTime1_BuffConfig; if (self.GetSrcID(buffInfo) == tarObj.GetID() || self.GetSrcParentID(buffInfo) == tarObj.GetID()) { key = Key_Double_AddTime1_BuffConfig; } else { key = Key_Double_AddTime2_BuffConfig; } foreach (var buff in self.GetBuffList(true)) { int buffId = self.GetBuffID(buff); if (buffId > 0 && buffId == self.GetBuffIntParam(buffConfig, Key_Int_BuffId_BuffConfig)) { double addTime = self.GetBuffDoubleParam(buffConfig, key); self.SetBuffTime(buff, self.GetBuffTime(buff) + addTime); self.SetBuffStateTime(buff, self.GetBuffStateTime(buff) + addTime); self.NotifyBuffInfo(buff, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd); } } }
public override void OnAttach(SkillObj self, SkillObj srcObj, BuffInfo_New buff, BuffConfig_New buffConfig) //public override double OnDataFix(SkillObj self, PropertyType pType, double pValue, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { if (self is Object.Tank) { Object.Tank tank = self as Object.Tank; //double pValue = tank.Spd2011; int GChangeType = self.GetBuffIntParam(buffConfig, Key_Int_GChangeType_BuffConfig); int FChangeType = self.GetBuffIntParam(buffConfig, Key_Int_FChangeType_BuffConfig); int bGFChanged = self.GetBuffIntParam(buff, Key_Int_GFChanged_BuffInfo); if (bGFChanged == 0) { self.SetBuffIntParam(buff, Key_Int_GFChanged_BuffInfo, 1); switch (GChangeType) { case 1: tank.AttAdd1004 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig); break; case 2: if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig) != 0) { tank.AttMult1003 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig); } break; } switch (FChangeType) { case 1: tank.DefAdd1009 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig); break; case 2: if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig) != 0) { tank.DefMult1008 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig); } break; } } } return; }
//public override double OnDataFix(SkillObj self, PropertyType pType, double pValue, BuffInfo_New buffInfo, BuffConfig_New buffConfig) public override void OnAttach(SkillObj self, SkillObj srcObj, BuffInfo_New buff, BuffConfig_New buffConfig) { if (self is Object.Tank) { Object.Tank tank = self as Object.Tank; //double pValue = tank.Spd2011; int GChangeType = self.GetBuffIntParam(buffConfig, Key_Int_GChangeType_BuffConfig); int FChangeType = self.GetBuffIntParam(buffConfig, Key_Int_FChangeType_BuffConfig); int bGFChanged = self.GetBuffIntParam(buff, Key_Int_GFChanged_BuffInfo); if (bGFChanged == 0) { self.SetBuffIntParam(buff, Key_Int_GFChanged_BuffInfo, 1); switch (GChangeType) { case 1: tank.AttAdd1004 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig); break; case 2: if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig) != 0) { tank.AttMult1003 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig); } break; } switch (FChangeType) { case 1: tank.DefAdd1009 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig); break; case 2: if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig) != 0) { tank.DefMult1008 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig); } break; } } } return ; }
//public override void OnAttachBuff(SkillObj self, SkillObj srcObj, BuffInfo_New newBuff, BuffInfo_New buffInfo, BuffConfig_New buffConfig) //{ // if(self is Object.Tank) // { // Object.Tank tank = self as Object.Tank; // //double pValue = tank.Spd2011; // int speedChangeType = self.GetBuffIntParam(buffConfig, Key_Int_SpeedChangeType_SkillConfig); // switch(speedChangeType) // { // case 1: // tank.SpdAdd2010 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_SkillConfig); // break; // case 2: // if(1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_SkillConfig) != 0) // { // tank.SpdMult2009 *= 1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_SpeedChange_SkillConfig); // } // break; // } // } //} public override void OnDetach(SkillObj self, SkillObj srcObj, BuffInfo_New buff, BuffConfig_New buffConfig) { if (self is Object.Tank) { Object.Tank tank = self as Object.Tank; //double pValue = tank.Spd2011; int GChangeType = self.GetBuffIntParam(buffConfig, Key_Int_GChangeType_BuffConfig); int FChangeType = self.GetBuffIntParam(buffConfig, Key_Int_FChangeType_BuffConfig); int bGFChanged = self.GetBuffIntParam(buff, Key_Int_GFChanged_BuffInfo); if (bGFChanged == 1) { switch (GChangeType) { case 1: tank.AttAdd1004 -= (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig); break; case 2: if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig) != 0) { tank.AttMult1003 -= (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig); } break; } switch (FChangeType) { case 1: tank.DefAdd1009 -= (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig); break; case 2: if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig) != 0) { tank.DefMult1008 -= (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig); } break; } } } }