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

Method javelin

battlecode-engine/src/controller/mod.rs:780–787  ·  view source on GitHub ↗

Javelins the robot, dealing the knight's standard damage. NoSuchUnit - either unit does not exist (inside the vision range). TeamNotAllowed - the knight is not on the current player's team. UnitNotOnMap - the knight is not on the map. InappropriateUnitType - the unit is not a knight. ResearchNotUnlocked - you do not have the needed research to use javelin. OutOfRange - the target does not lie wit

(&mut self, knight_id: UnitID, target_unit_id: UnitID)

Source from the content-addressed store, hash-verified

778 /// * OutOfRange - the target does not lie within ability range of the knight.
779 /// * Overheated - the knight is not ready to use javelin again.
780 pub fn javelin(&mut self, knight_id: UnitID, target_unit_id: UnitID) -> Result<(), GameError> {
781 let delta = Delta::Javelin { knight_id, target_unit_id };
782 self.world.apply(&delta)?;
783 if self.config.generate_turn_messages {
784 self.turn.changes.push(delta);
785 }
786 Ok(())
787 }
788
789 // ************************************************************************
790 // *************************** RANGER METHODS *****************************

Callers

nothing calls this directly

Calls 1

applyMethod · 0.80

Tested by

no test coverage detected