Skip to content

Commit ca32cf5

Browse files
committed
feat: Add artifacts long night's oath and finale of the deep galleries
1 parent a1f3678 commit ca32cf5

File tree

6 files changed

+205
-1
lines changed

6 files changed

+205
-1
lines changed

mona_core/src/artifacts/artifact.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ pub enum ArtifactSetName {
7676
UnfinishedReverie,
7777
ScrollOfTheHeroOfCinderCity,
7878
ObsidianCodex,
79+
LongNightsOath,
80+
FinaleOfTheDeepGalleries,
7981
}
8082

8183
impl ArtifactSetName {

mona_core/src/artifacts/effect_config.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,13 @@ pub struct ConfigObsidianCodex {
194194
pub set4_rate: f64,
195195
}
196196

197+
#[derive(Serialize, Deserialize)]
198+
#[derive(Debug, Clone, Default)]
199+
pub struct ConfigFinaleOfTheDeepGalleries {
200+
pub rate1: f64,
201+
pub rate2: f64,
202+
}
203+
197204
#[derive(Default, Debug, Clone)]
198205
#[derive(Serialize, Deserialize)]
199206
pub struct ArtifactEffectConfig {
@@ -230,6 +237,8 @@ pub struct ArtifactEffectConfig {
230237
pub config_unfinished_reverie: ConfigRate,
231238
pub config_scroll_of_the_hero_of_cinder_city: ConfigScrollOfTheHeroOfCinder,
232239
pub config_obsidian_codex: ConfigObsidianCodex,
240+
pub config_long_nights_oath: ConfigLevel,
241+
pub config_finale_of_the_deep_galleries: ConfigFinaleOfTheDeepGalleries,
233242
}
234243

235244
#[derive(Serialize, Deserialize)]
@@ -268,6 +277,8 @@ pub struct ArtifactConfigInterface {
268277
pub config_unfinished_reverie: Option<ConfigRate>,
269278
pub config_scroll_of_the_hero_of_cinder_city: Option<ConfigScrollOfTheHeroOfCinder>,
270279
pub config_obsidian_codex: Option<ConfigObsidianCodex>,
280+
pub config_long_nights_oath: Option<ConfigLevel>,
281+
pub config_finale_of_the_deep_galleries: Option<ConfigFinaleOfTheDeepGalleries>,
271282
}
272283

273284
impl ArtifactConfigInterface {
@@ -306,6 +317,8 @@ impl ArtifactConfigInterface {
306317
config_unfinished_reverie: self.config_unfinished_reverie.unwrap_or_default(),
307318
config_scroll_of_the_hero_of_cinder_city: self.config_scroll_of_the_hero_of_cinder_city.unwrap_or_default(),
308319
config_obsidian_codex: self.config_obsidian_codex.unwrap_or_default(),
320+
config_long_nights_oath: self.config_long_nights_oath.unwrap_or_default(),
321+
config_finale_of_the_deep_galleries: self.config_finale_of_the_deep_galleries.unwrap_or_default(),
309322
}
310323
}
311324
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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 LongNightsOathEffect {
11+
pub stack: f64,
12+
}
13+
14+
impl<A: Attribute> ArtifactEffect<A> for LongNightsOathEffect {
15+
fn effect2(&self, attribute: &mut A) {
16+
attribute.set_value_by(AttributeName::BonusPlungingAttack, "长夜之誓2", 0.25);
17+
}
18+
19+
fn effect4(&self, attribute: &mut A) {
20+
attribute.set_value_by(AttributeName::BonusPlungingAttack, "长夜之誓4", self.stack * 0.15);
21+
}
22+
}
23+
24+
pub struct LongNightsOath;
25+
26+
impl ArtifactTrait for LongNightsOath {
27+
fn create_effect<A: Attribute>(config: &ArtifactEffectConfig, character_common_data: &CharacterCommonData) -> Box<dyn ArtifactEffect<A>> {
28+
Box::new(LongNightsOathEffect {
29+
stack: config.config_long_nights_oath.level
30+
})
31+
}
32+
33+
#[cfg(not(target_family = "wasm"))]
34+
const META_DATA: ArtifactMetaData = ArtifactMetaData {
35+
name: ArtifactSetName::LongNightsOath,
36+
name_mona: "LongNightsOath",
37+
name_locale: locale!(
38+
zh_cn: "长夜之誓",
39+
en: "Long Night’s Oath"
40+
),
41+
flower: Some(locale!(
42+
zh_cn: "执灯人的誓词",
43+
en: "Lightkeeper's Pledge"
44+
)),
45+
feather: Some(locale!(
46+
zh_cn: "夜鸣莺的尾羽",
47+
en: "Nightingale's Tail Feather"
48+
)),
49+
sand: Some(locale!(
50+
zh_cn: "不死者的哀铃",
51+
en: "Undying One's Mourning Bell"
52+
)),
53+
goblet: Some(locale!(
54+
zh_cn: "未吹响的号角",
55+
en: "A Horn Unwinded"
56+
)),
57+
head: Some(locale!(
58+
zh_cn: "被浸染的缨盔",
59+
en: "Dyed Tassel"
60+
)),
61+
star: (4, 5),
62+
effect1: None,
63+
effect2: Some(locale!(
64+
zh_cn: "下落攻击造成的伤害提升25%。",
65+
en: "Plunging Attack DMG increased by 25%."
66+
)),
67+
effect3: None,
68+
effect4: Some(locale!(
69+
zh_cn: "装备者的下落攻击/重击/元素战技命中敌人后,获得1/2/2层「永照的流辉」,由下落攻击、重击或元素战技产生的该效果分别每1秒至多触发一次。永照的流辉:下落攻击造成的伤害提升15%,持续6秒,至多叠加5层,每层持续时间独立计算。",
70+
en: "After the equipping character’s Plunging Attack/Charged Attack/Elemental Skill hits an opponent, they will gain 1/2/2 stack(s) of “Radiance Everlasting.” Plunging Attacks, Charged Attacks, or Elemental Skills can each trigger this effect once every 1s. Radiance Everlasting: Plunging Attacks deal 15% increased DMG for 6s. Max 5 stacks. Each stack’s duration is counted independently."
71+
)),
72+
effect5: None,
73+
internal_id: 15039,
74+
};
75+
76+
#[cfg(not(target_family = "wasm"))]
77+
const CONFIG4: Option<&'static [ItemConfig]> = Some(&[
78+
ItemConfig {
79+
name: "level",
80+
title: locale!(
81+
zh_cn: "层数",
82+
en: "Stack"
83+
),
84+
config: ItemConfigType::Float { min: 0.0, max: 5.0, default: 0.0 }
85+
}
86+
]);
87+
}

mona_core/src/artifacts/effects/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ pub use fragment_of_harmonic_whimsy::FragmentOfHarmonicWhimsy;
5858
pub use unfinished_reverie::UnfinishedReverie;
5959
pub use scroll_of_the_hero_of_cinder_city::ScrollOfTheHeroOfCinderCity;
6060
pub use obsidian_codex::ObsidianCodex;
61+
pub use long_nights_oath::LongNightsOath;
62+
pub use finale_of_the_deep_galleries::FinaleOfTheDeepGalleries;
6163

6264
pub mod empty;
6365
pub mod adventurer;
@@ -113,6 +115,8 @@ pub mod fragment_of_harmonic_whimsy;
113115
pub mod unfinished_reverie;
114116
pub mod scroll_of_the_hero_of_cinder_city;
115117
pub mod obsidian_codex;
118+
mod long_nights_oath;
119+
mod finale_of_the_deep_galleries;
116120

117121
pub fn get_effect<T: Attribute>(name: ArtifactSetName, config: &ArtifactEffectConfig, character: &Character<T>) -> Box<dyn ArtifactEffect<T>> {
118122
name.create_effect(config, &character.common_data)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "genshin_artifacts",
3-
"version": "5.29.0",
3+
"version": "5.30.0",
44
"private": true,
55
"scripts": {
66
"serve": "cross-env ENV_FILE=.env.development.yaml vue-cli-service serve",

0 commit comments

Comments
 (0)