Ok if the unit can javelin. InappropriateUnitType - the unit is not a knight. ResearchNotUnlocked - the required technology is not unlocked.
(&self)
| 710 | /// * InappropriateUnitType - the unit is not a knight. |
| 711 | /// * ResearchNotUnlocked - the required technology is not unlocked. |
| 712 | pub(crate) fn ok_if_javelin_unlocked(&self) -> Result<(), GameError> { |
| 713 | self.ok_if_unit_type(Knight)?; |
| 714 | self.ok_if_ability_unlocked()?; |
| 715 | Ok(()) |
| 716 | } |
| 717 | |
| 718 | /// Updates the unit as if it has javelined, and returns the damage done. |
| 719 | pub(crate) fn javelin(&mut self) -> i32 { |
no test coverage detected