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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user