Other_100002.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using CommonAI.Zone.Helper;
  2. using CommonAI.Zone.Instance;
  3. using XmdsCommonServer.Plugin;
  4. using XmdsCommonServer.XLS.Data;
  5. using XmdsCommonSkill.Plugin.Buffs;
  6. using System;
  7. using static CommonAI.Zone.Instance.InstanceUnit;
  8. using XmdsCommon.Plugin;
  9. using CommonAI.Zone;
  10. using XmdsCommonServer.Plugin.Units;
  11. using CommonAI.Zone.Formula;
  12. using XmdsCommonSkill.Plugin.Skills;
  13. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  14. using XmdsCommonSkill.Plugin.Skills.Magic;
  15. using CommonLang;
  16. using CommonAI.Data;
  17. namespace XmdsCommonSkill.Plugin.PassiveSkills.Magic
  18. {
  19. /// <summary>
  20. /// 马车被动
  21. /// </summary>
  22. public class Other_100002 : XmdsPassiveSkillBase
  23. {
  24. /// 技能ID.
  25. public static int ID = 100002;
  26. private int mUUID_1;
  27. private int timePass = 0;
  28. private XmdsVirtual mOwner = null;
  29. public override int SkillID { get { return ID; } }
  30. protected override void OnInit(GameSkill skillInfo, XmdsVirtual owner)
  31. {
  32. this.mOwner = owner;
  33. mUUID_1 = owner.RegistOnHitDamage(OnHandleHitDmage, skillInfo, true);
  34. }
  35. private float OnHandleHitDmage(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
  36. ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
  37. {
  38. return 0;
  39. }
  40. protected override void OnUpdate(int intervalMS, bool slowRefresh)
  41. {
  42. base.OnUpdate(intervalMS, slowRefresh);
  43. this.timePass += intervalMS;
  44. if(this.timePass < 2000)
  45. {
  46. return;
  47. }
  48. this.timePass = 0;
  49. //队伍范围内找友军
  50. int alliesCount = 0, enemyCount = 0;
  51. base.GetNearUnitInfo(this.mOwner, 6, ref alliesCount, ref enemyCount);
  52. if(alliesCount > 0 && enemyCount == 0)
  53. {
  54. this.mOwner.MirrorProp.MoveSpeed = 1;
  55. this.mOwner.SycMoveSpeed();
  56. }
  57. else
  58. {
  59. this.mOwner.MirrorProp.MoveSpeed = 0;
  60. this.mOwner.SycMoveSpeed();
  61. }
  62. }
  63. protected override void OnDispose(XmdsVirtual owner)
  64. {
  65. owner.UnRegistOnHitDamage(mUUID_1);
  66. }
  67. }
  68. }