Remedy_510230.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using CommonLang;
  5. using XmdsCommon.Plugin;
  6. using XmdsCommonServer.Plugin;
  7. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  8. using XmdsCommonServer.XLS.Data;
  9. using XmdsCommonSkill.Plugin.Buffs;
  10. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  11. {
  12. /// <summary>
  13. /// 治疗, 二技能: 2-3(复数绿色的精灵环绕在奶妈四周,范围为X码,类似死亡先知大招,3s,绿色精灵会每1S触碰队友一次回血百分之X)
  14. /// </summary>
  15. public class Remedy_510230 : Remedy_510220
  16. {
  17. private static readonly int ID = 510230;
  18. public override int SkillID { get { return ID; } }
  19. //霸体buff
  20. private static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.COM_INGORE_CTRL;
  21. // 回血系数
  22. protected XmdsSkillValue valueSet4;
  23. //范围解控,提供霸体buff
  24. protected XmdsSkillValue valueSet5;
  25. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  26. {
  27. base.OnInit(info, unit, ref template);
  28. unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
  29. var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  30. var bt = pack.mBuffTemplate;
  31. bt.IsHarmful = true;
  32. bt.LifeTimeMS = valueSet5.GetValue(info.TalentSkillLevel3, 2);
  33. pack.BindTemplateAndDispose();
  34. unit.RegistSendBuff(bt);
  35. }
  36. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  37. {
  38. base.OnSkillDataChange(gs, unit);
  39. var bt = unit.GetRegistBuff(Buff_ID);
  40. bt.LifeTimeMS = valueSet5.GetValue(gs.TalentSkillLevel3, 2);
  41. }
  42. // 释放初始,解控,并提供霸体buff
  43. protected int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
  44. {
  45. //治疗自己和队友
  46. using (var list = ListObjectPool<InstanceUnit>.AllocAutoRelease())
  47. {
  48. launcher.mUnit.Parent.getObjectsRoundRange<InstanceUnit>(
  49. (obj, dx, dy, dr) =>
  50. {
  51. var u = obj as InstanceUnit;
  52. //己方单位.
  53. if (launcher.IsAllies(u.Virtual as XmdsVirtual))
  54. {
  55. return CMath.includeRoundPoint(dx, dy, dr, u.X, u.Y);
  56. }
  57. return false;
  58. },
  59. launcher.mUnit.X,
  60. launcher.mUnit.Y,
  61. valueSet5.GetValue(info.TalentSkillLevel3, 1),
  62. list, launcher.mUnit.AoiStatus);
  63. foreach(InstanceUnit unit in list)
  64. {
  65. (unit.Virtual as XmdsVirtual).RemoveControlBuff();
  66. unit.AddBuff(Buff_ID, launcher.mUnit);
  67. }
  68. }
  69. return 0;
  70. }
  71. protected override void OnSkillLogicEvent(BattleParams param)
  72. {
  73. base.OnSkillLogicEvent(param);
  74. if (param.Attacker.IsAllies(param.Hitter, true, true))
  75. {
  76. int addHP = CUtils.CastInt(param.Attacker.MirrorProp.MaxAttack * XmdsUnitProp.PER * valueSet4.GetValue(param.GameSkill.TalentSkillLevel3));
  77. param.Hitter.mUnit.AddHP(addHP, param.Attacker.mUnit);
  78. }
  79. }
  80. protected override void OnInitConfig()
  81. {
  82. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  83. base.InitBaseConfig(data);
  84. InitData(data, out buffTime, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  85. InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  86. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  87. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  88. InitData(data, out valueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
  89. //2-3免控
  90. InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  91. }
  92. }
  93. }