diff --git a/Content.Client/CloningConsole/UI/CloningConsoleBoundUserInterface.cs b/Content.Client/CloningConsole/UI/CloningConsoleBoundUserInterface.cs
index 8ab2c34627..51ee9d7b4e 100644
--- a/Content.Client/CloningConsole/UI/CloningConsoleBoundUserInterface.cs
+++ b/Content.Client/CloningConsole/UI/CloningConsoleBoundUserInterface.cs
@@ -22,7 +22,6 @@ namespace Content.Client.CloningConsole.UI
};
_window.OnClose += Close;
_window.CloneButton.OnPressed += _ => SendMessage(new UiButtonPressedMessage(UiButton.Clone));
- _window.EjectButton.OnPressed += _ => SendMessage(new UiButtonPressedMessage(UiButton.Eject));
_window.OpenCentered();
}
@@ -43,7 +42,6 @@ namespace Content.Client.CloningConsole.UI
{
_window.OnClose -= Close;
_window.CloneButton.OnPressed -= _ => SendMessage(new UiButtonPressedMessage(UiButton.Clone));
- _window.EjectButton.OnPressed -= _ => SendMessage(new UiButtonPressedMessage(UiButton.Eject));
}
_window?.Dispose();
}
diff --git a/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml b/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml
index 7a1886a5af..958bc83d11 100644
--- a/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml
+++ b/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml
@@ -46,11 +46,6 @@
-
diff --git a/Content.Server/Atmos/Miasma/MiasmaSystem.cs b/Content.Server/Atmos/Miasma/MiasmaSystem.cs
index df066048c0..3e5ba01e02 100644
--- a/Content.Server/Atmos/Miasma/MiasmaSystem.cs
+++ b/Content.Server/Atmos/Miasma/MiasmaSystem.cs
@@ -17,7 +17,6 @@ namespace Content.Server.Atmos.Miasma
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
-
[Dependency] private readonly IRobustRandom _random = default!;
/// System Variables
diff --git a/Content.Server/Climbing/ClimbSystem.cs b/Content.Server/Climbing/ClimbSystem.cs
index c43e26b4a9..d9f8e87cb0 100644
--- a/Content.Server/Climbing/ClimbSystem.cs
+++ b/Content.Server/Climbing/ClimbSystem.cs
@@ -116,13 +116,13 @@ public sealed class ClimbSystem : SharedClimbSystem
if (TryBonk(component, user))
return;
- _doAfterSystem.DoAfter(new DoAfterEventArgs(entityToMove, component.ClimbDelay, default, climbable)
+ _doAfterSystem.DoAfter(new DoAfterEventArgs(entityToMove, component.ClimbDelay, default, climbable, user)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnDamage = true,
BreakOnStun = true,
- UserFinishedEvent = new ClimbFinishedEvent(user, climbable)
+ UserFinishedEvent = new ClimbFinishedEvent(user, climbable, entityToMove)
});
}
@@ -155,10 +155,10 @@ public sealed class ClimbSystem : SharedClimbSystem
private void OnClimbFinished(EntityUid uid, ClimbingComponent climbing, ClimbFinishedEvent args)
{
- Climb(uid, args.User, args.Climbable, climbing: climbing);
+ Climb(uid, args.User, args.Instigator, args.Climbable, climbing: climbing);
}
- private void Climb(EntityUid uid, EntityUid user, EntityUid climbable, bool silent = false, ClimbingComponent? climbing = null,
+ private void Climb(EntityUid uid, EntityUid user, EntityUid instigator, EntityUid climbable, bool silent = false, ClimbingComponent? climbing = null,
PhysicsComponent? physics = null, FixturesComponent? fixtures = null)
{
if (!Resolve(uid, ref climbing, ref physics, ref fixtures, false))
@@ -174,7 +174,7 @@ public sealed class ClimbSystem : SharedClimbSystem
// there's also the cases where the user might collide with the person they are forcing onto the climbable that i haven't accounted for
RaiseLocalEvent(uid, new StartClimbEvent(climbable), false);
- RaiseLocalEvent(climbable, new ClimbedOnEvent(uid), false);
+ RaiseLocalEvent(climbable, new ClimbedOnEvent(uid, user), false);
if (silent)
return;
@@ -343,7 +343,7 @@ public sealed class ClimbSystem : SharedClimbSystem
public void ForciblySetClimbing(EntityUid uid, EntityUid climbable, ClimbingComponent? component = null)
{
- Climb(uid, uid, climbable, true, component);
+ Climb(uid, uid, uid, climbable, true, component);
}
private void OnBuckleChange(EntityUid uid, ClimbingComponent component, BuckleChangeEvent args)
@@ -436,14 +436,16 @@ public sealed class ClimbSystem : SharedClimbSystem
internal sealed class ClimbFinishedEvent : EntityEventArgs
{
- public ClimbFinishedEvent(EntityUid user, EntityUid climbable)
+ public ClimbFinishedEvent(EntityUid user, EntityUid climbable, EntityUid instigator)
{
User = user;
Climbable = climbable;
+ Instigator = instigator;
}
public EntityUid User { get; }
public EntityUid Climbable { get; }
+ public EntityUid Instigator { get; }
}
///
@@ -452,10 +454,12 @@ internal sealed class ClimbFinishedEvent : EntityEventArgs
public sealed class ClimbedOnEvent : EntityEventArgs
{
public EntityUid Climber;
+ public EntityUid Instigator;
- public ClimbedOnEvent(EntityUid climber)
+ public ClimbedOnEvent(EntityUid climber, EntityUid instigator)
{
Climber = climber;
+ Instigator = instigator;
}
}
diff --git a/Content.Server/Cloning/CloningConsoleSystem.cs b/Content.Server/Cloning/CloningConsoleSystem.cs
index 8026c5ea46..b57b4db96c 100644
--- a/Content.Server/Cloning/CloningConsoleSystem.cs
+++ b/Content.Server/Cloning/CloningConsoleSystem.cs
@@ -7,8 +7,8 @@ using Content.Server.Mind.Components;
using Content.Server.MachineLinking.System;
using Content.Server.MachineLinking.Events;
using Content.Server.UserInterface;
-using Content.Shared.MobState.Components;
using Content.Server.MobState;
+using Content.Shared.MobState.Components;
using Content.Server.Power.EntitySystems;
using Robust.Server.GameObjects;
using Robust.Server.Player;
@@ -55,10 +55,6 @@ namespace Content.Server.Cloning.Systems
if (consoleComponent.GeneticScanner != null && consoleComponent.CloningPod != null)
TryClone(uid, consoleComponent.CloningPod.Value, consoleComponent.GeneticScanner.Value, consoleComponent: consoleComponent);
break;
- case UiButton.Eject:
- if (consoleComponent.CloningPod != null)
- TryEject(uid, consoleComponent.CloningPod.Value, consoleComponent: consoleComponent);
- break;
}
UpdateUserInterface(consoleComponent);
}
@@ -123,14 +119,6 @@ namespace Content.Server.Cloning.Systems
_uiSystem.GetUiOrNull(consoleComponent.Owner, CloningConsoleUiKey.Key)?.SetState(newState);
}
- public void TryEject(EntityUid uid, EntityUid clonePodUid, CloningPodComponent? cloningPod = null, CloningConsoleComponent? consoleComponent = null)
- {
- if (!Resolve(uid, ref consoleComponent) || !Resolve(clonePodUid, ref cloningPod))
- return;
-
- _cloningSystem.Eject(clonePodUid, cloningPod);
- }
-
public void TryClone(EntityUid uid, EntityUid cloningPodUid, EntityUid scannerUid, CloningPodComponent? cloningPod = null, MedicalScannerComponent? scannerComp = null, CloningConsoleComponent? consoleComponent = null)
{
if (!Resolve(uid, ref consoleComponent) || !Resolve(cloningPodUid, ref cloningPod) || !Resolve(scannerUid, ref scannerComp))
@@ -222,9 +210,10 @@ namespace Content.Server.Cloning.Systems
EntityUid? cloneBody = clonePod.BodyContainer.ContainedEntity;
clonerMindPresent = clonePod.Status == CloningPodStatus.Cloning;
- if (cloneBody != null)
+ if (HasComp(consoleComponent.CloningPod))
{
- cloneBodyInfo = Identity.Name(cloneBody.Value, EntityManager);
+ if (cloneBody != null)
+ cloneBodyInfo = Identity.Name(cloneBody.Value, EntityManager);
clonerStatus = ClonerStatus.ClonerOccupied;
}
}
@@ -244,5 +233,6 @@ namespace Content.Server.Cloning.Systems
clonerInRange
);
}
+
}
}
diff --git a/Content.Server/Cloning/CloningSystem.cs b/Content.Server/Cloning/CloningSystem.cs
index be67623a00..689f504b29 100644
--- a/Content.Server/Cloning/CloningSystem.cs
+++ b/Content.Server/Cloning/CloningSystem.cs
@@ -1,19 +1,35 @@
-using Content.Server.Cloning.Components;
-using Content.Server.Mind.Components;
-using Content.Server.Power.EntitySystems;
using Content.Shared.GameTicking;
using Content.Shared.CharacterAppearance.Systems;
using Content.Shared.CharacterAppearance.Components;
using Content.Shared.Species;
-using Robust.Server.Player;
-using Robust.Shared.Prototypes;
-using Content.Server.EUI;
-using Robust.Shared.Containers;
-using Robust.Server.Containers;
+using Content.Shared.Damage;
+using Content.Shared.Stacks;
+using Content.Shared.Examine;
using Content.Shared.Cloning;
+using Content.Shared.Atmos;
+using Content.Shared.CCVar;
+using Content.Server.Cloning.Components;
+using Content.Server.Mind.Components;
+using Content.Server.Power.EntitySystems;
+using Content.Server.Atmos.EntitySystems;
+using Content.Server.EUI;
using Content.Server.MachineLinking.System;
using Content.Server.MachineLinking.Events;
using Content.Server.MobState;
+using Content.Server.Lathe.Components;
+using Content.Shared.Chemistry.Components;
+using Content.Server.Fluids.EntitySystems;
+using Content.Server.Chat.Systems;
+using Content.Server.Construction.Components;
+using Content.Server.Stack;
+using Robust.Server.GameObjects;
+using Robust.Server.Containers;
+using Robust.Server.Player;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Random;
+using Robust.Shared.Configuration;
+using Robust.Shared.Containers;
+
namespace Content.Server.Cloning.Systems
{
@@ -28,17 +44,29 @@ namespace Content.Server.Cloning.Systems
[Dependency] private readonly ContainerSystem _containerSystem = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly PowerReceiverSystem _powerReceiverSystem = default!;
+ [Dependency] private readonly IRobustRandom _robustRandom = default!;
+ [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
+ [Dependency] private readonly TransformSystem _transformSystem = default!;
+ [Dependency] private readonly SharedStackSystem _stackSystem = default!;
+ [Dependency] private readonly StackSystem _serverStackSystem = default!;
+ [Dependency] private readonly SpillableSystem _spillableSystem = default!;
+ [Dependency] private readonly ChatSystem _chatSystem = default!;
+ [Dependency] private readonly IConfigurationManager _configManager = default!;
+
public readonly Dictionary ClonesWaitingForMind = new();
+ public const float EasyModeCloningCost = 0.7f;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent(OnComponentInit);
+ SubscribeLocalEvent(OnDeconstruct);
SubscribeLocalEvent(Reset);
SubscribeLocalEvent(HandleMindAdded);
SubscribeLocalEvent(OnPortDisconnected);
SubscribeLocalEvent(OnAnchor);
+ SubscribeLocalEvent(OnExamined);
}
private void OnComponentInit(EntityUid uid, CloningPodComponent clonePod, ComponentInit args)
@@ -47,6 +75,14 @@ namespace Content.Server.Cloning.Systems
_signalSystem.EnsureReceiverPorts(uid, CloningPodComponent.PodPort);
}
+ private void OnDeconstruct(EntityUid uid, CloningPodComponent component, MachineDeconstructedEvent args)
+ {
+ if (!TryComp(uid, out var storage))
+ return;
+
+ _serverStackSystem.SpawnMultiple(storage.GetMaterialAmount("Biomass"), 100, "Biomass", Transform(uid).Coordinates);
+ }
+
private void UpdateAppearance(CloningPodComponent clonePod)
{
if (TryComp(clonePod.Owner, out var appearance))
@@ -97,11 +133,23 @@ namespace Content.Server.Cloning.Systems
_cloningConsoleSystem.UpdateUserInterface(console);
}
+ private void OnExamined(EntityUid uid, CloningPodComponent component, ExaminedEvent args)
+ {
+ if (!args.IsInDetailsRange || !_powerReceiverSystem.IsPowered(uid))
+ return;
+
+ if (TryComp(uid, out var storage))
+ args.PushMarkup(Loc.GetString("cloning-pod-biomass", ("number", storage.GetMaterialAmount("Biomass"))));
+ }
+
public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Mind.Mind mind, CloningPodComponent? clonePod)
{
if (!Resolve(uid, ref clonePod) || bodyToClone == null)
return false;
+ if (HasComp(uid))
+ return false;
+
if (ClonesWaitingForMind.TryGetValue(mind, out var clone))
{
if (EntityManager.EntityExists(clone) &&
@@ -120,11 +168,56 @@ namespace Content.Server.Cloning.Systems
if (mind.UserId == null || !_playerManager.TryGetSessionById(mind.UserId.Value, out var client))
return false; // If we can't track down the client, we can't offer transfer. That'd be quite bad.
+ if (!TryComp(clonePod.Owner, out var podStorage))
+ return false;
+
if (!TryComp(bodyToClone, out var humanoid))
return false; // whatever body was to be cloned, was not a humanoid
- var speciesProto = _prototype.Index(humanoid.Species).Prototype;
- var mob = Spawn(speciesProto, Transform(clonePod.Owner).MapPosition);
+ if (!_prototype.TryIndex(humanoid.Species, out var speciesPrototype))
+ return false;
+
+ if (!TryComp(bodyToClone, out var physics))
+ return false;
+
+ int cloningCost = (int) physics.FixturesMass;
+
+ if (_configManager.GetCVar(CCVars.BiomassEasyMode))
+ cloningCost = (int) Math.Round(cloningCost * EasyModeCloningCost);
+
+ // biomass checks
+ var biomassAmount = podStorage.GetMaterialAmount("Biomass");
+
+ if (biomassAmount < cloningCost)
+ {
+ if (clonePod.ConnectedConsole != null)
+ _chatSystem.TrySendInGameICMessage(clonePod.ConnectedConsole.Value, Loc.GetString("cloning-console-chat-error", ("units", cloningCost)), InGameICChatType.Speak, false);
+ return false;
+ }
+
+ podStorage.RemoveMaterial("Biomass", cloningCost);
+ clonePod.UsedBiomass = cloningCost;
+ // end of biomass checks
+
+ // genetic damage checks
+ if (TryComp(bodyToClone, out var damageable) &&
+ damageable.Damage.DamageDict.TryGetValue("Cellular", out var cellularDmg))
+ {
+ var chance = Math.Clamp((float) (cellularDmg / 100), 0, 1);
+ if (cellularDmg > 0 && clonePod.ConnectedConsole != null)
+ _chatSystem.TrySendInGameICMessage(clonePod.ConnectedConsole.Value, Loc.GetString("cloning-console-cellular-warning", ("percent", Math.Round(100 - (chance * 100)))), InGameICChatType.Speak, false);
+
+ if (_robustRandom.Prob(chance))
+ {
+ UpdateStatus(CloningPodStatus.Gore, clonePod);
+ clonePod.FailedClone = true;
+ AddComp(uid);
+ return true;
+ }
+ }
+ // end of genetic damage checks
+
+ var mob = Spawn(speciesPrototype.Prototype, Transform(clonePod.Owner).MapPosition);
_appearanceSystem.UpdateAppearance(mob, humanoid.Appearance);
_appearanceSystem.UpdateSexGender(mob, humanoid.Sex, humanoid.Gender);
@@ -156,16 +249,17 @@ namespace Content.Server.Cloning.Systems
if (!_powerReceiverSystem.IsPowered(cloning.Owner))
continue;
- if (cloning.BodyContainer.ContainedEntity != null)
- {
- cloning.CloningProgress += frameTime;
- cloning.CloningProgress = MathHelper.Clamp(cloning.CloningProgress, 0f, cloning.CloningTime);
- }
+ if (cloning.BodyContainer.ContainedEntity == null && !cloning.FailedClone)
+ continue;
- if (cloning.CapturedMind?.Session?.AttachedEntity == cloning.BodyContainer.ContainedEntity)
- {
+ cloning.CloningProgress += frameTime;
+ if (cloning.CloningProgress < cloning.CloningTime)
+ continue;
+
+ if (cloning.FailedClone)
+ EndFailedCloning(cloning.Owner, cloning);
+ else
Eject(cloning.Owner, cloning);
- }
}
}
@@ -181,10 +275,40 @@ namespace Content.Server.Cloning.Systems
clonePod.BodyContainer.Remove(entity);
clonePod.CapturedMind = null;
clonePod.CloningProgress = 0f;
+ clonePod.UsedBiomass = 0;
UpdateStatus(CloningPodStatus.Idle, clonePod);
RemCompDeferred(uid);
}
+ private void EndFailedCloning(EntityUid uid, CloningPodComponent clonePod)
+ {
+ clonePod.FailedClone = false;
+ clonePod.CloningProgress = 0f;
+ UpdateStatus(CloningPodStatus.Idle, clonePod);
+ var transform = Transform(uid);
+ var indices = _transformSystem.GetGridOrMapTilePosition(uid);
+
+ var tileMix = _atmosphereSystem.GetTileMixture(transform.GridUid, null, indices, true);
+
+ Solution bloodSolution = new();
+
+ int i = 0;
+ while (i < 1)
+ {
+ tileMix?.AdjustMoles(Gas.Miasma, 6f);
+ bloodSolution.AddReagent("Blood", 50);
+ if (_robustRandom.Prob(0.2f))
+ i++;
+ }
+ _spillableSystem.SpillAt(uid, bloodSolution, "PuddleBlood");
+
+ var biomassStack = Spawn("MaterialBiomass", transform.Coordinates);
+ _stackSystem.SetCount(biomassStack, _robustRandom.Next(1, (int) (clonePod.UsedBiomass / 2.5)));
+
+ clonePod.UsedBiomass = 0;
+ RemCompDeferred(uid);
+ }
+
public void Reset(RoundRestartCleanupEvent ev)
{
ClonesWaitingForMind.Clear();
diff --git a/Content.Server/Cloning/Components/CloningPodComponent.cs b/Content.Server/Cloning/Components/CloningPodComponent.cs
index b76f31f3ed..8c8fe37ef2 100644
--- a/Content.Server/Cloning/Components/CloningPodComponent.cs
+++ b/Content.Server/Cloning/Components/CloningPodComponent.cs
@@ -10,6 +10,8 @@ namespace Content.Server.Cloning.Components
[ViewVariables] public ContainerSlot BodyContainer = default!;
[ViewVariables] public Mind.Mind? CapturedMind;
[ViewVariables] public float CloningProgress = 0;
+ [ViewVariables] public int UsedBiomass = 70;
+ [ViewVariables] public bool FailedClone = false;
[DataField("cloningTime")]
[ViewVariables] public float CloningTime = 30f;
[ViewVariables] public CloningPodStatus Status;
diff --git a/Content.Server/Lathe/Components/LatheComponent.cs b/Content.Server/Lathe/Components/LatheComponent.cs
index b3ac8d1f21..8048e753ba 100644
--- a/Content.Server/Lathe/Components/LatheComponent.cs
+++ b/Content.Server/Lathe/Components/LatheComponent.cs
@@ -1,10 +1,7 @@
using Content.Shared.Lathe;
using Content.Shared.Research.Prototypes;
using Robust.Server.GameObjects;
-using Content.Shared.Whitelist;
-using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
-using Content.Shared.Materials;
using Robust.Shared.Audio;
namespace Content.Server.Lathe.Components
@@ -12,20 +9,6 @@ namespace Content.Server.Lathe.Components
[RegisterComponent]
public sealed class LatheComponent : SharedLatheComponent
{
- ///
- /// Whitelist for specifying the kind of materials that can be insert into the lathe
- ///
- [ViewVariables]
- [DataField("whitelist")]
- public EntityWhitelist? LatheWhitelist;
-
- ///
- /// Whitelist generated on runtime for what items are specifically used for the lathe's recipes.
- ///
- [ViewVariables]
- [DataField("materialWhiteList", customTypeSerializer: typeof(PrototypeIdListSerializer))]
- public List MaterialWhiteList = new();
-
///
/// The lathe's construction queue
///
@@ -49,12 +32,6 @@ namespace Content.Server.Lathe.Components
///
[DataField("producingSound")]
public SoundSpecifier? ProducingSound;
-
- ///
- /// The sound that plays when inserting an item into the lathe, if any
- ///
- [DataField("insertingSound")]
- public SoundSpecifier? InsertingSound;
///
/// The lathe's UI.
diff --git a/Content.Server/Lathe/Components/MaterialStorageComponent.cs b/Content.Server/Lathe/Components/MaterialStorageComponent.cs
index 4f3bd9d728..af6162c39c 100644
--- a/Content.Server/Lathe/Components/MaterialStorageComponent.cs
+++ b/Content.Server/Lathe/Components/MaterialStorageComponent.cs
@@ -1,4 +1,8 @@
using Content.Shared.Lathe;
+using Content.Shared.Whitelist;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
+using Content.Shared.Materials;
+using Robust.Shared.Audio;
namespace Content.Server.Lathe.Components
{
@@ -17,6 +21,26 @@ namespace Content.Server.Lathe.Components
[DataField("StorageLimit")]
private int _storageLimit = -1;
+ ///
+ /// Whitelist for specifying the kind of items that can be insert into this entity.
+ ///
+ [ViewVariables]
+ [DataField("whitelist")]
+ public EntityWhitelist? EntityWhitelist;
+
+ ///
+ /// Whitelist generated on runtime for what specific materials can be inserted into this entity.
+ ///
+ [ViewVariables]
+ [DataField("materialWhiteList", customTypeSerializer: typeof(PrototypeIdListSerializer))]
+ public List MaterialWhiteList = new();
+
+ ///
+ /// The sound that plays when inserting an item into the storage
+ ///
+ [DataField("insertingSound")]
+ public SoundSpecifier? InsertingSound;
+
public override ComponentState GetComponentState()
{
return new MaterialStorageState(Storage);
@@ -73,5 +97,14 @@ namespace Content.Server.Lathe.Components
{
return InsertMaterial(id, -amount);
}
+
+ // forgive me I needed to write a crumb of e/c code to not go fucking insane i swear i will ecs this entire shitty fucking system one day
+ public int GetMaterialAmount(string id)
+ {
+ if (!Storage.TryGetValue(id, out var amount))
+ return 0;
+
+ return amount;
+ }
}
}
diff --git a/Content.Server/Lathe/LatheSystem.cs b/Content.Server/Lathe/LatheSystem.cs
index 57229fa447..1641060cad 100644
--- a/Content.Server/Lathe/LatheSystem.cs
+++ b/Content.Server/Lathe/LatheSystem.cs
@@ -32,7 +32,7 @@ namespace Content.Server.Lathe
public override void Initialize()
{
base.Initialize();
- SubscribeLocalEvent(OnInteractUsing);
+ SubscribeLocalEvent(OnInteractUsing);
SubscribeLocalEvent(OnComponentInit);
SubscribeLocalEvent(OnLatheQueueRecipeMessage);
SubscribeLocalEvent(OnLatheSyncRequestMessage);
@@ -85,35 +85,34 @@ namespace Content.Server.Lathe
if (recipes == null)
return;
+ if (!TryComp(uid, out var storage))
+ return;
+
foreach (var recipe in recipes)
{
foreach (var mat in recipe.RequiredMaterials)
{
- if (!component.MaterialWhiteList.Contains(mat.Key))
- component.MaterialWhiteList.Add(mat.Key);
+ if (!storage.MaterialWhiteList.Contains(mat.Key))
+ storage.MaterialWhiteList.Add(mat.Key);
}
}
}
- ///
- /// When someone tries to use an item on the lathe,
- /// insert it if it's a stack and fits inside
- ///
- private void OnInteractUsing(EntityUid uid, LatheComponent component, InteractUsingEvent args)
+ private void OnInteractUsing(EntityUid uid, MaterialStorageComponent component, InteractUsingEvent args)
{
if (args.Handled)
return;
if (!TryComp(uid, out var storage)
|| !TryComp(args.Used, out var material)
- || component.LatheWhitelist?.IsValid(args.Used) == false)
+ || storage.EntityWhitelist?.IsValid(args.Used) == false)
return;
args.Handled = true;
var matUsed = false;
foreach (var mat in material.Materials)
- if (component.MaterialWhiteList.Contains(mat.ID))
+ if (storage.MaterialWhiteList.Contains(mat.ID))
matUsed = true;
if (!matUsed)
@@ -148,16 +147,25 @@ namespace Content.Server.Lathe
lastMat = mat;
}
+ EntityManager.QueueDeleteEntity(args.Used);
+
// Play a sound when inserting, if any
if (component.InsertingSound != null)
_audioSys.PlayPvs(component.InsertingSound, uid);
+ _popupSystem.PopupEntity(Loc.GetString("machine-insert-item", ("machine", uid),
+ ("item", args.Used)), uid, Filter.Entities(args.User));
+
+ // TODO: You can probably split this part off of lathe component too
+ if (!TryComp(uid, out var lathe))
+ return;
+
// We need the prototype to get the color
_prototypeManager.TryIndex(lastMat, out MaterialPrototype? matProto);
EntityManager.QueueDeleteEntity(args.Used);
- EnsureComp(uid).TimeRemaining = component.InsertionTime;
+ EnsureComp(uid).TimeRemaining = lathe.InsertionTime;
_popupSystem.PopupEntity(Loc.GetString("machine-insert-item", ("machine", uid),
("item", args.Used)), uid, Filter.Entities(args.User));
diff --git a/Content.Server/Medical/BiomassReclaimer/ActiveBiomassReclaimerComponent.cs b/Content.Server/Medical/BiomassReclaimer/ActiveBiomassReclaimerComponent.cs
new file mode 100644
index 0000000000..9e57f38d94
--- /dev/null
+++ b/Content.Server/Medical/BiomassReclaimer/ActiveBiomassReclaimerComponent.cs
@@ -0,0 +1,6 @@
+namespace Content.Server.Medical.BiomassReclaimer
+{
+ [RegisterComponent]
+ public sealed class ActiveBiomassReclaimerComponent : Component
+ {}
+}
diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs
new file mode 100644
index 0000000000..740ac4cb92
--- /dev/null
+++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs
@@ -0,0 +1,53 @@
+using Content.Shared.Storage;
+using System.Threading;
+
+namespace Content.Server.Medical.BiomassReclaimer
+{
+ [RegisterComponent]
+ public sealed class BiomassReclaimerComponent : Component
+ {
+ public CancellationTokenSource? CancelToken;
+
+ [DataField("accumulator")]
+ public float Accumulator = 0f;
+
+ [DataField("randomMessAccumulator")]
+ public float RandomMessAccumulator = 0f;
+ public TimeSpan RandomMessInterval = TimeSpan.FromSeconds(5);
+
+ ///
+ /// This gets set for each mob it processes.
+ /// When accumulator hits this, spit out biomass.
+ ///
+ public float CurrentProcessingTime = 70f;
+
+ ///
+ /// This is calculated from the YieldPerUnitMass
+ /// and adjusted for genetic damage too.
+ ///
+ public float CurrentExpectedYield = 28f;
+
+ public string BloodReagent = "Blood";
+
+ public List SpawnedEntities = new();
+
+ ///
+ /// How many units of biomass it produces for each unit of mass.
+ ///
+ [DataField("yieldPerUnitMass")]
+ public float YieldPerUnitMass = 0.4f;
+
+ ///
+ /// Lower number = faster processing.
+ /// Good for machine upgrading I guess.
+ ///
+ public float ProcessingSpeedMultiplier = 0.5f;
+
+
+ ///
+ /// Will this refuse to gib a living mob?
+ ///
+ [DataField("safetyEnabled")]
+ public bool SafetyEnabled = true;
+ }
+}
diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs
new file mode 100644
index 0000000000..c0c0e93a20
--- /dev/null
+++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs
@@ -0,0 +1,245 @@
+using System.Threading;
+using Content.Shared.MobState.Components;
+using Content.Shared.Interaction;
+using Content.Shared.Audio;
+using Content.Shared.Jittering;
+using Content.Shared.Chemistry.Components;
+using Content.Shared.Throwing;
+using Content.Shared.Construction.Components;
+using Content.Shared.Nutrition.Components;
+using Content.Shared.Administration.Logs;
+using Content.Shared.CCVar;
+using Content.Shared.Database;
+using Content.Shared.CharacterAppearance.Components;
+using Content.Server.MobState;
+using Content.Server.Power.Components;
+using Content.Server.Fluids.EntitySystems;
+using Content.Server.Body.Components;
+using Content.Server.Climbing;
+using Content.Server.DoAfter;
+using Content.Server.Mind.Components;
+using Content.Server.Stack;
+using Robust.Shared.Player;
+using Robust.Shared.Random;
+using Robust.Shared.Configuration;
+using Robust.Server.Player;
+
+namespace Content.Server.Medical.BiomassReclaimer
+{
+ public sealed class BiomassReclaimerSystem : EntitySystem
+ {
+ [Dependency] private readonly IConfigurationManager _configManager = default!;
+ [Dependency] private readonly StackSystem _stackSystem = default!;
+ [Dependency] private readonly MobStateSystem _mobState = default!;
+ [Dependency] private readonly SharedJitteringSystem _jitteringSystem = default!;
+ [Dependency] private readonly SharedAudioSystem _sharedAudioSystem = default!;
+ [Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
+ [Dependency] private readonly SpillableSystem _spillableSystem = default!;
+ [Dependency] private readonly ThrowingSystem _throwing = default!;
+ [Dependency] private readonly IRobustRandom _robustRandom = default!;
+ [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
+ [Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
+ [Dependency] private readonly IPlayerManager _playerManager = default!;
+
+ public override void Update(float frameTime)
+ {
+ base.Update(frameTime);
+
+ foreach (var (_, reclaimer) in EntityQuery())
+ {
+ reclaimer.Accumulator += frameTime;
+ reclaimer.RandomMessAccumulator += frameTime;
+
+ if (reclaimer.RandomMessAccumulator >= reclaimer.RandomMessInterval.TotalSeconds)
+ {
+ if (_robustRandom.Prob(0.3f))
+ {
+ if (_robustRandom.Prob(0.7f))
+ {
+ Solution blood = new();
+ blood.AddReagent(reclaimer.BloodReagent, 50);
+ _spillableSystem.SpillAt(reclaimer.Owner, blood, "PuddleBlood");
+ }
+ if (_robustRandom.Prob(0.1f) && reclaimer.SpawnedEntities.Count > 0)
+ {
+ var thrown = Spawn(_robustRandom.Pick(reclaimer.SpawnedEntities).PrototypeId, Transform(reclaimer.Owner).Coordinates);
+ Vector2 direction = (_robustRandom.Next(-30, 30), _robustRandom.Next(-30, 30));
+ _throwing.TryThrow(thrown, direction, _robustRandom.Next(1, 10));
+ }
+ }
+ reclaimer.RandomMessAccumulator -= (float) reclaimer.RandomMessInterval.TotalSeconds;
+ }
+
+ if (reclaimer.Accumulator < reclaimer.CurrentProcessingTime)
+ {
+ continue;
+ }
+ reclaimer.Accumulator = 0;
+
+ _stackSystem.SpawnMultiple((int) reclaimer.CurrentExpectedYield, 100, "Biomass", Transform(reclaimer.Owner).Coordinates);
+
+ reclaimer.SpawnedEntities.Clear();
+ RemCompDeferred(reclaimer.Owner);
+ }
+ }
+ public override void Initialize()
+ {
+ base.Initialize();
+ SubscribeLocalEvent(OnInit);
+ SubscribeLocalEvent(OnShutdown);
+ SubscribeLocalEvent(OnUnanchorAttempt);
+ SubscribeLocalEvent(OnAfterInteractUsing);
+ SubscribeLocalEvent(OnClimbedOn);
+ SubscribeLocalEvent(OnReclaimSuccessful);
+ SubscribeLocalEvent(OnReclaimCancelled);
+ }
+
+ private void OnInit(EntityUid uid, ActiveBiomassReclaimerComponent component, ComponentInit args)
+ {
+ _jitteringSystem.AddJitter(uid, -10, 100);
+ _sharedAudioSystem.Play("/Audio/Machines/reclaimer_startup.ogg", Filter.Pvs(uid), uid);
+ _ambientSoundSystem.SetAmbience(uid, true);
+ }
+
+ private void OnShutdown(EntityUid uid, ActiveBiomassReclaimerComponent component, ComponentShutdown args)
+ {
+ RemComp(uid);
+ _ambientSoundSystem.SetAmbience(uid, false);
+ }
+
+ private void OnUnanchorAttempt(EntityUid uid, ActiveBiomassReclaimerComponent component, UnanchorAttemptEvent args)
+ {
+ args.Cancel();
+ }
+ private void OnAfterInteractUsing(EntityUid uid, BiomassReclaimerComponent component, AfterInteractUsingEvent args)
+ {
+ if (!args.CanReach)
+ return;
+
+ if (component.CancelToken != null || args.Target == null)
+ return;
+
+ if (HasComp(args.Used) && CanGib(uid, args.Used, component))
+ {
+ component.CancelToken = new CancellationTokenSource();
+ _doAfterSystem.DoAfter(new DoAfterEventArgs(args.User, 7f, component.CancelToken.Token, target: args.Target)
+ {
+ BroadcastFinishedEvent = new ReclaimSuccessfulEvent(args.User, args.Used, uid),
+ BroadcastCancelledEvent = new ReclaimCancelledEvent(uid),
+ BreakOnTargetMove = true,
+ BreakOnUserMove = true,
+ BreakOnStun = true,
+ NeedHand = true
+ });
+ }
+ }
+
+ private void OnClimbedOn(EntityUid uid, BiomassReclaimerComponent component, ClimbedOnEvent args)
+ {
+ if (!CanGib(uid, args.Climber, component))
+ {
+ Vector2 direction = (_robustRandom.Next(-2, 2), _robustRandom.Next(-2, 2));
+ _throwing.TryThrow(args.Climber, direction, 0.5f);
+ return;
+ }
+ _adminLogger.Add(LogType.Action, LogImpact.Extreme, $"{ToPrettyString(args.Instigator):player} used a biomass reclaimer to gib {ToPrettyString(args.Climber):target} in {ToPrettyString(uid):reclaimer}");
+
+ StartProcessing(args.Climber, component);
+ }
+
+ private void OnReclaimSuccessful(ReclaimSuccessfulEvent args)
+ {
+ if (!TryComp(args.Reclaimer, out var reclaimer))
+ return;
+
+ _adminLogger.Add(LogType.Action, LogImpact.Extreme, $"{ToPrettyString(args.User):player} used a biomass reclaimer to gib {ToPrettyString(args.Target):target} in {ToPrettyString(args.Reclaimer):reclaimer}");
+ reclaimer.CancelToken = null;
+ StartProcessing(args.Target, reclaimer);
+ }
+
+ private void OnReclaimCancelled(ReclaimCancelledEvent args)
+ {
+ if (!TryComp(args.Reclaimer, out var reclaimer))
+ return;
+ reclaimer.CancelToken = null;
+ }
+ private void StartProcessing(EntityUid toProcess, BiomassReclaimerComponent component)
+ {
+ AddComp(component.Owner);
+
+ if (TryComp(toProcess, out var stream))
+ {
+ component.BloodReagent = stream.BloodReagent;
+ }
+ if (TryComp(toProcess, out var butcherableComponent))
+ {
+ component.SpawnedEntities = butcherableComponent.SpawnedEntities;
+ }
+
+ component.CurrentExpectedYield = CalculateYield(toProcess, component);
+ component.CurrentProcessingTime = component.CurrentExpectedYield / component.YieldPerUnitMass * component.ProcessingSpeedMultiplier;
+ EntityManager.QueueDeleteEntity(toProcess);
+ }
+ private float CalculateYield(EntityUid uid, BiomassReclaimerComponent component)
+ {
+ if (!TryComp(uid, out var physics))
+ {
+ Logger.Error("Somehow tried to extract biomass from " + uid + ", which has no physics component.");
+ return 0f;
+ }
+
+ return (physics.FixturesMass * component.YieldPerUnitMass);
+ }
+
+ private bool CanGib(EntityUid uid, EntityUid dragged, BiomassReclaimerComponent component)
+ {
+ if (HasComp(uid))
+ return false;
+
+ if (!HasComp(dragged))
+ return false;
+
+ if (!Transform(uid).Anchored)
+ return false;
+
+ if (TryComp(uid, out var power) && !power.Powered)
+ return false;
+
+ if (component.SafetyEnabled && !_mobState.IsDead(dragged))
+ return false;
+
+ // Reject souled bodies in easy mode.
+ if (_configManager.GetCVar(CCVars.BiomassEasyMode) && HasComp(dragged) &&
+ TryComp(dragged, out var mindComp))
+ {
+ if (mindComp.Mind?.UserId != null && _playerManager.TryGetSessionById(mindComp.Mind.UserId.Value, out var client))
+ return false;
+ }
+
+ return true;
+ }
+
+ private sealed class ReclaimCancelledEvent : EntityEventArgs
+ {
+ public EntityUid Reclaimer;
+
+ public ReclaimCancelledEvent(EntityUid reclaimer)
+ {
+ Reclaimer = reclaimer;
+ }
+ }
+
+ private sealed class ReclaimSuccessfulEvent : EntityEventArgs
+ {
+ public EntityUid User;
+ public EntityUid Target;
+ public EntityUid Reclaimer;
+ public ReclaimSuccessfulEvent(EntityUid user, EntityUid target, EntityUid reclaimer)
+ {
+ User = user;
+ Target = target;
+ Reclaimer = reclaimer;
+ }
+ }
+ }
+}
diff --git a/Content.Server/Medical/MedicalScannerSystem.cs b/Content.Server/Medical/MedicalScannerSystem.cs
index 5d07bfb2ac..9ab0a21f9d 100644
--- a/Content.Server/Medical/MedicalScannerSystem.cs
+++ b/Content.Server/Medical/MedicalScannerSystem.cs
@@ -48,7 +48,7 @@ namespace Content.Server.Medical
private void OnComponentInit(EntityUid uid, MedicalScannerComponent scannerComponent, ComponentInit args)
{
base.Initialize();
- scannerComponent.BodyContainer = _containerSystem.EnsureContainer(uid, $"{scannerComponent.Name}-bodyContainer");
+ scannerComponent.BodyContainer = _containerSystem.EnsureContainer(uid, $"scanner-bodyContainer");
_signalSystem.EnsureReceiverPorts(uid, MedicalScannerComponent.ScannerPort);
}
diff --git a/Content.Server/Salvage/SalvageMobRestrictionsSystem.cs b/Content.Server/Salvage/SalvageMobRestrictionsSystem.cs
index 8fbc68a454..6f95dff536 100644
--- a/Content.Server/Salvage/SalvageMobRestrictionsSystem.cs
+++ b/Content.Server/Salvage/SalvageMobRestrictionsSystem.cs
@@ -1,11 +1,13 @@
using Content.Shared.Damage;
using Content.Server.Body.Components;
+using Content.Server.MobState;
namespace Content.Server.Salvage;
public sealed class SalvageMobRestrictionsSystem : EntitySystem
{
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
+ [Dependency] private readonly MobStateSystem _mobStateSystem = default!;
public override void Initialize()
{
base.Initialize();
@@ -49,6 +51,7 @@ public sealed class SalvageMobRestrictionsSystem : EntitySystem
foreach (var target in component.MobsToKill)
{
if (Deleted(target, metaQuery)) continue;
+ if (_mobStateSystem.IsDead(target)) continue; // DONT WASTE BIOMASS
if (bodyQuery.TryGetComponent(target, out var body))
{
// Just because.
diff --git a/Content.Server/Stack/StackSystem.cs b/Content.Server/Stack/StackSystem.cs
index 11a4026629..f77ea99f67 100644
--- a/Content.Server/Stack/StackSystem.cs
+++ b/Content.Server/Stack/StackSystem.cs
@@ -83,6 +83,44 @@ namespace Content.Server.Stack
return entity;
}
+ ///
+ /// Say you want to spawn 97 stacks of something that has a max stack count of 30.
+ /// This would spawn 3 stacks of 30 and 1 stack of 7.
+ ///
+ public void SpawnMultiple(int amount, int maxCountPerStack, StackPrototype prototype, EntityCoordinates spawnPosition)
+ {
+ while (amount > 0)
+ {
+ if (amount > maxCountPerStack)
+ {
+ var entity = Spawn("MaterialBiomass", spawnPosition);
+ var stack = Comp(entity);
+
+ SetCount(entity, maxCountPerStack, stack);
+ amount -= maxCountPerStack;
+ }
+ else
+ {
+ var entity = Spawn("MaterialBiomass", spawnPosition);
+ var stack = Comp(entity);
+
+ SetCount(entity, amount, stack);
+ amount = 0;
+ }
+ }
+ }
+
+ public void SpawnMultiple(int amount, int maxCountPerStack, string prototype, EntityCoordinates spawnPosition)
+ {
+ if (!_prototypeManager.TryIndex(prototype, out var stackType))
+ {
+ Logger.Error("Failed to index stack prototype " + prototype);
+ return;
+ }
+
+ SpawnMultiple(amount, maxCountPerStack, stackType, spawnPosition);
+ }
+
private void OnStackAlternativeInteract(EntityUid uid, StackComponent stack, GetVerbsEvent args)
{
if (!args.CanAccess || !args.CanInteract || args.Hands == null)
diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs
index 92fe38ee89..f52edee9d7 100644
--- a/Content.Shared/CCVar/CCVars.cs
+++ b/Content.Shared/CCVar/CCVars.cs
@@ -1002,6 +1002,17 @@ namespace Content.Shared.CCVar
CVarDef.Create("crewmanifest.ordering", "Command,Security,Science,Medical,Engineering,Cargo,Civilian,Unknown",
CVar.REPLICATED);
+ /*
+ * Biomass
+ */
+
+ ///
+ /// Enabled: Cloning has 70% cost and reclaimer will refuse to reclaim corpses with souls. (For LRP).
+ /// Disabled: Cloning has full biomass cost and reclaimer can reclaim corpses with souls. (Playtested and balanced for MRP+).
+ ///
+ public static readonly CVarDef BiomassEasyMode =
+ CVarDef.Create("biomass.easy_mode", true, CVar.SERVERONLY);
+
/*
* VIEWPORT
*/
diff --git a/Content.Shared/Jittering/SharedJitteringSystem.cs b/Content.Shared/Jittering/SharedJitteringSystem.cs
index b9ecb9e895..87f90cb708 100644
--- a/Content.Shared/Jittering/SharedJitteringSystem.cs
+++ b/Content.Shared/Jittering/SharedJitteringSystem.cs
@@ -73,5 +73,16 @@ namespace Content.Shared.Jittering
jittering.Frequency = frequency;
}
}
+
+ ///
+ /// For non mobs.
+ ///
+ public void AddJitter(EntityUid uid, float amplitude = 10f, float frequency = 4f)
+ {
+ var jitter = EnsureComp(uid);
+ jitter.Amplitude = amplitude;
+ jitter.Frequency = frequency;
+ jitter.Dirty();
+ }
}
}
diff --git a/Resources/Audio/Ambience/Objects/license.txt b/Resources/Audio/Ambience/Objects/license.txt
index 67d622f7a5..feb17562f1 100644
--- a/Resources/Audio/Ambience/Objects/license.txt
+++ b/Resources/Audio/Ambience/Objects/license.txt
@@ -7,3 +7,4 @@ server_fans - https://freesound.org/people/DeVern/sounds/610761/ - CC-BY-3.0
drain.ogg - https://freesound.org/people/PhreaKsAccount/sounds/46266/ - CC-BY-3.0 (by PhreaKsAccount)
portable_scrubber.ogg - https://freesound.org/people/Beethovenboy/sounds/384335/ - CC0 (by Beethovenboy)
alarm.ogg - https://github.com/Baystation12/Baystation12/commit/41b11ef289bccfdfa2940480beb9c1e3f50c3b93, fire_alarm.ogg CC-BY-SA-3.0
+reclaimer_ambience.ogg - https://freesound.org/people/cmorris035/sounds/319152/, Woodchipper Start (heavy machine) 02.wav CC0 (by cmorris035)
diff --git a/Resources/Audio/Ambience/Objects/reclaimer_ambience.ogg b/Resources/Audio/Ambience/Objects/reclaimer_ambience.ogg
new file mode 100644
index 0000000000..ff093d9b9e
Binary files /dev/null and b/Resources/Audio/Ambience/Objects/reclaimer_ambience.ogg differ
diff --git a/Resources/Audio/Machines/license.txt b/Resources/Audio/Machines/license.txt
index 966e6d9569..ad8dc089d3 100644
--- a/Resources/Audio/Machines/license.txt
+++ b/Resources/Audio/Machines/license.txt
@@ -10,4 +10,6 @@ vaccinator_running.ogg taken from https://freesound.org/people/RutgerMuller/soun
vending_jingle.ogg made by github.com/hubismal licensed under CC-BY-3.0
-lightswitch.ogg taken from https://github.com/Skyrat-SS13/Skyrat-tg/blob/3f6099bbc3c2afdc609bf1991c2f06297a0f13c2/modular_skyrat/modules/aesthetics/lightswitch/sound/lightswitch.ogg under CC-BY-SA 3.0
\ No newline at end of file
+lightswitch.ogg taken from https://github.com/Skyrat-SS13/Skyrat-tg/blob/3f6099bbc3c2afdc609bf1991c2f06297a0f13c2/modular_skyrat/modules/aesthetics/lightswitch/sound/lightswitch.ogg under CC-BY-SA 3.0
+
+reclaimer_startup.ogg - https://freesound.org/people/cmorris035/sounds/319152/, Woodchipper Start (heavy machine) 02.wav CC0 (by cmorris035)
diff --git a/Resources/Audio/Machines/reclaimer_startup.ogg b/Resources/Audio/Machines/reclaimer_startup.ogg
new file mode 100644
index 0000000000..2dafef61c7
Binary files /dev/null and b/Resources/Audio/Machines/reclaimer_startup.ogg differ
diff --git a/Resources/Locale/en-US/lathe/lathesystem.ftl b/Resources/Locale/en-US/lathe/lathesystem.ftl
index 0b5e538d2c..9fa62e0c1e 100644
--- a/Resources/Locale/en-US/lathe/lathesystem.ftl
+++ b/Resources/Locale/en-US/lathe/lathesystem.ftl
@@ -1 +1 @@
-lathe-popup-material-not-used = This material is not used in this lathe.
\ No newline at end of file
+lathe-popup-material-not-used = This material is not used in this machine.
diff --git a/Resources/Locale/en-US/medical/components/cloning-console-component.ftl b/Resources/Locale/en-US/medical/components/cloning-console-component.ftl
index 911b06180e..80ac3df4e9 100644
--- a/Resources/Locale/en-US/medical/components/cloning-console-component.ftl
+++ b/Resources/Locale/en-US/medical/components/cloning-console-component.ftl
@@ -24,3 +24,6 @@ cloning-console-component-msg-already-cloning = Not Ready: Pod Network Conflict
cloning-console-component-msg-incomplete = Not Ready: Cloning In Progress
cloning-console-component-msg-no-cloner = Not Ready: No Cloner Detected
cloning-console-component-msg-no-mind = Not Ready: No Soul Activity Detected
+
+cloning-console-chat-error = ERROR: INSUFFICIENT BIOMASS. CLONING THIS BODY REQUIRES {$units} UNITS OF BIOMASS.
+cloning-console-cellular-warning = WARNING: GENEFSCK CONFIDENCE SCORE IS {$percent}%. CLONING MAY HAVE UNEXPECTED RESULTS.
diff --git a/Resources/Locale/en-US/medical/components/cloning-pod-component.ftl b/Resources/Locale/en-US/medical/components/cloning-pod-component.ftl
new file mode 100644
index 0000000000..c5afeeb173
--- /dev/null
+++ b/Resources/Locale/en-US/medical/components/cloning-pod-component.ftl
@@ -0,0 +1 @@
+cloning-pod-biomass = It currently has [color=red]{$number}[/color] units of biomass.
diff --git a/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml b/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml
index fbbf073ba1..93a5d8a4ef 100644
--- a/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml
+++ b/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml
@@ -132,6 +132,8 @@
- id: DoorRemoteMedical
- id: RubberStampCMO
- id: MedicalTechFabCircuitboard
+ - id: MaterialBiomass
+ amount: 3
- type: entity
id: LockerResearchDirectorFilled
diff --git a/Resources/Prototypes/Catalog/Research/technologies.yml b/Resources/Prototypes/Catalog/Research/technologies.yml
index 6259b15b4c..c0541eb546 100644
--- a/Resources/Prototypes/Catalog/Research/technologies.yml
+++ b/Resources/Prototypes/Catalog/Research/technologies.yml
@@ -126,7 +126,7 @@
- VaccinatorMachineCircuitboard
- DiagnoserMachineCircuitboard
- HandheldCrewMonitor
- - CloningConsoleComputerCircuitboard
+ - BiomassReclaimerMachineCircuitboard
- type: technology
name: technologies-advanced-life-support
@@ -143,6 +143,7 @@
- CloningPodMachineCircuitboard
- MedicalScannerMachineCircuitboard
- StasisBedMachineCircuitboard
+ - CloningConsoleComputerCircuitboard
# Security Technology Tree
diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml
index 8f12524f0d..68222cc6b3 100644
--- a/Resources/Prototypes/Catalog/uplink_catalog.yml
+++ b/Resources/Prototypes/Catalog/uplink_catalog.yml
@@ -554,15 +554,15 @@
# categories:
# - UplinkMisc
-- type: listing
- id: UplinkGigacancerScanner
- name: Ultragigacancer Health Analyzer
- description: Works like a normal health analyzer, other than giving everyone it scans ultragigacancer.
- productEntity: HandheldHealthAnalyzerGigacancer
- cost:
- Telecrystal: 5
- categories:
- - UplinkMisc
+# - type: listing
+# id: UplinkGigacancerScanner
+# name: Ultragigacancer Health Analyzer
+# description: Works like a normal health analyzer, other than giving everyone it scans ultragigacancer.
+# productEntity: HandheldHealthAnalyzerGigacancer
+# cost:
+# Telecrystal: 5
+# categories:
+# - UplinkMisc
- type: listing
id: UplinkNocturineChemistryBottle
diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml b/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml
index 3f9eaeb25c..a195044155 100644
--- a/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml
+++ b/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml
@@ -29,8 +29,8 @@
fixtures:
- shape:
!type:PhysShapeCircle
- radius: 0.25
- mass: 120
+ radius: 0.3
+ mass: 65
mask:
- MobMask
layer:
@@ -125,7 +125,7 @@
scale: 1.2, 1.2
layers:
- map: ["enum.DamageStateVisualLayers.Base"]
- state: regalrat
+ state: regalrat
- type: MobState
thresholds:
0: Alive
@@ -138,6 +138,16 @@
damage:
types:
Blunt: 50 #oof ouch owie my bones
+ - type: Fixtures
+ fixtures:
+ - shape:
+ !type:PhysShapeCircle
+ radius: 0.35
+ mass: 150
+ mask:
+ - MobMask
+ layer:
+ - MobLayer
- type: SlowOnDamage
speedModifierThresholds:
200: 0.7
diff --git a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml
index 2a606f5601..9436adc6f9 100644
--- a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml
+++ b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml
@@ -259,6 +259,31 @@
materialRequirements:
Glass: 1
+- type: entity
+ id: BiomassReclaimerMachineCircuitboard
+ parent: BaseMachineCircuitboard
+ name: biomass reclaimer machine board
+ description: A machine printed circuit board for a biomass reclaimer
+ components:
+ - type: MachineBoard
+ prototype: BiomassReclaimer
+ requirements:
+ Laser: 1
+ Manipulator: 1
+ tagRequirements:
+ Pipe:
+ Amount: 1
+ DefaultPrototype: GasPipeStraight
+ ExamineName: pipe
+ BorgArm:
+ Amount: 3
+ DefaultPrototype: LeftArmBorg
+ ExamineName: borg arm
+ Knife:
+ Amount: 3
+ DefaultPrototype: KitchenKnife
+ ExamineName: knife
+
- type: entity
id: HydroponicsTrayMachineCircuitboard
parent: BaseMachineCircuitboard
diff --git a/Resources/Prototypes/Entities/Objects/Materials/materials.yml b/Resources/Prototypes/Entities/Objects/Materials/materials.yml
index 97fca70b2d..8a27b2124a 100644
--- a/Resources/Prototypes/Entities/Objects/Materials/materials.yml
+++ b/Resources/Prototypes/Entities/Objects/Materials/materials.yml
@@ -119,6 +119,32 @@
- type: Stack
count: 1
+- type: entity
+ parent: MaterialBase
+ id: MaterialBiomass
+ name: biomass
+ suffix: Full
+ components:
+ - type: Material
+ materials:
+ Biomass: 1
+ - type: Stack
+ stackType: Biomass
+ count: 100
+ max: 100
+ - type: Sprite
+ sprite: /Textures/Objects/Misc/monkeycube.rsi
+ state: cube
+ color: "#8A9A5B"
+
+- type: entity
+ parent: MaterialBiomass
+ id: MaterialBiomass1
+ suffix: Single
+ components:
+ - type: Stack
+ count: 1
+
# Following not used currently
- type: entity
parent: MaterialBase
diff --git a/Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml b/Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml
index 329451bba4..08e3867624 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml
@@ -616,6 +616,8 @@
interfaces:
- key: enum.CloningConsoleUiKey.Key
type: CloningConsoleBoundUserInterface
+ - type: Speech
+ speechSounds: Pai
- type: entity
parent: BaseComputer
diff --git a/Resources/Prototypes/Entities/Structures/Machines/Medical/biomass_reclaimer.yml b/Resources/Prototypes/Entities/Structures/Machines/Medical/biomass_reclaimer.yml
new file mode 100644
index 0000000000..647bc61a6b
--- /dev/null
+++ b/Resources/Prototypes/Entities/Structures/Machines/Medical/biomass_reclaimer.yml
@@ -0,0 +1,23 @@
+- type: entity
+ id: BiomassReclaimer
+ parent: [ BaseMachinePowered, ConstructibleMachine ]
+ name: biomass reclaimer
+ description: Reclaims biomass from corpses. Gruesome.
+ placement:
+ mode: SnapgridCenter
+ components:
+ - type: Sprite
+ sprite: Structures/Machines/Medical/biomass_reclaimer.rsi
+ state: icon
+ netsync: false
+ - type: BiomassReclaimer
+ - type: Climbable
+ delay: 7
+ - type: AmbientSound
+ enabled: false
+ volume: -5
+ range: 5
+ sound:
+ path: /Audio/Ambience/Objects/reclaimer_ambience.ogg
+ - type: Machine
+ board: BiomassReclaimerMachineCircuitboard
diff --git a/Resources/Prototypes/Entities/Structures/Machines/disease_diagnoser.yml b/Resources/Prototypes/Entities/Structures/Machines/Medical/disease_diagnoser.yml
similarity index 100%
rename from Resources/Prototypes/Entities/Structures/Machines/disease_diagnoser.yml
rename to Resources/Prototypes/Entities/Structures/Machines/Medical/disease_diagnoser.yml
diff --git a/Resources/Prototypes/Entities/Structures/Machines/vaccinator.yml b/Resources/Prototypes/Entities/Structures/Machines/Medical/vaccinator.yml
similarity index 100%
rename from Resources/Prototypes/Entities/Structures/Machines/vaccinator.yml
rename to Resources/Prototypes/Entities/Structures/Machines/Medical/vaccinator.yml
diff --git a/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml b/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml
index 69bd8d8848..53e01e9e4c 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml
@@ -1,6 +1,6 @@
- type: entity
id: CloningPod
- parent: [ BaseMachinePowered, ConstructibleMachine ]
+ parent: BaseMachinePowered
name: cloning pod
description: A Cloning Pod. 50% reliable.
components:
@@ -26,6 +26,12 @@
- MachineMask
layer:
- MachineLayer
+ - type: Construction
+ graph: Machine
+ node: machine
+ - type: EmptyOnMachineDeconstruct
+ containers:
+ - clonepod-bodyContainer
- type: Destructible
thresholds:
- trigger:
@@ -39,6 +45,8 @@
- type: Machine
board: CloningPodMachineCircuitboard
- type: MaterialStorage
+ materialWhiteList:
+ - Biomass
- type: Wires
BoardName: "CloningPod"
LayoutId: CloningPod
diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
index f94cd2b9b3..828729585a 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml
@@ -48,6 +48,11 @@
- type: Machine
board: AutolatheMachineCircuitboard
- type: MaterialStorage
+ whitelist:
+ tags:
+ - Sheet
+ - RawMaterial
+ - Ingot
- type: Wires
BoardName: "Autolathe"
LayoutId: Autolathe
@@ -77,11 +82,6 @@
anchored: true
- type: Pullable
- type: Lathe
- whitelist:
- tags:
- - Sheet
- - RawMaterial
- - Ingot
- type: entity
parent: [ BaseMachinePowered, ConstructibleMachine ]
@@ -138,6 +138,11 @@
LayoutId: Protolathe
- type: TechnologyDatabase
- type: MaterialStorage
+ whitelist:
+ tags:
+ - Sheet
+ - RawMaterial
+ - Ingot
- type: ProtolatheDatabase
protolatherecipes:
- LightTube
@@ -212,11 +217,6 @@
anchored: true
- type: Pullable
- type: Lathe
- whitelist:
- tags:
- - Sheet
- - RawMaterial
- - Ingot
- type: entity
parent: Protolathe
@@ -248,6 +248,7 @@
- DiagnoserMachineCircuitboard
- ChemMasterMachineCircuitboard
- ChemDispenserMachineCircuitboard
+ - BiomassReclaimerMachineCircuitboard
- SurveillanceCameraRouterCircuitboard
- SurveillanceCameraMonitorCircuitboard
- SurveillanceWirelessCameraMonitorCircuitboard
@@ -278,6 +279,7 @@
board: CircuitImprinterMachineCircuitboard
- type: Lathe
producingSound: /Audio/Machines/circuitprinter.ogg
+ - type: MaterialStorage
whitelist:
tags:
- Sheet
@@ -329,6 +331,7 @@
- type: Machine
board: SecurityTechFabCircuitboard
- type: Lathe
+ - type: MaterialStorage
whitelist:
tags:
- Sheet
@@ -468,10 +471,12 @@
board: UniformPrinterMachineCircuitboard
- type: Lathe
producingSound: /Audio/Machines/uniformprinter.ogg
+ - type: MaterialStorage
whitelist:
tags:
- Sheet
- RawMaterial
+ - Ingot
- type: entity
parent: Autolathe
@@ -508,7 +513,8 @@
- SheetUranium1
- IngotGold1
- IngotSilver1
- - type: Lathe
+ - type: MaterialStorage
whitelist:
tags:
- Ore
+ - type: Lathe
diff --git a/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml b/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml
index 8982f9350f..1f4a9bb946 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml
@@ -1,6 +1,6 @@
- type: entity
id: MedicalScanner
- parent: [ BaseMachinePowered, ConstructibleMachine ]
+ parent: BaseMachinePowered
name: medical scanner
description: A bulky medical scanner.
components:
@@ -29,6 +29,9 @@
- MachineMask
layer:
- MachineLayer
+ - type: Construction
+ graph: Machine
+ node: machine
- type: Destructible
thresholds:
- trigger:
@@ -51,3 +54,6 @@
- type: Climbable
- type: ApcPowerReceiver
powerLoad: 200 #Receives most of its power from the console
+ - type: EmptyOnMachineDeconstruct
+ containers:
+ - scanner-bodyContainer
diff --git a/Resources/Prototypes/Reagents/Materials/materials.yml b/Resources/Prototypes/Reagents/Materials/materials.yml
index 74f8890d79..0b9efa08e3 100644
--- a/Resources/Prototypes/Reagents/Materials/materials.yml
+++ b/Resources/Prototypes/Reagents/Materials/materials.yml
@@ -1,3 +1,10 @@
+- type: material
+ id: Biomass
+ stack: Biomass
+ name: biomass
+ icon: /Textures/Objects/Misc/monkeycube.rsi/cube.png
+ color: "#8A9A5B"
+ price: 0.05
- type: material
id: Cloth
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/machines/machine.yml b/Resources/Prototypes/Recipes/Construction/Graphs/machines/machine.yml
index 322feb6892..67951a57fa 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/machines/machine.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/machines/machine.yml
@@ -109,7 +109,7 @@
- to: start
steps:
- tool: Welding
- doAfter: 5
+ doAfter: 5
completed:
- !type:SpawnPrototype
prototype: SheetSteel1
diff --git a/Resources/Prototypes/Recipes/Lathes/electronics.yml b/Resources/Prototypes/Recipes/Lathes/electronics.yml
index 7fd1361808..ca09f5662c 100644
--- a/Resources/Prototypes/Recipes/Lathes/electronics.yml
+++ b/Resources/Prototypes/Recipes/Lathes/electronics.yml
@@ -101,6 +101,16 @@
Glass: 900
Gold: 100
+- type: latheRecipe
+ id: BiomassReclaimerMachineCircuitboard
+ icon: Objects/Misc/module.rsi/id_mod.png
+ result: BiomassReclaimerMachineCircuitboard
+ completetime: 4
+ materials:
+ Steel: 100
+ Glass: 900
+ Gold: 100
+
- type: latheRecipe
id: HydroponicsTrayMachineCircuitboard
icon: Objects/Misc/module.rsi/id_mod.png
diff --git a/Resources/Prototypes/Stacks/Materials/materials.yml b/Resources/Prototypes/Stacks/Materials/materials.yml
index ce33f3f5e6..b36f76fd85 100644
--- a/Resources/Prototypes/Stacks/Materials/materials.yml
+++ b/Resources/Prototypes/Stacks/Materials/materials.yml
@@ -1,3 +1,9 @@
+- type: stack
+ id: Biomass
+ name: biomass
+ icon: /Textures/Objects/Misc/monkeycube.rsi/cube.png
+ spawn: MaterialBiomass1
+
- type: stack
id: WoodPlank
name: wood plank
@@ -21,7 +27,7 @@
name: diamond
icon: /Textures/Objects/Materials/materials.rsi/diamond.png
spawn: MaterialDiamond1
-
+
- type: stack
id: Cotton
name: cotton
diff --git a/Resources/Textures/Structures/Machines/Medical/biomass_reclaimer.rsi/icon.png b/Resources/Textures/Structures/Machines/Medical/biomass_reclaimer.rsi/icon.png
new file mode 100644
index 0000000000..ce5794b6b9
Binary files /dev/null and b/Resources/Textures/Structures/Machines/Medical/biomass_reclaimer.rsi/icon.png differ
diff --git a/Resources/Textures/Structures/Machines/Medical/biomass_reclaimer.rsi/meta.json b/Resources/Textures/Structures/Machines/Medical/biomass_reclaimer.rsi/meta.json
new file mode 100644
index 0000000000..8cb486c0d2
--- /dev/null
+++ b/Resources/Textures/Structures/Machines/Medical/biomass_reclaimer.rsi/meta.json
@@ -0,0 +1,14 @@
+{
+ "version": 1,
+ "license": "CC-BY-SA-3.0",
+ "copyright": "Created by Discord user Hyenh#6078",
+ "size": {
+ "x": 32,
+ "y": 32
+ },
+ "states": [
+ {
+ "name": "icon"
+ }
+ ]
+}