Skip to content

Commit

Permalink
fix(weapon): #308
Browse files Browse the repository at this point in the history
Close #308
  • Loading branch information
wormtql committed Nov 13, 2023
1 parent 7a13fcd commit 44e720e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mona_core/src/weapon/weapon_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
18 changes: 14 additions & 4 deletions mona_core/src/weapon/weapons/swords/key_of_khaj_nisut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::weapon::weapon_sub_stat::WeaponSubStatFamily;

pub struct KeyOfKhajNisutEffect {
pub stack: f64,
pub rate: f64,
}

impl<A: Attribute> WeaponEffect<A> for KeyOfKhajNisutEffect {
Expand All @@ -26,6 +27,15 @@ impl<A: Attribute> WeaponEffect<A> 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)),
"圣显之钥被动等效"
);
}
}

Expand Down Expand Up @@ -57,11 +67,11 @@ impl WeaponTrait for KeyOfKhajNisut {
]);

fn get_effect<A: Attribute>(character: &CharacterCommonData, config: &WeaponConfig) -> Option<Box<dyn WeaponEffect<A>>> {
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 }))
}
}

0 comments on commit 44e720e

Please sign in to comment.