From 5d0ba6e2b88ee3ad9a63202ed4ff5df9f47d45c6 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 9 May 2022 08:49:15 -0400 Subject: [PATCH] Addressed round 3 of feedback (no assets). --- common/src/comp/ability.rs | 4 +-- common/src/comp/inventory/item/item_key.rs | 35 ++++++++-------------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 60e099c097..f9b50559fa 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -1004,7 +1004,7 @@ impl CharacterAbility { }| { // Do we want to make buff_strength affect this instead of power? // Look into during modular weapon transition - *strength *= stats.buff_strength; + *strength *= stats.buff_strength * stats.power; }, ); *range *= stats.range; @@ -1046,7 +1046,7 @@ impl CharacterAbility { } => { // Do we want to make buff_strength affect this instead of power? // Look into during modular weapon transition - *buff_strength *= stats.buff_strength; + *buff_strength *= stats.buff_strength * stats.power; *buildup_duration /= stats.speed; *cast_duration /= stats.speed; *recover_duration /= stats.speed; diff --git a/common/src/comp/inventory/item/item_key.rs b/common/src/comp/inventory/item/item_key.rs index 955bfc3626..463e807417 100644 --- a/common/src/comp/inventory/item/item_key.rs +++ b/common/src/comp/inventory/item/item_key.rs @@ -37,29 +37,18 @@ impl From<&T> for ItemKey { }, ItemDefinitionId::Compound { .. } => ItemKey::Empty, }, - ItemKind::ModularComponent(mod_comp) => { - use modular::ModularComponent; - match mod_comp { - ModularComponent::ToolPrimaryComponent { .. } => { - if let ItemDefinitionId::Simple(id) = item_definition_id { - match modular::weapon_component_to_key(id, item_desc.components()) { - Ok(key) => ItemKey::ModularWeaponComponent(key), - // TODO: Maybe use a different ItemKey? - Err(_) => ItemKey::Tool(id.to_owned()), - } - } else { - ItemKey::Empty - } - }, - ModularComponent::ToolSecondaryComponent { .. } => { - if let ItemDefinitionId::Simple(id) = item_definition_id { - // TODO: Maybe use a different ItemKey? - ItemKey::Tool(id.to_owned()) - } else { - ItemKey::Empty - } - }, - } + ItemKind::ModularComponent(_) => match item_definition_id { + ItemDefinitionId::Simple(id) => ItemKey::Tool(id.to_owned()), + ItemDefinitionId::Compound { simple_base, .. } => { + if let Ok(key) = + modular::weapon_component_to_key(simple_base, item_desc.components()) + { + ItemKey::ModularWeaponComponent(key) + } else { + ItemKey::Tool(simple_base.to_owned()) + } + }, + ItemDefinitionId::Modular { .. } => ItemKey::Empty, }, ItemKind::Lantern(Lantern { kind, .. }) => ItemKey::Lantern(kind.clone()), ItemKind::Glider(Glider { kind, .. }) => ItemKey::Glider(kind.clone()),