Exemplo n.º 1
0
        public void Flee(Point2D retreatFrom, Point2D retreatTo)
        {
            PotentialHelper potential = new PotentialHelper(Unit.Pos, 4);

            potential.From(retreatFrom);
            potential.To(retreatTo);
            Order(Abilities.MOVE, potential.Get());
        }
Exemplo n.º 2
0
        public Point2D From(Point2D target, float magnitude)
        {
            PotentialHelper helper = new PotentialHelper(Unit.Pos);

            helper.Magnitude = magnitude;
            helper.From(target);
            return(helper.Get());
        }
Exemplo n.º 3
0
        public void Flee(Point2D retreatFrom)
        {
            PotentialHelper potential = new PotentialHelper(Unit.Pos, 4);

            potential.From(retreatFrom);
            Point2D fleeTo;

            if (Unit.IsFlying)
            {
                fleeTo = SC2Util.To2D(Tyr.Bot.MapAnalyzer.StartLocation);
            }
            else
            {
                fleeTo = Tyr.Bot.MapAnalyzer.Walk(SC2Util.To2D(Unit.Pos), Tyr.Bot.MapAnalyzer.MainDistances, 6);
            }
            potential.To(fleeTo);
            Order(Abilities.MOVE, potential.Get());
        }