technology auto guidebook (#21029)

* technology auto guidebook

* boo-womp

* boo-womp II
This commit is contained in:
Nemanja
2023-10-16 17:51:58 -04:00
committed by GitHub
parent fedc7c6957
commit fd994511a7
14 changed files with 296 additions and 52 deletions

View File

@@ -1,6 +1,4 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Utility;
namespace Content.Shared.Research.Prototypes;
@@ -19,57 +17,57 @@ public sealed class TechnologyPrototype : IPrototype
/// The name of the technology.
/// Supports locale strings
/// </summary>
[DataField("name", required: true)]
public string Name = string.Empty;
[DataField(required: true)]
public LocId Name = string.Empty;
/// <summary>
/// An icon used to visually represent the technology in UI.
/// </summary>
[DataField("icon", required: true)]
[DataField(required: true)]
public SpriteSpecifier Icon = default!;
/// <summary>
/// What research discipline this technology belongs to.
/// </summary>
[DataField("discipline", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<TechDisciplinePrototype>))]
public string Discipline = default!;
[DataField(required: true)]
public ProtoId<TechDisciplinePrototype> Discipline;
/// <summary>
/// What tier research is this?
/// The tier governs how much lower-tier technology
/// needs to be unlocked before this one.
/// </summary>
[DataField("tier", required: true)]
[DataField(required: true)]
public int Tier;
/// <summary>
/// Hidden tech is not ever available at the research console.
/// </summary>
[DataField("hidden")]
[DataField]
public bool Hidden;
/// <summary>
/// How much research is needed to unlock.
/// </summary>
[DataField("cost")]
[DataField]
public int Cost = 10000;
/// <summary>
/// A list of <see cref="TechnologyPrototype"/>s that need to be unlocked in order to unlock this technology.
/// </summary>
[DataField("technologyPrerequisites", customTypeSerializer: typeof(PrototypeIdListSerializer<TechnologyPrototype>))]
public IReadOnlyList<string> TechnologyPrerequisites = new List<string>();
[DataField]
public List<ProtoId<TechnologyPrototype>> TechnologyPrerequisites = new();
/// <summary>
/// A list of <see cref="LatheRecipePrototype"/>s that are unlocked by this technology
/// </summary>
[DataField("recipeUnlocks", customTypeSerializer: typeof(PrototypeIdListSerializer<LatheRecipePrototype>))]
public IReadOnlyList<string> RecipeUnlocks = new List<string>();
[DataField]
public List<ProtoId<LatheRecipePrototype>> RecipeUnlocks = new();
/// <summary>
/// A list of non-standard effects that are done when this technology is unlocked.
/// </summary>
[DataField("genericUnlocks")]
[DataField]
public IReadOnlyList<GenericUnlock> GenericUnlocks = new List<GenericUnlock>();
}
@@ -80,13 +78,13 @@ public partial record struct GenericUnlock()
/// What event is raised when this is unlocked?
/// Used for doing non-standard logic.
/// </summary>
[DataField("purchaseEvent")]
[DataField]
public object? PurchaseEvent = null;
/// <summary>
/// A player facing tooltip for what the unlock does.
/// Supports locale strings.
/// </summary>
[DataField("unlockDescription")]
[DataField]
public string UnlockDescription = string.Empty;
}