Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 484.07 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using System.Text;
  4. using Pirates;
  5.  
  6.  
  7. namespace MyBot
  8. {
  9. /// <summary>
  10. /// This is an example for a bot.
  11. /// </summary>
  12. public class TutorialBot : IPirateBot
  13. {
  14. /// <summary>
  15. /// Makes the bot run a single turn
  16. /// </summary>
  17. /// <param name="game">the current game state</param>
  18. public void DoTurn(PirateGame game)
  19. {
  20. Pirate[] good = game.GetMyLivingPirates();
  21. Pirate[] enemy = game.GetEnemyLivingPirates();
  22. Capsule[] gcapsule = game.GetMyCapsules();
  23. Capsule[] ecapsule = game.GetEnemyCapsules();
  24. Mothership[] gmother = game.GetMyMotherships();
  25. Mothership[] emother = game.GetEnemyMotherships();
  26. Asteroid[] asteroid = game.GetLivingAsteroids();
  27. Pirate[] gooda = game.GetAllMyPirates();
  28. Wormhole[] allworm = game.GetAllWormholes();
  29. Pirate[] heavies = game.GetAllMyPirates();
  30. System.Console.WriteLine(game.GetEnemy().BotName);
  31. int count2 = 0;
  32. int checker = 0;
  33. int count = 0;
  34. int check = 0;
  35. int amount = 0;
  36. if (enemy.Length > 0)
  37. {
  38. for (int m = 0; m < enemy.Length; m++)
  39. {
  40. if (enemy[m].HasCapsule())
  41. {
  42. count++;
  43. }
  44. }
  45.  
  46. }
  47. Pirate[] enemyhas = new Pirate[count];
  48. count = 0;
  49. if (enemy.Length > 0)
  50. {
  51. for (int m = 0; m < enemy.Length; m++)
  52. {
  53. if (enemy[m].HasCapsule())
  54. {
  55. enemyhas[count] = enemy[m];
  56. count++;
  57. }
  58. }
  59.  
  60. }
  61. for (int m = 0; m < good.Length; m++)
  62. {
  63. if (good[m].StateName == "heavy")
  64. {
  65. heavies[count2] = good[m];
  66. count2++;
  67. }
  68.  
  69. }
  70. foreach (Pirate good4 in game.GetAllMyPirates())
  71. {
  72. if (good4.StateName == "heavy")
  73. amount++;
  74. }
  75. if (game.GetEnemy().BotName == "25235")
  76. {
  77. if (good.Length > 0)
  78. {
  79. if (good[0].Capsule == null)
  80. {
  81. if (game.Turn > 17 && game.Turn <= 22)
  82. good[0].Sail(asteroid[3]);
  83. else
  84. good[0].Sail(gcapsule[0]);
  85. }
  86. else
  87. good[0].Sail(gmother[0]);
  88.  
  89. }
  90. }
  91.  
  92. if (game.GetEnemy().BotName == "25239")
  93. {
  94. if (!TryPush(good[0], game))
  95. {
  96. if (good[0].Capsule == null)
  97. {
  98. if (gooda[0].Distance(allworm[0]) <= 1000)
  99. gooda[0].Sail(allworm[0]);
  100. else
  101. good[0].Sail(gcapsule[0].InitialLocation);
  102. }
  103. // Else, go to my mothership.
  104. else
  105. {
  106. if (gooda[0].Distance(allworm[1]) <= 1000)
  107. gooda[0].Sail(allworm[1]);
  108. else
  109. gooda[0].Sail(gmother[0]);
  110. }
  111. }
  112.  
  113. }
  114. if (game.GetEnemy().BotName == "25238")
  115. {
  116. if (gooda[0].HasCapsule() == false)
  117. {
  118. if (gooda[0].GetLocation().Distance(gmother[0].GetLocation()) < 1000)
  119. {
  120. if (!TryPushworm(gooda[0], game))
  121. gooda[0].Sail(allworm[2]);
  122. }
  123. else
  124. {
  125. gooda[0].Sail(gcapsule[0].InitialLocation);
  126.  
  127. }
  128. }
  129. else
  130. {
  131. if (gooda[0].GetLocation().Distance(gcapsule[0].InitialLocation) < 1000)
  132. {
  133. if (!TryPushworm2(gooda[0], game))
  134. gooda[0].Sail(allworm[3]);
  135. }
  136. else
  137. {
  138. gooda[0].Sail(gmother[0]);
  139.  
  140. }
  141.  
  142. }
  143. }
  144. if (game.GetEnemy().BotName == "25236")
  145. {
  146. if (good.Length > 0)
  147. {
  148. if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
  149. {
  150. if (gooda[2].IsAlive() == true && gooda[0].IsAlive() == true)
  151. gooda[1].Sail(gooda[0]);
  152. if (gooda[2].IsAlive() == false && gooda[0].IsAlive() == true)
  153. gooda[1].Sail(gooda[0]);
  154. if (gooda[2].IsAlive() == true && gooda[0].IsAlive() == false)
  155. gooda[1].Sail(gooda[2]);
  156. if (gooda[2].IsAlive() == false && gooda[0].IsAlive() == false)
  157. gooda[1].Sail(gooda[0].InitialLocation);
  158. if (!TryPushaste(gooda[0], game))
  159. gooda[0].Sail(gcapsule[0].InitialLocation);
  160.  
  161. }
  162.  
  163. if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
  164. {
  165. if (!TryPushaste(gooda[0], game))
  166. gooda[0].Sail(gmother[0]);
  167. gooda[2].Sail(gcapsule[0].InitialLocation);
  168. if (!TryPush2(gooda[1], game))
  169. gooda[1].Sail(gooda[0]);
  170.  
  171. }
  172.  
  173. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
  174. {
  175. gooda[0].Sail(gcapsule[0].InitialLocation);
  176. if (!TryPushaste(gooda[2], game))
  177. gooda[2].Sail(gmother[0]);
  178. if (!TryPush3(gooda[1], game))
  179. gooda[1].Sail(gooda[2]);
  180. }
  181.  
  182.  
  183. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
  184. {
  185. if (!TryPushaste(gooda[0], game))
  186. gooda[0].Sail(gmother[0]);
  187. if (!TryPushaste(gooda[2], game))
  188. gooda[2].Sail(gmother[0]);
  189. if (!TryPush2(gooda[1], game))
  190. gooda[1].Sail(gooda[0]);
  191.  
  192.  
  193. }
  194.  
  195.  
  196. if (gooda.Length > 3)
  197. {
  198. for (int m = 3; m < gooda.Length - 2; m++)
  199. {
  200. if (enemyhas.Length == 0)
  201. gooda[m].Sail(emother[0]);
  202. if (enemyhas.Length == 1)
  203. {
  204. if (emother[0].GetLocation().Distance(enemyhas[0]) <= 4200)
  205. if (!TryPushcapsule(gooda[m], game))
  206. gooda[m].Sail(enemyhas[0]);
  207. if (emother[0].GetLocation().Distance(enemyhas[0]) > 4200)
  208. gooda[m].Sail(emother[0]);
  209. }
  210. if (enemyhas.Length == 2)
  211. {
  212. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200)
  213. if (!TryPushcapsule(gooda[m], game))
  214. gooda[m].Sail(enemyhas[0]);
  215. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200)
  216. if (!TryPushcapsule(gooda[m], game))
  217. gooda[m].Sail(enemyhas[1]);
  218. }
  219. }
  220. }
  221.  
  222. for (int m = 5; m < gooda.Length; m++)
  223. {
  224. if (enemyhas.Length == 0)
  225. gooda[m].Sail(emother[0]);
  226. if (enemyhas.Length == 1)
  227. {
  228. if (emother[0].GetLocation().Distance(enemyhas[0]) <= 2000)
  229. if (!TryPushcapsule(gooda[m], game))
  230. gooda[m].Sail(enemyhas[0]);
  231. if (emother[0].GetLocation().Distance(enemyhas[0]) > 2000)
  232. gooda[m].Sail(emother[0]);
  233. }
  234. if (enemyhas.Length == 2)
  235. {
  236. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000)
  237. if (!TryPushcapsule(gooda[m], game))
  238. gooda[m].Sail(enemyhas[0]);
  239. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000)
  240. if (!TryPushcapsule(gooda[m], game))
  241. gooda[m].Sail(enemyhas[1]);
  242. }
  243. }
  244. }
  245.  
  246.  
  247.  
  248. }
  249.  
  250. if (game.GetEnemy().BotName == "25241")
  251. {
  252. if (gooda[0].HasCapsule() == false)
  253. {
  254. if (gooda[0].GetLocation().Distance(gmother[0].GetLocation()) < 1000)
  255. {
  256. gooda[0].Sail(allworm[5]);
  257. }
  258. if (gooda[0].GetLocation().Distance(allworm[3].GetLocation()) < 1400)
  259. {
  260. gooda[0].Sail(allworm[5]);
  261. }
  262. if (gooda[0].GetLocation().Distance(allworm[1].GetLocation()) < 1400)
  263. {
  264. gooda[0].Sail(allworm[1]);
  265. }
  266. 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)
  267. {
  268. gooda[0].Sail(gcapsule[0].InitialLocation);
  269.  
  270. }
  271. }
  272. else
  273. {
  274. if (gooda[0].GetLocation().Distance(gcapsule[0].InitialLocation) < 1000)
  275. {
  276. gooda[0].Sail(allworm[0]);
  277. }
  278. if (gooda[0].GetLocation().Distance(allworm[2].GetLocation()) < 1500)
  279. {
  280. gooda[0].Sail(allworm[2]);
  281. }
  282. if (gooda[0].GetLocation().Distance(allworm[4].GetLocation()) < 1400)
  283. {
  284. gooda[0].Sail(allworm[4]);
  285. }
  286. 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)
  287. {
  288. gooda[0].Sail(gmother[0]);
  289.  
  290. }
  291.  
  292. }
  293.  
  294.  
  295.  
  296.  
  297. }
  298.  
  299. if (game.GetEnemy().BotName == "25186")
  300. {
  301. if (good.Length > 0)
  302. if (good[0].CanPush(enemy[0]))
  303. good[0].Push(enemy[0], new Location(3191, 1567));
  304. }
  305. if (game.GetEnemy().BotName == "25772")
  306. {
  307. if (gooda[0].StateName == "heavy")
  308. gooda[0].SwapStates(gooda[1]);
  309. else
  310. {
  311. if (gooda.Length > 0)
  312. {
  313. if (gooda[0].Capsule == null)
  314. {
  315. good[0].Sail(gcapsule[0]);
  316. }
  317. else
  318. good[0].Sail(gmother[0]);
  319.  
  320. }
  321. if (!TryPush2(gooda[1], game))
  322. gooda[1].Sail(gooda[0]);
  323. if (!TryPush2(gooda[2], game))
  324. gooda[2].Sail(gooda[0]);
  325. }
  326.  
  327. }
  328. if (game.GetEnemy().BotName == "25770")
  329. {
  330. if (!TryPush2pullpushon(gooda[1], game))
  331. gooda[1].Sail(new Location(2031, 1300));
  332. if (!TryPush2(gooda[2], game))
  333. gooda[2].Sail(new Location(1435, 1575));
  334. if (!TryPushaste(gooda[0], game))
  335. {
  336. if (gooda[0].Capsule == null)
  337. {
  338.  
  339. gooda[0].Sail(gcapsule[0].InitialLocation);
  340. }
  341. // Else, go to my mothership.
  342. else
  343. {
  344.  
  345. gooda[0].Sail(gmother[0]);
  346. }
  347. }
  348. for (int m = 2; m < 4; m++)
  349. {
  350. if (!TryPushaste(gooda[m], game))
  351. {
  352. if (gooda[m].Capsule == null)
  353. {
  354.  
  355. gooda[m].Sail(gcapsule[1].InitialLocation);
  356. }
  357. // Else, go to my mothership.
  358. else
  359. {
  360.  
  361. gooda[m].Sail(gmother[0]);
  362. }
  363. }
  364.  
  365.  
  366. }
  367.  
  368.  
  369. if (gooda.Length > 3)
  370. {
  371. for (int m = 5; m < gooda.Length - 2; m++)
  372. {
  373. if (!TryPushcapsule(gooda[m], game))
  374. {
  375. gooda[m].Sail(new Location(2080, 4329));
  376.  
  377. }
  378. }
  379. }
  380.  
  381. for (int m = 7; m < gooda.Length; m++)
  382. {
  383. if (!TryPushcapsule(gooda[m], game))
  384. {
  385. gooda[m].Sail(new Location(2080, 2871));
  386.  
  387. }
  388. }
  389.  
  390.  
  391. }
  392. if (game.GetEnemy().BotName == "25767")
  393. {
  394. for (int m = 0; m < 3; m++)
  395. if (!TryPushcapsule4(gooda[m], game))
  396. {
  397. if (game.Turn % 2 == 0)
  398. gooda[m].Sail(new Location(3000, 3514));
  399. else
  400. gooda[m].Sail(new Location(3362, 3514));
  401. }
  402. for (int m = 3; m < 6; m++)
  403. if (!TryPushcapsule4(gooda[m], game))
  404. {
  405. if (game.Turn % 2 == 0)
  406. gooda[m].Sail(new Location(3105, 2886));
  407. else
  408. gooda[m].Sail(new Location(3360, 2886));
  409. }
  410. }
  411. if (game.GetEnemy().BotName == "25773")
  412. {
  413. if (!TryPush(gooda[3], game))
  414. {
  415. if (gooda[3].Capsule == null)
  416. {
  417. gooda[3].Sail(gcapsule[0].InitialLocation);
  418. }
  419. // Else, go to my mothership.
  420. else
  421. {
  422. gooda[3].Sail(gmother[0]);
  423. }
  424. }
  425. for (int m = 0; m < 2; m++)
  426. {
  427. if (!TryPushcapsule(gooda[m], game))
  428. gooda[m].Sail(ecapsule[0].InitialLocation);
  429. }
  430. if (!TryPushcapsule(gooda[2], game))
  431. gooda[2].Sail(emother[0]);
  432. if (!TryPushcapsule(gooda[4], game))
  433. gooda[4].Sail(emother[0]);
  434.  
  435. }
  436.  
  437. if (game.GetEnemy().BotName == "25771")
  438. {
  439. if (gooda.Length > 0)
  440. {
  441. if (!TryPushcapsuleattack(gooda[0], game))
  442. {
  443. if (gooda[0].Capsule == null)
  444. {
  445. gooda[0].Sail(gcapsule[0]);
  446. }
  447. else
  448. {
  449. gooda[0].Sail(gmother[0]);
  450.  
  451. }
  452. }
  453.  
  454. for (int m = 3; m < 6; m++)
  455. {
  456. if (!TryPushcapsule(gooda[m], game))
  457. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 200));
  458. }
  459.  
  460. for (int m = 1; m < 3; m++)
  461. {
  462. if (!TryPushcapsule(gooda[m], game))
  463. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[1], 200));
  464. }
  465. }
  466.  
  467.  
  468. }
  469. if (game.GetEnemy().BotName == "25774")
  470. {
  471. if (!TryPush4ForBot(gooda[7], game))
  472. gooda[7].Sail(gmother[0].GetLocation().Towards(gcapsule[0].InitialLocation, 800));
  473.  
  474. if (!TryPushcapsuleattack(gooda[6], game))
  475. {
  476. if (gooda[6].Capsule == null)
  477. {
  478. gooda[6].Sail(gcapsule[0].InitialLocation);
  479. }
  480. else
  481. {
  482. gooda[6].Sail(gmother[0]);
  483.  
  484. }
  485. }
  486.  
  487. if (!TryPushcapsuleattack(gooda[4], game))
  488. {
  489. if (gooda[4].Capsule == null)
  490. {
  491. gooda[4].Sail(gcapsule[0].InitialLocation);
  492. }
  493. else
  494. {
  495. gooda[4].Sail(gmother[0]);
  496.  
  497. }
  498. }
  499. for (int m = 0; m < 6; m++)
  500. if (m != 4)
  501. {
  502. if (!TryPushcapsuleattack(gooda[m], game))
  503. {
  504. if (game.GetAllEnemyPirates()[1].IsAlive())
  505. gooda[m].Sail(game.GetAllEnemyPirates()[1]);
  506. else
  507. if (game.GetAllEnemyPirates()[9].IsAlive())
  508. gooda[m].Sail(game.GetAllEnemyPirates()[9]);
  509. }
  510. }
  511. }
  512. if (game.GetEnemy().BotName == "260269")
  513. {
  514. if (game.GetMyself().TurnsToStickyBomb == 0 && gooda[0].InStickBombRange(enemy[1]))
  515. {
  516. gooda[0].StickBomb(enemy[1]);
  517. }
  518.  
  519.  
  520.  
  521. }
  522. if (game.GetEnemy().BotName == "26070")
  523. {
  524. if (enemy.Length > 0)
  525. {
  526. if (allworm.Length > 0)
  527. {
  528. if (gooda.Length > 7)
  529. if (!TryPushcapsuleBotWorm(gooda[7], game))
  530. gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  531.  
  532.  
  533. if (gooda.Length > 1)
  534. {
  535. if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
  536. {
  537. if (!TryPushcapsuleBotWorm(gooda[1], game))
  538. gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  539. }
  540. else
  541. {
  542. if (!TryPushcapsuleBotWorm2(gooda[1], game))
  543. gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
  544. }
  545. }
  546. }
  547.  
  548. for (int m = 10; m < 14; m++)
  549. {
  550. if (gooda[m].HasCapsule() == false)
  551. {
  552. if (allworm.Length > 0)
  553. {
  554. 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)
  555. gooda[m].Sail(allworm[0]);
  556. else
  557. gooda[m].Sail(gcapsule[0].InitialLocation);
  558. }
  559. else
  560. if (!TryPush(gooda[m], game))
  561. gooda[m].Sail(gcapsule[0].InitialLocation);
  562.  
  563.  
  564. }
  565.  
  566. if (gooda[m].HasCapsule() == true)
  567. {
  568. int sucheck = 0;
  569. if (!TryPushaste(gooda[m], game))
  570. {
  571. if (allworm.Length > 0)
  572. {
  573. if ((gooda[m].Distance(gmother[0]) > gooda[m].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  574. gooda[m].Sail(allworm[0].Partner);
  575. else
  576. {
  577. gooda[m].Sail(gmother[0]);
  578. }
  579. }
  580. else
  581. {
  582. gooda[m].Sail(gmother[0]);
  583. }
  584. }
  585.  
  586.  
  587.  
  588. }
  589.  
  590. }
  591.  
  592. if (gooda[0].HasCapsule() == false)
  593. {
  594. if (allworm.Length > 0)
  595. {
  596. 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)
  597. gooda[0].Sail(allworm[0]);
  598. else
  599. gooda[0].Sail(gcapsule[0].InitialLocation);
  600. }
  601. else
  602. if (!TryPush(gooda[0], game))
  603. gooda[0].Sail(gcapsule[0].InitialLocation);
  604.  
  605.  
  606. }
  607.  
  608. if (gooda[0].HasCapsule() == true)
  609. {
  610. int sucheck = 0;
  611. if (!TryPushaste(gooda[0], game))
  612. {
  613. if (allworm.Length > 0)
  614. {
  615. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  616. gooda[0].Sail(allworm[0].Partner);
  617. else
  618. {
  619. gooda[0].Sail(gmother[0]);
  620. }
  621. }
  622. else
  623. {
  624. gooda[0].Sail(gmother[0]);
  625. }
  626. }
  627.  
  628.  
  629.  
  630. }
  631.  
  632.  
  633. if (gooda.Length > 2)
  634. {
  635. int m = 2;
  636. if (allworm.Length > 0)
  637. {
  638. for (int i = 0; i < allworm.Length; i++)
  639. {
  640.  
  641. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  642. {
  643.  
  644. if (!TryPushcapsule(gooda[m], game))
  645.  
  646. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  647. }
  648. }
  649. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  650. {
  651. if (enemyhas.Length == 0)
  652. if (!TryPushcapsule(gooda[m], game))
  653. {
  654. if (game.Turn % 2 == 0)
  655. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  656. else
  657. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  658. }
  659. if (enemyhas.Length == 1)
  660. {
  661. if (!TryPushcapsule(gooda[m], game))
  662. {
  663. if (game.Turn % 2 == 0)
  664. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  665. else
  666. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  667. }
  668.  
  669. }
  670. if (enemyhas.Length == 2)
  671. {
  672.  
  673. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  674. {
  675. if (gooda[m].Distance(enemyhas[0]) <= 300)
  676. {
  677. if (!TryPushcapsule(gooda[m], game))
  678. gooda[m].Sail(enemyhas[0]);
  679. }
  680. else
  681. {
  682. if (!TryPushcapsule(gooda[m], game))
  683. {
  684. if (game.Turn % 2 == 0)
  685. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  686. else
  687. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  688.  
  689. }
  690. }
  691.  
  692. }
  693. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  694. {
  695. if (gooda[m].Distance(enemyhas[1]) <= 300)
  696. {
  697. if (!TryPushcapsule(gooda[m], game))
  698. gooda[m].Sail(enemyhas[1]);
  699. }
  700. else
  701. {
  702. if (!TryPushcapsule(gooda[m], game))
  703. {
  704. if (game.Turn % 2 == 0)
  705. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  706. else
  707. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  708.  
  709. }
  710. }
  711. }
  712. }
  713.  
  714. }
  715. }
  716. else
  717. {
  718. if (enemyhas.Length == 0)
  719. if (!TryPushcapsule(gooda[m], game))
  720. {
  721. if (game.Turn % 2 == 0)
  722. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  723. else
  724. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  725. }
  726. if (enemyhas.Length == 1)
  727. {
  728. if (!TryPushcapsule(gooda[m], game))
  729. {
  730. if (game.Turn % 2 == 0)
  731. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  732. else
  733. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  734. }
  735.  
  736. }
  737. if (enemyhas.Length == 2)
  738. {
  739.  
  740. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  741. {
  742. if (gooda[m].Distance(enemyhas[0]) <= 300)
  743. {
  744. if (!TryPushcapsule(gooda[m], game))
  745. gooda[m].Sail(enemyhas[0]);
  746. }
  747. else
  748. {
  749. if (!TryPushcapsule(gooda[m], game))
  750. {
  751. if (game.Turn % 2 == 0)
  752. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  753. else
  754. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  755.  
  756. }
  757. }
  758.  
  759. }
  760. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  761. {
  762. if (gooda[m].Distance(enemyhas[1]) <= 300)
  763. {
  764. if (!TryPushcapsule(gooda[m], game))
  765. gooda[m].Sail(enemyhas[1]);
  766. }
  767. else
  768. {
  769. if (!TryPushcapsule(gooda[m], game))
  770. {
  771. if (game.Turn % 2 == 0)
  772. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  773. else
  774. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  775.  
  776. }
  777. }
  778. }
  779. }
  780.  
  781. }
  782. }
  783.  
  784.  
  785.  
  786.  
  787. if (gooda.Length > 3)
  788. {
  789. int m = 3;
  790. if (allworm.Length > 0)
  791. {
  792. for (int i = 0; i < allworm.Length; i++)
  793. {
  794.  
  795. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  796. {
  797.  
  798. if (!TryPushcapsule(gooda[m], game))
  799.  
  800. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  801. }
  802. }
  803. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  804. {
  805. if (enemyhas.Length == 0)
  806. if (!TryPushcapsule(gooda[m], game))
  807. {
  808. if (game.Turn % 2 == 0)
  809. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  810. else
  811. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  812. }
  813. if (enemyhas.Length == 1)
  814. {
  815. if (!TryPushcapsule(gooda[m], game))
  816. {
  817. if (game.Turn % 2 == 0)
  818. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  819. else
  820. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  821. }
  822.  
  823. }
  824. if (enemyhas.Length == 2)
  825. {
  826.  
  827. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  828. {
  829. if (gooda[m].Distance(enemyhas[0]) <= 300)
  830. {
  831. if (!TryPushcapsule(gooda[m], game))
  832. gooda[m].Sail(enemyhas[0]);
  833. }
  834. else
  835. {
  836. if (!TryPushcapsule(gooda[m], game))
  837. {
  838. if (game.Turn % 2 == 0)
  839. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  840. else
  841. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  842.  
  843. }
  844. }
  845.  
  846. }
  847. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  848. {
  849. if (gooda[m].Distance(enemyhas[1]) <= 300)
  850. {
  851. if (!TryPushcapsule(gooda[m], game))
  852. gooda[m].Sail(enemyhas[1]);
  853. }
  854. else
  855. {
  856. if (!TryPushcapsule(gooda[m], game))
  857. {
  858. if (game.Turn % 2 == 0)
  859. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  860. else
  861. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  862.  
  863. }
  864. }
  865. }
  866. }
  867.  
  868. }
  869. }
  870. else
  871. {
  872. if (enemyhas.Length == 0)
  873. if (!TryPushcapsule(gooda[m], game))
  874. {
  875. if (game.Turn % 2 == 0)
  876. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  877. else
  878. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  879. }
  880. if (enemyhas.Length == 1)
  881. {
  882. if (!TryPushcapsule(gooda[m], game))
  883. {
  884. if (game.Turn % 2 == 0)
  885. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  886. else
  887. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  888. }
  889.  
  890. }
  891. if (enemyhas.Length == 2)
  892. {
  893.  
  894. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  895. {
  896. if (gooda[m].Distance(enemyhas[0]) <= 300)
  897. {
  898. if (!TryPushcapsule(gooda[m], game))
  899. gooda[m].Sail(enemyhas[0]);
  900. }
  901. else
  902. {
  903. if (!TryPushcapsule(gooda[m], game))
  904. {
  905. if (game.Turn % 2 == 0)
  906. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  907. else
  908. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  909.  
  910. }
  911. }
  912.  
  913. }
  914. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  915. {
  916. if (gooda[m].Distance(enemyhas[1]) <= 300)
  917. {
  918. if (!TryPushcapsule(gooda[m], game))
  919. gooda[m].Sail(enemyhas[1]);
  920. }
  921. else
  922. {
  923. if (!TryPushcapsule(gooda[m], game))
  924. {
  925. if (game.Turn % 2 == 0)
  926. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  927. else
  928. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  929.  
  930. }
  931. }
  932. }
  933. }
  934.  
  935. }
  936. }
  937. if (gooda.Length > 4)
  938. {
  939. int m = 4;
  940. if (allworm.Length > 0)
  941. {
  942. for (int i = 0; i < allworm.Length; i++)
  943. {
  944.  
  945. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  946. {
  947.  
  948. if (!TryPushcapsule(gooda[m], game))
  949.  
  950. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  951. }
  952. }
  953. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  954. {
  955. if (enemyhas.Length == 0)
  956. if (!TryPushcapsule(gooda[m], game))
  957. {
  958. if (game.Turn % 2 == 0)
  959. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  960. else
  961. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  962. }
  963. if (enemyhas.Length == 1)
  964. {
  965. if (!TryPushcapsule(gooda[m], game))
  966. {
  967. if (game.Turn % 2 == 0)
  968. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  969. else
  970. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  971. }
  972.  
  973. }
  974. if (enemyhas.Length == 2)
  975. {
  976.  
  977. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  978. {
  979. if (gooda[m].Distance(enemyhas[0]) <= 300)
  980. {
  981. if (!TryPushcapsule(gooda[m], game))
  982. gooda[m].Sail(enemyhas[0]);
  983. }
  984. else
  985. {
  986. if (!TryPushcapsule(gooda[m], game))
  987. {
  988. if (game.Turn % 2 == 0)
  989. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  990. else
  991. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  992.  
  993. }
  994. }
  995.  
  996. }
  997. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  998. {
  999. if (gooda[m].Distance(enemyhas[1]) <= 300)
  1000. {
  1001. if (!TryPushcapsule(gooda[m], game))
  1002. gooda[m].Sail(enemyhas[1]);
  1003. }
  1004. else
  1005. {
  1006. if (!TryPushcapsule(gooda[m], game))
  1007. {
  1008. if (game.Turn % 2 == 0)
  1009. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  1010. else
  1011. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  1012.  
  1013. }
  1014. }
  1015. }
  1016. }
  1017.  
  1018. }
  1019. }
  1020. else
  1021. {
  1022. if (enemyhas.Length == 0)
  1023. if (!TryPushcapsule(gooda[m], game))
  1024. {
  1025. if (game.Turn % 2 == 0)
  1026. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  1027. else
  1028. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  1029. }
  1030. if (enemyhas.Length == 1)
  1031. {
  1032. if (!TryPushcapsule(gooda[m], game))
  1033. {
  1034. if (game.Turn % 2 == 0)
  1035. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  1036. else
  1037. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  1038. }
  1039.  
  1040. }
  1041. if (enemyhas.Length == 2)
  1042. {
  1043.  
  1044. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1045. {
  1046. if (gooda[m].Distance(enemyhas[0]) <= 300)
  1047. {
  1048. if (!TryPushcapsule(gooda[m], game))
  1049. gooda[m].Sail(enemyhas[0]);
  1050. }
  1051. else
  1052. {
  1053. if (!TryPushcapsule(gooda[m], game))
  1054. {
  1055. if (game.Turn % 2 == 0)
  1056. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  1057. else
  1058. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  1059.  
  1060. }
  1061. }
  1062.  
  1063. }
  1064. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1065. {
  1066. if (gooda[m].Distance(enemyhas[1]) <= 300)
  1067. {
  1068. if (!TryPushcapsule(gooda[m], game))
  1069. gooda[m].Sail(enemyhas[1]);
  1070. }
  1071. else
  1072. {
  1073. if (!TryPushcapsule(gooda[m], game))
  1074. {
  1075. if (game.Turn % 2 == 0)
  1076. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  1077. else
  1078. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  1079.  
  1080. }
  1081. }
  1082. }
  1083. }
  1084.  
  1085. }
  1086. }
  1087.  
  1088. //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]); }
  1089.  
  1090.  
  1091. System.Console.WriteLine(enemy[0].PushRange);
  1092.  
  1093.  
  1094. if (gooda.Length > 5)
  1095. {
  1096. int m = 5;
  1097. if (allworm.Length > 0)
  1098. {
  1099. for (int i = 0; i < allworm.Length; i++)
  1100. {
  1101.  
  1102. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  1103. {
  1104.  
  1105. if (!TryPushcapsule(gooda[m], game))
  1106.  
  1107. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  1108. }
  1109. }
  1110. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  1111. {
  1112. if (enemyhas.Length == 0)
  1113. {
  1114. if (!TryPushcapsule(gooda[m], game))
  1115. {
  1116. if (game.Turn % 2 == 0)
  1117. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  1118. else
  1119. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  1120. }
  1121. }
  1122. if (enemyhas.Length == 1)
  1123. {
  1124. if (!TryPushcapsule(gooda[m], game))
  1125. if (game.Turn % 2 == 0)
  1126. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1127. else
  1128. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1129. }
  1130. if (enemyhas.Length == 2)
  1131. {
  1132. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1133. if (!TryPushcapsule(gooda[m], game))
  1134. {
  1135. if (game.Turn % 2 == 0)
  1136. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1137. else
  1138. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1139. }
  1140.  
  1141. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1142. if (!TryPushcapsule(gooda[m], game))
  1143. {
  1144. if (game.Turn % 2 == 0)
  1145. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  1146. else
  1147. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1148. }
  1149.  
  1150.  
  1151. }
  1152.  
  1153. }
  1154. }
  1155. else
  1156. {
  1157. if (enemyhas.Length == 0)
  1158. {
  1159. if (!TryPushcapsule(gooda[m], game))
  1160. {
  1161. if (game.Turn % 2 == 0)
  1162. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  1163. else
  1164. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  1165. }
  1166. }
  1167. if (enemyhas.Length == 1)
  1168. {
  1169. if (!TryPushcapsule(gooda[m], game))
  1170. if (game.Turn % 2 == 0)
  1171. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1172. else
  1173. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1174. }
  1175. if (enemyhas.Length == 2)
  1176. {
  1177. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1178. if (!TryPushcapsule(gooda[m], game))
  1179. {
  1180. if (game.Turn % 2 == 0)
  1181. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1182. else
  1183. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1184. }
  1185.  
  1186. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1187. if (!TryPushcapsule(gooda[m], game))
  1188. {
  1189. if (game.Turn % 2 == 0)
  1190. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  1191. else
  1192. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1193. }
  1194.  
  1195.  
  1196.  
  1197. }
  1198. // 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]); }
  1199. }
  1200. }
  1201.  
  1202. if (gooda.Length > 6)
  1203. {
  1204. int m = 6;
  1205. if (allworm.Length > 0)
  1206. {
  1207. for (int i = 0; i < allworm.Length; i++)
  1208. {
  1209.  
  1210. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  1211. {
  1212.  
  1213. if (!TryPushcapsule(gooda[m], game))
  1214.  
  1215. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  1216. }
  1217. }
  1218. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  1219. {
  1220. if (enemyhas.Length == 0)
  1221. {
  1222. if (!TryPushcapsule(gooda[m], game))
  1223. {
  1224. if (game.Turn % 2 == 0)
  1225. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  1226. else
  1227. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  1228. }
  1229. }
  1230. if (enemyhas.Length == 1)
  1231. {
  1232. if (!TryPushcapsule(gooda[m], game))
  1233. if (game.Turn % 2 == 0)
  1234. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1235. else
  1236. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1237. }
  1238. if (enemyhas.Length == 2)
  1239. {
  1240. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1241. if (!TryPushcapsule(gooda[m], game))
  1242. {
  1243. if (game.Turn % 2 == 0)
  1244. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1245. else
  1246. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1247. }
  1248.  
  1249. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1250. if (!TryPushcapsule(gooda[m], game))
  1251. {
  1252. if (game.Turn % 2 == 0)
  1253. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  1254. else
  1255. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1256. }
  1257.  
  1258.  
  1259. }
  1260.  
  1261. }
  1262. }
  1263. else
  1264. {
  1265. if (enemyhas.Length == 0)
  1266. {
  1267. if (!TryPushcapsule(gooda[m], game))
  1268. {
  1269. if (game.Turn % 2 == 0)
  1270. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  1271. else
  1272. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  1273. }
  1274. }
  1275. if (enemyhas.Length == 1)
  1276. {
  1277. if (!TryPushcapsule(gooda[m], game))
  1278. if (game.Turn % 2 == 0)
  1279. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1280. else
  1281. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1282. }
  1283. if (enemyhas.Length == 2)
  1284. {
  1285. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1286. if (!TryPushcapsule(gooda[m], game))
  1287. {
  1288. if (game.Turn % 2 == 0)
  1289. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1290. else
  1291. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1292. }
  1293.  
  1294. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1295. if (!TryPushcapsule(gooda[m], game))
  1296. {
  1297. if (game.Turn % 2 == 0)
  1298. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  1299. else
  1300. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1301. }
  1302.  
  1303.  
  1304.  
  1305. }
  1306. // 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]); }
  1307. }
  1308. // 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]); }
  1309. }
  1310.  
  1311. if (gooda.Length > 8)
  1312. {
  1313. int m = 8;
  1314. if (allworm.Length > 0)
  1315. {
  1316. for (int i = 0; i < allworm.Length; i++)
  1317. {
  1318.  
  1319. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  1320. {
  1321.  
  1322. if (!TryPushcapsule(gooda[m], game))
  1323.  
  1324. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  1325. }
  1326. }
  1327. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  1328. {
  1329. if (enemyhas.Length == 0)
  1330. {
  1331. if (!TryPushcapsule(gooda[m], game))
  1332. {
  1333. if (game.Turn % 2 == 0)
  1334. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  1335. else
  1336. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  1337. }
  1338. }
  1339. if (enemyhas.Length == 1)
  1340. {
  1341. if (!TryPushcapsule(gooda[m], game))
  1342. if (game.Turn % 2 == 0)
  1343. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1344. else
  1345. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1346. }
  1347. if (enemyhas.Length == 2)
  1348. {
  1349. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1350. if (!TryPushcapsule(gooda[m], game))
  1351. {
  1352. if (game.Turn % 2 == 0)
  1353. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1354. else
  1355. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1356. }
  1357.  
  1358. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1359. if (!TryPushcapsule(gooda[m], game))
  1360. {
  1361. if (game.Turn % 2 == 0)
  1362. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  1363. else
  1364. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1365. }
  1366.  
  1367.  
  1368. }
  1369.  
  1370. }
  1371. }
  1372. else
  1373. {
  1374. if (enemyhas.Length == 0)
  1375. {
  1376. if (!TryPushcapsule(gooda[m], game))
  1377. {
  1378. if (game.Turn % 2 == 0)
  1379. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  1380. else
  1381. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  1382. }
  1383. }
  1384. if (enemyhas.Length == 1)
  1385. {
  1386. if (!TryPushcapsule(gooda[m], game))
  1387. if (game.Turn % 2 == 0)
  1388. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1389. else
  1390. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1391. }
  1392. if (enemyhas.Length == 2)
  1393. {
  1394. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1395. if (!TryPushcapsule(gooda[m], game))
  1396. {
  1397. if (game.Turn % 2 == 0)
  1398. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  1399. else
  1400. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1401. }
  1402.  
  1403. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1404. if (!TryPushcapsule(gooda[m], game))
  1405. {
  1406. if (game.Turn % 2 == 0)
  1407. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  1408. else
  1409. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  1410. }
  1411.  
  1412.  
  1413.  
  1414. }
  1415. // 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]); }
  1416. }
  1417. // 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]); }
  1418. }
  1419.  
  1420. if (gooda.Length > 9)
  1421. {
  1422. int m = 9;
  1423. if (allworm.Length > 0)
  1424. {
  1425. for (int i = 0; i < allworm.Length; i++)
  1426. {
  1427.  
  1428. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  1429. {
  1430.  
  1431. if (!TryPushcapsule(gooda[m], game))
  1432.  
  1433. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  1434. }
  1435. }
  1436. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  1437. {
  1438. if (enemyhas.Length == 0)
  1439. if (!TryPushcapsule(gooda[m], game))
  1440. {
  1441. if (game.Turn % 2 == 0)
  1442. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  1443. else
  1444. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  1445. }
  1446. if (enemyhas.Length == 1)
  1447. {
  1448. if (!TryPushcapsule(gooda[m], game))
  1449. {
  1450. if (game.Turn % 2 == 0)
  1451. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  1452. else
  1453. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  1454. }
  1455.  
  1456. }
  1457. if (enemyhas.Length == 2)
  1458. {
  1459.  
  1460. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1461. {
  1462. if (gooda[m].Distance(enemyhas[0]) <= 300)
  1463. {
  1464. if (!TryPushcapsule(gooda[m], game))
  1465. gooda[m].Sail(enemyhas[0]);
  1466. }
  1467. else
  1468. {
  1469. if (!TryPushcapsule(gooda[m], game))
  1470. {
  1471. if (game.Turn % 2 == 0)
  1472. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  1473. else
  1474. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  1475.  
  1476. }
  1477. }
  1478.  
  1479. }
  1480. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1481. {
  1482. if (gooda[m].Distance(enemyhas[1]) <= 300)
  1483. {
  1484. if (!TryPushcapsule(gooda[m], game))
  1485. gooda[m].Sail(enemyhas[1]);
  1486. }
  1487. else
  1488. {
  1489. if (!TryPushcapsule(gooda[m], game))
  1490. {
  1491. if (game.Turn % 2 == 0)
  1492. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  1493. else
  1494. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  1495.  
  1496. }
  1497. }
  1498. }
  1499. }
  1500.  
  1501. }
  1502. }
  1503. else
  1504. {
  1505. if (enemyhas.Length == 0)
  1506. if (!TryPushcapsule(gooda[m], game))
  1507. {
  1508. if (game.Turn % 2 == 0)
  1509. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  1510. else
  1511. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  1512. }
  1513. if (enemyhas.Length == 1)
  1514. {
  1515. if (!TryPushcapsule(gooda[m], game))
  1516. {
  1517. if (game.Turn % 2 == 0)
  1518. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  1519. else
  1520. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  1521. }
  1522.  
  1523. }
  1524. if (enemyhas.Length == 2)
  1525. {
  1526.  
  1527. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1528. {
  1529. if (gooda[m].Distance(enemyhas[0]) <= 300)
  1530. {
  1531. if (!TryPushcapsule(gooda[m], game))
  1532. gooda[m].Sail(enemyhas[0]);
  1533. }
  1534. else
  1535. {
  1536. if (!TryPushcapsule(gooda[m], game))
  1537. {
  1538. if (game.Turn % 2 == 0)
  1539. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  1540. else
  1541. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  1542.  
  1543. }
  1544. }
  1545.  
  1546. }
  1547. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1548. {
  1549. if (gooda[m].Distance(enemyhas[1]) <= 300)
  1550. {
  1551. if (!TryPushcapsule(gooda[m], game))
  1552. gooda[m].Sail(enemyhas[1]);
  1553. }
  1554. else
  1555. {
  1556. if (!TryPushcapsule(gooda[m], game))
  1557. {
  1558. if (game.Turn % 2 == 0)
  1559. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  1560. else
  1561. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  1562.  
  1563. }
  1564. }
  1565. }
  1566. }
  1567.  
  1568. }
  1569. // 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]); }
  1570. }
  1571. }
  1572. }
  1573.  
  1574. if (game.GetEnemy().BotName == "26068")
  1575. {
  1576. {
  1577. if (allworm.Length > 0)
  1578. {
  1579. if (gooda.Length > 7)
  1580. if (!TryPushcapsuleBotWorm(gooda[7], game))
  1581. gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  1582.  
  1583.  
  1584. if (gooda.Length > 1)
  1585. {
  1586. if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
  1587. {
  1588. if (!TryPushcapsuleBotWorm(gooda[1], game))
  1589. gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  1590. }
  1591. else
  1592. {
  1593. if (!TryPushcapsuleBotWorm2(gooda[1], game))
  1594. gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
  1595. }
  1596. }
  1597. }
  1598. if (gooda.Length > 2)
  1599. {
  1600. if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
  1601. {
  1602. if (!TryPush(gooda[0], game))
  1603. gooda[0].Sail(gcapsule[0].InitialLocation);
  1604. if (!TryPush(gooda[2], game))
  1605. {
  1606. if (allworm.Length > 0)
  1607. {
  1608. 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)
  1609. gooda[2].Sail(allworm[0]);
  1610. else
  1611. gooda[2].Sail(gcapsule[1].InitialLocation);
  1612. }
  1613. else
  1614. gooda[2].Sail(gcapsule[1].InitialLocation);
  1615. }
  1616.  
  1617. }
  1618.  
  1619. if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
  1620. {
  1621. int sucheck = 0;
  1622. if (!TryPushaste(gooda[0], game))
  1623. {
  1624. if (allworm.Length > 0)
  1625. {
  1626. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  1627. gooda[0].Sail(allworm[0].Partner);
  1628. else
  1629. {
  1630. if (gooda[0].Distance(gmother[0]) <= 2000)
  1631. {
  1632. if (gooda[0].StateName != "heavy")
  1633. {
  1634. foreach (Pirate good2 in game.GetMyLivingPirates())
  1635. {
  1636. if (gooda[0].StateName != "heavy")
  1637. {
  1638. if (good2.StateName == "heavy" && sucheck == 0)
  1639. {
  1640. gooda[0].SwapStates(good2);
  1641. sucheck = 1;
  1642. }
  1643. }
  1644.  
  1645. }
  1646. }
  1647. if (sucheck == 0 && gooda[0].StateName == "heavy")
  1648. {
  1649. gooda[0].Sail(gmother[0]);
  1650. }
  1651. }
  1652. else
  1653. gooda[0].Sail(gmother[0]);
  1654. }
  1655. }
  1656. else
  1657. {
  1658. if (gooda[0].Distance(gmother[0]) <= 2000)
  1659. {
  1660. if (gooda[0].StateName != "heavy")
  1661. {
  1662. foreach (Pirate good2 in game.GetMyLivingPirates())
  1663. {
  1664. if (gooda[0].StateName != "heavy")
  1665. {
  1666. if (good2.StateName == "heavy" && sucheck == 0)
  1667. {
  1668. gooda[0].SwapStates(good2);
  1669. sucheck = 1;
  1670. }
  1671. }
  1672.  
  1673. }
  1674. }
  1675. if (sucheck == 0 && gooda[0].StateName == "heavy")
  1676. {
  1677. gooda[0].Sail(gmother[0]);
  1678. }
  1679. }
  1680. else
  1681. gooda[0].Sail(gmother[0]);
  1682. }
  1683. }
  1684. if (!TryPushcapsuleattack(gooda[2], game))
  1685. {
  1686. gooda[2].Sail(gcapsule[1].InitialLocation);
  1687.  
  1688. }
  1689.  
  1690.  
  1691. }
  1692.  
  1693. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
  1694. {
  1695. int checker2 = 0;
  1696. gooda[0].Sail(gcapsule[0].InitialLocation);
  1697.  
  1698. if (!TryPushcapsuleattack2(gooda[2], game))
  1699. {
  1700. if (allworm.Length > 0)
  1701. {
  1702. if ((gooda[2].Distance(gmother[0]) >= gooda[2].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  1703. gooda[2].Sail(allworm[0].Partner);
  1704. else
  1705. {
  1706.  
  1707.  
  1708. gooda[2].Sail(gmother[0]);
  1709.  
  1710.  
  1711.  
  1712. }
  1713. }
  1714. else
  1715. {
  1716. if (gooda[2].Distance(gmother[0]) <= 2000)
  1717. {
  1718. if (gooda[2].StateName != "heavy")
  1719. {
  1720. for (int m = 1; m < gooda.Length; m++)
  1721. {
  1722. if (gooda[2].StateName != "heavy")
  1723. {
  1724. if (gooda[m].StateName == "heavy" && checker2 == 0)
  1725. {
  1726. gooda[2].SwapStates(gooda[m]);
  1727. checker2 = 1;
  1728. }
  1729. }
  1730.  
  1731. }
  1732. }
  1733. if (checker2 == 0 && gooda[2].StateName == "heavy")
  1734. {
  1735. gooda[2].Sail(gmother[0]);
  1736. }
  1737.  
  1738. }
  1739. else
  1740. gooda[2].Sail(gmother[0]);
  1741.  
  1742.  
  1743.  
  1744. }
  1745. }
  1746.  
  1747.  
  1748.  
  1749.  
  1750. }
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
  1757. {
  1758. int checker3 = 0;
  1759. int checker4 = 0;
  1760. if (!TryPushaste(gooda[0], game))
  1761. {
  1762. if (allworm.Length > 0)
  1763. {
  1764. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  1765. gooda[0].Sail(allworm[0].Partner);
  1766. else
  1767. {
  1768. if (gooda[0].Distance(gmother[0]) <= 2000)
  1769. {
  1770. if (gooda[0].StateName != "heavy")
  1771. {
  1772. foreach (Pirate good2 in game.GetMyLivingPirates())
  1773. {
  1774. if (gooda[0].StateName != "heavy")
  1775. {
  1776. if (good2.StateName == "heavy" && checker3 == 0)
  1777. {
  1778. gooda[0].SwapStates(good2);
  1779. checker3 = 1;
  1780. }
  1781. }
  1782.  
  1783. }
  1784. }
  1785. if (checker3 == 0 && gooda[0].StateName == "heavy")
  1786. {
  1787. gooda[0].Sail(gmother[0]);
  1788. }
  1789. }
  1790. else
  1791. gooda[0].Sail(gmother[0]);
  1792. }
  1793. }
  1794. else
  1795. {
  1796. if (gooda[0].Distance(gmother[0]) <= 2000)
  1797. {
  1798. if (gooda[0].StateName != "heavy")
  1799. {
  1800. foreach (Pirate good2 in game.GetMyLivingPirates())
  1801. {
  1802. if (gooda[0].StateName != "heavy")
  1803. {
  1804. if (good2.StateName == "heavy" && checker3 == 0)
  1805. {
  1806. gooda[0].SwapStates(good2);
  1807. checker3 = 1;
  1808. }
  1809. }
  1810.  
  1811. }
  1812. }
  1813. if (checker3 == 0 && gooda[0].StateName == "heavy")
  1814. {
  1815. gooda[0].Sail(gmother[0]);
  1816. }
  1817. }
  1818. else
  1819. gooda[0].Sail(gmother[0]);
  1820.  
  1821. }
  1822. }
  1823. if (!TryPushcapsuleattack2(gooda[2], game))
  1824. {
  1825. if (allworm.Length > 0)
  1826. {
  1827. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  1828. gooda[2].Sail(allworm[0].Partner);
  1829. else
  1830. {
  1831. if (gooda[2].Distance(gmother[0]) <= 2000)
  1832. {
  1833. if (gooda[2].StateName != "heavy")
  1834. {
  1835. for (int m = 1; m < gooda.Length; m++)
  1836. {
  1837. if (gooda[2].StateName != "heavy")
  1838. {
  1839. if (gooda[m].StateName == "heavy" && checker4 == 0)
  1840. {
  1841. gooda[2].SwapStates(gooda[m]);
  1842. checker4 = 1;
  1843. }
  1844. }
  1845.  
  1846. }
  1847. }
  1848. if (checker4 == 0 && gooda[2].StateName == "heavy")
  1849. {
  1850. gooda[2].Sail(gmother[0]);
  1851. }
  1852.  
  1853. }
  1854. else
  1855. gooda[2].Sail(gmother[0]);
  1856.  
  1857.  
  1858.  
  1859. }
  1860. }
  1861. else
  1862. {
  1863. if (gooda[2].Distance(gmother[0]) <= 2000)
  1864. {
  1865. if (gooda[2].StateName != "heavy")
  1866. {
  1867. for (int m = 1; m < gooda.Length; m++)
  1868. {
  1869. if (gooda[2].StateName != "heavy")
  1870. {
  1871. if (gooda[m].StateName == "heavy" && checker4 == 0)
  1872. {
  1873. gooda[2].SwapStates(gooda[m]);
  1874. checker4 = 1;
  1875. }
  1876. }
  1877.  
  1878. }
  1879. }
  1880. if (checker4 == 0 && gooda[2].StateName == "heavy")
  1881. {
  1882. gooda[2].Sail(gmother[0]);
  1883. }
  1884.  
  1885. }
  1886. else
  1887. gooda[2].Sail(gmother[0]);
  1888.  
  1889.  
  1890.  
  1891. }
  1892. }
  1893. }
  1894. }
  1895.  
  1896. if (gooda.Length > 3)
  1897. {
  1898. int m = 3;
  1899. if (allworm.Length > 0)
  1900. {
  1901. for (int i = 0; i < allworm.Length; i++)
  1902. {
  1903.  
  1904. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  1905. {
  1906.  
  1907. if (!TryPushcapsule(gooda[m], game))
  1908.  
  1909. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  1910. }
  1911. }
  1912. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  1913. {
  1914. if (enemyhas.Length == 0)
  1915. if (!TryPushcapsule(gooda[m], game))
  1916. {
  1917. if (game.Turn % 2 == 0)
  1918. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  1919. else
  1920. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  1921. }
  1922. if (enemyhas.Length == 1)
  1923. {
  1924. if (!TryPushcapsule(gooda[m], game))
  1925. {
  1926. if (game.Turn % 2 == 0)
  1927. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  1928. else
  1929. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  1930. }
  1931.  
  1932. }
  1933. if (enemyhas.Length == 2)
  1934. {
  1935.  
  1936. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  1937. {
  1938. if (gooda[m].Distance(enemyhas[0]) <= 300)
  1939. {
  1940. if (!TryPushcapsule(gooda[m], game))
  1941. gooda[m].Sail(enemyhas[0]);
  1942. }
  1943. else
  1944. {
  1945. if (!TryPushcapsule(gooda[m], game))
  1946. {
  1947. if (game.Turn % 2 == 0)
  1948. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  1949. else
  1950. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  1951.  
  1952. }
  1953. }
  1954.  
  1955. }
  1956. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  1957. {
  1958. if (gooda[m].Distance(enemyhas[1]) <= 300)
  1959. {
  1960. if (!TryPushcapsule(gooda[m], game))
  1961. gooda[m].Sail(enemyhas[1]);
  1962. }
  1963. else
  1964. {
  1965. if (!TryPushcapsule(gooda[m], game))
  1966. {
  1967. if (game.Turn % 2 == 0)
  1968. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  1969. else
  1970. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  1971.  
  1972. }
  1973. }
  1974. }
  1975. }
  1976.  
  1977. }
  1978. }
  1979. else
  1980. {
  1981. if (enemyhas.Length == 0)
  1982. if (!TryPushcapsule(gooda[m], game))
  1983. {
  1984. if (game.Turn % 2 == 0)
  1985. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  1986. else
  1987. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  1988. }
  1989. if (enemyhas.Length == 1)
  1990. {
  1991. if (!TryPushcapsule(gooda[m], game))
  1992. {
  1993. if (game.Turn % 2 == 0)
  1994. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  1995. else
  1996. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  1997. }
  1998.  
  1999. }
  2000. if (enemyhas.Length == 2)
  2001. {
  2002.  
  2003. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2004. {
  2005. if (gooda[m].Distance(enemyhas[0]) <= 300)
  2006. {
  2007. if (!TryPushcapsule(gooda[m], game))
  2008. gooda[m].Sail(enemyhas[0]);
  2009. }
  2010. else
  2011. {
  2012. if (!TryPushcapsule(gooda[m], game))
  2013. {
  2014. if (game.Turn % 2 == 0)
  2015. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  2016. else
  2017. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  2018.  
  2019. }
  2020. }
  2021.  
  2022. }
  2023. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2024. {
  2025. if (gooda[m].Distance(enemyhas[1]) <= 300)
  2026. {
  2027. if (!TryPushcapsule(gooda[m], game))
  2028. gooda[m].Sail(enemyhas[1]);
  2029. }
  2030. else
  2031. {
  2032. if (!TryPushcapsule(gooda[m], game))
  2033. {
  2034. if (game.Turn % 2 == 0)
  2035. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  2036. else
  2037. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  2038.  
  2039. }
  2040. }
  2041. }
  2042. }
  2043.  
  2044. }
  2045. }
  2046. if (gooda.Length > 4)
  2047. {
  2048. int m = 4;
  2049. if (allworm.Length > 0)
  2050. {
  2051. for (int i = 0; i < allworm.Length; i++)
  2052. {
  2053.  
  2054. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  2055. {
  2056.  
  2057. if (!TryPushcapsule(gooda[m], game))
  2058.  
  2059. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  2060. }
  2061. }
  2062. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  2063. {
  2064. if (enemyhas.Length == 0)
  2065. if (!TryPushcapsule(gooda[m], game))
  2066. {
  2067. if (game.Turn % 2 == 0)
  2068. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  2069. else
  2070. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  2071. }
  2072. if (enemyhas.Length == 1)
  2073. {
  2074. if (!TryPushcapsule(gooda[m], game))
  2075. {
  2076. if (game.Turn % 2 == 0)
  2077. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  2078. else
  2079. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  2080. }
  2081.  
  2082. }
  2083. if (enemyhas.Length == 2)
  2084. {
  2085.  
  2086. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2087. {
  2088. if (gooda[m].Distance(enemyhas[0]) <= 300)
  2089. {
  2090. if (!TryPushcapsule(gooda[m], game))
  2091. gooda[m].Sail(enemyhas[0]);
  2092. }
  2093. else
  2094. {
  2095. if (!TryPushcapsule(gooda[m], game))
  2096. {
  2097. if (game.Turn % 2 == 0)
  2098. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  2099. else
  2100. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  2101.  
  2102. }
  2103. }
  2104.  
  2105. }
  2106. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2107. {
  2108. if (gooda[m].Distance(enemyhas[1]) <= 300)
  2109. {
  2110. if (!TryPushcapsule(gooda[m], game))
  2111. gooda[m].Sail(enemyhas[1]);
  2112. }
  2113. else
  2114. {
  2115. if (!TryPushcapsule(gooda[m], game))
  2116. {
  2117. if (game.Turn % 2 == 0)
  2118. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  2119. else
  2120. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  2121.  
  2122. }
  2123. }
  2124. }
  2125. }
  2126.  
  2127. }
  2128. }
  2129. else
  2130. {
  2131. if (enemyhas.Length == 0)
  2132. if (!TryPushcapsule(gooda[m], game))
  2133. {
  2134. if (game.Turn % 2 == 0)
  2135. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  2136. else
  2137. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  2138. }
  2139. if (enemyhas.Length == 1)
  2140. {
  2141. if (!TryPushcapsule(gooda[m], game))
  2142. {
  2143. if (game.Turn % 2 == 0)
  2144. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  2145. else
  2146. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  2147. }
  2148.  
  2149. }
  2150. if (enemyhas.Length == 2)
  2151. {
  2152.  
  2153. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2154. {
  2155. if (gooda[m].Distance(enemyhas[0]) <= 300)
  2156. {
  2157. if (!TryPushcapsule(gooda[m], game))
  2158. gooda[m].Sail(enemyhas[0]);
  2159. }
  2160. else
  2161. {
  2162. if (!TryPushcapsule(gooda[m], game))
  2163. {
  2164. if (game.Turn % 2 == 0)
  2165. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  2166. else
  2167. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  2168.  
  2169. }
  2170. }
  2171.  
  2172. }
  2173. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2174. {
  2175. if (gooda[m].Distance(enemyhas[1]) <= 300)
  2176. {
  2177. if (!TryPushcapsule(gooda[m], game))
  2178. gooda[m].Sail(enemyhas[1]);
  2179. }
  2180. else
  2181. {
  2182. if (!TryPushcapsule(gooda[m], game))
  2183. {
  2184. if (game.Turn % 2 == 0)
  2185. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  2186. else
  2187. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  2188.  
  2189. }
  2190. }
  2191. }
  2192. }
  2193.  
  2194. }
  2195. }
  2196.  
  2197. //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]); }
  2198.  
  2199.  
  2200. System.Console.WriteLine(enemy[0].PushRange);
  2201.  
  2202.  
  2203. if (gooda.Length > 5)
  2204. {
  2205. int m = 5;
  2206. if (allworm.Length > 0)
  2207. {
  2208. for (int i = 0; i < allworm.Length; i++)
  2209. {
  2210.  
  2211. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  2212. {
  2213.  
  2214. if (!TryPushcapsule(gooda[m], game))
  2215.  
  2216. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  2217. }
  2218. }
  2219. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  2220. {
  2221. if (enemyhas.Length == 0)
  2222. {
  2223. if (!TryPushcapsule(gooda[m], game))
  2224. {
  2225. if (game.Turn % 2 == 0)
  2226. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  2227. else
  2228. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  2229. }
  2230. }
  2231. if (enemyhas.Length == 1)
  2232. {
  2233. if (!TryPushcapsule(gooda[m], game))
  2234. if (game.Turn % 2 == 0)
  2235. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2236. else
  2237. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2238. }
  2239. if (enemyhas.Length == 2)
  2240. {
  2241. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2242. if (!TryPushcapsule(gooda[m], game))
  2243. {
  2244. if (game.Turn % 2 == 0)
  2245. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2246. else
  2247. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2248. }
  2249.  
  2250. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2251. if (!TryPushcapsule(gooda[m], game))
  2252. {
  2253. if (game.Turn % 2 == 0)
  2254. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  2255. else
  2256. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2257. }
  2258.  
  2259.  
  2260. }
  2261.  
  2262. }
  2263. }
  2264. else
  2265. {
  2266. if (enemyhas.Length == 0)
  2267. {
  2268. if (!TryPushcapsule(gooda[m], game))
  2269. {
  2270. if (game.Turn % 2 == 0)
  2271. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  2272. else
  2273. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  2274. }
  2275. }
  2276. if (enemyhas.Length == 1)
  2277. {
  2278. if (!TryPushcapsule(gooda[m], game))
  2279. if (game.Turn % 2 == 0)
  2280. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2281. else
  2282. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2283. }
  2284. if (enemyhas.Length == 2)
  2285. {
  2286. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2287. if (!TryPushcapsule(gooda[m], game))
  2288. {
  2289. if (game.Turn % 2 == 0)
  2290. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2291. else
  2292. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2293. }
  2294.  
  2295. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2296. if (!TryPushcapsule(gooda[m], game))
  2297. {
  2298. if (game.Turn % 2 == 0)
  2299. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  2300. else
  2301. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2302. }
  2303.  
  2304.  
  2305.  
  2306. }
  2307. // 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]); }
  2308. }
  2309. }
  2310.  
  2311. if (gooda.Length > 6)
  2312. {
  2313. int m = 6;
  2314. if (allworm.Length > 0)
  2315. {
  2316. for (int i = 0; i < allworm.Length; i++)
  2317. {
  2318.  
  2319. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  2320. {
  2321.  
  2322. if (!TryPushcapsule(gooda[m], game))
  2323.  
  2324. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  2325. }
  2326. }
  2327. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  2328. {
  2329. if (enemyhas.Length == 0)
  2330. {
  2331. if (!TryPushcapsule(gooda[m], game))
  2332. {
  2333. if (game.Turn % 2 == 0)
  2334. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  2335. else
  2336. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  2337. }
  2338. }
  2339. if (enemyhas.Length == 1)
  2340. {
  2341. if (!TryPushcapsule(gooda[m], game))
  2342. if (game.Turn % 2 == 0)
  2343. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2344. else
  2345. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2346. }
  2347. if (enemyhas.Length == 2)
  2348. {
  2349. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2350. if (!TryPushcapsule(gooda[m], game))
  2351. {
  2352. if (game.Turn % 2 == 0)
  2353. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2354. else
  2355. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2356. }
  2357.  
  2358. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2359. if (!TryPushcapsule(gooda[m], game))
  2360. {
  2361. if (game.Turn % 2 == 0)
  2362. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  2363. else
  2364. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2365. }
  2366.  
  2367.  
  2368. }
  2369.  
  2370. }
  2371. }
  2372. else
  2373. {
  2374. if (enemyhas.Length == 0)
  2375. {
  2376. if (!TryPushcapsule(gooda[m], game))
  2377. {
  2378. if (game.Turn % 2 == 0)
  2379. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  2380. else
  2381. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  2382. }
  2383. }
  2384. if (enemyhas.Length == 1)
  2385. {
  2386. if (!TryPushcapsule(gooda[m], game))
  2387. if (game.Turn % 2 == 0)
  2388. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2389. else
  2390. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2391. }
  2392. if (enemyhas.Length == 2)
  2393. {
  2394. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2395. if (!TryPushcapsule(gooda[m], game))
  2396. {
  2397. if (game.Turn % 2 == 0)
  2398. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2399. else
  2400. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2401. }
  2402.  
  2403. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2404. if (!TryPushcapsule(gooda[m], game))
  2405. {
  2406. if (game.Turn % 2 == 0)
  2407. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  2408. else
  2409. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2410. }
  2411.  
  2412.  
  2413.  
  2414. }
  2415. // 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]); }
  2416. }
  2417. // 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]); }
  2418. }
  2419.  
  2420. if (gooda.Length > 8)
  2421. {
  2422. int m = 8;
  2423. if (allworm.Length > 0)
  2424. {
  2425. for (int i = 0; i < allworm.Length; i++)
  2426. {
  2427.  
  2428. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  2429. {
  2430.  
  2431. if (!TryPushcapsule(gooda[m], game))
  2432.  
  2433. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  2434. }
  2435. }
  2436. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  2437. {
  2438. if (enemyhas.Length == 0)
  2439. {
  2440. if (!TryPushcapsule(gooda[m], game))
  2441. {
  2442. if (game.Turn % 2 == 0)
  2443. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  2444. else
  2445. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  2446. }
  2447. }
  2448. if (enemyhas.Length == 1)
  2449. {
  2450. if (!TryPushcapsule(gooda[m], game))
  2451. if (game.Turn % 2 == 0)
  2452. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2453. else
  2454. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2455. }
  2456. if (enemyhas.Length == 2)
  2457. {
  2458. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2459. if (!TryPushcapsule(gooda[m], game))
  2460. {
  2461. if (game.Turn % 2 == 0)
  2462. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2463. else
  2464. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2465. }
  2466.  
  2467. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2468. if (!TryPushcapsule(gooda[m], game))
  2469. {
  2470. if (game.Turn % 2 == 0)
  2471. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  2472. else
  2473. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2474. }
  2475.  
  2476.  
  2477. }
  2478.  
  2479. }
  2480. }
  2481. else
  2482. {
  2483. if (enemyhas.Length == 0)
  2484. {
  2485. if (!TryPushcapsule(gooda[m], game))
  2486. {
  2487. if (game.Turn % 2 == 0)
  2488. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  2489. else
  2490. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  2491. }
  2492. }
  2493. if (enemyhas.Length == 1)
  2494. {
  2495. if (!TryPushcapsule(gooda[m], game))
  2496. if (game.Turn % 2 == 0)
  2497. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2498. else
  2499. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2500. }
  2501. if (enemyhas.Length == 2)
  2502. {
  2503. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2504. if (!TryPushcapsule(gooda[m], game))
  2505. {
  2506. if (game.Turn % 2 == 0)
  2507. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  2508. else
  2509. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2510. }
  2511.  
  2512. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2513. if (!TryPushcapsule(gooda[m], game))
  2514. {
  2515. if (game.Turn % 2 == 0)
  2516. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  2517. else
  2518. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  2519. }
  2520.  
  2521.  
  2522.  
  2523. }
  2524. // 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]); }
  2525. }
  2526. // 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]); }
  2527. }
  2528.  
  2529. if (gooda.Length > 9)
  2530. {
  2531. int m = 9;
  2532. if (allworm.Length > 0)
  2533. {
  2534. for (int i = 0; i < allworm.Length; i++)
  2535. {
  2536.  
  2537. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  2538. {
  2539.  
  2540. if (!TryPushcapsule(gooda[m], game))
  2541.  
  2542. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  2543. }
  2544. }
  2545. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  2546. {
  2547. if (enemyhas.Length == 0)
  2548. if (!TryPushcapsule(gooda[m], game))
  2549. {
  2550. if (game.Turn % 2 == 0)
  2551. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  2552. else
  2553. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  2554. }
  2555. if (enemyhas.Length == 1)
  2556. {
  2557. if (!TryPushcapsule(gooda[m], game))
  2558. {
  2559. if (game.Turn % 2 == 0)
  2560. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  2561. else
  2562. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  2563. }
  2564.  
  2565. }
  2566. if (enemyhas.Length == 2)
  2567. {
  2568.  
  2569. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2570. {
  2571. if (gooda[m].Distance(enemyhas[0]) <= 300)
  2572. {
  2573. if (!TryPushcapsule(gooda[m], game))
  2574. gooda[m].Sail(enemyhas[0]);
  2575. }
  2576. else
  2577. {
  2578. if (!TryPushcapsule(gooda[m], game))
  2579. {
  2580. if (game.Turn % 2 == 0)
  2581. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  2582. else
  2583. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  2584.  
  2585. }
  2586. }
  2587.  
  2588. }
  2589. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2590. {
  2591. if (gooda[m].Distance(enemyhas[1]) <= 300)
  2592. {
  2593. if (!TryPushcapsule(gooda[m], game))
  2594. gooda[m].Sail(enemyhas[1]);
  2595. }
  2596. else
  2597. {
  2598. if (!TryPushcapsule(gooda[m], game))
  2599. {
  2600. if (game.Turn % 2 == 0)
  2601. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  2602. else
  2603. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  2604.  
  2605. }
  2606. }
  2607. }
  2608. }
  2609.  
  2610. }
  2611. }
  2612. else
  2613. {
  2614. if (enemyhas.Length == 0)
  2615. if (!TryPushcapsule(gooda[m], game))
  2616. {
  2617. if (game.Turn % 2 == 0)
  2618. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  2619. else
  2620. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  2621. }
  2622. if (enemyhas.Length == 1)
  2623. {
  2624. if (!TryPushcapsule(gooda[m], game))
  2625. {
  2626. if (game.Turn % 2 == 0)
  2627. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  2628. else
  2629. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  2630. }
  2631.  
  2632. }
  2633. if (enemyhas.Length == 2)
  2634. {
  2635.  
  2636. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  2637. {
  2638. if (gooda[m].Distance(enemyhas[0]) <= 300)
  2639. {
  2640. if (!TryPushcapsule(gooda[m], game))
  2641. gooda[m].Sail(enemyhas[0]);
  2642. }
  2643. else
  2644. {
  2645. if (!TryPushcapsule(gooda[m], game))
  2646. {
  2647. if (game.Turn % 2 == 0)
  2648. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  2649. else
  2650. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  2651.  
  2652. }
  2653. }
  2654.  
  2655. }
  2656. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  2657. {
  2658. if (gooda[m].Distance(enemyhas[1]) <= 300)
  2659. {
  2660. if (!TryPushcapsule(gooda[m], game))
  2661. gooda[m].Sail(enemyhas[1]);
  2662. }
  2663. else
  2664. {
  2665. if (!TryPushcapsule(gooda[m], game))
  2666. {
  2667. if (game.Turn % 2 == 0)
  2668. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  2669. else
  2670. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  2671.  
  2672. }
  2673. }
  2674. }
  2675. }
  2676.  
  2677. }
  2678. // 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]); }
  2679. }
  2680.  
  2681.  
  2682. }
  2683. }
  2684. if (game.GetEnemy().BotName == "26067")
  2685. {
  2686.  
  2687. if (gooda.Length > 2)
  2688. {
  2689. if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
  2690. {
  2691.  
  2692. gooda[0].Sail(gcapsule[0].InitialLocation);
  2693.  
  2694. if (allworm.Length > 0)
  2695. {
  2696. 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)
  2697. gooda[2].Sail(allworm[0]);
  2698. else
  2699. gooda[2].Sail(gcapsule[1].InitialLocation);
  2700. }
  2701. else
  2702. gooda[2].Sail(gcapsule[1].InitialLocation);
  2703.  
  2704.  
  2705. }
  2706.  
  2707. if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
  2708. {
  2709. int sucheck = 0;
  2710. if (!TryPushaste(gooda[0], game))
  2711. {
  2712. if (allworm.Length > 0)
  2713. {
  2714. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  2715. gooda[0].Sail(allworm[0].Partner);
  2716. else
  2717. {
  2718. gooda[0].Sail(gmother[0]);
  2719. }
  2720. }
  2721. else
  2722. {
  2723. gooda[0].Sail(gmother[0]);
  2724. }
  2725. }
  2726.  
  2727. gooda[2].Sail(gcapsule[1].InitialLocation);
  2728.  
  2729.  
  2730.  
  2731.  
  2732. }
  2733.  
  2734. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
  2735. {
  2736. int checker2 = 0;
  2737. gooda[0].Sail(gcapsule[0].InitialLocation);
  2738.  
  2739.  
  2740. if (allworm.Length > 0)
  2741. {
  2742. if ((gooda[2].Distance(gmother[0]) >= gooda[2].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  2743. gooda[2].Sail(allworm[0].Partner);
  2744. else
  2745. {
  2746. gooda[2].Sail(gmother[0]);
  2747. }
  2748. }
  2749. else
  2750. {
  2751. gooda[2].Sail(gmother[0]);
  2752.  
  2753.  
  2754. }
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760. }
  2761. for (int m = 3; m < 6; m++)
  2762. {
  2763.  
  2764. if (good.Length > 0)
  2765. {
  2766. if (gooda[m].Capsule == null)
  2767. {
  2768.  
  2769. gooda[m].Sail(gcapsule[0]);
  2770. }
  2771. else
  2772. gooda[m].Sail(gmother[0]);
  2773.  
  2774. }
  2775. }
  2776.  
  2777.  
  2778.  
  2779. if (good.Length > 0)
  2780. {
  2781. if (gooda[0].Capsule == null)
  2782. {
  2783.  
  2784. gooda[0].Sail(gcapsule[0]);
  2785. }
  2786. else
  2787. gooda[0].Sail(gmother[0]);
  2788.  
  2789. }
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
  2797. {
  2798. int checker3 = 0;
  2799. int checker4 = 0;
  2800. if (!TryPushaste(gooda[0], game))
  2801. {
  2802. if (allworm.Length > 0)
  2803. {
  2804. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  2805. gooda[0].Sail(allworm[0].Partner);
  2806. else
  2807. {
  2808. gooda[0].Sail(gmother[0]);
  2809. }
  2810. }
  2811. else
  2812. {
  2813. gooda[0].Sail(gmother[0]);
  2814. }
  2815. }
  2816.  
  2817. if (allworm.Length > 0)
  2818. {
  2819. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  2820. gooda[2].Sail(allworm[0].Partner);
  2821. else
  2822. {
  2823. gooda[2].Sail(gmother[0]);
  2824.  
  2825.  
  2826. }
  2827. }
  2828.  
  2829. else
  2830. {
  2831. gooda[2].Sail(gmother[0]);
  2832.  
  2833.  
  2834. }
  2835.  
  2836. }
  2837. }
  2838.  
  2839.  
  2840.  
  2841. }
  2842. 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")
  2843. {
  2844. if (enemy.Length > 0)
  2845. {
  2846. if (good.Length > 0)
  2847. {
  2848. if (amount > 0)
  2849. {
  2850. if (gcapsule.Length > 1)
  2851. {
  2852. if (allworm.Length > 0)
  2853. {
  2854. if (gooda.Length > 7)
  2855. if (!TryPushcapsuleBotWorm(gooda[7], game))
  2856. gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  2857.  
  2858.  
  2859. if (gooda.Length > 1)
  2860. {
  2861. if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
  2862. {
  2863. if (!TryPushcapsuleBotWorm(gooda[1], game))
  2864. gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  2865. }
  2866. else
  2867. {
  2868. if (!TryPushcapsuleBotWorm2(gooda[1], game))
  2869. gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
  2870. }
  2871. }
  2872. }
  2873. if (gooda.Length > 2)
  2874. {
  2875. if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
  2876. {
  2877. if (!TryPushaste(gooda[0], game))
  2878. {
  2879. if (gooda[0].StateName == "heavy")
  2880. gooda[0].SwapStates(gooda[1]);
  2881. else
  2882. gooda[0].Sail(gcapsule[0].InitialLocation);
  2883. }
  2884. if (!TryPush(gooda[2], game))
  2885. {
  2886. if (gooda[2].StateName == "heavy")
  2887. {
  2888. gooda[2].SwapStates(gooda[1]);
  2889. }
  2890. else
  2891. {
  2892. if (allworm.Length > 0)
  2893. {
  2894. 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)
  2895. gooda[2].Sail(allworm[0]);
  2896. else
  2897. gooda[2].Sail(gcapsule[1].InitialLocation);
  2898. }
  2899. else
  2900. gooda[2].Sail(gcapsule[1].InitialLocation);
  2901. }
  2902. }
  2903.  
  2904. }
  2905.  
  2906. if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
  2907. {
  2908. int sucheck = 0;
  2909. if (!TryPushaste(gooda[0], game))
  2910. {
  2911. if (allworm.Length > 0)
  2912. {
  2913. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  2914. gooda[0].Sail(allworm[0].Partner);
  2915. else
  2916. {
  2917. if (heavies.Length > 0)
  2918. {
  2919. if (stuckenemies(gooda[0], game))
  2920. {
  2921. if (gooda[0].StateName != "heavy")
  2922. {
  2923. foreach (Pirate good2 in game.GetMyLivingPirates())
  2924. {
  2925. if (gooda[0].StateName != "heavy")
  2926. {
  2927. if (good2.StateName == "heavy" && sucheck == 0)
  2928. {
  2929. gooda[0].SwapStates(good2);
  2930. sucheck = 1;
  2931. }
  2932. }
  2933.  
  2934. }
  2935. }
  2936. if (sucheck == 0 && gooda[0].StateName == "heavy")
  2937. {
  2938. gooda[0].Sail(gmother[0]);
  2939. }
  2940. }
  2941. else
  2942. gooda[0].Sail(gmother[0]);
  2943. }
  2944. else
  2945. gooda[0].Sail(gmother[0]);
  2946. }
  2947. }
  2948. else
  2949. {
  2950. if (count2 > 0)
  2951. {
  2952. if (stuckenemies(gooda[0], game))
  2953. {
  2954. if (gooda[0].StateName != "heavy")
  2955. {
  2956. foreach (Pirate good2 in game.GetMyLivingPirates())
  2957. {
  2958. if (gooda[0].StateName != "heavy")
  2959. {
  2960. if (good2.StateName == "heavy" && sucheck == 0)
  2961. {
  2962. gooda[0].SwapStates(good2);
  2963. sucheck = 1;
  2964. }
  2965. }
  2966.  
  2967. }
  2968. }
  2969. if (sucheck == 0 && gooda[0].StateName == "heavy")
  2970. {
  2971. gooda[0].Sail(gmother[0]);
  2972. }
  2973. }
  2974. else
  2975. gooda[0].Sail(gmother[0]);
  2976. }
  2977. else
  2978. gooda[0].Sail(gmother[0]);
  2979. }
  2980. }
  2981. if (!TryPushcapsuleattack(gooda[2], game))
  2982. {
  2983. if (gooda[2].StateName != "heavy")
  2984. gooda[2].Sail(gcapsule[1].InitialLocation);
  2985. else
  2986. gooda[2].SwapStates(gooda[1]);
  2987.  
  2988. }
  2989.  
  2990.  
  2991. }
  2992.  
  2993. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
  2994. {
  2995. int checker2 = 0;
  2996. if (gooda[0].StateName != "heavy")
  2997. gooda[0].Sail(gcapsule[0].InitialLocation);
  2998. else
  2999. gooda[0].SwapStates(gooda[1]);
  3000.  
  3001. if (!TryPushcapsuleattack2(gooda[2], game))
  3002. {
  3003. if (allworm.Length > 0)
  3004. {
  3005. if ((gooda[2].Distance(gmother[0]) >= gooda[2].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  3006. gooda[2].Sail(allworm[0].Partner);
  3007. else
  3008. {
  3009. if (count2 > 0)
  3010. {
  3011. if (stuckenemies(gooda[2], game))
  3012. {
  3013. if (gooda[2].StateName != "heavy")
  3014. {
  3015. for (int m = 1; m < gooda.Length; m++)
  3016. {
  3017. if (gooda[2].StateName != "heavy")
  3018. {
  3019. if (gooda[m].StateName == "heavy" && checker2 == 0)
  3020. {
  3021. gooda[2].SwapStates(gooda[m]);
  3022. checker2 = 1;
  3023. }
  3024. }
  3025.  
  3026. }
  3027. }
  3028. if (checker2 == 0 && gooda[2].StateName == "heavy")
  3029. {
  3030. gooda[2].Sail(gmother[0]);
  3031. }
  3032.  
  3033. }
  3034. else
  3035. gooda[2].Sail(gmother[0]);
  3036. }
  3037. else
  3038. gooda[2].Sail(gmother[0]);
  3039.  
  3040.  
  3041.  
  3042. }
  3043. }
  3044. else
  3045. {
  3046. if (count2 > 0)
  3047. {
  3048. if (stuckenemies(gooda[2], game))
  3049. {
  3050. if (gooda[2].StateName != "heavy")
  3051. {
  3052. for (int m = 1; m < gooda.Length; m++)
  3053. {
  3054. if (gooda[2].StateName != "heavy")
  3055. {
  3056. if (gooda[m].StateName == "heavy" && checker2 == 0)
  3057. {
  3058. gooda[2].SwapStates(gooda[m]);
  3059. checker2 = 1;
  3060. }
  3061. }
  3062.  
  3063. }
  3064. }
  3065. if (checker2 == 0 && gooda[2].StateName == "heavy")
  3066. {
  3067. gooda[2].Sail(gmother[0]);
  3068. }
  3069.  
  3070. }
  3071. else
  3072.  
  3073. gooda[2].Sail(gmother[0]);
  3074. }
  3075. else
  3076. gooda[2].Sail(gmother[0]);
  3077.  
  3078.  
  3079.  
  3080. }
  3081. }
  3082.  
  3083.  
  3084.  
  3085.  
  3086. }
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
  3093. {
  3094. int checker3 = 0;
  3095. int checker4 = 0;
  3096. if (!TryPushaste(gooda[0], game))
  3097. {
  3098. if (allworm.Length > 0)
  3099. {
  3100. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  3101. gooda[0].Sail(allworm[0].Partner);
  3102. else
  3103. {
  3104. gooda[0].Sail(gmother[0]);
  3105. }
  3106. }
  3107. else
  3108. {
  3109. if (count2 > 0)
  3110. {
  3111. if (stuckenemies(gooda[0], game))
  3112. {
  3113. if (gooda[0].StateName != "heavy")
  3114. {
  3115. foreach (Pirate good2 in game.GetMyLivingPirates())
  3116. {
  3117. if (gooda[0].StateName != "heavy")
  3118. {
  3119. if (good2.StateName == "heavy" && checker3 == 0)
  3120. {
  3121. gooda[0].SwapStates(good2);
  3122. checker3 = 1;
  3123. }
  3124. }
  3125.  
  3126. }
  3127. }
  3128. if (checker3 == 0 && gooda[0].StateName == "heavy")
  3129. {
  3130. gooda[0].Sail(gmother[0]);
  3131. }
  3132. }
  3133. else
  3134. gooda[0].Sail(gmother[0]);
  3135. }
  3136. else
  3137. gooda[0].Sail(gmother[0]);
  3138.  
  3139. }
  3140. }
  3141. if (!TryPushcapsuleattack2(gooda[2], game))
  3142. {
  3143. if (allworm.Length > 0)
  3144. {
  3145. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  3146. gooda[2].Sail(allworm[0].Partner);
  3147. else
  3148. {
  3149. if (count2 > 0)
  3150. {
  3151. if (stuckenemies(gooda[2], game))
  3152. {
  3153. if (gooda[2].StateName != "heavy")
  3154. {
  3155. for (int m = 1; m < gooda.Length; m++)
  3156. {
  3157. if (gooda[2].StateName != "heavy")
  3158. {
  3159. if (gooda[m].StateName == "heavy" && checker4 == 0)
  3160. {
  3161. gooda[2].SwapStates(gooda[m]);
  3162. checker4 = 1;
  3163. }
  3164. }
  3165.  
  3166. }
  3167. }
  3168. if (checker4 == 0 && gooda[2].StateName == "heavy")
  3169. {
  3170. gooda[2].Sail(gmother[0]);
  3171. }
  3172.  
  3173. }
  3174. else
  3175. gooda[2].Sail(gmother[0]);
  3176. }
  3177. else
  3178. gooda[2].Sail(gmother[0]);
  3179.  
  3180.  
  3181.  
  3182. }
  3183. }
  3184. else
  3185. {
  3186. if (heavies.Length > 0)
  3187. {
  3188. if (stuckenemies(gooda[2], game))
  3189. {
  3190. if (gooda[2].StateName != "heavy")
  3191. {
  3192. for (int m = 1; m < gooda.Length; m++)
  3193. {
  3194. if (gooda[2].StateName != "heavy")
  3195. {
  3196. if (gooda[m].StateName == "heavy" && checker4 == 0)
  3197. {
  3198. gooda[2].SwapStates(gooda[m]);
  3199. checker4 = 1;
  3200. }
  3201. }
  3202.  
  3203. }
  3204. }
  3205. if (checker4 == 0 && gooda[2].StateName == "heavy")
  3206. {
  3207. gooda[2].Sail(gmother[0]);
  3208. }
  3209.  
  3210. }
  3211. else
  3212. gooda[2].Sail(gmother[0]);
  3213. }
  3214. else
  3215. gooda[2].Sail(gmother[0]);
  3216.  
  3217.  
  3218.  
  3219. }
  3220. }
  3221. }
  3222. }
  3223.  
  3224. if (gooda.Length > 3)
  3225. {
  3226. int m = 3;
  3227. if (allworm.Length > 0)
  3228. {
  3229. for (int i = 0; i < allworm.Length; i++)
  3230. {
  3231.  
  3232. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  3233. {
  3234.  
  3235. if (!TryPushcapsule(gooda[m], game))
  3236.  
  3237. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  3238. }
  3239. }
  3240. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  3241. {
  3242. if (enemyhas.Length == 0)
  3243. if (!TryPushcapsule(gooda[m], game))
  3244. {
  3245. if (game.Turn % 2 == 0)
  3246. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  3247. else
  3248. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  3249. }
  3250. if (enemyhas.Length == 1)
  3251. {
  3252. if (!TryPushcapsule(gooda[m], game))
  3253. {
  3254. if (game.Turn % 2 == 0)
  3255. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3256. else
  3257. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3258. }
  3259.  
  3260. }
  3261. if (enemyhas.Length == 2)
  3262. {
  3263.  
  3264. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3265. {
  3266. if (gooda[m].Distance(enemyhas[0]) <= 300)
  3267. {
  3268. if (!TryPushcapsule(gooda[m], game))
  3269. gooda[m].Sail(enemyhas[0]);
  3270. }
  3271. else
  3272. {
  3273. if (!TryPushcapsule(gooda[m], game))
  3274. {
  3275. if (game.Turn % 2 == 0)
  3276. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3277. else
  3278. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3279.  
  3280. }
  3281. }
  3282.  
  3283. }
  3284. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3285. {
  3286. if (gooda[m].Distance(enemyhas[1]) <= 300)
  3287. {
  3288. if (!TryPushcapsule(gooda[m], game))
  3289. gooda[m].Sail(enemyhas[1]);
  3290. }
  3291. else
  3292. {
  3293. if (!TryPushcapsule(gooda[m], game))
  3294. {
  3295. if (game.Turn % 2 == 0)
  3296. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  3297. else
  3298. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  3299.  
  3300. }
  3301. }
  3302. }
  3303. }
  3304.  
  3305. }
  3306. }
  3307. else
  3308. {
  3309. if (enemyhas.Length == 0)
  3310. if (!TryPushcapsule(gooda[m], game))
  3311. {
  3312. if (game.Turn % 2 == 0)
  3313. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  3314. else
  3315. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  3316. }
  3317. if (enemyhas.Length == 1)
  3318. {
  3319. if (!TryPushcapsule(gooda[m], game))
  3320. {
  3321. if (game.Turn % 2 == 0)
  3322. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3323. else
  3324. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3325. }
  3326.  
  3327. }
  3328. if (enemyhas.Length == 2)
  3329. {
  3330.  
  3331. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3332. {
  3333. if (gooda[m].Distance(enemyhas[0]) <= 300)
  3334. {
  3335. if (!TryPushcapsule(gooda[m], game))
  3336. gooda[m].Sail(enemyhas[0]);
  3337. }
  3338. else
  3339. {
  3340. if (!TryPushcapsule(gooda[m], game))
  3341. {
  3342. if (game.Turn % 2 == 0)
  3343. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3344. else
  3345. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3346.  
  3347. }
  3348. }
  3349.  
  3350. }
  3351. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3352. {
  3353. if (gooda[m].Distance(enemyhas[1]) <= 300)
  3354. {
  3355. if (!TryPushcapsule(gooda[m], game))
  3356. gooda[m].Sail(enemyhas[1]);
  3357. }
  3358. else
  3359. {
  3360. if (!TryPushcapsule(gooda[m], game))
  3361. {
  3362. if (game.Turn % 2 == 0)
  3363. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  3364. else
  3365. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  3366.  
  3367. }
  3368. }
  3369. }
  3370. }
  3371.  
  3372. }
  3373. }
  3374. if (gooda.Length > 4)
  3375. {
  3376. int m = 4;
  3377. if (allworm.Length > 0)
  3378. {
  3379. for (int i = 0; i < allworm.Length; i++)
  3380. {
  3381.  
  3382. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  3383. {
  3384.  
  3385. if (!TryPushcapsule(gooda[m], game))
  3386.  
  3387. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  3388. }
  3389. }
  3390. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  3391. {
  3392. if (enemyhas.Length == 0)
  3393. if (!TryPushcapsule(gooda[m], game))
  3394. {
  3395. if (game.Turn % 2 == 0)
  3396. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  3397. else
  3398. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  3399. }
  3400. if (enemyhas.Length == 1)
  3401. {
  3402. if (!TryPushcapsule(gooda[m], game))
  3403. {
  3404. if (game.Turn % 2 == 0)
  3405. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3406. else
  3407. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3408. }
  3409.  
  3410. }
  3411. if (enemyhas.Length == 2)
  3412. {
  3413.  
  3414. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3415. {
  3416. if (gooda[m].Distance(enemyhas[0]) <= 300)
  3417. {
  3418. if (!TryPushcapsule(gooda[m], game))
  3419. gooda[m].Sail(enemyhas[0]);
  3420. }
  3421. else
  3422. {
  3423. if (!TryPushcapsule(gooda[m], game))
  3424. {
  3425. if (game.Turn % 2 == 0)
  3426. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3427. else
  3428. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3429.  
  3430. }
  3431. }
  3432.  
  3433. }
  3434. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3435. {
  3436. if (gooda[m].Distance(enemyhas[1]) <= 300)
  3437. {
  3438. if (!TryPushcapsule(gooda[m], game))
  3439. gooda[m].Sail(enemyhas[1]);
  3440. }
  3441. else
  3442. {
  3443. if (!TryPushcapsule(gooda[m], game))
  3444. {
  3445. if (game.Turn % 2 == 0)
  3446. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  3447. else
  3448. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  3449.  
  3450. }
  3451. }
  3452. }
  3453. }
  3454.  
  3455. }
  3456. }
  3457. else
  3458. {
  3459. if (enemyhas.Length == 0)
  3460. if (!TryPushcapsule(gooda[m], game))
  3461. {
  3462. if (game.Turn % 2 == 0)
  3463. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  3464. else
  3465. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  3466. }
  3467. if (enemyhas.Length == 1)
  3468. {
  3469. if (!TryPushcapsule(gooda[m], game))
  3470. {
  3471. if (game.Turn % 2 == 0)
  3472. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3473. else
  3474. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3475. }
  3476.  
  3477. }
  3478. if (enemyhas.Length == 2)
  3479. {
  3480.  
  3481. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3482. {
  3483. if (gooda[m].Distance(enemyhas[0]) <= 300)
  3484. {
  3485. if (!TryPushcapsule(gooda[m], game))
  3486. gooda[m].Sail(enemyhas[0]);
  3487. }
  3488. else
  3489. {
  3490. if (!TryPushcapsule(gooda[m], game))
  3491. {
  3492. if (game.Turn % 2 == 0)
  3493. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3494. else
  3495. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3496.  
  3497. }
  3498. }
  3499.  
  3500. }
  3501. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3502. {
  3503. if (gooda[m].Distance(enemyhas[1]) <= 300)
  3504. {
  3505. if (!TryPushcapsule(gooda[m], game))
  3506. gooda[m].Sail(enemyhas[1]);
  3507. }
  3508. else
  3509. {
  3510. if (!TryPushcapsule(gooda[m], game))
  3511. {
  3512. if (game.Turn % 2 == 0)
  3513. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  3514. else
  3515. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  3516.  
  3517. }
  3518. }
  3519. }
  3520. }
  3521.  
  3522. }
  3523. }
  3524.  
  3525. //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]); }
  3526.  
  3527.  
  3528. System.Console.WriteLine(enemy[0].PushRange);
  3529.  
  3530.  
  3531. if (gooda.Length > 5)
  3532. {
  3533. int m = 5;
  3534. if (allworm.Length > 0)
  3535. {
  3536. for (int i = 0; i < allworm.Length; i++)
  3537. {
  3538.  
  3539. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  3540. {
  3541.  
  3542. if (!TryPushcapsule(gooda[m], game))
  3543.  
  3544. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  3545. }
  3546. }
  3547. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  3548. {
  3549. if (enemyhas.Length == 0)
  3550. {
  3551. if (!TryPushcapsule(gooda[m], game))
  3552. {
  3553. if (game.Turn % 2 == 0)
  3554. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  3555. else
  3556. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  3557. }
  3558. }
  3559. if (enemyhas.Length == 1)
  3560. {
  3561. if (!TryPushcapsule(gooda[m], game))
  3562. if (game.Turn % 2 == 0)
  3563. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3564. else
  3565. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3566. }
  3567. if (enemyhas.Length == 2)
  3568. {
  3569. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3570. if (!TryPushcapsule(gooda[m], game))
  3571. {
  3572. if (game.Turn % 2 == 0)
  3573. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3574. else
  3575. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3576. }
  3577.  
  3578. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3579. if (!TryPushcapsule(gooda[m], game))
  3580. {
  3581. if (game.Turn % 2 == 0)
  3582. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  3583. else
  3584. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3585. }
  3586.  
  3587.  
  3588. }
  3589.  
  3590. }
  3591. }
  3592. else
  3593. {
  3594. if (enemyhas.Length == 0)
  3595. {
  3596. if (!TryPushcapsule(gooda[m], game))
  3597. {
  3598. if (game.Turn % 2 == 0)
  3599. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  3600. else
  3601. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  3602. }
  3603. }
  3604. if (enemyhas.Length == 1)
  3605. {
  3606. if (!TryPushcapsule(gooda[m], game))
  3607. if (game.Turn % 2 == 0)
  3608. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3609. else
  3610. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3611. }
  3612. if (enemyhas.Length == 2)
  3613. {
  3614. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3615. if (!TryPushcapsule(gooda[m], game))
  3616. {
  3617. if (game.Turn % 2 == 0)
  3618. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3619. else
  3620. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3621. }
  3622.  
  3623. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3624. if (!TryPushcapsule(gooda[m], game))
  3625. {
  3626. if (game.Turn % 2 == 0)
  3627. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  3628. else
  3629. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3630. }
  3631.  
  3632.  
  3633.  
  3634. }
  3635. // 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]); }
  3636. }
  3637. }
  3638.  
  3639. if (gooda.Length > 6)
  3640. {
  3641. int m = 6;
  3642. if (allworm.Length > 0)
  3643. {
  3644. for (int i = 0; i < allworm.Length; i++)
  3645. {
  3646.  
  3647. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  3648. {
  3649.  
  3650. if (!TryPushcapsule(gooda[m], game))
  3651.  
  3652. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  3653. }
  3654. }
  3655. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  3656. {
  3657. if (enemyhas.Length == 0)
  3658. {
  3659. if (!TryPushcapsule(gooda[m], game))
  3660. {
  3661. if (game.Turn % 2 == 0)
  3662. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  3663. else
  3664. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  3665. }
  3666. }
  3667. if (enemyhas.Length == 1)
  3668. {
  3669. if (!TryPushcapsule(gooda[m], game))
  3670. if (game.Turn % 2 == 0)
  3671. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3672. else
  3673. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3674. }
  3675. if (enemyhas.Length == 2)
  3676. {
  3677. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3678. if (!TryPushcapsule(gooda[m], game))
  3679. {
  3680. if (game.Turn % 2 == 0)
  3681. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3682. else
  3683. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3684. }
  3685.  
  3686. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3687. if (!TryPushcapsule(gooda[m], game))
  3688. {
  3689. if (game.Turn % 2 == 0)
  3690. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  3691. else
  3692. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3693. }
  3694.  
  3695.  
  3696. }
  3697.  
  3698. }
  3699. }
  3700. else
  3701. {
  3702. if (enemyhas.Length == 0)
  3703. {
  3704. if (!TryPushcapsule(gooda[m], game))
  3705. {
  3706. if (game.Turn % 2 == 0)
  3707. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  3708. else
  3709. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  3710. }
  3711. }
  3712. if (enemyhas.Length == 1)
  3713. {
  3714. if (!TryPushcapsule(gooda[m], game))
  3715. if (game.Turn % 2 == 0)
  3716. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3717. else
  3718. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3719. }
  3720. if (enemyhas.Length == 2)
  3721. {
  3722. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3723. if (!TryPushcapsule(gooda[m], game))
  3724. {
  3725. if (game.Turn % 2 == 0)
  3726. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3727. else
  3728. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3729. }
  3730.  
  3731. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3732. if (!TryPushcapsule(gooda[m], game))
  3733. {
  3734. if (game.Turn % 2 == 0)
  3735. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  3736. else
  3737. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3738. }
  3739.  
  3740.  
  3741.  
  3742. }
  3743. // 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]); }
  3744. }
  3745. // 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]); }
  3746. }
  3747.  
  3748. if (gooda.Length > 8)
  3749. {
  3750. int m = 8;
  3751. if (allworm.Length > 0)
  3752. {
  3753. for (int i = 0; i < allworm.Length; i++)
  3754. {
  3755.  
  3756. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  3757. {
  3758.  
  3759. if (!TryPushcapsule(gooda[m], game))
  3760.  
  3761. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  3762. }
  3763. }
  3764. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  3765. {
  3766. if (enemyhas.Length == 0)
  3767. {
  3768. if (!TryPushcapsule(gooda[m], game))
  3769. {
  3770. if (game.Turn % 2 == 0)
  3771. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  3772. else
  3773. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  3774. }
  3775. }
  3776. if (enemyhas.Length == 1)
  3777. {
  3778. if (!TryPushcapsule(gooda[m], game))
  3779. if (game.Turn % 2 == 0)
  3780. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3781. else
  3782. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3783. }
  3784. if (enemyhas.Length == 2)
  3785. {
  3786. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3787. if (!TryPushcapsule(gooda[m], game))
  3788. {
  3789. if (game.Turn % 2 == 0)
  3790. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3791. else
  3792. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3793. }
  3794.  
  3795. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3796. if (!TryPushcapsule(gooda[m], game))
  3797. {
  3798. if (game.Turn % 2 == 0)
  3799. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  3800. else
  3801. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3802. }
  3803.  
  3804.  
  3805. }
  3806.  
  3807. }
  3808. }
  3809. else
  3810. {
  3811. if (enemyhas.Length == 0)
  3812. {
  3813. if (!TryPushcapsule(gooda[m], game))
  3814. {
  3815. if (game.Turn % 2 == 0)
  3816. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  3817. else
  3818. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  3819. }
  3820. }
  3821. if (enemyhas.Length == 1)
  3822. {
  3823. if (!TryPushcapsule(gooda[m], game))
  3824. if (game.Turn % 2 == 0)
  3825. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3826. else
  3827. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3828. }
  3829. if (enemyhas.Length == 2)
  3830. {
  3831. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3832. if (!TryPushcapsule(gooda[m], game))
  3833. {
  3834. if (game.Turn % 2 == 0)
  3835. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  3836. else
  3837. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3838. }
  3839.  
  3840. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3841. if (!TryPushcapsule(gooda[m], game))
  3842. {
  3843. if (game.Turn % 2 == 0)
  3844. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  3845. else
  3846. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  3847. }
  3848.  
  3849.  
  3850.  
  3851. }
  3852. // 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]); }
  3853. }
  3854. // 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]); }
  3855. }
  3856.  
  3857. if (gooda.Length > 9)
  3858. {
  3859. int m = 9;
  3860. if (allworm.Length > 0)
  3861. {
  3862. for (int i = 0; i < allworm.Length; i++)
  3863. {
  3864.  
  3865. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  3866. {
  3867.  
  3868. if (!TryPushcapsule(gooda[m], game))
  3869.  
  3870. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  3871. }
  3872. }
  3873. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  3874. {
  3875. if (enemyhas.Length == 0)
  3876. if (!TryPushcapsule(gooda[m], game))
  3877. {
  3878. if (game.Turn % 2 == 0)
  3879. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  3880. else
  3881. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  3882. }
  3883. if (enemyhas.Length == 1)
  3884. {
  3885. if (!TryPushcapsule(gooda[m], game))
  3886. {
  3887. if (game.Turn % 2 == 0)
  3888. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3889. else
  3890. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3891. }
  3892.  
  3893. }
  3894. if (enemyhas.Length == 2)
  3895. {
  3896.  
  3897. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3898. {
  3899. if (gooda[m].Distance(enemyhas[0]) <= 300)
  3900. {
  3901. if (!TryPushcapsule(gooda[m], game))
  3902. gooda[m].Sail(enemyhas[0]);
  3903. }
  3904. else
  3905. {
  3906. if (!TryPushcapsule(gooda[m], game))
  3907. {
  3908. if (game.Turn % 2 == 0)
  3909. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3910. else
  3911. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3912.  
  3913. }
  3914. }
  3915.  
  3916. }
  3917. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3918. {
  3919. if (gooda[m].Distance(enemyhas[1]) <= 300)
  3920. {
  3921. if (!TryPushcapsule(gooda[m], game))
  3922. gooda[m].Sail(enemyhas[1]);
  3923. }
  3924. else
  3925. {
  3926. if (!TryPushcapsule(gooda[m], game))
  3927. {
  3928. if (game.Turn % 2 == 0)
  3929. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  3930. else
  3931. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  3932.  
  3933. }
  3934. }
  3935. }
  3936. }
  3937.  
  3938. }
  3939. }
  3940. else
  3941. {
  3942. if (enemyhas.Length == 0)
  3943. if (!TryPushcapsule(gooda[m], game))
  3944. {
  3945. if (game.Turn % 2 == 0)
  3946. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  3947. else
  3948. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  3949. }
  3950. if (enemyhas.Length == 1)
  3951. {
  3952. if (!TryPushcapsule(gooda[m], game))
  3953. {
  3954. if (game.Turn % 2 == 0)
  3955. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3956. else
  3957. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3958. }
  3959.  
  3960. }
  3961. if (enemyhas.Length == 2)
  3962. {
  3963.  
  3964. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  3965. {
  3966. if (gooda[m].Distance(enemyhas[0]) <= 300)
  3967. {
  3968. if (!TryPushcapsule(gooda[m], game))
  3969. gooda[m].Sail(enemyhas[0]);
  3970. }
  3971. else
  3972. {
  3973. if (!TryPushcapsule(gooda[m], game))
  3974. {
  3975. if (game.Turn % 2 == 0)
  3976. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  3977. else
  3978. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  3979.  
  3980. }
  3981. }
  3982.  
  3983. }
  3984. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  3985. {
  3986. if (gooda[m].Distance(enemyhas[1]) <= 300)
  3987. {
  3988. if (!TryPushcapsule(gooda[m], game))
  3989. gooda[m].Sail(enemyhas[1]);
  3990. }
  3991. else
  3992. {
  3993. if (!TryPushcapsule(gooda[m], game))
  3994. {
  3995. if (game.Turn % 2 == 0)
  3996. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  3997. else
  3998. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  3999.  
  4000. }
  4001. }
  4002. }
  4003. }
  4004.  
  4005. }
  4006. // 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]); }
  4007. }
  4008.  
  4009.  
  4010. }
  4011. else
  4012. {
  4013. if (allworm.Length > 0)
  4014. {
  4015. if (gooda.Length > 7)
  4016.  
  4017. if (!TryPushcapsuleBotWorm(gooda[7], game))
  4018. gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  4019.  
  4020.  
  4021. if (gooda.Length > 1)
  4022. {
  4023. if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
  4024. {
  4025. if (!TryPushcapsuleBotWorm(gooda[1], game))
  4026. gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  4027. }
  4028. else
  4029. {
  4030. if (!TryPushcapsuleBotWorm2(gooda[1], game))
  4031. gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
  4032. }
  4033. }
  4034. }
  4035.  
  4036. if (gooda[0].HasCapsule() == false)
  4037. {
  4038. if (allworm.Length > 0)
  4039. {
  4040. 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)
  4041. gooda[0].Sail(allworm[0]);
  4042. else
  4043. gooda[0].Sail(gcapsule[0].InitialLocation);
  4044. }
  4045. else
  4046. if (!TryPush(gooda[0], game))
  4047. gooda[0].Sail(gcapsule[0].InitialLocation);
  4048.  
  4049.  
  4050. }
  4051.  
  4052. if (gooda[0].HasCapsule() == true)
  4053. {
  4054. int sucheck = 0;
  4055. if (!TryPushaste(gooda[0], game))
  4056. {
  4057. if (allworm.Length > 0)
  4058. {
  4059. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  4060. gooda[0].Sail(allworm[0].Partner);
  4061. else
  4062. {
  4063. if (gooda[0].Distance(gmother[0]) <= 2000)
  4064. {
  4065. if (gooda[0].StateName != "heavy")
  4066. {
  4067. foreach (Pirate good2 in game.GetMyLivingPirates())
  4068. {
  4069. if (gooda[0].StateName != "heavy")
  4070. {
  4071. if (good2.StateName == "heavy" && sucheck == 0)
  4072. {
  4073. gooda[0].SwapStates(good2);
  4074. sucheck = 1;
  4075. }
  4076. }
  4077.  
  4078. }
  4079. }
  4080. if (sucheck == 0 && gooda[0].StateName == "heavy")
  4081. {
  4082. gooda[0].Sail(gmother[0]);
  4083. }
  4084. }
  4085. else
  4086. gooda[0].Sail(gmother[0]);
  4087. }
  4088. }
  4089. else
  4090. {
  4091. if (gooda[0].Distance(gmother[0]) <= 2000)
  4092. {
  4093. if (gooda[0].StateName != "heavy")
  4094. {
  4095. foreach (Pirate good2 in game.GetMyLivingPirates())
  4096. {
  4097. if (gooda[0].StateName != "heavy")
  4098. {
  4099. if (good2.StateName == "heavy" && sucheck == 0)
  4100. {
  4101. gooda[0].SwapStates(good2);
  4102. sucheck = 1;
  4103. }
  4104. }
  4105.  
  4106. }
  4107. }
  4108. if (sucheck == 0 && gooda[0].StateName == "heavy")
  4109. {
  4110. gooda[0].Sail(gmother[0]);
  4111. }
  4112. }
  4113. else
  4114. gooda[0].Sail(gmother[0]);
  4115. }
  4116. }
  4117.  
  4118.  
  4119.  
  4120. }
  4121.  
  4122.  
  4123. if (gooda.Length > 2)
  4124. {
  4125. int m = 2;
  4126. if (allworm.Length > 0)
  4127. {
  4128. for (int i = 0; i < allworm.Length; i++)
  4129. {
  4130.  
  4131. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  4132. {
  4133.  
  4134. if (!TryPushcapsule(gooda[m], game))
  4135.  
  4136. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  4137. }
  4138. }
  4139. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  4140. {
  4141. if (enemyhas.Length == 0)
  4142. if (!TryPushcapsule(gooda[m], game))
  4143. {
  4144. if (game.Turn % 2 == 0)
  4145. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  4146. else
  4147. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  4148. }
  4149. if (enemyhas.Length == 1)
  4150. {
  4151. if (!TryPushcapsule(gooda[m], game))
  4152. {
  4153. if (game.Turn % 2 == 0)
  4154. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4155. else
  4156. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4157. }
  4158.  
  4159. }
  4160. if (enemyhas.Length == 2)
  4161. {
  4162.  
  4163. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4164. {
  4165. if (gooda[m].Distance(enemyhas[0]) <= 300)
  4166. {
  4167. if (!TryPushcapsule(gooda[m], game))
  4168. gooda[m].Sail(enemyhas[0]);
  4169. }
  4170. else
  4171. {
  4172. if (!TryPushcapsule(gooda[m], game))
  4173. {
  4174. if (game.Turn % 2 == 0)
  4175. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4176. else
  4177. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4178.  
  4179. }
  4180. }
  4181.  
  4182. }
  4183. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4184. {
  4185. if (gooda[m].Distance(enemyhas[1]) <= 300)
  4186. {
  4187. if (!TryPushcapsule(gooda[m], game))
  4188. gooda[m].Sail(enemyhas[1]);
  4189. }
  4190. else
  4191. {
  4192. if (!TryPushcapsule(gooda[m], game))
  4193. {
  4194. if (game.Turn % 2 == 0)
  4195. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  4196. else
  4197. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  4198.  
  4199. }
  4200. }
  4201. }
  4202. }
  4203.  
  4204. }
  4205. }
  4206. else
  4207. {
  4208. if (enemyhas.Length == 0)
  4209. if (!TryPushcapsule(gooda[m], game))
  4210. {
  4211. if (game.Turn % 2 == 0)
  4212. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  4213. else
  4214. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  4215. }
  4216. if (enemyhas.Length == 1)
  4217. {
  4218. if (!TryPushcapsule(gooda[m], game))
  4219. {
  4220. if (game.Turn % 2 == 0)
  4221. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4222. else
  4223. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4224. }
  4225.  
  4226. }
  4227. if (enemyhas.Length == 2)
  4228. {
  4229.  
  4230. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4231. {
  4232. if (gooda[m].Distance(enemyhas[0]) <= 300)
  4233. {
  4234. if (!TryPushcapsule(gooda[m], game))
  4235. gooda[m].Sail(enemyhas[0]);
  4236. }
  4237. else
  4238. {
  4239. if (!TryPushcapsule(gooda[m], game))
  4240. {
  4241. if (game.Turn % 2 == 0)
  4242. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4243. else
  4244. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4245.  
  4246. }
  4247. }
  4248.  
  4249. }
  4250. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4251. {
  4252. if (gooda[m].Distance(enemyhas[1]) <= 300)
  4253. {
  4254. if (!TryPushcapsule(gooda[m], game))
  4255. gooda[m].Sail(enemyhas[1]);
  4256. }
  4257. else
  4258. {
  4259. if (!TryPushcapsule(gooda[m], game))
  4260. {
  4261. if (game.Turn % 2 == 0)
  4262. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  4263. else
  4264. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  4265.  
  4266. }
  4267. }
  4268. }
  4269. }
  4270.  
  4271. }
  4272. }
  4273.  
  4274.  
  4275.  
  4276.  
  4277. if (gooda.Length > 3)
  4278. {
  4279. int m = 3;
  4280. if (allworm.Length > 0)
  4281. {
  4282. for (int i = 0; i < allworm.Length; i++)
  4283. {
  4284.  
  4285. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  4286. {
  4287.  
  4288. if (!TryPushcapsule(gooda[m], game))
  4289.  
  4290. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  4291. }
  4292. }
  4293. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  4294. {
  4295. if (enemyhas.Length == 0)
  4296. if (!TryPushcapsule(gooda[m], game))
  4297. {
  4298. if (game.Turn % 2 == 0)
  4299. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  4300. else
  4301. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  4302. }
  4303. if (enemyhas.Length == 1)
  4304. {
  4305. if (!TryPushcapsule(gooda[m], game))
  4306. {
  4307. if (game.Turn % 2 == 0)
  4308. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4309. else
  4310. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4311. }
  4312.  
  4313. }
  4314. if (enemyhas.Length == 2)
  4315. {
  4316.  
  4317. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4318. {
  4319. if (gooda[m].Distance(enemyhas[0]) <= 300)
  4320. {
  4321. if (!TryPushcapsule(gooda[m], game))
  4322. gooda[m].Sail(enemyhas[0]);
  4323. }
  4324. else
  4325. {
  4326. if (!TryPushcapsule(gooda[m], game))
  4327. {
  4328. if (game.Turn % 2 == 0)
  4329. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4330. else
  4331. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4332.  
  4333. }
  4334. }
  4335.  
  4336. }
  4337. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4338. {
  4339. if (gooda[m].Distance(enemyhas[1]) <= 300)
  4340. {
  4341. if (!TryPushcapsule(gooda[m], game))
  4342. gooda[m].Sail(enemyhas[1]);
  4343. }
  4344. else
  4345. {
  4346. if (!TryPushcapsule(gooda[m], game))
  4347. {
  4348. if (game.Turn % 2 == 0)
  4349. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  4350. else
  4351. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  4352.  
  4353. }
  4354. }
  4355. }
  4356. }
  4357.  
  4358. }
  4359. }
  4360. else
  4361. {
  4362. if (enemyhas.Length == 0)
  4363. if (!TryPushcapsule(gooda[m], game))
  4364. {
  4365. if (game.Turn % 2 == 0)
  4366. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  4367. else
  4368. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  4369. }
  4370. if (enemyhas.Length == 1)
  4371. {
  4372. if (!TryPushcapsule(gooda[m], game))
  4373. {
  4374. if (game.Turn % 2 == 0)
  4375. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4376. else
  4377. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4378. }
  4379.  
  4380. }
  4381. if (enemyhas.Length == 2)
  4382. {
  4383.  
  4384. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4385. {
  4386. if (gooda[m].Distance(enemyhas[0]) <= 300)
  4387. {
  4388. if (!TryPushcapsule(gooda[m], game))
  4389. gooda[m].Sail(enemyhas[0]);
  4390. }
  4391. else
  4392. {
  4393. if (!TryPushcapsule(gooda[m], game))
  4394. {
  4395. if (game.Turn % 2 == 0)
  4396. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4397. else
  4398. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4399.  
  4400. }
  4401. }
  4402.  
  4403. }
  4404. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4405. {
  4406. if (gooda[m].Distance(enemyhas[1]) <= 300)
  4407. {
  4408. if (!TryPushcapsule(gooda[m], game))
  4409. gooda[m].Sail(enemyhas[1]);
  4410. }
  4411. else
  4412. {
  4413. if (!TryPushcapsule(gooda[m], game))
  4414. {
  4415. if (game.Turn % 2 == 0)
  4416. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  4417. else
  4418. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  4419.  
  4420. }
  4421. }
  4422. }
  4423. }
  4424.  
  4425. }
  4426. }
  4427. if (gooda.Length > 4)
  4428. {
  4429. int m = 4;
  4430. if (allworm.Length > 0)
  4431. {
  4432. for (int i = 0; i < allworm.Length; i++)
  4433. {
  4434.  
  4435. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  4436. {
  4437.  
  4438. if (!TryPushcapsule(gooda[m], game))
  4439.  
  4440. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  4441. }
  4442. }
  4443. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  4444. {
  4445. if (enemyhas.Length == 0)
  4446. if (!TryPushcapsule(gooda[m], game))
  4447. {
  4448. if (game.Turn % 2 == 0)
  4449. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  4450. else
  4451. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  4452. }
  4453. if (enemyhas.Length == 1)
  4454. {
  4455. if (!TryPushcapsule(gooda[m], game))
  4456. {
  4457. if (game.Turn % 2 == 0)
  4458. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4459. else
  4460. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4461. }
  4462.  
  4463. }
  4464. if (enemyhas.Length == 2)
  4465. {
  4466.  
  4467. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4468. {
  4469. if (gooda[m].Distance(enemyhas[0]) <= 300)
  4470. {
  4471. if (!TryPushcapsule(gooda[m], game))
  4472. gooda[m].Sail(enemyhas[0]);
  4473. }
  4474. else
  4475. {
  4476. if (!TryPushcapsule(gooda[m], game))
  4477. {
  4478. if (game.Turn % 2 == 0)
  4479. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4480. else
  4481. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4482.  
  4483. }
  4484. }
  4485.  
  4486. }
  4487. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4488. {
  4489. if (gooda[m].Distance(enemyhas[1]) <= 300)
  4490. {
  4491. if (!TryPushcapsule(gooda[m], game))
  4492. gooda[m].Sail(enemyhas[1]);
  4493. }
  4494. else
  4495. {
  4496. if (!TryPushcapsule(gooda[m], game))
  4497. {
  4498. if (game.Turn % 2 == 0)
  4499. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  4500. else
  4501. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  4502.  
  4503. }
  4504. }
  4505. }
  4506. }
  4507.  
  4508. }
  4509. }
  4510. else
  4511. {
  4512. if (enemyhas.Length == 0)
  4513. if (!TryPushcapsule(gooda[m], game))
  4514. {
  4515. if (game.Turn % 2 == 0)
  4516. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  4517. else
  4518. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  4519. }
  4520. if (enemyhas.Length == 1)
  4521. {
  4522. if (!TryPushcapsule(gooda[m], game))
  4523. {
  4524. if (game.Turn % 2 == 0)
  4525. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4526. else
  4527. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4528. }
  4529.  
  4530. }
  4531. if (enemyhas.Length == 2)
  4532. {
  4533.  
  4534. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4535. {
  4536. if (gooda[m].Distance(enemyhas[0]) <= 300)
  4537. {
  4538. if (!TryPushcapsule(gooda[m], game))
  4539. gooda[m].Sail(enemyhas[0]);
  4540. }
  4541. else
  4542. {
  4543. if (!TryPushcapsule(gooda[m], game))
  4544. {
  4545. if (game.Turn % 2 == 0)
  4546. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4547. else
  4548. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4549.  
  4550. }
  4551. }
  4552.  
  4553. }
  4554. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4555. {
  4556. if (gooda[m].Distance(enemyhas[1]) <= 300)
  4557. {
  4558. if (!TryPushcapsule(gooda[m], game))
  4559. gooda[m].Sail(enemyhas[1]);
  4560. }
  4561. else
  4562. {
  4563. if (!TryPushcapsule(gooda[m], game))
  4564. {
  4565. if (game.Turn % 2 == 0)
  4566. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  4567. else
  4568. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  4569.  
  4570. }
  4571. }
  4572. }
  4573. }
  4574.  
  4575. }
  4576. }
  4577.  
  4578. //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]); }
  4579.  
  4580.  
  4581. System.Console.WriteLine(enemy[0].PushRange);
  4582.  
  4583.  
  4584. if (gooda.Length > 5)
  4585. {
  4586. int m = 5;
  4587. if (allworm.Length > 0)
  4588. {
  4589. for (int i = 0; i < allworm.Length; i++)
  4590. {
  4591.  
  4592. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  4593. {
  4594.  
  4595. if (!TryPushcapsule(gooda[m], game))
  4596.  
  4597. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  4598. }
  4599. }
  4600. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  4601. {
  4602. if (enemyhas.Length == 0)
  4603. {
  4604. if (!TryPushcapsule(gooda[m], game))
  4605. {
  4606. if (game.Turn % 2 == 0)
  4607. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  4608. else
  4609. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  4610. }
  4611. }
  4612. if (enemyhas.Length == 1)
  4613. {
  4614. if (!TryPushcapsule(gooda[m], game))
  4615. if (game.Turn % 2 == 0)
  4616. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4617. else
  4618. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4619. }
  4620. if (enemyhas.Length == 2)
  4621. {
  4622. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4623. if (!TryPushcapsule(gooda[m], game))
  4624. {
  4625. if (game.Turn % 2 == 0)
  4626. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4627. else
  4628. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4629. }
  4630.  
  4631. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4632. if (!TryPushcapsule(gooda[m], game))
  4633. {
  4634. if (game.Turn % 2 == 0)
  4635. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  4636. else
  4637. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4638. }
  4639.  
  4640.  
  4641. }
  4642.  
  4643. }
  4644. }
  4645. else
  4646. {
  4647. if (enemyhas.Length == 0)
  4648. {
  4649. if (!TryPushcapsule(gooda[m], game))
  4650. {
  4651. if (game.Turn % 2 == 0)
  4652. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  4653. else
  4654. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  4655. }
  4656. }
  4657. if (enemyhas.Length == 1)
  4658. {
  4659. if (!TryPushcapsule(gooda[m], game))
  4660. if (game.Turn % 2 == 0)
  4661. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4662. else
  4663. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4664. }
  4665. if (enemyhas.Length == 2)
  4666. {
  4667. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4668. if (!TryPushcapsule(gooda[m], game))
  4669. {
  4670. if (game.Turn % 2 == 0)
  4671. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4672. else
  4673. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4674. }
  4675.  
  4676. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4677. if (!TryPushcapsule(gooda[m], game))
  4678. {
  4679. if (game.Turn % 2 == 0)
  4680. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  4681. else
  4682. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4683. }
  4684.  
  4685.  
  4686.  
  4687. }
  4688. // 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]); }
  4689. }
  4690. }
  4691.  
  4692. if (gooda.Length > 6)
  4693. {
  4694. int m = 6;
  4695. if (allworm.Length > 0)
  4696. {
  4697. for (int i = 0; i < allworm.Length; i++)
  4698. {
  4699.  
  4700. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  4701. {
  4702.  
  4703. if (!TryPushcapsule(gooda[m], game))
  4704.  
  4705. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  4706. }
  4707. }
  4708. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  4709. {
  4710. if (enemyhas.Length == 0)
  4711. {
  4712. if (!TryPushcapsule(gooda[m], game))
  4713. {
  4714. if (game.Turn % 2 == 0)
  4715. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  4716. else
  4717. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  4718. }
  4719. }
  4720. if (enemyhas.Length == 1)
  4721. {
  4722. if (!TryPushcapsule(gooda[m], game))
  4723. if (game.Turn % 2 == 0)
  4724. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4725. else
  4726. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4727. }
  4728. if (enemyhas.Length == 2)
  4729. {
  4730. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4731. if (!TryPushcapsule(gooda[m], game))
  4732. {
  4733. if (game.Turn % 2 == 0)
  4734. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4735. else
  4736. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4737. }
  4738.  
  4739. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4740. if (!TryPushcapsule(gooda[m], game))
  4741. {
  4742. if (game.Turn % 2 == 0)
  4743. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  4744. else
  4745. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4746. }
  4747.  
  4748.  
  4749. }
  4750.  
  4751. }
  4752. }
  4753. else
  4754. {
  4755. if (enemyhas.Length == 0)
  4756. {
  4757. if (!TryPushcapsule(gooda[m], game))
  4758. {
  4759. if (game.Turn % 2 == 0)
  4760. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  4761. else
  4762. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  4763. }
  4764. }
  4765. if (enemyhas.Length == 1)
  4766. {
  4767. if (!TryPushcapsule(gooda[m], game))
  4768. if (game.Turn % 2 == 0)
  4769. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4770. else
  4771. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4772. }
  4773. if (enemyhas.Length == 2)
  4774. {
  4775. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4776. if (!TryPushcapsule(gooda[m], game))
  4777. {
  4778. if (game.Turn % 2 == 0)
  4779. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4780. else
  4781. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4782. }
  4783.  
  4784. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4785. if (!TryPushcapsule(gooda[m], game))
  4786. {
  4787. if (game.Turn % 2 == 0)
  4788. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  4789. else
  4790. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4791. }
  4792.  
  4793.  
  4794.  
  4795. }
  4796. // 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]); }
  4797. }
  4798. // 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]); }
  4799. }
  4800.  
  4801. if (gooda.Length > 8)
  4802. {
  4803. int m = 8;
  4804. if (allworm.Length > 0)
  4805. {
  4806. for (int i = 0; i < allworm.Length; i++)
  4807. {
  4808.  
  4809. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  4810. {
  4811.  
  4812. if (!TryPushcapsule(gooda[m], game))
  4813.  
  4814. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  4815. }
  4816. }
  4817. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  4818. {
  4819. if (enemyhas.Length == 0)
  4820. {
  4821. if (!TryPushcapsule(gooda[m], game))
  4822. {
  4823. if (game.Turn % 2 == 0)
  4824. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  4825. else
  4826. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  4827. }
  4828. }
  4829. if (enemyhas.Length == 1)
  4830. {
  4831. if (!TryPushcapsule(gooda[m], game))
  4832. if (game.Turn % 2 == 0)
  4833. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4834. else
  4835. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4836. }
  4837. if (enemyhas.Length == 2)
  4838. {
  4839. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4840. if (!TryPushcapsule(gooda[m], game))
  4841. {
  4842. if (game.Turn % 2 == 0)
  4843. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4844. else
  4845. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4846. }
  4847.  
  4848. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4849. if (!TryPushcapsule(gooda[m], game))
  4850. {
  4851. if (game.Turn % 2 == 0)
  4852. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  4853. else
  4854. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4855. }
  4856.  
  4857.  
  4858. }
  4859.  
  4860. }
  4861. }
  4862. else
  4863. {
  4864. if (enemyhas.Length == 0)
  4865. {
  4866. if (!TryPushcapsule(gooda[m], game))
  4867. {
  4868. if (game.Turn % 2 == 0)
  4869. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  4870. else
  4871. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  4872. }
  4873. }
  4874. if (enemyhas.Length == 1)
  4875. {
  4876. if (!TryPushcapsule(gooda[m], game))
  4877. if (game.Turn % 2 == 0)
  4878. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4879. else
  4880. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4881. }
  4882. if (enemyhas.Length == 2)
  4883. {
  4884. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4885. if (!TryPushcapsule(gooda[m], game))
  4886. {
  4887. if (game.Turn % 2 == 0)
  4888. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  4889. else
  4890. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4891. }
  4892.  
  4893. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4894. if (!TryPushcapsule(gooda[m], game))
  4895. {
  4896. if (game.Turn % 2 == 0)
  4897. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  4898. else
  4899. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  4900. }
  4901.  
  4902.  
  4903.  
  4904. }
  4905. // 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]); }
  4906. }
  4907. // 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]); }
  4908. }
  4909.  
  4910. if (gooda.Length > 9)
  4911. {
  4912. int m = 9;
  4913. if (allworm.Length > 0)
  4914. {
  4915. for (int i = 0; i < allworm.Length; i++)
  4916. {
  4917.  
  4918. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  4919. {
  4920.  
  4921. if (!TryPushcapsule(gooda[m], game))
  4922.  
  4923. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  4924. }
  4925. }
  4926. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  4927. {
  4928. if (enemyhas.Length == 0)
  4929. if (!TryPushcapsule(gooda[m], game))
  4930. {
  4931. if (game.Turn % 2 == 0)
  4932. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  4933. else
  4934. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  4935. }
  4936. if (enemyhas.Length == 1)
  4937. {
  4938. if (!TryPushcapsule(gooda[m], game))
  4939. {
  4940. if (game.Turn % 2 == 0)
  4941. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4942. else
  4943. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4944. }
  4945.  
  4946. }
  4947. if (enemyhas.Length == 2)
  4948. {
  4949.  
  4950. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  4951. {
  4952. if (gooda[m].Distance(enemyhas[0]) <= 300)
  4953. {
  4954. if (!TryPushcapsule(gooda[m], game))
  4955. gooda[m].Sail(enemyhas[0]);
  4956. }
  4957. else
  4958. {
  4959. if (!TryPushcapsule(gooda[m], game))
  4960. {
  4961. if (game.Turn % 2 == 0)
  4962. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  4963. else
  4964. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  4965.  
  4966. }
  4967. }
  4968.  
  4969. }
  4970. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  4971. {
  4972. if (gooda[m].Distance(enemyhas[1]) <= 300)
  4973. {
  4974. if (!TryPushcapsule(gooda[m], game))
  4975. gooda[m].Sail(enemyhas[1]);
  4976. }
  4977. else
  4978. {
  4979. if (!TryPushcapsule(gooda[m], game))
  4980. {
  4981. if (game.Turn % 2 == 0)
  4982. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  4983. else
  4984. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  4985.  
  4986. }
  4987. }
  4988. }
  4989. }
  4990.  
  4991. }
  4992. }
  4993. else
  4994. {
  4995. if (enemyhas.Length == 0)
  4996. if (!TryPushcapsule(gooda[m], game))
  4997. {
  4998. if (game.Turn % 2 == 0)
  4999. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  5000. else
  5001. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  5002. }
  5003. if (enemyhas.Length == 1)
  5004. {
  5005. if (!TryPushcapsule(gooda[m], game))
  5006. {
  5007. if (game.Turn % 2 == 0)
  5008. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5009. else
  5010. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5011. }
  5012.  
  5013. }
  5014. if (enemyhas.Length == 2)
  5015. {
  5016.  
  5017. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5018. {
  5019. if (gooda[m].Distance(enemyhas[0]) <= 300)
  5020. {
  5021. if (!TryPushcapsule(gooda[m], game))
  5022. gooda[m].Sail(enemyhas[0]);
  5023. }
  5024. else
  5025. {
  5026. if (!TryPushcapsule(gooda[m], game))
  5027. {
  5028. if (game.Turn % 2 == 0)
  5029. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5030. else
  5031. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5032.  
  5033. }
  5034. }
  5035.  
  5036. }
  5037. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5038. {
  5039. if (gooda[m].Distance(enemyhas[1]) <= 300)
  5040. {
  5041. if (!TryPushcapsule(gooda[m], game))
  5042. gooda[m].Sail(enemyhas[1]);
  5043. }
  5044. else
  5045. {
  5046. if (!TryPushcapsule(gooda[m], game))
  5047. {
  5048. if (game.Turn % 2 == 0)
  5049. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  5050. else
  5051. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  5052.  
  5053. }
  5054. }
  5055. }
  5056. }
  5057.  
  5058. }
  5059. // 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]); }
  5060. }
  5061. }
  5062. }
  5063.  
  5064.  
  5065. else
  5066. {
  5067. if (gcapsule.Length > 1)
  5068. {
  5069. if (allworm.Length > 0)
  5070. {
  5071. if (gooda.Length > 7)
  5072. if (!TryPushcapsuleBotWorm(gooda[7], game))
  5073. gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  5074.  
  5075.  
  5076. if (gooda.Length > 1)
  5077. {
  5078. if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
  5079. {
  5080. if (!TryPushcapsuleBotWorm(gooda[1], game))
  5081. gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  5082. }
  5083. else
  5084. {
  5085. if (!TryPushcapsuleBotWorm2(gooda[1], game))
  5086. gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
  5087. }
  5088. }
  5089. }
  5090. if (gooda.Length > 2)
  5091. {
  5092. if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
  5093. {
  5094. if (!TryPush(gooda[0], game))
  5095. gooda[0].Sail(gcapsule[0].InitialLocation);
  5096. if (!TryPush(gooda[2], game))
  5097. {
  5098. if (allworm.Length > 0)
  5099. {
  5100. 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)
  5101. gooda[2].Sail(allworm[0]);
  5102. else
  5103. gooda[2].Sail(gcapsule[1].InitialLocation);
  5104. }
  5105. else
  5106. gooda[2].Sail(gcapsule[1].InitialLocation);
  5107. }
  5108.  
  5109. }
  5110.  
  5111. if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
  5112. {
  5113. int sucheck = 0;
  5114. if (!TryPushaste(gooda[0], game))
  5115. {
  5116. if (allworm.Length > 0)
  5117. {
  5118. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  5119. gooda[0].Sail(allworm[0].Partner);
  5120. else
  5121. {
  5122. gooda[0].Sail(gmother[0]);
  5123. }
  5124. }
  5125. else
  5126. {
  5127. gooda[0].Sail(gmother[0]);
  5128. }
  5129. }
  5130. if (!TryPushcapsuleattack(gooda[2], game))
  5131. {
  5132. gooda[2].Sail(gcapsule[1].InitialLocation);
  5133.  
  5134. }
  5135.  
  5136.  
  5137. }
  5138.  
  5139. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
  5140. {
  5141. int checker2 = 0;
  5142. gooda[0].Sail(gcapsule[0].InitialLocation);
  5143.  
  5144. if (!TryPushcapsuleattack2(gooda[2], game))
  5145. {
  5146. if (allworm.Length > 0)
  5147. {
  5148. if ((gooda[2].Distance(gmother[0]) >= gooda[2].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  5149. gooda[2].Sail(allworm[0].Partner);
  5150. else
  5151. {
  5152. gooda[2].Sail(gmother[0]);
  5153. }
  5154. }
  5155. else
  5156. {
  5157. gooda[2].Sail(gmother[0]);
  5158.  
  5159.  
  5160. }
  5161. }
  5162.  
  5163.  
  5164.  
  5165.  
  5166. }
  5167.  
  5168.  
  5169.  
  5170.  
  5171.  
  5172. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
  5173. {
  5174. int checker3 = 0;
  5175. int checker4 = 0;
  5176. if (!TryPushaste(gooda[0], game))
  5177. {
  5178. if (allworm.Length > 0)
  5179. {
  5180. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  5181. gooda[0].Sail(allworm[0].Partner);
  5182. else
  5183. {
  5184. gooda[0].Sail(gmother[0]);
  5185. }
  5186. }
  5187. else
  5188. {
  5189. gooda[0].Sail(gmother[0]);
  5190. }
  5191. }
  5192. if (!TryPushcapsuleattack2(gooda[2], game))
  5193. {
  5194. if (allworm.Length > 0)
  5195. {
  5196. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  5197. gooda[2].Sail(allworm[0].Partner);
  5198. else
  5199. {
  5200. gooda[2].Sail(gmother[0]);
  5201.  
  5202.  
  5203. }
  5204. }
  5205.  
  5206. else
  5207. {
  5208. gooda[2].Sail(gmother[0]);
  5209.  
  5210.  
  5211. }
  5212. }
  5213. }
  5214. }
  5215.  
  5216. if (gooda.Length > 3)
  5217. {
  5218. int m = 3;
  5219. if (allworm.Length > 0)
  5220. {
  5221. for (int i = 0; i < allworm.Length; i++)
  5222. {
  5223.  
  5224. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  5225. {
  5226.  
  5227. if (!TryPushcapsule(gooda[m], game))
  5228.  
  5229. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  5230. }
  5231. }
  5232. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  5233. {
  5234. if (enemyhas.Length == 0)
  5235. if (!TryPushcapsule(gooda[m], game))
  5236. {
  5237. if (game.Turn % 2 == 0)
  5238. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  5239. else
  5240. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  5241. }
  5242. if (enemyhas.Length == 1)
  5243. {
  5244. if (!TryPushcapsule(gooda[m], game))
  5245. {
  5246. if (game.Turn % 2 == 0)
  5247. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5248. else
  5249. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5250. }
  5251.  
  5252. }
  5253. if (enemyhas.Length == 2)
  5254. {
  5255.  
  5256. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5257. {
  5258. if (gooda[m].Distance(enemyhas[0]) <= 300)
  5259. {
  5260. if (!TryPushcapsule(gooda[m], game))
  5261. gooda[m].Sail(enemyhas[0]);
  5262. }
  5263. else
  5264. {
  5265. if (!TryPushcapsule(gooda[m], game))
  5266. {
  5267. if (game.Turn % 2 == 0)
  5268. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5269. else
  5270. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5271.  
  5272. }
  5273. }
  5274.  
  5275. }
  5276. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5277. {
  5278. if (gooda[m].Distance(enemyhas[1]) <= 300)
  5279. {
  5280. if (!TryPushcapsule(gooda[m], game))
  5281. gooda[m].Sail(enemyhas[1]);
  5282. }
  5283. else
  5284. {
  5285. if (!TryPushcapsule(gooda[m], game))
  5286. {
  5287. if (game.Turn % 2 == 0)
  5288. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  5289. else
  5290. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  5291.  
  5292. }
  5293. }
  5294. }
  5295. }
  5296.  
  5297. }
  5298. }
  5299. else
  5300. {
  5301. if (enemyhas.Length == 0)
  5302. if (!TryPushcapsule(gooda[m], game))
  5303. {
  5304. if (game.Turn % 2 == 0)
  5305. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  5306. else
  5307. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  5308. }
  5309. if (enemyhas.Length == 1)
  5310. {
  5311. if (!TryPushcapsule(gooda[m], game))
  5312. {
  5313. if (game.Turn % 2 == 0)
  5314. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5315. else
  5316. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5317. }
  5318.  
  5319. }
  5320. if (enemyhas.Length == 2)
  5321. {
  5322.  
  5323. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5324. {
  5325. if (gooda[m].Distance(enemyhas[0]) <= 300)
  5326. {
  5327. if (!TryPushcapsule(gooda[m], game))
  5328. gooda[m].Sail(enemyhas[0]);
  5329. }
  5330. else
  5331. {
  5332. if (!TryPushcapsule(gooda[m], game))
  5333. {
  5334. if (game.Turn % 2 == 0)
  5335. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5336. else
  5337. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5338.  
  5339. }
  5340. }
  5341.  
  5342. }
  5343. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5344. {
  5345. if (gooda[m].Distance(enemyhas[1]) <= 300)
  5346. {
  5347. if (!TryPushcapsule(gooda[m], game))
  5348. gooda[m].Sail(enemyhas[1]);
  5349. }
  5350. else
  5351. {
  5352. if (!TryPushcapsule(gooda[m], game))
  5353. {
  5354. if (game.Turn % 2 == 0)
  5355. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  5356. else
  5357. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  5358.  
  5359. }
  5360. }
  5361. }
  5362. }
  5363.  
  5364. }
  5365. }
  5366. if (gooda.Length > 4)
  5367. {
  5368. int m = 4;
  5369. if (allworm.Length > 0)
  5370. {
  5371. for (int i = 0; i < allworm.Length; i++)
  5372. {
  5373.  
  5374. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  5375. {
  5376.  
  5377. if (!TryPushcapsule(gooda[m], game))
  5378.  
  5379. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  5380. }
  5381. }
  5382. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  5383. {
  5384. if (enemyhas.Length == 0)
  5385. if (!TryPushcapsule(gooda[m], game))
  5386. {
  5387. if (game.Turn % 2 == 0)
  5388. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  5389. else
  5390. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  5391. }
  5392. if (enemyhas.Length == 1)
  5393. {
  5394. if (!TryPushcapsule(gooda[m], game))
  5395. {
  5396. if (game.Turn % 2 == 0)
  5397. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5398. else
  5399. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5400. }
  5401.  
  5402. }
  5403. if (enemyhas.Length == 2)
  5404. {
  5405.  
  5406. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5407. {
  5408. if (gooda[m].Distance(enemyhas[0]) <= 300)
  5409. {
  5410. if (!TryPushcapsule(gooda[m], game))
  5411. gooda[m].Sail(enemyhas[0]);
  5412. }
  5413. else
  5414. {
  5415. if (!TryPushcapsule(gooda[m], game))
  5416. {
  5417. if (game.Turn % 2 == 0)
  5418. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5419. else
  5420. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5421.  
  5422. }
  5423. }
  5424.  
  5425. }
  5426. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5427. {
  5428. if (gooda[m].Distance(enemyhas[1]) <= 300)
  5429. {
  5430. if (!TryPushcapsule(gooda[m], game))
  5431. gooda[m].Sail(enemyhas[1]);
  5432. }
  5433. else
  5434. {
  5435. if (!TryPushcapsule(gooda[m], game))
  5436. {
  5437. if (game.Turn % 2 == 0)
  5438. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  5439. else
  5440. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  5441.  
  5442. }
  5443. }
  5444. }
  5445. }
  5446.  
  5447. }
  5448. }
  5449. else
  5450. {
  5451. if (enemyhas.Length == 0)
  5452. if (!TryPushcapsule(gooda[m], game))
  5453. {
  5454. if (game.Turn % 2 == 0)
  5455. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  5456. else
  5457. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  5458. }
  5459. if (enemyhas.Length == 1)
  5460. {
  5461. if (!TryPushcapsule(gooda[m], game))
  5462. {
  5463. if (game.Turn % 2 == 0)
  5464. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5465. else
  5466. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5467. }
  5468.  
  5469. }
  5470. if (enemyhas.Length == 2)
  5471. {
  5472.  
  5473. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5474. {
  5475. if (gooda[m].Distance(enemyhas[0]) <= 300)
  5476. {
  5477. if (!TryPushcapsule(gooda[m], game))
  5478. gooda[m].Sail(enemyhas[0]);
  5479. }
  5480. else
  5481. {
  5482. if (!TryPushcapsule(gooda[m], game))
  5483. {
  5484. if (game.Turn % 2 == 0)
  5485. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5486. else
  5487. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5488.  
  5489. }
  5490. }
  5491.  
  5492. }
  5493. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5494. {
  5495. if (gooda[m].Distance(enemyhas[1]) <= 300)
  5496. {
  5497. if (!TryPushcapsule(gooda[m], game))
  5498. gooda[m].Sail(enemyhas[1]);
  5499. }
  5500. else
  5501. {
  5502. if (!TryPushcapsule(gooda[m], game))
  5503. {
  5504. if (game.Turn % 2 == 0)
  5505. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  5506. else
  5507. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  5508.  
  5509. }
  5510. }
  5511. }
  5512. }
  5513.  
  5514. }
  5515. }
  5516.  
  5517. //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]); }
  5518.  
  5519.  
  5520. System.Console.WriteLine(enemy[0].PushRange);
  5521.  
  5522.  
  5523. if (gooda.Length > 5)
  5524. {
  5525. int m = 5;
  5526. if (allworm.Length > 0)
  5527. {
  5528. for (int i = 0; i < allworm.Length; i++)
  5529. {
  5530.  
  5531. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  5532. {
  5533.  
  5534. if (!TryPushcapsule(gooda[m], game))
  5535.  
  5536. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  5537. }
  5538. }
  5539. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  5540. {
  5541. if (enemyhas.Length == 0)
  5542. {
  5543. if (!TryPushcapsule(gooda[m], game))
  5544. {
  5545. if (game.Turn % 2 == 0)
  5546. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  5547. else
  5548. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  5549. }
  5550. }
  5551. if (enemyhas.Length == 1)
  5552. {
  5553. if (!TryPushcapsule(gooda[m], game))
  5554. if (game.Turn % 2 == 0)
  5555. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5556. else
  5557. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5558. }
  5559. if (enemyhas.Length == 2)
  5560. {
  5561. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5562. if (!TryPushcapsule(gooda[m], game))
  5563. {
  5564. if (game.Turn % 2 == 0)
  5565. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5566. else
  5567. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5568. }
  5569.  
  5570. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5571. if (!TryPushcapsule(gooda[m], game))
  5572. {
  5573. if (game.Turn % 2 == 0)
  5574. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  5575. else
  5576. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5577. }
  5578.  
  5579.  
  5580. }
  5581.  
  5582. }
  5583. }
  5584. else
  5585. {
  5586. if (enemyhas.Length == 0)
  5587. {
  5588. if (!TryPushcapsule(gooda[m], game))
  5589. {
  5590. if (game.Turn % 2 == 0)
  5591. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  5592. else
  5593. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  5594. }
  5595. }
  5596. if (enemyhas.Length == 1)
  5597. {
  5598. if (!TryPushcapsule(gooda[m], game))
  5599. if (game.Turn % 2 == 0)
  5600. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5601. else
  5602. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5603. }
  5604. if (enemyhas.Length == 2)
  5605. {
  5606. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5607. if (!TryPushcapsule(gooda[m], game))
  5608. {
  5609. if (game.Turn % 2 == 0)
  5610. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5611. else
  5612. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5613. }
  5614.  
  5615. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5616. if (!TryPushcapsule(gooda[m], game))
  5617. {
  5618. if (game.Turn % 2 == 0)
  5619. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  5620. else
  5621. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5622. }
  5623.  
  5624.  
  5625.  
  5626. }
  5627. // 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]); }
  5628. }
  5629. }
  5630.  
  5631. if (gooda.Length > 6)
  5632. {
  5633. int m = 6;
  5634. if (allworm.Length > 0)
  5635. {
  5636. for (int i = 0; i < allworm.Length; i++)
  5637. {
  5638.  
  5639. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  5640. {
  5641.  
  5642. if (!TryPushcapsule(gooda[m], game))
  5643.  
  5644. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  5645. }
  5646. }
  5647. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  5648. {
  5649. if (enemyhas.Length == 0)
  5650. {
  5651. if (!TryPushcapsule(gooda[m], game))
  5652. {
  5653. if (game.Turn % 2 == 0)
  5654. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  5655. else
  5656. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  5657. }
  5658. }
  5659. if (enemyhas.Length == 1)
  5660. {
  5661. if (!TryPushcapsule(gooda[m], game))
  5662. if (game.Turn % 2 == 0)
  5663. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5664. else
  5665. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5666. }
  5667. if (enemyhas.Length == 2)
  5668. {
  5669. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5670. if (!TryPushcapsule(gooda[m], game))
  5671. {
  5672. if (game.Turn % 2 == 0)
  5673. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5674. else
  5675. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5676. }
  5677.  
  5678. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5679. if (!TryPushcapsule(gooda[m], game))
  5680. {
  5681. if (game.Turn % 2 == 0)
  5682. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  5683. else
  5684. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5685. }
  5686.  
  5687.  
  5688. }
  5689.  
  5690. }
  5691. }
  5692. else
  5693. {
  5694. if (enemyhas.Length == 0)
  5695. {
  5696. if (!TryPushcapsule(gooda[m], game))
  5697. {
  5698. if (game.Turn % 2 == 0)
  5699. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  5700. else
  5701. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  5702. }
  5703. }
  5704. if (enemyhas.Length == 1)
  5705. {
  5706. if (!TryPushcapsule(gooda[m], game))
  5707. if (game.Turn % 2 == 0)
  5708. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5709. else
  5710. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5711. }
  5712. if (enemyhas.Length == 2)
  5713. {
  5714. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5715. if (!TryPushcapsule(gooda[m], game))
  5716. {
  5717. if (game.Turn % 2 == 0)
  5718. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5719. else
  5720. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5721. }
  5722.  
  5723. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5724. if (!TryPushcapsule(gooda[m], game))
  5725. {
  5726. if (game.Turn % 2 == 0)
  5727. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  5728. else
  5729. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5730. }
  5731.  
  5732.  
  5733.  
  5734. }
  5735. // 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]); }
  5736. }
  5737. // 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]); }
  5738. }
  5739.  
  5740. if (gooda.Length > 8)
  5741. {
  5742. int m = 8;
  5743. if (allworm.Length > 0)
  5744. {
  5745. for (int i = 0; i < allworm.Length; i++)
  5746. {
  5747.  
  5748. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  5749. {
  5750.  
  5751. if (!TryPushcapsule(gooda[m], game))
  5752.  
  5753. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  5754. }
  5755. }
  5756. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  5757. {
  5758. if (enemyhas.Length == 0)
  5759. {
  5760. if (!TryPushcapsule(gooda[m], game))
  5761. {
  5762. if (game.Turn % 2 == 0)
  5763. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  5764. else
  5765. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  5766. }
  5767. }
  5768. if (enemyhas.Length == 1)
  5769. {
  5770. if (!TryPushcapsule(gooda[m], game))
  5771. if (game.Turn % 2 == 0)
  5772. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5773. else
  5774. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5775. }
  5776. if (enemyhas.Length == 2)
  5777. {
  5778. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5779. if (!TryPushcapsule(gooda[m], game))
  5780. {
  5781. if (game.Turn % 2 == 0)
  5782. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5783. else
  5784. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5785. }
  5786.  
  5787. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5788. if (!TryPushcapsule(gooda[m], game))
  5789. {
  5790. if (game.Turn % 2 == 0)
  5791. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  5792. else
  5793. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5794. }
  5795.  
  5796.  
  5797. }
  5798.  
  5799. }
  5800. }
  5801. else
  5802. {
  5803. if (enemyhas.Length == 0)
  5804. {
  5805. if (!TryPushcapsule(gooda[m], game))
  5806. {
  5807. if (game.Turn % 2 == 0)
  5808. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  5809. else
  5810. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  5811. }
  5812. }
  5813. if (enemyhas.Length == 1)
  5814. {
  5815. if (!TryPushcapsule(gooda[m], game))
  5816. if (game.Turn % 2 == 0)
  5817. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5818. else
  5819. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5820. }
  5821. if (enemyhas.Length == 2)
  5822. {
  5823. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5824. if (!TryPushcapsule(gooda[m], game))
  5825. {
  5826. if (game.Turn % 2 == 0)
  5827. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  5828. else
  5829. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5830. }
  5831.  
  5832. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5833. if (!TryPushcapsule(gooda[m], game))
  5834. {
  5835. if (game.Turn % 2 == 0)
  5836. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  5837. else
  5838. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  5839. }
  5840.  
  5841.  
  5842.  
  5843. }
  5844. // 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]); }
  5845. }
  5846. // 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]); }
  5847. }
  5848.  
  5849. if (gooda.Length > 9)
  5850. {
  5851. int m = 9;
  5852. if (allworm.Length > 0)
  5853. {
  5854. for (int i = 0; i < allworm.Length; i++)
  5855. {
  5856.  
  5857. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  5858. {
  5859.  
  5860. if (!TryPushcapsule(gooda[m], game))
  5861.  
  5862. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  5863. }
  5864. }
  5865. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  5866. {
  5867. if (enemyhas.Length == 0)
  5868. if (!TryPushcapsule(gooda[m], game))
  5869. {
  5870. if (game.Turn % 2 == 0)
  5871. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  5872. else
  5873. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  5874. }
  5875. if (enemyhas.Length == 1)
  5876. {
  5877. if (!TryPushcapsule(gooda[m], game))
  5878. {
  5879. if (game.Turn % 2 == 0)
  5880. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5881. else
  5882. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5883. }
  5884.  
  5885. }
  5886. if (enemyhas.Length == 2)
  5887. {
  5888.  
  5889. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5890. {
  5891. if (gooda[m].Distance(enemyhas[0]) <= 300)
  5892. {
  5893. if (!TryPushcapsule(gooda[m], game))
  5894. gooda[m].Sail(enemyhas[0]);
  5895. }
  5896. else
  5897. {
  5898. if (!TryPushcapsule(gooda[m], game))
  5899. {
  5900. if (game.Turn % 2 == 0)
  5901. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5902. else
  5903. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5904.  
  5905. }
  5906. }
  5907.  
  5908. }
  5909. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5910. {
  5911. if (gooda[m].Distance(enemyhas[1]) <= 300)
  5912. {
  5913. if (!TryPushcapsule(gooda[m], game))
  5914. gooda[m].Sail(enemyhas[1]);
  5915. }
  5916. else
  5917. {
  5918. if (!TryPushcapsule(gooda[m], game))
  5919. {
  5920. if (game.Turn % 2 == 0)
  5921. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  5922. else
  5923. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  5924.  
  5925. }
  5926. }
  5927. }
  5928. }
  5929.  
  5930. }
  5931. }
  5932. else
  5933. {
  5934. if (enemyhas.Length == 0)
  5935. if (!TryPushcapsule(gooda[m], game))
  5936. {
  5937. if (game.Turn % 2 == 0)
  5938. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  5939. else
  5940. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  5941. }
  5942. if (enemyhas.Length == 1)
  5943. {
  5944. if (!TryPushcapsule(gooda[m], game))
  5945. {
  5946. if (game.Turn % 2 == 0)
  5947. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5948. else
  5949. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5950. }
  5951.  
  5952. }
  5953. if (enemyhas.Length == 2)
  5954. {
  5955.  
  5956. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  5957. {
  5958. if (gooda[m].Distance(enemyhas[0]) <= 300)
  5959. {
  5960. if (!TryPushcapsule(gooda[m], game))
  5961. gooda[m].Sail(enemyhas[0]);
  5962. }
  5963. else
  5964. {
  5965. if (!TryPushcapsule(gooda[m], game))
  5966. {
  5967. if (game.Turn % 2 == 0)
  5968. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  5969. else
  5970. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  5971.  
  5972. }
  5973. }
  5974.  
  5975. }
  5976. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  5977. {
  5978. if (gooda[m].Distance(enemyhas[1]) <= 300)
  5979. {
  5980. if (!TryPushcapsule(gooda[m], game))
  5981. gooda[m].Sail(enemyhas[1]);
  5982. }
  5983. else
  5984. {
  5985. if (!TryPushcapsule(gooda[m], game))
  5986. {
  5987. if (game.Turn % 2 == 0)
  5988. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  5989. else
  5990. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  5991.  
  5992. }
  5993. }
  5994. }
  5995. }
  5996.  
  5997. }
  5998. // 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]); }
  5999. }
  6000.  
  6001.  
  6002. }
  6003. else
  6004. {
  6005. if (allworm.Length > 0)
  6006. {
  6007. if (gooda.Length > 7)
  6008. if (!TryPushcapsuleBotWorm(gooda[7], game))
  6009. gooda[7].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  6010.  
  6011.  
  6012. if (gooda.Length > 1)
  6013. {
  6014. if (allworm[0].GetLocation().Distance(gmother[0]) >= 800)
  6015. {
  6016. if (!TryPushcapsuleBotWorm(gooda[1], game))
  6017. gooda[1].Sail(allworm[0].GetLocation().Towards(emother[0], 250));
  6018. }
  6019. else
  6020. {
  6021. if (!TryPushcapsuleBotWorm2(gooda[1], game))
  6022. gooda[1].Sail(allworm[1].GetLocation().Towards(emother[0], 250));
  6023. }
  6024. }
  6025. }
  6026.  
  6027.  
  6028. if (gooda[0].HasCapsule() == false)
  6029. {
  6030. if (allworm.Length > 0)
  6031. {
  6032. 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)
  6033. gooda[0].Sail(allworm[0]);
  6034. else
  6035. gooda[0].Sail(gcapsule[0].InitialLocation);
  6036. }
  6037. else
  6038. if (!TryPush(gooda[0], game))
  6039. gooda[0].Sail(gcapsule[0].InitialLocation);
  6040.  
  6041.  
  6042. }
  6043.  
  6044. if (gooda[0].HasCapsule() == true)
  6045. {
  6046. int sucheck = 0;
  6047. if (!TryPushaste(gooda[0], game))
  6048. {
  6049. if (allworm.Length > 0)
  6050. {
  6051. if ((gooda[0].Distance(gmother[0]) > gooda[0].Distance(allworm[0].Partner) + allworm[0].Distance(gmother[0])))
  6052. gooda[0].Sail(allworm[0].Partner);
  6053. else
  6054. {
  6055. gooda[0].Sail(gmother[0]);
  6056. }
  6057. }
  6058. else
  6059. {
  6060. gooda[0].Sail(gmother[0]);
  6061. }
  6062. }
  6063.  
  6064.  
  6065.  
  6066. }
  6067.  
  6068.  
  6069. if (gooda.Length > 2)
  6070. {
  6071. int m = 2;
  6072. if (allworm.Length > 0)
  6073. {
  6074. for (int i = 0; i < allworm.Length; i++)
  6075. {
  6076.  
  6077. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  6078. {
  6079.  
  6080. if (!TryPushcapsule(gooda[m], game))
  6081.  
  6082. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  6083. }
  6084. }
  6085. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  6086. {
  6087. if (enemyhas.Length == 0)
  6088. if (!TryPushcapsule(gooda[m], game))
  6089. {
  6090. if (game.Turn % 2 == 0)
  6091. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  6092. else
  6093. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  6094. }
  6095. if (enemyhas.Length == 1)
  6096. {
  6097. if (!TryPushcapsule(gooda[m], game))
  6098. {
  6099. if (game.Turn % 2 == 0)
  6100. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6101. else
  6102. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6103. }
  6104.  
  6105. }
  6106. if (enemyhas.Length == 2)
  6107. {
  6108.  
  6109. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6110. {
  6111. if (gooda[m].Distance(enemyhas[0]) <= 300)
  6112. {
  6113. if (!TryPushcapsule(gooda[m], game))
  6114. gooda[m].Sail(enemyhas[0]);
  6115. }
  6116. else
  6117. {
  6118. if (!TryPushcapsule(gooda[m], game))
  6119. {
  6120. if (game.Turn % 2 == 0)
  6121. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6122. else
  6123. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6124.  
  6125. }
  6126. }
  6127.  
  6128. }
  6129. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6130. {
  6131. if (gooda[m].Distance(enemyhas[1]) <= 300)
  6132. {
  6133. if (!TryPushcapsule(gooda[m], game))
  6134. gooda[m].Sail(enemyhas[1]);
  6135. }
  6136. else
  6137. {
  6138. if (!TryPushcapsule(gooda[m], game))
  6139. {
  6140. if (game.Turn % 2 == 0)
  6141. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  6142. else
  6143. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  6144.  
  6145. }
  6146. }
  6147. }
  6148. }
  6149.  
  6150. }
  6151. }
  6152. else
  6153. {
  6154. if (enemyhas.Length == 0)
  6155. if (!TryPushcapsule(gooda[m], game))
  6156. {
  6157. if (game.Turn % 2 == 0)
  6158. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  6159. else
  6160. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  6161. }
  6162. if (enemyhas.Length == 1)
  6163. {
  6164. if (!TryPushcapsule(gooda[m], game))
  6165. {
  6166. if (game.Turn % 2 == 0)
  6167. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6168. else
  6169. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6170. }
  6171.  
  6172. }
  6173. if (enemyhas.Length == 2)
  6174. {
  6175.  
  6176. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6177. {
  6178. if (gooda[m].Distance(enemyhas[0]) <= 300)
  6179. {
  6180. if (!TryPushcapsule(gooda[m], game))
  6181. gooda[m].Sail(enemyhas[0]);
  6182. }
  6183. else
  6184. {
  6185. if (!TryPushcapsule(gooda[m], game))
  6186. {
  6187. if (game.Turn % 2 == 0)
  6188. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6189. else
  6190. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6191.  
  6192. }
  6193. }
  6194.  
  6195. }
  6196. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6197. {
  6198. if (gooda[m].Distance(enemyhas[1]) <= 300)
  6199. {
  6200. if (!TryPushcapsule(gooda[m], game))
  6201. gooda[m].Sail(enemyhas[1]);
  6202. }
  6203. else
  6204. {
  6205. if (!TryPushcapsule(gooda[m], game))
  6206. {
  6207. if (game.Turn % 2 == 0)
  6208. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  6209. else
  6210. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  6211.  
  6212. }
  6213. }
  6214. }
  6215. }
  6216.  
  6217. }
  6218. }
  6219.  
  6220.  
  6221.  
  6222.  
  6223. if (gooda.Length > 3)
  6224. {
  6225. int m = 3;
  6226. if (allworm.Length > 0)
  6227. {
  6228. for (int i = 0; i < allworm.Length; i++)
  6229. {
  6230.  
  6231. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  6232. {
  6233.  
  6234. if (!TryPushcapsule(gooda[m], game))
  6235.  
  6236. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  6237. }
  6238. }
  6239. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  6240. {
  6241. if (enemyhas.Length == 0)
  6242. if (!TryPushcapsule(gooda[m], game))
  6243. {
  6244. if (game.Turn % 2 == 0)
  6245. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  6246. else
  6247. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  6248. }
  6249. if (enemyhas.Length == 1)
  6250. {
  6251. if (!TryPushcapsule(gooda[m], game))
  6252. {
  6253. if (game.Turn % 2 == 0)
  6254. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6255. else
  6256. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6257. }
  6258.  
  6259. }
  6260. if (enemyhas.Length == 2)
  6261. {
  6262.  
  6263. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6264. {
  6265. if (gooda[m].Distance(enemyhas[0]) <= 300)
  6266. {
  6267. if (!TryPushcapsule(gooda[m], game))
  6268. gooda[m].Sail(enemyhas[0]);
  6269. }
  6270. else
  6271. {
  6272. if (!TryPushcapsule(gooda[m], game))
  6273. {
  6274. if (game.Turn % 2 == 0)
  6275. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6276. else
  6277. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6278.  
  6279. }
  6280. }
  6281.  
  6282. }
  6283. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6284. {
  6285. if (gooda[m].Distance(enemyhas[1]) <= 300)
  6286. {
  6287. if (!TryPushcapsule(gooda[m], game))
  6288. gooda[m].Sail(enemyhas[1]);
  6289. }
  6290. else
  6291. {
  6292. if (!TryPushcapsule(gooda[m], game))
  6293. {
  6294. if (game.Turn % 2 == 0)
  6295. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  6296. else
  6297. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  6298.  
  6299. }
  6300. }
  6301. }
  6302. }
  6303.  
  6304. }
  6305. }
  6306. else
  6307. {
  6308. if (enemyhas.Length == 0)
  6309. if (!TryPushcapsule(gooda[m], game))
  6310. {
  6311. if (game.Turn % 2 == 0)
  6312. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  6313. else
  6314. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  6315. }
  6316. if (enemyhas.Length == 1)
  6317. {
  6318. if (!TryPushcapsule(gooda[m], game))
  6319. {
  6320. if (game.Turn % 2 == 0)
  6321. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6322. else
  6323. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6324. }
  6325.  
  6326. }
  6327. if (enemyhas.Length == 2)
  6328. {
  6329.  
  6330. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6331. {
  6332. if (gooda[m].Distance(enemyhas[0]) <= 300)
  6333. {
  6334. if (!TryPushcapsule(gooda[m], game))
  6335. gooda[m].Sail(enemyhas[0]);
  6336. }
  6337. else
  6338. {
  6339. if (!TryPushcapsule(gooda[m], game))
  6340. {
  6341. if (game.Turn % 2 == 0)
  6342. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6343. else
  6344. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6345.  
  6346. }
  6347. }
  6348.  
  6349. }
  6350. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6351. {
  6352. if (gooda[m].Distance(enemyhas[1]) <= 300)
  6353. {
  6354. if (!TryPushcapsule(gooda[m], game))
  6355. gooda[m].Sail(enemyhas[1]);
  6356. }
  6357. else
  6358. {
  6359. if (!TryPushcapsule(gooda[m], game))
  6360. {
  6361. if (game.Turn % 2 == 0)
  6362. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  6363. else
  6364. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  6365.  
  6366. }
  6367. }
  6368. }
  6369. }
  6370.  
  6371. }
  6372. }
  6373. if (gooda.Length > 4)
  6374. {
  6375. int m = 4;
  6376. if (allworm.Length > 0)
  6377. {
  6378. for (int i = 0; i < allworm.Length; i++)
  6379. {
  6380.  
  6381. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  6382. {
  6383.  
  6384. if (!TryPushcapsule(gooda[m], game))
  6385.  
  6386. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  6387. }
  6388. }
  6389. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  6390. {
  6391. if (enemyhas.Length == 0)
  6392. if (!TryPushcapsule(gooda[m], game))
  6393. {
  6394. if (game.Turn % 2 == 0)
  6395. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  6396. else
  6397. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  6398. }
  6399. if (enemyhas.Length == 1)
  6400. {
  6401. if (!TryPushcapsule(gooda[m], game))
  6402. {
  6403. if (game.Turn % 2 == 0)
  6404. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6405. else
  6406. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6407. }
  6408.  
  6409. }
  6410. if (enemyhas.Length == 2)
  6411. {
  6412.  
  6413. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6414. {
  6415. if (gooda[m].Distance(enemyhas[0]) <= 300)
  6416. {
  6417. if (!TryPushcapsule(gooda[m], game))
  6418. gooda[m].Sail(enemyhas[0]);
  6419. }
  6420. else
  6421. {
  6422. if (!TryPushcapsule(gooda[m], game))
  6423. {
  6424. if (game.Turn % 2 == 0)
  6425. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6426. else
  6427. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6428.  
  6429. }
  6430. }
  6431.  
  6432. }
  6433. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6434. {
  6435. if (gooda[m].Distance(enemyhas[1]) <= 300)
  6436. {
  6437. if (!TryPushcapsule(gooda[m], game))
  6438. gooda[m].Sail(enemyhas[1]);
  6439. }
  6440. else
  6441. {
  6442. if (!TryPushcapsule(gooda[m], game))
  6443. {
  6444. if (game.Turn % 2 == 0)
  6445. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  6446. else
  6447. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  6448.  
  6449. }
  6450. }
  6451. }
  6452. }
  6453.  
  6454. }
  6455. }
  6456. else
  6457. {
  6458. if (enemyhas.Length == 0)
  6459. if (!TryPushcapsule(gooda[m], game))
  6460. {
  6461. if (game.Turn % 2 == 0)
  6462. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  6463. else
  6464. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  6465. }
  6466. if (enemyhas.Length == 1)
  6467. {
  6468. if (!TryPushcapsule(gooda[m], game))
  6469. {
  6470. if (game.Turn % 2 == 0)
  6471. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6472. else
  6473. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6474. }
  6475.  
  6476. }
  6477. if (enemyhas.Length == 2)
  6478. {
  6479.  
  6480. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6481. {
  6482. if (gooda[m].Distance(enemyhas[0]) <= 300)
  6483. {
  6484. if (!TryPushcapsule(gooda[m], game))
  6485. gooda[m].Sail(enemyhas[0]);
  6486. }
  6487. else
  6488. {
  6489. if (!TryPushcapsule(gooda[m], game))
  6490. {
  6491. if (game.Turn % 2 == 0)
  6492. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6493. else
  6494. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6495.  
  6496. }
  6497. }
  6498.  
  6499. }
  6500. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6501. {
  6502. if (gooda[m].Distance(enemyhas[1]) <= 300)
  6503. {
  6504. if (!TryPushcapsule(gooda[m], game))
  6505. gooda[m].Sail(enemyhas[1]);
  6506. }
  6507. else
  6508. {
  6509. if (!TryPushcapsule(gooda[m], game))
  6510. {
  6511. if (game.Turn % 2 == 0)
  6512. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  6513. else
  6514. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  6515.  
  6516. }
  6517. }
  6518. }
  6519. }
  6520.  
  6521. }
  6522. }
  6523.  
  6524. //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]); }
  6525.  
  6526.  
  6527. System.Console.WriteLine(enemy[0].PushRange);
  6528.  
  6529.  
  6530. if (gooda.Length > 5)
  6531. {
  6532. int m = 5;
  6533. if (allworm.Length > 0)
  6534. {
  6535. for (int i = 0; i < allworm.Length; i++)
  6536. {
  6537.  
  6538. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  6539. {
  6540.  
  6541. if (!TryPushcapsule(gooda[m], game))
  6542.  
  6543. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  6544. }
  6545. }
  6546. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  6547. {
  6548. if (enemyhas.Length == 0)
  6549. {
  6550. if (!TryPushcapsule(gooda[m], game))
  6551. {
  6552. if (game.Turn % 2 == 0)
  6553. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  6554. else
  6555. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  6556. }
  6557. }
  6558. if (enemyhas.Length == 1)
  6559. {
  6560. if (!TryPushcapsule(gooda[m], game))
  6561. if (game.Turn % 2 == 0)
  6562. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6563. else
  6564. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6565. }
  6566. if (enemyhas.Length == 2)
  6567. {
  6568. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6569. if (!TryPushcapsule(gooda[m], game))
  6570. {
  6571. if (game.Turn % 2 == 0)
  6572. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6573. else
  6574. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6575. }
  6576.  
  6577. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6578. if (!TryPushcapsule(gooda[m], game))
  6579. {
  6580. if (game.Turn % 2 == 0)
  6581. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  6582. else
  6583. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6584. }
  6585.  
  6586.  
  6587. }
  6588.  
  6589. }
  6590. }
  6591. else
  6592. {
  6593. if (enemyhas.Length == 0)
  6594. {
  6595. if (!TryPushcapsule(gooda[m], game))
  6596. {
  6597. if (game.Turn % 2 == 0)
  6598. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  6599. else
  6600. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  6601. }
  6602. }
  6603. if (enemyhas.Length == 1)
  6604. {
  6605. if (!TryPushcapsule(gooda[m], game))
  6606. if (game.Turn % 2 == 0)
  6607. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6608. else
  6609. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6610. }
  6611. if (enemyhas.Length == 2)
  6612. {
  6613. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6614. if (!TryPushcapsule(gooda[m], game))
  6615. {
  6616. if (game.Turn % 2 == 0)
  6617. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6618. else
  6619. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6620. }
  6621.  
  6622. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6623. if (!TryPushcapsule(gooda[m], game))
  6624. {
  6625. if (game.Turn % 2 == 0)
  6626. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  6627. else
  6628. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6629. }
  6630.  
  6631.  
  6632.  
  6633. }
  6634. // 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]); }
  6635. }
  6636. }
  6637.  
  6638. if (gooda.Length > 6)
  6639. {
  6640. int m = 6;
  6641. if (allworm.Length > 0)
  6642. {
  6643. for (int i = 0; i < allworm.Length; i++)
  6644. {
  6645.  
  6646. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  6647. {
  6648.  
  6649. if (!TryPushcapsule(gooda[m], game))
  6650.  
  6651. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  6652. }
  6653. }
  6654. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  6655. {
  6656. if (enemyhas.Length == 0)
  6657. {
  6658. if (!TryPushcapsule(gooda[m], game))
  6659. {
  6660. if (game.Turn % 2 == 0)
  6661. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  6662. else
  6663. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  6664. }
  6665. }
  6666. if (enemyhas.Length == 1)
  6667. {
  6668. if (!TryPushcapsule(gooda[m], game))
  6669. if (game.Turn % 2 == 0)
  6670. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6671. else
  6672. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6673. }
  6674. if (enemyhas.Length == 2)
  6675. {
  6676. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6677. if (!TryPushcapsule(gooda[m], game))
  6678. {
  6679. if (game.Turn % 2 == 0)
  6680. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6681. else
  6682. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6683. }
  6684.  
  6685. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6686. if (!TryPushcapsule(gooda[m], game))
  6687. {
  6688. if (game.Turn % 2 == 0)
  6689. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  6690. else
  6691. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6692. }
  6693.  
  6694.  
  6695. }
  6696.  
  6697. }
  6698. }
  6699. else
  6700. {
  6701. if (enemyhas.Length == 0)
  6702. {
  6703. if (!TryPushcapsule(gooda[m], game))
  6704. {
  6705. if (game.Turn % 2 == 0)
  6706. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  6707. else
  6708. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  6709. }
  6710. }
  6711. if (enemyhas.Length == 1)
  6712. {
  6713. if (!TryPushcapsule(gooda[m], game))
  6714. if (game.Turn % 2 == 0)
  6715. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6716. else
  6717. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6718. }
  6719. if (enemyhas.Length == 2)
  6720. {
  6721. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6722. if (!TryPushcapsule(gooda[m], game))
  6723. {
  6724. if (game.Turn % 2 == 0)
  6725. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6726. else
  6727. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6728. }
  6729.  
  6730. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6731. if (!TryPushcapsule(gooda[m], game))
  6732. {
  6733. if (game.Turn % 2 == 0)
  6734. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  6735. else
  6736. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6737. }
  6738.  
  6739.  
  6740.  
  6741. }
  6742. // 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]); }
  6743. }
  6744. // 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]); }
  6745. }
  6746.  
  6747. if (gooda.Length > 8)
  6748. {
  6749. int m = 8;
  6750. if (allworm.Length > 0)
  6751. {
  6752. for (int i = 0; i < allworm.Length; i++)
  6753. {
  6754.  
  6755. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1200))
  6756. {
  6757.  
  6758. if (!TryPushcapsule(gooda[m], game))
  6759.  
  6760. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 1200));
  6761. }
  6762. }
  6763. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1200) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1200))
  6764. {
  6765. if (enemyhas.Length == 0)
  6766. {
  6767. if (!TryPushcapsule(gooda[m], game))
  6768. {
  6769. if (game.Turn % 2 == 0)
  6770. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  6771. else
  6772. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  6773. }
  6774. }
  6775. if (enemyhas.Length == 1)
  6776. {
  6777. if (!TryPushcapsule(gooda[m], game))
  6778. if (game.Turn % 2 == 0)
  6779. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6780. else
  6781. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6782. }
  6783. if (enemyhas.Length == 2)
  6784. {
  6785. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6786. if (!TryPushcapsule(gooda[m], game))
  6787. {
  6788. if (game.Turn % 2 == 0)
  6789. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6790. else
  6791. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6792. }
  6793.  
  6794. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6795. if (!TryPushcapsule(gooda[m], game))
  6796. {
  6797. if (game.Turn % 2 == 0)
  6798. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  6799. else
  6800. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6801. }
  6802.  
  6803.  
  6804. }
  6805.  
  6806. }
  6807. }
  6808. else
  6809. {
  6810. if (enemyhas.Length == 0)
  6811. {
  6812. if (!TryPushcapsule(gooda[m], game))
  6813. {
  6814. if (game.Turn % 2 == 0)
  6815. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 950));
  6816. else
  6817. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 850));
  6818. }
  6819. }
  6820. if (enemyhas.Length == 1)
  6821. {
  6822. if (!TryPushcapsule(gooda[m], game))
  6823. if (game.Turn % 2 == 0)
  6824. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6825. else
  6826. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6827. }
  6828. if (enemyhas.Length == 2)
  6829. {
  6830. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6831. if (!TryPushcapsule(gooda[m], game))
  6832. {
  6833. if (game.Turn % 2 == 0)
  6834. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 950));
  6835. else
  6836. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6837. }
  6838.  
  6839. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6840. if (!TryPushcapsule(gooda[m], game))
  6841. {
  6842. if (game.Turn % 2 == 0)
  6843. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 950));
  6844. else
  6845. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 850));
  6846. }
  6847.  
  6848.  
  6849.  
  6850. }
  6851. // 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]); }
  6852. }
  6853. // 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]); }
  6854. }
  6855.  
  6856. if (gooda.Length > 9)
  6857. {
  6858. int m = 9;
  6859. if (allworm.Length > 0)
  6860. {
  6861. for (int i = 0; i < allworm.Length; i++)
  6862. {
  6863.  
  6864. if ((allworm[i].GetLocation().Distance(emother[0].GetLocation()) <= 1500))
  6865. {
  6866.  
  6867. if (!TryPushcapsule(gooda[m], game))
  6868.  
  6869. gooda[m].Sail(allworm[i].GetLocation().Towards(emother[0], 250));
  6870. }
  6871. }
  6872. if ((allworm[0].GetLocation().Distance(emother[0].GetLocation()) > 1500) && (allworm[1].GetLocation().Distance(emother[0].GetLocation()) > 1500))
  6873. {
  6874. if (enemyhas.Length == 0)
  6875. if (!TryPushcapsule(gooda[m], game))
  6876. {
  6877. if (game.Turn % 2 == 0)
  6878. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  6879. else
  6880. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  6881. }
  6882. if (enemyhas.Length == 1)
  6883. {
  6884. if (!TryPushcapsule(gooda[m], game))
  6885. {
  6886. if (game.Turn % 2 == 0)
  6887. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6888. else
  6889. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6890. }
  6891.  
  6892. }
  6893. if (enemyhas.Length == 2)
  6894. {
  6895.  
  6896. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6897. {
  6898. if (gooda[m].Distance(enemyhas[0]) <= 300)
  6899. {
  6900. if (!TryPushcapsule(gooda[m], game))
  6901. gooda[m].Sail(enemyhas[0]);
  6902. }
  6903. else
  6904. {
  6905. if (!TryPushcapsule(gooda[m], game))
  6906. {
  6907. if (game.Turn % 2 == 0)
  6908. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6909. else
  6910. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6911.  
  6912. }
  6913. }
  6914.  
  6915. }
  6916. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6917. {
  6918. if (gooda[m].Distance(enemyhas[1]) <= 300)
  6919. {
  6920. if (!TryPushcapsule(gooda[m], game))
  6921. gooda[m].Sail(enemyhas[1]);
  6922. }
  6923. else
  6924. {
  6925. if (!TryPushcapsule(gooda[m], game))
  6926. {
  6927. if (game.Turn % 2 == 0)
  6928. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  6929. else
  6930. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  6931.  
  6932. }
  6933. }
  6934. }
  6935. }
  6936.  
  6937. }
  6938. }
  6939. else
  6940. {
  6941. if (enemyhas.Length == 0)
  6942. if (!TryPushcapsule(gooda[m], game))
  6943. {
  6944. if (game.Turn % 2 == 0)
  6945. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1500));
  6946. else
  6947. gooda[m].Sail(emother[0].GetLocation().Towards(ecapsule[0], 1400));
  6948. }
  6949. if (enemyhas.Length == 1)
  6950. {
  6951. if (!TryPushcapsule(gooda[m], game))
  6952. {
  6953. if (game.Turn % 2 == 0)
  6954. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6955. else
  6956. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6957. }
  6958.  
  6959. }
  6960. if (enemyhas.Length == 2)
  6961. {
  6962.  
  6963. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])))
  6964. {
  6965. if (gooda[m].Distance(enemyhas[0]) <= 300)
  6966. {
  6967. if (!TryPushcapsule(gooda[m], game))
  6968. gooda[m].Sail(enemyhas[0]);
  6969. }
  6970. else
  6971. {
  6972. if (!TryPushcapsule(gooda[m], game))
  6973. {
  6974. if (game.Turn % 2 == 0)
  6975. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1500));
  6976. else
  6977. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[0], 1400));
  6978.  
  6979. }
  6980. }
  6981.  
  6982. }
  6983. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])))
  6984. {
  6985. if (gooda[m].Distance(enemyhas[1]) <= 300)
  6986. {
  6987. if (!TryPushcapsule(gooda[m], game))
  6988. gooda[m].Sail(enemyhas[1]);
  6989. }
  6990. else
  6991. {
  6992. if (!TryPushcapsule(gooda[m], game))
  6993. {
  6994. if (game.Turn % 2 == 0)
  6995. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1500));
  6996. else
  6997. gooda[m].Sail(emother[0].GetLocation().Towards(enemyhas[1], 1400));
  6998.  
  6999. }
  7000. }
  7001. }
  7002. }
  7003.  
  7004. }
  7005. // 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]); }
  7006. }
  7007. }
  7008. }
  7009. }
  7010. }
  7011. }
  7012.  
  7013. if (game.GetEnemy().BotName == "25766")
  7014. {
  7015. if (gooda.Length > 0)
  7016. {
  7017. if (gooda[1].Capsule == null)
  7018. {
  7019. if (gooda[1].Distance(gcapsule[0].InitialLocation) > 1200)
  7020. gooda[1].Sail(gcapsule[0].InitialLocation);
  7021. if (gooda[1].Distance(gcapsule[0].InitialLocation) <= 1200 && gooda[1].Distance(gcapsule[0].InitialLocation) >= 500)
  7022. if (TryPush2BotState4(gooda[1], game))
  7023. gooda[1].Sail(gooda[0]);
  7024. if (gooda[1].Distance(gcapsule[0].InitialLocation) < 500)
  7025. gooda[1].Sail(gcapsule[0].InitialLocation);
  7026. if (!TryPush2BotState2(gooda[0], game))
  7027. gooda[0].Sail(gooda[1]);
  7028. }
  7029. else
  7030. {
  7031. gooda[1].Sail(gmother[0]);
  7032. if (!TryPush2BotState3(gooda[0], game))
  7033. gooda[0].Sail(gooda[1]);
  7034. }
  7035. }
  7036.  
  7037.  
  7038.  
  7039. }
  7040. if (game.GetEnemy().BotName == "25768") { for (int m = 0; m < gooda.Length; m++) { if (!TryPushcapsule(gooda[m], game)) gooda[m].Sail(ecapsule[0].InitialLocation); } }
  7041. if (game.GetEnemy().BotName == "25242")
  7042. {
  7043. if (!TryPush2pullpushon(gooda[1], game))
  7044. gooda[1].Sail(new Location(2031, 1300));
  7045. if (!TryPush2(gooda[2], game))
  7046. gooda[2].Sail(new Location(1435, 1575));
  7047. if (!TryPushaste(gooda[0], game))
  7048. {
  7049. if (good[0].Capsule == null)
  7050. {
  7051.  
  7052. good[0].Sail(gcapsule[0].InitialLocation);
  7053. }
  7054. // Else, go to my mothership.
  7055. else
  7056. {
  7057.  
  7058. gooda[0].Sail(gmother[0]);
  7059. }
  7060. }
  7061.  
  7062. if (gooda.Length > 3)
  7063. {
  7064. for (int m = 3; m < gooda.Length - 2; m++)
  7065. {
  7066. if (!TryPushcapsule(gooda[m], game))
  7067. {
  7068. if (game.Turn % 2 == 0)
  7069. gooda[m].Sail(new Location(638, 5448));
  7070. else
  7071. gooda[m].Sail(new Location(790, 5400));
  7072.  
  7073. }
  7074. }
  7075. }
  7076.  
  7077. for (int m = 5; m < gooda.Length; m++)
  7078. {
  7079. if (!TryPushcapsule(gooda[m], game))
  7080. {
  7081. if (game.Turn % 2 == 1)
  7082. gooda[m].Sail(new Location(638, 5448));
  7083. else
  7084. gooda[m].Sail(new Location(790, 5400));
  7085.  
  7086. }
  7087. }
  7088. }
  7089. if (game.GetEnemy().BotName == "25187" || game.GetEnemy().BotName == "25188" || game.GetEnemy().BotName == "25192" || game.GetEnemy().BotName == "25190")
  7090. {
  7091. if (good.Length > 0)
  7092. {
  7093. if (gooda[0].HasCapsule() == false && gooda[2].HasCapsule() == false)
  7094. {
  7095. if (gooda[2].IsAlive() == true && gooda[0].IsAlive() == true)
  7096. gooda[1].Sail(gooda[0]);
  7097. if (gooda[2].IsAlive() == false && gooda[0].IsAlive() == true)
  7098. gooda[1].Sail(gooda[0]);
  7099. if (gooda[2].IsAlive() == true && gooda[0].IsAlive() == false)
  7100. gooda[1].Sail(gooda[2]);
  7101. if (gooda[2].IsAlive() == false && gooda[0].IsAlive() == false)
  7102. gooda[1].Sail(gooda[0].InitialLocation);
  7103. if (!TryPushaste(gooda[0], game))
  7104. gooda[0].Sail(gcapsule[0].InitialLocation);
  7105. if (!TryPushaste(gooda[2], game))
  7106. gooda[2].Sail(gcapsule[1].InitialLocation);
  7107. }
  7108.  
  7109. if (gooda[2].HasCapsule() == false && gooda[0].HasCapsule() == true)
  7110. {
  7111. if (!TryPushaste(gooda[0], game))
  7112. gooda[0].Sail(gmother[0]);
  7113. gooda[2].Sail(gcapsule[1].InitialLocation);
  7114. if (!TryPush2(gooda[1], game))
  7115. gooda[1].Sail(gooda[0]);
  7116.  
  7117. }
  7118.  
  7119. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == false)
  7120. {
  7121. gooda[0].Sail(gcapsule[0].InitialLocation);
  7122. if (!TryPushaste(gooda[2], game))
  7123. gooda[2].Sail(gmother[0]);
  7124. if (!TryPush3(gooda[1], game))
  7125. gooda[1].Sail(gooda[2]);
  7126. }
  7127.  
  7128.  
  7129. if (gooda[2].HasCapsule() == true && gooda[0].HasCapsule() == true)
  7130. {
  7131. if (!TryPushaste(gooda[0], game))
  7132. gooda[0].Sail(gmother[0]);
  7133. if (!TryPushaste(gooda[2], game))
  7134. gooda[2].Sail(gmother[0]);
  7135. if (!TryPush2(gooda[1], game))
  7136. gooda[1].Sail(gooda[0]);
  7137.  
  7138.  
  7139. }
  7140.  
  7141.  
  7142. if (gooda.Length > 3)
  7143. {
  7144. for (int m = 3; m < gooda.Length - 2; m++)
  7145. {
  7146. if (enemyhas.Length == 0)
  7147. gooda[m].Sail(emother[0]);
  7148. if (enemyhas.Length == 1)
  7149. {
  7150. if (emother[0].GetLocation().Distance(enemyhas[0]) <= 4200)
  7151. if (!TryPushcapsule(gooda[m], game))
  7152. gooda[m].Sail(enemyhas[0]);
  7153. if (emother[0].GetLocation().Distance(enemyhas[0]) > 4200)
  7154. gooda[m].Sail(emother[0]);
  7155. }
  7156. if (enemyhas.Length == 2)
  7157. {
  7158. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 4200)
  7159. if (!TryPushcapsule(gooda[m], game))
  7160. gooda[m].Sail(enemyhas[0]);
  7161. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 4200)
  7162. if (!TryPushcapsule(gooda[m], game))
  7163. gooda[m].Sail(enemyhas[1]);
  7164. }
  7165. }
  7166. }
  7167.  
  7168.  
  7169. for (int m = 5; m < gooda.Length; m++)
  7170. {
  7171. if (enemyhas.Length == 0)
  7172. gooda[m].Sail(emother[0]);
  7173. if (enemyhas.Length == 1)
  7174. {
  7175. if (emother[0].GetLocation().Distance(enemyhas[0]) <= 2000)
  7176. if (!TryPushcapsule(gooda[m], game))
  7177. gooda[m].Sail(enemyhas[0]);
  7178. if (emother[0].GetLocation().Distance(enemyhas[0]) > 2000)
  7179. gooda[m].Sail(emother[0]);
  7180. }
  7181. if (enemyhas.Length == 2)
  7182. {
  7183. if ((emother[0].GetLocation().Distance(enemyhas[0]) < emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[0]) <= 2000)
  7184. if (!TryPushcapsule(gooda[m], game))
  7185. gooda[m].Sail(enemyhas[0]);
  7186. if ((emother[0].GetLocation().Distance(enemyhas[0]) >= emother[0].GetLocation().Distance(enemyhas[1])) && emother[0].GetLocation().Distance(enemyhas[1]) <= 2000)
  7187. if (!TryPushcapsule(gooda[m], game))
  7188. gooda[m].Sail(enemyhas[1]);
  7189. }
  7190. }
  7191. }
  7192. }
  7193. if (game.GetEnemy().BotName == "25189" || game.GetEnemy().BotName == "25185")
  7194. {
  7195. if (good.Length > 0)
  7196. if (!TryPush(good[0], game))
  7197. {
  7198. if (good[0].Capsule == null)
  7199. {
  7200. good[0].Sail(gcapsule[0].InitialLocation);
  7201. }
  7202. // Else, go to my mothership.
  7203. else
  7204. {
  7205. good[0].Sail(gmother[0]);
  7206. }
  7207. }
  7208. if (good.Length > 1)
  7209. if (!TryPush2(good[1], game))
  7210. {
  7211. if (good[1].Capsule == null)
  7212. {
  7213. good[1].Sail(gcapsule[0].InitialLocation);
  7214. }
  7215. // Else, go to my mothership.
  7216. else
  7217. {
  7218. good[1].Sail(gmother[0]);
  7219. }
  7220. }
  7221. if (good.Length > 2)
  7222. {
  7223. for (int m = 2; m < good.Length; m++)
  7224. {
  7225.  
  7226. if (!TryPushcapsule(good[m], game))
  7227. good[m].Sail(ecapsule[0].InitialLocation);
  7228. }
  7229. }
  7230.  
  7231. }
  7232. if (game.GetEnemy().BotName == "25184")
  7233. {
  7234.  
  7235. if (good.Length > 0)
  7236. if (!TryPush(good[0], game))
  7237. {
  7238. if (good[0].Capsule == null)
  7239. {
  7240. good[0].Sail(gcapsule[0].InitialLocation);
  7241. }
  7242.  
  7243. // Else, go to my mothership.
  7244. else
  7245. {
  7246. good[0].Sail(gmother[1]);
  7247. }
  7248. }
  7249. if (good.Length > 1)
  7250. if (!TryPush(good[1], game))
  7251. {
  7252. if (good[1].Capsule == null)
  7253. {
  7254. good[1].Sail(gcapsule[0].InitialLocation);
  7255. }
  7256. // Else, go to my mothership.
  7257. else
  7258. {
  7259. good[1].Sail(gmother[1]);
  7260. }
  7261. }
  7262. if (good.Length > 2)
  7263. {
  7264. for (int m = 2; m < good.Length; m++)
  7265. {
  7266.  
  7267. if (!TryPushGeorge(good[m], game))
  7268. good[m].Sail(ecapsule[0].InitialLocation);
  7269. }
  7270. }
  7271. }
  7272. if (game.GetEnemy().BotName == "25191")
  7273. {
  7274.  
  7275. if (good.Length == 1)
  7276. {
  7277. 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)
  7278. {
  7279. if (!TryPushas(good[0], game))
  7280. {
  7281. if (good[0].Capsule == null)
  7282. {
  7283. good[0].Sail(gcapsule[0].InitialLocation);
  7284. }
  7285. // Else, go to my mothership.
  7286. else
  7287. {
  7288. good[0].Sail(gmother[0]);
  7289. }
  7290. }
  7291. }
  7292. }
  7293. }
  7294. if (game.GetEnemy().BotName == "25237")
  7295. {
  7296. if (!TryPush2pullpushon(gooda[1], game))
  7297. gooda[1].Sail(new Location(1600, 1500));
  7298. if (!TryPush2(gooda[2], game))
  7299. gooda[2].Sail(new Location(1285, 1266));
  7300. if (!TryPushcapsule(gooda[3], game))
  7301. {
  7302. gooda[3].Sail(allworm[1].GetLocation().Towards(gmother[0].GetLocation(), 150));
  7303. }
  7304. if (!TryPushcapsuleBot(gooda[7], game))
  7305. {
  7306.  
  7307. gooda[7].Sail(allworm[1].GetLocation().Towards(gmother[0].GetLocation(), 150));
  7308.  
  7309. }
  7310. if (!TryPushaste(gooda[0], game))
  7311. {
  7312. if (good[0].Capsule == null)
  7313. {
  7314.  
  7315. good[0].Sail(gcapsule[0].InitialLocation);
  7316. }
  7317. // Else, go to my mothership.
  7318. else
  7319. {
  7320.  
  7321. gooda[0].Sail(gmother[0]);
  7322. }
  7323. }
  7324.  
  7325. if (gooda.Length > 4)
  7326. {
  7327. for (int m = 4; m < gooda.Length - 2; m++)
  7328. {
  7329. if (!TryPushcapsule(gooda[m], game))
  7330. {
  7331. if (game.Turn % 2 == 0)
  7332. gooda[m].Sail(new Location(2333, 5410));
  7333. else
  7334. gooda[m].Sail(new Location(2409, 5372));
  7335.  
  7336. }
  7337. }
  7338. }
  7339. if (game.Turn < 185)
  7340. {
  7341. for (int m = 6; m < gooda.Length - 1; m++)
  7342. {
  7343. if (!TryPushcapsule(gooda[m], game))
  7344. {
  7345. if (game.Turn % 2 == 1)
  7346. gooda[m].Sail(new Location(2333, 5410));
  7347. else
  7348. gooda[m].Sail(new Location(2409, 5372));
  7349.  
  7350. }
  7351. }
  7352. }
  7353. else
  7354. {
  7355. for (int m = 6; m < gooda.Length - 1; m++)
  7356. {
  7357. if (!TryPushcapsule(gooda[m], game))
  7358. {
  7359. if (game.Turn % 2 == 1)
  7360. gooda[m].Sail(new Location(781, 5362));
  7361. else
  7362. gooda[m].Sail(new Location(714, 5448));
  7363.  
  7364. }
  7365. }
  7366.  
  7367. }
  7368. }
  7369.  
  7370. }
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.  
  7377. private bool TryPush(Pirate pirate, PirateGame game)
  7378. {
  7379. // Go over all enemies
  7380. Location locat = new Location(pirate.GetLocation().Row, -1);
  7381. int min;
  7382. // Go over all enemies
  7383. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7384. {
  7385.  
  7386. if (pirate.CanPush(enemy))
  7387. {
  7388.  
  7389. min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
  7390. if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
  7391. {
  7392. min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
  7393. locat = new Location(pirate.GetLocation().Row, game.Cols);
  7394. }
  7395. if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
  7396. {
  7397. min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
  7398. locat = new Location(-1, pirate.GetLocation().Col);
  7399. }
  7400. if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
  7401. {
  7402. min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
  7403. locat = new Location(game.Rows, pirate.GetLocation().Col);
  7404. }
  7405. pirate.Push(enemy, locat);
  7406. // Print a message
  7407. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
  7408.  
  7409. // Did push
  7410. return true;
  7411. }
  7412.  
  7413. }
  7414.  
  7415. // Go over all living asteroids
  7416. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7417. {
  7418. // Check if the pirate can push the asteroid
  7419. if (pirate.CanPush(asteroid))
  7420. {
  7421. // Push asteroid!
  7422. if (game.GetEnemyCapsules().Length > 0)
  7423. pirate.Push(asteroid, closeto(pirate, game));
  7424.  
  7425. // Print a message
  7426. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7427.  
  7428. // Did push
  7429. return true;
  7430. }
  7431. }
  7432.  
  7433. // Didn't push
  7434. return false;
  7435. }
  7436. private bool TryPushcapsule(Pirate pirate, PirateGame game)
  7437. {
  7438. Location locat = new Location(pirate.GetLocation().Row, -1);
  7439. int min;
  7440. // Go over all enemies
  7441. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7442. {
  7443. if (enemy.Capsule != null)
  7444. if (pirate.CanPush(enemy))
  7445. {
  7446.  
  7447. min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
  7448. if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
  7449. {
  7450. min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
  7451. locat = new Location(pirate.GetLocation().Row, game.Cols);
  7452. }
  7453. if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
  7454. {
  7455. min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
  7456. locat = new Location(-1, pirate.GetLocation().Col);
  7457. }
  7458. if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
  7459. {
  7460. min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
  7461. locat = new Location(game.Rows, pirate.GetLocation().Col);
  7462. }
  7463. pirate.Push(enemy, locat);
  7464. // Print a message
  7465. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
  7466.  
  7467. // Did push
  7468. return true;
  7469. }
  7470.  
  7471. }
  7472.  
  7473.  
  7474. // Go over all living asteroids
  7475. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7476. {
  7477. // Check if the pirate can push the asteroid
  7478. if (pirate.CanPush(asteroid))
  7479. {
  7480. // Push asteroid!
  7481. if (game.GetEnemyCapsules().Length > 0)
  7482. pirate.Push(asteroid, closeto(pirate, game));
  7483.  
  7484. // Print a message
  7485. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7486.  
  7487. // Did push
  7488. return true;
  7489. }
  7490. }
  7491. foreach (Wormhole worm in game.GetAllWormholes())
  7492. {
  7493. // Check if the pirate can push the asteroid
  7494. if (pirate.CanPush(worm))
  7495. {
  7496. // Push asteroid!
  7497. int distan = game.GetMyCapsules()[0].Distance(game.GetMyCapsules()[1]);
  7498. if (game.GetMyCapsules().Length == 1)
  7499. pirate.Push(worm, new Location(3000, 3600));
  7500. if (game.GetMyCapsules().Length > 1)
  7501. pirate.Push(worm, game.GetMyCapsules()[1]);
  7502.  
  7503. // Print a message
  7504. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
  7505.  
  7506. // Did push
  7507. return true;
  7508. }
  7509. }
  7510. // Didn't push
  7511. return false;
  7512. }
  7513. private bool TryPushcapsuleforheavy(Pirate pirate, PirateGame game)
  7514. {
  7515. Location locat = new Location(pirate.GetLocation().Row, -1);
  7516. int min;
  7517. // Go over all enemies
  7518. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7519. {
  7520. if (enemy.Capsule != null)
  7521. if (pirate.CanPush(enemy))
  7522. {
  7523. pirate.Push(enemy, game.GetAllMyPirates()[4]);
  7524. // Print a message
  7525. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
  7526. // Did push
  7527. return true;
  7528. }
  7529.  
  7530. // Print a message
  7531. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
  7532.  
  7533.  
  7534. }
  7535.  
  7536.  
  7537.  
  7538.  
  7539. // Go over all living asteroids
  7540. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7541. {
  7542. // Check if the pirate can push the asteroid
  7543. if (pirate.CanPush(asteroid))
  7544. {
  7545. // Push asteroid!
  7546. if (game.GetEnemyCapsules().Length > 0)
  7547. pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
  7548.  
  7549. // Print a message
  7550. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7551.  
  7552. // Did push
  7553. return true;
  7554. }
  7555. }
  7556. foreach (Wormhole worm in game.GetAllWormholes())
  7557. {
  7558. // Check if the pirate can push the asteroid
  7559. if (pirate.CanPush(worm))
  7560. {
  7561. // Push asteroid!
  7562. if (game.GetEnemyCapsules().Length > 0)
  7563. pirate.Push(worm, game.GetMyCapsules()[0]);
  7564.  
  7565. // Print a message
  7566. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
  7567.  
  7568. // Did push
  7569. return true;
  7570. }
  7571. }
  7572. // Didn't push
  7573. return false;
  7574. }
  7575. private bool TryPushcapsuleattack(Pirate pirate, PirateGame game)
  7576. {
  7577. Location locat = new Location(pirate.GetLocation().Row, -1);
  7578. int min;
  7579. // Go over all enemies
  7580. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7581. {
  7582.  
  7583. if (pirate.CanPush(enemy))
  7584. {
  7585.  
  7586. min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
  7587. if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
  7588. {
  7589. min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
  7590. locat = new Location(pirate.GetLocation().Row, game.Cols);
  7591. }
  7592. if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
  7593. {
  7594. min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
  7595. locat = new Location(-1, pirate.GetLocation().Col);
  7596. }
  7597. if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
  7598. {
  7599. min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
  7600. locat = new Location(game.Rows, pirate.GetLocation().Col);
  7601. }
  7602. pirate.Push(enemy, locat);
  7603. // Print a message
  7604. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
  7605.  
  7606. // Did push
  7607. return true;
  7608. }
  7609.  
  7610. }
  7611.  
  7612.  
  7613. // Go over all living asteroids
  7614. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7615. {
  7616. // Check if the pirate can push the asteroid
  7617. if (pirate.CanPush(asteroid))
  7618. {
  7619. // Push asteroid!
  7620. if (game.GetEnemyCapsules().Length > 0)
  7621. pirate.Push(asteroid, closeto(pirate, game));
  7622.  
  7623. // Print a message
  7624. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7625.  
  7626. // Did push
  7627. return true;
  7628. }
  7629. }
  7630. foreach (Wormhole worm in game.GetAllWormholes())
  7631. {
  7632. // Check if the pirate can push the asteroid
  7633. if (pirate.CanPush(worm))
  7634. {
  7635. // Push asteroid!
  7636. if (game.GetEnemyCapsules().Length > 0)
  7637. pirate.Push(worm, game.GetMyCapsules()[1]);
  7638.  
  7639. // Print a message
  7640. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
  7641.  
  7642. // Did push
  7643. return true;
  7644. }
  7645. }
  7646. // Didn't push
  7647. return false;
  7648. }
  7649.  
  7650. private bool TryPushcapsuleattack2(Pirate pirate, PirateGame game)
  7651. {
  7652. Location locat = new Location(pirate.GetLocation().Row, -1);
  7653. int min;
  7654. // Go over all enemies
  7655. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7656. {
  7657.  
  7658. if (pirate.CanPush(enemy))
  7659. {
  7660.  
  7661. min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
  7662. if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
  7663. {
  7664. min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
  7665. locat = new Location(pirate.GetLocation().Row, game.Cols);
  7666. }
  7667. if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
  7668. {
  7669. min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
  7670. locat = new Location(-1, pirate.GetLocation().Col);
  7671. }
  7672. if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
  7673. {
  7674. min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
  7675. locat = new Location(game.Rows, pirate.GetLocation().Col);
  7676. }
  7677. pirate.Push(enemy, locat);
  7678. // Print a message
  7679. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
  7680.  
  7681. // Did push
  7682. return true;
  7683. }
  7684.  
  7685. }
  7686.  
  7687.  
  7688. // Go over all living asteroids
  7689. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7690. {
  7691. // Check if the pirate can push the asteroid
  7692. if (pirate.CanPush(asteroid))
  7693. {
  7694. // Push asteroid!
  7695. if (game.GetEnemyCapsules().Length > 0)
  7696. pirate.Push(asteroid, closeto(pirate, game));
  7697.  
  7698. // Print a message
  7699. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7700.  
  7701. // Did push
  7702. return true;
  7703. }
  7704. }
  7705. if (pirate.CanPush(game.GetAllWormholes()[0]))
  7706. {
  7707. pirate.Push(game.GetAllWormholes()[0], game.GetMyMotherships()[0]);
  7708. return true;
  7709. }
  7710. // Didn't push
  7711. return false;
  7712. }
  7713. private bool TryPushcapsuleBot(Pirate pirate, PirateGame game)
  7714. {
  7715. Location locat = new Location(pirate.GetLocation().Row, -1);
  7716. int min;
  7717. // Go over all enemies
  7718. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7719. {
  7720. if (enemy.Capsule != null)
  7721. if (pirate.CanPush(enemy))
  7722. {
  7723.  
  7724. min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
  7725. if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
  7726. {
  7727. min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
  7728. locat = new Location(pirate.GetLocation().Row, game.Cols);
  7729. }
  7730. if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
  7731. {
  7732. min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
  7733. locat = new Location(-1, pirate.GetLocation().Col);
  7734. }
  7735. if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
  7736. {
  7737. min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
  7738. locat = new Location(game.Rows, pirate.GetLocation().Col);
  7739. }
  7740. pirate.Push(enemy, locat);
  7741. // Print a message
  7742. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
  7743.  
  7744. // Did push
  7745. return true;
  7746. }
  7747.  
  7748. }
  7749.  
  7750.  
  7751. // Go over all living asteroids
  7752. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7753. {
  7754. // Check if the pirate can push the asteroid
  7755. if (pirate.CanPush(asteroid))
  7756. {
  7757. // Push asteroid!
  7758. if (game.GetEnemyCapsules().Length > 0)
  7759. pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
  7760.  
  7761. // Print a message
  7762. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7763.  
  7764. // Did push
  7765. return true;
  7766. }
  7767. }
  7768. foreach (Wormhole worm in game.GetAllWormholes())
  7769. {
  7770. // Check if the pirate can push the asteroid
  7771. if (pirate.CanPush(worm))
  7772. {
  7773. // Push asteroid!
  7774. if (game.GetEnemyCapsules().Length > 0)
  7775. pirate.Push(worm, new Location(1171, 3952));
  7776.  
  7777. // Print a message
  7778. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
  7779.  
  7780. // Did push
  7781. return true;
  7782. }
  7783. }
  7784. // Didn't push
  7785. return false;
  7786. }
  7787. private bool TryPushcapsuleBot23(Pirate pirate, PirateGame game)
  7788. {
  7789. Location locat = new Location(pirate.GetLocation().Row, -1);
  7790. int min;
  7791. // Go over all enemies
  7792. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7793. {
  7794. if (enemy.Capsule != null)
  7795. if (pirate.CanPush(enemy))
  7796. {
  7797.  
  7798. min = enemy.Distance(new Location(pirate.GetLocation().Row, -1));
  7799. if (enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols)) < min)
  7800. {
  7801. min = enemy.Distance(new Location(pirate.GetLocation().Row, game.Cols));
  7802. locat = new Location(pirate.GetLocation().Row, game.Cols);
  7803. }
  7804. if (enemy.Distance(new Location(-1, pirate.GetLocation().Col)) < min)
  7805. {
  7806. min = enemy.Distance(new Location(-1, pirate.GetLocation().Col));
  7807. locat = new Location(-1, pirate.GetLocation().Col);
  7808. }
  7809. if (enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col)) < min)
  7810. {
  7811. min = enemy.Distance(new Location(game.Rows, pirate.GetLocation().Col));
  7812. locat = new Location(game.Rows, pirate.GetLocation().Col);
  7813. }
  7814. pirate.Push(enemy, locat);
  7815. // Print a message
  7816. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
  7817.  
  7818. // Did push
  7819. return true;
  7820. }
  7821.  
  7822. }
  7823.  
  7824.  
  7825. // Go over all living asteroids
  7826. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7827. {
  7828. // Check if the pirate can push the asteroid
  7829. if (pirate.CanPush(asteroid))
  7830. {
  7831. // Push asteroid!
  7832. if (game.GetEnemyCapsules().Length > 0)
  7833. pirate.Push(asteroid, closeto(pirate, game));
  7834.  
  7835. // Print a message
  7836. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7837.  
  7838. // Did push
  7839. return true;
  7840. }
  7841. }
  7842. foreach (Wormhole worm in game.GetAllWormholes())
  7843. {
  7844. // Check if the pirate can push the asteroid
  7845. if (pirate.CanPush(worm))
  7846. {
  7847. // Push asteroid!
  7848. if (game.GetEnemyCapsules().Length > 0)
  7849. pirate.Push(worm, game.GetMyCapsules()[0]);
  7850.  
  7851. // Print a message
  7852. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
  7853.  
  7854. // Did push
  7855. return true;
  7856. }
  7857. }
  7858. // Didn't push
  7859. return false;
  7860. }
  7861. private bool TryPush2(Pirate pirate, PirateGame game)
  7862. {
  7863. // Go over all enemies
  7864. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7865. {
  7866.  
  7867. // Check if the pirate can push the enemy
  7868. if (pirate.CanPush(game.GetAllMyPirates()[0]) && (game.GetAllMyPirates()[0].Capsule != null) && (game.GetAllMyPirates()[0].GetLocation().Distance(enemy.GetLocation())) < 600)
  7869. {
  7870.  
  7871. pirate.Push(game.GetAllMyPirates()[0], game.GetMyMotherships()[0]);
  7872.  
  7873. // Print a message
  7874.  
  7875. // Did push
  7876. return true;
  7877.  
  7878. }
  7879. }
  7880.  
  7881. // Go over all living asteroids
  7882. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7883. {
  7884. // Check if the pirate can push the asteroid
  7885. if (pirate.CanPush(asteroid))
  7886. {
  7887. // Push asteroid!
  7888. if (game.GetEnemyCapsules().Length > 0)
  7889. pirate.Push(asteroid, closeto(pirate, game));
  7890.  
  7891. // Print a message
  7892. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7893.  
  7894. // Did push
  7895. return true;
  7896. }
  7897. }
  7898.  
  7899. // Didn't push
  7900. return false;
  7901. }
  7902. private bool TryPush2pullpushon(Pirate pirate, PirateGame game)
  7903. {
  7904. // Go over all enemies
  7905. foreach (Pirate good in game.GetAllMyPirates())
  7906. {
  7907.  
  7908. // Check if the pirate can push the enemy
  7909. if ((pirate.CanPush(good) && (good.Capsule != null)))
  7910. {
  7911.  
  7912. pirate.Push(game.GetAllMyPirates()[0], game.GetAllMyPirates()[2]);
  7913.  
  7914. // Print a message
  7915.  
  7916. // Did push
  7917. return true;
  7918.  
  7919. }
  7920. }
  7921.  
  7922. // Go over all living asteroids
  7923. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7924. {
  7925. // Check if the pirate can push the asteroid
  7926. if (pirate.CanPush(asteroid))
  7927. {
  7928. // Push asteroid!
  7929. if (game.GetEnemyCapsules().Length > 0)
  7930. pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
  7931.  
  7932. // Print a message
  7933. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7934.  
  7935. // Did push
  7936. return true;
  7937. }
  7938. }
  7939.  
  7940. // Didn't push
  7941. return false;
  7942. }
  7943. private bool TryPush3(Pirate pirate, PirateGame game)
  7944. {
  7945. // Go over all enemies
  7946. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7947. {
  7948.  
  7949. // Check if the pirate can push the enemy
  7950. if (pirate.CanPush(game.GetAllMyPirates()[2]) && (game.GetAllMyPirates()[2].Capsule != null) && (game.GetAllMyPirates()[2].GetLocation().Distance(enemy.GetLocation())) < 600)
  7951. {
  7952. pirate.Push(game.GetAllMyPirates()[2], game.GetMyMotherships()[0]);
  7953. // Did push
  7954. return true;
  7955.  
  7956. }
  7957. }
  7958.  
  7959. // Go over all living asteroids
  7960. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  7961. {
  7962. // Check if the pirate can push the asteroid
  7963. if (pirate.CanPush(asteroid))
  7964. {
  7965. // Push asteroid!
  7966. if (game.GetEnemyCapsules().Length > 0)
  7967. pirate.Push(asteroid, closeto(pirate, game));
  7968.  
  7969. // Print a message
  7970. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  7971.  
  7972. // Did push
  7973. return true;
  7974. }
  7975. }
  7976.  
  7977. // Didn't push
  7978. return false;
  7979. }
  7980. private bool TryPushGeorge(Pirate pirate, PirateGame game)
  7981. {
  7982. // Go over all enemies
  7983. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  7984. {
  7985. // Check if the pirate can push the enemy
  7986. if (pirate.CanPush(enemy))
  7987. {
  7988. // Push enemy!
  7989. pirate.Push(enemy, new Location(6334, 3167));
  7990.  
  7991. // Print a message
  7992. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + enemy.InitialLocation);
  7993.  
  7994. // Did push
  7995. return true;
  7996. }
  7997. }
  7998.  
  7999. // Go over all living asteroids
  8000. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  8001. {
  8002. // Check if the pirate can push the asteroid
  8003. if (pirate.CanPush(asteroid))
  8004. {
  8005. // Push asteroid!
  8006. pirate.Push(asteroid, game.GetEnemyCapsules()[0].InitialLocation);
  8007.  
  8008. // Print a message
  8009. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  8010.  
  8011. // Did push
  8012. return true;
  8013. }
  8014. }
  8015.  
  8016. // Didn't push
  8017. return false;
  8018. }
  8019. private bool TryPushas(Pirate pirate, PirateGame game)
  8020. {
  8021.  
  8022.  
  8023. // Go over all living asteroids
  8024. for (int m = 0; m < game.GetLivingAsteroids().Length - 1; m++)
  8025. {
  8026. // Check if the pirate can push the asteroid
  8027. if (pirate.CanPush(game.GetLivingAsteroids()[m]))
  8028. {
  8029. // Push asteroi
  8030. pirate.Push(game.GetLivingAsteroids()[m], game.GetLivingAsteroids()[m + 1]);
  8031.  
  8032. // Print a message
  8033. System.Console.WriteLine("pirate " + pirate + " pushes " + game.GetLivingAsteroids()[m] + " towards " + game.GetLivingAsteroids()[m + 1]);
  8034.  
  8035. // Did push
  8036. return true;
  8037. }
  8038. }
  8039.  
  8040. // Didn't push
  8041. return false;
  8042. }
  8043. private bool TryPushaste(Pirate pirate, PirateGame game)
  8044. {
  8045.  
  8046. // Go over all living asteroids
  8047. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  8048. {
  8049. // Check if the pirate can push the asteroid
  8050. if (pirate.CanPush(asteroid))
  8051. {
  8052. // Push asteroid!
  8053. if (game.GetEnemyCapsules().Length > 0)
  8054. pirate.Push(asteroid, closeto(pirate, game));
  8055.  
  8056. // Print a message
  8057. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  8058.  
  8059. // Did push
  8060. return true;
  8061. }
  8062. }
  8063.  
  8064. // Didn't push
  8065. return false;
  8066. }
  8067. private bool TryPushworm(Pirate pirate, PirateGame game)
  8068. {
  8069.  
  8070. foreach (Wormhole worm in game.GetAllWormholes())
  8071. {
  8072. // Check if the pirate can push the asteroid
  8073. if (pirate.CanPush(worm))
  8074. {
  8075. // Push asteroid!
  8076. if (game.GetEnemyCapsules().Length > 0)
  8077. pirate.Push(worm, game.GetMyMotherships()[0]);
  8078.  
  8079. // Print a message
  8080. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
  8081.  
  8082. // Did push
  8083. return true;
  8084. }
  8085. }
  8086. // Didn't push
  8087. return false;
  8088. }
  8089. private bool TryPushworm2(Pirate pirate, PirateGame game)
  8090. {
  8091.  
  8092. foreach (Wormhole worm in game.GetAllWormholes())
  8093. {
  8094. // Check if the pirate can push the asteroid
  8095. if (pirate.CanPush(worm))
  8096. {
  8097. // Push asteroid!
  8098. if (game.GetEnemyCapsules().Length > 0)
  8099. pirate.Push(worm, game.GetMyCapsules()[0]);
  8100.  
  8101. // Print a message
  8102. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
  8103.  
  8104. // Did push
  8105. return true;
  8106. }
  8107. }
  8108. // Didn't push
  8109. return false;
  8110. }
  8111. private bool TryPushwormForgooda2(Pirate pirate, PirateGame game)
  8112. {
  8113.  
  8114. foreach (Wormhole worm in game.GetAllWormholes())
  8115. {
  8116. // Check if the pirate can push the asteroid
  8117. if (pirate.CanPush(worm))
  8118. {
  8119. // Push asteroid!
  8120. if (game.GetEnemyCapsules().Length > 0)
  8121. pirate.Push(worm, game.GetMyCapsules()[0]);
  8122.  
  8123. // Print a message
  8124. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetMyCapsules()[0]);
  8125.  
  8126. // Did push
  8127. return true;
  8128. }
  8129. }
  8130. // Didn't push
  8131. return false;
  8132. }
  8133. private bool TryPush2BotState(Pirate pirate, PirateGame game)
  8134. {
  8135. // Go over all enemies
  8136. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  8137. {
  8138.  
  8139. // Check if the pirate can push the enemy
  8140. if (pirate.CanPush(game.GetAllMyPirates()[1]) && (game.GetAllMyPirates()[1].Capsule != null))
  8141. {
  8142.  
  8143. pirate.Push(game.GetAllMyPirates()[1], game.GetMyMotherships()[0]);
  8144.  
  8145. // Print a message
  8146.  
  8147. // Did push
  8148. return true;
  8149.  
  8150. }
  8151. }
  8152. return false;
  8153. }
  8154. private bool TryPush2BotState2(Pirate pirate, PirateGame game)
  8155. {
  8156. // Go over all enemies
  8157. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  8158. {
  8159.  
  8160. // Check if the pirate can push the enemy
  8161. if (pirate.CanPush(game.GetAllMyPirates()[1]))
  8162. {
  8163.  
  8164. pirate.Push(game.GetAllMyPirates()[1], game.GetMyCapsules()[0]);
  8165.  
  8166. // Print a message
  8167.  
  8168. // Did push
  8169. return true;
  8170.  
  8171. }
  8172. }
  8173. return false;
  8174. }
  8175. private bool TryPush2BotState3(Pirate pirate, PirateGame game)
  8176. {
  8177. // Go over all enemies
  8178. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  8179. {
  8180.  
  8181. // Check if the pirate can push the enemy
  8182. if (pirate.CanPush(game.GetAllMyPirates()[1]))
  8183. {
  8184.  
  8185. pirate.Push(game.GetAllMyPirates()[1], game.GetMyMotherships()[0]);
  8186.  
  8187. // Print a message
  8188.  
  8189. // Did push
  8190. return true;
  8191.  
  8192. }
  8193. }
  8194. return false;
  8195. }
  8196. private bool TryPush2BotState4(Pirate pirate, PirateGame game)
  8197. {
  8198. // Go over all enemies
  8199. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  8200. {
  8201.  
  8202. // Check if the pirate can push the enemy
  8203. if (pirate.CanPush(game.GetAllMyPirates()[1]))
  8204. {
  8205.  
  8206. pirate.Push(game.GetAllMyPirates()[0], game.GetMyCapsules()[0]);
  8207.  
  8208. // Print a message
  8209.  
  8210. // Did push
  8211. return true;
  8212.  
  8213. }
  8214. }
  8215. return false;
  8216. }
  8217. private bool TryPushcapsule4(Pirate pirate, PirateGame game)
  8218. {
  8219.  
  8220. // Go over all enemies
  8221. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  8222. {
  8223. if (enemy.Capsule != null)
  8224. if (pirate.CanPush(enemy))
  8225. {
  8226.  
  8227.  
  8228. pirate.Push(enemy, new Location(6400, 3200));
  8229. // Print a message
  8230. System.Console.WriteLine("pirate " + pirate + " pushes " + enemy + " towards " + game.GetEnemyCapsules()[0]);
  8231.  
  8232. // Did push
  8233. return true;
  8234. }
  8235.  
  8236. }
  8237.  
  8238.  
  8239. // Go over all living asteroids
  8240. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  8241. {
  8242. // Check if the pirate can push the asteroid
  8243. if (pirate.CanPush(asteroid))
  8244. {
  8245. // Push asteroid!
  8246. if (game.GetEnemyCapsules().Length > 0)
  8247. pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
  8248.  
  8249. // Print a message
  8250. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  8251.  
  8252. // Did push
  8253. return true;
  8254. }
  8255. }
  8256. foreach (Wormhole worm in game.GetAllWormholes())
  8257. {
  8258. // Check if the pirate can push the asteroid
  8259. if (pirate.CanPush(worm))
  8260. {
  8261. // Push asteroid!
  8262. if (game.GetEnemyCapsules().Length > 0)
  8263. pirate.Push(worm, game.GetMyCapsules()[0]);
  8264.  
  8265. // Print a message
  8266. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
  8267.  
  8268. // Did push
  8269. return true;
  8270. }
  8271. }
  8272. // Didn't push
  8273. return false;
  8274. }
  8275. private bool TryPush4ForBot(Pirate pirate, PirateGame game)
  8276. {
  8277. // Go over all enemies
  8278. foreach (Pirate good in game.GetMyLivingPirates())
  8279. {
  8280.  
  8281. // Check if the pirate can push the enemy
  8282. if (pirate.CanPush(good) && (good.Capsule != null))
  8283. {
  8284. pirate.Push(good, new Location(2924, 5210));
  8285. // Did push
  8286. return true;
  8287.  
  8288. }
  8289. }
  8290.  
  8291. // Go over all living asteroids
  8292. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  8293. {
  8294. // Check if the pirate can push the asteroid
  8295. if (pirate.CanPush(asteroid))
  8296. {
  8297. // Push asteroid!
  8298. if (game.GetEnemyCapsules().Length > 0)
  8299. pirate.Push(asteroid, new Location(6400, 6400));
  8300.  
  8301. // Print a message
  8302. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  8303.  
  8304. // Did push
  8305. return true;
  8306. }
  8307. }
  8308.  
  8309. // Didn't push
  8310. return false;
  8311. }
  8312. private bool TryPushcapsuleBotWorm(Pirate pirate, PirateGame game)
  8313. {
  8314. Location locat = new Location(pirate.GetLocation().Row, -1);
  8315. int min;
  8316. // Go over all enemies
  8317.  
  8318.  
  8319. // Go over all living asteroids
  8320. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  8321. {
  8322. // Check if the pirate can push the asteroid
  8323. if (pirate.CanPush(asteroid))
  8324. {
  8325. // Push asteroid!
  8326. if (game.GetEnemyCapsules().Length > 0)
  8327. pirate.Push(asteroid, game.GetEnemyCapsules()[0]);
  8328.  
  8329. // Print a message
  8330. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  8331.  
  8332. // Did push
  8333. return true;
  8334. }
  8335. }
  8336. foreach (Wormhole worm in game.GetAllWormholes())
  8337. {
  8338. // Check if the pirate can push the asteroid
  8339. if (pirate.CanPush(game.GetAllWormholes()[0]))
  8340. {
  8341. // Push asteroid!
  8342.  
  8343. pirate.Push(game.GetAllWormholes()[0], game.GetMyMotherships()[0]);
  8344.  
  8345. // Print a message
  8346. System.Console.WriteLine("pirate " + pirate + " pushes " + worm + " towards " + game.GetEnemyCapsules()[0]);
  8347.  
  8348. // Did push
  8349. return true;
  8350. }
  8351. }
  8352. // Didn't push
  8353. return false;
  8354. }
  8355.  
  8356. private bool TryPushcapsuleBotWorm2(Pirate pirate, PirateGame game)
  8357. {
  8358. Location locat = new Location(pirate.GetLocation().Row, -1);
  8359. int min;
  8360. // Go over all enemies
  8361.  
  8362.  
  8363. // Go over all living asteroids
  8364. foreach (Asteroid asteroid in game.GetLivingAsteroids())
  8365. {
  8366. // Check if the pirate can push the asteroid
  8367. if (pirate.CanPush(asteroid))
  8368. {
  8369. // Push asteroid!
  8370. if (game.GetEnemyCapsules().Length > 0)
  8371. pirate.Push(asteroid, game.GetMyMotherships()[0]);
  8372.  
  8373. // Print a message
  8374. System.Console.WriteLine("pirate " + pirate + " pushes " + asteroid + " towards " + game.GetEnemyCapsules()[0]);
  8375.  
  8376. // Did push
  8377. return true;
  8378. }
  8379. }
  8380.  
  8381.  
  8382. // Check if the pirate can push the asteroid
  8383. if (pirate.CanPush(game.GetAllWormholes()[0].Partner))
  8384. {
  8385. // Push asteroid!
  8386. int distan = game.GetMyCapsules()[0].Distance(game.GetMyCapsules()[1]);
  8387. pirate.Push(game.GetAllWormholes()[0].Partner, game.GetMyCapsules()[0].GetLocation().Towards(game.GetMyCapsules()[1], distan / 2 + 150));
  8388.  
  8389. // Print a message
  8390. System.Console.WriteLine("pirate " + pirate + " pushes " + " towards " + game.GetEnemyCapsules()[0]);
  8391.  
  8392. // Did push
  8393. return true;
  8394. }
  8395.  
  8396. // Didn't push
  8397. return false;
  8398. }
  8399. private bool Checkenemy0(Pirate pirate, PirateGame game)
  8400. {
  8401. // Go over all enemies
  8402. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  8403. {
  8404.  
  8405. if (game.GetAllMyPirates()[0].GetLocation().Distance(enemy) <= 500 && game.GetAllMyPirates()[0].Capsule != null)
  8406. return true;
  8407. }
  8408.  
  8409.  
  8410.  
  8411. // Didn't push
  8412. return false;
  8413. }
  8414. private bool Checkenemy2(Pirate pirate, PirateGame game)
  8415. {
  8416. // Go over all enemies
  8417. foreach (Pirate enemy in game.GetEnemyLivingPirates())
  8418. {
  8419.  
  8420. if (game.GetAllMyPirates()[2].GetLocation().Distance(enemy) <= 500 && game.GetAllMyPirates()[2].Capsule != null)
  8421. return true;
  8422. }
  8423. // Didn't push
  8424. return false;
  8425. }
  8426. private bool stuckenemies(Pirate pirate, PirateGame game)
  8427. {
  8428. for (int m = 0; m < game.GetEnemyLivingPirates().Length; m++)
  8429. {
  8430. for (int i = 0; i < game.GetEnemyLivingPirates().Length; i++)
  8431. {
  8432. if (m != i)
  8433. if (game.GetEnemyLivingPirates()[m].Distance(pirate) <= 600 && game.GetEnemyLivingPirates()[m].GetLocation().Distance(game.GetEnemyLivingPirates()[i]) <= 300)
  8434. return true;
  8435.  
  8436. }
  8437.  
  8438. }
  8439. return false;
  8440.  
  8441.  
  8442. }
  8443.  
  8444. private Pirate closeto(Pirate pirate, PirateGame game)
  8445. {
  8446. Pirate p = game.GetEnemyLivingPirates()[0];
  8447. int min2 = pirate.Distance(game.GetEnemyLivingPirates()[0]);
  8448. for (int m = 0; m < game.GetEnemyLivingPirates().Length; m++)
  8449. {
  8450. if (pirate.Distance(game.GetEnemyLivingPirates()[m]) < min2)
  8451. {
  8452. min2 = pirate.Distance(game.GetEnemyLivingPirates()[m]);
  8453. p = game.GetEnemyLivingPirates()[m];
  8454.  
  8455. }
  8456.  
  8457. }
  8458. return p;
  8459.  
  8460.  
  8461.  
  8462. }
  8463.  
  8464.  
  8465. }
  8466.  
  8467. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement