using Content.Shared.EntityEffects;
using Content.Shared.Physics;
using Content.Shared.Slippery;
using Content.Shared.StepTrigger.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Prototypes;
namespace Content.Server.EntityEffects.Effects;
///
/// Makes a mob slippery.
///
public sealed partial class Slipify : EntityEffect
{
public override void Effect(EntityEffectBaseArgs args)
{
var fixtureSystem = args.EntityManager.System();
var colWakeSystem = args.EntityManager.System();
var slippery = args.EntityManager.EnsureComponent(args.TargetEntity);
args.EntityManager.Dirty(args.TargetEntity, slippery);
args.EntityManager.EnsureComponent(args.TargetEntity);
// Need a fixture with a slip layer in order to actually do the slipping
var fixtures = args.EntityManager.EnsureComponent(args.TargetEntity);
var body = args.EntityManager.EnsureComponent(args.TargetEntity);
var shape = fixtures.Fixtures["fix1"].Shape;
fixtureSystem.TryCreateFixture(args.TargetEntity, shape, "slips", 1, false, (int)CollisionGroup.SlipLayer, manager: fixtures, body: body);
// Need to disable collision wake so that mobs can collide with and slip on it
var collisionWake = args.EntityManager.EnsureComponent(args.TargetEntity);
colWakeSystem.SetEnabled(args.TargetEntity, false, collisionWake);
}
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{
throw new NotImplementedException();
}
}