Add plant metabolism effects to chemical guidebook (#28038)

* draft one of plant metabolism guidebook

* loc fix?

* add attributes loc

* fix loc syntax

* improved appearance

* last commit was undercooked, my bad

* last commit was still undercooked, my worse

* last commit was even still undercooked, my worst

* Addressed comments?

* Fix newlines

* Hopefully this works

* Cleanup, I think

* 2xs
This commit is contained in:
Flesh
2024-05-20 01:01:44 +02:00
committed by GitHub
parent f2df51660d
commit c551cafdae
22 changed files with 154 additions and 6 deletions

View File

@@ -195,12 +195,22 @@ namespace Content.Shared.Chemistry.Reagent
public Dictionary<ProtoId<MetabolismGroupPrototype>, ReagentEffectsGuideEntry>? GuideEntries;
public List<string>? PlantMetabolisms = null;
public ReagentGuideEntry(ReagentPrototype proto, IPrototypeManager prototype, IEntitySystemManager entSys)
{
ReagentPrototype = proto.ID;
GuideEntries = proto.Metabolisms?
.Select(x => (x.Key, x.Value.MakeGuideEntry(prototype, entSys)))
.ToDictionary(x => x.Key, x => x.Item2);
if (proto.PlantMetabolisms.Count > 0)
{
PlantMetabolisms = new List<string> (proto.PlantMetabolisms
.Select(x => x.GuidebookEffectDescription(prototype, entSys))
.Where(x => x is not null)
.Select(x => x!)
.ToArray());
}
}
}