Skip to content

Commit

Permalink
Merge pull request #3 from whatston3/2024-11-03-wallmount-radar-sugge…
Browse files Browse the repository at this point in the history
…stions

2024 11 03 wallmount radar suggestions
  • Loading branch information
Tych0theSynth authored Nov 11, 2024
2 parents 67ab9f4 + 5aa81e3 commit b88e0ac
Show file tree
Hide file tree
Showing 24 changed files with 362 additions and 327 deletions.
31 changes: 25 additions & 6 deletions Content.Server/Construction/NodeEntities/BoardNodeEntity.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.Construction.Components;
using Content.Server._NF.Construction.Components; // Frontier
using Content.Shared.Construction;
using Content.Shared.Construction.Components;
using JetBrains.Annotations;
Expand All @@ -15,6 +15,7 @@ namespace Content.Server.Construction.NodeEntities;
public sealed partial class BoardNodeEntity : IGraphNodeEntity
{
[DataField("container")] public string Container { get; private set; } = string.Empty;
[DataField] public ComputerType Computer { get; private set; } = ComputerType.Default; // Frontier

public string? GetId(EntityUid? uid, EntityUid? userUid, GraphNodeEntityArgs args)
{
Expand All @@ -29,13 +30,22 @@ 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 == "ComputerTabletop"
&& args.EntityManager.TryGetComponent(board, out ComputerTabletopBoardComponent? tabletopComputer))
// Frontier - alternative computer variants
switch (Computer)
{
return tabletopComputer.Prototype;
case ComputerType.Tabletop:
if (args.EntityManager.TryGetComponent(board, out ComputerTabletopBoardComponent? tabletopComputer))
return tabletopComputer.Prototype;
break;
case ComputerType.Wallmount:
if (args.EntityManager.TryGetComponent(board, out ComputerWallmountBoardComponent? wallmountComputer))
return wallmountComputer.Prototype;
break;
case ComputerType.Default:
default:
break;
}
// End Frontier

// There should not be a case where both of these components exist on the same entity...
if (args.EntityManager.TryGetComponent(board, out MachineBoardComponent? machine))
Expand All @@ -46,4 +56,13 @@ public sealed partial class BoardNodeEntity : IGraphNodeEntity

return null;
}

// Frontier: support for multiple computer types
public enum ComputerType : byte
{
Default, // Default machines
Tabletop,
Wallmount
}
// End Frontier
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.Construction.Components
namespace Content.Server._NF.Construction.Components
{
/// <summary>
/// Used for construction graphs in building tabletop computers.
Expand Down
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._NF.Construction.Components
{
/// <summary>
/// Used for construction graphs in building wallmount computers.
/// </summary>
[RegisterComponent]
public sealed partial class ComputerWallmountBoardComponent : Component
{
[DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? Prototype { get; private set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,8 @@
prototype: ComputerRadar
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopRadar # Frontier
- type: Tag # Frontier
tags: # Frontier
- DroneUsable # Frontier
- RadarConsoleCircuitboard # Frontier
- type: ComputerWallmountBoard # Frontier
prototype: ComputerWallmountRadar # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand All @@ -341,10 +339,8 @@
prototype: ComputerAdvancedRadar
- type: ComputerTabletopBoard # Frontier
prototype: ComputerTabletopAdvancedRadar # Frontier
- type: Tag # Frontier
tags: # Frontier
- DroneUsable # Frontier
- AdvancedRadarConsoleCircuitboard # Frontier
- type: ComputerWallmountBoard # Frontier
prototype: ComputerWallmountAdvancedRadar # Frontier

- type: entity
parent: BaseComputerCircuitboard
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Mass scanner telescreen
- type: entity
parent: [BaseStructureComputerWallmount, ComputerRadar]
id: ComputerWallmountRadar
components:
- type: Sprite
drawdepth: WallMountedItems
sprite: _NF/Structures/Machines/computer_wallmount.rsi
layers:
- map: ["computerLayerBody"]
state: computer_wallmount
- map: ["computerLayerScreen"]
state: screen_mass

- type: entity
parent: [BaseStructureComputerWallmount, ComputerAdvancedRadar]
id: ComputerWallmountAdvancedRadar
components:
- type: Sprite
drawdepth: WallMountedItems
sprite: _NF/Structures/Machines/computer_wallmount.rsi
layers:
- map: ["computerLayerBody"]
state: computer_wallmount
- map: ["computerLayerScreen"]
state: screen_radar
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
- type: entity
id: BaseStructureComputerWallmount
parent: [BaseStructureWallmount, BaseStructure]
suffix: Wallmount
abstract: true
components:
- type: Anchorable
- type: InteractionOutline
- type: Construction
graph: ComputerWallmount
node: wallmount computer
- type: Sprite
sprite: _NF/Structures/Machines/computer_wallmount.rsi
drawdepth: WallMountedItems
layers:
- map: [ "computerLayerBody" ]
sprite: _NF/Structures/Machines/computer_wallmount.rsi
state: computer_wallmount
- map: [ "computerLayerScreen" ]
sprite: _NF/Structures/Machines/computer_wallmount.rsi
state: screen_generic
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Electronic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 100
behaviors:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
- !type:ChangeConstructionNodeBehavior
node: monitorBroken
- !type:DoActsBehavior
acts: ["Destruction"]
- type: StaticPrice
price: 100

- type: entity
parent: BaseStructureComputerWallmount
name: computer
id: ComputerWallmountFrame
components:
- type: Construction
graph: ComputerWallmount
node: frameUnsecured
containers:
- board
- type: Sprite
drawdepth: WallMountedItems
sprite: _NF/Structures/Machines/computer_wallmount.rsi
layers:
- state: computer_wallmount_frame
map: [ "enum.ConstructionVisuals.Layer" ]
- type: Appearance
- type: GenericVisualizer
visuals:
enum.ConstructionVisuals.Key:
enum.ConstructionVisuals.Layer:
frameUnsecured: { state: computer_wallmount_frame }
boardUnsecured: { state: computer_board_exposed }
missingWires: { state: computer_needs_wires }
monitorMissing: { state: computer_no_monitor }
monitorUnsecured: { state: computer_monitor_unscrewed }

- type: entity
parent: [BaseStructureWallmount, ComputerBroken]
id: ComputerWallmountBroken
suffix: Wallmount
components:
- type: Sprite
drawdepth: WallMountedItems
sprite: _NF/Structures/Machines/computer_wallmount.rsi
state: broken_wallmount

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
amount: 5
- !type:DeleteEntity {}
steps:
- tool: Welding
- tool: Screwing
doAfter: 2

- node: boardUnsecured
Expand Down Expand Up @@ -119,7 +119,9 @@
- tool: Prying

- node: tabletop computer
entity: !type:BoardNodeEntity { container: board }
entity: !type:BoardNodeEntity
container: board
computer: Tabletop
edges:
- to: monitorUnsecured
conditions:
Expand Down
Loading

0 comments on commit b88e0ac

Please sign in to comment.