Remedy_510410.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  10. {
  11. /// <summary>
  12. /// 治疗, 4技能 4 - 1(禁锢结束后减速50%,持续3秒)
  13. /// </summary>
  14. public class Remedy_510410 : Remedy_510400
  15. {
  16. private static readonly int ID = 510410;
  17. //4-1减速效果,时间, 治疗系数
  18. public XmdsSkillValue valueSet2;
  19. //禁锢结束帧控制
  20. private static readonly int Buff_SpeedDown = (int)XmdsBuffBase.XmdsBuffList.REMEDY_4_JINGU_SPEEDDOWN;
  21. private static readonly int Buff_JINGUEXT = (int)XmdsBuffBase.XmdsBuffList.REMEDY_4_JINGUEXT;
  22. public override int SkillID { get { return ID; } }
  23. protected override void OnSkillDamagePerEvent(BattleParams param)
  24. {
  25. if(param.AtkProp.DamagePerID == 2)
  26. {
  27. param.UseDamageType = CommonAI.Data.DamageType.Heal;
  28. param.SkillDamagePer = valueSet2.GetValue(param.GameSkill.TalentSkillLevel1, 3);
  29. }
  30. else
  31. {
  32. base.OnSkillDamagePerEvent(param);
  33. }
  34. }
  35. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  36. {
  37. base.OnInit(info, unit, ref template);
  38. //禁锢buf
  39. XmdsBuffPack pack1 = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_JINGUEXT);
  40. BuffTemplate bt1 = pack1.mBuffTemplate;
  41. bt1.IsHarmful = true;
  42. bt1.LifeTimeMS = valueSet5.GetValue(info.SkillLevel);
  43. pack1.BindTemplateAndDispose();
  44. unit.RegistSendBuff(bt1);
  45. XmdsBuffPack pack2 = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_SpeedDown);
  46. var Buff2 = pack2.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.MoveSpeedDown) as XmdsBuff_MoveSpeedDown;
  47. Buff2.ChangePercent = -valueSet2.GetValue(info.TalentSkillLevel1, 1);
  48. BuffTemplate bt2 = pack2.mBuffTemplate;
  49. bt2.IsHarmful = true;
  50. bt2.LifeTimeMS = valueSet2.GetValue(info.TalentSkillLevel1, 2);
  51. pack2.BindTemplateAndDispose();
  52. unit.RegistSendBuff(bt2);
  53. }
  54. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  55. {
  56. //禁锢被替换了,不用调用父类的数据重载
  57. //base.OnSkillDataChange(gs, unit);
  58. var bt = unit.GetRegistBuff(Buff_JINGUEXT);
  59. bt.LifeTimeMS = valueSet5.GetValue(gs.SkillLevel);
  60. var buff2 = unit.GetRegisBuffVirtual(Buff_SpeedDown) as XmdsBuff_MoveSpeedDown;
  61. buff2.ChangePercent = -valueSet2.GetValue(gs.TalentSkillLevel1, 1);
  62. var bt2 = unit.GetRegistBuff(Buff_SpeedDown);
  63. bt2.LifeTimeMS = valueSet2.GetValue(gs.TalentSkillLevel1, 2);
  64. }
  65. protected override void OnSkillLogicEvent(BattleParams param)
  66. {
  67. //一个人只被禁锢一次
  68. if (param.AtkProp.DamagePerID == 1 && !param.GameSkill.mHitUnits.ContainsKey(param.Hitter.mUnit.ID))//藤蔓
  69. {
  70. param.Hitter.mUnit.AddBuff(Buff_JINGUEXT, param.Attacker.mUnit);
  71. }
  72. }
  73. protected override void OnInitConfig()
  74. {
  75. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  76. base.InitBaseConfig(data);
  77. InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  78. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  79. //扩展配置
  80. InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  81. InitData(data, out valueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  82. }
  83. }
  84. }