Exemple #1
0
        public override bool Take(IPlayerSession session)
        {
            if (Taken)
            {
                return(false);
            }

            Taken = true;

            var mind = Owner.EnsureComponent <MindComponent>();

            if (mind.HasMind)
            {
                return(false);
            }

            if (MakeSentient)
            {
                MakeSentientCommand.MakeSentient(Owner, IoCManager.Resolve <IEntityManager>());
            }

            var ghostRoleSystem = EntitySystem.Get <GhostRoleSystem>();

            ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, Owner, Owner, this);

            ghostRoleSystem.UnregisterGhostRole(this);

            return(true);
        }
Exemple #2
0
        public override bool Take(IPlayerSession session)
        {
            if (Taken)
            {
                return(false);
            }

            if (string.IsNullOrEmpty(Prototype))
            {
                throw new NullReferenceException("Prototype string cannot be null or empty!");
            }

            var mob   = _entMan.SpawnEntity(Prototype, _entMan.GetComponent <TransformComponent>(Owner).Coordinates);
            var xform = _entMan.GetComponent <TransformComponent>(mob);

            xform.AttachToGridOrMap();

            var spawnedEvent = new GhostRoleSpawnerUsedEvent(Owner, mob);

            _entMan.EventBus.RaiseLocalEvent(mob, spawnedEvent, false);

            if (MakeSentient)
            {
                MakeSentientCommand.MakeSentient(mob, _entMan);
            }

            mob.EnsureComponent <MindComponent>();

            var ghostRoleSystem = EntitySystem.Get <GhostRoleSystem>();

            ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, Owner, mob, this);

            if (++_currentTakeovers < _availableTakeovers)
            {
                return(true);
            }

            Taken = true;

            if (_deleteOnSpawn)
            {
                _entMan.QueueDeleteEntity(Owner);
            }

            return(true);
        }
Exemple #3
0
        public override void Activate(IEntity user, IEntity target)
        {
            var groupController = IoCManager.Resolve <IConGroupController>();

            var player = user.GetComponent <IActorComponent>().playerSession;

            if (!groupController.CanCommand(player, "makesentient"))
            {
                return;
            }

            var host   = IoCManager.Resolve <IServerConsoleHost>();
            var cmd    = new MakeSentientCommand();
            var uidStr = target.Uid.ToString();

            cmd.Execute(new ConsoleShell(host, player), $"{cmd.Command} {uidStr}",
                        new[] { uidStr });
        }
Exemple #4
0
    //TODO: Figure out if everything in the player spawning region belongs somewhere else.
    #region Player spawning helpers

    /// <summary>
    /// Spawns in a player's mob according to their job and character information at the given coordinates.
    /// Used by systems that need to handle spawning players.
    /// </summary>
    /// <param name="coordinates">Coordinates to spawn the character at.</param>
    /// <param name="job">Job to assign to the character, if any.</param>
    /// <param name="profile">Appearance profile to use for the character.</param>
    /// <param name="station">The station this player is being spawned on.</param>
    /// <returns>The spawned entity</returns>
    public EntityUid SpawnPlayerMob(
        EntityCoordinates coordinates,
        Job?job,
        HumanoidCharacterProfile?profile,
        EntityUid?station)
    {
        // If we're not spawning a humanoid, we're gonna exit early without doing all the humanoid stuff.
        if (job?.JobEntity != null)
        {
            var jobEntity = EntityManager.SpawnEntity(job.JobEntity, coordinates);
            MakeSentientCommand.MakeSentient(jobEntity, EntityManager);
            DoJobSpecials(job, jobEntity);
            _identity.QueueIdentityUpdate(jobEntity);
            return(jobEntity);
        }

        var entity = EntityManager.SpawnEntity(
            _prototypeManager.Index <SpeciesPrototype>(profile?.Species ?? SpeciesManager.DefaultSpecies).Prototype,
            coordinates);

        if (job?.StartingGear != null)
        {
            var startingGear = _prototypeManager.Index <StartingGearPrototype>(job.StartingGear);
            EquipStartingGear(entity, startingGear, profile);
            if (profile != null)
            {
                EquipIdCard(entity, profile.Name, job.Prototype, station);
            }
        }

        if (profile != null)
        {
            _humanoidAppearanceSystem.UpdateFromProfile(entity, profile);
            EntityManager.GetComponent <MetaDataComponent>(entity).EntityName = profile.Name;
            if (profile.FlavorText != "" && _configurationManager.GetCVar(CCVars.FlavorText))
            {
                EntityManager.AddComponent <DetailExaminableComponent>(entity).Content = profile.FlavorText;
            }
        }

        DoJobSpecials(job, entity);
        _identity.QueueIdentityUpdate(entity);
        return(entity);
    }
Exemple #5
0
    public override void Startup()
    {
        base.Startup();

        var targetList = _entityManager.EntityQuery <SentienceTargetComponent>().ToList();

        _random.Shuffle(targetList);

        var toMakeSentient = _random.Next(2, 5);
        var groups         = new HashSet <string>();

        foreach (var target in targetList)
        {
            if (toMakeSentient-- == 0)
            {
                break;
            }

            MakeSentientCommand.MakeSentient(target.Owner, _entityManager);
            _entityManager.RemoveComponent <SentienceTargetComponent>(target.Owner);
            var comp = _entityManager.AddComponent <GhostTakeoverAvailableComponent>(target.Owner);
            comp.RoleName        = _entityManager.GetComponent <MetaDataComponent>(target.Owner).EntityName;
            comp.RoleDescription = Loc.GetString("station-event-random-sentience-role-description", ("name", comp.RoleName));
            groups.Add(target.FlavorKind);
        }

        if (groups.Count == 0)
        {
            return;
        }

        var groupList = groups.ToList();
        var kind1     = groupList.Count > 0 ? groupList[0] : "???";
        var kind2     = groupList.Count > 1 ? groupList[1] : "???";
        var kind3     = groupList.Count > 2 ? groupList[2] : "???";

        _chatManager.DispatchStationAnnouncement(
            Loc.GetString("station-event-random-sentience-announcement",
                          ("kind1", kind1), ("kind2", kind2), ("kind3", kind3), ("amount", groupList.Count),
                          ("data", Loc.GetString($"random-sentience-event-data-{_random.Next(1, 6)}")),
                          ("strength", Loc.GetString($"random-sentience-event-strength-{_random.Next(1, 8)}")))
            );
    }
        public override bool Take(IPlayerSession session)
        {
            if (Taken)
            {
                return(false);
            }

            if (string.IsNullOrEmpty(Prototype))
            {
                throw new NullReferenceException("Prototype string cannot be null or empty!");
            }

            var mob = Owner.EntityManager.SpawnEntity(Prototype, Owner.Transform.Coordinates);

            if (_makeSentient)
            {
                MakeSentientCommand.MakeSentient(mob);
            }

            mob.EnsureComponent <MindComponent>();

            var mind = session.ContentData()?.Mind;

            DebugTools.AssertNotNull(mind);

            mind !.TransferTo(mob);

            if (++_currentTakeovers < _availableTakeovers)
            {
                return(true);
            }

            Taken = true;

            if (_deleteOnSpawn)
            {
                Owner.Delete();
            }


            return(true);
        }
    public override void Startup()
    {
        base.Startup();
        HashSet <EntityUid> stationsToNotify = new();

        var targetList = _entityManager.EntityQuery <SentienceTargetComponent>().ToList();

        _random.Shuffle(targetList);

        var toMakeSentient = _random.Next(2, 5);
        var groups         = new HashSet <string>();

        foreach (var target in targetList)
        {
            if (toMakeSentient-- == 0)
            {
                break;
            }

            MakeSentientCommand.MakeSentient(target.Owner, _entityManager);
            _entityManager.RemoveComponent <SentienceTargetComponent>(target.Owner);
            var comp = _entityManager.AddComponent <GhostTakeoverAvailableComponent>(target.Owner);
            comp.RoleName        = _entityManager.GetComponent <MetaDataComponent>(target.Owner).EntityName;
            comp.RoleDescription = Loc.GetString("station-event-random-sentience-role-description", ("name", comp.RoleName));
            groups.Add(target.FlavorKind);
        }

        if (groups.Count == 0)
        {
            return;
        }

        var groupList = groups.ToList();
        var kind1     = groupList.Count > 0 ? groupList[0] : "???";
        var kind2     = groupList.Count > 1 ? groupList[1] : "???";
        var kind3     = groupList.Count > 2 ? groupList[2] : "???";

        var entSysMgr     = IoCManager.Resolve <IEntitySystemManager>();
        var stationSystem = entSysMgr.GetEntitySystem <StationSystem>();
        var chatSystem    = entSysMgr.GetEntitySystem <ChatSystem>();

        foreach (var target in targetList)
        {
            var station = stationSystem.GetOwningStation(target.Owner);
            if (station == null)
            {
                continue;
            }
            stationsToNotify.Add((EntityUid)station);
        }
        foreach (var station in stationsToNotify)
        {
            chatSystem.DispatchStationAnnouncement(
                (EntityUid)station,
                Loc.GetString("station-event-random-sentience-announcement",
                              ("kind1", kind1), ("kind2", kind2), ("kind3", kind3), ("amount", groupList.Count),
                              ("data", Loc.GetString($"random-sentience-event-data-{_random.Next(1, 6)}")),
                              ("strength", Loc.GetString($"random-sentience-event-strength-{_random.Next(1, 8)}"))),
                playDefaultSound: false,
                colorOverride: Color.Gold
                );
        }
    }
        /// <summary>
        /// This is the general purpose function to call if you want to zombify an entity.
        /// It handles both humanoid and nonhumanoid transformation.
        /// </summary>
        /// <param name="target">the entity being zombified</param>
        public void ZombifyEntity(EntityUid target)
        {
            if (HasComp <ZombieComponent>(target))
            {
                return;
            }

            _disease.CureAllDiseases(target);
            RemComp <DiseaseCarrierComponent>(target);
            RemComp <RespiratorComponent>(target);
            RemComp <BarotraumaComponent>(target);
            RemComp <HungerComponent>(target);
            RemComp <ThirstComponent>(target);

            var zombiecomp = EnsureComp <ZombifyOnDeathComponent>(target);

            if (TryComp <HumanoidAppearanceComponent>(target, out var huApComp))
            {
                var appearance = huApComp.Appearance;
                _sharedHuApp.UpdateAppearance(target, appearance.WithSkinColor(zombiecomp.SkinColor), huApComp);
                _sharedHuApp.ForceAppearanceUpdate(target, huApComp);
            }

            if (!HasComp <SharedDummyInputMoverComponent>(target))
            {
                MakeSentientCommand.MakeSentient(target, EntityManager);
            }

            EnsureComp <ReplacementAccentComponent>(target).Accent = "zombie";

            //funny add delet go brrr
            RemComp <CombatModeComponent>(target);
            AddComp <CombatModeComponent>(target);

            var melee = EnsureComp <MeleeWeaponComponent>(target);

            melee.Arc      = zombiecomp.AttackArc;
            melee.ClickArc = zombiecomp.AttackArc;
            //lord forgive me for the hardcoded damage
            DamageSpecifier dspec = new();

            dspec.DamageDict.Add("Slash", 13);
            dspec.DamageDict.Add("Piercing", 7);
            melee.Damage = dspec;

            _damageable.SetDamageModifierSetId(target, "Zombie");
            _bloodstream.SetBloodLossThreshold(target, 0f);

            _popupSystem.PopupEntity(Loc.GetString("zombie-transform", ("target", target)), target, Filter.Pvs(target));
            _serverInventory.TryUnequip(target, "gloves", true, true);

            if (TryComp <TemperatureComponent>(target, out var tempComp))
            {
                tempComp.ColdDamage.ClampMax(0);
            }

            if (TryComp <DamageableComponent>(target, out var damageablecomp))
            {
                _damageable.SetAllDamage(damageablecomp, 0);
            }

            if (TryComp <MetaDataComponent>(target, out var meta))
            {
                meta.EntityName = Loc.GetString("zombie-name-prefix", ("target", meta.EntityName));
            }

            var mindcomp = EnsureComp <MindComponent>(target);

            if (mindcomp.Mind != null && mindcomp.Mind.TryGetSession(out var session))
            {
                _chatMan.DispatchServerMessage(session, Loc.GetString("zombie-infection-greeting"));
            }

            if (!HasComp <GhostRoleMobSpawnerComponent>(target) && !mindcomp.HasMind) //this specific component gives build test trouble so pop off, ig
            {
                EntityManager.EnsureComponent <GhostTakeoverAvailableComponent>(target, out var ghostcomp);
                ghostcomp.RoleName        = Loc.GetString("zombie-generic");
                ghostcomp.RoleDescription = Loc.GetString("zombie-role-desc");
                ghostcomp.RoleRules       = Loc.GetString("zombie-role-rules");
            }

            foreach (var hand in _sharedHands.EnumerateHands(target))
            {
                _sharedHands.SetActiveHand(target, hand);
                hand.Container?.EmptyContainer();
                _sharedHands.RemoveHand(target, hand.Name);
            }
            RemComp <HandsComponent>(target);

            EnsureComp <ZombieComponent>(target);
        }
Exemple #9
0
        /// <summary>
        ///     This is the general purpose function to call if you want to zombify an entity.
        ///     It handles both humanoid and nonhumanoid transformation and everything should be called through it.
        /// </summary>
        /// <param name="target">the entity being zombified</param>
        /// <remarks>
        ///     ALRIGHT BIG BOY. YOU'VE COME TO THE LAYER OF THE BEAST. THIS IS YOUR WARNING.
        ///     This function is the god function for zombie stuff, and it is cursed. I have
        ///     attempted to label everything thouroughly for your sanity. I have attempted to
        ///     rewrite this, but this is how it shall lie eternal. Turn back now.
        ///     -emo
        /// </remarks>
        public void ZombifyEntity(EntityUid target)
        {
            //Don't zombfiy zombies
            if (HasComp <ZombieComponent>(target))
            {
                return;
            }

            //you're a real zombie now, son.
            var zombiecomp = AddComp <ZombieComponent>(target);

            ///we need to basically remove all of these because zombies shouldn't
            ///get diseases, breath, be thirst, be hungry, or die in space
            RemComp <DiseaseCarrierComponent>(target);
            RemComp <RespiratorComponent>(target);
            RemComp <BarotraumaComponent>(target);
            RemComp <HungerComponent>(target);
            RemComp <ThirstComponent>(target);

            //funny voice
            EnsureComp <ReplacementAccentComponent>(target).Accent = "zombie";
            var rotting = EnsureComp <RottingComponent>(target);

            rotting.DealDamage = false;

            ///This is needed for stupid entities that f**k up combat mode component
            ///in an attempt to make an entity not attack. This is the easiest way to do it.
            RemComp <CombatModeComponent>(target);
            AddComp <CombatModeComponent>(target);

            ///This is the actual damage of the zombie. We assign the visual appearance
            ///and range here because of stuff we'll find out later
            var melee = EnsureComp <MeleeWeaponComponent>(target);

            melee.Arc      = zombiecomp.AttackArc;
            melee.ClickArc = zombiecomp.AttackArc;
            melee.Range    = 0.75f;

            //We have specific stuff for humanoid zombies because they matter more
            if (TryComp <HumanoidAppearanceComponent>(target, out var huApComp)) //huapcomp
            {
                //this bs is done because you can't directly update humanoid appearances
                var appearance = huApComp.Appearance;
                appearance = appearance.WithSkinColor(zombiecomp.SkinColor).WithEyeColor(zombiecomp.EyeColor);
                _sharedHuApp.UpdateAppearance(target, appearance, huApComp);
                _sharedHuApp.ForceAppearanceUpdate(target, huApComp);

                ///This is done here because non-humanoids shouldn't get baller damage
                ///lord forgive me for the hardcoded damage
                DamageSpecifier dspec = new();
                dspec.DamageDict.Add("Slash", 13);
                dspec.DamageDict.Add("Piercing", 7);
                dspec.DamageDict.Add("Structural", 10);
                melee.Damage = dspec;
            }

            //The zombie gets the assigned damage weaknesses and strengths
            _damageable.SetDamageModifierSetId(target, "Zombie");

            ///This makes it so the zombie doesn't take bloodloss damage.
            ///NOTE: they are supposed to bleed, just not take damage
            _bloodstream.SetBloodLossThreshold(target, 0f);

            //This is specifically here to combat insuls, because frying zombies on grilles is funny as shit.
            _serverInventory.TryUnequip(target, "gloves", true, true);

            //popup
            _popupSystem.PopupEntity(Loc.GetString("zombie-transform", ("target", target)), target, Filter.Pvs(target), PopupType.LargeCaution);

            //Make it sentient if it's an animal or something
            if (!HasComp <InputMoverComponent>(target)) //this component is cursed and f***s shit up
            {
                MakeSentientCommand.MakeSentient(target, EntityManager);
            }

            //Make the zombie not die in the cold. Good for space zombies
            if (TryComp <TemperatureComponent>(target, out var tempComp))
            {
                tempComp.ColdDamage.ClampMax(0);
            }

            //Heals the zombie from all the damage it took while human
            if (TryComp <DamageableComponent>(target, out var damageablecomp))
            {
                _damageable.SetAllDamage(damageablecomp, 0);
            }

            //gives it the funny "Zombie ___" name.
            if (TryComp <MetaDataComponent>(target, out var meta))
            {
                meta.EntityName = Loc.GetString("zombie-name-prefix", ("target", meta.EntityName));
            }

            _identity.QueueIdentityUpdate(target);

            //He's gotta have a mind
            var mindcomp = EnsureComp <MindComponent>(target);

            if (mindcomp.Mind != null && mindcomp.Mind.TryGetSession(out var session))
            {
                //Zombie role for player manifest
                mindcomp.Mind.AddRole(new TraitorRole(mindcomp.Mind, _proto.Index <AntagPrototype>(zombiecomp.ZombieRoleId)));
                //Greeting message for new bebe zombers
                _chatMan.DispatchServerMessage(session, Loc.GetString("zombie-infection-greeting"));
            }

            if (!HasComp <GhostRoleMobSpawnerComponent>(target) && !mindcomp.HasMind) //this specific component gives build test trouble so pop off, ig
            {
                //yet more hardcoding. Visit zombie.ftl for more information.
                EntityManager.EnsureComponent <GhostTakeoverAvailableComponent>(target, out var ghostcomp);
                ghostcomp.RoleName        = Loc.GetString("zombie-generic");
                ghostcomp.RoleDescription = Loc.GetString("zombie-role-desc");
                ghostcomp.RoleRules       = Loc.GetString("zombie-role-rules");
            }

            ///Goes through every hand, drops the items in it, then removes the hand
            ///may become the source of various bugs.
            foreach (var hand in _sharedHands.EnumerateHands(target))
            {
                _sharedHands.SetActiveHand(target, hand);
                _sharedHands.DoDrop(target, hand);
                _sharedHands.RemoveHand(target, hand.Name);
            }
            RemComp <HandsComponent>(target);

            //zombie gamemode stuff
            RaiseLocalEvent(new EntityZombifiedEvent(target));
            //zombies get slowdown once they convert
            _movementSpeedModifier.RefreshMovementSpeedModifiers(target);
        }
Exemple #10
0
        private void AddDebugVerbs(GetOtherVerbsEvent args)
        {
            if (!args.User.TryGetComponent <ActorComponent>(out var actor))
            {
                return;
            }

            var player = actor.PlayerSession;

            // Delete verb
            if (_groupController.CanCommand(player, "deleteentity"))
            {
                Verb verb = new();
                verb.Text        = Loc.GetString("delete-verb-get-data-text");
                verb.Category    = VerbCategory.Debug;
                verb.IconTexture = "/Textures/Interface/VerbIcons/delete.svg.192dpi.png";
                verb.Act         = () => args.Target.Delete();
                args.Verbs.Add(verb);
            }

            // Rejuvenate verb
            if (_groupController.CanCommand(player, "rejuvenate"))
            {
                Verb verb = new();
                verb.Text        = Loc.GetString("rejuvenate-verb-get-data-text");
                verb.Category    = VerbCategory.Debug;
                verb.IconTexture = "/Textures/Interface/VerbIcons/rejuvenate.svg.192dpi.png";
                verb.Act         = () => RejuvenateCommand.PerformRejuvenate(args.Target);
                args.Verbs.Add(verb);
            }

            // Control mob verb
            if (_groupController.CanCommand(player, "controlmob") &&
                args.User != args.Target &&
                args.User.HasComponent <MindComponent>() &&
                args.Target.TryGetComponent <MindComponent>(out var targetMind))
            {
                Verb verb = new();
                verb.Text     = Loc.GetString("control-mob-verb-get-data-text");
                verb.Category = VerbCategory.Debug;
                // TODO VERB ICON control mob icon
                verb.Act = () =>
                {
                    targetMind.Mind?.TransferTo(null);
                    player.ContentData()?.Mind?.TransferTo(args.Target, ghostCheckOverride: true);
                };
                args.Verbs.Add(verb);
            }

            // Make Sentient verb
            if (_groupController.CanCommand(player, "makesentient") &&
                args.User != args.Target &&
                !args.Target.HasComponent <MindComponent>())
            {
                Verb verb = new();
                verb.Text        = Loc.GetString("make-sentient-verb-get-data-text");
                verb.Category    = VerbCategory.Debug;
                verb.IconTexture = "/Textures/Interface/VerbIcons/sentient.svg.192dpi.png";
                verb.Act         = () => MakeSentientCommand.MakeSentient(args.Target);
                args.Verbs.Add(verb);
            }

            if (_adminManager.HasAdminFlag(player, AdminFlags.Fun))
            {
                Verb verb = new();
                verb.Text     = Loc.GetString("explode-verb-get-data-text");
                verb.Category = VerbCategory.Debug;
                verb.Act      = () =>
                {
                    var coords = args.Target.Transform.Coordinates;
                    Timer.Spawn(_gameTiming.TickPeriod, () => ExplosionHelper.SpawnExplosion(coords, 0, 1, 2, 1), CancellationToken.None);
                    if (args.Target.TryGetComponent(out SharedBodyComponent? body))
                    {
                        body.Gib();
                    }
                };
                args.Verbs.Add(verb);
            }

            // Set clothing verb
            if (_groupController.CanCommand(player, "setoutfit") &&
                args.Target.HasComponent <InventoryComponent>())
            {
                Verb verb = new();
                verb.Text        = Loc.GetString("set-outfit-verb-get-data-text");
                verb.Category    = VerbCategory.Debug;
                verb.IconTexture = "/Textures/Interface/VerbIcons/outfit.svg.192dpi.png";
                verb.Act         = () => _euiManager.OpenEui(new SetOutfitEui(args.Target), player);
                args.Verbs.Add(verb);
            }

            // In range unoccluded verb
            if (_groupController.CanCommand(player, "inrangeunoccluded"))
            {
                Verb verb = new();
                verb.Text        = Loc.GetString("in-range-unoccluded-verb-get-data-text");
                verb.Category    = VerbCategory.Debug;
                verb.IconTexture = "/Textures/Interface/VerbIcons/information.svg.192dpi.png";
                verb.Act         = () =>
                {
                    var message = args.User.InRangeUnOccluded(args.Target)
                    ? Loc.GetString("in-range-unoccluded-verb-on-activate-not-occluded")
                    : Loc.GetString("in-range-unoccluded-verb-on-activate-occluded");
                    args.Target.PopupMessage(args.User, message);
                };
                args.Verbs.Add(verb);
            }

            // Get Disposal tube direction verb
            if (_groupController.CanCommand(player, "tubeconnections") &&
                args.Target.TryGetComponent <IDisposalTubeComponent>(out var tube))
            {
                Verb verb = new();
                verb.Text        = Loc.GetString("tube-direction-verb-get-data-text");
                verb.Category    = VerbCategory.Debug;
                verb.IconTexture = "/Textures/Interface/VerbIcons/information.svg.192dpi.png";
                verb.Act         = () => tube.PopupDirections(args.User);
                args.Verbs.Add(verb);
            }

            // Make ghost role verb
            if (_groupController.CanCommand(player, "makeghostrole") &&
                !(args.Target.GetComponentOrNull <MindComponent>()?.HasMind ?? false))
            {
                Verb verb = new();
                verb.Text     = Loc.GetString("make-ghost-role-verb-get-data-text");
                verb.Category = VerbCategory.Debug;
                // TODO VERB ICON add ghost icon
                // Where is the national park service icon for haunted forests?
                verb.Act = () => _ghostRoleSystem.OpenMakeGhostRoleEui(player, args.Target.Uid);
                args.Verbs.Add(verb);
            }

            // Configuration verb. Is this even used for anything!?
            if (_groupController.CanAdminMenu(player) &&
                args.Target.TryGetComponent <ConfigurationComponent>(out var config))
            {
                Verb verb = new();
                verb.Text        = Loc.GetString("configure-verb-get-data-text");
                verb.IconTexture = "/Textures/Interface/VerbIcons/settings.svg.192dpi.png";
                verb.Category    = VerbCategory.Debug;
                verb.Act         = () => config.OpenUserInterface(actor);
                args.Verbs.Add(verb);
            }

            // Add reagent verb
            if (_adminManager.HasAdminFlag(player, AdminFlags.Fun) &&
                args.Target.HasComponent <SolutionContainerManagerComponent>())
            {
                Verb verb = new();
                verb.Text        = Loc.GetString("admin-add-reagent-verb-get-data-text");
                verb.Category    = VerbCategory.Debug;
                verb.IconTexture = "/Textures/Interface/VerbIcons/spill.svg.192dpi.png";
                verb.Act         = () => _euiManager.OpenEui(new AdminAddReagentEui(args.Target), player);

                // TODO CHEMISTRY
                // Add reagent ui broke after solution refactor. Needs fixing
                verb.Disabled = true;
                verb.Tooltip  = "Currently non functional after solution refactor.";
                verb.Priority = -2;

                args.Verbs.Add(verb);
            }
        }
    }
        /// <summary>
        /// Polymorphs the target entity into the specific polymorph prototype
        /// </summary>
        /// <param name="target">The entity that will be transformed</param>
        /// <param name="proto">The polymorph prototype</param>
        public EntityUid?PolymorphEntity(EntityUid target, PolymorphPrototype proto)
        {
            /// This is the big papa function. This handles the transformation, moving the old entity
            /// logic and conditions specified in the prototype, and everything else that may be needed.
            /// I am clinically insane - emo

            // mostly just for vehicles
            if (TryComp <BuckleComponent>(target, out var buckle))
            {
                buckle.TryUnbuckle(target, true);
            }

            var targetTransformComp = Transform(target);

            var child = Spawn(proto.Entity, targetTransformComp.Coordinates);

            MakeSentientCommand.MakeSentient(child, EntityManager);

            var comp = EnsureComp <PolymorphedEntityComponent>(child);

            comp.Parent    = target;
            comp.Prototype = proto;
            RaiseLocalEvent(child, new PolymorphComponentSetupEvent(), true);

            var childXform = Transform(child);

            childXform.LocalRotation = targetTransformComp.LocalRotation;

            if (_container.TryGetContainingContainer(target, out var cont))
            {
                cont.Insert(child);
            }

            //Transfers all damage from the original to the new one
            if (proto.TransferDamage &&
                TryComp <DamageableComponent>(child, out var damageParent) &&
                _damageable.GetScaledDamage(target, child, out var damage) &&
                damage != null)
            {
                _damageable.SetDamage(damageParent, damage);
            }

            if (proto.Inventory == PolymorphInventoryChange.Transfer)
            {
                _inventory.TransferEntityInventories(target, child);
                foreach (var hand in _sharedHands.EnumerateHeld(target))
                {
                    hand.TryRemoveFromContainer();
                    _sharedHands.TryPickupAnyHand(child, hand);
                }
            }
            else if (proto.Inventory == PolymorphInventoryChange.Drop)
            {
                if (_inventory.TryGetContainerSlotEnumerator(target, out var enumerator))
                {
                    while (enumerator.MoveNext(out var slot))
                    {
                        slot.EmptyContainer();
                    }
                }

                foreach (var hand in _sharedHands.EnumerateHeld(target))
                {
                    hand.TryRemoveFromContainer();
                }
            }

            if (proto.TransferName &&
                TryComp <MetaDataComponent>(target, out var targetMeta) &&
                TryComp <MetaDataComponent>(child, out var childMeta))
            {
                childMeta.EntityName = targetMeta.EntityName;
            }

            if (proto.TransferHumanoidAppearance &&
                TryComp <HumanoidAppearanceComponent>(target, out var targetHuApp) &&
                TryComp <HumanoidAppearanceComponent>(child, out var childHuApp))
            {
                _sharedHuApp.UpdateAppearance(child, targetHuApp.Appearance);
                _sharedHuApp.ForceAppearanceUpdate(child);
            }

            if (TryComp <MindComponent>(target, out var mind) && mind.Mind != null)
            {
                mind.Mind.TransferTo(child);
            }

            //Ensures a map to banish the entity to
            EnsurePausesdMap();
            if (PausedMap != null)
            {
                targetTransformComp.AttachParent(Transform(PausedMap.Value));
            }

            return(child);
        }