Diseases (#7057)
* Disease system first pass * Renamed HealthChange * First working version of diseases (wtf???) * Fix the cursed yaml initialization * Pop-Up effect * Generic status effect * Create copy of prototype * CureDiseaseEffect * Disease resistance * Spaceacillin * Nerf spaceacillin now that we know it works * Sneezing, Coughing, Snoughing * Fix queuing, prevent future issues * Disease protection * Disease outbreak event * Disease Reagent Cure * Chem cause disease effect * Disease artifacts * Try infect when interacting with diseased * Diseases don't have to be infectious * Talking without a mask does a snough * Temperature cure * Bedrest * DiseaseAdjustReagent * Tweak how disease statuses work to be a bit less shit * A few more diseases * Natural immunity (can't get the same disease twice) * Polished up some diseases, touched up spaceacillin production * Rebalanced transmission * Edit a few diseases, make disease cures support a minimum value * Nitrile gloves, more disease protection sources * Health scanner shows diseased status * Clean up disease system * Traitor item * Mouth swabs * Disease diagnoser machine * Support for clean samples * Vaccines + fixes * Pass on disease resistant clothes * More work on non-infectious diseases & vaccines * Handle dead bodies * Added the relatively CBT visualizer * Pass over diseases and their populators * Comment stuff * Readability cleanup * Add printing sound to diagnoser, fix printing bug * vaccinator sound, seal up some classes * Make disease protection equip detection not shit (thanks whoever wrote addaccentcomponent) * Mirror review * More review stuff * More mirror review stuff * Refactor snoughing * Redid report creator * Fix snough messages, new vaccinator sound * Mirror review naming * Woops, forgot the artifact * Add recipes and fills * Rebalance space cold and robovirus * Give lizarb disease interaction stuff * Tweak some stuff and move things around * Add diseases to mice (since animal vectors are interesting and can be used to make vaccines) * Remove unused reagent
This commit is contained in:
36
Content.Server/Disease/Components/DiseaseCarrierComponent.cs
Normal file
36
Content.Server/Disease/Components/DiseaseCarrierComponent.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Disease;
|
||||
|
||||
namespace Content.Server.Disease.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
/// <summary>
|
||||
/// Allows the enity to be infected with diseases.
|
||||
/// Please use only on mobs.
|
||||
/// </summary>
|
||||
public sealed class DiseaseCarrierComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows the CURRENT diseases on the carrier
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public List<DiseasePrototype> Diseases = new();
|
||||
/// <summary>
|
||||
/// The carrier's resistance to disease
|
||||
/// </summary>
|
||||
[DataField("diseaseResist")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float DiseaseResist = 0f;
|
||||
/// <summary>
|
||||
/// Diseases the carrier has had, used for immunity.
|
||||
/// <summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public List<DiseasePrototype> PastDiseases = new();
|
||||
/// <summary>
|
||||
/// All the diseases the carrier has or has had.
|
||||
/// Checked against when trying to add a disease
|
||||
/// <summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public List<DiseasePrototype> AllDiseases => PastDiseases.Concat(Diseases).ToList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Content.Server.Disease.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// To give the disease diagnosing machine specific behavior
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class DiseaseDiagnoserComponent : Component
|
||||
{}
|
||||
}
|
||||
31
Content.Server/Disease/Components/DiseaseMachineComponent.cs
Normal file
31
Content.Server/Disease/Components/DiseaseMachineComponent.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Content.Shared.Disease;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Disease.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
/// <summary>
|
||||
/// For shared behavior between both disease machines
|
||||
/// </summary>
|
||||
public sealed class DiseaseMachineComponent : Component
|
||||
{
|
||||
[DataField("delay")]
|
||||
public float Delay = 5f;
|
||||
/// <summary>
|
||||
/// How much time we've accumulated processing
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public float Accumulator = 0f;
|
||||
/// <summary>
|
||||
/// The disease prototype currently being diagnosed
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public DiseasePrototype? Disease;
|
||||
/// <summary>
|
||||
/// What the machine will spawn
|
||||
/// </summary>
|
||||
[DataField("machineOutput", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>), required: true)]
|
||||
public string MachineOutput = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Content.Server.Disease.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// For EntityQuery to keep track of which machines are running
|
||||
/// <summary>
|
||||
[RegisterComponent]
|
||||
public sealed class DiseaseMachineRunningComponent : Component
|
||||
{}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace Content.Server.Disease.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Value added to clothing to give its wearer
|
||||
/// protection against infection from diseases
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class DiseaseProtectionComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Float value between 0 and 1, will be subtracted
|
||||
/// from the infection chance (which is base 0.7)
|
||||
/// Reference guide is a full biosuit w/gloves & mask
|
||||
/// should add up to exactly 0.7
|
||||
/// </summary>
|
||||
[DataField("protection")]
|
||||
public float Protection = 0.1f;
|
||||
/// <summary>
|
||||
/// Is the component currently being worn and affecting someone's disease
|
||||
/// resistance? Making the unequip check not totally CBT
|
||||
/// </summary>
|
||||
public bool IsActive = false;
|
||||
}
|
||||
}
|
||||
33
Content.Server/Disease/Components/DiseaseSwabComponent.cs
Normal file
33
Content.Server/Disease/Components/DiseaseSwabComponent.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Threading;
|
||||
using Content.Shared.Disease;
|
||||
|
||||
namespace Content.Server.Disease.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
/// <summary>
|
||||
/// For mouth swabs used to collect and process
|
||||
/// disease samples.
|
||||
/// </summary>
|
||||
public sealed class DiseaseSwabComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// How long it takes to swab someone.
|
||||
/// </summary>
|
||||
[DataField("swabDelay")]
|
||||
[ViewVariables]
|
||||
public float SwabDelay = 2f;
|
||||
/// <summary>
|
||||
/// If this swab has been used
|
||||
/// </summary>
|
||||
public bool Used = false;
|
||||
/// <summary>
|
||||
/// Token for interrupting swabbing do after.
|
||||
/// </summary>
|
||||
public CancellationTokenSource? CancelToken;
|
||||
/// <summary>
|
||||
/// The disease prototype currently on the swab
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public DiseasePrototype? Disease;
|
||||
}
|
||||
}
|
||||
33
Content.Server/Disease/Components/DiseaseVaccineComponent.cs
Normal file
33
Content.Server/Disease/Components/DiseaseVaccineComponent.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Threading;
|
||||
using Content.Shared.Disease;
|
||||
|
||||
namespace Content.Server.Disease.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
/// <summary>
|
||||
/// For disease vaccines
|
||||
/// </summary>
|
||||
public sealed class DiseaseVaccineComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// How long it takes to inject someone
|
||||
/// </summary>
|
||||
[DataField("injectDelay")]
|
||||
[ViewVariables]
|
||||
public float InjectDelay = 2f;
|
||||
/// <summary>
|
||||
/// If this vaccine has been used
|
||||
/// </summary>
|
||||
public bool Used = false;
|
||||
/// <summary>
|
||||
/// Token for interrupting injection do after.
|
||||
/// </summary>
|
||||
public CancellationTokenSource? CancelToken;
|
||||
|
||||
/// <summary>
|
||||
/// The disease prototype currently on the vaccine
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public DiseasePrototype? Disease;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Content.Server.Disease.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Controls disease machine behavior specific to the
|
||||
/// vaccine creating machine
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class DiseaseVaccineCreatorComponent : Component
|
||||
{}
|
||||
}
|
||||
Reference in New Issue
Block a user