mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-06-09 10:06:49 +02:00
d42adbf05d
* Pass 1. * i'm FREE * Prevent hangups. * okay fine here's an attribute for settings, will polish later and prolly remove the overridable thing. * sigh. * fix singular trigger bug so LatheTest doesn't flake. * Remove SystemAttribute usage. * Poke * I used the shotgun. You know why? Cause the shot gun doesn’t miss, and unlike the shitty hybrid taser it stops a criminal in their tracks in two hits. Bang, bang, and they’re fucking done. I use four shots just to make damn sure. Because, once again, I’m not there to coddle a buncha criminal scum sucking f------, I’m there to 1) Survive the fucking round. 2) Guard the armory. So you can absolutely get fucked. If I get unbanned, which I won’t, you can guarantee I will continue to use the shotgun to apprehend criminals. Because it’s quick, clean and effective as fuck. Why in the seven hells would I fuck around with the disabler shots, which take half a clip just to bring someone down, or with the tazer bolts which are slow as balls, impossible to aim and do about next to jack shit, fuck all. The shotgun is the superior law enforcement weapon. Because it stops crime. And it stops crime by reducing the number of criminals roaming the fucking halls. * Change the faulty store test into two tests, one of which is ignored for failing.
105 lines
3.8 KiB
C#
105 lines
3.8 KiB
C#
using Content.Shared.Buckle;
|
|
using Content.Shared.Buckle.Components;
|
|
using Content.Shared.Interaction;
|
|
using Robust.Server.GameObjects;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Map;
|
|
|
|
namespace Content.IntegrationTests.Tests.Buckle;
|
|
|
|
public sealed partial class BuckleTest
|
|
{
|
|
[Test]
|
|
public async Task BuckleInteractUnbuckleOther()
|
|
{
|
|
var pair = Pair;
|
|
var server = pair.Server;
|
|
|
|
var entMan = server.ResolveDependency<IServerEntityManager>();
|
|
var buckleSystem = entMan.System<SharedBuckleSystem>();
|
|
|
|
EntityUid user = default;
|
|
EntityUid victim = default;
|
|
EntityUid chair = default;
|
|
BuckleComponent buckle = null;
|
|
StrapComponent strap = null;
|
|
|
|
await server.WaitAssertion(() =>
|
|
{
|
|
user = entMan.SpawnEntity(BuckleDummyId, MapCoordinates.Nullspace);
|
|
victim = entMan.SpawnEntity(BuckleDummyId, MapCoordinates.Nullspace);
|
|
chair = entMan.SpawnEntity(StrapDummyId, MapCoordinates.Nullspace);
|
|
|
|
Assert.That(entMan.TryGetComponent(victim, out buckle));
|
|
Assert.That(entMan.TryGetComponent(chair, out strap));
|
|
|
|
#pragma warning disable RA0002
|
|
buckle.Delay = TimeSpan.Zero;
|
|
#pragma warning restore RA0002
|
|
|
|
// Buckle victim to chair
|
|
Assert.That(buckleSystem.TryBuckle(victim, user, chair, buckle));
|
|
Assert.Multiple(() =>
|
|
{
|
|
Assert.That(buckle.BuckledTo, Is.EqualTo(chair), "Victim did not get buckled to the chair.");
|
|
Assert.That(buckle.Buckled, "Victim is not buckled.");
|
|
Assert.That(strap.BuckledEntities, Does.Contain(victim), "Chair does not have victim buckled to it.");
|
|
});
|
|
|
|
// InteractHand with chair to unbuckle victim
|
|
entMan.EventBus.RaiseLocalEvent(chair, new InteractHandEvent(user, chair));
|
|
Assert.Multiple(() =>
|
|
{
|
|
Assert.That(buckle.BuckledTo, Is.Null);
|
|
Assert.That(buckle.Buckled, Is.False);
|
|
Assert.That(strap.BuckledEntities, Does.Not.Contain(victim));
|
|
});
|
|
});
|
|
}
|
|
|
|
[Test]
|
|
public async Task BuckleInteractBuckleUnbuckleSelf()
|
|
{
|
|
var pair = Pair;
|
|
var server = pair.Server;
|
|
|
|
var entMan = server.ResolveDependency<IServerEntityManager>();
|
|
|
|
EntityUid user = default;
|
|
EntityUid chair = default;
|
|
BuckleComponent buckle = null;
|
|
StrapComponent strap = null;
|
|
|
|
await server.WaitAssertion(() =>
|
|
{
|
|
user = entMan.SpawnEntity(BuckleDummyId, MapCoordinates.Nullspace);
|
|
chair = entMan.SpawnEntity(StrapDummyId, MapCoordinates.Nullspace);
|
|
|
|
Assert.That(entMan.TryGetComponent(user, out buckle));
|
|
Assert.That(entMan.TryGetComponent(chair, out strap));
|
|
|
|
#pragma warning disable RA0002
|
|
buckle.Delay = TimeSpan.Zero;
|
|
#pragma warning restore RA0002
|
|
|
|
// Buckle user to chair
|
|
entMan.EventBus.RaiseLocalEvent(chair, new InteractHandEvent(user, chair));
|
|
Assert.Multiple(() =>
|
|
{
|
|
Assert.That(buckle.BuckledTo, Is.EqualTo(chair), "Victim did not get buckled to the chair.");
|
|
Assert.That(buckle.Buckled, "Victim is not buckled.");
|
|
Assert.That(strap.BuckledEntities, Does.Contain(user), "Chair does not have victim buckled to it.");
|
|
});
|
|
|
|
// InteractHand with chair to unbuckle
|
|
entMan.EventBus.RaiseLocalEvent(chair, new InteractHandEvent(user, chair));
|
|
Assert.Multiple(() =>
|
|
{
|
|
Assert.That(buckle.BuckledTo, Is.Null);
|
|
Assert.That(buckle.Buckled, Is.False);
|
|
Assert.That(strap.BuckledEntities, Does.Not.Contain(user));
|
|
});
|
|
});
|
|
}
|
|
}
|