Remedy_510240.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.XLS.Data;
  7. using XmdsCommonSkill.Plugin.Buffs;
  8. using static CommonAI.Zone.Instance.InstanceUnit;
  9. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  10. {
  11. /// <summary>
  12. /// 治疗, 二技能: 2-4(队友在受到治疗 S时间内,增加自身攻击力X)
  13. /// </summary>
  14. public class Remedy_510240 : Remedy_510200
  15. {
  16. private static readonly int ID = 510240;
  17. private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.REMEDY_2_4_ATTACKUP;
  18. public override int SkillID { get { return ID; } }
  19. // 伤害提升系数
  20. protected XmdsSkillValue valueSet2;
  21. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  22. {
  23. base.OnInit(info, unit, ref template);
  24. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  25. var buff = (XmdsBuff_PropChange)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.PropChange);
  26. buff.IsPercent = true;
  27. buff.CurentChangeType = XmdsVirtual.UnitAttributeType.Attack;
  28. buff.CurrentValue = valueSet2.GetValue(info.TalentSkillLevel1, 1);
  29. BuffTemplate bt = pack.mBuffTemplate;
  30. bt.IsHarmful = false;
  31. bt.LifeTimeMS = valueSet2.GetValue(info.TalentSkillLevel1, 2);
  32. pack.BindTemplateAndDispose();
  33. unit.RegistSendBuff(bt);
  34. }
  35. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  36. {
  37. base.OnSkillDataChange(gs, unit);
  38. var buff = unit.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_PropChange;
  39. buff.CurrentValue = valueSet2.GetValue(gs.TalentSkillLevel1, 1);
  40. var bt = unit.GetRegistBuff(Buff_ID);
  41. bt.LifeTimeMS = valueSet2.GetValue(gs.TalentSkillLevel1, 2);
  42. }
  43. protected override void OnSkillLogicEvent(BattleParams param)
  44. {
  45. if (param.Attacker.IsAllies(param.Hitter, true, true) && !param.GameSkill.mHitUnits.ContainsKey(param.Hitter.mUnit.ID))
  46. {
  47. AddHpBuff(param);
  48. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  49. }
  50. }
  51. protected override void OnInitConfig()
  52. {
  53. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  54. base.InitBaseConfig(data);
  55. InitData(data, out buffTime, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  56. InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  57. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  58. }
  59. }
  60. }