fix: fix unnecessary devices in shitsilo (#211)

This commit is contained in:
ThereDrD0
2024-03-16 18:31:06 +03:00
committed by GitHub
parent 8ccf29a2fc
commit bbb2059482
8 changed files with 37 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
using System.Linq; using System.Linq;
using Content.Shared._White.ShitSilo;
using Content.Shared.Materials; using Content.Shared.Materials;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
@@ -44,6 +45,7 @@ public sealed partial class MaterialStorageControl : BoxContainer
} }
var gridStorage = _entityManager.TryGetComponent<TransformComponent>(_owner, out var transformComponent) && var gridStorage = _entityManager.TryGetComponent<TransformComponent>(_owner, out var transformComponent) &&
_entityManager.HasComponent<BluespaceSiloComponent>(_owner) &&
_entityManager.TryGetComponent<MaterialStorageComponent>(transformComponent.GridUid, _entityManager.TryGetComponent<MaterialStorageComponent>(transformComponent.GridUid,
out var materialStorageComponent) ? materialStorageComponent : null; out var materialStorageComponent) ? materialStorageComponent : null;

View File

@@ -8,6 +8,7 @@ using Content.Server.Materials;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Server.Stack; using Content.Server.Stack;
using Content.Shared._White.ShitSilo;
using Content.Shared.UserInterface; using Content.Shared.UserInterface;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Emag.Components; using Content.Shared.Emag.Components;
@@ -164,7 +165,7 @@ namespace Content.Server.Lathe
? (int) (-amount * component.MaterialUseMultiplier) ? (int) (-amount * component.MaterialUseMultiplier)
: -amount; : -amount;
var gridUid = var gridUid = HasComp<BluespaceSiloComponent>(uid) &&
TryComp<TransformComponent>(uid, out var transformComponent) ? transformComponent.GridUid : null; TryComp<TransformComponent>(uid, out var transformComponent) ? transformComponent.GridUid : null;
var gridStorage = var gridStorage =

View File

@@ -5,6 +5,7 @@ using Content.Shared.Popups;
using Content.Shared.Stacks; using Content.Shared.Stacks;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Stack; using Content.Server.Stack;
using Content.Shared._White.ShitSilo;
using Content.Shared.ActionBlocker; using Content.Shared.ActionBlocker;
using Content.Shared.Construction; using Content.Shared.Construction;
using Content.Shared.Database; using Content.Shared.Database;
@@ -78,7 +79,8 @@ public sealed class MaterialStorageSystem : SharedMaterialStorageSystem
volume = sheetsToExtract * volumePerSheet; volume = sheetsToExtract * volumePerSheet;
} }
var gridUid = TryComp<TransformComponent>(uid, out var transformComponent) var gridUid = HasComp<BluespaceSiloComponent>(uid) &&
TryComp<TransformComponent>(uid, out var transformComponent)
? transformComponent.GridUid ? transformComponent.GridUid
: null; : null;

View File

@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Content.Shared._White.ShitSilo;
using Content.Shared.Emag.Systems; using Content.Shared.Emag.Systems;
using Content.Shared.Materials; using Content.Shared.Materials;
using Content.Shared.Research.Prototypes; using Content.Shared.Research.Prototypes;
@@ -45,6 +46,7 @@ public abstract class SharedLatheSystem : EntitySystem
var adjustedAmount = AdjustMaterial(needed, recipe.ApplyMaterialDiscount, component.MaterialUseMultiplier); var adjustedAmount = AdjustMaterial(needed, recipe.ApplyMaterialDiscount, component.MaterialUseMultiplier);
var gridUid = var gridUid =
HasComp<BluespaceSiloComponent>(uid) &&
TryComp<TransformComponent>(uid, out var transformComponent) TryComp<TransformComponent>(uid, out var transformComponent)
? transformComponent.GridUid ? transformComponent.GridUid
: null; : null;

View File

@@ -1,4 +1,5 @@
using System.Linq; using System.Linq;
using Content.Shared._White.ShitSilo;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Interaction.Components; using Content.Shared.Interaction.Components;
using Content.Shared.Lathe; using Content.Shared.Lathe;
@@ -295,7 +296,7 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
var multiplier = TryComp<StackComponent>(toInsert, out var stackComponent) ? stackComponent.Count : 1; var multiplier = TryComp<StackComponent>(toInsert, out var stackComponent) ? stackComponent.Count : 1;
var totalVolume = 0; var totalVolume = 0;
var gridUid = HasComp<LatheComponent>(receiver) && var gridUid = HasComp<BluespaceSiloComponent>(receiver) &&
TryComp<TransformComponent>(receiver, out var transformComponent) TryComp<TransformComponent>(receiver, out var transformComponent)
? transformComponent.GridUid ? transformComponent.GridUid
: null; : null;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared._White.ShitSilo;
[RegisterComponent, NetworkedComponent]
public sealed partial class BluespaceSiloComponent : Component
{
}

View File

@@ -18,6 +18,7 @@
layer: layer:
- MachineLayer - MachineLayer
- type: Lathe - type: Lathe
- type: BluespaceSilo
- type: MaterialStorage - type: MaterialStorage
- type: Destructible - type: Destructible
thresholds: thresholds:
@@ -225,6 +226,7 @@
- MagazineGrenadeEmpty - MagazineGrenadeEmpty
- GrenadeEMP - GrenadeEMP
- GrenadeFlash - GrenadeFlash
- type: BluespaceSilo
- type: entity - type: entity
id: AutolatheHyperConvection id: AutolatheHyperConvection
@@ -237,6 +239,7 @@
- type: Lathe - type: Lathe
materialUseMultiplier: 0.5 materialUseMultiplier: 0.5
timeMultiplier: 1.5 timeMultiplier: 1.5
- type: BluespaceSilo
- type: LatheHeatProducing - type: LatheHeatProducing
- type: Machine - type: Machine
board: AutolatheHyperConvectionMachineCircuitboard board: AutolatheHyperConvectionMachineCircuitboard
@@ -349,6 +352,7 @@
- WeaponAdvancedLaser - WeaponAdvancedLaser
- WeaponLaserCannon - WeaponLaserCannon
- WeaponXrayCannon - WeaponXrayCannon
- type: BluespaceSilo
- type: entity - type: entity
id: ProtolatheHyperConvection id: ProtolatheHyperConvection
@@ -361,6 +365,7 @@
- type: Lathe - type: Lathe
materialUseMultiplier: 0.5 materialUseMultiplier: 0.5
timeMultiplier: 1.5 timeMultiplier: 1.5
- type: BluespaceSilo
- type: LatheHeatProducing - type: LatheHeatProducing
- type: Machine - type: Machine
board: ProtolatheHyperConvectionMachineCircuitboard board: ProtolatheHyperConvectionMachineCircuitboard
@@ -476,6 +481,7 @@
- ArtifactCrusherMachineCircuitboard - ArtifactCrusherMachineCircuitboard
- TelecomServerCircuitboard - TelecomServerCircuitboard
- MassMediaCircuitboard - MassMediaCircuitboard
- type: BluespaceSilo
- type: MaterialStorage - type: MaterialStorage
whitelist: whitelist:
tags: tags:
@@ -588,6 +594,7 @@
- HamtrLLeg - HamtrLLeg
- HamtrRLeg - HamtrRLeg
- VimHarness - VimHarness
- type: BluespaceSilo
- type: MaterialStorage - type: MaterialStorage
whitelist: whitelist:
tags: tags:
@@ -640,6 +647,7 @@
- AbominationCube - AbominationCube
- SpaceCarpCube - SpaceCarpCube
- SpaceTickCube - SpaceTickCube
- type: BluespaceSilo
- type: entity - type: entity
id: SecurityTechFab id: SecurityTechFab
@@ -770,6 +778,7 @@
- Sheet - Sheet
- RawMaterial - RawMaterial
- Ingot - Ingot
- type: BluespaceSilo
- type: entity - type: entity
id: AmmoTechFab id: AmmoTechFab
@@ -816,11 +825,12 @@
- MagazineBoxMagnumAP - MagazineBoxMagnumAP
- MagazineBoxAntiMateriel - MagazineBoxAntiMateriel
- MagazineBoxCaselessRifle - MagazineBoxCaselessRifle
- type: BluespaceSilo
- type: MaterialStorage - type: MaterialStorage
whitelist: whitelist:
tags: tags:
- Sheet - Sheet
-
- type: entity - type: entity
id: MedicalTechFab id: MedicalTechFab
parent: BaseLathe parent: BaseLathe
@@ -889,6 +899,7 @@
- SyringeBluespace - SyringeBluespace
- SyringeCryostasis - SyringeCryostasis
- ClothingEyesHudMedical - ClothingEyesHudMedical
- type: BluespaceSilo
- type: Machine - type: Machine
board: MedicalTechFabCircuitboard board: MedicalTechFabCircuitboard
- type: StealTarget - type: StealTarget
@@ -1073,6 +1084,7 @@
- ClothingOuterWinterCentcom - ClothingOuterWinterCentcom
- ClothingOuterWinterSyndie - ClothingOuterWinterSyndie
- ClothingOuterWinterSyndieCap - ClothingOuterWinterSyndieCap
- type: BluespaceSilo
- type: MaterialStorage - type: MaterialStorage
whitelist: whitelist:
tags: tags:
@@ -1119,6 +1131,7 @@
- IngotGold30 - IngotGold30
- IngotSilver30 - IngotSilver30
- MaterialBananium10 - MaterialBananium10
- type: BluespaceSilo
- type: entity - type: entity
parent: OreProcessor parent: OreProcessor
@@ -1147,6 +1160,7 @@
- IngotGold30 - IngotGold30
- IngotSilver30 - IngotSilver30
- MaterialBananium10 - MaterialBananium10
- type: BluespaceSilo
- type: entity - type: entity
parent: BaseLathe parent: BaseLathe
@@ -1178,3 +1192,4 @@
staticRecipes: staticRecipes:
- MaterialSheetMeat - MaterialSheetMeat
- SheetPaper - SheetPaper
- type: BluespaceSilo

View File

@@ -20,6 +20,7 @@
layer: layer:
- TabletopMachineLayer - TabletopMachineLayer
- type: Lathe - type: Lathe
- type: BluespaceSilo
- type: MaterialStorage - type: MaterialStorage
- type: ActivatableUI - type: ActivatableUI
key: enum.LatheUiKey.Key key: enum.LatheUiKey.Key