Files
wwdpublic/Content.Client/Research/UI/TechnologyCardControl.xaml.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

41 lines
1.7 KiB
C#

using Content.Shared.Research.Components;
using Content.Shared.Research.Prototypes;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Client.Research.UI;
[GenerateTypedNameReferences]
public sealed partial class TechnologyCardControl : Control
{
public Action? OnPressed;
public TechnologyCardControl(TechnologyPrototype technology, IPrototypeManager prototypeManager, SpriteSystem spriteSys, FormattedMessage description, int points, bool hasAccess, TechnologyDatabaseComponent database)
{
RobustXamlLoader.Load(this);
var discipline = prototypeManager.Index<TechDisciplinePrototype>(technology.Discipline);
Background.ModulateSelfOverride = discipline.Color;
DisciplineTexture.Texture = spriteSys.Frame0(discipline.Icon);
TechnologyNameLabel.Text = Loc.GetString(technology.Name);
var message = new FormattedMessage();
message.AddMarkup(Loc.GetString("research-console-tier-discipline-info",
("tier", technology.Tier), ("color", discipline.Color), ("discipline", Loc.GetString(discipline.Name))));
TierLabel.SetMessage(message);
UnlocksLabel.SetMessage(description);
TechnologyTexture.Texture = spriteSys.Frame0(technology.Icon);
if (!hasAccess)
ResearchButton.ToolTip = Loc.GetString("research-console-no-access-popup");
ResearchButton.Disabled = points < technology.Cost * database.SoftCapMultiplier || !hasAccess;
ResearchButton.OnPressed += _ => OnPressed?.Invoke();
}
}