|
| 1 | +use crate::artifacts::artifact_trait::{ArtifactMetaData, ArtifactTrait}; |
| 2 | +use crate::artifacts::ArtifactSetName; |
| 3 | +use crate::artifacts::effect::ArtifactEffect; |
| 4 | +use crate::artifacts::effect_config::ArtifactEffectConfig; |
| 5 | +use crate::attribute::{Attribute, AttributeName}; |
| 6 | +use crate::character::character_common_data::CharacterCommonData; |
| 7 | +use crate::common::i18n::locale; |
| 8 | +use crate::common::item_config_type::{ItemConfig, ItemConfigType}; |
| 9 | + |
| 10 | +struct FinaleOfTheDeepGalleriesEffect { |
| 11 | + pub rate1: f64, |
| 12 | + pub rate2: f64, |
| 13 | +} |
| 14 | + |
| 15 | +impl<A: Attribute> ArtifactEffect<A> for FinaleOfTheDeepGalleriesEffect { |
| 16 | + fn effect2(&self, attribute: &mut A) { |
| 17 | + attribute.set_value_by(AttributeName::BonusCryo, "深廊终曲2", 0.15); |
| 18 | + } |
| 19 | + |
| 20 | + fn effect4(&self, attribute: &mut A) { |
| 21 | + attribute.set_value_by(AttributeName::BonusNormalAttack, "深廊终曲4", 0.6 * self.rate1); |
| 22 | + attribute.set_value_by(AttributeName::BonusElementalBurst, "深廊终曲4", 0.6 * self.rate2); |
| 23 | + } |
| 24 | +} |
| 25 | + |
| 26 | +pub struct FinaleOfTheDeepGalleries; |
| 27 | + |
| 28 | +impl ArtifactTrait for FinaleOfTheDeepGalleries { |
| 29 | + fn create_effect<A: Attribute>(config: &ArtifactEffectConfig, character_common_data: &CharacterCommonData) -> Box<dyn ArtifactEffect<A>> { |
| 30 | + Box::new(FinaleOfTheDeepGalleriesEffect { |
| 31 | + rate1: config.config_finale_of_the_deep_galleries.rate1, |
| 32 | + rate2: config.config_finale_of_the_deep_galleries.rate2, |
| 33 | + }) |
| 34 | + } |
| 35 | + |
| 36 | + #[cfg(not(target_family = "wasm"))] |
| 37 | + const META_DATA: ArtifactMetaData = ArtifactMetaData { |
| 38 | + name: ArtifactSetName::FinaleOfTheDeepGalleries, |
| 39 | + name_mona: "FinaleOfTheDeepGalleries", |
| 40 | + name_locale: locale!( |
| 41 | + zh_cn: "深廊终曲", |
| 42 | + en: "Finale of the Deep Galleries" |
| 43 | + ), |
| 44 | + flower: Some(locale!( |
| 45 | + zh_cn: "深廊的回奏之歌", |
| 46 | + en: "Deep Gallery's Echoing Song" |
| 47 | + )), |
| 48 | + feather: Some(locale!( |
| 49 | + zh_cn: "深廊的漫远之约", |
| 50 | + en: "Deep Gallery's Distant Pact" |
| 51 | + )), |
| 52 | + sand: Some(locale!( |
| 53 | + zh_cn: "深廊的湮落之刻", |
| 54 | + en: "Deep Gallery's Moment of Oblivion" |
| 55 | + )), |
| 56 | + goblet: Some(locale!( |
| 57 | + zh_cn: "深廊的饫赐之宴", |
| 58 | + en: "Deep Gallery's Bestowed Banquet" |
| 59 | + )), |
| 60 | + head: Some(locale!( |
| 61 | + zh_cn: "深廊的遂失之冕", |
| 62 | + en: "Deep Gallery's Lost Crown" |
| 63 | + )), |
| 64 | + star: (4, 5), |
| 65 | + effect1: None, |
| 66 | + effect2: Some(locale!( |
| 67 | + zh_cn: "获得15%冰元素伤害加成。", |
| 68 | + en: "Cryo DMG Bonus +15%" |
| 69 | + )), |
| 70 | + effect3: None, |
| 71 | + effect4: Some(locale!( |
| 72 | + zh_cn: "装备者的元素能量为0时,普通攻击造成的伤害提升60%,元素爆发造成的伤害提升60%。装备者的普通攻击造成伤害后,上述元素爆发伤害提升效果将失效6秒;装备者的元素爆发造成伤害后,上述普通攻击伤害提升效果将失效6秒。角色处于队伍后台也能触发。", |
| 73 | + en: "When the equipping character has 0 Elemental Energy, Normal Attack DMG is increased by 60% and Elemental Burst DMG is increased by 60%. After the equipping character deals Normal Attack DMG, the aforementioned Elemental Burst effect will stop applying for 6s. After the equipping character deals Elemental Burst DMG, the aforementioned Normal Attack effect will stop applying for 6s. This effect can trigger even if the equipping character is off the field." |
| 74 | + )), |
| 75 | + effect5: None, |
| 76 | + internal_id: 15040, |
| 77 | + }; |
| 78 | + |
| 79 | + #[cfg(not(target_family = "wasm"))] |
| 80 | + const CONFIG4: Option<&'static [ItemConfig]> = Some(&[ |
| 81 | + ItemConfig { |
| 82 | + name: "rate1", |
| 83 | + title: locale!( |
| 84 | + zh_cn: "效果1比例(普通攻击)", |
| 85 | + en: "Effect 1 Rate (Normal ATK)" |
| 86 | + ), |
| 87 | + config: ItemConfigType::Float { min: 0.0, max: 1.0, default: 0.0 } |
| 88 | + }, |
| 89 | + ItemConfig { |
| 90 | + name: "rate2", |
| 91 | + title: locale!( |
| 92 | + zh_cn: "效果2比例(元素爆发)", |
| 93 | + en: "Effect 2 Rate (Elemental Burst)" |
| 94 | + ), |
| 95 | + config: ItemConfigType::Float { min: 0.0, max: 1.0, default: 0.0 } |
| 96 | + } |
| 97 | + ]); |
| 98 | +} |
0 commit comments