mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added healing healthsource logic to beam system.
This commit is contained in:
parent
13d9b814ab
commit
18c2b850d3
@ -190,13 +190,12 @@ impl<'a> System<'a> for Sys {
|
||||
}
|
||||
|
||||
if damage.healthchange != 0.0 {
|
||||
let cause = if is_heal { HealthSource::Healing { by: Some(*uid) } } else { HealthSource::Attack { by: *uid } };
|
||||
server_emitter.emit(ServerEvent::Damage {
|
||||
uid: *uid_b,
|
||||
change: HealthChange {
|
||||
amount: damage.healthchange as i32,
|
||||
cause: HealthSource::Attack {
|
||||
by: beam.owner.unwrap_or(*uid),
|
||||
},
|
||||
cause,
|
||||
},
|
||||
});
|
||||
if is_damage && beam.lifesteal_eff > 0.0 {
|
||||
|
@ -533,15 +533,11 @@ pub fn handle_explosion(
|
||||
damage.modify_damage(block, loadout);
|
||||
}
|
||||
|
||||
if damage.healthchange < 0.0 {
|
||||
if damage.healthchange != 0.0 {
|
||||
let cause = if is_heal { HealthSource::Healing { by: owner } } else { HealthSource::Explosion { owner } };
|
||||
stats_b.health.change_by(HealthChange {
|
||||
amount: damage.healthchange as i32,
|
||||
cause: HealthSource::Explosion { owner },
|
||||
});
|
||||
} else if damage.healthchange > 0.0 {
|
||||
stats_b.health.change_by(HealthChange {
|
||||
amount: damage.healthchange as i32,
|
||||
cause: HealthSource::Healing { by: owner },
|
||||
cause,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user