Advertisement
Guest User

Untitled

a guest
Dec 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 24.46 KB | None | 0 0
  1. using ElfKingdom;
  2.  
  3. namespace MyBot
  4. {
  5.     public class TutorialBot : ISkillzBot
  6.     {
  7.         bool DefenderCanBuild = true;
  8.        
  9.         bool EnemyIsBunker = true;
  10.         ////Portal [] EnemysPortalArr = IfTheEnemyPlaysBunker(game.GetEnemyCastle(), game);
  11.  
  12.         public void DoTurn(Game game)
  13.         {
  14.             this.HandleattackElf(game);
  15.             this.HandleDefeneElf(game);
  16.             this.HandlePortals(game);
  17.             //int num = IfTheEnemyPlaysBunker(game.GetEnemyCastle(), game);
  18.             //PrintPortalArr(IfTheEnemyPlaysBunker(game.GetEnemyCastle(), game));
  19.         }
  20.        
  21.         private void HandleDefeneElf(Game game)
  22.         {
  23.              Elf defenceElf = game.GetAllMyElves()[1];
  24.              if (!defenceElf.IsAlive())
  25.                 return;
  26.            
  27.             Castle MyCastle = game.GetMyCastle();            
  28.             DefenderCanBuild = defenceElf.IsBuilding;
  29.            
  30.             bool defenceElfDidSomething = false;
  31.             if (defenceElf.InRange(MyCastle, 1200) && defenceElf.CanBuildPortal() == true && !defenceElfDidSomething)
  32.             {
  33.                 defenceElf.BuildPortal();
  34.                 defenceElfDidSomething = true;
  35.             }
  36.            
  37.             if (MyAttackerCloseToEnemyPortal(defenceElf, game) == true && !defenceElfDidSomething)
  38.             {
  39.                 defenceElf.Attack(GetEnemyClosePortalToMe(defenceElf, game));
  40.                 defenceElfDidSomething = true;
  41.             }
  42.             else
  43.             {
  44.                 //System.Console.WriteLine("Distance: " + defenceElf.Distance(lavagiant));
  45.                 //System.Console.WriteLine("Can Build: " + DefenderCanBuild);
  46.                 /*foreach (Elf enemyelf in game.GetEnemyLivingElves())
  47.                 {
  48.                     if (CheckAttackForEnemyElf(defenceElf, game) && !defenceElfDidSomething)
  49.                     {
  50.                         defenceElf.Attack(GetCloserElfEnemyToMe(defenceElf, game));
  51.                         defenceElfDidSomething = true;
  52.                         break;
  53.                     }
  54.                     else
  55.                     {
  56.                         if (defenceElfDidSomething == false)
  57.                         {
  58.                             if (defenceElf.CanBuildPortal() && !IsPortalCloseToMe(defenceElf, game))
  59.                             {
  60.                                 defenceElf.BuildPortal();
  61.                                 defenceElfDidSomething = true;
  62.                                 break;
  63.                             }
  64.                         }
  65.                     }
  66.                 }*/
  67.                 foreach (Elf enemyelf in game.GetEnemyLivingElves())
  68.                 {
  69.                     if (!CheckAttackForEnemyElf(defenceElf, game))
  70.                     {
  71.                         if (defenceElfDidSomething == false)
  72.                         {
  73.                             if (defenceElf.CanBuildPortal() && !IsPortalCloseToMe(defenceElf, game))
  74.                             {
  75.                                 defenceElf.BuildPortal();
  76.                                 defenceElfDidSomething = true;
  77.                                 break;
  78.                             } //  
  79.                         }
  80.                     }
  81.                 }
  82.                 foreach (LavaGiant lavagiant in game.GetEnemyLavaGiants())
  83.                 {
  84.                     if (defenceElf.InAttackRange(lavagiant) && !defenceElfDidSomething)
  85.                     {
  86.                         defenceElf.Attack(lavagiant);
  87.                         defenceElfDidSomething = true;
  88.                         break;
  89.  
  90.                     }
  91.                     else
  92.                     {
  93.                         System.Console.WriteLine(HasPortalNextToLavaGainet(lavagiant, game));
  94.                         if (defenceElf.CanBuildPortal() && !IsPortalCloseToMe(defenceElf, game) && !HasPortalNextToLavaGainet(lavagiant, game) && !defenceElfDidSomething)
  95.                         {
  96.                             defenceElf.BuildPortal();
  97.                             defenceElfDidSomething = true;
  98.                             break;
  99.                         }
  100.                     }
  101.                 }
  102.                 if (defenceElf.IsBuilding == false && !defenceElfDidSomething)
  103.                 {
  104.                     if(GetEnemyClosePortalToMe(defenceElf, game) != null)
  105.                     {
  106.                         if (!defenceElf.InAttackRange(GetEnemyClosePortalToMe(defenceElf, game)))
  107.                         {
  108.                             defenceElf.MoveTo(GetEnemyClosePortalToMe(defenceElf, game));
  109.                             defenceElfDidSomething = true;
  110.                         }
  111.                         else
  112.                         {
  113.                             defenceElf.Attack(GetEnemyClosePortalToMe(defenceElf, game));
  114.                             defenceElfDidSomething = true;
  115.                         }
  116.                     }
  117.                     else
  118.                     {
  119.                         if (!defenceElf.InAttackRange(game.GetEnemyCastle()))
  120.                         {
  121.                             defenceElf.MoveTo(game.GetEnemyCastle());
  122.                             defenceElfDidSomething = true;
  123.                         }
  124.                         else
  125.                         {
  126.                             defenceElf.Attack(game.GetEnemyCastle());
  127.                             defenceElfDidSomething = true;
  128.                         }
  129.                     }
  130.                 }
  131.             }
  132.         }
  133.        
  134.         private void HandleattackElf(Game game)
  135.         {
  136.            
  137.             Elf attackElf = game.GetAllMyElves()[0];
  138.             if (!attackElf.IsAlive())
  139.                 return;
  140.            
  141.             Castle enemyCastle = game.GetEnemyCastle();
  142.             Castle MyCastle = game.GetMyCastle();
  143.  
  144.             bool attackElfDidSomeThing = false;
  145.  
  146.  
  147.                 if (attackElf.InRange(MyCastle, 1200) && attackElfDidSomeThing == false && attackElf.CanBuildPortal() == true)
  148.                 {
  149.                     attackElf.BuildPortal();
  150.                     attackElfDidSomeThing = true;
  151.                 }
  152.                 if (MyAttackerCloseToEnemyPortal(attackElf, game) == true && attackElfDidSomeThing == false)
  153.                 {
  154.                     attackElf.Attack(GetEnemyClosePortalToMe(attackElf, game));
  155.                     attackElfDidSomeThing = true;
  156.                 }
  157.                 if (HowMuchElfEnemysNearAttacker(attackElf, game) <= 1 && attackElf.InRange(enemyCastle, 1000) && attackElfDidSomeThing == false)
  158.                 {
  159.                     if (attackElf.CanBuildPortal() && !IsPortalCloseToMe(attackElf, game))
  160.                     {
  161.                         attackElf.BuildPortal();
  162.                         attackElfDidSomeThing = true;
  163.                     }
  164.                 }
  165.                 if (attackElf.InAttackRange(enemyCastle) && attackElfDidSomeThing == false)
  166.                 {
  167.                     attackElf.Attack(enemyCastle);
  168.                     attackElfDidSomeThing = true;
  169.                
  170.                 }
  171.                
  172.                 int astratergia = 2;
  173.                
  174.                
  175.                 if (attackElfDidSomeThing == false)
  176.                 {
  177.                     if (astratergia == 1)
  178.                     foreach (Elf enemyelf in game.GetEnemyLivingElves())
  179.                     {
  180.                         if (!CheckAttackForEnemyElf(attackElf, game))
  181.                         {
  182.                             if (attackElfDidSomeThing == false)
  183.                             {
  184.                                 if (attackElf.CanBuildPortal() && !IsPortalCloseToMe(attackElf, game))
  185.                                 {
  186.                                     attackElf.BuildPortal();
  187.                                     attackElfDidSomeThing = true;
  188.                                     break;
  189.                                 } //  
  190.                             }
  191.                         }
  192.                     }
  193.                    
  194.                     if (astratergia == 2)
  195.                     foreach (Elf enemyelf in game.GetEnemyLivingElves())
  196.                     {
  197.                         if (CheckAttackForEnemyElf(attackElf, game))
  198.                         {
  199.                             attackElf.Attack(GetCloserElfEnemyToMe(attackElf, game));
  200.                             attackElfDidSomeThing = true;
  201.                             break;
  202.                         }
  203.                         else
  204.                         {
  205.                             if (attackElfDidSomeThing == false)
  206.                             {
  207.                                 if (attackElf.CanBuildPortal() && !IsPortalCloseToMe(attackElf, game))
  208.                                 {
  209.                                     attackElf.BuildPortal();
  210.                                     attackElfDidSomeThing = true;
  211.                                     break;
  212.                                 }
  213.                             }
  214.                         }
  215.                     }
  216.                    
  217.                     if (astratergia == 3)
  218.                     foreach (LavaGiant lavagiant in game.GetEnemyLavaGiants())
  219.                     {
  220.                         if (attackElf.InAttackRange(lavagiant) && !attackElfDidSomeThing)
  221.                         {
  222.                             attackElf.Attack(lavagiant);
  223.                             attackElfDidSomeThing = true;
  224.                             break;
  225.  
  226.                         }
  227.                         else
  228.                         {
  229.                             System.Console.WriteLine(HasPortalNextToLavaGainet(lavagiant, game));
  230.                             if (attackElf.CanBuildPortal() && !IsPortalCloseToMe(attackElf, game) && !HasPortalNextToLavaGainet(lavagiant, game) && !attackElfDidSomeThing)
  231.                             {
  232.                                 attackElf.BuildPortal();
  233.                                 attackElfDidSomeThing = true;
  234.                                 break;
  235.                             }
  236.                         }
  237.                     }
  238.                 }  
  239.                    
  240.                    
  241.                     if (attackElfDidSomeThing == false)
  242.                     {
  243.                         if (attackElf.InRange(enemyCastle, 1000))
  244.                         {
  245.                             if (!IsPortalCloseToMe(attackElf, game))
  246.                             {
  247.                                 if (attackElf.CanBuildPortal())
  248.                                     attackElf.BuildPortal();
  249.                                 else
  250.                                     attackElf.MoveTo(enemyCastle);
  251.                                 attackElfDidSomeThing = true;
  252.                             }
  253.                         }
  254.  
  255.                         if (attackElfDidSomeThing == false)
  256.                         {
  257.                             if (attackElf.InAttackRange(enemyCastle))
  258.                                 attackElf.Attack(enemyCastle);
  259.                             else
  260.                             {
  261.                                 attackElf.MoveTo(enemyCastle);
  262.                             }
  263.                         }
  264.  
  265.                     }
  266.                
  267.            
  268.            
  269.  
  270.         }
  271.  
  272.  
  273.  
  274.         /*private Portal[] IfTheEnemyPlaysBunker(Castle enemyCastle)
  275.         {
  276.             Portal[] EnemyClosePortals = new Portal[game.GetEnemyPortals().Length];
  277.             for (int i = 0; i < EnemyClosePortals.Length; i++)
  278.             {
  279.                 if (game.GetEnemyPortals()[i].InRange(enemyCastle, 1250))
  280.                 {
  281.                     EnemyClosePortals[i] = game.GetEnemyPortals()[i];
  282.                     System.Console.WriteLine("The Arr: " + EnemyClosePortals[i] + " \n");
  283.                 }
  284.             }
  285.             //int counter = 1;
  286.             //System.Console.WriteLine("The Answer is aaaaa" + counter);
  287.             /*for (int j = 0; j < EnemyClosePortals.Length -1; j++)
  288.             {
  289.                 System.Console.WriteLine("J =    " + j);
  290.                 //System.Console.WriteLine("The Answer is dsadasd " + counter);
  291.                 if (EnemyClosePortals[j].InRange(EnemyClosePortals[j + 1], 1250))
  292.                     counter++;
  293.             }
  294.             System.Console.WriteLine(counter);
  295.             return EnemyClosePortals;
  296.         }*/
  297.  
  298.         private bool IsPortalCloseToMe(Elf me, Game game)
  299.         {
  300.             foreach (Portal portal in game.GetMyPortals())
  301.             {
  302.                 if (me.Distance(portal) < 1500)
  303.                     return true;
  304.             }
  305.             return false;
  306.         }
  307.  
  308.         private Portal WhoIsFarthest(Portal[] arr, Game game)
  309.         {
  310.             int dist = 100000;
  311.             Portal Farthest = null;
  312.             for (int i = 0; i < arr.Length; i++)
  313.             {
  314.                 if (dist > game.GetEnemyCastle().Distance(arr[i]))
  315.                 {
  316.                     dist = game.GetEnemyCastle().Distance(arr[i]);
  317.                     Farthest = arr[i];
  318.                 }
  319.             }
  320.             return Farthest;
  321.         }
  322.  
  323.         private Portal GetEnemyClosePortalToMe(Elf me, Game game)
  324.         {
  325.             int dist = 100000;
  326.             Portal closePortal = null;
  327.             foreach (Portal enemyPortal in game.GetEnemyPortals())
  328.             {
  329.                 if (dist > me.Distance(enemyPortal))
  330.                 {
  331.                     dist = me.Distance(enemyPortal);
  332.                     closePortal = enemyPortal;
  333.                 }
  334.             }
  335.             return closePortal;
  336.         }
  337.  
  338.  
  339.         private bool HasPortalNextToLavaGainet(LavaGiant enemyLava, Game game)
  340.         {
  341.             foreach (Portal myPortal in game.GetMyPortals())
  342.             {
  343.                 if (enemyLava.InRange(myPortal, 1350))
  344.                     return true;
  345.             }
  346.             return false;
  347.         }
  348.         private void HandlePortals(Game game) //    
  349.         {
  350.             // The Bot Crashed Here, need to check( Vs JavaGainet)
  351.             Portal doItCheck = GetClosetPortalToMyCastle(game);
  352.             //      
  353.             foreach (LavaGiant lavagiant in game.GetEnemyLavaGiants())
  354.             {
  355.                 if (doItCheck.InRange(lavagiant, 1100))
  356.                 {
  357.                     if (doItCheck.CanSummonIceTroll())
  358.                     {
  359.                         doItCheck.SummonIceTroll();
  360.                     }
  361.                 }
  362.                 else
  363.                 {
  364.                     if (GetClosetPortalToEnemy(lavagiant, game).InRange(lavagiant, 800))
  365.                     {
  366.                         if (GetClosetPortalToEnemy(lavagiant, game).CanSummonIceTroll())
  367.                         {
  368.                             GetClosetPortalToEnemy(lavagiant, game).SummonIceTroll();
  369.                         }
  370.                     }
  371.                 }
  372.             }
  373.             foreach (Elf enemyElf in game.GetEnemyLivingElves())
  374.             {
  375.                 if (GetClosetPortalToEnemyElf(enemyElf, game).InRange(enemyElf, 1100))
  376.                 {
  377.                     if (GetClosetPortalToEnemyElf(enemyElf, game).CanSummonIceTroll())
  378.                     {
  379.                         GetClosetPortalToEnemyElf(enemyElf, game).SummonIceTroll();
  380.                     }
  381.                 }
  382.                 /*else
  383.                 {
  384.                     if(GetClosetPortalToEnemy(lavagiant, game).InRange(lavagiant, 800))
  385.                     {
  386.                         if(GetClosetPortalToEnemy(lavagiant, game).CanSummonIceTroll())
  387.                         {
  388.                             GetClosetPortalToEnemy(lavagiant, game).SummonIceTroll();
  389.                         }
  390.                     }
  391.                 }*/
  392.             }
  393.         }
  394.        
  395.        
  396.        
  397.         public LavaGiant[] GetClosestLava(Location location, Game game)
  398.         {
  399.             int[] lavasDistance = new int[50];
  400.             LavaGiant[] lavasDistanceX = game.GetMyLavaGiants();
  401.             LavaGiant[] lavareturn = game.GetMyLavaGiants();
  402.             for (int j = 0; j < lavasDistance.Length; j++) lavasDistance[j] = 0;
  403.             int i = 0;
  404.             foreach (LavaGiant lavagiant in game.GetEnemyLavaGiants())
  405.             {
  406.                 lavasDistance[i] = lavagiant.Distance(location);
  407.                 lavasDistanceX[i] = lavagiant;
  408.                 i++;
  409.             }
  410.             int temp = 0;
  411.             for (int write = 0; write < lavasDistance.Length; write++)
  412.             {
  413.                 for (int sort = 0; sort < lavasDistance.Length - 1; sort++)
  414.                 {
  415.                     if (lavasDistance[sort] > lavasDistance[sort + 1])
  416.                     {
  417.                         temp = lavasDistance[sort + 1];
  418.                         lavasDistance[sort + 1] = lavasDistance[sort];
  419.                         lavasDistance[sort] = temp;
  420.                     }
  421.                 }
  422.             }
  423.             for (int x = 0; x < 4; x++)
  424.                 if (lavasDistance[x] == lavasDistanceX[x].Distance(location))
  425.                     lavareturn[x] = lavasDistanceX[x];
  426.             return lavareturn;
  427.         }
  428.         public Portal GetClosetPortalToEnemyCastle(Castle enemyCastle, Game game)
  429.         {
  430.             int dist = 100000;
  431.             Portal closePortal = null;
  432.             Castle EnemyCastle = game.GetEnemyCastle();
  433.             foreach (Portal portal in game.GetMyPortals())
  434.             {
  435.                 if (dist > EnemyCastle.Distance(portal))
  436.                 {
  437.                     dist = EnemyCastle.Distance(portal);
  438.                     closePortal = portal;
  439.                 }
  440.             }
  441.             return closePortal;
  442.         }
  443.         public Portal GetClosetPortalToMyCastle(Game game)
  444.         {
  445.             int dist = 100000;
  446.             Portal closePortal = null;
  447.             Castle MyCastle = game.GetMyCastle();
  448.             if(game.GetMyPortals() != null)
  449.             {
  450.                 foreach (Portal portal in game.GetMyPortals())
  451.                 {
  452.                     if (dist > MyCastle.Distance(portal))
  453.                     {
  454.                         dist = MyCastle.Distance(portal);
  455.                         closePortal = portal;
  456.                     }
  457.                 }
  458.             }
  459.             return closePortal;
  460.         }
  461.         int lavas = 0;
  462.         private void AttackersLava(Portal ClosetPortal, Game game)
  463.         {
  464.             if (ClosetPortal == null)
  465.                 return;
  466.             if (ClosetPortal.CanSummonLavaGiant() && lavas < 3)
  467.             {
  468.                 lavas++;
  469.                 ClosetPortal.SummonLavaGiant();
  470.             }
  471.         }
  472.  
  473.         private int HowMutchPortals(Game game)
  474.         {
  475.             int i = 0;
  476.             foreach (Portal myPortals in game.GetMyPortals())
  477.             {
  478.                 i++;
  479.             }
  480.             return i;
  481.         }
  482.  
  483.         private bool ThereIsClosePortalEnemy(Elf me, Game game)
  484.         {
  485.             foreach (Portal enemyPortals in game.GetEnemyPortals())
  486.             {
  487.                 if (me.InAttackRange(enemyPortals))
  488.                     return true;
  489.             }
  490.             return false;
  491.  
  492.         }
  493.         private bool CheckAttackForEnemyElf(Elf attacker, Game game)
  494.         {
  495.             foreach (Elf enemy in game.GetEnemyLivingElves())
  496.             {
  497.                 if (attacker.InAttackRange(enemy))
  498.                     return true;
  499.             }
  500.             return false;
  501.         }
  502.  
  503.         private int HowMutchElfsNearCastle(Castle enemyCastle, Game game)
  504.         {
  505.             int counter = 0;
  506.             foreach (Elf elf in game.GetMyLivingElves())
  507.             {
  508.                 if (elf.InRange(enemyCastle, 1400))
  509.                     counter++;
  510.             }
  511.             return counter;
  512.         }
  513.  
  514.         private Portal GetClosetPortalToEnemy(LavaGiant lavagiant, Game game)
  515.         {
  516.             int dist = 100000;
  517.             Portal closePortal = null;
  518.             foreach (Portal portal in game.GetMyPortals())
  519.             {
  520.                 if (dist > lavagiant.Distance(portal))
  521.                 {
  522.                     dist = lavagiant.Distance(portal);
  523.                     closePortal = portal;
  524.                 }
  525.             }
  526.             return closePortal;
  527.         }
  528.         private Portal GetClosetPortalToEnemyElf(Elf enemy, Game game)
  529.         {
  530.             int dist = 100000;
  531.             Portal closePortal = null;
  532.             foreach (Portal portal in game.GetMyPortals())
  533.             {
  534.                 if (dist > enemy.Distance(portal))
  535.                 {
  536.                     dist = enemy.Distance(portal);
  537.                     closePortal = portal;
  538.                 }
  539.             }
  540.             return closePortal;
  541.         }
  542.         private Elf GetCloserElfEnemyToMe(Elf me, Game game)
  543.         {
  544.             int dist = 100000;
  545.             Elf EnemyCloser = null;
  546.             foreach (Elf enemy in game.GetEnemyLivingElves())
  547.             {
  548.                 if (dist > me.Distance(enemy))
  549.                 {
  550.                     dist = me.Distance(enemy);
  551.                     EnemyCloser = enemy;
  552.                 }
  553.             }
  554.             return EnemyCloser;
  555.         }
  556.         private int HowMuchElfEnemysNearAttacker(Elf Attacker, Game game)
  557.         {
  558.             int counter = 0;
  559.             foreach (Elf elf in game.GetEnemyLivingElves())
  560.             {
  561.                 if (Attacker.InRange(elf, 1500))
  562.                     counter++;
  563.             }
  564.             return counter;
  565.         }
  566.        
  567.         /*private int HowMutchEnemysNearElf(Elf me, Game game)
  568.         {
  569.             int counter = 0;
  570.             foreach (IceTroll elf in game.GetEnemyIceTrolls())
  571.             {
  572.                 if (Attacker.InRange(elf, 1000))
  573.                     counter++;
  574.             }
  575.             return counter;
  576.         }*/
  577.  
  578.         private bool MyAttackerCloseToEnemyPortal(Elf myAttacker, Game game)
  579.         {
  580.             foreach (Portal enemyPortal in game.GetEnemyPortals())
  581.             {
  582.                 if (myAttacker.InAttackRange(enemyPortal))
  583.                     return true;
  584.             }
  585.             return false;
  586.         }
  587.  
  588.         private Elf CheckWhichElfClosestToEnemyCastle(Castle enemyCastle, Game game)
  589.         {
  590.             int dist = 100000;
  591.             Elf EnemyCloser = null;
  592.             foreach (Elf me in game.GetMyLivingElves())
  593.             {
  594.                 if (dist > enemyCastle.Distance(me))
  595.                 {
  596.                     dist = enemyCastle.Distance(me);
  597.                     EnemyCloser = me;
  598.                 }
  599.             }
  600.             return EnemyCloser;
  601.         }
  602.  
  603.         private void SendHelpWhenEnemyElfDead(Game game)
  604.         {
  605.             Elf attackElf = game.GetAllMyElves()[0];
  606.             Elf defenceElf = game.GetAllMyElves()[1];
  607.             if (attackElf.IsAlive() == true || defenceElf.IsAlive() == true)
  608.             {
  609.                 Elf attacker = CheckWhichElfClosestToEnemyCastle(game.GetEnemyCastle(), game);
  610.                 if (attacker.Distance(game.GetEnemyCastle()) <= 2000 && attacker.CanBuildPortal())
  611.                 {
  612.                     attacker.BuildPortal();
  613.                 }
  614.                 else
  615.                 {
  616.                     // newLocation = (game.GetEnemyCastle().Location.Row, game.GetEnemyCastle().Location.Col);
  617.                     //System.Console.WriteLine(game.GetEnemyCastle().Location.Row, game.GetEnemyCastle().Location.Col);
  618.                     Location newLocation = new Location(game.GetEnemyCastle().Location.Col, game.GetEnemyCastle().Location.Row);
  619.                     attacker.MoveTo(newLocation);
  620.                 }
  621.             }
  622.         }
  623.        
  624.        
  625.         /*private bool IsMyElfUnderAttack(Game game)
  626.         {
  627.             foreach(Elf enemyElf in game.GetEnemyLivingElves())
  628.             {
  629.                 for(int i = 0; i < game.GetEnemyLivingElves().Length; i++)
  630.                 {
  631.                     if(game.GetEnemyLivingElves[i].InAttackRange(enemyElf))
  632.                         Elf1 = game.GetEnemyLivingElves[i];
  633.                 }
  634.                
  635.                 if(enemyElf.)
  636.             }
  637.  
  638.             int dist = 100000;
  639.             Elf EnemyCloser = null;
  640.            
  641.            
  642.             foreach (Elf MyElf in game.GetMyLivingElves())
  643.             {
  644.                 foreach(Elf EnemyElf in game.GetEnemyLivingElves())
  645.                 {
  646.                     if (dist > EnemyElf.Distance(me))
  647.                     {
  648.                         dist = enemyCastle.Distance(me);
  649.                         EnemyCloser = me;
  650.                     }
  651.                 }
  652.             }
  653.         }*/
  654.     }
  655. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement