deez

Ancestrar.IA_Percepteur

Jun 27th, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. // IA.java => apply_typePerco()
  2. // Remplacer tous par :
  3.  
  4.         private static void apply_typePerco(Fighter F, Fight fight)
  5.         {
  6.         int notWhile = 0;
  7.          try
  8.          {
  9.            do
  10.            {
  11.                notWhile++;
  12.              if (notWhile >= 12) stop = true;
  13.              if (notWhile > 15) return;
  14.                 Fighter T = getNearestEnnemy(fight, F);
  15.                 if(T == null) return;
  16.                 int attack = attackIfPossiblePerco(fight,F);
  17.                 if(attack != 0)//Attaque
  18.                 {
  19.                     if(attack == 5) stop = true;//EC
  20.                     if(!moveFarIfPossible(fight, F))//fuite
  21.                     {
  22.                             if(!HealIfPossiblePerco(fight,F,false))//soin allié
  23.                             {
  24.                                 if(!buffIfPossiblePerco(fight,F,T))//buff allié
  25.                                 {
  26.                                     if(!HealIfPossiblePerco(fight,F,true))//auto-soin
  27.                                     {
  28.                                         if(!buffIfPossiblePerco(fight,F,F))//auto-buff
  29.                                         {
  30.                                                 stop = true;
  31.                                         }
  32.                                     }
  33.                                 }
  34.                             }
  35.                     }
  36.                 }
  37.                 if(stop) break;
  38.            }while(F.canPlay());
  39.          }catch(Exception e)
  40.          {
  41.              return;
  42.          }
  43.         }
  44.  
  45.  
  46. // Voici se que j'ai modifier :
  47.         int notWhile = 0;
  48.            do
  49.            {
  50.                notWhile++;
  51.              if (notWhile >= 12) stop = true;
  52.              if (notWhile > 15) return;
  53.                 if(stop) break;
  54.            }while(F.canPlay());
  55.          }catch(Exception e)
  56.          {
  57.              return;
  58.          }
  59.         }
Advertisement
Add Comment
Please, Sign In to add comment