mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-06-09 13:26:34 +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.
52 lines
2.2 KiB
C#
52 lines
2.2 KiB
C#
using System.Linq;
|
|
using Content.IntegrationTests.Fixtures;
|
|
using Content.IntegrationTests.Utility;
|
|
using Content.Shared.Damage.Components;
|
|
using Content.Shared.FixedPoint;
|
|
|
|
namespace Content.IntegrationTests.Tests.Damageable;
|
|
|
|
public sealed class StaminaComponentTest : GameTest
|
|
{
|
|
private static string[] _entitiesWithStamina = GameDataScrounger.EntitiesWithComponent("Stamina");
|
|
|
|
[Test]
|
|
[TestOf(typeof(StaminaComponent))]
|
|
[TestCaseSource(nameof(_entitiesWithStamina))]
|
|
[Description("Ensures every entity with Stamina has a valid stamina configuration.")]
|
|
public async Task ValidateStamina(string protoKey)
|
|
{
|
|
var pair = Pair;
|
|
var server = pair.Server;
|
|
var protoMan = server.ProtoMan;
|
|
|
|
await server.WaitAssertion(() =>
|
|
{
|
|
using (Assert.EnterMultipleScope())
|
|
{
|
|
var proto = protoMan.Index(protoKey);
|
|
var comp = (StaminaComponent)proto.Components["Stamina"].Component;
|
|
|
|
Assert.That(comp.AnimationThreshold,
|
|
Is.LessThan(comp.CritThreshold),
|
|
$"Animation threshold on {proto.ID} must be less than its crit threshold.");
|
|
|
|
// TODO(Kaylie): "value is in range" serializer. Needs some serializationmanager improvements.
|
|
Assert.That(comp.Decay, Is.Positive.Or.Zero, "Negative decay results in nonsensical behavior.");
|
|
Assert.That(comp.Cooldown, Is.Positive.Or.Zero, "Negative cooldown results in nonsensical behavior");
|
|
Assert.That(comp.BaseCritThreshold, Is.Positive);
|
|
Assert.That(comp.CritThreshold, Is.Positive);
|
|
Assert.That(comp.AfterCritDecayMultiplier, Is.Positive);
|
|
Assert.That(comp.ForceStandStamina, Is.Positive);
|
|
|
|
// NUnit's analyzer is defective here. Cool.
|
|
#pragma warning disable NUnit2041
|
|
Assert.That(comp.StunModifierThresholds.Keys,
|
|
Has.All.GreaterThanOrEqualTo(FixedPoint2.Zero).And.LessThanOrEqualTo(FixedPoint2.New(1.0f)),
|
|
"The stun thresholds are percentages and should be in the [0, 1.0] range.");
|
|
#pragma warning restore NUnit2041
|
|
}
|
|
});
|
|
}
|
|
}
|