Syndicate sponge for uplink (#17841)

* Syndicate sponge for uplink

* Fix yaml error

* Made changes mentioned in review

* Made changes according to reviews
This commit is contained in:
Arendian
2023-07-09 21:24:30 +02:00
committed by GitHub
parent 618c5271d2
commit ec58d2e716
6 changed files with 125 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
using Content.Server.Chemistry.Components;
using Content.Shared.FixedPoint;
using Content.Shared.Popups;
using Robust.Shared.Random;
namespace Content.Server.Chemistry.EntitySystems;
@@ -8,6 +9,7 @@ public sealed class RehydratableSystem : EntitySystem
{
[Dependency] private readonly SharedPopupSystem _popups = default!;
[Dependency] private readonly SolutionContainerSystem _solutions = default!;
[Dependency] private readonly IRobustRandom _random = default!;
public override void Initialize()
{
@@ -30,7 +32,10 @@ public sealed class RehydratableSystem : EntitySystem
{
_popups.PopupEntity(Loc.GetString("rehydratable-component-expands-message", ("owner", uid)), uid);
var target = Spawn(comp.TargetPrototype, Transform(uid).Coordinates);
var randomMob = _random.Pick(comp.PossibleSpawns);
var target = Spawn(randomMob, Transform(uid).Coordinates);
Transform(target).AttachToGridOrMap();
var ev = new GotRehydratedEvent(target);
RaiseLocalEvent(uid, ref ev);