소스 검색

various fixes

olinox 6 년 전
부모
커밋
59b813d888
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      carribean/script.py

+ 4 - 4
carribean/script.py

@@ -743,7 +743,7 @@ class Ship(Entity):
         
         elif self.speed == self.MAX_SPEED:
             
-            if self.speed == next_flag and afternext_flag > (next_flag + 1): # there is at least one straight cell after this drift
+            if self.speed == next_flag and afternext_flag >= (next_flag + 2): # there is at least one straight cell after this drift
                 # drift
                 diff = Grid.diff_directions(self.orientation, path[next_flag].orientation)
                 if diff > 0:
@@ -769,7 +769,7 @@ class Ship(Entity):
                     self.turn_right()
                     return
             
-            elif next_flag > 3:
+            elif next_flag > 3 or (next_flag > 2 and afternext_flag >= (next_flag + 2)):
                 self.speed_up()
                 return
         
@@ -802,7 +802,7 @@ class Ship(Entity):
             
             dt = (1 + round(dist / 3)) # time for tha cannonball to reach this pos
             
-            if dt == t:
+            if (dt + 1) == t:
                 log(f"precise shoot: {next_pos}")
                 ship.fire(*next_pos)
                 return
@@ -975,7 +975,7 @@ while True:
                 
                 ship.objectives_next.append(current_obj)
             
-                new_path = grid.path(ship.goto, d, 
+                new_path = grid.path(pos, d, 
                                        current_obj.target.pos, 
                                        ship._moving_costs,
                                        limit=(max_it - it_consumed)) or []