Miasma outbreaks give every mob the same disease (#9232)

This commit is contained in:
Rane
2022-07-02 22:25:31 -04:00
committed by GitHub
parent 745c1bf609
commit 87cf078d42
11 changed files with 135 additions and 21 deletions

View File

@@ -7,7 +7,7 @@ using JetBrains.Annotations;
namespace Content.Server.Chemistry.ReagentEffects
{
/// <summary>
/// Default metabolism for medicine reagents.
/// Causes a random disease from a list, if the user is not already diseased.
/// </summary>
[UsedImplicitly]
public sealed class ChemCauseRandomDisease : ReagentEffect

View File

@@ -0,0 +1,23 @@
using Content.Shared.Chemistry.Reagent;
using JetBrains.Annotations;
using Content.Server.Atmos.Miasma;
using Content.Server.Disease;
namespace Content.Server.Chemistry.ReagentEffects
{
/// <summary>
/// The miasma system rotates between 1 disease at a time.
/// This gives all entities the disease the miasme system is currently on.
/// For things ingested by one person, you probably want ChemCauseRandomDisease instead.
/// </summary>
[UsedImplicitly]
public sealed class ChemMiasmaPoolSource : ReagentEffect
{
public override void Effect(ReagentEffectArgs args)
{
string disease = EntitySystem.Get<MiasmaSystem>().RequestPoolDisease();
EntitySystem.Get<DiseaseSystem>().TryAddDisease(args.SolutionEntity, disease);
}
}
}