mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Heavy abilities
This commit is contained in:
parent
8a578bf3f6
commit
500e0ae3d0
@ -1,25 +1,47 @@
|
|||||||
// TODO: Make actual ability, just for testing right now
|
ComboMelee2(
|
||||||
BasicMelee(
|
strikes: [
|
||||||
energy_cost: 50,
|
(
|
||||||
buildup_duration: 0.3,
|
melee_constructor: (
|
||||||
swing_duration: 0.1,
|
kind: Slash(
|
||||||
recover_duration: 0.2,
|
damage: 7,
|
||||||
melee_constructor: (
|
poise: 0,
|
||||||
kind: Stab(
|
knockback: 0,
|
||||||
damage: 10,
|
energy_regen: 5,
|
||||||
poise: 0,
|
),
|
||||||
knockback: 0,
|
range: 3.0,
|
||||||
energy_regen: 0,
|
angle: 45.0,
|
||||||
|
),
|
||||||
|
buildup_duration: 0.4,
|
||||||
|
swing_duration: 0.1,
|
||||||
|
hit_timing: 0.5,
|
||||||
|
recover_duration: 0.7,
|
||||||
|
ori_modifier: 0.6,
|
||||||
),
|
),
|
||||||
range: 5.0,
|
(
|
||||||
angle: 10.0,
|
melee_constructor: (
|
||||||
),
|
kind: Slash(
|
||||||
ori_modifier: 1.0,
|
damage: 10,
|
||||||
|
poise: 0,
|
||||||
|
knockback: 0,
|
||||||
|
energy_regen: 10,
|
||||||
|
),
|
||||||
|
range: 3.0,
|
||||||
|
angle: 45.0,
|
||||||
|
),
|
||||||
|
buildup_duration: 0.5,
|
||||||
|
swing_duration: 0.1,
|
||||||
|
hit_timing: 0.5,
|
||||||
|
recover_duration: 0.6,
|
||||||
|
ori_modifier: 0.6,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
is_stance: true,
|
||||||
|
energy_cost_per_strike: 5,
|
||||||
meta: (
|
meta: (
|
||||||
kind: Some(Sword(Balanced)),
|
kind: Some(Sword(Heavy)),
|
||||||
capabilities: (
|
capabilities: (
|
||||||
// Block
|
// Poise resistant during attack
|
||||||
bits: 0b00000010,
|
bits: 0b00001000,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
@ -1,25 +1,30 @@
|
|||||||
// TODO: Make actual ability, just for testing right now
|
FinisherMelee(
|
||||||
BasicMelee(
|
energy_cost: 40,
|
||||||
energy_cost: 50,
|
buildup_duration: 0.4,
|
||||||
buildup_duration: 0.3,
|
|
||||||
swing_duration: 0.1,
|
swing_duration: 0.1,
|
||||||
recover_duration: 0.2,
|
recover_duration: 0.4,
|
||||||
melee_constructor: (
|
melee_constructor: (
|
||||||
kind: Stab(
|
kind: Slash(
|
||||||
damage: 10,
|
damage: 20,
|
||||||
poise: 0,
|
poise: 30,
|
||||||
|
knockback: 0,
|
||||||
|
energy_regen: 10,
|
||||||
|
),
|
||||||
|
scaled: Some(Slash(
|
||||||
|
damage: 0,
|
||||||
|
poise: 20,
|
||||||
knockback: 0,
|
knockback: 0,
|
||||||
energy_regen: 0,
|
energy_regen: 0,
|
||||||
),
|
)),
|
||||||
range: 5.0,
|
range: 3.0,
|
||||||
angle: 10.0,
|
angle: 15.0,
|
||||||
),
|
),
|
||||||
ori_modifier: 1.0,
|
scaling: Some((
|
||||||
|
target: Attack,
|
||||||
|
kind: Linear,
|
||||||
|
)),
|
||||||
|
minimum_combo: 10,
|
||||||
meta: (
|
meta: (
|
||||||
kind: Some(Sword(Balanced)),
|
kind: Some(Sword(Heavy)),
|
||||||
capabilities: (
|
|
||||||
// Block
|
|
||||||
bits: 0b00000010,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
@ -1,25 +1,12 @@
|
|||||||
// TODO: Make actual ability, just for testing right now
|
SelfBuff(
|
||||||
BasicMelee(
|
buildup_duration: 0.2,
|
||||||
energy_cost: 50,
|
cast_duration: 0.2,
|
||||||
buildup_duration: 0.3,
|
recover_duration: 0.6,
|
||||||
swing_duration: 0.1,
|
buff_kind: Fortitude,
|
||||||
recover_duration: 0.2,
|
buff_strength: 1.0,
|
||||||
melee_constructor: (
|
buff_duration: Some(5.0),
|
||||||
kind: Stab(
|
energy_cost: 40,
|
||||||
damage: 10,
|
|
||||||
poise: 0,
|
|
||||||
knockback: 0,
|
|
||||||
energy_regen: 0,
|
|
||||||
),
|
|
||||||
range: 5.0,
|
|
||||||
angle: 10.0,
|
|
||||||
),
|
|
||||||
ori_modifier: 1.0,
|
|
||||||
meta: (
|
meta: (
|
||||||
kind: Some(Sword(Balanced)),
|
kind: Some(Sword(Heavy)),
|
||||||
capabilities: (
|
|
||||||
// Block
|
|
||||||
bits: 0b00000010,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
@ -1,25 +1,26 @@
|
|||||||
// TODO: Make actual ability, just for testing right now
|
ComboMelee2(
|
||||||
BasicMelee(
|
strikes: [
|
||||||
energy_cost: 50,
|
(
|
||||||
buildup_duration: 0.3,
|
melee_constructor: (
|
||||||
swing_duration: 0.1,
|
kind: Slash(
|
||||||
recover_duration: 0.2,
|
damage: 10,
|
||||||
melee_constructor: (
|
poise: 20,
|
||||||
kind: Stab(
|
knockback: 0,
|
||||||
damage: 10,
|
energy_regen: 10,
|
||||||
poise: 0,
|
),
|
||||||
knockback: 0,
|
range: 4.0,
|
||||||
energy_regen: 0,
|
angle: 5.0,
|
||||||
|
),
|
||||||
|
buildup_duration: 0.2,
|
||||||
|
swing_duration: 0.1,
|
||||||
|
hit_timing: 0.6,
|
||||||
|
recover_duration: 0.4,
|
||||||
|
ori_modifier: 0.6,
|
||||||
),
|
),
|
||||||
range: 5.0,
|
],
|
||||||
angle: 10.0,
|
is_stance: false,
|
||||||
),
|
energy_cost_per_strike: 10,
|
||||||
ori_modifier: 1.0,
|
|
||||||
meta: (
|
meta: (
|
||||||
kind: Some(Sword(Balanced)),
|
kind: Some(Sword(Heavy)),
|
||||||
capabilities: (
|
|
||||||
// Block
|
|
||||||
bits: 0b00000010,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
@ -61,6 +61,9 @@ buff-desc-wet = The ground rejects your feet, making it hard to stop.
|
|||||||
## Ensnared
|
## Ensnared
|
||||||
buff-title-ensnared = Ensnared
|
buff-title-ensnared = Ensnared
|
||||||
buff-desc-ensnared = Vines grasp at your legs, impeding your movement.
|
buff-desc-ensnared = Vines grasp at your legs, impeding your movement.
|
||||||
|
## Fortitude
|
||||||
|
buff-title-fortitude = Fortitude
|
||||||
|
buff-desc-fortitude = You can withstand staggers.
|
||||||
## Util
|
## Util
|
||||||
buff-text-over_seconds = over { $dur_secs } seconds
|
buff-text-over_seconds = over { $dur_secs } seconds
|
||||||
buff-text-for_seconds = for { $dur_secs } seconds
|
buff-text-for_seconds = for { $dur_secs } seconds
|
||||||
|
@ -153,6 +153,7 @@ lazy_static! {
|
|||||||
BuffKind::Ensnared => "ensnared",
|
BuffKind::Ensnared => "ensnared",
|
||||||
BuffKind::Poisoned => "poisoned",
|
BuffKind::Poisoned => "poisoned",
|
||||||
BuffKind::Hastened => "hastened",
|
BuffKind::Hastened => "hastened",
|
||||||
|
BuffKind::Fortitude => "fortitude",
|
||||||
};
|
};
|
||||||
let mut buff_parser = HashMap::new();
|
let mut buff_parser = HashMap::new();
|
||||||
for kind in BuffKind::iter() {
|
for kind in BuffKind::iter() {
|
||||||
|
@ -286,7 +286,13 @@ impl Attack {
|
|||||||
let reduced_damage =
|
let reduced_damage =
|
||||||
applied_damage * damage_reduction / (1.0 - damage_reduction);
|
applied_damage * damage_reduction / (1.0 - damage_reduction);
|
||||||
let poise = reduced_damage * CRUSHING_POISE_FRACTION;
|
let poise = reduced_damage * CRUSHING_POISE_FRACTION;
|
||||||
let change = -Poise::apply_poise_reduction(poise, target.inventory, msm);
|
let change = -Poise::apply_poise_reduction(
|
||||||
|
poise,
|
||||||
|
target.inventory,
|
||||||
|
msm,
|
||||||
|
target.char_state,
|
||||||
|
target.stats,
|
||||||
|
);
|
||||||
let poise_change = PoiseChange {
|
let poise_change = PoiseChange {
|
||||||
amount: change,
|
amount: change,
|
||||||
impulse: *dir,
|
impulse: *dir,
|
||||||
@ -377,8 +383,13 @@ impl Attack {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
CombatEffect::Poise(p) => {
|
CombatEffect::Poise(p) => {
|
||||||
let change = -Poise::apply_poise_reduction(*p, target.inventory, msm)
|
let change = -Poise::apply_poise_reduction(
|
||||||
* strength_modifier;
|
*p,
|
||||||
|
target.inventory,
|
||||||
|
msm,
|
||||||
|
target.char_state,
|
||||||
|
target.stats,
|
||||||
|
) * strength_modifier;
|
||||||
if change.abs() > Poise::POISE_EPSILON {
|
if change.abs() > Poise::POISE_EPSILON {
|
||||||
let poise_change = PoiseChange {
|
let poise_change = PoiseChange {
|
||||||
amount: change,
|
amount: change,
|
||||||
@ -536,8 +547,13 @@ impl Attack {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
CombatEffect::Poise(p) => {
|
CombatEffect::Poise(p) => {
|
||||||
let change = -Poise::apply_poise_reduction(p, target.inventory, msm)
|
let change = -Poise::apply_poise_reduction(
|
||||||
* strength_modifier;
|
p,
|
||||||
|
target.inventory,
|
||||||
|
msm,
|
||||||
|
target.char_state,
|
||||||
|
target.stats,
|
||||||
|
) * strength_modifier;
|
||||||
if change.abs() > Poise::POISE_EPSILON {
|
if change.abs() > Poise::POISE_EPSILON {
|
||||||
let poise_change = PoiseChange {
|
let poise_change = PoiseChange {
|
||||||
amount: change,
|
amount: change,
|
||||||
@ -1146,7 +1162,8 @@ pub fn combat_rating(
|
|||||||
// Normalized with a standard max poise of 100
|
// Normalized with a standard max poise of 100
|
||||||
let poise_rating = poise.base_max() as f32
|
let poise_rating = poise.base_max() as f32
|
||||||
/ 100.0
|
/ 100.0
|
||||||
/ (1.0 - Poise::compute_poise_damage_reduction(inventory, msm)).max(0.00001);
|
/ (1.0 - Poise::compute_poise_damage_reduction(Some(inventory), msm, None, None))
|
||||||
|
.max(0.00001);
|
||||||
|
|
||||||
// Normalized with a standard crit multiplier of 1.2
|
// Normalized with a standard crit multiplier of 1.2
|
||||||
let crit_rating = compute_crit_mult(Some(inventory), msm) / 1.2;
|
let crit_rating = compute_crit_mult(Some(inventory), msm) / 1.2;
|
||||||
|
@ -2544,5 +2544,6 @@ bitflags::bitflags! {
|
|||||||
const ROLL_INTERRUPT = 0b00000001;
|
const ROLL_INTERRUPT = 0b00000001;
|
||||||
const BLOCK_INTERRUPT = 0b00000010;
|
const BLOCK_INTERRUPT = 0b00000010;
|
||||||
const BUILDUP_PARRIES = 0b00000100;
|
const BUILDUP_PARRIES = 0b00000100;
|
||||||
|
const POISE_RESISTANT = 0b00001000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,11 @@ pub enum BuffKind {
|
|||||||
/// Strength scales strength of both effects linearly. 0.5 is a 50%
|
/// Strength scales strength of both effects linearly. 0.5 is a 50%
|
||||||
/// increase, 1.0 is a 100% increase.
|
/// increase, 1.0 is a 100% increase.
|
||||||
Hastened,
|
Hastened,
|
||||||
|
// TODO: Consider non linear scaling?
|
||||||
|
/// Increases resistance to incomin poise over time
|
||||||
|
/// Strength scales the resistance linearly, values over 1 will usually do
|
||||||
|
/// nothing. 0.5 is 50%, 1.0 is 100%.
|
||||||
|
Fortitude,
|
||||||
// Debuffs
|
// Debuffs
|
||||||
/// Does damage to a creature over time
|
/// Does damage to a creature over time
|
||||||
/// Strength should be the DPS of the debuff
|
/// Strength should be the DPS of the debuff
|
||||||
@ -99,7 +104,8 @@ impl BuffKind {
|
|||||||
| BuffKind::IncreaseMaxHealth
|
| BuffKind::IncreaseMaxHealth
|
||||||
| BuffKind::Invulnerability
|
| BuffKind::Invulnerability
|
||||||
| BuffKind::ProtectingWard
|
| BuffKind::ProtectingWard
|
||||||
| BuffKind::Hastened => true,
|
| BuffKind::Hastened
|
||||||
|
| BuffKind::Fortitude => true,
|
||||||
BuffKind::Bleeding
|
BuffKind::Bleeding
|
||||||
| BuffKind::Cursed
|
| BuffKind::Cursed
|
||||||
| BuffKind::Burning
|
| BuffKind::Burning
|
||||||
@ -181,6 +187,8 @@ pub enum BuffEffect {
|
|||||||
AttackSpeed(f32),
|
AttackSpeed(f32),
|
||||||
/// Modifies ground friction of target
|
/// Modifies ground friction of target
|
||||||
GroundFriction(f32),
|
GroundFriction(f32),
|
||||||
|
/// Reduces poise damage taken after armor is accounted for by this fraction
|
||||||
|
PoiseReduction(f32),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Actual de/buff.
|
/// Actual de/buff.
|
||||||
@ -378,6 +386,10 @@ impl Buff {
|
|||||||
],
|
],
|
||||||
data.duration,
|
data.duration,
|
||||||
),
|
),
|
||||||
|
BuffKind::Fortitude => (
|
||||||
|
vec![BuffEffect::PoiseReduction(data.strength)],
|
||||||
|
data.duration,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
Buff {
|
Buff {
|
||||||
kind,
|
kind,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
comp::{
|
comp::{
|
||||||
ability::Capability, inventory::item::armor::Friction, item::ConsumableKind, ControlAction, Density, Energy, InputAttr,
|
ability::Capability, inventory::item::armor::Friction, item::ConsumableKind, ControlAction,
|
||||||
InputKind, Ori, Pos, Vel,
|
Density, Energy, InputAttr, InputKind, Ori, Pos, Vel,
|
||||||
},
|
},
|
||||||
event::{LocalEvent, ServerEvent},
|
event::{LocalEvent, ServerEvent},
|
||||||
states::{
|
states::{
|
||||||
|
@ -2,8 +2,9 @@ use crate::{
|
|||||||
combat::{DamageContributor, DamageSource},
|
combat::{DamageContributor, DamageSource},
|
||||||
comp::{
|
comp::{
|
||||||
self,
|
self,
|
||||||
|
ability::Capability,
|
||||||
inventory::item::{armor::Protection, ItemKind, MaterialStatManifest},
|
inventory::item::{armor::Protection, ItemKind, MaterialStatManifest},
|
||||||
CharacterState, Inventory,
|
CharacterState, Inventory, Stats,
|
||||||
},
|
},
|
||||||
resources::Time,
|
resources::Time,
|
||||||
states,
|
states,
|
||||||
@ -234,39 +235,58 @@ impl Poise {
|
|||||||
|
|
||||||
/// Returns the total poise damage reduction provided by all equipped items
|
/// Returns the total poise damage reduction provided by all equipped items
|
||||||
pub fn compute_poise_damage_reduction(
|
pub fn compute_poise_damage_reduction(
|
||||||
inventory: &Inventory,
|
inventory: Option<&Inventory>,
|
||||||
msm: &MaterialStatManifest,
|
msm: &MaterialStatManifest,
|
||||||
|
char_state: Option<&CharacterState>,
|
||||||
|
stats: Option<&Stats>,
|
||||||
) -> f32 {
|
) -> f32 {
|
||||||
let protection = inventory
|
let protection = inventory.map_or(Some(0.0), |inv| {
|
||||||
.equipped_items()
|
inv.equipped_items()
|
||||||
.filter_map(|item| {
|
.filter_map(|item| {
|
||||||
if let ItemKind::Armor(armor) = &*item.kind() {
|
if let ItemKind::Armor(armor) = &*item.kind() {
|
||||||
armor.stats(msm).poise_resilience
|
armor.stats(msm).poise_resilience
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.map(|protection| match protection {
|
.map(|protection| match protection {
|
||||||
Protection::Normal(protection) => Some(protection),
|
Protection::Normal(protection) => Some(protection),
|
||||||
Protection::Invincible => None,
|
Protection::Invincible => None,
|
||||||
})
|
})
|
||||||
.sum::<Option<f32>>();
|
.sum::<Option<f32>>()
|
||||||
match protection {
|
});
|
||||||
|
let from_inventory = match protection {
|
||||||
Some(dr) => dr / (60.0 + dr.abs()),
|
Some(dr) => dr / (60.0 + dr.abs()),
|
||||||
None => 1.0,
|
None => 1.0,
|
||||||
}
|
};
|
||||||
|
let from_char = {
|
||||||
|
let resistant = char_state
|
||||||
|
.and_then(|cs| cs.ability_info())
|
||||||
|
.map_or(false, |a| {
|
||||||
|
a.ability_meta
|
||||||
|
.capabilities
|
||||||
|
.contains(Capability::POISE_RESISTANT)
|
||||||
|
});
|
||||||
|
if resistant { 0.5 } else { 0.0 }
|
||||||
|
};
|
||||||
|
let from_stats = if let Some(stats) = stats {
|
||||||
|
stats.poise_reduction
|
||||||
|
} else {
|
||||||
|
0.0
|
||||||
|
};
|
||||||
|
1.0 - (1.0 - from_inventory) * (1.0 - from_char) * (1.0 - from_stats)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Modifies a poise change when optionally given an inventory to aid in
|
/// Modifies a poise change when optionally given an inventory and character
|
||||||
/// calculation of poise damage reduction
|
/// state to aid in calculation of poise damage reduction
|
||||||
pub fn apply_poise_reduction(
|
pub fn apply_poise_reduction(
|
||||||
value: f32,
|
value: f32,
|
||||||
inventory: Option<&Inventory>,
|
inventory: Option<&Inventory>,
|
||||||
msm: &MaterialStatManifest,
|
msm: &MaterialStatManifest,
|
||||||
|
char_state: Option<&CharacterState>,
|
||||||
|
stats: Option<&Stats>,
|
||||||
) -> f32 {
|
) -> f32 {
|
||||||
inventory.map_or(value, |inv| {
|
value * (1.0 - Poise::compute_poise_damage_reduction(inventory, msm, char_state, stats))
|
||||||
value * (1.0 - Poise::compute_poise_damage_reduction(inv, msm))
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ impl Error for StatChangeError {}
|
|||||||
pub struct Stats {
|
pub struct Stats {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub damage_reduction: f32,
|
pub damage_reduction: f32,
|
||||||
|
pub poise_reduction: f32,
|
||||||
pub max_health_modifiers: StatsModifier,
|
pub max_health_modifiers: StatsModifier,
|
||||||
pub move_speed_modifier: f32,
|
pub move_speed_modifier: f32,
|
||||||
pub attack_speed_modifier: f32,
|
pub attack_speed_modifier: f32,
|
||||||
@ -61,6 +62,7 @@ impl Stats {
|
|||||||
Self {
|
Self {
|
||||||
name,
|
name,
|
||||||
damage_reduction: 0.0,
|
damage_reduction: 0.0,
|
||||||
|
poise_reduction: 0.0,
|
||||||
max_health_modifiers: StatsModifier::default(),
|
max_health_modifiers: StatsModifier::default(),
|
||||||
move_speed_modifier: 1.0,
|
move_speed_modifier: 1.0,
|
||||||
attack_speed_modifier: 1.0,
|
attack_speed_modifier: 1.0,
|
||||||
@ -76,6 +78,7 @@ impl Stats {
|
|||||||
/// Resets temporary modifiers to default values
|
/// Resets temporary modifiers to default values
|
||||||
pub fn reset_temp_modifiers(&mut self) {
|
pub fn reset_temp_modifiers(&mut self) {
|
||||||
self.damage_reduction = 0.0;
|
self.damage_reduction = 0.0;
|
||||||
|
self.poise_reduction = 0.0;
|
||||||
self.max_health_modifiers = StatsModifier::default();
|
self.max_health_modifiers = StatsModifier::default();
|
||||||
self.move_speed_modifier = 1.0;
|
self.move_speed_modifier = 1.0;
|
||||||
self.attack_speed_modifier = 1.0;
|
self.attack_speed_modifier = 1.0;
|
||||||
|
@ -414,10 +414,8 @@ pub fn handle_forced_movement(
|
|||||||
// FRIC_GROUND temporarily used to normalize things around expected values
|
// FRIC_GROUND temporarily used to normalize things around expected values
|
||||||
data.body.base_accel() * block.get_traction() * block.get_friction() / FRIC_GROUND
|
data.body.base_accel() * block.get_traction() * block.get_friction() / FRIC_GROUND
|
||||||
}) {
|
}) {
|
||||||
update.vel.0 += Vec2::broadcast(data.dt.0)
|
update.vel.0 +=
|
||||||
* accel
|
Vec2::broadcast(data.dt.0) * accel * Vec2::from(update.ori) * strength;
|
||||||
* Vec2::from(update.ori)
|
|
||||||
* strength;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ForcedMovement::Reverse(strength) => {
|
ForcedMovement::Reverse(strength) => {
|
||||||
|
@ -466,6 +466,9 @@ fn execute_effect(
|
|||||||
BuffEffect::GroundFriction(gf) => {
|
BuffEffect::GroundFriction(gf) => {
|
||||||
stat.friction_modifier *= *gf;
|
stat.friction_modifier *= *gf;
|
||||||
},
|
},
|
||||||
|
BuffEffect::PoiseReduction(pr) => {
|
||||||
|
stat.poise_reduction = stat.poise_reduction.max(*pr).min(1.0);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -552,6 +552,7 @@ pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3<f32>)
|
|||||||
let falldmg = impact_energy / 1000.0;
|
let falldmg = impact_energy / 1000.0;
|
||||||
|
|
||||||
let inventories = ecs.read_storage::<Inventory>();
|
let inventories = ecs.read_storage::<Inventory>();
|
||||||
|
let char_states = ecs.read_storage::<CharacterState>();
|
||||||
let stats = ecs.read_storage::<Stats>();
|
let stats = ecs.read_storage::<Stats>();
|
||||||
let time = ecs.read_resource::<Time>();
|
let time = ecs.read_resource::<Time>();
|
||||||
let msm = ecs.read_resource::<MaterialStatManifest>();
|
let msm = ecs.read_resource::<MaterialStatManifest>();
|
||||||
@ -583,8 +584,13 @@ pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3<f32>)
|
|||||||
|
|
||||||
// Emit poise change
|
// Emit poise change
|
||||||
let poise_damage = -(mass.0 * vel.magnitude_squared() / 1500.0);
|
let poise_damage = -(mass.0 * vel.magnitude_squared() / 1500.0);
|
||||||
let poise_change =
|
let poise_change = Poise::apply_poise_reduction(
|
||||||
Poise::apply_poise_reduction(poise_damage, inventories.get(entity), &msm);
|
poise_damage,
|
||||||
|
inventories.get(entity),
|
||||||
|
&msm,
|
||||||
|
char_states.get(entity),
|
||||||
|
stats.get(entity),
|
||||||
|
);
|
||||||
let poise_change = comp::PoiseChange {
|
let poise_change = comp::PoiseChange {
|
||||||
amount: poise_change,
|
amount: poise_change,
|
||||||
impulse: Vec3::unit_z(),
|
impulse: Vec3::unit_z(),
|
||||||
|
@ -183,7 +183,16 @@ impl StateExt for State {
|
|||||||
},
|
},
|
||||||
Effect::Poise(poise) => {
|
Effect::Poise(poise) => {
|
||||||
let inventories = self.ecs().read_storage::<Inventory>();
|
let inventories = self.ecs().read_storage::<Inventory>();
|
||||||
let change = Poise::apply_poise_reduction(poise, inventories.get(entity), &msm);
|
let char_states = self.ecs().read_storage::<comp::CharacterState>();
|
||||||
|
let stats = self.ecs().read_storage::<comp::Stats>();
|
||||||
|
|
||||||
|
let change = Poise::apply_poise_reduction(
|
||||||
|
poise,
|
||||||
|
inventories.get(entity),
|
||||||
|
&msm,
|
||||||
|
char_states.get(entity),
|
||||||
|
stats.get(entity),
|
||||||
|
);
|
||||||
// Check to make sure the entity is not already stunned
|
// Check to make sure the entity is not already stunned
|
||||||
if let Some(character_state) = self
|
if let Some(character_state) = self
|
||||||
.ecs()
|
.ecs()
|
||||||
|
@ -101,7 +101,8 @@ pub fn localize_chat_message(
|
|||||||
| BuffKind::Invulnerability
|
| BuffKind::Invulnerability
|
||||||
| BuffKind::ProtectingWard
|
| BuffKind::ProtectingWard
|
||||||
| BuffKind::Frenzied
|
| BuffKind::Frenzied
|
||||||
| BuffKind::Hastened => {
|
| BuffKind::Hastened
|
||||||
|
| BuffKind::Fortitude => {
|
||||||
tracing::error!("Player was killed by a positive buff!");
|
tracing::error!("Player was killed by a positive buff!");
|
||||||
"hud-outcome-mysterious"
|
"hud-outcome-mysterious"
|
||||||
},
|
},
|
||||||
|
@ -956,7 +956,13 @@ impl<'a> Widget for Bag<'a> {
|
|||||||
let combat_rating_txt = format!("{}", (combat_rating * 10.0) as usize);
|
let combat_rating_txt = format!("{}", (combat_rating * 10.0) as usize);
|
||||||
let stun_res_txt = format!(
|
let stun_res_txt = format!(
|
||||||
"{}",
|
"{}",
|
||||||
(100.0 * Poise::compute_poise_damage_reduction(inventory, self.msm)) as i32
|
(100.0
|
||||||
|
* Poise::compute_poise_damage_reduction(
|
||||||
|
Some(inventory),
|
||||||
|
self.msm,
|
||||||
|
None,
|
||||||
|
None
|
||||||
|
)) as i32
|
||||||
);
|
);
|
||||||
let stealth_txt = format!(
|
let stealth_txt = format!(
|
||||||
"{:.1}%",
|
"{:.1}%",
|
||||||
|
@ -1190,8 +1190,12 @@ impl<'a> Widget for Diary<'a> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Stun-Resistance" => {
|
"Stun-Resistance" => {
|
||||||
let stun_res =
|
let stun_res = Poise::compute_poise_damage_reduction(
|
||||||
Poise::compute_poise_damage_reduction(self.inventory, self.msm);
|
Some(self.inventory),
|
||||||
|
self.msm,
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
);
|
||||||
format!("{:.2}%", stun_res * 100.0)
|
format!("{:.2}%", stun_res * 100.0)
|
||||||
},
|
},
|
||||||
"Crit-Power" => {
|
"Crit-Power" => {
|
||||||
|
@ -4608,17 +4608,19 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id {
|
|||||||
BuffKind::IncreaseMaxHealth { .. } => imgs.buff_healthplus_0,
|
BuffKind::IncreaseMaxHealth { .. } => imgs.buff_healthplus_0,
|
||||||
BuffKind::Invulnerability => imgs.buff_invincibility_0,
|
BuffKind::Invulnerability => imgs.buff_invincibility_0,
|
||||||
BuffKind::ProtectingWard => imgs.buff_dmg_red_0,
|
BuffKind::ProtectingWard => imgs.buff_dmg_red_0,
|
||||||
BuffKind::Frenzied { .. } => imgs.buff_frenzy_0,
|
BuffKind::Frenzied => imgs.buff_frenzy_0,
|
||||||
BuffKind::Hastened { .. } => imgs.buff_haste_0,
|
BuffKind::Hastened => imgs.buff_haste_0,
|
||||||
|
// TODO: Get unique icon
|
||||||
|
BuffKind::Fortitude => imgs.buff_dmg_red_0,
|
||||||
// Debuffs
|
// Debuffs
|
||||||
BuffKind::Bleeding { .. } => imgs.debuff_bleed_0,
|
BuffKind::Bleeding => imgs.debuff_bleed_0,
|
||||||
BuffKind::Cursed { .. } => imgs.debuff_skull_0,
|
BuffKind::Cursed => imgs.debuff_skull_0,
|
||||||
BuffKind::Burning { .. } => imgs.debuff_burning_0,
|
BuffKind::Burning => imgs.debuff_burning_0,
|
||||||
BuffKind::Crippled { .. } => imgs.debuff_crippled_0,
|
BuffKind::Crippled => imgs.debuff_crippled_0,
|
||||||
BuffKind::Frozen { .. } => imgs.debuff_frozen_0,
|
BuffKind::Frozen => imgs.debuff_frozen_0,
|
||||||
BuffKind::Wet { .. } => imgs.debuff_wet_0,
|
BuffKind::Wet => imgs.debuff_wet_0,
|
||||||
BuffKind::Ensnared { .. } => imgs.debuff_ensnared_0,
|
BuffKind::Ensnared => imgs.debuff_ensnared_0,
|
||||||
BuffKind::Poisoned { .. } => imgs.debuff_poisoned_0,
|
BuffKind::Poisoned => imgs.debuff_poisoned_0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4640,6 +4642,7 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> Cow<s
|
|||||||
BuffKind::ProtectingWard => localized_strings.get_msg("buff-title-protectingward"),
|
BuffKind::ProtectingWard => localized_strings.get_msg("buff-title-protectingward"),
|
||||||
BuffKind::Frenzied => localized_strings.get_msg("buff-title-frenzied"),
|
BuffKind::Frenzied => localized_strings.get_msg("buff-title-frenzied"),
|
||||||
BuffKind::Hastened => localized_strings.get_msg("buff-title-hastened"),
|
BuffKind::Hastened => localized_strings.get_msg("buff-title-hastened"),
|
||||||
|
BuffKind::Fortitude => localized_strings.get_msg("buff-title-fortitude"),
|
||||||
// Debuffs
|
// Debuffs
|
||||||
BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-title-bleed"),
|
BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-title-bleed"),
|
||||||
BuffKind::Cursed { .. } => localized_strings.get_msg("buff-title-cursed"),
|
BuffKind::Cursed { .. } => localized_strings.get_msg("buff-title-cursed"),
|
||||||
@ -4674,6 +4677,7 @@ pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localiz
|
|||||||
BuffKind::ProtectingWard => localized_strings.get_msg("buff-desc-protectingward"),
|
BuffKind::ProtectingWard => localized_strings.get_msg("buff-desc-protectingward"),
|
||||||
BuffKind::Frenzied => localized_strings.get_msg("buff-desc-frenzied"),
|
BuffKind::Frenzied => localized_strings.get_msg("buff-desc-frenzied"),
|
||||||
BuffKind::Hastened => localized_strings.get_msg("buff-desc-hastened"),
|
BuffKind::Hastened => localized_strings.get_msg("buff-desc-hastened"),
|
||||||
|
BuffKind::Fortitude => localized_strings.get_msg("buff-desc-fortitude"),
|
||||||
// Debuffs
|
// Debuffs
|
||||||
BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-desc-bleed"),
|
BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-desc-bleed"),
|
||||||
BuffKind::Cursed { .. } => localized_strings.get_msg("buff-desc-cursed"),
|
BuffKind::Cursed { .. } => localized_strings.get_msg("buff-desc-cursed"),
|
||||||
|
@ -183,7 +183,8 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> Vec<String> {
|
|||||||
| BuffKind::Wet
|
| BuffKind::Wet
|
||||||
| BuffKind::Ensnared
|
| BuffKind::Ensnared
|
||||||
| BuffKind::Poisoned
|
| BuffKind::Poisoned
|
||||||
| BuffKind::Hastened => Cow::Borrowed(""),
|
| BuffKind::Hastened
|
||||||
|
| BuffKind::Fortitude => Cow::Borrowed(""),
|
||||||
};
|
};
|
||||||
|
|
||||||
write!(&mut description, "{}", buff_desc).unwrap();
|
write!(&mut description, "{}", buff_desc).unwrap();
|
||||||
@ -213,7 +214,8 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> Vec<String> {
|
|||||||
| BuffKind::Wet
|
| BuffKind::Wet
|
||||||
| BuffKind::Ensnared
|
| BuffKind::Ensnared
|
||||||
| BuffKind::Poisoned
|
| BuffKind::Poisoned
|
||||||
| BuffKind::Hastened => Cow::Borrowed(""),
|
| BuffKind::Hastened
|
||||||
|
| BuffKind::Fortitude => Cow::Borrowed(""),
|
||||||
}
|
}
|
||||||
} else if let BuffKind::Saturation | BuffKind::Regeneration | BuffKind::EnergyRegen =
|
} else if let BuffKind::Saturation | BuffKind::Regeneration | BuffKind::EnergyRegen =
|
||||||
buff.kind
|
buff.kind
|
||||||
|
Loading…
Reference in New Issue
Block a user