-
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
7 changed files
with
144 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
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}; | ||
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; | ||
|
||
struct ChainBreakerEffect { | ||
pub count: usize, | ||
} | ||
|
||
impl<A: Attribute> WeaponEffect<A> for ChainBreakerEffect { | ||
fn apply(&self, data: &WeaponCommonData, attribute: &mut A) { | ||
let refine = data.refine as f64; | ||
|
||
let step = 0.036 + 0.012 * refine; | ||
attribute.add_atk_percentage("碎链被动", step * self.count as f64); | ||
if self.count >= 3 { | ||
attribute.set_value_by(AttributeName::ElementalMastery, "碎链被动", 18.0 + 6.0 * refine); | ||
} | ||
} | ||
} | ||
|
||
pub struct ChainBreaker; | ||
|
||
impl WeaponTrait for ChainBreaker { | ||
const META_DATA: WeaponStaticData = WeaponStaticData { | ||
name: WeaponName::ChainBreaker, | ||
internal_name: "Bow_Isikhulu", | ||
weapon_type: WeaponType::Bow, | ||
weapon_sub_stat: Some(WeaponSubStatFamily::ATK60), | ||
weapon_base: WeaponBaseATKFamily::ATK565, | ||
star: 4, | ||
#[cfg(not(target_family = "wasm"))] | ||
effect: Some(locale!( | ||
zh_cn: "队伍中每有一名纳塔角色或与装备者元素类型不同的角色,装备者获得<span style=\"color: #409EFF;\">4.8%-6%-7.2%-8.4%-9.6%</span>攻击力提升;上述角色不少于3名时,装备者的元素精通提升<span style=\"color: #409EFF;\">24-30-36-42-48</span>点。", | ||
en: "For every party member from Natlan or who has a different Elemental Type from the equipping character, the equipping character gains <span style=\"color: #409EFF;\">4.8%-6%-7.2%-8.4%-9.6%</span> increased ATK. When there are no less than 3 of the aforementioned characters, the equipping character gains <span style=\"color: #409EFF;\">24-30-36-42-48</span> Elemental Mastery." | ||
)), | ||
#[cfg(not(target_family = "wasm"))] | ||
name_locale: locale!( | ||
zh_cn: "碎链", | ||
en: "Chain Breaker" | ||
), | ||
}; | ||
|
||
#[cfg(not(target_family = "wasm"))] | ||
const CONFIG_DATA: Option<&'static [ItemConfig]> = Some(&[ | ||
ItemConfig { | ||
name: "count", | ||
title: locale!( | ||
zh_cn: "纳塔角色或与装备者元素类型不同的角色数量", | ||
en: "Characters number from Natlan or who has a different Elemental Type from the equipping character" | ||
), | ||
config: ItemConfigType::Int { min: 0, max: 4, default: 4 } | ||
} | ||
]); | ||
|
||
fn get_effect<A: Attribute>(character: &CharacterCommonData, config: &WeaponConfig) -> Option<Box<dyn WeaponEffect<A>>> { | ||
match *config { | ||
WeaponConfig::ChainBreaker { count } => Some(Box::new(ChainBreakerEffect { | ||
count | ||
})), | ||
_ => None | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
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; | ||
|
||
struct SurfsUpEffect { | ||
pub stack: f64, | ||
} | ||
|
||
impl<A: Attribute> WeaponEffect<A> for SurfsUpEffect { | ||
fn apply(&self, data: &WeaponCommonData, attribute: &mut A) { | ||
|
||
let refine = data.refine as f64; | ||
|
||
attribute.add_hp_percentage("冲浪时光被动", 0.15 + 0.05 * refine); | ||
attribute.set_value_by(AttributeName::BonusNormalAttack, "冲浪时光被动", (0.09 + 0.03 * refine) * self.stack); | ||
} | ||
} | ||
|
||
pub struct SurfsUp; | ||
|
||
impl WeaponTrait for SurfsUp { | ||
const META_DATA: WeaponStaticData = WeaponStaticData { | ||
name: WeaponName::SurfsUp, | ||
internal_name: "Catalyst_MechaPufferfish", | ||
weapon_type: WeaponType::Catalyst, | ||
weapon_sub_stat: Some(WeaponSubStatFamily::CriticalDamage192), | ||
weapon_base: WeaponBaseATKFamily::ATK542, | ||
star: 5, | ||
#[cfg(not(target_family = "wasm"))] | ||
effect: Some(locale!( | ||
zh_cn: "生命值上限提高<span style=\"color: #409EFF;\">20%-25%-30%-35%-40%</span>。每15秒一次,施放元素战技后的14秒内,产生如下效果:获得4层「炽夏」,每层使普通攻击造成的伤害提升<span style=\"color: #409EFF;\">12%-15%-18%-21%-24%</span>。持续期间内,每1.5秒一次:普通攻击命中敌人后,移除1层;每1.5秒一次:对敌人触发蒸发反应后,增加1层。「炽夏」效果至多叠加4层。", | ||
en: "Max HP increased by <span style=\"color: #409EFF;\">20%-25%-30%-35%-40%</span>. Once every 15s, for the 14s after using an Elemental Skill: Gain 4 Scorching Summer stacks. Each stack increases Normal Attack DMG by <span style=\"color: #409EFF;\">12%-15%-18%-21%-24%</span>. For the duration of the effect, once every 1.5s, lose 1 stack after a Normal Attack hits an opponent; once every 1.5s, gain 1 stack after triggering a Vaporize reaction on an opponent. Max 4 Scorching Summer stacks." | ||
)), | ||
#[cfg(not(target_family = "wasm"))] | ||
name_locale: locale!( | ||
zh_cn: "冲浪时光", | ||
en: "Surf’s Up" | ||
), | ||
}; | ||
|
||
#[cfg(not(target_family = "wasm"))] | ||
const CONFIG_DATA: Option<&'static [ItemConfig]> = Some(&[ | ||
ItemConfig::STACK04 | ||
]); | ||
|
||
fn get_effect<A: Attribute>(character: &CharacterCommonData, config: &WeaponConfig) -> Option<Box<dyn WeaponEffect<A>>> { | ||
match *config { | ||
WeaponConfig::SurfsUp { stack } => Some(Box::new(SurfsUpEffect { | ||
stack | ||
})), | ||
_ => None | ||
} | ||
} | ||
} |