Remedy_510530.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. /// 治疗, 五技能 5-3(角色脚下有一个光环,自身提升防御力、免伤、韧性,在此范围内,
  14. /// 所有友军提升此强化角色BUFF的一半效果 (防御力、免伤、韧性)
  15. /// </summary>
  16. public class Remedy_510530 : Remedy_510520
  17. {
  18. private static readonly int ID = 510530;
  19. private static readonly int BuffID_5_3 = (int)XmdsBuffBase.XmdsBuffList.REMEDY_5_3_TAG;
  20. private static readonly int BuffID_5_3_Allies = (int)XmdsBuffBase.XmdsBuffList.REMEDY_5_3_ALLIESTAG;
  21. public override int SkillID { get { return ID; } }
  22. //提升数值
  23. public XmdsSkillValue valueSet4; //自身强化光环
  24. // 扩展配置
  25. public XmdsSkillValue valueSet6; //队友强化光环
  26. private void BuffInit(GameSkill info, XmdsVirtual unit, XmdsSkillValue config, int BuffID)
  27. {
  28. var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(BuffID);
  29. var buff1 = pack.GetXmdsBuff(0) as XmdsBuff_PropChange;
  30. buff1.CurentChangeType = XmdsVirtual.UnitAttributeType.Defence;
  31. buff1.IsPercent = true;
  32. buff1.CurrentValue = config.GetValue(info.TalentSkillLevel3, 1);
  33. var buff2 = pack.GetXmdsBuff(1) as XmdsBuff_PropChange;
  34. buff2.CurentChangeType = XmdsVirtual.UnitAttributeType.AllDmgReduce;
  35. buff2.IsPercent = true;
  36. buff2.CurrentValue = config.GetValue(info.TalentSkillLevel3, 2);
  37. var buff3 = pack.GetXmdsBuff(2) as XmdsBuff_PropChange;
  38. buff3.CurentChangeType = XmdsVirtual.UnitAttributeType.ControlTimeReduce;
  39. buff3.IsPercent = true;
  40. buff3.CurrentValue = config.GetValue(info.TalentSkillLevel3, 3);
  41. var bt = pack.mBuffTemplate;
  42. bt.IsHarmful = false;
  43. if (BuffID == BuffID_5_3)
  44. {
  45. var buff4 = pack.GetXmdsBuff(3) as XmdsBuff_AddBuff;
  46. buff4.addBuffId = BuffID_5_3_Allies;
  47. bt.LifeTimeMS = valueSet5.GetValue(info.SkillLevel, 4);
  48. }
  49. else
  50. {
  51. //写死,在增益圈中每隔一段时间会再续上
  52. bt.LifeTimeMS = 1000;
  53. }
  54. pack.BindTemplateAndDispose();
  55. unit.RegistSendBuff(bt);
  56. }
  57. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  58. {
  59. if(unit == null)
  60. {
  61. log.Error("测试日志:510530 OnSkillDataChange单位为null!");
  62. return;
  63. }
  64. base.OnSkillDataChange(gs, unit);
  65. ReloadBuffData(gs, unit, BuffID_5_3, valueSet4);
  66. ReloadBuffData(gs, unit, BuffID_5_3_Allies, valueSet6);
  67. }
  68. private void ReloadBuffData(GameSkill gs, XmdsVirtual unit, int BuffID, XmdsSkillValue config)
  69. {
  70. var buff1 = unit.GetRegisBuffVirtual(BuffID, 0) as XmdsBuff_PropChange;
  71. buff1.CurrentValue = config.GetValue(gs.TalentSkillLevel3, 1);
  72. var buff2 = unit.GetRegisBuffVirtual(BuffID, 1) as XmdsBuff_PropChange;
  73. buff2.CurrentValue = config.GetValue(gs.TalentSkillLevel3, 2);
  74. var buff3 = unit.GetRegisBuffVirtual(BuffID, 2) as XmdsBuff_PropChange;
  75. buff3.CurrentValue = config.GetValue(gs.TalentSkillLevel3, 3);
  76. if(BuffID == BuffID_5_3)
  77. {
  78. var bt = unit.GetRegistBuff(BuffID);
  79. bt.LifeTimeMS = valueSet5.GetValue(gs.SkillLevel, 4);
  80. }
  81. }
  82. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  83. {
  84. base.OnInit(info, unit, ref template);
  85. //初始化光环buff
  86. BuffInit(info, unit, valueSet4, BuffID_5_3);
  87. //初始化队友光环buff
  88. BuffInit(info, unit, valueSet6, BuffID_5_3_Allies);
  89. }
  90. protected override void OnInitConfig()
  91. {
  92. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  93. base.InitBaseConfig(data);
  94. InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  95. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  96. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  97. InitData(data, out valueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
  98. // 扩展配置
  99. InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  100. InitData(data, out valueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  101. InitData(data, out valueSet7, XmdsSkillData.XmdsSkillDataKey.ValueSet7);
  102. }
  103. }
  104. }