-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
mona_core/src/artifacts/effects/fragment_of_harmonic_whimsy.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
use crate::artifacts::artifact_trait::{ArtifactMetaData, ArtifactTrait}; | ||
use crate::artifacts::ArtifactSetName; | ||
use crate::artifacts::effect::ArtifactEffect; | ||
use crate::artifacts::effect_config::ArtifactEffectConfig; | ||
use crate::attribute::{Attribute, AttributeCommon, AttributeName}; | ||
use crate::character::character_common_data::CharacterCommonData; | ||
use crate::common::i18n::locale; | ||
use crate::common::item_config_type::{ItemConfig, ItemConfigType}; | ||
|
||
pub struct FragmentOfHarmonicWhimsyEffect { | ||
pub stack: f64, | ||
} | ||
|
||
impl<A: Attribute> ArtifactEffect<A> for FragmentOfHarmonicWhimsyEffect { | ||
fn effect2(&self, attribute: &mut A) { | ||
attribute.add_atk_percentage("谐律异想断章2", 0.18); | ||
} | ||
|
||
fn effect4(&self, attribute: &mut A) { | ||
let bonus = self.stack * 0.18; | ||
attribute.set_value_by(AttributeName::BonusBase, "谐律异想断章4", bonus); | ||
} | ||
} | ||
|
||
pub struct FragmentOfHarmonicWhimsy; | ||
|
||
impl ArtifactTrait for FragmentOfHarmonicWhimsy { | ||
fn create_effect<A: Attribute>(config: &ArtifactEffectConfig, character_common_data: &CharacterCommonData) -> Box<dyn ArtifactEffect<A>> { | ||
let stack = config.config_fragment_of_harmonic_whimsy.level; | ||
Box::new(FragmentOfHarmonicWhimsyEffect { | ||
stack | ||
}) | ||
} | ||
|
||
#[cfg(not(target_family = "wasm"))] | ||
const META_DATA: ArtifactMetaData = ArtifactMetaData { | ||
name: ArtifactSetName::FragmentOfHarmonicWhimsy, | ||
name_mona: "FragmentOfHarmonicWhimsy", | ||
name_locale: locale!( | ||
zh_cn: "谐律异想断章", | ||
en: "Fragment of Harmonic Whimsy" | ||
), | ||
flower: Some(locale!( | ||
zh_cn: "谐律交响的前奏", | ||
en: "Harmonious Symphony Prelude" | ||
)), | ||
feather: Some(locale!(zh_cn: "古海玄幽的夜想", en: "Ancient Sea's Nocturnal Musing")), | ||
sand: Some(locale!(zh_cn: "命途轮转的谐谑", en: "The Grand Jape of the Turning of Fate")), | ||
goblet: Some(locale!(zh_cn: "灵露倾洒的狂诗", en: "Ichor Shower Rhapsody")), | ||
head: Some(locale!(zh_cn: "异想零落的圆舞", en: "Whimsical Dance of the Withered")), | ||
star: (4, 5), | ||
effect1: None, | ||
effect2: Some(locale!( | ||
zh_cn: "攻击力提高18%。", | ||
en: "ATK +18%" | ||
)), | ||
effect3: None, | ||
effect4: Some(locale!( | ||
zh_cn: "生命之契的数值提升或降低时,角色造成的伤害提升18%,该效果持续6秒,至多叠加3次。", | ||
en: "When the value of a Bond of Life increases or decreases, this character deals 18% increased DMG for 6s. Max 3 stacks." | ||
)), | ||
effect5: None, | ||
internal_id: 15035, // todo | ||
}; | ||
|
||
#[cfg(not(target_family = "wasm"))] | ||
const CONFIG4: Option<&'static [ItemConfig]> = Some(&[ | ||
ItemConfig { | ||
name: "level", | ||
title: locale!( | ||
zh_cn: "被动层数", | ||
en: "Stack" | ||
), | ||
config: ItemConfigType::Float { min: 0.0, max: 3.0, default: 0.0 } | ||
} | ||
]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
use crate::artifacts::artifact_trait::{ArtifactMetaData, ArtifactTrait}; | ||
use crate::artifacts::ArtifactSetName; | ||
use crate::artifacts::effect::ArtifactEffect; | ||
use crate::artifacts::effect_config::ArtifactEffectConfig; | ||
use crate::attribute::{Attribute, AttributeCommon, AttributeName}; | ||
use crate::character::character_common_data::CharacterCommonData; | ||
use crate::common::i18n::locale; | ||
use crate::common::item_config_type::{ItemConfig, ItemConfigType}; | ||
|
||
pub struct UnfinishedReverieEffect { | ||
pub rate: f64, | ||
} | ||
|
||
impl<A: Attribute> ArtifactEffect<A> for UnfinishedReverieEffect { | ||
fn effect2(&self, attribute: &mut A) { | ||
attribute.add_atk_percentage("未竟的遐思2", 0.18); | ||
} | ||
|
||
fn effect4(&self, attribute: &mut A) { | ||
let bonus = 0.5 * self.rate; | ||
attribute.set_value_by(AttributeName::BonusBase, "未竟的遐思4", bonus); | ||
} | ||
} | ||
|
||
pub struct UnfinishedReverie; | ||
|
||
impl ArtifactTrait for UnfinishedReverie { | ||
fn create_effect<A: Attribute>(config: &ArtifactEffectConfig, character_common_data: &CharacterCommonData) -> Box<dyn ArtifactEffect<A>> { | ||
Box::new(UnfinishedReverieEffect { | ||
rate: config.config_unfinished_reverie.rate | ||
}) | ||
} | ||
|
||
#[cfg(not(target_family = "wasm"))] | ||
const META_DATA: ArtifactMetaData = ArtifactMetaData { | ||
name: ArtifactSetName::UnfinishedReverie, | ||
name_mona: "UnfinishedReverie", | ||
name_locale: locale!(zh_cn: "未竟的遐思", en: "Unfinished Reverie"), | ||
flower: Some(locale!(zh_cn: "暗结的明花", en: "Dark Fruit of Bright Flowers")), | ||
feather: Some(locale!(zh_cn: "褪光的翠尾", en: "Faded Emerald Tail")), | ||
sand: Some(locale!(zh_cn: "举业的识刻", en: "Moment of Attainment")), | ||
goblet: Some(locale!(zh_cn: "筹谋的共樽", en: "The Wine-Flask Over Which the Plan Was Hatched")), | ||
head: Some(locale!(zh_cn: "失冕的宝冠", en: "Crownless Crown")), | ||
star: (4, 5), | ||
effect1: None, | ||
effect2: Some(locale!( | ||
zh_cn: "攻击力提高18%。", | ||
en: "ATK +18%" | ||
)), | ||
effect3: None, | ||
effect4: Some(locale!( | ||
zh_cn: "脱离战斗状态3秒后,造成的伤害提升50%。在战斗状态下,附近不存在处于燃烧状态下的敌人超过6秒后,上述伤害提升效果每秒降低10%,直到降低至0%;存在处于燃烧状态下的敌人时,每秒提升10%,直到达到50%。装备此圣遗物套装的角色处于队伍后台时,依然会触发该效果。", | ||
en: "After leaving combat for 3s, DMG dealt increased by 50%. In combat, if no Burning opponents are nearby for more than 6s, this DMG Bonus will decrease by 10% per second until it reaches 0%. When a Burning opponent exists, it will increase by 10% instead until it reaches 50%. This effect still triggers if the equipping character is off-field." | ||
)), | ||
effect5: None, | ||
internal_id: 15036, | ||
}; | ||
|
||
#[cfg(not(target_family = "wasm"))] | ||
const CONFIG4: Option<&'static [ItemConfig]> = Some(&[ | ||
ItemConfig { | ||
name: "rate", | ||
title: locale!( | ||
zh_cn: "被动比例", | ||
en: "Effect Ratio" | ||
), | ||
config: ItemConfigType::Float { min: 0.0, max: 1.0, default: 0.0 } | ||
} | ||
]); | ||
} |