Split adjusted_by_skills by toolkind

This commit is contained in:
juliancoffee 2021-08-16 12:16:20 +03:00
parent a2e0426d45
commit 81bbc8c31f
2 changed files with 520 additions and 513 deletions

File diff suppressed because it is too large Load Diff

View File

@ -956,6 +956,15 @@ impl SkillSet {
} }
} }
/// Returns the level of the skill or passed value as default
pub fn skill_level_or(&self, skill: Skill, default: u16) -> u16 {
if let Ok(Some(level)) = self.skill_level(skill) {
level
} else {
default
}
}
/// Checks the next level of a skill /// Checks the next level of a skill
fn next_skill_level(&self, skill: Skill) -> Option<u16> { fn next_skill_level(&self, skill: Skill) -> Option<u16> {
if let Ok(level) = self.skill_level(skill) { if let Ok(level) = self.skill_level(skill) {