Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function IuseChip(chip, target) {
- var A = 0,
- cost = getChipCost(chip);
- if (cost <= getTP() && getCooldown(chip) === 0) {
- A = useChip(chip, target);
- if (A !== 1) {
- var str = A;
- if (A === USE_INVALID_POSITION) { // -4
- str = "Ligne de vue ou portée " + floor(getDistance(getCell(), getCell(target))) + " / " + getChipMaxScope(chip);
- } else if (A === USE_INVALID_COOLDOWN) { // -3
- str = "Cooldown encore " + getCooldown(chip) + "tour(s)";
- }
- if (A === USE_INVALID_COOLDOWN) { // -2
- str = "J'ai besoin de " + cost + "TP, j'en ai " + getTP();
- } else if (A === USE_INVALID_TARGET) { // -1
- str = isAlive(target) ? "Cible morte" : "Pb puce";
- } else if (A === USE_FAILED) { // 0
- str = "Echec critique";
- }
- debugbuffer("Je ne peux pas utiliser la puce " + getChipName(chip) + ". (" + str + ")");
- }
- return A;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement