mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Rolling now dodges melee attacks again.
This commit is contained in:
parent
78879d5189
commit
18aa315f0d
@ -64,6 +64,7 @@ impl Attack {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn apply_attack(
|
pub fn apply_attack(
|
||||||
&self,
|
&self,
|
||||||
target_group: GroupTarget,
|
target_group: GroupTarget,
|
||||||
@ -72,6 +73,7 @@ impl Attack {
|
|||||||
inventory: Option<&Inventory>,
|
inventory: Option<&Inventory>,
|
||||||
attacker_uid: Uid,
|
attacker_uid: Uid,
|
||||||
dir: Dir,
|
dir: Dir,
|
||||||
|
target_dodging: bool,
|
||||||
) -> Vec<ServerEvent> {
|
) -> Vec<ServerEvent> {
|
||||||
let is_crit = thread_rng().gen::<f32>() < self.crit_chance;
|
let is_crit = thread_rng().gen::<f32>() < self.crit_chance;
|
||||||
let mut accumulated_damage = 0.0;
|
let mut accumulated_damage = 0.0;
|
||||||
@ -80,6 +82,7 @@ impl Attack {
|
|||||||
.damages
|
.damages
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|d| d.target.map_or(true, |t| t == target_group))
|
.filter(|d| d.target.map_or(true, |t| t == target_group))
|
||||||
|
.filter(|d| !(matches!(d.target, Some(GroupTarget::OutOfGroup)) && target_dodging))
|
||||||
{
|
{
|
||||||
let change = damage.damage.modify_damage(
|
let change = damage.damage.modify_damage(
|
||||||
inventory,
|
inventory,
|
||||||
|
@ -134,6 +134,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
inventory_b_maybe,
|
inventory_b_maybe,
|
||||||
*uid,
|
*uid,
|
||||||
dir,
|
dir,
|
||||||
|
is_dodge,
|
||||||
);
|
);
|
||||||
|
|
||||||
if !server_events.is_empty() {
|
if !server_events.is_empty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user