mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Handled health change over time buff effect better.
This commit is contained in:
parent
5a5d35fade
commit
fdf8decb18
@ -61,8 +61,12 @@ impl<'a> System<'a> for Sys {
|
||||
// Only add an effect here if it is continuous or it is not immediate
|
||||
BuffEffect::HealthChangeOverTime { rate, accumulated } => {
|
||||
*accumulated += *rate * buff_delta;
|
||||
// Apply only 0.5 or higher damage
|
||||
if accumulated.abs() > 50.0 {
|
||||
// Apply damage only once a second (with a minimum of 1 damage), or when a buff is removed
|
||||
if accumulated.abs() > rate.abs().max(10.0)
|
||||
|| active_buff_indices_for_removal
|
||||
.iter()
|
||||
.any(|index| *index == i)
|
||||
{
|
||||
let cause = if *accumulated > 0.0 {
|
||||
HealthSource::Healing { by: buff_owner }
|
||||
} else {
|
||||
|
@ -167,7 +167,7 @@ impl<'a> System<'a> for Sys {
|
||||
uid: *uid_b,
|
||||
buff_change: buff::BuffChange::Add(buff::Buff::new(
|
||||
buff::BuffId::Regeneration {
|
||||
strength: 100.0,
|
||||
strength: 1.0,
|
||||
duration: Some(Duration::from_secs(60)),
|
||||
},
|
||||
vec![buff::BuffCategoryId::Physical, buff::BuffCategoryId::Buff],
|
||||
|
@ -76,6 +76,7 @@ impl<'a> System<'a> for Sys {
|
||||
| HealthSource::Projectile { owner: Some(by) }
|
||||
| HealthSource::Energy { owner: Some(by) }
|
||||
| HealthSource::Explosion { owner: Some(by) }
|
||||
| HealthSource::Buff { owner: Some(by) }
|
||||
| HealthSource::Healing { by: Some(by) } => {
|
||||
let by_me = my_uid.map_or(false, |&uid| by == uid);
|
||||
// If the attack was by me also reset this timer
|
||||
|
Loading…
Reference in New Issue
Block a user