]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
mild reagent prototype cleanup + other misc garbage (#22630)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Sun, 17 Dec 2023 03:34:13 +0000 (22:34 -0500)
committerGitHub <noreply@github.com>
Sun, 17 Dec 2023 03:34:13 +0000 (19:34 -0800)
Content.IntegrationTests/Tests/Chemistry/SolutionSystemTests.cs
Content.Server/GuideGenerator/ReagentEntry.cs
Content.Shared/Chemistry/Reagent/ReagentPrototype.cs
Resources/Locale/en-US/guidebook/chemistry/statuseffects.ftl
Resources/Locale/en-US/reagents/meta/consumable/drink/drinks.ftl
Resources/Locale/en-US/reagents/meta/consumable/food/food.ftl
Resources/Locale/en-US/reagents/meta/narcotics.ftl
Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml

index 8b489d27fc7d820f5f905261b02b38577f75c5f2..064ce46934edda34ad9228a3339d8a018c8541fe 100644 (file)
@@ -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()
index 7e1444b8a0a66876b83ae3281da9a36ae3edae14..5c9ec40fd4f496969a61dd3f411776216bb59c74 100644 (file)
@@ -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<string> Recipes { get; } = new();
 
     [JsonPropertyName("metabolisms")]
-    public Dictionary<string, ReagentEffectsEntry>? Metabolisms { get; }
+    public Dictionary<ProtoId<MetabolismGroupPrototype>, ReagentEffectsEntry>? Metabolisms { get; }
 
     public ReagentEntry(ReagentPrototype proto)
     {
index 0f24a363392b284fa43d6faf99d5c6e90cfb7f31..1603d3d647f12a3aee2513dd9296f87b1a28b1fd 100644 (file)
@@ -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<ReagentPrototype>))]
+        [ParentDataField(typeof(AbstractPrototypeIdArraySerializer<ReagentPrototype>))]
         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
         /// <summary>
         ///     Is this reagent recognizable to the average spaceman (water, welding fuel, ketchup, etc)?
         /// </summary>
-        [DataField("recognizable")]
-        public bool Recognizable = false;
+        [DataField]
+        public bool Recognizable;
 
-        [DataField("flavor", customTypeSerializer:typeof(PrototypeIdSerializer<FlavorPrototype>))]
-        public string? Flavor;
+        [DataField]
+        public ProtoId<FlavorPrototype>? Flavor;
 
         /// <summary>
         /// There must be at least this much quantity in a solution to be tasted.
         /// </summary>
-        [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.
         /// </summary>
-        [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;
 
         /// <summary>
         /// If this reagent is part of a puddle is it slippery.
         /// </summary>
-        [DataField("slippery")]
-        public bool Slippery = false;
+        [DataField]
+        public bool Slippery;
 
         /// <summary>
         /// How much reagent slows entities down if it's part of a puddle.
         /// 0 - no slowdown; 1 - can't move.
         /// </summary>
-        [DataField("viscosity")]
-        public float Viscosity = 0;
+        [DataField]
+        public float Viscosity;
 
-        [DataField("metabolisms", serverOnly: true, customTypeSerializer: typeof(PrototypeIdDictionarySerializer<ReagentEffectsEntry, MetabolismGroupPrototype>))]
-        public Dictionary<string, ReagentEffectsEntry>? Metabolisms = null;
+        [DataField(serverOnly: true)]
+        public Dictionary<ProtoId<MetabolismGroupPrototype>, ReagentEffectsEntry>? Metabolisms;
 
-        [DataField("reactiveEffects", serverOnly: true, customTypeSerializer: typeof(PrototypeIdDictionarySerializer<ReactiveReagentEffectEntry, ReactiveGroupPrototype>))]
-        public Dictionary<string, ReactiveReagentEffectEntry>? ReactiveEffects = null;
+        [DataField(serverOnly: true)]
+        public Dictionary<ProtoId<ReactiveGroupPrototype>, ReactiveReagentEffectEntry>? ReactiveEffects;
 
-        [DataField("tileReactions", serverOnly: true)]
+        [DataField(serverOnly: true)]
         public List<ITileReaction> TileReactions = new(0);
 
         [DataField("plantMetabolism", serverOnly: true)]
         public List<ReagentEffect> 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<string, ReagentEffectsGuideEntry>? GuideEntries;
+        public Dictionary<ProtoId<MetabolismGroupPrototype>, ReagentEffectsGuideEntry>? GuideEntries;
 
         public ReagentGuideEntry(ReagentPrototype proto, IPrototypeManager prototype, IEntitySystemManager entSys)
         {
index f00921b8313f13449661d9627ce6319181bd9f4c..3db8a3c5b0e0887bdbf9c9f8e86bf484af38ced7 100644 (file)
@@ -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
index 5153d7f9a0167aab247fe6edb3644d16cdcfe12c..00091ad9fe2de8d3b3acf45b3c0448941d775852 100644 (file)
@@ -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.
index 01c716787e37598e5301de3abb5dbf84023735a2..85d46ff6c8ced1abc24996e85261cabc79abde6c 100644 (file)
@@ -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.
index 7eed44835c2ba8489058d9f614b3192942416f23..ea115bf9627eca09b28128676a6952a3a2ba4e2f 100644 (file)
@@ -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
index 2bd3031825c3ffae272ea0ee7bc702d1cad82b34..299126ade879a677e0c9451bcae125bdd9dc3b63 100644 (file)
@@ -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"