diff --git a/common/src/bin/csv_export/main.rs b/common/src/bin/csv_export/main.rs index ba530ce7da..d9857765f5 100644 --- a/common/src/bin/csv_export/main.rs +++ b/common/src/bin/csv_export/main.rs @@ -73,7 +73,7 @@ fn armor_stats() -> Result<(), Box> { wtr.write_record(&[ item.item_definition_id() - .raw() + .itemdef_id() .expect("All items from asset glob should be simple items"), &kind, &item.name(), @@ -134,7 +134,7 @@ fn weapon_stats() -> Result<(), Box> { wtr.write_record(&[ item.item_definition_id() - .raw() + .itemdef_id() .expect("All items from asset glob should be simple items"), &kind, &item.name(), @@ -233,7 +233,7 @@ fn all_items() -> Result<(), Box> { wtr.write_record(&[ item.item_definition_id() - .raw() + .itemdef_id() .expect("All items in asset glob should be simple items"), &item.name(), &kind, diff --git a/common/src/bin/csv_import/main.rs b/common/src/bin/csv_import/main.rs index d77f04aecf..0a78e6e969 100644 --- a/common/src/bin/csv_import/main.rs +++ b/common/src/bin/csv_import/main.rs @@ -236,7 +236,7 @@ fn armor_stats() -> Result<(), Box> { let mut path = ASSETS_PATH.clone(); for part in item .item_definition_id() - .raw() + .itemdef_id() .expect("Csv import only works on simple items, not modular items") .split('.') { @@ -435,7 +435,7 @@ fn weapon_stats() -> Result<(), Box> { let mut path = ASSETS_PATH.clone(); for part in item .item_definition_id() - .raw() + .itemdef_id() .expect("Csv import only works on simple items, not modular items") .split('.') { diff --git a/common/src/bin/recipe_graphviz.rs b/common/src/bin/recipe_graphviz.rs index 4e26730218..89ca057d82 100644 --- a/common/src/bin/recipe_graphviz.rs +++ b/common/src/bin/recipe_graphviz.rs @@ -25,7 +25,7 @@ fn main() { .output .0 .item_definition_id() - .raw() + .itemdef_id() .expect("Recipe book can only create simple items (probably)"), ); let inputs = recipe @@ -34,7 +34,7 @@ fn main() { .map(|(i, _, _)| i) .filter_map(|input| { if let RecipeInput::Item(item) = input { - item.item_definition_id().raw().map(String::from) + item.item_definition_id().itemdef_id().map(String::from) } else { None } diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index f9b50559fa..1c1daacf9b 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -1002,9 +1002,7 @@ impl CharacterAbility { duration: _, category: _, }| { - // Do we want to make buff_strength affect this instead of power? - // Look into during modular weapon transition - *strength *= stats.buff_strength * stats.power; + *strength *= stats.diminished_buff_strength(); }, ); *range *= stats.range; @@ -1044,9 +1042,7 @@ impl CharacterAbility { buff_duration: _, ref mut energy_cost, } => { - // Do we want to make buff_strength affect this instead of power? - // Look into during modular weapon transition - *buff_strength *= stats.buff_strength * stats.power; + *buff_strength *= stats.diminished_buff_strength(); *buildup_duration /= stats.speed; *cast_duration /= stats.speed; *recover_duration /= stats.speed; diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index 35fa4df480..663b74aa01 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -131,6 +131,18 @@ impl Stats { buff_strength: 1.0, } } + + /// Calculates a diminished buff strength where the buff strength is clamped + /// by the power, and then excess buff strength above the power is added + /// with diminishing returns. + // TODO: Remove this later when there are more varied high tier materials. + // Mainly exists for now as a hack to allow some progression in strength of + // directly applied buffs. + pub fn diminished_buff_strength(&self) -> f32 { + let base = self.buff_strength.clamp(0.0, self.power); + let diminished = (self.buff_strength - base + 1.0).log(5.0); + base + diminished + } } impl Asset for Stats {