bool CanBuildMoreOfAircraft(ActorInfo actorInfo)
        {
            var attackAircraftInfo = actorInfo.TraitInfoOrDefault <AttackAircraftInfo>();

            if (attackAircraftInfo == null)
            {
                return(true);
            }
            var numAirUnits = AIUtils.GetActorsWithTrait <AttackAircraft>(player.World).Count(a => a.Owner == player);

            return(numAirUnits < Info.MaxAircraft);
        }
예제 #2
0
        void IBotTick.BotTick(IBot bot)
        {
            var colonies = AIUtils.GetActorsWithTrait <Colony>(world).Where(c => c.Owner == player).ToArray();

            foreach (var colony in colonies)
            {
                var health = colony.Trait <IHealth>();
                if (health.DamageState == Info.DamageState)
                {
                    colony.Trait <Colony>().CancelProductions(colony);
                }
            }
        }
예제 #3
0
        void IBotTick.BotTick(IBot bot)
        {
            var colonies = AIUtils.GetActorsWithTrait <Colony>(world).Where(c => c.Owner == player).ToArray();

            foreach (var colony in colonies)
            {
                var health = colony.Trait <IHealth>();
                if (health.DamageState == Info.DamageState)
                {
                    var queue = colony.TraitOrDefault <ProductionQueue>();                    // Turrets don't produce
                    if (queue == null)
                    {
                        continue;
                    }

                    foreach (var current in queue.AllQueued())
                    {
                        bot.QueueOrder(Order.CancelProduction(queue.Actor, current.Item, 1));
                        AIUtils.BotDebug("{0}: Stopping production of {1} at {2} to heal.".F(player.PlayerName, current.Item, colony));
                    }
                }
            }
        }