Remedy_510110.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using XmdsCommon.Plugin;
  5. using XmdsCommonServer.Plugin;
  6. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  7. using XmdsCommonServer.XLS.Data;
  8. using XmdsCommonSkill.Plugin.Buffs;
  9. using XmdsCommonSkill.Plugin.Skills;
  10. using static CommonAI.Zone.Instance.InstanceUnit;
  11. /// <summary>
  12. /// 治疗【1】技能 1 - 1 (此技能穿过友方,友方获得加速10%,持续2S(不叠加,只持续重置BUFF时间))
  13. /// </summary>
  14. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  15. {
  16. public class Remedy_510110 : Remedy_510100
  17. {
  18. private static readonly int ID = 510110;
  19. //治疗提升效果
  20. protected XmdsSkillValue valueSet2;
  21. //扩展配置
  22. protected XmdsSkillValue valueSet6; //加速效果
  23. protected static readonly int Buff_ID_SpeedUp = (int)XmdsBuffBase.XmdsBuffList.SPEED_UP;
  24. public override int SkillID { get { return ID; } }
  25. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  26. {
  27. base.OnInit(info, unit, ref template);
  28. // Buff2修改
  29. var pack2 = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID_SpeedUp);
  30. var buff2 = pack2.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.MoveSpeedUp) as XmdsBuff_MoveSpeedUp;
  31. buff2.ChangePercent = valueSet6.GetValue(info.TalentSkillLevel1, 1);
  32. var bt2 = pack2.mBuffTemplate;
  33. bt2.LifeTimeMS = valueSet6.GetValue(info.TalentSkillLevel1, 2);
  34. bt2.IsHarmful = false;
  35. pack2.BindTemplateAndDispose();
  36. unit.RegistSendBuff(bt2);
  37. }
  38. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  39. {
  40. base.OnSkillDataChange(gs, unit);
  41. var buff = unit.GetRegisBuffVirtual(Buff_ID_SpeedUp) as XmdsBuff_MoveSpeedUp;
  42. buff.ChangePercent = valueSet6.GetValue(gs.TalentSkillLevel1, 1);
  43. var bt = unit.GetRegistBuff(Buff_ID_SpeedUp);
  44. bt.LifeTimeMS = valueSet6.GetValue(gs.TalentSkillLevel1, 2);
  45. }
  46. /** 自疗恢复已损失生命百分百 */
  47. protected override float GetHealValue(BattleParams param)
  48. {
  49. return base.GetHealValue(param) + valueSet2.GetValue(param.GameSkill.TalentSkillLevel1);
  50. }
  51. protected override void OnSkillLogicEvent(BattleParams param)
  52. {
  53. if (param.Hitter.IsAllies(param.Attacker, false, true))
  54. {
  55. param.Hitter.mUnit.AddBuff(Buff_ID_SpeedUp, param.Attacker.mUnit);
  56. }
  57. }
  58. protected override void OnInitConfig()
  59. {
  60. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  61. base.InitBaseConfig(data);
  62. InitData(data, out valueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  63. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  64. //扩展配置
  65. InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  66. InitData(data, out valueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  67. }
  68. }
  69. }