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