Add attach to self, grid and grandparent debug verbs (#2395)
* Add parenttoself, attachtogrid and attachtograndparent verbs * Remove body system changes * Name consistency
This commit is contained in:
55
Content.Server/GlobalVerbs/AttachToGrandparentVerb.cs
Normal file
55
Content.Server/GlobalVerbs/AttachToGrandparentVerb.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Content.Shared.GameObjects.Verbs;
|
||||
using Content.Shared.Utility;
|
||||
using Robust.Server.Console;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Server.GlobalVerbs
|
||||
{
|
||||
[GlobalVerb]
|
||||
public class AttachToGrandparentVerb : GlobalVerb
|
||||
{
|
||||
public override void GetData(IEntity user, IEntity target, VerbData data)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
|
||||
if (user == target)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.TryGetComponent(out IActorComponent actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.playerSession, "attachtograndparent"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
data.Text = Loc.GetString("Attach to grid");
|
||||
data.CategoryData = VerbCategories.Debug;
|
||||
}
|
||||
|
||||
public override void Activate(IEntity user, IEntity target)
|
||||
{
|
||||
if (!user.TryGetComponent(out IActorComponent actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.playerSession, "attachtograndparent"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
target.Transform.AttachToGrandparent();
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Content.Server/GlobalVerbs/AttachToGridVerb.cs
Normal file
54
Content.Server/GlobalVerbs/AttachToGridVerb.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Content.Shared.GameObjects.Verbs;
|
||||
using Robust.Server.Console;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Server.GlobalVerbs
|
||||
{
|
||||
[GlobalVerb]
|
||||
public class AttachToGridVerb : GlobalVerb
|
||||
{
|
||||
public override void GetData(IEntity user, IEntity target, VerbData data)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
|
||||
if (user == target)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.TryGetComponent(out IActorComponent actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.playerSession, "attachtogrid"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
data.Text = Loc.GetString("Attach to grid");
|
||||
data.CategoryData = VerbCategories.Debug;
|
||||
}
|
||||
|
||||
public override void Activate(IEntity user, IEntity target)
|
||||
{
|
||||
if (!user.TryGetComponent(out IActorComponent actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.playerSession, "attachtogrid"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
target.Transform.AttachToGridOrMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Content.Server/GlobalVerbs/AttachToSelf.cs
Normal file
54
Content.Server/GlobalVerbs/AttachToSelf.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Content.Shared.GameObjects.Verbs;
|
||||
using Robust.Server.Console;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Server.GlobalVerbs
|
||||
{
|
||||
[GlobalVerb]
|
||||
public class AttachToSelf : GlobalVerb
|
||||
{
|
||||
public override void GetData(IEntity user, IEntity target, VerbData data)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
|
||||
if (user == target)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.TryGetComponent(out IActorComponent actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.playerSession, "attachtoself"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
data.Text = Loc.GetString("Attach to self");
|
||||
data.CategoryData = VerbCategories.Debug;
|
||||
}
|
||||
|
||||
public override void Activate(IEntity user, IEntity target)
|
||||
{
|
||||
if (!user.TryGetComponent(out IActorComponent actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
if (!groupController.CanCommand(actor.playerSession, "attachtoself"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
target.Transform.AttachParent(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,9 @@
|
||||
- hurt
|
||||
- toggledisallowlatejoin
|
||||
- attachbodypart
|
||||
- attachtoself
|
||||
- attachtogrid
|
||||
- attachtograndparent
|
||||
CanViewVar: true
|
||||
CanAdminPlace: true
|
||||
CanAdminMenu: true
|
||||
@@ -213,6 +216,9 @@
|
||||
- hurt
|
||||
- toggledisallowlatejoin
|
||||
- attachbodypart
|
||||
- attachtoself
|
||||
- attachtogrid
|
||||
- attachtograndparent
|
||||
CanViewVar: true
|
||||
CanAdminPlace: true
|
||||
CanScript: true
|
||||
|
||||
Reference in New Issue
Block a user