Commands the healer to heal the target robot. NoSuchUnit - either unit does not exist (inside the vision range). InappropriateUnitType - the unit is not a healer, or the target is not a robot. TeamNotAllowed - either robot is not on the current player's team. UnitNotOnMap - the healer is not on the map. OutOfRange - the target does not lie within "attack" range of the healer. Overheated - the hea
(&mut self, healer_id: UnitID, robot_id: UnitID)
| 1691 | /// * OutOfRange - the target does not lie within "attack" range of the healer. |
| 1692 | /// * Overheated - the healer is not ready to heal again. |
| 1693 | pub fn heal(&mut self, healer_id: UnitID, robot_id: UnitID) -> Result<(), GameError> { |
| 1694 | self.ok_if_can_heal(healer_id, robot_id)?; |
| 1695 | self.ok_if_heal_ready(healer_id)?; |
| 1696 | let damage = self.my_unit_mut(healer_id).unwrap().use_attack(); |
| 1697 | self.damage_unit(robot_id, damage); |
| 1698 | Ok(()) |
| 1699 | } |
| 1700 | |
| 1701 | fn ok_if_can_overcharge(&self, healer_id: UnitID, robot_id: UnitID) |
| 1702 | -> Result<(), GameError> { |
no test coverage detected