mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add Constant for damage fade
Former-commit-id: 4b0e2ff6249ebcf814b036ba11c57ad094811e30
This commit is contained in:
parent
73f29e3716
commit
525af4c201
@ -30,6 +30,8 @@ use specs::{Component, Entity as EcsEntity, Join, VecStorage};
|
||||
use std::{collections::HashMap, f32};
|
||||
use vek::*;
|
||||
|
||||
const DAMAGE_FADE_COEFFICIENT: f64 = 5.0;
|
||||
|
||||
pub struct FigureModelCache {
|
||||
models: HashMap<Body, (Model<FigurePipeline>, u64)>,
|
||||
}
|
||||
@ -364,7 +366,7 @@ impl FigureMgr {
|
||||
.and_then(|stats| stats.hp.last_change)
|
||||
.map(|(change_by, time)| {
|
||||
Rgba::broadcast(1.0)
|
||||
+ Rgba::new(0.0, -1.0, -1.0, 0.0).map(|c| (c / (1.0 + 5.0 * time)) as f32)
|
||||
+ Rgba::new(0.0, -1.0, -1.0, 0.0).map(|c| (c / (1.0 + DAMAGE_FADE_COEFFICIENT * time)) as f32)
|
||||
})
|
||||
.unwrap_or(Rgba::broadcast(1.0));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user