This commit is contained in:
Sam 2023-05-27 17:02:34 -04:00
parent c62626cec1
commit 188be17b95
9 changed files with 68 additions and 28 deletions

View File

@ -1,22 +1,9 @@
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.1,
cast_duration: 0.4,
recover_duration: 0.2,
buff_kind: Defiance,
buff_strength: 0.4,
buff_duration: Some(20.0),
energy_cost: /*20*/0,
)

View File

@ -100,6 +100,9 @@ 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.
## Sunderer
buff-title-defiance = Defiance
buff-desc-defiance = You can withstand mightier and more staggering blows
## Util
buff-text-over_seconds = over { $dur_secs } seconds
buff-text-for_seconds = for { $dur_secs } seconds

View File

@ -175,6 +175,7 @@ lazy_static! {
BuffKind::ImminentCritical => "imminent_critical",
BuffKind::Fury => "fury",
BuffKind::Sunderer => "sunderer",
BuffKind::Defiance => "defiance",
};
let mut buff_parser = HashMap::new();
for kind in BuffKind::iter() {

View File

@ -91,6 +91,12 @@ pub enum BuffKind {
/// increase. DR penetration is non-linear, 0.5 is 50% penetration and 1.0
/// is a 67% penetration.
Sunderer,
/// Increases damage resistance and poise resistance. Damage resistance is
/// increased by half of poise resistance. Poise resistance increases
/// non-linearly with strength, 0.5 is 50% and 1.0 is 67%.
/// Damage resistance increases non-linearly with strength, 0.5 is 25% and
/// 1.0 is 33%.
Defiance,
// Debuffs
/// Does damage to a creature over time.
/// Strength should be the DPS of the debuff.
@ -156,7 +162,8 @@ impl BuffKind {
//| BuffKind::SalamanderAspect
| BuffKind::ImminentCritical
| BuffKind::Fury
| BuffKind::Sunderer => true,
| BuffKind::Sunderer
| BuffKind::Defiance => true,
BuffKind::Bleeding
| BuffKind::Cursed
| BuffKind::Burning
@ -354,6 +361,10 @@ impl BuffKind {
BuffEffect::AttackPoise(data.strength),
BuffEffect::MitigationsPenetration(nn_scaling(data.strength)),
],
BuffKind::Defiance => vec![
BuffEffect::DamageReduction(nn_scaling(data.strength) / 2.0),
BuffEffect::PoiseReduction(nn_scaling(data.strength)),
],
}
}

View File

@ -589,9 +589,8 @@ fn execute_effect(
stat.max_energy_modifiers.mult_mod *= *value;
},
},
#[allow(clippy::manual_clamp)]
BuffEffect::DamageReduction(dr) => {
stat.damage_reduction = stat.damage_reduction.max(*dr).min(1.0);
stat.damage_reduction = 1.0 - ((1.0 - stat.damage_reduction) * (1.0 - *dr));
},
BuffEffect::MaxHealthChangeOverTime {
rate,

View File

@ -360,6 +360,38 @@ impl Animation for SelfBuffAnimation {
next.second.position += Vec3::new(0.0, move2 * -10.0, 0.0);
next.control.position += Vec3::new(0.0, 0.0, move2 * -5.0);
},
Some("common.abilities.axe.defiance") => {
let (move1, tension, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
Some(StageSection::Action) => (1.0, (anim_time * 20.0).sin(), 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 * 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.6);
next.control.orientation.rotate_x(move1 * 1.7);
next.control.position += Vec3::new(move1 * 12.0, move1 * -10.0, move1 * 18.0);
next.head.orientation.rotate_x(move1 * 0.6);
next.head.position += Vec3::new(0.0, 0.0, move1 * -3.0);
next.control.orientation.rotate_z(move1 * 0.4);
next.head.orientation.rotate_x(tension * 0.3);
next.control.position += Vec3::new(0.0, 0.0, tension * 2.0);
},
_ => {},
}

View File

@ -123,7 +123,8 @@ pub fn localize_chat_message(
// | BuffKind::SalamanderAspect
| BuffKind::ImminentCritical
| BuffKind::Fury
| BuffKind::Sunderer => {
| BuffKind::Sunderer
| BuffKind::Defiance => {
tracing::error!("Player was killed by a positive buff!");
"hud-outcome-mysterious"
},

View File

@ -5118,6 +5118,8 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id {
BuffKind::Fury => imgs.buff_reckless,
// TODO: Get buff image
BuffKind::Sunderer => imgs.debuff_crippled_0,
// TODO: Get buff image
BuffKind::Defiance => imgs.buff_fortitude_0,
// Debuffs
BuffKind::Bleeding => imgs.debuff_bleed_0,
BuffKind::Cursed => imgs.debuff_skull_0,
@ -5157,6 +5159,7 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> Cow<s
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"),
BuffKind::Defiance => localized_strings.get_msg("buff-title-defiance"),
// Debuffs
BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-title-bleed"),
BuffKind::Cursed { .. } => localized_strings.get_msg("buff-title-cursed"),
@ -5203,6 +5206,7 @@ pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localiz
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"),
BuffKind::Defiance => localized_strings.get_msg("buff-desc-defiance"),
// Debuffs
BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-desc-bleed"),
BuffKind::Cursed { .. } => localized_strings.get_msg("buff-desc-cursed"),

View File

@ -212,7 +212,8 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec<String> {
// | BuffKind::SalamanderAspect
| BuffKind::ImminentCritical
| BuffKind::Fury
| BuffKind::Sunderer => Cow::Borrowed(""),
| BuffKind::Sunderer
| BuffKind::Defiance => Cow::Borrowed(""),
};
write!(&mut description, "{}", buff_desc).unwrap();
@ -257,7 +258,8 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec<String> {
// | BuffKind::SalamanderAspect
| BuffKind::ImminentCritical
| BuffKind::Fury
| BuffKind::Sunderer => Cow::Borrowed(""),
| BuffKind::Sunderer
| BuffKind::Defiance => Cow::Borrowed(""),
}
} else if let BuffKind::Saturation
| BuffKind::Regeneration