Disease Tweaks (#7136)

This commit is contained in:
Rane
2022-03-20 18:29:12 -04:00
committed by GitHub
parent 41f77e6889
commit 1759bf509b
6 changed files with 23 additions and 15 deletions

View File

@@ -1,6 +1,8 @@
using Content.Shared.Disease;
using Content.Shared.FixedPoint;
using Content.Shared.Chemistry.Reagent;
using Content.Server.Body.Components;
using Robust.Shared.Prototypes;
namespace Content.Server.Disease.Cures
{
@@ -30,9 +32,10 @@ namespace Content.Server.Disease.Cures
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 (Loc.GetString("diagnoser-cure-reagent", ("units", Min), ("reagent", Reagent)));
return (Loc.GetString("diagnoser-cure-reagent", ("units", Min), ("reagent", reagentProt.Name)));
}
}
}

View File

@@ -3,6 +3,7 @@ using Content.Server.Chat.Managers;
using Content.Server.Disease.Components;
using Content.Server.Disease;
using Content.Shared.Disease;
using Content.Shared.MobState.Components;
using Robust.Shared.Random;
using Robust.Shared.Prototypes;
@@ -32,16 +33,21 @@ public sealed class DiseaseOutbreak : StationEvent
public override float Weight => WeightNormal;
protected override float EndAfter => 1.0f;
/// <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.
/// They all get the same disease.
/// </summary>
public override void Startup()
{
base.Startup();
var targetList = _entityManager.EntityQuery<DiseaseCarrierComponent>().ToList();
_random.Shuffle(targetList);
List<DiseaseCarrierComponent> aliveList = new();
foreach (var (carrier, mobState) in _entityManager.EntityQuery<DiseaseCarrierComponent, MobStateComponent>())
{
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);
@@ -51,8 +57,8 @@ public sealed class DiseaseOutbreak : StationEvent
return;
var diseaseSystem = EntitySystem.Get<DiseaseSystem>();
foreach (var target in targetList)
/// Now we give it to people in the list of living disease carriers earlier
foreach (var target in aliveList)
{
if (toInfect-- == 0)
break;

View File

@@ -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-infectious = Infectious: [color=red]Yes[/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-low = Medication Resistance: [color=yellow]Low[/color]
diagnoser-disease-report-cureresist-medium = Medication Resistance: [color=orange]Medium[/color]
diagnoser-disease-report-cureresist-high = Medication Resistance: [color=red]High[/color]
diagnoser-disease-report-cureresist-none = Spaceacillin Resistance: [color=green]None[/color]
diagnoser-disease-report-cureresist-low = Spaceacillin Resistance: [color=yellow]Low[/color]
diagnoser-disease-report-cureresist-medium = Spaceacillin Resistance: [color=orange]Medium[/color]
diagnoser-disease-report-cureresist-high = Spaceacillin Resistance: [color=red]High[/color]
diagnoser-cure-none = The disease has no specific cures.
diagnoser-cure-has = The disease has the following cures:
diagnoser-cure-bedrest = Rest in bed for {$time} seconds.

View File

@@ -135,4 +135,3 @@
min: 420 ## Reachable with a flamer
- !type:DiseaseReagentCure
reagent: Theobromine
amount: 10

View File

@@ -19,7 +19,7 @@
parent: BaseItem
id: 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:
- type: Item
size: 3

View File

@@ -276,7 +276,7 @@
- type: reagent
id: BananaHonk
name: banana mama
name: banana honk
parent: BaseAlcohol
desc: A drink from Clown Heaven.
physicalDesc: strong-smelling