Remedy_510130.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.Skills;
  7. using XmdsCommonServer.XLS.Data;
  8. using XmdsCommonSkill.Plugin.Interface;
  9. using static XmdsCommonSkill.Plugin.Interface.ComSpellTemplate;
  10. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  11. {
  12. /// <summary>
  13. /// 治疗【1】技能 1 - 3(扇子在打到第一个敌人后会分生成5个扇子,扇形向前,飞出剩余相同距离,(每个扇子伤害独立,最多叠加3个扇子的伤害,恢复唯一,不重复累加))
  14. /// </summary>
  15. public class Remedy_510130 : Remedy_510120
  16. {
  17. private static readonly int ID = 510130;
  18. public override int SkillID { get { return ID; } }
  19. //伤害系数
  20. protected XmdsSkillValue valueSet4;
  21. //扩展配置
  22. protected XmdsSkillValue valueSet7; //最多被扇子击中N次
  23. //触发分裂伞的单位,不应该被分裂山击中
  24. private uint mIngoreUnit;
  25. protected override void OnSkillDamagePerEvent(BattleParams param)
  26. {
  27. if(param.AtkProp.DamagePerID == 0)
  28. {
  29. base.OnSkillDamagePerEvent(param);
  30. }
  31. else
  32. {
  33. //if(this.mIngoreUnit == param.Hitter.mUnit.ID)
  34. //{
  35. // param.SkillDamagePer = 0;
  36. // param.UseDamageType = CommonAI.Data.DamageType.None;
  37. //}
  38. //else
  39. {
  40. int count = param.GameSkill.mHitUnits.Get(param.Hitter.mUnit.ID);
  41. if (count > valueSet7.GetValue(param.GameSkill.TalentSkillLevel3))
  42. {
  43. param.SkillDamagePer = 0;
  44. param.UseDamageType = CommonAI.Data.DamageType.None;
  45. }
  46. else
  47. {
  48. param.SkillDamagePer = valueSet4.GetValue(param.GameSkill.TalentSkillLevel3);
  49. }
  50. param.GameSkill.mHitUnits.Put(param.Hitter.mUnit.ID, count + 1);
  51. }
  52. }
  53. }
  54. protected override int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
  55. {
  56. base.OnLaunchSkillOver(info, launcher, state);
  57. this.mIngoreUnit = 0;
  58. return 0;
  59. }
  60. protected override void OnSkillLogicEvent(BattleParams param)
  61. {
  62. base.OnSkillLogicEvent(param);
  63. //第一次打击到敌人,创建法术, 而且是强依赖编辑器
  64. if (this.mIngoreUnit == 0 && !param.Attacker.IsAllies(param.Hitter, false))
  65. {
  66. this.mIngoreUnit = param.Hitter.mUnit.ID;
  67. float pointDirection = 0;
  68. if (param.Source.FromSpellUnit != null)
  69. {
  70. param.Source.FromSpellUnit.Parent.RemoveObject(param.Source.FromSpellUnit);
  71. pointDirection = param.Source.FromSpellUnit.Direction;
  72. }
  73. param.Attacker.mUnit.Parent.unitLaunchSpell(param.GameSkill.SkillType, param.Attacker.mUnit,
  74. ComSpellTemplate.Instance().GetSpellByID(XmdsSpellID.SPLIT_FAN), param.Hitter.mUnit.X, param.Hitter.mUnit.Y,
  75. param.Hitter.mUnit.ID, null, -1, 0, pointDirection);
  76. }
  77. }
  78. protected override void OnInitConfig()
  79. {
  80. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  81. base.InitBaseConfig(data);
  82. InitData(data, out valueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  83. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  84. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  85. InitData(data, out valueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
  86. //扩展配置
  87. InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  88. InitData(data, out valueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  89. InitData(data, out valueSet7, XmdsSkillData.XmdsSkillDataKey.ValueSet7);
  90. }
  91. }
  92. }