From 1759bf509beefae2eb191236543ff70c6fad1078 Mon Sep 17 00:00:00 2001 From: Rane <60792108+Elijahrane@users.noreply.github.com> Date: Sun, 20 Mar 2022 18:29:12 -0400 Subject: [PATCH] Disease Tweaks (#7136) --- .../Disease/Cures/DiseaseReagentCure.cs | 7 +++++-- .../StationEvents/Events/DiseaseOutbreak.cs | 18 ++++++++++++------ Resources/Locale/en-US/disease/diagnoser.ftl | 8 ++++---- Resources/Prototypes/Diseases/infectious.yml | 1 - .../Objects/Specific/Medical/disease.yml | 2 +- .../Reagents/Consumable/Drink/alcohol.yml | 2 +- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Content.Server/Disease/Cures/DiseaseReagentCure.cs b/Content.Server/Disease/Cures/DiseaseReagentCure.cs index 0568252768..37a1a007b4 100644 --- a/Content.Server/Disease/Cures/DiseaseReagentCure.cs +++ b/Content.Server/Disease/Cures/DiseaseReagentCure.cs @@ -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(); + if (Reagent == null || !prototypeMan.TryIndex(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))); } } } diff --git a/Content.Server/StationEvents/Events/DiseaseOutbreak.cs b/Content.Server/StationEvents/Events/DiseaseOutbreak.cs index 9c4d0d422d..94bd8a739a 100644 --- a/Content.Server/StationEvents/Events/DiseaseOutbreak.cs +++ b/Content.Server/StationEvents/Events/DiseaseOutbreak.cs @@ -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; /// - /// 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. /// public override void Startup() { base.Startup(); - - var targetList = _entityManager.EntityQuery().ToList(); - _random.Shuffle(targetList); + List aliveList = new(); + foreach (var (carrier, mobState) in _entityManager.EntityQuery()) + { + 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(); - - 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; diff --git a/Resources/Locale/en-US/disease/diagnoser.ftl b/Resources/Locale/en-US/disease/diagnoser.ftl index 2b451af84a..3d7dddff21 100644 --- a/Resources/Locale/en-US/disease/diagnoser.ftl +++ b/Resources/Locale/en-US/disease/diagnoser.ftl @@ -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. diff --git a/Resources/Prototypes/Diseases/infectious.yml b/Resources/Prototypes/Diseases/infectious.yml index fd1153673d..758cfc9694 100644 --- a/Resources/Prototypes/Diseases/infectious.yml +++ b/Resources/Prototypes/Diseases/infectious.yml @@ -135,4 +135,3 @@ min: 420 ## Reachable with a flamer - !type:DiseaseReagentCure reagent: Theobromine - amount: 10 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/disease.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/disease.yml index f69ca7a911..4626c39e7d 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/disease.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/disease.yml @@ -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 diff --git a/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml b/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml index bfc81c82d8..77c0c1f86d 100644 --- a/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml +++ b/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml @@ -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