mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Sunder
This commit is contained in:
parent
daea14f8e5
commit
820f8dca94
@ -1,22 +1,10 @@
|
||||
ComboMelee2(
|
||||
strikes: [
|
||||
(
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 4,
|
||||
poise: 5,
|
||||
knockback: 0,
|
||||
energy_regen: 5,
|
||||
),
|
||||
range: 3.0,
|
||||
angle: 45.0,
|
||||
),
|
||||
buildup_duration: 0.15,
|
||||
swing_duration: 0.05,
|
||||
hit_timing: 0.5,
|
||||
recover_duration: 0.1,
|
||||
ori_modifier: 0.6,
|
||||
),
|
||||
],
|
||||
energy_cost_per_strike: 0,
|
||||
)
|
||||
SelfBuff(
|
||||
buildup_duration: 0.2,
|
||||
cast_duration: 0.2,
|
||||
recover_duration: 0.1,
|
||||
buff_kind: Sunderer,
|
||||
buff_strength: 0.25,
|
||||
buff_duration: Some(15.0),
|
||||
combo_cost: 10,
|
||||
energy_cost: 0,
|
||||
)
|
||||
|
@ -97,6 +97,9 @@ buff-desc-imminentcritical = Your next attack will critically hit the enemy.
|
||||
## Fury
|
||||
buff-title-fury = Fury
|
||||
buff-desc-fury = With your fury, you attack more swiftly.
|
||||
## Sunderer
|
||||
buff-title-sunderer = Sunderer
|
||||
buff-desc-sunderer = Your attacks can break through your foes' defences and are more staggering.
|
||||
## Util
|
||||
buff-text-over_seconds = over { $dur_secs } seconds
|
||||
buff-text-for_seconds = for { $dur_secs } seconds
|
||||
|
@ -174,6 +174,7 @@ lazy_static! {
|
||||
// BuffKind::SalamanderAspect => "salamander_aspect",
|
||||
BuffKind::ImminentCritical => "imminent_critical",
|
||||
BuffKind::Fury => "fury",
|
||||
BuffKind::Sunderer => "sunderer",
|
||||
};
|
||||
let mut buff_parser = HashMap::new();
|
||||
for kind in BuffKind::iter() {
|
||||
|
@ -137,8 +137,13 @@ impl Attack {
|
||||
mut emit_outcome: impl FnMut(Outcome),
|
||||
) -> f32 {
|
||||
if damage.value > 0.0 {
|
||||
let damage_reduction =
|
||||
let attacker_penetration = attacker
|
||||
.and_then(|a| a.stats)
|
||||
.map_or(0.0, |s| s.mitigations_penetration)
|
||||
.clamp(0.0, 1.0);
|
||||
let raw_damage_reduction =
|
||||
Damage::compute_damage_reduction(Some(damage), target.inventory, target.stats, msm);
|
||||
let damage_reduction = (1.0 - attacker_penetration) * raw_damage_reduction;
|
||||
let block_reduction =
|
||||
if let (Some(char_state), Some(ori)) = (target.char_state, target.ori) {
|
||||
if ori.look_vec().angle_between(-*dir) < char_state.block_angle() {
|
||||
|
@ -86,6 +86,11 @@ pub enum BuffKind {
|
||||
ImminentCritical,
|
||||
/// Increases attack speed linearly with strength, 1.0 is a 100% increase
|
||||
Fury,
|
||||
/// Increases poise damage and allows attacks to ignore DR
|
||||
/// Poise damage increased linearly relative to strength, 1.0 is a 100%
|
||||
/// increase. DR penetration is non-linear, 0.5 is 50% penetration and 1.0
|
||||
/// is a 67% penetration.
|
||||
Sunderer,
|
||||
// Debuffs
|
||||
/// Does damage to a creature over time.
|
||||
/// Strength should be the DPS of the debuff.
|
||||
@ -150,7 +155,8 @@ impl BuffKind {
|
||||
| BuffKind::Lifesteal
|
||||
//| BuffKind::SalamanderAspect
|
||||
| BuffKind::ImminentCritical
|
||||
| BuffKind::Fury => true,
|
||||
| BuffKind::Fury
|
||||
| BuffKind::Sunderer => true,
|
||||
BuffKind::Bleeding
|
||||
| BuffKind::Cursed
|
||||
| BuffKind::Burning
|
||||
@ -344,6 +350,10 @@ impl BuffKind {
|
||||
val: 1.0,
|
||||
}],
|
||||
BuffKind::Fury => vec![BuffEffect::AttackSpeed(1.0 + data.strength)],
|
||||
BuffKind::Sunderer => vec![
|
||||
BuffEffect::AttackPoise(data.strength),
|
||||
BuffEffect::MitigationsPenetration(nn_scaling(data.strength)),
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
@ -474,6 +484,10 @@ pub enum BuffEffect {
|
||||
BuffOnHit(AttackEffect),
|
||||
BuffImmunity(BuffKind),
|
||||
SwimSpeed(f32),
|
||||
/// Increases poise damage dealt by attacks
|
||||
AttackPoise(f32),
|
||||
/// Ignores some damage reduction on target
|
||||
MitigationsPenetration(f32),
|
||||
}
|
||||
|
||||
/// Actual de/buff.
|
||||
|
@ -66,6 +66,7 @@ pub struct Stats {
|
||||
pub crit_chance_modifier: StatsModifier,
|
||||
pub buffs_on_hit: Vec<AttackEffect>,
|
||||
pub swim_speed_modifier: f32,
|
||||
pub mitigations_penetration: f32,
|
||||
}
|
||||
|
||||
impl Stats {
|
||||
@ -86,6 +87,7 @@ impl Stats {
|
||||
crit_chance_modifier: StatsModifier::default(),
|
||||
buffs_on_hit: Vec::new(),
|
||||
swim_speed_modifier: 1.0,
|
||||
mitigations_penetration: 0.0,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -691,5 +691,11 @@ fn execute_effect(
|
||||
BuffEffect::SwimSpeed(speed) => {
|
||||
stat.swim_speed_modifier *= speed;
|
||||
},
|
||||
BuffEffect::AttackPoise(p) => {
|
||||
stat.poise_damage_modifier *= p;
|
||||
},
|
||||
BuffEffect::MitigationsPenetration(mp) => {
|
||||
stat.mitigations_penetration *= mp;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ use super::{
|
||||
CharacterSkeleton, SkeletonAttr,
|
||||
};
|
||||
use common::states::utils::{AbilityInfo, StageSection};
|
||||
use core::f32::consts::PI;
|
||||
use core::f32::consts::{PI, TAU};
|
||||
|
||||
pub struct SelfBuffAnimation;
|
||||
impl Animation for SelfBuffAnimation {
|
||||
@ -323,6 +323,43 @@ impl Animation for SelfBuffAnimation {
|
||||
next.control.orientation.rotate_x(move2 * -0.5);
|
||||
next.control.position += Vec3::new(move2 * 9.0, move2 * -3.0, move2 * -14.0);
|
||||
},
|
||||
Some("common.abilities.axe.sunder") => {
|
||||
let (move1_raw, move2_raw, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
||||
Some(StageSection::Action) => (1.0, anim_time, 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
let pullback = 1.0 - move3;
|
||||
let move1 = move1_raw * pullback;
|
||||
let move2 = move2_raw * pullback;
|
||||
|
||||
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
|
||||
|
||||
next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
|
||||
next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
|
||||
* Quaternion::rotation_y(s_a.ac.4)
|
||||
* Quaternion::rotation_z(s_a.ac.5);
|
||||
|
||||
next.control.orientation.rotate_z(move1 * -1.5);
|
||||
next.control.position += Vec3::new(move1 * 12.0, 0.0, move1 * 5.0);
|
||||
next.control.orientation.rotate_y(move1 * 0.5);
|
||||
next.main.position += Vec3::new(0.0, move1 * 10.0, 0.0);
|
||||
next.main.orientation.rotate_z(move1_raw * TAU);
|
||||
next.second.position += Vec3::new(0.0, move1 * 10.0, 0.0);
|
||||
next.second.orientation.rotate_z(move1_raw * -TAU);
|
||||
|
||||
next.main.orientation.rotate_z(move2_raw * TAU);
|
||||
next.main.position += Vec3::new(0.0, move2 * -10.0, 0.0);
|
||||
next.second.orientation.rotate_z(move2_raw * -TAU);
|
||||
next.second.position += Vec3::new(0.0, move2 * -10.0, 0.0);
|
||||
next.control.position += Vec3::new(0.0, 0.0, move2 * -5.0);
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,8 @@ pub fn localize_chat_message(
|
||||
| BuffKind::Lifesteal
|
||||
// | BuffKind::SalamanderAspect
|
||||
| BuffKind::ImminentCritical
|
||||
| BuffKind::Fury => {
|
||||
| BuffKind::Fury
|
||||
| BuffKind::Sunderer => {
|
||||
tracing::error!("Player was killed by a positive buff!");
|
||||
"hud-outcome-mysterious"
|
||||
},
|
||||
|
@ -5116,6 +5116,8 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id {
|
||||
BuffKind::ImminentCritical => imgs.buff_reckless,
|
||||
// TODO: Get buff image
|
||||
BuffKind::Fury => imgs.buff_reckless,
|
||||
// TODO: Get buff image
|
||||
BuffKind::Sunderer => imgs.debuff_crippled_0,
|
||||
// Debuffs
|
||||
BuffKind::Bleeding => imgs.debuff_bleed_0,
|
||||
BuffKind::Cursed => imgs.debuff_skull_0,
|
||||
@ -5154,6 +5156,7 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> Cow<s
|
||||
// BuffKind::SalamanderAspect => localized_strings.get_msg("buff-title-salamanderaspect"),
|
||||
BuffKind::ImminentCritical => localized_strings.get_msg("buff-title-imminentcritical"),
|
||||
BuffKind::Fury => localized_strings.get_msg("buff-title-fury"),
|
||||
BuffKind::Sunderer => localized_strings.get_msg("buff-title-sunderer"),
|
||||
// Debuffs
|
||||
BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-title-bleed"),
|
||||
BuffKind::Cursed { .. } => localized_strings.get_msg("buff-title-cursed"),
|
||||
@ -5199,6 +5202,7 @@ pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localiz
|
||||
// BuffKind::SalamanderAspect => localized_strings.get_msg("buff-desc-salamanderaspect"),
|
||||
BuffKind::ImminentCritical => localized_strings.get_msg("buff-desc-imminentcritical"),
|
||||
BuffKind::Fury => localized_strings.get_msg("buff-desc-fury"),
|
||||
BuffKind::Sunderer => localized_strings.get_msg("buff-desc-sunderer"),
|
||||
// Debuffs
|
||||
BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-desc-bleed"),
|
||||
BuffKind::Cursed { .. } => localized_strings.get_msg("buff-desc-cursed"),
|
||||
|
@ -211,7 +211,8 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec<String> {
|
||||
| BuffKind::Lifesteal
|
||||
// | BuffKind::SalamanderAspect
|
||||
| BuffKind::ImminentCritical
|
||||
| BuffKind::Fury => Cow::Borrowed(""),
|
||||
| BuffKind::Fury
|
||||
| BuffKind::Sunderer => Cow::Borrowed(""),
|
||||
};
|
||||
|
||||
write!(&mut description, "{}", buff_desc).unwrap();
|
||||
@ -255,7 +256,8 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec<String> {
|
||||
| BuffKind::Lifesteal
|
||||
// | BuffKind::SalamanderAspect
|
||||
| BuffKind::ImminentCritical
|
||||
| BuffKind::Fury => Cow::Borrowed(""),
|
||||
| BuffKind::Fury
|
||||
| BuffKind::Sunderer => Cow::Borrowed(""),
|
||||
}
|
||||
} else if let BuffKind::Saturation
|
||||
| BuffKind::Regeneration
|
||||
|
Loading…
Reference in New Issue
Block a user