Assassin_200020.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using CommonAI.Zone;
  2. using XmdsCommon.Plugin;
  3. using XmdsCommonServer.Plugin;
  4. using XmdsCommonSkill.Plugin.Buffs;
  5. using XmdsCommonServer.XLS.Data;
  6. namespace XmdsCommonSkill.Plugin.Skills.Assassin
  7. {
  8. /// <summary>
  9. /// 暗影之刃:命中目标之后,暗影之刃会对敌人造成多次伤害,每次造成x倍物攻伤害附加x物理伤害. //,并且暗影之刃会标记目标<X>秒.
  10. /// 伤害通过buff多次伤害,故此处buff没有生效概率,百分百起效.
  11. /// </summary>
  12. public class Assassin_200020 : XmdsSkillBase
  13. {
  14. public static int ID = 200020;
  15. /// 伤害倍数.
  16. public static XmdsSkillValue DP_1;
  17. // 暗影之刃 造成的多次伤害.
  18. public static int Buff_2 = (int)XmdsBuffBase.XmdsBuffList.AN_YIN_ZHI_REN;
  19. public static int BuffLifeTime = 2500; // 此buff用来实现多段伤害,故buffTime固定在编辑器里,此处不做配置表获取.
  20. public override int SkillID { get { return ID; } }
  21. protected override void OnSkillDamagePerEvent(BattleParams param)
  22. {
  23. int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
  24. param.SkillDamagePer = ret;
  25. }
  26. protected override void OnSkillLogicEvent(BattleParams param)
  27. {
  28. // 添加buff
  29. if (param.AtkProp.DamagePerID == 1)
  30. {
  31. //标记.
  32. //param.Hitter.mUnit.AddBuff(Buff_1, param.Attacker.mUnit);
  33. //伤害.
  34. XmdsBuffBase b3 = (XmdsBuffBase)param.Attacker.GetRegisBuffVirtual(Buff_2, 0);
  35. b3.SetOnHitCallBack(param.GameSkill, OnXmdsBuffHitEvent);
  36. param.Hitter.mUnit.AddBuff(Buff_2, param.Attacker.mUnit);
  37. param.UseDamageType = CommonAI.Data.DamageType.None;
  38. }
  39. //纯计算伤害.
  40. else if (param.AtkProp.DamagePerID == 2) { }
  41. }
  42. /// <summary>
  43. /// 初始化.
  44. /// </summary>
  45. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  46. {
  47. //多段伤害实现.
  48. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_2);
  49. BuffTemplate bt = pack.mBuffTemplate;
  50. bt.LifeTimeMS = BuffLifeTime;
  51. bt.IsHarmful = true;
  52. pack.BindTemplateAndDispose();
  53. unit.RegistSendBuff(bt);
  54. }
  55. private void OnXmdsBuffHitEvent(BattleParams param)
  56. {
  57. //重新
  58. this.OnDoSkillHitProcess(ref param);
  59. }
  60. protected override void OnInitSkillParam()
  61. {
  62. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  63. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  64. }
  65. }
  66. }