Rip out remaining machine upgrades (#24413)
* Rip out remaining machine upgrades * eek
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user