Remove random reaction system (#1345)

* wow

* d
This commit is contained in:
Red
2025-06-01 15:01:32 +03:00
committed by GitHub
parent 759e7c73d9
commit a99f2fcd50
11 changed files with 38 additions and 139 deletions

View File

@@ -51,42 +51,11 @@ namespace Content.Shared.Chemistry.Reaction
[DataField("requiredMixerCategories")]
public List<ProtoId<MixingCategoryPrototype>>? MixingCategories;
// CP14 random reactions begin
/// <summary>
/// Reagents created when the reaction occurs.
/// </summary>
[DataField("products", customTypeSerializer:typeof(PrototypeIdDictionarySerializer<FixedPoint2, ReagentPrototype>))]
public Dictionary<string, FixedPoint2> _products = new(); // CP14 random reactions
public Dictionary<string, FixedPoint2> Products
{
get {
if (Cp14RandomProducts.Count == 0)
return _products;
// New dict because we don't want to modify original products dict
Dictionary<string, FixedPoint2> res = new(_products);
foreach (var product in Cp14RandomProducts[Cp14RandomProductIndex])
{
if (res.ContainsKey(product.Key))
res[product.Key] += product.Value;
else
res[product.Key] = product.Value;
}
return res;
}
set {
_products = value;
}
}
public int Cp14RandomProductIndex = 0;
/// <summary>
/// Random reagents groups, one of which will be selected at the roundstart and will be used as a reaction product.
/// </summary>
[DataField("cp14RandomProducts")]
public List<Dictionary<string, FixedPoint2>> Cp14RandomProducts = new();
// CP14 random reactions end
public Dictionary<string, FixedPoint2> Products = new();
/// <summary>
/// Effects to be triggered when the reaction occurs.