From 44e720e071d25542eb5ba01bd25bec29fdfc5973 Mon Sep 17 00:00:00 2001 From: wormtql <584130248@qq.com> Date: Mon, 13 Nov 2023 17:21:11 +0800 Subject: [PATCH] fix(weapon): #308 Close #308 --- mona_core/src/weapon/weapon_config.rs | 2 +- .../weapon/weapons/swords/key_of_khaj_nisut.rs | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/mona_core/src/weapon/weapon_config.rs b/mona_core/src/weapon/weapon_config.rs index 1eb82967..9aca0ae2 100644 --- a/mona_core/src/weapon/weapon_config.rs +++ b/mona_core/src/weapon/weapon_config.rs @@ -22,7 +22,7 @@ pub enum WeaponConfig { CursedBlade { rate: f64 }, SapwoodBlade { rate: f64 }, XiphosMoonlight { rate: f64 }, - KeyOfKhajNisut { stack: f64 }, + KeyOfKhajNisut { stack: f64, rate: f64 }, ToukabouShigure { rate: f64 }, LightOfFoliarIncision { rate: f64 }, WolfFang { e_stack: f64, q_stack: f64 }, diff --git a/mona_core/src/weapon/weapons/swords/key_of_khaj_nisut.rs b/mona_core/src/weapon/weapons/swords/key_of_khaj_nisut.rs index 8b75e470..5e56136a 100644 --- a/mona_core/src/weapon/weapons/swords/key_of_khaj_nisut.rs +++ b/mona_core/src/weapon/weapons/swords/key_of_khaj_nisut.rs @@ -12,6 +12,7 @@ use crate::weapon::weapon_sub_stat::WeaponSubStatFamily; pub struct KeyOfKhajNisutEffect { pub stack: f64, + pub rate: f64, } impl WeaponEffect for KeyOfKhajNisutEffect { @@ -26,6 +27,15 @@ impl WeaponEffect for KeyOfKhajNisutEffect { Box::new(move |hp, _, grad| (em_bonus, 0.0)), "圣显之钥被动等效" ); + + let em_bonus2 = (0.0005 * refine + 0.0015) * self.rate; + attribute.add_edge1( + AttributeName::HP, + AttributeName::ElementalMasteryExtra, + Box::new(move |hp, _| hp * em_bonus2), + Box::new(move |hp, _, grad| (0.0, 0.0)), + "圣显之钥被动等效" + ); } } @@ -57,11 +67,11 @@ impl WeaponTrait for KeyOfKhajNisut { ]); fn get_effect(character: &CharacterCommonData, config: &WeaponConfig) -> Option>> { - let stack = match *config { - WeaponConfig::KeyOfKhajNisut { stack } => stack, - _ => 0.0 + let (stack, rate) = match *config { + WeaponConfig::KeyOfKhajNisut { stack, rate } => (stack, rate), + _ => (0.0, 0.0) }; - Some(Box::new(KeyOfKhajNisutEffect { stack })) + Some(Box::new(KeyOfKhajNisutEffect { stack, rate })) } }