Remedy_510350.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using System.Diagnostics;
  5. using XmdsCommon.Plugin;
  6. using XmdsCommonServer.Plugin;
  7. using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
  8. using XmdsCommonServer.XLS.Data;
  9. using XmdsCommonSkill.Plugin.Buffs;
  10. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  11. {
  12. /// <summary>
  13. /// 治疗, 三技能:3-5(普攻弹射最多5个单位(攻击力系数,不是普攻的伤害)(敌伤害 友治疗))
  14. /// </summary>
  15. public class Remedy_510350 : Remedy_510340
  16. {
  17. public static readonly new int ID = 510350;
  18. public static int Buff_ID_3_5 = (int)XmdsBuffBase.XmdsBuffList.REMEDY_3_5_TAG;
  19. public override int SkillID { get { return ID; } }
  20. //弹射治疗量
  21. public int normalAtkDmgAdditionExt;
  22. //弹射普攻
  23. protected XmdsSkillValue valueSet3;
  24. //扩展, 普攻条弹射
  25. protected XmdsSkillValue valueSet6;
  26. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  27. {
  28. base.firstHitAddBuf = false;
  29. base.OnInit(info, unit, ref template);
  30. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID_3_5);
  31. BuffTemplate bt = pack.mBuffTemplate;
  32. bt.IsHarmful = false;
  33. bt.LifeTimeMS = valueSet5.GetValue(info.TalentSkillLevel1);
  34. pack.BindTemplateAndDispose();
  35. unit.RegistSendBuff(bt);
  36. unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
  37. //额外伤害要加上上一阶段的强化数值
  38. this.normalAtkDmgAddition = valueSet3.GetValue(info.TalentSkillLevel2, 1) + valueSet2.GetValue(info.TalentSkillLevel1);
  39. this.normalAtkDmgAdditionExt = valueSet3.GetValue(info.TalentSkillLevel2, 2) + valueSet2.GetValue(info.TalentSkillLevel1);
  40. }
  41. private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
  42. {
  43. launcher.mUnit.AddBuff(Buff_ID_3_5, launcher.mUnit);
  44. return 0;
  45. }
  46. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  47. {
  48. base.OnSkillDataChange(gs, unit);
  49. //额外伤害要加上上一阶段的强化数值
  50. this.normalAtkDmgAddition = valueSet3.GetValue(gs.TalentSkillLevel2, 1) + valueSet2.GetValue(gs.TalentSkillLevel1);
  51. this.normalAtkDmgAdditionExt = valueSet3.GetValue(gs.TalentSkillLevel2, 2) + valueSet2.GetValue(gs.TalentSkillLevel1);
  52. var bt = unit.GetRegistBuff(Buff_ID_3_5);
  53. bt.LifeTimeMS = valueSet5.GetValue(gs.TalentSkillLevel1);
  54. }
  55. protected override void OnInitOver(XmdsVirtual unit, GameSkill info)
  56. {
  57. unit.ReInitOverBaseSkill(info);
  58. }
  59. public override int GetSkillValue(AbstractSkillType type)
  60. {
  61. if(type == AbstractSkillType.Value2)
  62. {
  63. return this.normalAtkDmgAdditionExt;
  64. }
  65. else
  66. {
  67. return this.normalAtkDmgAddition;
  68. }
  69. }
  70. protected override void OnInitConfig()
  71. {
  72. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  73. base.InitBaseConfig(data);
  74. InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  75. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  76. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  77. // 扩展配置
  78. InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  79. InitData(data, out valueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  80. }
  81. }
  82. }