Files
wwdpublic/Content.Shared/Research/Components/ResearchServerComponent.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

67 lines
2.1 KiB
C#

using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Research.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ResearchServerComponent : Component
{
/// <summary>
/// The name of the server
/// </summary>
[AutoNetworkedField]
[DataField("serverName"), ViewVariables(VVAccess.ReadWrite)]
public string ServerName = "RDSERVER";
/// <summary>
/// The amount of points on the server.
/// </summary>
[AutoNetworkedField]
[DataField("points"), ViewVariables(VVAccess.ReadWrite)]
public int Points;
/// <summary>
/// A unique numeric id representing the server
/// </summary>
[AutoNetworkedField]
[ViewVariables(VVAccess.ReadOnly)]
public int Id;
/// <summary>
/// Entities connected to the server
/// </summary>
/// <remarks>
/// This is not safe to read clientside
/// </remarks>
[ViewVariables(VVAccess.ReadOnly)]
public List<EntityUid> Clients = new();
[DataField("nextUpdateTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan NextUpdateTime = TimeSpan.Zero;
[DataField("researchConsoleUpdateTime"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan ResearchConsoleUpdateTime = TimeSpan.FromSeconds(1);
[DataField, AutoNetworkedField]
public float CurrentSoftCapMultiplier = 1;
}
/// <summary>
/// Event raised on a server's clients when the point value of the server is changed.
/// </summary>
/// <param name="Server"></param>
/// <param name="Total"></param>
/// <param name="Delta"></param>
[ByRefEvent]
public readonly record struct ResearchServerPointsChangedEvent(EntityUid Server, int Total, int Delta);
/// <summary>
/// Event raised every second to calculate the amount of points added to the server.
/// </summary>
/// <param name="Server"></param>
/// <param name="Points"></param>
[ByRefEvent]
public record struct ResearchServerGetPointsPerSecondEvent(EntityUid Server, int Points);