Heatstroke VFX

Filling the heatstroke meter now results in a postprocessing filter which increasingly distorts the player's view as they get closer to death.
This commit is contained in:
Reinier Vens 2021-03-06 02:42:19 +00:00
commit 2f088b5590
11 changed files with 183 additions and 26 deletions

View file

@ -27,7 +27,6 @@ public class Cockpit : IBehavior
public BehaviorData Data => _data;
public float Heatstroke { get; private set; }
public Cockpit(ItemManager context, CockpitData data, Entity entity, EquippedItem item)
{
@ -35,22 +34,10 @@ public class Cockpit : IBehavior
_data = data;
Entity = entity;
Item = item;
Heatstroke = 0;
}
public bool Execute(float delta)
{
if (Item.Temperature > Context.GameplaySettings.HeatstrokeTemperature)
{
Heatstroke = saturate(
Heatstroke +
pow(Item.Temperature - Context.GameplaySettings.HeatstrokeTemperature, Context.GameplaySettings.HeatstrokeExponent) *
Context.GameplaySettings.HeatstrokeMultiplier * delta);
}
else
{
Heatstroke = saturate(Heatstroke - Context.GameplaySettings.HeatstrokeRecoverySpeed * delta);
}
return Heatstroke < Context.GameplaySettings.HeatstrokeControlLimit;
return true;
}
}