mild reagent prototype cleanup + other misc garbage (#22630)

This commit is contained in:
Nemanja
2023-12-16 22:34:13 -05:00
committed by GitHub
parent 00aa408501
commit 0a81038a17
8 changed files with 55 additions and 44 deletions

View 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)
{