Remedy_510460.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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.XLS.Data;
  8. using XmdsCommonSkill.Plugin.Buffs;
  9. using XmdsCommonSkill.Plugin.PassiveSkills.Remedy;
  10. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  11. {
  12. /// <summary>
  13. /// 治疗, 四技能4-6(蔓延打到的敌人被埋下种子,得到一个DEBUFF,在3秒后释放一个相同的蔓延藤曼对周围被打到的人受到伤害并禁锢1s )
  14. /// </summary>
  15. public class Remedy_510460 : Remedy_510450
  16. {
  17. private static readonly int ID = 510460;
  18. private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.REMEDY_4_6_DEBUFF;
  19. private static readonly int Buff_JINGUEXT = (int)XmdsBuffBase.XmdsBuffList.REMEDY_4_6_JINGUEXT;
  20. public override int SkillID { get { return ID; } }
  21. //伤害系数,额外附加N层毒
  22. private XmdsSkillValue valueSet4;
  23. //扩展配置
  24. private XmdsSkillValue valueSet6; //延时藤蔓时间
  25. private XmdsSkillValue valueSet7; //二段禁锢
  26. //二段禁锢伤害信息, 命中人数
  27. public HashMap<uint, int> mHitUnitExt = new HashMap<uint, int>();
  28. //藤蔓再次释放debuff标记数量
  29. private int tengManDebuff = 0;
  30. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  31. {
  32. base.OnInit(info, unit, ref template);
  33. //禁锢二段禁锢buf
  34. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_JINGUEXT);
  35. BuffTemplate bt = pack.mBuffTemplate;
  36. bt.IsHarmful = true;
  37. bt.LifeTimeMS = valueSet7.GetValue(info.TalentSkillLevel3);
  38. pack.BindTemplateAndDispose();
  39. unit.RegistSendBuff(bt);
  40. // 延时藤蔓debuff
  41. var pack1 = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  42. var bt1 = pack1.mBuffTemplate;
  43. bt1.IsHarmful = true;
  44. bt1.LifeTimeMS = valueSet6.GetValue(info.TalentSkillLevel3);
  45. pack1.BindTemplateAndDispose();
  46. unit.RegistSendBuff(bt1);
  47. }
  48. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  49. {
  50. base.OnSkillDataChange(gs, unit);
  51. var bt1 = unit.GetRegistBuff(Buff_JINGUEXT);
  52. bt1.LifeTimeMS = valueSet7.GetValue(gs.TalentSkillLevel3);
  53. var bt2 = unit.GetRegistBuff(Buff_ID);
  54. bt2.LifeTimeMS = valueSet6.GetValue(gs.TalentSkillLevel3);
  55. }
  56. protected override bool OnSkillFinalDamageModifyEvent(BattleParams param)
  57. {
  58. //额外禁锢
  59. if (param.AtkProp.DamagePerID == 3)
  60. {
  61. if (mHitUnitExt.ContainsKey(param.Hitter.mUnit.ID))
  62. {
  63. return true;
  64. }
  65. mHitUnitExt.Put(param.Hitter.mUnit.ID, 1);
  66. //2段禁锢
  67. param.Hitter.mUnit.AddBuff(Buff_JINGUEXT, param.Attacker.mUnit);
  68. //额外附加N层毒
  69. PlayerCache_Remedy talnet = param.Attacker.GetPlayerCache() as PlayerCache_Remedy;
  70. if (talnet == null)
  71. {
  72. log.Warn("Remedy_510460叠毒找不到天赋:" + param.Attacker.mUnit.PlayerUUID + ", " + param.Attacker.mUnit.Parent.GetSceneID());
  73. }
  74. else if (talnet.IsCanAddPosion(param.Hitter))
  75. {
  76. param.Hitter.mUnit.AddBuff(Remedy_510601.Buff_POISON, param.Attacker.mUnit, 0, false, false, false, 0, valueSet4.GetValue(param.GameSkill.TalentSkillLevel3, 2));
  77. }
  78. return false;
  79. }
  80. else
  81. {
  82. return base.OnSkillFinalDamageModifyEvent(param); ;
  83. }
  84. }
  85. protected override int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
  86. {
  87. base.OnLaunchSkillOver(info, launcher, state);
  88. this.tengManDebuff = 0;
  89. this.mHitUnitExt.Clear();
  90. return 0;
  91. }
  92. protected override void OnSkillDamagePerEvent(BattleParams param)
  93. {
  94. if(param.AtkProp.DamagePerID == 3)
  95. {
  96. param.SkillDamagePer = valueSet4.GetValue(param.GameSkill.TalentSkillLevel3, 1);
  97. }
  98. else
  99. {
  100. base.OnSkillDamagePerEvent(param);
  101. }
  102. }
  103. protected override void OnSkillLogicEvent(BattleParams param)
  104. {
  105. base.OnSkillLogicEvent(param);
  106. //藤蔓延时标记
  107. if(param.AtkProp.DamagePerID == 1)
  108. {
  109. //最多标记三个
  110. if(param.Hitter.mUnit.GetBuffByID(Buff_ID) == null && this.tengManDebuff < 3)
  111. {
  112. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  113. this.tengManDebuff++;
  114. }
  115. }
  116. else if (param.AtkProp.DamagePerID == 3) //二段禁锢
  117. {
  118. }
  119. }
  120. protected override void OnInitConfig()
  121. {
  122. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  123. base.InitBaseConfig(data);
  124. InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  125. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  126. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  127. InitData(data, out valueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
  128. //扩展配置
  129. InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  130. InitData(data, out valueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  131. InitData(data, out valueSet7, XmdsSkillData.XmdsSkillDataKey.ValueSet7);
  132. InitData(data, out valueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  133. }
  134. }
  135. }