mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Implement modular weapons.
- Add ItemKind::ModularComponent, Item::components. - Add tool::StatKind::{Direct,Modular} for the modular weapons themselves. - Move ItemConfig from ItemDesc to Item, so components' stats can be taken into account. - Crafting stores into the components field. - Components/recipes/placeholders are created dynamically. - Show which components a modular weapon contains in the tooltip in voxygen. Squashed fixes: - `Item::duplicate` components in `Item::new_from_item_def`. - Speed of 1.0 for now.
This commit is contained in:
@ -294,14 +294,14 @@ pub fn handle_wield(data: &JoinData, update: &mut StateUpdate) {
|
||||
|
||||
/// If a tool is equipped, goes into Equipping state, otherwise goes to Idle
|
||||
pub fn attempt_wield(data: &JoinData, update: &mut StateUpdate) {
|
||||
if let Some(ItemKind::Tool(tool)) = data
|
||||
if let Some((item, ItemKind::Tool(tool))) = data
|
||||
.inventory
|
||||
.equipped(EquipSlot::Mainhand)
|
||||
.map(|i| i.kind())
|
||||
.map(|i| (i, i.kind()))
|
||||
{
|
||||
update.character = CharacterState::Equipping(equipping::Data {
|
||||
static_data: equipping::StaticData {
|
||||
buildup_duration: tool.equip_time(),
|
||||
buildup_duration: tool.equip_time(item.components()),
|
||||
},
|
||||
timer: Duration::default(),
|
||||
});
|
||||
|
Reference in New Issue
Block a user