Remedy_510120.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using CommonAI.Data;
  2. using CommonAI.Zone;
  3. using CommonAI.Zone.Helper;
  4. using CommonAI.Zone.Instance;
  5. using CommonLang;
  6. using System.Collections.Generic;
  7. using XmdsCommon.Plugin;
  8. using XmdsCommonServer.Plugin;
  9. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  10. using XmdsCommonServer.XLS.Data;
  11. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  12. {
  13. /// <summary>
  14. /// 战士【1】技能 1 - 2(扇子接触到友军会恢复友军自身失去血量的n%)
  15. /// </summary>
  16. public class Remedy_510120 : Remedy_510110
  17. {
  18. private static readonly int ID = 510120;
  19. //友军被治疗
  20. protected XmdsSkillValue valueSet3;
  21. //友军治疗列表
  22. protected HashSet<uint> mCureList = new HashSet<uint>();
  23. public override int SkillID { get { return ID; } }
  24. protected override int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
  25. {
  26. base.OnLaunchSkillOver(info, launcher, state);
  27. mCureList.Clear();
  28. return 0;
  29. }
  30. protected override void OnSkillLogicEvent(BattleParams param)
  31. {
  32. if (param.Attacker.IsAllies(param.Hitter, false, true))
  33. {
  34. if (mCureList.Contains(param.Hitter.mUnit.ID))
  35. {
  36. param.UseDamageType = DamageType.None;
  37. }
  38. else
  39. {
  40. mCureList.Add(param.Hitter.mUnit.ID);
  41. //友方获得加速buff 和 加血
  42. param.Hitter.mUnit.AddBuff(Buff_ID_SpeedUp, param.Attacker.mUnit);
  43. double addHP = (long)param.Attacker.MirrorProp.MaxAttack * XmdsUnitProp.PER * valueSet3.GetValue(param.GameSkill.TalentSkillLevel2);
  44. param.Hitter.mUnit.AddHP((int)addHP, param.Attacker.mUnit);
  45. }
  46. }
  47. }
  48. protected override void OnInitConfig()
  49. {
  50. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  51. base.InitBaseConfig(data);
  52. InitData(data, out valueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  53. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  54. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  55. //扩展配置
  56. InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  57. InitData(data, out valueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  58. }
  59. }
  60. }