Boss_90309.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Formula;
  3. using CommonAI.Zone.Helper;
  4. using CommonAI.Zone.Instance;
  5. using CommonLang;
  6. using XmdsCommon.Plugin;
  7. using XmdsCommonServer.Plugin;
  8. using XmdsCommonServer.XLS.Data;
  9. using XmdsCommonSkill.Plugin.Buffs;
  10. using XmdsCommonSkill.Plugin.PassiveSkills.Magic;
  11. using static CommonAI.Zone.Instance.InstanceUnit;
  12. namespace XmdsCommonSkill.Plugin.Skills.Boss
  13. {
  14. /// <summary>
  15. /// boss - 1 - 破军(对当前朝向线性范围内释放一次攻击,对命中目标造成伤害和破甲BUFF)
  16. /// </summary>
  17. public class Boss_90309 : XmdsSkillBase
  18. {
  19. private static int ID = 90309;
  20. private static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.BOSS_SUNDERARMOR;
  21. public static XmdsSkillValue dmgValue; // 伤害系数
  22. public static XmdsSkillValue valueSet1; // 减防系数
  23. public static XmdsSkillValue valueSet2; // buff时间
  24. public override int SkillID { get { return ID; } }
  25. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  26. {
  27. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  28. XmdsBuff_SunderArmor buff = (XmdsBuff_SunderArmor)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Sunder_Armor);
  29. buff.ChangeValue = -valueSet1.GetValue();
  30. BuffTemplate bt = pack.mBuffTemplate;
  31. bt.IsHarmful = false;
  32. bt.HitIntervalMS = valueSet2.GetValue();
  33. //bt.MaxOverlay = 3;
  34. pack.BindTemplateAndDispose();
  35. unit.RegistSendBuff(bt);
  36. }
  37. //伤害计算
  38. protected override void OnSkillDamagePerEvent(BattleParams param)
  39. {
  40. param.SkillDamagePer = dmgValue.GetValue();
  41. }
  42. private float OnHandleHitOther(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source, GameSkill sk, ref XmdsVirtual.AtkResult result)
  43. {
  44. // 流血
  45. var buff = attacker.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_Bleed;
  46. buff.ChangeValue = CUtils.CastInt(damage * 0.5);
  47. hitted.mUnit.AddBuff(Buff_ID, attacker.mUnit);
  48. return damage;
  49. }
  50. protected override void OnInitSkillParam()
  51. {
  52. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  53. InitData(data, out dmgValue, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  54. InitData(data, out valueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  55. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  56. }
  57. }
  58. }