XmdsBuff_MPChange.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using XmdsCommonServer.Plugin;
  2. using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
  3. namespace XmdsCommonSkill.Plugin.Buffs
  4. {
  5. /// <summary>
  6. /// FileName: XmdsBuff_AddMP.cs
  7. /// Author: Alex.Yu
  8. /// Corporation:...
  9. /// Description: 怒气变更.
  10. /// DateTime: 2015/6/26 15:21:32
  11. /// </summary>
  12. public class XmdsBuff_MPChange : XmdsBuffBase
  13. {
  14. /// <summary>
  15. /// 变更值(填正为加怒气,填负为减怒气).
  16. /// </summary>
  17. public int ChangeValue = 0;
  18. /// <summary>
  19. /// 作用单位,默认为受击者.
  20. /// </summary>
  21. public bool ForSender = false;
  22. public override int GetAbilityID()
  23. {
  24. return (int)XmdsCommon.Plugin.XmdsBuffProperties.XmdsBuffAbility.MPChange;
  25. }
  26. public override void CopyTo(UnitBuff other)
  27. {
  28. var ret = other as XmdsBuff_MPChange;
  29. ret.ChangeValue = this.ChangeValue;
  30. ret.ForSender = this.ForSender;
  31. base.CopyTo(other);
  32. }
  33. protected override int OnBuffHit(XmdsVirtual hitter, XmdsVirtual attacker, CommonAI.Zone.Formula.AttackSource source, ref XmdsVirtual.AtkResult result)
  34. {
  35. if (ForSender)
  36. {
  37. //可能需要协议,增加飘字功能.
  38. attacker.AddMP(ChangeValue, attacker.mUnit);
  39. }
  40. else
  41. {
  42. //可能需要协议,增加飘字功能.
  43. hitter.AddMP(ChangeValue, attacker.mUnit);
  44. }
  45. return 0;
  46. }
  47. }
  48. }