Prototype-ize Mind (#41384)
* Use MindBase prototype for mind creation * Create mind.yml * Add ContainerContainer
This commit is contained in:
@@ -20,6 +20,7 @@ using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -43,6 +44,8 @@ public abstract partial class SharedMindSystem : EntitySystem
|
||||
|
||||
private HashSet<Entity<MindComponent>> _pickingMinds = new();
|
||||
|
||||
private readonly EntProtoId _mindProto = "MindBase";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -226,7 +229,7 @@ public abstract partial class SharedMindSystem : EntitySystem
|
||||
|
||||
public Entity<MindComponent> CreateMind(NetUserId? userId, string? name = null)
|
||||
{
|
||||
var mindId = Spawn(null, MapCoordinates.Nullspace);
|
||||
var mindId = Spawn(_mindProto, MapCoordinates.Nullspace);
|
||||
_metadata.SetEntityName(mindId, name == null ? "mind" : $"mind ({name})");
|
||||
var mind = EnsureComp<MindComponent>(mindId);
|
||||
mind.CharacterName = name;
|
||||
|
||||
10
Resources/Prototypes/Entities/Virtual/mind.yml
Normal file
10
Resources/Prototypes/Entities/Virtual/mind.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
- type: entity
|
||||
id: MindBase
|
||||
name: mind
|
||||
categories: [ HideSpawnMenu ]
|
||||
components:
|
||||
- type: Mind
|
||||
- type: ContainerContainer
|
||||
containers:
|
||||
mind_roles: !type:Container
|
||||
ents: []
|
||||
Reference in New Issue
Block a user