jump
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Committer: Diego Dorn <ddorn@alt-r08p02.prolo>
#
# On branch master
# Changes to be committed:
#	modified:   bot.py
#	modified:   game.py
#	modified:   utils.py
#
# Untracked files:
#	dump1.json
#	mapRubis.txt
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/bot.py b/bot.py
index c25cc38..a7124ab 100644
--- a/bot.py
+++ b/bot.py
@@ -30,6 +30,7 @@ class BasicBot:
         while heads:
 
             _, head = heappop(heads)
+            c = costs[head]
 
             for dir in (UP, DOWN, LEFT, RIGHT):
                 new = add(head, dir)
@@ -46,8 +47,6 @@ class BasicBot:
                 m, grip = (cost, grip) if cost != -1 else self.game.move_cost(head, dir, CaseType.VIDE)
                 if a == INF: continue
 
-                c = costs[head]
-
                 if c[1] + a > 1:
                     t = c[0] + c[1] + a - 1
                     a = 1
@@ -71,6 +70,21 @@ class BasicBot:
                     heappush(heads, (t*100 + a*10 + m, new))
                     pred[new] = (dir, grip)
 
+            # Jump
+            i = 1
+            l, col = head
+            while i < 4 and self.game.turns_to_break((l + i, col)) == 0:
+                new = l + i, col
+
+                if self.game.turns_to_break((l + i + 1, col)) > 0:
+                    if self._better_than(c, costs[new]):
+                        costs[new] = c
+                        heappush(heads, (c[0] * 100 + c[1] * 10 + c[2], new))
+                        pred[new] = (i, 0), False, "JUMP"
+
+                i += 1
+
+
         return costs, pred
 
     def back_chemin(self, end, pred, start):
@@ -175,22 +189,28 @@ class BasicBot:
 
         flag_debug(nain.pos, chemin)
 
-        for dir, grip in chemin:
-            cout, _ = self.game.move_cost(nain.pos, dir)
-
-            if grip:
+        for dir, grip, *jump in chemin:
+            if jump:
+                if nain.lacher():
+                    return
                 nain.grip()
             else:
-                nain.lacher()
+                cout, _= self.game.move_cost(nain.pos, dir)
 
-            supp = api.cout_de_deplacement(nain.id, DIR_TO_API[dir])
-            if cout != supp:
-                debug("DIFF:", cout, supp, dir, nain.pos)
-                api.debug_afficher_drapeau(nain.pos, api.debug_drapeau.DRAPEAU_ROUGE)
+                if grip:
+                    nain.grip()
+                else:
+                    if nain.lacher():
+                        return
 
-            if cout == -1:
-                if self.game.mine(nain, dir):
-                    return
+                # supp = api.cout_de_deplacement(nain.id, DIR_TO_API[dir])
+                # if cout != supp:
+                #     debug("DIFF:", cout, supp, dir, nain.pos)
+                #     api.debug_afficher_drapeau(nain.pos, api.debug_drapeau.DRAPEAU_ROUGE)
 
-            if nain.move(dir):
-                return
+                if cout == -1:
+                    if self.game.mine(nain, dir):
+                        return
+
+                if nain.move(dir):
+                    return
diff --git a/game.py b/game.py
index 3c26c21..1914abc 100644
--- a/game.py
+++ b/game.py
@@ -74,8 +74,15 @@ class Nain:
 
     def lacher(self, for_real=True):
         if for_real:
-            api.lacher(self.id)
-        return True
+            error = api.lacher(self.id)
+        else:
+            error = OK
+
+        if error == OK:
+            n = api.info_nain(MOI, self.id)
+            self.__init__(self.id, n.pos, n.vie, n.pa, n.pm, n.accroche, n.butin)
+
+        return self.vie <= 0
 
     def rope(self, dir, for_real=True):
         if for_real:
@@ -141,6 +148,8 @@ class Case:
             return 1
         if self.type & CaseType.UNBREAKABLE:
             return INF
+        if self.type == CaseType.TAVERNE_ENEMI:
+            return 101
         return 0
 
     @property
diff --git a/utils.py b/utils.py
index 73df1bc..750140f 100644
--- a/utils.py
+++ b/utils.py
@@ -28,7 +28,7 @@ def debug(*args, **kwargs):
 
 def flag_debug(start, path):
     if MOI == 1:
-        for dir, grip in path:
+        for dir, grip, *jump in path:
             start = add(start, dir)
             if grip:
                 api.debug_afficher_drapeau(start, api.debug_drapeau.DRAPEAU_ROUGE)
