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

Method use_attack

battlecode-engine/src/unit.rs:535–538  ·  view source on GitHub ↗

Updates the unit as if it has attacked, and increases the attack heat. Returns the damage done.

(&mut self)

Source from the content-addressed store, hash-verified

533 /// Updates the unit as if it has attacked, and increases the attack heat.
534 /// Returns the damage done.
535 pub(crate) fn use_attack(&mut self) -> i32 {
536 self.attack_heat += self.attack_cooldown;
537 self.damage
538 }
539
540 /// Take the amount of damage given, returning true if the unit has died.
541 /// Returns false if the unit is still alive.

Callers 2

attackMethod · 0.80
healMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected