-
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
18 changed files
with
2,494 additions
and
2,143 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
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
62 changes: 62 additions & 0 deletions
62
mona_core/src/weapon/weapons/catalysts/sacrificial_jade.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,62 @@ | ||
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; | ||
use crate::common::WeaponType; | ||
use crate::weapon::weapon_common_data::WeaponCommonData; | ||
use crate::weapon::weapon_effect::WeaponEffect; | ||
use crate::weapon::weapon_static_data::WeaponStaticData; | ||
use crate::weapon::weapon_trait::WeaponTrait; | ||
use crate::weapon::{WeaponConfig, WeaponName}; | ||
use crate::weapon::weapon_base_atk::WeaponBaseATKFamily; | ||
use crate::weapon::weapon_sub_stat::WeaponSubStatFamily; | ||
|
||
pub struct SacrificialJadeEffect { | ||
pub rate: f64 | ||
} | ||
|
||
impl<A: Attribute> WeaponEffect<A> for SacrificialJadeEffect { | ||
fn apply(&self, data: &WeaponCommonData, attribute: &mut A) { | ||
let refine = data.refine as f64; | ||
attribute.add_hp_percentage("遗祀玉珑被动", self.rate * (0.08 * refine + 0.24)); | ||
attribute.set_value_by(AttributeName::ElementalMastery, "遗祀玉珑被动", self.rate * (10.0 * refine + 30.0)); | ||
} | ||
} | ||
|
||
pub struct SacrificialJade; | ||
|
||
impl WeaponTrait for SacrificialJade { | ||
const META_DATA: WeaponStaticData = WeaponStaticData { | ||
name: WeaponName::SacrificialJade, | ||
internal_name: "", | ||
weapon_type: WeaponType::Catalyst, | ||
weapon_sub_stat: Some(WeaponSubStatFamily::CriticalRate80), | ||
weapon_base: WeaponBaseATKFamily::ATK454, | ||
star: 4, | ||
#[cfg(not(target_family = "wasm"))] | ||
effect: Some(locale!( | ||
zh_cn: "处于队伍后台超过5秒后,生命值上限提升<span style=\"color: #409EFF;\">32%-40%-48%-56%-64%</span>,元素精通提升<span style=\"color: #409EFF;\">40-50-60-70-80</span>点。装备者登场并留在场上10秒后,该效果将失效。", | ||
en: "When not on the field for more than 5s, Max HP will be increased by <span style=\"color: #409EFF;\">32%-40%-48%-56%-64%</span> and Elemental Mastery will be increased by <span style=\"color: #409EFF;\">40-50-60-70-80</span>. These effects will be canceled after the wielder has been on the field for 10s." | ||
)), | ||
#[cfg(not(target_family = "wasm"))] | ||
name_locale: locale!( | ||
zh_cn: "遗祀玉珑", | ||
en: "Sacrificial Jade" | ||
) | ||
}; | ||
|
||
#[cfg(not(target_family = "wasm"))] | ||
const CONFIG_DATA: Option<&'static [ItemConfig]> = Some(&[ | ||
ItemConfig::RATE01 | ||
]); | ||
|
||
fn get_effect<A: Attribute>(character: &CharacterCommonData, config: &WeaponConfig) -> Option<Box<dyn WeaponEffect<A>>> { | ||
let rate = match *config { | ||
WeaponConfig::SacrificialJade { rate } => rate, | ||
_ => 0.0 | ||
}; | ||
Some(Box::new(SacrificialJadeEffect { | ||
rate | ||
})) | ||
} | ||
} |
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,62 @@ | ||
use crate::attribute::{Attribute, AttributeCommon}; | ||
use crate::character::character_common_data::CharacterCommonData; | ||
use crate::common::i18n::locale; | ||
use crate::common::item_config_type::ItemConfig; | ||
use crate::common::WeaponType; | ||
use crate::weapon::weapon_common_data::WeaponCommonData; | ||
use crate::weapon::weapon_effect::WeaponEffect; | ||
use crate::weapon::weapon_static_data::WeaponStaticData; | ||
use crate::weapon::weapon_trait::WeaponTrait; | ||
use crate::weapon::{WeaponConfig, WeaponName}; | ||
use crate::weapon::weapon_base_atk::WeaponBaseATKFamily; | ||
use crate::weapon::weapon_sub_stat::WeaponSubStatFamily; | ||
|
||
pub struct TidalShadowEffect { | ||
pub rate: f64 | ||
} | ||
|
||
impl<A: Attribute> WeaponEffect<A> for TidalShadowEffect { | ||
fn apply(&self, data: &WeaponCommonData, attribute: &mut A) { | ||
let refine = data.refine as f64; | ||
let value = 0.06 * refine + 0.18; | ||
attribute.add_atk_percentage("浪影阔剑被动", value * self.rate); | ||
} | ||
} | ||
|
||
pub struct TidalShadow; | ||
|
||
impl WeaponTrait for TidalShadow { | ||
const META_DATA: WeaponStaticData = WeaponStaticData { | ||
name: WeaponName::TidalShadow, | ||
internal_name: "Claymore_Vorpal", | ||
weapon_type: WeaponType::Claymore, | ||
weapon_sub_stat: Some(WeaponSubStatFamily::ATK90), | ||
weapon_base: WeaponBaseATKFamily::ATK510, | ||
star: 4, | ||
#[cfg(not(target_family = "wasm"))] | ||
effect: Some(locale!( | ||
zh_cn: "受到治疗后,攻击力提升<span style=\"color: #409EFF;\">24%-30%-36%-42%-48%</span>,持续8秒。角色处于队伍后台也能触发。", | ||
en: "After the wielder is healed, ATK will be increased by <span style=\"color: #409EFF;\">24%-30%-36%-42%-48%</span> for 8s. This can be triggered even when the character is not on the field." | ||
)), | ||
#[cfg(not(target_family = "wasm"))] | ||
name_locale: locale!( | ||
zh_cn: "浪影阔剑", | ||
en: "Tidal Shadow", | ||
) | ||
}; | ||
|
||
#[cfg(not(target_family = "wasm"))] | ||
const CONFIG_DATA: Option<&'static [ItemConfig]> = Some(&[ | ||
ItemConfig::RATE01 | ||
]); | ||
|
||
fn get_effect<A: Attribute>(character: &CharacterCommonData, config: &WeaponConfig) -> Option<Box<dyn WeaponEffect<A>>> { | ||
let rate = match *config { | ||
WeaponConfig::TidalShadow { rate } => rate, | ||
_ => 0.0 | ||
}; | ||
Some(Box::new(TidalShadowEffect { | ||
rate | ||
})) | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
mona_core/src/weapon/weapons/polearms/ballad_of_the_fjords.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,70 @@ | ||
use crate::attribute::{Attribute, AttributeName}; | ||
use crate::character::character_common_data::CharacterCommonData; | ||
use crate::common::i18n::locale; | ||
use crate::common::item_config_type::{ItemConfig, ItemConfigType}; | ||
use crate::common::WeaponType; | ||
use crate::weapon::weapon_common_data::WeaponCommonData; | ||
use crate::weapon::weapon_effect::WeaponEffect; | ||
use crate::weapon::weapon_static_data::WeaponStaticData; | ||
use crate::weapon::weapon_trait::WeaponTrait; | ||
use crate::weapon::{WeaponConfig, WeaponName}; | ||
use crate::weapon::weapon_base_atk::WeaponBaseATKFamily; | ||
use crate::weapon::weapon_sub_stat::WeaponSubStatFamily; | ||
|
||
pub struct BalladOfTheFjordsEffect { | ||
pub use_effect: bool | ||
} | ||
|
||
impl<A: Attribute> WeaponEffect<A> for BalladOfTheFjordsEffect { | ||
fn apply(&self, data: &WeaponCommonData, attribute: &mut A) { | ||
if self.use_effect { | ||
let value = 30 * data.refine + 90; | ||
attribute.set_value_by(AttributeName::ElementalMastery, "峡湾长歌被动", value as f64); | ||
} | ||
} | ||
} | ||
|
||
pub struct BalladOfTheFjords; | ||
|
||
impl WeaponTrait for BalladOfTheFjords { | ||
const META_DATA: WeaponStaticData = WeaponStaticData { | ||
name: WeaponName::BalladOfTheFjords, | ||
internal_name: "Pole_Shanty", | ||
weapon_type: WeaponType::Polearm, | ||
weapon_sub_stat: Some(WeaponSubStatFamily::CriticalRate60), | ||
weapon_base: WeaponBaseATKFamily::ATK510, | ||
star: 4, | ||
#[cfg(not(target_family = "wasm"))] | ||
effect: Some(locale!( | ||
zh_cn: "队伍中存在至少三种不同元素类型的角色时,元素精通提升<span style=\"color: #409EFF;\">120-150-180-210-240</span>点。", | ||
en: "When there are at least 3 different Elemental Types in your party, Elemental Mastery will be increased by <span style=\"color: #409EFF;\">120-150-180-210-240</span>." | ||
)), | ||
#[cfg(not(target_family = "wasm"))] | ||
name_locale: locale!( | ||
zh_cn: "峡湾长歌", | ||
en: "Ballad of the Fjords" | ||
) | ||
}; | ||
|
||
#[cfg(not(target_family = "wasm"))] | ||
const CONFIG_DATA: Option<&'static [ItemConfig]> = Some(&[ | ||
ItemConfig { | ||
name: "use_effect", | ||
title: locale!( | ||
zh_cn: "开启被动", | ||
en: "Use Effect" | ||
), | ||
config: ItemConfigType::Bool { default: true } | ||
} | ||
]); | ||
|
||
fn get_effect<A: Attribute>(character: &CharacterCommonData, config: &WeaponConfig) -> Option<Box<dyn WeaponEffect<A>>> { | ||
let b = match *config { | ||
WeaponConfig::BalladOfTheFjords { use_effect } => use_effect, | ||
_ => false | ||
}; | ||
Some(Box::new(BalladOfTheFjordsEffect { | ||
use_effect: b | ||
})) | ||
} | ||
} |
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,37 @@ | ||
use crate::attribute::Attribute; | ||
use crate::character::character_common_data::CharacterCommonData; | ||
use crate::common::i18n::locale; | ||
use crate::common::WeaponType; | ||
use crate::weapon::weapon_effect::WeaponEffect; | ||
use crate::weapon::weapon_static_data::WeaponStaticData; | ||
use crate::weapon::weapon_trait::WeaponTrait; | ||
use crate::weapon::{WeaponConfig, WeaponName}; | ||
use crate::weapon::weapon_base_atk::WeaponBaseATKFamily; | ||
use crate::weapon::weapon_sub_stat::WeaponSubStatFamily; | ||
|
||
pub struct RightfulReward; | ||
|
||
impl WeaponTrait for RightfulReward { | ||
const META_DATA: WeaponStaticData = WeaponStaticData { | ||
name: WeaponName::RightfulReward, | ||
internal_name: "Pole_Vorpal", | ||
weapon_type: WeaponType::Polearm, | ||
weapon_sub_stat: Some(WeaponSubStatFamily::HP60), | ||
weapon_base: WeaponBaseATKFamily::ATK565, | ||
star: 4, | ||
#[cfg(not(target_family = "wasm"))] | ||
effect: Some(locale!( | ||
zh_cn: "受到治疗时,恢复<span style=\"color: #409EFF;\">8-10-12-14-16</span>点能量,该效果每10秒至多触发一次,角色处于队伍后台时也能触发。", | ||
en: "When the wielder is healed, restore <span style=\"color: #409EFF;\">8-10-12-14-16</span> Energy. This effect can be triggered once every 10s, and can occur even when the character is not on the field." | ||
)), | ||
#[cfg(not(target_family = "wasm"))] | ||
name_locale: locale!( | ||
zh_cn: "公义的酬报", | ||
en: "Rightful Reward" | ||
) | ||
}; | ||
|
||
fn get_effect<A: Attribute>(character: &CharacterCommonData, config: &WeaponConfig) -> Option<Box<dyn WeaponEffect<A>>> { | ||
None | ||
} | ||
} |
Oops, something went wrong.