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 bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { int iDamamge = self.GetSkillIntParam(skillConfig, DamegeKey); Damage damage = BattleModule.CreateDamage(iDamamge); BattleModule.DamageTarget(target, self, damage); return(true); }
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 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 = 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); } } }
//private const int Key_Double_BuffBegin_SkillConfig = 0; public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { if (self.GetCamp() != target.GetCamp()) { int iDamamge = self.GetSkillIntParam(skillConfig, Key_Damege_SkillConfig); Damage damage = BattleModule.CreateDamage(iDamamge); BattleModule.DamageTarget(target, self, damage); var buffIds = self.GetSkillIntParams(skillConfig).Skip(Key_Damege_SkillConfig + 1); foreach (var buffId in buffIds) { BattleModule.AddBuff(target, self, buffId, BattleReason.Skill); } } else { var buffIds = self.GetSkillDoubleParams(skillConfig).Select(d => (int)d); foreach (var buffId in buffIds) { BattleModule.AddBuff(target, self, buffId, BattleReason.Skill); } } return(true); }