Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PORT] настольные компьютеры залетают в игру! #1046

Merged
merged 5 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.Construction.Components
{
/// <summary>
/// Used for construction graphs in building tabletop computers.
/// </summary>
[RegisterComponent]
public sealed partial class ComputerTabletopBoardComponent : Component
{
[DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? Prototype { get; private set; }
}
}
8 changes: 8 additions & 0 deletions Content.Server/Construction/NodeEntities/BoardNodeEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ public sealed partial class BoardNodeEntity : IGraphNodeEntity

var board = container.ContainedEntities[0];

// Frontier - adds tabletop variants
if (args.EntityManager.TryGetComponent(container.Owner, out ConstructionComponent? constructionComponent)
&& constructionComponent.Graph == "GraphComputerTabletop"
&& args.EntityManager.TryGetComponent(board, out ComputerTabletopBoardComponent? tabletopComputer))
{
return tabletopComputer.Prototype;
}

// There should not be a case where both of these components exist on the same entity...
if (args.EntityManager.TryGetComponent(board, out MachineBoardComponent? machine))
return machine.Prototype;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
state: cpu_engineering
- type: ComputerBoard
prototype: ComputerAtmosMonitoring
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopAlert # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -50,6 +52,8 @@
state: cpu_engineering
- type: ComputerBoard
prototype: ComputerPowerMonitoring
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopPowerMonitoring # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -61,6 +65,8 @@
state: cpu_medical
- type: ComputerBoard
prototype: ComputerMedicalRecords
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopMedicalRecords # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -72,6 +78,8 @@
state: cpu_security
- type: ComputerBoard
prototype: ComputerCriminalRecords
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCriminalRecords # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -83,6 +91,8 @@
state: cpu_command
- type: ComputerBoard
prototype: ComputerStationRecords
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopStationRecords # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -108,6 +118,8 @@
- type: ComputerBoard
prototype: ComputerPalletConsole

- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoOrders # Frontier
- type: entity
id: CargoBountyComputerCircuitboard
parent: BaseComputerCircuitboard
Expand All @@ -119,6 +131,8 @@
- type: ComputerBoard
prototype: ComputerCargoBounty
- type: StaticPrice
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -131,6 +145,8 @@
state: cpu_supply
- type: ComputerBoard
prototype: ComputerCargoShuttle
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier
Comment on lines +148 to +149
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Проверьте консистентность прототипов ComputerTabletopBoard

Некоторые компьютеры используют неправильные прототипы (например, ComputerTabletopCargoBounty используется для разных типов компьютеров).

Also applies to: 178-179, 208-209


🏁 Script executed:

#!/bin/bash
# Проверка уникальности прототипов
rg "prototype: ComputerTabletopCargoBounty" -A 2 -B 2

Length of output: 6141


Проверка консистентности прототипов ComputerTabletopBoard

Из результатов поиска видно, что во всех упомянутых блоках файла
Resources/Prototypes/Entities/Objects/Devices/Circuitboards/computer.yml
устройство с типом ComputerTabletopBoard всегда получает прототип ComputerTabletopCargoBounty. При этом наблюдаются блоки, где для разных типов компьютеров использованы иные прототипы (например, ComputerCargoShuttle, ComputerCrewMonitoring, SyndicateComputerComms и т.д.), что свидетельствует о том, что прототип ComputerTabletopCargoBounty используется повторно и, вероятно, применён некорректно для компьютеров типа ComputerTabletopBoard.

  • Все вхождения с типом ComputerTabletopBoard ассоциированы с прототипом ComputerTabletopCargoBounty (строки 148-149, 178-179, 208-209 и т.д.).
  • Прототип ComputerTabletopCargoBounty также применён в других контекстах, что указывает на неоднозначность его использования.

Рекомендуется проверить, соответствует ли использование данного прототипа задумке для устройств типа ComputerTabletopBoard, и, при необходимости, внести изменения для обеспечения согласованности.


- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -144,6 +160,8 @@
prototype: ComputerSalvageExpedition
- type: StealTarget
stealGroup: SalvageExpeditionsComputerCircuitboard
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopSalvageExpedition # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -157,6 +175,8 @@
prototype: ComputerShuttleCargo
- type: StealTarget
stealGroup: CargoShuttleConsoleCircuitboard
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -171,6 +191,8 @@
- type: Tag
tags:
- SurveillanceCameraMonitorCircuitboard
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -182,6 +204,8 @@
state: cpu_security
- type: ComputerBoard
prototype: ComputerSurveillanceWirelessCameraMonitor
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -194,6 +218,8 @@
- type: Tag
tags:
- ComputerTelevisionCircuitboard
# - type: ComputerTabletopBoard # Frontier
# prototype: ComputerTabletopTelevision # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -205,6 +231,8 @@
state: cpu_science
- type: ComputerBoard
prototype: ComputerResearchAndDevelopment
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopResearchAndDevelopment # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -216,6 +244,8 @@
state: cpu_science
- type: ComputerBoard
prototype: ComputerAnalysisConsole
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopAnalysisConsole # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -227,6 +257,8 @@
state: cpu_science
- type: ComputerBoard
prototype: ComputerTechnologyDiskTerminal
# - type: ComputerTabletopBoard # Frontier
# prototype: ComputerTabletopTechnologyDiskTerminal # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -238,6 +270,8 @@
state: cpu_medical
- type: ComputerBoard
prototype: ComputerCrewMonitoring
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: [BaseComputerCircuitboard, BaseGrandTheftContraband]
Expand All @@ -254,6 +288,8 @@
- type: Tag
tags:
- HighRiskItem
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopId # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -265,6 +301,8 @@
state: cpu_medical
- type: ComputerBoard
prototype: computerBodyScanner
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopBodyScanner # Frontier

- type: entity
parent: [ BaseComputerCircuitboard, BaseGrandTheftContraband ]
Expand All @@ -276,6 +314,8 @@
state: cpu_command
- type: ComputerBoard
prototype: ComputerComms
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopComms # Frontier

- type: entity
parent: [ BaseComputerCircuitboard, BaseSyndicateContraband ]
Expand All @@ -287,6 +327,8 @@
state: cpu_syndicate
- type: ComputerBoard
prototype: SyndicateComputerComms
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -297,6 +339,8 @@
state: cpu_supply
- type: ComputerBoard
prototype: ComputerRadar
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopRadar # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -308,6 +352,8 @@
state: cpu_engineering
- type: ComputerBoard
prototype: ComputerSolarControl
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopSolarControl # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -317,6 +363,8 @@
components:
- type: ComputerBoard
prototype: SpaceVillainArcade
# - type: ComputerTabletopBoard # Frontier
# prototype: TabletopSpaceVillainArcade # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -326,6 +374,8 @@
components:
- type: ComputerBoard
prototype: BlockGameArcade
# - type: ComputerTabletopBoard # Frontier
# prototype: TabletopBlockGameArcade # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -337,6 +387,8 @@
state: cpu_engineering
- type: ComputerBoard
prototype: ParticleAcceleratorControlBoxUnfinished
# - type: ComputerTabletopBoard # Frontier
# prototype: ParticleAcceleratorControlBoxTabletopUnfinished # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -348,6 +400,8 @@
state: cpu_supply
- type: ComputerBoard
prototype: ComputerShuttle
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -370,6 +424,8 @@
state: cpu_medical
- type: ComputerBoard
prototype: ComputerCloningConsole
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCloningConsole # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -381,6 +437,8 @@
state: cpu_command
- type: ComputerBoard
prototype: ComputerIFF
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -392,6 +450,8 @@
state: cpu_syndicate
- type: ComputerBoard
prototype: ComputerIFFSyndicate
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -405,6 +465,8 @@
price: 100
- type: ComputerBoard
prototype: ComputerMassMedia
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopMassMedia # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -427,6 +489,8 @@
state: cpu_science
- type: ComputerBoard
prototype: ComputerRoboticsControl
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -438,3 +502,5 @@
state: cpu_science
- type: ComputerBoard
prototype: StationAiUploadComputer
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopCargoBounty # Frontier
Loading
Loading