Rolling now dodges melee attacks again.

This commit is contained in:
Sam 2021-01-27 20:54:45 -05:00
parent 78879d5189
commit 18aa315f0d
2 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,7 @@ impl Attack {
self
}
#[allow(clippy::too_many_arguments)]
pub fn apply_attack(
&self,
target_group: GroupTarget,
@ -72,6 +73,7 @@ impl Attack {
inventory: Option<&Inventory>,
attacker_uid: Uid,
dir: Dir,
target_dodging: bool,
) -> Vec<ServerEvent> {
let is_crit = thread_rng().gen::<f32>() < self.crit_chance;
let mut accumulated_damage = 0.0;
@ -80,6 +82,7 @@ impl Attack {
.damages
.iter()
.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(
inventory,

View File

@ -134,6 +134,7 @@ impl<'a> System<'a> for Sys {
inventory_b_maybe,
*uid,
dir,
is_dodge,
);
if !server_events.is_empty() {