Rip out remaining machine upgrades (#24413)

* Rip out remaining machine upgrades

* eek
This commit is contained in:
Nemanja
2024-01-22 17:13:04 -05:00
committed by GitHub
parent 7daf7ac0be
commit a9e89ab372
79 changed files with 36 additions and 1135 deletions

View File

@@ -1,5 +1,4 @@
using Content.Server.Anomaly.Components;
using Content.Server.Construction;
using Content.Server.Power.EntitySystems;
using Content.Shared.Anomaly;
using Content.Shared.Anomaly.Components;
@@ -20,7 +19,6 @@ public sealed partial class AnomalySystem
{
SubscribeLocalEvent<AnomalyVesselComponent, ComponentShutdown>(OnVesselShutdown);
SubscribeLocalEvent<AnomalyVesselComponent, MapInitEvent>(OnVesselMapInit);
SubscribeLocalEvent<AnomalyVesselComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing);
SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<AnomalyVesselComponent, ResearchServerGetPointsPerSecondEvent>(OnVesselGetPointsPerSecond);
@@ -67,11 +65,6 @@ public sealed partial class AnomalySystem
UpdateVesselAppearance(uid, component);
}
private void OnUpgradeExamine(EntityUid uid, AnomalyVesselComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("anomaly-vessel-component-upgrade-output", component.PointMultiplier);
}
private void OnVesselInteractUsing(EntityUid uid, AnomalyVesselComponent component, InteractUsingEvent args)
{
if (component.Anomaly != null ||

View File

@@ -1,6 +1,4 @@
using Content.Shared.Atmos;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Atmos.Piping.Binary.Components
{
@@ -19,28 +17,10 @@ namespace Content.Server.Atmos.Piping.Binary.Components
[DataField("outlet")]
public string OutletName { get; set; } = "outlet";
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MinTemp = 300 + Atmospherics.T0C;
[DataField("BaseMinTemp")]
public float BaseMinTemp = 300 + Atmospherics.T0C;
[DataField("machinePartMinTemp", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartMinTemp = "Capacitor";
[DataField("partRatingMinTempMultiplier")]
public float PartRatingMinTempMultiplier = 0.95f;
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MinPressure = 30 * Atmospherics.OneAtmosphere;
[DataField("BaseMinPressure")]
public float BaseMinPressure = 30 * Atmospherics.OneAtmosphere;
[DataField("machinePartMinPressure", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartMinPressure = "Manipulator";
[DataField("partRatingMinPressureMultiplier")]
public float PartRatingMinPressureMultiplier = 0.8f;
}
}

View File

@@ -1,7 +1,6 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Piping.Binary.Components;
using Content.Server.Atmos.Piping.Components;
using Content.Server.Construction;
using Content.Server.NodeContainer;
using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NodeContainer.Nodes;
@@ -29,8 +28,6 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
SubscribeLocalEvent<GasRecyclerComponent, AtmosDeviceUpdateEvent>(OnUpdate);
SubscribeLocalEvent<GasRecyclerComponent, AtmosDeviceDisabledEvent>(OnDisabled);
SubscribeLocalEvent<GasRecyclerComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<GasRecyclerComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<GasRecyclerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
}
private void OnEnabled(EntityUid uid, GasRecyclerComponent comp, ref AtmosDeviceEnabledEvent args)
@@ -125,20 +122,5 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
_appearance.SetData(uid, PumpVisuals.Enabled, comp.Reacting);
}
private void OnRefreshParts(EntityUid uid, GasRecyclerComponent component, RefreshPartsEvent args)
{
var ratingTemp = args.PartRatings[component.MachinePartMinTemp];
var ratingPressure = args.PartRatings[component.MachinePartMinPressure];
component.MinTemp = component.BaseMinTemp * MathF.Pow(component.PartRatingMinTempMultiplier, ratingTemp - 1);
component.MinPressure = component.BaseMinPressure * MathF.Pow(component.PartRatingMinPressureMultiplier, ratingPressure - 1);
}
private void OnUpgradeExamine(EntityUid uid, GasRecyclerComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("gas-recycler-upgrade-min-temp", component.MinTemp / component.BaseMinTemp);
args.AddPercentageUpgrade("gas-recycler-upgrade-min-pressure", component.MinPressure / component.BaseMinPressure);
}
}
}

View File

@@ -1,6 +1,4 @@
using Content.Shared.Atmos;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Atmos.Portable
{
@@ -39,51 +37,13 @@ namespace Content.Server.Atmos.Portable
/// <summary>
/// Maximum internal pressure before it refuses to take more.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MaxPressure = 2500;
/// <summary>
/// The base amount of maximum internal pressure
/// </summary>
[DataField("baseMaxPressure")]
public float BaseMaxPressure = 2500;
/// <summary>
/// The machine part that modifies the maximum internal pressure
/// </summary>
[DataField("machinePartMaxPressure", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartMaxPressure = "MatterBin";
/// <summary>
/// How much the <see cref="MachinePartMaxPressure"/> will affect the pressure.
/// The value will be multiplied by this amount for each increasing part tier.
/// </summary>
[DataField("partRatingMaxPressureModifier")]
public float PartRatingMaxPressureModifier = 1.5f;
/// <summary>
/// The speed at which gas is scrubbed from the environment.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float TransferRate = 800;
/// <summary>
/// The base speed at which gas is scrubbed from the environment.
/// </summary>
[DataField("baseTransferRate")]
public float BaseTransferRate = 800;
/// <summary>
/// The machine part which modifies the speed of <see cref="TransferRate"/>
/// </summary>
[DataField("machinePartTransferRate", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartTransferRate = "Manipulator";
/// <summary>
/// How much the <see cref="MachinePartTransferRate"/> will modify the rate.
/// The value will be multiplied by this amount for each increasing part tier.
/// </summary>
[DataField("partRatingTransferRateModifier")]
public float PartRatingTransferRateModifier = 1.4f;
}
}

View File

@@ -12,7 +12,6 @@ using Content.Server.NodeContainer.Nodes;
using Content.Server.NodeContainer.NodeGroups;
using Content.Server.Audio;
using Content.Server.Administration.Logs;
using Content.Server.Construction;
using Content.Server.NodeContainer.EntitySystems;
using Content.Shared.Database;
@@ -39,8 +38,6 @@ namespace Content.Server.Atmos.Portable
SubscribeLocalEvent<PortableScrubberComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<PortableScrubberComponent, DestructionEventArgs>(OnDestroyed);
SubscribeLocalEvent<PortableScrubberComponent, GasAnalyzerScanEvent>(OnScrubberAnalyzed);
SubscribeLocalEvent<PortableScrubberComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<PortableScrubberComponent, UpgradeExamineEvent>(OnUpgradeExamine);
}
private bool IsFull(PortableScrubberComponent component)
@@ -170,20 +167,5 @@ namespace Content.Server.Atmos.Portable
}
args.GasMixtures = gasMixDict;
}
private void OnRefreshParts(EntityUid uid, PortableScrubberComponent component, RefreshPartsEvent args)
{
var pressureRating = args.PartRatings[component.MachinePartMaxPressure];
var transferRating = args.PartRatings[component.MachinePartTransferRate];
component.MaxPressure = component.BaseMaxPressure * MathF.Pow(component.PartRatingMaxPressureModifier, pressureRating - 1);
component.TransferRate = component.BaseTransferRate * MathF.Pow(component.PartRatingTransferRateModifier, transferRating - 1);
}
private void OnUpgradeExamine(EntityUid uid, PortableScrubberComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("portable-scrubber-component-upgrade-max-pressure", component.MaxPressure / component.BaseMaxPressure);
args.AddPercentageUpgrade("portable-scrubber-component-upgrade-transfer-rate", component.TransferRate / component.BaseTransferRate);
}
}
}

View File

@@ -2,7 +2,6 @@ using Content.Server.Actions;
using Content.Server.Bed.Components;
using Content.Server.Bed.Sleep;
using Content.Server.Body.Systems;
using Content.Server.Construction;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Shared.Bed;
@@ -10,7 +9,6 @@ using Content.Shared.Bed.Sleep;
using Content.Shared.Body.Components;
using Content.Shared.Buckle.Components;
using Content.Shared.Damage;
using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems;
using Content.Shared.Mobs.Systems;
using Robust.Shared.Timing;
@@ -33,8 +31,6 @@ namespace Content.Server.Bed
SubscribeLocalEvent<StasisBedComponent, BuckleChangeEvent>(OnBuckleChange);
SubscribeLocalEvent<StasisBedComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<StasisBedComponent, GotEmaggedEvent>(OnEmagged);
SubscribeLocalEvent<StasisBedComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<StasisBedComponent, UpgradeExamineEvent>(OnUpgradeExamine);
}
private void ManageUpdateList(EntityUid uid, HealOnBuckleComponent component, ref BuckleChangeEvent args)
@@ -130,18 +126,5 @@ namespace Content.Server.Bed
RaiseLocalEvent(buckledEntity, metabolicEvent);
}
}
private void OnRefreshParts(EntityUid uid, StasisBedComponent component, RefreshPartsEvent args)
{
var metabolismRating = args.PartRatings[component.MachinePartMetabolismModifier];
component.Multiplier = component.BaseMultiplier * metabolismRating; //linear scaling so it's not OP
if (HasComp<EmaggedComponent>(uid))
component.Multiplier = 1f / component.Multiplier;
}
private void OnUpgradeExamine(EntityUid uid, StasisBedComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("stasis-bed-component-upgrade-stasis", component.Multiplier / component.BaseMultiplier);
}
}
}

View File

@@ -1,21 +1,12 @@
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Bed.Components
{
[RegisterComponent]
public sealed partial class StasisBedComponent : Component
{
[DataField("baseMultiplier", required: true), ViewVariables(VVAccess.ReadWrite)]
public float BaseMultiplier = 10f;
/// <summary>
/// What the metabolic update rate will be multiplied by (higher = slower metabolism)
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float Multiplier = 10f;
[DataField("machinePartMetabolismModifier", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartMetabolismModifier = "Capacitor";
}
}

View File

@@ -1,7 +1,4 @@
using Content.Server.Botany.Systems;
using Content.Server.Construction;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Botany.Components;
@@ -10,33 +7,14 @@ namespace Content.Server.Botany.Components;
public sealed partial class SeedExtractorComponent : Component
{
/// <summary>
/// The minimum amount of seed packets dropped with no machine upgrades.
/// The minimum amount of seed packets dropped.
/// </summary>
[DataField("baseMinSeeds"), ViewVariables(VVAccess.ReadWrite)]
public int BaseMinSeeds = 1;
/// <summary>
/// The maximum amount of seed packets dropped with no machine upgrades.
/// The maximum amount of seed packets dropped.
/// </summary>
[DataField("baseMaxSeeds"), ViewVariables(VVAccess.ReadWrite)]
public int BaseMaxSeeds = 3;
/// <summary>
/// Modifier to the amount of seeds outputted, set on <see cref="RefreshPartsEvent"/>.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float SeedAmountMultiplier;
/// <summary>
/// Machine part whose rating modifies the amount of seed packets dropped.
/// </summary>
[DataField("machinePartYieldAmount", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartSeedAmount = "Manipulator";
/// <summary>
/// How much the machine part quality affects the amount of seeds outputted.
/// Going up a tier will multiply the seed output by this amount.
/// </summary>
[DataField("partRatingSeedAmountMultiplier")]
public float PartRatingSeedAmountMultiplier = 1.5f;
}

View File

@@ -1,10 +1,8 @@
using Content.Server.Botany.Components;
using Content.Server.Construction;
using Content.Server.Popups;
using Content.Server.Power.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Robust.Shared.Player;
using Robust.Shared.Random;
namespace Content.Server.Botany.Systems;
@@ -20,8 +18,6 @@ public sealed class SeedExtractorSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<SeedExtractorComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<SeedExtractorComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<SeedExtractorComponent, UpgradeExamineEvent>(OnUpgradeExamine);
}
private void OnInteractUsing(EntityUid uid, SeedExtractorComponent seedExtractor, InteractUsingEvent args)
@@ -29,7 +25,8 @@ public sealed class SeedExtractorSystem : EntitySystem
if (!this.IsPowered(uid, EntityManager))
return;
if (!TryComp(args.Used, out ProduceComponent? produce)) return;
if (!TryComp(args.Used, out ProduceComponent? produce))
return;
if (!_botanySystem.TryGetSeed(produce, out var seed) || seed.Seedless)
{
_popupSystem.PopupCursor(Loc.GetString("seed-extractor-component-no-seeds",("name", args.Used)),
@@ -42,7 +39,7 @@ public sealed class SeedExtractorSystem : EntitySystem
QueueDel(args.Used);
var amount = (int) _random.NextFloat(seedExtractor.BaseMinSeeds, seedExtractor.BaseMaxSeeds + 1) * seedExtractor.SeedAmountMultiplier;
var amount = _random.Next(seedExtractor.BaseMinSeeds, seedExtractor.BaseMaxSeeds + 1);
var coords = Transform(uid).Coordinates;
if (amount > 1)
@@ -53,15 +50,4 @@ public sealed class SeedExtractorSystem : EntitySystem
_botanySystem.SpawnSeedPacket(seed, coords, args.User);
}
}
private void OnRefreshParts(EntityUid uid, SeedExtractorComponent seedExtractor, RefreshPartsEvent args)
{
var manipulatorQuality = args.PartRatings[seedExtractor.MachinePartSeedAmount];
seedExtractor.SeedAmountMultiplier = MathF.Pow(seedExtractor.PartRatingSeedAmountMultiplier, manipulatorQuality - 1);
}
private void OnUpgradeExamine(EntityUid uid, SeedExtractorComponent seedExtractor, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("seed-extractor-component-upgrade-seed-yield", seedExtractor.SeedAmountMultiplier);
}
}

View File

@@ -1,6 +1,4 @@
using Content.Server.Cargo.Components;
using Content.Server.Construction;
using Content.Server.Paper;
using Content.Server.Power.Components;
using Content.Shared.Cargo;
using Content.Shared.Cargo.Components;
@@ -15,8 +13,6 @@ public sealed partial class CargoSystem
private void InitializeTelepad()
{
SubscribeLocalEvent<CargoTelepadComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<CargoTelepadComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<CargoTelepadComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<CargoTelepadComponent, PowerChangedEvent>(OnTelepadPowerChange);
// Shouldn't need re-anchored event
SubscribeLocalEvent<CargoTelepadComponent, AnchorStateChangedEvent>(OnTelepadAnchorChange);
@@ -83,17 +79,6 @@ public sealed partial class CargoSystem
_linker.EnsureSinkPorts(uid, telepad.ReceiverPort);
}
private void OnRefreshParts(EntityUid uid, CargoTelepadComponent component, RefreshPartsEvent args)
{
var rating = args.PartRatings[component.MachinePartTeleportDelay] - 1;
component.Delay = component.BaseDelay * MathF.Pow(component.PartRatingTeleportDelay, rating);
}
private void OnUpgradeExamine(EntityUid uid, CargoTelepadComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("cargo-telepad-delay-upgrade", component.Delay / component.BaseDelay);
}
private void SetEnabled(EntityUid uid, CargoTelepadComponent component, ApcPowerReceiverComponent? receiver = null,
TransformComponent? xform = null)
{

View File

@@ -3,27 +3,9 @@ namespace Content.Server.Chemistry.Components;
[RegisterComponent]
public sealed partial class SolutionHeaterComponent : Component
{
/// <summary>
/// How much heat is added per second to the solution, with no upgrades.
/// </summary>
[DataField("baseHeatPerSecond")]
public float BaseHeatPerSecond = 120;
/// <summary>
/// How much heat is added per second to the solution, taking upgrades into account.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float HeatPerSecond;
/// <summary>
/// The machine part that affects the heat multiplier.
/// </summary>
[DataField("machinePartHeatMultiplier")]
public string MachinePartHeatMultiplier = "Capacitor";
/// <summary>
/// How much each upgrade multiplies the heat by.
/// </summary>
[DataField("partRatingHeatMultiplier")]
public float PartRatingHeatMultiplier = 1.5f;
}

View File

@@ -1,6 +1,5 @@
using Content.Server.Chemistry.Components;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Construction;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Shared.Chemistry;
@@ -21,8 +20,6 @@ public sealed class SolutionHeaterSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<SolutionHeaterComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<SolutionHeaterComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<SolutionHeaterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<SolutionHeaterComponent, ItemPlacedEvent>(OnItemPlaced);
SubscribeLocalEvent<SolutionHeaterComponent, ItemRemovedEvent>(OnItemRemoved);
}
@@ -64,18 +61,6 @@ public sealed class SolutionHeaterSystem : EntitySystem
}
}
private void OnRefreshParts(Entity<SolutionHeaterComponent> entity, ref RefreshPartsEvent args)
{
var heatRating = args.PartRatings[entity.Comp.MachinePartHeatMultiplier] - 1;
entity.Comp.HeatPerSecond = entity.Comp.BaseHeatPerSecond * MathF.Pow(entity.Comp.PartRatingHeatMultiplier, heatRating);
}
private void OnUpgradeExamine(Entity<SolutionHeaterComponent> entity, ref UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("solution-heater-upgrade-heat", entity.Comp.HeatPerSecond / entity.Comp.BaseHeatPerSecond);
}
private void OnItemPlaced(Entity<SolutionHeaterComponent> entity, ref ItemPlacedEvent args)
{
TryTurnOn(entity);

View File

@@ -1,7 +1,6 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Chat.Systems;
using Content.Server.Cloning.Components;
using Content.Server.Construction;
using Content.Server.DeviceLinking.Systems;
using Content.Server.EUI;
using Content.Server.Fluids.EntitySystems;
@@ -10,7 +9,6 @@ using Content.Server.Jobs;
using Content.Server.Materials;
using Content.Server.Popups;
using Content.Server.Power.EntitySystems;
using Content.Server.Traits.Assorted;
using Content.Shared.Atmos;
using Content.Shared.CCVar;
using Content.Shared.Chemistry.Components;
@@ -71,8 +69,6 @@ namespace Content.Server.Cloning
base.Initialize();
SubscribeLocalEvent<CloningPodComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<CloningPodComponent, RefreshPartsEvent>(OnPartsRefreshed);
SubscribeLocalEvent<CloningPodComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
SubscribeLocalEvent<BeingClonedComponent, MindAddedMessage>(HandleMindAdded);
SubscribeLocalEvent<CloningPodComponent, PortDisconnectedEvent>(OnPortDisconnected);
@@ -87,21 +83,6 @@ namespace Content.Server.Cloning
_signalSystem.EnsureSinkPorts(uid, CloningPodComponent.PodPort);
}
private void OnPartsRefreshed(EntityUid uid, CloningPodComponent component, RefreshPartsEvent args)
{
var materialRating = args.PartRatings[component.MachinePartMaterialUse];
var speedRating = args.PartRatings[component.MachinePartCloningSpeed];
component.BiomassRequirementMultiplier = MathF.Pow(component.PartRatingMaterialMultiplier, materialRating - 1);
component.CloningTime = component.BaseCloningTime * MathF.Pow(component.PartRatingSpeedMultiplier, speedRating - 1);
}
private void OnUpgradeExamine(EntityUid uid, CloningPodComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("cloning-pod-component-upgrade-speed", component.BaseCloningTime / component.CloningTime);
args.AddPercentageUpgrade("cloning-pod-component-upgrade-biomass-requirement", component.BiomassRequirementMultiplier);
}
internal void TransferMindToClone(EntityUid mindId, MindComponent mind)
{
if (!ClonesWaitingForMind.TryGetValue(mind, out var entity) ||
@@ -190,7 +171,7 @@ namespace Content.Server.Cloning
if (!TryComp<PhysicsComponent>(bodyToClone, out var physics))
return false;
var cloningCost = (int) Math.Round(physics.FixturesMass * clonePod.BiomassRequirementMultiplier);
var cloningCost = (int) Math.Round(physics.FixturesMass);
if (_configManager.GetCVar(CCVars.BiomassEasyMode))
cloningCost = (int) Math.Round(cloningCost * EasyModeCloningCost);

View File

@@ -5,7 +5,6 @@ using Content.Shared.Construction.Components;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Verbs;
using Robust.Shared.Containers;
using Robust.Shared.Map.Components;
using Robust.Shared.Utility;
namespace Content.Server.Construction;
@@ -144,7 +143,7 @@ public sealed partial class ConstructionSystem
var p = EntityManager.SpawnEntity(partProto.StockPartPrototype, xform.Coordinates);
if (!_container.Insert(p, partContainer))
throw new Exception($"Couldn't insert machine part of type {part} to machine with prototype {partProto.StockPartPrototype ?? "N/A"}!");
throw new Exception($"Couldn't insert machine part of type {part} to machine with prototype {partProto.StockPartPrototype}!");
}
}
@@ -184,7 +183,7 @@ public sealed class RefreshPartsEvent : EntityEventArgs
{
public IReadOnlyList<MachinePartComponent> Parts = new List<MachinePartComponent>();
public Dictionary<string, float> PartRatings = new Dictionary<string, float>();
public Dictionary<string, float> PartRatings = new();
}
public sealed class UpgradeExamineEvent : EntityEventArgs

View File

@@ -10,7 +10,6 @@ using Content.Shared.Storage;
using Robust.Shared.Containers;
using Robust.Shared.Utility;
using Content.Shared.Wires;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Collections;
@@ -43,7 +42,7 @@ public sealed class PartExchangerSystem : EntitySystem
if (args.Handled || args.Args.Target == null)
return;
if (!TryComp<StorageComponent>(uid, out var storage) || storage.Container == null)
if (!TryComp<StorageComponent>(uid, out var storage))
return; //the parts are stored in here
var machinePartQuery = GetEntityQuery<MachinePartComponent>();

View File

@@ -37,9 +37,6 @@ namespace Content.Server.Gravity
// 0 -> 1
[ViewVariables(VVAccess.ReadWrite)] [DataField("charge")] public float Charge { get; set; } = 1;
[DataField("machinePartMaxChargeMultiplier", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartMaxChargeMultiplier = "Capacitor";
/// <summary>
/// Is the gravity generator currently "producing" gravity?
/// </summary>

View File

@@ -1,6 +1,5 @@
using Content.Server.Administration.Logs;
using Content.Server.Audio;
using Content.Server.Construction;
using Content.Server.Power.Components;
using Content.Shared.Database;
using Content.Shared.Gravity;
@@ -27,7 +26,6 @@ namespace Content.Server.Gravity
SubscribeLocalEvent<GravityGeneratorComponent, ComponentShutdown>(OnComponentShutdown);
SubscribeLocalEvent<GravityGeneratorComponent, EntParentChangedMessage>(OnParentChanged); // Or just anchor changed?
SubscribeLocalEvent<GravityGeneratorComponent, InteractHandEvent>(OnInteractHand);
SubscribeLocalEvent<GravityGeneratorComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<GravityGeneratorComponent, SharedGravityGeneratorComponent.SwitchGeneratorMessage>(
OnSwitchGenerator);
}
@@ -256,12 +254,6 @@ namespace Content.Server.Gravity
}
}
private void OnRefreshParts(EntityUid uid, GravityGeneratorComponent component, RefreshPartsEvent args)
{
var maxChargeMultipler = args.PartRatings[component.MachinePartMaxChargeMultiplier];
component.MaxCharge = maxChargeMultipler * 1;
}
private void MakeBroken(Entity<GravityGeneratorComponent> ent, AppearanceComponent? appearance)
{
_ambientSoundSystem.SetAmbience(ent, false);

View File

@@ -1,4 +1,3 @@
using Content.Shared.Construction.Prototypes;
using Content.Shared.DeviceLinking;
using Content.Shared.Item;
using Robust.Shared.Audio;
@@ -13,10 +12,6 @@ namespace Content.Server.Kitchen.Components
{
[DataField("cookTimeMultiplier"), ViewVariables(VVAccess.ReadWrite)]
public float CookTimeMultiplier = 1;
[DataField("machinePartCookTimeMultiplier", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartCookTimeMultiplier = "Capacitor";
[DataField("cookTimeScalingConstant")]
public float CookTimeScalingConstant = 0.5f;
[DataField("baseHeatMultiplier"), ViewVariables(VVAccess.ReadWrite)]
public float BaseHeatMultiplier = 100;
[DataField("objectHeatMultiplier"), ViewVariables(VVAccess.ReadWrite)]

View File

@@ -1,8 +1,6 @@
using Content.Shared.Kitchen;
using Content.Server.Kitchen.EntitySystems;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Kitchen.Components
{
@@ -15,30 +13,15 @@ namespace Content.Server.Kitchen.Components
[Access(typeof(ReagentGrinderSystem)), RegisterComponent]
public sealed partial class ReagentGrinderComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public int StorageMaxEntities = 6;
[DataField("baseStorageMaxEntities"), ViewVariables(VVAccess.ReadWrite)]
public int BaseStorageMaxEntities = 4;
[DataField("machinePartStorageMax", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartStorageMax = "MatterBin";
[DataField("storagePerPartRating")]
public int StoragePerPartRating = 4;
[DataField("workTime"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan WorkTime = TimeSpan.FromSeconds(3.5); // Roughly matches the grind/juice sounds.
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float WorkTimeMultiplier = 1;
[DataField("machinePartWorkTime", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartWorkTime = "Manipulator";
[DataField("partRatingWorkTimeMultiplier")]
public float PartRatingWorkTimerMulitplier = 0.6f;
[DataField("clickSound"), ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier ClickSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");

View File

@@ -31,7 +31,6 @@ using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using System.Linq;
using Content.Shared.Access.Components;
namespace Content.Server.Kitchen.EntitySystems
{
@@ -67,8 +66,6 @@ namespace Content.Server.Kitchen.EntitySystems
SubscribeLocalEvent<MicrowaveComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<MicrowaveComponent, AnchorStateChangedEvent>(OnAnchorChanged);
SubscribeLocalEvent<MicrowaveComponent, SuicideEvent>(OnSuicide);
SubscribeLocalEvent<MicrowaveComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<MicrowaveComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<MicrowaveComponent, SignalReceivedEvent>(OnSignalReceived);
@@ -335,17 +332,6 @@ namespace Content.Server.Kitchen.EntitySystems
_sharedContainer.EmptyContainer(component.Storage);
}
private void OnRefreshParts(Entity<MicrowaveComponent> ent, ref RefreshPartsEvent args)
{
var cookRating = args.PartRatings[ent.Comp.MachinePartCookTimeMultiplier];
ent.Comp.CookTimeMultiplier = MathF.Pow(ent.Comp.CookTimeScalingConstant, cookRating - 1);
}
private void OnUpgradeExamine(Entity<MicrowaveComponent> ent, ref UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("microwave-component-upgrade-cook-time", ent.Comp.CookTimeMultiplier);
}
private void OnSignalReceived(Entity<MicrowaveComponent> ent, ref SignalReceivedEvent args)
{
if (args.Port != ent.Comp.OnPort)

View File

@@ -1,5 +1,4 @@
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Construction;
using Content.Server.Kitchen.Components;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
@@ -49,8 +48,6 @@ namespace Content.Server.Kitchen.EntitySystems
SubscribeLocalEvent<ReagentGrinderComponent, ComponentStartup>((uid, _, _) => UpdateUiState(uid));
SubscribeLocalEvent((EntityUid uid, ReagentGrinderComponent _, ref PowerChangedEvent _) => UpdateUiState(uid));
SubscribeLocalEvent<ReagentGrinderComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<ReagentGrinderComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<ReagentGrinderComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<ReagentGrinderComponent, EntInsertedIntoContainerMessage>(OnContainerModified);
SubscribeLocalEvent<ReagentGrinderComponent, EntRemovedFromContainerMessage>(OnContainerModified);
@@ -186,24 +183,6 @@ namespace Content.Server.Kitchen.EntitySystems
args.Handled = true;
}
/// <remarks>
/// Gotta be efficient, you know? you're saving a whole extra second here and everything.
/// </remarks>
private void OnRefreshParts(Entity<ReagentGrinderComponent> entity, ref RefreshPartsEvent args)
{
var ratingWorkTime = args.PartRatings[entity.Comp.MachinePartWorkTime];
var ratingStorage = args.PartRatings[entity.Comp.MachinePartStorageMax];
entity.Comp.WorkTimeMultiplier = MathF.Pow(entity.Comp.PartRatingWorkTimerMulitplier, ratingWorkTime - 1);
entity.Comp.StorageMaxEntities = entity.Comp.BaseStorageMaxEntities + (int) (entity.Comp.StoragePerPartRating * (ratingStorage - 1));
}
private void OnUpgradeExamine(Entity<ReagentGrinderComponent> entity, ref UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("reagent-grinder-component-upgrade-work-time", entity.Comp.WorkTimeMultiplier);
args.AddNumberUpgrade("reagent-grinder-component-upgrade-storage", entity.Comp.StorageMaxEntities - entity.Comp.BaseStorageMaxEntities);
}
private void UpdateUiState(EntityUid uid)
{
var inputContainer = _containerSystem.EnsureContainer<Container>(uid, SharedReagentGrinder.InputContainerId);

View File

@@ -1,6 +1,5 @@
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Construction;
using Content.Server.Fluids.EntitySystems;
using Content.Server.GameTicking;
using Content.Server.Nutrition.EntitySystems;
@@ -43,8 +42,6 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
base.Initialize();
SubscribeLocalEvent<MaterialReclaimerComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<MaterialReclaimerComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<MaterialReclaimerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<MaterialReclaimerComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<MaterialReclaimerComponent, InteractUsingEvent>(OnInteractUsing,
before: new []{typeof(WiresSystem), typeof(SolutionTransferSystem)});
@@ -56,18 +53,6 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
_solutionContainer.EnsureSolution(entity.Owner, entity.Comp.SolutionContainerId);
}
private void OnUpgradeExamine(Entity<MaterialReclaimerComponent> entity, ref UpgradeExamineEvent args)
{
args.AddPercentageUpgrade(Loc.GetString("material-reclaimer-upgrade-process-rate"), entity.Comp.MaterialProcessRate / entity.Comp.BaseMaterialProcessRate);
}
private void OnRefreshParts(Entity<MaterialReclaimerComponent> entity, ref RefreshPartsEvent args)
{
var rating = args.PartRatings[entity.Comp.MachinePartProcessRate] - 1;
entity.Comp.MaterialProcessRate = entity.Comp.BaseMaterialProcessRate * MathF.Pow(entity.Comp.PartRatingProcessRateMultiplier, rating);
Dirty(entity);
}
private void OnPowerChanged(Entity<MaterialReclaimerComponent> entity, ref PowerChangedEvent args)
{
AmbientSound.SetAmbience(entity.Owner, entity.Comp.Enabled && args.Powered);

View File

@@ -1,8 +1,4 @@
using System.Threading;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Storage;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Medical.BiomassReclaimer
{
@@ -50,53 +46,14 @@ namespace Content.Server.Medical.BiomassReclaimer
/// <summary>
/// How many units of biomass it produces for each unit of mass.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float YieldPerUnitMass = default;
/// <summary>
/// The base yield per mass unit when no components are upgraded.
/// </summary>
[DataField("baseYieldPerUnitMass")]
public float BaseYieldPerUnitMass = 0.4f;
/// <summary>
/// Machine part whose rating modifies the yield per mass.
/// </summary>
[DataField("machinePartYieldAmount", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartYieldAmount = "MatterBin";
/// <summary>
/// How much the machine part quality affects the yield.
/// Going up a tier will multiply the yield by this amount.
/// </summary>
[DataField("partRatingYieldAmountMultiplier")]
public float PartRatingYieldAmountMultiplier = 1.25f;
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float YieldPerUnitMass = 0.4f;
/// <summary>
/// The time it takes to process a mob, per mass.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float ProcessingTimePerUnitMass = default;
/// <summary>
/// The base time per mass unit that it takes to process a mob
/// when no components are upgraded.
/// </summary>
[DataField("baseProcessingTimePerUnitMass")]
public float BaseProcessingTimePerUnitMass = 0.5f;
/// <summary>
/// The machine part that increses the processing speed.
/// </summary>
[DataField("machinePartProcessSpeed", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartProcessingSpeed = "Manipulator";
/// <summary>
/// How much the machine part quality affects the yield.
/// Going up a tier will multiply the speed by this amount.
/// </summary>
[DataField("partRatingSpeedMultiplier")]
public float PartRatingSpeedMultiplier = 1.35f;
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float ProcessingTimePerUnitMass = 0.5f;
/// <summary>
/// Will this refuse to gib a living mob?

View File

@@ -1,6 +1,5 @@
using System.Numerics;
using Content.Server.Body.Components;
using Content.Server.Construction;
using Content.Server.Fluids.EntitySystems;
using Content.Server.Materials;
using Content.Server.Power.Components;
@@ -24,7 +23,6 @@ using Content.Shared.Nutrition.Components;
using Content.Shared.Popups;
using Content.Shared.Throwing;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Physics.Components;
@@ -96,8 +94,6 @@ namespace Content.Server.Medical.BiomassReclaimer
SubscribeLocalEvent<ActiveBiomassReclaimerComponent, UnanchorAttemptEvent>(OnUnanchorAttempt);
SubscribeLocalEvent<BiomassReclaimerComponent, AfterInteractUsingEvent>(OnAfterInteractUsing);
SubscribeLocalEvent<BiomassReclaimerComponent, ClimbedOnEvent>(OnClimbedOn);
SubscribeLocalEvent<BiomassReclaimerComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<BiomassReclaimerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<BiomassReclaimerComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<BiomassReclaimerComponent, SuicideEvent>(OnSuicide);
SubscribeLocalEvent<BiomassReclaimerComponent, ReclaimerDoAfterEvent>(OnDoAfter);
@@ -176,26 +172,6 @@ namespace Content.Server.Medical.BiomassReclaimer
StartProcessing(args.Climber, reclaimer);
}
private void OnRefreshParts(EntityUid uid, BiomassReclaimerComponent component, RefreshPartsEvent args)
{
var laserRating = args.PartRatings[component.MachinePartProcessingSpeed];
var manipRating = args.PartRatings[component.MachinePartYieldAmount];
// Processing time slopes downwards with part rating.
component.ProcessingTimePerUnitMass =
component.BaseProcessingTimePerUnitMass / MathF.Pow(component.PartRatingSpeedMultiplier, laserRating - 1);
// Yield slopes upwards with part rating.
component.YieldPerUnitMass =
component.BaseYieldPerUnitMass * MathF.Pow(component.PartRatingYieldAmountMultiplier, manipRating - 1);
}
private void OnUpgradeExamine(EntityUid uid, BiomassReclaimerComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("biomass-reclaimer-component-upgrade-speed", component.BaseProcessingTimePerUnitMass / component.ProcessingTimePerUnitMass);
args.AddPercentageUpgrade("biomass-reclaimer-component-upgrade-biomass-yield", component.YieldPerUnitMass / component.BaseYieldPerUnitMass);
}
private void OnDoAfter(Entity<BiomassReclaimerComponent> reclaimer, ref ReclaimerDoAfterEvent args)
{
if (args.Handled || args.Cancelled || args.Args.Target == null || HasComp<BiomassReclaimerComponent>(args.Args.Target.Value))

View File

@@ -13,13 +13,7 @@ namespace Content.Server.Medical.Components
public ContainerSlot BodyContainer = default!;
public EntityUid? ConnectedConsole;
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float CloningFailChanceMultiplier = 1f;
[DataField("machinePartCloningFailChance", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartCloningFailChance = "Capacitor";
[DataField("partRatingCloningFailChanceMultiplier")]
public float PartRatingFailMultiplier = 0.75f;
}
}

View File

@@ -7,7 +7,6 @@ using Content.Shared.Movement.Events;
using Content.Shared.Verbs;
using Robust.Shared.Containers;
using Content.Server.Cloning.Components;
using Content.Server.Construction;
using Content.Server.DeviceLinking.Systems;
using Content.Shared.DeviceLinking.Events;
using Content.Server.Power.EntitySystems;
@@ -45,8 +44,6 @@ namespace Content.Server.Medical
SubscribeLocalEvent<MedicalScannerComponent, DragDropTargetEvent>(OnDragDropOn);
SubscribeLocalEvent<MedicalScannerComponent, PortDisconnectedEvent>(OnPortDisconnected);
SubscribeLocalEvent<MedicalScannerComponent, AnchorStateChangedEvent>(OnAnchorChanged);
SubscribeLocalEvent<MedicalScannerComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<MedicalScannerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<MedicalScannerComponent, CanDropTargetEvent>(OnCanDragDropOn);
}
@@ -249,17 +246,5 @@ namespace Content.Server.Medical
_climbSystem.ForciblySetClimbing(contained, uid);
UpdateAppearance(uid, scannerComponent);
}
private void OnRefreshParts(EntityUid uid, MedicalScannerComponent component, RefreshPartsEvent args)
{
var ratingFail = args.PartRatings[component.MachinePartCloningFailChance];
component.CloningFailChanceMultiplier = MathF.Pow(component.PartRatingFailMultiplier, ratingFail - 1);
}
private void OnUpgradeExamine(EntityUid uid, MedicalScannerComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("medical-scanner-upgrade-cloning", component.CloningFailChanceMultiplier);
}
}
}

View File

@@ -1,5 +1,4 @@
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Nutrition.Components;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
@@ -26,26 +25,6 @@ public sealed partial class FatExtractorComponent : Component
[DataField("nutritionPerSecond"), ViewVariables(VVAccess.ReadWrite)]
public int NutritionPerSecond = 10;
/// <summary>
/// The base rate of extraction
/// </summary>
[DataField("baseNutritionPerSecond"), ViewVariables(VVAccess.ReadWrite)]
public int BaseNutritionPerSecond = 10;
#region Machine Upgrade
/// <summary>
/// Which machine part affects the nutrition rate
/// </summary>
[DataField("machinePartNutritionRate", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartNutritionRate = "Manipulator";
/// <summary>
/// The increase in rate per each rating above 1.
/// </summary>
[DataField("partRatingRateMultiplier")]
public float PartRatingRateMultiplier = 10;
#endregion
/// <summary>
/// An accumulator which tracks extracted nutrition to determine
/// when to spawn a meat.
@@ -57,7 +36,7 @@ public sealed partial class FatExtractorComponent : Component
/// How high <see cref="NutrientAccumulator"/> has to be to spawn meat
/// </summary>
[DataField("nutrientPerMeat"), ViewVariables(VVAccess.ReadWrite)]
public int NutrientPerMeat = 60;
public int NutrientPerMeat = 30;
/// <summary>
/// Meat spawned by the extractor.

View File

@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.Construction;
using Content.Server.Nutrition.Components;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
@@ -10,7 +9,6 @@ using Content.Shared.Emag.Systems;
using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems;
using Content.Shared.Storage.Components;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing;
@@ -29,8 +27,6 @@ public sealed class FatExtractorSystem : EntitySystem
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<FatExtractorComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<FatExtractorComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<FatExtractorComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<FatExtractorComponent, GotEmaggedEvent>(OnGotEmagged);
SubscribeLocalEvent<FatExtractorComponent, StorageAfterCloseEvent>(OnClosed);
@@ -38,17 +34,6 @@ public sealed class FatExtractorSystem : EntitySystem
SubscribeLocalEvent<FatExtractorComponent, PowerChangedEvent>(OnPowerChanged);
}
private void OnRefreshParts(EntityUid uid, FatExtractorComponent component, RefreshPartsEvent args)
{
var rating = args.PartRatings[component.MachinePartNutritionRate] - 1;
component.NutritionPerSecond = component.BaseNutritionPerSecond + (int) (component.PartRatingRateMultiplier * rating);
}
private void OnUpgradeExamine(EntityUid uid, FatExtractorComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("fat-extractor-component-rate", (float) component.NutritionPerSecond / component.BaseNutritionPerSecond);
}
private void OnUnpaused(EntityUid uid, FatExtractorComponent component, ref EntityUnpausedEvent args)
{
component.NextUpdate += args.PausedTime;

View File

@@ -1,28 +0,0 @@
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Power.Components
{
[RegisterComponent]
public sealed partial class UpgradeBatteryComponent : Component
{
/// <summary>
/// The machine part that affects the power capacity.
/// </summary>
[DataField("machinePartPowerCapacity", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartPowerCapacity = "PowerCell";
/// <summary>
/// The machine part rating is raised to this power when calculating power gain
/// </summary>
[DataField("maxChargeMultiplier")]
public float MaxChargeMultiplier = 2f;
/// <summary>
/// Power gain scaling
/// </summary>
[DataField("baseMaxCharge")]
public float BaseMaxCharge = 8000000;
}
}

View File

@@ -1,41 +0,0 @@
using Content.Server.Construction.Components;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Power.Components;
/// <summary>
/// This is used for machines whose power draw
/// can be decreased through machine part upgrades.
/// </summary>
[RegisterComponent]
public sealed partial class UpgradePowerDrawComponent : Component
{
/// <summary>
/// The base power draw of the machine.
/// Prioritizes hv/mv draw over lv draw.
/// Value is initializezd on map init from <see cref="ApcPowerReceiverComponent"/>
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float BaseLoad;
/// <summary>
/// The machine part that affects the power draw.
/// </summary>
[DataField("machinePartPowerDraw", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string MachinePartPowerDraw = "Capacitor";
/// <summary>
/// The multiplier used for scaling the power draw.
/// </summary>
[DataField("powerDrawMultiplier", required: true), ViewVariables(VVAccess.ReadWrite)]
public float PowerDrawMultiplier = 1f;
/// <summary>
/// What type of scaling is being used?
/// </summary>
[DataField("scaling", required: true), ViewVariables(VVAccess.ReadWrite)]
public MachineUpgradeScalingType Scaling;
}

View File

@@ -1,36 +0,0 @@
using Content.Server.Construction.Components;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Power.Components;
[RegisterComponent]
public sealed partial class UpgradePowerSupplierComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
public float BaseSupplyRate;
/// <summary>
/// The machine part that affects the power supplu.
/// </summary>
[DataField("machinePartPowerSupply", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string MachinePartPowerSupply = "Capacitor";
/// <summary>
/// The multiplier used for scaling the power supply.
/// </summary>
[DataField("powerSupplyMultiplier", required: true), ViewVariables(VVAccess.ReadWrite)]
public float PowerSupplyMultiplier = 1f;
/// <summary>
/// What type of scaling is being used?
/// </summary>
[DataField("scaling", required: true), ViewVariables(VVAccess.ReadWrite)]
public MachineUpgradeScalingType Scaling;
/// <summary>
/// The current value that the power supply is being scaled by,
/// </summary>
[DataField("actualScalar"), ViewVariables(VVAccess.ReadWrite)]
public float ActualScalar = 1f;
}

View File

@@ -1,38 +0,0 @@
using Content.Server.Construction.Components;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Power.Components
{
[RegisterComponent]
public sealed partial class UpgradePowerSupplyRampingComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
public float BaseRampRate;
/// <summary>
/// The machine part that affects the power supply ramping
/// </summary>
[DataField("machinePartPowerCapacity", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartRampRate = "Capacitor";
/// <summary>
/// The multiplier used for scaling the power supply ramping
/// </summary>
[DataField("supplyRampingMultiplier")]
public float SupplyRampingMultiplier = 1f;
/// <summary>
/// What type of scaling is being used?
/// </summary>
[DataField("scaling", required: true), ViewVariables(VVAccess.ReadWrite)]
public MachineUpgradeScalingType Scaling;
/// <summary>
/// The current value that the power supply is being scaled by
/// </summary>
[DataField("actualScalar"), ViewVariables(VVAccess.ReadWrite)]
public float ActualScalar = 1f;
}
}

View File

@@ -1,39 +0,0 @@
using Content.Server.Construction;
using Content.Server.Power.Components;
using JetBrains.Annotations;
namespace Content.Server.Power.EntitySystems
{
[UsedImplicitly]
public sealed class UpgradeBatterySystem : EntitySystem
{
[Dependency] private readonly BatterySystem _batterySystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<UpgradeBatteryComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<UpgradeBatteryComponent, UpgradeExamineEvent>(OnUpgradeExamine);
}
public void OnRefreshParts(EntityUid uid, UpgradeBatteryComponent component, RefreshPartsEvent args)
{
var powerCellRating = args.PartRatings[component.MachinePartPowerCapacity];
if (TryComp<BatteryComponent>(uid, out var batteryComp))
{
_batterySystem.SetMaxCharge(uid, MathF.Pow(component.MaxChargeMultiplier, powerCellRating - 1) * component.BaseMaxCharge, batteryComp);
}
}
private void OnUpgradeExamine(EntityUid uid, UpgradeBatteryComponent component, UpgradeExamineEvent args)
{
// UpgradeBatteryComponent.MaxChargeMultiplier is not the actual multiplier, so we have to do this.
if (TryComp<BatteryComponent>(uid, out var batteryComp))
{
args.AddPercentageUpgrade("upgrade-max-charge", batteryComp.MaxCharge / component.BaseMaxCharge);
}
}
}
}

View File

@@ -1,139 +0,0 @@
using Content.Server.Construction;
using Content.Server.Construction.Components;
using Content.Server.Power.Components;
namespace Content.Server.Power.EntitySystems;
/// <summary>
/// This handles using upgraded machine parts
/// to modify the power supply/generation of a machine.
/// </summary>
public sealed class UpgradePowerSystem : EntitySystem
{
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<UpgradePowerDrawComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<UpgradePowerDrawComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<UpgradePowerDrawComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<UpgradePowerSupplierComponent, MapInitEvent>(OnSupplierMapInit);
SubscribeLocalEvent<UpgradePowerSupplierComponent, RefreshPartsEvent>(OnSupplierRefreshParts);
SubscribeLocalEvent<UpgradePowerSupplierComponent, UpgradeExamineEvent>(OnSupplierUpgradeExamine);
SubscribeLocalEvent<UpgradePowerSupplyRampingComponent, MapInitEvent>(OnSupplyRampingMapInit);
SubscribeLocalEvent<UpgradePowerSupplyRampingComponent, RefreshPartsEvent>(OnSupplyRampingRefreshParts);
SubscribeLocalEvent<UpgradePowerSupplyRampingComponent, UpgradeExamineEvent>(OnSupplyRampingUpgradeExamine);
}
private void OnMapInit(EntityUid uid, UpgradePowerDrawComponent component, MapInitEvent args)
{
if (TryComp<PowerConsumerComponent>(uid, out var powa))
component.BaseLoad = powa.DrawRate;
else if (TryComp<ApcPowerReceiverComponent>(uid, out var powa2))
component.BaseLoad = powa2.Load;
}
private void OnRefreshParts(EntityUid uid, UpgradePowerDrawComponent component, RefreshPartsEvent args)
{
var load = component.BaseLoad;
var rating = args.PartRatings[component.MachinePartPowerDraw];
switch (component.Scaling)
{
case MachineUpgradeScalingType.Linear:
load += component.PowerDrawMultiplier * (rating - 1);
break;
case MachineUpgradeScalingType.Exponential:
load *= MathF.Pow(component.PowerDrawMultiplier, rating - 1);
break;
default:
Log.Error($"invalid power scaling type for {ToPrettyString(uid)}.");
load = 0;
break;
}
if (TryComp<ApcPowerReceiverComponent>(uid, out var powa))
powa.Load = load;
if (TryComp<PowerConsumerComponent>(uid, out var powa2))
powa2.DrawRate = load;
}
private void OnUpgradeExamine(EntityUid uid, UpgradePowerDrawComponent component, UpgradeExamineEvent args)
{
// UpgradePowerDrawComponent.PowerDrawMultiplier is not the actual multiplier, so we have to do this.
var powerDrawMultiplier = CompOrNull<ApcPowerReceiverComponent>(uid)?.Load / component.BaseLoad
?? CompOrNull<PowerConsumerComponent>(uid)?.DrawRate / component.BaseLoad;
if (powerDrawMultiplier is not null)
args.AddPercentageUpgrade("upgrade-power-draw", powerDrawMultiplier.Value);
}
private void OnSupplierMapInit(EntityUid uid, UpgradePowerSupplierComponent component, MapInitEvent args)
{
if (TryComp<PowerSupplierComponent>(uid, out var supplier))
component.BaseSupplyRate = supplier.MaxSupply;
}
private void OnSupplierRefreshParts(EntityUid uid, UpgradePowerSupplierComponent component, RefreshPartsEvent args)
{
var supply = component.BaseSupplyRate;
var rating = args.PartRatings[component.MachinePartPowerSupply];
switch (component.Scaling)
{
case MachineUpgradeScalingType.Linear:
supply += component.PowerSupplyMultiplier * component.BaseSupplyRate * (rating - 1);
break;
case MachineUpgradeScalingType.Exponential:
supply *= MathF.Pow(component.PowerSupplyMultiplier, rating - 1);
break;
default:
Log.Error($"invalid power scaling type for {ToPrettyString(uid)}.");
supply = component.BaseSupplyRate;
break;
}
component.ActualScalar = supply / component.BaseSupplyRate;
if (TryComp<PowerSupplierComponent>(uid, out var powa))
powa.MaxSupply = supply;
}
private void OnSupplierUpgradeExamine(EntityUid uid, UpgradePowerSupplierComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("upgrade-power-supply", component.ActualScalar);
}
private void OnSupplyRampingMapInit(EntityUid uid, UpgradePowerSupplyRampingComponent component, MapInitEvent args)
{
if (TryComp<PowerNetworkBatteryComponent>(uid, out var battery))
component.BaseRampRate = battery.SupplyRampRate;
}
private void OnSupplyRampingRefreshParts(EntityUid uid, UpgradePowerSupplyRampingComponent component, RefreshPartsEvent args)
{
var rampRate = component.BaseRampRate;
var rating = args.PartRatings[component.MachinePartRampRate];
switch (component.Scaling)
{
case MachineUpgradeScalingType.Linear:
rampRate += component.SupplyRampingMultiplier * component.BaseRampRate * (rating - 1);
break;
case MachineUpgradeScalingType.Exponential:
rampRate *= MathF.Pow(component.SupplyRampingMultiplier, rating - 1);
break;
default:
Log.Error($"invalid power supply ramping type for {ToPrettyString(uid)}.");
rampRate = component.BaseRampRate;
break;
}
component.ActualScalar = rampRate / component.BaseRampRate;
if (TryComp<PowerNetworkBatteryComponent>(uid, out var battery))
battery.SupplyRampRate = rampRate;
}
private void OnSupplyRampingUpgradeExamine(EntityUid uid, UpgradePowerSupplyRampingComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("upgrade-power-supply-ramping", component.ActualScalar);
}
}

View File

@@ -26,11 +26,8 @@ public sealed class GeneratorSystem : SharedGeneratorSystem
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly PuddleSystem _puddle = default!;
private EntityQuery<UpgradePowerSupplierComponent> _upgradeQuery;
public override void Initialize()
{
_upgradeQuery = GetEntityQuery<UpgradePowerSupplierComponent>();
UpdatesBefore.Add(typeof(PowerNetSystem));
@@ -216,9 +213,7 @@ public sealed class GeneratorSystem : SharedGeneratorSystem
supplier.Enabled = true;
var upgradeMultiplier = _upgradeQuery.CompOrNull(uid)?.ActualScalar ?? 1f;
supplier.MaxSupply = gen.TargetPower * upgradeMultiplier;
supplier.MaxSupply = gen.TargetPower;
var eff = 1 / CalcFuelEfficiency(gen.TargetPower, gen.OptimalPower, gen);
var consumption = gen.OptimalBurnRate * frameTime * eff;

View File

@@ -1,10 +1,8 @@
using System.Numerics;
using Content.Server.Shuttles.Systems;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Damage;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Shuttles.Components
{
@@ -27,9 +25,6 @@ namespace Content.Server.Shuttles.Components
[ViewVariables(VVAccess.ReadWrite), DataField("thrust")]
public float Thrust = 100f;
[DataField("baseThrust"), ViewVariables(VVAccess.ReadWrite)]
public float BaseThrust = 100f;
[DataField("thrusterType")]
public ThrusterType Type = ThrusterType.Linear;
@@ -60,12 +55,6 @@ namespace Content.Server.Shuttles.Components
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("nextFire", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan NextFire;
[DataField("machinePartThrust", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartThrust = "Capacitor";
[DataField("partRatingThrustMultiplier")]
public float PartRatingThrustMultiplier = 1.5f;
}
public enum ThrusterType

View File

@@ -52,9 +52,6 @@ public sealed class ThrusterSystem : EntitySystem
SubscribeLocalEvent<ThrusterComponent, ExaminedEvent>(OnThrusterExamine);
SubscribeLocalEvent<ThrusterComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<ThrusterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<ShuttleComponent, TileChangedEvent>(OnShuttleTileChange);
}
@@ -204,12 +201,10 @@ public sealed class ThrusterSystem : EntitySystem
if (component.Type == ThrusterType.Linear)
{
oldShuttleComponent.LinearThrust[oldDirection] -= component.Thrust;
oldShuttleComponent.BaseLinearThrust[oldDirection] -= component.BaseThrust;
DebugTools.Assert(oldShuttleComponent.LinearThrusters[oldDirection].Contains(uid));
oldShuttleComponent.LinearThrusters[oldDirection].Remove(uid);
shuttleComponent.LinearThrust[direction] += component.Thrust;
shuttleComponent.BaseLinearThrust[direction] += component.BaseThrust;
DebugTools.Assert(!shuttleComponent.LinearThrusters[direction].Contains(uid));
shuttleComponent.LinearThrusters[direction].Add(uid);
}
@@ -283,7 +278,6 @@ public sealed class ThrusterSystem : EntitySystem
var direction = (int) xform.LocalRotation.GetCardinalDir() / 2;
shuttleComponent.LinearThrust[direction] += component.Thrust;
shuttleComponent.BaseLinearThrust[direction] += component.BaseThrust;
DebugTools.Assert(!shuttleComponent.LinearThrusters[direction].Contains(uid));
shuttleComponent.LinearThrusters[direction].Add(uid);
@@ -382,7 +376,6 @@ public sealed class ThrusterSystem : EntitySystem
var direction = (int) angle.Value.GetCardinalDir() / 2;
shuttleComponent.LinearThrust[direction] -= component.Thrust;
shuttleComponent.BaseLinearThrust[direction] -= component.BaseThrust;
DebugTools.Assert(shuttleComponent.LinearThrusters[direction].Contains(uid));
shuttleComponent.LinearThrusters[direction].Remove(uid);
break;
@@ -578,24 +571,6 @@ public sealed class ThrusterSystem : EntitySystem
}
}
private void OnRefreshParts(EntityUid uid, ThrusterComponent component, RefreshPartsEvent args)
{
if (component.IsOn) // safely disable thruster to prevent negative thrust
DisableThruster(uid, component);
var thrustRating = args.PartRatings[component.MachinePartThrust];
component.Thrust = component.BaseThrust * MathF.Pow(component.PartRatingThrustMultiplier, thrustRating - 1);
if (component.Enabled && CanEnable(uid, component))
EnableThruster(uid, component);
}
private void OnUpgradeExamine(EntityUid uid, ThrusterComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("thruster-comp-upgrade-thrust", component.Thrust / component.BaseThrust);
}
#endregion
private int GetFlagIndex(DirectionFlag flag)

View File

@@ -1,7 +1,6 @@
using System.Numerics;
using System.Threading;
using Content.Server.Administration.Logs;
using Content.Server.Construction;
using Content.Server.DeviceLinking.Events;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
@@ -48,8 +47,6 @@ namespace Content.Server.Singularity.EntitySystems
SubscribeLocalEvent<EmitterComponent, InteractHandEvent>(OnInteractHand);
SubscribeLocalEvent<EmitterComponent, GetVerbsEvent<Verb>>(OnGetVerb);
SubscribeLocalEvent<EmitterComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<EmitterComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<EmitterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<EmitterComponent, AnchorStateChangedEvent>(OnAnchorStateChanged);
SubscribeLocalEvent<EmitterComponent, SignalReceivedEvent>(OnSignalReceived);
}
@@ -179,20 +176,6 @@ namespace Content.Server.Singularity.EntitySystems
}
}
private void OnRefreshParts(EntityUid uid, EmitterComponent component, RefreshPartsEvent args)
{
var fireRateRating = args.PartRatings[component.MachinePartFireRate];
component.FireInterval = component.BaseFireInterval * MathF.Pow(component.FireRateMultiplier, fireRateRating - 1);
component.FireBurstDelayMin = component.BaseFireBurstDelayMin * MathF.Pow(component.FireRateMultiplier, fireRateRating - 1);
component.FireBurstDelayMax = component.BaseFireBurstDelayMax * MathF.Pow(component.FireRateMultiplier, fireRateRating - 1);
}
private void OnUpgradeExamine(EntityUid uid, EmitterComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("emitter-component-upgrade-fire-rate", (float) (component.BaseFireInterval.TotalSeconds / component.FireInterval.TotalSeconds));
}
public void SwitchOff(EntityUid uid, EmitterComponent component)
{
component.IsOn = false;

View File

@@ -1,7 +1,4 @@
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Xenoarchaeology.Equipment.Components;
namespace Content.Server.Xenoarchaeology.Equipment.Components;
/// <summary>
/// This is used for a machine that biases
@@ -10,18 +7,6 @@ namespace Content.Server.Xenoarchaeology.Equipment.Components;
[RegisterComponent]
public sealed partial class TraversalDistorterComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
public float BiasChance;
[DataField("baseBiasChance")]
public float BaseBiasChance = 0.7f;
[DataField("machinePartBiasChance", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartBiasChance = "Manipulator";
[DataField("partRatingBiasChance")]
public float PartRatingBiasChance = 1.1f;
[ViewVariables(VVAccess.ReadWrite)]
public BiasDirection BiasDirection = BiasDirection.In;

View File

@@ -1,12 +1,9 @@
using Content.Server.Construction;
using Content.Server.Popups;
using Content.Server.Popups;
using Content.Server.Power.EntitySystems;
using Content.Server.Xenoarchaeology.Equipment.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Placeable;
using Robust.Shared.Player;
using Robust.Shared.Timing;
namespace Content.Server.Xenoarchaeology.Equipment.Systems;
@@ -23,8 +20,6 @@ public sealed class TraversalDistorterSystem : EntitySystem
SubscribeLocalEvent<TraversalDistorterComponent, ActivateInWorldEvent>(OnInteract);
SubscribeLocalEvent<TraversalDistorterComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<TraversalDistorterComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<TraversalDistorterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<TraversalDistorterComponent, ItemPlacedEvent>(OnItemPlaced);
SubscribeLocalEvent<TraversalDistorterComponent, ItemRemovedEvent>(OnItemRemoved);
@@ -77,18 +72,6 @@ public sealed class TraversalDistorterSystem : EntitySystem
args.PushMarkup(examine);
}
private void OnRefreshParts(EntityUid uid, TraversalDistorterComponent component, RefreshPartsEvent args)
{
var biasRating = args.PartRatings[component.MachinePartBiasChance];
component.BiasChance = component.BaseBiasChance * MathF.Pow(component.PartRatingBiasChance, biasRating - 1);
}
private void OnUpgradeExamine(EntityUid uid, TraversalDistorterComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("traversal-distorter-upgrade-bias", component.BiasChance / component.BaseBiasChance);
}
private void OnItemPlaced(EntityUid uid, TraversalDistorterComponent component, ref ItemPlacedEvent args)
{
var bias = EnsureComp<BiasedArtifactComponent>(args.OtherEntity);

View File

@@ -206,7 +206,6 @@ public sealed partial class ArtifactSystem : EntitySystem
if (TryComp<BiasedArtifactComponent>(uid, out var bias) &&
TryComp<TraversalDistorterComponent>(bias.Provider, out var trav) &&
_random.Prob(trav.BiasChance) &&
this.IsPowered(bias.Provider, EntityManager))
{
switch (trav.BiasDirection)

View File

@@ -1,4 +1,3 @@
using Content.Shared.Construction.Prototypes;
using Content.Shared.DeviceLinking;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
@@ -13,30 +12,12 @@ namespace Content.Shared.Cargo.Components;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedCargoSystem))]
public sealed partial class CargoTelepadComponent : Component
{
/// <summary>
/// The base amount of time it takes to teleport from the telepad
/// </summary>
[DataField("baseDelay"), ViewVariables(VVAccess.ReadWrite)]
public float BaseDelay = 10f;
/// <summary>
/// The actual amount of time it takes to teleport from the telepad
/// </summary>
[DataField("delay"), ViewVariables(VVAccess.ReadWrite)]
public float Delay = 10f;
/// <summary>
/// The machine part that affects <see cref="Delay"/>
/// </summary>
[DataField("machinePartTeleportDelay", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string MachinePartTeleportDelay = "Capacitor";
/// <summary>
/// A multiplier applied to <see cref="Delay"/> for each level of <see cref="MachinePartTeleportDelay"/>
/// </summary>
[DataField("partRatingTeleportDelay"), ViewVariables(VVAccess.ReadWrite)]
public float PartRatingTeleportDelay = 0.8f;
/// <summary>
/// How much time we've accumulated until next teleport.
/// </summary>

View File

@@ -1,11 +1,9 @@
using Content.Shared.Construction.Prototypes;
using Content.Shared.DeviceLinking;
using Content.Shared.Materials;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Cloning;
@@ -36,28 +34,10 @@ public sealed partial class CloningPodComponent : Component
[DataField("requiredMaterial"), ViewVariables(VVAccess.ReadWrite)]
public ProtoId<MaterialPrototype> RequiredMaterial = "Biomass";
/// <summary>
/// The base amount of time it takes to clone a body
/// </summary>
[DataField("baseCloningTime")]
public float BaseCloningTime = 30f;
/// <summary>
/// The multiplier for cloning duration
/// </summary>
[DataField("partRatingSpeedMultiplier")]
public float PartRatingSpeedMultiplier = 0.75f;
/// <summary>
/// The machine part that affects cloning speed
/// </summary>
[DataField("machinePartCloningSpeed"), ViewVariables(VVAccess.ReadWrite)]
public ProtoId<MachinePartPrototype> MachinePartCloningSpeed = "Manipulator";
/// <summary>
/// The current amount of time it takes to clone a body
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float CloningTime = 30f;
/// <summary>
@@ -82,25 +62,6 @@ public sealed partial class CloningPodComponent : Component
Params = AudioParams.Default.WithVolume(4),
};
/// <summary>
/// The machine part that affects how much biomass is needed to clone a body.
/// </summary>
[DataField("partRatingMaterialMultiplier")]
public float PartRatingMaterialMultiplier = 0.85f;
/// <summary>
/// The current multiplier on the body weight, which determines the
/// amount of biomass needed to clone.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float BiomassRequirementMultiplier = 1;
/// <summary>
/// The machine part that decreases the amount of material needed for cloning
/// </summary>
[DataField("machinePartMaterialUse"), ViewVariables(VVAccess.ReadWrite)]
public ProtoId<MachinePartPrototype> MachinePartMaterialUse = "MatterBin";
[ViewVariables(VVAccess.ReadWrite)]
public CloningPodStatus Status;

View File

@@ -21,7 +21,6 @@ namespace Content.Shared.Construction
{
base.Initialize();
SubscribeLocalEvent<MachineBoardComponent, ExaminedEvent>(OnMachineBoardExamined);
SubscribeLocalEvent<MachinePartComponent, ExaminedEvent>(OnMachinePartExamined);
}
private void OnMachineBoardExamined(EntityUid uid, MachineBoardComponent component, ExaminedEvent args)
@@ -62,20 +61,6 @@ namespace Content.Shared.Construction
}
}
private void OnMachinePartExamined(EntityUid uid, MachinePartComponent component, ExaminedEvent args)
{
if (!args.IsInDetailsRange)
return;
using (args.PushGroup(nameof(MachinePartComponent)))
{
args.PushMarkup(Loc.GetString("machine-part-component-on-examine-rating-text",
("rating", component.Rating)));
args.PushMarkup(Loc.GetString("machine-part-component-on-examine-type-text", ("type",
Loc.GetString(_prototype.Index<MachinePartPrototype>(component.PartType).Name))));
}
}
public Dictionary<string, int> GetMachineBoardMaterialCost(Entity<MachineBoardComponent> entity, int coefficient = 1)
{
var (_, comp) = entity;

View File

@@ -1,8 +1,6 @@
using Content.Shared.Construction.Prototypes;
using Content.Shared.Whitelist;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
@@ -44,13 +42,6 @@ public sealed partial class MaterialReclaimerComponent : Component
[DataField]
public bool ScaleProcessSpeed = true;
/// <summary>
/// How quickly it takes to consume X amount of materials per second.
/// For example, with a rate of 50, an entity with 100 total material takes 2 seconds to process.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float BaseMaterialProcessRate = 100f;
/// <summary>
/// How quickly it takes to consume X amount of materials per second.
/// For example, with a rate of 50, an entity with 100 total material takes 2 seconds to process.
@@ -58,18 +49,6 @@ public sealed partial class MaterialReclaimerComponent : Component
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public float MaterialProcessRate = 100f;
/// <summary>
/// Machine part whose rating modifies <see cref="MaterialProcessRate"/>
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public ProtoId<MachinePartPrototype> MachinePartProcessRate = "Manipulator";
/// <summary>
/// How much the machine part quality affects the <see cref="MaterialProcessRate"/>
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float PartRatingProcessRateMultiplier = 1.5f;
/// <summary>
/// The minimum amount fo time it can take to process an entity.
/// this value supercedes the calculated one using <see cref="MaterialProcessRate"/>

View File

@@ -1,5 +1,4 @@
using System.Threading;
using Content.Shared.Construction.Prototypes;
using Content.Shared.DeviceLinking;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
@@ -53,12 +52,6 @@ public sealed partial class EmitterComponent : Component
[DataField("fireInterval")]
public TimeSpan FireInterval = TimeSpan.FromSeconds(2);
/// <summary>
/// The base amount of time between each shot during a burst.
/// </summary>
[DataField("baseFireInterval"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan BaseFireInterval = TimeSpan.FromSeconds(2);
/// <summary>
/// The current minimum delay between bursts.
/// </summary>
@@ -71,33 +64,6 @@ public sealed partial class EmitterComponent : Component
[DataField("fireBurstDelayMax")]
public TimeSpan FireBurstDelayMax = TimeSpan.FromSeconds(10);
/// <summary>
/// The base minimum delay between shot bursts.
/// Used for machine part rating calculations.
/// </summary>
[DataField("baseFireBurstDelayMin")]
public TimeSpan BaseFireBurstDelayMin = TimeSpan.FromSeconds(4);
/// <summary>
/// The base maximum delay between shot bursts.
/// Used for machine part rating calculations.
/// </summary>
[DataField("baseFireBurstDelayMax")]
public TimeSpan BaseFireBurstDelayMax = TimeSpan.FromSeconds(10);
/// <summary>
/// The multiplier for the base delay between shot bursts as well as
/// the fire interval
/// </summary>
[DataField("fireRateMultiplier"), ViewVariables(VVAccess.ReadWrite)]
public float FireRateMultiplier = 0.8f;
/// <summary>
/// The machine part that affects burst delay.
/// </summary>
[DataField("machinePartFireRate", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartFireRate = "Capacitor";
/// <summary>
/// The visual state that is set when the emitter is turned on
/// </summary>

View File

@@ -3,7 +3,6 @@ anomaly-component-contact-damage = The anomaly sears off your skin!
anomaly-vessel-component-anomaly-assigned = Anomaly assigned to vessel.
anomaly-vessel-component-not-assigned = This vessel is not assigned to any anomaly. Try using a scanner on it.
anomaly-vessel-component-assigned = This vessel is currently assigned to an anomaly.
anomaly-vessel-component-upgrade-output = point output
anomaly-particles-delta = Delta particles
anomaly-particles-epsilon = Epsilon particles

View File

@@ -1,6 +1,3 @@
gas-recycler-reacting = It is [color=green]converting[/color] waste gases.
gas-recycler-low-pressure = The input pressure is [color=darkred]too low[/color].
gas-recycler-low-temperature = The input temperature is [color=darkred]too low[/color].
gas-recycler-upgrade-min-temp = Minimum temperature
gas-recycler-upgrade-min-pressure = Minimum pressure

View File

@@ -1,4 +1 @@
portable-scrubber-fill-level = It's at about [color=yellow]{$percent}%[/color] of its maximum internal pressure.
portable-scrubber-component-upgrade-max-pressure = max pressure
portable-scrubber-component-upgrade-transfer-rate = transfer rate

View File

@@ -2,5 +2,3 @@
seed-extractor-component-interact-message = You extract some seeds from the { THE($name) }.
seed-extractor-component-no-seeds = { CAPITALIZE(THE($name)) } has no seeds!
seed-extractor-component-upgrade-seed-yield = seed yield

View File

@@ -45,5 +45,3 @@ cargo-shuttle-console-station-unknown = Unknown
cargo-shuttle-console-shuttle-not-found = Not found
cargo-shuttle-console-organics = Detected organic lifeforms on the shuttle
cargo-no-shuttle = No cargo shuttle found!
cargo-telepad-delay-upgrade = Teleport delay

View File

@@ -1 +0,0 @@
solution-heater-upgrade-heat = Heat strength

View File

@@ -1,2 +0,0 @@
machine-part-component-on-examine-rating-text = [color=white]Rating:[/color] [color=cyan]{$rating}[/color]
machine-part-component-on-examine-type-text = [color=white]Type:[/color] [color=cyan]{$type}[/color]

View File

@@ -9,7 +9,6 @@ microwave-component-suicide-multi-head-others-message = {$victim} is trying to c
microwave-component-suicide-others-message = {$victim} is trying to cook their head!
microwave-component-suicide-multi-head-message = You cook your heads!
microwave-component-suicide-message = You cook your head!
microwave-component-upgrade-cook-time = cook time
microwave-component-interact-full = It's full.
microwave-component-interact-item-too-big = { CAPITALIZE(THE($item)) } is too big to fit in the microwave!

View File

@@ -4,9 +4,6 @@ reagent-grinder-bound-user-interface-instant-button = INSTANT
reagent-grinder-bound-user-interface-cook-time-label = COOK TIME
reagent-grinder-component-cannot-put-entity-message = You can't put this in the reagent grinder!
reagent-grinder-component-upgrade-work-time = Work time
reagent-grinder-component-upgrade-storage = Storage
grinder-menu-title = All-In-One Grinder 3000
grinder-menu-grind-button = Grind
grinder-menu-juice-button = Juice

View File

@@ -13,11 +13,6 @@ machine-part-name-manipulator = Manipulator
machine-part-name-matter-bin = Matter Bin
machine-part-name-power-cell = Power Cell
upgrade-power-draw = power draw
upgrade-max-charge = max charge
upgrade-power-supply = power supply
upgrade-power-supply-ramping = power ramp rate
two-way-lever-left = push left
two-way-lever-right = push right
two-way-lever-cant = can't push the lever that way!

View File

@@ -34,6 +34,3 @@ materials-raw-silver = raw silver
materials-raw-plasma = raw plasma
materials-raw-uranium = raw uranium
materials-raw-bananium = raw bananium
# Material Reclaimer
material-reclaimer-upgrade-process-rate = process rate

View File

@@ -1,4 +1 @@
biomass-reclaimer-suicide-others = {CAPITALIZE(THE($victim))} threw themselves into the biomass reclaimer!
biomass-reclaimer-component-upgrade-speed = speed
biomass-reclaimer-component-upgrade-biomass-yield = biomass yield

View File

@@ -1,5 +1,3 @@
cloning-pod-biomass = It currently has [color=red]{$number}[/color] units of biomass.
cloning-pod-component-upgrade-speed = cloning speed
cloning-pod-component-upgrade-biomass-requirement = biomass requirement
cloning-pod-component-upgrade-emag-requirement = The card zaps something inside the cloning pod.

View File

@@ -2,5 +2,3 @@
medical-scanner-verb-enter = Enter
medical-scanner-verb-noun-occupant = occupant
medical-scanner-upgrade-cloning = Cloning fail chance

View File

@@ -1 +0,0 @@
stasis-bed-component-upgrade-stasis = stasis effect

View File

@@ -1,5 +1,3 @@
fat-extractor-component-rate = extraction rate
fat-extractor-fact-1 = Fats are triglycerides made up of a combination of different building blocks; glycerol and fatty acids.
fat-extractor-fact-2 = Adults should get a recommended 20-35% of their energy intake from fat.
fat-extractor-fact-3 = Being overweight or obese puts you at an increased risk of chronic diseases, such as cardiovascular diseases, metabolic syndrome, type 2 diabetes, and some types of cancers.

View File

@@ -3,5 +3,3 @@ thruster-comp-disabled = The thruster is turned [color=red]off[/color].
thruster-comp-nozzle-direction = The nozzle is facing [color=yellow]{$direction}[/color].
thruster-comp-nozzle-exposed = The nozzle [color=green]exposed[/color] to space.
thruster-comp-nozzle-not-exposed = The nozzle [color=red]is not exposed[/color] to space.
thruster-comp-upgrade-thrust = Thrust strength

View File

@@ -11,8 +11,5 @@ comp-emitter-turned-off = The {$target} turns off.
# Shows if the user attempts to activate the emitter while it's un-anchored.
comp-emitter-not-anchored = The {$target} isn't anchored to the ground!
# Upgrades
emitter-component-upgrade-fire-rate = fire rate
emitter-component-current-type = The current selected type is: {$type}.
emitter-component-type-set = Type set to: {$type}

View File

@@ -3,5 +3,3 @@ traversal-distorter-set-out = Traversal bias set to "out"
traversal-distorter-desc-in = The affected artifact's traversal now favors moving inwards to the beginning.
traversal-distorter-desc-out = The affected artifact's traversal now favors moving outwards towards more dangerous nodes.
traversal-distorter-upgrade-bias = Bias effectiveness

View File

@@ -2545,8 +2545,6 @@ entities:
- ShutdownSubscribers:
- 433
type: DeviceNetwork
missingComponents:
- UpgradeBattery
- proto: SpawnPointChiefEngineer
entities:
- uid: 145

View File

@@ -9,9 +9,6 @@
sprite: Objects/Misc/stock_parts.rsi
- type: Item
size: Tiny
- type: GuideHelp
guides:
- MachineUpgrading
- type: entity
id: CapacitorStockPart

View File

@@ -10,9 +10,6 @@
- type: Item
sprite: Objects/Specific/Research/rped.rsi
size: Normal
- type: GuideHelp
guides:
- MachineUpgrading
- type: PartExchanger
- type: Storage
grid:

View File

@@ -34,9 +34,6 @@
- type: Wires
boardName: wires-board-name-chemdispenser
layoutId: ChemDispenser
- type: UpgradePowerDraw
powerDrawMultiplier: 0.75
scaling: Exponential
- type: GuideHelp
guides:
- Chemicals

View File

@@ -176,8 +176,8 @@
SetParticleEpsilon: AnomalousParticleEpsilon
SetParticleZeta: AnomalousParticleZeta
fireBurstSize: 1
baseFireBurstDelayMin: 2
baseFireBurstDelayMax: 6
fireBurstDelayMin: 2
fireBurstDelayMax: 6
- type: ApcPowerReceiver
powerLoad: 100
- type: GuideHelp

View File

@@ -53,9 +53,6 @@
- type: ApcPowerReceiver
powerLoad: 15000
needsPower: true
- type: UpgradePowerDraw
powerDrawMultiplier: 0.80
scaling: Exponential
- type: ItemPlacer
whitelist:
components:

View File

@@ -106,9 +106,6 @@
hard: False
- type: Transform
noRot: false
- type: UpgradePowerDraw
powerDrawMultiplier: 0.80
scaling: Exponential
- type: TraversalDistorter
- type: ItemPlacer
# don't limit the number of artifacts that can be biased

View File

@@ -35,6 +35,3 @@
- type: SeedExtractor
- type: Machine
board: SeedExtractorMachineCircuitboard
- type: UpgradePowerDraw
powerDrawMultiplier: 0.75
scaling: Exponential

View File

@@ -163,9 +163,6 @@
materialWhiteList: [Plasma]
- type: PortableGenerator
startChance: 0.8
- type: UpgradePowerSupplier
powerSupplyMultiplier: 1.25
scaling: Exponential
- type: GeneratorExhaustGas
gasType: CarbonDioxide
# 2 moles of gas for every sheet of plasma.
@@ -223,9 +220,6 @@
storageLimit: 3000
materialWhiteList: [Uranium]
- type: PortableGenerator
- type: UpgradePowerSupplier
powerSupplyMultiplier: 1.25
scaling: Exponential
- type: PowerMonitoringDevice
group: Generator
loadNodes:

View File

@@ -29,15 +29,10 @@
state: "smes-op1"
shader: unshaded
- type: Smes
- type: UpgradeBattery
maxChargeMultiplier: 2
baseMaxCharge: 8000000
- type: UpgradePowerSupplyRamping
scaling: Linear
supplyRampingMultiplier: 1
- type: Appearance
- type: Battery
startingCharge: 0
maxCharge: 8000000
- type: ExaminableBattery
- type: NodeContainer
examinable: true

View File

@@ -17,13 +17,8 @@
shader: unshaded
- state: full
shader: unshaded
- type: UpgradeBattery
maxChargeMultiplier: 2
baseMaxCharge: 2500000
- type: UpgradePowerSupplyRamping
scaling: Linear
supplyRampingMultiplier: 1
- type: Battery
maxCharge: 2500000
startingCharge: 0
- type: ExaminableBattery
- type: PointLight

View File

@@ -143,7 +143,6 @@
- type: Thruster
thrusterType: Angular
requireSpace: false
baseThrust: 2000
thrust: 2000
machinePartThrust: Manipulator
- type: Sprite
@@ -193,9 +192,6 @@
collection: MetalBreak
- !type:ChangeConstructionNodeBehavior
node: machineFrame
- type: UpgradePowerDraw
powerDrawMultiplier: 0.75
scaling: Exponential
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Electronic
@@ -220,7 +216,6 @@
- type: Thruster
thrusterType: Angular
requireSpace: false
baseThrust: 100
thrust: 100
- type: ApcPowerReceiver
needsPower: false

View File

@@ -7,7 +7,6 @@
- AnomalousResearch
- Xenoarchaeology
- Robotics
- MachineUpgrading
- type: guideEntry
id: Technologies
@@ -58,11 +57,6 @@
name: guide-entry-traversal-distorter
text: "/ServerInfo/Guidebook/Science/TraversalDistorter.xml"
- type: guideEntry
id: MachineUpgrading
name: guide-entry-machine-upgrading
text: "/ServerInfo/Guidebook/Science/MachineUpgrading.xml"
- type: guideEntry
id: Cyborgs
name: guide-entry-cyborgs

View File

@@ -1,28 +0,0 @@
<Document>
# Machine Upgrading
Machines help the station run smoothly, and as a scientist, you can help them run even better!
## Parts
<Box>Stock Parts:</Box>
<Box>
<GuideEntityEmbed Entity="CapacitorStockPart"/>
<GuideEntityEmbed Entity="MatterBinStockPart"/>
<GuideEntityEmbed Entity="MicroManipulatorStockPart"/>
</Box>
Machine Parts can be used to create many machines.
## 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:
<Box Orientation="Vertical">
<GuideEntityEmbed Entity="ProtolatheMachineCircuitboard"/>
<GuideEntityEmbed Entity="CloningPodMachineCircuitboard"/>
<GuideEntityEmbed Entity="TraversalDistorterMachineCircuitboard"/>
<GuideEntityEmbed Entity="ThermomachineFreezerMachineCircuitBoard"/>
</Box>
You can also quickly build machines by using an RPED, loading it with machine parts, and then clicking on a machine.
<GuideEntityEmbed Entity="RPED"/>
</Document>