コード例 #1
0
    public override void Do()
    {
        if (CloseToPosition(TargetMob.Position))
        {
            Finish();
            return;
        }

        SetVelocityVector();
        OwnerMob.MoveAndSlide(VelocityVector);
    }
コード例 #2
0
    public override void Do()
    {
        if (TargetMob.IsDead())
        {
            Finish();
            return;
        }

        if (TargetIsNotClose())
        {
            OwnerMob.AttackMob(TargetMob);
            return;
        }

        if (AttackTimer.IsStopped())
        {
            PerformAttack();
        }
    }
コード例 #3
0
    private Vector2 GetPathDirection()
    {
        if (Path == null)
        {
            SetNavigationPath();
        }

        if (Path == null)
        {
            OwnerMob.Log("Path is null after calculation");
        }

        while (Path.Count > 0)
        {
            if (CloseToPosition(Path[0]))
            {
                Path.RemoveAt(0);
                continue;
            }
            return(OwnerMob.Position.DirectionTo(Path[0]));
        }

        return(Vector2.Zero);
    }
コード例 #4
0
 public override void Finish()
 {
     Finished = true;
     OwnerMob.Log("finished moving to " + TargetMob.Name);
 }