diff --git a/.github/workflows/update-wiki.yml b/.github/workflows/update-wiki.yml
new file mode 100644
index 0000000000..5184a7f093
--- /dev/null
+++ b/.github/workflows/update-wiki.yml
@@ -0,0 +1,61 @@
+name: Update JSON files on wiki
+
+on:
+ push:
+ branches: [ master, jsondump ]
+ paths:
+ - '.github/workflows/update-wiki.yml'
+ - 'Content.Shared/Chemistry/**.cs'
+ - 'Content.Server/Chemistry/**.cs'
+ - 'Content.Server/GuideGenerator/**.cs'
+ - 'Resources/Prototypes/Reagents/**.yml'
+ - 'Resources/Prototypes/Chemistry/**.yml'
+ - 'Resources/Prototypes/Recipes/Reactions/**.yml'
+ - 'RobustToolbox/'
+
+jobs:
+ wiki:
+ name: Build and publish JSON for the wiki
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup submodule
+ run: |
+ git submodule update --init --recursive
+ - name: Pull engine updates
+ uses: space-wizards/submodule-dependency@v0.1.5
+ - name: Update Engine Submodules
+ run: |
+ cd RobustToolbox/
+ git submodule update --init --recursive
+ - name: Setup .NET Core
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 6.0.100
+ - name: Install dependencies
+ run: dotnet restore
+ - name: Build
+ run: dotnet build --configuration Release --no-restore /p:WarningsAsErrors=nullable /m
+ - name: Generate JSON
+ run: dotnet ./bin/Content.Server/Content.Server.dll --cvar autogen.destination_file=prototypes.json
+ continue-on-error: true
+ - name: Upload chem_prototypes.json
+ uses: jtmullen/mediawiki-edit-action@v0.1.1
+ with:
+ wiki_text_file: ./bin/Content.Server/data/chem_prototypes.json
+ edit_summary: Update chem_prototypes.json via GitHub Actions
+ page_name: "${{ secrets.WIKI_PAGE_ROOT }}/chem_prototypes.json"
+ api_url: https://wiki.spacestation14.io/w/api.php
+ username: ${{ secrets.WIKI_BOT_USER }}
+ password: ${{ secrets.WIKI_BOT_PASS }}
+ - name: Upload react_prototypes.json
+ uses: jtmullen/mediawiki-edit-action@v0.1.1
+ with:
+ wiki_text_file: ./bin/Content.Server/data/react_prototypes.json
+ edit_summary: Update react_prototypes.json via GitHub Actions
+ page_name: "${{ secrets.WIKI_PAGE_ROOT }}/react_prototypes.json"
+ api_url: https://wiki.spacestation14.io/w/api.php
+ username: ${{ secrets.WIKI_BOT_USER }}
+ password: ${{ secrets.WIKI_BOT_PASS }}
+
diff --git a/Content.Server/Chemistry/ReactionEffects/ExplosionReactionEffect.cs b/Content.Server/Chemistry/ReactionEffects/ExplosionReactionEffect.cs
index 074f5b57b8..e09cb7eb4b 100644
--- a/Content.Server/Chemistry/ReactionEffects/ExplosionReactionEffect.cs
+++ b/Content.Server/Chemistry/ReactionEffects/ExplosionReactionEffect.cs
@@ -1,4 +1,5 @@
using System;
+using System.Text.Json.Serialization;
using Content.Server.Chemistry.Components.SolutionManager;
using Content.Server.Explosion.EntitySystems;
using Content.Shared.Administration.Logs;
@@ -12,21 +13,36 @@ namespace Content.Server.Chemistry.ReactionEffects
[DataDefinition]
public class ExplosionReactionEffect : ReagentEffect
{
- [DataField("devastationRange")] private float _devastationRange = 1;
- [DataField("heavyImpactRange")] private float _heavyImpactRange = 2;
- [DataField("lightImpactRange")] private float _lightImpactRange = 3;
- [DataField("flashRange")] private float _flashRange;
+ [DataField("devastationRange")]
+ [JsonIgnore]
+ private float _devastationRange = 1;
+
+ [DataField("heavyImpactRange")]
+ [JsonIgnore]
+ private float _heavyImpactRange = 2;
+
+ [DataField("lightImpactRange")]
+ [JsonIgnore]
+ private float _lightImpactRange = 3;
+
+ [DataField("flashRange")]
+ [JsonIgnore]
+ private float _flashRange;
///
/// If true, then scale ranges by intensity. If not, the ranges are the same regardless of reactant amount.
///
- [DataField("scaled")] private bool _scaled;
+ [DataField("scaled")]
+ [JsonIgnore]
+ private bool _scaled;
///
/// Maximum scaling on ranges. For example, if it equals 5, then it won't scaled anywhere past
/// 5 times the minimum reactant amount.
///
- [DataField("maxScale")] private float _maxScale = 1;
+ [DataField("maxScale")]
+ [JsonIgnore]
+ private float _maxScale = 1;
public override bool ShouldLog => true;
public override LogImpact LogImpact => LogImpact.High;
diff --git a/Content.Server/Chemistry/ReagentEffects/HealthChange.cs b/Content.Server/Chemistry/ReagentEffects/HealthChange.cs
index d8ea396740..1316d7b9c9 100644
--- a/Content.Server/Chemistry/ReagentEffects/HealthChange.cs
+++ b/Content.Server/Chemistry/ReagentEffects/HealthChange.cs
@@ -1,3 +1,4 @@
+using System.Text.Json.Serialization;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -16,6 +17,7 @@ namespace Content.Server.Chemistry.ReagentEffects
///
/// Damage to apply every metabolism cycle. Damage Ignores resistances.
///
+ [JsonPropertyName("damage")]
[DataField("damage", required: true)]
public DamageSpecifier Damage = default!;
@@ -23,10 +25,12 @@ namespace Content.Server.Chemistry.ReagentEffects
/// Should this effect scale the damage by the amount of chemical in the solution?
/// Useful for touch reactions, like styptic powder or acid.
///
+ [JsonPropertyName("scaleByQuantity")]
[DataField("scaleByQuantity")]
public bool ScaleByQuantity = false;
[DataField("ignoreResistances")]
+ [JsonPropertyName("ignoreResistances")]
public bool IgnoreResistances = true;
public override void Effect(ReagentEffectArgs args)
diff --git a/Content.Server/Entry/EntryPoint.cs b/Content.Server/Entry/EntryPoint.cs
index 656ec0b4f5..7a513b634d 100644
--- a/Content.Server/Entry/EntryPoint.cs
+++ b/Content.Server/Entry/EntryPoint.cs
@@ -1,3 +1,4 @@
+using System.IO;
using Content.Server.Administration.Managers;
using Content.Server.Afk;
using Content.Server.AI.Utility;
@@ -8,6 +9,7 @@ using Content.Server.Connection;
using Content.Server.Database;
using Content.Server.EUI;
using Content.Server.GameTicking;
+using Content.Server.GuideGenerator;
using Content.Server.Info;
using Content.Server.IoC;
using Content.Server.Maps;
@@ -18,15 +20,19 @@ using Content.Server.Voting.Managers;
using Content.Shared.Actions;
using Content.Shared.Administration;
using Content.Shared.Alert;
+using Content.Shared.CCVar;
using Content.Shared.Kitchen;
+using Robust.Server;
using Robust.Server.Bql;
using Robust.Server.Player;
+using Robust.Shared.Configuration;
using Robust.Server.ServerStatus;
using Robust.Shared.ContentPack;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Timing;
+using Robust.Shared.Utility;
namespace Content.Server.Entry
{
@@ -62,45 +68,66 @@ namespace Content.Server.Entry
IoCManager.BuildGraph();
factory.GenerateNetIds();
+ var configManager = IoCManager.Resolve();
+ var dest = configManager.GetCVar(CCVars.DestinationFile);
+ if (string.IsNullOrEmpty(dest)) //hacky but it keeps load times for the generator down.
+ {
+ _euiManager = IoCManager.Resolve();
+ _voteManager = IoCManager.Resolve();
- _euiManager = IoCManager.Resolve();
- _voteManager = IoCManager.Resolve();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
+ var playerManager = IoCManager.Resolve();
- var playerManager = IoCManager.Resolve();
+ var logManager = IoCManager.Resolve();
+ logManager.GetSawmill("Storage").Level = LogLevel.Info;
+ logManager.GetSawmill("db.ef").Level = LogLevel.Info;
- var logManager = IoCManager.Resolve();
- logManager.GetSawmill("Storage").Level = LogLevel.Info;
- logManager.GetSawmill("db.ef").Level = LogLevel.Info;
-
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Init();
- IoCManager.Resolve().Init();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- _voteManager.Initialize();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Init();
+ IoCManager.Resolve().Init();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
+ _voteManager.Initialize();
+ }
}
public override void PostInit()
{
base.PostInit();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().Initialize();
- _euiManager.Initialize();
+ var configManager = IoCManager.Resolve();
+ var resourceManager = IoCManager.Resolve();
+ var dest = configManager.GetCVar(CCVars.DestinationFile);
+ if (!string.IsNullOrEmpty(dest))
+ {
+ var resPath = new ResourcePath(dest).ToRootedPath();
+ var file = resourceManager.UserData.OpenWriteText(resPath.WithName("chem_" + dest));
+ ChemistryJsonGenerator.PublishJson(file);
+ file.Flush();
+ file = resourceManager.UserData.OpenWriteText(resPath.WithName("react_" + dest));
+ ReactionJsonGenerator.PublishJson(file);
+ file.Flush();
+ IoCManager.Resolve().Shutdown("Data generation done");
+ }
+ else
+ {
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().Initialize();
+ _euiManager.Initialize();
- IoCManager.Resolve().Initialize();
- IoCManager.Resolve().GetEntitySystem().PostInitialize();
- IoCManager.Resolve().DoAutoRegistrations();
+ IoCManager.Resolve().Initialize();
+ IoCManager.Resolve().GetEntitySystem().PostInitialize();
+ IoCManager.Resolve().DoAutoRegistrations();
+ }
}
public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs)
diff --git a/Content.Server/GuideGenerator/ChemistryJsonGenerator.cs b/Content.Server/GuideGenerator/ChemistryJsonGenerator.cs
new file mode 100644
index 0000000000..6eabade395
--- /dev/null
+++ b/Content.Server/GuideGenerator/ChemistryJsonGenerator.cs
@@ -0,0 +1,70 @@
+using System;
+using System.IO;
+using System.Linq;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Content.Shared.Chemistry.Reaction;
+using Content.Shared.Chemistry.Reagent;
+using Content.Shared.Damage;
+using Content.Shared.FixedPoint;
+using Robust.Shared.IoC;
+using Robust.Shared.Prototypes;
+
+namespace Content.Server.GuideGenerator;
+
+public class ChemistryJsonGenerator
+{
+ public static void PublishJson(StreamWriter file)
+ {
+ var prototype = IoCManager.Resolve();
+ var prototypes =
+ prototype
+ .EnumeratePrototypes()
+ .Where(x => !x.Abstract)
+ .Select(x => new ReagentEntry(x))
+ .ToDictionary(x => x.Id, x => x);
+
+ var reactions =
+ prototype
+ .EnumeratePrototypes()
+ .Where(x => x.Products.Count != 0);
+
+ foreach (var reaction in reactions)
+ {
+ foreach (var product in reaction.Products.Keys)
+ {
+ prototypes[product].Recipes.Add(reaction.ID);
+ }
+ }
+
+ var serializeOptions = new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ Converters =
+ {
+ new UniversalJsonConverter(),
+ new UniversalJsonConverter(),
+ new UniversalJsonConverter(),
+ new UniversalJsonConverter(),
+ new FixedPointJsonConverter()
+ }
+ };
+
+ file.Write(JsonSerializer.Serialize(prototypes, serializeOptions));
+ }
+
+ public class FixedPointJsonConverter : JsonConverter
+ {
+ public override void Write(Utf8JsonWriter writer, FixedPoint2 value, JsonSerializerOptions options)
+ {
+ writer.WriteNumberValue(value.Float());
+ }
+
+ public override FixedPoint2 Read(ref Utf8JsonReader reader, Type objectType, JsonSerializerOptions options)
+ {
+ // Throwing a NotSupportedException here allows the error
+ // message to provide path information.
+ throw new NotSupportedException();
+ }
+ }
+}
diff --git a/Content.Server/GuideGenerator/ReactionJsonGenerator.cs b/Content.Server/GuideGenerator/ReactionJsonGenerator.cs
new file mode 100644
index 0000000000..58c2de143d
--- /dev/null
+++ b/Content.Server/GuideGenerator/ReactionJsonGenerator.cs
@@ -0,0 +1,36 @@
+using System.IO;
+using System.Linq;
+using System.Text.Json;
+using Content.Shared.Chemistry.Reaction;
+using Content.Shared.Chemistry.Reagent;
+using Content.Shared.FixedPoint;
+using Robust.Shared.IoC;
+using Robust.Shared.Prototypes;
+
+namespace Content.Server.GuideGenerator;
+
+public class ReactionJsonGenerator
+{
+ public static void PublishJson(StreamWriter file)
+ {
+ var prototype = IoCManager.Resolve();
+
+ var reactions =
+ prototype
+ .EnumeratePrototypes()
+ .Select(x => new ReactionEntry(x))
+ .ToDictionary(x => x.Id, x => x);
+
+ var serializeOptions = new JsonSerializerOptions
+ {
+ WriteIndented = true,
+ Converters =
+ {
+ new UniversalJsonConverter(),
+ }
+ };
+
+ file.Write(JsonSerializer.Serialize(reactions, serializeOptions));
+ }
+}
+
diff --git a/Content.Server/GuideGenerator/ReagentEntry.cs b/Content.Server/GuideGenerator/ReagentEntry.cs
new file mode 100644
index 0000000000..d5179f74ef
--- /dev/null
+++ b/Content.Server/GuideGenerator/ReagentEntry.cs
@@ -0,0 +1,96 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json.Serialization;
+using Content.Server.Body.Components;
+using Content.Shared.Chemistry.Reaction;
+using Content.Shared.Chemistry.Reagent;
+using Robust.Shared.Maths;
+using Robust.Shared.Serialization.Manager.Attributes;
+
+namespace Content.Server.GuideGenerator;
+
+public class ReagentEntry
+{
+ [JsonPropertyName("id")]
+ public string Id { get; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; }
+
+ [JsonPropertyName("group")]
+ public string Group { get; }
+
+ [JsonPropertyName("desc")]
+ public string Description { get; }
+
+ [JsonPropertyName("physicalDesc")]
+ public string PhysicalDescription { get; }
+
+ [JsonPropertyName("color")]
+ public string SubstanceColor { get; }
+
+ [JsonPropertyName("recipes")]
+ public List Recipes { get; } = new();
+
+ [JsonPropertyName("metabolisms")]
+ public Dictionary? Metabolisms { get; }
+
+ public ReagentEntry(ReagentPrototype proto)
+ {
+ Id = proto.ID;
+ Name = proto.Name;
+ Group = proto.Group;
+ Description = proto.Description;
+ PhysicalDescription = proto.PhysicalDescription;
+ SubstanceColor = proto.SubstanceColor.ToHex();
+ Metabolisms = proto.Metabolisms;
+ }
+}
+
+public class ReactionEntry
+{
+ [JsonPropertyName("id")]
+ public string Id { get; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; }
+
+ [JsonPropertyName("reactants")]
+ public Dictionary Reactants { get; }
+
+ [JsonPropertyName("products")]
+ public Dictionary Products { get; }
+
+ [JsonPropertyName("effects")]
+ public List Effects { get; }
+
+ public ReactionEntry(ReactionPrototype proto)
+ {
+ Id = proto.ID;
+ Name = proto.Name;
+ Reactants =
+ proto.Reactants
+ .Select(x => KeyValuePair.Create(x.Key, new ReactantEntry(x.Value.Amount.Float(), x.Value.Catalyst)))
+ .ToDictionary(x => x.Key, x => x.Value);
+ Products =
+ proto.Products
+ .Select(x => KeyValuePair.Create(x.Key, x.Value.Float()))
+ .ToDictionary(x => x.Key, x => x.Value);
+ Effects = proto.Effects;
+ }
+}
+
+public class ReactantEntry
+{
+ [JsonPropertyName("amount")]
+ public float Amount { get; }
+
+ [JsonPropertyName("catalyst")]
+ public bool Catalyst { get; }
+
+ public ReactantEntry(float amnt, bool cata)
+ {
+ Amount = amnt;
+ Catalyst = cata;
+ }
+}
diff --git a/Content.Server/GuideGenerator/UniversalJsonConverter.cs b/Content.Server/GuideGenerator/UniversalJsonConverter.cs
new file mode 100644
index 0000000000..6de4608e4b
--- /dev/null
+++ b/Content.Server/GuideGenerator/UniversalJsonConverter.cs
@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace Content.Server.GuideGenerator
+{
+ // This class is used as a shim to help do polymorphic serialization of objects into JSON
+ // (serializing objects that inherit abstract base classes or interfaces) since
+ // System.Text.Json (our new JSON solution) doesn't support that while Newtonsoft.Json (our old
+ // solution) does.
+ public class UniversalJsonConverter : JsonConverter
+ {
+
+ // This converter can only convert types that are T or descend from T.
+ public override bool CanConvert(Type typeToConvert)
+ {
+ return typeof(T).IsAssignableFrom(typeToConvert);
+ }
+
+ // We don't support deserialization right now. In order to do so, we'd need to bundle a
+ // field like "$type" with our objects so they'd be reserialized into the correct base class
+ // but that presents a security hazard.
+ public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ // Throwing a NotImplementedException here allows the Utf8JsonReader to provide
+ // an error message that provides the specific JSON path of the problematic object
+ // rather than a generic error message. At least in theory. Haven't tested that.
+ throw new NotImplementedException();
+ }
+
+ // The bread and butter. Deserialize an object of parameter type T.
+ // This method is automatically called when the JSON writer finds an object of a type
+ // where we've registered this class as its converter using the [JsonConverter(...)] attribute
+ public override void Write(Utf8JsonWriter writer, T obj, JsonSerializerOptions options)
+ {
+ // If the object is null, don't include it.
+ if (obj is null)
+ {
+ writer.WriteNullValue();
+ return;
+ }
+
+ // Use reflection to get a list of fields and properties on the object we're serializing.
+ // Using obj.GetType() here instead of typeof(T) allows us to get the true base class rather
+ // than the abstract ancestor, even if we're parameterized with that abstract class.
+ FieldInfo[] fields = obj.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
+ PropertyInfo[] properties = obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
+
+ // Since the JSON writer will have already written the field name, we need to write the object itself.
+ // Since we only use this class to serialize complex objects, we know we'll be writing a JSON object, so open one.
+ writer.WriteStartObject();
+
+ // For each field, try to write it into the object.
+ foreach (FieldInfo field in fields)
+ {
+ // If the field has a [JsonIgnore] attribute, skip it
+ if (Attribute.GetCustomAttribute(field, typeof(JsonIgnoreAttribute), true) != null) continue;
+
+ // exclude fields that are compiler autogenerated like "__BackingField" fields
+ if (Attribute.GetCustomAttribute(field, typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute), true) != null) continue;
+
+ // If the field has a [JsonPropertyName] attribute, get the property name. Otherwise, use the field name.
+ JsonPropertyNameAttribute? attr = (JsonPropertyNameAttribute?) Attribute.GetCustomAttribute(field, typeof(JsonPropertyNameAttribute), true);
+ string name = attr == null ? field.Name : attr.Name;
+
+ // Write a new key/value pair into the JSON object itself.
+ WriteKV(writer, name, field.GetValue(obj), options);
+ }
+
+ // Repeat the same process for each property.
+ foreach (PropertyInfo prop in properties)
+ {
+ // If the field has a [JsonIgnore] attribute, skip it
+ if (Attribute.GetCustomAttribute(prop, typeof(JsonIgnoreAttribute), true) != null) continue;
+
+ // If the property has a [JsonPropertyName] attribute, get the property name. Otherwise, use the property name.
+ JsonPropertyNameAttribute? attr = (JsonPropertyNameAttribute?) Attribute.GetCustomAttribute(prop, typeof(JsonPropertyNameAttribute), true);
+ string name = attr == null ? prop.Name : attr.Name;
+
+ // Write a new key/value pair into the JSON object itself.
+ WriteKV(writer, name, prop.GetValue(obj), options);
+ }
+
+ // Close the object, we're done!
+ writer.WriteEndObject();
+ }
+
+ // This is a little utility method to write a key/value pair inside a JSON object.
+ // It's used for all the actual writing.
+ public void WriteKV(Utf8JsonWriter writer, string key, object? obj, JsonSerializerOptions options)
+ {
+ // First, write the property name
+ writer.WritePropertyName(key);
+
+ // Then, recurse. This ensures that primitive values will be written directly, while
+ // more complex values can use any custom converters we've registered (like this one.)
+ JsonSerializer.Serialize(writer, obj, options);
+ }
+ }
+}
diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs
index f56b5bbab4..b1bb2113d5 100644
--- a/Content.Shared/CCVar/CCVars.cs
+++ b/Content.Shared/CCVar/CCVars.cs
@@ -626,5 +626,12 @@ namespace Content.Shared.CCVar
///
public static readonly CVarDef RulesWaitTime =
CVarDef.Create("rules.time", 45f, CVar.SERVER | CVar.REPLICATED);
+
+ /*
+ * Autogeneration
+ */
+
+ public static readonly CVarDef DestinationFile =
+ CVarDef.Create("autogen.destination_file", "", CVar.SERVER | CVar.SERVERONLY);
}
}
diff --git a/Content.Shared/Chemistry/Reagent/ReagentEffect.cs b/Content.Shared/Chemistry/Reagent/ReagentEffect.cs
index 1c526e053e..113e60584a 100644
--- a/Content.Shared/Chemistry/Reagent/ReagentEffect.cs
+++ b/Content.Shared/Chemistry/Reagent/ReagentEffect.cs
@@ -1,4 +1,6 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
using Content.Shared.Administration.Logs;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
@@ -20,24 +22,29 @@ namespace Content.Shared.Chemistry.Reagent
[MeansImplicitUse]
public abstract class ReagentEffect
{
+ [JsonPropertyName("id")] private protected string _id => this.GetType().Name;
///
/// The list of conditions required for the effect to activate. Not required.
///
+ [JsonPropertyName("conditions")]
[DataField("conditions")]
public ReagentEffectCondition[]? Conditions;
///
/// What's the chance, from 0 to 1, that this effect will occur?
///
+ [JsonPropertyName("probability")]
[DataField("probability")]
public float Probability = 1.0f;
+ [JsonIgnore]
[DataField("logImpact")]
public virtual LogImpact LogImpact { get; } = LogImpact.Low;
///
/// Should this reagent effect log at all?
///
+ [JsonIgnore]
[DataField("shouldLog")]
public virtual bool ShouldLog { get; } = false;
diff --git a/Content.Shared/Chemistry/Reagent/ReagentEffectCondition.cs b/Content.Shared/Chemistry/Reagent/ReagentEffectCondition.cs
index 40df2383b7..ea5b2857de 100644
--- a/Content.Shared/Chemistry/Reagent/ReagentEffectCondition.cs
+++ b/Content.Shared/Chemistry/Reagent/ReagentEffectCondition.cs
@@ -1,4 +1,4 @@
-using Content.Shared.Chemistry.Components;
+using System.Text.Json.Serialization;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -9,6 +9,8 @@ namespace Content.Shared.Chemistry.Reagent
[MeansImplicitUse]
public abstract class ReagentEffectCondition
{
+ [JsonPropertyName("id")] private protected string _id => this.GetType().Name;
+
public abstract bool Condition(ReagentEffectArgs args);
}
}
diff --git a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs
index 42be3db8e1..a4cdd6b61c 100644
--- a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs
+++ b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs
@@ -1,5 +1,6 @@
-using System;
+using System;
using System.Collections.Generic;
+using System.Text.Json.Serialization;
using Content.Shared.Administration.Logs;
using Content.Shared.Body.Prototypes;
using Content.Shared.Chemistry.Components;
@@ -30,7 +31,10 @@ namespace Content.Shared.Chemistry.Reagent
[DataField("name")]
public string Name { get; } = string.Empty;
- [DataField("parent", customTypeSerializer:typeof(PrototypeIdSerializer))]
+ [DataField("group")]
+ public string Group { get; } = "Unknown";
+
+ [DataField("parent", customTypeSerializer: typeof(PrototypeIdSerializer))]
public string? Parent { get; private set; }
[NeverPushInheritance]
@@ -65,7 +69,7 @@ namespace Content.Shared.Chemistry.Reagent
[DataField("metabolisms", serverOnly: true, customTypeSerializer: typeof(PrototypeIdDictionarySerializer))]
public Dictionary? Metabolisms = null;
- [DataField("reactiveEffects", serverOnly: true, customTypeSerializer:typeof(PrototypeIdDictionarySerializer))]
+ [DataField("reactiveEffects", serverOnly: true, customTypeSerializer: typeof(PrototypeIdDictionarySerializer))]
public Dictionary? ReactiveEffects = null;
[DataField("tileReactions", serverOnly: true)]
@@ -144,12 +148,14 @@ namespace Content.Shared.Chemistry.Reagent
///
/// Amount of reagent to metabolize, per metabolism cycle.
///
+ [JsonPropertyName("rate")]
[DataField("metabolismRate")]
public FixedPoint2 MetabolismRate = FixedPoint2.New(0.5f);
///
/// A list of effects to apply when these reagents are metabolized.
///
+ [JsonPropertyName("effects")]
[DataField("effects", required: true)]
public ReagentEffect[] Effects = default!;
}
diff --git a/Content.Shared/Damage/DamageSpecifier.cs b/Content.Shared/Damage/DamageSpecifier.cs
index bf589efbcb..50fed1c687 100644
--- a/Content.Shared/Damage/DamageSpecifier.cs
+++ b/Content.Shared/Damage/DamageSpecifier.cs
@@ -9,6 +9,7 @@ using Robust.Shared.ViewVariables;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Text.Json.Serialization;
using Content.Shared.FixedPoint;
namespace Content.Shared.Damage
@@ -23,15 +24,18 @@ namespace Content.Shared.Damage
[DataDefinition]
public class DamageSpecifier
{
+ [JsonPropertyName("types")]
[DataField("types", customTypeSerializer: typeof(PrototypeIdDictionarySerializer))]
private readonly Dictionary? _damageTypeDictionary;
+ [JsonPropertyName("groups")]
[DataField("groups", customTypeSerializer: typeof(PrototypeIdDictionarySerializer))]
private readonly Dictionary? _damageGroupDictionary;
///
/// Main DamageSpecifier dictionary. Most DamageSpecifier functions exist to somehow modifying this.
///
+ [JsonIgnore]
[ViewVariables(VVAccess.ReadWrite)]
public Dictionary DamageDict
{
@@ -43,6 +47,7 @@ namespace Content.Shared.Damage
}
set => _damageDict = value;
}
+ [JsonIgnore]
private Dictionary? _damageDict;
///
@@ -53,11 +58,13 @@ namespace Content.Shared.Damage
/// in another. For this purpose, you should instead use and then check the property.
///
+ [JsonIgnore]
public FixedPoint2 Total => DamageDict.Values.Sum();
///
/// Whether this damage specifier has any entries.
///
+ [JsonIgnore]
public bool Empty => DamageDict.Count == 0;
#region constructors
diff --git a/Content.Shared/FixedPoint/FixedPoint2.cs b/Content.Shared/FixedPoint/FixedPoint2.cs
index ed575a0f0f..74d95df587 100644
--- a/Content.Shared/FixedPoint/FixedPoint2.cs
+++ b/Content.Shared/FixedPoint/FixedPoint2.cs
@@ -264,11 +264,11 @@ namespace Content.Shared.FixedPoint
public readonly int CompareTo(FixedPoint2 other)
{
- if(other._value > _value)
+ if (other._value > _value)
{
return -1;
}
- if(other._value < _value)
+ if (other._value < _value)
{
return 1;
}
diff --git a/Resources/Prototypes/Catalog/ReagentDispensers/beverage.yml b/Resources/Prototypes/Catalog/ReagentDispensers/beverage.yml
index e08d1b8872..f2189ce079 100644
--- a/Resources/Prototypes/Catalog/ReagentDispensers/beverage.yml
+++ b/Resources/Prototypes/Catalog/ReagentDispensers/beverage.yml
@@ -1,7 +1,6 @@
- type: reagentDispenserInventory
id: SodaDispenserInventory
inventory:
-
- Water
- Ice
- Coffee
diff --git a/Resources/Prototypes/Reagents/Consumable/Drink/base_drink.yml b/Resources/Prototypes/Reagents/Consumable/Drink/base_drink.yml
index 35da9dcabb..46682e13f0 100644
--- a/Resources/Prototypes/Reagents/Consumable/Drink/base_drink.yml
+++ b/Resources/Prototypes/Reagents/Consumable/Drink/base_drink.yml
@@ -1,5 +1,6 @@
- type: reagent
id: BaseDrink
+ group: Drinks
abstract: true
metabolisms:
Drink:
@@ -37,6 +38,7 @@
- type: reagent
id: BaseAlcohol
+ group: Drinks
abstract: true
metabolisms:
Drink:
diff --git a/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml b/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml
index 62f8c96be4..c90c72993d 100644
--- a/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml
+++ b/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml
@@ -9,6 +9,7 @@
- type: reagent
id: Cream
name: cream
+ group: Drinks
desc: The fatty, still liquid part of milk. Why don't you mix this with sum scotch, eh?
physicalDesc: creamy
color: "#DFD7AF"
@@ -75,6 +76,7 @@
- type: reagent
id: Lemonade
name: lemonade
+ group: Drinks
desc: Drink using lemon juice, water, and a sweetener such as cane sugar or honey.
physicalDesc: tart
color: "#FFFF00"
@@ -88,6 +90,7 @@
- type: reagent
id: Milk
name: milk
+ group: Drinks
desc: An opaque white liquid produced by the mammary glands of mammals.
physicalDesc: opaque
color: "#DFDFDF"
@@ -105,6 +108,7 @@
- type: reagent
id: MilkOat
name: oat milk
+ group: Drinks
desc: Surprisingly tasty.
physicalDesc: refreshing
color: "#302000"
@@ -117,6 +121,7 @@
- type: reagent
id: MilkSoy
name: soy milk
+ group: Drinks
desc: Surprisingly tasty.
physicalDesc: refreshing
color: "#302000"
@@ -129,6 +134,7 @@
- type: reagent
id: MilkSpoiled
name: spoiled milk
+ group: Drinks
desc: This milk has gone rancid.
physicalDesc: putrid
color: "#faffba"
@@ -142,6 +148,7 @@
id: Nothing
name: nothing
desc: Absolutely nothing.
+ group: Drinks
physicalDesc: nothing
spritePath: nothing.rsi
metabolisms:
@@ -154,6 +161,7 @@
- type: reagent
id: NukaCola
name: nuka cola
+ group: Drinks
desc: Cola, cola never changes.
physicalDesc: fizzy
color: "#100800"
diff --git a/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml b/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml
index fe975bd967..09ea7ef1cc 100644
--- a/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml
+++ b/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml
@@ -1,6 +1,7 @@
- type: reagent
id: Astrotame
name: Astrotame
+ group: Foods
desc: The sweetness of a thousand sugars but none of the calories.
# physicalDesc:
color: aquamarine
@@ -8,6 +9,7 @@
- type: reagent
id: BbqSauce
name: BBQ sauce
+ group: Foods
desc: Hand wipes not included.
physicalDesc: Gloopy.
color: darkred
@@ -15,6 +17,7 @@
- type: reagent
id: Cornoil
name: corn oil
+ group: Foods
desc: Corn oil, A delicious oil used in cooking. Made from corn.
# physicalDesc:
color: yellow
@@ -22,6 +25,7 @@
- type: reagent
id: Frostoil
name: frostoil
+ group: Foods
desc: Leaves the tongue numb in its passage.
# physicalDesc:
color: skyblue
@@ -29,6 +33,7 @@
- type: reagent
id: HorseradishSauce
name: horseradish sauce
+ group: Foods
desc: Smelly horseradish sauce.
physicalDesc: Overpowering.
color: gray
@@ -36,6 +41,7 @@
- type: reagent
id: Hotsauce
name: hotsauce
+ group: Foods
desc: Burns so good.
# physicalDesc:
color: red
@@ -43,6 +49,7 @@
- type: reagent
id: Ketchup
name: ketchup
+ group: Foods
desc: Made from pureed tomatoes and flavored with spices.
# physicalDesc:
color: red
@@ -50,6 +57,7 @@
- type: reagent
id: Soysauce
name: soy sauce
+ group: Foods
desc: A salty soy-based flavoring.
# physicalDesc:
color: saddlebrown
@@ -57,6 +65,7 @@
- type: reagent
id: TableSalt
name: table salt
+ group: Foods
desc: Commonly known as salt, Sodium Chloride is often used to season food or kill borers instantly.
physicalDesc: grainy
color: "#a1000b"
diff --git a/Resources/Prototypes/Reagents/Consumable/Food/food.yml b/Resources/Prototypes/Reagents/Consumable/Food/food.yml
index bec89e469c..a1e71c3491 100644
--- a/Resources/Prototypes/Reagents/Consumable/Food/food.yml
+++ b/Resources/Prototypes/Reagents/Consumable/Food/food.yml
@@ -1,6 +1,7 @@
- type: reagent
id: Nutriment
name: nutriment
+ group: Foods
desc: All the vitamins, minerals, and carbohydrates the body needs in pure form.
physicalDesc: opaque
color: "#664330"
diff --git a/Resources/Prototypes/Reagents/Consumable/Food/ingredients.yml b/Resources/Prototypes/Reagents/Consumable/Food/ingredients.yml
index 29fc1e187f..680763f036 100644
--- a/Resources/Prototypes/Reagents/Consumable/Food/ingredients.yml
+++ b/Resources/Prototypes/Reagents/Consumable/Food/ingredients.yml
@@ -1,6 +1,7 @@
- type: reagent
id: Flour
name: flour
+ group: Foods
desc: Used for baking.
physicalDesc: powdery
color: white
@@ -13,6 +14,7 @@
- type: reagent
id: Oats
name: oats
+ group: Foods
desc: Used for a variety of tasty purposes.
physicalDesc: coarse
color: tan
@@ -25,6 +27,7 @@
- type: reagent
id: Enzyme
name: universal enzyme
+ group: Foods
desc: Used in cooking various dishes.
color: "#009900"
metabolisms:
@@ -36,6 +39,7 @@
- type: reagent
id: Egg
name: egg
+ group: Foods
desc: Used for baking.
physicalDesc: mucus-like
color: white
@@ -48,6 +52,7 @@
- type: reagent
id: Sugar
name: sugar
+ group: Foods
desc: Tasty spacey sugar!
physicalDesc:
color: white
@@ -60,6 +65,7 @@
- type: reagent
id: Blackpepper
name: black pepper
+ group: Foods
desc: Often used to flavor food or make people sneeze.
physicalDesc: Grainy.
color: black
@@ -72,6 +78,7 @@
- type: reagent
id: Vinegar
name: vinegar
+ group: Foods
desc: Often used to flavor food.
color: tan
metabolisms:
@@ -83,6 +90,7 @@
- type: reagent
id: Rice
name: rice
+ group: Foods
desc: Hard, small white grains.
color: white
metabolisms:
@@ -93,6 +101,7 @@
- type: reagent
id: OilOlive
name: olive oil
+ group: Foods
desc: Viscous and fragrant.
color: olive
metabolisms:
@@ -104,6 +113,7 @@
- type: reagent
id: Oil
name: oil
+ group: Foods
desc: Used by chefs to cook.
physicalDesc: oily
color: "#b67823"
diff --git a/Resources/Prototypes/Reagents/botany.yml b/Resources/Prototypes/Reagents/botany.yml
index c658e16d3e..ceb5a54dd3 100644
--- a/Resources/Prototypes/Reagents/botany.yml
+++ b/Resources/Prototypes/Reagents/botany.yml
@@ -1,6 +1,7 @@
- type: reagent
id: EZNutrient
name: EZ nutrient
+ group: Botanical
desc: Give your plants some of those EZ nutrients!
color: "#664330"
physicalDesc: thick
@@ -11,6 +12,7 @@
- type: reagent
id: Left4Zed
name: left-4-zed
+ group: Botanical
desc: A cocktail of mutagenic compounds, which cause plant life to become highly unstable.
color: "#5b406c"
physicalDesc: heterogeneous
@@ -26,6 +28,7 @@
- type: reagent
id: PestKiller
name: pest killer
+ group: Botanical
desc: A mixture that targets pests.
color: "#9e9886"
physicalDesc: bubbling
@@ -38,6 +41,7 @@
- type: reagent
id: PlantBGone
name: plant-B-gone
+ group: Botanical
desc: A harmful toxic mixture to kill plantlife. Do not ingest!
color: "#49002E"
physicalDesc: bubbling
@@ -54,6 +58,7 @@
- type: reagent
id: RobustHarvest
name: robust harvest
+ group: Botanical
desc: Plant-enhancing hormones, good for increasing potency.
color: "#3e901c"
physicalDesc: robust
@@ -71,6 +76,7 @@
- type: reagent
id: WeedKiller
name: weed killer
+ group: Botanical
desc: A mixture that targets weeds.
color: "#968395"
physicalDesc: bubbling
@@ -83,6 +89,7 @@
- type: reagent
id: Ammonia
name: ammonia
+ group: Botanical
desc: An effective fertilizer which is better than what is available to the botanist initially, though it isn't as powerful as Diethylamine
physicalDesc: pungent
color: "#77b58e"
@@ -104,6 +111,7 @@
- type: reagent
id: Diethylamine
name: diethylamine
+ group: Botanical
desc: A very potent fertilizer.
physicalDesc: strong-smelling
color: "#a1000b"
diff --git a/Resources/Prototypes/Reagents/elements.yml b/Resources/Prototypes/Reagents/elements.yml
index 669d67e21e..30b01be70b 100644
--- a/Resources/Prototypes/Reagents/elements.yml
+++ b/Resources/Prototypes/Reagents/elements.yml
@@ -1,6 +1,7 @@
- type: reagent
id: Aluminium # We use real words here.
name: aluminium
+ group: Elements
desc: A silver, soft, non-magnetic, and ductile metal.
physicalDesc: metallic
color: "#848789"
@@ -10,6 +11,7 @@
- type: reagent
id: Carbon
name: carbon
+ group: Elements
desc: A black, crystalline solid.
physicalDesc: crystalline
color: "#22282b"
@@ -19,6 +21,7 @@
- type: reagent
id: Chlorine
name: chlorine
+ group: Elements
desc: A yellow-green gas which is toxic to humans.
physicalDesc: gaseous
color: "#a2ff00"
@@ -37,6 +40,7 @@
- type: reagent
id: Copper
name: copper
+ group: Elements
desc: A soft, malleable, and ductile metal with very high thermal and electrical conductivity.
physicalDesc: metallic
color: "#b05b3c"
@@ -46,6 +50,7 @@
- type: reagent
id: Fluorine
name: fluorine
+ group: Elements
desc: A highly toxic pale yellow gas. Extremely reactive.
physicalDesc: gaseous
color: "#808080"
@@ -64,6 +69,7 @@
- type: reagent
id: Gold
name: gold
+ group: Elements
desc: Gold is a dense, soft, shiny metal and the most malleable and ductile metal known.
physicalDesc: metallic
color: "#F7C430"
@@ -73,6 +79,7 @@
- type: reagent
id: Hydrogen
name: hydrogen
+ group: Elements
desc: A light, flammable gas.
physicalDesc: gaseous
color: "#808080"
@@ -82,6 +89,7 @@
- type: reagent
id: Iodine
name: iodine
+ group: Elements
desc: Commonly added to table salt as a nutrient. On its own it tastes far less pleasing.
physicalDesc: Dark Brown
color: "#BC8A00"
@@ -91,6 +99,7 @@
- type: reagent
id: Iron
name: iron
+ group: Elements
desc: A silvery-grey metal which forms iron oxides (rust) with contact with air. Commonly alloyed with other elements to create alloys such as steel.
physicalDesc: metallic
color: "#434b4d"
@@ -100,6 +109,7 @@
- type: reagent
id: Lithium
name: lithium
+ group: Elements
desc: A soft, silvery-white alkali metal. It is highly reactive, and ignites if it makes contact with water.
physicalDesc: shiny
color: "#c6c8cc"
@@ -110,6 +120,7 @@
- type: reagent
id: Mercury
name: mercury
+ group: Elements
desc: A silver metal which is liquid at room temperature. It is highly toxic to humans.
physicalDesc: shiny
color: "#929296"
@@ -126,6 +137,7 @@
- type: reagent
id: Nitrogen
name: nitrogen
+ group: Elements
desc: A colorless, odorless unreactive gas. Highly stable.
physicalDesc: gaseous
color: "#808080"
@@ -135,6 +147,7 @@
- type: reagent
id: Oxygen
name: oxygen
+ group: Elements
desc: An oxidizing, colorless gas.
physicalDesc: gaseous
color: "#808080"
@@ -144,6 +157,7 @@
- type: reagent
id: Potassium
name: potassium
+ group: Elements
desc: A soft, shiny grey metal. Even more reactive than lithium.
physicalDesc: shiny
color: "#c6c8cc"
@@ -153,6 +167,7 @@
- type: reagent
id: Phosphorus
name: phosphorus
+ group: Elements
desc: A reactive metal used in pyrotechnics and weapons.
physicalDesc: powdery
color: "#ede4e4"
@@ -169,6 +184,7 @@
- type: reagent
id: Radium
name: radium
+ group: Elements
parent: Uranium
desc: A radioactive metal, silvery-white in its pure form. It glows due to its radioactivity and is highly toxic.
physicalDesc: glowing
@@ -179,6 +195,7 @@
- type: reagent
id: Silicon
name: silicon
+ group: Elements
desc: A hard and brittle crystalline solid with a blue-grey color.
physicalDesc: crystalline
color: "#364266"
@@ -188,6 +205,7 @@
- type: reagent
id: Silver
name: silver
+ group: Elements
desc: A soft, white, lustrous transition metal, it has the highest electrical conductivity of any element and the highest thermal conductivity of any metal.
physicalDesc: reasonably metallic
color: "#d0d0d0"
@@ -197,6 +215,7 @@
- type: reagent
id: Sulfur
name: sulfur
+ group: Elements
desc: A yellow, crystalline solid.
physicalDesc: powdery
color: "#fff385"
@@ -206,6 +225,7 @@
- type: reagent
id: Sodium
name: sodium
+ group: Elements
desc: A silvery-white alkali metal. Highly reactive in its pure form. #thanks visne <3
physicalDesc: metallic
color: "#c6c8cc"
@@ -215,6 +235,7 @@
- type: reagent
id: Uranium
name: uranium
+ group: Elements
desc: A grey metallic chemical element in the actinide series, weakly radioactive.
physicalDesc: metallic
color: "#8fa191"
diff --git a/Resources/Prototypes/Reagents/fun.yml b/Resources/Prototypes/Reagents/fun.yml
index e7337caa3a..505f50cce4 100644
--- a/Resources/Prototypes/Reagents/fun.yml
+++ b/Resources/Prototypes/Reagents/fun.yml
@@ -1,6 +1,7 @@
- type: reagent
id: Carpetium
name: carpetium
+ group: Special
desc: A mystical chemical, usually outsourced from the Clown Planet, that covers everything it touches in carpet.
physicalDesc: fibrous
color: "#800000"
@@ -27,6 +28,7 @@
- type: reagent
id: BuzzochloricBees
name: Buzzochloric Bees
+ group: Toxins
desc: "Liquid bees. Oh god it's LIQUID BEES NO-"
physicalDesc: buzzy
color: "#FFD35D"
@@ -130,6 +132,7 @@
- type: reagent
id: Licoxide
name: Licoxide
+ group: Toxins
desc: It looks... electrifying.
physicalDesc: electric
color: "#FDD023"
diff --git a/Resources/Prototypes/Reagents/medicine.yml b/Resources/Prototypes/Reagents/medicine.yml
index 2c8bab68d6..aa216680b6 100644
--- a/Resources/Prototypes/Reagents/medicine.yml
+++ b/Resources/Prototypes/Reagents/medicine.yml
@@ -1,6 +1,7 @@
- type: reagent
id: Alkycosine
name: alkycosine
+ group: Medicine
desc: Lessens the damage to neurological tissue. More effective at treating brain damage than alkysine and also a fairly effective painkiller as well. Caution is needed in its creation to avoid mixing bleach and the chlorine needed to make alkysine.
physicalDesc: strong-smelling
color: "#9e232b"
@@ -9,6 +10,7 @@
- type: reagent
id: Alkysine
name: alkysine
+ group: Medicine
desc: Lessens the damage to neurological tissue, effective even after catastrophic injury. Used for treating brain damage and also a fairly effective painkiller.
physicalDesc: oily
color: "#ff8c00"
@@ -17,6 +19,7 @@
- type: reagent
id: Dylovene
name: dylovene
+ group: Medicine
desc: A broad-spectrum anti-toxin, which treats toxin damage in the blood stream. Overdosing will cause vomiting, dizzyness and pain.
physicalDesc: translucent
color: "#3a1d8a"
@@ -37,6 +40,7 @@
- type: reagent
id: Diphenhydramine
name: diphenhydramine
+ group: Medicine
desc: Rapidly purges the body of histamine and reduces jitteriness.
physicalDesc: chalky
color: "#64ffe6"
@@ -54,6 +58,7 @@
- type: reagent
id: Arithrazine
name: arithrazine
+ group: Medicine
desc: A slightly unstable medication used for the most extreme any serious case of radiation poisoning. Lowers radiation level at over twice the rate Hyronalin does and will heal toxin damage at the same time. Deals very minor brute damage to the patient over time, but the patient's body will typically out-regenerate it easily.
physicalDesc: cloudy
color: "#bd5902"
@@ -70,6 +75,7 @@
- type: reagent
id: Bicaridine
name: bicaridine
+ group: Medicine
desc: An analgesic which is highly effective at treating brute damage. It is useful for stabilizing people who have been severely beaten, as well as treating less life-threatening injuries. In the case of bleeding (internal or external), bicaridine will slow down the bleeding heavily. If the dosage exceeds the overdose limit, it'll stop it outright.
physicalDesc: opaque
color: "#ffaa00"
@@ -84,6 +90,7 @@
- type: reagent
id: Cryoxadone
name: cryoxadone
+ group: Medicine
desc: Required for the proper function of cryogenics. Heals all standard types of damage very swiftly, but only works in temperatures under 170K (usually this means cryo cells). Can also slowly heal clone damage, such as caused by cloning or Slimes.
physicalDesc: fizzy
color: "#0091ff"
@@ -111,6 +118,7 @@
- type: reagent
id: Clonexadone
name: clonexadone
+ group: Medicine
parent: Cryoxadone
desc: Heals standard damage in the same as Cryoxadone, with the same temperature requirement. Significantly more effective than the former at treating cellular damage, although both can be used simultaneously. Best used in cryo cells.
physicalDesc: bubbly
@@ -124,6 +132,7 @@
- type: reagent
id: Citalopram
name: citalopram
+ group: Medicine
desc: Prevents hallucination slightly.
physicalDesc: cloudy
color: "#21693c"
@@ -133,6 +142,7 @@
- type: reagent
id: Dermaline
name: dermaline
+ group: Medicine
desc: An advanced chemical that is more effective at treating burn damage than Kelotane.
physicalDesc: translucent
color: "#215263"
@@ -147,6 +157,7 @@
- type: reagent
id: Dexalin
name: dexalin
+ group: Medicine
desc: Used for treating oxygen deprivation. In most cases where it is likely to be needed, the strength of Dexalin Plus will probably be more useful (Results in 1 unit instead of 2).
physicalDesc: opaque
color: "#0041a8"
@@ -161,6 +172,7 @@
- type: reagent
id: DexalinPlus
name: dexalin plus
+ group: Medicine
desc: Used in treatment of extreme cases of oxygen deprivation. Even a single unit immediately counters all oxygen loss, which is hugely useful in many circumstances. Any dose beyond this will continue to counter oxygen loss until it is metabolized, essentially removing the need to breathe.
physicalDesc: cloudy
color: "#4da0bd"
@@ -175,6 +187,7 @@
- type: reagent
id: Ethylredoxrazine
name: ethylredoxrazine
+ group: Medicine
desc: Neutralises the effects of alcohol in the blood stream. Though it is commonly needed, it is rarely requested.
physicalDesc: opaque
color: "#2d5708"
@@ -184,6 +197,7 @@
- type: reagent
id: Epinephrine
name: epinephrine
+ group: Medicine
desc: Effective at bringing people back from a critical state. Reduces some stun times. Easy to overdose on.
physicalDesc: odorless
color: "#d2fffa"
@@ -243,6 +257,7 @@
- type: reagent
id: Hyperzine
name: hyperzine
+ group: Medicine
desc: A highly effective, long lasting muscle stimulant. It allows greater freedom of movement in bulky clothing although it has the side effect of causing some twitching. Dangerous in higher doses.
physicalDesc: translucent
color: "#17bd61"
@@ -250,6 +265,7 @@
- type: reagent
id: Hyronalin
name: hyronalin
+ group: Medicine
desc: A weak treatment for radiation damage. Considered to be useful mainly for genetic modification, where it reduces radiation levels, and thus the chance of genetic mutations. Largely outclassed by Arithrazine.
physicalDesc: cloudy
color: "#4cb580"
@@ -264,6 +280,7 @@
- type: reagent
id: Imidazoline
name: imidazoline
+ group: Medicine
desc: Effective in treating eye trauma. It heals damage caused by physical or chemical trauma, though it is ineffective in treating genetic defects in the eyes.
physicalDesc: pungent
color: "#f7ef00"
@@ -272,6 +289,7 @@
- type: reagent
id: Inacusiate
name: inacusiate
+ group: Medicine
desc: You only need 1u for Inacusiate to be effective. Cures deafness instantly. Useful after an explosion.
physicalDesc: pungent
color: "#c4c04b"
@@ -280,6 +298,7 @@
- type: reagent
id: Inaprovaline
name: inaprovaline
+ group: Medicine
desc: Inaprovaline is a synaptic stimulant and cardiostimulant. Commonly used to stabilize patients- it stops oxygen loss when the patient is in critical health. It'll also slow down bleeding (internal or external) by half while in the body. Acts as a decent painkiller.
physicalDesc: opaque
color: "#731024"
@@ -298,6 +317,7 @@
- type: reagent
id: Kelotane
name: kelotane
+ group: Medicine
desc: Treats burn damage and prevents infection.
physicalDesc: strong-smelling
color: "#bf3d19"
@@ -312,6 +332,7 @@
- type: reagent
id: Leporazine
name: leporazine
+ group: Medicine
desc: This keeps a patient's body temperature stable. High doses can allow short periods of unprotected EVA, but prevents use of the cryogenics tubes.
physicalDesc: pungent
color: "#ff7db5"
@@ -336,6 +357,7 @@
- type: reagent
id: Methylin
name: methylin
+ group: Medicine
desc: An intelligence enhancer, also used in the treatment of attention deficit hyperactivity disorder. Also known as Ritalin. Allows monkeys (not diona nymphs) to understand human speech and improves their dexterity as long as they have some in their system. Causes toxin and brain damage in higher doses.
physicalDesc: acrid
color: "#a700c4"
@@ -343,6 +365,7 @@
- type: reagent
id: Oxycodone
name: oxycodone
+ group: Medicine
desc: A very effective painkiller, about 250% as strong as Tramadol.
physicalDesc: acrid
color: "#c4a300"
@@ -350,6 +373,7 @@
- type: reagent
id: Phalanximine
name: phalanximine
+ group: Medicine
desc: Used in the treatment of cancer, is as effective as Anti-Toxin. Causes moderate radiation and hair loss.
physicalDesc: acrid
color: "#c8ff75"
@@ -366,6 +390,7 @@
- type: reagent
id: Paroxetine
name: paroxetine
+ group: Medicine
desc: Prevents hallucination, but has a 10% chance of causing intense hallucinations.
physicalDesc: acrid
color: "#fffbad"
@@ -374,6 +399,7 @@
- type: reagent
id: Ryetalyn
name: ryetalyn
+ group: Medicine
desc: You only need 1u for Ryetalin to work. Deactivates genetic defects and powers, restoring a patient to an ideal state. May be useful if genetics is unable to function properly. Deactivated effects return if the patient's genes are modified again.
physicalDesc: cloudy
color: "#532fd4"
@@ -381,6 +407,7 @@
- type: reagent
id: Spaceacillin
name: spaceacillin
+ group: Medicine
desc: A theta-lactam antibiotic. A common and very useful medicine, effective against many diseases likely to be encountered in space. Slows progression of diseases.
physicalDesc: opaque
color: "#9942f5"
@@ -388,6 +415,7 @@
- type: reagent
id: Synaptizine
name: synaptizine
+ group: Medicine
desc: Toxic, but treats hallucinations, drowsiness & halves the duration of paralysis, stuns and knockdowns. One unit is enough to treat hallucinations; two units is deadly.
physicalDesc: pungent
color: "#d49a2f"
@@ -410,6 +438,7 @@
- type: reagent
id: Tramadol
name: tramadol
+ group: Medicine
desc: A simple, yet effective painkiller. Very effective for patients in shock.
physicalDesc: strong-smelling
color: "#2f6ed4"
@@ -417,6 +446,7 @@
- type: reagent
id: Tricordrazine
name: tricordrazine
+ group: Medicine
desc: A wide-spectrum stimulant, originally derived from Cordrazine. Is capable of healing all four main damage types simultaneously, however it only heals at half the rate of conventional healing chemicals. Because of its low potency, it's best used as a supplement to other medicines.
physicalDesc: opaque
color: "#00e5ff"
@@ -434,6 +464,7 @@
- type: reagent
id: ChloralHydrate
name: chloral hydrate
+ group: Medicine
desc: A powerful sedative which causes death in doses upwards of 16.2 units. Sends the patient to sleep almost instantly.
physicalDesc: acrid
color: "#18c9b1"
@@ -442,6 +473,7 @@
- type: reagent
id: Cryptobiolin
name: cryptobiolin
+ group: Medicine
desc: Causes confusion and dizziness. This is essential to make Spaceacillin.
physicalDesc: fizzy
color: "#081a80"
@@ -450,6 +482,7 @@
- type: reagent
id: Lipozine
name: lipozine
+ group: Medicine
desc: Causes weight loss upon consumption.
physicalDesc: oily
color: "#2690b5"
@@ -463,6 +496,7 @@
- type: reagent
id: Sterilizine
name: sterilizine
+ group: Medicine
desc: Helps the patient when used during surgery, may also decontaminate objects and surfaces that bear pathogens. Is currently useless due to infections not being a thing.
physicalDesc: strong-smelling
color: "#7cad37"
@@ -470,6 +504,7 @@
- type: reagent
id: Omnizine
name: Omnizine
+ group: Medicine
desc: A soothing milky liquid with an iridescent gleam. A well known conspiracy theory says that it's origins remain a mystery because knowing the secrets of its production would render most commercial pharmaceuticals obsolete.
physicalDesc: soothing
color: "#fcf7f9"
@@ -483,10 +518,11 @@
Toxin: -2
Airloss: -2
Brute: -2
-
+
- type: reagent
id: Ultravasculine
name: Ultravasculine
+ group: Medicine
desc: Rapidly flushes toxins from the body, but places some stress on the veins. Do not overdose.
physicalDesc: thick and grainy
color: "#520e30"
diff --git a/Resources/Prototypes/Reagents/narcotics.yml b/Resources/Prototypes/Reagents/narcotics.yml
index 586c54643d..3603bb6f22 100644
--- a/Resources/Prototypes/Reagents/narcotics.yml
+++ b/Resources/Prototypes/Reagents/narcotics.yml
@@ -1,6 +1,7 @@
- type: reagent
id: Desoxyephedrine
name: desoxyephedrine
+ group: Narcotics
desc: Desoxyephedrine is a potent stimulant with dangerous side-effects if too much is consumed.
physicalDesc: translucent
color: "#FAFAFA"
@@ -42,6 +43,7 @@
- type: reagent
id: Ephedrine
name: ephedrine
+ group: Narcotics
desc: Increases stun resistance and movement speed, giving you hand cramps. Overdose deals toxin damage and inhibits breathing.
physicalDesc: Bone white
color: "#D2FFFA"
@@ -78,6 +80,7 @@
- type: reagent
id: THC
name: THC
+ group: Narcotics
desc: The main psychoactive compound in cannabis.
color: "#808080"
physicalDesc: crystalline
@@ -90,6 +93,7 @@
- type: reagent
id: THCOil
name: THC oil
+ group: Narcotics
desc: Pure THC oil, extracted from the leaves of the cannabis plant. Much stronger than in it's natural form and can be used to numb chronic pain in patients.
physicalDesc: skunky
color: "#DAA520"
@@ -97,6 +101,7 @@
- type: reagent
id: Nicotine
name: Nicotine
+ group: Narcotics
desc: Dangerous and highly addictive.
color: "#C0C0C0"
physicalDesc: strong smelling
@@ -107,6 +112,7 @@
- type: reagent
id: Impedrezene
name: impedrezene
+ group: Narcotics
desc: A narcotic that impedes one's ability by slowing down the higher brain cell functions. Causes massive brain damage.
physicalDesc: acrid
color: "#215263"
@@ -114,6 +120,7 @@
- type: reagent
id: SpaceDrugs
name: space drugs
+ group: Narcotics
desc: An illegal compound which induces a number of effects such as loss of balance and visual artefacts.
physicalDesc: syrupy
color: "#63806e"
diff --git a/Resources/Prototypes/Reagents/pyrotechnic.yml b/Resources/Prototypes/Reagents/pyrotechnic.yml
index aa0f02b0e7..e47609d663 100644
--- a/Resources/Prototypes/Reagents/pyrotechnic.yml
+++ b/Resources/Prototypes/Reagents/pyrotechnic.yml
@@ -1,5 +1,7 @@
- type: reagent
id: BasePyrotechnic
+ group: Pyrotechnic
+ abstract: true
reactiveEffects:
Flammable:
methods: [ Touch ]
diff --git a/Resources/Prototypes/Reagents/toxins.yml b/Resources/Prototypes/Reagents/toxins.yml
index 4f2668a033..5f517a79a5 100644
--- a/Resources/Prototypes/Reagents/toxins.yml
+++ b/Resources/Prototypes/Reagents/toxins.yml
@@ -1,6 +1,7 @@
- type: reagent
id: Toxin
name: toxin
+ group: Toxins
desc: A Toxic chemical.
color: "#cf3600"
physicalDesc: opaque
@@ -20,6 +21,7 @@
- type: reagent
id: PolytrinicAcid
name: polytrinic acid
+ group: Toxins
desc: An extremely corrosive chemical substance. The slightest touch of it will melt off most masks and headgear, and it deals extreme damage to anyone who comes directly into contact with it.
physicalDesc: strong-smelling
color: "#a1000b"
@@ -60,6 +62,7 @@
- type: reagent
id: FluorosulfuricAcid
name: fluorosulfuric acid
+ group: Toxins
desc: An extremely corrosive chemical substance.
physicalDesc: strong-smelling
color: "#5050ff"
@@ -93,6 +96,7 @@
- type: reagent
id: SulfuricAcid
name: sulfuric acid
+ group: Toxins
desc: A highly corrosive, oily, colorless liquid.
physicalDesc: oily
color: "#BF8C00"
@@ -134,6 +138,7 @@
- type: reagent
id: Plasma
name: plasma
+ group: Toxins
desc: Funky, space-magic pixie dust. You probably shouldn't eat this, but we both know you will anyways.
physicalDesc: gaseous
color: "#7e009e"
@@ -161,6 +166,7 @@
- type: reagent
id: UnstableMutagen
name: unstable mutagen
+ group: Toxins
desc: Causes mutations when injected into living people or plants. High doses may be lethal, especially in humans.
physicalDesc: glowing
color: "#00ff5f"
@@ -180,6 +186,7 @@
- type: reagent
id: HeartbreakerToxin
name: heartbreaker toxin
+ group: Toxins
desc: A hallucinogenic compound that is illegal under space law. A synthetic drug derived from Mindbreaker toxin, it blocks some neurological signals to the respiratory system which causes choking.
physicalDesc: strong-smelling
color: "#5f959c"
@@ -197,6 +204,7 @@
- type: reagent
id: Lexorin
name: lexorin
+ group: Toxins
desc: Temporarily stops respiration and causes tissue damage. Large doses are fatal, and will cause people to pass out very quickly. Dexalin and Dexalin Plus will both remove it, however.
physicalDesc: pungent
color: "#6b0007"
@@ -211,6 +219,7 @@
- type: reagent
id: MindbreakerToxin
name: mindbreaker toxin
+ group: Toxins
desc: A potent hallucinogenic compound that is illegal under space law. Formerly known as LSD.
physicalDesc: opaque
color: "#77b58e"
@@ -222,6 +231,7 @@
- type: reagent
id: Soporific
name: soporific (sleep-toxin)
+ group: Toxins
desc: A less powerful sedative that takes a while to work, intended to help insomniacs and patients that are too aggressive to be treated normally. Takes roughly 50 seconds to make the patient fall asleep. Is safe in large quantities. Can be counteracted with Anti-Toxin.
physicalDesc: acrid
color: "#215263"
@@ -230,6 +240,7 @@
- type: reagent
id: Histamine
name: histamine
+ group: Toxins
desc: Histamine's effects become more dangerous depending on the dosage amount. They range from mildly annoying to incredibly lethal.
physicalDesc: abrasive
color: "#FA6464"
@@ -266,6 +277,7 @@
- type: reagent
id: Theobromine
name: theobromine
+ group: Toxins
desc: Theobromine is a bitter alkaloid of the cacao plant found in chocolate, and some other foods.
physicalDesc: grainy
color: "#f5f5f5"