From 0a81038a174880b40dfa2236fe4f68bd304ba41f Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sat, 16 Dec 2023 22:34:13 -0500 Subject: [PATCH] mild reagent prototype cleanup + other misc garbage (#22630) --- .../Tests/Chemistry/SolutionSystemTests.cs | 18 +++--- Content.Server/GuideGenerator/ReagentEntry.cs | 5 +- .../Chemistry/Reagent/ReagentPrototype.cs | 57 ++++++++++--------- .../guidebook/chemistry/statuseffects.ftl | 1 + .../reagents/meta/consumable/drink/drinks.ftl | 5 +- .../reagents/meta/consumable/food/food.ftl | 5 +- .../Locale/en-US/reagents/meta/narcotics.ftl | 4 +- .../Reagents/Consumable/Drink/drinks.yml | 4 +- 8 files changed, 55 insertions(+), 44 deletions(-) diff --git a/Content.IntegrationTests/Tests/Chemistry/SolutionSystemTests.cs b/Content.IntegrationTests/Tests/Chemistry/SolutionSystemTests.cs index 8b489d27fc..064ce46934 100644 --- a/Content.IntegrationTests/Tests/Chemistry/SolutionSystemTests.cs +++ b/Content.IntegrationTests/Tests/Chemistry/SolutionSystemTests.cs @@ -26,22 +26,22 @@ public sealed class SolutionSystemTests - type: reagent id: TestReagentA - name: nah - desc: nah - physicalDesc: nah + name: reagent-name-nothing + desc: reagent-desc-nothing + physicalDesc: reagent-physical-desc-nothing - type: reagent id: TestReagentB - name: nah - desc: nah - physicalDesc: nah + name: reagent-name-nothing + desc: reagent-desc-nothing + physicalDesc: reagent-physical-desc-nothing - type: reagent id: TestReagentC specificHeat: 2.0 - name: nah - desc: nah - physicalDesc: nah + name: reagent-name-nothing + desc: reagent-desc-nothing + physicalDesc: reagent-physical-desc-nothing "; [Test] public async Task TryAddTwoNonReactiveReagent() diff --git a/Content.Server/GuideGenerator/ReagentEntry.cs b/Content.Server/GuideGenerator/ReagentEntry.cs index 7e1444b8a0..5c9ec40fd4 100644 --- a/Content.Server/GuideGenerator/ReagentEntry.cs +++ b/Content.Server/GuideGenerator/ReagentEntry.cs @@ -1,7 +1,10 @@ using System.Linq; using System.Text.Json.Serialization; +using Content.Server.Body.Components; +using Content.Shared.Body.Prototypes; using Content.Shared.Chemistry.Reaction; using Content.Shared.Chemistry.Reagent; +using Robust.Shared.Prototypes; namespace Content.Server.GuideGenerator; @@ -29,7 +32,7 @@ public sealed class ReagentEntry public List Recipes { get; } = new(); [JsonPropertyName("metabolisms")] - public Dictionary? Metabolisms { get; } + public Dictionary, ReagentEffectsEntry>? Metabolisms { get; } public ReagentEntry(ReagentPrototype proto) { diff --git a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs index 0f24a36339..1603d3d647 100644 --- a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs +++ b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs @@ -27,30 +27,30 @@ namespace Content.Shared.Chemistry.Reagent [IdDataField] public string ID { get; private set; } = default!; - [DataField("name", required: true)] - private string Name { get; set; } = default!; + [DataField(required: true)] + private LocId Name { get; set; } [ViewVariables(VVAccess.ReadOnly)] public string LocalizedName => Loc.GetString(Name); - [DataField("group")] + [DataField] public string Group { get; private set; } = "Unknown"; - [ParentDataFieldAttribute(typeof(AbstractPrototypeIdArraySerializer))] + [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; private set; } [NeverPushInheritance] - [AbstractDataFieldAttribute] + [AbstractDataField] public bool Abstract { get; private set; } [DataField("desc", required: true)] - private string Description { get; set; } = default!; + private LocId Description { get; set; } [ViewVariables(VVAccess.ReadOnly)] public string LocalizedDescription => Loc.GetString(Description); [DataField("physicalDesc", required: true)] - private string PhysicalDescription { get; set; } = default!; + private LocId PhysicalDescription { get; set; } = default!; [ViewVariables(VVAccess.ReadOnly)] public string LocalizedPhysicalDescription => Loc.GetString(PhysicalDescription); @@ -58,16 +58,16 @@ namespace Content.Shared.Chemistry.Reagent /// /// Is this reagent recognizable to the average spaceman (water, welding fuel, ketchup, etc)? /// - [DataField("recognizable")] - public bool Recognizable = false; + [DataField] + public bool Recognizable; - [DataField("flavor", customTypeSerializer:typeof(PrototypeIdSerializer))] - public string? Flavor; + [DataField] + public ProtoId? Flavor; /// /// There must be at least this much quantity in a solution to be tasted. /// - [DataField("flavorMinimum")] + [DataField] public FixedPoint2 FlavorMinimum = FixedPoint2.New(0.1f); [DataField("color")] @@ -77,47 +77,48 @@ namespace Content.Shared.Chemistry.Reagent /// The specific heat of the reagent. /// How much energy it takes to heat one unit of this reagent by one Kelvin. /// - [DataField("specificHeat")] + [DataField] public float SpecificHeat { get; private set; } = 1.0f; - [DataField("boilingPoint")] + [DataField] public float? BoilingPoint { get; private set; } - [DataField("meltingPoint")] + [DataField] public float? MeltingPoint { get; private set; } - [DataField("metamorphicSprite")] + [DataField] public SpriteSpecifier? MetamorphicSprite { get; private set; } = null; /// /// If this reagent is part of a puddle is it slippery. /// - [DataField("slippery")] - public bool Slippery = false; + [DataField] + public bool Slippery; /// /// How much reagent slows entities down if it's part of a puddle. /// 0 - no slowdown; 1 - can't move. /// - [DataField("viscosity")] - public float Viscosity = 0; + [DataField] + public float Viscosity; - [DataField("metabolisms", serverOnly: true, customTypeSerializer: typeof(PrototypeIdDictionarySerializer))] - public Dictionary? Metabolisms = null; + [DataField(serverOnly: true)] + public Dictionary, ReagentEffectsEntry>? Metabolisms; - [DataField("reactiveEffects", serverOnly: true, customTypeSerializer: typeof(PrototypeIdDictionarySerializer))] - public Dictionary? ReactiveEffects = null; + [DataField(serverOnly: true)] + public Dictionary, ReactiveReagentEffectEntry>? ReactiveEffects; - [DataField("tileReactions", serverOnly: true)] + [DataField(serverOnly: true)] public List TileReactions = new(0); [DataField("plantMetabolism", serverOnly: true)] public List PlantMetabolisms = new(0); - [DataField("pricePerUnit")] public float PricePerUnit; + [DataField] + public float PricePerUnit; // TODO: Pick the highest reagent for sounds and add sticky to cola, juice, etc. - [DataField("footstepSound")] + [DataField] public SoundSpecifier FootstepSound = new SoundCollectionSpecifier("FootstepWater"); public FixedPoint2 ReactionTile(TileRef tile, FixedPoint2 reactVolume) @@ -171,7 +172,7 @@ namespace Content.Shared.Chemistry.Reagent { public string ReagentPrototype; - public Dictionary? GuideEntries; + public Dictionary, ReagentEffectsGuideEntry>? GuideEntries; public ReagentGuideEntry(ReagentPrototype proto, IPrototypeManager prototype, IEntitySystemManager entSys) { diff --git a/Resources/Locale/en-US/guidebook/chemistry/statuseffects.ftl b/Resources/Locale/en-US/guidebook/chemistry/statuseffects.ftl index f00921b831..3db8a3c5b0 100644 --- a/Resources/Locale/en-US/guidebook/chemistry/statuseffects.ftl +++ b/Resources/Locale/en-US/guidebook/chemistry/statuseffects.ftl @@ -10,3 +10,4 @@ reagent-effect-status-effect-Drunk = drunkness reagent-effect-status-effect-PressureImmunity = pressure immunity reagent-effect-status-effect-Pacified = combat pacification reagent-effect-status-effect-RatvarianLanguage = ratvarian language patterns +reagent-effect-status-effect-StaminaModifier = modified stamina diff --git a/Resources/Locale/en-US/reagents/meta/consumable/drink/drinks.ftl b/Resources/Locale/en-US/reagents/meta/consumable/drink/drinks.ftl index 5153d7f9a0..00091ad9fe 100644 --- a/Resources/Locale/en-US/reagents/meta/consumable/drink/drinks.ftl +++ b/Resources/Locale/en-US/reagents/meta/consumable/drink/drinks.ftl @@ -46,6 +46,9 @@ reagent-desc-nothing = Absolutely nothing. reagent-name-nuclear-cola = nuclear cola reagent-desc-nuclear-cola = Cola, cola never changes. +reagent-name-hot-cocoa = hot cocoa +reagent-desc-hot-cocoa = Smells like the holidays! + reagent-name-soda-water = soda water reagent-desc-soda-water = A container of club soda. Why not make a scotch and soda? @@ -80,4 +83,4 @@ reagent-name-the-martinez = The Martinez reagent-desc-the-martinez = The edgerunner legend. Remembered by a drink, forgotten by a drunk. reagent-name-white-gilgamesh = white gilgamesh -reagent-desc-white-gilgamesh = A sickening mixture of milk and beer. Makes you feel like you're made of wood. \ No newline at end of file +reagent-desc-white-gilgamesh = A sickening mixture of milk and beer. Makes you feel like you're made of wood. diff --git a/Resources/Locale/en-US/reagents/meta/consumable/food/food.ftl b/Resources/Locale/en-US/reagents/meta/consumable/food/food.ftl index 01c716787e..85d46ff6c8 100644 --- a/Resources/Locale/en-US/reagents/meta/consumable/food/food.ftl +++ b/Resources/Locale/en-US/reagents/meta/consumable/food/food.ftl @@ -13,5 +13,8 @@ reagent-desc-protein = Found in certain meals, good for bodily health. reagent-name-cocoapowder = сocoa powder reagent-desc-cocoapowder = From the best varieties of cocoa beans +reagent-name-butter = butter +reagent-desc-butter = You can believe it! + reagent-name-pumpkin-flesh = pumpkin flesh -reagent-desc-pumpkin-flesh = The mushy, sweet remains of a pumpkin. \ No newline at end of file +reagent-desc-pumpkin-flesh = The mushy, sweet remains of a pumpkin. diff --git a/Resources/Locale/en-US/reagents/meta/narcotics.ftl b/Resources/Locale/en-US/reagents/meta/narcotics.ftl index 7eed44835c..ea115bf962 100644 --- a/Resources/Locale/en-US/reagents/meta/narcotics.ftl +++ b/Resources/Locale/en-US/reagents/meta/narcotics.ftl @@ -16,10 +16,10 @@ reagent-desc-thc = The main psychoactive compound in cannabis. reagent-name-thc-oil = THC oil reagent-desc-thc-oil = Pure THC oil, extracted from the leaves of the cannabis plant. Much stronger than its natural form and can be used to numb chronic pain in patients. -reagent-name-bananadine = Bananadine +reagent-name-bananadine = bananadine reagent-desc-bananadine = A mild psychedelic that is found in small traces in banana peels. -reagent-name-nicotine = Nicotine +reagent-name-nicotine = nicotine reagent-desc-nicotine = Dangerous and highly addictive, but that's what the propaganda says. reagent-name-impedrezene = impedrezene diff --git a/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml b/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml index 2bd3031825..299126ade8 100644 --- a/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml +++ b/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml @@ -18,9 +18,9 @@ - type: reagent id: HotCocoa - name: reagent-name-cocoa + name: reagent-name-hot-cocoa parent: BaseDrink - desc: reagent-desc-cocoa + desc: reagent-desc-hot-cocoa physicalDesc: reagent-physical-desc-aromatic flavor: chocolate color: "#664300"