1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using System;
- using static CommonAI.Zone.Instance.InstanceUnit;
- using XmdsCommon.Plugin;
- using CommonAI.Zone;
- using XmdsCommonServer.Plugin.Units;
- using CommonAI.Zone.Formula;
- using XmdsCommonSkill.Plugin.Skills;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- using XmdsCommonSkill.Plugin.Skills.Magic;
- using CommonLang;
- using CommonAI.Data;
- namespace XmdsCommonSkill.Plugin.PassiveSkills.Magic
- {
- /// <summary>
- /// 马车被动
- /// </summary>
- public class Other_100002 : XmdsPassiveSkillBase
- {
- /// 技能ID.
- public static int ID = 100002;
- private int mUUID_1;
- private int timePass = 0;
- private XmdsVirtual mOwner = null;
- public override int SkillID { get { return ID; } }
- protected override void OnInit(GameSkill skillInfo, XmdsVirtual owner)
- {
- this.mOwner = owner;
- mUUID_1 = owner.RegistOnHitDamage(OnHandleHitDmage, skillInfo, true);
- }
- private float OnHandleHitDmage(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
- ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
- {
- return 0;
- }
- protected override void OnUpdate(int intervalMS, bool slowRefresh)
- {
- base.OnUpdate(intervalMS, slowRefresh);
- this.timePass += intervalMS;
- if(this.timePass < 2000)
- {
- return;
- }
- this.timePass = 0;
- //队伍范围内找友军
- int alliesCount = 0, enemyCount = 0;
- base.GetNearUnitInfo(this.mOwner, 6, ref alliesCount, ref enemyCount);
- if(alliesCount > 0 && enemyCount == 0)
- {
- this.mOwner.MirrorProp.MoveSpeed = 1;
- this.mOwner.SycMoveSpeed();
- }
- else
- {
- this.mOwner.MirrorProp.MoveSpeed = 0;
- this.mOwner.SycMoveSpeed();
- }
- }
- protected override void OnDispose(XmdsVirtual owner)
- {
- owner.UnRegistOnHitDamage(mUUID_1);
- }
- }
- }
|