Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Pirates;
- namespace MyBot
- {
- /// <summary>
- /// This is an example for a bot.
- /// </summary>
- public class TutorialBot : IPirateBot
- {
- /// <summary>
- /// Makes the bot run a single turn
- /// </summary>
- /// <param name="game">the current game state</param>
- public void DoTurn(PirateGame game)
- {
- Pirate[] good = game.GetMyLivingPirates();
- Pirate[] enemy = game.GetEnemyLivingPirates();
- Capsule[] gcapsule = game.GetMyCapsules();
- Capsule[] ecapsule = game.GetEnemyCapsules();
- Mothership[] gmother = game.GetMyMotherships();
- Mothership[] emother = game.GetEnemyMotherships();
- Asteroid[] asteroid = game.GetLivingAsteroids();
- Pirate[] gooda = game.GetAllMyPirates();
- Wormhole[] allworm = game.GetAllWormholes();
- Pirate[] heavies = game.GetAllMyPirates();
- System.Console.WriteLine(game.GetEnemy().BotName);
- int count2 = 0;
- int checker = 0;
- int count = 0;
- int check = 0;
- int amount = 0;
- if (enemy.Length > 0)
- {
- for (int m = 0; m < enemy.Length; m++)
- {
- if (enemy[m].HasCapsule())
- {
- count++;
- }
- }
- }
- Pirate[] enemyhas = new Pirate[count];
- count = 0;
- if (enemy.Length > 0)
- {
- for (int m = 0; m < enemy.Length; m++)
- {
- if (enemy[m].HasCapsule())
- {
- enemyhas[count] = enemy[m];
- count++;
- }
- }
- }
- for (int m = 0; m < good.Length; m++)
- {
- if (good[m].StateName == "heavy")
- {
- heavies[count2] = good[m];
- count2++;
- }
- }
- foreach (Pirate good4 in game.GetAllMyPirates())
- {
- if (good4.StateName == "heavy")
- amount++;
- }
- if (game.GetEnemy().BotName == "25235")
- {
- if (good.Length > 0)
- {
- if (good[0].Capsule == null)
- {
- if (game.Turn > 17 && game.Turn <= 22)
- good[0].Sail(asteroid[3]);
- else
- good[0].Sail(gcapsule[0]);
- }
- else
- good[0].Sail(gmother[0]);
- }
- }
- if (game.GetEnemy().BotName == "25239")
- {
- if (!TryPush(good[0], game))
- {
- if (good[0].Capsule == null)
- {
- if (gooda[0].Distance(allworm[0]) <= 1000)
- gooda[0].Sail(allworm[0]);
- else
- good[0].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- if (gooda[0].Distance(allworm[1]) <= 1000)
- gooda[0].Sail(allworm[1]);
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- }
- if (game.GetEnemy().BotName == "25238")
- {
- if (gooda[0].HasCapsule() == false)
- {
- if (gooda[0].GetLocation().Distance(gmother[0].GetLocation()) < 1000)
- {
- if (!TryPushworm(gooda[0], game))
- gooda[0].Sail(allworm[2]);
- }
- else
- {
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- }
- else
- {
- if (gooda[0].GetLocation().Distance(gcapsule[0].InitialLocation) < 1000)
- {
- if (!TryPushworm2(gooda[0], game))
- gooda[0].Sail(allworm[3]);
- }
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- }
- if (game.GetEnemy().BotName == "25236")
- {
- if (good.Length > 0)
- {
- if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
- {
- if (gooda[2].IsAlive() == true && gooda[0].IsAlive() == true)
- gooda[1].Sail(gooda[0]);
- if (gooda[2].IsAlive() == false && gooda[0].IsAlive() == true)
- gooda[1].Sail(gooda[0]);
- if (gooda[2].IsAlive() == true && gooda[0].IsAlive() == false)
- gooda[1].Sail(gooda[2]);
- if (gooda[2].IsAlive() == false && gooda[0].IsAlive() == false)
- gooda[1].Sail(gooda[0].InitialLocation);
- if (!TryPushaste(gooda[0], game))
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
- {
- if (!TryPushaste(gooda[0], game))
- gooda[0].Sail(gmother[0]);
- gooda[2].Sail(gcapsule[0].InitialLocation);
- if (!TryPush2(gooda[1], game))
- gooda[1].Sail(gooda[0]);
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
- {
- gooda[0].Sail(gcapsule[0].InitialLocation);
- if (!TryPushaste(gooda[2], game))
- gooda[2].Sail(gmother[0]);
- if (!TryPush3(gooda[1], game))
- gooda[1].Sail(gooda[2]);
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
- {
- if (!TryPushaste(gooda[0], game))
- gooda[0].Sail(gmother[0]);
- if (!TryPushaste(gooda[2], game))
- gooda[2].Sail(gmother[0]);
- if (!TryPush2(gooda[1], game))
- gooda[1].Sail(gooda[0]);
- }
- if (gooda.Length > 3)
- {
- for (int m = 3; m < gooda.Length - 2; m++)
- {
- if (enemyhas.Length == 0)
- gooda[m].Sail(emother[0]);
- if (enemyhas.Length == 1)
- {
- if (emother[0].GetLocation().Distance(enemyhas[0]) <= 4200)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- if (emother[0].GetLocation().Distance(enemyhas[0]) > 4200)
- gooda[m].Sail(emother[0]);
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- }
- }
- for (int m = 5; m < gooda.Length; m++)
- {
- if (enemyhas.Length == 0)
- gooda[m].Sail(emother[0]);
- if (enemyhas.Length == 1)
- {
- if (emother[0].GetLocation().Distance(enemyhas[0]) <= 2000)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- if (emother[0].GetLocation().Distance(enemyhas[0]) > 2000)
- gooda[m].Sail(emother[0]);
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- }
- }
- }
- if (game.GetEnemy().BotName == "25241")
- {
- if (gooda[0].HasCapsule() == false)
- {
- if (gooda[0].GetLocation().Distance(gmother[0].GetLocation()) < 1000)
- {
- gooda[0].Sail(allworm[5]);
- }
- if (gooda[0].GetLocation().Distance(allworm[3].GetLocation()) < 1400)
- {
- gooda[0].Sail(allworm[5]);
- }
- if (gooda[0].GetLocation().Distance(allworm[1].GetLocation()) < 1400)
- {
- gooda[0].Sail(allworm[1]);
- }
- if (gooda[0].GetLocation().Distance(allworm[1].GetLocation()) > 1400 && gooda[0].GetLocation().Distance(allworm[3].GetLocation()) > 1400 && gooda[0].GetLocation().Distance(gmother[0].GetLocation()) > 1000)
- {
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- }
- else
- {
- if (gooda[0].GetLocation().Distance(gcapsule[0].InitialLocation) < 1000)
- {
- gooda[0].Sail(allworm[0]);
- }
- if (gooda[0].GetLocation().Distance(allworm[2].GetLocation()) < 1500)
- {
- gooda[0].Sail(allworm[2]);
- }
- if (gooda[0].GetLocation().Distance(allworm[4].GetLocation()) < 1400)
- {
- gooda[0].Sail(allworm[4]);
- }
- if (gooda[0].GetLocation().Distance(allworm[4].GetLocation()) > 1400 && gooda[0].GetLocation().Distance(allworm[2].GetLocation()) > 1500 && gooda[0].GetLocation().Distance(gcapsule[0].InitialLocation) > 1000)
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- }
- if (game.GetEnemy().BotName == "25186")
- {
- if (good.Length > 0)
- if (good[0].CanPush(enemy[0]))
- good[0].Push(enemy[0], new Location(3191, 1567));
- }
- if (game.GetEnemy().BotName == "25772")
- {
- if (gooda[0].StateName == "heavy")
- gooda[0].SwapStates(gooda[1]);
- else
- {
- if (gooda.Length > 0)
- {
- if (gooda[0].Capsule == null)
- {
- good[0].Sail(gcapsule[0]);
- }
- else
- good[0].Sail(gmother[0]);
- }
- if (!TryPush2(gooda[1], game))
- gooda[1].Sail(gooda[0]);
- if (!TryPush2(gooda[2], game))
- gooda[2].Sail(gooda[0]);
- }
- }
- if (game.GetEnemy().BotName == "25770")
- {
- if (!TryPush2pullpushon(gooda[1], game))
- gooda[1].Sail(new Location(2031, 1300));
- if (!TryPush2(gooda[2], game))
- gooda[2].Sail(new Location(1435, 1575));
- if (!TryPushaste(gooda[0], game))
- {
- if (gooda[0].Capsule == null)
- {
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- for (int m = 2; m < 4; m++)
- {
- if (!TryPushaste(gooda[m], game))
- {
- if (gooda[m].Capsule == null)
- {
- gooda[m].Sail(gcapsule[1].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- gooda[m].Sail(gmother[0]);
- }
- }
- }
- if (gooda.Length > 3)
- {
- for (int m = 5; m < gooda.Length - 2; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- gooda[m].Sail(new Location(2080, 4329));
- }
- }
- }
- for (int m = 7; m < gooda.Length; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- gooda[m].Sail(new Location(2080, 2871));
- }
- }
- }
- if (game.GetEnemy().BotName == "25767")
- {
- for (int m = 0; m < 3; m++)
- if (!TryPushcapsule4(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(new Location(3000, 3514));
- else
- gooda[m].Sail(new Location(3362, 3514));
- }
- for (int m = 3; m < 6; m++)
- if (!TryPushcapsule4(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(new Location(3105, 2886));
- else
- gooda[m].Sail(new Location(3360, 2886));
- }
- }
- if (game.GetEnemy().BotName == "25773")
- {
- if (!TryPush(gooda[3], game))
- {
- if (gooda[3].Capsule == null)
- {
- gooda[3].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- gooda[3].Sail(gmother[0]);
- }
- }
- for (int m = 0; m < 2; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(ecapsule[0].InitialLocation);
- }
- if (!TryPushcapsule(gooda[2], game))
- gooda[2].Sail(emother[0]);
- if (!TryPushcapsule(gooda[4], game))
- gooda[4].Sail(emother[0]);
- }
- if (game.GetEnemy().BotName == "25771")
- {
- if (gooda.Length > 0)
- {
- if (!TryPushcapsuleattack(gooda[0], game))
- {
- if (gooda[0].Capsule == null)
- {
- gooda[0].Sail(gcapsule[0]);
- }
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- for (int m = 3; m < 6; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 200));
- }
- for (int m = 1; m < 3; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[1], 200));
- }
- }
- }
- if (game.GetEnemy().BotName == "25774")
- {
- if (!TryPush4ForBot(gooda[7], game))
- gooda[7].Sail(gmother[0].GetLocation().Towards(gcapsule[0].InitialLocation, 800));
- if (!TryPushcapsuleattack(gooda[6], game))
- {
- if (gooda[6].Capsule == null)
- {
- gooda[6].Sail(gcapsule[0].InitialLocation);
- }
- else
- {
- gooda[6].Sail(gmother[0]);
- }
- }
- if (!TryPushcapsuleattack(gooda[4], game))
- {
- if (gooda[4].Capsule == null)
- {
- gooda[4].Sail(gcapsule[0].InitialLocation);
- }
- else
- {
- gooda[4].Sail(gmother[0]);
- }
- }
- for (int m = 0; m < 6; m++)
- if (m != 4)
- {
- if (!TryPushcapsuleattack(gooda[m], game))
- {
- if (game.GetAllEnemyPirates()[1].IsAlive())
- gooda[m].Sail(game.GetAllEnemyPirates()[1]);
- else
- if (game.GetAllEnemyPirates()[9].IsAlive())
- gooda[m].Sail(game.GetAllEnemyPirates()[9]);
- }
- }
- }
- if (game.GetEnemy().BotName == "260269")
- {
- if (game.GetMyself().TurnsToStickyBomb == 0 && gooda[0].InStickBombRange(enemy[1]))
- {
- gooda[0].StickBomb(enemy[1]);
- }
- }
- if (game.GetEnemy().BotName == "26070")
- {
- if (enemy.Length > 0)
- {
- if (allworm.Length > 0)
- {
- if (gooda.Length > 7)
- if (!TryPushcapsuleBotWorm(gooda[7], game))
- gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- if (gooda.Length > 1)
- {
- if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
- {
- if (!TryPushcapsuleBotWorm(gooda[1], game))
- gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- }
- else
- {
- if (!TryPushcapsuleBotWorm2(gooda[1], game))
- gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
- }
- }
- }
- for (int m = 10; m < 14; m++)
- {
- if (gooda[m].HasCapsule() == false)
- {
- if (allworm.Length > 0)
- {
- if ((gooda[m].Distance(allworm[0].Partner) + gcapsule[0].InitialLocation.Distance(allworm[0]) < gooda[m].Distance(gcapsule[1].InitialLocation)) && gooda[m].Distance(gmother[0]) < 3000)
- gooda[m].Sail(allworm[0]);
- else
- gooda[m].Sail(gcapsule[0].InitialLocation);
- }
- else
- if (!TryPush(gooda[m], game))
- gooda[m].Sail(gcapsule[0].InitialLocation);
- }
- if (gooda[m].HasCapsule() == true)
- {
- int sucheck = 0;
- if (!TryPushaste(gooda[m], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[m].Distance(gmother[0]) > gooda[m].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[m].Sail(allworm[0].Partner);
- else
- {
- gooda[m].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[m].Sail(gmother[0]);
- }
- }
- }
- }
- if (gooda[0].HasCapsule() == false)
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(allworm[0].Partner) + gcapsule[0].InitialLocation.Distance(allworm[0]) < gooda[0].Distance(gcapsule[1].InitialLocation)) && gooda[0].Distance(gmother[0]) < 3000)
- gooda[0].Sail(allworm[0]);
- else
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- else
- if (!TryPush(gooda[0], game))
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- if (gooda[0].HasCapsule() == true)
- {
- int sucheck = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- }
- if (gooda.Length > 2)
- {
- int m = 2;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- if (gooda.Length > 3)
- {
- int m = 3;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- if (gooda.Length > 4)
- {
- int m = 4;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- //if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- System.Console.WriteLine(enemy[0].PushRange);
- if (gooda.Length > 5)
- {
- int m = 5;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- if (gooda.Length > 6)
- {
- int m = 6;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 8)
- {
- int m = 8;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 9)
- {
- int m = 9;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- }
- if (game.GetEnemy().BotName == "26068")
- {
- {
- if (allworm.Length > 0)
- {
- if (gooda.Length > 7)
- if (!TryPushcapsuleBotWorm(gooda[7], game))
- gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- if (gooda.Length > 1)
- {
- if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
- {
- if (!TryPushcapsuleBotWorm(gooda[1], game))
- gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- }
- else
- {
- if (!TryPushcapsuleBotWorm2(gooda[1], game))
- gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
- }
- }
- }
- if (gooda.Length > 2)
- {
- if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
- {
- if (!TryPush(gooda[0], game))
- gooda[0].Sail(gcapsule[0].InitialLocation);
- if (!TryPush(gooda[2], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[2].Distance(allworm[0].Partner) + gcapsule[1].InitialLocation.Distance(allworm[0]) < gooda[2].Distance(gcapsule[1].InitialLocation)) && gooda[2].Distance(gmother[0]) < 3000)
- gooda[2].Sail(allworm[0]);
- else
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- else
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- }
- if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
- {
- int sucheck = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- if (gooda[0].Distance(gmother[0]) <= 2000)
- {
- if (gooda[0].StateName != "heavy")
- {
- foreach (Pirate good2 in game.GetMyLivingPirates())
- {
- if (gooda[0].StateName != "heavy")
- {
- if (good2.StateName == "heavy" && sucheck == 0)
- {
- gooda[0].SwapStates(good2);
- sucheck = 1;
- }
- }
- }
- }
- if (sucheck == 0 && gooda[0].StateName == "heavy")
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- if (gooda[0].Distance(gmother[0]) <= 2000)
- {
- if (gooda[0].StateName != "heavy")
- {
- foreach (Pirate good2 in game.GetMyLivingPirates())
- {
- if (gooda[0].StateName != "heavy")
- {
- if (good2.StateName == "heavy" && sucheck == 0)
- {
- gooda[0].SwapStates(good2);
- sucheck = 1;
- }
- }
- }
- }
- if (sucheck == 0 && gooda[0].StateName == "heavy")
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- if (!TryPushcapsuleattack(gooda[2], game))
- {
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
- {
- int checker2 = 0;
- gooda[0].Sail(gcapsule[0].InitialLocation);
- if (!TryPushcapsuleattack2(gooda[2], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[2].Distance(gmother[0]) >= gooda[2].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[2].Sail(allworm[0].Partner);
- else
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- {
- if (gooda[2].Distance(gmother[0]) <= 2000)
- {
- if (gooda[2].StateName != "heavy")
- {
- for (int m = 1; m < gooda.Length; m++)
- {
- if (gooda[2].StateName != "heavy")
- {
- if (gooda[m].StateName == "heavy" && checker2 == 0)
- {
- gooda[2].SwapStates(gooda[m]);
- checker2 = 1;
- }
- }
- }
- }
- if (checker2 == 0 && gooda[2].StateName == "heavy")
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- }
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
- {
- int checker3 = 0;
- int checker4 = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- if (gooda[0].Distance(gmother[0]) <= 2000)
- {
- if (gooda[0].StateName != "heavy")
- {
- foreach (Pirate good2 in game.GetMyLivingPirates())
- {
- if (gooda[0].StateName != "heavy")
- {
- if (good2.StateName == "heavy" && checker3 == 0)
- {
- gooda[0].SwapStates(good2);
- checker3 = 1;
- }
- }
- }
- }
- if (checker3 == 0 && gooda[0].StateName == "heavy")
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- if (gooda[0].Distance(gmother[0]) <= 2000)
- {
- if (gooda[0].StateName != "heavy")
- {
- foreach (Pirate good2 in game.GetMyLivingPirates())
- {
- if (gooda[0].StateName != "heavy")
- {
- if (good2.StateName == "heavy" && checker3 == 0)
- {
- gooda[0].SwapStates(good2);
- checker3 = 1;
- }
- }
- }
- }
- if (checker3 == 0 && gooda[0].StateName == "heavy")
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- if (!TryPushcapsuleattack2(gooda[2], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[2].Sail(allworm[0].Partner);
- else
- {
- if (gooda[2].Distance(gmother[0]) <= 2000)
- {
- if (gooda[2].StateName != "heavy")
- {
- for (int m = 1; m < gooda.Length; m++)
- {
- if (gooda[2].StateName != "heavy")
- {
- if (gooda[m].StateName == "heavy" && checker4 == 0)
- {
- gooda[2].SwapStates(gooda[m]);
- checker4 = 1;
- }
- }
- }
- }
- if (checker4 == 0 && gooda[2].StateName == "heavy")
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- {
- if (gooda[2].Distance(gmother[0]) <= 2000)
- {
- if (gooda[2].StateName != "heavy")
- {
- for (int m = 1; m < gooda.Length; m++)
- {
- if (gooda[2].StateName != "heavy")
- {
- if (gooda[m].StateName == "heavy" && checker4 == 0)
- {
- gooda[2].SwapStates(gooda[m]);
- checker4 = 1;
- }
- }
- }
- }
- if (checker4 == 0 && gooda[2].StateName == "heavy")
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- }
- }
- }
- if (gooda.Length > 3)
- {
- int m = 3;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- if (gooda.Length > 4)
- {
- int m = 4;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- //if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- System.Console.WriteLine(enemy[0].PushRange);
- if (gooda.Length > 5)
- {
- int m = 5;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- if (gooda.Length > 6)
- {
- int m = 6;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 8)
- {
- int m = 8;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 9)
- {
- int m = 9;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- }
- if (game.GetEnemy().BotName == "26067")
- {
- if (gooda.Length > 2)
- {
- if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
- {
- gooda[0].Sail(gcapsule[0].InitialLocation);
- if (allworm.Length > 0)
- {
- if ((gooda[2].Distance(allworm[0].Partner) + gcapsule[1].InitialLocation.Distance(allworm[0]) < gooda[2].Distance(gcapsule[1].InitialLocation)) && gooda[2].Distance(gmother[0]) < 3000)
- gooda[2].Sail(allworm[0]);
- else
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- else
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
- {
- int sucheck = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
- {
- int checker2 = 0;
- gooda[0].Sail(gcapsule[0].InitialLocation);
- if (allworm.Length > 0)
- {
- if ((gooda[2].Distance(gmother[0]) >= gooda[2].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[2].Sail(allworm[0].Partner);
- else
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- for (int m = 3; m < 6; m++)
- {
- if (good.Length > 0)
- {
- if (gooda[m].Capsule == null)
- {
- gooda[m].Sail(gcapsule[0]);
- }
- else
- gooda[m].Sail(gmother[0]);
- }
- }
- if (good.Length > 0)
- {
- if (gooda[0].Capsule == null)
- {
- gooda[0].Sail(gcapsule[0]);
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
- {
- int checker3 = 0;
- int checker4 = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[2].Sail(allworm[0].Partner);
- else
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- }
- }
- if (game.GetEnemy().BotName != "26067" && game.GetEnemy().BotName != "26068" && game.GetEnemy().BotName != "26070" && game.GetEnemy().BotName != "26069" && game.GetEnemy().BotName != "25774" && game.GetEnemy().BotName != "25768" && game.GetEnemy().BotName != "25771" && game.GetEnemy().BotName != "25773" && game.GetEnemy().BotName != "25767" && game.GetEnemy().BotName != "25770" && game.GetEnemy().BotName != "25766" && game.GetEnemy().BotName != "25772" && game.GetEnemy().BotName != "25237" && game.GetEnemy().BotName != "25242" && game.GetEnemy().BotName != "25235" && game.GetEnemy().BotName != "25239" && game.GetEnemy().BotName != "25236" && game.GetEnemy().BotName != "25241" && game.GetEnemy().BotName != "25189" && game.GetEnemy().BotName != "25190" && game.GetEnemy().BotName != "25191" && game.GetEnemy().BotName != "25192" && game.GetEnemy().BotName != "25188" && game.GetEnemy().BotName != "25187" && game.GetEnemy().BotName != "25238" && game.GetEnemy().BotName != "25184" && game.GetEnemy().BotName != "25185" && game.GetEnemy().BotName != "25186")
- {
- if (enemy.Length > 0)
- {
- if (good.Length > 0)
- {
- if (amount > 0)
- {
- if (gcapsule.Length > 1)
- {
- if (allworm.Length > 0)
- {
- if (gooda.Length > 7)
- if (!TryPushcapsuleBotWorm(gooda[7], game))
- gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- if (gooda.Length > 1)
- {
- if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
- {
- if (!TryPushcapsuleBotWorm(gooda[1], game))
- gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- }
- else
- {
- if (!TryPushcapsuleBotWorm2(gooda[1], game))
- gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
- }
- }
- }
- if (gooda.Length > 2)
- {
- if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
- {
- if (!TryPushaste(gooda[0], game))
- {
- if (gooda[0].StateName == "heavy")
- gooda[0].SwapStates(gooda[1]);
- else
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- if (!TryPush(gooda[2], game))
- {
- if (gooda[2].StateName == "heavy")
- {
- gooda[2].SwapStates(gooda[1]);
- }
- else
- {
- if (allworm.Length > 0)
- {
- if ((gooda[2].Distance(allworm[0].Partner) + gcapsule[1].InitialLocation.Distance(allworm[0]) < gooda[2].Distance(gcapsule[1].InitialLocation)) && gooda[2].Distance(gmother[0]) < 3000)
- gooda[2].Sail(allworm[0]);
- else
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- else
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- }
- }
- if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
- {
- int sucheck = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- if (heavies.Length > 0)
- {
- if (stuckenemies(gooda[0], game))
- {
- if (gooda[0].StateName != "heavy")
- {
- foreach (Pirate good2 in game.GetMyLivingPirates())
- {
- if (gooda[0].StateName != "heavy")
- {
- if (good2.StateName == "heavy" && sucheck == 0)
- {
- gooda[0].SwapStates(good2);
- sucheck = 1;
- }
- }
- }
- }
- if (sucheck == 0 && gooda[0].StateName == "heavy")
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- if (count2 > 0)
- {
- if (stuckenemies(gooda[0], game))
- {
- if (gooda[0].StateName != "heavy")
- {
- foreach (Pirate good2 in game.GetMyLivingPirates())
- {
- if (gooda[0].StateName != "heavy")
- {
- if (good2.StateName == "heavy" && sucheck == 0)
- {
- gooda[0].SwapStates(good2);
- sucheck = 1;
- }
- }
- }
- }
- if (sucheck == 0 && gooda[0].StateName == "heavy")
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- if (!TryPushcapsuleattack(gooda[2], game))
- {
- if (gooda[2].StateName != "heavy")
- gooda[2].Sail(gcapsule[1].InitialLocation);
- else
- gooda[2].SwapStates(gooda[1]);
- }
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
- {
- int checker2 = 0;
- if (gooda[0].StateName != "heavy")
- gooda[0].Sail(gcapsule[0].InitialLocation);
- else
- gooda[0].SwapStates(gooda[1]);
- if (!TryPushcapsuleattack2(gooda[2], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[2].Distance(gmother[0]) >= gooda[2].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[2].Sail(allworm[0].Partner);
- else
- {
- if (count2 > 0)
- {
- if (stuckenemies(gooda[2], game))
- {
- if (gooda[2].StateName != "heavy")
- {
- for (int m = 1; m < gooda.Length; m++)
- {
- if (gooda[2].StateName != "heavy")
- {
- if (gooda[m].StateName == "heavy" && checker2 == 0)
- {
- gooda[2].SwapStates(gooda[m]);
- checker2 = 1;
- }
- }
- }
- }
- if (checker2 == 0 && gooda[2].StateName == "heavy")
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- {
- if (count2 > 0)
- {
- if (stuckenemies(gooda[2], game))
- {
- if (gooda[2].StateName != "heavy")
- {
- for (int m = 1; m < gooda.Length; m++)
- {
- if (gooda[2].StateName != "heavy")
- {
- if (gooda[m].StateName == "heavy" && checker2 == 0)
- {
- gooda[2].SwapStates(gooda[m]);
- checker2 = 1;
- }
- }
- }
- }
- if (checker2 == 0 && gooda[2].StateName == "heavy")
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- }
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
- {
- int checker3 = 0;
- int checker4 = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- if (count2 > 0)
- {
- if (stuckenemies(gooda[0], game))
- {
- if (gooda[0].StateName != "heavy")
- {
- foreach (Pirate good2 in game.GetMyLivingPirates())
- {
- if (gooda[0].StateName != "heavy")
- {
- if (good2.StateName == "heavy" && checker3 == 0)
- {
- gooda[0].SwapStates(good2);
- checker3 = 1;
- }
- }
- }
- }
- if (checker3 == 0 && gooda[0].StateName == "heavy")
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- if (!TryPushcapsuleattack2(gooda[2], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[2].Sail(allworm[0].Partner);
- else
- {
- if (count2 > 0)
- {
- if (stuckenemies(gooda[2], game))
- {
- if (gooda[2].StateName != "heavy")
- {
- for (int m = 1; m < gooda.Length; m++)
- {
- if (gooda[2].StateName != "heavy")
- {
- if (gooda[m].StateName == "heavy" && checker4 == 0)
- {
- gooda[2].SwapStates(gooda[m]);
- checker4 = 1;
- }
- }
- }
- }
- if (checker4 == 0 && gooda[2].StateName == "heavy")
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- {
- if (heavies.Length > 0)
- {
- if (stuckenemies(gooda[2], game))
- {
- if (gooda[2].StateName != "heavy")
- {
- for (int m = 1; m < gooda.Length; m++)
- {
- if (gooda[2].StateName != "heavy")
- {
- if (gooda[m].StateName == "heavy" && checker4 == 0)
- {
- gooda[2].SwapStates(gooda[m]);
- checker4 = 1;
- }
- }
- }
- }
- if (checker4 == 0 && gooda[2].StateName == "heavy")
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- else
- gooda[2].Sail(gmother[0]);
- }
- }
- }
- }
- if (gooda.Length > 3)
- {
- int m = 3;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- if (gooda.Length > 4)
- {
- int m = 4;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- //if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- System.Console.WriteLine(enemy[0].PushRange);
- if (gooda.Length > 5)
- {
- int m = 5;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- if (gooda.Length > 6)
- {
- int m = 6;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 8)
- {
- int m = 8;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 9)
- {
- int m = 9;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- else
- {
- if (allworm.Length > 0)
- {
- if (gooda.Length > 7)
- if (!TryPushcapsuleBotWorm(gooda[7], game))
- gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- if (gooda.Length > 1)
- {
- if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
- {
- if (!TryPushcapsuleBotWorm(gooda[1], game))
- gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- }
- else
- {
- if (!TryPushcapsuleBotWorm2(gooda[1], game))
- gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
- }
- }
- }
- if (gooda[0].HasCapsule() == false)
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(allworm[0].Partner) + gcapsule[0].InitialLocation.Distance(allworm[0]) < gooda[0].Distance(gcapsule[1].InitialLocation)) && gooda[0].Distance(gmother[0]) < 3000)
- gooda[0].Sail(allworm[0]);
- else
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- else
- if (!TryPush(gooda[0], game))
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- if (gooda[0].HasCapsule() == true)
- {
- int sucheck = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- if (gooda[0].Distance(gmother[0]) <= 2000)
- {
- if (gooda[0].StateName != "heavy")
- {
- foreach (Pirate good2 in game.GetMyLivingPirates())
- {
- if (gooda[0].StateName != "heavy")
- {
- if (good2.StateName == "heavy" && sucheck == 0)
- {
- gooda[0].SwapStates(good2);
- sucheck = 1;
- }
- }
- }
- }
- if (sucheck == 0 && gooda[0].StateName == "heavy")
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- if (gooda[0].Distance(gmother[0]) <= 2000)
- {
- if (gooda[0].StateName != "heavy")
- {
- foreach (Pirate good2 in game.GetMyLivingPirates())
- {
- if (gooda[0].StateName != "heavy")
- {
- if (good2.StateName == "heavy" && sucheck == 0)
- {
- gooda[0].SwapStates(good2);
- sucheck = 1;
- }
- }
- }
- }
- if (sucheck == 0 && gooda[0].StateName == "heavy")
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- gooda[0].Sail(gmother[0]);
- }
- }
- }
- if (gooda.Length > 2)
- {
- int m = 2;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- if (gooda.Length > 3)
- {
- int m = 3;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- if (gooda.Length > 4)
- {
- int m = 4;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- //if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- System.Console.WriteLine(enemy[0].PushRange);
- if (gooda.Length > 5)
- {
- int m = 5;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- if (gooda.Length > 6)
- {
- int m = 6;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 8)
- {
- int m = 8;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 9)
- {
- int m = 9;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- }
- else
- {
- if (gcapsule.Length > 1)
- {
- if (allworm.Length > 0)
- {
- if (gooda.Length > 7)
- if (!TryPushcapsuleBotWorm(gooda[7], game))
- gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- if (gooda.Length > 1)
- {
- if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
- {
- if (!TryPushcapsuleBotWorm(gooda[1], game))
- gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- }
- else
- {
- if (!TryPushcapsuleBotWorm2(gooda[1], game))
- gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
- }
- }
- }
- if (gooda.Length > 2)
- {
- if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
- {
- if (!TryPush(gooda[0], game))
- gooda[0].Sail(gcapsule[0].InitialLocation);
- if (!TryPush(gooda[2], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[2].Distance(allworm[0].Partner) + gcapsule[1].InitialLocation.Distance(allworm[0]) < gooda[2].Distance(gcapsule[1].InitialLocation)) && gooda[2].Distance(gmother[0]) < 3000)
- gooda[2].Sail(allworm[0]);
- else
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- else
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- }
- if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
- {
- int sucheck = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- if (!TryPushcapsuleattack(gooda[2], game))
- {
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
- {
- int checker2 = 0;
- gooda[0].Sail(gcapsule[0].InitialLocation);
- if (!TryPushcapsuleattack2(gooda[2], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[2].Distance(gmother[0]) >= gooda[2].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[2].Sail(allworm[0].Partner);
- else
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
- {
- int checker3 = 0;
- int checker4 = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- if (!TryPushcapsuleattack2(gooda[2], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[2].Sail(allworm[0].Partner);
- else
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[2].Sail(gmother[0]);
- }
- }
- }
- }
- if (gooda.Length > 3)
- {
- int m = 3;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- if (gooda.Length > 4)
- {
- int m = 4;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- //if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- System.Console.WriteLine(enemy[0].PushRange);
- if (gooda.Length > 5)
- {
- int m = 5;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- if (gooda.Length > 6)
- {
- int m = 6;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 8)
- {
- int m = 8;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 9)
- {
- int m = 9;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- else
- {
- if (allworm.Length > 0)
- {
- if (gooda.Length > 7)
- if (!TryPushcapsuleBotWorm(gooda[7], game))
- gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- if (gooda.Length > 1)
- {
- if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
- {
- if (!TryPushcapsuleBotWorm(gooda[1], game))
- gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
- }
- else
- {
- if (!TryPushcapsuleBotWorm2(gooda[1], game))
- gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
- }
- }
- }
- if (gooda[0].HasCapsule() == false)
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(allworm[0].Partner) + gcapsule[0].InitialLocation.Distance(allworm[0]) < gooda[0].Distance(gcapsule[1].InitialLocation)) && gooda[0].Distance(gmother[0]) < 3000)
- gooda[0].Sail(allworm[0]);
- else
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- else
- if (!TryPush(gooda[0], game))
- gooda[0].Sail(gcapsule[0].InitialLocation);
- }
- if (gooda[0].HasCapsule() == true)
- {
- int sucheck = 0;
- if (!TryPushaste(gooda[0], game))
- {
- if (allworm.Length > 0)
- {
- if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
- gooda[0].Sail(allworm[0].Partner);
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- }
- if (gooda.Length > 2)
- {
- int m = 2;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- if (gooda.Length > 3)
- {
- int m = 3;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- if (gooda.Length > 4)
- {
- int m = 4;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- //if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- System.Console.WriteLine(enemy[0].PushRange);
- if (gooda.Length > 5)
- {
- int m = 5;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- if (gooda.Length > 6)
- {
- int m = 6;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 8)
- {
- int m = 8;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
- }
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- if (gooda.Length > 9)
- {
- int m = 9;
- if (allworm.Length > 0)
- {
- for (int i = 0; i < allworm.Length; i++)
- {
- if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
- }
- }
- if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- }
- else
- {
- if (enemyhas.Length == 0)
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
- }
- if (enemyhas.Length == 1)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[0]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
- }
- }
- }
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
- {
- if (gooda[m].Distance(enemyhas[1]) <= 300)
- {
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- else
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
- else
- gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
- }
- }
- }
- }
- }
- // if (enemyhas.Length == 2) { if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[0]); if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000) if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(enemyhas[1]); }
- }
- }
- }
- }
- }
- }
- if (game.GetEnemy().BotName == "25766")
- {
- if (gooda.Length > 0)
- {
- if (gooda[1].Capsule == null)
- {
- if (gooda[1].Distance(gcapsule[0].InitialLocation) > 1200)
- gooda[1].Sail(gcapsule[0].InitialLocation);
- if (gooda[1].Distance(gcapsule[0].InitialLocation) <= 1200 && gooda[1].Distance(gcapsule[0].InitialLocation) >= 500)
- if (TryPush2BotState4(gooda[1], game))
- gooda[1].Sail(gooda[0]);
- if (gooda[1].Distance(gcapsule[0].InitialLocation) < 500)
- gooda[1].Sail(gcapsule[0].InitialLocation);
- if (!TryPush2BotState2(gooda[0], game))
- gooda[0].Sail(gooda[1]);
- }
- else
- {
- gooda[1].Sail(gmother[0]);
- if (!TryPush2BotState3(gooda[0], game))
- gooda[0].Sail(gooda[1]);
- }
- }
- }
- if (game.GetEnemy().BotName == "25768") { for (int m = 0; m < gooda.Length; m++) { if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(ecapsule[0].InitialLocation); } }
- if (game.GetEnemy().BotName == "25242")
- {
- if (!TryPush2pullpushon(gooda[1], game))
- gooda[1].Sail(new Location(2031, 1300));
- if (!TryPush2(gooda[2], game))
- gooda[2].Sail(new Location(1435, 1575));
- if (!TryPushaste(gooda[0], game))
- {
- if (good[0].Capsule == null)
- {
- good[0].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- if (gooda.Length > 3)
- {
- for (int m = 3; m < gooda.Length - 2; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(new Location(638, 5448));
- else
- gooda[m].Sail(new Location(790, 5400));
- }
- }
- }
- for (int m = 5; m < gooda.Length; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 1)
- gooda[m].Sail(new Location(638, 5448));
- else
- gooda[m].Sail(new Location(790, 5400));
- }
- }
- }
- if (game.GetEnemy().BotName == "25187" || game.GetEnemy().BotName == "25188" || game.GetEnemy().BotName == "25192" || game.GetEnemy().BotName == "25190")
- {
- if (good.Length > 0)
- {
- if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
- {
- if (gooda[2].IsAlive() == true && gooda[0].IsAlive() == true)
- gooda[1].Sail(gooda[0]);
- if (gooda[2].IsAlive() == false && gooda[0].IsAlive() == true)
- gooda[1].Sail(gooda[0]);
- if (gooda[2].IsAlive() == true && gooda[0].IsAlive() == false)
- gooda[1].Sail(gooda[2]);
- if (gooda[2].IsAlive() == false && gooda[0].IsAlive() == false)
- gooda[1].Sail(gooda[0].InitialLocation);
- if (!TryPushaste(gooda[0], game))
- gooda[0].Sail(gcapsule[0].InitialLocation);
- if (!TryPushaste(gooda[2], game))
- gooda[2].Sail(gcapsule[1].InitialLocation);
- }
- if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
- {
- if (!TryPushaste(gooda[0], game))
- gooda[0].Sail(gmother[0]);
- gooda[2].Sail(gcapsule[1].InitialLocation);
- if (!TryPush2(gooda[1], game))
- gooda[1].Sail(gooda[0]);
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
- {
- gooda[0].Sail(gcapsule[0].InitialLocation);
- if (!TryPushaste(gooda[2], game))
- gooda[2].Sail(gmother[0]);
- if (!TryPush3(gooda[1], game))
- gooda[1].Sail(gooda[2]);
- }
- if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
- {
- if (!TryPushaste(gooda[0], game))
- gooda[0].Sail(gmother[0]);
- if (!TryPushaste(gooda[2], game))
- gooda[2].Sail(gmother[0]);
- if (!TryPush2(gooda[1], game))
- gooda[1].Sail(gooda[0]);
- }
- if (gooda.Length > 3)
- {
- for (int m = 3; m < gooda.Length - 2; m++)
- {
- if (enemyhas.Length == 0)
- gooda[m].Sail(emother[0]);
- if (enemyhas.Length == 1)
- {
- if (emother[0].GetLocation().Distance(enemyhas[0]) <= 4200)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- if (emother[0].GetLocation().Distance(enemyhas[0]) > 4200)
- gooda[m].Sail(emother[0]);
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- }
- }
- for (int m = 5; m < gooda.Length; m++)
- {
- if (enemyhas.Length == 0)
- gooda[m].Sail(emother[0]);
- if (enemyhas.Length == 1)
- {
- if (emother[0].GetLocation().Distance(enemyhas[0]) <= 2000)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- if (emother[0].GetLocation().Distance(enemyhas[0]) > 2000)
- gooda[m].Sail(emother[0]);
- }
- if (enemyhas.Length == 2)
- {
- if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[0]);
- if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000)
- if (!TryPushcapsule(gooda[m], game))
- gooda[m].Sail(enemyhas[1]);
- }
- }
- }
- }
- if (game.GetEnemy().BotName == "25189" || game.GetEnemy().BotName == "25185")
- {
- if (good.Length > 0)
- if (!TryPush(good[0], game))
- {
- if (good[0].Capsule == null)
- {
- good[0].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- good[0].Sail(gmother[0]);
- }
- }
- if (good.Length > 1)
- if (!TryPush2(good[1], game))
- {
- if (good[1].Capsule == null)
- {
- good[1].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- good[1].Sail(gmother[0]);
- }
- }
- if (good.Length > 2)
- {
- for (int m = 2; m < good.Length; m++)
- {
- if (!TryPushcapsule(good[m], game))
- good[m].Sail(ecapsule[0].InitialLocation);
- }
- }
- }
- if (game.GetEnemy().BotName == "25184")
- {
- if (good.Length > 0)
- if (!TryPush(good[0], game))
- {
- if (good[0].Capsule == null)
- {
- good[0].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- good[0].Sail(gmother[1]);
- }
- }
- if (good.Length > 1)
- if (!TryPush(good[1], game))
- {
- if (good[1].Capsule == null)
- {
- good[1].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- good[1].Sail(gmother[1]);
- }
- }
- if (good.Length > 2)
- {
- for (int m = 2; m < good.Length; m++)
- {
- if (!TryPushGeorge(good[m], game))
- good[m].Sail(ecapsule[0].InitialLocation);
- }
- }
- }
- if (game.GetEnemy().BotName == "25191")
- {
- if (good.Length == 1)
- {
- if (game.Turn < 70 || (game.Turn >= 73 && game.Turn < 96) || (game.Turn >= 99 && game.Turn < 126) || (game.Turn >= 131 && game.Turn < 190) || (game.Turn >= 195 && game.Turn <= 291) || game.Turn > 296)
- {
- if (!TryPushas(good[0], game))
- {
- if (good[0].Capsule == null)
- {
- good[0].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- good[0].Sail(gmother[0]);
- }
- }
- }
- }
- }
- if (game.GetEnemy().BotName == "25237")
- {
- if (!TryPush2pullpushon(gooda[1], game))
- gooda[1].Sail(new Location(1600, 1500));
- if (!TryPush2(gooda[2], game))
- gooda[2].Sail(new Location(1285, 1266));
- if (!TryPushcapsule(gooda[3], game))
- {
- gooda[3].Sail(allworm[1].GetLocation().Towards(gmother[0].GetLocation(), 150));
- }
- if (!TryPushcapsuleBot(gooda[7], game))
- {
- gooda[7].Sail(allworm[1].GetLocation().Towards(gmother[0].GetLocation(), 150));
- }
- if (!TryPushaste(gooda[0], game))
- {
- if (good[0].Capsule == null)
- {
- good[0].Sail(gcapsule[0].InitialLocation);
- }
- // Else, go to my mothership.
- else
- {
- gooda[0].Sail(gmother[0]);
- }
- }
- if (gooda.Length > 4)
- {
- for (int m = 4; m < gooda.Length - 2; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 0)
- gooda[m].Sail(new Location(2333, 5410));
- else
- gooda[m].Sail(new Location(2409, 5372));
- }
- }
- }
- if (game.Turn < 185)
- {
- for (int m = 6; m < gooda.Length - 1; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 1)
- gooda[m].Sail(new Location(2333, 5410));
- else
- gooda[m].Sail(new Location(2409, 5372));
- }
- }
- }
- else
- {
- for (int m = 6; m < gooda.Length - 1; m++)
- {
- if (!TryPushcapsule(gooda[m], game))
- {
- if (game.Turn % 2 == 1)
- gooda[m].Sail(new Location(781, 5362));
- else
- gooda[m].Sail(new Location(714, 5448));
- }
- }
- }
- }
- }
- private bool TryPush(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- Location locat = new Location(pirate.GetLocation().Row, -1);
- int min;
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (pirate.CanPush(enemy))
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
- if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
- locat = new Location(pirate.GetLocation().Row, game.Cols);
- }
- if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
- locat = new Location(-1, pirate.GetLocation().Col);
- }
- if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
- locat = new Location(game.Rows, pirate.GetLocation().Col);
- }
- pirate.Push(enemy, locat);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, closeto(pirate, game));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushcapsule(Pirate pirate, PirateGame game)
- {
- Location locat = new Location(pirate.GetLocation().Row, -1);
- int min;
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (enemy.Capsule != null)
- if (pirate.CanPush(enemy))
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
- if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
- locat = new Location(pirate.GetLocation().Row, game.Cols);
- }
- if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
- locat = new Location(-1, pirate.GetLocation().Col);
- }
- if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
- locat = new Location(game.Rows, pirate.GetLocation().Col);
- }
- pirate.Push(enemy, locat);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, closeto(pirate, game));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(worm))
- {
- // Push asteroid!
- int distan = game.GetMyCapsules()[0].Distance(game.GetMyCapsules()[1]);
- if (game.GetMyCapsules().Length == 1)
- pirate.Push(worm, new Location(3000, 3600));
- if (game.GetMyCapsules().Length > 1)
- pirate.Push(worm, game.GetMyCapsules()[1]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushcapsuleforheavy(Pirate pirate, PirateGame game)
- {
- Location locat = new Location(pirate.GetLocation().Row, -1);
- int min;
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (enemy.Capsule != null)
- if (pirate.CanPush(enemy))
- {
- pirate.Push(enemy, game.GetAllMyPirates()[4]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(worm))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(worm, game.GetMyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushcapsuleattack(Pirate pirate, PirateGame game)
- {
- Location locat = new Location(pirate.GetLocation().Row, -1);
- int min;
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (pirate.CanPush(enemy))
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
- if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
- locat = new Location(pirate.GetLocation().Row, game.Cols);
- }
- if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
- locat = new Location(-1, pirate.GetLocation().Col);
- }
- if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
- locat = new Location(game.Rows, pirate.GetLocation().Col);
- }
- pirate.Push(enemy, locat);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, closeto(pirate, game));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(worm))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(worm, game.GetMyCapsules()[1]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushcapsuleattack2(Pirate pirate, PirateGame game)
- {
- Location locat = new Location(pirate.GetLocation().Row, -1);
- int min;
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (pirate.CanPush(enemy))
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
- if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
- locat = new Location(pirate.GetLocation().Row, game.Cols);
- }
- if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
- locat = new Location(-1, pirate.GetLocation().Col);
- }
- if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
- locat = new Location(game.Rows, pirate.GetLocation().Col);
- }
- pirate.Push(enemy, locat);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, closeto(pirate, game));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- if (pirate.CanPush(game.GetAllWormholes()[0]))
- {
- pirate.Push(game.GetAllWormholes()[0], game.GetMyMotherships()[0]);
- return true;
- }
- // Didn't push
- return false;
- }
- private bool TryPushcapsuleBot(Pirate pirate, PirateGame game)
- {
- Location locat = new Location(pirate.GetLocation().Row, -1);
- int min;
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (enemy.Capsule != null)
- if (pirate.CanPush(enemy))
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
- if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
- locat = new Location(pirate.GetLocation().Row, game.Cols);
- }
- if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
- locat = new Location(-1, pirate.GetLocation().Col);
- }
- if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
- locat = new Location(game.Rows, pirate.GetLocation().Col);
- }
- pirate.Push(enemy, locat);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(worm))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(worm, new Location(1171, 3952));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushcapsuleBot23(Pirate pirate, PirateGame game)
- {
- Location locat = new Location(pirate.GetLocation().Row, -1);
- int min;
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (enemy.Capsule != null)
- if (pirate.CanPush(enemy))
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
- if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
- {
- min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
- locat = new Location(pirate.GetLocation().Row, game.Cols);
- }
- if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
- locat = new Location(-1, pirate.GetLocation().Col);
- }
- if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
- {
- min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
- locat = new Location(game.Rows, pirate.GetLocation().Col);
- }
- pirate.Push(enemy, locat);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, closeto(pirate, game));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(worm))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(worm, game.GetMyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPush2(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- // Check if the pirate can push the enemy
- if (pirate.CanPush(game.GetAllMyPirates()[0]) && (game.GetAllMyPirates()[0].Capsule != null) && (game.GetAllMyPirates()[0].GetLocation().Distance(enemy.GetLocation())) < 600)
- {
- pirate.Push(game.GetAllMyPirates()[0], game.GetMyMotherships()[0]);
- // Print a message
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, closeto(pirate, game));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPush2pullpushon(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate good in game.GetAllMyPirates())
- {
- // Check if the pirate can push the enemy
- if ((pirate.CanPush(good) && (good.Capsule != null)))
- {
- pirate.Push(game.GetAllMyPirates()[0], game.GetAllMyPirates()[2]);
- // Print a message
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPush3(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- // Check if the pirate can push the enemy
- if (pirate.CanPush(game.GetAllMyPirates()[2]) && (game.GetAllMyPirates()[2].Capsule != null) && (game.GetAllMyPirates()[2].GetLocation().Distance(enemy.GetLocation())) < 600)
- {
- pirate.Push(game.GetAllMyPirates()[2], game.GetMyMotherships()[0]);
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, closeto(pirate, game));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushGeorge(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- // Check if the pirate can push the enemy
- if (pirate.CanPush(enemy))
- {
- // Push enemy!
- pirate.Push(enemy, new Location(6334, 3167));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + enemy.InitialLocation);
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- pirate.Push(asteroid, game.GetEnemyCapsules()[0].InitialLocation);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushas(Pirate pirate, PirateGame game)
- {
- // Go over all living asteroids
- for (int m = 0; m < game.GetLivingAsteroids().Length - 1; m++)
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(game.GetLivingAsteroids()[m]))
- {
- // Push asteroi
- pirate.Push(game.GetLivingAsteroids()[m], game.GetLivingAsteroids()[m + 1]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + game.GetLivingAsteroids()[m] + " towards " + game.GetLivingAsteroids()[m + 1]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushaste(Pirate pirate, PirateGame game)
- {
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, closeto(pirate, game));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushworm(Pirate pirate, PirateGame game)
- {
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(worm))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(worm, game.GetMyMotherships()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushworm2(Pirate pirate, PirateGame game)
- {
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(worm))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(worm, game.GetMyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushwormForgooda2(Pirate pirate, PirateGame game)
- {
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(worm))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(worm, game.GetMyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetMyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPush2BotState(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- // Check if the pirate can push the enemy
- if (pirate.CanPush(game.GetAllMyPirates()[1]) && (game.GetAllMyPirates()[1].Capsule != null))
- {
- pirate.Push(game.GetAllMyPirates()[1], game.GetMyMotherships()[0]);
- // Print a message
- // Did push
- return true;
- }
- }
- return false;
- }
- private bool TryPush2BotState2(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- // Check if the pirate can push the enemy
- if (pirate.CanPush(game.GetAllMyPirates()[1]))
- {
- pirate.Push(game.GetAllMyPirates()[1], game.GetMyCapsules()[0]);
- // Print a message
- // Did push
- return true;
- }
- }
- return false;
- }
- private bool TryPush2BotState3(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- // Check if the pirate can push the enemy
- if (pirate.CanPush(game.GetAllMyPirates()[1]))
- {
- pirate.Push(game.GetAllMyPirates()[1], game.GetMyMotherships()[0]);
- // Print a message
- // Did push
- return true;
- }
- }
- return false;
- }
- private bool TryPush2BotState4(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- // Check if the pirate can push the enemy
- if (pirate.CanPush(game.GetAllMyPirates()[1]))
- {
- pirate.Push(game.GetAllMyPirates()[0], game.GetMyCapsules()[0]);
- // Print a message
- // Did push
- return true;
- }
- }
- return false;
- }
- private bool TryPushcapsule4(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (enemy.Capsule != null)
- if (pirate.CanPush(enemy))
- {
- pirate.Push(enemy, new Location(6400, 3200));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(worm))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(worm, game.GetMyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPush4ForBot(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate good in game.GetMyLivingPirates())
- {
- // Check if the pirate can push the enemy
- if (pirate.CanPush(good) && (good.Capsule != null))
- {
- pirate.Push(good, new Location(2924, 5210));
- // Did push
- return true;
- }
- }
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, new Location(6400, 6400));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushcapsuleBotWorm(Pirate pirate, PirateGame game)
- {
- Location locat = new Location(pirate.GetLocation().Row, -1);
- int min;
- // Go over all enemies
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- foreach (Wormhole worm in game.GetAllWormholes())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(game.GetAllWormholes()[0]))
- {
- // Push asteroid!
- pirate.Push(game.GetAllWormholes()[0], game.GetMyMotherships()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Didn't push
- return false;
- }
- private bool TryPushcapsuleBotWorm2(Pirate pirate, PirateGame game)
- {
- Location locat = new Location(pirate.GetLocation().Row, -1);
- int min;
- // Go over all enemies
- // Go over all living asteroids
- foreach (Asteroid asteroid in game.GetLivingAsteroids())
- {
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(asteroid))
- {
- // Push asteroid!
- if (game.GetEnemyCapsules().Length > 0)
- pirate.Push(asteroid, game.GetMyMotherships()[0]);
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- }
- // Check if the pirate can push the asteroid
- if (pirate.CanPush(game.GetAllWormholes()[0].Partner))
- {
- // Push asteroid!
- int distan = game.GetMyCapsules()[0].Distance(game.GetMyCapsules()[1]);
- pirate.Push(game.GetAllWormholes()[0].Partner, game.GetMyCapsules()[0].GetLocation().Towards(game.GetMyCapsules()[1], distan / 2 + 150));
- // Print a message
- System.Console.WriteLine("pirate " + pirate + " pushes " + " towards " + game.GetEnemyCapsules()[0]);
- // Did push
- return true;
- }
- // Didn't push
- return false;
- }
- private bool Checkenemy0(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (game.GetAllMyPirates()[0].GetLocation().Distance(enemy) <= 500 && game.GetAllMyPirates()[0].Capsule != null)
- return true;
- }
- // Didn't push
- return false;
- }
- private bool Checkenemy2(Pirate pirate, PirateGame game)
- {
- // Go over all enemies
- foreach (Pirate enemy in game.GetEnemyLivingPirates())
- {
- if (game.GetAllMyPirates()[2].GetLocation().Distance(enemy) <= 500 && game.GetAllMyPirates()[2].Capsule != null)
- return true;
- }
- // Didn't push
- return false;
- }
- private bool stuckenemies(Pirate pirate, PirateGame game)
- {
- for (int m = 0; m < game.GetEnemyLivingPirates().Length; m++)
- {
- for (int i = 0; i < game.GetEnemyLivingPirates().Length; i++)
- {
- if (m != i)
- if (game.GetEnemyLivingPirates()[m].Distance(pirate) <= 600 && game.GetEnemyLivingPirates()[m].GetLocation().Distance(game.GetEnemyLivingPirates()[i]) <= 300)
- return true;
- }
- }
- return false;
- }
- private Pirate closeto(Pirate pirate, PirateGame game)
- {
- Pirate p = game.GetEnemyLivingPirates()[0];
- int min2 = pirate.Distance(game.GetEnemyLivingPirates()[0]);
- for (int m = 0; m < game.GetEnemyLivingPirates().Length; m++)
- {
- if (pirate.Distance(game.GetEnemyLivingPirates()[m]) < min2)
- {
- min2 = pirate.Distance(game.GetEnemyLivingPirates()[m]);
- p = game.GetEnemyLivingPirates()[m];
- }
- }
- return p;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement