Skill_910040.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using System;
  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. using XmdsCommonSkill.Plugin.PassiveSkills.Magic;
  11. using static CommonAI.Zone.Instance.InstanceUnit;
  12. using static XmdsCommonSkill.Plugin.Buffs.XmdsBuff_SwordShadow;
  13. namespace XmdsCommonSkill.Plugin.Skills.Magic
  14. {
  15. /// <summary>
  16. /// 岩浆减速,结束自爆
  17. /// </summary>
  18. public class Skill_910040 : XmdsSkillBase
  19. {
  20. private static readonly int ID = 910040;
  21. public override int SkillID { get { return ID; } }
  22. private static readonly int Buff_SpeedDown = (int)XmdsBuffBase.XmdsBuffList.SPEED_DOWN; // 通用减速
  23. private static XmdsSkillValue mSpeedDownTime;
  24. private static XmdsSkillValue mSpeedDownValue;
  25. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  26. {
  27. //修改减速buff
  28. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_SpeedDown);
  29. XmdsBuff_MoveSpeedDown buffAdd = (XmdsBuff_MoveSpeedDown)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.MoveSpeedDown);
  30. buffAdd.ChangePercent = -mSpeedDownValue.GetValue();
  31. BuffTemplate bt = pack.mBuffTemplate;
  32. bt.IsHarmful = true;
  33. bt.LifeTimeMS = mSpeedDownTime.GetValue();
  34. pack.BindTemplateAndDispose();
  35. unit.RegistSendBuff(bt);
  36. }
  37. protected override void OnSkillLogicEvent(BattleParams param)
  38. {
  39. param.UseDamageType = CommonAI.Data.DamageType.None;
  40. if (param.AtkProp.DamagePerID == 0)
  41. {
  42. param.Hitter.mUnit.AddBuff(Buff_SpeedDown, param.Attacker.mUnit);
  43. }
  44. else
  45. {
  46. //结束那一帧杀死
  47. param.Hitter.AddHP(-param.Hitter.MirrorProp.MaxHP, param.Attacker.mUnit);
  48. }
  49. }
  50. protected override void OnInitSkillParam()
  51. {
  52. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  53. InitData(data, out mSpeedDownValue, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  54. InitData(data, out mSpeedDownTime, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  55. }
  56. }
  57. }