Esempio n. 1
0
        public static void CustomGoToDestination(this SebsFancyAntsClass ant, Item destItem)
        {
            var distance = Coordinate.GetDistanceBetween(ant, destItem);
            var angle    = Coordinate.GetDegreesBetween(ant, destItem);

            ant.TurnToDirection(angle);
            ant.GoForward(distance);
            ant.Dest = destItem;
        }
Esempio n. 2
0
        public static bool CustomGettingTired(this SebsFancyAntsClass ant)
        {
            if ((ant.Destination == null || ant.Destination is Bug) && (ant.Dest == null || ant.Dest is Bug || ant.Dest is Ant))
            {
                if (ant.Range / (ant.WalkedRange + 1) < 2)
                {
                    ant.Think($"I'm tired. Walking home now.");
                    ant.Stop();
                    ant.CustomGoToDestination(ant.Home);
                    return(true);
                }
            }

            return(false);
        }