Beispiel #1
0
 public void Chase(ActorController actor)
 {
     if (this.ForceFollow)
     {
         return;
     }
     if (this.targetMove == null)
     {
         this.targetMove = new MoveStateTarget(this.actorCtrler);
     }
     this.targetMove.SetTarget(actor, this.AttackDistance);
     this.SetMoveState(this.targetMove, 1);
 }
Beispiel #2
0
 protected void UpdateWarning(float elapse)
 {
     if (!this.EnableAI || this.warningFlag || this.Target == null || this.Target.IsDead || Globals.Instance.ActorMgr.IsPvpScene())
     {
         return;
     }
     this.threatTimer += elapse;
     if (this.threatTimer > 0.1f)
     {
         this.threatTimer = 0f;
         float distance2D = this.actorCtrler.GetDistance2D(this.Target);
         if (distance2D < this.AttackDistance * 2.5f && !this.Target.IsBox)
         {
             this.warningFlag = true;
             this.actorCtrler.UpdateSpeedScale(1f);
             if (distance2D > this.AttackDistance * 2f)
             {
                 this.actorCtrler.PlayAction("Skill/Tan", null);
                 if (this.targetMove == null)
                 {
                     this.targetMove = new MoveStateTarget(this.actorCtrler);
                 }
                 this.targetMove.Stop(1f);
                 Globals.Instance.ActorMgr.OnPlayerFindEnemy(this.Target);
             }
         }
     }
 }
Beispiel #3
0
 private void OnDestroy()
 {
     for (int i = 0; i < this.moveStates.Length; i++)
     {
         this.moveStates[i] = null;
     }
     this.idleMove = null;
     this.followMove = null;
     this.targetMove = null;
 }