Remedy_510220.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.Plugin.XmdsSkillTemplate.DamageCalculator;
  8. using XmdsCommonServer.XLS.Data;
  9. using XmdsCommonSkill.Plugin.Buffs;
  10. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  11. {
  12. /// <summary>
  13. /// 治疗, 二技能 : 2-2(得到一个小护盾,持续3S,基于自身生命值系数()
  14. /// </summary>
  15. public class Remedy_510220 : Remedy_510210
  16. {
  17. private static readonly int ID = 510220;
  18. private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.REMEDY_2_2_HUDUN;
  19. public override int SkillID { get { return ID; } }
  20. // 护盾系数
  21. protected XmdsSkillValue valueSet3;
  22. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  23. {
  24. base.OnInit(info, unit, ref template);
  25. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  26. var Buff = pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.SHIELD_AbsorbDamage) as XmdsBuff_Shield_AbsorbDamage;
  27. Buff.AbsorbDamageSum = CUtils.CastInt(unit.MirrorProp.MaxHP * XmdsUnitProp.PER * valueSet3.GetValue(info.TalentSkillLevel2, 1));
  28. BuffTemplate bt = pack.mBuffTemplate;
  29. bt.IsHarmful = false;
  30. bt.LifeTimeMS = valueSet3.GetValue(info.TalentSkillLevel2, 2);
  31. pack.BindTemplateAndDispose();
  32. unit.RegistSendBuff(bt);
  33. }
  34. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  35. {
  36. base.OnSkillDataChange(gs, unit);
  37. var buff = unit.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_Shield_AbsorbDamage;
  38. buff.AbsorbDamageSum = CUtils.CastInt(unit.MirrorProp.MaxHP * XmdsUnitProp.PER * valueSet3.GetValue(gs.TalentSkillLevel2, 1));
  39. var bt = unit.GetRegistBuff(Buff_ID);
  40. bt.LifeTimeMS = valueSet3.GetValue(gs.TalentSkillLevel2, 2);
  41. }
  42. protected void AddHuDunBuff(BattleParams param)
  43. {
  44. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  45. }
  46. protected override void OnSkillLogicEvent(BattleParams param)
  47. {
  48. if (param.Attacker.IsAllies(param.Hitter, true, true) && !param.GameSkill.mHitUnits.ContainsKey(param.Hitter.mUnit.ID))
  49. {
  50. AddHpBuff(param);
  51. AddDefenceBuff(param);
  52. AddHuDunBuff(param);
  53. }
  54. }
  55. protected override void OnInitConfig()
  56. {
  57. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  58. base.InitBaseConfig(data);
  59. InitData(data, out buffTime, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  60. InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  61. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  62. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  63. }
  64. }
  65. }