unit.py changes
@@ -357,6 +357,14 @@ class Unit:
speed *= SPEED_ALTERING_BUFFS.get(buff, 1)
return speed
+ @property
+ def distance_per_step(self) -> float:
+ return (self.real_speed/22.4) * self._bot_object.client.game_step
+
+ @property
+ def distance_to_weapon_ready(self) -> float:
+ return (self.real_speed / 22.4) * self.weapon_cooldown
+
@property
def is_mineral_field(self) -> bool:
""" Checks if the unit is a mineral field. """
@@ -1177,6 +1185,10 @@ class Unit:
return self._proto.weapon_cooldown
return -1
+ @property
+ def weapon_ready(self) -> bool:
+ return self.weapon_cooldown < self._bot_object.client.game_step
+
@property
def engaged_target_tag(self) -> int:
# TODO What does this do?
