MCPcopy Index your code
hub / github.com/battlecode/battlecode-2018 / overcharge

Method overcharge

battlecode-engine/src/world.rs:1743–1750  ·  view source on GitHub ↗

Overcharges the robot, resetting the robot's cooldowns. The robot must be on the same team as you. NoSuchUnit - either unit does not exist (inside the vision range). TeamNotAllowed - either robot is not on the current player's team. UnitNotOnMap - the healer is not on the map. InappropriateUnitType - the unit is not a healer, or the target is not a robot. ResearchNotUnlocked - you do not have the

(&mut self, healer_id: UnitID, robot_id: UnitID)

Source from the content-addressed store, hash-verified

1741 /// * OutOfRange - the target does not lie within ability range of the healer.
1742 /// * Overheated - the healer is not ready to use overcharge again.
1743 pub fn overcharge(&mut self, healer_id: UnitID, robot_id: UnitID)
1744 -> Result<(), GameError> {
1745 self.ok_if_can_overcharge(healer_id, robot_id)?;
1746 self.ok_if_overcharge_ready(healer_id)?;
1747 self.my_unit_mut(healer_id)?.overcharge();
1748 self.my_unit_mut(robot_id)?.be_overcharged();
1749 Ok(())
1750 }
1751
1752 // ************************************************************************
1753 // ************************* STRUCTURE METHODS ****************************

Callers 1

applyMethod · 0.45

Calls 4

ok_if_can_overchargeMethod · 0.80
my_unit_mutMethod · 0.80
be_overchargedMethod · 0.80

Tested by

no test coverage detected