Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function IuseChip(chip, target) {
  2.     var A = 0,
  3.         cost = getChipCost(chip);
  4.     if (cost <= getTP() && getCooldown(chip) === 0) {
  5.         A = useChip(chip, target);
  6.         if (A !== 1) {
  7.             var str = A;
  8.             if (A === USE_INVALID_POSITION) { // -4
  9.                 str = "Ligne de vue ou portée " + floor(getDistance(getCell(), getCell(target))) + " / " + getChipMaxScope(chip);
  10.             } else if (A === USE_INVALID_COOLDOWN) { // -3
  11.                 str = "Cooldown encore " + getCooldown(chip) + "tour(s)";
  12.             }
  13.             if (A === USE_INVALID_COOLDOWN) { // -2
  14.                 str = "J'ai besoin de " + cost + "TP, j'en ai " + getTP();
  15.             } else if (A === USE_INVALID_TARGET) { // -1
  16.                 str = isAlive(target) ? "Cible morte" : "Pb puce";
  17.             } else if (A === USE_FAILED) { // 0
  18.                 str = "Echec critique";
  19.             }
  20.             debugbuffer("Je ne peux pas utiliser la puce " + getChipName(chip) + ". (" + str + ")");
  21.         }
  22.         return A;
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement