Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ------------------
- // Variables globales
- // ------------------
- global self, enemy;
- // -----------------
- // Variables locales
- // -----------------
- var distance_to_enemy, move;
- // ---
- // ...
- // ---
- self = getLeek();
- enemy = getNearestEnemy();
- if (getWeapon() == -1) {
- // say("Bonne chance " + getName(enemy));
- setWeapon(WEAPON_LASER);
- }
- // -------
- // Logique
- // -------
- distance_to_enemy = getDistance(getCell(), getCell(enemy));
- move = 0;
- if (distance_to_enemy <= 1) {
- move = moveAwayFrom(enemy, distance_to_enemy);
- } else if (distance_to_enemy > 5) {
- move = moveToward(enemy);
- }
- // Si on a moins de la moitié de sa vie
- // ou qu'on est trop loin de l'adversaire, on se soigne puis l'attaque
- if (
- getLife() <= 1 / 2 * getTotalLife()
- || (
- getLife() < getTotalLife()
- && getDistance(getCell(), getCell(enemy)) >= getChipMaxScope(getWeapon())
- )
- ) {
- useChip(CHIP_VACCINE, self);
- useChip(CHIP_CURE, self);
- useChip(CHIP_ICE, enemy);
- useChip(CHIP_CURE, self);
- useChip(CHIP_ICE, enemy);
- // Sinon on l'attaque
- } else {
- if (canUseWeapon(enemy)) {
- useWeapon(enemy);
- } else if (canUseChip(CHIP_STALACTITE, enemy)) {
- useChip(CHIP_STALACTITE, enemy);
- }
- if (getLife() < getTotalLife()) {
- useChip(CHIP_BANDAGE, self);
- useChip(CHIP_BANDAGE, self);
- }
- }
- if (getMP() >= 1) {
- moveToward(enemy, 1);
- }
- useChip(CHIP_VACCINE, self);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement