Add puller sanity test (#24885)

* Add puller sanity test

* weh

* NRTs
This commit is contained in:
metalgearsloth
2024-02-03 12:51:05 +11:00
committed by GitHub
parent 7e97d540b7
commit 641fb665b7
2 changed files with 48 additions and 24 deletions

View File

@@ -0,0 +1,45 @@
using Content.Shared.Hands.Components;
using Content.Shared.Prototypes;
using Content.Shared.Pulling.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
namespace Content.IntegrationTests.Tests.Puller;
#nullable enable
[TestFixture]
public sealed class PullerTest
{
/// <summary>
/// Checks that needsHands on PullerComponent is not set on mobs that don't even have hands.
/// </summary>
[Test]
public async Task PullerSanityTest()
{
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var compFactory = server.ResolveDependency<IComponentFactory>();
var protoManager = server.ResolveDependency<IPrototypeManager>();
await server.WaitAssertion(() =>
{
Assert.Multiple(() =>
{
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
{
if (!proto.TryGetComponent(out SharedPullerComponent? puller))
continue;
if (!puller.NeedsHands)
continue;
Assert.That(proto.HasComponent<HandsComponent>(compFactory), $"Found puller {proto} with NeedsHand pulling but has no hands?");
}
});
});
await pair.CleanReturnAsync();
}
}

View File

@@ -58,8 +58,6 @@
damage:
types:
Piercing: 5
- type: Puller
needsHands: true
- type: Tag
tags:
- VimPilot
@@ -122,8 +120,6 @@
- type: HTN
rootTask:
task: SimpleHostileCompound
- type: Puller
needsHands: true
- type: ZombieImmune
- type: entity
@@ -229,12 +225,10 @@
accent: chicken
- type: SentienceTarget
flavorKind: station-event-random-sentience-flavor-organic
- type: Puller
needsHands: true
- type: NpcFactionMember
factions:
- Passive
- type: entity
parent: MobChicken
id: MobChicken1
@@ -259,7 +253,7 @@
Base: dead-1
Dead:
Base: dead-1
- type: entity
parent: MobChicken
id: MobChicken2
@@ -524,8 +518,6 @@
prototype: Mothroach
- type: TypingIndicator
proto: moth
- type: Puller
needsHands: true
- type: Destructible
thresholds:
- trigger:
@@ -701,8 +693,6 @@
bloodMaxVolume: 0.1
- type: MobPrice
price: 50
- type: Puller
needsHands: true
- type: entity
name: cow
@@ -985,7 +975,6 @@
path: /Audio/Animals/goose_honk.ogg
- type: Bloodstream
bloodMaxVolume: 100
- type: Puller
- type: NpcFactionMember
factions:
- Passive
@@ -1042,7 +1031,6 @@
- type: HTN
rootTask:
task: SimpleHostileCompound
- type: Puller
- type: entity
name: kangaroo
@@ -1301,7 +1289,7 @@
- type: GhostTakeoverAvailable
- type: Loadout
prototypes: [SyndicateOperativeGearMonkey]
- type: entity
id: MobMonkeySyndicateAgent
parent: MobBaseSyndicateMonkey
@@ -1589,8 +1577,6 @@
- type: CanEscapeInventory
- type: MobPrice
price: 50
- type: Puller
needsHands: true
- type: BadFood
- type: NonSpreaderZombie
- type: PreventSpiller
@@ -1723,8 +1709,6 @@
- type: Damageable
damageContainer: Biological
damageModifierSet: Scale
- type: Puller
needsHands: true
- type: Tag
tags:
- VimPilot
@@ -1828,8 +1812,6 @@
path: /Audio/Animals/frog_ribbit.ogg
- type: Bloodstream
bloodMaxVolume: 50
- type: Puller
needsHands: true
- type: Tag
tags:
- VimPilot
@@ -2054,8 +2036,6 @@
- type: Damageable
damageContainer: Biological
damageModifierSet: Scale
- type: Puller
needsHands: true
# Code unique spider prototypes or combine them all into one spider and get a
# random sprite state when you spawn it.
@@ -2499,7 +2479,6 @@
gender: epicene
- type: SentienceTarget
flavorKind: station-event-random-sentience-flavor-corgi
- type: Puller
- type: MobPrice
price: 200
- type: Tag