Debug items no longer have durability

This commit is contained in:
Sam 2023-04-14 18:25:24 -04:00
parent 553aa690b4
commit 9d503d1e1f
2 changed files with 8 additions and 4 deletions

View File

@ -1230,7 +1230,9 @@ impl Item {
DurabilityMultiplier(mult)
}
pub fn has_durability(&self) -> bool { self.kind().has_durability() }
pub fn has_durability(&self) -> bool {
self.kind().has_durability() && self.quality() != Quality::Debug
}
pub fn increment_damage(&mut self, ability_map: &AbilityMap, msm: &MaterialStatManifest) {
if let Some(durability_lost) = &mut self.durability_lost {
@ -1353,7 +1355,9 @@ impl ItemDesc for ItemDef {
fn components(&self) -> &[Item] { &[] }
fn has_durability(&self) -> bool { self.kind().has_durability() }
fn has_durability(&self) -> bool {
self.kind().has_durability() && self.quality != Quality::Debug
}
fn durability(&self) -> Option<u32> { None }

View File

@ -773,7 +773,7 @@ impl<'a> Widget for ItemTooltip<'a> {
);
diff_text(text, buff_strength_diff.1, 6)
}
if tool_durability != equipped_durability {
if tool_durability != equipped_durability && item.has_durability() {
let text = format!(
"{} {}",
&durability_diff.0,
@ -1020,7 +1020,7 @@ impl<'a> Widget for ItemTooltip<'a> {
}
index += armor_stats.stealth.is_some() as usize;
if armor_durability != equipped_durability {
if armor_durability != equipped_durability && item.has_durability() {
let diff = armor_durability.unwrap_or(Item::MAX_DURABILITY) as i32
- equipped_durability.unwrap_or(Item::MAX_DURABILITY) as i32;
let text = format!("{} {}", &durability_diff.0, diff);