Files
wwdpublic/Content.Shared/Research/Components/TechnologyDatabaseComponent.cs
VMSolidus 0acf7c5b4b Replace Tech Lockout With Softcap (#1605)
# Description

This PR fully replaces the "Tier 3 Tech Lockout" with a research
softcap. How it works is that technologies are allowed to set a softcap
contribution, meaning that they multiplicatively increase the cost of
all other research by a certain amount. By default, this is done by all
Tier 3 Technologies. Essentially, this means that you're no longer
limited to a single research category's tier 3 selections. Instead the
costs of research increase the more capstones you unlock. The current
cost increase for research is displayed on the console.

<details><summary><h1>Media</h1></summary>
<p>

![image](https://github.com/user-attachments/assets/e65fa1ee-c849-489c-b690-f7ce8d98b678)

</p>
</details>

# Changelog

🆑
- remove: Removed the "Tier 3 Tech Lockout" mechanic. You are no longer
limited to 1 discipline worth of t3 research.
- add: Research is now "Softcapped" by Tier 3 unlocks. Each unlocked
Tier 3 technology multiplicatively increases the cost of all other
research. Rushing a capstone can be quite expensive, as will be getting
multiple capstones. I hope you're glad that you can build more than one
prober now without guaranteeing the station will explode.

(cherry picked from commit b7da1f4ff64ca3ce8c4dc4545186573174b3e89c)
2025-01-20 21:24:31 +03:00

61 lines
2.3 KiB
C#

using Content.Shared.Lathe;
using Content.Shared.Research.Prototypes;
using Content.Shared.Research.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Research.Components;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedResearchSystem), typeof(SharedLatheSystem)), AutoGenerateComponentState]
public sealed partial class TechnologyDatabaseComponent : Component
{
/// <summary>
/// A main discipline that bypasses the T3 Softcap
/// </summary>
[AutoNetworkedField]
[DataField("mainDiscipline", customTypeSerializer: typeof(PrototypeIdSerializer<TechDisciplinePrototype>))]
public string? MainDiscipline;
[AutoNetworkedField]
[DataField("currentTechnologyCards")]
public List<string> CurrentTechnologyCards = new();
/// <summary>
/// Which research disciplines are able to be unlocked
/// </summary>
[AutoNetworkedField]
[DataField("supportedDisciplines", customTypeSerializer: typeof(PrototypeIdListSerializer<TechDisciplinePrototype>))]
public List<string> SupportedDisciplines = new();
/// <summary>
/// The ids of all the technologies which have been unlocked.
/// </summary>
[AutoNetworkedField]
[DataField("unlockedTechnologies", customTypeSerializer: typeof(PrototypeIdListSerializer<TechnologyPrototype>))]
public List<string> UnlockedTechnologies = new();
/// <summary>
/// The ids of all the lathe recipes which have been unlocked.
/// This is maintained alongside the TechnologyIds
/// </summary>
/// todo: if you unlock all the recipes in a tech, it doesn't count as unlocking the tech. sadge
[AutoNetworkedField]
[DataField("unlockedRecipes", customTypeSerializer: typeof(PrototypeIdListSerializer<LatheRecipePrototype>))]
public List<string> UnlockedRecipes = new();
[DataField, AutoNetworkedField]
public float SoftCapMultiplier = 1;
}
/// <summary>
/// Event raised on the database whenever its
/// technologies or recipes are modified.
/// </summary>
/// <remarks>
/// This event is forwarded from the
/// server to all of it's clients.
/// </remarks>
[ByRefEvent]
public readonly record struct TechnologyDatabaseModifiedEvent;