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 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 OnSummon(int id, SkillObj self, SkillObj summonObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { if(summonObj != null) { var summonId = self.GetBuffIntParam(buffConfig, Key_Int_AddBuffSummonObjId_BuffConfig); var buffId = self.GetBuffIntParam(buffConfig, Key_Int_SummonObjBuffId_BuffConfig); if(summonId == id) { BattleModule.AddBuff(summonObj, self, buffId, BattleReason.Buff); } } }
public override void OnSummon(int id, SkillObj self, SkillObj summonObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { if (summonObj != null) { var summonId = self.GetBuffIntParam(buffConfig, Key_Int_AddBuffSummonObjId_BuffConfig); var buffId = self.GetBuffIntParam(buffConfig, Key_Int_SummonObjBuffId_BuffConfig); if (summonId == id) { BattleModule.AddBuff(summonObj, self, buffId, BattleReason.Buff); } } }
public override void OnDie(SkillObj self, SkillObj attacker, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { return; if (self.GetBuffIntParam(buffInfo, Key_Int_Bombed_BuffInfo) != Key_Int_Bombed_Value) { var targetSelectName = self.GetTargetSelect(buffConfig); var targetSelect = BattleModule.GetTargetSelect(targetSelectName); if (targetSelect == null) { self.LogInfo("targetSelect == null buffId:[{0}] targetSelectName:[{1}]".F(self.GetBuffID(buffInfo), targetSelectName)); return; } var targetTypeName = self.GetTargetType(buffConfig); var targetType = BattleModule.GetTargetType(targetTypeName); if (targetType == null) { self.LogInfo("targetSelect == null buffId:[{0}] targetType:[{1}]".F(self.GetBuffID(buffInfo), targetTypeName)); return; } var targets = BattleModule.GetTargets(self, targetSelect, targetType, buffInfo, buffConfig); foreach (var tar in targets.Where(t => !t.IsDead())) { OnEffect(self, tar, buffInfo, buffConfig); } } }
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 OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { int damageValue = 999999999; int damageByMyHP = self.GetBuffIntParam(buffInfo, Key_Int_DamageByMyHP_BuffInfo); int damageTarPerByMyHP = self.GetBuffIntParam(buffConfig, Key_Int_DamageTarPerByMyHP_BuffConfig); if (self == tarObj) { if (damageByMyHP <= 0) { damageByMyHP = self.GetHP() * damageTarPerByMyHP / 10000; self.SetBuffIntParam(buffInfo, Key_Int_DamageByMyHP_BuffInfo, damageByMyHP); } if (damageValue > 0) { Damage damage = BattleModule.CreateDamage(damageValue, bNeedCalc: false); BattleModule.DamageTarget(tarObj, self, damage); } int summonId = self.GetBuffIntParam(buffConfig, Key_Int_SummonId_BuffConfig); if (summonId > 0) { var summonTar = BattleModule.Summon(summonId, self, self, null, null); } } else { if (damageByMyHP <= 0) { damageByMyHP = self.GetHP() * damageTarPerByMyHP / 10000; self.SetBuffIntParam(buffInfo, Key_Int_DamageByMyHP_BuffInfo, damageByMyHP); if (damageByMyHP < 0) { damageByMyHP = 0; } } damageValue = self.GetBuffIntParam(buffConfig, Key_Int_DamageTarPer_BuffConfig) * tarObj.GetMaxHP() / 10000 + damageByMyHP; if (damageValue > 0) { Damage damage = BattleModule.CreateDamage(damageValue, bNeedCalc: false); BattleModule.DamageTarget(tarObj, self, damage); } } self.SetBuffIntParam(buffInfo, Key_Int_Bombed_BuffInfo, Key_Int_Bombed_Value); }
public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { int healValue = self.GetBuffIntParam(buffConfig, HealValueKey); if (healValue > 0) { Damage heal = BattleModule.CreateDamage(-healValue); BattleModule.DamageTarget(tarObj, self, heal); } }
public override bool InitBuffInfo(SkillObj self, SkillObj srcObj, BattleReason reason, BuffInfo_New buffInfo, BuffConfig_New buffConfig, bool RefreshGUID = true) { base.InitBuffInfo(self, srcObj, reason, buffInfo, buffConfig, RefreshGUID); int absorbDamage = self.GetBuffIntParam(buffConfig, AbsorbDamageKey); if(absorbDamage > 0) { self.SetBuffIntParam(buffInfo, AbsorbDamageKey, absorbDamage); } return true; }
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 bool InitBuffInfo(SkillObj self, SkillObj srcObj, BattleReason reason, BuffInfo_New buffInfo, BuffConfig_New buffConfig, bool RefreshGUID = true) { base.InitBuffInfo(self, srcObj, reason, buffInfo, buffConfig, RefreshGUID); int absorbDamage = self.GetBuffIntParam(buffConfig, AbsorbDamageKey); if (absorbDamage > 0) { self.SetBuffIntParam(buffInfo, AbsorbDamageKey, absorbDamage); } return(true); }
//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; } } } }
public override Damage BeHurtDamageFix(SkillObj self, SkillObj source, Damage damage, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { int shield = self.GetBuffIntParam(buffInfo, AbsorbDamageKey); if(shield > damage.value) { shield -= damage.value; damage.value = 0; } else { damage.value -= shield; shield = 0; BuffOnEnd(self, buffInfo, buffConfig); } return damage; }
public override Damage BeHurtDamageFix(SkillObj self, SkillObj source, Damage damage, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { int shield = self.GetBuffIntParam(buffInfo, AbsorbDamageKey); if (shield > damage.value) { shield -= damage.value; damage.value = 0; } else { damage.value -= shield; shield = 0; BuffOnEnd(self, buffInfo, buffConfig); } return(damage); }
public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { int damageValue = self.GetBuffIntParam(buffConfig, Key_DamageValue_SkillConfig); if (damageValue > 0 && self.GetSrcCamp(buffInfo) >= 0) { if (tarObj.GetCamp() == self.GetSrcCamp(buffInfo)) { Damage heal = BattleModule.CreateDamage(-damageValue, self.GetSrcID(buffInfo)); BattleModule.DamageTarget(tarObj, self, heal); } else { Damage damage = BattleModule.CreateDamage(damageValue, self.GetSrcID(buffInfo)); BattleModule.DamageTarget(tarObj, self, damage); } } }
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 OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { int damageValue = 999999999; int damageByMyHP = self.GetBuffIntParam(buffInfo, Key_Int_DamageByMyHP_BuffInfo); int damageTarPerByMyHP = self.GetBuffIntParam(buffConfig, Key_Int_DamageTarPerByMyHP_BuffConfig); if (self == tarObj) { if (damageByMyHP <= 0) { damageByMyHP = self.GetHP()* damageTarPerByMyHP /10000; self.SetBuffIntParam(buffInfo, Key_Int_DamageByMyHP_BuffInfo, damageByMyHP); } if (damageValue > 0) { Damage damage = BattleModule.CreateDamage(damageValue, bNeedCalc : false); BattleModule.DamageTarget(tarObj, self, damage); } int summonId = self.GetBuffIntParam(buffConfig, Key_Int_SummonId_BuffConfig); if(summonId > 0) { var summonTar = BattleModule.Summon(summonId, self, self, null, null); } } else { if (damageByMyHP <= 0) { damageByMyHP = self.GetHP() * damageTarPerByMyHP / 10000; self.SetBuffIntParam(buffInfo, Key_Int_DamageByMyHP_BuffInfo, damageByMyHP); if(damageByMyHP < 0 ) { damageByMyHP = 0; } } damageValue = self.GetBuffIntParam(buffConfig, Key_Int_DamageTarPer_BuffConfig) * tarObj.GetMaxHP()/10000 + damageByMyHP; if (damageValue > 0) { Damage damage = BattleModule.CreateDamage(damageValue, bNeedCalc: false); BattleModule.DamageTarget(tarObj, self, damage); } } self.SetBuffIntParam(buffInfo, Key_Int_Bombed_BuffInfo, Key_Int_Bombed_Value); }