Skip to content

Commit

Permalink
Merge pull request #142 from Gorox221/dream
Browse files Browse the repository at this point in the history
Мелкие правки
  • Loading branch information
Yuoko authored Apr 28, 2024
2 parents 17f6e79 + e61fc41 commit 45d5a17
Show file tree
Hide file tree
Showing 36 changed files with 896 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using Content.Shared.Roles;
using Content.Shared.Whitelist;
using Robust.Shared.Prototypes;

namespace Content.Server.Corvax.HiddenDescription;

/// <summary>
/// A component that shows players with specific roles or jobs additional information about entities
/// </summary>

[RegisterComponent, Access(typeof(HiddenDescriptionSystem))]
public sealed partial class HiddenDescriptionComponent : Component
{
[DataField(required: true)]
public List<HiddenDescriptionEntry> Entries = new();

/// <summary>
/// Prioritizing the location of classified information in an inspection
/// </summary>
[DataField]
public int PushPriority = 1;
}

[DataDefinition, Serializable]
public readonly partial record struct HiddenDescriptionEntry()
{
/// <summary>
/// Locale string with hidden description
/// </summary>
[DataField(required: true)]
public LocId Label { get; init; } = default!;

/// <summary>
/// A player's mind must pass a whitelist check to receive hidden information
/// </summary>
[DataField]
public EntityWhitelist WhitelistMind { get; init; } = new();

/// <summary>
/// A player's body must pass a whitelist check to receive hidden information
/// </summary>
[DataField]
public EntityWhitelist WhitelistBody { get; init; } = new();

/// <summary>
/// The player's mind has to have some job role to access the hidden information
/// </summary>
[DataField]
public List<ProtoId<JobPrototype>> JobRequired { get; init; } = new();

/// <summary>
/// If true, the player needs to go through and whitelist, and have some job. By default, at least one successful checks is sufficient.
/// </summary>
[DataField]
public bool NeedAllCheck { get; init; } = false;
}
37 changes: 37 additions & 0 deletions Content.Server/Corvax/HiddenDescription/HiddenDescriptionSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Content.Server.Mind;
using Content.Shared.Examine;
using Content.Shared.Roles.Jobs;

namespace Content.Server.Corvax.HiddenDescription;

public sealed partial class HiddenDescriptionSystem : EntitySystem
{

[Dependency] private readonly MindSystem _mind = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<HiddenDescriptionComponent, ExaminedEvent>(OnExamine);
}

private void OnExamine(Entity<HiddenDescriptionComponent> hiddenDesc, ref ExaminedEvent args)
{
_mind.TryGetMind(args.Examiner, out var mindId, out var mindComponent);
TryComp<JobComponent>(mindId, out var job);

foreach (var item in hiddenDesc.Comp.Entries)
{
var isJobAllow = job?.Prototype != null && item.JobRequired.Contains(job.Prototype.Value);
var isMindWhitelistPassed = item.WhitelistMind.IsValid(mindId);
var isBodyWhitelistPassed = item.WhitelistMind.IsValid(args.Examiner);
var passed = item.NeedAllCheck
? isMindWhitelistPassed && isBodyWhitelistPassed && isJobAllow
: isMindWhitelistPassed || isBodyWhitelistPassed || isJobAllow;

if (passed)
args.PushMarkup(Loc.GetString(item.Label), hiddenDesc.Comp.PushPriority);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ corvax-hidden-desc-SadTromboneImplanter-research = [color=#D381C9]Это имп
corvax-hidden-desc-LightImplanter-research = [color=#D381C9]Это имплантер света. Позволяет коже владельца слабо светиться по его желанию.[/color]
corvax-hidden-desc-BikeHornImplanter-research = [color=#D381C9]Это хонк-имплантер. Позволяет издавать смешные звуки непонятно откуда.[/color]
corvax-hidden-desc-TrackingImplanter-research = [color=#D381C9]Это трекер-имплантер. Транслирует местоположение и жизненные показатели владельца на сервер мониторинга экипажа.[/color]
corvax-hidden-desc-MindShieldImplanter-research = [color=#D381C9]Это имплант "Щит разума". Гарантирует лояльность корпорации Nanotrasen и предотвращает воздействие устройств контроля сознания.[/color]
corvax-hidden-desc-MindShieldImplanter-research = [color=#D381C9]Это имплант "Щит разума". Защищает от промывки мозгов, а так-же позволяет отменить недавнюю промывку мозгов и в дальнейшем предотвратить таковую, имплант не отменяет длительное внушение.[/color]
corvax-hidden-desc-StorageImplanter-research = [color=#D381C9]Это имплантер подкожного хранилища. Позволяет организовать скрытое хранилище внутри тела с использованием блюспейс-технологии.[/color]
corvax-hidden-desc-FreedomImplanter-research = [color=#D381C9]Это имплантер свободы. Позволяет пользователю до трёх раз вырваться из наручников, прежде чем он перестанет функционировать.[/color]
corvax-hidden-desc-UplinkImplanter-research = [color=#D381C9]Это имплантер чёрного рынка. Позволяет владельцу пользоваться чёрным рынком.[/color]
Expand All @@ -64,7 +64,7 @@ corvax-hidden-desc-SadTromboneImplanter-syndicate = [color=#e31735]Это имп
corvax-hidden-desc-LightImplanter-syndicate = [color=#e31735]Это имплантер света. Позволит коже слабо светиться по желанию.[/color]
corvax-hidden-desc-BikeHornImplanter-syndicate = [color=#e31735]Это хонк-имплантер. Позволит издавать смешные звуки непонятно откуда.[/color]
corvax-hidden-desc-TrackingImplanter-syndicate = [color=#e31735]Это трекер-имплантер. Будет транслировать местоположение и жизненные показатели на сервера NanoTrasen.[/color]
corvax-hidden-desc-MindShieldImplanter-syndicate = [color=#e31735]Это имплант "Щит разума". Гарантирует лояльность корпорации Nanotrasen и предотвращает воздействие устройств контроля сознания.[/color]
corvax-hidden-desc-MindShieldImplanter-syndicate = [color=#e31735]Это имплант "Щит разума". Защищает от промывки мозгов, а так-же позволяет отменить недавнюю промывку мозгов и в дальнейшем предотвратить таковую, имплант не отменяет моё длительное внушение.[/color]
corvax-hidden-desc-StorageImplanter-syndicate = [color=#e31735]Это имплантер подкожного хранилища. Позволит хранить контрабанду внутри тела.[/color]
corvax-hidden-desc-FreedomImplanter-syndicate = [color=#e31735]Это имплантер свободы. Позволит до трёх раз вырваться из наручников, освободившись из плена.[/color]
corvax-hidden-desc-UplinkImplanter-syndicate = [color=#e31735]Это имплантер чёрного рынка. Позволит пользоваться спрятанным аплинком Синдиката, даже если у меня всё заберут.[/color]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ ent-ClothingOuterHardsuitTSFHeavy = тяжелый скафандр ТСФ
.desc = Скафандр, используемый флотом ТСФ против агрессивной фауны.
ent-ClothingHeadHelmetHardsuitTSFHeavy = шлем тяжелого скафандра ТСФ
.desc = Бронированный шлем, используемый военными скафандрами ТСФ против агрессивных форм жизни.
ent-ClothingHeadHelmetHardsuitTSFWhite = шлем снежного скафандра ТСФ
.desc = Бронированный шлем, используемый военными скафандрами ТСФ.
ent-ClothingOuterHardsuitTSFWhite = снежный скафандр ТСФ
.desc = Скафандр, используемый флотом ТСФ в условиях экстренно низких температур.
42 changes: 42 additions & 0 deletions Resources/Prototypes/Entities/Clothing/Shoes/specific.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@
# ninja are masters of sneaking around relatively quickly, won't break cloak
walkModifier: 1.1
sprintModifier: 1.3
# Corvax-HiddenDesc-Start
- type: HiddenDescription
entries:
- label: corvax-hidden-desc-NoSlip-ninja
whitelistMind:
components:
- NinjaRole
- label: corvax-hidden-desc-NoSlip-research
jobRequired:
- ResearchAssistant
- SeniorResearcher
- ResearchDirector
- Scientist
- Borg
# Corvax-HiddenDesc-End

- type: entity
parent: ClothingShoesBaseButcherable
Expand Down Expand Up @@ -179,6 +194,33 @@
description: Stylish black shoes.
components:
- type: NoSlip
- type: HiddenDescription
entries:
- label: corvax-hidden-desc-Chameleon-syndicate
whitelistMind:
components:
- TraitorRole
- NukeOperative
- label: corvax-hidden-desc-NoSlip-syndicate
whitelistMind:
components:
- TraitorRole
- NukeOperative
- label: corvax-hidden-desc-Chameleon-research
jobRequired:
- ResearchAssistant
- SeniorResearcher
- ResearchDirector
- Scientist
- Borg
- label: corvax-hidden-desc-NoSlip-research
jobRequired:
- ResearchAssistant
- SeniorResearcher
- ResearchDirector
- Scientist
- Borg
# Corvax-HiddenDesc-End

- type: entity
parent: ClothingShoesClown
Expand Down
13 changes: 13 additions & 0 deletions Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,19 @@
- type: Tag
tags:
- Fruit # It's in the name
# Corvax-HiddenDesc-Start
- type: HiddenDescription
entries:
- label: corvax-hidden-desc-Gatfruit-syndicate
whitelistMind:
components:
- TraitorRole
- NukeOperative
- label: corvax-hidden-desc-Gatfruit-botanist
jobRequired:
- Botanist
- Borg
# Corvax-HiddenDesc-End

- type: entity
name: rice bushel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@
state: combat_hypo
- type: GuardianCreator
guardianProto: MobHoloparasiteGuardian
# Corvax-HiddenDesc-Start
- type: HiddenDescription
entries:
- label: corvax-hidden-desc-HoloparasiteInjector-syndicate
whitelistMind:
components:
- TraitorRole
- NukeOperative
- label: corvax-hidden-desc-HoloparasiteInjector-research
jobRequired:
- ResearchAssistant
- ResearchDirector
- SeniorResearcher
- Scientist
- Borg
- label: corvax-hidden-desc-IllegalImplants-medical
jobRequired:
- Paramedic
- MedicalDoctor
- ChiefMedicalOfficer
# Corvax-HiddenDesc-End

- type: entity
name: holoclown injector
Expand All @@ -18,6 +39,27 @@
components:
- type: GuardianCreator
guardianProto: MobHoloClownGuardian
# Corvax-HiddenDesc-Start
- type: HiddenDescription
entries:
- label: corvax-hidden-desc-HoloClownInjector-syndicate
whitelistMind:
components:
- TraitorRole
- NukeOperative
- label: corvax-hidden-desc-HoloClownInjector-research
jobRequired:
- ResearchAssistant
- SeniorResearcher
- ResearchDirector
- Scientist
- Borg
- label: corvax-hidden-desc-IllegalImplants-medical
jobRequired:
- Paramedic
- MedicalDoctor
- ChiefMedicalOfficer
# Corvax-HiddenDesc-End

- type: entity
name: magical lamp
Expand Down
16 changes: 16 additions & 0 deletions Resources/Prototypes/Entities/Objects/Fun/darts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@
solution: melee
- type: SolutionTransfer
maxTransferAmount: 7
# Corvax-HiddenDesc-Start
- type: HiddenDescription
entries:
- label: corvax-hidden-desc-HypoDart-syndicate
whitelistMind:
components:
- TraitorRole
- NukeOperative
- label: corvax-hidden-desc-HypoDart-research
jobRequired:
- ResearchAssistant
- SeniorResearcher
- ResearchDirector
- Scientist
- Borg
# Corvax-HiddenDesc-End

- type: entity
name: dartboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
heldPrefix: blue
- type: IdCard
jobTitle: Офицер ЦК
jobIcon: JobIconCentCom
jobIcon: JobIconNanotrasen
- type: Access
groups:
- AllAccess
Expand Down Expand Up @@ -564,6 +564,7 @@
- type: IdCard
jobTitle: ОБР Офицер Безопасности
jobIcon: JobIconERTOfficer

- type: entity
parent: IDCardStandard
id: CentcomIDCardSyndie
Expand Down Expand Up @@ -716,6 +717,22 @@
type: AgentIDCardBoundUserInterface
- key: enum.ChameleonUiKey.Key
type: ChameleonBoundUserInterface
# Corvax-HiddenDesc-Start
- type: HiddenDescription
entries:
- label: corvax-hidden-desc-AgentIDCard-syndicate
whitelistMind:
components:
- TraitorRole
- NukeOperative
- label: corvax-hidden-desc-AgentIDCard-research
jobRequired:
- ResearchAssistant
- SeniorResearcher
- ResearchDirector
- Scientist
- Borg
# Corvax-HiddenDesc-End

- type: entity
name: passenger ID card
Expand Down
Loading

0 comments on commit 45d5a17

Please sign in to comment.