using Content.Server.Anomaly.Components;
-using Content.Server.Construction;
using Content.Server.Power.EntitySystems;
using Content.Shared.Anomaly;
using Content.Shared.Anomaly.Components;
{
SubscribeLocalEvent<AnomalyVesselComponent, ComponentShutdown>(OnVesselShutdown);
SubscribeLocalEvent<AnomalyVesselComponent, MapInitEvent>(OnVesselMapInit);
- SubscribeLocalEvent<AnomalyVesselComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing);
SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<AnomalyVesselComponent, ResearchServerGetPointsPerSecondEvent>(OnVesselGetPointsPerSecond);
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 ||
using Content.Shared.Atmos;
-using Content.Shared.Construction.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
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;
}
}
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;
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)
_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);
- }
}
}
using Content.Shared.Atmos;
-using Content.Shared.Construction.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
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;
}
}
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;
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)
}
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);
- }
}
}
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;
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;
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)
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);
- }
}
}
-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";
}
}
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;
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;
}
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;
base.Initialize();
SubscribeLocalEvent<SeedExtractorComponent, InteractUsingEvent>(OnInteractUsing);
- SubscribeLocalEvent<SeedExtractorComponent, RefreshPartsEvent>(OnRefreshParts);
- SubscribeLocalEvent<SeedExtractorComponent, UpgradeExamineEvent>(OnUpgradeExamine);
}
private void OnInteractUsing(EntityUid uid, SeedExtractorComponent seedExtractor, InteractUsingEvent args)
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)),
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)
_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);
- }
}
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;
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);
_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)
{
[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;
}
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;
base.Initialize();
SubscribeLocalEvent<SolutionHeaterComponent, PowerChangedEvent>(OnPowerChanged);
- SubscribeLocalEvent<SolutionHeaterComponent, RefreshPartsEvent>(OnRefreshParts);
- SubscribeLocalEvent<SolutionHeaterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<SolutionHeaterComponent, ItemPlacedEvent>(OnItemPlaced);
SubscribeLocalEvent<SolutionHeaterComponent, ItemRemovedEvent>(OnItemRemoved);
}
}
}
- 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);
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;
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;
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);
_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) ||
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);
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;
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}!");
}
}
{
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
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;
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>();
// 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>
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;
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);
}
}
}
- 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);
-using Content.Shared.Construction.Prototypes;
using Content.Shared.DeviceLinking;
using Content.Shared.Item;
using Robust.Shared.Audio;
{
[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)]
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
{
[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");
using Robust.Shared.Containers;
using Robust.Shared.Player;
using System.Linq;
-using Content.Shared.Access.Components;
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);
_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)
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;
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);
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);
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;
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)});
_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);
-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
{
/// <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?
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;
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;
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);
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))
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;
}
}
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;
SubscribeLocalEvent<MedicalScannerComponent, DragDropTargetEvent>(OnDragDropOn);
SubscribeLocalEvent<MedicalScannerComponent, PortDisconnectedEvent>(OnPortDisconnected);
SubscribeLocalEvent<MedicalScannerComponent, AnchorStateChangedEvent>(OnAnchorChanged);
- SubscribeLocalEvent<MedicalScannerComponent, RefreshPartsEvent>(OnRefreshParts);
- SubscribeLocalEvent<MedicalScannerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<MedicalScannerComponent, CanDropTargetEvent>(OnCanDragDropOn);
}
_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);
- }
}
}
using Content.Server.Nutrition.EntitySystems;
-using Content.Shared.Construction.Prototypes;
using Content.Shared.Nutrition.Components;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
[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.
/// 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.
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;
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;
/// <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);
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;
+++ /dev/null
-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;
- }
-}
+++ /dev/null
-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;
-}
-
-
+++ /dev/null
-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;
-}
+++ /dev/null
-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;
- }
-}
+++ /dev/null
-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);
- }
- }
- }
-}
+++ /dev/null
-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);
- }
-}
[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));
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;
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
{
[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;
/// </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
SubscribeLocalEvent<ThrusterComponent, ExaminedEvent>(OnThrusterExamine);
- SubscribeLocalEvent<ThrusterComponent, RefreshPartsEvent>(OnRefreshParts);
- SubscribeLocalEvent<ThrusterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
-
SubscribeLocalEvent<ShuttleComponent, TileChangedEvent>(OnShuttleTileChange);
}
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);
}
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);
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;
}
}
- 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)
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;
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);
}
}
}
- 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;
-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
[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;
-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;
SubscribeLocalEvent<TraversalDistorterComponent, ActivateInWorldEvent>(OnInteract);
SubscribeLocalEvent<TraversalDistorterComponent, ExaminedEvent>(OnExamine);
- SubscribeLocalEvent<TraversalDistorterComponent, RefreshPartsEvent>(OnRefreshParts);
- SubscribeLocalEvent<TraversalDistorterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<TraversalDistorterComponent, ItemPlacedEvent>(OnItemPlaced);
SubscribeLocalEvent<TraversalDistorterComponent, ItemRemovedEvent>(OnItemRemoved);
examine = Loc.GetString("traversal-distorter-desc-out");
break;
}
-
- 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);
+ args.PushMarkup(examine);
}
private void OnItemPlaced(EntityUid uid, TraversalDistorterComponent component, ref ItemPlacedEvent args)
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)
-using Content.Shared.Construction.Prototypes;
using Content.Shared.DeviceLinking;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
[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>
-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;
[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>
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;
{
base.Initialize();
SubscribeLocalEvent<MachineBoardComponent, ExaminedEvent>(OnMachineBoardExamined);
- SubscribeLocalEvent<MachinePartComponent, ExaminedEvent>(OnMachinePartExamined);
}
private void OnMachineBoardExamined(EntityUid uid, MachineBoardComponent component, ExaminedEvent args)
}
}
- 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;
-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;
[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.
[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"/>
using System.Threading;
-using Content.Shared.Construction.Prototypes;
using Content.Shared.DeviceLinking;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
[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>
[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>
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
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
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
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
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
+++ /dev/null
-solution-heater-upgrade-heat = Heat strength
+++ /dev/null
-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]
\ No newline at end of file
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!
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
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!
recycler-count-items = Recycled {$items} objects.
-machine-already-in-use = {CAPITALIZE(THE($machine))} is already in use.
\ No newline at end of file
+machine-already-in-use = {CAPITALIZE(THE($machine))} is already in use.
materials-raw-plasma = raw plasma
materials-raw-uranium = raw uranium
materials-raw-bananium = raw bananium
-
-# Material Reclaimer
-material-reclaimer-upgrade-process-rate = process rate
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
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.
medical-scanner-verb-enter = Enter
medical-scanner-verb-noun-occupant = occupant
-
-medical-scanner-upgrade-cloning = Cloning fail chance
+++ /dev/null
-stasis-bed-component-upgrade-stasis = stasis effect
-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.
fat-extractor-fact-4 = Not all fats are bad. A certain amount of fat is an essential part of a healthy balanced diet.
fat-extractor-fact-5 = Saturated fat should form no more than 11% of your daily calories.
-fat-extractor-fact-6 = Unsaturated fat, that is monounsaturated fats, polyunsaturated fats, and omega-3 fatty acids, is found in plants and fish.
\ No newline at end of file
+fat-extractor-fact-6 = Unsaturated fat, that is monounsaturated fats, polyunsaturated fats, and omega-3 fatty acids, is found in plants and fish.
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
# 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}
\ No newline at end of file
+emitter-component-type-set = Type set to: {$type}
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
- ShutdownSubscribers:
- 433
type: DeviceNetwork
- missingComponents:
- - UpgradeBattery
- proto: SpawnPointChiefEngineer
entities:
- uid: 145
sprite: Objects/Misc/stock_parts.rsi
- type: Item
size: Tiny
- - type: GuideHelp
- guides:
- - MachineUpgrading
- type: entity
id: CapacitorStockPart
- type: Item
sprite: Objects/Specific/Research/rped.rsi
size: Normal
- - type: GuideHelp
- guides:
- - MachineUpgrading
- type: PartExchanger
- type: Storage
grid:
- type: Wires
boardName: wires-board-name-chemdispenser
layoutId: ChemDispenser
- - type: UpgradePowerDraw
- powerDrawMultiplier: 0.75
- scaling: Exponential
- type: GuideHelp
guides:
- Chemicals
SetParticleEpsilon: AnomalousParticleEpsilon
SetParticleZeta: AnomalousParticleZeta
fireBurstSize: 1
- baseFireBurstDelayMin: 2
- baseFireBurstDelayMax: 6
+ fireBurstDelayMin: 2
+ fireBurstDelayMax: 6
- type: ApcPowerReceiver
powerLoad: 100
- type: GuideHelp
noRot: false
- type: ApcPowerReceiver
powerLoad: 15000
- needsPower: true
- - type: UpgradePowerDraw
- powerDrawMultiplier: 0.80
- scaling: Exponential
+ needsPower: true
- type: ItemPlacer
whitelist:
components:
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
- type: SeedExtractor
- type: Machine
board: SeedExtractorMachineCircuitboard
- - type: UpgradePowerDraw
- powerDrawMultiplier: 0.75
- scaling: Exponential
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.
storageLimit: 3000
materialWhiteList: [Uranium]
- type: PortableGenerator
- - type: UpgradePowerSupplier
- powerSupplyMultiplier: 1.25
- scaling: Exponential
- type: PowerMonitoringDevice
group: Generator
loadNodes:
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
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
- type: Thruster
thrusterType: Angular
requireSpace: false
- baseThrust: 2000
thrust: 2000
machinePartThrust: Manipulator
- type: Sprite
collection: MetalBreak
- !type:ChangeConstructionNodeBehavior
node: machineFrame
- - type: UpgradePowerDraw
- powerDrawMultiplier: 0.75
- scaling: Exponential
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Electronic
- type: Thruster
thrusterType: Angular
requireSpace: false
- baseThrust: 100
thrust: 100
- type: ApcPowerReceiver
needsPower: false
- AnomalousResearch
- Xenoarchaeology
- Robotics
- - MachineUpgrading
- type: guideEntry
id: Technologies
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
+++ /dev/null
-<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>