deez

Ancestrar.apply_typeX

Jun 30th, 2012
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.95 KB | None | 0 0
  1.         private static void apply_type1(Fighter F, Fight fight)
  2.         {
  3.             boolean stop = false;
  4.             while(!stop && F.canPlay())
  5.             {
  6.                 int PDVPER = (F.getPDV()*100)/F.getPDVMAX();
  7.                 Fighter T = getNearestEnnemy(fight, F); // Ennemis
  8.                 Fighter T2 = getNearestFriend(fight,F); // Amis
  9.                 if(T == null)
  10.                     return;
  11.                 if(PDVPER > 15)
  12.                 {
  13.                     int attack = attackIfPossible(fight,F);
  14.                     if(attack != 0)//Attaque
  15.                     {
  16.                         if(attack == 5) stop = true;//EC
  17.                         if(!moveToAttackIfPossible(fight,F))
  18.                         {
  19.                             if(!buffIfPossible(fight,F,F))//auto-buff
  20.                             {
  21.                                 if(!HealIfPossible(fight,F, false))//soin allié
  22.                                 {
  23.                                     if(!buffIfPossible(fight,F,T2))//buff allié
  24.                                     {
  25.                                         if(!moveNearIfPossible(fight,F,T))//avancer
  26.                                         {
  27.                                             if(!invocIfPossible(fight,F))//invoquer
  28.                                             {
  29.                                                 stop = true;
  30.                                             }
  31.                                         }
  32.                                     }
  33.                                 }
  34.                             }
  35.                         }
  36.                     }
  37.                 }
  38.                 else
  39.                 {
  40.                     if(!HealIfPossible(fight,F,true))//auto-soin
  41.                     {
  42.                         int attack = attackIfPossible(fight,F);
  43.                         if(attack != 0)//Attaque
  44.                         {
  45.                             if(attack == 5) stop = true;//EC
  46.                             if(!buffIfPossible(fight,F,F))//auto-buff
  47.                             {
  48.                                 if(!HealIfPossible(fight,F,false))//soin allié
  49.                                 {
  50.                                     if(!buffIfPossible(fight,F,T2))//buff allié
  51.                                     {
  52.                                         if(!invocIfPossible(fight,F))
  53.                                         {
  54.                                             if(!moveFarIfPossible(fight, F))//fuite
  55.                                             {
  56.                                                 stop = true;
  57.                                             }
  58.                                         }
  59.                                     }
  60.                                 }
  61.                             }
  62.                         }
  63.                     }              
  64.                 }
  65.             }
  66.         }
  67.  
  68.         private static void apply_type2(Fighter F, Fight fight)
  69.         {
  70.             boolean stop = false;
  71.             while(!stop && F.canPlay())
  72.             {
  73.                 Fighter T = getNearestFriend(fight,F);
  74.                 if(!HealIfPossible(fight,F,false))//soin allié
  75.                 {
  76.                     if(!buffIfPossible(fight,F,T))//buff allié
  77.                     {
  78.                         if(!moveNearIfPossible(fight,F,T))//Avancer vers allié
  79.                         {
  80.                             if(!HealIfPossible(fight,F,true))//auto-soin
  81.                             {
  82.                                 if(!buffIfPossible(fight,F,F))//auto-buff
  83.                                 {
  84.                                     if(!invocIfPossible(fight,F))
  85.                                     {
  86.                                         T = getNearestEnnemy(fight, F);
  87.                                         int attack = attackIfPossible(fight,F);
  88.                                         if(attack != 0)//Attaque
  89.                                         {
  90.                                             if(attack == 5) stop = true;//EC
  91.                                             if(!moveFarIfPossible(fight, F))//fuite
  92.                                                 stop = true;
  93.                                         }
  94.                                     }
  95.                                 }
  96.                             }
  97.                         }
  98.                     }
  99.                 }          
  100.             }
  101.         }
  102.        
  103.         private static void apply_type3(Fighter F, Fight fight)
  104.         {
  105.             boolean stop = false;
  106.             while(!stop && F.canPlay())
  107.             {
  108.                 Fighter T = getNearestFriend(fight,F);
  109.                     if(!moveNearIfPossible(fight,F,T))//Avancer vers allié
  110.                     {
  111.                         if(!HealIfPossible(fight,F,false))//soin allié
  112.                         {
  113.                             if(!buffIfPossible(fight,F,T))//buff allié
  114.                             {
  115.                                 if(!HealIfPossible(fight,F,true))//auto-soin
  116.                                 {
  117.                                     if(!invocIfPossible(fight,F))
  118.                                     {
  119.                                         if(!buffIfPossible(fight,F,F))//auto-buff
  120.                                         {
  121.                                                 stop = true;
  122.                                         }
  123.                                     }
  124.                             }
  125.                         }
  126.                     }
  127.                 }
  128.             }      
  129.         }
  130.        
  131.         private static void apply_type4(Fighter F, Fight fight) //IA propre La Folle
  132.         {
  133.             boolean stop = false;
  134.             while(!stop && F.canPlay())
  135.             {
  136.                 Fighter T = getNearestEnnemy(fight, F);
  137.                 if(T == null) return;
  138.                 int attack = attackIfPossible(fight,F);
  139.                 if(attack != 0)//Attaque
  140.                 {
  141.                     if(attack == 5) stop = true;//EC
  142.                     if(!moveFarIfPossible(fight, F))//fuite
  143.                     {
  144.                             if(!HealIfPossible(fight,F,false))//soin allié
  145.                             {
  146.                                 if(!buffIfPossible(fight,F,T))//buff allié
  147.                                 {
  148.                                     if(!HealIfPossible(fight,F,true))//auto-soin
  149.                                     {
  150.                                         if(!invocIfPossible(fight,F))
  151.                                         {
  152.                                             if(!buffIfPossible(fight,F,F))//auto-buff
  153.                                             {
  154.                                                     stop = true;
  155.                                             }
  156.                                         }
  157.                                     }
  158.                                 }
  159.                             }
  160.                     }
  161.                 }
  162.             }
  163.         }
  164.        
  165.         private static void apply_type5(Fighter F, Fight fight) //IA propre aux énus
  166.         {
  167.             boolean stop = false;
  168.             while(!stop && F.canPlay())
  169.             {
  170.                 Fighter T = getNearestEnnemy(fight, F);
  171.                 if(T == null) return;
  172.                
  173.                 if(!moveNearIfPossible(fight,F,T))//Avancer vers enemis
  174.                 {
  175.                     stop = true;
  176.                 }
  177.             }
  178.         }
  179.        
  180.         private static void apply_type6(Fighter F, Fight fight)
  181.         {
  182.             boolean stop = false;
  183.             while(!stop && F.canPlay())
  184.             {
  185.                 if(!invocIfPossible(fight,F))
  186.                 {
  187.                     Fighter T = getNearestFriend(fight,F);
  188.                     if(!HealIfPossible(fight,F,false))//soin allié
  189.                     {
  190.                         if(!buffIfPossible(fight,F,T))//buff allié
  191.                         {
  192.                             if(!buffIfPossible(fight,F,F))//buff allié
  193.                             {
  194.                                 if(!HealIfPossible(fight,F,true))
  195.                                 {
  196.                                     int attack = attackIfPossible(fight,F);
  197.                                     if(attack != 0)//Attaque
  198.                                     {
  199.                                         if(attack == 5) stop = true;//EC
  200.                                         if(!moveFarIfPossible(fight, F))//fuite
  201.                                             stop = true;
  202.                                     }
  203.                                 }
  204.                             }
  205.                         }
  206.                     }  
  207.                 }
  208.             }
  209.         }
Advertisement
Add Comment
Please, Sign In to add comment