mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-14 19:29:53 +01:00
* feat: RnD tech research console now have reroll feature * fix: disable Rediscover button when there is not enough currency or user have no access * refactor: xml-doc, extract method, minor simplify xaml * minor cleanup after review * refactor: change sending research server points amount into BUI from state to ResearchServerComponent (using AfterAutoHandleStateEvent) * feat: now tech rerolls will have cooldown to ensure no one can spam-spend all dept budget instantly * refactor: revert unneeded code * refactor: whitespaces --------- Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
64 lines
2.1 KiB
C#
64 lines
2.1 KiB
C#
using Content.Shared.Lathe;
|
|
using Content.Shared.Research.Prototypes;
|
|
using Content.Shared.Research.Systems;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.Research.Components;
|
|
|
|
[RegisterComponent, NetworkedComponent, Access(typeof(SharedResearchSystem), typeof(SharedLatheSystem)), AutoGenerateComponentState]
|
|
public sealed partial class TechnologyDatabaseComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// A main discipline that locks out other discipline technology past a certain tier.
|
|
/// </summary>
|
|
[AutoNetworkedField]
|
|
[DataField]
|
|
public ProtoId<TechDisciplinePrototype>? MainDiscipline;
|
|
|
|
[AutoNetworkedField]
|
|
[DataField]
|
|
public List<ProtoId<TechnologyPrototype>> CurrentTechnologyCards = new();
|
|
|
|
/// <summary>
|
|
/// Which research disciplines are able to be unlocked
|
|
/// </summary>
|
|
[AutoNetworkedField]
|
|
[DataField]
|
|
public List<ProtoId<TechDisciplinePrototype>> SupportedDisciplines = new();
|
|
|
|
/// <summary>
|
|
/// The ids of all the technologies which have been unlocked.
|
|
/// </summary>
|
|
[AutoNetworkedField]
|
|
[DataField]
|
|
public List<ProtoId<TechnologyPrototype>> 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]
|
|
public List<ProtoId<LatheRecipePrototype>> UnlockedRecipes = new();
|
|
}
|
|
|
|
/// <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(List<string>? NewlyUnlockedRecipes);
|
|
|
|
/// <summary>
|
|
/// Event raised on a database after being synchronized
|
|
/// with the values from another database.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public readonly record struct TechnologyDatabaseSynchronizedEvent;
|