Localize makesentient command. Move makesentient method to mind system. (#38565)

* praying pjb doesn't smite me for this 🙏

* requested changes

* Update makesentient-command.ftl

* verin commith and verin taketh away
This commit is contained in:
Kyle Tyo
2025-07-23 08:29:46 -04:00
committed by GitHub
parent eb21b5826a
commit 83b3e9e15a
10 changed files with 60 additions and 69 deletions

View File

@@ -2,15 +2,19 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.Administration.Logs;
using Content.Shared.Database;
using Content.Shared.Emoting;
using Content.Shared.Examine;
using Content.Shared.GameTicking;
using Content.Shared.Humanoid;
using Content.Shared.Interaction.Events;
using Content.Shared.Movement.Components;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Objectives.Systems;
using Content.Shared.Players;
using Content.Shared.Speech;
using Content.Shared.Whitelist;
using Robust.Shared.Map;
using Robust.Shared.Network;
@@ -632,6 +636,31 @@ public abstract partial class SharedMindSystem : EntitySystem
return allHumans;
}
/// <summary>
/// Give sentience to a target entity by attaching necessary components.
/// </summary>
/// <param name="uid">Uid of the target entity.</param>
/// <param name="allowMovement">Whether the target entity should be able to move.</param>
/// <param name="allowSpeech">Whether the target entity should be able to talk.</param>
public void MakeSentient(EntityUid uid, bool allowMovement = true, bool allowSpeech = true)
{
EnsureComp<MindContainerComponent>(uid);
if (allowMovement)
{
EnsureComp<InputMoverComponent>(uid);
EnsureComp<MobMoverComponent>(uid);
EnsureComp<MovementSpeedModifierComponent>(uid);
}
if (allowSpeech)
{
EnsureComp<SpeechComponent>(uid);
EnsureComp<EmotingComponent>(uid);
}
EnsureComp<ExaminerComponent>(uid);
}
}
/// <summary>