Disease Tweaks (#7136)
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
using Content.Shared.Disease;
|
using Content.Shared.Disease;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
|
using Content.Shared.Chemistry.Reagent;
|
||||||
using Content.Server.Body.Components;
|
using Content.Server.Body.Components;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Server.Disease.Cures
|
namespace Content.Server.Disease.Cures
|
||||||
{
|
{
|
||||||
@@ -30,9 +32,10 @@ namespace Content.Server.Disease.Cures
|
|||||||
|
|
||||||
public override string CureText()
|
public override string CureText()
|
||||||
{
|
{
|
||||||
if (Reagent == null)
|
var prototypeMan = IoCManager.Resolve<IPrototypeManager>();
|
||||||
|
if (Reagent == null || !prototypeMan.TryIndex<ReagentPrototype>(Reagent, out var reagentProt))
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
return (Loc.GetString("diagnoser-cure-reagent", ("units", Min), ("reagent", Reagent)));
|
return (Loc.GetString("diagnoser-cure-reagent", ("units", Min), ("reagent", reagentProt.Name)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Content.Server.Chat.Managers;
|
|||||||
using Content.Server.Disease.Components;
|
using Content.Server.Disease.Components;
|
||||||
using Content.Server.Disease;
|
using Content.Server.Disease;
|
||||||
using Content.Shared.Disease;
|
using Content.Shared.Disease;
|
||||||
|
using Content.Shared.MobState.Components;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
@@ -32,16 +33,21 @@ public sealed class DiseaseOutbreak : StationEvent
|
|||||||
public override float Weight => WeightNormal;
|
public override float Weight => WeightNormal;
|
||||||
protected override float EndAfter => 1.0f;
|
protected override float EndAfter => 1.0f;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds 2-5 random entities that can host diseases
|
/// Finds 2-5 random, alive entities that can host diseases
|
||||||
/// and gives them a randomly selected disease.
|
/// and gives them a randomly selected disease.
|
||||||
/// They all get the same disease.
|
/// They all get the same disease.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Startup()
|
public override void Startup()
|
||||||
{
|
{
|
||||||
base.Startup();
|
base.Startup();
|
||||||
|
List<DiseaseCarrierComponent> aliveList = new();
|
||||||
var targetList = _entityManager.EntityQuery<DiseaseCarrierComponent>().ToList();
|
foreach (var (carrier, mobState) in _entityManager.EntityQuery<DiseaseCarrierComponent, MobStateComponent>())
|
||||||
_random.Shuffle(targetList);
|
{
|
||||||
|
if (!mobState.IsDead())
|
||||||
|
aliveList.Add(carrier);
|
||||||
|
}
|
||||||
|
_random.Shuffle(aliveList);
|
||||||
|
/// We're going to filter the above out to only alive mobs. Might change after future mobstate rework
|
||||||
|
|
||||||
var toInfect = _random.Next(2, 5);
|
var toInfect = _random.Next(2, 5);
|
||||||
|
|
||||||
@@ -51,8 +57,8 @@ public sealed class DiseaseOutbreak : StationEvent
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var diseaseSystem = EntitySystem.Get<DiseaseSystem>();
|
var diseaseSystem = EntitySystem.Get<DiseaseSystem>();
|
||||||
|
/// Now we give it to people in the list of living disease carriers earlier
|
||||||
foreach (var target in targetList)
|
foreach (var target in aliveList)
|
||||||
{
|
{
|
||||||
if (toInfect-- == 0)
|
if (toInfect-- == 0)
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ diagnoser-disease-report-none-contents = [color=green]No diseases were found in
|
|||||||
diagnoser-disease-report-name = Disease Name: {CAPITALIZE($disease)}
|
diagnoser-disease-report-name = Disease Name: {CAPITALIZE($disease)}
|
||||||
diagnoser-disease-report-infectious = Infectious: [color=red]Yes[/color]
|
diagnoser-disease-report-infectious = Infectious: [color=red]Yes[/color]
|
||||||
diagnoser-disease-report-not-infectious = Infectious: [color=green]No[/color]
|
diagnoser-disease-report-not-infectious = Infectious: [color=green]No[/color]
|
||||||
diagnoser-disease-report-cureresist-none = Medication Resistance: [color=green]None[/color]
|
diagnoser-disease-report-cureresist-none = Spaceacillin Resistance: [color=green]None[/color]
|
||||||
diagnoser-disease-report-cureresist-low = Medication Resistance: [color=yellow]Low[/color]
|
diagnoser-disease-report-cureresist-low = Spaceacillin Resistance: [color=yellow]Low[/color]
|
||||||
diagnoser-disease-report-cureresist-medium = Medication Resistance: [color=orange]Medium[/color]
|
diagnoser-disease-report-cureresist-medium = Spaceacillin Resistance: [color=orange]Medium[/color]
|
||||||
diagnoser-disease-report-cureresist-high = Medication Resistance: [color=red]High[/color]
|
diagnoser-disease-report-cureresist-high = Spaceacillin Resistance: [color=red]High[/color]
|
||||||
diagnoser-cure-none = The disease has no specific cures.
|
diagnoser-cure-none = The disease has no specific cures.
|
||||||
diagnoser-cure-has = The disease has the following cures:
|
diagnoser-cure-has = The disease has the following cures:
|
||||||
diagnoser-cure-bedrest = Rest in bed for {$time} seconds.
|
diagnoser-cure-bedrest = Rest in bed for {$time} seconds.
|
||||||
|
|||||||
@@ -135,4 +135,3 @@
|
|||||||
min: 420 ## Reachable with a flamer
|
min: 420 ## Reachable with a flamer
|
||||||
- !type:DiseaseReagentCure
|
- !type:DiseaseReagentCure
|
||||||
reagent: Theobromine
|
reagent: Theobromine
|
||||||
amount: 10
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
parent: BaseItem
|
parent: BaseItem
|
||||||
id: Vaccine
|
id: Vaccine
|
||||||
name: Vaccine
|
name: Vaccine
|
||||||
description: There's no way you don't already have an opinion on these.
|
description: Prevents people who DON'T already have a disease from catching it.
|
||||||
components:
|
components:
|
||||||
- type: Item
|
- type: Item
|
||||||
size: 3
|
size: 3
|
||||||
|
|||||||
@@ -276,7 +276,7 @@
|
|||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: BananaHonk
|
id: BananaHonk
|
||||||
name: banana mama
|
name: banana honk
|
||||||
parent: BaseAlcohol
|
parent: BaseAlcohol
|
||||||
desc: A drink from Clown Heaven.
|
desc: A drink from Clown Heaven.
|
||||||
physicalDesc: strong-smelling
|
physicalDesc: strong-smelling
|
||||||
|
|||||||
Reference in New Issue
Block a user