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 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); }