From dd8a31d2a68d3fbe7dd36e60f837530c0b7bd6c1 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Sat, 25 May 2019 13:35:37 +0200 Subject: [PATCH] Add Constant for damage fade Former-commit-id: 4b0e2ff6249ebcf814b036ba11c57ad094811e30 --- voxygen/src/scene/figure.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 9d2083a51d..09db7596b2 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -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, 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));