From fd9e1f37387b7cdc8c23a89b640f4bdb488ccf63 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Mon, 16 Jan 2023 11:53:23 -0500 Subject: [PATCH] machine upgrade guidebook (#13511) * machine upgrade guidebook * oops * guidehelpcomponent * build, damn you --- .../Tests/MachineBoardTest.cs | 1 + .../Tests/MaterialArbitrageTest.cs | 5 ++- .../Construction/Completions/BuildMachine.cs | 1 + .../Construction/Components/IRefreshParts.cs | 4 +- .../Components/MachineFrameComponent.cs | 3 +- .../ConstructionSystem.Machine.cs | 1 + .../Construction/MachineFrameSystem.cs | 1 + .../Construction/PartExchangerSystem.cs | 1 + .../Components/MachineBoardComponent.cs | 5 ++- .../Components/MachinePartComponent.cs | 5 ++- .../Construction/MachinePartSystem.cs | 4 +- Content.Shared/Examine/ExamineSystemShared.cs | 4 ++ Resources/Locale/en-US/guidebook/guides.ftl | 2 + .../Entities/Objects/Misc/machine_parts.yml | 3 ++ .../Objects/Specific/Research/rped.yml | 3 ++ Resources/Prototypes/Guidebook/science.yml | 11 +++++ .../Prototypes/Guidebook/shiftandcrew.yml | 1 + .../Guidebook/MachineUpgrading.xml | 42 +++++++++++++++++++ Resources/Server Info/Guidebook/Science.xml | 26 ++++++++++++ 19 files changed, 113 insertions(+), 10 deletions(-) rename {Content.Server => Content.Shared}/Construction/Components/MachineBoardComponent.cs (93%) rename {Content.Server => Content.Shared}/Construction/Components/MachinePartComponent.cs (87%) rename {Content.Server => Content.Shared}/Construction/MachinePartSystem.cs (96%) create mode 100644 Resources/Prototypes/Guidebook/science.yml create mode 100644 Resources/Server Info/Guidebook/MachineUpgrading.xml create mode 100644 Resources/Server Info/Guidebook/Science.xml diff --git a/Content.IntegrationTests/Tests/MachineBoardTest.cs b/Content.IntegrationTests/Tests/MachineBoardTest.cs index b97c579e96..e1c1718cfb 100644 --- a/Content.IntegrationTests/Tests/MachineBoardTest.cs +++ b/Content.IntegrationTests/Tests/MachineBoardTest.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading.Tasks; using Content.Server.Construction.Components; +using Content.Shared.Construction.Components; using NUnit.Framework; using Robust.Shared.Prototypes; diff --git a/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs b/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs index e1d0a3fb48..de8b78a55f 100644 --- a/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs +++ b/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs @@ -17,6 +17,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; +using Content.Shared.Construction.Components; namespace Content.IntegrationTests.Tests; @@ -148,7 +149,7 @@ public sealed class MaterialArbitrageTest spawnedOnDestroy.Add(proto.ID, (spawnedEnts, spawnedMats)); } - // This is the main loop where we actually check for destruction arbitrage + // This is the main loop where we actually check for destruction arbitrage Assert.Multiple(async () => { foreach (var (id, (spawnedEnts, spawnedMats)) in spawnedOnDestroy) @@ -183,7 +184,7 @@ public sealed class MaterialArbitrageTest } } }); - + // Finally, lets also check for deconstruction arbitrage. // Get ingredients returned when deconstructing an entity Dictionary> deconstructionMaterials = new(); diff --git a/Content.Server/Construction/Completions/BuildMachine.cs b/Content.Server/Construction/Completions/BuildMachine.cs index 917d0ab887..5de944648d 100644 --- a/Content.Server/Construction/Completions/BuildMachine.cs +++ b/Content.Server/Construction/Completions/BuildMachine.cs @@ -1,6 +1,7 @@ using System.Linq; using Content.Server.Construction.Components; using Content.Shared.Construction; +using Content.Shared.Construction.Components; using JetBrains.Annotations; using Robust.Server.Containers; using Robust.Shared.Containers; diff --git a/Content.Server/Construction/Components/IRefreshParts.cs b/Content.Server/Construction/Components/IRefreshParts.cs index 7773704a9d..714ca72c97 100644 --- a/Content.Server/Construction/Components/IRefreshParts.cs +++ b/Content.Server/Construction/Components/IRefreshParts.cs @@ -1,4 +1,6 @@ -namespace Content.Server.Construction.Components +using Content.Shared.Construction.Components; + +namespace Content.Server.Construction.Components { [RequiresExplicitImplementation] public interface IRefreshParts diff --git a/Content.Server/Construction/Components/MachineFrameComponent.cs b/Content.Server/Construction/Components/MachineFrameComponent.cs index 4606a46479..3da4ba6961 100644 --- a/Content.Server/Construction/Components/MachineFrameComponent.cs +++ b/Content.Server/Construction/Components/MachineFrameComponent.cs @@ -1,4 +1,5 @@ -using Content.Shared.Construction.Prototypes; +using Content.Shared.Construction.Components; +using Content.Shared.Construction.Prototypes; using Robust.Shared.Containers; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; diff --git a/Content.Server/Construction/ConstructionSystem.Machine.cs b/Content.Server/Construction/ConstructionSystem.Machine.cs index 5cb0be6927..6cf6a1fe7a 100644 --- a/Content.Server/Construction/ConstructionSystem.Machine.cs +++ b/Content.Server/Construction/ConstructionSystem.Machine.cs @@ -1,6 +1,7 @@ using System.Linq; using Content.Server.Construction.Components; using Content.Server.Examine; +using Content.Shared.Construction.Components; using Content.Shared.Construction.Prototypes; using Content.Shared.Verbs; using Robust.Shared.Containers; diff --git a/Content.Server/Construction/MachineFrameSystem.cs b/Content.Server/Construction/MachineFrameSystem.cs index 4f0c9bf137..fc2dfd6363 100644 --- a/Content.Server/Construction/MachineFrameSystem.cs +++ b/Content.Server/Construction/MachineFrameSystem.cs @@ -1,5 +1,6 @@ using Content.Server.Construction.Components; using Content.Server.Stack; +using Content.Shared.Construction.Components; using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Stacks; diff --git a/Content.Server/Construction/PartExchangerSystem.cs b/Content.Server/Construction/PartExchangerSystem.cs index e92db4e67e..7389353a27 100644 --- a/Content.Server/Construction/PartExchangerSystem.cs +++ b/Content.Server/Construction/PartExchangerSystem.cs @@ -5,6 +5,7 @@ using Content.Server.DoAfter; using Content.Server.Storage.Components; using Content.Server.Storage.EntitySystems; using Content.Server.Wires; +using Content.Shared.Construction.Components; using Content.Shared.Interaction; using Content.Shared.Popups; using Robust.Shared.Containers; diff --git a/Content.Server/Construction/Components/MachineBoardComponent.cs b/Content.Shared/Construction/Components/MachineBoardComponent.cs similarity index 93% rename from Content.Server/Construction/Components/MachineBoardComponent.cs rename to Content.Shared/Construction/Components/MachineBoardComponent.cs index 3e324f6565..f81b68e853 100644 --- a/Content.Server/Construction/Components/MachineBoardComponent.cs +++ b/Content.Shared/Construction/Components/MachineBoardComponent.cs @@ -1,11 +1,12 @@ using Content.Shared.Construction.Prototypes; using Content.Shared.Stacks; +using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; -namespace Content.Server.Construction.Components +namespace Content.Shared.Construction.Components { - [RegisterComponent] + [RegisterComponent, NetworkedComponent] public sealed class MachineBoardComponent : Component { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; diff --git a/Content.Server/Construction/Components/MachinePartComponent.cs b/Content.Shared/Construction/Components/MachinePartComponent.cs similarity index 87% rename from Content.Server/Construction/Components/MachinePartComponent.cs rename to Content.Shared/Construction/Components/MachinePartComponent.cs index 997b8b28a8..21faf369c9 100644 --- a/Content.Server/Construction/Components/MachinePartComponent.cs +++ b/Content.Shared/Construction/Components/MachinePartComponent.cs @@ -1,9 +1,10 @@ using Content.Shared.Construction.Prototypes; +using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -namespace Content.Server.Construction.Components +namespace Content.Shared.Construction.Components { - [RegisterComponent] + [RegisterComponent, NetworkedComponent] public sealed class MachinePartComponent : Component { [DataField("part", required: true, customTypeSerializer: typeof(PrototypeIdSerializer))] diff --git a/Content.Server/Construction/MachinePartSystem.cs b/Content.Shared/Construction/MachinePartSystem.cs similarity index 96% rename from Content.Server/Construction/MachinePartSystem.cs rename to Content.Shared/Construction/MachinePartSystem.cs index b282a9a2e8..38e70848be 100644 --- a/Content.Server/Construction/MachinePartSystem.cs +++ b/Content.Shared/Construction/MachinePartSystem.cs @@ -1,7 +1,7 @@ -using Content.Server.Construction.Components; +using Content.Shared.Construction.Components; using Content.Shared.Examine; -namespace Content.Server.Construction +namespace Content.Shared.Construction { /// /// Deals with machine parts and machine boards. diff --git a/Content.Shared/Examine/ExamineSystemShared.cs b/Content.Shared/Examine/ExamineSystemShared.cs index 385ef88880..d4bc15558e 100644 --- a/Content.Shared/Examine/ExamineSystemShared.cs +++ b/Content.Shared/Examine/ExamineSystemShared.cs @@ -7,6 +7,7 @@ using Content.Shared.Mobs.Systems; using JetBrains.Annotations; using Robust.Shared.Containers; using Robust.Shared.Map; +using Robust.Shared.Network; using Robust.Shared.Physics; using Robust.Shared.Utility; using static Content.Shared.Interaction.SharedInteractionSystem; @@ -46,6 +47,9 @@ namespace Content.Shared.Examine public bool IsInDetailsRange(EntityUid examiner, EntityUid entity) { + if (entity.IsClientSide()) + return true; + // check if the mob is in critical or dead if (MobStateSystem.IsIncapacitated(examiner)) return false; diff --git a/Resources/Locale/en-US/guidebook/guides.ftl b/Resources/Locale/en-US/guidebook/guides.ftl index a5bc7b4d69..b96e120cf0 100644 --- a/Resources/Locale/en-US/guidebook/guides.ftl +++ b/Resources/Locale/en-US/guidebook/guides.ftl @@ -5,6 +5,8 @@ guide-entry-fires = Fires & Space guide-entry-shuttle-craft = Shuttle-craft guide-entry-power = Power guide-entry-ame = Antimatter Engine (AME) +guide-entry-science = Science +guide-entry-machine-upgrading = Machine Upgrading guide-entry-controls = Controls guide-entry-jobs = Jobs guide-entry-survival = Survival diff --git a/Resources/Prototypes/Entities/Objects/Misc/machine_parts.yml b/Resources/Prototypes/Entities/Objects/Misc/machine_parts.yml index 65c1e85fbb..0e32628413 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/machine_parts.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/machine_parts.yml @@ -10,6 +10,9 @@ sprite: Objects/Misc/stock_parts.rsi - type: MachinePart rating: 1 + - type: GuideHelp + guides: + - MachineUpgrading # Rating 1 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Research/rped.yml b/Resources/Prototypes/Entities/Objects/Specific/Research/rped.yml index 37fcd55100..0a0b3b059f 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Research/rped.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Research/rped.yml @@ -10,6 +10,9 @@ - type: Item sprite: Objects/Specific/Research/rped.rsi size: 50 + - type: GuideHelp + guides: + - MachineUpgrading - type: PartExchanger - type: Storage capacity: 150 diff --git a/Resources/Prototypes/Guidebook/science.yml b/Resources/Prototypes/Guidebook/science.yml new file mode 100644 index 0000000000..0b5d20c4df --- /dev/null +++ b/Resources/Prototypes/Guidebook/science.yml @@ -0,0 +1,11 @@ +- type: guideEntry + id: Science + name: guide-entry-science + text: "/Server Info/Guidebook/Science.xml" + children: + - MachineUpgrading + +- type: guideEntry + id: MachineUpgrading + name: guide-entry-machine-upgrading + text: "/Server Info/Guidebook/MachineUpgrading.xml" \ No newline at end of file diff --git a/Resources/Prototypes/Guidebook/shiftandcrew.yml b/Resources/Prototypes/Guidebook/shiftandcrew.yml index 3913437a9d..d4821a1216 100644 --- a/Resources/Prototypes/Guidebook/shiftandcrew.yml +++ b/Resources/Prototypes/Guidebook/shiftandcrew.yml @@ -4,6 +4,7 @@ text: "/Server Info/Guidebook/Jobs.xml" children: - Engineering + - Science - type: guideEntry id: Survival diff --git a/Resources/Server Info/Guidebook/MachineUpgrading.xml b/Resources/Server Info/Guidebook/MachineUpgrading.xml new file mode 100644 index 0000000000..6f159832bb --- /dev/null +++ b/Resources/Server Info/Guidebook/MachineUpgrading.xml @@ -0,0 +1,42 @@ + +# Machine Upgrading + +Machines help the station run smoothly, and as a scientist, you can help them run even better! + +## Parts +Stock Parts: + + + + + + + + + +You can examine each machine part to see both the type and the rating, which range from 1 to 4. + +Parts of higher levels can be researched as well as found through artifacts or salvage. + + + + + + +## Upgrading +To know if a machine can be upgraded, you can examine it and check for the [color=#a4885c]lightning bolt[/color] icon in the lower right corner. Clicking on it will allow you to see what kinds of upgrades the machine has. + +To check what parts a machine needs, you can examine its board. Try it here: + + + + + + +You can use any rating part for any part requirement. Using higher rated parts will increase how effective the machine is. + +If you want to upgrade an existing machine, simply deconstruct it with a screwdriver and crowbar, and replace the existing parts with parts of a higher level. + +You can also quickly upgrade machines by using an RPED, loading it with machine parts, and then clicking on a machine. It will quickly be upgraded with whatever parts were inserted. + + diff --git a/Resources/Server Info/Guidebook/Science.xml b/Resources/Server Info/Guidebook/Science.xml new file mode 100644 index 0000000000..8cde008c8e --- /dev/null +++ b/Resources/Server Info/Guidebook/Science.xml @@ -0,0 +1,26 @@ + +# Science + +Science, often called Research and Development, is a job made up of both generating research points to unlock new technologies as well as using said technologies to produce new items at lathes to help out the station. + +## Technologies + + + + +The most important thing inside your department is the R&D server, which stores unlocked technologies, and the R&D computer, which allows you to unlock technologies. + +Each technology costs [color=#a4885c]Research Points[/color] and unlocks recipes at lathes. Some technologies will also have prerequesites you have to unlock before you can research them. + +## Lathes + + + + + + + + +At a lathe, you can sync to a server to allow it print whatever recipes you have unlocked. Recipes require various materials (steel, glass, plastic, gold, plasma) which can be acquired at Cargo or Salvage. + +