diff --git a/assets/common/repair_recipe_book.ron b/assets/common/repair_recipe_book.ron index ee402601a1..21e11ba9ff 100644 --- a/assets/common/repair_recipe_book.ron +++ b/assets/common/repair_recipe_book.ron @@ -214,6 +214,99 @@ recipes: { ItemDefId("common.items.armor.misc.pants.worker_brown"): ( inputs: [], ), ItemDefId("common.items.armor.misc.pants.worker_blue"): ( inputs: [], ), ItemDefId("common.items.armor.misc.foot.sandals"): ( inputs: [], ), + // Twigs set + ItemDefId("common.items.armor.twigs.belt"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 1), + ], + ), + ItemDefId("common.items.armor.twigs.chest"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 3), + ], + ), + ItemDefId("common.items.armor.twigs.foot"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 1), + ], + ), + ItemDefId("common.items.armor.twigs.hand"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 1), + ], + ), + ItemDefId("common.items.armor.twigs.pants"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 2), + ], + ), + ItemDefId("common.items.armor.twigs.shoulder"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 2), + ], + ), + // Twigsleaves set + ItemDefId("common.items.armor.twigsleaves.belt"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 1), + ], + ), + ItemDefId("common.items.armor.twigsleaves.chest"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 3), + ], + ), + ItemDefId("common.items.armor.twigsleaves.foot"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 1), + ], + ), + ItemDefId("common.items.armor.twigsleaves.hand"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 1), + ], + ), + ItemDefId("common.items.armor.twigsleaves.pants"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 2), + ], + ), + ItemDefId("common.items.armor.twigsleaves.shoulder"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 2), + ], + ), + // Twigsflowers set + ItemDefId("common.items.armor.twigsflowers.belt"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 1), + ], + ), + ItemDefId("common.items.armor.twigsflowers.chest"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 3), + ], + ), + ItemDefId("common.items.armor.twigsflowers.foot"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 1), + ], + ), + ItemDefId("common.items.armor.twigsflowers.hand"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 1), + ], + ), + ItemDefId("common.items.armor.twigsflowers.pants"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 2), + ], + ), + ItemDefId("common.items.armor.twigsflowers.shoulder"): ( + inputs: [ + (Item("common.items.crafting_ing.twigs"), 2), + ], + ), // ARMOR/HIDE/RAWHIDE ItemDefId("common.items.armor.hide.rawhide.back"): ( inputs: [ @@ -230,7 +323,7 @@ recipes: { (Item("common.items.crafting_ing.leather.simple_leather"), 3), ], ), - ItemDefId("common.items.armorhide.rawhide.foot"): ( + ItemDefId("common.items.armor.hide.rawhide.foot"): ( inputs: [ (Item("common.items.crafting_ing.leather.simple_leather"), 1), ], @@ -266,7 +359,7 @@ recipes: { (Item("common.items.crafting_ing.leather.thick_leather"), 3), ], ), - ItemDefId("common.items.armorhide.leather.foot"): ( + ItemDefId("common.items.armor.hide.leather.foot"): ( inputs: [ (Item("common.items.crafting_ing.leather.thick_leather"), 1), ], @@ -305,7 +398,7 @@ recipes: { (Item("common.items.mineral.ore.veloritefrag"), 3), ], ), - ItemDefId("common.items.armorhide.scale.foot"): ( + ItemDefId("common.items.armor.hide.scale.foot"): ( inputs: [ (Item("common.items.crafting_ing.hide.scales"), 1), (Item("common.items.mineral.ore.veloritefrag"), 1), @@ -348,7 +441,7 @@ recipes: { (Item("common.items.mineral.ore.veloritefrag"), 6), ], ), - ItemDefId("common.items.armorhide.carapace.foot"): ( + ItemDefId("common.items.armor.hide.carapace.foot"): ( inputs: [ (Item("common.items.crafting_ing.hide.carapace"), 1), (Item("common.items.mineral.ore.veloritefrag"), 2), @@ -391,7 +484,7 @@ recipes: { (Item("common.items.mineral.ore.veloritefrag"), 9), ], ), - ItemDefId("common.items.armorhide.primal.foot"): ( + ItemDefId("common.items.armor.hide.primal.foot"): ( inputs: [ (Item("common.items.crafting_ing.hide.plate"), 1), (Item("common.items.mineral.ore.veloritefrag"), 3), @@ -1084,7 +1177,7 @@ recipes: { }, fallback: ( inputs: [ - (Item("common.items.mineral.ore.veloritefrag"), 16), + (Item("common.items.mineral.ore.veloritefrag"), 8), ], ), ) \ No newline at end of file diff --git a/common/src/cmd.rs b/common/src/cmd.rs index 4fb54e7434..2ff84a99ce 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -293,6 +293,7 @@ pub enum ServerChatCommand { Region, ReloadChunks, RemoveLights, + RepairEquipment, Respawn, RevokeBuild, RevokeBuildAll, @@ -772,6 +773,9 @@ impl ServerChatCommand { "Scale your character", Some(Admin), ), + ServerChatCommand::RepairEquipment => { + cmd(vec![], "Repairs all equipped items", Some(Admin)) + }, } } @@ -859,6 +863,7 @@ impl ServerChatCommand { ServerChatCommand::WeatherZone => "weather_zone", ServerChatCommand::Lightning => "lightning", ServerChatCommand::Scale => "scale", + ServerChatCommand::RepairEquipment => "repair_equipment", } } diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 289d92f745..4432d17d9f 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -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 { None } diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 91c4807dd8..44244a619d 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -28,7 +28,10 @@ use common::{ self, aura::{Aura, AuraKind, AuraTarget}, buff::{Buff, BuffCategory, BuffData, BuffKind, BuffSource}, - inventory::item::{tool::AbilityMap, MaterialStatManifest, Quality}, + inventory::{ + item::{tool::AbilityMap, MaterialStatManifest, Quality}, + slot::Slot, + }, invite::InviteKind, AdminRole, ChatType, Inventory, Item, LightEmitter, Presence, PresenceKind, WaypointArea, }, @@ -202,6 +205,7 @@ fn do_command( ServerChatCommand::WeatherZone => handle_weather_zone, ServerChatCommand::Lightning => handle_lightning, ServerChatCommand::Scale => handle_scale, + ServerChatCommand::RepairEquipment => handle_repair_equipment, }; handler(server, client, target, args, cmd) @@ -4123,3 +4127,32 @@ fn handle_scale( Err(action.help_string()) } } + +fn handle_repair_equipment( + server: &mut Server, + client: EcsEntity, + target: EcsEntity, + _args: Vec, + action: &ServerChatCommand, +) -> CmdResult<()> { + let ecs = server.state.ecs(); + if let Some(mut inventory) = ecs.write_storage::().get_mut(target) { + let ability_map = ecs.read_resource::(); + let msm = ecs.read_resource::(); + let slots = inventory + .equipped_items_with_slot() + .filter(|(_, item)| item.has_durability()) + .map(|(slot, _)| slot) + .collect::>(); + for slot in slots { + inventory.repair_item_at_slot(Slot::Equip(slot), &ability_map, &msm); + } + server.notify_client( + client, + ServerGeneral::server_msg(ChatType::CommandInfo, "Repaired all equipped items"), + ); + Ok(()) + } else { + Err(action.help_string()) + } +} diff --git a/voxygen/src/ui/widgets/item_tooltip.rs b/voxygen/src/ui/widgets/item_tooltip.rs index 761fa0818e..4e4161c738 100644 --- a/voxygen/src/ui/widgets/item_tooltip.rs +++ b/voxygen/src/ui/widgets/item_tooltip.rs @@ -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);