Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // game loop
- while (true)
- {
- //...
- //target other enemy factories - offensive
- foreach (Factory factory in Factory.FriendlyFactories.Values)
- {
- Factory targetFactory = Link.GetTargetFactory(factory);
- if(targetFactory != null)
- {
- if (targetFactory.owner == -1 && !BombTargetedFactories.Contains(targetFactory) && Bomb.TurnsUntilBombHitsFactory(targetFactory) == -1) //here we check if the targetFactory is owned by the enemy, if we haven't targeted it already this turn, AND if we have targeted already in previous turns
- {
- BombTargetedFactories.Add(targetFactory);
- new Action(factory.id, targetFactory.id); //launch bomb on enemy factories only
- }
- if(factory.production == 0)
- {
- new Action(factory.id, targetFactory.id, targetFactory.finalNumberOfCyborgs + 1); //launch ships to target factory
- }
- else if(factory.production < 2)
- {
- new Action(factory);
- }
- else
- {
- new Action(factory.id, targetFactory.id, targetFactory.finalNumberOfCyborgs + 1); //launch ships to target factory here too
- }
- }
- }
- if(Action.Actions.Count() == 0){
- Console.WriteLine("WAIT");
- }else{
- StringBuilder builder = new StringBuilder();
- foreach(Action action in Action.Actions){
- builder.Append(action.ToString());
- }
- builder.Length--;
- Console.WriteLine(builder);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement