Disease stages (#8405)

* Added the stages , time to implelement them

* adjusted the zombie code to fit within the new staged system

* because I forgot it starts at 0

* mmmm Mistaken

* Removed unused comp

* removed DiseaseBuildup comp from IgnoredComponents.cs

* Resolved review

* Delete IgnoredComponents.cs

* Resolved review

* resolved review

Co-authored-by: wrexbe <81056464+wrexbe@users.noreply.github.com>
Co-authored-by: wrexbe <wrexbe@protonmail.com>
This commit is contained in:
Ripmorld
2022-06-23 04:41:17 +08:00
committed by GitHub
parent dab63cbc1e
commit 13b208a5f1
4 changed files with 69 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
using JetBrains.Annotations;
using Robust.Shared.Utility;
namespace Content.Shared.Disease
{
@@ -15,6 +16,38 @@ namespace Content.Shared.Disease
/// What effect the disease will have.
/// </summary>
public abstract void Effect(DiseaseEffectArgs args);
/// <summary>
/// What is the minimal severity needed for this effect to occur?
/// </summary>
[DataField("minSeverity")]
public float MinSeverity
{
get => _minSeverity;
set
{
DebugTools.Assert(value > 1f || value < 0f ,"MinSeverity have been attempted to be set out of range");
_minSeverity = Math.Clamp(value, 0.0f, 1.0f);
}
}
private float _minSeverity = 0.0f;
/// <summary>
/// What is the maximum severity that this effect can occur?
/// </summary>
[DataField("maxSeverity")]
public float MaxSeverity
{
get => _maxSeverity;
set
{
DebugTools.Assert(value > 1f || value < 0f ,"MaxSeverity have been attempted to be set out of range");
_maxSeverity = Math.Clamp(value, 0.0f, 1.0f);
}
}
private float _maxSeverity = 1.0f;
}
/// <summary>
/// What you have to work with in any disease effect/cure.

View File

@@ -36,6 +36,17 @@ namespace Content.Shared.Disease
/// it needs something to control its tickrate
/// </summary>
public float Accumulator = 0f;
/// <summary>
/// This controls the progression of the disease, used to stage disease effects
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float DiseaseSeverity
{
get => _diseaseServerity;
set => _diseaseServerity = Math.Clamp(value, 0f, 1f);
}
private float _diseaseServerity = 0f;
/// <summary>
/// List of effects the disease has that will
/// run every second (by default anyway)