1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using CommonAI.Zone;
- using CommonAI.Zone.Instance;
- namespace XmdsCommonServer.Plugin.Units
- {
- /// <summary>
- /// 召唤单位,目前召唤单位AI与宠物相同,先继承自宠物.
- /// </summary>
- public class XmdsInstanceSummonUnit : XmdsInstancePet //InstanceGuard, ViewTrigger.ViewTriggerListener, ISummonedUnit
- {
- public override bool IntersectObj { get { return false; } }
- public XmdsInstanceSummonUnit(InstanceZone zone, UnitInfo info, string name, int force, int level)
- : base(zone, info, name, force, level)
- {
- }
- public InstanceUnit BindUnit { get; set; }
- protected override void onAdded(bool pointLv)
- {
- base.onAdded(pointLv);
- if(this.Info.SumType == CommonAI.Data.SummonType.attack)
- {
- base.SetFollowMode(XmdsCommon.Plugin.XmdsPetConifg.XmdsPetFollowMode.ActiveAtk);
- }
- }
- override protected void onUpdate(bool slowRefresh)
- {
- base.onUpdate(slowRefresh);
- if (BindUnit != null)
- {
- if (X != BindUnit.X || Y != BindUnit.Y)
- {
- setPos(BindUnit.X, BindUnit.Y, false);
- }
- }
- if ((PassTimeMS >= Info.LifeTimeMS) || (SummonerUnit != null && !SummonerUnit.IsActive))
- {
- kill(null, false);
- }
- }
- public override void InitSkills(LaunchSkill baseSkill, params LaunchSkill[] skills)
- {
- if (this.Virtual == null ||
- (this.Virtual as XmdsVirtual).IsFinishSkillInit() == false)
- {
- return;
- }
- base.InitSkills(baseSkill, skills);
- }
- // 各种填坑,宠物机制被改的贼特殊,贼恶心
- protected override bool IsCanAttack(InstanceUnit unit) { return true; }
- public override bool IsPet { get { return false; } }
- protected override bool IsPetCanAttack() { return true; }
- protected override void followMasterChangeSpeed(float speedChag) { }
- protected override bool CheckFollowMaster()
- {
- if(this.Info.SumType == CommonAI.Data.SummonType.MoveToMaster || this.Info.SumType == CommonAI.Data.SummonType.AwaitMaster)
- {
- return false;
- }
- return true;
- }
- protected override void Disposing()
- {
- BindUnit = null;
- base.Disposing();
- }
- }
- }
|